From 58ce3fd2471ee566c2f0f776e2c66aa7779aab77 Mon Sep 17 00:00:00 2001 From: Catouse Date: Tue, 5 Aug 2014 16:02:05 +0800 Subject: [PATCH] * added methods to manage storage data of page to store.js. --- dist/js/zui.js | 51 ++++++++++++++++++++++++++++++++++++++--- dist/js/zui.lite.js | 51 ++++++++++++++++++++++++++++++++++++++--- dist/js/zui.lite.min.js | 4 ++-- dist/js/zui.min.js | 6 ++--- src/js/store.js | 51 ++++++++++++++++++++++++++++++++++++++--- 5 files changed, 149 insertions(+), 14 deletions(-) diff --git a/dist/js/zui.js b/dist/js/zui.js index 0ec461d61..be3fbd210 100644 --- a/dist/js/zui.js +++ b/dist/js/zui.js @@ -10,13 +10,14 @@ if (typeof jQuery === "undefined") { throw new Error("ZUI requires jQuery") } /* Store */ -+function(window) ++function(window, $) { "use strict"; var lsName = 'localStorage'; var storage = window[lsName], - old = window['store']; + old = window['store'], + pageName = 'page_' + window.location.pathname; /* The Store object */ var Store = function() @@ -24,6 +25,50 @@ if (typeof jQuery === "undefined") { throw new Error("ZUI requires jQuery") } this.slience = true; this.disabled = (lsName in window) && window[lsName] && window[lsName]['setItem']; this.storage = storage; + var self = this; + + this.page = this.get(pageName, {}); + }; + + /* Save page data */ + Store.prototype.savePage = function() + { + if($.isEmptyObject(this.page)) + { + this.remove(pageName); + } + else + { + this.set(pageName, this.page); + } + }; + + /* Clear page data */ + Store.prototype.clearPage = function() + { + this.page = {}; + this.savePage(); + }; + + /* Get page data */ + Store.prototype.getPage = function(key, defaultValue) + { + var val = this.page[key]; + return (defaultValue !== undefined && val === null) ? defaultValue : val; + }; + + /* Set page data */ + Store.prototype.setPage = function(objOrKey, val) + { + if($.isPlanObject(objOrKey)) + { + $.extend(true, this.page, objOrKey); + } + else + { + this.page[this.serialize(objOrKey)] = val; + } + this.savePage(); }; /* Check disabled status */ @@ -155,7 +200,7 @@ if (typeof jQuery === "undefined") { throw new Error("ZUI requires jQuery") } window.store = old; return store; } -}(window); +}(window, jQuery); /* * jQuery Hotkeys Plugin diff --git a/dist/js/zui.lite.js b/dist/js/zui.lite.js index 6626c4334..891bb746f 100644 --- a/dist/js/zui.lite.js +++ b/dist/js/zui.lite.js @@ -10,13 +10,14 @@ if (typeof jQuery === "undefined") { throw new Error("ZUI requires jQuery") } /* Store */ -+function(window) ++function(window, $) { "use strict"; var lsName = 'localStorage'; var storage = window[lsName], - old = window['store']; + old = window['store'], + pageName = 'page_' + window.location.pathname; /* The Store object */ var Store = function() @@ -24,6 +25,50 @@ if (typeof jQuery === "undefined") { throw new Error("ZUI requires jQuery") } this.slience = true; this.disabled = (lsName in window) && window[lsName] && window[lsName]['setItem']; this.storage = storage; + var self = this; + + this.page = this.get(pageName, {}); + }; + + /* Save page data */ + Store.prototype.savePage = function() + { + if($.isEmptyObject(this.page)) + { + this.remove(pageName); + } + else + { + this.set(pageName, this.page); + } + }; + + /* Clear page data */ + Store.prototype.clearPage = function() + { + this.page = {}; + this.savePage(); + }; + + /* Get page data */ + Store.prototype.getPage = function(key, defaultValue) + { + var val = this.page[key]; + return (defaultValue !== undefined && val === null) ? defaultValue : val; + }; + + /* Set page data */ + Store.prototype.setPage = function(objOrKey, val) + { + if($.isPlanObject(objOrKey)) + { + $.extend(true, this.page, objOrKey); + } + else + { + this.page[this.serialize(objOrKey)] = val; + } + this.savePage(); }; /* Check disabled status */ @@ -155,7 +200,7 @@ if (typeof jQuery === "undefined") { throw new Error("ZUI requires jQuery") } window.store = old; return store; } -}(window); +}(window, jQuery); /** * Format string diff --git a/dist/js/zui.lite.min.js b/dist/js/zui.lite.min.js index 2adc898eb..8c00efe52 100644 --- a/dist/js/zui.lite.min.js +++ b/dist/js/zui.lite.min.js @@ -7,5 +7,5 @@ /* Some code copy from Bootstrap v3.0.0 by @fat and @mdo. (Copyright 2013 Twitter, Inc. Licensed under http://www.apache.org/licenses/)*/ -if("undefined"==typeof jQuery)throw new Error("ZUI requires jQuery");+function(a){"use strict";var b="localStorage",c=a[b],d=a.store,e=function(){this.slience=!0,this.disabled=b in a&&a[b]&&a[b].setItem,this.storage=c};e.prototype.check=function(){if(this.disabled&&!this.slience)throw new Error("Browser not support localStorage or disabled status been set true.");return!this.disabled},e.prototype.length=function(){return this.check()?c.length:void 0},e.prototype.removeItem=function(a){c.removeItem(a)},e.prototype.remove=function(a){this.removeItem(a)},e.prototype.getItem=function(a){return c.getItem(a)},e.prototype.get=function(a,b){var c=this.deserialize(this.getItem(a));return void 0!==b&&null===c?b:c},e.prototype.key=function(a){return this.deserialize(c.key(a))},e.prototype.setItem=function(a,b){c.setItem(a,b)},e.prototype.set=function(a,b){return void 0===b?this.remove(a):void this.setItem(a,this.serialize(b))},e.prototype.clear=function(){c.clear(key)},e.prototype.forEach=function(a){for(var b=0;b0){var c;if(1==arguments.length&&"object"==typeof a)for(var d in a)void 0!=a[d]&&(c=new RegExp("({"+d+"})","g"),b=b.replace(c,a[d]));else for(var e=0;ei;i++)if(h[d[i]])return c.apply(this,arguments)}}}}a.hotkeys={version:"0.8",specialKeys:{8:"backspace",9:"tab",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",191:"/",224:"meta"},shiftNums:{"`":"~",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|"}},a.each(["keydown","keyup","keypress"],function(){a.event.special[this]={add:b}})})(jQuery),+function(a,b,c){"$:nomunge";function d(){e=b[h](function(){f.each(function(){var b=a(this),c=b.width(),d=b.height(),e=a.data(this,j);(c!==e.w||d!==e.h)&&b.trigger(i,[e.w=c,e.h=d])}),d()},g[k])}var e,f=a([]),g=a.resize=a.extend(a.resize,{}),h="setTimeout",i="resize",j=i+"-special-event",k="delay",l="throttleWindow";g[k]=250,g[l]=!0,a.event.special[i]={setup:function(){if(!g[l]&&this[h])return!1;var b=a(this);f=f.add(b),a.data(this,j,{w:b.width(),h:b.height()}),1===f.length&&d()},teardown:function(){if(!g[l]&&this[h])return!1;var b=a(this);f=f.not(b),b.removeData(j),f.length||clearTimeout(e)},add:function(b){function d(b,d,f){var g=a(this),h=a.data(this,j);h.w=d!==c?d:g.width(),h.h=f!==c?f:g.height(),e.apply(this,arguments)}if(!g[l]&&this[h])return!1;var e;return a.isFunction(b)?(e=b,d):(e=b.handler,void(b.handler=d))}}}(jQuery,this),+function(a,b,c,d){"use strict";a.extend({uuid:function(){for(var a=(new Date).getTime();1e16>a;)a*=10;return a+d.floor(9999*d.random())},getPropertyCount:function(a){return"object"!=typeof a||null==a?0:Object.getOwnPropertyNames(a).length},callEvent:function(b,c,d){if(a.isFunction(b)){"undefined"!=typeof d&&(b=a.proxy(b,d));var e=b(c);return!(void 0!=e&&!e)}return 1}})}(jQuery,window,document,Math),+function(a,b){var c=1200,d=992,e=768,f={desktop:"screen-desktop",desktopLg:"screen-desktop-wide",tablet:"screen-tablet",phone:"screen-phone",isMobile:"device-mobile",isDesktop:"device-desktop"},g=function(){var g=a(b).width();a("html").toggleClass(f.desktop,g>=d&&c>g).toggleClass(f.desktopLg,g>=c).toggleClass(f.tablet,g>=e&&d>g).toggleClass(f.phone,e>g).toggleClass(f.isMobile,d>g).toggleClass(f.isDesktop,g>=d)};a(b).resize(g),g()}(jQuery,window,document,Math),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]}}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one(a.support.transition.end,function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b()})}(jQuery),+function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype.close=function(b){function c(){f.trigger("closed.bs.alert").remove()}var d=a(this),e=d.attr("data-target");e||(e=d.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,""));var f=a(e);b&&b.preventDefault(),f.length||(f=d.hasClass("alert")?d:d.parent()),f.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one(a.support.transition.end,c).emulateTransitionEnd(150):c())};var d=a.fn.alert;a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("bs.alert");e||d.data("bs.alert",e=new c(this)),"string"==typeof b&&e[b].call(d)})},a.fn.alert.Constructor=c,a.fn.alert.noConflict=function(){return a.fn.alert=d,this},a(document).on("click.bs.alert.data-api",b,c.prototype.close)}(window.jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.isLoading=!1};b.DEFAULTS={loadingText:"loading..."},b.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",f.resetText||d.data("resetText",d[e]()),d[e](f[b]||this.options[b]),setTimeout(a.proxy(function(){"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},b.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")&&(c.prop("checked")&&this.$element.hasClass("active")?a=!1:b.find(".active").removeClass("active")),a&&c.prop("checked",!this.$element.hasClass("active")).trigger("change")}a&&this.$element.toggleClass("active")};var c=a.fn.button;a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof c&&c;e||d.data("bs.button",e=new b(this,f)),"toggle"==c?e.toggle():c&&e.setState(c)})},a.fn.button.Constructor=b,a.fn.button.noConflict=function(){return a.fn.button=c,this},a(document).on("click.bs.button.data-api","[data-toggle^=button]",function(b){var c=a(b.target);c.hasClass("btn")||(c=c.closest(".btn")),c.button("toggle"),b.preventDefault()})}(jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.transitioning=null,this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.DEFAULTS={toggle:!0},b.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},b.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b=a.Event("show.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.$parent&&this.$parent.find("> .panel > .in");if(c&&c.length){var d=c.data("bs.collapse");if(d&&d.transitioning)return;c.collapse("hide"),d||c.data("bs.collapse",null)}var e=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[e](0),this.transitioning=1;var f=function(){this.$element.removeClass("collapsing").addClass("in")[e]("auto"),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return f.call(this);var g=a.camelCase(["scroll",e].join("-"));this.$element.one(a.support.transition.end,a.proxy(f,this)).emulateTransitionEnd(350)[e](this.$element[0][g])}}},b.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var d=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return a.support.transition?void this.$element[c](0).one(a.support.transition.end,a.proxy(d,this)).emulateTransitionEnd(350):d.call(this)}}},b.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var c=a.fn.collapse;a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("bs.collapse"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c);e||d.data("bs.collapse",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.collapse.Constructor=b,a.fn.collapse.noConflict=function(){return a.fn.collapse=c,this},a(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(b){var c,d=a(this),e=d.attr("data-target")||b.preventDefault()||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,""),f=a(e),g=f.data("bs.collapse"),h=g?"toggle":d.data(),i=d.attr("data-parent"),j=i&&a(i);g&&g.transitioning||(j&&j.find('[data-toggle=collapse][data-parent="'+i+'"]').not(d).addClass("collapsed"),d[f.hasClass("in")?"addClass":"removeClass"]("collapsed")),f.collapse(h)})}(window.jQuery),+function(a){"use strict";function b(){a(d).remove(),a(e).each(function(b){var d=c(a(this));d.hasClass("open")&&(d.trigger(b=a.Event("hide.bs.dropdown")),b.isDefaultPrevented()||d.removeClass("open").trigger("hidden.bs.dropdown"))})}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}var d=".dropdown-backdrop",e="[data-toggle=dropdown]",f=function(b){a(b).on("click.bs.dropdown",this.toggle)};f.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){if("ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(''}),b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),b.prototype.constructor=b,b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.setContent=function(){var a=this.tip(),b=this.getTarget();if(b)return b.find(".arrow").length<1&&a.addClass("no-arrow"),void a.html(b.html());var c=this.getTitle(),d=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](c),a.find(".popover-content")[this.options.html?"html":"text"](d),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},b.prototype.hasContent=function(){return this.getTarget()||this.getTitle()||this.getContent()},b.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},b.prototype.getTarget=function(){var b=this.$element,c=this.options,d=b.attr("data-target")||("function"==typeof c.target?c.target.call(b[0]):c.target);return d?"$next"==d?b.next(".popover"):a(d):!1},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},b.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var c=a.fn.popover;a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof c&&c;e||d.data("bs.popover",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.popover.Constructor=b,a.fn.popover.noConflict=function(){return a.fn.popover=c,this}}(window.jQuery),+function(a){"use strict";var b=function(b){this.element=a(b)};b.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.attr("data-target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a")[0],f=a.Event("show.bs.tab",{relatedTarget:e});if(b.trigger(f),!f.isDefaultPrevented()){var g=a(d);this.activate(b.parent("li"),c),this.activate(g,g.parent(),function(){b.trigger({type:"shown.bs.tab",relatedTarget:e})})}}},b.prototype.activate=function(b,c,d){function e(){f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),g?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var f=c.find("> .active"),g=d&&a.support.transition&&f.hasClass("fade");g?f.one(a.support.transition.end,e).emulateTransitionEnd(150):e(),f.removeClass("in")};var c=a.fn.tab;a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new b(this)),"string"==typeof c&&e[c]()})},a.fn.tab.Constructor=b,a.fn.tab.noConflict=function(){return a.fn.tab=c,this},a(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})}(window.jQuery),+function(a,b){"use strict";function c(){this.show=function(b,c,f,g,h){a(".messager").hide(),d++,c=c||"default",g=g||2e3,h=h||"body",f=f||"top";var i=a(e.format({message:b,type:c,placement:f,id:d})).appendTo(h);return i.find(".close-messager").click(function(){a(this).closest(".messager").fadeOut()}),("top"==f||"bottom"==f)&&i.css("left",(a(h).width()-i.width()-50)/2),i.fadeIn(),setTimeout(function(){a("#messager"+d).fadeOut(function(){a(this).remove()})},g),i},this.primary=function(a,b,c,d){return this.show(a,"primary",b,c,d)},this.success=function(a,b,c,d){return this.show(' '+a,"success",b,c,d)},this.info=function(a,b,c,d){return this.show(' '+a,"info",b,c,d)},this.warning=function(a,b,c,d){return this.show(''+a,"warning",b,c,d)},this.danger=function(a,b,c,d){return this.show(''+a,"danger",b,c,d)},this.important=function(a,b,c,d){return this.show(a,"important",b,c,d)},this.special=function(a,b,c,d){return this.show(a,"special",b,c,d)}}var d=0,e='',f=new c; -b.messager=f}(jQuery,window,document,Math); \ No newline at end of file +if("undefined"==typeof jQuery)throw new Error("ZUI requires jQuery");+function(a,b){"use strict";var c="localStorage",d=a[c],e=a.store,f="page_"+a.location.pathname,g=function(){this.slience=!0,this.disabled=c in a&&a[c]&&a[c].setItem,this.storage=d;this.page=this.get(f,{})};g.prototype.savePage=function(){b.isEmptyObject(this.page)?this.remove(f):this.set(f,this.page)},g.prototype.clearPage=function(){this.page={},this.savePage()},g.prototype.getPage=function(a,b){var c=this.page[a];return void 0!==b&&null===c?b:c},g.prototype.setPage=function(a,c){b.isPlanObject(a)?b.extend(!0,this.page,a):this.page[this.serialize(a)]=c,this.savePage()},g.prototype.check=function(){if(this.disabled&&!this.slience)throw new Error("Browser not support localStorage or disabled status been set true.");return!this.disabled},g.prototype.length=function(){return this.check()?d.length:void 0},g.prototype.removeItem=function(a){d.removeItem(a)},g.prototype.remove=function(a){this.removeItem(a)},g.prototype.getItem=function(a){return d.getItem(a)},g.prototype.get=function(a,b){var c=this.deserialize(this.getItem(a));return void 0!==b&&null===c?b:c},g.prototype.key=function(a){return this.deserialize(d.key(a))},g.prototype.setItem=function(a,b){d.setItem(a,b)},g.prototype.set=function(a,b){return void 0===b?this.remove(a):void this.setItem(a,this.serialize(b))},g.prototype.clear=function(){d.clear(key)},g.prototype.forEach=function(a){for(var b=0;b0){var c;if(1==arguments.length&&"object"==typeof a)for(var d in a)void 0!=a[d]&&(c=new RegExp("({"+d+"})","g"),b=b.replace(c,a[d]));else for(var e=0;ei;i++)if(h[d[i]])return c.apply(this,arguments)}}}}a.hotkeys={version:"0.8",specialKeys:{8:"backspace",9:"tab",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",191:"/",224:"meta"},shiftNums:{"`":"~",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|"}},a.each(["keydown","keyup","keypress"],function(){a.event.special[this]={add:b}})})(jQuery),+function(a,b,c){"$:nomunge";function d(){e=b[h](function(){f.each(function(){var b=a(this),c=b.width(),d=b.height(),e=a.data(this,j);(c!==e.w||d!==e.h)&&b.trigger(i,[e.w=c,e.h=d])}),d()},g[k])}var e,f=a([]),g=a.resize=a.extend(a.resize,{}),h="setTimeout",i="resize",j=i+"-special-event",k="delay",l="throttleWindow";g[k]=250,g[l]=!0,a.event.special[i]={setup:function(){if(!g[l]&&this[h])return!1;var b=a(this);f=f.add(b),a.data(this,j,{w:b.width(),h:b.height()}),1===f.length&&d()},teardown:function(){if(!g[l]&&this[h])return!1;var b=a(this);f=f.not(b),b.removeData(j),f.length||clearTimeout(e)},add:function(b){function d(b,d,f){var g=a(this),h=a.data(this,j);h.w=d!==c?d:g.width(),h.h=f!==c?f:g.height(),e.apply(this,arguments)}if(!g[l]&&this[h])return!1;var e;return a.isFunction(b)?(e=b,d):(e=b.handler,void(b.handler=d))}}}(jQuery,this),+function(a,b,c,d){"use strict";a.extend({uuid:function(){for(var a=(new Date).getTime();1e16>a;)a*=10;return a+d.floor(9999*d.random())},getPropertyCount:function(a){return"object"!=typeof a||null==a?0:Object.getOwnPropertyNames(a).length},callEvent:function(b,c,d){if(a.isFunction(b)){"undefined"!=typeof d&&(b=a.proxy(b,d));var e=b(c);return!(void 0!=e&&!e)}return 1}})}(jQuery,window,document,Math),+function(a,b){var c=1200,d=992,e=768,f={desktop:"screen-desktop",desktopLg:"screen-desktop-wide",tablet:"screen-tablet",phone:"screen-phone",isMobile:"device-mobile",isDesktop:"device-desktop"},g=function(){var g=a(b).width();a("html").toggleClass(f.desktop,g>=d&&c>g).toggleClass(f.desktopLg,g>=c).toggleClass(f.tablet,g>=e&&d>g).toggleClass(f.phone,e>g).toggleClass(f.isMobile,d>g).toggleClass(f.isDesktop,g>=d)};a(b).resize(g),g()}(jQuery,window,document,Math),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]}}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one(a.support.transition.end,function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b()})}(jQuery),+function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype.close=function(b){function c(){f.trigger("closed.bs.alert").remove()}var d=a(this),e=d.attr("data-target");e||(e=d.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,""));var f=a(e);b&&b.preventDefault(),f.length||(f=d.hasClass("alert")?d:d.parent()),f.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one(a.support.transition.end,c).emulateTransitionEnd(150):c())};var d=a.fn.alert;a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("bs.alert");e||d.data("bs.alert",e=new c(this)),"string"==typeof b&&e[b].call(d)})},a.fn.alert.Constructor=c,a.fn.alert.noConflict=function(){return a.fn.alert=d,this},a(document).on("click.bs.alert.data-api",b,c.prototype.close)}(window.jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.isLoading=!1};b.DEFAULTS={loadingText:"loading..."},b.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",f.resetText||d.data("resetText",d[e]()),d[e](f[b]||this.options[b]),setTimeout(a.proxy(function(){"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},b.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")&&(c.prop("checked")&&this.$element.hasClass("active")?a=!1:b.find(".active").removeClass("active")),a&&c.prop("checked",!this.$element.hasClass("active")).trigger("change")}a&&this.$element.toggleClass("active")};var c=a.fn.button;a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof c&&c;e||d.data("bs.button",e=new b(this,f)),"toggle"==c?e.toggle():c&&e.setState(c)})},a.fn.button.Constructor=b,a.fn.button.noConflict=function(){return a.fn.button=c,this},a(document).on("click.bs.button.data-api","[data-toggle^=button]",function(b){var c=a(b.target);c.hasClass("btn")||(c=c.closest(".btn")),c.button("toggle"),b.preventDefault()})}(jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.transitioning=null,this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.DEFAULTS={toggle:!0},b.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},b.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b=a.Event("show.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.$parent&&this.$parent.find("> .panel > .in");if(c&&c.length){var d=c.data("bs.collapse");if(d&&d.transitioning)return;c.collapse("hide"),d||c.data("bs.collapse",null)}var e=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[e](0),this.transitioning=1;var f=function(){this.$element.removeClass("collapsing").addClass("in")[e]("auto"),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return f.call(this);var g=a.camelCase(["scroll",e].join("-"));this.$element.one(a.support.transition.end,a.proxy(f,this)).emulateTransitionEnd(350)[e](this.$element[0][g])}}},b.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var d=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return a.support.transition?void this.$element[c](0).one(a.support.transition.end,a.proxy(d,this)).emulateTransitionEnd(350):d.call(this)}}},b.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var c=a.fn.collapse;a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("bs.collapse"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c);e||d.data("bs.collapse",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.collapse.Constructor=b,a.fn.collapse.noConflict=function(){return a.fn.collapse=c,this},a(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(b){var c,d=a(this),e=d.attr("data-target")||b.preventDefault()||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,""),f=a(e),g=f.data("bs.collapse"),h=g?"toggle":d.data(),i=d.attr("data-parent"),j=i&&a(i);g&&g.transitioning||(j&&j.find('[data-toggle=collapse][data-parent="'+i+'"]').not(d).addClass("collapsed"),d[f.hasClass("in")?"addClass":"removeClass"]("collapsed")),f.collapse(h)})}(window.jQuery),+function(a){"use strict";function b(){a(d).remove(),a(e).each(function(b){var d=c(a(this));d.hasClass("open")&&(d.trigger(b=a.Event("hide.bs.dropdown")),b.isDefaultPrevented()||d.removeClass("open").trigger("hidden.bs.dropdown"))})}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}var d=".dropdown-backdrop",e="[data-toggle=dropdown]",f=function(b){a(b).on("click.bs.dropdown",this.toggle)};f.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){if("ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(''}),b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),b.prototype.constructor=b,b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.setContent=function(){var a=this.tip(),b=this.getTarget();if(b)return b.find(".arrow").length<1&&a.addClass("no-arrow"),void a.html(b.html());var c=this.getTitle(),d=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](c),a.find(".popover-content")[this.options.html?"html":"text"](d),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},b.prototype.hasContent=function(){return this.getTarget()||this.getTitle()||this.getContent()},b.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},b.prototype.getTarget=function(){var b=this.$element,c=this.options,d=b.attr("data-target")||("function"==typeof c.target?c.target.call(b[0]):c.target);return d?"$next"==d?b.next(".popover"):a(d):!1},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},b.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var c=a.fn.popover;a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof c&&c;e||d.data("bs.popover",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.popover.Constructor=b,a.fn.popover.noConflict=function(){return a.fn.popover=c,this}}(window.jQuery),+function(a){"use strict";var b=function(b){this.element=a(b)};b.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.attr("data-target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a")[0],f=a.Event("show.bs.tab",{relatedTarget:e});if(b.trigger(f),!f.isDefaultPrevented()){var g=a(d);this.activate(b.parent("li"),c),this.activate(g,g.parent(),function(){b.trigger({type:"shown.bs.tab",relatedTarget:e})})}}},b.prototype.activate=function(b,c,d){function e(){f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),g?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var f=c.find("> .active"),g=d&&a.support.transition&&f.hasClass("fade");g?f.one(a.support.transition.end,e).emulateTransitionEnd(150):e(),f.removeClass("in")};var c=a.fn.tab;a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new b(this)),"string"==typeof c&&e[c]()})},a.fn.tab.Constructor=b,a.fn.tab.noConflict=function(){return a.fn.tab=c,this},a(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})}(window.jQuery),+function(a,b){"use strict";function c(){this.show=function(b,c,f,g,h){a(".messager").hide(),d++,c=c||"default",g=g||2e3,h=h||"body",f=f||"top";var i=a(e.format({message:b,type:c,placement:f,id:d})).appendTo(h);return i.find(".close-messager").click(function(){a(this).closest(".messager").fadeOut()}),("top"==f||"bottom"==f)&&i.css("left",(a(h).width()-i.width()-50)/2),i.fadeIn(),setTimeout(function(){a("#messager"+d).fadeOut(function(){a(this).remove()})},g),i},this.primary=function(a,b,c,d){return this.show(a,"primary",b,c,d)},this.success=function(a,b,c,d){return this.show(' '+a,"success",b,c,d)},this.info=function(a,b,c,d){return this.show(' '+a,"info",b,c,d) +},this.warning=function(a,b,c,d){return this.show(''+a,"warning",b,c,d)},this.danger=function(a,b,c,d){return this.show(''+a,"danger",b,c,d)},this.important=function(a,b,c,d){return this.show(a,"important",b,c,d)},this.special=function(a,b,c,d){return this.show(a,"special",b,c,d)}}var d=0,e='',f=new c;b.messager=f}(jQuery,window,document,Math); \ No newline at end of file diff --git a/dist/js/zui.min.js b/dist/js/zui.min.js index 0abd2d606..1f25a0ff9 100644 --- a/dist/js/zui.min.js +++ b/dist/js/zui.min.js @@ -7,6 +7,6 @@ /* Some code copy from Bootstrap v3.0.0 by @fat and @mdo. (Copyright 2013 Twitter, Inc. Licensed under http://www.apache.org/licenses/)*/ -if("undefined"==typeof jQuery)throw new Error("ZUI requires jQuery");+function(a){"use strict";var b="localStorage",c=a[b],d=a.store,e=function(){this.slience=!0,this.disabled=b in a&&a[b]&&a[b].setItem,this.storage=c};e.prototype.check=function(){if(this.disabled&&!this.slience)throw new Error("Browser not support localStorage or disabled status been set true.");return!this.disabled},e.prototype.length=function(){return this.check()?c.length:void 0},e.prototype.removeItem=function(a){c.removeItem(a)},e.prototype.remove=function(a){this.removeItem(a)},e.prototype.getItem=function(a){return c.getItem(a)},e.prototype.get=function(a,b){var c=this.deserialize(this.getItem(a));return void 0!==b&&null===c?b:c},e.prototype.key=function(a){return this.deserialize(c.key(a))},e.prototype.setItem=function(a,b){c.setItem(a,b)},e.prototype.set=function(a,b){return void 0===b?this.remove(a):void this.setItem(a,this.serialize(b))},e.prototype.clear=function(){c.clear(key)},e.prototype.forEach=function(a){for(var b=0;bi;i++)if(h[d[i]])return c.apply(this,arguments)}}}}a.hotkeys={version:"0.8",specialKeys:{8:"backspace",9:"tab",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",191:"/",224:"meta"},shiftNums:{"`":"~",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|"}},a.each(["keydown","keyup","keypress"],function(){a.event.special[this]={add:b}})}(jQuery),+function(a,b,c){"$:nomunge";function d(){e=b[h](function(){f.each(function(){var b=a(this),c=b.width(),d=b.height(),e=a.data(this,j);(c!==e.w||d!==e.h)&&b.trigger(i,[e.w=c,e.h=d])}),d()},g[k])}var e,f=a([]),g=a.resize=a.extend(a.resize,{}),h="setTimeout",i="resize",j=i+"-special-event",k="delay",l="throttleWindow";g[k]=250,g[l]=!0,a.event.special[i]={setup:function(){if(!g[l]&&this[h])return!1;var b=a(this);f=f.add(b),a.data(this,j,{w:b.width(),h:b.height()}),1===f.length&&d()},teardown:function(){if(!g[l]&&this[h])return!1;var b=a(this);f=f.not(b),b.removeData(j),f.length||clearTimeout(e)},add:function(b){function d(b,d,f){var g=a(this),h=a.data(this,j);h.w=d!==c?d:g.width(),h.h=f!==c?f:g.height(),e.apply(this,arguments)}if(!g[l]&&this[h])return!1;var e;return a.isFunction(b)?(e=b,d):(e=b.handler,void(b.handler=d))}}}(jQuery,this),String.prototype.format=function(a){var b=this;if(arguments.length>0){var c;if(1==arguments.length&&"object"==typeof a)for(var d in a)void 0!=a[d]&&(c=new RegExp("({"+d+"})","g"),b=b.replace(c,a[d]));else for(var e=0;en;n++){var p=m[n].split("="),q=c(p.shift()),r=p.join("=");if(e&&e===q){l=f(r,g);break}e||void 0===(r=f(r))||(l[q]=r)}return l};h.defaults={},a.removeCookie=function(b,c){return void 0===a.cookie(b)?!1:(a.cookie(b,"",a.extend({},c,{expires:-1})),!a.cookie(b))}}),+function(a,b,c,d){"use strict";a.extend({uuid:function(){for(var a=(new Date).getTime();1e16>a;)a*=10;return a+d.floor(9999*d.random())},getPropertyCount:function(a){return"object"!=typeof a||null==a?0:Object.getOwnPropertyNames(a).length},callEvent:function(b,c,d){if(a.isFunction(b)){"undefined"!=typeof d&&(b=a.proxy(b,d));var e=b(c);return!(void 0!=e&&!e)}return 1}})}(jQuery,window,document,Math),+function(a,b){var c=1200,d=992,e=768,f={desktop:"screen-desktop",desktopLg:"screen-desktop-wide",tablet:"screen-tablet",phone:"screen-phone",isMobile:"device-mobile",isDesktop:"device-desktop"},g=function(){var g=a(b).width();a("html").toggleClass(f.desktop,g>=d&&c>g).toggleClass(f.desktopLg,g>=c).toggleClass(f.tablet,g>=e&&d>g).toggleClass(f.phone,e>g).toggleClass(f.isMobile,d>g).toggleClass(f.isDesktop,g>=d)};a(b).resize(g),g()}(jQuery,window,document,Math),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]}}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one(a.support.transition.end,function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b()})}(jQuery),+function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype.close=function(b){function c(){f.trigger("closed.bs.alert").remove()}var d=a(this),e=d.attr("data-target");e||(e=d.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,""));var f=a(e);b&&b.preventDefault(),f.length||(f=d.hasClass("alert")?d:d.parent()),f.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one(a.support.transition.end,c).emulateTransitionEnd(150):c())};var d=a.fn.alert;a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("bs.alert");e||d.data("bs.alert",e=new c(this)),"string"==typeof b&&e[b].call(d)})},a.fn.alert.Constructor=c,a.fn.alert.noConflict=function(){return a.fn.alert=d,this},a(document).on("click.bs.alert.data-api",b,c.prototype.close)}(window.jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.isLoading=!1};b.DEFAULTS={loadingText:"loading..."},b.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",f.resetText||d.data("resetText",d[e]()),d[e](f[b]||this.options[b]),setTimeout(a.proxy(function(){"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},b.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")&&(c.prop("checked")&&this.$element.hasClass("active")?a=!1:b.find(".active").removeClass("active")),a&&c.prop("checked",!this.$element.hasClass("active")).trigger("change")}a&&this.$element.toggleClass("active")};var c=a.fn.button;a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof c&&c;e||d.data("bs.button",e=new b(this,f)),"toggle"==c?e.toggle():c&&e.setState(c)})},a.fn.button.Constructor=b,a.fn.button.noConflict=function(){return a.fn.button=c,this},a(document).on("click.bs.button.data-api","[data-toggle^=button]",function(b){var c=a(b.target);c.hasClass("btn")||(c=c.closest(".btn")),c.button("toggle"),b.preventDefault()})}(jQuery),+function(a){"use strict";var b=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter",a.proxy(this.pause,this)).on("mouseleave",a.proxy(this.cycle,this))};b.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,touchable:!0},b.prototype.touchable=function(){function b(b){var b=b||window.event;b.originalEvent&&(b=b.originalEvent);var f=a(this);switch(b.type){case"touchstart":d=b.touches[0].pageX,e=b.touches[0].pageY;break;case"touchend":var g=b.changedTouches[0].pageX-d,h=b.changedTouches[0].pageY-e;if(Math.abs(g)>Math.abs(h))c(f,g),Math.abs(g)>10&&b.preventDefault();else{var i=a(window);a("body,html").animate({scrollTop:i.scrollTop()-h},400)}}}function c(a,b){b>10&&a.find(".left.carousel-control").click(),-10>b&&a.find(".right.carousel-control").click()}if(this.options.touchable){this.$element.on("touchstart touchmove touchend",b);var d,e}},b.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},b.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},b.prototype.to=function(b){var c=this,d=this.getActiveIndex();return b>this.$items.length-1||0>b?void 0:this.sliding?this.$element.one("slid",function(){c.to(b)}):d==b?this.pause().cycle():this.slide(b>d?"next":"prev",a(this.$items[b]))},b.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition.end&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},b.prototype.next=function(){return this.sliding?void 0:this.slide("next")},b.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},b.prototype.slide=function(b,c){var d=this.$element.find(".item.active"),e=c||d[b](),f=this.interval,g="next"==b?"left":"right",h="next"==b?"first":"last",i=this;if(!e.length){if(!this.options.wrap)return;e=this.$element.find(".item")[h]()}this.sliding=!0,f&&this.pause();var j=a.Event("slide.bs.carousel",{relatedTarget:e[0],direction:g});if(!e.hasClass("active")){if(this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid",function(){var b=a(i.$indicators.children()[i.getActiveIndex()]);b&&b.addClass("active")})),a.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(j),j.isDefaultPrevented())return;e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),d.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid")},0)}).emulateTransitionEnd(600)}else{if(this.$element.trigger(j),j.isDefaultPrevented())return;d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return f&&this.cycle(),this}};var c=a.fn.carousel;a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c),g="string"==typeof c?c:f.slide;e||d.data("bs.carousel",e=new b(this,f)),"number"==typeof c?e.to(c):g?e[g]():f.interval&&e.pause().cycle(),f.touchable&&e.touchable()})},a.fn.carousel.Constructor=b,a.fn.carousel.noConflict=function(){return a.fn.carousel=c,this},a(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(b){var c,d=a(this),e=a(d.attr("data-target")||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"")),f=a.extend({},e.data(),d.data()),g=d.attr("data-slide-to");g&&(f.interval=!1),e.carousel(f),(g=d.attr("data-slide-to"))&&e.data("bs.carousel").to(g),b.preventDefault()}),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var b=a(this);b.carousel(b.data())})})}(window.jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.transitioning=null,this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.DEFAULTS={toggle:!0},b.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},b.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b=a.Event("show.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.$parent&&this.$parent.find("> .panel > .in");if(c&&c.length){var d=c.data("bs.collapse");if(d&&d.transitioning)return;c.collapse("hide"),d||c.data("bs.collapse",null)}var e=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[e](0),this.transitioning=1;var f=function(){this.$element.removeClass("collapsing").addClass("in")[e]("auto"),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return f.call(this);var g=a.camelCase(["scroll",e].join("-"));this.$element.one(a.support.transition.end,a.proxy(f,this)).emulateTransitionEnd(350)[e](this.$element[0][g])}}},b.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var d=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return a.support.transition?void this.$element[c](0).one(a.support.transition.end,a.proxy(d,this)).emulateTransitionEnd(350):d.call(this)}}},b.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var c=a.fn.collapse;a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("bs.collapse"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c);e||d.data("bs.collapse",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.collapse.Constructor=b,a.fn.collapse.noConflict=function(){return a.fn.collapse=c,this},a(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(b){var c,d=a(this),e=d.attr("data-target")||b.preventDefault()||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,""),f=a(e),g=f.data("bs.collapse"),h=g?"toggle":d.data(),i=d.attr("data-parent"),j=i&&a(i);g&&g.transitioning||(j&&j.find('[data-toggle=collapse][data-parent="'+i+'"]').not(d).addClass("collapsed"),d[f.hasClass("in")?"addClass":"removeClass"]("collapsed")),f.collapse(h)})}(window.jQuery),+function(a){"use strict";function b(){a(d).remove(),a(e).each(function(b){var d=c(a(this));d.hasClass("open")&&(d.trigger(b=a.Event("hide.bs.dropdown")),b.isDefaultPrevented()||d.removeClass("open").trigger("hidden.bs.dropdown"))})}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}var d=".dropdown-backdrop",e="[data-toggle=dropdown]",f=function(b){a(b).on("click.bs.dropdown",this.toggle)};f.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){if("ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(''}),b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),b.prototype.constructor=b,b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.setContent=function(){var a=this.tip(),b=this.getTarget();if(b)return b.find(".arrow").length<1&&a.addClass("no-arrow"),void a.html(b.html());var c=this.getTitle(),d=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](c),a.find(".popover-content")[this.options.html?"html":"text"](d),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},b.prototype.hasContent=function(){return this.getTarget()||this.getTitle()||this.getContent()},b.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},b.prototype.getTarget=function(){var b=this.$element,c=this.options,d=b.attr("data-target")||("function"==typeof c.target?c.target.call(b[0]):c.target);return d?"$next"==d?b.next(".popover"):a(d):!1},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},b.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var c=a.fn.popover;a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof c&&c;e||d.data("bs.popover",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.popover.Constructor=b,a.fn.popover.noConflict=function(){return a.fn.popover=c,this}}(window.jQuery),+function(a){"user strict";var b=function(a,b){this.init("pager",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");if(!a.fn.popover)throw new Error("Popover requires popover.js");b.prototype.init=function(b,c,d){this.type=b,this.$element=a(c),this.options=d,this.computeIndex(),this.$element.popover({container:"body",trigger:"manual",html:!0,template:'
'}).on("click."+this.type,!1,a.proxy(this.showPopover,this))},b.prototype.hidePopover=function(){var b=this.$element;"true"==b.attr("data-safe-close")?(b.popover("hide").attr("data-safe-close",!1),a(document).unbind("click",this.hidePopover)):b.attr("data-safe-close",!0)},b.prototype.showPopover=function(){var b=this.$element;b.attr("data-content")||b.attr("data-content","
    "+this.setContent(this.getUrl())+"
"),b.popover("show"),a(document).bind("click",a.proxy(this.hidePopover,this))},b.prototype.setContent=function(a){var b="";if(this.isRangeIndex)for(var c=this.indexStart;c<=this.indexEnd;c++)b+="
  • "+c+"
  • ";else for(var c=this.indexs.length-1;c>=0;c--){var d=this.indexs[c];b+="
  • "+d+"
  • "}return b},b.prototype.getUrl=function(){var a=this.$element,b=this.options;return a.attr("data-url")||a.attr("href")||("function"==typeof b.url?b.url.call(a[0]):b.url)||"?page=%"},b.prototype.computeIndex=function(){var a=this.$element,b=a.closest("li"),c=this.options,d=a.attr("data-index")||("function"==typeof c.index?c.index.call(a[0]):c.index)||b.prev("li").find("a").text()-0+1+"-"+(b.next("li").find("a").text()-1);if(d.indexOf("-")>0){this.isRangeIndex=!0;var e=d.split("-");this.indexStart=e[0]-0,this.indexEnd=e[1]-0,this.indexCount=this.indexEnd-this.indexStart}else this.indexs=d.split(","),this.indexCount=this.indexs.length};var c=a.fn.pager;a.fn.pager=function(c){return this.each(function(){var d=a(this),e=d.data("bs.pager"),f="object"==typeof c&&c;e||d.data("bs.pager",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.pager.Constructor=b,a.fn.pager.noConflict=function(){return a.fn.pager=c,this}}(window.jQuery),+function(a){"use strict";var b=function(b){this.element=a(b)};b.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.attr("data-target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a")[0],f=a.Event("show.bs.tab",{relatedTarget:e});if(b.trigger(f),!f.isDefaultPrevented()){var g=a(d);this.activate(b.parent("li"),c),this.activate(g,g.parent(),function(){b.trigger({type:"shown.bs.tab",relatedTarget:e})})}}},b.prototype.activate=function(b,c,d){function e(){f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),g?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var f=c.find("> .active"),g=d&&a.support.transition&&f.hasClass("fade");g?f.one(a.support.transition.end,e).emulateTransitionEnd(150):e(),f.removeClass("in")};var c=a.fn.tab;a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new b(this)),"string"==typeof c&&e[c]()})},a.fn.tab.Constructor=b,a.fn.tab.noConflict=function(){return a.fn.tab=c,this},a(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})}(window.jQuery);var imgReady=function(){var a=[],b=null,c=function(){for(var b=0;b1024)&&(e.call(m),h.end=!0)},h(),m.onload=function(){!h.end&&h(),f&&f.call(m),m=m.onload=m.onerror=null},void(h.end||(a.push(h),null===b&&(b=setInterval(c,40)))))}}();+function(a,b,c,d){"use strict";if(!a.fn.modalTrigger)throw new Error("modal & modalTrigger requires for lightbox");if(!imgReady)throw new Error("imgReady requires for lightbox");var e=function(b,c){this.$=a(b),this.options=this.getOptions(c),this.init()};e.DEFAULTS={modalTeamplate:'