").html(data).evalScripts();
-
- return data;
- },
-
- handleError: function (s, xhr, status, e) {
- // If a local callback was specified, fire it
- if (s.error) {
- s.error.call(s.context || s, xhr, status, e);
- }
-
- // Fire the global callback
- if (s.global) {
- (s.context ? jQuery(s.context) : jQuery.event).trigger("ajaxError", [xhr, s, e]);
- }
- }
-})
-
+
+jQuery.extend({
+ createUploadIframe: function (id, uri) {
+ //create frame
+ var frameId = 'jUploadFrame' + id;
+ var iframeHtml = '
';
+ jQuery(iframeHtml).appendTo(document.body);
+
+ return jQuery('#' + frameId).get(0);
+ },
+ createUploadForm: function (id, fileElementId, data) {
+ //create form
+ var formId = 'jUploadForm' + id;
+ var fileId = 'jUploadFile' + id;
+ var form = jQuery('
');
+ if (data) {
+ for (var i in data) {
+ if (data[i].name != null && data[i].value != null) {
+ jQuery('
').appendTo(form);
+ }
+ }
+ }
+ var oldElement = jQuery('#' + fileElementId);
+ var newElement = jQuery(oldElement).clone();
+ jQuery(oldElement).attr('id', fileId);
+ jQuery(oldElement).before(newElement);
+ jQuery(oldElement).appendTo(form);
+
+
+
+ //set attributes
+ jQuery(form).css('position', 'absolute');
+ jQuery(form).css('top', '-1200px');
+ jQuery(form).css('left', '-1200px');
+ jQuery(form).appendTo('body');
+ return form;
+ },
+
+ ajaxFileUpload: function (s) {
+ // TODO introduce global settings, allowing the client to modify them for all requests, not only timeout
+ s = jQuery.extend({}, jQuery.ajaxSettings, s);
+ var id = new Date().getTime()
+ var form = jQuery.createUploadForm(id, s.fileElementId, (typeof (s.data) == 'undefined' ? false : s.data));
+ var io = jQuery.createUploadIframe(id, s.secureuri);
+ var frameId = 'jUploadFrame' + id;
+ var formId = 'jUploadForm' + id;
+ // Watch for a new set of requests
+ if (s.global && !jQuery.active++) {
+ jQuery.event.trigger("ajaxStart");
+ }
+ var requestDone = false;
+ // Create the request object
+ var xml = {}
+ if (s.global)
+ jQuery.event.trigger("ajaxSend", [xml, s]);
+ // Wait for a response to come back
+ var uploadCallback = function (isTimeout) {
+ var io = document.getElementById(frameId);
+ try {
+ if (io.contentWindow) {
+ xml.responseText = io.contentWindow.document.body ? io.contentWindow.document.body.innerHTML : null;
+ xml.responseXML = io.contentWindow.document.XMLDocument ? io.contentWindow.document.XMLDocument : io.contentWindow.document;
+
+ } else if (io.contentDocument) {
+ xml.responseText = io.contentDocument.document.body ? io.contentDocument.document.body.innerHTML : null;
+ xml.responseXML = io.contentDocument.document.XMLDocument ? io.contentDocument.document.XMLDocument : io.contentDocument.document;
+ }
+ } catch (e) {
+ jQuery.handleError(s, xml, null, e);
+ }
+ if (xml || isTimeout == "timeout") {
+ requestDone = true;
+ var status;
+ try {
+ status = isTimeout != "timeout" ? "success" : "error";
+ // Make sure that the request was successful or notmodified
+ if (status != "error") {
+ // process the data (runs the xml through httpData regardless of callback)
+ var data = jQuery.uploadHttpData(xml, s.dataType);
+ // If a local callback was specified, fire it and pass it the data
+ if (s.success)
+ s.success(data, status);
+
+ // Fire the global callback
+ if (s.global)
+ jQuery.event.trigger("ajaxSuccess", [xml, s]);
+ } else
+ jQuery.handleError(s, xml, status);
+ } catch (e) {
+ status = "error";
+ jQuery.handleError(s, xml, status, e);
+ }
+
+ // The request was completed
+ if (s.global)
+ jQuery.event.trigger("ajaxComplete", [xml, s]);
+
+ // Handle the global AJAX counter
+ if (s.global && ! --jQuery.active)
+ jQuery.event.trigger("ajaxStop");
+
+ // Process result
+ if (s.complete)
+ s.complete(xml, status);
+
+ jQuery(io).unbind()
+
+ setTimeout(function () {
+ try {
+ jQuery(io).remove();
+ jQuery(form).remove();
+
+ } catch (e) {
+ jQuery.handleError(s, xml, null, e);
+ }
+
+ }, 100)
+
+ xml = null
+
+ }
+ }
+ // Timeout checker
+ if (s.timeout > 0) {
+ setTimeout(function () {
+ // Check to see if the request is still happening
+ if (!requestDone) uploadCallback("timeout");
+ }, s.timeout);
+ }
+ try {
+
+ var form = jQuery('#' + formId);
+ jQuery(form).attr('action', s.url);
+ jQuery(form).attr('method', 'POST');
+ jQuery(form).attr('target', frameId);
+ if (form.encoding) {
+ jQuery(form).attr('encoding', 'multipart/form-data');
+ }
+ else {
+ jQuery(form).attr('enctype', 'multipart/form-data');
+ }
+ jQuery(form).submit();
+
+ } catch (e) {
+ jQuery.handleError(s, xml, null, e);
+ }
+
+ jQuery('#' + frameId).load(uploadCallback);
+ return { abort: function () { } };
+
+ },
+
+ uploadHttpData: function (r, type) {
+ var data = !type;
+ if (!type)
+ data = r.responseText;
+ if (type == "xml")
+ data = r.responseXML;
+ //data = type == "xml" || data ? r.responseXML : r.responseText;
+ // If the type is "script", eval it in global context
+ if (type == "script")
+ jQuery.globalEval(data);
+ // Get the JavaScript object, if JSON is used.
+ if (type == "json") {
+ ////////////Fix the issue that it always throws the error "unexpected token '<'"///////////////
+ data = r.responseText;
+ var start = data.indexOf(">");
+ if (start != -1) {
+ var end = data.indexOf("<", start + 1);
+ if (end != -1) {
+ data = data.substring(start + 1, end);
+ }
+ }
+ ///////////////////////////////////////////////////////////////////////////////////////////////
+ //eval("data = " + data);
+ }
+ // evaluate scripts within html
+ if (type == "html")
+ jQuery("
").html(data).evalScripts();
+
+ return data;
+ },
+
+ handleError: function (s, xhr, status, e) {
+ // If a local callback was specified, fire it
+ if (s.error) {
+ s.error.call(s.context || s, xhr, status, e);
+ }
+
+ // Fire the global callback
+ if (s.global) {
+ (s.context ? jQuery(s.context) : jQuery.event).trigger("ajaxError", [xhr, s, e]);
+ }
+ }
+})
+
diff --git a/chapter11/src/main/resources/static/assets/js/bootbox.min.js b/chapter11/src/main/resources/static/assets/js/bootbox.min.js
old mode 100755
new mode 100644
diff --git a/chapter11/src/main/resources/static/assets/js/bootstrap-colorpicker.min.js b/chapter11/src/main/resources/static/assets/js/bootstrap-colorpicker.min.js
old mode 100755
new mode 100644
index fa2bf2e..b408cd5
--- a/chapter11/src/main/resources/static/assets/js/bootstrap-colorpicker.min.js
+++ b/chapter11/src/main/resources/static/assets/js/bootstrap-colorpicker.min.js
@@ -1,19 +1,19 @@
-/* =========================================================
- * bootstrap-colorpicker.js
- * http://www.eyecon.ro/bootstrap-colorpicker
- * =========================================================
- * Copyright 2012 Stefan Petre
- *
- * 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.
- * ========================================================= */
+/* =========================================================
+ * bootstrap-colorpicker.js
+ * http://www.eyecon.ro/bootstrap-colorpicker
+ * =========================================================
+ * Copyright 2012 Stefan Petre
+ *
+ * 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($){var Color=function(val){this.value={h:1,s:1,b:1,a:1};this.setColor(val)};Color.prototype={constructor:Color,setColor:function(val){val=val.toLowerCase();var that=this;$.each(CPGlobal.stringParsers,function(i,parser){var match=parser.re.exec(val),values=match&&parser.parse(match),space=parser.space||"rgba";if(values){if(space==="hsla"){that.value=CPGlobal.RGBtoHSB.apply(null,CPGlobal.HSLtoRGB.apply(null,values))}else{that.value=CPGlobal.RGBtoHSB.apply(null,values)}return false}})},setHue:function(h){this.value.h=1-h},setSaturation:function(s){this.value.s=s},setLightness:function(b){this.value.b=1-b},setAlpha:function(a){this.value.a=parseInt((1-a)*100,10)/100},toRGB:function(h,s,b,a){if(!h){h=this.value.h;s=this.value.s;b=this.value.b}h*=360;var R,G,B,X,C;h=h%360/60;C=b*s;X=C*(1-Math.abs(h%2-1));R=G=B=b-C;h=~~h;R+=[C,X,0,0,X,C][h];G+=[X,C,C,X,0,0][h];B+=[0,0,X,C,C,X][h];return{r:Math.round(R*255),g:Math.round(G*255),b:Math.round(B*255),a:a||this.value.a}},toHex:function(h,s,b,a){var rgb=this.toRGB(h,s,b,a);return"#"+(1<<24|parseInt(rgb.r)<<16|parseInt(rgb.g)<<8|parseInt(rgb.b)).toString(16).substr(1)},toHSL:function(h,s,b,a){if(!h){h=this.value.h;s=this.value.s;b=this.value.b}var H=h,L=(2-s)*b,S=s*b;if(L>0&&L<=1){S/=L}else{S/=2-L}L/=2;if(S>1){S=1}return{h:H,s:S,l:L,a:a||this.value.a}}};var Colorpicker=function(element,options){this.element=$(element);var format=options.format||this.element.data("color-format")||"hex";this.format=CPGlobal.translateFormats[format];this.isInput=this.element.is("input");this.component=this.element.is(".color")?this.element.find(".add-on"):false;this.picker=$(CPGlobal.template).appendTo("body").on("mousedown",$.proxy(this.mousedown,this));if(this.isInput){this.element.on({focus:$.proxy(this.show,this),keyup:$.proxy(this.update,this)})}else if(this.component){this.component.on({click:$.proxy(this.show,this)})}else{this.element.on({click:$.proxy(this.show,this)})}if(format==="rgba"||format==="hsla"){this.picker.addClass("alpha");this.alpha=this.picker.find(".colorpicker-alpha")[0].style}if(this.component){this.picker.find(".colorpicker-color").hide();this.preview=this.element.find("i")[0].style}else{this.preview=this.picker.find("div:last")[0].style}this.base=this.picker.find("div:first")[0].style;this.update()};Colorpicker.prototype={constructor:Colorpicker,show:function(e){this.picker.show();this.height=this.component?this.component.outerHeight():this.element.outerHeight();this.place();$(window).on("resize",$.proxy(this.place,this));if(!this.isInput){if(e){e.stopPropagation();e.preventDefault()}}$(document).on({mousedown:$.proxy(this.hide,this)});this.element.trigger({type:"show",color:this.color})},update:function(){this.color=new Color(this.isInput?this.element.prop("value"):this.element.data("color"));this.picker.find("i").eq(0).css({left:this.color.value.s*100,top:100-this.color.value.b*100}).end().eq(1).css("top",100*(1-this.color.value.h)).end().eq(2).css("top",100*(1-this.color.value.a));this.previewColor()},setValue:function(newColor){this.color=new Color(newColor);this.picker.find("i").eq(0).css({left:this.color.value.s*100,top:100-this.color.value.b*100}).end().eq(1).css("top",100*(1-this.color.value.h)).end().eq(2).css("top",100*(1-this.color.value.a));this.previewColor();this.element.trigger({type:"changeColor",color:this.color})},hide:function(){this.picker.hide();$(window).off("resize",this.place);if(!this.isInput){$(document).off({mousedown:this.hide});if(this.component){this.element.find("input").prop("value",this.format.call(this))}this.element.data("color",this.format.call(this))}else{this.element.prop("value",this.format.call(this))}this.element.trigger({type:"hide",color:this.color})},place:function(){var offset=this.component?this.component.offset():this.element.offset();this.picker.css({top:offset.top+this.height,left:offset.left})},previewColor:function(){try{this.preview.backgroundColor=this.format.call(this)}catch(e){this.preview.backgroundColor=this.color.toHex()}this.base.backgroundColor=this.color.toHex(this.color.value.h,1,1,1);if(this.alpha){this.alpha.backgroundColor=this.color.toHex()}},pointer:null,slider:null,mousedown:function(e){e.stopPropagation();e.preventDefault();var target=$(e.target);var zone=target.closest("div");if(!zone.is(".colorpicker")){if(zone.is(".colorpicker-saturation")){this.slider=$.extend({},CPGlobal.sliders.saturation)}else if(zone.is(".colorpicker-hue")){this.slider=$.extend({},CPGlobal.sliders.hue)}else if(zone.is(".colorpicker-alpha")){this.slider=$.extend({},CPGlobal.sliders.alpha)}else{return false}var offset=zone.offset();this.slider.knob=zone.find("i")[0].style;this.slider.left=e.pageX-offset.left;this.slider.top=e.pageY-offset.top;this.pointer={left:e.pageX,top:e.pageY};$(document).on({mousemove:$.proxy(this.mousemove,this),mouseup:$.proxy(this.mouseup,this)}).trigger("mousemove")}return false},mousemove:function(e){e.stopPropagation();e.preventDefault();var left=Math.max(0,Math.min(this.slider.maxLeft,this.slider.left+((e.pageX||this.pointer.left)-this.pointer.left)));var top=Math.max(0,Math.min(this.slider.maxTop,this.slider.top+((e.pageY||this.pointer.top)-this.pointer.top)));this.slider.knob.left=left+"px";this.slider.knob.top=top+"px";if(this.slider.callLeft){this.color[this.slider.callLeft].call(this.color,left/100)}if(this.slider.callTop){this.color[this.slider.callTop].call(this.color,top/100)}this.previewColor();this.element.trigger({type:"changeColor",color:this.color});return false},mouseup:function(e){e.stopPropagation();e.preventDefault();$(document).off({mousemove:this.mousemove,mouseup:this.mouseup});return false}};$.fn.colorpicker=function(option,val){return this.each(function(){var $this=$(this),data=$this.data("colorpicker"),options=typeof option==="object"&&option;if(!data){$this.data("colorpicker",data=new Colorpicker(this,$.extend({},$.fn.colorpicker.defaults,options)))}if(typeof option==="string")data[option](val)})};$.fn.colorpicker.defaults={};$.fn.colorpicker.Constructor=Colorpicker;var CPGlobal={translateFormats:{rgb:function(){var rgb=this.color.toRGB();return"rgb("+rgb.r+","+rgb.g+","+rgb.b+")"},rgba:function(){var rgb=this.color.toRGB();return"rgba("+rgb.r+","+rgb.g+","+rgb.b+","+rgb.a+")"},hsl:function(){var hsl=this.color.toHSL();return"hsl("+Math.round(hsl.h*360)+","+Math.round(hsl.s*100)+"%,"+Math.round(hsl.l*100)+"%)"},hsla:function(){var hsl=this.color.toHSL();return"hsla("+Math.round(hsl.h*360)+","+Math.round(hsl.s*100)+"%,"+Math.round(hsl.l*100)+"%,"+hsl.a+")"},hex:function(){return this.color.toHex()}},sliders:{saturation:{maxLeft:100,maxTop:100,callLeft:"setSaturation",callTop:"setLightness"},hue:{maxLeft:0,maxTop:100,callLeft:false,callTop:"setHue"},alpha:{maxLeft:0,maxTop:100,callLeft:false,callTop:"setAlpha"}},RGBtoHSB:function(r,g,b,a){r/=255;g/=255;b/=255;var H,S,V,C;V=Math.max(r,g,b);C=V-Math.min(r,g,b);H=C===0?null:V==r?(g-b)/C:V==g?(b-r)/C+2:(r-g)/C+4;H=(H+360)%6*60/360;S=C===0?0:C/V;return{h:H||1,s:S,b:V,a:a||1}},HueToRGB:function(p,q,h){if(h<0)h+=1;else if(h>1)h-=1;if(h*6<1)return p+(q-p)*h*6;else if(h*2<1)return q;else if(h*3<2)return p+(q-p)*(2/3-h)*6;else return p},HSLtoRGB:function(h,s,l,a){if(s<0){s=0}var q;if(l<=.5){q=l*(1+s)}else{q=l+s-l*s}var p=2*l-q;var tr=h+1/3;var tg=h;var tb=h-1/3;var r=Math.round(CPGlobal.HueToRGB(p,q,tr)*255);var g=Math.round(CPGlobal.HueToRGB(p,q,tg)*255);var b=Math.round(CPGlobal.HueToRGB(p,q,tb)*255);return[r,g,b,a||1]},stringParsers:[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,parse:function(execResult){return[execResult[1],execResult[2],execResult[3],execResult[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,parse:function(execResult){return[2.55*execResult[1],2.55*execResult[2],2.55*execResult[3],execResult[4]]}},{re:/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/,parse:function(execResult){return[parseInt(execResult[1],16),parseInt(execResult[2],16),parseInt(execResult[3],16)]}},{re:/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/,parse:function(execResult){return[parseInt(execResult[1]+execResult[1],16),parseInt(execResult[2]+execResult[2],16),parseInt(execResult[3]+execResult[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(execResult){return[execResult[1]/360,execResult[2]/100,execResult[3]/100,execResult[4]]}}],template:'"}}(window.jQuery);
\ No newline at end of file
diff --git a/chapter11/src/main/resources/static/assets/js/bootstrap-multiselect.js b/chapter11/src/main/resources/static/assets/js/bootstrap-multiselect.js
old mode 100755
new mode 100644
diff --git a/chapter11/src/main/resources/static/assets/js/bootstrap-tag.min.js b/chapter11/src/main/resources/static/assets/js/bootstrap-tag.min.js
old mode 100755
new mode 100644
diff --git a/chapter11/src/main/resources/static/assets/js/bootstrap-treeview.js b/chapter11/src/main/resources/static/assets/js/bootstrap-treeview.js
old mode 100755
new mode 100644
diff --git a/chapter11/src/main/resources/static/assets/js/bootstrap-wysiwyg.min.js b/chapter11/src/main/resources/static/assets/js/bootstrap-wysiwyg.min.js
old mode 100755
new mode 100644
diff --git a/chapter11/src/main/resources/static/assets/js/bootstrap.min.js b/chapter11/src/main/resources/static/assets/js/bootstrap.min.js
old mode 100755
new mode 100644
diff --git a/chapter11/src/main/resources/static/assets/js/boxDiv.js b/chapter11/src/main/resources/static/assets/js/boxDiv.js
old mode 100755
new mode 100644
index 2fdb647..8884ad0
--- a/chapter11/src/main/resources/static/assets/js/boxDiv.js
+++ b/chapter11/src/main/resources/static/assets/js/boxDiv.js
@@ -1,69 +1,69 @@
-(function($) {
- var idName;
- $.fn.box = function() {
- var method = arguments[0];
- if (methods[method]) {
- method = methods[method];
- arguments = Array.prototype.slice.call(arguments, 1);
- } else if (typeof (method) == "object" || !method) {
- method = methods.init;
- } else {
- $.error("Method" + method + "does not exist on jQuery.dialog");
- return this;
- }
- return method.apply(this, arguments);
- };
- /**
- * 参数
- */
- var params={
- title : '您有新的提示消息',
- display:'none',
- height:"200px",
- width:"300px",
- message:[]
- }
- var methods = {
- /**
- * 初始化
- */
- init : function(options) {
- var settings = $.extend({}, params, options);
- var MsgPop = $(this)[0];// 获取窗口这个对象,即ID为winpop的对象
- var MsgTitle=$("#"+MsgPop.id +" .title")[0];
- MsgPop.style.display = settings['display'];// 那么将隐藏的窗口显示出来
- $("#"+MsgPop.id +" .title .title").html(settings['title']);
- if(settings["message"].length>0){
- $("#"+MsgPop.id +" .con").append("
");
- for (var int = 0; int < settings["message"].length; int++) {
- $("#"+MsgPop.id +" .con ul").append(""+settings["message"][int]["title"]+" ");
- }
- $("#"+MsgPop.id +" .con").append(" ");
- }
- $("#"+MsgPop.id).animate({
- height:settings['height'],
- width:settings['width']
- });
- params=settings;
- },
- open : function() {//打开窗口
- var MsgPop = $(this)[0];// 获取窗口这个对象,即ID为winpop的对象
- MsgPop.style.display = "block";// 那么将隐藏的窗口显示出来
- $("#"+MsgPop.id).animate({
- height:params['height'],
- width:params['width']
- });
- },
- close : function() {//关闭窗口
- var MsgPop = $(this)[0];// 获取窗口这个对象,即ID为winpop的对象
- $("#"+MsgPop.id).animate({
- height:'0px',
- });
- setTimeout(function(){
- MsgPop.style.display = "none";// 将窗口隐藏
- },800)
-
- },
- }
-
-})(jQuery);
+(function($) {
+ var idName;
+ $.fn.box = function() {
+ var method = arguments[0];
+ if (methods[method]) {
+ method = methods[method];
+ arguments = Array.prototype.slice.call(arguments, 1);
+ } else if (typeof (method) == "object" || !method) {
+ method = methods.init;
+ } else {
+ $.error("Method" + method + "does not exist on jQuery.dialog");
+ return this;
+ }
+ return method.apply(this, arguments);
+ };
+ /**
+ * 参数
+ */
+ var params={
+ title : '您有新的提示消息',
+ display:'none',
+ height:"200px",
+ width:"300px",
+ message:[]
+ }
+ var methods = {
+ /**
+ * 初始化
+ */
+ init : function(options) {
+ var settings = $.extend({}, params, options);
+ var MsgPop = $(this)[0];// 获取窗口这个对象,即ID为winpop的对象
+ var MsgTitle=$("#"+MsgPop.id +" .title")[0];
+ MsgPop.style.display = settings['display'];// 那么将隐藏的窗口显示出来
+ $("#"+MsgPop.id +" .title .title").html(settings['title']);
+ if(settings["message"].length>0){
+ $("#"+MsgPop.id +" .con").append("
");
+ for (var int = 0; int < settings["message"].length; int++) {
+ $("#"+MsgPop.id +" .con ul").append(""+settings["message"][int]["title"]+" ");
+ }
+ $("#"+MsgPop.id +" .con").append(" ");
+ }
+ $("#"+MsgPop.id).animate({
+ height:settings['height'],
+ width:settings['width']
+ });
+ params=settings;
+ },
+ open : function() {//打开窗口
+ var MsgPop = $(this)[0];// 获取窗口这个对象,即ID为winpop的对象
+ MsgPop.style.display = "block";// 那么将隐藏的窗口显示出来
+ $("#"+MsgPop.id).animate({
+ height:params['height'],
+ width:params['width']
+ });
+ },
+ close : function() {//关闭窗口
+ var MsgPop = $(this)[0];// 获取窗口这个对象,即ID为winpop的对象
+ $("#"+MsgPop.id).animate({
+ height:'0px',
+ });
+ setTimeout(function(){
+ MsgPop.style.display = "none";// 将窗口隐藏
+ },800)
+
+ },
+ }
+
+})(jQuery);
diff --git a/chapter11/src/main/resources/static/assets/js/chosen.jquery.min.js b/chapter11/src/main/resources/static/assets/js/chosen.jquery.min.js
old mode 100755
new mode 100644
diff --git a/chapter11/src/main/resources/static/assets/js/common.js b/chapter11/src/main/resources/static/assets/js/common.js
deleted file mode 100644
index cdab623..0000000
--- a/chapter11/src/main/resources/static/assets/js/common.js
+++ /dev/null
@@ -1,36 +0,0 @@
-//这个是分页图标,必须添加
-function updatePagerIcons(table) {
- var replacement =
- {
- 'ui-icon-seek-first' : 'icon-double-angle-left bigger-140',
- 'ui-icon-seek-prev' : 'icon-angle-left bigger-140',
- 'ui-icon-seek-next' : 'icon-angle-right bigger-140',
- 'ui-icon-seek-end' : 'icon-double-angle-right bigger-140'
- };
- $('.ui-pg-table:not(.navtable) > tbody > tr > .ui-pg-button > .ui-icon').each(function(){
- var icon = $(this);
- var $class = $.trim(icon.attr('class').replace('ui-icon', ''));
- if($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);
- });
-}
-
-
-//重写alert
-window.alert = function(msg, callback){
- parent.layer.alert(msg, function(index){
- parent.layer.close(index);
- if(typeof(callback) === "function"){
- callback("ok");
- }
- });
-}
-
-//重写confirm式样框
-window.confirm = function(msg, callback){
- parent.layer.confirm(msg, {btn: ['确定','取消']},
- function(){//确定事件
- if(typeof(callback) === "function"){
- callback("ok");
- }
- });
-}
\ No newline at end of file
diff --git a/chapter11/src/main/resources/static/assets/js/custom.js b/chapter11/src/main/resources/static/assets/js/custom.js
old mode 100755
new mode 100644
diff --git a/chapter11/src/main/resources/static/assets/js/date-time/boostrap-daterangepicker-zh_CN.js b/chapter11/src/main/resources/static/assets/js/date-time/boostrap-daterangepicker-zh_CN.js
old mode 100755
new mode 100644
diff --git a/chapter11/src/main/resources/static/assets/js/date-time/bootstrap-datepicker.min.js b/chapter11/src/main/resources/static/assets/js/date-time/bootstrap-datepicker.min.js
old mode 100755
new mode 100644
index 8f87b21..f16ac37
--- a/chapter11/src/main/resources/static/assets/js/date-time/bootstrap-datepicker.min.js
+++ b/chapter11/src/main/resources/static/assets/js/date-time/bootstrap-datepicker.min.js
@@ -1,1005 +1,1005 @@
-!function(d) {
- function f() {
- return new Date(Date.UTC.apply(Date, arguments))
- }
- function b() {
- var g = new Date();
- return f(g.getUTCFullYear(), g.getUTCMonth(), g.getUTCDate())
- }
- var a = function(h, g) {
- var i = this;
- this.element = d(h);
- this.language = g.language || this.element.data("date-language")
- || "en";
- this.language = this.language in e ? this.language : this.language
- .split("-")[0];
- this.language = this.language in e ? this.language : "en";
- this.isRTL = e[this.language].rtl || false;
- this.format = c.parseFormat(g.format
- || this.element.data("date-format") || e[this.language].format
- || "mm/dd/yyyy");
- this.isInline = false;
- this.isInput = this.element.is("input");
- this.component = this.element.is(".date") ? this.element
- .find(".add-on, .btn") : false;
- this.hasInput = this.component && this.element.find("input").length;
- if (this.component && this.component.length === 0) {
- this.component = false
- }
- this._attachEvents();
- this.forceParse = true;
- if ("forceParse" in g) {
- this.forceParse = g.forceParse
- } else {
- if ("dateForceParse" in this.element.data()) {
- this.forceParse = this.element.data("date-force-parse")
- }
- }
- this.picker = d(c.template).appendTo(
- this.isInline ? this.element : "body").on({
- click : d.proxy(this.click, this),
- mousedown : d.proxy(this.mousedown, this)
- });
- if (this.isInline) {
- this.picker.addClass("datepicker-inline")
- } else {
- this.picker.addClass("datepicker-dropdown dropdown-menu")
- }
- if (this.isRTL) {
- this.picker.addClass("datepicker-rtl");
- this.picker.find(".prev i, .next i").toggleClass(
- "icon-arrow-left icon-arrow-right")
- }
- d(document)
- .on(
- "mousedown",
- function(j) {
- if (d(j.target)
- .closest(
- ".datepicker.datepicker-inline, .datepicker.datepicker-dropdown").length === 0) {
- i.hide()
- }
- });
- this.autoclose = false;
- if ("autoclose" in g) {
- this.autoclose = g.autoclose
- } else {
- if ("dateAutoclose" in this.element.data()) {
- this.autoclose = this.element.data("date-autoclose")
- }
- }
- this.keyboardNavigation = true;
- if ("keyboardNavigation" in g) {
- this.keyboardNavigation = g.keyboardNavigation
- } else {
- if ("dateKeyboardNavigation" in this.element.data()) {
- this.keyboardNavigation = this.element
- .data("date-keyboard-navigation")
- }
- }
- this.viewMode = this.startViewMode = 0;
- switch (g.startView || this.element.data("date-start-view")) {
- case 2:
- case "decade":
- this.viewMode = this.startViewMode = 2;
- break;
- case 1:
- case "year":
- this.viewMode = this.startViewMode = 1;
- break
- }
- this.minViewMode = g.minViewMode
- || this.element.data("date-min-view-mode") || 0;
- if (typeof this.minViewMode === "string") {
- switch (this.minViewMode) {
- case "months":
- this.minViewMode = 1;
- break;
- case "years":
- this.minViewMode = 2;
- break;
- default:
- this.minViewMode = 0;
- break
- }
- }
- this.viewMode = this.startViewMode = Math.max(this.startViewMode,
- this.minViewMode);
- this.todayBtn = (g.todayBtn || this.element.data("date-today-btn") || false);
- this.todayHighlight = (g.todayHighlight
- || this.element.data("date-today-highlight") || false);
- this.calendarWeeks = false;
- if ("calendarWeeks" in g) {
- this.calendarWeeks = g.calendarWeeks
- } else {
- if ("dateCalendarWeeks" in this.element.data()) {
- this.calendarWeeks = this.element.data("date-calendar-weeks")
- }
- }
- if (this.calendarWeeks) {
- this.picker.find("tfoot th.today").attr("colspan", function(j, k) {
- return parseInt(k) + 1
- })
- }
- this.weekStart = ((g.weekStart || this.element.data("date-weekstart")
- || e[this.language].weekStart || 0) % 7);
- this.weekEnd = ((this.weekStart + 6) % 7);
- this.startDate = -Infinity;
- this.endDate = Infinity;
- this.daysOfWeekDisabled = [];
- this.setStartDate(g.startDate || this.element.data("date-startdate"));
- this.setEndDate(g.endDate || this.element.data("date-enddate"));
- this.setDaysOfWeekDisabled(g.daysOfWeekDisabled
- || this.element.data("date-days-of-week-disabled"));
- this.fillDow();
- this.fillMonths();
- this.update();
- this.showMode();
- if (this.isInline) {
- this.show()
- }
- };
- a.prototype = {
- constructor : a,
- _events : [],
- _attachEvents : function() {
- this._detachEvents();
- if (this.isInput) {
- this._events = [ [ this.element, {
- focus : d.proxy(this.show, this),
- keyup : d.proxy(this.update, this),
- keydown : d.proxy(this.keydown, this)
- } ] ]
- } else {
- if (this.component && this.hasInput) {
- this._events = [ [ this.element.find("input"), {
- focus : d.proxy(this.show, this),
- keyup : d.proxy(this.update, this),
- keydown : d.proxy(this.keydown, this)
- } ], [ this.component, {
- click : d.proxy(this.show, this)
- } ] ]
- } else {
- if (this.element.is("div")) {
- this.isInline = true
- } else {
- this._events = [ [ this.element, {
- click : d.proxy(this.show, this)
- } ] ]
- }
- }
- }
- for (var g = 0, h, j; g < this._events.length; g++) {
- h = this._events[g][0];
- j = this._events[g][1];
- h.on(j)
- }
- },
- _detachEvents : function() {
- for (var g = 0, h, j; g < this._events.length; g++) {
- h = this._events[g][0];
- j = this._events[g][1];
- h.off(j)
- }
- this._events = []
- },
- show : function(g) {
- this.picker.show();
- this.height = this.component ? this.component.outerHeight()
- : this.element.outerHeight();
- this.update();
- this.place();
- d(window).on("resize", d.proxy(this.place, this));
- if (g) {
- g.preventDefault()
- }
- this.element.trigger({
- type : "show",
- date : this.date
- })
- },
- hide : function(g) {
- if (this.isInline) {
- return
- }
- if (!this.picker.is(":visible")) {
- return
- }
- this.picker.hide();
- d(window).off("resize", this.place);
- this.viewMode = this.startViewMode;
- this.showMode();
- if (!this.isInput) {
- d(document).off("mousedown", this.hide)
- }
- if (this.forceParse
- && (this.isInput && this.element.val() || this.hasInput
- && this.element.find("input").val())) {
- this.setValue()
- }
- this.element.trigger({
- type : "hide",
- date : this.date
- })
- },
- remove : function() {
- this._detachEvents();
- this.picker.remove();
- delete this.element.data().datepicker;
- if (!this.isInput) {
- delete this.element.data().date
- }
- },
- getDate : function() {
- var g = this.getUTCDate();
- return new Date(g.getTime() + (g.getTimezoneOffset() * 60000))
- },
- getUTCDate : function() {
- return this.date
- },
- setDate : function(g) {
- this.setUTCDate(new Date(g.getTime()
- - (g.getTimezoneOffset() * 60000)))
- },
- setUTCDate : function(g) {
- this.date = g;
- this.setValue()
- },
- setValue : function() {
- var g = this.getFormattedDate();
- if (!this.isInput) {
- if (this.component) {
- this.element.find("input").val(g)
- }
- this.element.data("date", g)
- } else {
- this.element.val(g)
- }
- },
- getFormattedDate : function(g) {
- if (g === undefined) {
- g = this.format
- }
- return c.formatDate(this.date, g, this.language)
- },
- setStartDate : function(g) {
- this.startDate = g || -Infinity;
- if (this.startDate !== -Infinity) {
- this.startDate = c.parseDate(this.startDate, this.format,
- this.language)
- }
- this.update();
- this.updateNavArrows()
- },
- setEndDate : function(g) {
- this.endDate = g || Infinity;
- if (this.endDate !== Infinity) {
- this.endDate = c.parseDate(this.endDate, this.format,
- this.language)
- }
- this.update();
- this.updateNavArrows()
- },
- setDaysOfWeekDisabled : function(g) {
- this.daysOfWeekDisabled = g || [];
- if (!d.isArray(this.daysOfWeekDisabled)) {
- this.daysOfWeekDisabled = this.daysOfWeekDisabled.split(/,\s*/)
- }
- this.daysOfWeekDisabled = d.map(this.daysOfWeekDisabled,
- function(h) {
- return parseInt(h, 10)
- });
- this.update();
- this.updateNavArrows()
- },
- place : function() {
- if (this.isInline) {
- return
- }
- var i = parseInt(this.element.parents().filter(function() {
- return d(this).css("z-index") != "auto"
- }).first().css("z-index")) + 1100;
- var h = this.component ? this.component.parent().offset()
- : this.element.offset();
- var g = this.component ? this.component.outerHeight(true)
- : this.element.outerHeight(true);
- this.picker.css({
- top : h.top + g,
- left : h.left,
- zIndex : i
- })
- },
- update : function() {
- var g, h = false;
- if (arguments
- && arguments.length
- && (typeof arguments[0] === "string" || arguments[0] instanceof Date)) {
- g = arguments[0];
- h = true
- } else {
- g = this.isInput ? this.element.val() : this.element
- .data("date")
- || this.element.find("input").val()
- }
- this.date = c.parseDate(g, this.format, this.language);
- if (h) {
- this.setValue()
- }
- if (this.date < this.startDate) {
- this.viewDate = new Date(this.startDate)
- } else {
- if (this.date > this.endDate) {
- this.viewDate = new Date(this.endDate)
- } else {
- this.viewDate = new Date(this.date)
- }
- }
- this.fill()
- },
- fillDow : function() {
- var h = this.weekStart, i = "
";
- if (this.calendarWeeks) {
- var g = ' ';
- i += g;
- this.picker.find(".datepicker-days thead tr:first-child")
- .prepend(g)
- }
- while (h < this.weekStart + 7) {
- i += '' + e[this.language].daysMin[(h++) % 7]
- + " "
- }
- i += " ";
- this.picker.find(".datepicker-days thead").append(i)
- },
- fillMonths : function() {
- var h = "", g = 0;
- while (g < 12) {
- h += '
' + e[this.language].monthsShort[g++]
- + " "
- }
- this.picker.find(".datepicker-months td").html(h)
- },
- fill : function() {
- var y = new Date(this.viewDate), p = y.getUTCFullYear(), z = y
- .getUTCMonth(), s = this.startDate !== -Infinity ? this.startDate
- .getUTCFullYear()
- : -Infinity, w = this.startDate !== -Infinity ? this.startDate
- .getUTCMonth()
- : -Infinity, m = this.endDate !== Infinity ? this.endDate
- .getUTCFullYear() : Infinity, t = this.endDate !== Infinity ? this.endDate
- .getUTCMonth()
- : Infinity, n = this.date && this.date.valueOf(), x = new Date();
- this.picker.find(".datepicker-days thead th.switch").text(
- e[this.language].months[z] + " " + p);
- this.picker.find("tfoot th.today").text(e[this.language].today)
- .toggle(this.todayBtn !== false);
- this.updateNavArrows();
- this.fillMonths();
- var B = f(p, z - 1, 28, 0, 0, 0, 0), v = c.getDaysInMonth(B
- .getUTCFullYear(), B.getUTCMonth());
- B.setUTCDate(v);
- B.setUTCDate(v - (B.getUTCDay() - this.weekStart + 7) % 7);
- var g = new Date(B);
- g.setUTCDate(g.getUTCDate() + 42);
- g = g.valueOf();
- var o = [];
- var r;
- while (B.valueOf() < g) {
- if (B.getUTCDay() == this.weekStart) {
- o.push("
");
- if (this.calendarWeeks) {
- var h = new Date(+B
- + (this.weekStart - B.getUTCDay() - 7) % 7
- * 86400000), k = new Date(+h
- + (7 + 4 - h.getUTCDay()) % 7 * 86400000), j = new Date(
- +(j = f(k.getUTCFullYear(), 0, 1))
- + (7 + 4 - j.getUTCDay()) % 7
- * 86400000), q = (k - j) / 86400000 / 7 + 1;
- o.push('' + q + " ")
- }
- }
- r = "";
- if (B.getUTCFullYear() < p
- || (B.getUTCFullYear() == p && B.getUTCMonth() < z)) {
- r += " old"
- } else {
- if (B.getUTCFullYear() > p
- || (B.getUTCFullYear() == p && B.getUTCMonth() > z)) {
- r += " new"
- }
- }
- if (this.todayHighlight
- && B.getUTCFullYear() == x.getFullYear()
- && B.getUTCMonth() == x.getMonth()
- && B.getUTCDate() == x.getDate()) {
- r += " today"
- }
- if (n && B.valueOf() == n) {
- r += " active"
- }
- if (B.valueOf() < this.startDate
- || B.valueOf() > this.endDate
- || d.inArray(B.getUTCDay(), this.daysOfWeekDisabled) !== -1) {
- r += " disabled"
- }
- o.push('' + B.getUTCDate() + " ");
- if (B.getUTCDay() == this.weekEnd) {
- o.push(" ")
- }
- B.setUTCDate(B.getUTCDate() + 1)
- }
- this.picker.find(".datepicker-days tbody").empty().append(
- o.join(""));
- var C = this.date && this.date.getUTCFullYear();
- var l = this.picker.find(".datepicker-months").find("th:eq(1)")
- .text(p).end().find("span").removeClass("active");
- if (C && C == p) {
- l.eq(this.date.getUTCMonth()).addClass("active")
- }
- if (p < s || p > m) {
- l.addClass("disabled")
- }
- if (p == s) {
- l.slice(0, w).addClass("disabled")
- }
- if (p == m) {
- l.slice(t + 1).addClass("disabled")
- }
- o = "";
- p = parseInt(p / 10, 10) * 10;
- var A = this.picker.find(".datepicker-years").find("th:eq(1)")
- .text(p + "-" + (p + 9)).end().find("td");
- p -= 1;
- for (var u = -1; u < 11; u++) {
- o += '
m ? " disabled" : "") + '">' + p
- + " ";
- p += 1
- }
- A.html(o)
- },
- updateNavArrows : function() {
- var i = new Date(this.viewDate), g = i.getUTCFullYear(), h = i
- .getUTCMonth();
- switch (this.viewMode) {
- case 0:
- if (this.startDate !== -Infinity
- && g <= this.startDate.getUTCFullYear()
- && h <= this.startDate.getUTCMonth()) {
- this.picker.find(".prev").css({
- visibility : "hidden"
- })
- } else {
- this.picker.find(".prev").css({
- visibility : "visible"
- })
- }
- if (this.endDate !== Infinity
- && g >= this.endDate.getUTCFullYear()
- && h >= this.endDate.getUTCMonth()) {
- this.picker.find(".next").css({
- visibility : "hidden"
- })
- } else {
- this.picker.find(".next").css({
- visibility : "visible"
- })
- }
- break;
- case 1:
- case 2:
- if (this.startDate !== -Infinity
- && g <= this.startDate.getUTCFullYear()) {
- this.picker.find(".prev").css({
- visibility : "hidden"
- })
- } else {
- this.picker.find(".prev").css({
- visibility : "visible"
- })
- }
- if (this.endDate !== Infinity
- && g >= this.endDate.getUTCFullYear()) {
- this.picker.find(".next").css({
- visibility : "hidden"
- })
- } else {
- this.picker.find(".next").css({
- visibility : "visible"
- })
- }
- break
- }
- },
- click : function(m) {
- m.preventDefault();
- var l = d(m.target).closest("span, td, th");
- if (l.length == 1) {
- switch (l[0].nodeName.toLowerCase()) {
- case "th":
- switch (l[0].className) {
- case "switch":
- this.showMode(1);
- break;
- case "prev":
- case "next":
- var i = c.modes[this.viewMode].navStep
- * (l[0].className == "prev" ? -1 : 1);
- switch (this.viewMode) {
- case 0:
- this.viewDate = this.moveMonth(this.viewDate, i);
- break;
- case 1:
- case 2:
- this.viewDate = this.moveYear(this.viewDate, i);
- break
- }
- this.fill();
- break;
- case "today":
- var h = new Date();
- h = f(h.getFullYear(), h.getMonth(), h.getDate(), 0, 0,
- 0);
- this.showMode(-2);
- var n = this.todayBtn == "linked" ? null : "view";
- this._setDate(h, n);
- break
- }
- break;
- case "span":
- if (!l.is(".disabled")) {
- this.viewDate.setUTCDate(1);
- if (l.is(".month")) {
- var g = 1;
- var k = l.parent().find("span").index(l);
- var j = this.viewDate.getUTCFullYear();
- this.viewDate.setUTCMonth(k);
- this.element.trigger({
- type : "changeMonth",
- date : this.viewDate
- });
- if (this.minViewMode == 1) {
- this._setDate(f(j, k, g, 0, 0, 0, 0))
- }
- } else {
- var j = parseInt(l.text(), 10) || 0;
- var g = 1;
- var k = 0;
- this.viewDate.setUTCFullYear(j);
- this.element.trigger({
- type : "changeYear",
- date : this.viewDate
- });
- if (this.minViewMode == 2) {
- this._setDate(f(j, k, g, 0, 0, 0, 0))
- }
- }
- this.showMode(-1);
- this.fill()
- }
- break;
- case "td":
- if (l.is(".day") && !l.is(".disabled")) {
- var g = parseInt(l.text(), 10) || 1;
- var j = this.viewDate.getUTCFullYear(), k = this.viewDate
- .getUTCMonth();
- if (l.is(".old")) {
- if (k === 0) {
- k = 11;
- j -= 1
- } else {
- k -= 1
- }
- } else {
- if (l.is(".new")) {
- if (k == 11) {
- k = 0;
- j += 1
- } else {
- k += 1
- }
- }
- }
- this._setDate(f(j, k, g, 0, 0, 0, 0))
- this.picker.hide();
- }
- break
- }
-
- }
- },
- _setDate : function(g, i) {
- if (!i || i == "date") {
- this.date = g
- }
- if (!i || i == "view") {
- this.viewDate = g
- }
- this.fill();
- this.setValue();
- this.element.trigger({
- type : "changeDate",
- date : this.date
- });
- var h;
- if (this.isInput) {
- h = this.element
- } else {
- if (this.component) {
- h = this.element.find("input")
- }
- }
- if (h) {
- h.change();
- if (this.autoclose && (!i || i == "date")) {
- this.hide()
- }
- }
- },
- moveMonth : function(g, h) {
- if (!h) {
- return g
- }
- var l = new Date(g.valueOf()), p = l.getUTCDate(), m = l
- .getUTCMonth(), k = Math.abs(h), o, n;
- h = h > 0 ? 1 : -1;
- if (k == 1) {
- n = h == -1 ? function() {
- return l.getUTCMonth() == m
- } : function() {
- return l.getUTCMonth() != o
- };
- o = m + h;
- l.setUTCMonth(o);
- if (o < 0 || o > 11) {
- o = (o + 12) % 12
- }
- } else {
- for (var j = 0; j < k; j++) {
- l = this.moveMonth(l, h)
- }
- o = l.getUTCMonth();
- l.setUTCDate(p);
- n = function() {
- return o != l.getUTCMonth()
- }
- }
- while (n()) {
- l.setUTCDate(--p);
- l.setUTCMonth(o)
- }
- return l
- },
- moveYear : function(h, g) {
- return this.moveMonth(h, g * 12)
- },
- dateWithinRange : function(g) {
- return g >= this.startDate && g <= this.endDate
- },
- keydown : function(n) {
- if (this.picker.is(":not(:visible)")) {
- if (n.keyCode == 27) {
- this.show()
- }
- return
- }
- var j = false, i, h, m, g, l;
- switch (n.keyCode) {
- case 27:
- this.hide();
- n.preventDefault();
- break;
- case 37:
- case 39:
- if (!this.keyboardNavigation) {
- break
- }
- i = n.keyCode == 37 ? -1 : 1;
- if (n.ctrlKey) {
- g = this.moveYear(this.date, i);
- l = this.moveYear(this.viewDate, i)
- } else {
- if (n.shiftKey) {
- g = this.moveMonth(this.date, i);
- l = this.moveMonth(this.viewDate, i)
- } else {
- g = new Date(this.date);
- g.setUTCDate(this.date.getUTCDate() + i);
- l = new Date(this.viewDate);
- l.setUTCDate(this.viewDate.getUTCDate() + i)
- }
- }
- if (this.dateWithinRange(g)) {
- this.date = g;
- this.viewDate = l;
- this.setValue();
- this.update();
- n.preventDefault();
- j = true
- }
- break;
- case 38:
- case 40:
- if (!this.keyboardNavigation) {
- break
- }
- i = n.keyCode == 38 ? -1 : 1;
- if (n.ctrlKey) {
- g = this.moveYear(this.date, i);
- l = this.moveYear(this.viewDate, i)
- } else {
- if (n.shiftKey) {
- g = this.moveMonth(this.date, i);
- l = this.moveMonth(this.viewDate, i)
- } else {
- g = new Date(this.date);
- g.setUTCDate(this.date.getUTCDate() + i * 7);
- l = new Date(this.viewDate);
- l.setUTCDate(this.viewDate.getUTCDate() + i * 7)
- }
- }
- if (this.dateWithinRange(g)) {
- this.date = g;
- this.viewDate = l;
- this.setValue();
- this.update();
- n.preventDefault();
- j = true
- }
- break;
- case 13:
- this.hide();
- n.preventDefault();
- break;
- case 9:
- this.hide();
- break
- }
- if (j) {
- this.element.trigger({
- type : "changeDate",
- date : this.date
- });
- var k;
- if (this.isInput) {
- k = this.element
- } else {
- if (this.component) {
- k = this.element.find("input")
- }
- }
- if (k) {
- k.change()
- }
- }
- },
- showMode : function(g) {
- if (g) {
- this.viewMode = Math.max(this.minViewMode, Math.min(2,
- this.viewMode + g))
- }
- this.picker.find(">div").hide().filter(
- ".datepicker-" + c.modes[this.viewMode].clsName).css(
- "display", "block");
- this.updateNavArrows()
- }
- };
- d.fn.datepicker = function(h) {
- var g = Array.apply(null, arguments);
- g.shift();
- return this.each(function() {
- var k = d(this), j = k.data("datepicker"), i = typeof h == "object"
- && h;
- if (!j) {
- k.data("datepicker", (j = new a(this, d.extend({},
- d.fn.datepicker.defaults, i))))
- }
- if (typeof h == "string" && typeof j[h] == "function") {
- j[h].apply(j, g)
- }
- })
- };
- d.fn.datepicker.defaults = {};
- d.fn.datepicker.Constructor = a;
- var e = d.fn.datepicker.dates = {
- en : {
- days : [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday",
- "Friday", "Saturday", "Sunday" ],
- daysShort : [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat",
- "Sun" ],
- daysMin : [ "Su", "Mo", "Tu", "We", "Th", "Fr", "Sa", "Su" ],
- months : [ "January", "February", "March", "April", "May", "June",
- "July", "August", "September", "October", "November",
- "December" ],
- monthsShort : [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul",
- "Aug", "Sep", "Oct", "Nov", "Dec" ],
- today : "Today"
- },
- cn:{
- days : ["星期天", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
- daysShort : ["天", "一", "二", "三", "四", "五", "六"],
- daysMin : ["天", "一", "二", "三", "四", "五", "六"],
- months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
- monthsShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
- today: "今天",
- }
- };
- var c = {
- modes : [ {
- clsName : "days",
- navFnc : "Month",
- navStep : 1
- }, {
- clsName : "months",
- navFnc : "FullYear",
- navStep : 1
- }, {
- clsName : "years",
- navFnc : "FullYear",
- navStep : 10
- } ],
- isLeapYear : function(g) {
- return (((g % 4 === 0) && (g % 100 !== 0)) || (g % 400 === 0))
- },
- getDaysInMonth : function(g, h) {
- return [ 31, (c.isLeapYear(g) ? 29 : 28), 31, 30, 31, 30, 31, 31,
- 30, 31, 30, 31 ][h]
- },
- validParts : /dd?|DD?|mm?|MM?|yy(?:yy)?/g,
- nonpunctuation : /[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g,
- parseFormat : function(i) {
- var g = i.replace(this.validParts, "\0").split("\0"), h = i
- .match(this.validParts);
- if (!g || !g.length || !h || h.length === 0) {
- throw new Error("Invalid date format.")
- }
- return {
- separators : g,
- parts : h
- }
- },
- parseDate : function(k, u, n) {
- if (k instanceof Date) {
- return k
- }
- if (/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(k)) {
- var w = /([\-+]\d+)([dmwy])/, m = k
- .match(/([\-+]\d+)([dmwy])/g), g, l;
- k = new Date();
- for (var o = 0; o < m.length; o++) {
- g = w.exec(m[o]);
- l = parseInt(g[1]);
- switch (g[2]) {
- case "d":
- k.setUTCDate(k.getUTCDate() + l);
- break;
- case "m":
- k = a.prototype.moveMonth.call(a.prototype, k, l);
- break;
- case "w":
- k.setUTCDate(k.getUTCDate() + l * 7);
- break;
- case "y":
- k = a.prototype.moveYear.call(a.prototype, k, l);
- break
- }
- }
- return f(k.getUTCFullYear(), k.getUTCMonth(), k.getUTCDate(),
- 0, 0, 0)
- }
- var m = k && k.match(this.nonpunctuation) || [], k = new Date(), r = {}, t = [
- "yyyy", "yy", "M", "MM", "m", "mm", "d", "dd" ], v = {
- yyyy : function(s, i) {
- return s.setUTCFullYear(i)
- },
- yy : function(s, i) {
- return s.setUTCFullYear(2000 + i)
- },
- m : function(s, i) {
- i -= 1;
- while (i < 0) {
- i += 12
- }
- i %= 12;
- s.setUTCMonth(i);
- while (s.getUTCMonth() != i) {
- s.setUTCDate(s.getUTCDate() - 1)
- }
- return s
- },
- d : function(s, i) {
- return s.setUTCDate(i)
- }
- }, j, p, g;
- v.M = v.MM = v.mm = v.m;
- v.dd = v.d;
- k = f(k.getFullYear(), k.getMonth(), k.getDate(), 0, 0, 0);
- var q = u.parts.slice();
- if (m.length != q.length) {
- q = d(q).filter(function(s, y) {
- return d.inArray(y, t) !== -1
- }).toArray()
- }
- if (m.length == q.length) {
- for (var o = 0, h = q.length; o < h; o++) {
- j = parseInt(m[o], 10);
- g = q[o];
- if (isNaN(j)) {
- switch (g) {
- case "MM":
- p = d(e[n].months)
- .filter(
- function() {
- var i = this.slice(0,
- m[o].length), s = m[o]
- .slice(0, i.length);
- return i == s
- });
- j = d.inArray(p[0], e[n].months) + 1;
- break;
- case "M":
- p = d(e[n].monthsShort)
- .filter(
- function() {
- var i = this.slice(0,
- m[o].length), s = m[o]
- .slice(0, i.length);
- return i == s
- });
- j = d.inArray(p[0], e[n].monthsShort) + 1;
- break
- }
- }
- r[g] = j
- }
- for (var o = 0, x; o < t.length; o++) {
- x = t[o];
- if (x in r && !isNaN(r[x])) {
- v[x](k, r[x])
- }
- }
- }
- return k
- },
- formatDate : function(g, l, n) {
- var m = {
- d : g.getUTCDate(),
- D : e[n].daysShort[g.getUTCDay()],
- DD : e[n].days[g.getUTCDay()],
- m : g.getUTCMonth() + 1,
- M : e[n].monthsShort[g.getUTCMonth()],
- MM : e[n].months[g.getUTCMonth()],
- yy : g.getUTCFullYear().toString().substring(2),
- yyyy : g.getUTCFullYear()
- };
- m.dd = (m.d < 10 ? "0" : "") + m.d;
- m.mm = (m.m < 10 ? "0" : "") + m.m;
- var g = [], k = d.extend([], l.separators);
- for (var j = 0, h = l.parts.length; j < h; j++) {
- if (k.length) {
- g.push(k.shift())
- }
- g.push(m[l.parts[j]])
- }
- return g.join("")
- },
- headTemplate : '
',
- contTemplate : '
',
- footTemplate : '
'
- };
- c.template = '
'
- + c.headTemplate
- + " "
- + c.footTemplate
- + '
'
- + c.headTemplate
- + c.contTemplate
- + c.footTemplate
- + '
'
- + c.headTemplate
- + c.contTemplate
- + c.footTemplate
- + "
";
- d.fn.datepicker.DPGlobal = c
+!function(d) {
+ function f() {
+ return new Date(Date.UTC.apply(Date, arguments))
+ }
+ function b() {
+ var g = new Date();
+ return f(g.getUTCFullYear(), g.getUTCMonth(), g.getUTCDate())
+ }
+ var a = function(h, g) {
+ var i = this;
+ this.element = d(h);
+ this.language = g.language || this.element.data("date-language")
+ || "en";
+ this.language = this.language in e ? this.language : this.language
+ .split("-")[0];
+ this.language = this.language in e ? this.language : "en";
+ this.isRTL = e[this.language].rtl || false;
+ this.format = c.parseFormat(g.format
+ || this.element.data("date-format") || e[this.language].format
+ || "mm/dd/yyyy");
+ this.isInline = false;
+ this.isInput = this.element.is("input");
+ this.component = this.element.is(".date") ? this.element
+ .find(".add-on, .btn") : false;
+ this.hasInput = this.component && this.element.find("input").length;
+ if (this.component && this.component.length === 0) {
+ this.component = false
+ }
+ this._attachEvents();
+ this.forceParse = true;
+ if ("forceParse" in g) {
+ this.forceParse = g.forceParse
+ } else {
+ if ("dateForceParse" in this.element.data()) {
+ this.forceParse = this.element.data("date-force-parse")
+ }
+ }
+ this.picker = d(c.template).appendTo(
+ this.isInline ? this.element : "body").on({
+ click : d.proxy(this.click, this),
+ mousedown : d.proxy(this.mousedown, this)
+ });
+ if (this.isInline) {
+ this.picker.addClass("datepicker-inline")
+ } else {
+ this.picker.addClass("datepicker-dropdown dropdown-menu")
+ }
+ if (this.isRTL) {
+ this.picker.addClass("datepicker-rtl");
+ this.picker.find(".prev i, .next i").toggleClass(
+ "icon-arrow-left icon-arrow-right")
+ }
+ d(document)
+ .on(
+ "mousedown",
+ function(j) {
+ if (d(j.target)
+ .closest(
+ ".datepicker.datepicker-inline, .datepicker.datepicker-dropdown").length === 0) {
+ i.hide()
+ }
+ });
+ this.autoclose = false;
+ if ("autoclose" in g) {
+ this.autoclose = g.autoclose
+ } else {
+ if ("dateAutoclose" in this.element.data()) {
+ this.autoclose = this.element.data("date-autoclose")
+ }
+ }
+ this.keyboardNavigation = true;
+ if ("keyboardNavigation" in g) {
+ this.keyboardNavigation = g.keyboardNavigation
+ } else {
+ if ("dateKeyboardNavigation" in this.element.data()) {
+ this.keyboardNavigation = this.element
+ .data("date-keyboard-navigation")
+ }
+ }
+ this.viewMode = this.startViewMode = 0;
+ switch (g.startView || this.element.data("date-start-view")) {
+ case 2:
+ case "decade":
+ this.viewMode = this.startViewMode = 2;
+ break;
+ case 1:
+ case "year":
+ this.viewMode = this.startViewMode = 1;
+ break
+ }
+ this.minViewMode = g.minViewMode
+ || this.element.data("date-min-view-mode") || 0;
+ if (typeof this.minViewMode === "string") {
+ switch (this.minViewMode) {
+ case "months":
+ this.minViewMode = 1;
+ break;
+ case "years":
+ this.minViewMode = 2;
+ break;
+ default:
+ this.minViewMode = 0;
+ break
+ }
+ }
+ this.viewMode = this.startViewMode = Math.max(this.startViewMode,
+ this.minViewMode);
+ this.todayBtn = (g.todayBtn || this.element.data("date-today-btn") || false);
+ this.todayHighlight = (g.todayHighlight
+ || this.element.data("date-today-highlight") || false);
+ this.calendarWeeks = false;
+ if ("calendarWeeks" in g) {
+ this.calendarWeeks = g.calendarWeeks
+ } else {
+ if ("dateCalendarWeeks" in this.element.data()) {
+ this.calendarWeeks = this.element.data("date-calendar-weeks")
+ }
+ }
+ if (this.calendarWeeks) {
+ this.picker.find("tfoot th.today").attr("colspan", function(j, k) {
+ return parseInt(k) + 1
+ })
+ }
+ this.weekStart = ((g.weekStart || this.element.data("date-weekstart")
+ || e[this.language].weekStart || 0) % 7);
+ this.weekEnd = ((this.weekStart + 6) % 7);
+ this.startDate = -Infinity;
+ this.endDate = Infinity;
+ this.daysOfWeekDisabled = [];
+ this.setStartDate(g.startDate || this.element.data("date-startdate"));
+ this.setEndDate(g.endDate || this.element.data("date-enddate"));
+ this.setDaysOfWeekDisabled(g.daysOfWeekDisabled
+ || this.element.data("date-days-of-week-disabled"));
+ this.fillDow();
+ this.fillMonths();
+ this.update();
+ this.showMode();
+ if (this.isInline) {
+ this.show()
+ }
+ };
+ a.prototype = {
+ constructor : a,
+ _events : [],
+ _attachEvents : function() {
+ this._detachEvents();
+ if (this.isInput) {
+ this._events = [ [ this.element, {
+ focus : d.proxy(this.show, this),
+ keyup : d.proxy(this.update, this),
+ keydown : d.proxy(this.keydown, this)
+ } ] ]
+ } else {
+ if (this.component && this.hasInput) {
+ this._events = [ [ this.element.find("input"), {
+ focus : d.proxy(this.show, this),
+ keyup : d.proxy(this.update, this),
+ keydown : d.proxy(this.keydown, this)
+ } ], [ this.component, {
+ click : d.proxy(this.show, this)
+ } ] ]
+ } else {
+ if (this.element.is("div")) {
+ this.isInline = true
+ } else {
+ this._events = [ [ this.element, {
+ click : d.proxy(this.show, this)
+ } ] ]
+ }
+ }
+ }
+ for (var g = 0, h, j; g < this._events.length; g++) {
+ h = this._events[g][0];
+ j = this._events[g][1];
+ h.on(j)
+ }
+ },
+ _detachEvents : function() {
+ for (var g = 0, h, j; g < this._events.length; g++) {
+ h = this._events[g][0];
+ j = this._events[g][1];
+ h.off(j)
+ }
+ this._events = []
+ },
+ show : function(g) {
+ this.picker.show();
+ this.height = this.component ? this.component.outerHeight()
+ : this.element.outerHeight();
+ this.update();
+ this.place();
+ d(window).on("resize", d.proxy(this.place, this));
+ if (g) {
+ g.preventDefault()
+ }
+ this.element.trigger({
+ type : "show",
+ date : this.date
+ })
+ },
+ hide : function(g) {
+ if (this.isInline) {
+ return
+ }
+ if (!this.picker.is(":visible")) {
+ return
+ }
+ this.picker.hide();
+ d(window).off("resize", this.place);
+ this.viewMode = this.startViewMode;
+ this.showMode();
+ if (!this.isInput) {
+ d(document).off("mousedown", this.hide)
+ }
+ if (this.forceParse
+ && (this.isInput && this.element.val() || this.hasInput
+ && this.element.find("input").val())) {
+ this.setValue()
+ }
+ this.element.trigger({
+ type : "hide",
+ date : this.date
+ })
+ },
+ remove : function() {
+ this._detachEvents();
+ this.picker.remove();
+ delete this.element.data().datepicker;
+ if (!this.isInput) {
+ delete this.element.data().date
+ }
+ },
+ getDate : function() {
+ var g = this.getUTCDate();
+ return new Date(g.getTime() + (g.getTimezoneOffset() * 60000))
+ },
+ getUTCDate : function() {
+ return this.date
+ },
+ setDate : function(g) {
+ this.setUTCDate(new Date(g.getTime()
+ - (g.getTimezoneOffset() * 60000)))
+ },
+ setUTCDate : function(g) {
+ this.date = g;
+ this.setValue()
+ },
+ setValue : function() {
+ var g = this.getFormattedDate();
+ if (!this.isInput) {
+ if (this.component) {
+ this.element.find("input").val(g)
+ }
+ this.element.data("date", g)
+ } else {
+ this.element.val(g)
+ }
+ },
+ getFormattedDate : function(g) {
+ if (g === undefined) {
+ g = this.format
+ }
+ return c.formatDate(this.date, g, this.language)
+ },
+ setStartDate : function(g) {
+ this.startDate = g || -Infinity;
+ if (this.startDate !== -Infinity) {
+ this.startDate = c.parseDate(this.startDate, this.format,
+ this.language)
+ }
+ this.update();
+ this.updateNavArrows()
+ },
+ setEndDate : function(g) {
+ this.endDate = g || Infinity;
+ if (this.endDate !== Infinity) {
+ this.endDate = c.parseDate(this.endDate, this.format,
+ this.language)
+ }
+ this.update();
+ this.updateNavArrows()
+ },
+ setDaysOfWeekDisabled : function(g) {
+ this.daysOfWeekDisabled = g || [];
+ if (!d.isArray(this.daysOfWeekDisabled)) {
+ this.daysOfWeekDisabled = this.daysOfWeekDisabled.split(/,\s*/)
+ }
+ this.daysOfWeekDisabled = d.map(this.daysOfWeekDisabled,
+ function(h) {
+ return parseInt(h, 10)
+ });
+ this.update();
+ this.updateNavArrows()
+ },
+ place : function() {
+ if (this.isInline) {
+ return
+ }
+ var i = parseInt(this.element.parents().filter(function() {
+ return d(this).css("z-index") != "auto"
+ }).first().css("z-index")) + 1100;
+ var h = this.component ? this.component.parent().offset()
+ : this.element.offset();
+ var g = this.component ? this.component.outerHeight(true)
+ : this.element.outerHeight(true);
+ this.picker.css({
+ top : h.top + g,
+ left : h.left,
+ zIndex : i
+ })
+ },
+ update : function() {
+ var g, h = false;
+ if (arguments
+ && arguments.length
+ && (typeof arguments[0] === "string" || arguments[0] instanceof Date)) {
+ g = arguments[0];
+ h = true
+ } else {
+ g = this.isInput ? this.element.val() : this.element
+ .data("date")
+ || this.element.find("input").val()
+ }
+ this.date = c.parseDate(g, this.format, this.language);
+ if (h) {
+ this.setValue()
+ }
+ if (this.date < this.startDate) {
+ this.viewDate = new Date(this.startDate)
+ } else {
+ if (this.date > this.endDate) {
+ this.viewDate = new Date(this.endDate)
+ } else {
+ this.viewDate = new Date(this.date)
+ }
+ }
+ this.fill()
+ },
+ fillDow : function() {
+ var h = this.weekStart, i = "
";
+ if (this.calendarWeeks) {
+ var g = ' ';
+ i += g;
+ this.picker.find(".datepicker-days thead tr:first-child")
+ .prepend(g)
+ }
+ while (h < this.weekStart + 7) {
+ i += '' + e[this.language].daysMin[(h++) % 7]
+ + " "
+ }
+ i += " ";
+ this.picker.find(".datepicker-days thead").append(i)
+ },
+ fillMonths : function() {
+ var h = "", g = 0;
+ while (g < 12) {
+ h += '
' + e[this.language].monthsShort[g++]
+ + " "
+ }
+ this.picker.find(".datepicker-months td").html(h)
+ },
+ fill : function() {
+ var y = new Date(this.viewDate), p = y.getUTCFullYear(), z = y
+ .getUTCMonth(), s = this.startDate !== -Infinity ? this.startDate
+ .getUTCFullYear()
+ : -Infinity, w = this.startDate !== -Infinity ? this.startDate
+ .getUTCMonth()
+ : -Infinity, m = this.endDate !== Infinity ? this.endDate
+ .getUTCFullYear() : Infinity, t = this.endDate !== Infinity ? this.endDate
+ .getUTCMonth()
+ : Infinity, n = this.date && this.date.valueOf(), x = new Date();
+ this.picker.find(".datepicker-days thead th.switch").text(
+ e[this.language].months[z] + " " + p);
+ this.picker.find("tfoot th.today").text(e[this.language].today)
+ .toggle(this.todayBtn !== false);
+ this.updateNavArrows();
+ this.fillMonths();
+ var B = f(p, z - 1, 28, 0, 0, 0, 0), v = c.getDaysInMonth(B
+ .getUTCFullYear(), B.getUTCMonth());
+ B.setUTCDate(v);
+ B.setUTCDate(v - (B.getUTCDay() - this.weekStart + 7) % 7);
+ var g = new Date(B);
+ g.setUTCDate(g.getUTCDate() + 42);
+ g = g.valueOf();
+ var o = [];
+ var r;
+ while (B.valueOf() < g) {
+ if (B.getUTCDay() == this.weekStart) {
+ o.push("
");
+ if (this.calendarWeeks) {
+ var h = new Date(+B
+ + (this.weekStart - B.getUTCDay() - 7) % 7
+ * 86400000), k = new Date(+h
+ + (7 + 4 - h.getUTCDay()) % 7 * 86400000), j = new Date(
+ +(j = f(k.getUTCFullYear(), 0, 1))
+ + (7 + 4 - j.getUTCDay()) % 7
+ * 86400000), q = (k - j) / 86400000 / 7 + 1;
+ o.push('' + q + " ")
+ }
+ }
+ r = "";
+ if (B.getUTCFullYear() < p
+ || (B.getUTCFullYear() == p && B.getUTCMonth() < z)) {
+ r += " old"
+ } else {
+ if (B.getUTCFullYear() > p
+ || (B.getUTCFullYear() == p && B.getUTCMonth() > z)) {
+ r += " new"
+ }
+ }
+ if (this.todayHighlight
+ && B.getUTCFullYear() == x.getFullYear()
+ && B.getUTCMonth() == x.getMonth()
+ && B.getUTCDate() == x.getDate()) {
+ r += " today"
+ }
+ if (n && B.valueOf() == n) {
+ r += " active"
+ }
+ if (B.valueOf() < this.startDate
+ || B.valueOf() > this.endDate
+ || d.inArray(B.getUTCDay(), this.daysOfWeekDisabled) !== -1) {
+ r += " disabled"
+ }
+ o.push('' + B.getUTCDate() + " ");
+ if (B.getUTCDay() == this.weekEnd) {
+ o.push(" ")
+ }
+ B.setUTCDate(B.getUTCDate() + 1)
+ }
+ this.picker.find(".datepicker-days tbody").empty().append(
+ o.join(""));
+ var C = this.date && this.date.getUTCFullYear();
+ var l = this.picker.find(".datepicker-months").find("th:eq(1)")
+ .text(p).end().find("span").removeClass("active");
+ if (C && C == p) {
+ l.eq(this.date.getUTCMonth()).addClass("active")
+ }
+ if (p < s || p > m) {
+ l.addClass("disabled")
+ }
+ if (p == s) {
+ l.slice(0, w).addClass("disabled")
+ }
+ if (p == m) {
+ l.slice(t + 1).addClass("disabled")
+ }
+ o = "";
+ p = parseInt(p / 10, 10) * 10;
+ var A = this.picker.find(".datepicker-years").find("th:eq(1)")
+ .text(p + "-" + (p + 9)).end().find("td");
+ p -= 1;
+ for (var u = -1; u < 11; u++) {
+ o += '
m ? " disabled" : "") + '">' + p
+ + " ";
+ p += 1
+ }
+ A.html(o)
+ },
+ updateNavArrows : function() {
+ var i = new Date(this.viewDate), g = i.getUTCFullYear(), h = i
+ .getUTCMonth();
+ switch (this.viewMode) {
+ case 0:
+ if (this.startDate !== -Infinity
+ && g <= this.startDate.getUTCFullYear()
+ && h <= this.startDate.getUTCMonth()) {
+ this.picker.find(".prev").css({
+ visibility : "hidden"
+ })
+ } else {
+ this.picker.find(".prev").css({
+ visibility : "visible"
+ })
+ }
+ if (this.endDate !== Infinity
+ && g >= this.endDate.getUTCFullYear()
+ && h >= this.endDate.getUTCMonth()) {
+ this.picker.find(".next").css({
+ visibility : "hidden"
+ })
+ } else {
+ this.picker.find(".next").css({
+ visibility : "visible"
+ })
+ }
+ break;
+ case 1:
+ case 2:
+ if (this.startDate !== -Infinity
+ && g <= this.startDate.getUTCFullYear()) {
+ this.picker.find(".prev").css({
+ visibility : "hidden"
+ })
+ } else {
+ this.picker.find(".prev").css({
+ visibility : "visible"
+ })
+ }
+ if (this.endDate !== Infinity
+ && g >= this.endDate.getUTCFullYear()) {
+ this.picker.find(".next").css({
+ visibility : "hidden"
+ })
+ } else {
+ this.picker.find(".next").css({
+ visibility : "visible"
+ })
+ }
+ break
+ }
+ },
+ click : function(m) {
+ m.preventDefault();
+ var l = d(m.target).closest("span, td, th");
+ if (l.length == 1) {
+ switch (l[0].nodeName.toLowerCase()) {
+ case "th":
+ switch (l[0].className) {
+ case "switch":
+ this.showMode(1);
+ break;
+ case "prev":
+ case "next":
+ var i = c.modes[this.viewMode].navStep
+ * (l[0].className == "prev" ? -1 : 1);
+ switch (this.viewMode) {
+ case 0:
+ this.viewDate = this.moveMonth(this.viewDate, i);
+ break;
+ case 1:
+ case 2:
+ this.viewDate = this.moveYear(this.viewDate, i);
+ break
+ }
+ this.fill();
+ break;
+ case "today":
+ var h = new Date();
+ h = f(h.getFullYear(), h.getMonth(), h.getDate(), 0, 0,
+ 0);
+ this.showMode(-2);
+ var n = this.todayBtn == "linked" ? null : "view";
+ this._setDate(h, n);
+ break
+ }
+ break;
+ case "span":
+ if (!l.is(".disabled")) {
+ this.viewDate.setUTCDate(1);
+ if (l.is(".month")) {
+ var g = 1;
+ var k = l.parent().find("span").index(l);
+ var j = this.viewDate.getUTCFullYear();
+ this.viewDate.setUTCMonth(k);
+ this.element.trigger({
+ type : "changeMonth",
+ date : this.viewDate
+ });
+ if (this.minViewMode == 1) {
+ this._setDate(f(j, k, g, 0, 0, 0, 0))
+ }
+ } else {
+ var j = parseInt(l.text(), 10) || 0;
+ var g = 1;
+ var k = 0;
+ this.viewDate.setUTCFullYear(j);
+ this.element.trigger({
+ type : "changeYear",
+ date : this.viewDate
+ });
+ if (this.minViewMode == 2) {
+ this._setDate(f(j, k, g, 0, 0, 0, 0))
+ }
+ }
+ this.showMode(-1);
+ this.fill()
+ }
+ break;
+ case "td":
+ if (l.is(".day") && !l.is(".disabled")) {
+ var g = parseInt(l.text(), 10) || 1;
+ var j = this.viewDate.getUTCFullYear(), k = this.viewDate
+ .getUTCMonth();
+ if (l.is(".old")) {
+ if (k === 0) {
+ k = 11;
+ j -= 1
+ } else {
+ k -= 1
+ }
+ } else {
+ if (l.is(".new")) {
+ if (k == 11) {
+ k = 0;
+ j += 1
+ } else {
+ k += 1
+ }
+ }
+ }
+ this._setDate(f(j, k, g, 0, 0, 0, 0))
+ this.picker.hide();
+ }
+ break
+ }
+
+ }
+ },
+ _setDate : function(g, i) {
+ if (!i || i == "date") {
+ this.date = g
+ }
+ if (!i || i == "view") {
+ this.viewDate = g
+ }
+ this.fill();
+ this.setValue();
+ this.element.trigger({
+ type : "changeDate",
+ date : this.date
+ });
+ var h;
+ if (this.isInput) {
+ h = this.element
+ } else {
+ if (this.component) {
+ h = this.element.find("input")
+ }
+ }
+ if (h) {
+ h.change();
+ if (this.autoclose && (!i || i == "date")) {
+ this.hide()
+ }
+ }
+ },
+ moveMonth : function(g, h) {
+ if (!h) {
+ return g
+ }
+ var l = new Date(g.valueOf()), p = l.getUTCDate(), m = l
+ .getUTCMonth(), k = Math.abs(h), o, n;
+ h = h > 0 ? 1 : -1;
+ if (k == 1) {
+ n = h == -1 ? function() {
+ return l.getUTCMonth() == m
+ } : function() {
+ return l.getUTCMonth() != o
+ };
+ o = m + h;
+ l.setUTCMonth(o);
+ if (o < 0 || o > 11) {
+ o = (o + 12) % 12
+ }
+ } else {
+ for (var j = 0; j < k; j++) {
+ l = this.moveMonth(l, h)
+ }
+ o = l.getUTCMonth();
+ l.setUTCDate(p);
+ n = function() {
+ return o != l.getUTCMonth()
+ }
+ }
+ while (n()) {
+ l.setUTCDate(--p);
+ l.setUTCMonth(o)
+ }
+ return l
+ },
+ moveYear : function(h, g) {
+ return this.moveMonth(h, g * 12)
+ },
+ dateWithinRange : function(g) {
+ return g >= this.startDate && g <= this.endDate
+ },
+ keydown : function(n) {
+ if (this.picker.is(":not(:visible)")) {
+ if (n.keyCode == 27) {
+ this.show()
+ }
+ return
+ }
+ var j = false, i, h, m, g, l;
+ switch (n.keyCode) {
+ case 27:
+ this.hide();
+ n.preventDefault();
+ break;
+ case 37:
+ case 39:
+ if (!this.keyboardNavigation) {
+ break
+ }
+ i = n.keyCode == 37 ? -1 : 1;
+ if (n.ctrlKey) {
+ g = this.moveYear(this.date, i);
+ l = this.moveYear(this.viewDate, i)
+ } else {
+ if (n.shiftKey) {
+ g = this.moveMonth(this.date, i);
+ l = this.moveMonth(this.viewDate, i)
+ } else {
+ g = new Date(this.date);
+ g.setUTCDate(this.date.getUTCDate() + i);
+ l = new Date(this.viewDate);
+ l.setUTCDate(this.viewDate.getUTCDate() + i)
+ }
+ }
+ if (this.dateWithinRange(g)) {
+ this.date = g;
+ this.viewDate = l;
+ this.setValue();
+ this.update();
+ n.preventDefault();
+ j = true
+ }
+ break;
+ case 38:
+ case 40:
+ if (!this.keyboardNavigation) {
+ break
+ }
+ i = n.keyCode == 38 ? -1 : 1;
+ if (n.ctrlKey) {
+ g = this.moveYear(this.date, i);
+ l = this.moveYear(this.viewDate, i)
+ } else {
+ if (n.shiftKey) {
+ g = this.moveMonth(this.date, i);
+ l = this.moveMonth(this.viewDate, i)
+ } else {
+ g = new Date(this.date);
+ g.setUTCDate(this.date.getUTCDate() + i * 7);
+ l = new Date(this.viewDate);
+ l.setUTCDate(this.viewDate.getUTCDate() + i * 7)
+ }
+ }
+ if (this.dateWithinRange(g)) {
+ this.date = g;
+ this.viewDate = l;
+ this.setValue();
+ this.update();
+ n.preventDefault();
+ j = true
+ }
+ break;
+ case 13:
+ this.hide();
+ n.preventDefault();
+ break;
+ case 9:
+ this.hide();
+ break
+ }
+ if (j) {
+ this.element.trigger({
+ type : "changeDate",
+ date : this.date
+ });
+ var k;
+ if (this.isInput) {
+ k = this.element
+ } else {
+ if (this.component) {
+ k = this.element.find("input")
+ }
+ }
+ if (k) {
+ k.change()
+ }
+ }
+ },
+ showMode : function(g) {
+ if (g) {
+ this.viewMode = Math.max(this.minViewMode, Math.min(2,
+ this.viewMode + g))
+ }
+ this.picker.find(">div").hide().filter(
+ ".datepicker-" + c.modes[this.viewMode].clsName).css(
+ "display", "block");
+ this.updateNavArrows()
+ }
+ };
+ d.fn.datepicker = function(h) {
+ var g = Array.apply(null, arguments);
+ g.shift();
+ return this.each(function() {
+ var k = d(this), j = k.data("datepicker"), i = typeof h == "object"
+ && h;
+ if (!j) {
+ k.data("datepicker", (j = new a(this, d.extend({},
+ d.fn.datepicker.defaults, i))))
+ }
+ if (typeof h == "string" && typeof j[h] == "function") {
+ j[h].apply(j, g)
+ }
+ })
+ };
+ d.fn.datepicker.defaults = {};
+ d.fn.datepicker.Constructor = a;
+ var e = d.fn.datepicker.dates = {
+ en : {
+ days : [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday",
+ "Friday", "Saturday", "Sunday" ],
+ daysShort : [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat",
+ "Sun" ],
+ daysMin : [ "Su", "Mo", "Tu", "We", "Th", "Fr", "Sa", "Su" ],
+ months : [ "January", "February", "March", "April", "May", "June",
+ "July", "August", "September", "October", "November",
+ "December" ],
+ monthsShort : [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul",
+ "Aug", "Sep", "Oct", "Nov", "Dec" ],
+ today : "Today"
+ },
+ cn:{
+ days : ["星期天", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
+ daysShort : ["天", "一", "二", "三", "四", "五", "六"],
+ daysMin : ["天", "一", "二", "三", "四", "五", "六"],
+ months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
+ monthsShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
+ today: "今天",
+ }
+ };
+ var c = {
+ modes : [ {
+ clsName : "days",
+ navFnc : "Month",
+ navStep : 1
+ }, {
+ clsName : "months",
+ navFnc : "FullYear",
+ navStep : 1
+ }, {
+ clsName : "years",
+ navFnc : "FullYear",
+ navStep : 10
+ } ],
+ isLeapYear : function(g) {
+ return (((g % 4 === 0) && (g % 100 !== 0)) || (g % 400 === 0))
+ },
+ getDaysInMonth : function(g, h) {
+ return [ 31, (c.isLeapYear(g) ? 29 : 28), 31, 30, 31, 30, 31, 31,
+ 30, 31, 30, 31 ][h]
+ },
+ validParts : /dd?|DD?|mm?|MM?|yy(?:yy)?/g,
+ nonpunctuation : /[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g,
+ parseFormat : function(i) {
+ var g = i.replace(this.validParts, "\0").split("\0"), h = i
+ .match(this.validParts);
+ if (!g || !g.length || !h || h.length === 0) {
+ throw new Error("Invalid date format.")
+ }
+ return {
+ separators : g,
+ parts : h
+ }
+ },
+ parseDate : function(k, u, n) {
+ if (k instanceof Date) {
+ return k
+ }
+ if (/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(k)) {
+ var w = /([\-+]\d+)([dmwy])/, m = k
+ .match(/([\-+]\d+)([dmwy])/g), g, l;
+ k = new Date();
+ for (var o = 0; o < m.length; o++) {
+ g = w.exec(m[o]);
+ l = parseInt(g[1]);
+ switch (g[2]) {
+ case "d":
+ k.setUTCDate(k.getUTCDate() + l);
+ break;
+ case "m":
+ k = a.prototype.moveMonth.call(a.prototype, k, l);
+ break;
+ case "w":
+ k.setUTCDate(k.getUTCDate() + l * 7);
+ break;
+ case "y":
+ k = a.prototype.moveYear.call(a.prototype, k, l);
+ break
+ }
+ }
+ return f(k.getUTCFullYear(), k.getUTCMonth(), k.getUTCDate(),
+ 0, 0, 0)
+ }
+ var m = k && k.match(this.nonpunctuation) || [], k = new Date(), r = {}, t = [
+ "yyyy", "yy", "M", "MM", "m", "mm", "d", "dd" ], v = {
+ yyyy : function(s, i) {
+ return s.setUTCFullYear(i)
+ },
+ yy : function(s, i) {
+ return s.setUTCFullYear(2000 + i)
+ },
+ m : function(s, i) {
+ i -= 1;
+ while (i < 0) {
+ i += 12
+ }
+ i %= 12;
+ s.setUTCMonth(i);
+ while (s.getUTCMonth() != i) {
+ s.setUTCDate(s.getUTCDate() - 1)
+ }
+ return s
+ },
+ d : function(s, i) {
+ return s.setUTCDate(i)
+ }
+ }, j, p, g;
+ v.M = v.MM = v.mm = v.m;
+ v.dd = v.d;
+ k = f(k.getFullYear(), k.getMonth(), k.getDate(), 0, 0, 0);
+ var q = u.parts.slice();
+ if (m.length != q.length) {
+ q = d(q).filter(function(s, y) {
+ return d.inArray(y, t) !== -1
+ }).toArray()
+ }
+ if (m.length == q.length) {
+ for (var o = 0, h = q.length; o < h; o++) {
+ j = parseInt(m[o], 10);
+ g = q[o];
+ if (isNaN(j)) {
+ switch (g) {
+ case "MM":
+ p = d(e[n].months)
+ .filter(
+ function() {
+ var i = this.slice(0,
+ m[o].length), s = m[o]
+ .slice(0, i.length);
+ return i == s
+ });
+ j = d.inArray(p[0], e[n].months) + 1;
+ break;
+ case "M":
+ p = d(e[n].monthsShort)
+ .filter(
+ function() {
+ var i = this.slice(0,
+ m[o].length), s = m[o]
+ .slice(0, i.length);
+ return i == s
+ });
+ j = d.inArray(p[0], e[n].monthsShort) + 1;
+ break
+ }
+ }
+ r[g] = j
+ }
+ for (var o = 0, x; o < t.length; o++) {
+ x = t[o];
+ if (x in r && !isNaN(r[x])) {
+ v[x](k, r[x])
+ }
+ }
+ }
+ return k
+ },
+ formatDate : function(g, l, n) {
+ var m = {
+ d : g.getUTCDate(),
+ D : e[n].daysShort[g.getUTCDay()],
+ DD : e[n].days[g.getUTCDay()],
+ m : g.getUTCMonth() + 1,
+ M : e[n].monthsShort[g.getUTCMonth()],
+ MM : e[n].months[g.getUTCMonth()],
+ yy : g.getUTCFullYear().toString().substring(2),
+ yyyy : g.getUTCFullYear()
+ };
+ m.dd = (m.d < 10 ? "0" : "") + m.d;
+ m.mm = (m.m < 10 ? "0" : "") + m.m;
+ var g = [], k = d.extend([], l.separators);
+ for (var j = 0, h = l.parts.length; j < h; j++) {
+ if (k.length) {
+ g.push(k.shift())
+ }
+ g.push(m[l.parts[j]])
+ }
+ return g.join("")
+ },
+ headTemplate : '
',
+ contTemplate : '
',
+ footTemplate : '
'
+ };
+ c.template = '
'
+ + c.headTemplate
+ + " "
+ + c.footTemplate
+ + '
'
+ + c.headTemplate
+ + c.contTemplate
+ + c.footTemplate
+ + '
'
+ + c.headTemplate
+ + c.contTemplate
+ + c.footTemplate
+ + "
";
+ d.fn.datepicker.DPGlobal = c
}(window.jQuery);
\ No newline at end of file
diff --git a/chapter11/src/main/resources/static/assets/js/date-time/bootstrap-timepicker.min.js b/chapter11/src/main/resources/static/assets/js/date-time/bootstrap-timepicker.min.js
old mode 100755
new mode 100644
diff --git a/chapter11/src/main/resources/static/assets/js/date-time/date.js b/chapter11/src/main/resources/static/assets/js/date-time/date.js
old mode 100755
new mode 100644
diff --git a/chapter11/src/main/resources/static/assets/js/date-time/daterangepicker.js b/chapter11/src/main/resources/static/assets/js/date-time/daterangepicker.js
old mode 100755
new mode 100644
diff --git a/chapter11/src/main/resources/static/assets/js/date-time/daterangepicker.min.js b/chapter11/src/main/resources/static/assets/js/date-time/daterangepicker.min.js
old mode 100755
new mode 100644
index 54bbbb5..c035842
--- a/chapter11/src/main/resources/static/assets/js/date-time/daterangepicker.min.js
+++ b/chapter11/src/main/resources/static/assets/js/date-time/daterangepicker.min.js
@@ -1,786 +1,786 @@
-!function(b) {
- var a = function(k, s, i) {
- var q = typeof s == "object";
- var f;
- this.startDate = moment().startOf("day");
- this.endDate = moment().startOf("day");
- this.minDate = false;
- this.maxDate = false;
- this.dateLimit = false;
- this.showDropdowns = false;
- this.showWeekNumbers = false;
- this.timePicker = false;
- this.timePickerIncrement = 30;
- this.timePicker12Hour = true;
- this.ranges = {};
- this.opens = "right";
- this.buttonClasses = [ "btn", "btn-sm" ];
- this.applyClass = "btn-success";
- this.cancelClass = "btn-default";
- this.format = "MM/DD/YYYY";
- this.separator = " - ";
- this.locale = {
- applyLabel : "Apply",
- cancelLabel : "Cancel",
- fromLabel : "From",
- toLabel : "To",
- weekLabel : "W",
- customRangeLabel : "Custom Range",
- daysOfWeek : moment()._lang._weekdaysMin.slice(),
- monthNames : moment()._lang._monthsShort.slice(),
- firstDay : 0
- };
- this.cb = function() {
- };
- this.element = b(k);
- if (this.element.hasClass("pull-right")) {
- this.opens = "left"
- }
- if (this.element.is("input")) {
- this.element.on({
- click : b.proxy(this.show, this),
- focus : b.proxy(this.show, this)
- })
- } else {
- this.element.on("click", b.proxy(this.show, this))
- }
- f = this.locale;
- if (q) {
- if (typeof s.locale == "object") {
- b.each(f, function(t, c) {
- f[t] = s.locale[t] || c
- })
- }
- if (s.applyClass) {
- this.applyClass = s.applyClass
- }
- if (s.cancelClass) {
- this.cancelClass = s.cancelClass
- }
- }
- var d = '';
- this.container = b(d).appendTo("body");
- if (q) {
- if (typeof s.format == "string") {
- this.format = s.format
- }
- if (typeof s.separator == "string") {
- this.separator = s.separator
- }
- if (typeof s.startDate == "string") {
- this.startDate = moment(s.startDate, this.format)
- }
- if (typeof s.endDate == "string") {
- this.endDate = moment(s.endDate, this.format)
- }
- if (typeof s.minDate == "string") {
- this.minDate = moment(s.minDate, this.format)
- }
- if (typeof s.maxDate == "string") {
- this.maxDate = moment(s.maxDate, this.format)
- }
- if (typeof s.startDate == "object") {
- this.startDate = moment(s.startDate)
- }
- if (typeof s.endDate == "object") {
- this.endDate = moment(s.endDate)
- }
- if (typeof s.minDate == "object") {
- this.minDate = moment(s.minDate)
- }
- if (typeof s.maxDate == "object") {
- this.maxDate = moment(s.maxDate)
- }
- if (typeof s.ranges == "object") {
- for ( var m in s.ranges) {
- var e = moment(s.ranges[m][0]);
- var j = moment(s.ranges[m][1]);
- if (this.minDate && e.isBefore(this.minDate)) {
- e = moment(this.minDate)
- }
- if (this.maxDate && j.isAfter(this.maxDate)) {
- j = moment(this.maxDate)
- }
- if ((this.minDate && j.isBefore(this.minDate))
- || (this.maxDate && e.isAfter(this.maxDate))) {
- continue
- }
- this.ranges[m] = [ e, j ]
- }
- var n = "
";
- for ( var m in this.ranges) {
- n += "" + m + " "
- }
- n += "" + this.locale.customRangeLabel + " ";
- n += " ";
- this.container.find(".ranges").prepend(n)
- }
- if (typeof s.dateLimit == "object") {
- this.dateLimit = s.dateLimit
- }
- if (typeof s.locale == "object") {
- if (typeof s.locale.firstDay == "number") {
- this.locale.firstDay = s.locale.firstDay;
- var l = s.locale.firstDay;
- while (l > 0) {
- this.locale.daysOfWeek.push(this.locale.daysOfWeek
- .shift());
- l--
- }
- }
- }
- if (typeof s.opens == "string") {
- this.opens = s.opens
- }
- if (typeof s.showWeekNumbers == "boolean") {
- this.showWeekNumbers = s.showWeekNumbers
- }
- if (typeof s.buttonClasses == "string") {
- this.buttonClasses = [ s.buttonClasses ]
- }
- if (typeof s.buttonClasses == "object") {
- this.buttonClasses = s.buttonClasses
- }
- if (typeof s.showDropdowns == "boolean") {
- this.showDropdowns = s.showDropdowns
- }
- if (typeof s.timePicker == "boolean") {
- this.timePicker = s.timePicker
- }
- if (typeof s.timePickerIncrement == "number") {
- this.timePickerIncrement = s.timePickerIncrement
- }
- if (typeof s.timePicker12Hour == "boolean") {
- this.timePicker12Hour = s.timePicker12Hour
- }
- }
- if (!this.timePicker) {
- this.startDate = this.startDate.startOf("day");
- this.endDate = this.endDate.startOf("day")
- }
- var p = this.container;
- b.each(this.buttonClasses, function(c, t) {
- p.find("button").addClass(t)
- });
- if (this.opens == "right") {
- var h = this.container.find(".calendar.left");
- var r = this.container.find(".calendar.right");
- h.removeClass("left").addClass("right");
- r.removeClass("right").addClass("left")
- }
- if (typeof s == "undefined" || typeof s.ranges == "undefined") {
- this.container.find(".calendar").show();
- this.move()
- }
- if (typeof i == "function") {
- this.cb = i
- }
- this.container.addClass("opens" + this.opens);
- if (!q
- || (typeof s.startDate == "undefined" && typeof s.endDate == "undefined")) {
- if (b(this.element).is("input[type=text]")) {
- var g = b(this.element).val();
- var o = g.split(this.separator);
- var e, j;
- if (o.length == 2) {
- e = moment(o[0], this.format);
- j = moment(o[1], this.format)
- }
- if (e != null && j != null) {
- this.startDate = e;
- this.endDate = j
- }
- }
- }
- this.oldStartDate = this.startDate.clone();
- this.oldEndDate = this.endDate.clone();
- this.leftCalendar = {
- month : moment([ this.startDate.year(), this.startDate.month(), 1,
- this.startDate.hour(), this.startDate.minute() ]),
- calendar : []
- };
- this.rightCalendar = {
- month : moment([ this.endDate.year(), this.endDate.month(), 1,
- this.endDate.hour(), this.endDate.minute() ]),
- calendar : []
- };
- this.container.on("mousedown", b.proxy(this.mousedown, this));
- this.container.find(".calendar").on("click", ".prev",
- b.proxy(this.clickPrev, this));
- this.container.find(".calendar").on("click", ".next",
- b.proxy(this.clickNext, this));
- this.container.find(".ranges").on("click", "button.applyBtn",
- b.proxy(this.clickApply, this));
- this.container.find(".ranges").on("click", "button.cancelBtn",
- b.proxy(this.clickCancel, this));
- this.container.find(".ranges").on("click",
- ".daterangepicker_start_input",
- b.proxy(this.showCalendars, this));
- this.container.find(".ranges")
- .on("click", ".daterangepicker_end_input",
- b.proxy(this.showCalendars, this));
- this.container.find(".calendar").on("click", "td.available",
- b.proxy(this.clickDate, this));
- this.container.find(".calendar").on("mouseenter", "td.available",
- b.proxy(this.enterDate, this));
- this.container.find(".calendar").on("mouseleave", "td.available",
- b.proxy(this.updateView, this));
- this.container.find(".ranges").on("click", "li",
- b.proxy(this.clickRange, this));
- this.container.find(".ranges").on("mouseenter", "li",
- b.proxy(this.enterRange, this));
- this.container.find(".ranges").on("mouseleave", "li",
- b.proxy(this.updateView, this));
- this.container.find(".calendar").on("change", "select.yearselect",
- b.proxy(this.updateMonthYear, this));
- this.container.find(".calendar").on("change", "select.monthselect",
- b.proxy(this.updateMonthYear, this));
- this.container.find(".calendar").on("change", "select.hourselect",
- b.proxy(this.updateTime, this));
- this.container.find(".calendar").on("change", "select.minuteselect",
- b.proxy(this.updateTime, this));
- this.container.find(".calendar").on("change", "select.ampmselect",
- b.proxy(this.updateTime, this));
- this.element.on("keyup", b.proxy(this.updateFromControl, this));
- this.updateView();
- this.updateCalendars()
- };
- a.prototype = {
- constructor : a,
- mousedown : function(c) {
- c.stopPropagation()
- },
- updateView : function() {
- this.leftCalendar.month.month(this.startDate.month()).year(
- this.startDate.year());
- this.rightCalendar.month.month(this.endDate.month()).year(
- this.endDate.year());
- this.container.find("input[name=daterangepicker_start]").val(
- this.startDate.format(this.format));
- this.container.find("input[name=daterangepicker_end]").val(
- this.endDate.format(this.format));
- if (this.startDate.isSame(this.endDate)
- || this.startDate.isBefore(this.endDate)) {
- this.container.find("button.applyBtn").removeAttr("disabled")
- } else {
- this.container.find("button.applyBtn").attr("disabled",
- "disabled")
- }
- },
- updateFromControl : function() {
- if (!this.element.is("input")) {
- return
- }
- if (!this.element.val().length) {
- return
- }
- var d = this.element.val().split(this.separator);
- var e = moment(d[0], this.format);
- var c = moment(d[1], this.format);
- if (e == null || c == null) {
- return
- }
- if (c.isBefore(e)) {
- return
- }
- this.startDate = e;
- this.endDate = c;
- this.notify();
- this.updateCalendars()
- },
- notify : function() {
- this.updateView();
- this.cb(this.startDate, this.endDate)
- },
- move : function() {
- var c = b(this.container).find(".ranges").outerWidth();
- if (b(this.container).find(".calendar").is(":visible")) {
- var d = 24;
- c += b(this.container).find(".calendar").outerWidth() * 2 + d
- }
- if (this.opens == "left") {
- this.container.css({
- top : this.element.offset().top
- + this.element.outerHeight(),
- right : b(window).width() - this.element.offset().left
- - this.element.outerWidth(),
- left : "auto",
- "min-width" : c
- });
- if (this.container.offset().left < 0) {
- this.container.css({
- right : "auto",
- left : 9
- })
- }
- } else {
- this.container.css({
- top : this.element.offset().top
- + this.element.outerHeight(),
- left : this.element.offset().left,
- right : "auto",
- "min-width" : c
- });
- if (this.container.offset().left + this.container.outerWidth() > b(
- window).width()) {
- this.container.css({
- left : "auto",
- right : 0
- })
- }
- }
- },
- show : function(c) {
- this.container.show();
- this.move();
- if (c) {
- c.stopPropagation();
- c.preventDefault()
- }
- b(document).on("mousedown", b.proxy(this.hide, this));
- this.element.trigger("shown", {
- target : c.target,
- picker : this
- })
- },
- hide : function(c) {
- this.container.hide();
- if (!this.startDate.isSame(this.oldStartDate)
- || !this.endDate.isSame(this.oldEndDate)) {
- this.notify()
- }
- this.oldStartDate = this.startDate.clone();
- this.oldEndDate = this.endDate.clone();
- b(document).off("mousedown", this.hide);
- this.element.trigger("hidden", {
- picker : this
- })
- },
- enterRange : function(f) {
- var c = f.target.innerHTML;
- if (c == this.locale.customRangeLabel) {
- this.updateView()
- } else {
- var d = this.ranges[c];
- this.container.find("input[name=daterangepicker_start]").val(
- d[0].format(this.format));
- this.container.find("input[name=daterangepicker_end]").val(
- d[1].format(this.format))
- }
- },
- showCalendars : function() {
- this.container.find(".calendar").show();
- this.move()
- },
- updateInputText : function() {
- if (this.element.is("input")) {
- this.element.val(this.startDate.format(this.format)
- + this.separator + this.endDate.format(this.format))
- }
- },
- clickRange : function(f) {
- var c = f.target.innerHTML;
- if (c == this.locale.customRangeLabel) {
- this.showCalendars()
- } else {
- var d = this.ranges[c];
- this.startDate = d[0];
- this.endDate = d[1];
- if (!this.timePicker) {
- this.startDate.startOf("day");
- this.endDate.startOf("day")
- }
- this.leftCalendar.month.month(this.startDate.month()).year(
- this.startDate.year()).hour(this.startDate.hour())
- .minute(this.startDate.minute());
- this.rightCalendar.month.month(this.endDate.month()).year(
- this.endDate.year()).hour(this.endDate.hour()).minute(
- this.endDate.minute());
- this.updateCalendars();
- this.updateInputText();
- this.container.find(".calendar").hide();
- this.hide()
- }
- },
- clickPrev : function(d) {
- var c = b(d.target).parents(".calendar");
- if (c.hasClass("left")) {
- this.leftCalendar.month.subtract("month", 1)
- } else {
- this.rightCalendar.month.subtract("month", 1)
- }
- this.updateCalendars()
- },
- clickNext : function(d) {
- var c = b(d.target).parents(".calendar");
- if (c.hasClass("left")) {
- this.leftCalendar.month.add("month", 1)
- } else {
- this.rightCalendar.month.add("month", 1)
- }
- this.updateCalendars()
- },
- enterDate : function(f) {
- var h = b(f.target).attr("data-title");
- var g = h.substr(1, 1);
- var c = h.substr(3, 1);
- var d = b(f.target).parents(".calendar");
- if (d.hasClass("left")) {
- this.container.find("input[name=daterangepicker_start]").val(
- this.leftCalendar.calendar[g][c].format(this.format))
- } else {
- this.container.find("input[name=daterangepicker_end]").val(
- this.rightCalendar.calendar[g][c].format(this.format))
- }
- },
- clickDate : function(j) {
- var k = b(j.target).attr("data-title");
- var l = k.substr(1, 1);
- var g = k.substr(3, 1);
- var d = b(j.target).parents(".calendar");
- if (d.hasClass("left")) {
- var f = this.leftCalendar.calendar[l][g];
- var i = this.endDate;
- if (typeof this.dateLimit == "object") {
- var c = moment(f).add(this.dateLimit).startOf("day");
- if (i.isAfter(c)) {
- i = c
- }
- }
- } else {
- var f = this.startDate;
- var i = this.rightCalendar.calendar[l][g];
- if (typeof this.dateLimit == "object") {
- var h = moment(i).subtract(this.dateLimit).startOf("day");
- if (f.isBefore(h)) {
- f = h
- }
- }
- }
- d.find("td").removeClass("active");
- if (f.isSame(i) || f.isBefore(i)) {
- b(j.target).addClass("active");
- this.startDate = f;
- this.endDate = i
- } else {
- if (f.isAfter(i)) {
- b(j.target).addClass("active");
- this.startDate = f;
- this.endDate = moment(f).add("day", 1).startOf("day")
- }
- }
- this.leftCalendar.month.month(this.startDate.month()).year(
- this.startDate.year());
- this.rightCalendar.month.month(this.endDate.month()).year(
- this.endDate.year());
- this.updateCalendars()
- },
- clickApply : function(c) {
- this.updateInputText();
- this.hide()
- },
- clickCancel : function(c) {
- this.startDate = this.oldStartDate;
- this.endDate = this.oldEndDate;
- this.updateView();
- this.updateCalendars();
- this.hide()
- },
- updateMonthYear : function(g) {
- var h = b(g.target).closest(".calendar").hasClass("left");
- var f = this.container.find(".calendar.left");
- if (!h) {
- f = this.container.find(".calendar.right")
- }
- var d = f.find(".monthselect").val();
- var c = f.find(".yearselect").val();
- if (h) {
- this.leftCalendar.month.month(d).year(c)
- } else {
- this.rightCalendar.month.month(d).year(c)
- }
- this.updateCalendars()
- },
- updateTime : function(h) {
- var j = b(h.target).closest(".calendar").hasClass("left");
- var g = this.container.find(".calendar.left");
- if (!j) {
- g = this.container.find(".calendar.right")
- }
- var d = parseInt(g.find(".hourselect").val());
- var i = parseInt(g.find(".minuteselect").val());
- if (this.timePicker12Hour) {
- var f = g.find(".ampmselect").val();
- if (f == "PM" && d < 12) {
- d += 12
- }
- if (f == "AM" && d == 12) {
- d = 0
- }
- }
- if (j) {
- var k = this.startDate;
- k.hour(d);
- k.minute(i);
- this.startDate = k;
- this.leftCalendar.month.hour(d).minute(i)
- } else {
- var c = this.endDate;
- c.hour(d);
- c.minute(i);
- this.endDate = c;
- this.rightCalendar.month.hour(d).minute(i)
- }
- this.updateCalendars()
- },
- updateCalendars : function() {
- this.leftCalendar.calendar = this.buildCalendar(
- this.leftCalendar.month.month(), this.leftCalendar.month
- .year(), this.leftCalendar.month.hour(),
- this.leftCalendar.month.minute(), "left");
- this.rightCalendar.calendar = this.buildCalendar(
- this.rightCalendar.month.month(), this.rightCalendar.month
- .year(), this.rightCalendar.month.hour(),
- this.rightCalendar.month.minute(), "right");
- this.container.find(".calendar.left").html(
- this.renderCalendar(this.leftCalendar.calendar,
- this.startDate, this.minDate, this.maxDate));
- this.container.find(".calendar.right").html(
- this.renderCalendar(this.rightCalendar.calendar,
- this.endDate, this.startDate, this.maxDate));
- this.container.find(".ranges li").removeClass("active");
- var c = true;
- var e = 0;
- for ( var d in this.ranges) {
- if (this.timePicker) {
- if (this.startDate.isSame(this.ranges[d][0])
- && this.endDate.isSame(this.ranges[d][1])) {
- c = false;
- this.container.find(".ranges li:eq(" + e + ")")
- .addClass("active")
- }
- } else {
- if (this.startDate.format("YYYY-MM-DD") == this.ranges[d][0]
- .format("YYYY-MM-DD")
- && this.endDate.format("YYYY-MM-DD") == this.ranges[d][1]
- .format("YYYY-MM-DD")) {
- c = false;
- this.container.find(".ranges li:eq(" + e + ")")
- .addClass("active")
- }
- }
- e++
- }
- if (c) {
- this.container.find(".ranges li:last").addClass("active")
- }
- },
- buildCalendar : function(o, q, h, g, p) {
- var c = moment([ q, o, 1 ]);
- var m = moment(c).subtract("month", 1).month();
- var l = moment(c).subtract("month", 1).year();
- var r = moment([ l, m ]).daysInMonth();
- var e = c.day();
- var k = [];
- for (var j = 0; j < 6; j++) {
- k[j] = []
- }
- var n = r - e + this.locale.firstDay + 1;
- if (n > r) {
- n -= 7
- }
- if (e == this.locale.firstDay) {
- n = r - 6
- }
- var f = moment([ l, m, n, h, g ]);
- for (var j = 0, d = 0, s = 0; j < 42; j++, d++, f = moment(f).add(
- "day", 1)) {
- if (j > 0 && d % 7 == 0) {
- d = 0;
- s++
- }
- k[s][d] = f
- }
- return k
- },
- renderDropdowns : function(h, g, c) {
- var k = h.month();
- var f = '
';
- var d = false;
- var p = false;
- for (var e = 0; e < 12; e++) {
- if ((!d || e >= g.month()) && (!p || e <= c.month())) {
- f += ""
- + this.locale.monthNames[e] + " "
- }
- }
- f += " ";
- var j = h.year();
- var i = (c && c.year()) || (j + 5);
- var o = (g && g.year()) || (j - 50);
- var n = '
';
- for (var l = o; l <= i; l++) {
- n += '" + l
- + " "
- }
- n += " ";
- return f + n
- },
- renderCalendar : function(m, k, j, d) {
- var p = '
';
- p += '
';
- p += "";
- p += "";
- if (this.showWeekNumbers) {
- p += " "
- }
- if (!j || j.isBefore(m[1][1])) {
- p += ' '
- } else {
- p += " "
- }
- var f = this.locale.monthNames[m[1][1].month()]
- + m[1][1].format(" YYYY");
- if (this.showDropdowns) {
- f = this.renderDropdowns(m[1][1], j, d)
- }
- p += '' + f + " ";
- if (!d || d.isAfter(m[1][1])) {
- p += ' '
- } else {
- p += " "
- }
- p += " ";
- p += "";
- if (this.showWeekNumbers) {
- p += '' + this.locale.weekLabel + " "
- }
- b.each(this.locale.daysOfWeek, function(s, i) {
- p += "" + i + " "
- });
- p += " ";
- p += " ";
- p += "";
- for (var r = 0; r < 6; r++) {
- p += "";
- if (this.showWeekNumbers) {
- p += '' + m[r][0].week() + " "
- }
- for (var g = 0; g < 7; g++) {
- var o = "available ";
- o += (m[r][g].month() == m[1][1].month()) ? "" : "off";
- if ((j && m[r][g].isBefore(j)) || (d && m[r][g].isAfter(d))) {
- o = " off disabled "
- } else {
- if (m[r][g].format("YYYY-MM-DD") == k
- .format("YYYY-MM-DD")) {
- o += " active ";
- if (m[r][g].format("YYYY-MM-DD") == this.startDate
- .format("YYYY-MM-DD")) {
- o += " start-date "
- }
- if (m[r][g].format("YYYY-MM-DD") == this.endDate
- .format("YYYY-MM-DD")) {
- o += " end-date "
- }
- } else {
- if (m[r][g] >= this.startDate
- && m[r][g] <= this.endDate) {
- o += " in-range ";
- if (m[r][g].isSame(this.startDate)) {
- o += " start-date "
- }
- if (m[r][g].isSame(this.endDate)) {
- o += " end-date "
- }
- }
- }
- }
- var q = "r" + r + "c" + g;
- p += ''
- + m[r][g].date() + " "
- }
- p += " "
- }
- p += " ";
- p += "
";
- p += "
";
- if (this.timePicker) {
- p += '
';
- p += '';
- var e = 0;
- var h = 23;
- var c = k.hour();
- if (this.timePicker12Hour) {
- e = 1;
- h = 12;
- if (c >= 12) {
- c -= 12
- }
- if (c == 0) {
- c = 12
- }
- }
- for (var l = e; l <= h; l++) {
- if (l == c) {
- p += ''
- + l + " "
- } else {
- p += '' + l + " "
- }
- }
- p += " : ";
- p += '';
- for (var l = 0; l < 60; l += this.timePickerIncrement) {
- var n = l;
- if (n < 10) {
- n = "0" + n
- }
- if (l == k.minute()) {
- p += ''
- + n + " "
- } else {
- p += '' + n + " "
- }
- }
- p += " ";
- if (this.timePicker12Hour) {
- p += '';
- if (k.hour() >= 12) {
- p += 'AM PM '
- } else {
- p += 'AM PM '
- }
- p += " "
- }
- p += "
"
- }
- return p
- }
- };
- b.fn.daterangepicker = function(d, c) {
- this.each(function() {
- var e = b(this);
- if (!e.data("daterangepicker")) {
- e.data("daterangepicker", new a(e, d, c))
- }
- });
- return this
- }
+!function(b) {
+ var a = function(k, s, i) {
+ var q = typeof s == "object";
+ var f;
+ this.startDate = moment().startOf("day");
+ this.endDate = moment().startOf("day");
+ this.minDate = false;
+ this.maxDate = false;
+ this.dateLimit = false;
+ this.showDropdowns = false;
+ this.showWeekNumbers = false;
+ this.timePicker = false;
+ this.timePickerIncrement = 30;
+ this.timePicker12Hour = true;
+ this.ranges = {};
+ this.opens = "right";
+ this.buttonClasses = [ "btn", "btn-sm" ];
+ this.applyClass = "btn-success";
+ this.cancelClass = "btn-default";
+ this.format = "MM/DD/YYYY";
+ this.separator = " - ";
+ this.locale = {
+ applyLabel : "Apply",
+ cancelLabel : "Cancel",
+ fromLabel : "From",
+ toLabel : "To",
+ weekLabel : "W",
+ customRangeLabel : "Custom Range",
+ daysOfWeek : moment()._lang._weekdaysMin.slice(),
+ monthNames : moment()._lang._monthsShort.slice(),
+ firstDay : 0
+ };
+ this.cb = function() {
+ };
+ this.element = b(k);
+ if (this.element.hasClass("pull-right")) {
+ this.opens = "left"
+ }
+ if (this.element.is("input")) {
+ this.element.on({
+ click : b.proxy(this.show, this),
+ focus : b.proxy(this.show, this)
+ })
+ } else {
+ this.element.on("click", b.proxy(this.show, this))
+ }
+ f = this.locale;
+ if (q) {
+ if (typeof s.locale == "object") {
+ b.each(f, function(t, c) {
+ f[t] = s.locale[t] || c
+ })
+ }
+ if (s.applyClass) {
+ this.applyClass = s.applyClass
+ }
+ if (s.cancelClass) {
+ this.cancelClass = s.cancelClass
+ }
+ }
+ var d = '';
+ this.container = b(d).appendTo("body");
+ if (q) {
+ if (typeof s.format == "string") {
+ this.format = s.format
+ }
+ if (typeof s.separator == "string") {
+ this.separator = s.separator
+ }
+ if (typeof s.startDate == "string") {
+ this.startDate = moment(s.startDate, this.format)
+ }
+ if (typeof s.endDate == "string") {
+ this.endDate = moment(s.endDate, this.format)
+ }
+ if (typeof s.minDate == "string") {
+ this.minDate = moment(s.minDate, this.format)
+ }
+ if (typeof s.maxDate == "string") {
+ this.maxDate = moment(s.maxDate, this.format)
+ }
+ if (typeof s.startDate == "object") {
+ this.startDate = moment(s.startDate)
+ }
+ if (typeof s.endDate == "object") {
+ this.endDate = moment(s.endDate)
+ }
+ if (typeof s.minDate == "object") {
+ this.minDate = moment(s.minDate)
+ }
+ if (typeof s.maxDate == "object") {
+ this.maxDate = moment(s.maxDate)
+ }
+ if (typeof s.ranges == "object") {
+ for ( var m in s.ranges) {
+ var e = moment(s.ranges[m][0]);
+ var j = moment(s.ranges[m][1]);
+ if (this.minDate && e.isBefore(this.minDate)) {
+ e = moment(this.minDate)
+ }
+ if (this.maxDate && j.isAfter(this.maxDate)) {
+ j = moment(this.maxDate)
+ }
+ if ((this.minDate && j.isBefore(this.minDate))
+ || (this.maxDate && e.isAfter(this.maxDate))) {
+ continue
+ }
+ this.ranges[m] = [ e, j ]
+ }
+ var n = "
";
+ for ( var m in this.ranges) {
+ n += "" + m + " "
+ }
+ n += "" + this.locale.customRangeLabel + " ";
+ n += " ";
+ this.container.find(".ranges").prepend(n)
+ }
+ if (typeof s.dateLimit == "object") {
+ this.dateLimit = s.dateLimit
+ }
+ if (typeof s.locale == "object") {
+ if (typeof s.locale.firstDay == "number") {
+ this.locale.firstDay = s.locale.firstDay;
+ var l = s.locale.firstDay;
+ while (l > 0) {
+ this.locale.daysOfWeek.push(this.locale.daysOfWeek
+ .shift());
+ l--
+ }
+ }
+ }
+ if (typeof s.opens == "string") {
+ this.opens = s.opens
+ }
+ if (typeof s.showWeekNumbers == "boolean") {
+ this.showWeekNumbers = s.showWeekNumbers
+ }
+ if (typeof s.buttonClasses == "string") {
+ this.buttonClasses = [ s.buttonClasses ]
+ }
+ if (typeof s.buttonClasses == "object") {
+ this.buttonClasses = s.buttonClasses
+ }
+ if (typeof s.showDropdowns == "boolean") {
+ this.showDropdowns = s.showDropdowns
+ }
+ if (typeof s.timePicker == "boolean") {
+ this.timePicker = s.timePicker
+ }
+ if (typeof s.timePickerIncrement == "number") {
+ this.timePickerIncrement = s.timePickerIncrement
+ }
+ if (typeof s.timePicker12Hour == "boolean") {
+ this.timePicker12Hour = s.timePicker12Hour
+ }
+ }
+ if (!this.timePicker) {
+ this.startDate = this.startDate.startOf("day");
+ this.endDate = this.endDate.startOf("day")
+ }
+ var p = this.container;
+ b.each(this.buttonClasses, function(c, t) {
+ p.find("button").addClass(t)
+ });
+ if (this.opens == "right") {
+ var h = this.container.find(".calendar.left");
+ var r = this.container.find(".calendar.right");
+ h.removeClass("left").addClass("right");
+ r.removeClass("right").addClass("left")
+ }
+ if (typeof s == "undefined" || typeof s.ranges == "undefined") {
+ this.container.find(".calendar").show();
+ this.move()
+ }
+ if (typeof i == "function") {
+ this.cb = i
+ }
+ this.container.addClass("opens" + this.opens);
+ if (!q
+ || (typeof s.startDate == "undefined" && typeof s.endDate == "undefined")) {
+ if (b(this.element).is("input[type=text]")) {
+ var g = b(this.element).val();
+ var o = g.split(this.separator);
+ var e, j;
+ if (o.length == 2) {
+ e = moment(o[0], this.format);
+ j = moment(o[1], this.format)
+ }
+ if (e != null && j != null) {
+ this.startDate = e;
+ this.endDate = j
+ }
+ }
+ }
+ this.oldStartDate = this.startDate.clone();
+ this.oldEndDate = this.endDate.clone();
+ this.leftCalendar = {
+ month : moment([ this.startDate.year(), this.startDate.month(), 1,
+ this.startDate.hour(), this.startDate.minute() ]),
+ calendar : []
+ };
+ this.rightCalendar = {
+ month : moment([ this.endDate.year(), this.endDate.month(), 1,
+ this.endDate.hour(), this.endDate.minute() ]),
+ calendar : []
+ };
+ this.container.on("mousedown", b.proxy(this.mousedown, this));
+ this.container.find(".calendar").on("click", ".prev",
+ b.proxy(this.clickPrev, this));
+ this.container.find(".calendar").on("click", ".next",
+ b.proxy(this.clickNext, this));
+ this.container.find(".ranges").on("click", "button.applyBtn",
+ b.proxy(this.clickApply, this));
+ this.container.find(".ranges").on("click", "button.cancelBtn",
+ b.proxy(this.clickCancel, this));
+ this.container.find(".ranges").on("click",
+ ".daterangepicker_start_input",
+ b.proxy(this.showCalendars, this));
+ this.container.find(".ranges")
+ .on("click", ".daterangepicker_end_input",
+ b.proxy(this.showCalendars, this));
+ this.container.find(".calendar").on("click", "td.available",
+ b.proxy(this.clickDate, this));
+ this.container.find(".calendar").on("mouseenter", "td.available",
+ b.proxy(this.enterDate, this));
+ this.container.find(".calendar").on("mouseleave", "td.available",
+ b.proxy(this.updateView, this));
+ this.container.find(".ranges").on("click", "li",
+ b.proxy(this.clickRange, this));
+ this.container.find(".ranges").on("mouseenter", "li",
+ b.proxy(this.enterRange, this));
+ this.container.find(".ranges").on("mouseleave", "li",
+ b.proxy(this.updateView, this));
+ this.container.find(".calendar").on("change", "select.yearselect",
+ b.proxy(this.updateMonthYear, this));
+ this.container.find(".calendar").on("change", "select.monthselect",
+ b.proxy(this.updateMonthYear, this));
+ this.container.find(".calendar").on("change", "select.hourselect",
+ b.proxy(this.updateTime, this));
+ this.container.find(".calendar").on("change", "select.minuteselect",
+ b.proxy(this.updateTime, this));
+ this.container.find(".calendar").on("change", "select.ampmselect",
+ b.proxy(this.updateTime, this));
+ this.element.on("keyup", b.proxy(this.updateFromControl, this));
+ this.updateView();
+ this.updateCalendars()
+ };
+ a.prototype = {
+ constructor : a,
+ mousedown : function(c) {
+ c.stopPropagation()
+ },
+ updateView : function() {
+ this.leftCalendar.month.month(this.startDate.month()).year(
+ this.startDate.year());
+ this.rightCalendar.month.month(this.endDate.month()).year(
+ this.endDate.year());
+ this.container.find("input[name=daterangepicker_start]").val(
+ this.startDate.format(this.format));
+ this.container.find("input[name=daterangepicker_end]").val(
+ this.endDate.format(this.format));
+ if (this.startDate.isSame(this.endDate)
+ || this.startDate.isBefore(this.endDate)) {
+ this.container.find("button.applyBtn").removeAttr("disabled")
+ } else {
+ this.container.find("button.applyBtn").attr("disabled",
+ "disabled")
+ }
+ },
+ updateFromControl : function() {
+ if (!this.element.is("input")) {
+ return
+ }
+ if (!this.element.val().length) {
+ return
+ }
+ var d = this.element.val().split(this.separator);
+ var e = moment(d[0], this.format);
+ var c = moment(d[1], this.format);
+ if (e == null || c == null) {
+ return
+ }
+ if (c.isBefore(e)) {
+ return
+ }
+ this.startDate = e;
+ this.endDate = c;
+ this.notify();
+ this.updateCalendars()
+ },
+ notify : function() {
+ this.updateView();
+ this.cb(this.startDate, this.endDate)
+ },
+ move : function() {
+ var c = b(this.container).find(".ranges").outerWidth();
+ if (b(this.container).find(".calendar").is(":visible")) {
+ var d = 24;
+ c += b(this.container).find(".calendar").outerWidth() * 2 + d
+ }
+ if (this.opens == "left") {
+ this.container.css({
+ top : this.element.offset().top
+ + this.element.outerHeight(),
+ right : b(window).width() - this.element.offset().left
+ - this.element.outerWidth(),
+ left : "auto",
+ "min-width" : c
+ });
+ if (this.container.offset().left < 0) {
+ this.container.css({
+ right : "auto",
+ left : 9
+ })
+ }
+ } else {
+ this.container.css({
+ top : this.element.offset().top
+ + this.element.outerHeight(),
+ left : this.element.offset().left,
+ right : "auto",
+ "min-width" : c
+ });
+ if (this.container.offset().left + this.container.outerWidth() > b(
+ window).width()) {
+ this.container.css({
+ left : "auto",
+ right : 0
+ })
+ }
+ }
+ },
+ show : function(c) {
+ this.container.show();
+ this.move();
+ if (c) {
+ c.stopPropagation();
+ c.preventDefault()
+ }
+ b(document).on("mousedown", b.proxy(this.hide, this));
+ this.element.trigger("shown", {
+ target : c.target,
+ picker : this
+ })
+ },
+ hide : function(c) {
+ this.container.hide();
+ if (!this.startDate.isSame(this.oldStartDate)
+ || !this.endDate.isSame(this.oldEndDate)) {
+ this.notify()
+ }
+ this.oldStartDate = this.startDate.clone();
+ this.oldEndDate = this.endDate.clone();
+ b(document).off("mousedown", this.hide);
+ this.element.trigger("hidden", {
+ picker : this
+ })
+ },
+ enterRange : function(f) {
+ var c = f.target.innerHTML;
+ if (c == this.locale.customRangeLabel) {
+ this.updateView()
+ } else {
+ var d = this.ranges[c];
+ this.container.find("input[name=daterangepicker_start]").val(
+ d[0].format(this.format));
+ this.container.find("input[name=daterangepicker_end]").val(
+ d[1].format(this.format))
+ }
+ },
+ showCalendars : function() {
+ this.container.find(".calendar").show();
+ this.move()
+ },
+ updateInputText : function() {
+ if (this.element.is("input")) {
+ this.element.val(this.startDate.format(this.format)
+ + this.separator + this.endDate.format(this.format))
+ }
+ },
+ clickRange : function(f) {
+ var c = f.target.innerHTML;
+ if (c == this.locale.customRangeLabel) {
+ this.showCalendars()
+ } else {
+ var d = this.ranges[c];
+ this.startDate = d[0];
+ this.endDate = d[1];
+ if (!this.timePicker) {
+ this.startDate.startOf("day");
+ this.endDate.startOf("day")
+ }
+ this.leftCalendar.month.month(this.startDate.month()).year(
+ this.startDate.year()).hour(this.startDate.hour())
+ .minute(this.startDate.minute());
+ this.rightCalendar.month.month(this.endDate.month()).year(
+ this.endDate.year()).hour(this.endDate.hour()).minute(
+ this.endDate.minute());
+ this.updateCalendars();
+ this.updateInputText();
+ this.container.find(".calendar").hide();
+ this.hide()
+ }
+ },
+ clickPrev : function(d) {
+ var c = b(d.target).parents(".calendar");
+ if (c.hasClass("left")) {
+ this.leftCalendar.month.subtract("month", 1)
+ } else {
+ this.rightCalendar.month.subtract("month", 1)
+ }
+ this.updateCalendars()
+ },
+ clickNext : function(d) {
+ var c = b(d.target).parents(".calendar");
+ if (c.hasClass("left")) {
+ this.leftCalendar.month.add("month", 1)
+ } else {
+ this.rightCalendar.month.add("month", 1)
+ }
+ this.updateCalendars()
+ },
+ enterDate : function(f) {
+ var h = b(f.target).attr("data-title");
+ var g = h.substr(1, 1);
+ var c = h.substr(3, 1);
+ var d = b(f.target).parents(".calendar");
+ if (d.hasClass("left")) {
+ this.container.find("input[name=daterangepicker_start]").val(
+ this.leftCalendar.calendar[g][c].format(this.format))
+ } else {
+ this.container.find("input[name=daterangepicker_end]").val(
+ this.rightCalendar.calendar[g][c].format(this.format))
+ }
+ },
+ clickDate : function(j) {
+ var k = b(j.target).attr("data-title");
+ var l = k.substr(1, 1);
+ var g = k.substr(3, 1);
+ var d = b(j.target).parents(".calendar");
+ if (d.hasClass("left")) {
+ var f = this.leftCalendar.calendar[l][g];
+ var i = this.endDate;
+ if (typeof this.dateLimit == "object") {
+ var c = moment(f).add(this.dateLimit).startOf("day");
+ if (i.isAfter(c)) {
+ i = c
+ }
+ }
+ } else {
+ var f = this.startDate;
+ var i = this.rightCalendar.calendar[l][g];
+ if (typeof this.dateLimit == "object") {
+ var h = moment(i).subtract(this.dateLimit).startOf("day");
+ if (f.isBefore(h)) {
+ f = h
+ }
+ }
+ }
+ d.find("td").removeClass("active");
+ if (f.isSame(i) || f.isBefore(i)) {
+ b(j.target).addClass("active");
+ this.startDate = f;
+ this.endDate = i
+ } else {
+ if (f.isAfter(i)) {
+ b(j.target).addClass("active");
+ this.startDate = f;
+ this.endDate = moment(f).add("day", 1).startOf("day")
+ }
+ }
+ this.leftCalendar.month.month(this.startDate.month()).year(
+ this.startDate.year());
+ this.rightCalendar.month.month(this.endDate.month()).year(
+ this.endDate.year());
+ this.updateCalendars()
+ },
+ clickApply : function(c) {
+ this.updateInputText();
+ this.hide()
+ },
+ clickCancel : function(c) {
+ this.startDate = this.oldStartDate;
+ this.endDate = this.oldEndDate;
+ this.updateView();
+ this.updateCalendars();
+ this.hide()
+ },
+ updateMonthYear : function(g) {
+ var h = b(g.target).closest(".calendar").hasClass("left");
+ var f = this.container.find(".calendar.left");
+ if (!h) {
+ f = this.container.find(".calendar.right")
+ }
+ var d = f.find(".monthselect").val();
+ var c = f.find(".yearselect").val();
+ if (h) {
+ this.leftCalendar.month.month(d).year(c)
+ } else {
+ this.rightCalendar.month.month(d).year(c)
+ }
+ this.updateCalendars()
+ },
+ updateTime : function(h) {
+ var j = b(h.target).closest(".calendar").hasClass("left");
+ var g = this.container.find(".calendar.left");
+ if (!j) {
+ g = this.container.find(".calendar.right")
+ }
+ var d = parseInt(g.find(".hourselect").val());
+ var i = parseInt(g.find(".minuteselect").val());
+ if (this.timePicker12Hour) {
+ var f = g.find(".ampmselect").val();
+ if (f == "PM" && d < 12) {
+ d += 12
+ }
+ if (f == "AM" && d == 12) {
+ d = 0
+ }
+ }
+ if (j) {
+ var k = this.startDate;
+ k.hour(d);
+ k.minute(i);
+ this.startDate = k;
+ this.leftCalendar.month.hour(d).minute(i)
+ } else {
+ var c = this.endDate;
+ c.hour(d);
+ c.minute(i);
+ this.endDate = c;
+ this.rightCalendar.month.hour(d).minute(i)
+ }
+ this.updateCalendars()
+ },
+ updateCalendars : function() {
+ this.leftCalendar.calendar = this.buildCalendar(
+ this.leftCalendar.month.month(), this.leftCalendar.month
+ .year(), this.leftCalendar.month.hour(),
+ this.leftCalendar.month.minute(), "left");
+ this.rightCalendar.calendar = this.buildCalendar(
+ this.rightCalendar.month.month(), this.rightCalendar.month
+ .year(), this.rightCalendar.month.hour(),
+ this.rightCalendar.month.minute(), "right");
+ this.container.find(".calendar.left").html(
+ this.renderCalendar(this.leftCalendar.calendar,
+ this.startDate, this.minDate, this.maxDate));
+ this.container.find(".calendar.right").html(
+ this.renderCalendar(this.rightCalendar.calendar,
+ this.endDate, this.startDate, this.maxDate));
+ this.container.find(".ranges li").removeClass("active");
+ var c = true;
+ var e = 0;
+ for ( var d in this.ranges) {
+ if (this.timePicker) {
+ if (this.startDate.isSame(this.ranges[d][0])
+ && this.endDate.isSame(this.ranges[d][1])) {
+ c = false;
+ this.container.find(".ranges li:eq(" + e + ")")
+ .addClass("active")
+ }
+ } else {
+ if (this.startDate.format("YYYY-MM-DD") == this.ranges[d][0]
+ .format("YYYY-MM-DD")
+ && this.endDate.format("YYYY-MM-DD") == this.ranges[d][1]
+ .format("YYYY-MM-DD")) {
+ c = false;
+ this.container.find(".ranges li:eq(" + e + ")")
+ .addClass("active")
+ }
+ }
+ e++
+ }
+ if (c) {
+ this.container.find(".ranges li:last").addClass("active")
+ }
+ },
+ buildCalendar : function(o, q, h, g, p) {
+ var c = moment([ q, o, 1 ]);
+ var m = moment(c).subtract("month", 1).month();
+ var l = moment(c).subtract("month", 1).year();
+ var r = moment([ l, m ]).daysInMonth();
+ var e = c.day();
+ var k = [];
+ for (var j = 0; j < 6; j++) {
+ k[j] = []
+ }
+ var n = r - e + this.locale.firstDay + 1;
+ if (n > r) {
+ n -= 7
+ }
+ if (e == this.locale.firstDay) {
+ n = r - 6
+ }
+ var f = moment([ l, m, n, h, g ]);
+ for (var j = 0, d = 0, s = 0; j < 42; j++, d++, f = moment(f).add(
+ "day", 1)) {
+ if (j > 0 && d % 7 == 0) {
+ d = 0;
+ s++
+ }
+ k[s][d] = f
+ }
+ return k
+ },
+ renderDropdowns : function(h, g, c) {
+ var k = h.month();
+ var f = '
';
+ var d = false;
+ var p = false;
+ for (var e = 0; e < 12; e++) {
+ if ((!d || e >= g.month()) && (!p || e <= c.month())) {
+ f += ""
+ + this.locale.monthNames[e] + " "
+ }
+ }
+ f += " ";
+ var j = h.year();
+ var i = (c && c.year()) || (j + 5);
+ var o = (g && g.year()) || (j - 50);
+ var n = '
';
+ for (var l = o; l <= i; l++) {
+ n += '" + l
+ + " "
+ }
+ n += " ";
+ return f + n
+ },
+ renderCalendar : function(m, k, j, d) {
+ var p = '
';
+ p += '
';
+ p += "";
+ p += "";
+ if (this.showWeekNumbers) {
+ p += " "
+ }
+ if (!j || j.isBefore(m[1][1])) {
+ p += ' '
+ } else {
+ p += " "
+ }
+ var f = this.locale.monthNames[m[1][1].month()]
+ + m[1][1].format(" YYYY");
+ if (this.showDropdowns) {
+ f = this.renderDropdowns(m[1][1], j, d)
+ }
+ p += '' + f + " ";
+ if (!d || d.isAfter(m[1][1])) {
+ p += ' '
+ } else {
+ p += " "
+ }
+ p += " ";
+ p += "";
+ if (this.showWeekNumbers) {
+ p += '' + this.locale.weekLabel + " "
+ }
+ b.each(this.locale.daysOfWeek, function(s, i) {
+ p += "" + i + " "
+ });
+ p += " ";
+ p += " ";
+ p += "";
+ for (var r = 0; r < 6; r++) {
+ p += "";
+ if (this.showWeekNumbers) {
+ p += '' + m[r][0].week() + " "
+ }
+ for (var g = 0; g < 7; g++) {
+ var o = "available ";
+ o += (m[r][g].month() == m[1][1].month()) ? "" : "off";
+ if ((j && m[r][g].isBefore(j)) || (d && m[r][g].isAfter(d))) {
+ o = " off disabled "
+ } else {
+ if (m[r][g].format("YYYY-MM-DD") == k
+ .format("YYYY-MM-DD")) {
+ o += " active ";
+ if (m[r][g].format("YYYY-MM-DD") == this.startDate
+ .format("YYYY-MM-DD")) {
+ o += " start-date "
+ }
+ if (m[r][g].format("YYYY-MM-DD") == this.endDate
+ .format("YYYY-MM-DD")) {
+ o += " end-date "
+ }
+ } else {
+ if (m[r][g] >= this.startDate
+ && m[r][g] <= this.endDate) {
+ o += " in-range ";
+ if (m[r][g].isSame(this.startDate)) {
+ o += " start-date "
+ }
+ if (m[r][g].isSame(this.endDate)) {
+ o += " end-date "
+ }
+ }
+ }
+ }
+ var q = "r" + r + "c" + g;
+ p += ''
+ + m[r][g].date() + " "
+ }
+ p += " "
+ }
+ p += " ";
+ p += "
";
+ p += "
";
+ if (this.timePicker) {
+ p += '
';
+ p += '';
+ var e = 0;
+ var h = 23;
+ var c = k.hour();
+ if (this.timePicker12Hour) {
+ e = 1;
+ h = 12;
+ if (c >= 12) {
+ c -= 12
+ }
+ if (c == 0) {
+ c = 12
+ }
+ }
+ for (var l = e; l <= h; l++) {
+ if (l == c) {
+ p += ''
+ + l + " "
+ } else {
+ p += '' + l + " "
+ }
+ }
+ p += " : ";
+ p += '';
+ for (var l = 0; l < 60; l += this.timePickerIncrement) {
+ var n = l;
+ if (n < 10) {
+ n = "0" + n
+ }
+ if (l == k.minute()) {
+ p += ''
+ + n + " "
+ } else {
+ p += '' + n + " "
+ }
+ }
+ p += " ";
+ if (this.timePicker12Hour) {
+ p += '';
+ if (k.hour() >= 12) {
+ p += 'AM PM '
+ } else {
+ p += 'AM PM '
+ }
+ p += " "
+ }
+ p += "
"
+ }
+ return p
+ }
+ };
+ b.fn.daterangepicker = function(d, c) {
+ this.each(function() {
+ var e = b(this);
+ if (!e.data("daterangepicker")) {
+ e.data("daterangepicker", new a(e, d, c))
+ }
+ });
+ return this
+ }
}(window.jQuery);
\ No newline at end of file
diff --git a/chapter11/src/main/resources/static/assets/js/date-time/moment.min.js b/chapter11/src/main/resources/static/assets/js/date-time/moment.min.js
old mode 100755
new mode 100644
diff --git a/chapter11/src/main/resources/static/assets/js/dropzone.min.js b/chapter11/src/main/resources/static/assets/js/dropzone.min.js
old mode 100755
new mode 100644
diff --git a/chapter11/src/main/resources/static/assets/js/excanvas.min.js b/chapter11/src/main/resources/static/assets/js/excanvas.min.js
old mode 100755
new mode 100644
diff --git a/chapter11/src/main/resources/static/assets/js/flot/jquery.flot.min.js b/chapter11/src/main/resources/static/assets/js/flot/jquery.flot.min.js
old mode 100755
new mode 100644
diff --git a/chapter11/src/main/resources/static/assets/js/flot/jquery.flot.pie.min.js b/chapter11/src/main/resources/static/assets/js/flot/jquery.flot.pie.min.js
old mode 100755
new mode 100644
diff --git a/chapter11/src/main/resources/static/assets/js/flot/jquery.flot.resize.min.js b/chapter11/src/main/resources/static/assets/js/flot/jquery.flot.resize.min.js
old mode 100755
new mode 100644
diff --git a/chapter11/src/main/resources/static/assets/js/fuelux/data/fuelux.tree-sampledata.js b/chapter11/src/main/resources/static/assets/js/fuelux/data/fuelux.tree-sampledata.js
old mode 100755
new mode 100644
index d7cba4e..0bef75e
--- a/chapter11/src/main/resources/static/assets/js/fuelux/data/fuelux.tree-sampledata.js
+++ b/chapter11/src/main/resources/static/assets/js/fuelux/data/fuelux.tree-sampledata.js
@@ -1,176 +1,176 @@
-var DataSourceTree = function(options) {
- this._data = options.data;
- this._delay = options.delay;
-}
-
-DataSourceTree.prototype.data = function(options, callback) {
- var self = this;
- var $data = null;
-
- if(!("name" in options) && !("type" in options)){
- $data = this._data;//the root tree
- callback({ data: $data });
- return;
- }
- else if("type" in options && options.type == "folder") {
- if("additionalParameters" in options && "children" in options.additionalParameters)
- $data = options.additionalParameters.children;
- else $data = {}//no data
- }
-
- if($data != null)//this setTimeout is only for mimicking some random delay
- setTimeout(function(){callback({ data: $data });} , parseInt(Math.random() * 500) + 200);
-
- //we have used static data here
- //but you can retrieve your data dynamically from a server using ajax call
- //checkout examples/treeview.html and examples/treeview.js for more info
-};
-
-var tree_data = {
- 'for-sale' : {name: 'For Sale', type: 'folder'} ,
- 'vehicles' : {name: 'Vehicles', type: 'folder'} ,
- 'rentals' : {name: 'Rentals', type: 'folder'} ,
- 'real-estate' : {name: 'Real Estate', type: 'folder'} ,
- 'pets' : {name: 'Pets', type: 'folder'} ,
- 'tickets' : {name: 'Tickets', type: 'item'} ,
- 'services' : {name: 'Services', type: 'item'} ,
- 'personals' : {name: 'Personals', type: 'item'}
-}
-tree_data['for-sale']['additionalParameters'] = {
- 'children' : {
- 'appliances' : {name: 'Appliances', type: 'item'},
- 'arts-crafts' : {name: 'Arts & Crafts', type: 'item'},
- 'clothing' : {name: 'Clothing', type: 'item'},
- 'computers' : {name: 'Computers', type: 'item'},
- 'jewelry' : {name: 'Jewelry', type: 'item'},
- 'office-business' : {name: 'Office & Business', type: 'item'},
- 'sports-fitness' : {name: 'Sports & Fitness', type: 'item'}
- }
-}
-tree_data['vehicles']['additionalParameters'] = {
- 'children' : {
- 'cars' : {name: 'Cars', type: 'folder'},
- 'motorcycles' : {name: 'Motorcycles', type: 'item'},
- 'boats' : {name: 'Boats', type: 'item'}
- }
-}
-tree_data['vehicles']['additionalParameters']['children']['cars']['additionalParameters'] = {
- 'children' : {
- 'classics' : {name: 'Classics', type: 'item'},
- 'convertibles' : {name: 'Convertibles', type: 'item'},
- 'coupes' : {name: 'Coupes', type: 'item'},
- 'hatchbacks' : {name: 'Hatchbacks', type: 'item'},
- 'hybrids' : {name: 'Hybrids', type: 'item'},
- 'suvs' : {name: 'SUVs', type: 'item'},
- 'sedans' : {name: 'Sedans', type: 'item'},
- 'trucks' : {name: 'Trucks', type: 'item'}
- }
-}
-
-tree_data['rentals']['additionalParameters'] = {
- 'children' : {
- 'apartments-rentals' : {name: 'Apartments', type: 'item'},
- 'office-space-rentals' : {name: 'Office Space', type: 'item'},
- 'vacation-rentals' : {name: 'Vacation Rentals', type: 'item'}
- }
-}
-tree_data['real-estate']['additionalParameters'] = {
- 'children' : {
- 'apartments' : {name: 'Apartments', type: 'item'},
- 'villas' : {name: 'Villas', type: 'item'},
- 'plots' : {name: 'Plots', type: 'item'}
- }
-}
-tree_data['pets']['additionalParameters'] = {
- 'children' : {
- 'cats' : {name: 'Cats', type: 'item'},
- 'dogs' : {name: 'Dogs', type: 'item'},
- 'horses' : {name: 'Horses', type: 'item'},
- 'reptiles' : {name: 'Reptiles', type: 'item'}
- }
-}
-
-var treeDataSource = new DataSourceTree({data: tree_data});
-
-
-
-
-
-
-
-
-
-
-
-var tree_data_2 = {
- 'pictures' : {name: 'Pictures', type: 'folder', 'icon-class':'red'} ,
- 'music' : {name: 'Music', type: 'folder', 'icon-class':'orange'} ,
- 'video' : {name: 'Video', type: 'folder', 'icon-class':'blue'} ,
- 'documents' : {name: 'Documents', type: 'folder', 'icon-class':'green'} ,
- 'backup' : {name: 'Backup', type: 'folder'} ,
- 'readme' : {name: '
ReadMe.txt', type: 'item'},
- 'manual' : {name: '
Manual.html', type: 'item'}
-}
-tree_data_2['music']['additionalParameters'] = {
- 'children' : [
- {name: '
song1.ogg', type: 'item'},
- {name: '
song2.ogg', type: 'item'},
- {name: '
song3.ogg', type: 'item'},
- {name: '
song4.ogg', type: 'item'},
- {name: '
song5.ogg', type: 'item'}
- ]
-}
-tree_data_2['video']['additionalParameters'] = {
- 'children' : [
- {name: '
movie1.avi', type: 'item'},
- {name: '
movie2.avi', type: 'item'},
- {name: '
movie3.avi', type: 'item'},
- {name: '
movie4.avi', type: 'item'},
- {name: '
movie5.avi', type: 'item'}
- ]
-}
-tree_data_2['pictures']['additionalParameters'] = {
- 'children' : {
- 'wallpapers' : {name: 'Wallpapers', type: 'folder', 'icon-class':'pink'},
- 'camera' : {name: 'Camera', type: 'folder', 'icon-class':'pink'}
- }
-}
-tree_data_2['pictures']['additionalParameters']['children']['wallpapers']['additionalParameters'] = {
- 'children' : [
- {name: '
wallpaper1.jpg', type: 'item'},
- {name: '
wallpaper2.jpg', type: 'item'},
- {name: '
wallpaper3.jpg', type: 'item'},
- {name: '
wallpaper4.jpg', type: 'item'}
- ]
-}
-tree_data_2['pictures']['additionalParameters']['children']['camera']['additionalParameters'] = {
- 'children' : [
- {name: '
photo1.jpg', type: 'item'},
- {name: '
photo2.jpg', type: 'item'},
- {name: '
photo3.jpg', type: 'item'},
- {name: '
photo4.jpg', type: 'item'},
- {name: '
photo5.jpg', type: 'item'},
- {name: '
photo6.jpg', type: 'item'}
- ]
-}
-
-
-tree_data_2['documents']['additionalParameters'] = {
- 'children' : [
- {name: '
document1.pdf', type: 'item'},
- {name: '
document2.doc', type: 'item'},
- {name: '
document3.doc', type: 'item'},
- {name: '
document4.pdf', type: 'item'},
- {name: '
document5.doc', type: 'item'}
- ]
-}
-
-tree_data_2['backup']['additionalParameters'] = {
- 'children' : [
- {name: '
backup1.zip', type: 'item'},
- {name: '
backup2.zip', type: 'item'},
- {name: '
backup3.zip', type: 'item'},
- {name: '
backup4.zip', type: 'item'}
- ]
-}
+var DataSourceTree = function(options) {
+ this._data = options.data;
+ this._delay = options.delay;
+}
+
+DataSourceTree.prototype.data = function(options, callback) {
+ var self = this;
+ var $data = null;
+
+ if(!("name" in options) && !("type" in options)){
+ $data = this._data;//the root tree
+ callback({ data: $data });
+ return;
+ }
+ else if("type" in options && options.type == "folder") {
+ if("additionalParameters" in options && "children" in options.additionalParameters)
+ $data = options.additionalParameters.children;
+ else $data = {}//no data
+ }
+
+ if($data != null)//this setTimeout is only for mimicking some random delay
+ setTimeout(function(){callback({ data: $data });} , parseInt(Math.random() * 500) + 200);
+
+ //we have used static data here
+ //but you can retrieve your data dynamically from a server using ajax call
+ //checkout examples/treeview.html and examples/treeview.js for more info
+};
+
+var tree_data = {
+ 'for-sale' : {name: 'For Sale', type: 'folder'} ,
+ 'vehicles' : {name: 'Vehicles', type: 'folder'} ,
+ 'rentals' : {name: 'Rentals', type: 'folder'} ,
+ 'real-estate' : {name: 'Real Estate', type: 'folder'} ,
+ 'pets' : {name: 'Pets', type: 'folder'} ,
+ 'tickets' : {name: 'Tickets', type: 'item'} ,
+ 'services' : {name: 'Services', type: 'item'} ,
+ 'personals' : {name: 'Personals', type: 'item'}
+}
+tree_data['for-sale']['additionalParameters'] = {
+ 'children' : {
+ 'appliances' : {name: 'Appliances', type: 'item'},
+ 'arts-crafts' : {name: 'Arts & Crafts', type: 'item'},
+ 'clothing' : {name: 'Clothing', type: 'item'},
+ 'computers' : {name: 'Computers', type: 'item'},
+ 'jewelry' : {name: 'Jewelry', type: 'item'},
+ 'office-business' : {name: 'Office & Business', type: 'item'},
+ 'sports-fitness' : {name: 'Sports & Fitness', type: 'item'}
+ }
+}
+tree_data['vehicles']['additionalParameters'] = {
+ 'children' : {
+ 'cars' : {name: 'Cars', type: 'folder'},
+ 'motorcycles' : {name: 'Motorcycles', type: 'item'},
+ 'boats' : {name: 'Boats', type: 'item'}
+ }
+}
+tree_data['vehicles']['additionalParameters']['children']['cars']['additionalParameters'] = {
+ 'children' : {
+ 'classics' : {name: 'Classics', type: 'item'},
+ 'convertibles' : {name: 'Convertibles', type: 'item'},
+ 'coupes' : {name: 'Coupes', type: 'item'},
+ 'hatchbacks' : {name: 'Hatchbacks', type: 'item'},
+ 'hybrids' : {name: 'Hybrids', type: 'item'},
+ 'suvs' : {name: 'SUVs', type: 'item'},
+ 'sedans' : {name: 'Sedans', type: 'item'},
+ 'trucks' : {name: 'Trucks', type: 'item'}
+ }
+}
+
+tree_data['rentals']['additionalParameters'] = {
+ 'children' : {
+ 'apartments-rentals' : {name: 'Apartments', type: 'item'},
+ 'office-space-rentals' : {name: 'Office Space', type: 'item'},
+ 'vacation-rentals' : {name: 'Vacation Rentals', type: 'item'}
+ }
+}
+tree_data['real-estate']['additionalParameters'] = {
+ 'children' : {
+ 'apartments' : {name: 'Apartments', type: 'item'},
+ 'villas' : {name: 'Villas', type: 'item'},
+ 'plots' : {name: 'Plots', type: 'item'}
+ }
+}
+tree_data['pets']['additionalParameters'] = {
+ 'children' : {
+ 'cats' : {name: 'Cats', type: 'item'},
+ 'dogs' : {name: 'Dogs', type: 'item'},
+ 'horses' : {name: 'Horses', type: 'item'},
+ 'reptiles' : {name: 'Reptiles', type: 'item'}
+ }
+}
+
+var treeDataSource = new DataSourceTree({data: tree_data});
+
+
+
+
+
+
+
+
+
+
+
+var tree_data_2 = {
+ 'pictures' : {name: 'Pictures', type: 'folder', 'icon-class':'red'} ,
+ 'music' : {name: 'Music', type: 'folder', 'icon-class':'orange'} ,
+ 'video' : {name: 'Video', type: 'folder', 'icon-class':'blue'} ,
+ 'documents' : {name: 'Documents', type: 'folder', 'icon-class':'green'} ,
+ 'backup' : {name: 'Backup', type: 'folder'} ,
+ 'readme' : {name: '
ReadMe.txt', type: 'item'},
+ 'manual' : {name: '
Manual.html', type: 'item'}
+}
+tree_data_2['music']['additionalParameters'] = {
+ 'children' : [
+ {name: '
song1.ogg', type: 'item'},
+ {name: '
song2.ogg', type: 'item'},
+ {name: '
song3.ogg', type: 'item'},
+ {name: '
song4.ogg', type: 'item'},
+ {name: '
song5.ogg', type: 'item'}
+ ]
+}
+tree_data_2['video']['additionalParameters'] = {
+ 'children' : [
+ {name: '
movie1.avi', type: 'item'},
+ {name: '
movie2.avi', type: 'item'},
+ {name: '
movie3.avi', type: 'item'},
+ {name: '
movie4.avi', type: 'item'},
+ {name: '
movie5.avi', type: 'item'}
+ ]
+}
+tree_data_2['pictures']['additionalParameters'] = {
+ 'children' : {
+ 'wallpapers' : {name: 'Wallpapers', type: 'folder', 'icon-class':'pink'},
+ 'camera' : {name: 'Camera', type: 'folder', 'icon-class':'pink'}
+ }
+}
+tree_data_2['pictures']['additionalParameters']['children']['wallpapers']['additionalParameters'] = {
+ 'children' : [
+ {name: '
wallpaper1.jpg', type: 'item'},
+ {name: '
wallpaper2.jpg', type: 'item'},
+ {name: '
wallpaper3.jpg', type: 'item'},
+ {name: '
wallpaper4.jpg', type: 'item'}
+ ]
+}
+tree_data_2['pictures']['additionalParameters']['children']['camera']['additionalParameters'] = {
+ 'children' : [
+ {name: '
photo1.jpg', type: 'item'},
+ {name: '
photo2.jpg', type: 'item'},
+ {name: '
photo3.jpg', type: 'item'},
+ {name: '
photo4.jpg', type: 'item'},
+ {name: '
photo5.jpg', type: 'item'},
+ {name: '
photo6.jpg', type: 'item'}
+ ]
+}
+
+
+tree_data_2['documents']['additionalParameters'] = {
+ 'children' : [
+ {name: '
document1.pdf', type: 'item'},
+ {name: '
document2.doc', type: 'item'},
+ {name: '
document3.doc', type: 'item'},
+ {name: '
document4.pdf', type: 'item'},
+ {name: '
document5.doc', type: 'item'}
+ ]
+}
+
+tree_data_2['backup']['additionalParameters'] = {
+ 'children' : [
+ {name: '
backup1.zip', type: 'item'},
+ {name: '
backup2.zip', type: 'item'},
+ {name: '
backup3.zip', type: 'item'},
+ {name: '
backup4.zip', type: 'item'}
+ ]
+}
var treeDataSource2 = new DataSourceTree({data: tree_data_2});
\ No newline at end of file
diff --git a/chapter11/src/main/resources/static/assets/js/fuelux/fuelux.spinner.min.js b/chapter11/src/main/resources/static/assets/js/fuelux/fuelux.spinner.min.js
old mode 100755
new mode 100644
diff --git a/chapter11/src/main/resources/static/assets/js/fuelux/fuelux.tree.min.js b/chapter11/src/main/resources/static/assets/js/fuelux/fuelux.tree.min.js
old mode 100755
new mode 100644
diff --git a/chapter11/src/main/resources/static/assets/js/fuelux/fuelux.wizard.min.js b/chapter11/src/main/resources/static/assets/js/fuelux/fuelux.wizard.min.js
old mode 100755
new mode 100644
diff --git a/chapter11/src/main/resources/static/assets/js/fullcalendar.min.js b/chapter11/src/main/resources/static/assets/js/fullcalendar.min.js
old mode 100755
new mode 100644
diff --git a/chapter11/src/main/resources/static/assets/js/html5shiv.js b/chapter11/src/main/resources/static/assets/js/html5shiv.js
old mode 100755
new mode 100644
diff --git a/chapter11/src/main/resources/static/assets/js/jqGrid/grid.base.js b/chapter11/src/main/resources/static/assets/js/jqGrid/grid.base.js
old mode 100755
new mode 100644
diff --git a/chapter11/src/main/resources/static/assets/js/jqGrid/i18n/grid.locale-cn.js b/chapter11/src/main/resources/static/assets/js/jqGrid/i18n/grid.locale-cn.js
old mode 100755
new mode 100644
diff --git a/chapter11/src/main/resources/static/assets/js/jqGrid/i18n/grid.locale-en.js b/chapter11/src/main/resources/static/assets/js/jqGrid/i18n/grid.locale-en.js
old mode 100755
new mode 100644
index a66dd84..35dec69
--- a/chapter11/src/main/resources/static/assets/js/jqGrid/i18n/grid.locale-en.js
+++ b/chapter11/src/main/resources/static/assets/js/jqGrid/i18n/grid.locale-en.js
@@ -1,168 +1,168 @@
-;(function($){
-/**
- * jqGrid English Translation
- * Tony Tomov tony@trirand.com
- * http://trirand.com/blog/
- * Dual licensed under the MIT and GPL licenses:
- * http://www.opensource.org/licenses/mit-license.php
- * http://www.gnu.org/licenses/gpl.html
-**/
-$.jgrid = $.jgrid || {};
-$.extend($.jgrid,{
- defaults : {
- recordtext: "{0} - {1}\u3000共 {2} 条", // 共字前是全角空格
- emptyrecords: "无数据显示",
- loadtext: "读取中...",
- pgtext : " {0} 共 {1} 页",
- },
- search : {
- caption: "搜索...",
- Find: "查找",
- Reset: "重置",
- odata: [{ oper:'eq', text:'等于\u3000\u3000'},{ oper:'ne', text:'不等\u3000\u3000'},{ oper:'lt', text:'小于\u3000\u3000'},{ oper:'le', text:'小于等于'},{ oper:'gt', text:'大于\u3000\u3000'},{ oper:'ge', text:'大于等于'},{ oper:'bw', text:'开始于'},{ oper:'bn', text:'不开始于'},{ oper:'in', text:'属于\u3000\u3000'},{ oper:'ni', text:'不属于'},{ oper:'ew', text:'结束于'},{ oper:'en', text:'不结束于'},{ oper:'cn', text:'包含\u3000\u3000'},{ oper:'nc', text:'不包含'},{ oper:'nu', text:'不存在'},{ oper:'nn', text:'存在'}],
- groupOps: [ { op: "AND", text: "所有" }, { op: "OR", text: "任一" } ]
- },
- edit : {
- addCaption: "添加记录",
- editCaption: "编辑记录",
- bSubmit: "提交",
- bCancel: "取消",
- bClose: "关闭",
- saveData: "数据已改变,是否保存?",
- bYes : "是",
- bNo : "否",
- bExit : "取消",
- msg: {
- required:"此字段必需",
- number:"请输入有效数字",
- minValue:"输值必须大于等于 ",
- maxValue:"输值必须小于等于 ",
- email: "这不是有效的e-mail地址",
- integer: "请输入有效整数",
- date: "请输入有效时间",
- url: "无效网址。前缀必须为 ('http://' 或 'https://')",
- nodefined : " 未定义!",
- novalue : " 需要返回值!",
- customarray : "自定义函数需要返回数组!",
- customfcheck : "必须有自定义函数!"
-
- }
- },
- view : {
- caption: "查看记录",
- bClose: "关闭"
- },
- del : {
- caption: "删除",
- msg: "删除所选记录?",
- bSubmit: "删除",
- bCancel: "取消"
- },
- nav : {
- edittext: "",
- edittitle: "编辑所选记录",
- addtext:"",
- addtitle: "添加新记录",
- deltext: "",
- deltitle: "删除所选记录",
- searchtext: "",
- searchtitle: "查找",
- refreshtext: "",
- refreshtitle: "刷新表格",
- alertcap: "注意",
- alerttext: "请选择记录",
- viewtext: "",
- viewtitle: "查看所选记录"
- },
- col : {
- caption: "选择列",
- bSubmit: "确定",
- bCancel: "取消"
- },
- errors : {
- errcap : "错误",
- nourl : "没有设置url",
- norecords: "没有要处理的记录",
- model : "colNames 和 colModel 长度不等!"
- },
- formatter : {
- integer : {thousandsSeparator: ",", defaultValue: '0'},
- number : {decimalSeparator:".", thousandsSeparator: ",", decimalPlaces: 2, defaultValue: '0.00'},
- currency : {decimalSeparator:".", thousandsSeparator: ",", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0.00'},
- date : {
- dayNames: [
- "日", "一", "二", "三", "四", "五", "六",
- "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六",
- ],
- monthNames: [
- "一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二",
- "一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"
- ],
- AmPm : ["am","pm","AM","PM"],
- S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th';},
- srcformat: 'Y-m-d',
- newformat: 'n/j/Y',
- parseRe : /[Tt\\\/:_;.,\t\s-]/,
- masks : {
- // see http://php.net/manual/en/function.date.php for PHP format used in jqGrid
- // and see http://docs.jquery.com/UI/Datepicker/formatDate
- // and https://github.com/jquery/globalize#dates for alternative formats used frequently
- // one can find on https://github.com/jquery/globalize/tree/master/lib/cultures many
- // information about date, time, numbers and currency formats used in different countries
- // one should just convert the information in PHP format
- ISO8601Long:"Y-m-d H:i:s",
- ISO8601Short:"Y-m-d",
- // short date:
- // n - Numeric representation of a month, without leading zeros
- // j - Day of the month without leading zeros
- // Y - A full numeric representation of a year, 4 digits
- // example: 3/1/2012 which means 1 March 2012
- ShortDate: "n/j/Y", // in jQuery UI Datepicker: "M/d/yyyy"
- // long date:
- // l - A full textual representation of the day of the week
- // F - A full textual representation of a month
- // d - Day of the month, 2 digits with leading zeros
- // Y - A full numeric representation of a year, 4 digits
- LongDate: "l, F d, Y", // in jQuery UI Datepicker: "dddd, MMMM dd, yyyy"
- // long date with long time:
- // l - A full textual representation of the day of the week
- // F - A full textual representation of a month
- // d - Day of the month, 2 digits with leading zeros
- // Y - A full numeric representation of a year, 4 digits
- // g - 12-hour format of an hour without leading zeros
- // i - Minutes with leading zeros
- // s - Seconds, with leading zeros
- // A - Uppercase Ante meridiem and Post meridiem (AM or PM)
- FullDateTime: "l, F d, Y g:i:s A", // in jQuery UI Datepicker: "dddd, MMMM dd, yyyy h:mm:ss tt"
- // month day:
- // F - A full textual representation of a month
- // d - Day of the month, 2 digits with leading zeros
- MonthDay: "F d", // in jQuery UI Datepicker: "MMMM dd"
- // short time (without seconds)
- // g - 12-hour format of an hour without leading zeros
- // i - Minutes with leading zeros
- // A - Uppercase Ante meridiem and Post meridiem (AM or PM)
- ShortTime: "g:i A", // in jQuery UI Datepicker: "h:mm tt"
- // long time (with seconds)
- // g - 12-hour format of an hour without leading zeros
- // i - Minutes with leading zeros
- // s - Seconds, with leading zeros
- // A - Uppercase Ante meridiem and Post meridiem (AM or PM)
- LongTime: "g:i:s A", // in jQuery UI Datepicker: "h:mm:ss tt"
- SortableDateTime: "Y-m-d\\TH:i:s",
- UniversalSortableDateTime: "Y-m-d H:i:sO",
- // month with year
- // Y - A full numeric representation of a year, 4 digits
- // F - A full textual representation of a month
- YearMonth: "F, Y" // in jQuery UI Datepicker: "MMMM, yyyy"
- },
- reformatAfterEdit : false
- },
- baseLinkUrl: '',
- showAction: '',
- target: '',
- checkbox : {disabled:true},
- idName : 'id'
- }
-});
+;(function($){
+/**
+ * jqGrid English Translation
+ * Tony Tomov tony@trirand.com
+ * http://trirand.com/blog/
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+**/
+$.jgrid = $.jgrid || {};
+$.extend($.jgrid,{
+ defaults : {
+ recordtext: "{0} - {1}\u3000共 {2} 条", // 共字前是全角空格
+ emptyrecords: "无数据显示",
+ loadtext: "读取中...",
+ pgtext : " {0} 共 {1} 页",
+ },
+ search : {
+ caption: "搜索...",
+ Find: "查找",
+ Reset: "重置",
+ odata: [{ oper:'eq', text:'等于\u3000\u3000'},{ oper:'ne', text:'不等\u3000\u3000'},{ oper:'lt', text:'小于\u3000\u3000'},{ oper:'le', text:'小于等于'},{ oper:'gt', text:'大于\u3000\u3000'},{ oper:'ge', text:'大于等于'},{ oper:'bw', text:'开始于'},{ oper:'bn', text:'不开始于'},{ oper:'in', text:'属于\u3000\u3000'},{ oper:'ni', text:'不属于'},{ oper:'ew', text:'结束于'},{ oper:'en', text:'不结束于'},{ oper:'cn', text:'包含\u3000\u3000'},{ oper:'nc', text:'不包含'},{ oper:'nu', text:'不存在'},{ oper:'nn', text:'存在'}],
+ groupOps: [ { op: "AND", text: "所有" }, { op: "OR", text: "任一" } ]
+ },
+ edit : {
+ addCaption: "添加记录",
+ editCaption: "编辑记录",
+ bSubmit: "提交",
+ bCancel: "取消",
+ bClose: "关闭",
+ saveData: "数据已改变,是否保存?",
+ bYes : "是",
+ bNo : "否",
+ bExit : "取消",
+ msg: {
+ required:"此字段必需",
+ number:"请输入有效数字",
+ minValue:"输值必须大于等于 ",
+ maxValue:"输值必须小于等于 ",
+ email: "这不是有效的e-mail地址",
+ integer: "请输入有效整数",
+ date: "请输入有效时间",
+ url: "无效网址。前缀必须为 ('http://' 或 'https://')",
+ nodefined : " 未定义!",
+ novalue : " 需要返回值!",
+ customarray : "自定义函数需要返回数组!",
+ customfcheck : "必须有自定义函数!"
+
+ }
+ },
+ view : {
+ caption: "查看记录",
+ bClose: "关闭"
+ },
+ del : {
+ caption: "删除",
+ msg: "删除所选记录?",
+ bSubmit: "删除",
+ bCancel: "取消"
+ },
+ nav : {
+ edittext: "",
+ edittitle: "编辑所选记录",
+ addtext:"",
+ addtitle: "添加新记录",
+ deltext: "",
+ deltitle: "删除所选记录",
+ searchtext: "",
+ searchtitle: "查找",
+ refreshtext: "",
+ refreshtitle: "刷新表格",
+ alertcap: "注意",
+ alerttext: "请选择记录",
+ viewtext: "",
+ viewtitle: "查看所选记录"
+ },
+ col : {
+ caption: "选择列",
+ bSubmit: "确定",
+ bCancel: "取消"
+ },
+ errors : {
+ errcap : "错误",
+ nourl : "没有设置url",
+ norecords: "没有要处理的记录",
+ model : "colNames 和 colModel 长度不等!"
+ },
+ formatter : {
+ integer : {thousandsSeparator: ",", defaultValue: '0'},
+ number : {decimalSeparator:".", thousandsSeparator: ",", decimalPlaces: 2, defaultValue: '0.00'},
+ currency : {decimalSeparator:".", thousandsSeparator: ",", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0.00'},
+ date : {
+ dayNames: [
+ "日", "一", "二", "三", "四", "五", "六",
+ "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六",
+ ],
+ monthNames: [
+ "一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二",
+ "一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"
+ ],
+ AmPm : ["am","pm","AM","PM"],
+ S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th';},
+ srcformat: 'Y-m-d',
+ newformat: 'n/j/Y',
+ parseRe : /[Tt\\\/:_;.,\t\s-]/,
+ masks : {
+ // see http://php.net/manual/en/function.date.php for PHP format used in jqGrid
+ // and see http://docs.jquery.com/UI/Datepicker/formatDate
+ // and https://github.com/jquery/globalize#dates for alternative formats used frequently
+ // one can find on https://github.com/jquery/globalize/tree/master/lib/cultures many
+ // information about date, time, numbers and currency formats used in different countries
+ // one should just convert the information in PHP format
+ ISO8601Long:"Y-m-d H:i:s",
+ ISO8601Short:"Y-m-d",
+ // short date:
+ // n - Numeric representation of a month, without leading zeros
+ // j - Day of the month without leading zeros
+ // Y - A full numeric representation of a year, 4 digits
+ // example: 3/1/2012 which means 1 March 2012
+ ShortDate: "n/j/Y", // in jQuery UI Datepicker: "M/d/yyyy"
+ // long date:
+ // l - A full textual representation of the day of the week
+ // F - A full textual representation of a month
+ // d - Day of the month, 2 digits with leading zeros
+ // Y - A full numeric representation of a year, 4 digits
+ LongDate: "l, F d, Y", // in jQuery UI Datepicker: "dddd, MMMM dd, yyyy"
+ // long date with long time:
+ // l - A full textual representation of the day of the week
+ // F - A full textual representation of a month
+ // d - Day of the month, 2 digits with leading zeros
+ // Y - A full numeric representation of a year, 4 digits
+ // g - 12-hour format of an hour without leading zeros
+ // i - Minutes with leading zeros
+ // s - Seconds, with leading zeros
+ // A - Uppercase Ante meridiem and Post meridiem (AM or PM)
+ FullDateTime: "l, F d, Y g:i:s A", // in jQuery UI Datepicker: "dddd, MMMM dd, yyyy h:mm:ss tt"
+ // month day:
+ // F - A full textual representation of a month
+ // d - Day of the month, 2 digits with leading zeros
+ MonthDay: "F d", // in jQuery UI Datepicker: "MMMM dd"
+ // short time (without seconds)
+ // g - 12-hour format of an hour without leading zeros
+ // i - Minutes with leading zeros
+ // A - Uppercase Ante meridiem and Post meridiem (AM or PM)
+ ShortTime: "g:i A", // in jQuery UI Datepicker: "h:mm tt"
+ // long time (with seconds)
+ // g - 12-hour format of an hour without leading zeros
+ // i - Minutes with leading zeros
+ // s - Seconds, with leading zeros
+ // A - Uppercase Ante meridiem and Post meridiem (AM or PM)
+ LongTime: "g:i:s A", // in jQuery UI Datepicker: "h:mm:ss tt"
+ SortableDateTime: "Y-m-d\\TH:i:s",
+ UniversalSortableDateTime: "Y-m-d H:i:sO",
+ // month with year
+ // Y - A full numeric representation of a year, 4 digits
+ // F - A full textual representation of a month
+ YearMonth: "F, Y" // in jQuery UI Datepicker: "MMMM, yyyy"
+ },
+ reformatAfterEdit : false
+ },
+ baseLinkUrl: '',
+ showAction: '',
+ target: '',
+ checkbox : {disabled:true},
+ idName : 'id'
+ }
+});
})(jQuery);
\ No newline at end of file
diff --git a/chapter11/src/main/resources/static/assets/js/jqGrid/jquery.jqGrid.min.js b/chapter11/src/main/resources/static/assets/js/jqGrid/jquery.jqGrid.min.js
old mode 100755
new mode 100644
index b9c3815..10e2068
--- a/chapter11/src/main/resources/static/assets/js/jqGrid/jquery.jqGrid.min.js
+++ b/chapter11/src/main/resources/static/assets/js/jqGrid/jquery.jqGrid.min.js
@@ -1,561 +1,561 @@
-/*
-* jqGrid 4.5.2 - jQuery Grid
-* Copyright (c) 2008, Tony Tomov, tony@trirand.com
-* Dual licensed under the MIT and GPL licenses
-* http://www.opensource.org/licenses/mit-license.php
-* http://www.gnu.org/licenses/gpl-2.0.html
-* Date:2013-05-21
-* Modules: grid.base.js; jquery.fmatter.js; grid.custom.js; grid.common.js; grid.formedit.js; grid.filter.js; grid.inlinedit.js; grid.celledit.js; jqModal.js; jqDnR.js; grid.subgrid.js; grid.grouping.js; grid.treegrid.js; grid.import.js; JsonXml.js; grid.tbltogrid.js; grid.jqueryui.js;
-*/
-
-(function(b){b.jgrid=b.jgrid||{};b.extend(b.jgrid,{version:"4.5.2",htmlDecode:function(b){return b&&(" "===b||" "===b||1===b.length&&160===b.charCodeAt(0))?"":!b?b:(""+b).replace(/>/g,">").replace(/</g,"<").replace(/"/g,'"').replace(/&/g,"&")},htmlEncode:function(b){return!b?b:(""+b).replace(/&/g,"&").replace(/\"/g,""").replace(//g,">")},format:function(d){var f=b.makeArray(arguments).slice(1);null==d&&(d="");return d.replace(/\{(\d+)\}/g,
-function(b,e){return f[e]})},msie:"Microsoft Internet Explorer"===navigator.appName,msiever:function(){var b=-1;null!=/MSIE ([0-9]{1,}[.0-9]{0,})/.exec(navigator.userAgent)&&(b=parseFloat(RegExp.$1));return b},getCellIndex:function(d){d=b(d);if(d.is("tr"))return-1;d=(!d.is("td")&&!d.is("th")?d.closest("td,th"):d)[0];return b.jgrid.msie?b.inArray(d,d.parentNode.cells):d.cellIndex},stripHtml:function(b){var b=""+b,f=/<("[^"]*"|'[^']*'|[^'">])*>/gi;return b?(b=b.replace(f,""))&&" "!==b&&" "!==
-b?b.replace(/\"/g,"'"):"":b},stripPref:function(d,f){var c=b.type(d);if("string"===c||"number"===c)d=""+d,f=""!==d?(""+f).replace(""+d,""):f;return f},parse:function(d){"while(1);"===d.substr(0,9)&&(d=d.substr(9));"/*"===d.substr(0,2)&&(d=d.substr(2,d.length-4));d||(d="{}");return!0===b.jgrid.useJSON&&"object"===typeof JSON&&"function"===typeof JSON.parse?JSON.parse(d):eval("("+d+")")},parseDate:function(d,f,c,e){var a=/^\/Date\((([-+])?[0-9]+)(([-+])([0-9]{2})([0-9]{2}))?\)\/$/,j="string"===typeof f?
-f.match(a):null,a=function(a,b){a=""+a;for(b=parseInt(b,10)||2;a.length
j&&(f[i]=j+1,g.m=f[i])),"F"===d[i]&&(j=b.inArray(f[i],e.monthNames,12),-1!==j&&11j&&f[i]===e.AmPm[j]&&
-(f[i]=j,g.h=h(f[i],g.h))),"A"===d[i]&&(j=b.inArray(f[i],e.AmPm),-1!==j&&1=h?g.y=1900+g.y:0<=h&&69>=h&&(g.y=2E3+g.y);h=new Date(g.y,g.m,g.d,g.h,g.i,g.s,g.u)}else h=new Date(g.y,g.m,g.d,g.h,g.i,g.s,g.u);if(void 0===c)return h;e.masks.hasOwnProperty(c)?c=e.masks[c]:
-c||(c="Y-m-d");d=h.getHours();f=h.getMinutes();g=h.getDate();j=h.getMonth()+1;i=h.getTimezoneOffset();k=h.getSeconds();var l=h.getMilliseconds(),o=h.getDay(),n=h.getFullYear(),m=(o+6)%7+1,t=(new Date(n,j-1,g)-new Date(n,0,1))/864E5,A={d:a(g),D:e.dayNames[o],j:g,l:e.dayNames[o+7],N:m,S:e.S(g),w:o,z:t,W:5>m?Math.floor((t+m-1)/7)+1:Math.floor((t+m-1)/7)||(4>((new Date(n-1,0,1)).getDay()+6)%7?53:52),F:e.monthNames[j-1+12],m:a(j),M:e.monthNames[j-1],n:j,t:"?",L:"?",o:"?",Y:n,y:(""+n).substring(2),a:12>
-d?e.AmPm[0]:e.AmPm[1],A:12>d?e.AmPm[2]:e.AmPm[3],B:"?",g:d%12||12,G:d,h:a(d%12||12),H:a(d),i:a(f),s:a(k),u:l,e:"?",I:"?",O:(0?@\[\\\]\^`{|}~]/g,"\\$&")},guid:1,uidPref:"jqg",randId:function(d){return(d||b.jgrid.uidPref)+b.jgrid.guid++},getAccessor:function(b,f){var c,e,a=[],j;if("function"===typeof f)return f(b);c=b[f];if(void 0===c)try{if("string"===typeof f&&(a=f.split(".")),j=a.length)for(c=b;c&&j--;)e=a.shift(),c=c[e]}catch(g){}return c},getXmlData:function(d,f,c){var e="string"===typeof f?f.match(/^(.*)\[(\w+)\]$/):null;if("function"===
-typeof f)return f(d);if(e&&e[2])return e[1]?b(e[1],d).attr(e[2]):b(d).attr(e[2]);d=b(f,d);return c?d:0 "),f=d.appendTo("body").find("td").width();d.remove();return 5!==f},cell_width:!0,ajaxOptions:{},from:function(d){return new function(d,c){"string"===typeof d&&(d=b.data(d));var e=
-this,a=d,j=!0,g=!1,h=c,i=/[\$,%]/g,k=null,l=null,o=0,n=!1,m="",t=[],A=!0;if("object"===typeof d&&d.push)0