add site
This commit is contained in:
1 parent
88e0a25ecd
commit
c9723008af
1047 files changed
+443540
-1
No files matched your search
@@ -0,0 +1,207 @@
|
||||
var HashMap = function () {
|
||||
|
||||
var size = 0;// Map大小
|
||||
var entry = new Object();// 对象
|
||||
|
||||
this.common = new common(); //取得common的通用方法
|
||||
|
||||
// Map的存put方法
|
||||
this.put = function (key, value) {
|
||||
if (!this.containsKey(key)) {
|
||||
size++;
|
||||
entry[key] = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Map取get方法
|
||||
this.get = function (key) {
|
||||
return this.containsKey(key) ? entry[key] : null;
|
||||
}
|
||||
|
||||
// Map删除remove
|
||||
this.remove = function (key) {
|
||||
if (this.containsKey(key) && (delete entry[key])) {
|
||||
size--;
|
||||
}
|
||||
}
|
||||
|
||||
// 是否包含Key
|
||||
this.containsKey = function (key) {
|
||||
return (key in entry);
|
||||
}
|
||||
// 是否包含Value
|
||||
this.containsValue = function (value) {
|
||||
for (var prop in entry) {
|
||||
if (isObjectValueEqual(entry[prop], value)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// 所有的Value
|
||||
this.values = function () {
|
||||
var values = new Array();
|
||||
for (var prop in entry) {
|
||||
values.push(entry[prop]);
|
||||
}
|
||||
return values;
|
||||
}
|
||||
|
||||
// 所有的 Key
|
||||
this.keys = function () {
|
||||
var keys = new Array();
|
||||
for (var prop in entry) {
|
||||
keys.push(prop);
|
||||
}
|
||||
return keys;
|
||||
}
|
||||
|
||||
// Map size
|
||||
this.size = function () {
|
||||
return size;
|
||||
}
|
||||
|
||||
// 清空Map
|
||||
this.clear = function () {
|
||||
size = 0;
|
||||
entry = new Object();
|
||||
}
|
||||
|
||||
// 获取key By value
|
||||
this.getKeyByValue = function (value) {
|
||||
for (var prop in entry) {
|
||||
if (this.common.isObjectValueEqual(entry[prop], value)) {
|
||||
console.log("getKeyByValue is ok");
|
||||
return prop;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// 包含特定字段对象的所有keys
|
||||
this.specialKeys = function (containsID) {
|
||||
var keys = new Array();
|
||||
var object_container = new Array();
|
||||
var values = this.values();
|
||||
for (var i = 0; i < values.length; i++) {
|
||||
console.log(this.common.isPropertyInObject(values[i], containsID));
|
||||
if (this.common.isPropertyInObject(values[i], containsID)) {
|
||||
object_container.push(values[i]);
|
||||
}
|
||||
}
|
||||
console.log("object_container.length", object_container.length);
|
||||
for (var j = 0; j < object_container.length; j++) {
|
||||
keys.push(this.getKeyByValue(object_container[j]));
|
||||
}
|
||||
return keys;
|
||||
}
|
||||
|
||||
// 查找一个弱对象是否存在于哈希表中
|
||||
this.findWeekObjectInHash = function (obj) {
|
||||
var values = this.values();
|
||||
for (var i = 0; i < values.length; i++) {
|
||||
if (this.common.isObjectValueEqualIgnoreSequence(obj, values[i])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// 包含对象特定字段的所有keys
|
||||
this.specialKeysSequence = function (containsID, start_end) {
|
||||
var keys = new Array();
|
||||
var object_container = new Array();
|
||||
var values = this.values();
|
||||
for (var i = 0; i < values.length; i++) {
|
||||
if (this.common.isPropertyValueInAndEqualObjectPropertyValue(values[i],
|
||||
start_end, containsID)) {
|
||||
object_container.push(values[i]);
|
||||
}
|
||||
}
|
||||
for (var j = 0; j < object_container.length; j++) {
|
||||
keys.push(this.getKeyByValue(object_container[j]));
|
||||
}
|
||||
return keys;
|
||||
}
|
||||
|
||||
// 根据对象中是否包含某一属性值去查找hashmap的该value(即该对象)
|
||||
this.findObjectByPropety = function (ID) {
|
||||
var value = this.values();
|
||||
for (var i = 0; i < value.length; i++) {
|
||||
if (this.common.isPropertyInObject(value[i], ID)) {
|
||||
return value[i];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
var common = function () {
|
||||
|
||||
// 判断两个对象是否相等
|
||||
this.isObjectValueEqual = function (a, b) {
|
||||
var aProps = Object.getOwnPropertyNames(a);
|
||||
var bProps = Object.getOwnPropertyNames(b);
|
||||
if (aProps.length != bProps.length) {
|
||||
return false;
|
||||
}
|
||||
for (var i = 0; i < aProps.length; i++) {
|
||||
var propName = aProps[i];
|
||||
if (a[propName] !== b[propName]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* @description:弱判断两个对象是否相等(忽略属性的先后顺序,只要值相等 @example:A.x=1,A.y=2与A.x=2,A.y=1视为相等
|
||||
*
|
||||
*/
|
||||
this.isObjectValueEqualIgnoreSequence = function (a, b) {
|
||||
var flag = true;
|
||||
var aProps = Object.getOwnPropertyNames(a);
|
||||
var bProps = Object.getOwnPropertyNames(b);
|
||||
if (aProps.length != bProps.length) {
|
||||
return false;
|
||||
}
|
||||
for (var i = 0; i < aProps.length; i++) {
|
||||
if (!isPropertyInObject(b, a[aProps[i]])) {
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
// 判断一个属性值是不是在一个对象里
|
||||
this.isPropertyInObject = function (object, value) {
|
||||
for (var i in object) {
|
||||
if (object[i] == value) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// 判断一个属性值是不是与一个对象的指定属性值相等
|
||||
this.isPropertyValueInAndEqualObjectPropertyValue = function (object, prop, value) {
|
||||
if (prop in object) {
|
||||
if (object[prop] == value) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// 根据一个属性值找对象中另外一个属性值
|
||||
this.FindPropertyValueInObjectWithOtherPropertyValue = function (object, prop1,
|
||||
prop2, value) {
|
||||
if (prop1 in object) {
|
||||
if (object[prop1] == value) {
|
||||
return object[prop2];
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
function evalRpn(input) {
|
||||
var outputStack = [];
|
||||
var rpnQueue = toRPolish(input);
|
||||
while (rpnQueue.length > 0) {
|
||||
var cur = rpnQueue.shift();
|
||||
|
||||
if (!isOperatorR(cur)) {
|
||||
outputStack.push(cur);
|
||||
} else {
|
||||
if (outputStack.length < 2) {
|
||||
throw "unvalid stack length";
|
||||
}
|
||||
var sec = outputStack.pop();
|
||||
var fir = outputStack.pop();
|
||||
|
||||
outputStack.push(getResult(fir, sec, cur));
|
||||
}
|
||||
}
|
||||
|
||||
if (outputStack.length != 1) {
|
||||
throw "unvalid expression";
|
||||
} else {
|
||||
return outputStack[0];
|
||||
}
|
||||
}
|
||||
|
||||
function getResult(fir, sec, cur) {
|
||||
var s = fir + cur + sec;
|
||||
var r = eval(s);
|
||||
if (r < 0) {
|
||||
r = r * -1;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
function isOperatorR(value) {
|
||||
var operatorString = "+-*/";
|
||||
return operatorString.indexOf(value) > -1
|
||||
}
|
||||
|
||||
function isOperatorF(value) {
|
||||
var operatorString = "(){}[]";
|
||||
return operatorString.indexOf(value) > -1
|
||||
}
|
||||
|
||||
function toRPolish(input) {
|
||||
var regex = /(\+|\-|\*|\/)+/;
|
||||
var array = input.replaceAll('\\(', '').replaceAll('\\)', '').replaceAll('\\{', '').replaceAll('\\}', '').replaceAll('\\[', '').replaceAll('\\]', '').split(regex);
|
||||
var RPolish = ""
|
||||
var isI = false;
|
||||
num = 0;
|
||||
var SymbolArray = new Array(100);
|
||||
var SymbolNum = -1;
|
||||
for (j = 0; j < input.length; j++) {
|
||||
if (input.charAt(j).match(/\d/)) {
|
||||
if (isI == false) {
|
||||
if (RPolish.length > 0) {
|
||||
RPolish += ','
|
||||
}
|
||||
RPolish += array[num];
|
||||
num++;
|
||||
isI = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
var c = input.charAt(j);
|
||||
if (isOperatorR(c)) {
|
||||
num++;
|
||||
}
|
||||
if (!isOperatorF(c)) {
|
||||
SymbolNum++;
|
||||
SymbolArray[SymbolNum] = input.charAt(j);
|
||||
}
|
||||
isI = false;
|
||||
}
|
||||
}
|
||||
while (SymbolNum >= 0) {
|
||||
RPolish += ',';
|
||||
RPolish += SymbolArray[SymbolNum];
|
||||
SymbolNum--;
|
||||
}
|
||||
regex = /,/;
|
||||
var RPolishArray = RPolish.split(regex);
|
||||
return RPolishArray;
|
||||
}
|
||||
|
||||
function compare(a, b) {
|
||||
if ((a.match(/\*/) || a.match(/\//)) && (b.match(/\+/) || b.match(/\-/))) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
$acceptancetext = $dialog.extend({});
|
||||
|
||||
$acceptancetext.prototype.show = function (msg) {
|
||||
var width = 650;
|
||||
var height = 400;
|
||||
// 获取当前语言ID
|
||||
var lang = _utility.currentLang;
|
||||
this.title = GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SYSTEMOPTIONSCTRL_A037", "Terms and Conditions");
|
||||
var dialog = this.createDialog(width, height);
|
||||
dialog.css("top", (document.documentElement.clientHeight - height) / 2);
|
||||
var src = "AcceptanceText.aspx?l=" + lang;
|
||||
var ele = $('<div style="width: 97%;height: 80%; margin: 10px auto auto auto;border: 1px solid;"></div>').appendTo(dialog);
|
||||
ele.load(sitePath + src);
|
||||
|
||||
//TODO: 添加一些按钮
|
||||
$('<input type="button" style="margin-right: 23px;float: right;margin-top: 5px;width: 110px;" value="' + GetLanguageByKey("LHBIS_FIC_SILVERLIGHT_LOGIN_LOGINPAGE_A059", "Do Not Accept") + '"/>').click(this,
|
||||
function (e) {
|
||||
e.data.close();
|
||||
}
|
||||
).appendTo(dialog);
|
||||
|
||||
$('<input type="button" style="margin-right: 23px;float: right;margin-top: 5px;width: 70px;" value="' + GetLanguageByKey("LHBIS_FIC_SILVERLIGHT_LOGIN_LOGINPAGE_A058", "Accept") + '"/>').click(this,
|
||||
function (e) {
|
||||
reLoginAcceptanceText();
|
||||
e.data.close();
|
||||
}
|
||||
).appendTo(dialog);
|
||||
|
||||
dialog.appendTo($(document.body));
|
||||
|
||||
};
|
||||
@@ -0,0 +1,18 @@
|
||||
function setCookie(cname, cvalue, exdays) {
|
||||
if (exdays === undefined) {
|
||||
document.cookie = cname + "=" + cvalue + "; path=/" + "; document=" + document.domain;
|
||||
} else {
|
||||
var d = new Date();
|
||||
d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
|
||||
var expires = "expires=" + d.toUTCString();
|
||||
document.cookie = cname + "=" + cvalue + "; " + expires + "; path=/" + "; document=" + document.domain;
|
||||
}
|
||||
}
|
||||
|
||||
function GetCookie(name) {
|
||||
var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
|
||||
if (arr = document.cookie.match(reg))
|
||||
return unescape(decodeURI(arr[2]));
|
||||
else
|
||||
return null;
|
||||
}
|
||||
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
/*!
|
||||
* Datepicker v1.0.8
|
||||
* https://fengyuanchen.github.io/datepicker
|
||||
*
|
||||
* Copyright 2014-present Chen Fengyuan
|
||||
* Released under the MIT license
|
||||
*
|
||||
* Date: 2019-06-23T08:07:40.545Z
|
||||
*/
|
||||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],e):e((t=t||self).jQuery)}(this,function(D){"use strict";function a(t,e){for(var i=0;i<e.length;i++){var a=e[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}D=D&&D.hasOwnProperty("default")?D.default:D;var s={autoShow:!1,autoHide:!1,autoPick:!1,inline:!1,container:null,trigger:null,language:"",format:"mm/dd/yyyy",date:null,startDate:null,endDate:null,startView:0,weekStart:0,yearFirst:!1,yearSuffix:"",days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],itemTag:"li",mutedClass:"muted",pickedClass:"picked",disabledClass:"disabled",highlightedClass:"highlighted",template:'<div class="datepicker-container"><div class="datepicker-panel" data-view="years picker"><ul><li data-view="years prev">‹</li><li data-view="years current"></li><li data-view="years next">›</li></ul><ul data-view="years"></ul></div><div class="datepicker-panel" data-view="months picker"><ul><li data-view="year prev">‹</li><li data-view="year current"></li><li data-view="year next">›</li></ul><ul data-view="months"></ul></div><div class="datepicker-panel" data-view="days picker"><ul><li data-view="month prev">‹</li><li data-view="month current"></li><li data-view="month next">›</li></ul><ul data-view="week"></ul><ul data-view="days"></ul></div></div>',offset:10,zIndex:1e3,filter:null,show:null,hide:null,pick:null},t="undefined"!=typeof window,e=t?window:{},i=t&&"ontouchstart"in e.document.documentElement,c="datepicker",n="click.".concat(c),r="focus.".concat(c),h="hide.".concat(c),o="keyup.".concat(c),l="pick.".concat(c),d="resize.".concat(c),u="scroll.".concat(c),p="show.".concat(c),f="touchstart.".concat(c),g="".concat(c,"-hide"),y={},m=0,v=1,w=2,k=Object.prototype.toString;function b(t){return"string"==typeof t}var C=Number.isNaN||e.isNaN;function $(t){return"number"==typeof t&&!C(t)}function x(t){return void 0===t}function F(t){return"date"===function(t){return k.call(t).slice(8,-1).toLowerCase()}(t)&&!C(t.getTime())}function M(a,s){for(var t=arguments.length,n=new Array(2<t?t-2:0),e=2;e<t;e++)n[e-2]=arguments[e];return function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return a.apply(s,n.concat(e))}}function Y(t){return'[data-view="'.concat(t,'"]')}function G(t,e){return[31,function(t){return t%4==0&&t%100!=0||t%400==0}(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]}function V(t,e,i){return Math.min(i,G(t,e))}var T=/(y|m|d)+/g;function S(t,e){var i=1<arguments.length&&void 0!==e?e:1,a=String(Math.abs(t)),s=a.length,n="";for(t<0&&(n+="-");s<i;)s+=1,n+="0";return n+a}var I=/\d+/g,P={show:function(){this.built||this.build(),this.shown||this.trigger(p).isDefaultPrevented()||(this.shown=!0,this.$picker.removeClass(g).on(n,D.proxy(this.click,this)),this.showView(this.options.startView),this.inline||(this.$scrollParent.on(u,D.proxy(this.place,this)),D(window).on(d,this.onResize=M(this.place,this)),D(document).on(n,this.onGlobalClick=M(this.globalClick,this)),D(document).on(o,this.onGlobalKeyup=M(this.globalKeyup,this)),i&&D(document).on(f,this.onTouchStart=M(this.touchstart,this)),this.place()))},hide:function(){this.shown&&(this.trigger(h).isDefaultPrevented()||(this.shown=!1,this.$picker.addClass(g).off(n,this.click),this.inline||(this.$scrollParent.off(u,this.place),D(window).off(d,this.onResize),D(document).off(n,this.onGlobalClick),D(document).off(o,this.onGlobalKeyup),i&&D(document).off(f,this.onTouchStart))))},toggle:function(){this.shown?this.hide():this.show()},update:function(){var t=this.getValue();t!==this.oldValue&&(this.setDate(t,!0),this.oldValue=t)},pick:function(t){var e=this.$element,i=this.date;this.trigger(l,{view:t||"",date:i}).isDefaultPrevented()||(i=this.formatDate(this.date),this.setValue(i),this.isInput&&(e.trigger("input"),e.trigger("change")))},reset:function(){this.setDate(this.initialDate,!0),this.setValue(this.initialValue),this.shown&&this.showView(this.options.startView)},getMonthName:function(t,e){var i=this.options,a=i.monthsShort,s=i.months;return D.isNumeric(t)?t=Number(t):x(e)&&(e=t),!0===e&&(s=a),s[$(t)?t:this.date.getMonth()]},getDayName:function(t,e,i){var a=this.options,s=a.days;return D.isNumeric(t)?t=Number(t):(x(i)&&(i=e),x(e)&&(e=t)),i?s=a.daysMin:e&&(s=a.daysShort),s[$(t)?t:this.date.getDay()]},getDate:function(t){var e=this.date;return t?this.formatDate(e):new Date(e)},setDate:function(t,e){var i=this.options.filter;if(F(t)||b(t)){if(t=this.parseDate(t),D.isFunction(i)&&!1===i.call(this.$element,t,"daLine truncated
|
||||
Vendored
+22
@@ -0,0 +1,22 @@
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you 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(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.echarts={})}(this,function(t){"use strict";var e=2311,n=function(){return e++},v="object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?{browser:{},os:{},node:!1,wxa:!0,canvasSupported:!0,svgSupported:!1,touchEventsSupported:!0,domSupported:!1}:"undefined"==typeof document&&"undefined"!=typeof self?{browser:{},os:{},node:!1,worker:!0,canvasSupported:!0,domSupported:!1}:"undefined"==typeof navigator?{browser:{},os:{},node:!0,worker:!1,canvasSupported:!0,svgSupported:!0,domSupported:!1}:function(t){var e={},i=t.match(/Firefox\/([\d.]+)/),n=t.match(/MSIE\s([\d.]+)/)||t.match(/Trident\/.+?rv:(([\d.]+))/),o=t.match(/Edge\/([\d.]+)/),a=/micromessenger/i.test(t);i&&(e.firefox=!0,e.version=i[1]);n&&(e.ie=!0,e.version=n[1]);o&&(e.edge=!0,e.version=o[1]);a&&(e.weChat=!0);return{browser:e,os:{},node:!1,canvasSupported:!!document.createElement("canvas").getContext,svgSupported:"undefined"!=typeof SVGRect,touchEventsSupported:"ontouchstart"in window&&!e.ie&&!e.edge,pointerEventsSupported:"onpointerdown"in window&&(e.edge||e.ie&&11<=e.version),domSupported:"undefined"!=typeof document}}(navigator.userAgent);var s={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1,"[object CanvasPattern]":1,"[object Image]":1,"[object Canvas]":1},l={"[object Int8Array]":1,"[object Uint8Array]":1,"[object Uint8ClampedArray]":1,"[object Int16Array]":1,"[object Uint16Array]":1,"[object Int32Array]":1,"[object Uint32Array]":1,"[object Float32Array]":1,"[object Float64Array]":1},u=Object.prototype.toString,i=Array.prototype,r=i.forEach,h=i.filter,o=i.slice,c=i.map,d=i.reduce,a={};function f(t,e){"createCanvas"===t&&(g=null),a[t]=e}function k(t){if(null==t||"object"!=typeof t)return t;var e=t,i=u.call(t);if("[object Array]"===i){if(!$(t)){e=[];for(var n=0,o=t.length;n<o;n++)e[n]=k(t[n])}}else if(l[i]){if(!$(t)){var a=t.constructor;if(t.constructor.from)e=a.from(t);else{e=new a(t.length);for(n=0,o=t.length;n<o;n++)e[n]=k(t[n])}}}else if(!s[i]&&!$(t)&&!G(t))for(var r in e={},t)t.hasOwnProperty(r)&&(e[r]=k(t[r]));return e}function m(t,e,i){if(!z(e)||!z(t))return i?k(e):t;for(var n in e)if(e.hasOwnProperty(n)){var o=t[n],a=e[n];!z(a)||!z(o)||L(a)||L(o)||G(a)||G(o)||B(a)||B(o)||$(a)||$(o)?!i&&n in t||(t[n]=k(e[n])):m(o,a,i)}return t}function p(t,e){for(var i=t[0],n=1,o=t.length;n<o;n++)i=m(i,t[n],e);return i}function P(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t}function D(t,e,i){for(var n in e)e.hasOwnProperty(n)&&(i?null!=e[n]:null==t[n])&&(t[n]=e[n]);return t}function y(){return a.createCanvas()}var g;function x(){return g=g||y().getContext("2d")}function _(t,e){if(t){if(t.indexOf)return t.indexOf(e);for(var i=0,n=t.length;i<n;i++)if(t[i]===e)return i}return-1}function w(t,e){var i=t.prototype;function n(){}for(var o in n.prototype=e.prototype,t.prototype=new n,i)i.hasOwnProperty(o)&&(t.prototype[o]=i[o]);(t.prototype.constructor=t).superClass=e}function b(t,e,i){D(t="prototype"in t?t.prototype:t,e="prototype"in e?e.prototype:e,i)}function N(t){if(t)return"string"!=typeof t&&"number"==typeof t.length}function R(t,e,i){if(t&&e)if(t.forEach&&t.forEach===r)t.forEach(e,i);else if(t.length===+t.length)for(var n=0,o=t.length;n<o;n++)e.call(i,t[n],n,t);else for(var a in t)t.hasOwnProperty(a)&&e.call(i,t[a],a,t)}function O(t,e,i){if(t&&e){if(t.map&&t.map===c)return t.map(e,i);for(var n=[],o=0,a=t.length;o<a;o++)n.push(e.call(i,t[o],o,t));return n}}function S(t,e,i,n){if(t&&e){if(t.reduce&&t.reduce===d)return t.reduce(e,i,n);for(var o=0,a=t.length;o<a;o++)i=e.call(n,i,t[o],o,t);return i}}function M(t,e,i){if(t&&e){if(t.filter&&t.filter===h)return t.filter(e,i);for(var n=[],o=0,a=t.length;o<a;o++)e.call(i,t[o],o,t)&&n.push(t[o]);return n}}function I(t,e,i){if(t&&e)for(var n=0,o=t.length;n<o;n++)if(e.call(i,t[n],n,t))return t[n]}function A(t,e){var i=o.call(arguments,2);return function(){return t.apply(e,i.concat(o.call(arguments)))}}function T(t){var e=o.call(arguments,1);return function(){return t.apply(this,e.concat(o.call(arguments)))}}function L(t){return"[object Array]"===u.call(t)}function C(t){return"function"==typeof t}function E(t){return"[object String]"===u.call(t)}function z(t){var e=typeof t;return"function"==e||!!t&&"object"==e}function B(t){return!!s[u.call(t)]}function V(t){return!!l[u.call(t)]}function G(t){return"object"==typeof t&&"number"==typeof t.nodeType&&"object"==typeof t.ownerDocument}function F(t){return t!=t}function W(t){for(var e=0,i=arguments.length;e<i;e++)if(null!=arguments[e])return arguments[e]}function H(t,e){return null!=t?t:e}function Z(t,e,i){return null!=t?t:null!=e?e:i}function U(){return Function.call.apply(o,arguments)}function X(t){if("number"==typeof t)return[t,t,t,t];var e=t.length;return 2===e?[t[0],t[1],t[0],t[1]]:3===e?[t[0],t[1],t[2],t[1]]:t}function Y(t,e){if(!t)throw new Error(e)}funcLine truncated
|
||||
Vendored
+10351
File diff suppressed because it is too large.
Load diff
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
/*! jQuery v1.12.4 | (c) jQuery Foundation | jquery.org/license */
|
||||
!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="1.12.4",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:g,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(n.isPlainObject(c)||(b=n.isArray(c)))?(b?(b=!1,f=a&&n.isArray(a)?a:[]):f=a&&n.isPlainObject(a)?a:{},g[d]=n.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray||function(a){return"array"===n.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){var b=a&&a.toString();return!n.isArray(a)&&b-parseFloat(b)+1>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;try{if(a.constructor&&!k.call(a,"constructor")&&!k.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(!l.ownFirst)for(b in a)return k.call(a,b);for(b in a);return void 0===b||k.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(b){b&&n.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):g.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(h)return h.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,g=0,h=[];if(s(a))for(d=a.length;d>g;g++)e=b(a[g],g,c),null!=e&&h.push(e);else for(g in a)e=b(a[g],g,c),null!=e&&h.push(e);return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return"string"==typeof b&&(f=a[b],b=a,a=f),n.isFunction(a)?(c=e.call(arguments,2),d=function(){return a.apply(b||this,c.concat(e.call(arguments)))},d.guid=a.guid=a.guid||n.guid++,d):void 0},now:function(){return+new Date},support:l}),"function"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){i["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=!!a&&"length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ga(),z=ga(),A=ga(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+L+"*\\]",O=":("+M+")(?:\\((('((?:\\\\.|Line truncated
|
||||
}return c}function Q(a){var b;for(b in a)if(("data"!==b||!n.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function R(a,b,d,e){if(M(a)){var f,g,h=n.expando,i=a.nodeType,j=i?n.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||n.guid++:h),j[k]||(j[k]=i?{}:{toJSON:n.noop}),"object"!=typeof b&&"function"!=typeof b||(e?j[k]=n.extend(j[k],b):j[k].data=n.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[n.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[n.camelCase(b)])):f=g,f}}function S(a,b,c){if(M(a)){var d,e,f=a.nodeType,g=f?n.cache:a,h=f?a[n.expando]:n.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){n.isArray(b)?b=b.concat(n.map(b,n.camelCase)):b in d?b=[b]:(b=n.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!Q(d):!n.isEmptyObject(d))return}(c||(delete g[h].data,Q(g[h])))&&(f?n.cleanData([a],!0):l.deleteExpando||g!=g.window?delete g[h]:g[h]=void 0)}}}n.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?n.cache[a[n.expando]]:a[n.expando],!!a&&!Q(a)},data:function(a,b,c){return R(a,b,c)},removeData:function(a,b){return S(a,b)},_data:function(a,b,c){return R(a,b,c,!0)},_removeData:function(a,b){return S(a,b,!0)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=n.data(f),1===f.nodeType&&!n._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));n._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){n.data(this,a)}):arguments.length>1?this.each(function(){n.data(this,a,b)}):f?P(f,a,n.data(f,a)):void 0},removeData:function(a){return this.each(function(){n.removeData(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=n._data(a,b),c&&(!d||n.isArray(c)?d=n._data(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return n._data(a,c)||n._data(a,c,{empty:n.Callbacks("once memory").add(function(){n._removeData(a,b+"queue"),n._removeData(a,c)})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=n._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}}),function(){var a;l.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var b,c,e;return c=d.getElementsByTagName("body")[0],c&&c.style?(b=d.createElement("div"),e=d.createElement("div"),e.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(e).appendChild(b),"undefined"!=typeof b.style.zoom&&(b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",b.appendChild(d.createElement("div")).style.width="5px",a=3!==b.offsetWidth),c.removeChild(e),a):void 0}}();var T=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,U=new RegExp("^(?:([+-])=|)("+T+")([a-z%]*)$","i"),V=["Top","Right","Bottom","Left"],W=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)};function X(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return n.css(a,b,"")},i=h(),j=c&&c[3]||(n.cssNumber[b]?"":"px"),k=(n.cssNumber[b]||"px"!==j&&+i)&&U.exec(n.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,n.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var Y=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)Y(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},Z=/^(?:checkbox|radio)$/i,$=/<([\w:-]+)/,_=/^$|\/(?:java|ecma)script/i,aa=/^\s+/,ba="abbr|article|aside|audio|bdi|canvas|data|datalist|details|dialog|figcaption|figure|footer|header|hgroup|main|mark|meter|nav|output|picture|progress|section|summary|template|time|video";function ca(a){var b=ba.split("|"),c=a.createDocumentFraLine truncated
|
||||
marginLeft:0},function(){return a.getBoundingClientRect().left}):0))+"px":void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+V[d]+b]=f[d]||f[d-2]||f[0];return e}},Na.test(a)||(n.cssHooks[a+b].set=db)}),n.fn.extend({css:function(a,b){return Y(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=Ra(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return cb(this,!0)},hide:function(){return cb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){W(this)?n(this).show():n(this).hide()})}});function gb(a,b,c,d,e){return new gb.prototype.init(a,b,c,d,e)}n.Tween=gb,gb.prototype={constructor:gb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||n.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=gb.propHooks[this.prop];return a&&a.get?a.get(this):gb.propHooks._default.get(this)},run:function(a){var b,c=gb.propHooks[this.prop];return this.options.duration?this.pos=b=n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):gb.propHooks._default.set(this),this}},gb.prototype.init.prototype=gb.prototype,gb.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[n.cssProps[a.prop]]&&!n.cssHooks[a.prop]?a.elem[a.prop]=a.now:n.style(a.elem,a.prop,a.now+a.unit)}}},gb.propHooks.scrollTop=gb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},n.fx=gb.prototype.init,n.fx.step={};var hb,ib,jb=/^(?:toggle|show|hide)$/,kb=/queueHooks$/;function lb(){return a.setTimeout(function(){hb=void 0}),hb=n.now()}function mb(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=V[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function nb(a,b,c){for(var d,e=(qb.tweeners[b]||[]).concat(qb.tweeners["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ob(a,b,c){var d,e,f,g,h,i,j,k,m=this,o={},p=a.style,q=a.nodeType&&W(a),r=n._data(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,m.always(function(){m.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=n.css(a,"display"),k="none"===j?n._data(a,"olddisplay")||Ma(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(l.inlineBlockNeedsLayout&&"inline"!==Ma(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",l.shrinkWrapBlocks()||m.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],jb.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(o))"inline"===("none"===j?Ma(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=n._data(a,"fxshow",{}),f&&(r.hidden=!q),q?n(a).show():m.done(function(){n(a).hide()}),m.done(function(){var b;n._removeData(a,"fxshow");for(b in o)n.style(a,b,o[b])});for(d in o)g=nb(q?r[d]:0,d,m),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function pb(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function qb(a,b,c){var d,e,f=0,g=qb.prefilters.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=hb||lb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{},easing:n.easing._default},c),originalProperties:b,originalOptions:c,startTime:hb||lb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]Line truncated
|
||||
padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return Y(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var nc=a.jQuery,oc=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=oc),b&&a.jQuery===n&&(a.jQuery=nc),n},b||(a.jQuery=a.$=n),n});
|
||||
@@ -0,0 +1,626 @@
|
||||
/*
|
||||
* jQuery treegrid Plugin 0.3.0
|
||||
* https://github.com/maxazan/jquery-treegrid
|
||||
*
|
||||
* Copyright 2013, Pomazan Max
|
||||
* Licensed under the MIT licenses.
|
||||
*/
|
||||
(function($) {
|
||||
|
||||
var methods = {
|
||||
/**
|
||||
* Initialize tree
|
||||
*
|
||||
* @param {Object} options
|
||||
* @returns {Object[]}
|
||||
*/
|
||||
initTree: function(options) {
|
||||
var settings = $.extend({}, this.treegrid.defaults, options);
|
||||
return this.each(function() {
|
||||
var $this = $(this);
|
||||
$this.treegrid('setTreeContainer', $(this));
|
||||
$this.treegrid('setSettings', settings);
|
||||
settings.getRootNodes.apply(this, [$(this)]).treegrid('initNode', settings);
|
||||
$this.treegrid('getRootNodes').treegrid('render');
|
||||
});
|
||||
},
|
||||
/**
|
||||
* Initialize node
|
||||
*
|
||||
* @param {Object} settings
|
||||
* @returns {Object[]}
|
||||
*/
|
||||
initNode: function(settings) {
|
||||
return this.each(function() {
|
||||
var $this = $(this);
|
||||
$this.treegrid('setTreeContainer', settings.getTreeGridContainer.apply(this));
|
||||
$this.treegrid('getChildNodes').treegrid('initNode', settings);
|
||||
$this.treegrid('initExpander').treegrid('initIndent').treegrid('initEvents').treegrid('initState').treegrid('initChangeEvent').treegrid("initSettingsEvents");
|
||||
});
|
||||
},
|
||||
initChangeEvent: function() {
|
||||
var $this = $(this);
|
||||
//Save state on change
|
||||
$this.on("change", function() {
|
||||
var $this = $(this);
|
||||
$this.treegrid('render');
|
||||
if ($this.treegrid('getSetting', 'saveState')) {
|
||||
$this.treegrid('saveState');
|
||||
}
|
||||
});
|
||||
return $this;
|
||||
},
|
||||
/**
|
||||
* Initialize node events
|
||||
*
|
||||
* @returns {Node}
|
||||
*/
|
||||
initEvents: function() {
|
||||
var $this = $(this);
|
||||
//Default behavior on collapse
|
||||
$this.on("collapse", function() {
|
||||
var $this = $(this);
|
||||
$this.removeClass('treegrid-expanded');
|
||||
$this.addClass('treegrid-collapsed');
|
||||
});
|
||||
//Default behavior on expand
|
||||
$this.on("expand", function() {
|
||||
var $this = $(this);
|
||||
$this.removeClass('treegrid-collapsed');
|
||||
$this.addClass('treegrid-expanded');
|
||||
});
|
||||
|
||||
return $this;
|
||||
},
|
||||
/**
|
||||
* Initialize events from settings
|
||||
*
|
||||
* @returns {Node}
|
||||
*/
|
||||
initSettingsEvents: function() {
|
||||
var $this = $(this);
|
||||
//Save state on change
|
||||
$this.on("change", function() {
|
||||
var $this = $(this);
|
||||
if (typeof($this.treegrid('getSetting', 'onChange')) === "function") {
|
||||
$this.treegrid('getSetting', 'onChange').apply($this);
|
||||
}
|
||||
});
|
||||
//Default behavior on collapse
|
||||
$this.on("collapse", function() {
|
||||
var $this = $(this);
|
||||
if (typeof($this.treegrid('getSetting', 'onCollapse')) === "function") {
|
||||
$this.treegrid('getSetting', 'onCollapse').apply($this);
|
||||
}
|
||||
});
|
||||
//Default behavior on expand
|
||||
$this.on("expand", function() {
|
||||
var $this = $(this);
|
||||
if (typeof($this.treegrid('getSetting', 'onExpand')) === "function") {
|
||||
$this.treegrid('getSetting', 'onExpand').apply($this);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
return $this;
|
||||
},
|
||||
/**
|
||||
* Initialize expander for node
|
||||
*
|
||||
* @returns {Node}
|
||||
*/
|
||||
initExpander: function() {
|
||||
var $this = $(this);
|
||||
var cell = $this.find('td').get($this.treegrid('getSetting', 'treeColumn'));
|
||||
var tpl = $this.treegrid('getSetting', 'expanderTemplate');
|
||||
var expander = $this.treegrid('getSetting', 'getExpander').apply(this);
|
||||
if (expander) {
|
||||
expander.remove();
|
||||
}
|
||||
$(tpl).prependTo(cell).click(function() {
|
||||
$($(this).closest('tr')).treegrid('toggle');
|
||||
});
|
||||
return $this;
|
||||
},
|
||||
/**
|
||||
* Initialize indent for node
|
||||
*
|
||||
* @returns {Node}
|
||||
*/
|
||||
initIndent: function() {
|
||||
var $this = $(this);
|
||||
$this.find('.treegrid-indent').remove();
|
||||
var tpl = $this.treegrid('getSetting', 'indentTemplate');
|
||||
var expander = $this.find('.treegrid-expander');
|
||||
var depth = $this.treegrid('getDepth');
|
||||
for (var i = 0; i < depth; i++) {
|
||||
$(tpl).insertBefore(expander);
|
||||
}
|
||||
return $this;
|
||||
},
|
||||
/**
|
||||
* Initialise state of node
|
||||
*
|
||||
* @returns {Node}
|
||||
*/
|
||||
initState: function() {
|
||||
var $this = $(this);
|
||||
if ($this.treegrid('getSetting', 'saveState') && !$this.treegrid('isFirstInit')) {
|
||||
$this.treegrid('restoreState');
|
||||
} else {
|
||||
if ($this.treegrid('getSetting', 'initialState') === "expanded") {
|
||||
$this.treegrid('expand');
|
||||
} else {
|
||||
$this.treegrid('collapse');
|
||||
}
|
||||
}
|
||||
return $this;
|
||||
},
|
||||
/**
|
||||
* Return true if this tree was never been initialised
|
||||
*
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
isFirstInit: function() {
|
||||
var tree = $(this).treegrid('getTreeContainer');
|
||||
if (tree.data('first_init') === undefined) {
|
||||
tree.data('first_init', $.cookie(tree.treegrid('getSetting', 'saveStateName')) === undefined);
|
||||
}
|
||||
return tree.data('first_init');
|
||||
},
|
||||
/**
|
||||
* Save state of current node
|
||||
*
|
||||
* @returns {Node}
|
||||
*/
|
||||
saveState: function() {
|
||||
var $this = $(this);
|
||||
if ($this.treegrid('getSetting', 'saveStateMethod') === 'cookie') {
|
||||
|
||||
var stateArrayString = $.cookie($this.treegrid('getSetting', 'saveStateName')) || '';
|
||||
var stateArray = (stateArrayString === '' ? [] : stateArrayString.split(','));
|
||||
var nodeId = $this.treegrid('getNodeId');
|
||||
|
||||
if ($this.treegrid('isExpanded')) {
|
||||
if ($.inArray(nodeId, stateArray) === -1) {
|
||||
stateArray.push(nodeId);
|
||||
}
|
||||
} else if ($this.treegrid('isCollapsed')) {
|
||||
if ($.inArray(nodeId, stateArray) !== -1) {
|
||||
stateArray.splice($.inArray(nodeId, stateArray), 1);
|
||||
}
|
||||
}
|
||||
$.cookie($this.treegrid('getSetting', 'saveStateName'), stateArray.join(','));
|
||||
}
|
||||
return $this;
|
||||
},
|
||||
/**
|
||||
* Restore state of current node.
|
||||
*
|
||||
* @returns {Node}
|
||||
*/
|
||||
restoreState: function() {
|
||||
var $this = $(this);
|
||||
if ($this.treegrid('getSetting', 'saveStateMethod') === 'cookie') {
|
||||
var stateArray = $.cookie($this.treegrid('getSetting', 'saveStateName')).split(',');
|
||||
if ($.inArray($this.treegrid('getNodeId'), stateArray) !== -1) {
|
||||
$this.treegrid('expand');
|
||||
} else {
|
||||
$this.treegrid('collapse');
|
||||
}
|
||||
|
||||
}
|
||||
return $this;
|
||||
},
|
||||
/**
|
||||
* Method return setting by name
|
||||
*
|
||||
* @param {type} name
|
||||
* @returns {unresolved}
|
||||
*/
|
||||
getSetting: function(name) {
|
||||
if (!$(this).treegrid('getTreeContainer')) {
|
||||
return null;
|
||||
}
|
||||
return $(this).treegrid('getTreeContainer').data('settings')[name];
|
||||
},
|
||||
/**
|
||||
* Add new settings
|
||||
*
|
||||
* @param {Object} settings
|
||||
*/
|
||||
setSettings: function(settings) {
|
||||
$(this).treegrid('getTreeContainer').data('settings', settings);
|
||||
},
|
||||
/**
|
||||
* Return tree container
|
||||
*
|
||||
* @returns {HtmlElement}
|
||||
*/
|
||||
getTreeContainer: function() {
|
||||
return $(this).data('treegrid');
|
||||
},
|
||||
/**
|
||||
* Set tree container
|
||||
*
|
||||
* @param {HtmlE;ement} container
|
||||
*/
|
||||
setTreeContainer: function(container) {
|
||||
return $(this).data('treegrid', container);
|
||||
},
|
||||
/**
|
||||
* Method return all root nodes of tree.
|
||||
*
|
||||
* Start init all child nodes from it.
|
||||
*
|
||||
* @returns {Array}
|
||||
*/
|
||||
getRootNodes: function() {
|
||||
return $(this).treegrid('getSetting', 'getRootNodes').apply(this, [$(this).treegrid('getTreeContainer')]);
|
||||
},
|
||||
/**
|
||||
* Method return all nodes of tree.
|
||||
*
|
||||
* @returns {Array}
|
||||
*/
|
||||
getAllNodes: function() {
|
||||
return $(this).treegrid('getSetting', 'getAllNodes').apply(this, [$(this).treegrid('getTreeContainer')]);
|
||||
},
|
||||
/**
|
||||
* Mthod return true if element is Node
|
||||
*
|
||||
* @returns {String}
|
||||
*/
|
||||
isNode: function() {
|
||||
return $(this).treegrid('getNodeId') !== null;
|
||||
},
|
||||
/**
|
||||
* Mthod return id of node
|
||||
*
|
||||
* @returns {String}
|
||||
*/
|
||||
getNodeId: function() {
|
||||
if ($(this).treegrid('getSetting', 'getNodeId') === null) {
|
||||
return null;
|
||||
} else {
|
||||
return $(this).treegrid('getSetting', 'getNodeId').apply(this);
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Method return parent id of node or null if root node
|
||||
*
|
||||
* @returns {String}
|
||||
*/
|
||||
getParentNodeId: function() {
|
||||
return $(this).treegrid('getSetting', 'getParentNodeId').apply(this);
|
||||
},
|
||||
/**
|
||||
* Method return parent node or null if root node
|
||||
*
|
||||
* @returns {Object[]}
|
||||
*/
|
||||
getParentNode: function() {
|
||||
if ($(this).treegrid('getParentNodeId') === null) {
|
||||
return null;
|
||||
} else {
|
||||
return $(this).treegrid('getSetting', 'getNodeById').apply(this, [$(this).treegrid('getParentNodeId'), $(this).treegrid('getTreeContainer')]);
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Method return array of child nodes or null if node is leaf
|
||||
*
|
||||
* @returns {Object[]}
|
||||
*/
|
||||
getChildNodes: function() {
|
||||
return $(this).treegrid('getSetting', 'getChildNodes').apply(this, [$(this).treegrid('getNodeId'), $(this).treegrid('getTreeContainer')]);
|
||||
},
|
||||
/**
|
||||
* Method return depth of tree.
|
||||
*
|
||||
* This method is needs for calculate indent
|
||||
*
|
||||
* @returns {Number}
|
||||
*/
|
||||
getDepth: function() {
|
||||
if ($(this).treegrid('getParentNode') === null) {
|
||||
return 0;
|
||||
}
|
||||
return $(this).treegrid('getParentNode').treegrid('getDepth') + 1;
|
||||
},
|
||||
/**
|
||||
* Method return true if node is root
|
||||
*
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
isRoot: function() {
|
||||
return $(this).treegrid('getDepth') === 0;
|
||||
},
|
||||
/**
|
||||
* Method return true if node has no child nodes
|
||||
*
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
isLeaf: function() {
|
||||
return $(this).treegrid('getChildNodes').length === 0;
|
||||
},
|
||||
/**
|
||||
* Method return true if node last in branch
|
||||
*
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
isLast: function() {
|
||||
if ($(this).treegrid('isNode')) {
|
||||
var parentNode = $(this).treegrid('getParentNode');
|
||||
if (parentNode === null) {
|
||||
if ($(this).treegrid('getNodeId') === $(this).treegrid('getRootNodes').last().treegrid('getNodeId')) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if ($(this).treegrid('getNodeId') === parentNode.treegrid('getChildNodes').last().treegrid('getNodeId')) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
/**
|
||||
* Method return true if node first in branch
|
||||
*
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
isFirst: function() {
|
||||
if ($(this).treegrid('isNode')) {
|
||||
var parentNode = $(this).treegrid('getParentNode');
|
||||
if (parentNode === null) {
|
||||
if ($(this).treegrid('getNodeId') === $(this).treegrid('getRootNodes').first().treegrid('getNodeId')) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if ($(this).treegrid('getNodeId') === parentNode.treegrid('getChildNodes').first().treegrid('getNodeId')) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
/**
|
||||
* Return true if node expanded
|
||||
*
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
isExpanded: function() {
|
||||
return $(this).hasClass('treegrid-expanded');
|
||||
},
|
||||
/**
|
||||
* Return true if node collapsed
|
||||
*
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
isCollapsed: function() {
|
||||
return $(this).hasClass('treegrid-collapsed');
|
||||
},
|
||||
/**
|
||||
* Return true if at least one of parent node is collapsed
|
||||
*
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
isOneOfParentsCollapsed: function() {
|
||||
var $this = $(this);
|
||||
if ($this.treegrid('isRoot')) {
|
||||
return false;
|
||||
} else {
|
||||
if ($this.treegrid('getParentNode').treegrid('isCollapsed')) {
|
||||
return true;
|
||||
} else {
|
||||
return $this.treegrid('getParentNode').treegrid('isOneOfParentsCollapsed');
|
||||
}
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Expand node
|
||||
*
|
||||
* @returns {Node}
|
||||
*/
|
||||
expand: function() {
|
||||
if (!this.treegrid('isLeaf') && !this.treegrid("isExpanded")) {
|
||||
this.trigger("expand");
|
||||
this.trigger("change");
|
||||
return this;
|
||||
}
|
||||
return this;
|
||||
},
|
||||
/**
|
||||
* Expand all nodes
|
||||
*
|
||||
* @returns {Node}
|
||||
*/
|
||||
expandAll: function() {
|
||||
var $this = $(this);
|
||||
$this.treegrid('getRootNodes').treegrid('expandRecursive');
|
||||
return $this;
|
||||
},
|
||||
/**
|
||||
* Expand current node and all child nodes begin from current
|
||||
*
|
||||
* @returns {Node}
|
||||
*/
|
||||
expandRecursive: function() {
|
||||
return $(this).each(function() {
|
||||
var $this = $(this);
|
||||
$this.treegrid('expand');
|
||||
if (!$this.treegrid('isLeaf')) {
|
||||
$this.treegrid('getChildNodes').treegrid('expandRecursive');
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* Collapse node
|
||||
*
|
||||
* @returns {Node}
|
||||
*/
|
||||
collapse: function() {
|
||||
return $(this).each(function() {
|
||||
var $this = $(this);
|
||||
if (!$this.treegrid('isLeaf') && !$this.treegrid("isCollapsed")) {
|
||||
$this.trigger("collapse");
|
||||
$this.trigger("change");
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* Collapse all nodes
|
||||
*
|
||||
* @returns {Node}
|
||||
*/
|
||||
collapseAll: function() {
|
||||
var $this = $(this);
|
||||
$this.treegrid('getRootNodes').treegrid('collapseRecursive');
|
||||
return $this;
|
||||
},
|
||||
/**
|
||||
* Collapse current node and all child nodes begin from current
|
||||
*
|
||||
* @returns {Node}
|
||||
*/
|
||||
collapseRecursive: function() {
|
||||
return $(this).each(function() {
|
||||
var $this = $(this);
|
||||
$this.treegrid('collapse');
|
||||
if (!$this.treegrid('isLeaf')) {
|
||||
$this.treegrid('getChildNodes').treegrid('collapseRecursive');
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* Expand if collapsed, Collapse if expanded
|
||||
*
|
||||
* @returns {Node}
|
||||
*/
|
||||
toggle: function() {
|
||||
var $this = $(this);
|
||||
if ($this.treegrid('isExpanded')) {
|
||||
$this.treegrid('collapse');
|
||||
} else {
|
||||
$this.treegrid('expand');
|
||||
}
|
||||
return $this;
|
||||
},
|
||||
/**
|
||||
* Rendering node
|
||||
*
|
||||
* @returns {Node}
|
||||
*/
|
||||
render: function() {
|
||||
return $(this).each(function() {
|
||||
var $this = $(this);
|
||||
//if parent colapsed we hidden
|
||||
if ($this.treegrid('isOneOfParentsCollapsed')) {
|
||||
$this.hide();
|
||||
} else {
|
||||
$this.show();
|
||||
}
|
||||
if (!$this.treegrid('isLeaf')) {
|
||||
$this.treegrid('renderExpander');
|
||||
$this.treegrid('getChildNodes').treegrid('render');
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* Rendering expander depends on node state
|
||||
*
|
||||
* @returns {Node}
|
||||
*/
|
||||
renderExpander: function() {
|
||||
return $(this).each(function() {
|
||||
var $this = $(this);
|
||||
var expander = $this.treegrid('getSetting', 'getExpander').apply(this);
|
||||
if (expander) {
|
||||
|
||||
if (!$this.treegrid('isCollapsed')) {
|
||||
expander.removeClass($this.treegrid('getSetting', 'expanderCollapsedClass'));
|
||||
expander.addClass($this.treegrid('getSetting', 'expanderExpandedClass'));
|
||||
} else {
|
||||
expander.removeClass($this.treegrid('getSetting', 'expanderExpandedClass'));
|
||||
expander.addClass($this.treegrid('getSetting', 'expanderCollapsedClass'));
|
||||
}
|
||||
} else {
|
||||
$this.treegrid('initExpander');
|
||||
$this.treegrid('renderExpander');
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
$.fn.treegrid = function(method) {
|
||||
if (methods[method]) {
|
||||
return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
|
||||
} else if (typeof method === 'object' || !method) {
|
||||
return methods.initTree.apply(this, arguments);
|
||||
} else {
|
||||
$.error('Method with name ' + method + ' does not exists for jQuery.treegrid');
|
||||
}
|
||||
};
|
||||
/**
|
||||
* Plugin's default options
|
||||
*/
|
||||
$.fn.treegrid.defaults = {
|
||||
initialState: 'expanded',
|
||||
saveState: false,
|
||||
saveStateMethod: 'cookie',
|
||||
saveStateName: 'tree-grid-state',
|
||||
expanderTemplate: '<span class="treegrid-expander"></span>',
|
||||
indentTemplate: '<span class="treegrid-indent"></span>',
|
||||
expanderExpandedClass: 'treegrid-expander-expanded',
|
||||
expanderCollapsedClass: 'treegrid-expander-collapsed',
|
||||
treeColumn: 0,
|
||||
getExpander: function() {
|
||||
return $(this).find('.treegrid-expander');
|
||||
},
|
||||
getNodeId: function() {
|
||||
var template = /treegrid-([A-Za-z0-9_-]+)/;
|
||||
if (template.test($(this).attr('class'))) {
|
||||
return template.exec($(this).attr('class'))[1];
|
||||
}
|
||||
return null;
|
||||
},
|
||||
getParentNodeId: function() {
|
||||
var template = /treegrid-parent-([A-Za-z0-9_-]+)/;
|
||||
if (template.test($(this).attr('class'))) {
|
||||
return template.exec($(this).attr('class'))[1];
|
||||
}
|
||||
return null;
|
||||
},
|
||||
getNodeById: function(id, treegridContainer) {
|
||||
var templateClass = "treegrid-" + id;
|
||||
return treegridContainer.find('tr.' + templateClass);
|
||||
},
|
||||
getChildNodes: function(id, treegridContainer) {
|
||||
var templateClass = "treegrid-parent-" + id;
|
||||
return treegridContainer.find('tr.' + templateClass);
|
||||
},
|
||||
getTreeGridContainer: function() {
|
||||
return $(this).closest('table');
|
||||
},
|
||||
getRootNodes: function(treegridContainer) {
|
||||
var result = $.grep(treegridContainer.find('tr'), function(element) {
|
||||
var classNames = $(element).attr('class');
|
||||
var templateClass = /treegrid-([A-Za-z0-9_-]+)/;
|
||||
var templateParentClass = /treegrid-parent-([A-Za-z0-9_-]+)/;
|
||||
return templateClass.test(classNames) && !templateParentClass.test(classNames);
|
||||
});
|
||||
return $(result);
|
||||
},
|
||||
getAllNodes: function(treegridContainer) {
|
||||
var result = $.grep(treegridContainer.find('tr'), function(element) {
|
||||
var classNames = $(element).attr('class');
|
||||
var templateClass = /treegrid-([A-Za-z0-9_-]+)/;
|
||||
return templateClass.test(classNames);
|
||||
});
|
||||
return $(result);
|
||||
},
|
||||
//Events
|
||||
onCollapse: null,
|
||||
onExpand: null,
|
||||
onChange: null
|
||||
|
||||
};
|
||||
})(jQuery);
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.VueColor=t():e.VueColor=t()}(this,function(){return function(e){function t(r){if(o[r])return o[r].exports;var a=o[r]={exports:{},id:r,loaded:!1};return e[r].call(a.exports,a,a.exports,t),a.loaded=!0,a.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var a=o(37),i=r(a),n=o(38),s=r(n),l=o(41),c=r(l),u=o(42),h=r(u),d=o(39),f=r(d),p=o(40),_=r(p),v=o(36),g=r(v),b=o(6),x=r(b),m=o(8),w=r(m),C=o(4),y=r(C),k=o(5),F=r(k),A=o(7),R=r(A),S=o(3),M=r(S),E={version:"2.2.1",Compact:i.default,Material:s.default,Slider:c.default,Swatches:h.default,Photoshop:f.default,Sketch:_.default,Chrome:g.default,Alpha:x.default,Checkboard:w.default,EditableInput:y.default,Hue:F.default,Saturation:R.default,ColorMixin:M.default};e.exports=E},function(e,t){e.exports=function(){var e=[];return e.toString=function(){for(var e=[],t=0;t<this.length;t++){var o=this[t];o[2]?e.push("@media "+o[2]+"{"+o[1]+"}"):e.push(o[1])}return e.join("")},e.i=function(t,o){"string"==typeof t&&(t=[[null,t,""]]);for(var r={},a=0;a<this.length;a++){var i=this[a][0];"number"==typeof i&&(r[i]=!0)}for(a=0;a<t.length;a++){var n=t[a];"number"==typeof n[0]&&r[n[0]]||(o&&!n[2]?n[2]=o:o&&(n[2]="("+n[2]+") and ("+o+")"),e.push(n))}},e}},function(e,t,o){function r(e,t){for(var o=0;o<e.length;o++){var r=e[o],a=h[r.id];if(a){a.refs++;for(var i=0;i<a.parts.length;i++)a.parts[i](r.parts[i]);for(;i<r.parts.length;i++)a.parts.push(l(r.parts[i],t))}else{for(var n=[],i=0;i<r.parts.length;i++)n.push(l(r.parts[i],t));h[r.id]={id:r.id,refs:1,parts:n}}}}function a(e){for(var t=[],o={},r=0;r<e.length;r++){var a=e[r],i=a[0],n=a[1],s=a[2],l=a[3],c={css:n,media:s,sourceMap:l};o[i]?o[i].parts.push(c):t.push(o[i]={id:i,parts:[c]})}return t}function i(e,t){var o=p(),r=g[g.length-1];if("top"===e.insertAt)r?r.nextSibling?o.insertBefore(t,r.nextSibling):o.appendChild(t):o.insertBefore(t,o.firstChild),g.push(t);else{if("bottom"!==e.insertAt)throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");o.appendChild(t)}}function n(e){e.parentNode.removeChild(e);var t=g.indexOf(e);t>=0&&g.splice(t,1)}function s(e){var t=document.createElement("style");return t.type="text/css",i(e,t),t}function l(e,t){var o,r,a;if(t.singleton){var i=v++;o=_||(_=s(t)),r=c.bind(null,o,i,!1),a=c.bind(null,o,i,!0)}else o=s(t),r=u.bind(null,o),a=function(){n(o)};return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else a()}}function c(e,t,o,r){var a=o?"":r.css;if(e.styleSheet)e.styleSheet.cssText=b(t,a);else{var i=document.createTextNode(a),n=e.childNodes;n[t]&&e.removeChild(n[t]),n.length?e.insertBefore(i,n[t]):e.appendChild(i)}}function u(e,t){var o=t.css,r=t.media,a=t.sourceMap;if(r&&e.setAttribute("media",r),a&&(o+="\n/*# sourceURL="+a.sources[0]+" */",o+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */"),e.styleSheet)e.styleSheet.cssText=o;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(o))}}var h={},d=function(e){var t;return function(){return"undefined"==typeof t&&(t=e.apply(this,arguments)),t}},f=d(function(){return/msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase())}),p=d(function(){return document.head||document.getElementsByTagName("head")[0]}),_=null,v=0,g=[];e.exports=function(e,t){t=t||{},"undefined"==typeof t.singleton&&(t.singleton=f()),"undefined"==typeof t.insertAt&&(t.insertAt="bottom");var o=a(e);return r(o,t),function(e){for(var i=[],n=0;n<o.length;n++){var s=o[n],l=h[s.id];l.refs--,i.push(l)}if(e){var c=a(e);r(c,t)}for(var n=0;n<i.length;n++){var l=i[n];if(0===l.refs){for(var u=0;u<l.parts.length;u++)l.parts[u]();delete h[l.id]}}}};var b=function(){var e=[];return function(t,o){return e[t]=o,e.filter(Boolean).join("\n")}}()},function(e,t,o){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){var o,r=e&&e.a;o=e&&e.hsl?(0,n.default)(e.hsl):e&&e.hex&&e.hex.length>0?(0,n.default)(e.hex):(0,n.default)(e),!o||void 0!==o._a&&null!==o._a||o.setAlpha(r||1);var a=o.toHsl(),i=o.toHsv();return 0===a.s&&(i.h=a.h=e.h||e.hsl&&e.hsl.h||t||0),{hsl:a,hex:o.toHexString().toUpperCase(),rgba:o.toRgb(),hsv:i,oldHue:e.h||t||a.h,source:e.source,a:e.a||o.getAlpha()}}Object.defineProperty(t,"__esModule",{value:!0});var i=o(35),n=r(i);t.default={props:["value"],data:function(){return{val:a(this.value)}},computed:{colors:{get:function(){return this.val},set:function(e){this.val=e,this.$emit("input",e)}}},watch:{value:function(e){this.val=a(e)}},methods:{colorChange:function(e,t){this.oldHue=this.colors.hsl.h,this.colors=a(e,t||this.oldHue)},isValidHex:function(e){return(0,n.default)(e).isValid()},simpleCheckForValidColor:function(e){for(var t=["r","g","b","a","h"Line truncated
|
||||
R&&_?r(e):(_=v=void 0,b)}function d(){void 0!==x&&clearTimeout(x),k=0,_=m=v=x=void 0}function f(){return void 0===x?b:h(y())}function p(){var e=y(),o=c(e);if(_=arguments,v=this,m=e,o){if(void 0===x)return i(m);if(A)return x=setTimeout(u,t),r(m)}return void 0===x&&(x=setTimeout(u,t)),b}var _,v,g,b,x,m,k=0,F=!1,A=!1,R=!0;if("function"!=typeof e)throw new TypeError(l);return t=s(t)||0,a(o)&&(F=!!o.leading,A="maxWait"in o,g=A?w(s(o.maxWait)||0,t):g,R="trailing"in o?!!o.trailing:R),p.cancel=d,p.flush=f,p}function r(e,t,r){var i=!0,n=!0;if("function"!=typeof e)throw new TypeError(l);return a(r)&&(i="leading"in r?!!r.leading:i,n="trailing"in r?!!r.trailing:n),o(e,t,{leading:i,maxWait:t,trailing:n})}function a(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function i(e){return!!e&&"object"==typeof e}function n(e){return"symbol"==typeof e||i(e)&&m.call(e)==u}function s(e){if("number"==typeof e)return e;if(n(e))return c;if(a(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=a(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(h,"");var o=f.test(e);return o||p.test(e)?_(e.slice(2),o?2:8):d.test(e)?c:+e}var l="Expected a function",c=NaN,u="[object Symbol]",h=/^\s+|\s+$/g,d=/^[-+]0x[0-9a-f]+$/i,f=/^0b[01]+$/i,p=/^0o[0-7]+$/i,_=parseInt,v="object"==typeof t&&t&&t.Object===Object&&t,g="object"==typeof self&&self&&self.Object===Object&&self,b=v||g||Function("return this")(),x=Object.prototype,m=x.toString,w=Math.max,C=Math.min,y=function(){return b.Date.now()};e.exports=r}).call(t,function(){return this}())},function(e,t,o){var r,a,i;!function(o,n){a=[],r=n,i="function"==typeof r?r.apply(t,a):r,!(void 0!==i&&(e.exports=i))}(this,function(){return{red:{50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",a100:"#ff8a80",a200:"#ff5252",a400:"#ff1744",a700:"#d50000"},pink:{50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",a100:"#ff80ab",a200:"#ff4081",a400:"#f50057",a700:"#c51162"},purple:{50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",a100:"#ea80fc",a200:"#e040fb",a400:"#d500f9",a700:"#aa00ff"},deepPurple:{50:"#ede7f6",100:"#d1c4e9",200:"#b39ddb",300:"#9575cd",400:"#7e57c2",500:"#673ab7",600:"#5e35b1",700:"#512da8",800:"#4527a0",900:"#311b92",a100:"#b388ff",a200:"#7c4dff",a400:"#651fff",a700:"#6200ea"},indigo:{50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",a100:"#8c9eff",a200:"#536dfe",a400:"#3d5afe",a700:"#304ffe"},blue:{50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",a100:"#82b1ff",a200:"#448aff",a400:"#2979ff",a700:"#2962ff"},lightBlue:{50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",a100:"#80d8ff",a200:"#40c4ff",a400:"#00b0ff",a700:"#0091ea"},cyan:{50:"#e0f7fa",100:"#b2ebf2",200:"#80deea",300:"#4dd0e1",400:"#26c6da",500:"#00bcd4",600:"#00acc1",700:"#0097a7",800:"#00838f",900:"#006064",a100:"#84ffff",a200:"#18ffff",a400:"#00e5ff",a700:"#00b8d4"},teal:{50:"#e0f2f1",100:"#b2dfdb",200:"#80cbc4",300:"#4db6ac",400:"#26a69a",500:"#009688",600:"#00897b",700:"#00796b",800:"#00695c",900:"#004d40",a100:"#a7ffeb",a200:"#64ffda",a400:"#1de9b6",a700:"#00bfa5"},green:{50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",a100:"#b9f6ca",a200:"#69f0ae",a400:"#00e676",a700:"#00c853"},lightGreen:{50:"#f1f8e9",100:"#dcedc8",200:"#c5e1a5",300:"#aed581",400:"#9ccc65",500:"#8bc34a",600:"#7cb342",700:"#689f38",800:"#558b2f",900:"#33691e",a100:"#ccff90",a200:"#b2ff59",a400:"#76ff03",a700:"#64dd17"},lime:{50:"#f9fbe7",100:"#f0f4c3",200:"#e6ee9c",300:"#dce775",400:"#d4e157",500:"#cddc39",600:"#c0ca33",700:"#afb42b",800:"#9e9d24",900:"#827717",a100:"#f4ff81",a200:"#eeff41",a400:"#c6ff00",a700:"#aeea00"},yellow:{50:"#fffde7",100:"#fff9c4",200:"#fff59d",300:"#fff176",400:"#ffee58",500:"#ffeb3b",600:"#fdd835",700:"#fbc02d",800:"#f9a825",900:"#f57f17",a100:"#ffff8d",a200:"#ffff00",a400:"#ffea00",a700:"#ffd600"},amber:{50:"#fff8e1",100:"#ffecb3",200:"#ffe082",300:"#ffd54f",400:"#ffca28",500:"#ffc107",600:"#ffb300",700:"#ffa000",800:"#ff8f00",900:"#ff6f00",a100:"#ffe57f",a200:"#ffd740",a400:"#ffc400",a700:"#ffab00"},orange:{50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",a100:"#ffd180",a200:"#ffab40",a400:"#ff9100",a700:"#ff6d00"},deepOrange:{50:"#fbe9e7",100:"#ffccbc",200:"#ffab91",300:"#ff8a65",400:"#ff7043",500:"#ff5722",600:"#f4511e",700:"#e64a19",800:"#d84315",900:"#bf360c",a100:"#ff9e80",a200:"#ff6e40",a400:"#ff3d00",aLine truncated
|
||||
}})],1),e._v(" "),o("div",{staticClass:"vue-color__sketch__field--single"},[o("ed-in",{attrs:{label:"a","arrow-offset":.01,max:1},on:{change:e.inputChange},model:{value:e.colors.a,callback:function(t){e.colors.a=t},expression:"colors.a"}})],1)]),e._v(" "),o("div",{staticClass:"vue-color__sketch__presets"},e._l(e.presetColors,function(t){return o("div",{staticClass:"vue-color__sketch__presets-color",style:{background:t},on:{click:function(o){e.handlePreset(t)}}})}))])},staticRenderFns:[]}},function(e,t){e.exports={render:function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"vue-color__chrome"},[o("div",{staticClass:"vue-color__chrome__saturation-wrap"},[o("saturation",{on:{change:e.childChange},model:{value:e.colors,callback:function(t){e.colors=t},expression:"colors"}})],1),e._v(" "),o("div",{staticClass:"vue-color__chrome__chrome-body"},[o("div",{staticClass:"vue-color__chrome__controls"},[o("div",{staticClass:"vue-color__chrome__color-wrap"},[o("div",{staticClass:"vue-color__chrome__active-color",style:{background:e.activeColor}})]),e._v(" "),o("div",{staticClass:"vue-color__chrome__sliders"},[o("div",{staticClass:"vue-color__chrome__hue-wrap"},[o("hue",{on:{change:e.childChange},model:{value:e.colors,callback:function(t){e.colors=t},expression:"colors"}})],1),e._v(" "),o("div",{staticClass:"vue-color__chrome__alpha-wrap"},[o("alpha",{on:{change:e.childChange},model:{value:e.colors,callback:function(t){e.colors=t},expression:"colors"}})],1)])]),e._v(" "),o("div",{staticClass:"vue-color__chrome__fields-wrap"},[o("div",{directives:[{name:"show",rawName:"v-show",value:0===e.fieldsIndex,expression:"fieldsIndex === 0"}],staticClass:"vue-color__chrome__fields"},[o("div",{staticClass:"vue-color__chrome__field"},[o("ed-in",{attrs:{label:"hex"},on:{change:e.inputChange},model:{value:e.colors.hex,callback:function(t){e.colors.hex=t},expression:"colors.hex"}})],1)]),e._v(" "),o("div",{directives:[{name:"show",rawName:"v-show",value:1===e.fieldsIndex,expression:"fieldsIndex === 1"}],staticClass:"vue-color__chrome__fields"},[o("div",{staticClass:"vue-color__chrome__field"},[o("ed-in",{attrs:{label:"r"},on:{change:e.inputChange},model:{value:e.colors.rgba.r,callback:function(t){e.colors.rgba.r=t},expression:"colors.rgba.r"}})],1),e._v(" "),o("div",{staticClass:"vue-color__chrome__field"},[o("ed-in",{attrs:{label:"g"},on:{change:e.inputChange},model:{value:e.colors.rgba.g,callback:function(t){e.colors.rgba.g=t},expression:"colors.rgba.g"}})],1),e._v(" "),o("div",{staticClass:"vue-color__chrome__field"},[o("ed-in",{attrs:{label:"b"},on:{change:e.inputChange},model:{value:e.colors.rgba.b,callback:function(t){e.colors.rgba.b=t},expression:"colors.rgba.b"}})],1),e._v(" "),o("div",{staticClass:"vue-color__chrome__field"},[o("ed-in",{attrs:{label:"a","arrow-offset":.01,max:1},on:{change:e.inputChange},model:{value:e.colors.a,callback:function(t){e.colors.a=t},expression:"colors.a"}})],1)]),e._v(" "),o("div",{directives:[{name:"show",rawName:"v-show",value:2===e.fieldsIndex,expression:"fieldsIndex === 2"}],staticClass:"vue-color__chrome__fields"},[o("div",{staticClass:"vue-color__chrome__field"},[o("ed-in",{attrs:{label:"h"},on:{change:e.inputChange},model:{value:e.colors.hsl.h,callback:function(t){e.colors.hsl.h=t},expression:"colors.hsl.h"}})],1),e._v(" "),o("div",{staticClass:"vue-color__chrome__field"},[o("ed-in",{attrs:{label:"s"},on:{change:e.inputChange},model:{value:e.colors.hsl.s,callback:function(t){e.colors.hsl.s=t},expression:"colors.hsl.s"}})],1),e._v(" "),o("div",{staticClass:"vue-color__chrome__field"},[o("ed-in",{attrs:{label:"l"},on:{change:e.inputChange},model:{value:e.colors.hsl.l,callback:function(t){e.colors.hsl.l=t},expression:"colors.hsl.l"}})],1),e._v(" "),o("div",{staticClass:"vue-color__chrome__field"},[o("ed-in",{attrs:{label:"a","arrow-offset":.01,max:1},on:{change:e.inputChange},model:{value:e.colors.a,callback:function(t){e.colors.a=t},expression:"colors.a"}})],1)]),e._v(" "),o("div",{staticClass:"vue-color__chrome__toggle-btn",on:{click:e.toggleViews}},[o("div",{staticClass:"vue-color__chrome__icon"},[o("svg",{staticStyle:{width:"24px",height:"24px"},attrs:{viewBox:"0 0 24 24"},on:{mouseover:e.showHighlight,mouseenter:e.showHighlight,mouseout:e.hideHighlight}},[o("path",{attrs:{fill:"#333",d:"M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z"}})])]),e._v(" "),o("div",{directives:[{name:"show",rawName:"v-show",value:e.highlight,expression:"highlight"}],staticClass:"vue-color__chrome__icon-highlight"})])])])])},staticRenderFns:[]}},function(e,t){e.exports={render:function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"vue-color__c-alpha"},[o("div",{staticClass:"vue-color__c-alpha__checkboard-wrap"},[o("checkboard")],1),e._v(" "),o("div",{staticClass:"vue-color__c-alpha__gradient",style:{background:e.gradientColor}}),e._v(" "),o("div",{ref:"container",staticClass:"vue-color_Line truncated
|
||||
+10078
File diff suppressed because it is too large.
Load diff
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
/*!
|
||||
* Vue.js v2.4.2
|
||||
* (c) 2014-2017 Evan You
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.Vue=e()}(this,function(){"use strict";function t(t){return void 0===t||null===t}function e(t){return void 0!==t&&null!==t}function n(t){return!0===t}function r(t){return!1===t}function i(t){return"string"==typeof t||"number"==typeof t||"boolean"==typeof t}function o(t){return null!==t&&"object"==typeof t}function a(t){return"[object Object]"===pi.call(t)}function s(t){return"[object RegExp]"===pi.call(t)}function c(t){var e=parseFloat(t);return e>=0&&Math.floor(e)===e&&isFinite(t)}function u(t){return null==t?"":"object"==typeof t?JSON.stringify(t,null,2):String(t)}function l(t){var e=parseFloat(t);return isNaN(e)?t:e}function f(t,e){for(var n=Object.create(null),r=t.split(","),i=0;i<r.length;i++)n[r[i]]=!0;return e?function(t){return n[t.toLowerCase()]}:function(t){return n[t]}}function p(t,e){if(t.length){var n=t.indexOf(e);if(n>-1)return t.splice(n,1)}}function d(t,e){return hi.call(t,e)}function v(t){var e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}function h(t,e){function n(n){var r=arguments.length;return r?r>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n}function m(t,e){e=e||0;for(var n=t.length-e,r=new Array(n);n--;)r[n]=t[n+e];return r}function y(t,e){for(var n in e)t[n]=e[n];return t}function g(t){for(var e={},n=0;n<t.length;n++)t[n]&&y(e,t[n]);return e}function _(t,e,n){}function b(t,e){if(t===e)return!0;var n=o(t),r=o(e);if(!n||!r)return!n&&!r&&String(t)===String(e);try{var i=Array.isArray(t),a=Array.isArray(e);if(i&&a)return t.length===e.length&&t.every(function(t,n){return b(t,e[n])});if(i||a)return!1;var s=Object.keys(t),c=Object.keys(e);return s.length===c.length&&s.every(function(n){return b(t[n],e[n])})}catch(t){return!1}}function $(t,e){for(var n=0;n<t.length;n++)if(b(t[n],e))return n;return-1}function C(t){var e=!1;return function(){e||(e=!0,t.apply(this,arguments))}}function w(t){var e=(t+"").charCodeAt(0);return 36===e||95===e}function x(t,e,n,r){Object.defineProperty(t,e,{value:n,enumerable:!!r,writable:!0,configurable:!0})}function A(t){if(!Ti.test(t)){var e=t.split(".");return function(t){for(var n=0;n<e.length;n++){if(!t)return;t=t[e[n]]}return t}}}function k(t,e,n){if(ki.errorHandler)ki.errorHandler.call(null,t,e,n);else{if(!ji||"undefined"==typeof console)throw t;console.error(t)}}function O(t){return"function"==typeof t&&/native code/.test(t.toString())}function T(t){Gi.target&&Zi.push(Gi.target),Gi.target=t}function S(){Gi.target=Zi.pop()}function E(t,e,n){t.__proto__=e}function j(t,e,n){for(var r=0,i=n.length;r<i;r++){var o=n[r];x(t,o,e[o])}}function L(t,e){if(o(t)){var n;return d(t,"__ob__")&&t.__ob__ instanceof eo?n=t.__ob__:to.shouldConvert&&!zi()&&(Array.isArray(t)||a(t))&&Object.isExtensible(t)&&!t._isVue&&(n=new eo(t)),e&&n&&n.vmCount++,n}}function N(t,e,n,r,i){var o=new Gi,a=Object.getOwnPropertyDescriptor(t,e);if(!a||!1!==a.configurable){var s=a&&a.get,c=a&&a.set,u=!i&&L(n);Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){var e=s?s.call(t):n;return Gi.target&&(o.depend(),u&&u.dep.depend(),Array.isArray(e)&&D(e)),e},set:function(e){var r=s?s.call(t):n;e===r||e!==e&&r!==r||(c?c.call(t,e):n=e,u=!i&&L(e),o.notify())}})}}function I(t,e,n){if(Array.isArray(t)&&c(e))return t.length=Math.max(t.length,e),t.splice(e,1,n),n;if(d(t,e))return t[e]=n,n;var r=t.__ob__;return t._isVue||r&&r.vmCount?n:r?(N(r.value,e,n),r.dep.notify(),n):(t[e]=n,n)}function M(t,e){if(Array.isArray(t)&&c(e))t.splice(e,1);else{var n=t.__ob__;t._isVue||n&&n.vmCount||d(t,e)&&(delete t[e],n&&n.dep.notify())}}function D(t){for(var e=void 0,n=0,r=t.length;n<r;n++)(e=t[n])&&e.__ob__&&e.__ob__.dep.depend(),Array.isArray(e)&&D(e)}function P(t,e){if(!e)return t;for(var n,r,i,o=Object.keys(e),s=0;s<o.length;s++)r=t[n=o[s]],i=e[n],d(t,n)?a(r)&&a(i)&&P(r,i):I(t,n,i);return t}function F(t,e,n){return n?t||e?function(){var r="function"==typeof e?e.call(n):e,i="function"==typeof t?t.call(n):void 0;return r?P(r,i):i}:void 0:e?t?function(){return P("function"==typeof e?e.call(this):e,"function"==typeof t?t.call(this):t)}:e:t}function R(t,e){return e?t?t.concat(e):Array.isArray(e)?e:[e]:t}function H(t,e){var n=Object.create(t||null);return e?y(n,e):n}function B(t){var e=t.props;if(e){var n,r,i={};if(Array.isArray(e))for(n=e.length;n--;)"string"==typeof(r=e[n])&&(i[yi(r)]={type:null});else if(a(e))for(var o in e)r=e[o],i[yi(o)]=a(r)?r:{type:r};t.props=i}}function U(t){var e=t.inject;if(Array.isArray(e))for(var n=t.inject={},r=0;r<e.length;r++)n[e[r]]=e[r]}function V(t){var e=t.directives;if(e)for(var n in e){var r=e[n];"function"==typeof r&&(e[n]={bind:r,update:r})}}function z(t,e,n){function r(r){var i=no[r]||ro;c[r]=i(t[r],e[r],n,r)}"function"==typeof e&&(e=e.options),B(e),U(e),V(e);var i=e.extends;if(i&&(t=z(t,i,n)),e.mixins)for(var o=0,a=e.mixins.length;o<a;o++)t=z(t,e.mixins[o],n);var s,c={};for(s in t)r(s);for(s
Line truncated
|
||||
@@ -0,0 +1,310 @@
|
||||
/* eslint-disable no-var */
|
||||
/* eslint-disable no-plusplus */
|
||||
/* eslint-disable prefer-arrow-callback */
|
||||
/* eslint-disable prefer-template */
|
||||
/* eslint-disable func-names */
|
||||
/* eslint-disable object-shorthand */
|
||||
|
||||
(function (factory) {
|
||||
// eslint-disable-next-line no-unused-expressions
|
||||
window.Promise || (window.Promise = factory());
|
||||
// eslint-disable-next-line padded-blocks
|
||||
}(function () {
|
||||
|
||||
var STATUS = {
|
||||
PENDING: 'pending',
|
||||
SEALED: 'sealed',
|
||||
FULFILLED: 'fulfilled',
|
||||
REJECTED: 'rejected',
|
||||
};
|
||||
|
||||
var asyncSettimer = typeof setImmediate !== 'undefined' ? setImmediate : setTimeout;
|
||||
var asyncQueue = [];
|
||||
var asyncTimer;
|
||||
|
||||
function NOP() { }
|
||||
|
||||
function isArray(value) {
|
||||
return Array.isArray ? Array.isArray(value) : Object.prototype.toString.call(value) === '[object Array]';
|
||||
}
|
||||
|
||||
function asyncFlush() {
|
||||
var i = 0;
|
||||
// run
|
||||
for (; i < asyncQueue.length; i++) {
|
||||
asyncQueue[i][0](asyncQueue[i][1]);
|
||||
}
|
||||
|
||||
// reset
|
||||
asyncQueue = [];
|
||||
asyncTimer = false;
|
||||
}
|
||||
|
||||
function asyncCall(callback, arg) {
|
||||
asyncQueue.push([callback, arg]);
|
||||
|
||||
if (!asyncTimer) {
|
||||
asyncTimer = true;
|
||||
asyncSettimer(asyncFlush, 0);
|
||||
}
|
||||
}
|
||||
|
||||
function publish(promise) {
|
||||
var i = 0;
|
||||
var callbacks = promise._then;
|
||||
promise._then = null;
|
||||
|
||||
for (; i < callbacks.length; i++) {
|
||||
// eslint-disable-next-line no-use-before-define
|
||||
invokeCallback(callbacks[i]);
|
||||
}
|
||||
}
|
||||
|
||||
function publishFulfillment(promise) {
|
||||
promise._state = STATUS.FULFILLED;
|
||||
publish(promise);
|
||||
}
|
||||
|
||||
function publishRejection(promise) {
|
||||
promise._state = STATUS.REJECTED;
|
||||
publish(promise);
|
||||
}
|
||||
|
||||
function fulfill(promise, value) {
|
||||
if (promise._state === STATUS.PENDING) {
|
||||
promise._state = STATUS.SEALED;
|
||||
promise._data = value;
|
||||
|
||||
asyncCall(publishFulfillment, promise);
|
||||
}
|
||||
}
|
||||
|
||||
function resolve(promise, value) {
|
||||
// eslint-disable-next-line no-use-before-define
|
||||
if (promise === value || !handleThenable(promise, value)) {
|
||||
fulfill(promise, value);
|
||||
}
|
||||
}
|
||||
|
||||
function reject(promise, reason) {
|
||||
if (promise._state === STATUS.PENDING) {
|
||||
promise._state = STATUS.SEALED;
|
||||
promise._data = reason;
|
||||
|
||||
asyncCall(publishRejection, promise);
|
||||
}
|
||||
}
|
||||
|
||||
function handleThenable(promise, value) {
|
||||
var resolved;
|
||||
|
||||
try {
|
||||
if (promise === value) {
|
||||
throw new TypeError('A promise\'s callback cannot return that same promise');
|
||||
}
|
||||
|
||||
if (value && (typeof value === 'function' || typeof value === 'object')) {
|
||||
// eslint-disable-next-line vars-on-top
|
||||
var then = value.then;
|
||||
|
||||
if (typeof then === 'function') {
|
||||
then.call(value, function (val) {
|
||||
if (!resolved) {
|
||||
resolved = true;
|
||||
|
||||
if (value !== val) {
|
||||
resolve(promise, val);
|
||||
} else {
|
||||
fulfill(promise, val);
|
||||
}
|
||||
}
|
||||
}, function (reason) {
|
||||
if (!resolved) {
|
||||
resolved = true;
|
||||
|
||||
reject(promise, reason);
|
||||
}
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
if (!resolved) {
|
||||
reject(promise, e);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function invokeResolver(fn, promise) {
|
||||
function resolvePromise(value) {
|
||||
resolve(promise, value);
|
||||
}
|
||||
|
||||
function rejectPromise(reason) {
|
||||
reject(promise, reason);
|
||||
}
|
||||
|
||||
try {
|
||||
fn(resolvePromise, rejectPromise);
|
||||
} catch (e) {
|
||||
rejectPromise(e);
|
||||
}
|
||||
}
|
||||
|
||||
function invokeCallback(subscriber) {
|
||||
var owner = subscriber.owner;
|
||||
var settled = owner._state;
|
||||
var value = owner._data;
|
||||
var callback = subscriber[settled];
|
||||
var promise = subscriber.then;
|
||||
|
||||
if (typeof callback === 'function') {
|
||||
settled = STATUS.FULFILLED;
|
||||
try {
|
||||
value = callback(value);
|
||||
} catch (e) {
|
||||
reject(promise, e);
|
||||
}
|
||||
}
|
||||
|
||||
if (!handleThenable(promise, value)) {
|
||||
if (settled === STATUS.FULFILLED) {
|
||||
resolve(promise, value);
|
||||
} else if (settled === STATUS.REJECTED) {
|
||||
reject(promise, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function Promise(fn) {
|
||||
if (!(this instanceof Promise)) {
|
||||
throw new TypeError(this + ' is not a promise');
|
||||
}
|
||||
if (typeof fn !== 'function') {
|
||||
throw new TypeError('Promise resolver ' + fn + ' is not a function');
|
||||
}
|
||||
|
||||
this._then = [];
|
||||
|
||||
invokeResolver(fn, this);
|
||||
}
|
||||
|
||||
Promise.prototype = {
|
||||
_state: STATUS.PENDING,
|
||||
_then: null,
|
||||
_data: undefined,
|
||||
|
||||
then: function (onResolver, onRejection) {
|
||||
var subscriber = {
|
||||
owner: this,
|
||||
then: new Promise(NOP),
|
||||
fulfilled: onResolver,
|
||||
rejected: onRejection,
|
||||
};
|
||||
|
||||
if (this._state === STATUS.FULFILLED || this._state === STATUS.REJECTED) {
|
||||
// already resolved
|
||||
asyncCall(invokeCallback, subscriber);
|
||||
} else {
|
||||
// subscribe
|
||||
this._then.push(subscriber);
|
||||
}
|
||||
return subscriber.then;
|
||||
},
|
||||
// eslint-disable-next-line quote-props
|
||||
'catch': function (onRejection) {
|
||||
return this.then(null, onRejection);
|
||||
},
|
||||
};
|
||||
|
||||
// eslint-disable-next-line no-extend-native
|
||||
Object.defineProperty(Promise.prototype, 'constructor', { value: Promise });
|
||||
|
||||
Promise.all = function (promises) {
|
||||
var This = this;
|
||||
|
||||
if (!isArray(promises)) {
|
||||
throw new TypeError(promises + ' is not an array');
|
||||
}
|
||||
|
||||
return new This(function (onresolve, onreject) {
|
||||
var results = [];
|
||||
var remaining = 0;
|
||||
var i = 0;
|
||||
var promise;
|
||||
|
||||
function resolver(index) {
|
||||
remaining++;
|
||||
return function (value) {
|
||||
results[index] = value;
|
||||
if (!--remaining) {
|
||||
onresolve(results);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
for (; i < promises.length; i++) {
|
||||
promise = promises[i];
|
||||
|
||||
if (promise && typeof promise.then === 'function') {
|
||||
promise.then(resolver(i), onreject);
|
||||
} else {
|
||||
results[i] = promise;
|
||||
}
|
||||
}
|
||||
|
||||
if (!remaining) {
|
||||
onresolve(results);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Promise.race = function (promises) {
|
||||
var This = this;
|
||||
|
||||
if (!isArray(promises)) {
|
||||
throw new TypeError(promises + ' is not an array');
|
||||
}
|
||||
|
||||
return new This(function (onresolve, onreject) {
|
||||
var i = 0;
|
||||
var promise;
|
||||
for (; i < promises.length; i++) {
|
||||
promise = promises[i];
|
||||
|
||||
if (promise && typeof promise.then === 'function') {
|
||||
promise.then(onresolve, onreject);
|
||||
} else {
|
||||
onresolve(promise);
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Promise.resolve = function (value) {
|
||||
var This = this;
|
||||
|
||||
if (value && typeof value === 'object' && value.constructor === This) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return new This(function (onresolve) {
|
||||
onresolve(value);
|
||||
});
|
||||
};
|
||||
|
||||
Promise.reject = function (reason) {
|
||||
var This = this;
|
||||
|
||||
return new This(function (onresolve, onreject) {
|
||||
onreject(reason);
|
||||
});
|
||||
};
|
||||
|
||||
return Promise;
|
||||
}));
|
||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user