Skip to content

Commit

Permalink
Add up-to-date hello world widget and widget skeleton framework, upda…
Browse files Browse the repository at this point in the history
…te to Apereo OAE branding, add validation to widget builder, update jQuery to 2.0.2, various other fixes
  • Loading branch information
bertpareyn committed Jun 13, 2013
1 parent 7f3d06c commit 1d08f23
Show file tree
Hide file tree
Showing 66 changed files with 10,491 additions and 3,776 deletions.
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ source :rubygems
gem 'rails', '3.2.13'

# Use jQuery instead of Prototype
gem 'jquery-rails'
gem 'jquery-ui-rails'

# Use Paperclip for image dependency management
Expand Down
1 change: 0 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ DEPENDENCIES
ffaker
flexmock
guid
jquery-rails
jquery-ui-rails
mailcatcher
mysql2
Expand Down
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Sakai OAE Widget Library and SDK
Apereo OAE Widget Library and SDK
5 changes: 3 additions & 2 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
//= require jquery
//= require jquery_ujs
//= require jquery-2.0.2
//= require jquery.ui.all
//= require jquery.remotipart
//= require jquery.autoellipsis
//= require jquery.validate
//= require jquery.history
//= require modernizr
//= require_self
//= require core/navigation
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/browse.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$(function() {

var TITLE_BASE = 'Sakai OAE Widget Library - Browse';
var TITLE_BASE = 'Apereo OAE Widget Library - Browse';
var DEFAULT_SORT = 'average_rating';
var DEFAULT_DIR = 'desc';

Expand Down
8 changes: 3 additions & 5 deletions app/assets/javascripts/sdk.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ $(function() {
// });
// };

var TITLE_BASE = 'Sakai OAE Widget Library - SDK';
var TITLE_BASE = 'Apereo OAE Widget Library - SDK';
var History = window.History;
var $lhnav = $(".wl-content-container #lhnavigation_container ul");

Expand Down Expand Up @@ -59,9 +59,7 @@ $(function() {
});

var addBinding = function(){
// $("#developer_videocontent_container").live("click", showVideoOverlay);
// $("#videocontent_overlay").live("click", hideVideoOverlay);
$(".expand_all_link").live("click", function(){
$(".expand_all_link").on("click", function(){
var expanded = $(".expand_all_link").attr("data-expanded");
if(expanded === "true"){
$(".expand_all_link").attr("data-expanded", "false");
Expand All @@ -83,7 +81,7 @@ $(function() {
});
});

$(".expand_link").live("click", function(){
$(".expand_link").on("click", function(){
$(this).children("span").toggle();
var $container = $(this).parents(".wl-widget-item").children(".expandable_container");
if ($container.is(":visible")){
Expand Down
72 changes: 5 additions & 67 deletions app/assets/javascripts/sdk/widgetbuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,83 +3,21 @@ $(function() {
///////////////
// VARIABLES //
///////////////
var createWidgetButton = "#widgetbuilder_create";

var widgetLoadingDialog = "#widgetbuilder_widgetloading";
var widgetDownloadWidgetDialog = "#widgetbuilder_downloadwidget";
var createWidgetButton = "#widgetbuilder_create";
var widgetBuilderForm = "#widgetbuilder_form";

var downloadWidgetButton = "#widgetbuilder_dodownloadwidget";

var to = false;


///////////////
// UTILITIES //
///////////////

/**
* Present the ZIP file to the user and show the final file name
*/
var showDownloadZip = function(){
$(widgetLoadingDialog).jqmHide();
$("#widgetbuilder_built_name").text($("#widgetbuilder_title").val() + ".zip");
$(widgetDownloadWidgetDialog).jqmShow();
};

/**
* If a user cancels creation also cancel the timeout that shows the final ZIP document
*/
var removeTimeout = function(hash){
hash.o.remove();
hash.w.hide();
clearTimeout(to);
};


////////////////////
// INITIALIZATION //
////////////////////

/**
* Initialize the overlays that show progress and final ZIP file
*/
var initializeOverlays = function(){
$(widgetLoadingDialog).jqm({
modal: true,
overlay: 20,
toTop: true,
onHide: removeTimeout
});

$(widgetLoadingDialog).jqmShow();

$(widgetDownloadWidgetDialog).jqm({
modal: true,
overlay: 20,
toTop: true
});

to = setTimeout(showDownloadZip, 500);
};

/**
* Add binding to various elements
*/
var addBinding = function(){
$(createWidgetButton).live("click", function(){
initializeOverlays();
});

$(downloadWidgetButton).live("click", function(){
$(widgetBuilderForm).submit();
});
};

var init = function(){
addBinding();
};
$(widgetBuilderForm).validate();

init();
$(createWidgetButton).on("click", function(){
$(widgetBuilderForm).submit();
});

});
9 changes: 9 additions & 0 deletions app/assets/stylesheets/application.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1140,5 +1140,14 @@ input:-moz-placeholder, textarea:-moz-placeholder {
}
}

input.error {
border-color: #b94a48;
}

label.error {
color: #b94a48;
margin: 7px;
}

@import "core/widget_list.css.scss";
@import "core/submitwidget.css.scss";
4 changes: 4 additions & 0 deletions app/assets/stylesheets/sdk.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -123,5 +123,9 @@
}
}

#widgetbuilder_title {
min-width: 200px;
}

@import "sdk/widgetsdk.css.scss";
@import "sdk/colorpalette.css.scss";
5 changes: 0 additions & 5 deletions app/assets/stylesheets/sdk/widgetsdk.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,6 @@
margin-top: 0;
}
}
#widgetbuilder_description {
height: 70px;
margin-bottom: 10px;
width: 450px;
}
#widgetbuilder_options {
input {
float: left;
Expand Down
9 changes: 4 additions & 5 deletions app/controllers/widget_generator_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ def zippedwidget
# passing into the widget generator.
appstyle = params[:widgetbuilder_skeletontype]
myappname = params[:widgetbuilder_title]
appdesc = params[:widgetbuilder_description]
tempdir = "#{Dir::tmpdir}/#{Guid.new}"

# This is a bit of a leaky abstraction really. But we're doing the same thing
Expand All @@ -21,23 +20,23 @@ def zippedwidget
# the temp directory for the zip file as well.
filename = myappname.humanize.downcase.gsub(' ','')

Rails::Generators.invoke 'sakaiwidget', ["#{filename}"], :behavior => :invoke, :destination_root => tempdir, :apptitle => myappname, :appdesc => appdesc, :appstyle => appstyle #, :personalportal => personalportal, :sakaidocs => sakaidocs
Rails::Generators.invoke 'sakaiwidget', ["#{filename}"], :behavior => :invoke, :destination_root => tempdir, :apptitle => myappname, :appstyle => appstyle #, :personalportal => personalportal, :sakaidocs => sakaidocs
t = Tempfile.new("#{filename}")
zos = Zip::ZipOutputStream.open(t.path)
prefix = "#{tempdir}/"
Find.find("#{tempdir}/#{filename}") do |path|
Find.find("#{tempdir}/#{filename}") do |path|
zippath = path.slice(prefix.length...path.length)
if zippath != myappname then
if !File.directory?(path) then
zos.put_next_entry(zippath)
open(path) do |f|
open(path) do |f|
zos << f.read
end
end
end
end
zos.close
send_file t.path, :type => 'application/zip', :disposition => 'attachment', :filename => "#{myappname}.zip"
send_file t.path, :type => 'application/zip', :disposition => 'attachment', :filename => "#{myappname}.zip"
t.close
end

Expand Down
2 changes: 1 addition & 1 deletion app/views/core/_header.html.erb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<%= link_to raw('<div id="widgetlibrary_header_branding"></div>'), root_path, :id => "widgetlibrary_header_branding_link", :title => "Sakai OAE Widget Library Home" %>
<%= link_to raw('<div id="widgetlibrary_header_branding"></div>'), root_path, :id => "widgetlibrary_header_branding_link", :title => "Apereo OAE Widget Library Home" %>
4 changes: 2 additions & 2 deletions app/views/home/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<h2>A 'Widget' is an app which can be used as a 'bolt on' to the installed Sakai Open Academic Environment to add additional functionality, expanding the value of the platform for tutors and students alike.</h2>
</div>
<div id="carousel_state2" class="widgetlibrary_homecarousel_pane">
<h1>By adding custom widgets to Sakai OAE, you’ll be enriching the learning experience for students and staff alike.</h1>
<h2>A handful of the Universities benefiting from Sakai OAE:</h2>
<h1>By adding custom widgets to Apereo OAE, you’ll be enriching the learning experience for students and staff alike.</h1>
<h2>A handful of the Universities benefiting from Apereo OAE:</h2>
</div>
<div id="carousel_state3" class="widgetlibrary_homecarousel_pane">
<h1 class="size-30">Design. Code. Submit.</h1>
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/admin.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<title>Sakai OAE Widget Library<%= yield :title %></title>
<title>Apereo OAE Widget Library<%= yield :title %></title>
<%= stylesheet_link_tag "application" %>
<%= stylesheet_link_tag "core/lhnavigation" %>
<%= page_css %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<title>Sakai OAE Widget Library<%= yield :title %></title>
<title>Apereo OAE Widget Library<%= yield :title %></title>
<%= stylesheet_link_tag "application" %>
<%= page_css %>
<%= javascript_include_tag "application" %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/lhnavigation.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<title>Sakai OAE Widget Library<%= yield :title %></title>
<title>Apereo OAE Widget Library<%= yield :title %></title>
<%= stylesheet_link_tag "application" %>
<%= stylesheet_link_tag "core/lhnavigation" %>
<%= page_css %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/sdk/_lhnav.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<nav id="lhnavigation_container">
<h1 class="wl-bold">Sakai OAE Widget SDK</h1>
<h1 class="wl-bold">Apereo OAE Widget SDK</h1>
<ul>
<li <% if params[:section].eql?("developwidget")%>class="selected" <% elsif ["developwidget/quicksetup", "developwidget/devsetup", "developwidget/widgetbuilder", "developwidget/widgetsubmission", "developwidget/learnbasics", "developwidget/gitbasics"].include?(params[:section])%>class="selected_parent"<% end %>><div><%= link_to "Develop a widget", "/sdk/developwidget" %></div></li>
<ul class="subnav" <% if !["developwidget", "developwidget/quicksetup", "developwidget/devsetup", "developwidget/learnbasics", "developwidget/widgetbuilder", "developwidget/widgetsubmission", "developwidget/gitbasics"].include?(params[:section]) %> style="display:none;"<% end %>>
Expand Down
8 changes: 4 additions & 4 deletions app/views/sdk/api.html.erb
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<% content_for :title do %> - SDK - API &amp; endpoints<% end %>
<div class="widgetsdk_container">
<h1>API &amp; endpoints</h1>
<p>There is already a lot of functionality build into Sakai OAE.<br />We show you how you can use that and how you can communicate with the server.</p>
<p>There is already a lot of functionality build into Apereo OAE.<br />We show you how you can use that and how you can communicate with the server.</p>

<div class="wl-widget-item">
<%= image_tag "developer_fulldev_icon.png", :alt => "Front-end API", :class => "descriptive_icon" %>
<div class="descriptive_text">
<h2>Front-end API</h2>
<p>Use the build-in JavaScript functionality of Sakai OAE.</p>
<p>Use the build-in JavaScript functionality of Apereo OAE.</p>
<%= link_to "View", "/sdk/api/frontend", :class => "wl-link-button wl-button wl-header-button blue"%>
</div>
</div>
Expand All @@ -25,10 +25,10 @@
<%= image_tag "developer_interaction_icon.png", :alt => "3rd party libraries", :class => "descriptive_icon" %>
<div class="descriptive_text">
<h2>3rd party libraries</h2>
<p>A list of 3rd party JavaScript libraries that we use in Sakai OAE.</p>
<p>A list of 3rd party JavaScript libraries that we use in Apereo OAE.</p>
<%= link_to "View", "/sdk/api/thirdparty", :class => "wl-link-button wl-button wl-header-button blue"%>
</div>
</div>

<hr class="wl-push wl-hidden"/>
</div>
</div>
6 changes: 3 additions & 3 deletions app/views/sdk/backend.html.erb
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<% content_for :title do %> - SDK - Back-end endpoints<% end %>
<div id="backend" class="widgetsdk_container">
<h1>Back-end endpoints</h1>
<p>Sakai OAE has a number of API functions available that your widgets should use to communicate with the Sakai OAE server. A full list of API functions will be coming soon, but documentation on some of the most used backend Widget API functions are provided below.</p>
<p>Apereo OAE has a number of API functions available that your widgets should use to communicate with the Apereo OAE server. A full list of API functions will be coming soon, but documentation on some of the most used backend Widget API functions are provided below.</p>
<p>If you are looking for API functions to build the interface of your widgets, check out the <%= link_to "front-end API", "/sdk/api/frontend", :class => "wl-regular-link" %>.</p>

<div class="wl-widget-item">
<h2>Back-end endpoints</h2>
<p>More documentation will be added in the future. For now we recommend to run nakamura and go to <%= link_to "http://localhost:8080/system/doc", "http://localhost:8080/system/doc", :class => "wl-regular-link" %>.</p>
<p>If you can't run nakamura locally, you can go to any of the <%= link_to "Sakai OAE QA servers", "https://confluence.sakaiproject.org/display/QA/QA+Servers+-+Sakai+OAE", :class => "wl-regular-link" %> and add <em>/system/doc</em> to the URL.</p>
<p>If you can't run nakamura locally, you can go to any of the <%= link_to "Apereo OAE QA servers", "https://confluence.sakaiproject.org/display/QA/QA+Servers+-+Sakai+OAE", :class => "wl-regular-link" %> and add <em>/system/doc</em> to the URL.</p>
</div>
<%= render :partial => "sdk/feedback" %>
</div>
</div>
4 changes: 2 additions & 2 deletions app/views/sdk/colorpalette.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<% content_for :title do %> - SDK - Color palette<% end %>
<div id="colorpalette" class="widgetsdk_container">
<h1>Color palette</h1>
<p>This guide will help you style your widgets allowing them to fit seamlessly into the Sakai OAE suite of Widgets maintain a high standard for content presentation, and to maintain a high level of user experience across the system.</p>
<p>This guide will help you style your widgets allowing them to fit seamlessly into the Apereo OAE suite of Widgets maintain a high standard for content presentation, and to maintain a high level of user experience across the system.</p>

<div class="wl-widget-item">
<h2>HEX colors</h2>
Expand Down Expand Up @@ -126,4 +126,4 @@
</div>
<hr class="wl-push wl-hidden"/>
<%= render :partial => "sdk/feedback" %>
</div>
</div>
6 changes: 3 additions & 3 deletions app/views/sdk/contact.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<div class="wl-widget-item">
<h2>IRC</h2>
<p>You can almost always find a 3akai-UX (Sakai OAE front-end codename) Developer or Nakamura (Sakai OAE back-end codename) Developer in the Sakai IRC group chat room. The purpose of this space is to get quick answers to issues you are having and for group discussions on various issues. All are welcome.</p>
<p>You can almost always find a 3akai-UX (Apereo OAE front-end codename) Developer or Nakamura (Apereo OAE back-end codename) Developer in the Sakai IRC group chat room. The purpose of this space is to get quick answers to issues you are having and for group discussions on various issues. All are welcome.</p>
<p>To join:</p>
<p>1. You will need an IRC Client:</p>
<ul class="inline_list">
Expand All @@ -24,8 +24,8 @@
<h2>Email</h2>
<p>The Sakai community relies heavily on email lists for communication. Questions and ideas are welcome from anyone on these lists but you must sign up before you can send to the lists.</p>
<ul class="inline_list">
<li>Sakai OAE development: <%= link_to "[email protected]", "http://collab.sakaiproject.org/mailman/listinfo/oae-dev", :class => "wl-regular-link" %> (sign up) (archive)</li>
<li>Apereo OAE development: <%= link_to "[email protected]", "http://collab.sakaiproject.org/mailman/listinfo/oae-dev", :class => "wl-regular-link" %> (sign up) (archive)</li>
</ul>
</div>
<%= render :partial => "sdk/feedback" %>
</div>
</div>
8 changes: 4 additions & 4 deletions app/views/sdk/designguide.html.erb
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<% content_for :title do %> - SDK - Design guide<% end %>
<div class="widgetsdk_container">
<h1>Design guide</h1>
<p>Style your widgets and allow them to fit seamlessly into the Sakai OAE suite of Widgets. So we can maintain a high standard for content presentation and a high level of user experience across the system.</p>
<p>Style your widgets and allow them to fit seamlessly into the Apereo OAE suite of Widgets. So we can maintain a high standard for content presentation and a high level of user experience across the system.</p>

<div class="wl-widget-item">
<%= image_tag "developer_colorpalette_icon.png", :alt => "Color palette", :class => "descriptive_icon" %>
<div class="descriptive_text">
<h2>Color palette</h2>
<p>The main colours used within Sakai OAE for all aspects of the interface. From the hover states of lists to the colors used in the system messages.</p>
<p>The main colours used within Apereo OAE for all aspects of the interface. From the hover states of lists to the colors used in the system messages.</p>
<%= link_to "View", "/sdk/designguide/colorpalette", :class => "wl-link-button wl-button wl-header-button blue"%>
</div>
</div>
Expand All @@ -25,7 +25,7 @@
<%= image_tag "developer_speechbubble_icon.png", :alt => "Iconography", :class => "descriptive_icon" %>
<div class="descriptive_text">
<h2>Iconography</h2>
<p>The generic style of icons has to adhere to a few basic rules. The examples here will show you ho to creat your own icons to gel with the Sakai OAE icon family.</p>
<p>The generic style of icons has to adhere to a few basic rules. The examples here will show you ho to creat your own icons to gel with the Apereo OAE icon family.</p>
<%= link_to "View", "/sdk/designguide/iconography", :class => "wl-link-button wl-button wl-header-button blue"%>
</div>
</div>
Expand Down Expand Up @@ -67,4 +67,4 @@
</div>

<hr class="wl-push wl-hidden"/>
</div>
</div>
Loading

0 comments on commit 1d08f23

Please sign in to comment.