Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated API + Development environment setup #114

Open
wants to merge 42 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
20dfad8
Initial version
Coenego Apr 22, 2013
089bc5b
Added new pages + changed navigation structure
Coenego Apr 23, 2013
5b83358
Added new pages + changed navigation structure
Coenego Apr 23, 2013
93add75
Added markdown parser
Coenego Apr 23, 2013
620cd6a
Update SDK/development-environment-setup
Coenego Apr 23, 2013
840d7b1
SDKController update
Coenego Apr 23, 2013
e93ab12
Added OAE Modules to API
Coenego Apr 24, 2013
3649032
Integrated /docs in API
Coenego Apr 24, 2013
43f8a4c
Integrated /docs in API
Coenego Apr 24, 2013
eb2de96
Fix in sdk_controller
Coenego Apr 24, 2013
0ea9b59
Added partial for modules navigation
Coenego Apr 25, 2013
eab4551
Merged the api overview and detailview
Coenego Apr 25, 2013
780047b
Created partials for modulenavigation and moduledetail
Coenego Apr 25, 2013
90e3c24
Updated API
Coenego Apr 25, 2013
9f399e0
Added frontend docs + changed endpoints to newer ones
Coenego Apr 25, 2013
4f1b6fd
Fixed the not updating when a module is selected in the api docs
Coenego Apr 26, 2013
4d11c9d
CSS update for API
Coenego Apr 26, 2013
aaaa1cd
Updated CSS
Coenego Apr 26, 2013
24cbf21
Deleted unnecessary controller
Coenego Apr 26, 2013
f3ada3e
Cleanup code
Coenego Apr 26, 2013
151b3a5
Basic CSS-file parsing
Coenego Apr 29, 2013
1b4c40f
Created subfolder for API
Coenego Apr 29, 2013
90ac2fa
Integrated parsing CSS-files
Coenego Apr 29, 2013
fd7edfb
Added CSS parsing
Coenego Apr 29, 2013
2b1d704
SDKController update
Coenego Apr 29, 2013
4802b16
Added partial for rendering categories
Coenego Apr 30, 2013
d8dbb16
CSS update for reusable-css section
Coenego Apr 30, 2013
ee34856
CSS update for reusable-css section
Coenego Apr 30, 2013
9d537d8
Created example files for the style-guide
Coenego Apr 30, 2013
b09c73b
Modified examples
Coenego May 1, 2013
b74b6b4
Modified examples
Coenego May 1, 2013
37ffcec
Modified examples
Coenego May 1, 2013
82562c5
Style-guide update
Coenego May 1, 2013
e4c207c
Latest
Coenego May 1, 2013
e5ed157
Latest
Coenego May 1, 2013
2b2a56e
Added Ruby script for parsing CSS files and create HTML docs
Coenego May 2, 2013
918aafc
Latest
Coenego May 7, 2013
e3eef52
Latest
Coenego May 7, 2013
40ab296
Latest
Coenego May 7, 2013
49c375f
Dynamic folders for each skin version
Coenego May 7, 2013
9500cf9
Latest
Coenego May 7, 2013
5e694eb
Latest
Coenego May 7, 2013
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.idea
npm-debug.log
.bundle
db/*.sqlite3
log/*.log
Expand Down
9 changes: 9 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,18 @@ gem 'devise', '~> 1.5.3'
# Use CanCan for user authorization
gem 'cancan'

# Use for decode json strings to object
gem 'yajl-ruby'

#Use Markdown for parsing Markdown files
gem 'markdown'

# Use reCAPTCHA
gem "recaptcha", :require => "recaptcha/rails"

# Use Redcarpet for parsing Markdown files
gem 'redcarpet'

# handle ajax image uploads
gem 'remotipart'

Expand Down
14 changes: 14 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,13 @@ GEM
railties (>= 3.2.0, < 5.0)
thor (~> 0.14)
json (1.7.4)
kramdown (1.0.1)
libv8 (3.3.10.4)
libwebsocket (0.1.5)
addressable
linecache19 (0.5.13)
ruby_core_source (>= 0.1.4)
logutils (0.6.0)
mail (2.4.4)
i18n (>= 0.4.0)
mime-types (~> 1.16)
Expand All @@ -120,6 +122,10 @@ GEM
skinny (~> 0.2, >= 0.2.1)
sqlite3 (~> 1.3)
thin (~> 1.2)
markdown (1.0.0)
kramdown (>= 0.13.7)
props (>= 1.0.0)
textutils (>= 0.2.0)
mime-types (1.19)
multi_json (1.3.6)
mysql2 (0.3.11)
Expand All @@ -140,6 +146,7 @@ GEM
mime-types
polyglot (0.3.3)
populator (1.0.0)
props (1.0.0)
rack (1.4.1)
rack-cache (1.2)
rack (>= 0.4)
Expand Down Expand Up @@ -170,6 +177,7 @@ GEM
rdoc (3.12)
json (~> 1.4)
recaptcha (0.3.4)
redcarpet (2.2.2)
remotipart (1.0.2)
ruby-debug-base19 (0.11.26)
columnize (>= 0.3.1)
Expand Down Expand Up @@ -210,6 +218,8 @@ GEM
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sqlite3 (1.3.6)
textutils (0.5.3)
logutils (~> 0.5)
therubyracer (0.10.1)
libv8 (~> 3.3.10)
thin (1.4.1)
Expand All @@ -233,6 +243,7 @@ GEM
will_paginate (3.0.3)
xpath (0.1.4)
nokogiri (~> 1.3)
yajl-ruby (1.1.0)
yui-compressor (0.9.6)
POpen4 (>= 0.1.4)

Expand All @@ -256,12 +267,14 @@ DEPENDENCIES
jquery-rails
linecache19 (= 0.5.13)
mailcatcher
markdown
mysql2
paperclip (~> 2.3)
populator
rails (= 3.2.6)
rails_autolink
recaptcha
redcarpet
remotipart
ruby-debug-base19 (= 0.11.26)
ruby-debug19 (= 0.11.6)
Expand All @@ -274,4 +287,5 @@ DEPENDENCIES
uglifier (>= 1.0.3)
whenever
will_paginate
yajl-ruby
yui-compressor
100 changes: 78 additions & 22 deletions app/assets/javascripts/sdk.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//= require sdk/widgetbuilder

$(function() {
$(function(){

// Disabling these for now
// var showVideoOverlay = function(){
Expand All @@ -16,7 +15,6 @@ $(function() {
// $("#videocontent_overlay").animate({opacity:'toggle'}, 300);
// });
// };

var TITLE_BASE = 'Sakai OAE Widget Library - SDK';
var History = window.History;
var $lhnav = $(".wl-content-container #lhnavigation_container ul");
Expand All @@ -30,22 +28,23 @@ $(function() {
var $parentElement = $toSelectElement.closest(".subnav");

// Check whether the element is a parent element or not
if($parentElement.length){
if ($parentElement.length){
// it is a child element
$toSelectElement.closest("li").addClass("selected");
$parentElement.show().prev().addClass("selected_parent");
} else {
} else{
$toSelectElement.closest("li").addClass("selected").next().show();
}
};

$(window).on('statechange', function() {
$(window).on('statechange',
function(){
var state = History.getState();
// Update the left hand navigation
updateLhnav(state);
$.ajax({
url: state.url,
success: function(data) {
success: function(data){
var $containerResponse = $("<div />").html(data);
var $sdkxhrContent = $containerResponse.find("#sdkxhr_content");
$(".wl-content-container .widgetsdk_container").html($sdkxhrContent);
Expand All @@ -58,59 +57,116 @@ $(function() {
});
});

var addClassesToMarkdownText = function(){
$('#development-environment-setup').find('ul').addClass('inline_list');
$('#development-environment-setup').find('ol').addClass('inline_list');
$('#development-environment-setup').find('a').addClass('wl-regular-link');
};

var addBinding = function(){
// $("#developer_videocontent_container").live("click", showVideoOverlay);
// $("#videocontent_overlay").live("click", hideVideoOverlay);
$(".expand_all_link").live("click", function(){
$(".expand_all_link").live("click",
function(){
var expanded = $(".expand_all_link").attr("data-expanded");
if(expanded === "true"){
if (expanded === "true"){
$(".expand_all_link").attr("data-expanded", "false");
}else{
} else{
$(".expand_all_link").attr("data-expanded", "true");
}
$(this).children("span").toggle();
$.each($(".expandable_container"), function(i, container){
$.each($(".expandable_container"),
function(i, container){
container = $(container);
if(container.is(":visible") && expanded === "true"){
container.animate({'height': 'toggle', 'opacity': 'toggle'}, 500);
if (container.is(":visible") && expanded === "true"){
container.animate({
'height': 'toggle',
'opacity': 'toggle'
},
500);
container.prevAll("h3").children("a").attr("data-expanded", false);
container.prevAll("h3").find("span").toggle();
} else if(!container.is(":visible") && expanded !== "true"){
container.animate({'height': 'toggle', 'opacity': 'toggle'}, 500);
} else if (!container.is(":visible") && expanded !== "true"){
container.animate({
'height': 'toggle',
'opacity': 'toggle'
},
500);
container.prevAll("h3").children("a").attr("data-expanded", true);
container.prevAll("h3").find("span").toggle();
}
});
});

$(".expand_link").live("click", function(){
$(".expand_link").live("click",
function(){
$(this).children("span").toggle();
var $container = $(this).parents(".wl-widget-item").children(".expandable_container");
if ($container.is(":visible")){
$container.prevAll("h3").children("a").attr("data-expanded", false);
$container.animate({'height': 'toggle'}, 500);
} else {
$container.animate({
'height': 'toggle'
},
500);
} else{
$container.prevAll("h3").children("a").attr("data-expanded", true);
$container.animate({'height': 'toggle'}, 500);
$container.animate({
'height': 'toggle'
},
500);
}
});

$("body").on("click", '#lhnavigation_container a, .wl-content-container .wl-content-right-container a[href^="/sdk/"]', function(evt){
$("body").on("click", '#lhnavigation_container a, .wl-content-container .wl-content-right-container a[href^="/sdk/"]',
function(evt){
// Disable the default click behavior
evt.preventDefault();
// evt.preventDefault();
// Cache the this selector
var $this = $(this);
var url = $this.attr("href");
var title = TITLE_BASE + ' - ' + $this.text();
var state = {
section: url
};
};d
History.pushState(state, title, url);
});

$('#reusable-css').find('.wl-widget-item h3').bind('click', function(e){
$(e.currentTarget).next().slideToggle();
return false;
})

$('#dpdVersions').change(function(e){
var version = $(e.currentTarget).val();
document.location = "/sdk/style-guide/reusable-css/" + version
})
};

var hideCSSContentContainers = function(){
$('#reusable-css').find('.wl-widget-item .css-content').hide();
};

var showFirstCSSContentContainer = function(){
$('#reusable-css').find('.wl-widget-item .css-content').first().show();
};

var splitCodeTagsOnLinebreaks = function(){
var arrParagraphs = $("#development-environment-setup").find('p');
$.each(arrParagraphs,
function(i){
if (arrParagraphs[i].firstChild.tagName == "CODE"){
var child = $(arrParagraphs[i]).find('code');
$(child).addClass('well');
$(child).html($(child).html().replace(/\n/g, '<br />'));
}
})
};

var init = function(){
splitCodeTagsOnLinebreaks();
hideCSSContentContainers();
showFirstCSSContentContainer();
addClassesToMarkdownText();
addBinding();
};

Expand Down
16 changes: 16 additions & 0 deletions app/assets/stylesheets/application.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ option {
margin-right: 15px;
}

.wl-margin-top-0 {
margin-top: 0 !important;
}

.wl-margin-top-9 {
margin-top: 9px;
}
Expand Down Expand Up @@ -174,14 +178,26 @@ option {
width: 145px;
}

.wl-content-160 {
width: 160px;
}

.wl-content-165 {
width: 165px;
}

.wl-content-175 {
width: 175px;
}

.wl-content-185 {
width: 185px;
}

.wl-content-505 {
width: 505px;
}

.wl-content-710 {
width: 710px;
}
Expand Down
Loading