diff --git a/webgui/3rdparty/jquery/jquery.jui_theme_switch.min.js b/webgui/3rdparty/jquery/jquery.jui_theme_switch.min.js new file mode 100644 index 000000000..246547a65 --- /dev/null +++ b/webgui/3rdparty/jquery/jquery.jui_theme_switch.min.js @@ -0,0 +1,11 @@ +/** + * @fileOverview jui_theme_switch: jquery plugin to switch juery-ui themes + *

License MIT + *
Copyright 2012 Christos Pontikis http://pontikis.net + *
Project page http://pontikis.net/labs/jui_theme_switch + *
Minified using Online YUI Compressor http://www.refresh-sf.com/yui/ + * @version 1.0.6 (21 Jan 2013) + * @author Christos Pontikis http://pontikis.net + * @requires jquery, jquery-ui + */ +"use strict";(function(e){var d="jui_theme_switch",c="jui_theme_switch_status";var a={init:function(f){var g=this;return this.each(function(){var k=g.data(d);if(typeof(k)=="undefined"){var n=g.jui_theme_switch("getDefaults");k=e.extend({},n,f)}else{k=e.extend({},k,f)}g.data(d,k);if(typeof g.data(c)==="undefined"){g.data(c,{});g.data(c)["selected_theme"]={}}g.unbind("onChangeTheme").bind("onChangeTheme",k.onChangeTheme);g.unbind("onDisplay").bind("onDisplay",k.onDisplay);var p=g.attr("id"),r,q,s="",h=b(k.switcher_id_prefix,p),u=b(k.switcher_label_id_prefix,p),t,m,w=e("#"+k.stylesheet_link_id),o="",l,j="",v="";e.ajax({url:k.datasource_url,dataType:"json",cache:false,success:function(i){r=i.length;s+='";s+='";g.html(s);m=e("#"+u);t=e("#"+h);m.removeClass().addClass(k.labelClass);t.removeClass().addClass(k.listClass);g.removeClass().addClass(k.containerClass);g.off("change",t).on("change",t,function(){w.attr("href",t.val());for(q=0;qERROR: '+f+"");e.error(f)}if(a[g]){return a[g].apply(this,Array.prototype.slice.call(arguments,1))}else{if(typeof g==="object"||!g){return a.init.apply(this,arguments)}else{e.error("Method "+g+" does not exist on jQuery."+d)}}}})(jQuery); diff --git a/webgui/index.html b/webgui/index.html index 52c6ff7c1..5f2002a75 100644 --- a/webgui/index.html +++ b/webgui/index.html @@ -32,7 +32,7 @@ - + @@ -222,6 +239,7 @@ html, body, #wrapper { click: $root.selectTopic"> +

diff --git a/webgui/jquery-ui-themes.json b/webgui/jquery-ui-themes.json new file mode 100644 index 000000000..aaa28acc5 --- /dev/null +++ b/webgui/jquery-ui-themes.json @@ -0,0 +1,194 @@ +[ +{ +"theme_name": "black-tie", +"theme_url": "3rdparty/jquery-ui-themes-1.11.2/themes/black-tie/jquery-ui.css", +"group": "Official", +"active": "yes", +"author": "jQuery Project", +"license": "http://jquery.org/license" +}, +{ +"theme_name": "blitzer", +"theme_url": "3rdparty/jquery-ui-themes-1.11.2/themes/blitzer/jquery-ui.css", +"group": "Official", +"active": "yes", +"author": "jQuery Project", +"license": "http://jquery.org/license" +}, +{ +"theme_name": "cupertino", +"theme_url": "3rdparty/jquery-ui-themes-1.11.2/themes/cupertino/jquery-ui.css", +"group": "Official", +"active": "yes", +"author": "jQuery Project", +"license": "http://jquery.org/license" +}, +{ +"theme_name": "dark-hive", +"theme_url": "3rdparty/jquery-ui-themes-1.11.2/themes/dark-hive/jquery-ui.css", +"group": "Official", +"active": "yes", +"author": "jQuery Project", +"license": "http://jquery.org/license" +}, +{ +"theme_name": "dot-luv", +"theme_url": "3rdparty/jquery-ui-themes-1.11.2/themes/dot-luv/jquery-ui.css", +"group": "Official", +"active": "yes", +"author": "jQuery Project", +"license": "http://jquery.org/license" +}, +{ +"theme_name": "eggplant", +"theme_url": "3rdparty/jquery-ui-themes-1.11.2/themes/eggplant/jquery-ui.css", +"group": "Official", +"active": "yes", +"author": "jQuery Project", +"license": "http://jquery.org/license" +}, +{ +"theme_name": "excite-bike", +"theme_url": "3rdparty/jquery-ui-themes-1.11.2/themes/excite-bike/jquery-ui.css", +"group": "Official", +"active": "yes", +"author": "jQuery Project", +"license": "http://jquery.org/license" +}, +{ +"theme_name": "flick", +"theme_url": "3rdparty/jquery-ui-themes-1.11.2/themes/flick/jquery-ui.css", +"group": "Official", +"active": "yes", +"author": "jQuery Project", +"license": "http://jquery.org/license" +}, +{ +"theme_name": "hot-sneaks", +"theme_url": "3rdparty/jquery-ui-themes-1.11.2/themes/hot-sneaks/jquery-ui.css", +"group": "Official", +"active": "yes", +"author": "jQuery Project", +"license": "http://jquery.org/license" +}, +{ +"theme_name": "humanity", +"theme_url": "3rdparty/jquery-ui-themes-1.11.2/themes/humanity/jquery-ui.css", +"group": "Official", +"active": "yes", +"author": "jQuery Project", +"license": "http://jquery.org/license" +}, +{ +"theme_name": "le-frog", +"theme_url": "3rdparty/jquery-ui-themes-1.11.2/themes/le-frog/jquery-ui.css", +"group": "Official", +"active": "yes", +"author": "jQuery Project", +"license": "http://jquery.org/license" +}, +{ +"theme_name": "mint-choc", +"theme_url": "3rdparty/jquery-ui-themes-1.11.2/themes/mint-choc/jquery-ui.css", +"group": "Official", +"active": "yes", +"author": "jQuery Project", +"license": "http://jquery.org/license" +}, +{ +"theme_name": "overcast", +"theme_url": "3rdparty/jquery-ui-themes-1.11.2/themes/overcast/jquery-ui.css", +"group": "Official", +"active": "yes", +"author": "jQuery Project", +"license": "http://jquery.org/license" +}, +{ +"theme_name": "pepper-grinder", +"theme_url": "3rdparty/jquery-ui-themes-1.11.2/themes/pepper-grinder/jquery-ui.css", +"group": "Official", +"active": "yes", +"author": "jQuery Project", +"license": "http://jquery.org/license" +}, +{ +"theme_name": "redmond", +"theme_url": "3rdparty/jquery-ui-themes-1.11.2/themes/redmond/jquery-ui.css", +"group": "Official", +"active": "yes", +"author": "jQuery Project", +"license": "http://jquery.org/license" +}, +{ +"theme_name": "smoothness", +"theme_url": "3rdparty/jquery-ui-themes-1.11.2/themes/smoothness/jquery-ui.css", +"group": "Official", +"active": "yes", +"author": "jQuery Project", +"license": "http://jquery.org/license" +}, +{ +"theme_name": "south-street", +"theme_url": "3rdparty/jquery-ui-themes-1.11.2/themes/south-street/jquery-ui.css", +"group": "Official", +"active": "yes", +"author": "jQuery Project", +"license": "http://jquery.org/license" +}, +{ +"theme_name": "start", +"theme_url": "3rdparty/jquery-ui-themes-1.11.2/themes/start/jquery-ui.css", +"group": "Official", +"active": "yes", +"author": "jQuery Project", +"license": "http://jquery.org/license" +}, +{ +"theme_name": "sunny", +"theme_url": "3rdparty/jquery-ui-themes-1.11.2/themes/sunny/jquery-ui.css", +"group": "Official", +"active": "yes", +"author": "jQuery Project", +"license": "http://jquery.org/license" +}, +{ +"theme_name": "swanky-purse", +"theme_url": "3rdparty/jquery-ui-themes-1.11.2/themes/swanky-purse/jquery-ui.css", +"group": "Official", +"active": "yes", +"author": "jQuery Project", +"license": "http://jquery.org/license" +}, +{ +"theme_name": "trontastic", +"theme_url": "3rdparty/jquery-ui-themes-1.11.2/themes/trontastic/jquery-ui.css", +"group": "Official", +"active": "yes", +"author": "jQuery Project", +"license": "http://jquery.org/license" +}, +{ +"theme_name": "ui-darkness", +"theme_url": "3rdparty/jquery-ui-themes-1.11.2/themes/ui-darkness/jquery-ui.css", +"group": "Official", +"active": "yes", +"author": "jQuery Project", +"license": "http://jquery.org/license" +}, +{ +"theme_name": "ui-lightness", +"theme_url": "3rdparty/jquery-ui-themes-1.11.2/themes/ui-lightness/jquery-ui.css", +"group": "Official", +"active": "yes", +"author": "jQuery Project", +"license": "http://jquery.org/license" +}, +{ +"theme_name": "vader", +"theme_url": "3rdparty/jquery-ui-themes-1.11.2/themes/vader/jquery-ui.css", +"group": "Official", +"active": "yes", +"author": "jQuery Project", +"license": "http://jquery.org/license" +} +] diff --git a/webgui/main.js b/webgui/main.js index 1a0d6720e..d908011d8 100644 --- a/webgui/main.js +++ b/webgui/main.js @@ -14,8 +14,8 @@ require.config({ }); require([ - 'knockout', 'jquery', -], function(ko) { + 'knockout', 'jquery', 'themeswitch' +], function(ko,jquery) { function KnockProps(aliases) { @@ -287,4 +287,5 @@ require([ }); ko.applyBindings(new PhiViewModel()); + }); diff --git a/webgui/mkthemes.sh b/webgui/mkthemes.sh new file mode 100644 index 000000000..65b01799d --- /dev/null +++ b/webgui/mkthemes.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +echo "[" +THEMES=`ls 3rdparty/jquery-ui-themes-1.11.2/themes/` +set -- $THEMES +while [ $# -gt 0 ]; do +echo "{" +echo "\"theme_name\": \"$1\"," +echo "\"theme_url\": \"3rdparty/jquiery-ui-themes-1.11.2/themes/$1/jquery-ui.css\"," +echo "\"group\": \"Official\"," +echo "\"active\": \"yes\"," +echo "\"author\": \"jQuery Project\"," +echo "\"license\": \"http://jquery.org/license\"" +echo "}," + shift +done +echo "]" + diff --git a/webgui/themeswitch.js b/webgui/themeswitch.js new file mode 100644 index 000000000..0ba54225c --- /dev/null +++ b/webgui/themeswitch.js @@ -0,0 +1,19 @@ +require([ + 'jquery', +], function(jquery) { + // nested require to ensure jquery is ready before + // jui_theme_switch starts + require([ + '3rdparty/jquery/jquery.jui_theme_switch.min' + ], function() { + + + $(function() { + $("#ui-theme-switcher").jui_theme_switch({ + stylesheet_link_id: "ui-theme", + datasource_url: "jquery-ui-themes.json" + }); + }); +}); + +});