/*! * ZUI: Lite edition - v1.10.0 - 2021-11-04 * http://openzui.com * GitHub: https://github.com/easysoft/zui.git * Copyright (c) 2021 cnezsoft.com; Licensed MIT */ /*! Some code copy from Bootstrap v3.0.0 by @fat and @mdo. (Copyright 2013 Twitter, Inc. Licensed under http://www.apache.org/licenses/)*/ /* ======================================================================== * ZUI: jquery.extensions.js * http://openzui.com * ======================================================================== * 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 = (Date.now() - 1580890015292) * 10e4 + Math.floor(Math.random() * 10e3) * 10 + (lastUuidAmend++) % 10; return asNumber ? uuidNumber : uuidNumber.toString(36); }, callEvent: function(func, event, proxy) { if(typeof func === 'function') { if(proxy !== undefined) { func = func.bind(proxy); } var result = func(event); if(event) event.result = result; return !(result !== undefined && (!result)); } return 1; }, strCode: function(str) { var code = 0; if (typeof str !== 'string') str = String(str); if(str && str.length) { for(var i = 0; i < str.length; ++i) { code += (i + 1) * 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; }, /** * default language name * @type {string} */ defaultLang: 'en', /** * Get client language name * @return {string} */ 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 || $.zui.defaultLang); } return lang.replace('-', '_').toLowerCase(); }, /** * @type {object} * @example * { * 'zui.pager': { * 'zh-cn': { * prev: '上一页', * } * } * } */ langDataMap: {}, /** * Add lang data for components * @param {string} [langName] * @param {string} [componentName] * @param {object} data * @example * // Add lang data to specify language and specify component * $.zui.addLangData('zh-cn', 'zui.pager', { * prev: '上一页', * next: '下一页', * }); * * // Add lang data to specify language and multiple components * $.zui.addLangData('zh-cn', { * 'zui.pager': { * prev: '上一页', * next: '下一页', * }, * 'chosen': { * } * }); * * // Add lang data to multiple languages and multiple components * $.zui.addLangData({ * 'zh-cn': { * 'zui.pager': { * prev: '上一页', * next: '下一页', * }, * 'chosen': { * } * }, * 'zh-tw': { * 'zui.pager': { * prev: '上一页', * next: '下一页', * } * } * }); */ addLangData: function(langName, componentName, data) { var langData = {}; if (data && componentName && langName) { langData[componentName] = {}; langData[componentName][langName] = data; } else if (langName && componentName && !data) { data = componentName; $.each(data, function(comName) { langData[comName] = {}; langData[comName][langName] = data[comName]; }); } else if (langName && !componentName && !data) { $.each(data, function(theLangName) { var comsData = data[theLangName]; $.each(comsData, function(comName) { if (!langData[comName]) { langData[comName] = {}; } langData[comName][theLangName] = comsData[comName]; }); }); } $.extend(true, $.zui.langDataMap, langData); }, /** * Get lang data * @example * $.zui.getLangData('zui.pager'); * * $.zui.getLangData('zui.pager', 'zh-cn'); * * $.zui.getLangData('zui.pager', 'zh-cn', { * prev: '上一页', * next: '下一页', * }); */ getLangData: function(componentName, langName, initialData) { if (!arguments.length) { return $.extend({}, $.zui.langDataMap); } if (arguments.length === 1) { return $.extend({}, $.zui.langDataMap[componentName]); } if (arguments.length === 2) { var comData = $.zui.langDataMap[componentName]; if (comData) { return langName ? comData[langName] : comData; } return {}; } if (arguments.length === 3) { langName = langName || $.zui.clientLang(); var comData = $.zui.langDataMap[componentName]; var langData = comData ? comData[langName] : {}; return $.extend(true, {}, initialData[langName] || initialData.en || initialData.zh_cn, langData); } return null; }, lang: function() { if (arguments.length && $.isPlainObject(arguments[arguments.length - 1])) { return $.zui.addLangData.apply(null, arguments); } return $.zui.getLangData.apply(null, arguments); }, _scrollbarWidth: 0, checkBodyScrollbar: function() { if(document.body.clientWidth >= window.innerWidth) return 0; if(!$.zui._scrollbarWidth) { var scrollDiv = document.createElement('div'); scrollDiv.className = 'scrollbar-measure'; document.body.appendChild(scrollDiv); $.zui._scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth; document.body.removeChild(scrollDiv); } return $.zui._scrollbarWidth; }, fixBodyScrollbar: function() { if($.zui.checkBodyScrollbar()) { var $body = $('body'); var bodyPad = parseInt(($body.css('padding-right') || 0), 10); if($.zui._scrollbarWidth) { $body.css({paddingRight: bodyPad + $.zui._scrollbarWidth, overflowY: 'hidden'}); } return true; } }, resetBodyScrollbar: function() { $('body').css({paddingRight: '', overflowY: ''}); }, }); $.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(typeof func === 'function') { e.result = $.zui.callEvent(func, e, model); } } $this.trigger(e); return e; }; $.fn.callComEvent = function(component, eventName, params) { if (params !== undefined && !Array.isArray(params)) { params = [params]; } var $this = this; var result; $this.trigger(eventName, params); var eventCallback = component.options[eventName]; if (eventCallback) { result = eventCallback.apply(component, params); } return result; }; }(jQuery, window, undefined)); /* ======================================================================== * ZUI: typography.js * http://openzui.com * ======================================================================== * 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: 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://openzui.com * ======================================================================== */ + 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); /* ======================================================================== * 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://openzui.com * ======================================================================== * 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://openzui.com * ======================================================================== * 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, complete.bind(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, complete.bind(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://openzui.com * ======================================================================== * 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://openzui.com * ======================================================================== * Copyright 2014-2020 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 = false; for (var i = 11; 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) .toggleClass('gt-ie-10 gte-ie-11', ie >= 11) .toggleClass('lte-ie-10 lt-ie-11', ie < 11); } }; // Show browse happy tip Browser.prototype.tip = function (showContent) { var $browseHappy = $('#browseHappyTip'); if (!$browseHappy.length) { $browseHappy = $('