; /*! * jQuery Cookie Plugin v1.4.1 * https://github.com/carhartl/jquery-cookie * * Copyright 2013 Klaus Hartl * Released under the MIT license */ (function (factory) { if (typeof define === 'function' && define.amd) { // AMD define(['jquery'], factory); } else if (typeof exports === 'object') { // CommonJS factory(require('jquery')); } else { // Browser globals factory(jQuery); } }(function ($) { var pluses = /\+/g; function encode(s) { return config.raw ? s : encodeURIComponent(s); } function decode(s) { return config.raw ? s : decodeURIComponent(s); } function stringifyCookievalsue(value) { return encode(config.json ? JSON.stringify(value) : String(value)); } function parseCookievalsue(s) { if (s.indexOf('"') === 0) { // This is a quoted cookie as according to RFC2068, unescape... s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\'); } try { // Replace server-side written pluses with spaces. // If we can't decode the cookie, ignore it, it's unusable. // If we can't parse the cookie, ignore it, it's unusable. s = decodeURIComponent(s.replace(pluses, ' ')); return config.json ? JSON.parse(s) : s; } catch(e) {} } function read(s, converter) { var value = config.raw ? s : parseCookievalsue(s); return $.isFunction(converter) ? converter(value) : value; } var config = $.cookie = function (key, value, options) { // Write if (value !== undefined && !$.isFunction(value)) { options = $.extend({}, config.defaults, options); if (typeof options.expires === 'number') { var days = options.expires, t = options.expires = new Date(); t.setTime(+t + days * 864e+5); } return (document.cookie = [ encode(key), '=', stringifyCookievalsue(value), options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE options.path ? '; path=' + options.path : '', options.domain ? '; domain=' + options.domain : '', options.secure ? '; secure' : '' ].join('')); } // Read var result = key ? undefined : {}; // To prevent the for loop in the first place assign an empty array // in case there are no cookies at all. Also prevents odd result when // calling $.cookie(). var cookies = document.cookie ? document.cookie.split('; ') : []; for (var i = 0, l = cookies.length; i < l; i++) { var parts = cookies[i].split('='); var name = decode(parts.shift()); var cookie = parts.join('='); if (key && key === name) { // If second argument (value) is a function it's a converter... result = read(cookie, value); break; } // Prevent storing a cookie that we couldn't decode. if (!key && (cookie = read(cookie)) !== undefined) { result[name] = cookie; } } return result; }; config.defaults = {}; $.removeCookie = function (key, options) { if ($.cookie(key) === undefined) { return false; } // Must not alter options, thus extending a fresh object... $.cookie(key, '', $.extend({}, options, { expires: -1 })); return !$.cookie(key); };})); ; /*! * Bootstrap v3.3.6 (http://getbootstrap.com) * Copyright 2011-2015 Twitter, Inc. * Licensed under the MIT license */ if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1||b[0]>2)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",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(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.6",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.6",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.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")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),a(c.target).is('input[type="radio"]')||a(c.target).is('input[type="checkbox"]')||c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.6",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.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},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.6",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.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 in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hiddm.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hiddm.bs.dropdown",f)))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.6",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger(a.Event("shown.bs.dropdown",h))}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&jdocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),c.isInStateTrue()?void 0:(clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide())},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-mo.width?"left":"left"==h&&k.left-lg.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;jg.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.6",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.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)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.6",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b=e[a]&&(void 0===e[a+1]||b .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.6",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=e?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery);; /*! * jQuery-ajaxTransport-XDomainRequest - v1.0.4 - 2015-03-05 * https://github.com/MoonScript/jQuery-ajaxTransport-XDomainRequest * Copyright (c) 2015 Jason Moon (@JSONMOON) * Licensed MIT (/blob/master/LICENSE.txt) */ (function(factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as anonymous module. define(['jquery'], factory); } else if (typeof exports === 'object') { // CommonJS module.exports = factory(require('jquery')); } else { // Browser globals. factory(jQuery); } }(function($) {// Only continue if we're on IE8/IE9 with jQuery 1.5+ (contains the ajaxTransport function) if ($.support.cors || !$.ajaxTransport || !window.XDomainRequest) { return $; }var httpRegEx = /^(https?:)?\/\//i; var getOrPostRegEx = /^get|post$/i; var sameSchemeRegEx = new RegExp('^(\/\/|' + locations.protocol + ')', 'i');// ajaxTransport exists in jQuery 1.5+ $.ajaxTransport('* text html xml json', function(options, userOptions, jqXHR) { // Only continue if the request is: asynchronous, uses GET or POST method, has HTTP or HTTPS protocol, and has the same scheme as the calling page if (!options.crossDomain || !options.async || !getOrPostRegEx.test(options.type) || !httpRegEx.test(options.url) || !sameSchemeRegEx.test(options.url)) { return; } var xdr = null; return { send: function(headers, complete) { var postData = ''; var userType = (userOptions.dataType || '').toLowerCase(); xdr = new XDomainRequest(); if (/^\d+$/.test(userOptions.timeout)) { xdr.timeout = userOptions.timeout; } xdr.ontimeout = function() { complete(500, 'timeout'); }; xdr.onload = function() { var allResponseHeaders = 'Content-Length: ' + xdr.responseText.length + '\r\nContent-Type: ' + xdr.contentType; var status = { code: 200, message: 'success' }; var responses = { text: xdr.responseText }; try { if (userType === 'html' || /text\/html/i.test(xdr.contentType)) { responses.html = xdr.responseText; } else if (userType === 'json' || (userType !== 'text' && /\/json/i.test(xdr.contentType))) { try { responses.json = $.parseJSON(xdr.responseText); } catch(e) { status.code = 500; status.message = 'parseerror'; //throw 'Invalid JSON: ' + xdr.responseText; } } else if (userType === 'xml' || (userType !== 'text' && /\/xml/i.test(xdr.contentType))) { var doc = new ActiveXObject('Microsoft.XMLDOM'); doc.async = false; try { doc.loadXML(xdr.responseText); } catch(e) { doc = undefined; } if (!doc || !doc.documentElement || doc.getElementsByTagName('parsererror').length) { status.code = 500; status.message = 'parseerror'; throw 'Invalid XML: ' + xdr.responseText; } responses.xml = doc; } } catch(parseMessage) { throw parseMessage; } finally { complete(status.code, status.message, responses, allResponseHeaders); } }; // set an empty handler for 'onprogress' so requests don't get aborted xdr.onprogress = function(){}; xdr.onerror = function() { complete(500, 'error', { text: xdr.responseText }); }; if (userOptions.data) { postData = ($.type(userOptions.data) === 'string') ? userOptions.data : $.param(userOptions.data); } xdr.open(options.type, options.url); xdr.send(postData); }, abort: function() { if (xdr) { xdr.abort(); } } }; });return $;})); ; /*!art-template - Template Engine | http://aui.github.com/artTemplate/*/ !function () { function a(a) { return a.replace(t, "").replace(u, ",").replace(v, "").replace(w, "").replace(x, "").split(y) } function b(a) { return "'" + a.replace(/('|\\)/g, "\\$1").replace(/\r/g, "\\r").replace(/\n/g, "\\n") + "'" } function c(c, d) { function e(a) { return m += a.split(/\n/).length - 1, k && (a = a.replace(/\s+/g, " ").replace(//g, "")), a && (a = s[1] + b(a) + s[2] + "\n"), a } function f(b) { var c = m; if (j ? b = j(b, d) : g && (b = b.replace(/\n/g, function () { return m++, "$line=" + m + ";" })), 0 === b.indexOf("=")) { var e = l && !/^=[=#]/.test(b); if (b = b.replace(/^=[=#]?|[\s;]*$/g, ""), e) { var f = b.replace(/\s*\([^\)]+\)/, ""); n[f] || /^(include|print)$/.test(f) || (b = "$escape(" + b + ")") } else b = "$string(" + b + ")"; b = s[1] + b + s[2] } return g && (b = "$line=" + c + ";" + b), r(a(b), function (a) { if (a && !p[a]) { var b; b = "print" === a ? u : "include" === a ? v : n[a] ? "$utils." + a : o[a] ? "$helpers." + a : "$data." + a, w += a + "=" + b + ",", p[a] = !0 } }), b + "\n" } var g = d.debug, h = d.openTag, i = d.closeTag, j = d.parser, k = d.compress, l = d.escape, m = 1, p = { $data: 1, $filename: 1, $utils: 1, $helpers: 1, $out: 1, $line: 1 }, q = "".trim, s = q ? ["$out='';", "$out+=", ";", "$out"] : ["$out=[];", "$out.push(", ");", "$out.join('')"], t = q ? "$out+=text;return $out;" : "$out.push(text);", u = "function(){var text=''.concat.apply('',arguments);" + t + "}", v = "function(filename,data){data=data||$data;var text=$utils.$include(filename,data,$filename);" + t + "}", w = "'use strict';var $utils=this,$helpers=$utils.$helpers," + (g ? "$line=0," : ""), x = s[0], y = "return new String(" + s[3] + ");"; r(c.split(h), function (a) { a = a.split(i); var b = a[0], c = a[1]; 1 === a.length ? x += e(b) : (x += f(b), c && (x += e(c))) }); var z = w + x + y; g && (z = "try{" + z + "}catch(e){throw {filename:$filename,name:'Render Error',message:e.message,line:$line,source:" + b(c) + ".split(/\\n/)[$line-1].replace(/^\\s+/,'')};}"); try { var A = new Function("$data", "$filename", z); return A.prototype = n, A } catch (B) { throw B.temp = "function anonymous($data,$filename) {" + z + "}", B } } var d = function (a, b) { return "string" == typeof b ? q(b, { filename: a }) : g(a, b) }; d.version = "3.0.0", d.config = function (a, b) { e[a] = b }; var e = d.defaults = { openTag: "<%", closeTag: "%>", escape: !0, cache: !0, compress: !1, parser: null }, f = d.cache = {}; d.render = function (a, b) { return q(a, b) }; var g = d.renderFile = function (a, b) { var c = d.get(a) || p({ filename: a, name: "Render Error", message: "Template not found" }); return b ? c(b) : c }; d.get = function (a) { var b; if (f[a]) b = f[a]; else if ("object" == typeof document) { var c = document.getElementById(a); if (c) { var d = (c.value || c.innerHTML).replace(/^\s*|\s*$/g, ""); b = q(d, { filename: a }) } } return b }; var h = function (a, b) { return "string" != typeof a && (b = typeof a, "number" === b ? a += "" : a = "function" === b ? h(a.call(a)) : ""), a }, i = { "<": "<", ">": ">", '"': """, "'": "'", "&": "&" }, j = function (a) { return i[a] }, k = function (a) { return h(a).replace(/&(?![\w#]+;)|[<>"']/g, j) }, l = Array.isArray || function (a) { return "[object Array]" === {}.toString.call(a) }, m = function (a, b) { var c, d; if (l(a)) for (c = 0, d = a.length; d > c; c++) b.call(a, a[c], c, a); else for (c in a) b.call(a, a[c], c) }, n = d.utils = { $helpers: {}, $include: g, $string: h, $escape: k, $each: m }; d.helper = function (a, b) { o[a] = b }; var o = d.helpers = n.$helpers; d.onerror = function (a) { var b = "Template Error\n\n"; for (var c in a) b += "<" + c + ">\n" + a[c] + "\n\n"; "object" == typeof console && console.error(b) }; var p = function (a) { return d.onerror(a), function () { return "{Template Error}" } }, q = d.compile = function (a, b) { function d(c) { try { return new i(c, h) + "" } catch (d) { return b.debug ? p(d)() : (b.debug = !0, q(a, b)(c)) } } b = b || {}; for (var g in e) void 0 === b[g] && (b[g] = e[g]); var h = b.filename; try { var i = c(a, b) } catch (j) { return j.filename = h || "anonymous", j.name = "Syntax Error", p(j) } return d.prototype = i.prototype, d.toString = function () { return i.toString() }, h && b.cache && (f[h] = d), d }, r = n.$each, s = "break,case,catch,continue,debugger,default,delete,do,else,false,finally,for,function,if,in,instanceof,new,null,return,switch,this,throw,true,try,typeof,var,void,while,with,abstract,boolean,byte,char,class,const,double,enum,export,extends,final,float,goto,implements,import,int,interface,long,native,package,private,protected,public,short,static,super,synchronized,throws,transient,volatile,arguments,let,yield,undefined", t = /\/\*[\w\W]*?\*\/|\/\/[^\n]*\n|\/\/[^\n]*$|"(?:[^"\\]|\\[\w\W])*"|'(?:[^'\\]|\\[\w\W])*'|\s*\.\s*[$\w\.]+/g, u = /[^\w$]+/g, v = new RegExp(["\\b" + s.replace(/,/g, "\\b|\\b") + "\\b"].join("|"), "g"), w = /^\d[^,]*|,\d[^,]*/g, x = /^,+|,+$/g, y = /^$|,+/; e.openTag = "{{", e.closeTag = "}}"; var z = function (a, b) { var c = b.split(":"), d = c.shift(), e = c.join(":") || ""; return e && (e = ", " + e), "$helpers." + d + "(" + a + e + ")" }; e.parser = function (a) { a = a.replace(/^\s/, ""); var b = a.split(" "), c = b.shift(), e = b.join(" "); switch (c) { case "if": a = "if(" + e + "){"; break; case "else": b = "if" === b.shift() ? " if(" + b.join(" ") + ")" : "", a = "}else" + b + "{"; break; case "/if": a = "}"; break; case "each": var f = b[0] || "$data", g = b[1] || "as", h = b[2] || "$value", i = b[3] || "$index", j = h + "," + i; "as" !== g && (f = "[]"), a = "$each(" + f + ",function(" + j + "){"; break; case "/each": a = "});"; break; case "echo": a = "print(" + e + ");"; break; case "print": case "include": a = c + "(" + b.join(",") + ");"; break; default: if (/^\s*\|\s*[\w\$]/.test(e)) { var k = !0; 0 === a.indexOf("#") && (a = a.substr(1), k = !1); for (var l = 0, m = a.split("|"), n = m.length, o = m[l++]; n > l; l++) o = z(o, m[l]); a = (k ? "=" : "=#") + o } else a = d.helpers[c] ? "=#" + c + "(" + b.join(",") + ");" : "=" + a } return a }, "function" == typeof define ? define(function () { return d }) : "undefined" != typeof exports ? module.exports = d : this.template = d }();; //; /* 根据〖中华人民共和国国家标准 GB 11643-1999〗中有关公民身份号码的规定,公民身份号码是特征组合码,由十七位数字本体码和一位数字校验码组成。排列顺序从左至右依次为:六位数字地址码,八位数字出生日期码,三位数字顺序码和一位数字校验码。 地址码表示编码对象常住户口所在县(市、旗、区)的行政区划代码。 出生日期码表示编码对象出生的年、月、日,其中年份用四位数字表示,年、月、日之间不用分隔符。 顺序码表示同一地址码所标识的区域范围内,对同年、月、日出生的人员编定的顺序号。顺序码的奇数分给男性,偶数分给女性。 校验码是根据前面十七位数字码,按照ISO 7064:1983.MOD 11-2校验码计算出来的检验码。出生日期计算方法。 15位的身份证编码首先把出生年扩展为4位,简单的就是增加一个19或18,这样就包含了所有1800-1999年出生的人; 2000年后出生的肯定都是18位的了没有这个烦恼,至于1800年前出生的,那啥那时应该还没身份证号这个东东,⊙﹏⊙b汗... 下面是正则表达式: 出生日期1800-2099 (18|19|20)?\d{2}(0[1-9]|1[12])(0[1-9]|[12]\d|3[01]) 身份证正则表达式 /^\d{6}(18|19|20)?\d{2}(0[1-9]|1[12])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/i 15位校验规则 6位地址编码+6位出生日期+3位顺序号 18位校验规则 6位地址编码+8位出生日期+3位顺序号+1位校验位 校验位规则 公式:∑(ai×Wi)(mod 11)……………………………………(1) 公式(1)中: i----表示号码字符从由至左包括校验码在内的位置序号; ai----表示第i位置上的号码字符值; Wi----示第i位置上的加权因子,其数值依据公式Wi=2^(n-1)(mod 11)计算得出。 i 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 Wi 7 9 10 5 8 4 2 1 6 3 7 9 10 5 8 4 2 1*/ //身份证号合法性验证 //支持15位和18位身份证号 //支持地址编码、出生日期、校验位验证 function IdentityCodevalsid(code) { var city={11:"北京",12:"天津",13:"河北",14:"山西",15:"内蒙古",21:"辽宁",22:"吉林",23:"黑龙江 ",31:"上海",32:"江苏",33:"浙江",34:"安徽",35:"福建",36:"江西",37:"山东",41:"河南",42:"湖北 ",43:"湖南",44:"广东",45:"广西",46:"海南",50:"重庆",51:"四川",52:"贵州",53:"云南",54:"西藏 ",61:"陕西",62:"甘肃",63:"青海",64:"宁夏",65:"新疆",71:"台湾",81:"香港",82:"澳门",91:"国外 "}; var tip = ""; var pass= true; if(!code || !/^\d{6}(18|19|20)?\d{2}(0[1-9]|1[12])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/i.test(code)){ tip = "身份证号格式错误"; pass = false; } else if(!city[code.substr(0,2)]){ tip = "地址编码错误"; pass = false; } else{ //18位身份证需要验证最后一位校验位 if(code.length == 18){ code = code.split(''); //∑(ai×Wi)(mod 11) //加权因子 var factor = [ 7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2 ]; //校验位 var parity = [ 1, 0, 'X', 9, 8, 7, 6, 5, 4, 3, 2 ]; var sum = 0; var ai = 0; var wi = 0; for (var i = 0; i < 17; i++) { ai = code[i]; wi = factor[i]; sum += ai * wi; } var last = parity[sum % 11]; if(parity[sum % 11] != code[17]){ tip = "校验位错误"; pass =false; } } } // if(!pass) alert(tip); return pass; } // var c = '130981199312253466'; // var res= IdentityCodevalsid(c); window.IdentityCodevalsid = IdentityCodevalsid;; (function ($) { 'use strict'; var patch = window.KDPatch = window.KDPatch || {}, fn; patch['imgResPatch'] = fn = function () { var kid = lanh.kid || '', customExtend = lanh.customExtend || {}, resRule = (customExtend.resRule || '').replace('{kid}', kid), resPath = '/userdatas/' + resRule + '/public_html/runtime/uploads/', basePath = '/runtime/uploads/'; $('img').each(function (idx, img) { var $el = $(this), src = $el.attr('src')||$el.attr('data-src'), host, protocol, origin, ts = src; if (!!ts&&ts.indexOf(basePath) > -1 && ts.indexOf(resPath) === -1) { if (/^\/\//.test(ts)) { ts = 'http:' + ts; } protocol = ts.substr(0, ts.indexOf('://') + 3); ts = ts.replace(protocol, ''); host = ts.substr(0, ts.indexOf('/')); origin = protocol + host; var reg = new RegExp('^' + origin + '.*' + basePath, 'i'); if (reg.test(src) && host.indexOf('cdn') === -1) { $el.attr('raw-src', src).attr('src', src.replace(reg, origin + resPath)); } } }); } // 自动执行补丁 $(fn); })(jQuery);; (function(win, $) { 'use strict'; win.Kdo = win.Kdo || {}; var counter=0; //转义特殊字符 var _replaceTemplateEscape = function(template) { if (!!template) { return template.replace(/</g, "<") .replace(/>/g, ">") .replace(/&/g, "&"); } } var isEmpty = function(obj) { var key; if (!!obj) { for (key in obj) { return false; } } return true; }; /* art-template 扩展*/ template.helper('toString', function(data) { return JSON.stringify(data); }); template.helper("trim", function(data) { return $.trim(data); }); template.helper("toUrl", function(data, columnName) { var _router = ""; $.each(data, function(idx,parent) { _router = _router + "/" + parent[columnName] }); return _router; }); //处理DataConfig动态数据配置,并渲染模块 var _buildDataConfigs = function(_$box, controlConfig) { var reload = !!controlConfig && !!controlConfig.reload, isAsync = !!_$box.data('asyncload'); //获取data config数据配置对象 var _getDataConfig = function(tpl) { var dataConfig = _$box.data('controldataconfig'); return dataConfig; } //处理data config配置对象,并获取数据整体返回结果集。 var _getData = function(dataConfigs, callback) { var count = 0, _data = {}, finished = false, _complete = function() { count++; if (count >= dataConfigs.length && !finished) { callback(_data); finished = true } }; dataConfigs = Array.isArray(dataConfigs) ? dataConfigs : []; if (dataConfigs.length <= 0) { return _complete(); } dataConfigs.forEach(function(cfg) { //build mock data(用于Mock Data) var _queryString = [], _postData = {}, _isEmpty = isEmpty(cfg); if (!cfg.mockData) cfg.mockData = {}; //mock query string对象 (cfg.queryString || []).forEach(function(item) { if (item.indexOf("<%=") == -1) { _queryString.push(item); } else { var _val = item.substring(item.indexOf("<%=")); _queryString.push(item.replace(_val, cfg.mockData[_val] || "")); } }); //mock post data对象 for (var key in cfg.postData) { if (cfg.postData[key].indexOf("<%=") == -1) { _postData[key] = cfg.postData[key]; } else { _postData[key] = cfg.mockData[cfg.postData[key]]; } } if (!_isEmpty) { var url = lanh.apiHost + cfg.path + "?" + _queryString.join("&"), formBody = !!cfg.contentType ? JSON.stringify(_postData) : _postData, data, cache = !!Kdo && !!Kdo.utils && !!Kdo.utils.cache ? Kdo.utils.cache : null, cacheKey, load = function(next) { $.ajax({ url: url, method: cfg.method, dataType: "json", data: formBody, contentType: cfg.contentType || null, async: isAsync, success: function(result) { var curResult = _data[cfg.objName] = result; // 修正返回结果数据,如果没有data属性,则默认添加data属性,值为""(空字符串). if (!!curResult && !curResult.data) { curResult.data = ""; }!!next && next(result); }, complete: _complete }); }; if (!!cache) { cacheKey = JSON.stringify(cfg); //cfg.method+'-'+url+'&'+$.param(_postData,true); data = cache.getOrSetModuleData(cacheKey, load, reload); if (!!data) { _data[cfg.objName] = data; _complete(); } } else { load(); } } else { _complete(); } }); } var applyFictitiousData = function(controlConfig, data) { var ctrlKey = controlConfig.key, ctrlId = controlConfig.controlId, fd = Kdo.menus.getFictitiousData(), map = fd.control_map_path, dataConfig = map[ctrlKey], objName, path, curdata, orgdata, vd = $.extend(true, {}, data || {}), emptier = 0; if (!!dataConfig) { dataConfig.forEach(function(cfg) { objName = !!ctrlId ? cfg['objName'].replace(/_panelId_/g, ctrlId) : cfg['objName']; orgdata = vd[objName]; if (isEmpty(orgdata) || isEmpty(orgdata.data)) { path = cfg['path']; curdata = fd[path]; vd[objName] = $.extend(true, vd[objName] || {}, curdata); emptier++; } }); if (emptier === dataConfig.length) { $.extend(true, data || {}, vd); } } } //执行数据查询,并重新渲染模板(HTML & JavaScript) _getData(_getDataConfig(_$box.html()), function(data) { counter--; //编辑样式时传的对象中不包含controlId,则只有在对象是满足的情况才做如下操作 by linna if (!!controlConfig && controlConfig.controlId) { applyFictitiousData(controlConfig, data); var filterStrategy = Kdo.page.create.dynamicDataFilterStrategy[controlConfig.key]; if (typeof filterStrategy === 'function') { for (var d in data) { var serData = data[d]['data']; controlConfig = filterStrategy(controlConfig, serData); } //重新保存模块对象到页面对象中 Kdo.data.controls.set(controlConfig); } } //使用{{ }}解析动态数据 template.config("openTag", "{{"); template.config("closeTag", "}}"); //------------build _$box START------------ var $tplDiv = _$box.children("div[id^='control_']"), _template = $tplDiv.prop("outerHTML"), ctrlId = $tplDiv.attr('id'); if (!!isAsync) { ctrlId = (_$box.attr('id') || '').replace('modulebox_', ''); _template = $('#template_' + ctrlId).html(); } _template = (_template || '').replace(/scr_ipt/ig,'script').replace(/\{_\{/g, '{{').replace(/\}_\}/g, '}}'); _template = _replaceTemplateEscape(_template); _template = !!_template ? template.compile(_template)(data) : ''; if (isAsync) { _template = $(_template).attr('id', ctrlId); _template.find('img[data-onerror]').each(function(idx, el) { var $el = $(el); $el.attr('onerror', $el.data('onerror')); }); } //替换掉视图 $tplDiv.replaceWith(_template); // _$box.children("div[id^='control_']").show(); //------------build _$box END------------ setTimeout(function() { _$box.trigger('rendered', data, _$box); }, 17); //恢复默认解析静态数据的标记 template.config("openTag", "{{{"); template.config("closeTag", "}}}"); }); } /** 异步加载模块数据,只针对异步模块进行处理 */ var _asyncLoadModuleData = function() { $(function() { var $box = $('div[data-asyncload="true"]'), idx=0, len=$box.length, timer, loadfn=function(){ if(idx===len) { return clearTimeout(timer); }; if(counter<=3){ counter++; var $el = $($box.get(idx)); _buildDataConfigs($el); idx++; } timer=setTimeout(loadfn,0); }; loadfn(); }); } var exportObj = { buildDataConfigs: _buildDataConfigs, asyncLoadModuleData: _asyncLoadModuleData }; win.Kdo = win.Kdo || {}; $.extend(true, win.Kdo, { page: { create: exportObj } });}(window, jQuery)) ; /*!art-template - Template Engine | http://aui.github.com/artTemplate/*/ !function(){function a(a){return a.replace(t,"").replace(u,",").replace(v,"").replace(w,"").replace(x,"").split(y)}function b(a){return"'"+a.replace(/('|\\)/g,"\\$1").replace(/\r/g,"\\r").replace(/\n/g,"\\n")+"'"}function c(c,d){function e(a){return m+=a.split(/\n/).length-1,k&&(a=a.replace(/\s+/g," ").replace(//g,"")),a&&(a=s[1]+b(a)+s[2]+"\n"),a}function f(b){var c=m;if(j?b=j(b,d):g&&(b=b.replace(/\n/g,function(){return m++,"$line="+m+";"})),0===b.indexOf("=")){var e=l&&!/^=[=#]/.test(b);if(b=b.replace(/^=[=#]?|[\s;]*$/g,""),e){var f=b.replace(/\s*\([^\)]+\)/,"");n[f]||/^(include|print)$/.test(f)||(b="$escape("+b+")")}else b="$string("+b+")";b=s[1]+b+s[2]}return g&&(b="$line="+c+";"+b),r(a(b),function(a){if(a&&!p[a]){var b;b="print"===a?u:"include"===a?v:n[a]?"$utils."+a:o[a]?"$helpers."+a:"$data."+a,w+=a+"="+b+",",p[a]=!0}}),b+"\n"}var g=d.debug,h=d.openTag,i=d.closeTag,j=d.parser,k=d.compress,l=d.escape,m=1,p={$data:1,$filename:1,$utils:1,$helpers:1,$out:1,$line:1},q="".trim,s=q?["$out='';","$out+=",";","$out"]:["$out=[];","$out.push(",");","$out.join('')"],t=q?"$out+=text;return $out;":"$out.push(text);",u="function(){var text=''.concat.apply('',arguments);"+t+"}",v="function(filename,data){data=data||$data;var text=$utils.$include(filename,data,$filename);"+t+"}",w="'use strict';var $utils=this,$helpers=$utils.$helpers,"+(g?"$line=0,":""),x=s[0],y="return new String("+s[3]+");";r(c.split(h),function(a){a=a.split(i);var b=a[0],c=a[1];1===a.length?x+=e(b):(x+=f(b),c&&(x+=e(c)))});var z=w+x+y;g&&(z="try{"+z+"}catch(e){throw {filename:$filename,name:'Render Error',message:e.message,line:$line,source:"+b(c)+".split(/\\n/)[$line-1].replace(/^\\s+/,'')};}");try{var A=new Function("$data","$filename",z);return A.prototype=n,A}catch(B){throw B.temp="function anonymous($data,$filename) {"+z+"}",B}}var d=function(a,b){return"string"==typeof b?q(b,{filename:a}):g(a,b)};d.version="3.0.0",d.config=function(a,b){e[a]=b};var e=d.defaults={openTag:"<%",closeTag:"%>",escape:!0,cache:!0,compress:!1,parser:null},f=d.cache={};d.render=function(a,b){return q(a,b)};var g=d.renderFile=function(a,b){var c=d.get(a)||p({filename:a,name:"Render Error",message:"Template not found"});return b?c(b):c};d.get=function(a){var b;if(f[a])b=f[a];else if("object"==typeof document){var c=document.getElementById(a);if(c){var d=(c.value||c.innerHTML).replace(/^\s*|\s*$/g,"");b=q(d,{filename:a})}}return b};var h=function(a,b){return"string"!=typeof a&&(b=typeof a,"number"===b?a+="":a="function"===b?h(a.call(a)):""),a},i={"<":"<",">":">",'"':""","'":"'","&":"&"},j=function(a){return i[a]},k=function(a){return h(a).replace(/&(?![\w#]+;)|[<>"']/g,j)},l=Array.isArray||function(a){return"[object Array]"==={}.toString.call(a)},m=function(a,b){var c,d;if(l(a))for(c=0,d=a.length;d>c;c++)b.call(a,a[c],c,a);else for(c in a)b.call(a,a[c],c)},n=d.utils={$helpers:{},$include:g,$string:h,$escape:k,$each:m};d.helper=function(a,b){o[a]=b};var o=d.helpers=n.$helpers;d.onerror=function(a){var b="Template Error\n\n";for(var c in a)b+="<"+c+">\n"+a[c]+"\n\n";"object"==typeof console&&console.error(b)};var p=function(a){return d.onerror(a),function(){return"{Template Error}"}},q=d.compile=function(a,b){function d(c){try{return new i(c,h)+""}catch(d){return b.debug?p(d)():(b.debug=!0,q(a,b)(c))}}b=b||{};for(var g in e)void 0===b[g]&&(b[g]=e[g]);var h=b.filename;try{var i=c(a,b)}catch(j){return j.filename=h||"anonymous",j.name="Syntax Error",p(j)}return d.prototype=i.prototype,d.toString=function(){return i.toString()},h&&b.cache&&(f[h]=d),d},r=n.$each,s="break,case,catch,continue,debugger,default,delete,do,else,false,finally,for,function,if,in,instanceof,new,null,return,switch,this,throw,true,try,typeof,var,void,while,with,abstract,boolean,byte,char,class,const,double,enum,export,extends,final,float,goto,implements,import,int,interface,long,native,package,private,protected,public,short,static,super,synchronized,throws,transient,volatile,arguments,let,yield,undefined",t=/\/\*[\w\W]*?\*\/|\/\/[^\n]*\n|\/\/[^\n]*$|"(?:[^"\\]|\\[\w\W])*"|'(?:[^'\\]|\\[\w\W])*'|\s*\.\s*[$\w\.]+/g,u=/[^\w$]+/g,v=new RegExp(["\\b"+s.replace(/,/g,"\\b|\\b")+"\\b"].join("|"),"g"),w=/^\d[^,]*|,\d[^,]*/g,x=/^,+|,+$/g,y=/^$|,+/;e.openTag="{{",e.closeTag="}}";var z=function(a,b){var c=b.split(":"),d=c.shift(),e=c.join(":")||"";return e&&(e=", "+e),"$helpers."+d+"("+a+e+")"};e.parser=function(a){a=a.replace(/^\s/,"");var b=a.split(" "),c=b.shift(),e=b.join(" ");switch(c){case"if":a="if("+e+"){";break;case"else":b="if"===b.shift()?" if("+b.join(" ")+")":"",a="}else"+b+"{";break;case"/if":a="}";break;case"each":var f=b[0]||"$data",g=b[1]||"as",h=b[2]||"$value",i=b[3]||"$index",j=h+","+i;"as"!==g&&(f="[]"),a="$each("+f+",function("+j+"){";break;case"/each":a="});";break;case"echo":a="print("+e+");";break;case"print":case"include":a=c+"("+b.join(",")+");";break;default:if(/^\s*\|\s*[\w\$]/.test(e)){var k=!0;0===a.indexOf("#")&&(a=a.substr(1),k=!1);for(var l=0,m=a.split("|"),n=m.length,o=m[l++];n>l;l++)o=z(o,m[l]);a=(k?"=":"=#")+o}else a=d.helpers[c]?"=#"+c+"("+b.join(",")+");":"="+a}return a},"function"==typeof define?define(function(){return d}):"undefined"!=typeof exports?module.exports=d:this.template=d}();; (function ($, template) { window.midway = {}; // ---------- art-template设置 START---------- // 语法标记 template.config("openTag", "{~"); template.config("closeTag", "~}"); // 扩展方法 template.helper('toString', function (data) { return JSON.stringify(data) }); template.helper('toJSON', function (data) { return JSON.stringify(data) }); template.helper('trim', function (data) { return $.trim(data) }); template.helper("toUrl", function (data, columnName) { var _router = ""; for(var item in data){ _router = _router + "/" + data[item][columnName]; } return _router; }); // ---------- art-template设置 END---------- // 数据异步请求 window.midway.request = function (dataConfigs, target, opts) { var $target = $(target), targetHTML = $target.prop("outerHTML"), ajaxResults = {}, ajaxDeferreds = []; opts = $.extend(true, { loading: 'default' }, opts || {}); // 如果设置了loading switch (opts.loading) { case 'default': $target.html('
'); break; } // 组装每个ajax请求 $.each(dataConfigs, function (i, cfg) { // 组装ajax请求URL地址 var url = cfg.path; if (cfg.queryString) { url += (url.indexOf("?") == -1 ? "?" : "&") + cfg.queryString.join("&"); } // 将配置转换为ajax请求对象 ajaxDeferreds.push( $.ajax({ url: window.lanh.apiHost + url, method: cfg.method || "get", contentType: "application/json", dataType: "json", data: cfg.postData, success: function (data, textStatus, jqXHR) { ajaxResults[cfg.objName] = data; }, error: function (jqXHR, textStatus, errorThrown) { ajaxResults[cfg.objName] = {}; } }) ) }); // 执行ajax对象 $.whm.apply(null, ajaxDeferreds).done(function () { // 模板绑定 $target.replaceWith(template.compile(targetHTML)(ajaxResults)); }); }})(jQuery, template); //jQuery和artTemplate为必要依赖项 ; /** * bootstrap-paginator.js v0.5 * -- * Copyright 2013 Yun Lai * -- * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */(function ($) { "use strict"; // jshint ;_; /* Paginator PUBLIC CLASS DEFINITION * ================================= */ /** * Boostrap Paginator Constructor * * @param element element of the paginator * @param options the options to config the paginator * * */ var BootstrapPaginator = function (element, options) { this.init(element, options); }, old = null; BootstrapPaginator.prototype = { /** * Initialization function of the paginator, accepting an element and the options as parameters * * @param element element of the paginator * @param options the options to config the paginator * * */ init: function (element, options) { this.$element = $(element); var version = (options && options.bootstrapMajorVersion) ? options.bootstrapMajorVersion : $.fn.bootstrapPaginator.defaults.bootstrapMajorVersion, id = this.$element.attr("id"); if (version === 2 && !this.$element.is("div")) { throw "in Bootstrap version 2 the pagination must be a div element. Or if you are using Bootstrap pagination 3. Please specify it in bootstrapMajorVersion in the option"; } else if (version > 2 && !this.$element.is("ul")) { throw "in Bootstrap version 3 the pagination root item must be an ul element." } this.currentPage = 1; this.lastPage = 1; this.setOptions(options); this.initialized = true; }, /** * Update the properties of the paginator element * * @param options options to config the paginator * */ setOptions: function (options) { this.options = $.extend({}, (this.options || $.fn.bootstrapPaginator.defaults), options); this.totalPages = parseInt(this.options.totalPages, 10); //setup the total pages property. this.numberOfPages = parseInt(this.options.numberOfPages, 10); //setup the numberOfPages to be shown //move the set current page after the setting of total pages. otherwise it will cause out of page exception. if (options && typeof (options.currentPage) !== 'undefined') { this.setCurrentPage(options.currentPage); } this.listen(); //render the paginator this.render(); if (!this.initialized && this.lastPage !== this.currentPage) { this.$element.trigger("page-changed", [this.lastPage, this.currentPage]); } }, /** * Sets up the events listeners. Currently the pageclicked and pagechanged events are linked if available. * * */ listen: function () { this.$element.off("page-clicked"); this.$element.off("page-changed");// unload the events for the element if (typeof (this.options.onPageClicked) === "function") { this.$element.bind("page-clicked", this.options.onPageClicked); } if (typeof (this.options.onPageChanged) === "function") { this.$element.on("page-changed", this.options.onPageChanged); } this.$element.bind("page-clicked", this.onPageClicked); }, /** * * Destroys the paginator element, it unload the event first, then empty the content inside. * * */ destroy: function () { this.$element.off("page-clicked"); this.$element.off("page-changed"); this.$element.removeData('bootstrapPaginator'); this.$element.empty(); }, /** * Shows the page * * */ show: function (page) { this.setCurrentPage(page); this.render(); if (this.lastPage !== this.currentPage) { this.$element.trigger("page-changed", [this.lastPage, this.currentPage]); } }, /** * Shows the next page * * */ showNext: function () { var pages = this.getPages(); if (pages.next) { this.show(pages.next); } }, /** * Shows the previous page * * */ showPrevious: function () { var pages = this.getPages(); if (pages.prev) { this.show(pages.prev); } }, /** * Shows the first page * * */ showFirst: function () { var pages = this.getPages(); if (pages.first) { this.show(pages.first); } }, /** * Shows the last page * * */ showLast: function () { var pages = this.getPages(); if (pages.last) { this.show(pages.last); } }, /** * Internal on page item click handler, when the page item is clicked, change the current page to the corresponding page and * trigger the pageclick event for the listeners. * * * */ onPageItemClicked: function (event) { var type = event.data.type, page = event.data.page; this.$element.trigger("page-clicked", [event, type, page]); }, onPageClicked: function (event, originalEvent, type, page) { //show the corresponding page and retrieve the newly built item related to the page clicked before for the event return var currentTarget = $(event.currentTarget); switch (type) { case "first": currentTarget.bootstrapPaginator("showFirst"); break; case "prev": currentTarget.bootstrapPaginator("showPrevious"); break; case "next": currentTarget.bootstrapPaginator("showNext"); break; case "last": currentTarget.bootstrapPaginator("showLast"); break; case "page": currentTarget.bootstrapPaginator("show", page); break; } }, /** * Renders the paginator according to the internal properties and the settings. * * * */ render: function () { //fetch the container class and add them to the container var containerClass = this.getValueFromOption(this.options.containerClass, this.$element), size = this.options.size || "normal", alignment = this.options.alignment || "left", pages = this.getPages(), listContainer = this.options.bootstrapMajorVersion === 2 ? $("
    ") : this.$element, listContainerClass = this.options.bootstrapMajorVersion === 2 ? this.getValueFromOption(this.options.listContainerClass, listContainer) : null, first = null, prev = null, next = null, last = null, p = null, i = 0; this.$element.prop("class", ""); this.$element.addClass("pagination"); switch (size.toLowerCase()) { case "large": case "small": case "mini": this.$element.addClass($.fn.bootstrapPaginator.sizeArray[this.options.bootstrapMajorVersion][size.toLowerCase()]); break; default: break; } if (this.options.bootstrapMajorVersion === 2) { switch (alignment.toLowerCase()) { case "center": this.$element.addClass("pagination-centered"); break; case "right": this.$element.addClass("pagination-right"); break; default: break; } } this.$element.addClass(containerClass); //empty the outter most container then add the listContainer inside. this.$element.empty(); if (this.options.bootstrapMajorVersion === 2) { this.$element.append(listContainer); listContainer.addClass(listContainerClass); } //update the page element reference this.pageRef = []; if (pages.first) {//if the there is first page element first = this.buildPageItem("first", pages.first); if (first) { listContainer.append(first); } } if (pages.prev) {//if the there is previous page element prev = this.buildPageItem("prev", pages.prev); if (prev) { listContainer.append(prev); } } for (i = 0; i < pages.length; i = i + 1) {//fill the numeric pages. p = this.buildPageItem("page", pages[i]); if (p) { listContainer.append(p); } } if (pages.next) {//if there is next page next = this.buildPageItem("next", pages.next); if (next) { listContainer.append(next); } } if (pages.last) {//if there is last page last = this.buildPageItem("last", pages.last); if (last) { listContainer.append(last); } } }, /** * * Creates a page item base on the type and page number givm. * * @param page page number * @param type type of the page, whether it is the first, prev, page, next, last * * @return Object the constructed page element * */ buildPageItem: function (type, page) { var itemContainer = $("
  • "),//creates the item container itemContent = $(""),//creates the item content text = "", title = "", itemContainerClass = this.options.itemContainerClass(type, page, this.currentPage), itemContentClass = this.getValueFromOption(this.options.itemContentClass, type, page, this.currentPage), tooltipOpts = null; switch (type) { case "first": if (!this.getValueFromOption(this.options.shouldShowPage, type, page, this.currentPage)) { return; } text = this.options.itemTexts(type, page, this.currentPage); title = this.options.tooltipTitles(type, page, this.currentPage); break; case "last": if (!this.getValueFromOption(this.options.shouldShowPage, type, page, this.currentPage)) { return; } text = this.options.itemTexts(type, page, this.currentPage); title = this.options.tooltipTitles(type, page, this.currentPage); break; case "prev": if (!this.getValueFromOption(this.options.shouldShowPage, type, page, this.currentPage)) { return; } text = this.options.itemTexts(type, page, this.currentPage); title = this.options.tooltipTitles(type, page, this.currentPage); break; case "next": if (!this.getValueFromOption(this.options.shouldShowPage, type, page, this.currentPage)) { return; } text = this.options.itemTexts(type, page, this.currentPage); title = this.options.tooltipTitles(type, page, this.currentPage); break; case "page": if (!this.getValueFromOption(this.options.shouldShowPage, type, page, this.currentPage)) { return; } text = this.options.itemTexts(type, page, this.currentPage); title = this.options.tooltipTitles(type, page, this.currentPage); break; } itemContainer.addClass(itemContainerClass).append(itemContent); itemContent.addClass(itemContentClass).html(text).on("click", null, {type: type, page: page}, $.proxy(this.onPageItemClicked, this)); if (this.options.pageUrl) { itemContent.attr("href", this.getValueFromOption(this.options.pageUrl, type, page, this.currentPage)); } if (this.options.useBootstrapTooltip) { tooltipOpts = $.extend({}, this.options.bootstrapTooltipOptions, {title: title}); itemContent.tooltip(tooltipOpts); } else { itemContent.attr("title", title); } return itemContainer; }, setCurrentPage: function (page) { if (page > this.totalPages || page < 1) {// if the current page is out of range, throw exception. throw "Page out of range"; } this.lastPage = this.currentPage; this.currentPage = parseInt(page, 10); }, /** * Gets an array that represents the current status of the page object. Numeric pages can be access via array mode. length attributes describes how many numeric pages are there. First, previous, next and last page can be accessed via attributes first, prev, next and last. Current attribute marks the current page within the pages. * * @return object output objects that has first, prev, next, last and also the number of pages in betwem. * */ getPages: function () { var totalPages = this.totalPages,// get or calculate the total pages via the total records pageStart = (this.currentPage % this.numberOfPages === 0) ? (parseInt(this.currentPage / this.numberOfPages, 10) - 1) * this.numberOfPages + 1 : parseInt(this.currentPage / this.numberOfPages, 10) * this.numberOfPages + 1,//calculates the start page. output = [], i = 0, counter = 0; pageStart = pageStart < 1 ? 1 : pageStart;//check the range of the page start to see if its less than 1. for (i = pageStart, counter = 0; counter < this.numberOfPages && i <= totalPages; i = i + 1, counter = counter + 1) {//fill the pages output.push(i); } output.first = 1;//add the first when the current page leaves the 1st page. if (this.currentPage > 1) {// add the previous when the current page leaves the 1st page output.prev = this.currentPage - 1; } else { output.prev = 1; } if (this.currentPage < totalPages) {// add the next page when the current page doesn't reach the last page output.next = this.currentPage + 1; } else { output.next = totalPages; } output.last = totalPages;// add the last page when the current page doesn't reach the last page output.current = this.currentPage;//mark the current page. output.total = totalPages; output.numberOfPages = this.options.numberOfPages; return output; }, /** * Gets the value from the options, this is made to handle the situation where value is the return value of a function. * * @return mixed value that depends on the type of parameters, if the given parameter is a function, then the evalsuated result is returned. Otherwise the parameter itself will get returned. * */ getValueFromOption: function (value) { var output = null, args = Array.prototype.slice.call(arguments, 1); if (typeof value === 'function') { output = value.apply(this, args); } else { output = value; } return output; } }; /* TYPEAHEAD PLUGIN DEFINITION * =========================== */ old = $.fn.bootstrapPaginator; $.fn.bootstrapPaginator = function (option) { var args = arguments, result = null; $(this).each(function (index, item) { var $this = $(item), data = $this.data('bootstrapPaginator'), options = (typeof option !== 'object') ? null : option; if (!data) { data = new BootstrapPaginator(this, options); $this = $(data.$element); $this.data('bootstrapPaginator', data); return; } if (typeof option === 'string') { if (data[option]) { result = data[option].apply(data, Array.prototype.slice.call(args, 1)); } else { throw "Method " + option + " does not exist"; } } else { result = data.setOptions(option); } }); return result; }; $.fn.bootstrapPaginator.sizeArray = { "2": { "large": "pagination-large", "small": "pagination-small", "mini": "pagination-mini" }, "3": { "large": "pagination-lg", "small": "pagination-sm", "mini": "" } }; $.fn.bootstrapPaginator.defaults = { containerClass: "", size: "normal", alignment: "left", bootstrapMajorVersion: 2, listContainerClass: "", itemContainerClass: function (type, page, current) { return (page === current) ? "active" : ""; }, itemContentClass: function (type, page, current) { return ""; }, currentPage: 1, numberOfPages: 5, totalPages: 1, pageUrl: function (type, page, current) { return null; }, onPageClicked: null, onPageChanged: null, useBootstrapTooltip: false, shouldShowPage: function (type, page, current) { var result = true; switch (type) { case "first": result = (current !== 1); break; case "prev": result = (current !== 1); break; case "next": result = (current !== this.totalPages); break; case "last": result = (current !== this.totalPages); break; case "page": result = true; break; } return result; }, itemTexts: function (type, page, current) { switch (type) { case "first": return "<<"; case "prev": return "<"; case "next": return ">"; case "last": return ">>"; case "page": return page; } }, tooltipTitles: function (type, page, current) { switch (type) { case "first": return "Go to first page"; case "prev": return "Go to previous page"; case "next": return "Go to next page"; case "last": return "Go to last page"; case "page": return (page === current) ? "Current page is " + page : "Go to page " + page; } }, bootstrapTooltipOptions: { animation: true, html: true, placement: 'top', selector: false, title: "", container: false } }; $.fn.bootstrapPaginator.Constructor = BootstrapPaginator;}(window.jQuery)); ; /* * jQuery edSlider plugin v.1.4 * @author Eduardo Moreno * Code under MIT License */(function($){ $.fn.edslider = function(settings){ var defaults = { width : 960, height : 400, position : 1, interval : 5000, duration : 500, animation : true, paginator : true, navigator : true, progress : true, loadImgSrc: 'images/load.gif', skin: 'edslider', autoplay: false }; var options = $.extend({}, defaults, settings); this.each(function(){ //Building (wrapping, validating, setting up) var slider = $(this), sliderLi = slider.find('li'), sliderBgImg = sliderLi.css('background-image'); sliderLi.length == 0 && console.error('error: empty slider!'); var sliderImg = slider.find('img'), wrapper = slider .wrap('
    ') .parent() .css({ 'width' : "100%", 'background-image' : 'url("' + options.loadImgSrc + '")', 'background-repeat' : 'no-repeat', 'background-position': 'center' }), startPosition = options.position; if(options.position == 0 || options.position > sliderLi.length){ console.error('error: start position value must be between 1 and ' + sliderLi.length + '!'); startPosition = 1; } slider .on('mouseenter', function(){ $(this).addClass('hover'); hoverControl(); }) .on('mouseleave', function(){ $(this).removeClass('hover'); hoverControl(); }) .add(sliderLi) .css('height', options.height); sliderLi .css('width', options.width) .filter(':nth-child(' + startPosition + ')') .addClass('current'); //Controls (navigation, pagination and progress bar) var position, controls, paginator, paginatorLi, progress, progressWidth, progressElapsed, interact = false; if((options.navigator || options.paginator) && sliderLi.length > 1){ controls = wrapper .on('selectstart', false) .append('
    ') .find('.controls'); if(options.paginator){ paginator = controls .prepend('
      ') .find('.paginator') .hide(); sliderLi.each(function(){ paginator.append('
    •  
    • '); }); paginatorLi = paginator .find('li') .on('click', function(){ if(interact){ position = $(this).index(); if((index - 1) != position){ sliderLi .removeClass('current') .filter(':nth-child(' + ++position + ')') .addClass('current'); play(); } } }) } if(options.navigator){ controls .append('