diff --git a/module/common/view/datepicker.html.php b/module/common/view/datepicker.html.php
index 02d2d3b5cd..4464ca81cf 100755
--- a/module/common/view/datepicker.html.php
+++ b/module/common/view/datepicker.html.php
@@ -1,55 +1 @@
getExtViewFile(__FILE__)){include $extView; return helper::cd();}?>
-app->getClientLang();
-if($config->debug)
-{
- css::import($jsRoot . 'jquery/datetimepicker/min.css');
- js::import($jsRoot . 'jquery/datetimepicker/min.js');
-}
-?>
-
diff --git a/www/js/my.full.js b/www/js/my.full.js
index 1ed8f07fa5..d753ce8479 100644
--- a/www/js/my.full.js
+++ b/www/js/my.full.js
@@ -911,294 +911,6 @@ function isNum(s)
return false;
}
-/**
- * Set modal load content with ajax or iframe
- *
- * @access public
- * @return void
- */
-function setModal()
-{
- jQuery.fn.modalTrigger = function(setting)
- {
- return $(this).each(function()
- {
- var $this = $(this);
- $this.off('click.modalTrigger.zui');
-
- $this.on('click.modalTrigger.zui', function(event)
- {
- var $e = $(this);
- if($e.closest('.body-modal').length) return;
-
- if($e.hasClass('disabled')) return false;
-
- var url = (setting ? setting.url : false) || $e.attr('href') || $e.data('url');
- var type = (setting ? setting.type : false) || ($e.hasClass('iframe') ? 'iframe' : ($e.data('type') || 'ajax'));
- if(type == 'iframe')
- {
- var options = $.extend(
- {
- url: url,
- title: $e.attr('title') || $e.text(),
- cssClass: $e.data('class'),
- icon: '?',
- center: true
- }, setting, $e.data());
-
- if(options.icon == '?')
- {
- var i = $e.find("[class^='icon-']");
- options.icon = i.length ? i.attr('class').substring(5) : 'file-text';
- }
-
- showIframeModal(options);
- }
- else
- {
- initModalFrame();
- $.get(url, function(data)
- {
- var options = $.extend(
- {
- width: 800,
- title: $e.attr('title') || $e.text(),
- icon: '?',
- backdrop: 'static',
- show: true
- }, setting, $e.data());
-
- var ajaxModal = $('#ajaxModal');
- if(data.indexOf('modal-dialog') < 0)
- {
- data = "
".format($.extend({content: data}, options));
- }
- ajaxModal.html(data);
-
- /* Set the width of modal dialog. */
- if(options.width)
- {
- var modalWidth = parseInt(options.width);
- $ajaxModal.data('width', modalWidth).find('.modal-dialog').css('width', modalWidth);
- ajustModalPosition();
- }
- ajaxModal.modal(options);
- });
- }
-
- /* Save the href to rel attribute thus we can save it. */
- $('#ajaxModal').attr('rel', url);
-
- event.preventDefault();
- return false;
- });
- });
- }
-
- function showIframeModal(settings)
- {
- var options =
- {
- width: 800,
- height: 'auto',
- icon: '?',
- title: '',
- name: 'modalIframe',
- cssClass: '',
- headerless: false,
- waittime: 0,
- center: true,
- backdrop: 'static',
- show: true
- };
-
- if(typeof(settings) == 'string')
- {
- options.url = settings;
- }
- else
- {
- options = $.extend(options, settings);
- }
-
- initModalFrame(options);
-
- if(isNum(options.height.toString())) options.height += 'px';
- if(isNum(options.width.toString())) options.width += 'px';
- if(options.size == 'fullscreen')
- {
- var $w = $(window);
- options.width = $w.width();
- options.height = $w.height();
- options.cssClass += ' fullscreen';
- }
- if(options.headerless)
- {
- options.cssClass += ' hide-header';
- }
- if(typeof(options.url) == 'undefined' || !options.url) return false;
-
- var modal = $('#ajaxModal').addClass('modal-loading').data('first', true);
-
- modal.html("".format(options));
-
- var modalBody = modal.find('.modal-body'), dialog = modal.find('.modal-dialog');
- if(options.cssClass)
- {
- dialog.addClass(options.cssClass);
- }
-
- if(options.waittime > 0)
- {
- options.waitingFuc = setTimeout(function(){showModal(options, modal, modalBody, dialog);}, options.waittime );
- }
-
- var frame = document.getElementById(options.name);
- frame.onload = frame.onreadystatechange = function()
- {
- if(this.readyState && this.readyState != 'complete') return;
- if(modal.data('first') && (!modal.hasClass('modal-loading'))) return;
- if(!modal.data('first')) modal.addClass('modal-loading');
-
- if(options.waittime > 0)
- {
- clearTimeout(options.waitingFuc);
- }
- showModal(options, modal, modalBody, dialog);
- }
- modal.modal(options);
- }
-
- function showModal(options, modal, modalBody, dialog)
- {
- modalBody.css('height', options.height - modal.find('.modal-header').outerHeight());
- try
- {
- var frame$ = window.frames[options.name].$;
- frame$(function()
- {
- if(frame$('#titlebar').length || frame$('.main-header').length || frame$('.modal-header').length || frame$('#mainMenu').length)
- {
- modal.addClass('with-titlebar');
- if(options.size == 'fullscreen')
- {
- modalBody.css('height', options.height);
- }
- }
-
- if(options.height == 'auto')
- {
- var $framebody = frame$('body');
- setTimeout(function()
- {
- modal.removeClass('fade');
- var fbH = $framebody.addClass('body-modal').outerHeight();
- frame$('#titlebar > .heading a').each(function()
- {
- var $a = frame$(this);
- $a.replaceWith("" + $a.text() + "");
- });
- if(typeof fbH == 'object') fbH = $framebody.height();
- modalBody.css('height', fbH);
- ajustModalPosition();
- if(modal.data('first')) modal.data('first', false);
- modal.removeClass('modal-loading').addClass('fade');
- }, 100);
-
- $framebody.resize(function()
- {
- var fbH = $framebody.outerHeight();
- if(typeof fbH == 'object') fbH = $framebody.height();
- modalBody.css('height', fbH);
- ajustModalPosition();
- });
- }
- else
- {
- modal.removeClass('modal-loading');
- }
- })
-
- if(frame$)
- {
- frame$.extend({'closeModal': $.closeModal});
- }
- }
- catch(e)
- {
- modal.removeClass('modal-loading');
- }
- }
-
- function initModalFrame(setting)
- {
- if($('#ajaxModal').length)
- {
- /* unbind all events */
- $('#ajaxModal').attr('class', 'modal fade').off('show.zui.modal shown.zui.modal hide.zui.modal hidden.zui.modal');
- }
- else
- {
- /* Addpend modal div. */
- $('').appendTo('body');
- }
-
- $ajaxModal = $('#ajaxModal');
- $ajaxModal.data('cancel-reload', false);
-
- $.extend({'closeModal':function(callback, location)
- {
- $ajaxModal.on('hidden.zui.modal', function()
- {
- if(location && (!$ajaxModal.data('cancel-reload')))
- {
- if(location == 'this') window.location.reload();
- else window.location = location;
- }
- if(callback && $.isFunction(callback)) callback();
- });
- $ajaxModal.modal('hide');
- }, 'cancelReloadCloseModal': function(){$ajaxModal.data('cancel-reload', true);}});
-
- /* rebind events */
- if(!setting) return;
- if(setting.afterShow && $.isFunction(setting.afterShow)) $ajaxModal.on('show.zui.modal', setting.afterShow);
- if(setting.afterShown && $.isFunction(setting.afterShown)) $ajaxModal.on('shown.zui.modal', setting.afterShown);
- if(setting.afterHide && $.isFunction(setting.afterHide)) $ajaxModal.on('hide.zui.modal', setting.afterHide);
- if(setting.afterHidden && $.isFunction(setting.afterHidden)) $ajaxModal.on('hidden.zui.modal', setting.afterHidden);
- }
-
- function ajustModalPosition(position, dialog)
- {
- position = position || 'fit';
- if(!dialog) dialog = $('#ajaxModal .modal-dialog');
- if(position)
- {
- var half = Math.max(0, ($(window).height() - dialog.outerHeight())/2);
- var pos = position == 'fit' ? (half*2/3) : (position == 'center' ? half : position);
- dialog.css('margin-top', pos);
- }
- }
-
- $.extend({ajustModalPosition: ajustModalPosition, modalTrigger: showIframeModal, colorbox: function(setting)
- {
- if((typeof setting == 'object') && setting.iframe)
- {
- $.modalTrigger({type: 'iframe', width: setting['width'], afterHide: setting['onCleanup'], url: setting['href']});
- }
- }});
-
- $('[data-toggle=modal], a.iframe').modalTrigger();
-
- jQuery.fn.colorbox = function(setting)
- {
- if((typeof setting == 'object') && setting.iframe)
- {
- $(this).modalTrigger({type: 'iframe', width: setting['width'], afterHide: setting['onCleanup'], url: setting['href']});
- }
- }
-}
-
/**
* Set modal for list page.
*
@@ -1962,7 +1674,6 @@ $(document).ready(function()
if(typeof(config.onlybody) != 'undefined' && config.onlybody == 'yes') checkOnlybodyPage();
$('body').addClass('m-{currentModule}-{currentMethod}'.format(config));
- setModal();
setTableBehavior();
setForm();
saveWindowSize();
diff --git a/www/js/zui/min.js b/www/js/zui/min.js
index 58d81c178f..5c02b3ce22 100644
--- a/www/js/zui/min.js
+++ b/www/js/zui/min.js
@@ -1,5 +1,5 @@
/*!
- * ZUI: Zentao template - v1.8.1 - 2018-05-04
+ * ZUI: Zentao template - v1.8.1 - 2018-05-08
* http://zui.sexy
* GitHub: https://github.com/easysoft/zui.git
* Copyright (c) 2018 cnezsoft.com; Licensed MIT
@@ -63,4 +63,4 @@ function(){var t,e,i,s,n,a={}.hasOwnProperty,o=function(t,e){function i(){this.c
* Lesser General Public License for more details.
*/
!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof module&&module.exports?module.exports=function(e,i){return void 0===i&&(i="undefined"!=typeof window?require("jquery"):require("jquery")(e)),t(i),i}:t(jQuery)}(function(t){"use strict";function e(e){var i=e.data;e.isDefaultPrevented()||(e.preventDefault(),t(e.target).closest("form").ajaxSubmit(i))}function i(e){var i=e.target,s=t(i);if(!s.is("[type=submit],[type=image]")){var n=s.closest("[type=submit]");if(0===n.length)return;i=n[0]}var a=i.form;if(a.clk=i,"image"===i.type)if(void 0!==e.offsetX)a.clk_x=e.offsetX,a.clk_y=e.offsetY;else if("function"==typeof t.fn.offset){var o=s.offset();a.clk_x=e.pageX-o.left,a.clk_y=e.pageY-o.top}else a.clk_x=e.pageX-i.offsetLeft,a.clk_y=e.pageY-i.offsetTop;setTimeout(function(){a.clk=a.clk_x=a.clk_y=null},100)}function s(){if(t.fn.ajaxSubmit.debug){var e="[jquery.form] "+Array.prototype.join.call(arguments,"");window.console&&window.console.log?window.console.log(e):window.opera&&window.opera.postError&&window.opera.postError(e)}}var n=/\r?\n/g,a={};a.fileapi=void 0!==t('').get(0).files,a.formdata=void 0!==window.FormData;var o=!!t.fn.prop;t.fn.attr2=function(){if(!o)return this.attr.apply(this,arguments);var t=this.prop.apply(this,arguments);return t&&t.jquery||"string"==typeof t?t:this.attr.apply(this,arguments)},t.fn.ajaxSubmit=function(e,i,n,r){function l(i){var s,n,a=t.param(i,e.traditional).split("&"),o=a.length,r=[];for(s=0;s',T).val(d.extraData[l].value).appendTo(C)[0]):o.push(h('',T).val(d.extraData[l]).appendTo(C)[0]));d.iframeTarget||g.appendTo(S),m.attachEvent?m.attachEvent("onload",r):m.addEventListener("load",r,!1),setTimeout(t,15);try{C.submit()}catch(h){document.createElement("form").submit.apply(C)}}finally{C.setAttribute("action",i),C.setAttribute("enctype",a),e?C.setAttribute("target",e):p.removeAttr("target"),h(o).remove()}}function r(t){if(!y.aborted&&!$){if((L=n(m))||(s("cannot access response document"),t=M),t===D&&y)return y.abort("timeout"),void k.reject(y,"timeout");if(t===M&&y)return y.abort("server abort"),void k.reject(y,"error","server abort");if(L&&L.location.href!==d.iframeSrc||x){m.detachEvent?m.detachEvent("onload",r):m.removeEventListener("load",r,!1);var e,i="success";try{if(x)throw"timeout";var a="xml"===d.dataType||L.XMLDocument||v.isXMLDoc(L);if(s("isXml="+a),!a&&window.opera&&(null===L.body||!L.body.innerHTML)&&--E)return s("requeing onLoad callback, DOM not available"),void setTimeout(r,250);var o=L.body?L.body:L.documentElement;y.responseText=o?o.innerHTML:null,y.responseXML=L.XMLDocument?L.XMLDocument:L,a&&(d.dataType="xml"),y.getResponseHeader=function(t){return{"content-type":d.dataType}[t.toLowerCase()]},o&&(y.status=Number(o.getAttribute("status"))||y.status,y.statusText=o.getAttribute("statusText")||y.statusText);var l=(d.dataType||"").toLowerCase(),h=/(json|script|text)/.test(l);if(h||d.textarea){var c=L.getElementsByTagName("textarea")[0];if(c)y.responseText=c.value,y.status=Number(c.getAttribute("status"))||y.status,y.statusText=c.getAttribute("statusText")||y.statusText;else if(h){var p=L.getElementsByTagName("pre")[0],f=L.getElementsByTagName("body")[0];p?y.responseText=p.textContent?p.textContent:p.innerText:f&&(y.responseText=f.textContent?f.textContent:f.innerText)}}else"xml"===l&&!y.responseXML&&y.responseText&&(y.responseXML=I(y.responseText));try{z=U(y,l,d)}catch(v){i="parsererror",y.error=e=v||i}}catch(v){s("error caught: ",v),i="error",y.error=e=v||i}y.aborted&&(s("upload aborted"),i=null),y.status&&(i=y.status>=200&&y.status<300||304===y.status?"success":"error"),"success"===i?(d.success&&d.success.call(d.context,z,"success",y),k.resolve(y.responseText,"success",y),u&&v.event.trigger("ajaxSuccess",[y,d])):i&&(void 0===e&&(e=y.statusText),d.error&&d.error.call(d.context,y,i,e),k.reject(y,"error",e),u&&v.event.trigger("ajaxError",[y,d,e])),u&&v.event.trigger("ajaxComplete",[y,d]),u&&!--v.active&&v.event.trigger("ajaxStop"),d.complete&&d.complete.call(d.context,y,i),$=!0,d.timeout&&clearTimeout(_),setTimeout(function(){d.iframeTarget?g.attr("src",d.iframeSrc):g.remove(),y.responseXML=null},100)}}}var l,h,d,u,f,g,m,y,b,w,x,_,C=p[0],k=t.Deferred();if(k.abort=function(t){y.abort(t)},i)for(h=0;h',T)).css({position:"absolute",top:"-1000px",left:"-1000px"}),m=g[0],y={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(t){var e="timeout"===t?"timeout":"aborted";s("aborting upload... "+e),this.aborted=1;try{m.contentWindow.document.execCommand&&m.contentWindow.document.execCommand("Stop")}catch(i){}g.attr("src",d.iframeSrc),y.error=e,d.error&&d.error.call(d.context,y,e,t),u&&i.event.trigger("ajaxError",[y,d,e]),d.complete&&d.complete.call(d.context,y,e)}},(u=d.global)&&0==t.active++&&t.event.trigger("ajaxStart"),u&&t.event.trigger("ajaxSend",[y,d]),d.beforeSend&&!1===d.beforeSend.call(d.context,y,d))return d.global&&t.active--,k.reject(),k;if(y.aborted)return k.reject(),k;(b=C.clk)&&(w=b.name)&&!b.disabled&&(d.extraData=d.extraData||{},d.extraData[w]=b.value,"image"===b.type&&(d.extraData[w+".x"]=C.clk_x,d.extraData[w+".y"]=C.clk_y));var D=1,M=2,P=t("meta[name=csrf-token]").attr("content"),F=t("meta[name=csrf-param]").attr("content");F&&P&&(d.extraData=d.extraData||{},d.extraData[F]=P),d.forceSync?a():setTimeout(a,10);var z,L,$,E=50,I=t.parseXML||function(t,e){return window.ActiveXObject?((e=new ActiveXObject("Microsoft.XMLDOM")).async="false",e.loadXML(t)):e=(new DOMParser).parseFromString(t,"text/xml"),e&&e.documentElement&&"parsererror"!==e.documentElement.nodeName?e:null},A=t.parseJSON||function(t){return window.eval("("+t+")")},U=function(e,i,s){var n=e.getResponseHeader("content-type")||"",a=("xml"===i||!i)&&n.indexOf("xml")>=0,o=a?e.responseXML:e.responseText;return a&&"parsererror"===o.documentElement.nodeName&&t.error&&t.error("parsererror"),s&&s.dataFilter&&(o=s.dataFilter(o,i)),"string"==typeof o&&(("json"===i||!i)&&n.indexOf("json")>=0?o=A(o):("script"===i||!i)&&n.indexOf("javascript")>=0&&t.globalEval(o)),o};return k}if(!this.length)return s("ajaxSubmit: skipping submit process - no element selected"),this;var c,d,u,p=this;"function"==typeof e?e={success:e}:"string"==typeof e||!1===e&&arguments.length>0?(e={url:e,data:i,dataType:n},"function"==typeof r&&(e.success=r)):void 0===e&&(e={}),c=e.method||e.type||this.attr2("method"),(u=(u="string"==typeof(d=e.url||this.attr2("action"))?t.trim(d):"")||window.location.href||"")&&(u=(u.match(/^([^#]+)/)||[])[1]),e=t.extend(!0,{url:u,success:t.ajaxSettings.success,type:c||t.ajaxSettings.type,iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},e);var f={};if(this.trigger("form-pre-serialize",[this,e,f]),f.veto)return s("ajaxSubmit: submit vetoed via form-pre-serialize trigger"),this;if(e.beforeSerialize&&!1===e.beforeSerialize(this,e))return s("ajaxSubmit: submit aborted via beforeSerialize callback"),this;var g=e.traditional;void 0===g&&(g=t.ajaxSettings.traditional);var m,v=[],y=this.formToArray(e.semantic,v,e.filtering);if(e.data){var b=t.isFunction(e.data)?e.data(y):e.data;e.extraData=b,m=t.param(b,g)}if(e.beforeSubmit&&!1===e.beforeSubmit(y,this,e))return s("ajaxSubmit: submit aborted via beforeSubmit callback"),this;if(this.trigger("form-submit-validate",[y,this,e,f]),f.veto)return s("ajaxSubmit: submit vetoed via form-submit-validate trigger"),this;var w=t.param(y,g);m&&(w=w?w+"&"+m:m),"GET"===e.type.toUpperCase()?(e.url+=(e.url.indexOf("?")>=0?"&":"?")+w,e.data=null):e.data=w;var x=[];if(e.resetForm&&x.push(function(){p.resetForm()}),e.clearForm&&x.push(function(){p.clearForm(e.includeHidden)}),!e.dataType&&e.target){var _=e.success||function(){};x.push(function(i,s,n){var a=arguments,o=e.replaceTarget?"replaceWith":"html";t(e.target)[o](i).each(function(){_.apply(this,a)})})}else e.success&&(t.isArray(e.success)?t.merge(x,e.success):x.push(e.success));if(e.success=function(t,i,s){for(var n=e.context||this,a=0,o=x.length;a0,S="multipart/form-data",D=p.attr("enctype")===S||p.attr("encoding")===S,M=a.fileapi&&a.formdata;s("fileAPI :"+M);var P,F=(T||D)&&!M;!1!==e.iframe&&(e.iframe||F)?e.closeKeepAlive?t.get(e.closeKeepAlive,function(){P=h(y)}):P=h(y):P=(T||D)&&M?function(i){for(var s=new FormData,n=0;n0)&&(n={url:n,data:a,dataType:o},"function"==typeof r&&(n.success=r)),n=n||{},n.delegation=n.delegation&&t.isFunction(t.fn.on),!n.delegation&&0===this.length){var l={s:this.selector,c:this.context};return!t.isReady&&l.s?(s("DOM not ready, queuing ajaxForm"),t(function(){t(l.s,l.c).ajaxForm(n)}),this):(s("terminating; zero elements found by selector"+(t.isReady?"":" (DOM not ready)")),this)}return n.delegation?(t(document).off("submit.form-plugin",this.selector,e).off("click.form-plugin",this.selector,i).on("submit.form-plugin",this.selector,n,e).on("click.form-plugin",this.selector,n,i),this):this.ajaxFormUnbind().on("submit.form-plugin",n,e).on("click.form-plugin",n,i)},t.fn.ajaxFormUnbind=function(){return this.off("submit.form-plugin click.form-plugin")},t.fn.formToArray=function(e,i,s){var n=[];if(0===this.length)return n;var o,r=this[0],l=this.attr("id"),h=e||void 0===r.elements?r.getElementsByTagName("*"):r.elements;if(h&&(h=t.makeArray(h)),l&&(e||/(Edge|Trident)\//.test(navigator.userAgent))&&(o=t(':input[form="'+l+'"]').get()).length&&(h=(h||[]).concat(o)),!h||!h.length)return n;t.isFunction(s)&&(h=t.map(h,s));var c,d,u,p,f,g,m;for(c=0,g=h.length;c'},add:{template:''},edit:{template:''},"delete":{template:''}};a.DEFAULTS={animate:null,initialState:"normal",toggleTemplate:''},a.prototype.add=function(e,i,s,n,a){var o,r=t(e),l=this.options;if(r.is("li")?(o=r.children("ul"),o.length||(o=t(""),r.append(o),this._initList(o,r))):o=r,o){var h=this;t.isArray(i)||(i=[i]),t.each(i,function(e,i){var s=t("").data(i).appendTo(o);void 0!==i.id&&s.attr("data-id",i.id);var n=l.itemWrapper?t(l.itemWrapper===!0?'':l.itemWrapper).appendTo(s):s;if(i.html)n.html(i.html);else if(t.isFunction(h.options.itemCreator)){var a=h.options.itemCreator(s,i);a!==!0&&a!==!1&&n.html(a)}else i.url?n.append(t("",{href:i.url}).text(i.title||i.name)):n.append(t("").text(i.title||i.name));h._initItem(s,i.idx||e,o,i),i.children&&i.children.length&&h.add(s,i.children)}),this._initList(o),s&&!o.hasClass("tree")&&h.expand(o.parent("li"),n,a)}},a.prototype.reload=function(e){var i=this;e&&(i.$.empty(),i.add(i.$,e)),i.isPreserve&&i.store.time&&i.$.find("li:not(.tree-action-item)").each(function(){var e=t(this);i[i.store[e.data("id")]?"expand":"collapse"](e,!0,!0)})},a.prototype._initList=function(s,n,a,o){var r=this;s.hasClass("tree")?(a=0,n=null):(n=(n||s.closest("li")).addClass("has-list"),n.find(".list-toggle").length||n.prepend(this.options.toggleTemplate),a=a||n.data("idx"));var l=s.attr("data-idx",a||0).children("li:not(.tree-action-item)").each(function(e){r._initItem(t(this),e+1,s)});1!==l.length||l.find("ul").length||l.addClass("tree-single-item"),o=o||(n?n.data():null);var h=e(o?o.actions:null,this.actions);if(h){if(h.add&&h.add.templateInList!==!1){var c=s.children("li.tree-action-item");c.length?c.detach().appendTo(s):t('').append(i(h.add,"add",h.add.templateInList)).appendTo(s)}h.sort&&s.sortable(t.extend({dragCssClass:"tree-drag-holder",trigger:".sort-handler",selector:"li:not(.tree-action-item)",finish:function(t){r.callEvent("action",{action:h.sort,$list:s,target:t.target,item:o})}},h.sort.options,t.isPlainObject(this.options.sortable)?this.options.sortable:null))}n&&(n.hasClass("open")||o&&o.open)&&n.addClass("open in")},a.prototype._initItem=function(s,n,a,o){if(void 0===n){var r=s.prev("li");n=r.length?r.data("idx")+1:1}if(a=a||s.closest("ul"),s.attr("data-idx",n).removeClass("tree-single-item"),!s.data("id")){var l=n;a.hasClass("tree")||(l=a.parent("li").data("id")+"-"+l),s.attr("data-id",l)}o=o||s.data();var h=e(o.actions,this.actions);if(h){var c=s.find(".tree-actions");c.length||(c=t('').appendTo(this.options.itemWrapper?s.find(".tree-item-wrapper"):s),t.each(h,function(t,e){e&&c.append(i(e,t))}))}var d=s.children("ul");d.length&&this._initList(d,s,n,o)},a.prototype._init=function(){var i=this.options,a=this;this.actions=e(i.actions),this.$.addClass("tree"),i.animate&&this.$.addClass("tree-animate"),this._initList(this.$);var o=i.initialState,r=t.zui&&t.zui.store&&t.zui.store.enable;r&&(this.selector=s+"::"+(i.name||"")+"#"+(this.$.attr("id")||n++),this.store=t.zui.store[i.name?"get":"pageGet"](this.selector,{})),"preserve"===o&&(r?this.isPreserve=!0:this.options.initialState=o="normal"),this.reload(i.data),r&&(this.isPreserve=!0),"expand"===o?this.expand():"collapse"===o&&this.collapse(),this.$.on("click",'.list-toggle,a[href="#"],.tree-toggle',function(e){var i=t(this),s=i.parent("li");a.callEvent("hit",{target:s,item:s.data()}),a.toggle(s),i.is("a")&&e.preventDefault()}).on("click",".tree-action",function(){var e=t(this),i=e.data();if(i.action&&(i=i.action),"sort"!==i.type){var s=e.closest("li:not(.tree-action-item)");a.callEvent("action",{action:i,target:this,$item:s,item:s.data()})}})},a.prototype.preserve=function(e,i,s){if(this.isPreserve)if(e)i=i||e.data("id"),s=void 0===s&&e.hasClass("open"),s?this.store[i]=s:delete this.store[i],this.store.time=(new Date).getTime(),t.zui.store[this.options.name?"set":"pageSet"](this.selector,this.store);else{var n=this;this.store={},this.$.find("li").each(function(){n.preserve(t(this))})}},a.prototype.expand=function(t,e,i){t?(t.addClass("open"),!e&&this.options.animate?setTimeout(function(){t.addClass("in")},10):t.addClass("in")):t=this.$.find("li.has-list").addClass("open in"),i||this.preserve(t),this.callEvent("expand",t,this)},a.prototype.show=function(e,i,s){var n=this;e.each(function(){var e=t(this);if(n.expand(e,i,s),e)for(var a=e.parent("ul");a&&a.length&&!a.hasClass("tree");){var o=a.parent("li");o.length?(n.expand(o,i,s),a=o.parent("ul")):a=!1}})},a.prototype.collapse=function(t,e,i){t?!e&&this.options.animate?(t.removeClass("in"),setTimeout(function(){t.removeClass("open")},300)):t.removeClass("open in"):t=this.$.find("li.has-list").removeClass("open in"),i||this.preserve(t),this.callEvent("collapse",t,this)},a.prototype.toggle=function(t){var e=t&&t.hasClass("open")||t===!1||void 0===t&&this.$.find("li.has-list.open").length;this[e?"collapse":"expand"](t)},a.prototype.getOptions=function(e){this.options=t.extend({},a.DEFAULTS,this.$.data(),e),null===this.options.animate&&this.$.hasClass("tree-animate")&&(this.options.animate=!0)},a.prototype.toData=function(e,i){t.isFunction(e)&&(i=e,e=null),e=e||this.$;var s=this;return e.children("li:not(.tree-action-item)").map(function(){var e=t(this),n=e.data();delete n["zui.droppable"];var a=e.children("ul");return a.length&&(n.children=s.toData(a)),t.isFunction(i)?i(n,e):n}).get()},a.prototype.callEvent=function(e,i){var s;return t.isFunction(this.options[e])&&(s=this.options[e](i,this)),this.$.trigger(t.Event(e+"."+this.name,i)),s},t.fn.tree=function(e,i){return this.each(function(){var n=t(this),o=n.data(s),r="object"==typeof e&&e;o||n.data(s,o=new a(this,r)),"string"==typeof e&&o[e](i)})},t.fn.tree.Constructor=a,t(function(){t('[data-ride="tree"]').tree()})}(jQuery),function(t){"use strict";var e="zui.colorPicker",i='',s={zh_cn:{errorTip:"不是有效的颜色值"},zh_tw:{errorTip:"不是有效的顏色值"},en:{errorTip:"Not a valid color value"}},n=function(i,s){this.name=e,this.$=t(i),this.getOptions(s),this.init()};n.DEFAULTS={colors:["#00BCD4","#388E3C","#3280fc","#3F51B5","#9C27B0","#795548","#F57C00","#F44336","#E91E63"],pullMenuRight:!0,wrapper:"btn-wrapper",tileSize:30,lineCount:5,optional:!0,tooltip:"top",icon:"caret-down",updateBtn:"auto"},n.prototype.init=function(){var e=this,s=e.options,n=e.$,a=n.parent(),o=!1;a.hasClass("colorpicker")?e.$picker=a:(e.$picker=t(s.template||i),o=!0),e.$picker.addClass(s.wrapper).find(".cp-title").toggle(void 0!==s.title).text(s.title),e.$menu=e.$picker.find(".dropdown-menu").toggleClass("pull-right",s.pullMenuRight),e.$btn=e.$picker.find(".btn.dropdown-toggle"),e.$btn.find(".ic").addClass("icon-"+s.icon),s.btnTip&&e.$picker.attr("data-toggle","tooltip").tooltip({title:s.btnTip,placement:s.tooltip,container:"body"}),n.attr("data-provide",null),o&&n.after(e.$picker),e.colors={},t.each(s.colors,function(i,s){if(t.zui.Color.isColor(s)){var n=new t.zui.Color(s);e.colors[n.toCssStr()]=n}}),e.updateColors(),e.$picker.on("click",".cp-tile",function(){e.setValue(t(this).data("color"))});var r=function(){var i=n.val(),a=t.zui.Color.isColor(i);n.parent().toggleClass("has-error",!(a||s.optional&&""===i)),a?e.setValue(i,!0):s.optional&&""===i?n.tooltip("hide"):n.is(":focus")||n.tooltip("show",s.errorTip)};n.is("input:not([type=hidden])")?(s.tooltip&&n.attr("data-toggle","tooltip").tooltip({trigger:"manual",placement:s.tooltip,tipClass:"tooltip-danger",container:"body"}),n.on("keyup paste input change",r)):n.appendTo(e.$picker),r()},n.prototype.addColor=function(e){e instanceof t.zui.Color||(e=new t.zui.Color(e));var i=e.toCssStr(),s=this.options;this.colors[i]||(this.colors[i]=e);var n=t('',{titile:e}).data("color",e).css({color:e.contrast().toCssStr(),background:i,"border-color":e.luma()>.43?"#ccc":"transparent"}).attr("data-color",i);this.$menu.append(t("").css({width:s.tileSize,height:s.tileSize}).append(n)),s.optional&&this.$menu.find(".cp-tile.empty").parent().detach().appendTo(this.$menu)},n.prototype.updateColors=function(e){var i=(this.$picker,this.$menu.children("li:not(.heading)").remove()),s=this.options,e=e||this.colors,n=this,a=0;if(t.each(e,function(t,e){n.addColor(e),a++}),s.optional){var o=t('').css({width:s.tileSize,height:s.tileSize});this.$menu.append(o),a++}i.css("width",Math.min(a,s.lineCount)*s.tileSize+6)},n.prototype.setValue=function(e,i){var s=this,n=s.options,a=s.$btn;s.$menu.find(".cp-tile.active").removeClass("active");var o="",r=n.updateBtn;if("auto"===r){var l=a.find(".color-bar");r=!l.length||function(t){l.css("background",t||"")}}if(e){var h=new t.zui.Color(e);o=h.toCssStr().toLowerCase(),r&&(t.isFunction(r)?r(o,a,s):a.css({background:o,color:h.contrast().toCssStr(),borderColor:h.luma()>.43?"#ccc":o})),s.colors[o]||s.addColor(h),i||s.$.val().toLowerCase()===o||s.$.val(o).trigger("change"),s.$menu.find('.cp-tile[data-color="'+o+'"]').addClass("active"),s.$.tooltip("hide"),s.$.trigger("colorchange",h)}else r&&(t.isFunction(r)?r(null,a,s):a.attr("style",null)),i||""===s.$.val()||s.$.val(o).trigger("change"),n.optional&&s.$.tooltip("hide"),s.$menu.find(".cp-tile.empty").addClass("active"),s.$.trigger("colorchange",null);n.updateBorder&&t(n.updateBorder).css("border-color",o),n.updateBackground&&t(n.updateBackground).css("background-color",o),n.updateColor&&t(n.updateColor).css("color",o),n.updateText&&t(n.updateText).text(o)},n.prototype.getOptions=function(e){var i=t.extend({},n.DEFAULTS,this.$.data(),e);"string"==typeof i.colors&&(i.colors=i.colors.split(","));var a=(i.lang||t.zui.clientLang()).toLowerCase();i.errorTip||(i.errorTip=s[a].errorTip),t.fn.tooltip||(i.btnTip=!1),this.options=i},t.fn.colorPicker=function(i){return this.each(function(){var s=t(this),a=s.data(e),o="object"==typeof i&&i;a||s.data(e,a=new n(this,o)),"string"==typeof i&&a[i]()})},t.fn.colorPicker.Constructor=n,t(function(){t('[data-provide="colorpicker"]').colorPicker()})}(jQuery),function(t,e){function i(t){return t===e&&(t=s+=1),n[t%n.length]}var s=0,n=["#00a9fc","#ff5d5d","#fdc137","#00da88","#7ec5ff","#8666b8","#bd7b46","#ff9100","#ff3d00","#f57f17","#00e5ff","#00b0ff","#2979ff","#3d5afe","#651fff","#d500f9","#f50057","#ff1744"];jQuery.fn.tableChart=function(){t(this).each(function(){var e=t(this),s=e.data(),n=s.chart||"pie",a=t(s.target);if(a.length){var o=null;if("pie"===n){s=t.extend({scaleShowLabels:!0,scaleLabel:"<%=label%>: <%=value%>"},s);var r=[],l=e.find("tbody > tr").each(function(e){var s=t(this),n=i();s.attr("data-id",e).find(".chart-color-dot").css("background",n),r.push({label:s.find(".chart-label").text(),value:parseInt(s.find(".chart-value").text()),color:n,id:e})});r.length>1?s.scaleLabelPlacement="outside":1===r.length&&(s.scaleLabelPlacement="inside",r.push({label:"",value:r[0].value/2e3,color:"#fff",showLabel:!1})),o=a.pieChart(r,s),a.on("mousemove",function(t){var e=o.getSegmentsAtEvent(t);l.removeClass("active"),e.length&&l.filter('[data-id="'+e[0].id+'"]').addClass("active")})}else if("bar"===n){var h=i(),c=[],d={label:e.find("thead .chart-label").text(),color:h,data:[]},l=e.find("tbody > tr").each(function(e){var i=t(this);c.push(i.find(".chart-label").text()),d.data.push(parseInt(i.find(".chart-value").text())),i.find(".chart-color-dot").css("background",h)}),r={labels:c,datasets:[d]};c.length&&(s.barValueSpacing=5),o=a.barChart(r,s)}else if("line"===n){var h=i(),c=[],d={label:e.find("thead .chart-label").text(),color:h,data:[]},l=e.find("tbody > tr").each(function(e){var i=t(this);c.push(i.find(".chart-label").text()),d.data.push(parseInt(i.find(".chart-value").text())),i.find(".chart-color-dot").css("background",h)}),r={labels:c,datasets:[d]};c.length&&(s.barValueSpacing=5),o=a.lineChart(r,s)}null!==o&&e.data("zui.chart",o)}})};var a=function(i,s){var n=t(i),a=n.is("canvas")?n:n.find("canvas"),o=t.extend({value:0,color:"#006af1",backColor:"#E9F2FB",doughnut:!0,doughnutSize:85,width:20,height:20,showTip:!1,name:"",tipTemplate:"<%=value%>%",animation:"auto",realValue:parseFloat(n.find(".progress-value").text())},s,n.data()),r=a.length;r||(a=t("