diff --git a/Gruntfile.js b/Gruntfile.js index e19aec0..b420801 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -6,7 +6,7 @@ module.exports = function(grunt) { uglify : { options: { report: "gzip", - banner: "/*! Chained <%= pkg.version %> - MIT license - Copyright 2010-2013 Mika Tuupola */\n" + banner: "/*! Chained <%= pkg.version %> - MIT license - Copyright 2010-2014 Mika Tuupola */\n" }, target: { files: { diff --git a/bower.json b/bower.json index 544d007..d6b96af 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "chained", - "version": "0.9.9", + "version": "0.9.10", "homepage": "http://www.appelsiini.net/projects/chained", "authors": [ "Mika Tuupola " diff --git a/chained.jquery.json b/chained.jquery.json index a40fc5c..1f5cf59 100644 --- a/chained.jquery.json +++ b/chained.jquery.json @@ -1,6 +1,6 @@ { "name": "chained", - "version": "0.9.9", + "version": "0.9.10", "title": "Chained", "author": { "name": "Mika Tuupola", diff --git a/demo.html b/demo.html index 45bbb67..1f6f8bc 100644 --- a/demo.html +++ b/demo.html @@ -291,7 +291,7 @@

Multiple jquery.chained.js

jquery.chained.remote.js

- @@ -438,9 +438,24 @@

Multiple jquery.chained.remote.js

$("#c").chained("#a,#b"); /* For jquery.chained.remote.js */ - $("#series-remote").remoteChained("#mark-remote", "json.php"); - $("#model-remote").remoteChained("#series-remote", "json.php"); - $("#engine-remote").remoteChained("#series-remote, #model-remote", "json.php"); + $("#series-remote").remoteChained({ + parents : "#mark-remote", + url : "json.php?sleep=1", + loading : "-x-", + clear : true + }); + $("#model-remote").remoteChained({ + parents : "#series-remote", + url : "json.php?sleep=1", + loading : "-x-", + clear : true + }); + $("#engine-remote").remoteChained({ + parents : "#series-remote, #model-remote", + url : "json.php?sleep=1", + loading : "-x-", + clear : true + }); /* Show button after each pulldown has a value. */ $("#engine-remote").bind("change", function(event) { diff --git a/jquery.chained.js b/jquery.chained.js index 3eef202..7ea0254 100644 --- a/jquery.chained.js +++ b/jquery.chained.js @@ -1,7 +1,7 @@ /* * Chained - jQuery / Zepto chained selects plugin * - * Copyright (c) 2010-2013 Mika Tuupola + * Copyright (c) 2010-2014 Mika Tuupola * * Licensed under the MIT license: * http://www.opensource.org/licenses/mit-license.php @@ -9,7 +9,7 @@ * Project home: * http://www.appelsiini.net/projects/chained * - * Version: 0.9.10-dev + * Version: 0.9.10 * */ diff --git a/jquery.chained.min.js b/jquery.chained.min.js index 75b83cb..479c6b4 100644 --- a/jquery.chained.min.js +++ b/jquery.chained.min.js @@ -1,2 +1,2 @@ -/*! Chained 0.9.9 - MIT license - Copyright 2010-2013 Mika Tuupola */ -!function(a,b){"use strict";a.fn.chained=function(c){return this.each(function(){function d(){var d=!0,g=a("option:selected",e).val();a(e).html(f.html());var h="";a(c).each(function(){var c=a("option:selected",this).val();c&&(h.length>0&&(h+=b.Zepto?"\\\\":"\\"),h+=c)});var i;i=a.isArray(c)?a(c[0]).first():a(c).first();var j=a("option:selected",i).val();a("option",e).each(function(){a(this).hasClass(h)&&a(this).val()===g?(a(this).prop("selected",!0),d=!1):a(this).hasClass(h)||a(this).hasClass(j)||""===a(this).val()||a(this).remove()}),1===a("option",e).size()&&""===a(e).val()?a(e).attr("disabled","disabled"):a(e).removeAttr("disabled"),d&&a(e).trigger("change")}var e=this,f=a(e).clone();a(c).each(function(){a(this).bind("change",function(){d()}),a("option:selected",this).length||a("option",this).first().attr("selected","selected"),d()})})},a.fn.chainedTo=a.fn.chained,a.fn.chained.defaults={}}(window.jQuery||window.Zepto,window,document); \ No newline at end of file +/*! Chained 0.9.10 - MIT license - Copyright 2010-2014 Mika Tuupola */ +!function(a,b){"use strict";a.fn.chained=function(c){return this.each(function(){function d(){var d=!0,g=a("option:selected",e).val();a(e).html(f.html());var h="";a(c).each(function(){var c=a("option:selected",this).val();c&&(h.length>0&&(h+=b.Zepto?"\\\\":"\\"),h+=c)});var i;i=a.isArray(c)?a(c[0]).first():a(c).first();var j=a("option:selected",i).val();a("option",e).each(function(){a(this).hasClass(h)&&a(this).val()===g?(a(this).prop("selected",!0),d=!1):a(this).hasClass(h)||a(this).hasClass(j)||""===a(this).val()||a(this).remove()}),1===a("option",e).size()&&""===a(e).val()?a(e).prop("disabled",!0):a(e).prop("disabled",!1),d&&a(e).trigger("change")}var e=this,f=a(e).clone();a(c).each(function(){a(this).bind("change",function(){d()}),a("option:selected",this).length||a("option",this).first().attr("selected","selected"),d()})})},a.fn.chainedTo=a.fn.chained,a.fn.chained.defaults={}}(window.jQuery||window.Zepto,window,document); \ No newline at end of file diff --git a/jquery.chained.remote.js b/jquery.chained.remote.js index cb6c6f4..77ce7a0 100644 --- a/jquery.chained.remote.js +++ b/jquery.chained.remote.js @@ -1,7 +1,7 @@ /* * Chained - jQuery / Zepto chained selects plugin * - * Copyright (c) 2010-2013 Mika Tuupola + * Copyright (c) 2010-2014 Mika Tuupola * * Licensed under the MIT license: * http://www.opensource.org/licenses/mit-license.php @@ -9,7 +9,7 @@ * Project home: * http://www.appelsiini.net/projects/chained * - * Version: 0.9.10-dev + * Version: 0.9.10 * */ diff --git a/jquery.chained.remote.min.js b/jquery.chained.remote.min.js index 7447099..af6c9b7 100644 --- a/jquery.chained.remote.min.js +++ b/jquery.chained.remote.min.js @@ -1,2 +1,2 @@ -/*! Chained 0.9.9 - MIT license - Copyright 2010-2013 Mika Tuupola */ -!function(a){"use strict";a.fn.remoteChained=function(b,c,d){var e;return"object"==typeof b&&"undefined"!=typeof b.url?e=a.extend({},a.fn.remoteChained.defaults,b):(e=a.extend({},a.fn.remoteChained.defaults,d),e.parents=b,e.url=c),this.each(function(){function b(b){var d=a(":selected",c).val();a("option",c).remove();var e=[];if(a.isArray(b))e=b;else for(var f in b)b.hasOwnProperty(f)&&e.push([f,b[f]]);for(var g=0;g!==e.length;g++){var h=e[g][0],i=e[g][1];if("selected"!==h){var j=a("