From b312c707c3213bdb18d4b448eabcaef7b7ba289b Mon Sep 17 00:00:00 2001 From: Mottie Date: Fri, 8 Nov 2013 02:43:57 -0600 Subject: [PATCH] theme & demo updates --- css/theme.bootstrap.css | 2 + css/theme.dark.css | 2 +- docs/assets/theme_switcher.json | 321 ++++++++++++++++++++ docs/css/jq.css | 2 +- docs/example-widget-filter-formatter-1.html | 49 ++- docs/example-widget-savesort.html | 3 +- docs/example-widget-ui-theme.html | 23 +- docs/index.html | 20 +- docs/js/jquery.jui_theme_switch.min.js | 11 + 9 files changed, 404 insertions(+), 29 deletions(-) create mode 100644 docs/assets/theme_switcher.json create mode 100644 docs/js/jquery.jui_theme_switch.min.js diff --git a/css/theme.bootstrap.css b/css/theme.bootstrap.css index 4ac95183..9aa55311 100644 --- a/css/theme.bootstrap.css +++ b/css/theme.bootstrap.css @@ -55,6 +55,8 @@ /* processing icon */ .tablesorter-bootstrap .tablesorter-processing { background-image: url('data:image/gif;base64,R0lGODlhFAAUAKEAAO7u7lpaWgAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQBCgACACwAAAAAFAAUAAACQZRvoIDtu1wLQUAlqKTVxqwhXIiBnDg6Y4eyx4lKW5XK7wrLeK3vbq8J2W4T4e1nMhpWrZCTt3xKZ8kgsggdJmUFACH5BAEKAAIALAcAAAALAAcAAAIUVB6ii7jajgCAuUmtovxtXnmdUAAAIfkEAQoAAgAsDQACAAcACwAAAhRUIpmHy/3gUVQAQO9NetuugCFWAAAh+QQBCgACACwNAAcABwALAAACE5QVcZjKbVo6ck2AF95m5/6BSwEAIfkEAQoAAgAsBwANAAsABwAAAhOUH3kr6QaAcSrGWe1VQl+mMUIBACH5BAEKAAIALAIADQALAAcAAAIUlICmh7ncTAgqijkruDiv7n2YUAAAIfkEAQoAAgAsAAAHAAcACwAAAhQUIGmHyedehIoqFXLKfPOAaZdWAAAh+QQFCgACACwAAAIABwALAAACFJQFcJiXb15zLYRl7cla8OtlGGgUADs='); + background-position: center center !important; + background-repeat: no-repeat !important; position: absolute; z-index: 1000; } diff --git a/css/theme.dark.css b/css/theme.dark.css index a763fa2e..f1cf1ae9 100644 --- a/css/theme.dark.css +++ b/css/theme.dark.css @@ -114,7 +114,7 @@ /* caption */ caption { - background: #fff; + background: #202020; } /* filter widget */ diff --git a/docs/assets/theme_switcher.json b/docs/assets/theme_switcher.json new file mode 100644 index 00000000..24369265 --- /dev/null +++ b/docs/assets/theme_switcher.json @@ -0,0 +1,321 @@ +[ + { + "theme_name": "base", + "theme_url": "http://code.jquery.com/ui/1.10.0/themes/base/jquery-ui.css", + "group": "Official", + "active": "yes", + "author": "jQuery Project", + "license": "http://jquery.org/license" + }, + { + "theme_name": "black-tie", + "theme_url": "http://code.jquery.com/ui/1.10.0/themes/black-tie/jquery-ui.css", + "group": "Official", + "active": "yes", + "author": "jQuery Project", + "license": "http://jquery.org/license" + }, + { + "theme_name": "blitzer", + "theme_url": "http://code.jquery.com/ui/1.10.0/themes/blitzer/jquery-ui.css", + "group": "Official", + "active": "yes", + "author": "jQuery Project", + "license": "http://jquery.org/license" + }, + { + "theme_name": "cupertino", + "theme_url": "http://code.jquery.com/ui/1.10.0/themes/cupertino/jquery-ui.css", + "group": "Official", + "active": "yes", + "author": "jQuery Project", + "license": "http://jquery.org/license" + }, + { + "theme_name": "dark-hive", + "theme_url": "http://code.jquery.com/ui/1.10.0/themes/dark-hive/jquery-ui.css", + "group": "Official", + "active": "yes", + "author": "jQuery Project", + "license": "http://jquery.org/license" + }, + { + "theme_name": "dot-luv", + "theme_url": "http://code.jquery.com/ui/1.10.0/themes/dot-luv/jquery-ui.css", + "group": "Official", + "active": "yes", + "author": "jQuery Project", + "license": "http://jquery.org/license" + }, + { + "theme_name": "eggplant", + "theme_url": "http://code.jquery.com/ui/1.10.0/themes/eggplant/jquery-ui.css", + "group": "Official", + "active": "yes", + "author": "jQuery Project", + "license": "http://jquery.org/license" + }, + { + "theme_name": "excite-bike", + "theme_url": "http://code.jquery.com/ui/1.10.0/themes/excite-bike/jquery-ui.css", + "group": "Official", + "active": "yes", + "author": "jQuery Project", + "license": "http://jquery.org/license" + }, + { + "theme_name": "flick", + "theme_url": "http://code.jquery.com/ui/1.10.0/themes/flick/jquery-ui.css", + "group": "Official", + "active": "yes", + "author": "jQuery Project", + "license": "http://jquery.org/license" + }, + { + "theme_name": "hot-sneaks", + "theme_url": "http://code.jquery.com/ui/1.10.0/themes/hot-sneaks/jquery-ui.css", + "group": "Official", + "active": "yes", + "author": "jQuery Project", + "license": "http://jquery.org/license" + }, + { + "theme_name": "humanity", + "theme_url": "http://code.jquery.com/ui/1.10.0/themes/humanity/jquery-ui.css", + "group": "Official", + "active": "yes", + "author": "jQuery Project", + "license": "http://jquery.org/license" + }, + { + "theme_name": "le-frog", + "theme_url": "http://code.jquery.com/ui/1.10.0/themes/le-frog/jquery-ui.css", + "group": "Official", + "active": "yes", + "author": "jQuery Project", + "license": "http://jquery.org/license" + }, + { + "theme_name": "mint-choc", + "theme_url": "http://code.jquery.com/ui/1.10.0/themes/mint-choc/jquery-ui.css", + "group": "Official", + "active": "yes", + "author": "jQuery Project", + "license": "http://jquery.org/license" + }, + { + "theme_name": "overcast", + "theme_url": "http://code.jquery.com/ui/1.10.0/themes/overcast/jquery-ui.css", + "group": "Official", + "active": "yes", + "author": "jQuery Project", + "license": "http://jquery.org/license" + }, + { + "theme_name": "pepper-grinder", + "theme_url": "http://code.jquery.com/ui/1.10.0/themes/pepper-grinder/jquery-ui.css", + "group": "Official", + "active": "yes", + "author": "jQuery Project", + "license": "http://jquery.org/license" + }, + { + "theme_name": "redmond", + "theme_url": "http://code.jquery.com/ui/1.10.0/themes/redmond/jquery-ui.css", + "group": "Official", + "active": "yes", + "author": "jQuery Project", + "license": "http://jquery.org/license" + }, + { + "theme_name": "smoothness", + "theme_url": "http://code.jquery.com/ui/1.10.0/themes/smoothness/jquery-ui.css", + "group": "Official", + "active": "yes", + "author": "jQuery Project", + "license": "http://jquery.org/license" + }, + { + "theme_name": "south-street", + "theme_url": "http://code.jquery.com/ui/1.10.0/themes/south-street/jquery-ui.css", + "group": "Official", + "active": "yes", + "author": "jQuery Project", + "license": "http://jquery.org/license" + }, + { + "theme_name": "start", + "theme_url": "http://code.jquery.com/ui/1.10.0/themes/start/jquery-ui.css", + "group": "Official", + "active": "yes", + "author": "jQuery Project", + "license": "http://jquery.org/license" + }, + { + "theme_name": "sunny", + "theme_url": "http://code.jquery.com/ui/1.10.0/themes/sunny/jquery-ui.css", + "group": "Official", + "active": "yes", + "author": "jQuery Project", + "license": "http://jquery.org/license" + }, + { + "theme_name": "swanky-purse", + "theme_url": "http://code.jquery.com/ui/1.10.0/themes/swanky-purse/jquery-ui.css", + "group": "Official", + "active": "yes", + "author": "jQuery Project", + "license": "http://jquery.org/license" + }, + { + "theme_name": "trontastic", + "theme_url": "http://code.jquery.com/ui/1.10.0/themes/trontastic/jquery-ui.css", + "group": "Official", + "active": "yes", + "author": "jQuery Project", + "license": "http://jquery.org/license" + }, + { + "theme_name": "ui-darkness", + "theme_url": "http://code.jquery.com/ui/1.10.0/themes/ui-darkness/jquery-ui.css", + "group": "Official", + "active": "yes", + "author": "jQuery Project", + "license": "http://jquery.org/license" + }, + { + "theme_name": "ui-lightness", + "theme_url": "http://code.jquery.com/ui/1.10.0/themes/ui-lightness/jquery-ui.css", + "group": "Official", + "active": "yes", + "author": "jQuery Project", + "license": "http://jquery.org/license" + }, + { + "theme_name": "vader", + "theme_url": "http://code.jquery.com/ui/1.10.0/themes/vader/jquery-ui.css", + "group": "Official", + "active": "yes", + "author": "jQuery Project", + "license": "http://jquery.org/license" + }, + + + { + "theme_name": "aristo", + "theme_url": "http://taitems.github.com/Aristo-jQuery-UI-Theme/css/Aristo/Aristo.css", + "group": "3rd-party", + "active": "yes", + "author": "https://github.com/taitems/Aristo-jQuery-UI-Theme", + "license": "MIT" + }, + { + "theme_name": "jquery-ui-bootstrap", + "theme_url": "http://addyosmani.github.com/jquery-ui-bootstrap/css/custom-theme/jquery-ui-1.8.16.custom.css", + "group": "3rd-party", + "active": "yes", + "author": "http://addyosmani.github.com/jquery-ui-bootstrap", + "license": "Copyright 2012, Addy Osmani - Dual licensed under the MIT or GPL Version 2 licenses" + }, + { + "theme_name": "Absolution", + "hosted_locally": "yes", + "theme_url": "/lib/jquery-ui-1.10.0.custom/css/3rd-party/Absolution/absolution.css", + "group": "3rd-party", + "active": "yes", + "author": "http://www.michaelvanderheeren.be/archives/382", + "license": "https://github.com/michaelvanderheeren/Absolution/blob/master/README.md", + "notes": "You are free to redistribute or change the theme. You can change the theme, but you should keep the references to contributors!" + }, + { + "theme_name": "Selene", + "theme_url": "http://gravityonmars.github.com/Selene/css/ui-selene/jquery-ui-1.8.17.custom.css", + "group": "3rd-party", + "active": "yes", + "author": "https://github.com/gravityonmars/Selene", + "license": "MIT" + }, + { + "theme_name": "kiandra-delta", + "theme_url": "http://kiandra.github.com/Delta-jQuery-UI-Theme/theme/jquery-ui.css", + "group": "3rd-party", + "active": "yes", + "author": "https://github.com/kiandra/Delta-jQuery-UI-Theme", + "license": "Dual licensed under the MIT or GPL Version 2 licenses." + }, + + + { + "theme_name": "arctic", + "theme_url": "http://cdn.wijmo.com/themes/arctic/jquery-wijmo.css", + "group": "Wijmo", + "active": "yes", + "author": "http://wijmo.com", + "license": "http://wijmo.com/license" + }, + { + "theme_name": "midnight", + "theme_url": "http://cdn.wijmo.com/themes/midnight/jquery-wijmo.css", + "group": "Wijmo", + "active": "yes", + "author": "http://wijmo.com", + "license": "http://wijmo.com/license" + }, + { + "theme_name": "rocket", + "theme_url": "http://cdn.wijmo.com/themes/rocket/jquery-wijmo.css", + "group": "Wijmo", + "active": "yes", + "author": "http://wijmo.com", + "license": "http://wijmo.com/license" + }, + { + "theme_name": "cobalt", + "theme_url": "http://cdn.wijmo.com/themes/cobalt/jquery-wijmo.css", + "group": "Wijmo", + "active": "yes", + "author": "http://wijmo.com", + "license": "http://wijmo.com/license" + }, + { + "theme_name": "sterling", + "theme_url": "http://cdn.wijmo.com/themes/sterling/jquery-wijmo.css", + "group": "Wijmo", + "active": "yes", + "author": "http://wijmo.com", + "license": "http://wijmo.com/license" + }, + { + "theme_name": "metro", + "theme_url": "http://cdn.wijmo.com/themes/metro/jquery-wijmo.css", + "group": "Wijmo", + "active": "yes", + "author": "http://wijmo.com", + "license": "http://wijmo.com/license" + }, + { + "theme_name": "metro-dark", + "theme_url": "http://cdn.wijmo.com/themes/metro-dark/jquery-wijmo.css", + "group": "Wijmo", + "active": "yes", + "author": "http://wijmo.com", + "license": "http://wijmo.com/license" + }, + { + "theme_name": "bootstrap-wijmo", + "theme_url": "http://cdn.wijmo.com/themes/bootstrap/jquery-ui.css", + "group": "Wijmo", + "active": "yes", + "author": "http://addyosmani.github.com/jquery-ui-bootstrap", + "license": "Copyright 2012, Addy Osmani - Dual licensed under the MIT or GPL Version 2 licenses" + }, + { + "theme_name": "aristo-wijmo", + "theme_url": "http://cdn.wijmo.com/themes/aristo/jquery-wijmo.css", + "group": "Wijmo", + "active": "yes", + "author": "http://wijmo.com", + "license": "http://wijmo.com/license", + "notes": "Based on the Aristo theme concept created by 280 North and Pinvoke (https://github.com/280north/aristo)" + } +] diff --git a/docs/css/jq.css b/docs/css/jq.css index 05dc1cd2..6732fa3b 100644 --- a/docs/css/jq.css +++ b/docs/css/jq.css @@ -33,7 +33,7 @@ pre.normal {background-color:transparent;border:none;border-left-width:0;overflo #start,#case,.bright {color:#007baa;} #demo strong {color:#a00;} hr {height:1px;} -ul {color:#333;list-style:square;} +ul {list-style:square;} #banner {margin:20px 20px 5px 20px;padding:0;text-align:left;} #banner *,.demo h1,.demo h1 em {color:#232121;font-family:Georgia, Palatino, Times New Roman;font-size:30px;font-style:normal;font-weight:400;margin:0;padding:0;} #banner h1 {display:block;float:left;} diff --git a/docs/example-widget-filter-formatter-1.html b/docs/example-widget-filter-formatter-1.html index 47cd43c3..b9f75bd4 100644 --- a/docs/example-widget-filter-formatter-1.html +++ b/docs/example-widget-filter-formatter-1.html @@ -8,7 +8,6 @@ - @@ -18,8 +17,20 @@ th { width: 15%; } - - + + + + + + + @@ -30,17 +41,23 @@ heightStyle: 'content', collapsible : true }); + + $('#switcher').jui_theme_switch({ + stylesheet_link_id : 'ui-theme', + datasource_url : 'assets/theme_switcher.json' + }); + }); + + @@ -13,9 +13,17 @@ + + + + - - + + @@ -67,6 +75,15 @@ }); + + diff --git a/docs/index.html b/docs/index.html index b2fd92a8..66774d95 100644 --- a/docs/index.html +++ b/docs/index.html @@ -445,12 +445,14 @@ "" Additional CSS class applied to style the header with a ascending sort - v2.11.

- Changed to empty string in v2.11, as the "tablesorter-headerAsc" class will always be added to a header cell with an ascending sort; this option now contains any additional class names to add. Previous default value changed v2.5. + Changed to empty string ("") in v2.11, as the "tablesorter-headerAsc" class will always be added to a header cell with an ascending sort; this option now contains any additional class names to add. +

Example from the blue theme:

.tablesorter-blue .tablesorter-headerAsc {
   background-color: #9fbfdf;
   background-image: url(black-asc.gif);
-}
+} + Default changed v2.5 to "tablesorter-headerAsc". Default changed v2.1.7 to "tablesorter-headerSortUp". Original default: "headerSortUp" @@ -459,7 +461,7 @@ cssChildRow String "tablesorter-childRow" - Add this css class to a child row that should always be attached to its parent. Click on the "cssChildRow" link to toggle the view on the attached child row. Previous default was "expand-child" (Changed in v2.4). + Add this css class to a child row that should always be attached to its parent. Click on the "cssChildRow" link to toggle the view on the attached child row. Previous default was "expand-child" (Changed in v2.4). Ex:1 2 @@ -516,12 +518,13 @@ "" Additional CSS class applied to style the header with a descending sort - v2.11.

- Changed to empty string in v2.11, as the "tablesorter-headerDesc" class will always be added to a header cell with a descending sort; this option now contains any additional class names to add. Previous default value changed v2.5. + Changed to empty string in v2.11, as the "tablesorter-headerDesc" class will always be added to a header cell with a descending sort; this option now contains any additional class names to add.

Example from the blue theme:

.tablesorter-blue .tablesorter-headerDesc {
   background-color: #8cb3d9;
   background-image: url(black-desc.gif);
-}
+} + Default changed v2.5 to "tablesorter-headerDesc". Default changed v2.1.7 to "tablesorter-headerSortDown". Original default: "headerSortDown" @@ -541,7 +544,8 @@ padding: 4px 20px 4px 4px; white-space: normal; cursor: pointer; -} +} + Default changed v2.1.7 to "tablesorter-header". Original default: "header" @@ -1211,7 +1215,7 @@ $(function(){ $("#myTable").tableSorter( { textExtraction: myTextExtraction } ); }); tablesorter will pass the current table cell object for you to parse and return. Thanks to Josh Nathanson for the examples. Updated to a jQuery example by Rob G (Mottie). -

Now if the text you are finding in the script above is say a number, then just include the headers sorter option to specify how to sort it. Also in this example, we will specify that the special textExtraction code is only needed for the second column ("1" because we are using a zero-based index). All other columns will ignore this textExtraction function.

+

Now if the text you are finding in the script above is say a number, then just include the headers sorter option to specify how to sort it. Also in this example, we will specify that the special textExtraction code is only needed for the second column (1 because we are using a zero-based index). All other columns will ignore this textExtraction function.

Added table and cellIndex variables to the textExtraction function in version 2.1.2.

$(function(){
   $("table").tablesorter({
@@ -1283,7 +1287,7 @@ $(function(){
     textSorter : {
       // replace INDIVIDUAL COLUMN text sorter functions
       0 : function(a, b, direction, columnIndex, table){
-        // same as $.tablesorter.sortText
+        // same as $.tablesorter.sortText (basic alphabetical sort)
         // direction: true = ascending; false = descending
         // columnIndex: zero-based index of the current table column being sorted
         // table: table DOM element (access options by using table.config)
diff --git a/docs/js/jquery.jui_theme_switch.min.js b/docs/js/jquery.jui_theme_switch.min.js
new file mode 100644
index 00000000..d3e916cc
--- /dev/null
+++ b/docs/js/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); \ No newline at end of file