From ea74787b8709e0d3e4b66ca4f3a8fd1c49593910 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 9 Feb 2018 11:01:02 +0800 Subject: [PATCH] * change todo to calendar. --- module/block/css/dashboard.css | 67 - module/common/lang/en.php | 2 +- module/common/lang/menuOrder.php | 2 +- module/common/lang/zh-cn.php | 2 +- module/my/control.php | 5 + module/my/view/index.html.php | 3 +- www/js/zui/min.js | 10927 +---------------------------- www/theme/default/style.css | 1 - www/theme/zui/css/min.css | 8108 +-------------------- 9 files changed, 19 insertions(+), 19098 deletions(-) diff --git a/module/block/css/dashboard.css b/module/block/css/dashboard.css index 9969a13dca..e69de29bb2 100644 --- a/module/block/css/dashboard.css +++ b/module/block/css/dashboard.css @@ -1,67 +0,0 @@ -body {background: #fafafa;} - -.page-content {margin-top: -19px; border-top: 1px solid #3280fc;} - -#wrap .outer {background-color: #fafafa;} -#wrap .outer > .dashboard {margin-left: -10px; margin-right: -10px;} - -/* panel style */ -.panel-block .table th {background-color: #fafafa} -.panel-primary {border-color: transparent;!important;} -.panel-success > .panel-heading, -.panel-warning > .panel-heading, -.panel-primary > .panel-heading, -.panel-info > .panel-heading, -.panel-danger > .panel-heading {color: #333; border: none; border-bottom: 1px solid rgba(0,0,0,.04);} -.panel-success, .panel-success .table-header-fixed th {background: #d1fecb!important; border-color: #b0e4ac!important} -.panel-success > .panel-heading {background: #c5f7c1!important; } -.panel-warning, .panel-warning .table-header-fixed th {background: #fdfdc7!important; border-color: #e1e09a!important} -.panel-warning > .panel-heading {background: #f8f7b6!important;} -.panel-primary, .panel-primary .table-header-fixed th {background: #d8f2fa!important; border-color: #badfeb!important} -.panel-primary > .panel-heading {background: #c9ecf8!important; color: #333!important; border:none!important;} -.panel-info, .panel-info .table-header-fixed th {background: #dcd8fe!important; border-color: #d0c9ee!important} -.panel-info > .panel-heading {background: #d4cdf3!important;} -.panel-danger, .panel-danger .table-header-fixed th {background: #f5d0f5!important; border-color: #e9b9e9!important} -.panel-danger > .panel-heading {background: #f1c3f1!important;} -.panel-success .table td, .panel-success .table th, -.panel-warning .table td, .panel-warning .table th, -.panel-primary .table td, .panel-primary .table th, -.panel-info .table td, .panel-info .table th, -.panel-danger .table td, .panel-danger .table th {border: none; background-color: transparent} -.panel-success .table tr:nth-child(even) > td, .panel-success .table th, -.panel-warning .table tr:nth-child(even) > td, .panel-warning .table th, -.panel-primary .table tr:nth-child(even) > td, .panel-primary .table th, -.panel-info .table tr:nth-child(even) > td, .panel-info .table th, -.panel-danger .table tr:nth-child(even) > td, .panel-danger .table th {background: rgba(255,255,255,.25);} -.panel-success .table tr:nth-child(odd) > td, -.panel-warning .table tr:nth-child(odd) > td, -.panel-primary .table tr:nth-child(odd) > td, -.panel-info .table tr:nth-child(odd) > td, -.panel-danger .table tr:nth-child(odd) > td {background: rgba(0,0,0,.03);} -.panel-success .table tr:last-child > td, -.panel-warning .table tr:last-child > td, -.panel-primary .table tr:last-child > td, -.panel-info .table tr:last-child > td -.panel-danger .table tr:last-child > td {border-bottom: 1px solid rgba(0,0,0,0.05)} -.panel-success .table tr:hover > th, -.panel-warning .table tr:hover > th, -.panel-primary .table tr:hover > th, -.panel-info .table tr:hover > th, -.panel-danger .table tr:hover > th {background: none;} -.panel-success .table.table-hover tr:hover > td, -.panel-warning .table.table-hover tr:hover > td, -.panel-primary .table.table-hover tr:hover > td, -.panel-info .table.table-hover tr:hover > td, -.panel-danger .table.table-hover tr:hover > td {background: rgba(255,255,255,.4);} - -.block.input-group-btn .btn-success {background: #d1fecb; color: #333; text-shadow: none; border-color: #ccc} -.block.input-group-btn .btn-warning {background: #fdfdc7; color: #333; text-shadow: none; border-color: #ccc} -.block.input-group-btn .btn-info {background: #dcd8fe; color: #333; text-shadow: none; border-color: #ccc} -.block.input-group-btn .btn-danger {background: #f5d0f5; color: #333; text-shadow: none; border-color: #ccc} -.block.input-group-btn .btn-primary, .block.input-group-btn .btn-primary:focus {background: #d8f2fa; color: #333; text-shadow: none; border-color: #ccc} -.block.input-group-btn .btn-success:hover {border-color: #aaa} -.block.input-group-btn .btn-warning:hover {border-color: #aaa} -.block.input-group-btn .btn-primary:hover {border-color: #aaa} -.block.input-group-btn .btn-info:hover {border-color: #aaa} -.block.input-group-btn .btn-danger:hover {border-color: #aaa} -.block.input-group-btn .btn-primary .caret, .block.input-group-btn .btn-success .caret, .block.input-group-btn .btn-warning .caret, .block.input-group-btn .btn-danger .caret, .block.input-group-btn .btn-info .caret {border-top-color: #333} diff --git a/module/common/lang/en.php b/module/common/lang/en.php index 5f37ae76b6..411cd05b58 100644 --- a/module/common/lang/en.php +++ b/module/common/lang/en.php @@ -167,7 +167,7 @@ $lang->my = new stdclass(); $lang->my->menu = new stdclass(); $lang->my->menu->index = 'Home|my|index'; -$lang->my->menu->todo = array('link' => 'Todo|my|todo|', 'subModule' => 'todo'); +$lang->my->menu->calendar = array('link' => 'Calendar|my|calendar|', 'subModule' => 'todo', 'alias' => 'todo'); $lang->my->menu->task = array('link' => 'Task|my|task|', 'subModule' => 'task'); $lang->my->menu->bug = array('link' => 'Bug|my|bug|', 'subModule' => 'bug'); $lang->my->menu->testtask = array('link' => 'Test Task|my|testtask|', 'subModule' => 'testcase,testtask', 'alias' => 'testcase'); diff --git a/module/common/lang/menuOrder.php b/module/common/lang/menuOrder.php index a2561ca4c8..e6edf25c96 100644 --- a/module/common/lang/menuOrder.php +++ b/module/common/lang/menuOrder.php @@ -16,7 +16,7 @@ $lang->index->menuOrder[10] = 'project'; /* my menu order. */ $lang->my->menuOrder[5] = 'account'; $lang->my->menuOrder[10] = 'index'; -$lang->my->menuOrder[15] = 'todo'; +$lang->my->menuOrder[15] = 'calendar'; $lang->my->menuOrder[20] = 'task'; $lang->my->menuOrder[25] = 'bug'; $lang->my->menuOrder[30] = 'testtask'; diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index 4cb1c6b231..77e9daa7fb 100644 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -167,7 +167,7 @@ $lang->my = new stdclass(); $lang->my->menu = new stdclass(); $lang->my->menu->index = '首页|my|index'; -$lang->my->menu->todo = array('link' => '待办|my|todo|', 'subModule' => 'todo'); +$lang->my->menu->calendar = array('link' => '日程|my|calendar|', 'subModule' => 'todo', 'alias' => 'todo'); $lang->my->menu->task = array('link' => '任务|my|task|', 'subModule' => 'task'); $lang->my->menu->bug = array('link' => 'Bug|my|bug|', 'subModule' => 'bug'); $lang->my->menu->testtask = array('link' => '测试|my|testtask|', 'subModule' => 'testcase,testtask', 'alias' => 'testcase'); diff --git a/module/my/control.php b/module/my/control.php index 5eff4c7b4b..8b7a64744a 100644 --- a/module/my/control.php +++ b/module/my/control.php @@ -62,6 +62,11 @@ class my extends control $this->display(); } + public function calendar() + { + $this->locate($this->createLink('my', 'todo')); + } + /** * My todos. * diff --git a/module/my/view/index.html.php b/module/my/view/index.html.php index 04ae954272..ce507842fd 100644 --- a/module/my/view/index.html.php +++ b/module/my/view/index.html.php @@ -10,6 +10,5 @@ */ ?> -version);?> fetch('block', 'dashboard', 'module=my');?> - \ No newline at end of file + diff --git a/www/js/zui/min.js b/www/js/zui/min.js index a8a7259c20..7770dfb3ea 100644 --- a/www/js/zui/min.js +++ b/www/js/zui/min.js @@ -4,10937 +4,24 @@ * GitHub: https://github.com/easysoft/zui.git * Copyright (c) 2018 cnezsoft.com; Licensed MIT */ - -/* ======================================================================== - * ZUI: jquery.extensions.js - * http://zui.sexy - * ======================================================================== - * Copyright (c) 2014-2016 cnezsoft.com; Licensed MIT - * ======================================================================== */ - - -(function($, window, undefined) { - 'use strict'; - - /* Check jquery */ - if(typeof($) === 'undefined') throw new Error('ZUI requires jQuery'); - - // ZUI shared object - if(!$.zui) $.zui = function(obj) { - if($.isPlainObject(obj)) { - $.extend($.zui, obj); - } - }; - - var MOUSE_BUTTON_CODES = { - all: -1, - left: 0, - middle: 1, - right: 2 - }; - - var lastUuidAmend = 0; - $.zui({ - uuid: function(asNumber) { - var uuidNumber = (new Date()).getTime() * 1000 + (lastUuidAmend++) % 1000; - return asNumber ? uuidNumber : uuidNumber.toString(36); - }, - - callEvent: function(func, event, proxy) { - if($.isFunction(func)) { - if(proxy !== undefined) { - func = $.proxy(func, proxy); - } - var result = func(event); - if(event) event.result = result; - return !(result !== undefined && (!result)); - } - return 1; - }, - - clientLang: function() { - var lang; - var config = window.config; - if(typeof(config) != 'undefined' && config.clientLang) { - lang = config.clientLang; - } - if(!lang) { - var hl = $('html').attr('lang'); - lang = hl ? hl : (navigator.userLanguage || navigator.userLanguage || 'zh_cn'); - } - return lang.replace('-', '_').toLowerCase(); - }, - - strCode: function(str) { - var code = 0; - if(str && str.length) { - for(var i = 0; i < str.length; ++i) { - code += i * str.charCodeAt(i); - } - } - return code; - }, - - getMouseButtonCode: function(mouseButton) { - if(typeof mouseButton !== 'number') { - mouseButton = MOUSE_BUTTON_CODES[mouseButton]; - } - if(mouseButton === undefined || mouseButton === null) mouseButton = -1; - return mouseButton; - } - }); - - $.fn.callEvent = function(name, event, model) { - var $this = $(this); - var dotIndex = name.indexOf('.zui.'); - var shortName = dotIndex < 0 ? name : name.substring(0, dotIndex); - var e = $.Event(shortName, event); - - if((model === undefined) && dotIndex > 0) { - model = $this.data(name.substring(dotIndex + 1)); - } - - if(model && model.options) { - var func = model.options[shortName]; - if($.isFunction(func)) { - e.result = $.zui.callEvent(func, e, model); - } - } - $this.trigger(e); - return e; - }; - - $.fn.callComEvent = function(component, eventName, params) { - if (params !== undefined && !$.isArray(params)) { - params = [params]; - } - var $this = this; - var result = $this.triggerHandler(eventName, params); - - var eventCallback = component.options[eventName]; - if (eventCallback) { - result = eventCallback.apply(component, params); - } - return result; - }; -}(jQuery, window, undefined)); - - -/* ======================================================================== - * ZUI: typography.js - * http://zui.sexy - * ======================================================================== - * Copyright (c) 2014-2016 cnezsoft.com; Licensed MIT - * ======================================================================== */ - - -(function($) { - 'use strict'; - - $.fn.fixOlPd = function(pd) { - pd = pd || 10; - return this.each(function() { - var $ol = $(this); - $ol.css('paddingLeft', Math.ceil(Math.log10($ol.children().length)) * pd + 10); - }); - }; - - $(function() { - $('.ol-pd-fix,.article ol').fixOlPd(); - }); -}(jQuery)); - - -/* ======================================================================== - * Bootstrap: button.js v3.0.3 - * http://getbootstrap.com/javascript/#buttons - * - * ZUI: The file has been changed in ZUI. It will not keep update with the - * Bootsrap version in the future. - * http://zui.sexy - * ======================================================================== - * Copyright 2011-2014 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ - - -+ function($) { - 'use strict'; - - // BUTTON PUBLIC CLASS DEFINITION - // ============================== - - var Button = function(element, options) { - this.$element = $(element) - this.options = $.extend({}, Button.DEFAULTS, options) - this.isLoading = false - } - - Button.DEFAULTS = { - loadingText: 'loading...' - } - - Button.prototype.setState = function(state) { - var d = 'disabled' - var $el = this.$element - var val = $el.is('input') ? 'val' : 'html' - var data = $el.data() - - state = state + 'Text' - - if(!data.resetText) $el.data('resetText', $el[val]()) - - $el[val](data[state] || this.options[state]) - - // push to event loop to allow forms to submit - setTimeout($.proxy(function() { - if(state == 'loadingText') { - this.isLoading = true - $el.addClass(d).attr(d, d) - } else if(this.isLoading) { - this.isLoading = false - $el.removeClass(d).removeAttr(d) - } - }, this), 0) - } - - Button.prototype.toggle = function() { - var changed = true - var $parent = this.$element.closest('[data-toggle="buttons"]') - - if($parent.length) { - var $input = this.$element.find('input') - if($input.prop('type') == 'radio') { - if($input.prop('checked') && this.$element.hasClass('active')) changed = false - else $parent.find('.active').removeClass('active') - } - if(changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change') - } - - if(changed) this.$element.toggleClass('active') - } - - - // BUTTON PLUGIN DEFINITION - // ======================== - - var old = $.fn.button - - $.fn.button = function(option) { - return this.each(function() { - var $this = $(this) - var data = $this.data('zui.button') - var options = typeof option == 'object' && option - - if(!data) $this.data('zui.button', (data = new Button(this, options))) - - if(option == 'toggle') data.toggle() - else if(option) data.setState(option) - }) - } - - $.fn.button.Constructor = Button - - - // BUTTON NO CONFLICT - // ================== - - $.fn.button.noConflict = function() { - $.fn.button = old - return this - } - - - // BUTTON DATA-API - // =============== - - $(document).on('click.zui.button.data-api', '[data-toggle^=button]', function(e) { - var $btn = $(e.target) - if(!$btn.hasClass('btn')) $btn = $btn.closest('.btn') - $btn.button('toggle') - e.preventDefault() - }) - -}(jQuery); - - -/* ======================================================================== - * Bootstrap: alert.js v3.0.0 - * http://twbs.github.com/bootstrap/javascript.html#alerts - * ======================================================================== - * Copyright 2013 Twitter, Inc. - * - * 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. - * - * ZUI: The file has been changed in ZUI. It will not keep update with the - * Bootsrap version in the future. - * http://zui.sexy - * ======================================================================== */ - - -+ function($) { - 'use strict'; - - // ALERT CLASS DEFINITION - // ====================== - - var dismiss = '[data-dismiss="alert"]' - var zuiname = 'zui.alert'; - - var Alert = function(el) { - $(el).on('click', dismiss, this.close) - } - - Alert.prototype.close = function(e) { - var $this = $(this) - var selector = $this.attr('data-target') - - if(!selector) { - selector = $this.attr('href') - selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 - } - - var $parent = $(selector) - - if(e) e.preventDefault() - - if(!$parent.length) { - $parent = $this.hasClass('alert') ? $this : $this.parent() - } - - $parent.trigger(e = $.Event('close.' + zuiname)) - - if(e.isDefaultPrevented()) return - - $parent.removeClass('in') - - function removeElement() { - $parent.trigger('closed.' + zuiname).remove() - } - - $.support.transition && $parent.hasClass('fade') ? - $parent - .one($.support.transition.end, removeElement) - .emulateTransitionEnd(150) : - removeElement() - } - - - // ALERT PLUGIN DEFINITION - // ======================= - - var old = $.fn.alert - - $.fn.alert = function(option) { - return this.each(function() { - var $this = $(this) - var data = $this.data(zuiname) - - if(!data) $this.data(zuiname, (data = new Alert(this))) - if(typeof option == 'string') data[option].call($this) - }) - } - - $.fn.alert.Constructor = Alert - - - // ALERT NO CONFLICT - // ================= - - $.fn.alert.noConflict = function() { - $.fn.alert = old - return this - } - - - // ALERT DATA-API - // ============== - - $(document).on('click.' + zuiname + '.data-api', dismiss, Alert.prototype.close) - -}(window.jQuery); - -/* ======================================================================== - * ZUI: pager.js - * http://zui.sexy - * ======================================================================== - * Copyright (c) 2017-2018 cnezsoft.com; Licensed MIT - * ======================================================================== */ - - -(function($) { - 'use strict'; - - var NAME = 'zui.pager'; // model name - - var DEFAULT_PAGER = { - page: 0, // current page index - recTotal: 0, // records total count - recPerPage: 10, // records count per page - }; - - var LANG = { - zh_cn: { - prev: '上一页', - next: '下一页', - first: '第一页', - last: '最后一页', - goto: '跳转', - pageOf: '第 {page} 页', - totalPage: '共 {totalPage} 页', - totalCount: '共 {recTotal} 项', - pageSize: '每页 {recPerPage} 项', - itemsRange: '第 {start} ~ {end} 项', - pageOfTotal: '第 {page}/{totalPage} 页' - }, - zh_tw: { - prev: '上一頁', - next: '下一頁', - first: '第一頁', - last: '最後一頁', - goto: '跳轉', - pageOf: '第 {page} 頁', - totalPage: '共 {totalPage} 頁', - totalCount: '共 {recTotal} 項', - pageSize: '每頁 {recPerPage} 項', - itemsRange: '第 {start} ~ {end} 項', - pageOfTotal: '第 {page}/{totalPage} 頁' - }, - en: { - prev: 'Prev', - next: 'Next', - first: 'First', - last: 'Last', - goto: 'Goto', - pageOf: 'Page {page}', - totalPage: '{totalPage} pages', - totalCount: '{recTotal} items', - pageSize: '{recPerPage} items per page', - itemsRange: 'From {start} to {end}', - pageOfTotal: 'Page {page} of {totalPage}' - } - }; - - // The pager model class - var Pager = function(element, options) { - var that = this; - that.name = NAME; - that.$ = $(element); - - options = that.options = $.extend({}, Pager.DEFAULTS, this.$.data(), options); - - var lang = options.lang || 'zh_cn'; - that.lang = $.isPlainObject(lang) ? ($.extend(true, {}, LANG[lang.lang || $.zui.clientLang()], lang)) : LANG[lang]; - - that.state = {}; - - that.set(options.page, options.recTotal, options.recPerPage); - - that.$.on('click', '.pager-goto-btn', function() { - var $goto = $(this).closest('.pager-goto'); - var page = parseInt($goto.find('.pager-goto-input').val()); - if (page !== NaN) { - that.set(page); - } - }).on('click', '.pager-item', function() { - var page = $(this).data('page'); - if (typeof page === 'number' && page > 0) { - that.set(page); - } - }).on('click', '.pager-size-menu [data-size]', function() { - var size = $(this).data('size'); - if (typeof size === 'number' && size > 0) { - that.set(-1, -1, size); - } - }); - }; - - Pager.prototype.set = function(page, recTotal, recPerPage) { - var that = this; - if (typeof page === 'object' && page !== null) { - recPerPage = page.recPerPage; - recTotal = page.recTotal; - page = page.page; - } - var state = that.state; - if (!state) { - state = $.extend({}, DEFAULT_PAGER); - } - var oldState = $.extend({}, state); - if (typeof recPerPage === 'number' && recPerPage > 0) { - state.recPerPage = recPerPage; - } - if (typeof recTotal === 'number' && recTotal >= 0) { - state.recTotal = recTotal; - } - if (typeof page === 'number' && page >= 0) { - state.page = page; - } - state.totalPage = (state.recTotal && state.recPerPage) ? (Math.ceil(state.recTotal / state.recPerPage)) : 1; - state.page = Math.max(0, Math.min(state.page, state.totalPage)); - // stateRecCount is items count in current page - state.pageRecCount = state.recTotal; - if (state.page && state.recTotal) { - if (state.page < state.totalPage) { - state.pageRecCount = state.recPerPage; - } else if (state.page > 1) { - state.pageRecCount = state.recTotal - (state.recPerPage * (state.page - 1)); - } - } - state.skip = state.page > 1 ? ((state.page - 1) * state.recPerPage) : 0; - state.start = state.skip + 1; - state.end = state.skip + state.pageRecCount; - state.prev = state.page > 1 ? (state.page - 1) : 0; - state.next = state.page < state.totalPage ? (state.page + 1) : 0; - that.state = state; - if (oldState.page !== state.page || oldState.recTotal !== state.recTotal || oldState.recPerPage !== state.recPerPage) { - that.$.callComEvent(that, 'onPageChange', [state, oldState]); - } - return that.render(); - }; - - Pager.prototype.createLinkItem = function(page, text, asAElement) { - var that = this; - if (text === undefined) { - text = page; - } - var $ele = $('').attr('href', page ? that.createLink(page, that.state) : '###').html(text); - if (!asAElement) { - $ele = $('
  • ').append($ele).toggleClass('active', page === that.state.page).toggleClass('disabled', !page); - } - return $ele; - }; - - Pager.prototype.createNavItems = function(maxCount) { - var that = this; - var $nav = that.$; - var pager = that.state; - var totalPage = pager.totalPage; - var page = pager.page; - var appendItem = function(p, to) { - if(p === false) { - $nav.append(that.createLinkItem(0, to || '')); - return; - } - if(to === undefined) to = p; - for(var i = p; i <= to; ++i) { - $nav.append(that.createLinkItem(i)); - } - }; - if (maxCount === undefined) { - maxCount = that.options.maxNavCount || 10; - } - appendItem(1); - if(totalPage > 1) { - if(totalPage <= maxCount) { - appendItem(2, totalPage); - } - else if(page < (maxCount - 2)) { - appendItem(2, maxCount - 2); - appendItem(false); - appendItem(totalPage); - } - else if(page > (totalPage - maxCount + 2)) { - appendItem(false); - appendItem((totalPage - maxCount + 2), totalPage); - } - else { - appendItem(false); - appendItem(page - Math.ceil((maxCount-4)/2), page + Math.floor((maxCount-4)/2)); - appendItem(false); - appendItem(totalPage); - } - } - }; - - Pager.prototype.createGoto = function() { - var that = this; - var pager = this.state; - var $goto = $('
    '); - return $goto; - }; - - Pager.prototype.createSizeMenu = function() { - var that = this; - var pager = this.state; - var $menu = $(''); - var options = that.options.pageSizeOptions; - if (typeof options === 'string') { - options = options.split(','); - } - for (var i = 0; i < options.length; ++i) { - var size = options[i]; - if (typeof size === 'string') { - size = parseInt(size); - } - var $li = $('
  • ' + size + '
  • ').toggleClass('active', size === pager.recPerPage); - $menu.append($li); - } - return $('
    ').addClass(that.options.menuDirection).append($menu); - }; - - Pager.prototype.createElement = function(element, $pager, pager) { - var that = this; - var createLinkItem= $.proxy(that.createLinkItem, that); - var lang = that.lang; - switch (element) { - case 'prev': - return createLinkItem(pager.prev, lang.prev); - case 'prev_icon': - return createLinkItem(pager.prev, ''); - case 'next': - return createLinkItem(pager.next, lang.next); - case 'next_icon': - return createLinkItem(pager.next, ''); - case 'first': - return createLinkItem(1, lang.first, true); - case 'first_icon': - return createLinkItem(1, '', true); - case 'last': - return createLinkItem(pager.totalPage, lang.last, true); - case 'last_icon': - return createLinkItem(pager.totalPage, '', true); - case 'space': - case '|': - return $('
  • '); - case 'nav': - case 'pages': - that.createNavItems(); - return; - case 'total_text': - return $(('
    ' + lang.totalCount + '
    ').format(pager)); - case 'page_text': - return $(('
    ' + lang.pageOf + '
    ').format(pager)); - case 'total_page_text': - return $(('
    ' + lang.totalPage + '
    ').format(pager)); - case 'page_of_total_text': - return $(('
    ' + lang.pageOfTotal + '
    ').format(pager)); - case 'page_size_text': - return $(('
    ' + lang.pageSize + '
    ').format(pager)); - case 'items_range_text': - return $(('
    ' + lang.itemsRange + '
    ').format(pager)); - case 'goto': - return that.createGoto(); - case 'size_menu': - return that.createSizeMenu(); - default: - return $('
  • ').html(element); - } - }; - - Pager.prototype.createLink = function(page, pager) { - var linkCreator = this.options.linkCreator; - if (typeof linkCreator === 'string') { - return linkCreator.format($.extend({}, pager, {page: page})); - } else if ($.isFunction(linkCreator)) { - return linkCreator(page, pager); - } - return '#page=' + page; - }; - - Pager.prototype.render = function(elements) { - var that = this; - var state = that.state; - var createElement = that.options.elementCreator || that.createElement; - var isMapperCreator = $.isPlainObject(createElement); - - elements = elements || that.elements || that.options.elements; - if (typeof elements == 'string') { - elements = elements.split(','); - } - that.elements = elements; - - that.$.empty(); - - for(var i = 0; i < elements.length; ++i) { - var element = $.trim(elements[i]); - var creator = isMapperCreator ? (createElement[element] || createElement) : createElement; - var $element = creator.call(that, element, that.$, state); - if ($element === false) { - $element = that.createElement(element, that.$, state); - } - if ($element instanceof $) { - if ($element[0].tagName !== 'LI') { - $element = $('
  • ').append($element); - } - that.$.append($element); - } - } - - // Fix page item border - var $lastItem = null; - that.$.children('li').each(function() { - var $li = $(this); - var isItem = !!$li.children('.pager-item').length; - if ($lastItem) { - $lastItem.toggleClass('pager-item-right', !isItem); - } else { - if (isItem) { - $li.addClass('pager-item-left'); - } - } - $lastItem = isItem ? $li : null; - }); - - that.$.callComEvent(that, 'onRender', [state]); - return that; - }; - - // default options - Pager.DEFAULTS = $.extend({ - elements: ['first_icon', 'prev_icon', 'pages', 'next_icon', 'last_icon', 'page_of_total_text', 'items_range_text', 'total_text'], - prevIcon: 'icon-double-angle-left', - nextIcon: 'icon-double-angle-right', - firstIcon: 'icon-step-backward', - lastIcon: 'icon-step-forward', - maxNavCount: 10, - menuDirection: 'dropdown', // or dropup - pageSizeOptions: [10, 20, 30, 50, 100], - // onPageChange: null - }, DEFAULT_PAGER); - - // Extense jquery element - $.fn.pager = function(option) { - return this.each(function() { - var $this = $(this); - var data = $this.data(NAME); - var options = typeof option == 'object' && option; - - if(!data) $this.data(NAME, (data = new Pager(this, options))); - - if(typeof option == 'string') data[option](); - }); - }; - - Pager.NAME = NAME; - - $.fn.pager.Constructor = Pager; - - // Auto call pager after document load complete - $(function() { - $('[data-ride="pager"]').pager(); - }); -}(jQuery)); - - -/* ======================================================================== - * Bootstrap: tab.js v3.0.0 - * http://twbs.github.com/bootstrap/javascript.html#tabs - * - * ZUI: The file has been changed in ZUI. It will not keep update with the - * Bootsrap version in the future. - * http://zui.sexy - * ======================================================================== - * Copyright 2012 Twitter, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ======================================================================== */ - - -+ function($) { - 'use strict'; - - // TAB CLASS DEFINITION - // ==================== - - var zuiname = 'zui.tab' - var Tab = function(element) { - this.element = $(element) - } - - Tab.prototype.show = function() { - var $this = this.element - var $ul = $this.closest('ul:not(.dropdown-menu)') - var selector = $this.attr('data-target') || $this.attr('data-tab') - - if(!selector) { - selector = $this.attr('href') - selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 - } - - if($this.parent('li').hasClass('active')) return - - var previous = $ul.find('.active:last a')[0] - var e = $.Event('show.' + zuiname, { - relatedTarget: previous - }) - - $this.trigger(e) - - if(e.isDefaultPrevented()) return - - var $target = $(selector) - - this.activate($this.parent('li'), $ul) - this.activate($target, $target.parent(), function() { - $this.trigger({ - type: 'shown.' + zuiname, - relatedTarget: previous - }) - }) - } - - Tab.prototype.activate = function(element, container, callback) { - var $active = container.find('> .active') - var transition = callback && $.support.transition && $active.hasClass('fade') - - function next() { - $active - .removeClass('active') - .find('> .dropdown-menu > .active') - .removeClass('active') - - element.addClass('active') - - if(transition) { - element[0].offsetWidth // reflow for transition - element.addClass('in') - } else { - element.removeClass('fade') - } - - if(element.parent('.dropdown-menu')) { - element.closest('li.dropdown').addClass('active') - } - - callback && callback() - } - - transition ? - $active - .one($.support.transition.end, next) - .emulateTransitionEnd(150) : - next() - - $active.removeClass('in') - } - - - // TAB PLUGIN DEFINITION - // ===================== - - var old = $.fn.tab - - $.fn.tab = function(option) { - return this.each(function() { - var $this = $(this) - var data = $this.data(zuiname) - - if(!data) $this.data(zuiname, (data = new Tab(this))) - if(typeof option == 'string') data[option]() - }) - } - - $.fn.tab.Constructor = Tab - - - // TAB NO CONFLICT - // =============== - - $.fn.tab.noConflict = function() { - $.fn.tab = old - return this - } - - - // TAB DATA-API - // ============ - - $(document).on('click.zui.tab.data-api', '[data-toggle="tab"], [data-tab]', function(e) { - e.preventDefault() - $(this).tab('show') - }) - -}(window.jQuery); - - -/* ======================================================================== - * Bootstrap: transition.js v3.2.0 - * http://getbootstrap.com/javascript/#transitions - * - * ZUI: The file has been changed in ZUI. It will not keep update with the - * Bootsrap version in the future. - * http://zui.sexy - * ======================================================================== - * Copyright 2011-2014 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ - - -+ function($) { - 'use strict'; - - // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/) - // ============================================================ - - function transitionEnd() { - var el = document.createElement('bootstrap') - - var transEndEventNames = { - WebkitTransition: 'webkitTransitionEnd', - MozTransition: 'transitionend', - OTransition: 'oTransitionEnd otransitionend', - transition: 'transitionend' - } - - for(var name in transEndEventNames) { - if(el.style[name] !== undefined) { - return { - end: transEndEventNames[name] - } - } - } - - return false // explicit for ie8 ( ._.) - } - - // http://blog.alexmaccaw.com/css-transitions - $.fn.emulateTransitionEnd = function(duration) { - var called = false - var $el = this - $(this).one('bsTransitionEnd', function() { - called = true - }) - var callback = function() { - if(!called) $($el).trigger($.support.transition.end) - } - setTimeout(callback, duration) - return this - } - - $(function() { - $.support.transition = transitionEnd() - - if(!$.support.transition) return - - $.event.special.bsTransitionEnd = { - bindType: $.support.transition.end, - delegateType: $.support.transition.end, - handle: function(e) { - if($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments) - } - } - }) - -}(jQuery); - - -/* ======================================================================== - * Bootstrap: collapse.js v3.0.0 - * http://twbs.github.com/bootstrap/javascript.html#collapse - * - * ZUI: The file has been changed in ZUI. It will not keep update with the - * Bootsrap version in the future. - * http://zui.sexy - * ======================================================================== - * Copyright 2012 Twitter, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ======================================================================== */ - - -+ function($) { - 'use strict'; - - var zuiname = 'zui.collapse' - - // COLLAPSE PUBLIC CLASS DEFINITION - // ================================ - - var Collapse = function(element, options) { - this.$element = $(element) - this.options = $.extend({}, Collapse.DEFAULTS, options) - this.transitioning = null - - if(this.options.parent) this.$parent = $(this.options.parent) - if(this.options.toggle) this.toggle() - } - - Collapse.DEFAULTS = { - toggle: true - } - - Collapse.prototype.dimension = function() { - var hasWidth = this.$element.hasClass('width') - return hasWidth ? 'width' : 'height' - } - - Collapse.prototype.show = function() { - if(this.transitioning || this.$element.hasClass('in')) return - - var startEvent = $.Event('show.' + zuiname) - this.$element.trigger(startEvent) - if(startEvent.isDefaultPrevented()) return - - var actives = this.$parent && this.$parent.find('.in') - - if(actives && actives.length) { - var hasData = actives.data(zuiname) - if(hasData && hasData.transitioning) return - actives.collapse('hide') - hasData || actives.data(zuiname, null) - } - - var dimension = this.dimension() - - this.$element - .removeClass('collapse') - .addClass('collapsing')[dimension](0) - - this.transitioning = 1 - - var complete = function() { - this.$element - .removeClass('collapsing') - .addClass('in')[dimension]('auto') - this.transitioning = 0 - this.$element.trigger('shown.' + zuiname) - } - - if(!$.support.transition) return complete.call(this) - - var scrollSize = $.camelCase(['scroll', dimension].join('-')) - - this.$element - .one($.support.transition.end, $.proxy(complete, this)) - .emulateTransitionEnd(350)[dimension](this.$element[0][scrollSize]) - } - - Collapse.prototype.hide = function() { - if(this.transitioning || !this.$element.hasClass('in')) return - - var startEvent = $.Event('hide.' + zuiname) - this.$element.trigger(startEvent) - if(startEvent.isDefaultPrevented()) return - - var dimension = this.dimension() - - this.$element[dimension](this.$element[dimension]())[0].offsetHeight - - this.$element - .addClass('collapsing') - .removeClass('collapse') - .removeClass('in') - - this.transitioning = 1 - - var complete = function() { - this.transitioning = 0 - this.$element - .trigger('hidden.' + zuiname) - .removeClass('collapsing') - .addClass('collapse') - } - - if(!$.support.transition) return complete.call(this) - - this.$element[dimension](0) - .one($.support.transition.end, $.proxy(complete, this)) - .emulateTransitionEnd(350) - } - - Collapse.prototype.toggle = function() { - this[this.$element.hasClass('in') ? 'hide' : 'show']() - } - - - // COLLAPSE PLUGIN DEFINITION - // ========================== - - var old = $.fn.collapse - - $.fn.collapse = function(option) { - return this.each(function() { - var $this = $(this) - var data = $this.data(zuiname) - var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option) - - if(!data) $this.data(zuiname, (data = new Collapse(this, options))) - if(typeof option == 'string') data[option]() - }) - } - - $.fn.collapse.Constructor = Collapse - - - // COLLAPSE NO CONFLICT - // ==================== - - $.fn.collapse.noConflict = function() { - $.fn.collapse = old - return this - } - - - // COLLAPSE DATA-API - // ================= - - $(document).on('click.' + zuiname + '.data-api', '[data-toggle=collapse]', function(e) { - var $this = $(this), - href - var target = $this.attr('data-target') || e.preventDefault() || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 - var $target = $(target) - var data = $target.data(zuiname) - var option = data ? 'toggle' : $this.data() - var parent = $this.attr('data-parent') - var $parent = parent && $(parent) - - if(!data || !data.transitioning) { - if($parent) $parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed') - $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed') - } - - $target.collapse(option) - }) - -}(window.jQuery); - - -/* ======================================================================== - * ZUI: device.js - * http://zui.sexy - * ======================================================================== - * Copyright (c) 2014-2016 cnezsoft.com; Licensed MIT - * ======================================================================== */ - - -(function(window, $) { - 'use strict'; - var desktopLg = 1200, - desktop = 992, - tablet = 768; - - var $window = $(window); - - var resetCssClass = function() { - var width = $window.width(); - $('html').toggleClass('screen-desktop', width >= desktop && width < desktopLg) - .toggleClass('screen-desktop-wide', width >= desktopLg) - .toggleClass('screen-tablet', width >= tablet && width < desktop) - .toggleClass('screen-phone', width < tablet) - .toggleClass('device-mobile', width < desktop) - .toggleClass('device-desktop', width >= desktop); - }; - - var classNames = ''; - var userAgent = navigator.userAgent; - if (userAgent.match(/(iPad|iPhone|iPod)/i)) { - classNames += ' os-ios'; - } else if (userAgent.match(/android/i)) { - classNames += ' os-android'; - } else if (userAgent.match(/Win/i)) { - classNames += ' os-windows'; - } else if (userAgent.match(/Mac/i)) { - classNames += ' os-mac'; - } else if (userAgent.match(/Linux/i)) { - classNames += ' os-linux'; - } else if (userAgent.match(/X11/i)) { - classNames += ' os-unix'; - } - if ('ontouchstart' in document.documentElement) { - classNames += ' is-touchable'; - } - $('html').addClass(classNames); - - $window.resize(resetCssClass); - resetCssClass(); -}(window, jQuery)); - - -/* ======================================================================== - * ZUI: browser.js - * http://zui.sexy - * ======================================================================== - * Copyright (c) 2014 cnezsoft.com; Licensed MIT - * ======================================================================== */ - - -(function($) { - 'use strict'; - - var browseHappyTip = { - 'zh_cn': '您的浏览器版本过低,无法体验所有功能,建议升级或者更换浏览器。 了解更多...', - 'zh_tw': '您的瀏覽器版本過低,無法體驗所有功能,建議升級或者更换瀏覽器。了解更多...', - 'en': 'Your browser is too old, it has been unable to experience the colorful internet. We strongly recommend that you upgrade a better one. Learn more...' - }; - - // The browser modal class - var Browser = function() { - var ie = this.isIE() || this.isIE10() || false; - if(ie) { - for(var i = 10; i > 5; i--) { - if(this.isIE(i)) { - ie = i; - break; - } - } - } - - this.ie = ie; - - this.cssHelper(); - }; - - // Append CSS class to html tag - Browser.prototype.cssHelper = function() { - var ie = this.ie, - $html = $('html'); - $html.toggleClass('ie', ie) - .removeClass('ie-6 ie-7 ie-8 ie-9 ie-10'); - if(ie) { - $html.addClass('ie-' + ie) - .toggleClass('gt-ie-7 gte-ie-8 support-ie', ie >= 8) - .toggleClass('lte-ie-7 lt-ie-8 outdated-ie', ie < 8) - .toggleClass('gt-ie-8 gte-ie-9', ie >= 9) - .toggleClass('lte-ie-8 lt-ie-9', ie < 9) - .toggleClass('gt-ie-9 gte-ie-10', ie >= 10) - .toggleClass('lte-ie-9 lt-ie-10', ie < 10); - } - }; - - // Show browse happy tip - Browser.prototype.tip = function(showCoontent) { - var $browseHappy = $('#browseHappyTip'); - if(!$browseHappy.length) { - $browseHappy = $('
    '); - $browseHappy.prependTo('body'); - } - - $browseHappy.find('.content').html(showCoontent || this.browseHappyTip || browseHappyTip[$.zui.clientLang() || 'zh_cn']); - }; - - // Detect it is IE, can given a version - Browser.prototype.isIE = function(version) { - if(version === 10) return this.isIE10(); - var b = document.createElement('b'); - b.innerHTML = ''; - return b.getElementsByTagName('i').length === 1; - }; - - // Detect ie 10 with hack - Browser.prototype.isIE10 = function() { - return (/*@cc_on!@*/false); - }; - - $.zui({ - browser: new Browser() - }); - - $(function() { - if(!$('body').hasClass('disabled-browser-tip')) { - if($.zui.browser.ie && $.zui.browser.ie < 8) { - $.zui.browser.tip(); - } - } - }); -}(jQuery)); - - -/* ======================================================================== - * ZUI: date.js - * Date polyfills - * http://zui.sexy - * ======================================================================== - * Copyright (c) 2014 cnezsoft.com; Licensed MIT - * ======================================================================== */ - - -(function() { - 'use strict'; - - /** - * Ticks of a whole day - * @type {number} - */ - Date.ONEDAY_TICKS = 24 * 3600 * 1000; - - /** - * Format date to a string - * - * @param string format - * @return string - */ - if(!Date.prototype.format) { - Date.prototype.format = function(format) { - var date = { - 'M+': this.getMonth() + 1, - 'd+': this.getDate(), - 'h+': this.getHours(), - 'm+': this.getMinutes(), - 's+': this.getSeconds(), - 'q+': Math.floor((this.getMonth() + 3) / 3), - 'S+': this.getMilliseconds() - }; - if(/(y+)/i.test(format)) { - format = format.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length)); - } - for(var k in date) { - if(new RegExp('(' + k + ')').test(format)) { - format = format.replace(RegExp.$1, RegExp.$1.length == 1 ? date[k] : ('00' + date[k]).substr(('' + date[k]).length)); - } - } - return format; - }; - } - - /** - * Add milliseconds to the date - * @param {number} value - */ - if(!Date.prototype.addMilliseconds) { - Date.prototype.addMilliseconds = function(value) { - this.setTime(this.getTime() + value); - return this; - }; - } - - - /** - * Add days to the date - * @param {number} days - */ - if(!Date.prototype.addDays) { - Date.prototype.addDays = function(days) { - this.addMilliseconds(days * Date.ONEDAY_TICKS); - return this; - }; - } - - - /** - * Clone a new date instane from the date - * @return {Date} - */ - if(!Date.prototype.clone) { - Date.prototype.clone = function() { - var date = new Date(); - date.setTime(this.getTime()); - return date; - }; - } - - - /** - * Judge the year is in a leap year - * @param {integer} year - * @return {Boolean} - */ - if(!Date.isLeapYear) { - Date.isLeapYear = function(year) { - return(((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0)); - }; - } - - if(!Date.getDaysInMonth) { - /** - * Get days number of the date - * @param {integer} year - * @param {integer} month - * @return {integer} - */ - Date.getDaysInMonth = function(year, month) { - return [31, (Date.isLeapYear(year) ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month]; - }; - } - - - /** - * Judge the date is in a leap year - * @return {Boolean} - */ - if(!Date.prototype.isLeapYear) { - Date.prototype.isLeapYear = function() { - return Date.isLeapYear(this.getFullYear()); - }; - } - - - /** - * Clear time part of the date - * @return {date} - */ - if(!Date.prototype.clearTime) { - Date.prototype.clearTime = function() { - this.setHours(0); - this.setMinutes(0); - this.setSeconds(0); - this.setMilliseconds(0); - return this; - }; - } - - - /** - * Get days of this month of the date - * @return {integer} - */ - if(!Date.prototype.getDaysInMonth) { - Date.prototype.getDaysInMonth = function() { - return Date.getDaysInMonth(this.getFullYear(), this.getMonth()); - }; - } - - - /** - * Add months to the date - * @param {date} value - */ - if(!Date.prototype.addMonths) { - Date.prototype.addMonths = function(value) { - var n = this.getDate(); - this.setDate(1); - this.setMonth(this.getMonth() + value); - this.setDate(Math.min(n, this.getDaysInMonth())); - return this; - }; - } - - - /** - * Get last week day of the date - * @param {integer} day - * @return {date} - */ - if(!Date.prototype.getLastWeekday) { - Date.prototype.getLastWeekday = function(day) { - day = day || 1; - - var d = this.clone(); - while(d.getDay() != day) { - d.addDays(-1); - } - d.clearTime(); - return d; - }; - } - - - /** - * Judge the date is same day as another date - * @param {date} date - * @return {Boolean} - */ - if(!Date.prototype.isSameDay) { - Date.prototype.isSameDay = function(date) { - return date.toDateString() === this.toDateString(); - }; - } - - - /** - * Judge the date is in same week as another date - * @param {date} date - * @return {Boolean} - */ - if(!Date.prototype.isSameWeek) { - Date.prototype.isSameWeek = function(date) { - var weekStart = this.getLastWeekday(); - var weekEnd = weekStart.clone().addDays(7); - return date >= weekStart && date < weekEnd; - }; - } - - - /** - * Judge the date is in same year as another date - * @param {date} date - * @return {Boolean} - */ - if(!Date.prototype.isSameYear) { - Date.prototype.isSameYear = function(date) { - return this.getFullYear() === date.getFullYear(); - }; - } - - /** - * Create an date instance with string, timestamp or date instance - * @param {Date|String|Number} date - * @return {Date} - */ - if (!Date.create) { - Date.create = function(date) { - if (!(date instanceof Date)) { - if (typeof date === 'number' && date < 10000000000) { - date *= 1000; - } - date = new Date(date); - } - return date; - }; - } - - if (!Date.timestamp) { - Date.timestamp = function(date) { - if (typeof date === 'number') { - if (date < 10000000000) { - date *= 1000; - } - } else { - date = Date.create(date).getTime(); - } - return date; - }; - } -}()); - - -/* ======================================================================== - * ZUI: string.js - * String Polyfill. - * http://zui.sexy - * ======================================================================== - * Copyright (c) 2014-2016 cnezsoft.com; Licensed MIT - * ======================================================================== */ - - -(function() { - 'use strict'; - - /** - * Format string with argument list or object - * @param {object | arguments} args - * @return {String} - */ - if(!String.prototype.format) { - String.prototype.format = function(args) { - var result = this; - if(arguments.length > 0) { - var reg; - if(arguments.length <= 2 && typeof(args) == 'object') { - for(var key in args) { - if(args[key] !== undefined) { - reg = new RegExp('(' + (arguments[1] ? arguments[1].replace('0', key) : '{' + key + '}') + ')', 'g'); - result = result.replace(reg, args[key]); - } - } - } else { - for(var i = 0; i < arguments.length; i++) { - if(arguments[i] !== undefined) { - reg = new RegExp('({[' + i + ']})', 'g'); - result = result.replace(reg, arguments[i]); - } - } - } - } - return result; - }; - } - - /** - * Judge the string is a integer number - * - * @access public - * @return bool - */ - if(!String.prototype.isNum) { - String.prototype.isNum = function(s) { - if(s !== null) { - var r, re; - re = /\d*/i; - r = s.match(re); - return(r == s) ? true : false; - } - return false; - }; - } - - if(!String.prototype.endsWith) { - String.prototype.endsWith = function(searchString, position) { - var subjectString = this.toString(); - if(position === undefined || position > subjectString.length) { - position = subjectString.length; - } - position -= searchString.length; - var lastIndex = subjectString.indexOf(searchString, position); - return lastIndex !== -1 && lastIndex === position; - }; - } - - if(!String.prototype.startsWith) { - String.prototype.startsWith = function(searchString, position) { - position = position || 0; - return this.lastIndexOf(searchString, position) === position; - }; - } - - if(!String.prototype.includes) { - String.prototype.includes = function() { - return String.prototype.indexOf.apply(this, arguments) !== -1; - }; - } - -})(); - - -/* ======================================================================== - * Resize: resize.js [Version: 1.1] - * http://benalman.com/projects/jquery-resize-plugin/ - * - * ZUI: The file has been changed in ZUI. It will not keep update with the - * official version in the future. - * http://zui.sexy - * ======================================================================== - * opyright (c) 2010 "Cowboy" Ben Alman - * Dual licensed under the MIT and GPL licenses. - * http://benalman.com/about/license/ - * ======================================================================== */ - - -/*! +!function(t,e,i){"use strict";if("undefined"==typeof t)throw new Error("ZUI requires jQuery");t.zui||(t.zui=function(e){t.isPlainObject(e)&&t.extend(t.zui,e)});var n={all:-1,left:0,middle:1,right:2},s=0;t.zui({uuid:function(t){var e=1e3*(new Date).getTime()+s++%1e3;return t?e:e.toString(36)},callEvent:function(e,n,s){if(t.isFunction(e)){s!==i&&(e=t.proxy(e,s));var a=e(n);return n&&(n.result=a),!(a!==i&&!a)}return 1},clientLang:function(){var i,n=e.config;if("undefined"!=typeof n&&n.clientLang&&(i=n.clientLang),!i){var s=t("html").attr("lang");i=s?s:navigator.userLanguage||navigator.userLanguage||"zh_cn"}return i.replace("-","_").toLowerCase()},strCode:function(t){var e=0;if(t&&t.length)for(var i=0;i0&&(s=a.data(e.substring(o+1))),s&&s.options){var h=s.options[r];t.isFunction(h)&&(l.result=t.zui.callEvent(h,l,s))}return a.trigger(l),l},t.fn.callComEvent=function(e,n,s){s===i||t.isArray(s)||(s=[s]);var a=this,o=a.triggerHandler(n,s),r=e.options[n];return r&&(o=r.apply(e,s)),o}}(jQuery,window,void 0),function(t){"use strict";t.fn.fixOlPd=function(e){return e=e||10,this.each(function(){var i=t(this);i.css("paddingLeft",Math.ceil(Math.log10(i.children().length))*e+10)})},t(function(){t(".ol-pd-fix,.article ol").fixOlPd()})}(jQuery),+function(t){"use strict";var e=function(i,n){this.$element=t(i),this.options=t.extend({},e.DEFAULTS,n),this.isLoading=!1};e.DEFAULTS={loadingText:"loading..."},e.prototype.setState=function(e){var i="disabled",n=this.$element,s=n.is("input")?"val":"html",a=n.data();e+="Text",a.resetText||n.data("resetText",n[s]()),n[s](a[e]||this.options[e]),setTimeout(t.proxy(function(){"loadingText"==e?(this.isLoading=!0,n.addClass(i).attr(i,i)):this.isLoading&&(this.isLoading=!1,n.removeClass(i).removeAttr(i))},this),0)},e.prototype.toggle=function(){var t=!0,e=this.$element.closest('[data-toggle="buttons"]');if(e.length){var i=this.$element.find("input");"radio"==i.prop("type")&&(i.prop("checked")&&this.$element.hasClass("active")?t=!1:e.find(".active").removeClass("active")),t&&i.prop("checked",!this.$element.hasClass("active")).trigger("change")}t&&this.$element.toggleClass("active")};var i=t.fn.button;t.fn.button=function(i){return this.each(function(){var n=t(this),s=n.data("zui.button"),a="object"==typeof i&&i;s||n.data("zui.button",s=new e(this,a)),"toggle"==i?s.toggle():i&&s.setState(i)})},t.fn.button.Constructor=e,t.fn.button.noConflict=function(){return t.fn.button=i,this},t(document).on("click.zui.button.data-api","[data-toggle^=button]",function(e){var i=t(e.target);i.hasClass("btn")||(i=i.closest(".btn")),i.button("toggle"),e.preventDefault()})}(jQuery),+function(t){"use strict";var e='[data-dismiss="alert"]',i="zui.alert",n=function(i){t(i).on("click",e,this.close)};n.prototype.close=function(e){function n(){o.trigger("closed."+i).remove()}var s=t(this),a=s.attr("data-target");a||(a=s.attr("href"),a=a&&a.replace(/.*(?=#[^\s]*$)/,""));var o=t(a);e&&e.preventDefault(),o.length||(o=s.hasClass("alert")?s:s.parent()),o.trigger(e=t.Event("close."+i)),e.isDefaultPrevented()||(o.removeClass("in"),t.support.transition&&o.hasClass("fade")?o.one(t.support.transition.end,n).emulateTransitionEnd(150):n())};var s=t.fn.alert;t.fn.alert=function(e){return this.each(function(){var s=t(this),a=s.data(i);a||s.data(i,a=new n(this)),"string"==typeof e&&a[e].call(s)})},t.fn.alert.Constructor=n,t.fn.alert.noConflict=function(){return t.fn.alert=s,this},t(document).on("click."+i+".data-api",e,n.prototype.close)}(window.jQuery),function(t){"use strict";var e="zui.pager",i={page:0,recTotal:0,recPerPage:10},n={zh_cn:{prev:"上一页",next:"下一页",first:"第一页",last:"最后一页","goto":"跳转",pageOf:"第 {page} 页",totalPage:"共 {totalPage} 页",totalCount:"共 {recTotal} 项",pageSize:"每页 {recPerPage} 项",itemsRange:"第 {start} ~ {end} 项",pageOfTotal:"第 {page}/{totalPage} 页"},zh_tw:{prev:"上一頁",next:"下一頁",first:"第一頁",last:"最後一頁","goto":"跳轉",pageOf:"第 {page} 頁",totalPage:"共 {totalPage} 頁",totalCount:"共 {recTotal} 項",pageSize:"每頁 {recPerPage} 項",itemsRange:"第 {start} ~ {end} 項",pageOfTotal:"第 {page}/{totalPage} 頁"},en:{prev:"Prev",next:"Next",first:"First",last:"Last","goto":"Goto",pageOf:"Page {page}",totalPage:"{totalPage} pages",totalCount:"{recTotal} items",pageSize:"{recPerPage} items per page",itemsRange:"From {start} to {end}",pageOfTotal:"Page {page} of {totalPage}"}},s=function(i,a){var o=this;o.name=e,o.$=t(i),a=o.options=t.extend({},s.DEFAULTS,this.$.data(),a);var r=a.lang||"zh_cn";o.lang=t.isPlainObject(r)?t.extend(!0,{},n[r.lang||t.zui.clientLang()],r):n[r],o.state={},o.set(a.page,a.recTotal,a.recPerPage),o.$.on("click",".pager-goto-btn",function(){var e=t(this).closest(".pager-goto"),i=parseInt(e.find(".pager-goto-input").val());NaN!==i&&o.set(i)}).on("click",".pager-item",function(){var e=t(this).data("page");"number"==typeof e&&e>0&&o.set(e)}).on("click",".pager-size-menu [data-size]",function(){var e=t(this).data("size");"number"==typeof e&&e>0&&o.set(-1,-1,e)})};s.prototype.set=function(e,n,s){var a=this;"object"==typeof e&&null!==e&&(s=e.recPerPage,n=e.recTotal,e=e.page);var o=a.state;o||(o=t.extend({},i));var r=t.extend({},o);return"number"==typeof s&&s>0&&(o.recPerPage=s),"number"==typeof n&&n>=0&&(o.recTotal=n),"number"==typeof e&&e>=0&&(o.page=e),o.totalPage=o.recTotal&&o.recPerPage?Math.ceil(o.recTotal/o.recPerPage):1,o.page=Math.max(0,Math.min(o.page,o.totalPage)),o.pageRecCount=o.recTotal,o.page&&o.recTotal&&(o.page1&&(o.pageRecCount=o.recTotal-o.recPerPage*(o.page-1))),o.skip=o.page>1?(o.page-1)*o.recPerPage:0,o.start=o.skip+1,o.end=o.skip+o.pageRecCount,o.prev=o.page>1?o.page-1:0,o.next=o.page').attr("href",e?s.createLink(e,s.state):"###").html(i);return n||(a=t("
  • ").append(a).toggleClass("active",e===s.state.page).toggleClass("disabled",!e)),a},s.prototype.createNavItems=function(t){var e=this,i=e.$,n=e.state,s=n.totalPage,a=n.page,o=function(t,n){if(t===!1)return void i.append(e.createLinkItem(0,n||''));void 0===n&&(n=t);for(var s=t;s<=n;++s)i.append(e.createLinkItem(s))};void 0===t&&(t=e.options.maxNavCount||10),o(1),s>1&&(s<=t?o(2,s):as-t+2?(o(!1),o(s-t+2,s)):(o(!1),o(a-Math.ceil((t-4)/2),a+Math.floor((t-4)/2)),o(!1),o(s)))},s.prototype.createGoto=function(){var e=this,i=this.state,n=t('
    ");return n},s.prototype.createSizeMenu=function(){var e=this,i=this.state,n=t(''),s=e.options.pageSizeOptions;"string"==typeof s&&(s=s.split(","));for(var a=0;a'+o+"
  • ").toggleClass("active",o===i.recPerPage);n.append(r)}return t('
    ').addClass(e.options.menuDirection).append(n)},s.prototype.createElement=function(e,i,n){var s=this,a=t.proxy(s.createLinkItem,s),o=s.lang;switch(e){case"prev":return a(n.prev,o.prev);case"prev_icon":return a(n.prev,'');case"next":return a(n.next,o.next);case"next_icon":return a(n.next,'');case"first":return a(1,o.first,!0);case"first_icon":return a(1,'',!0);case"last":return a(n.totalPage,o.last,!0);case"last_icon":return a(n.totalPage,'',!0);case"space":case"|":return t('
  • ');case"nav":case"pages":return void s.createNavItems();case"total_text":return t(('
    '+o.totalCount+"
    ").format(n));case"page_text":return t(('
    '+o.pageOf+"
    ").format(n));case"total_page_text":return t(('
    '+o.totalPage+"
    ").format(n));case"page_of_total_text":return t(('
    '+o.pageOfTotal+"
    ").format(n));case"page_size_text":return t(('
    '+o.pageSize+"
    ").format(n));case"items_range_text":return t(('
    '+o.itemsRange+"
    ").format(n));case"goto":return s.createGoto();case"size_menu":return s.createSizeMenu();default:return t("
  • ").html(e)}},s.prototype.createLink=function(e,i){var n=this.options.linkCreator;return"string"==typeof n?n.format(t.extend({},i,{page:e})):t.isFunction(n)?n(e,i):"#page="+e},s.prototype.render=function(e){var i=this,n=i.state,s=i.options.elementCreator||i.createElement,a=t.isPlainObject(s);e=e||i.elements||i.options.elements,"string"==typeof e&&(e=e.split(",")),i.elements=e,i.$.empty();for(var o=0;o").append(h)),i.$.append(h))}var c=null;return i.$.children("li").each(function(){var e=t(this),i=!!e.children(".pager-item").length;c?c.toggleClass("pager-item-right",!i):i&&e.addClass("pager-item-left"),c=i?e:null}),i.$.callComEvent(i,"onRender",[n]),i},s.DEFAULTS=t.extend({elements:["first_icon","prev_icon","pages","next_icon","last_icon","page_of_total_text","items_range_text","total_text"],prevIcon:"icon-double-angle-left",nextIcon:"icon-double-angle-right",firstIcon:"icon-step-backward",lastIcon:"icon-step-forward",maxNavCount:10,menuDirection:"dropdown",pageSizeOptions:[10,20,30,50,100]},i),t.fn.pager=function(i){return this.each(function(){var n=t(this),a=n.data(e),o="object"==typeof i&&i;a||n.data(e,a=new s(this,o)),"string"==typeof i&&a[i]()})},s.NAME=e,t.fn.pager.Constructor=s,t(function(){t('[data-ride="pager"]').pager()})}(jQuery),+function(t){"use strict";var e="zui.tab",i=function(e){this.element=t(e)};i.prototype.show=function(){var i=this.element,n=i.closest("ul:not(.dropdown-menu)"),s=i.attr("data-target")||i.attr("data-tab");if(s||(s=i.attr("href"),s=s&&s.replace(/.*(?=#[^\s]*$)/,"")),!i.parent("li").hasClass("active")){var a=n.find(".active:last a")[0],o=t.Event("show."+e,{relatedTarget:a});if(i.trigger(o),!o.isDefaultPrevented()){var r=t(s);this.activate(i.parent("li"),n),this.activate(r,r.parent(),function(){i.trigger({type:"shown."+e,relatedTarget:a})})}}},i.prototype.activate=function(e,i,n){function s(){a.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),e.addClass("active"),o?(e[0].offsetWidth,e.addClass("in")):e.removeClass("fade"),e.parent(".dropdown-menu")&&e.closest("li.dropdown").addClass("active"),n&&n()}var a=i.find("> .active"),o=n&&t.support.transition&&a.hasClass("fade");o?a.one(t.support.transition.end,s).emulateTransitionEnd(150):s(),a.removeClass("in")};var n=t.fn.tab;t.fn.tab=function(n){return this.each(function(){var s=t(this),a=s.data(e);a||s.data(e,a=new i(this)),"string"==typeof n&&a[n]()})},t.fn.tab.Constructor=i,t.fn.tab.noConflict=function(){return t.fn.tab=n,this},t(document).on("click.zui.tab.data-api",'[data-toggle="tab"], [data-tab]',function(e){e.preventDefault(),t(this).tab("show")})}(window.jQuery),+function(t){"use strict";function e(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in e)if(void 0!==t.style[i])return{end:e[i]};return!1}t.fn.emulateTransitionEnd=function(e){var i=!1,n=this;t(this).one("bsTransitionEnd",function(){i=!0});var s=function(){i||t(n).trigger(t.support.transition.end)};return setTimeout(s,e),this},t(function(){t.support.transition=e(),t.support.transition&&(t.event.special.bsTransitionEnd={bindType:t.support.transition.end,delegateType:t.support.transition.end,handle:function(e){if(t(e.target).is(this))return e.handleObj.handler.apply(this,arguments)}})})}(jQuery),+function(t){"use strict";var e="zui.collapse",i=function(e,n){this.$element=t(e),this.options=t.extend({},i.DEFAULTS,n),this.transitioning=null,this.options.parent&&(this.$parent=t(this.options.parent)),this.options.toggle&&this.toggle()};i.DEFAULTS={toggle:!0},i.prototype.dimension=function(){var t=this.$element.hasClass("width");return t?"width":"height"},i.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var i=t.Event("show."+e);if(this.$element.trigger(i),!i.isDefaultPrevented()){var n=this.$parent&&this.$parent.find(".in");if(n&&n.length){var s=n.data(e);if(s&&s.transitioning)return;n.collapse("hide"),s||n.data(e,null)}var a=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[a](0),this.transitioning=1;var o=function(){this.$element.removeClass("collapsing").addClass("in")[a]("auto"),this.transitioning=0,this.$element.trigger("shown."+e)};if(!t.support.transition)return o.call(this);var r=t.camelCase(["scroll",a].join("-"));this.$element.one(t.support.transition.end,t.proxy(o,this)).emulateTransitionEnd(350)[a](this.$element[0][r])}}},i.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var i=t.Event("hide."+e);if(this.$element.trigger(i),!i.isDefaultPrevented()){var n=this.dimension();this.$element[n](this.$element[n]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var s=function(){this.transitioning=0,this.$element.trigger("hidden."+e).removeClass("collapsing").addClass("collapse")};return t.support.transition?void this.$element[n](0).one(t.support.transition.end,t.proxy(s,this)).emulateTransitionEnd(350):s.call(this)}}},i.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var n=t.fn.collapse;t.fn.collapse=function(n){return this.each(function(){var s=t(this),a=s.data(e),o=t.extend({},i.DEFAULTS,s.data(),"object"==typeof n&&n);a||s.data(e,a=new i(this,o)),"string"==typeof n&&a[n]()})},t.fn.collapse.Constructor=i,t.fn.collapse.noConflict=function(){return t.fn.collapse=n,this},t(document).on("click."+e+".data-api","[data-toggle=collapse]",function(i){var n,s=t(this),a=s.attr("data-target")||i.preventDefault()||(n=s.attr("href"))&&n.replace(/.*(?=#[^\s]+$)/,""),o=t(a),r=o.data(e),l=r?"toggle":s.data(),h=s.attr("data-parent"),c=h&&t(h);r&&r.transitioning||(c&&c.find('[data-toggle=collapse][data-parent="'+h+'"]').not(s).addClass("collapsed"),s[o.hasClass("in")?"addClass":"removeClass"]("collapsed")),o.collapse(l)})}(window.jQuery),function(t,e){"use strict";var i=1200,n=992,s=768,a=e(t),o=function(){var t=a.width();e("html").toggleClass("screen-desktop",t>=n&&t=i).toggleClass("screen-tablet",t>=s&&t=n)},r="",l=navigator.userAgent;l.match(/(iPad|iPhone|iPod)/i)?r+=" os-ios":l.match(/android/i)?r+=" os-android":l.match(/Win/i)?r+=" os-windows":l.match(/Mac/i)?r+=" os-mac":l.match(/Linux/i)?r+=" os-linux":l.match(/X11/i)&&(r+=" os-unix"),"ontouchstart"in document.documentElement&&(r+=" is-touchable"),e("html").addClass(r),a.resize(o),o()}(window,jQuery),function(t){"use strict";var e={zh_cn:'您的浏览器版本过低,无法体验所有功能,建议升级或者更换浏览器。 了解更多...',zh_tw:'您的瀏覽器版本過低,無法體驗所有功能,建議升級或者更换瀏覽器。了解更多...',en:'Your browser is too old, it has been unable to experience the colorful internet. We strongly recommend that you upgrade a better one. Learn more...'},i=function(){var t=this.isIE()||this.isIE10()||!1;if(t)for(var e=10;e>5;e--)if(this.isIE(e)){t=e;break}this.ie=t,this.cssHelper()};i.prototype.cssHelper=function(){var e=this.ie,i=t("html");i.toggleClass("ie",e).removeClass("ie-6 ie-7 ie-8 ie-9 ie-10"),e&&i.addClass("ie-"+e).toggleClass("gt-ie-7 gte-ie-8 support-ie",e>=8).toggleClass("lte-ie-7 lt-ie-8 outdated-ie",e<8).toggleClass("gt-ie-8 gte-ie-9",e>=9).toggleClass("lte-ie-8 lt-ie-9",e<9).toggleClass("gt-ie-9 gte-ie-10",e>=10).toggleClass("lte-ie-9 lt-ie-10",e<10)},i.prototype.tip=function(i){var n=t("#browseHappyTip");n.length||(n=t('
    '),n.prependTo("body")),n.find(".content").html(i||this.browseHappyTip||e[t.zui.clientLang()||"zh_cn"])},i.prototype.isIE=function(t){if(10===t)return this.isIE10();var e=document.createElement("b");return e.innerHTML="",1===e.getElementsByTagName("i").length},i.prototype.isIE10=function(){return!1},t.zui({browser:new i}),t(function(){t("body").hasClass("disabled-browser-tip")||t.zui.browser.ie&&t.zui.browser.ie<8&&t.zui.browser.tip()})}(jQuery),function(){"use strict";Date.ONEDAY_TICKS=864e5,Date.prototype.format||(Date.prototype.format=function(t){var e={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),"S+":this.getMilliseconds()};/(y+)/i.test(t)&&(t=t.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length)));for(var i in e)new RegExp("("+i+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[i]:("00"+e[i]).substr((""+e[i]).length)));return t}),Date.prototype.addMilliseconds||(Date.prototype.addMilliseconds=function(t){return this.setTime(this.getTime()+t),this}),Date.prototype.addDays||(Date.prototype.addDays=function(t){return this.addMilliseconds(t*Date.ONEDAY_TICKS),this}),Date.prototype.clone||(Date.prototype.clone=function(){var t=new Date;return t.setTime(this.getTime()),t}),Date.isLeapYear||(Date.isLeapYear=function(t){return t%4===0&&t%100!==0||t%400===0}),Date.getDaysInMonth||(Date.getDaysInMonth=function(t,e){return[31,Date.isLeapYear(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]}),Date.prototype.isLeapYear||(Date.prototype.isLeapYear=function(){return Date.isLeapYear(this.getFullYear())}),Date.prototype.clearTime||(Date.prototype.clearTime=function(){return this.setHours(0),this.setMinutes(0),this.setSeconds(0),this.setMilliseconds(0),this}),Date.prototype.getDaysInMonth||(Date.prototype.getDaysInMonth=function(){return Date.getDaysInMonth(this.getFullYear(),this.getMonth())}),Date.prototype.addMonths||(Date.prototype.addMonths=function(t){var e=this.getDate();return this.setDate(1),this.setMonth(this.getMonth()+t),this.setDate(Math.min(e,this.getDaysInMonth())),this}),Date.prototype.getLastWeekday||(Date.prototype.getLastWeekday=function(t){t=t||1;for(var e=this.clone();e.getDay()!=t;)e.addDays(-1);return e.clearTime(),e}),Date.prototype.isSameDay||(Date.prototype.isSameDay=function(t){return t.toDateString()===this.toDateString()}),Date.prototype.isSameWeek||(Date.prototype.isSameWeek=function(t){var e=this.getLastWeekday(),i=e.clone().addDays(7);return t>=e&&t0){var i;if(arguments.length<=2&&"object"==typeof t)for(var n in t)void 0!==t[n]&&(i=new RegExp("("+(arguments[1]?arguments[1].replace("0",n):"{"+n+"}")+")","g"),e=e.replace(i,t[n]));else for(var s=0;si.length)&&(e=i.length),e-=t.length;var n=i.indexOf(t,e);return n!==-1&&n===e}),String.prototype.startsWith||(String.prototype.startsWith=function(t,e){return e=e||0,this.lastIndexOf(t,e)===e}),String.prototype.includes||(String.prototype.includes=function(){return String.prototype.indexOf.apply(this,arguments)!==-1})}(),/*! * jQuery resize event - v1.1 * http://benalman.com/projects/jquery-resize-plugin/ * Copyright (c) 2010 "Cowboy" Ben Alman * MIT & GPL http://benalman.com/about/license/ */ - -// Script: jQuery resize event -// -// *Version: 1.1, Last updated: 3/14/2010* -// -// Project Home - http://benalman.com/projects/jquery-resize-plugin/ -// GitHub - http://github.com/cowboy/jquery-resize/ -// Source - http://github.com/cowboy/jquery-resize/raw/master/jquery.ba-resize.js -// (Minified) - http://github.com/cowboy/jquery-resize/raw/master/jquery.ba-resize.min.js (1.0kb) -// -// About: License -// -// Copyright (c) 2010 "Cowboy" Ben Alman, -// Dual licensed under the MIT and GPL licenses. -// http://benalman.com/about/license/ -// -// About: Examples -// -// This working example, complete with fully commented code, illustrates a few -// ways in which this plugin can be used. -// -// resize event - http://benalman.com/code/projects/jquery-resize/examples/resize/ -// -// About: Support and Testing -// -// Information about what version or versions of jQuery this plugin has been -// tested with, what browsers it has been tested in, and where the unit tests -// reside (so you can test it yourself). -// -// jQuery Versions - 1.3.2, 1.4.1, 1.4.2 -// Browsers Tested - Internet Explorer 6-8, Firefox 2-3.6, Safari 3-4, Chrome, Opera 9.6-10.1. -// Unit Tests - http://benalman.com/code/projects/jquery-resize/unit/ -// -// About: Release History -// -// 1.1 - (3/14/2010) Fixed a minor bug that was causing the event to trigger -// immediately after bind in some circumstances. Also changed $.fn.data -// to $.data to improve performance. -// 1.0 - (2/10/2010) Initial release - -(function($, window, undefined) { - '$:nomunge'; // Used by YUI compressor. - - // A jQuery object containing all non-window elements to which the resize - // event is bound. - var elems = $([]), - - // Extend $.resize if it already exists, otherwise create it. - jq_resize = $.resize = $.extend($.resize, {}), - - timeout_id, - - // Reused strings. - str_setTimeout = 'setTimeout', - str_resize = 'resize', - str_data = str_resize + '-special-event', - str_delay = 'delay', - str_throttle = 'throttleWindow'; - - // Property: jQuery.resize.delay - // - // The numeric interval (in milliseconds) at which the resize event polling - // loop executes. Defaults to 250. - - jq_resize[str_delay] = 250; - - // Property: jQuery.resize.throttleWindow - // - // Throttle the native window object resize event to fire no more than once - // every milliseconds. Defaults to true. - // - // Because the window object has its own resize event, it doesn't need to be - // provided by this plugin, and its execution can be left entirely up to the - // browser. However, since certain browsers fire the resize event continuously - // while others do not, enabling this will throttle the window resize event, - // making event behavior consistent across all elements in all browsers. - // - // While setting this property to false will disable window object resize - // event throttling, please note that this property must be changed before any - // window object resize event callbacks are bound. - - jq_resize[str_throttle] = true; - - // Event: resize event - // - // Fired when an element's width or height changes. Because browsers only - // provide this event for the window element, for other elements a polling - // loop is initialized, running every milliseconds - // to see if elements' dimensions have changed. You may bind with either - // .resize( fn ) or .bind( "resize", fn ), and unbind with .unbind( "resize" ). - // - // Usage: - // - // > jQuery('selector').bind( 'resize', function(e) { - // > // element's width or height has changed! - // > ... - // > }); - // - // Additional Notes: - // - // * The polling loop is not created until at least one callback is actually - // bound to the 'resize' event, and this single polling loop is shared - // across all elements. - // - // Double firing issue in jQuery 1.3.2: - // - // While this plugin works in jQuery 1.3.2, if an element's event callbacks - // are manually triggered via .trigger( 'resize' ) or .resize() those - // callbacks may double-fire, due to limitations in the jQuery 1.3.2 special - // events system. This is not an issue when using jQuery 1.4+. - // - // > // While this works in jQuery 1.4+ - // > $(elem).css({ width: new_w, height: new_h }).resize(); - // > - // > // In jQuery 1.3.2, you need to do this: - // > var elem = $(elem); - // > elem.css({ width: new_w, height: new_h }); - // > elem.data( 'resize-special-event', { width: elem.width(), height: elem.height() } ); - // > elem.resize(); - - $.event.special[str_resize] = { - - // Called only when the first 'resize' event callback is bound per element. - setup: function() { - // Since window has its own native 'resize' event, return false so that - // jQuery will bind the event using DOM methods. Since only 'window' - // objects have a .setTimeout method, this should be a sufficient test. - // Unless, of course, we're throttling the 'resize' event for window. - if(!jq_resize[str_throttle] && this[str_setTimeout]) { - return false; - } - - var elem = $(this); - - // Add this element to the list of internal elements to monitor. - elems = elems.add(elem); - - // Initialize data store on the element. - $.data(this, str_data, { - w: elem.width(), - h: elem.height() - }); - - // If this is the first element added, start the polling loop. - if(elems.length === 1) { - loopy(); - } - }, - - // Called only when the last 'resize' event callback is unbound per element. - teardown: function() { - // Since window has its own native 'resize' event, return false so that - // jQuery will unbind the event using DOM methods. Since only 'window' - // objects have a .setTimeout method, this should be a sufficient test. - // Unless, of course, we're throttling the 'resize' event for window. - if(!jq_resize[str_throttle] && this[str_setTimeout]) { - return false; - } - - var elem = $(this); - - // Remove this element from the list of internal elements to monitor. - elems = elems.not(elem); - - // Remove any data stored on the element. - elem.removeData(str_data); - - // If this is the last element removed, stop the polling loop. - if(!elems.length) { - clearTimeout(timeout_id); - } - }, - - // Called every time a 'resize' event callback is bound per element (new in - // jQuery 1.4). - add: function(handleObj) { - // Since window has its own native 'resize' event, return false so that - // jQuery doesn't modify the event object. Unless, of course, we're - // throttling the 'resize' event for window. - if(!jq_resize[str_throttle] && this[str_setTimeout]) { - return false; - } - - var old_handler; - - // The new_handler function is executed every time the event is triggered. - // This is used to update the internal element data store with the width - // and height when the event is triggered manually, to avoid double-firing - // of the event callback. See the "Double firing issue in jQuery 1.3.2" - // comments above for more information. - - function new_handler(e, w, h) { - var elem = $(this), - data = $.data(this, str_data) || {}; - - // If called from the polling loop, w and h will be passed in as - // arguments. If called manually, via .trigger( 'resize' ) or .resize(), - // those values will need to be computed. - data.w = w !== undefined ? w : elem.width(); - data.h = h !== undefined ? h : elem.height(); - - old_handler.apply(this, arguments); - }; - - // This may seem a little complicated, but it normalizes the special event - // .add method between jQuery 1.4/1.4.1 and 1.4.2+ - if($.isFunction(handleObj)) { - // 1.4, 1.4.1 - old_handler = handleObj; - return new_handler; - } else { - // 1.4.2+ - old_handler = handleObj.handler; - handleObj.handler = new_handler; - } - } - - }; - - function loopy() { - - // Start the polling loop, asynchronously. - timeout_id = window[str_setTimeout](function() { - - // Iterate over all elements to which the 'resize' event is bound. - elems.each(function() { - var elem = $(this), - width = elem.width(), - height = elem.height(), - data = $.data(this, str_data); - - // If element size has changed since the last time, update the element - // data store and trigger the 'resize' event. - if(width !== data.w || height !== data.h) { - elem.trigger(str_resize, [data.w = width, data.h = height]); - } - - }); - - // Loop. - loopy(); - - }, jq_resize[str_delay]); - - }; - -})(jQuery, this); - - -/* ======================================================================== - * ZUI: storeb.js - * http://zui.sexy - * ======================================================================== - * Copyright (c) 2014-2016 cnezsoft.com; Licensed MIT - * ======================================================================== */ - - -(function(window, $) { - 'use strict'; - - var lsName = 'localStorage'; - var storage, - dataset, - pageName = 'page_' + window.location.pathname + window.location.search; - - /* The Store object */ - var Store = function() { - this.slience = true; - try { - if((lsName in window) && window[lsName] && window[lsName].setItem) { - this.enable = true; - storage = window[lsName]; - } - } catch(e){} - if(!this.enable) { - dataset = {}; - storage = { - getLength: function() { - var length = 0; - $.each(dataset, function() { - length++; - }); - return length; - }, - key: function(index) { - var key, i = 0; - $.each(dataset, function(k) { - if(i === index) { - key = k; - return false; - } - i++; - }); - return key; - }, - removeItem: function(key) { - delete dataset[key]; - }, - getItem: function(key) { - return dataset[key]; - }, - setItem: function(key, val) { - dataset[key] = val; - }, - clear: function() { - dataset = {}; - } - }; - } - this.storage = storage; - this.page = this.get(pageName, {}); - }; - - /* Save page data */ - Store.prototype.pageSave = function() { - if($.isEmptyObject(this.page)) { - this.remove(pageName); - } else { - var forDeletes = [], - i; - for(i in this.page) { - var val = this.page[i]; - if(val === null) - forDeletes.push(i); - } - for(i = forDeletes.length - 1; i >= 0; i--) { - delete this.page[forDeletes[i]]; - } - this.set(pageName, this.page); - } - }; - - /* Remove page data item */ - Store.prototype.pageRemove = function(key) { - if(typeof this.page[key] != 'undefined') { - this.page[key] = null; - this.pageSave(); - } - }; - - /* Clear page data */ - Store.prototype.pageClear = function() { - this.page = {}; - this.pageSave(); - }; - - /* Get page data */ - Store.prototype.pageGet = function(key, defaultValue) { - var val = this.page[key]; - return(defaultValue !== undefined && (val === null || val === undefined)) ? defaultValue : val; - }; - - /* Set page data */ - Store.prototype.pageSet = function(objOrKey, val) { - if($.isPlainObject(objOrKey)) { - $.extend(true, this.page, objOrKey); - } else { - this.page[this.serialize(objOrKey)] = val; - } - this.pageSave(); - }; - - /* Check enable status */ - Store.prototype.check = function() { - if(!this.enable) { - if(!this.slience) throw new Error('Browser not support localStorage or enable status been set true.'); - } - return this.enable; - }; - - /* Get length */ - Store.prototype.length = function() { - if(this.check()) { - return storage.getLength ? storage.getLength() : storage.length; - } - return 0; - }; - - /* Remove item with browser localstorage native method */ - Store.prototype.removeItem = function(key) { - storage.removeItem(key); - return this; - }; - - /* Remove item with browser localstorage native method, same as removeItem */ - Store.prototype.remove = function(key) { - return this.removeItem(key); - }; - - /* Get item value with browser localstorage native method, and without deserialize */ - Store.prototype.getItem = function(key) { - return storage.getItem(key); - }; - - /* Get item value and deserialize it, if value is null and defaultValue been given then return defaultValue */ - Store.prototype.get = function(key, defaultValue) { - var val = this.deserialize(this.getItem(key)); - if(typeof val === 'undefined' || val === null) { - if(typeof defaultValue !== 'undefined') { - return defaultValue; - } - } - return val; - }; - - /* Get item key by index and deserialize it */ - Store.prototype.key = function(index) { - return storage.key(index); - }; - - /* Set item value with browser localstorage native method, and without serialize filter */ - Store.prototype.setItem = function(key, val) { - storage.setItem(key, val); - return this; - }; - - /* Set item value, serialize it if the given value is not an string */ - Store.prototype.set = function(key, val) { - if(val === undefined) return this.remove(key); - this.setItem(key, this.serialize(val)); - return this; - }; - - /* Clear all items with browser localstorage native method */ - Store.prototype.clear = function() { - storage.clear(); - return this; - }; - - /* Iterate all items with callback */ - Store.prototype.forEach = function(callback) { - var length = this.length(); - for(var i = length - 1; i >= 0; i--) { - var key = storage.key(i); - callback(key, this.get(key)); - } - return this; - }; - - /* Get all items and set value in an object. */ - Store.prototype.getAll = function() { - var all = {}; - this.forEach(function(key, val) { - all[key] = val; - }); - - return all; - }; - - /* Serialize value with JSON.stringify */ - Store.prototype.serialize = function(value) { - if(typeof value === 'string') return value; - return JSON.stringify(value); - }; - - /* Deserialize value, with JSON.parse if the given value is not a string */ - Store.prototype.deserialize = function(value) { - if(typeof value !== 'string') return undefined; - try { - return JSON.parse(value); - } catch(e) { - return value || undefined; - } - }; - - $.zui({ - store: new Store() - }); -}(window, jQuery)); - - -/* ======================================================================== - * ZUI: searchbox.js - * http://zui.sexy - * ======================================================================== - * Copyright (c) 2014-2016 cnezsoft.com; Licensed MIT - * ======================================================================== */ - - -(function($) { - 'use strict'; - - var NAME = 'zui.searchBox'; // modal name - - // The searchbox modal class - var SearchBox = function(element, options) { - var that = this; - that.name = name; - that.$ = $(element); - - that.options = options = $.extend({}, SearchBox.DEFAULTS, that.$.data(), options); - - // Initialize here - var $input = that.$.is(options.inputSelector) ? that.$ : that.$.find(options.inputSelector); - if ($input.length) { - var clearChangeTimer = function() { - if (that.changeTimer) { - clearTimeout(that.changeTimer); - that.changeTimer = null; - } - }; - - var handleChange = function() { - clearChangeTimer(); - var value = that.getSearch(); - if (value !== that.lastValue) { - var isEmpty = value === ''; - $input.toggleClass('empty', isEmpty); - that.$.callComEvent(that, 'onSearchChange', [value, isEmpty]); - that.lastValue = value; - } - }; - - that.$input = $input = $input.first(); - that.lastValue = that.getSearch(); - - $input.on(options.listenEvent, function(params) { - that.changeTimer = setTimeout(function() { - handleChange(); - }, options.changeDelay); - }).on('focus', function(e) { - $input.addClass('focus'); - that.$.callComEvent(that, 'onFocus', [e]); - }).on('blur', function(e) { - $input.removeClass('focus'); - that.$.callComEvent(that, 'onBlur', [e]); - }).on('keydown', function(e) { - var handled = 0; - var keyCode = e.witch; - if (keyCode === 27 && options.escToClear) { // esc - this.setSearch('', true); - handleChange(); - handled = 1; - } else if (keyCode === 13 && options.onPressEnter) { - handleChange(); - that.$.callComEvent(that, 'onPressEnter', [e]); - } - var onKeyDownResult = that.$.callComEvent(that, 'onKeyDown', [e]); - if (onKeyDownResult === false) { - handled = 1; - } - if (handled) { - e.preventDefault(); - } - }); - - that.$.on('click', '.search-clear-btn', function(e) { - that.setSearch('', true); - handleChange(); - e.preventDefault(); - }); - - handleChange(); - } else { - console.error('ZUI: search box init error, cannot find search box input element.'); - } - }; - - // default options - SearchBox.DEFAULTS = { - inputSelector: 'input[type="search"],input[type="text"]', - listenEvent: 'change input paste', - changeDelay: 500, - - // onKeyDown: null, - // onFocus: null, - // onBlur: null, - // onSearchChange: null, - // onPressEnter: null, - // escToClear: true - }; - - // Get current search string - SearchBox.prototype.getSearch = function() { - return this.$input && $.trim(this.$input.val()); - }; - - // Set current search string - SearchBox.prototype.setSearch = function(value, notTriggerChange) { - var $input = this.$input; - if ($input) { - $input.val(value); - if (!notTriggerChange) { - $input.trigger('change'); - } - } - }; - - // Focus input element - SearchBox.prototype.focus = function() { - this.$input && this.$input.focus(); - }; - - // Extense jquery element - $.fn.searchBox = function(option) { - return this.each(function() { - var $this = $(this); - var data = $this.data(NAME); - var options = typeof option == 'object' && option; - - if(!data) $this.data(NAME, (data = new SearchBox(this, options))); - - if(typeof option == 'string') data[option](); - }); - }; - - SearchBox.NAME = NAME; - - $.fn.searchBox.Constructor = SearchBox; -}(jQuery)); - - -/* ======================================================================== - * ZUI: draggable.js - * http://zui.sexy - * ======================================================================== - * Copyright (c) 2014-2016 cnezsoft.com; Licensed MIT - * ======================================================================== */ - - -(function($, document) { - 'use strict'; - - var NAME = 'zui.draggable', - DEFAULTS = { - // selector: '', - container: 'body', - move: true - // mouseButton: -1 // 0, 1, 2, -1, all, left, right, middle - }; - var idIncrementer = 0; - - var Draggable = function(element, options) { - var that = this; - that.$ = $(element); - that.id = idIncrementer++; - that.options = $.extend({}, DEFAULTS, that.$.data(), options); - that.init(); - }; - - Draggable.DEFAULTS = DEFAULTS; - Draggable.NAME = NAME; - - Draggable.prototype.init = function() { - var that = this, - $root = that.$, - BEFORE = 'before', - DRAG = 'drag', - FINISH = 'finish', - eventSuffix = '.' + NAME + '.' + that.id, - mouseDownEvent = 'mousedown' + eventSuffix, - mouseUpEvent = 'mouseup' + eventSuffix, - mouseMoveEvent = 'mousemove' + eventSuffix, - setting = that.options, - selector = setting.selector, - handle = setting.handle, - $ele = $root, - isMoveFunc = $.isFunction(setting.move), - startPos, - cPos, - startOffset, - mousePos, - moved; - - var mouseMove = function(event) { - var mX = event.pageX, - mY = event.pageY; - moved = true; - var dragPos = { - left: mX - startOffset.x, - top: mY - startOffset.y - }; - - $ele.removeClass('drag-ready').addClass('dragging'); - if(setting.move) { - if (isMoveFunc) { - setting.move(dragPos, $ele); - } else { - $ele.css(dragPos); - } - } - - setting[DRAG] && setting[DRAG]({ - event: event, - element: $ele, - startOffset: startOffset, - pos: dragPos, - offset: { - x: mX - startPos.x, - y: mY - startPos.y - }, - smallOffset: { - x: mX - mousePos.x, - y: mY - mousePos.y - } - }); - mousePos.x = mX; - mousePos.y = mY; - - if(setting.stopPropagation) { - event.stopPropagation(); - } - }; - - var mouseUp = function(event) { - $(document).off(eventSuffix); - if(!moved) { - $ele.removeClass('drag-ready'); - return; - } - var endPos = { - left: event.pageX - startOffset.x, - top: event.pageY - startOffset.y - }; - $ele.removeClass('drag-ready dragging'); - if(setting.move) { - if (isMoveFunc) { - setting.move(endPos, $ele); - } else { - $ele.css(endPos); - } - } - - setting[FINISH] && setting[FINISH]({ - event: event, - element: $ele, - startOffset: startOffset, - pos: endPos, - offset: { - x: event.pageX - startPos.x, - y: event.pageY - startPos.y - }, - smallOffset: { - x: event.pageX - mousePos.x, - y: event.pageY - mousePos.y - } - }); - event.preventDefault(); - if(setting.stopPropagation) { - event.stopPropagation(); - } - }; - - var mouseDown = function(event) { - var mouseButton = $.zui.getMouseButtonCode(setting.mouseButton); - if(mouseButton > -1 && event.button !== mouseButton) { - return; - } - - var $mouseDownEle = $(this); - if(selector) { - $ele = handle ? $mouseDownEle.closest(selector) : $mouseDownEle; - } - - if(setting[BEFORE]) { - var isSure = setting[BEFORE]({ - event: event, - element: $ele - }); - if(isSure === false) return; - } - - var $container = $(setting.container), - pos = $ele.offset(); - cPos = $container.offset(); - startPos = { - x: event.pageX, - y: event.pageY - }; - startOffset = { - x: event.pageX - pos.left + cPos.left, - y: event.pageY - pos.top + cPos.top - }; - mousePos = $.extend({}, startPos); - moved = false; - - $ele.addClass('drag-ready'); - event.preventDefault(); - - if(setting.stopPropagation) { - event.stopPropagation(); - } - - $(document).on(mouseMoveEvent, mouseMove).on(mouseUpEvent, mouseUp); - }; - - if(handle) { - $root.on(mouseDownEvent, handle, mouseDown); - } else if(selector) { - $root.on(mouseDownEvent, selector, mouseDown); - } else { - $root.on(mouseDownEvent, mouseDown); - } - }; - - Draggable.prototype.destroy = function() { - var eventSuffix = '.' + NAME + '.' + this.id; - this.$.off(eventSuffix); - $(document).off(eventSuffix); - this.$.data(NAME, null); - }; - - $.fn.draggable = function(option) { - return this.each(function() { - var $this = $(this); - var data = $this.data(NAME); - var options = typeof option == 'object' && option; - - if(!data) $this.data(NAME, (data = new Draggable(this, options))); - if(typeof option == 'string') data[option](); - }); - }; - - $.fn.draggable.Constructor = Draggable; -}(jQuery, document)); - - -/* ======================================================================== - * ZUI: droppable.js - * http://zui.sexy - * ======================================================================== - * Copyright (c) 2014-2016 cnezsoft.com; Licensed MIT - * ======================================================================== */ - - -(function($, document, Math) { - 'use strict'; - - var NAME = 'zui.droppable', - DEFAULTS = { - // container: '', - // selector: '', - // handle: '', - // flex: false, - // nested: false, - target: '.droppable-target', - deviation: 5, - sensorOffsetX: 0, - sensorOffsetY: 0, - // mouseButton: -1 // 0, 1, 2, -1, all, left, right, middle - }; - var idIncrementer = 0; - - var Droppable = function(element, options) { - var that = this; - that.id = idIncrementer++; - that.$ = $(element); - that.options = $.extend({}, DEFAULTS, that.$.data(), options); - that.init(); - }; - - Droppable.DEFAULTS = DEFAULTS; - Droppable.NAME = NAME; - - Droppable.prototype.trigger = function(name, params) { - return $.zui.callEvent(this.options[name], params, this); - }; - - Droppable.prototype.init = function() { - var that = this, - $root = that.$, - setting = that.options, - deviation = setting.deviation, - eventSuffix = '.' + NAME + '.' + that.id, - mouseDownEvent = 'mousedown' + eventSuffix, - mouseUpEvent = 'mouseup' + eventSuffix, - mouseMoveEvent = 'mousemove' + eventSuffix, - selector = setting.selector, - handle = setting.handle, - flex = setting.flex, - container = setting.container, - canMoveHere = setting.canMoveHere, - $ele = $root, - isMouseDown = false, - $container = container ? $(setting.container).first() : (selector ? $root : $('body')), - $targets, - $target, - $shadow, - isIn, - isSelf, - oldCssPosition, - startOffset, - startMouseOffset, - containerOffset, - clickOffset, - mouseOffset, - lastMouseOffset, - mouseDownBackEventCall; - - var mouseMove = function(event) { - if(!isMouseDown) return; - - mouseOffset = {left: event.pageX, top: event.pageY}; - - // ignore small move - if(Math.abs(mouseOffset.left - startMouseOffset.left) < deviation && Math.abs(mouseOffset.top - startMouseOffset.top) < deviation) return; - - if($shadow === null) // create shadow - { - var cssPosition = $container.css('position'); - if(cssPosition != 'absolute' && cssPosition != 'relative' && cssPosition != 'fixed') { - oldCssPosition = cssPosition; - $container.css('position', 'relative'); - } - - $shadow = $ele.clone().removeClass('drag-from').addClass('drag-shadow').css({ - position: 'absolute', - width: $ele.outerWidth(), - transition: 'none' - }).appendTo($container); - $ele.addClass('dragging'); - - that.trigger('start', { - event: event, - element: $ele - }); - } - - var offset = { - left: mouseOffset.left - clickOffset.left, - top: mouseOffset.top - clickOffset.top - }; - var position = { - left: offset.left - containerOffset.left, - top: offset.top - containerOffset.top - }; - $shadow.css(position); - $.extend(lastMouseOffset, mouseOffset); - - var isNew = false; - isIn = false; - - if(!flex) { - $targets.removeClass('drop-to'); - } - - var $newTarget = null; - $targets.each(function() { - var t = $(this), - tPos = t.offset(), - tW = t.outerWidth(), - tH = t.outerHeight(), - tX = tPos.left + setting.sensorOffsetX, - tY = tPos.top + setting.sensorOffsetY; - - if(mouseOffset.left > tX && mouseOffset.top > tY && mouseOffset.left < (tX + tW) && mouseOffset.top < (tY + tH)) { - if($newTarget) $newTarget.removeClass('drop-to'); - $newTarget = t; - if(!setting.nested) return false; - } - }); - - if($newTarget) { - isIn = true; - var id = $newTarget.data('id'); - if($ele.data('id') != id) isSelf = false; - if($target === null || ($target.data('id') !== id && (!isSelf))) isNew = true; - $target = $newTarget; - if(flex) { - $targets.removeClass('drop-to'); - } - $target.addClass('drop-to'); - } - - - if(!flex) { - $ele.toggleClass('drop-in', isIn); - $shadow.toggleClass('drop-in', isIn); - } else if($target !== null && $target.length) { - isIn = true; - } - - if(!canMoveHere || canMoveHere($ele, $target) !== false) { - that.trigger('drag', { - event: event, - isIn: isIn, - target: $target, - element: $ele, - isNew: isNew, - selfTarget: isSelf, - clickOffset: clickOffset, - offset: offset, - position: { - left: offset.left - containerOffset.left, - top: offset.top - containerOffset.top - }, - mouseOffset: mouseOffset - }); - } - - event.preventDefault(); - }; - - var mouseUp = function(event) { - $(document).off(eventSuffix); - clearTimeout(mouseDownBackEventCall); - if(!isMouseDown) return; - - isMouseDown = false; - - if(oldCssPosition) { - $container.css('position', oldCssPosition); - } - - if($shadow === null) { - $ele.removeClass('drag-from'); - that.trigger('always', { - event: event, - cancel: true - }); - return; - } - - if(!isIn) $target = null; - var isSure = true; - mouseOffset = event ? { - left: event.pageX, - top: event.pageY - } : lastMouseOffset; - var offset = { - left: mouseOffset.left - clickOffset.left, - top: mouseOffset.top - clickOffset.top - }; - var moveOffset = { - left: mouseOffset.left - lastMouseOffset.left, - top: mouseOffset.top - lastMouseOffset.top - }; - lastMouseOffset.left = mouseOffset.left; - lastMouseOffset.top = mouseOffset.top; - var eventOptions = { - event: event, - isIn: isIn, - target: $target, - element: $ele, - isNew: (!isSelf) && $target !== null, - selfTarget: isSelf, - offset: offset, - mouseOffset: mouseOffset, - position: { - left: offset.left - containerOffset.left, - top: offset.top - containerOffset.top - }, - lastMouseOffset: lastMouseOffset, - moveOffset: moveOffset - }; - - isSure = that.trigger('beforeDrop', eventOptions); - - if(isSure && isIn) { - that.trigger('drop', eventOptions); - } - - $targets.removeClass('drop-to'); - $ele.removeClass('dragging').removeClass('drag-from'); - $shadow.remove(); - $shadow = null; - - that.trigger('finish', eventOptions); - that.trigger('always', eventOptions); - - if(event) event.preventDefault(); - }; - - var mouseDown = function(event) { - var mouseButton = $.zui.getMouseButtonCode(setting.mouseButton); - if(mouseButton > -1 && event.button !== mouseButton) { - return; - } - - var $mouseDownEle = $(this); - if(selector) { - $ele = handle ? $mouseDownEle.closest(selector) : $mouseDownEle; - } - - if($ele.hasClass('drag-shadow')) { - return; - } - - if(setting['before']) { - if(setting['before']({ - event: event, - element: $ele - }) === false) return; - } - - isMouseDown = true; - $targets = $.isFunction(setting.target) ? setting.target($root) : $container.find(setting.target), - $target = null, - $shadow = null, - isIn = false, - isSelf = true, - oldCssPosition = null, - startOffset = $ele.offset(), - containerOffset = $container.offset(); - startMouseOffset = {left: event.pageX, top: event.pageY}; - lastMouseOffset = $.extend({}, startMouseOffset); - clickOffset = { - left: startMouseOffset.left - startOffset.left, - top: startMouseOffset.top - startOffset.top - }; - - $ele.addClass('drag-from'); - $(document).on(mouseMoveEvent, mouseMove).on(mouseUpEvent, mouseUp); - mouseDownBackEventCall = setTimeout(function() { - $(document).on(mouseDownEvent, mouseUp); - }, 10); - event.preventDefault(); - }; - - if(handle) { - $root.on(mouseDownEvent, handle, mouseDown); - } else if(selector) { - $root.on(mouseDownEvent, selector, mouseDown); - } else { - $root.on(mouseDownEvent, mouseDown); - } - }; - - Droppable.prototype.destroy = function() { - var eventSuffix = '.' + NAME + '.' + this.id; - this.$.off(eventSuffix); - $(document).off(eventSuffix); - this.$.data(NAME, null); - }; - - Droppable.prototype.reset = function() { - this.destroy(); - this.init(); - }; - - $.fn.droppable = function(option) { - return this.each(function() { - var $this = $(this); - var data = $this.data(NAME); - var options = typeof option == 'object' && option; - - if(!data) $this.data(NAME, (data = new Droppable(this, options))); - - if(typeof option == 'string') data[option](); - }); - }; - - $.fn.droppable.Constructor = Droppable; -}(jQuery, document, Math)); - -/* ======================================================================== - * Bootstrap: modal.js v3.2.0 - * http://getbootstrap.com/javascript/#modals - * - * ZUI: The file has been changed in ZUI. It will not keep update with the - * Bootsrap version in the future. - * http://zui.sexy - * ======================================================================== - * Copyright 2011-2014 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== - * Updates in ZUI: - * 1. changed event namespace to *.zui.modal - * 2. added position option to ajust poisition of modal - * 3. added event 'escaping.zui.modal' with an param 'esc' to judge the esc - * key down - * 4. get moveable options value from '.modal-moveable' on '.modal-dialog' - * 5. add setMoveable method to make modal dialog moveable - * ======================================================================== */ - -+ function($) { - 'use strict'; - - // MODAL CLASS DEFINITION - // ====================== - - var zuiname = 'zui.modal' - var Modal = function(element, options) { - var that = this; - that.options = options - that.$body = $(document.body) - that.$element = $(element) - that.$backdrop = - that.isShown = null - that.scrollbarWidth = 0 - - if(options.moveable === undefined) { - that.options.moveable = that.$element.hasClass('modal-moveable'); - } - - if(options.remote) { - that.$element - .find('.modal-content') - .load(options.remote, function() { - that.$element.trigger('loaded.' + zuiname) - }) - } - } - - Modal.VERSION = '3.2.0' - - Modal.TRANSITION_DURATION = 300 - Modal.BACKDROP_TRANSITION_DURATION = 150 - - Modal.DEFAULTS = { - backdrop: true, - keyboard: true, - show: true, - // rememberPos: false, - // moveable: false, - position: 'fit' // 'center' or '40px' or '10%' - }; - - var setDialogPos = function($dialog, pos) { - var $window = $(window); - pos.left = Math.max(0, Math.min(pos.left, $window.width() - $dialog.outerWidth())); - pos.top = Math.max(0, Math.min(pos.top, $window.height() - $dialog.outerHeight())); - $dialog.css(pos); - }; - - Modal.prototype.toggle = function(_relatedTarget, position) { - return this.isShown ? this.hide() : this.show(_relatedTarget, position) - } - - Modal.prototype.ajustPosition = function(position) { - var that = this; - var options = that.options; - if(typeof position === 'undefined') position = options.position; - if(typeof position === 'undefined') return; - var $dialog = that.$element.find('.modal-dialog'); - // if($dialog.hasClass('modal-dragged')) return; - - var half = Math.max(0, ($(window).height() - $dialog.outerHeight()) / 2); - var topPos = position == 'fit' ? (half * 2 / 3) : (position == 'center' ? half : position); - if($dialog.hasClass('modal-moveable')) { - var pos = null; - var rememberPos = options.rememberPos; - if(rememberPos) { - if(rememberPos === true) { - pos = that.$element.data('modal-pos'); - } else if($.zui.store) { - pos = $.zui.store.pageGet(zuiname + '.rememberPos.' + rememberPos); - } - } - if(!pos) { - pos = { - left: Math.max(0, ($(window).width() - $dialog.outerWidth()) / 2), - top: topPos - }; - } - if (options.moveable === 'inside') { - setDialogPos($dialog, pos); - } else { - $dialog.css(pos); - } - } else { - $dialog.css('margin-top', topPos); - } - } - - Modal.prototype.setMoveale = function() { - if(!$.fn.draggable) console.error('Moveable modal requires draggable.js.'); - var that = this; - var options = that.options; - var $dialog = that.$element.find('.modal-dialog').removeClass('modal-dragged'); - $dialog.toggleClass('modal-moveable', !!options.moveable); - - if(!that.$element.data('modal-moveable-setup')) { - $dialog.draggable({ - container: that.$element, - handle: '.modal-header', - before: function() { - $dialog.css('margin-top', '').addClass('modal-dragged'); - }, - finish: function(e) { - var rememberPos = options.rememberPos; - if(rememberPos) { - that.$element.data('modal-pos', e.pos); - if($.zui.store && rememberPos !== true) { - $.zui.store.pageSet(zuiname + '.rememberPos.' + rememberPos, e.pos); - } - } - }, - move: options.moveable === 'inside' ? function (dragPos) { - setDialogPos($dialog, dragPos); - } : true - }); - } - } - - Modal.prototype.show = function(_relatedTarget, position) { - var that = this - var e = $.Event('show.' + zuiname, { - relatedTarget: _relatedTarget - }) - - that.$element.trigger(e) - - if(that.isShown || e.isDefaultPrevented()) return - - that.isShown = true - - if(that.options.moveable) that.setMoveale(); - - that.checkScrollbar() - that.$body.addClass('modal-open') - - that.setScrollbar() - that.escape() - - that.$element.on('click.dismiss.' + zuiname, '[data-dismiss="modal"]', $.proxy(that.hide, that)) - - that.backdrop(function() { - var transition = $.support.transition && that.$element.hasClass('fade') - - if(!that.$element.parent().length) { - that.$element.appendTo(that.$body) // don't move modals dom position - } - - that.$element - .show() - .scrollTop(0) - - if(transition) { - that.$element[0].offsetWidth // force reflow - } - - that.$element - .addClass('in') - .attr('aria-hidden', false) - - that.ajustPosition(position); - - that.enforceFocus() - - var e = $.Event('shown.' + zuiname, { - relatedTarget: _relatedTarget - }) - - transition ? - that.$element.find('.modal-dialog') // wait for modal to slide in - .one('bsTransitionEnd', function() { - that.$element.trigger('focus').trigger(e) - }) - .emulateTransitionEnd(Modal.TRANSITION_DURATION) : - that.$element.trigger('focus').trigger(e) - }) - } - - Modal.prototype.hide = function(e) { - if(e) e.preventDefault() - - e = $.Event('hide.' + zuiname) - - this.$element.trigger(e) - - if(!this.isShown || e.isDefaultPrevented()) return - - this.isShown = false - - this.$body.removeClass('modal-open') - - this.resetScrollbar() - this.escape() - - $(document).off('focusin.' + zuiname) - - this.$element - .removeClass('in') - .attr('aria-hidden', true) - .off('click.dismiss.' + zuiname) - - $.support.transition && this.$element.hasClass('fade') ? - this.$element - .one('bsTransitionEnd', $.proxy(this.hideModal, this)) - .emulateTransitionEnd(Modal.TRANSITION_DURATION) : - this.hideModal() - } - - Modal.prototype.enforceFocus = function() { - $(document) - .off('focusin.' + zuiname) // guard against infinite focus loop - .on('focusin.' + zuiname, $.proxy(function(e) { - if(this.$element[0] !== e.target && !this.$element.has(e.target).length) { - this.$element.trigger('focus') - } - }, this)) - } - - Modal.prototype.escape = function() { - if(this.isShown && this.options.keyboard) { - $(document).on('keydown.dismiss.' + zuiname, $.proxy(function(e) { - if(e.which == 27) { - var et = $.Event('escaping.' + zuiname) - var result = this.$element.triggerHandler(et, 'esc') - if(result != undefined && (!result)) return - this.hide() - } - }, this)) - } else if(!this.isShown) { - $(document).off('keydown.dismiss.' + zuiname) - } - } - - Modal.prototype.hideModal = function() { - var that = this - this.$element.hide() - this.backdrop(function() { - that.$element.trigger('hidden.' + zuiname) - }) - } - - Modal.prototype.removeBackdrop = function() { - this.$backdrop && this.$backdrop.remove() - this.$backdrop = null - } - - Modal.prototype.backdrop = function(callback) { - var that = this - var animate = this.$element.hasClass('fade') ? 'fade' : '' - - if(this.isShown && this.options.backdrop) { - var doAnimate = $.support.transition && animate - - this.$backdrop = $('
  • '); - } - var $a = $('').attr({ - href: item.url || '###', - 'class': item.className, - style: item.style - }).data('item', item); - if (item.html) { - $a.html(item.html === true ? (item.label || item.text) : item.html); - } else { - $a.text(item.label || item.text); - } - if (item.onClick) { - $a.on('click', item.onClick); - } - return $('
  • ').toggleClass('disabled', item.disabled === true).append($a); - }; - - var animationTimer = null; - var hideContextMenu = function(id, callback) { - if (typeof id === 'function') { - callback = id; - id = null; - } - - if (animationTimer) { - clearTimeout(animationTimer); - animationTimer = null; - } - - var $target = $('#' + targetId); - if ($target.length) { - var options = $target.data('options'); - if (!id || options.id === id) { - var afterHide = function() { - $target.hide(); - options.onHidden && options.onHidden(); - callback && callback(); - }; - options.onHide && options.onHide(); - var animation = options.animation; - $target.removeClass('in'); - if (animation) { - animationTimer = setTimeout(afterHide, options.duration); - } else { - afterHide(); - } - } - } - return ContextMenu; - }; - - var showContextMenu = function(items, options, callback) { - if ($.isPlainObject(items)) { - callback = options; - options = items; - items = options.items; - } - - isShowingMenu = true; - // hideContextMenu(); - - options = $.extend({}, DEFAULTS, options); - var x = options.x; - var y = options.y; - if (x === undefined) x = (options.event || options).clientX; - if (x === undefined) x = mouseX; - if (y === undefined) y = (options.event || options).clientY; - if (y === undefined) y = mouseY; - - var $target = $('#' + targetId); - if (!$target.length) { - $target = $('').appendTo('body'); - } - var $menu = $target.find('.contextmenu-menu').off('click.' + NAME).on('click.' + NAME, 'a', function(e) { - var $item = $(this); - var clickResult = options.onClickItem && options.onClickItem($item.data('item'), $item, e); - if (clickResult !== false) { - hideContextMenu(); - } - }).empty();; - $target.hide().attr('class', 'contextmenu'); - var itemCreator = options.itemCreator || createMenuItem; - var itemsType = typeof items; - if (itemsType === 'string') { - items = items.split(','); - } else if (itemsType === 'function') { - items = items(options); - } - $.each(items, function(index, item) { - $menu.append(itemCreator(item, index, options)); - }); - - // Show menu - var animation = options.animation; - var duration = options.duration; - if (animation === true) options.animation = animation = 'fade'; - if (animationTimer) { - clearTimeout(animationTimer); - animationTimer = null; - } - var afterShow = function() { - $target.addClass('in'); - options.onShown && options.onShown(); - callback && callback(); - }; - options.onShow && options.onShow(); - $target.data('options', { - animation: animation, - onHide: options.onHide, - onHidden: options.onHidden, - id: options.id, - duration: duration - }); - - var $w = $(window); - x = Math.max(0, Math.min(x, $w.width() - $menu.outerWidth())); - y = Math.max(0, Math.min(y, $w.height() - $menu.outerHeight())); - $target.css({ - left: x, - top: y - }); - - if (animation) { - $target.addClass('open').addClass(animation).show(); - animationTimer = setTimeout(function() { - afterShow(); - isShowingMenu = false; - }, options.duration); - } else { - $target.addClass('open').show(); - afterShow(); - animationTimer = setTimeout(function() { - isShowingMenu = false; - }, 200); - } - return ContextMenu; - }; - - $(document).on('click', function(e) { - if (!isShowingMenu && !$(e.target).closest('.contextmenu').length) { - hideContextMenu(); - } - }); - - $.extend(ContextMenu, { - NAME: NAME, - DEFAULTS: DEFAULTS, - show: showContextMenu, - hide: hideContextMenu, - listenMouse: listenMouseMove - }); - $.zui({ContextMenu: ContextMenu}); - - - // The contextmenu model class - var ContextListener = function(element, options) { - var that = this; - that.name = NAME; - that.$ = $(element); - - options = that.options = $.extend({trigger: 'contextmenu'}, ContextMenu.DEFAULTS, this.$.data(), options); - - var trigger = options.trigger; - - that.id = $.zui.uuid(); - var eventHandler = function(e) { - if (e.type === 'mousedown' && e.button !== 2) { - return; - } - var config = { - x: e.clientX, - y: e.clientY, - event: e - }; - if (options.itemsCreator) { - config.items = options.itemsCreator.call(this, e); - } - that.show(config); - e.preventDefault(); - e.returnValue = false; // 解决IE8右键弹出 - return false; - }; - var eventName = trigger + '.' + NAME; - if (options.selector) { - that.$.on(eventName, options.selector, eventHandler); - } else { - that.$.on(eventName, eventHandler); - } - }; - - ContextListener.prototype.destory = function () { - that.$.off('.' + NAME); - }; - - ContextListener.prototype.hide = function (callback) { - ContextMenu.hide(this.id, callback); - }; - - ContextListener.prototype.show = function (options, callback) { - options = $.extend({}, this.options, options); - ContextMenu.show(options, callback); - }; - - // Extense jquery element - $.fn.contextmenu = function(option) { - return this.each(function() { - var $this = $(this); - var data = $this.data(NAME); - var options = typeof option == 'object' && option; - - if(!data) $this.data(NAME, (data = new ContextListener(this, options))); - - if(typeof option == 'string') data[option](); - }); - }; - $.fn.contextmenu.Constructor = ContextListener; -}(jQuery, undefined)); - - -/* ======================================================================== - * ZUI: messager.js - * http://zui.sexy - * ======================================================================== - * Copyright (c) 2014-2016 cnezsoft.com; Licensed MIT - * ======================================================================== */ - - -(function($, window, undefined) { - 'use strict'; - - var id = 0; - var template = ''; - var defaultOptions = { - type: 'default', - placement: 'top', - time: 4000, - parent: 'body', - // clear: false, - icon: null, - close: true, - // actions: [{icon, name, action, title}], - // contentClass: null, - // cssClass: null, - // onAction: function, - fade: true, - scale: true - }; - var all = {}; - - var Messager = function(message, options) { - if($.isPlainObject(message)) { - options = message; - message = options.message; - } - - var that = this; - options = that.options = $.extend({}, defaultOptions, options); - - that.id = options.id || (id++); - var oldMessager = all[that.id]; - if(oldMessager) oldMessager.destroy(); - all[that.id] = that; - that.message = (options.icon ? ' ' : '') + message; - - that.$ = $(template.format(options)).toggleClass('fade', options.fade).toggleClass('scale', options.scale).attr('id', 'messager-' + that.id); - - if(options.cssClass) that.$.addClass(options.cssClass); - - var hasCloseAction = false; - var $actions = that.$.find('.messager-actions'); - var appendAction = function(action) { - var $btn = $('').appendTo("body").data(i,r);var d=function(e,i){var n=o[e];t.isFunction(n)&&c.on(i+s,n)};d("onShow","show"),d("shown","shown"),d("onHide","hide"),d("hidden","hidden"),d("loaded","loaded"),c.on("shown"+s,function(){r.isShown=!0}).on("hidden"+s,function(){r.isShown=!1}),this.$modal=c,this.$dialog=c.find(".modal-dialog"),o.mergeOptions&&(this.options=o)},o.prototype.show=function(s){var o=t.extend({},this.options,{url:this.$trigger?this.$trigger.attr("href")||this.$trigger.attr("data-url")||this.$trigger.data("url"):this.options.url},s);this.init(o);var r=this,l=this.$modal,h=this.$dialog,c=o.custom,d=h.find(".modal-body").css("padding",""),u=h.find(".modal-header"),p=h.find(".modal-content");l.toggleClass("fade",o.fade).addClass(o.className).toggleClass("modal-loading",!this.isShown),h.toggleClass("modal-md","md"===o.size).toggleClass("modal-sm","sm"===o.size).toggleClass("modal-lg","lg"===o.size).toggleClass("modal-fullscreen","fullscreen"===o.size),u.toggle(o.showHeader),u.find(".modal-icon").attr("class","modal-icon icon-"+o.icon),u.find(".modal-title-name").text(o.title||""),o.size&&"fullscreen"===o.size&&(o.width="",o.height="");var f=function(){clearTimeout(this.resizeTask),this.resizeTask=setTimeout(function(){r.ajustPosition()},100)},g=function(t,e){return"undefined"==typeof t&&(t=o.delay),setTimeout(function(){h=l.find(".modal-dialog"),o.width&&"auto"!=o.width&&h.css("width",o.width),o.height&&"auto"!=o.height&&(h.css("height",o.height),"iframe"===o.type&&d.css("height",h.height()-u.outerHeight())),r.ajustPosition(o.position),l.removeClass("modal-loading"),"iframe"!=o.type&&h.off("resize."+i).on("resize."+i,f),e&&e()},t)};if("custom"===o.type&&c)if(t.isFunction(c)){var m=c({modal:l,options:o,modalTrigger:r,ready:g});typeof m===a&&(d.html(m),g())}else c instanceof t?(d.html(t("
    ").append(c.clone()).html()),g()):(d.html(c),g());else if(o.url){var v=function(){var t=l.callComEvent(r,"broken");t&&(d.html(t),g())};if(l.attr("ref",o.url),"iframe"===o.type){l.addClass("modal-iframe"),this.firstLoad=!0;var y="iframe-"+o.name;u.detach(),d.detach(),p.empty().append(u).append(d),d.css("padding",0).html(''),o.waittime>0&&(r.waitTimeout=g(o.waittime,v));var w=document.getElementById(y);w.onload=w.onreadystatechange=function(){if(r.firstLoad&&l.addClass("modal-loading"),!this.readyState||"complete"==this.readyState){r.firstLoad=!1,o.waittime>0&&clearTimeout(r.waitTimeout);try{l.attr("ref",w.contentWindow.location.href);var t=e.frames[y].$;if(t&&"auto"===o.height&&"fullscreen"!=o.size){var n=t("body").addClass("body-modal");o.iframeBodyClass&&n.addClass(o.iframeBodyClass);var s=function(t){l.removeClass("fade");var e=n.outerHeight();t===!0&&o.onlyIncreaseHeight&&(e=Math.max(e,d.data("minModalHeight")||0),d.data("minModalHeight",e)),d.css("height",e),o.fade&&l.addClass("fade"),g()};l.callComEvent(r,"loaded",{modalType:"iframe",jQuery:t}),setTimeout(s,100),n.off("resize."+i).on("resize."+i,f)}else g();t.extend({closeModal:e.closeModal})}catch(a){g()}}}}else t.ajax(t.extend({url:o.url,success:function(e){try{var i=t(e);i.hasClass("modal-dialog")?h.replaceWith(i):i.hasClass("modal-content")?h.find(".modal-content").replaceWith(i):d.wrapInner(i)}catch(s){l.html(e)}l.callComEvent(r,"loaded",{modalType:n}),g()},error:v},o.ajaxOptions))}l.modal({show:"show",backdrop:o.backdrop,moveable:o.moveable,rememberPos:o.rememberPos,keyboard:o.keyboard})},o.prototype.close=function(i,n){(i||n)&&this.$modal.on("hidden"+s,function(){t.isFunction(i)&&i(),typeof n===a&&("this"===n?e.location.reload():e.location=n)}),this.$modal.modal("hide")},o.prototype.toggle=function(t){this.isShown?this.close():this.show(t)},o.prototype.ajustPosition=function(t){this.$modal.modal("ajustPosition",t||this.options.position)},t.zui({ModalTrigger:o,modalTrigger:new o}),t.fn.modalTrigger=function(e,n){return t(this).each(function(){var s=t(this),r=s.data(i),l=t.extend({title:s.attr("title")||s.text(),url:s.attr("href"),type:s.hasClass("iframe")?"iframe":""},s.data(),t.isPlainObject(e)&&e);r||s.data(i,r=new o(l,s)),typeof e==a?r[e](n):l.show&&r.show(n),s.on((l.trigger||"click")+".toggle."+i,function(t){r.toggle(l),s.is("a")&&t.preventDefault()})})};var r=t.fn.modal;t.fn.modal=function(e,i){return t(this).each(function(){var n=t(this);n.hasClass("modal")?r.call(n,e,i):n.modalTrigger(e,i)})};var l=function(e){var i=typeof e;return"undefined"===i?e=t(".modal.modal-trigger"):i===a&&(e=t(e)),e&&e instanceof t?e:null},h=function(e,n,s){if(t.isFunction(e)){var a=s;s=n,n=e,e=a}e=l(e),e&&e.length&&e.each(function(){t(this).data(i).close(n,s)})},c=function(t,e){e=l(e),e&&e.length&&e.modal("ajustPosition",t)};t.zui({closeModal:h,ajustModalPosition:c}),t(document).on("click."+i+".data-api",'[data-toggle="modal"]',function(e){var n=t(this),s=n.attr("href"),a=null;try{a=t(n.attr("data-target")||s&&s.replace(/.*(?=#[^\s]+$)/,""))}catch(o){}a&&a.length||(n.data(i)?n.trigger(".toggle."+i):n.modalTrigger({show:!0})),n.is("a")&&e.preventDefault()})}(window.jQuery,window),+function(t){"use strict";var e=function(t,e){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.init("tooltip",t,e)};e.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'
    ',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},e.prototype.init=function(e,i,n){this.enabled=!0,this.type=e,this.$element=t(i),this.options=this.getOptions(n);for(var s=this.options.trigger.split(" "),a=s.length;a--;){var o=s[a];if("click"==o)this.$element.on("click."+this.type,this.options.selector,t.proxy(this.toggle,this));else if("manual"!=o){var r="hover"==o?"mouseenter":"focus",l="hover"==o?"mouseleave":"blur";this.$element.on(r+"."+this.type,this.options.selector,t.proxy(this.enter,this)),this.$element.on(l+"."+this.type,this.options.selector,t.proxy(this.leave,this))}}this.options.selector?this._options=t.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},e.prototype.getDefaults=function(){return e.DEFAULTS},e.prototype.getOptions=function(e){return e=t.extend({},this.getDefaults(),this.$element.data(),e),e.delay&&"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),e},e.prototype.getDelegateOptions=function(){var e={},i=this.getDefaults();return this._options&&t.each(this._options,function(t,n){i[t]!=n&&(e[t]=n)}),e},e.prototype.enter=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget)[this.type](this.getDelegateOptions()).data("zui."+this.type);return clearTimeout(i.timeout),i.hoverState="in",i.options.delay&&i.options.delay.show?void(i.timeout=setTimeout(function(){"in"==i.hoverState&&i.show()},i.options.delay.show)):i.show()},e.prototype.leave=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget)[this.type](this.getDelegateOptions()).data("zui."+this.type);return clearTimeout(i.timeout),i.hoverState="out",i.options.delay&&i.options.delay.hide?void(i.timeout=setTimeout(function(){"out"==i.hoverState&&i.hide()},i.options.delay.hide)):i.hide()},e.prototype.show=function(e){var i=t.Event("show.zui."+this.type);if((e||this.hasContent())&&this.enabled){var n=this;if(n.$element.trigger(i),i.isDefaultPrevented())return;var s=n.tip();n.setContent(e),n.options.animation&&s.addClass("fade");var a="function"==typeof n.options.placement?n.options.placement.call(n,s[0],n.$element[0]):n.options.placement,o=/\s?auto?\s?/i,r=o.test(a);r&&(a=a.replace(o,"")||"top"),s.detach().css({top:0,left:0,display:"block"}).addClass(a),n.options.container?s.appendTo(n.options.container):s.insertAfter(n.$element);var l=n.getPosition(),h=s[0].offsetWidth,c=s[0].offsetHeight;if(r){var d=n.$element.parent(),u=a,p=document.documentElement.scrollTop||document.body.scrollTop,f="body"==n.options.container?window.innerWidth:d.outerWidth(),g="body"==n.options.container?window.innerHeight:d.outerHeight(),m="body"==n.options.container?0:d.offset().left;a="bottom"==a&&l.top+l.height+c-p>g?"top":"top"==a&&l.top-p-c<0?"bottom":"right"==a&&l.right+h>f?"left":"left"==a&&l.left-h

    '}),e.prototype=t.extend({},t.fn.tooltip.Constructor.prototype),e.prototype.constructor=e,e.prototype.getDefaults=function(){return e.DEFAULTS},e.prototype.setContent=function(){var t=this.tip(),e=this.getTarget();if(e)return e.find(".arrow").length<1&&t.addClass("no-arrow"),void t.html(e.html());var i=this.getTitle(),n=this.getContent();t.find(".popover-title")[this.options.html?"html":"text"](i),t.find(".popover-content")[this.options.html?"html":"text"](n),t.removeClass("fade top bottom left right in"),this.options.tipId&&t.attr("id",this.options.tipId),this.options.tipClass&&t.addClass(this.options.tipClass),t.find(".popover-title").html()||t.find(".popover-title").hide()},e.prototype.hasContent=function(){return this.getTarget()||this.getTitle()||this.getContent()},e.prototype.getContent=function(){var t=this.$element,e=this.options;return t.attr("data-content")||("function"==typeof e.content?e.content.call(t[0]):e.content)},e.prototype.getTarget=function(){var e=this.$element,i=this.options,n=e.attr("data-target")||("function"==typeof i.target?i.target.call(e[0]):i.target);return!!n&&("$next"==n?e.next(".popover"):t(n))},e.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},e.prototype.tip=function(){return this.$tip||(this.$tip=t(this.options.template)),this.$tip};var i=t.fn.popover;t.fn.popover=function(i){return this.each(function(){var n=t(this),s=n.data("zui.popover"),a="object"==typeof i&&i;s||n.data("zui.popover",s=new e(this,a)),"string"==typeof i&&s[i]()})},t.fn.popover.Constructor=e,t.fn.popover.noConflict=function(){return t.fn.popover=i,this}}(window.jQuery),+function(t){"use strict"; +function e(){t(s).remove(),t(a).each(function(e){var s=i(t(this));s.hasClass("open")&&(s.trigger(e=t.Event("hide."+n)),e.isDefaultPrevented()||s.removeClass("open").trigger("hidden."+n))})}function i(e){var i=e.attr("data-target");i||(i=e.attr("href"),i=i&&/#/.test(i)&&i.replace(/.*(?=#[^\s]*$)/,""));var n;try{n=i&&t(i)}catch(s){}return n&&n.length?n:e.parent()}var n="zui.dropdown",s=".dropdown-backdrop",a="[data-toggle=dropdown]",o=function(e){t(e).on("click."+n,this.toggle)};o.prototype.toggle=function(s){var a=t(this);if(!a.is(".disabled, :disabled")){var o=i(a),r=o.hasClass("open");if(e(),!r){if("ontouchstart"in document.documentElement&&!o.closest(".navbar-nav").length&&t('
  • ');var n=t("").attr({href:e.url||"###","class":e.className,style:e.style}).data("item",e);return e.html?n.html(e.html===!0?e.label||e.text:e.html):n.text(e.label||e.text),e.onClick&&n.on("click",e.onClick),t("
  • ").toggleClass("disabled",e.disabled===!0).append(n)},d=null,u=function(e,i){"function"==typeof e&&(i=e,e=null),d&&(clearTimeout(d),d=null);var n=t("#"+o);if(n.length){var s=n.data("options");if(!e||s.id===e){var r=function(){n.hide(),s.onHidden&&s.onHidden(),i&&i()};s.onHide&&s.onHide();var l=s.animation;n.removeClass("in"),l?d=setTimeout(r,s.duration):r()}}return a},p=function(h,p,f){t.isPlainObject(h)&&(f=p,p=h,h=p.items),s=!0,p=t.extend({},n,p);var g=p.x,m=p.y;g===e&&(g=(p.event||p).clientX),g===e&&(g=r),m===e&&(m=(p.event||p).clientY),m===e&&(m=l);var v=t("#"+o);v.length||(v=t('').appendTo("body"));var y=v.find(".contextmenu-menu").off("click."+i).on("click."+i,"a",function(e){var i=t(this),n=p.onClickItem&&p.onClickItem(i.data("item"),i,e);n!==!1&&u()}).empty();v.hide().attr("class","contextmenu");var w=p.itemCreator||c,b=typeof h;"string"===b?h=h.split(","):"function"===b&&(h=h(p)),t.each(h,function(t,e){y.append(w(e,t,p))});var C=p.animation,x=p.duration;C===!0&&(p.animation=C="fade"),d&&(clearTimeout(d),d=null);var T=function(){v.addClass("in"),p.onShown&&p.onShown(),f&&f()};p.onShow&&p.onShow(),v.data("options",{animation:C,onHide:p.onHide,onHidden:p.onHidden,id:p.id,duration:x});var k=t(window);return g=Math.max(0,Math.min(g,k.width()-y.outerWidth())),m=Math.max(0,Math.min(m,k.height()-y.outerHeight())),v.css({left:g,top:m}),C?(v.addClass("open").addClass(C).show(),d=setTimeout(function(){T(),s=!1},p.duration)):(v.addClass("open").show(),T(),d=setTimeout(function(){s=!1},200)),a};t(document).on("click",function(e){s||t(e.target).closest(".contextmenu").length||u()}),t.extend(a,{NAME:i,DEFAULTS:n,show:p,hide:u,listenMouse:h}),t.zui({ContextMenu:a});var f=function(e,n){var s=this;s.name=i,s.$=t(e),n=s.options=t.extend({trigger:"contextmenu"},a.DEFAULTS,this.$.data(),n);var o=n.trigger;s.id=t.zui.uuid();var r=function(t){if("mousedown"!==t.type||2===t.button){var e={x:t.clientX,y:t.clientY,event:t};return n.itemsCreator&&(e.items=n.itemsCreator.call(this,t)),s.show(e),t.preventDefault(),t.returnValue=!1,!1}},l=o+"."+i;n.selector?s.$.on(l,n.selector,r):s.$.on(l,r)};f.prototype.destory=function(){that.$.off("."+i)},f.prototype.hide=function(t){a.hide(this.id,t)},f.prototype.show=function(e,i){e=t.extend({},this.options,e),a.show(e,i)},t.fn.contextmenu=function(e){return this.each(function(){var n=t(this),s=n.data(i),a="object"==typeof e&&e;s||n.data(i,s=new f(this,a)),"string"==typeof e&&s[e]()})},t.fn.contextmenu.Constructor=f}(jQuery,void 0),function(t,e,i){"use strict";var n=0,s='',a={type:"default",placement:"top",time:4e3,parent:"body",icon:null,close:!0,fade:!0,scale:!0},o={},r=function(e,r){t.isPlainObject(e)&&(r=e,e=r.message);var l=this;r=l.options=t.extend({},a,r),l.id=r.id||n++;var h=o[l.id];h&&h.destroy(),o[l.id]=l,l.message=(r.icon?' ':"")+e,l.$=t(s.format(r)).toggleClass("fade",r.fade).toggleClass("scale",r.scale).attr("id","messager-"+l.id),r.cssClass&&l.$.addClass(r.cssClass);var c=!1,d=l.$.find(".messager-actions"),u=function(e){var n=t('