BookStack/public/build/js/common-80db108453.js

6 lines
175 KiB
JavaScript
Raw Normal View History

2015-12-01 05:59:34 +08:00
!function e(t,n,i){function r(s,a){if(!n[s]){if(!t[s]){var l="function"==typeof require&&require;if(!a&&l)return l(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[s]={exports:{}};t[s][0].call(u.exports,function(e){var n=t[s][1][e];return r(n?n:e)},u,u.exports,e,t,n,i)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s<i.length;s++)r(i[s]);return r}({1:[function(e,t,n){(function(){var e,n,i,r,o,s,a,l,c=[].slice,u={}.hasOwnProperty,h=function(e,t){function n(){this.constructor=e}for(var i in t)u.call(t,i)&&(e[i]=t[i]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e};a=function(){},n=function(){function e(){}return e.prototype.addEventListener=e.prototype.on,e.prototype.on=function(e,t){return this._callbacks=this._callbacks||{},this._callbacks[e]||(this._callbacks[e]=[]),this._callbacks[e].push(t),this},e.prototype.emit=function(){var e,t,n,i,r,o;if(i=arguments[0],e=2<=arguments.length?c.call(arguments,1):[],this._callbacks=this._callbacks||{},n=this._callbacks[i])for(r=0,o=n.length;o>r;r++)t=n[r],t.apply(this,e);return this},e.prototype.removeListener=e.prototype.off,e.prototype.removeAllListeners=e.prototype.off,e.prototype.removeEventListener=e.prototype.off,e.prototype.off=function(e,t){var n,i,r,o,s;if(!this._callbacks||0===arguments.length)return this._callbacks={},this;if(i=this._callbacks[e],!i)return this;if(1===arguments.length)return delete this._callbacks[e],this;for(r=o=0,s=i.length;s>o;r=++o)if(n=i[r],n===t){i.splice(r,1);break}return this},e}(),e=function(e){function t(e,n){var r,o,s;if(this.element=e,this.version=t.version,this.defaultOptions.previewTemplate=this.defaultOptions.previewTemplate.replace(/\n*/g,""),this.clickableElements=[],this.listeners=[],this.files=[],"string"==typeof this.element&&(this.element=document.querySelector(this.element)),!this.element||null==this.element.nodeType)throw new Error("Invalid dropzone element.");if(this.element.dropzone)throw new Error("Dropzone already attached.");if(t.instances.push(this),this.element.dropzone=this,r=null!=(s=t.optionsForElement(this.element))?s:{},this.options=i({},this.defaultOptions,r,null!=n?n:{}),this.options.forceFallback||!t.isBrowserSupported())return this.options.fallback.call(this);if(null==this.options.url&&(this.options.url=this.element.getAttribute("action")),!this.options.url)throw new Error("No URL provided.");if(this.options.acceptedFiles&&this.options.acceptedMimeTypes)throw new Error("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.");this.options.acceptedMimeTypes&&(this.options.acceptedFiles=this.options.acceptedMimeTypes,delete this.options.acceptedMimeTypes),this.options.method=this.options.method.toUpperCase(),(o=this.getExistingFallback())&&o.parentNode&&o.parentNode.removeChild(o),this.options.previewsContainer!==!1&&(this.options.previewsContainer?this.previewsContainer=t.getElement(this.options.previewsContainer,"previewsContainer"):this.previewsContainer=this.element),this.options.clickable&&(this.options.clickable===!0?this.clickableElements=[this.element]:this.clickableElements=t.getElements(this.options.clickable,"clickable")),this.init()}var i,r;return h(t,e),t.prototype.Emitter=n,t.prototype.events=["drop","dragstart","dragend","dragenter","dragover","dragleave","addedfile","addedfiles","removedfile","thumbnail","error","errormultiple","processing","processingmultiple","uploadprogress","totaluploadprogress","sending","sendingmultiple","success","successmultiple","canceled","canceledmultiple","complete","completemultiple","reset","maxfilesexceeded","maxfilesreached","queuecomplete"],t.prototype.defaultOptions={url:null,method:"post",withCredentials:!1,parallelUploads:2,uploadMultiple:!1,maxFilesize:256,paramName:"file",createImageThumbnails:!0,maxThumbnailFilesize:10,thumbnailWidth:120,thumbnailHeight:120,filesizeBase:1e3,maxFiles:null,params:{},clickable:!0,ignoreHiddenFiles:!0,acceptedFiles:null,acceptedMimeTypes:null,autoProcessQueue:!0,autoQueue:!0,a
},e.isValidFile=function(e,t){var n,i,r,o,s;if(!t)return!0;for(t=t.split(","),i=e.type,n=i.replace(/\/.*$/,""),o=0,s=t.length;s>o;o++)if(r=t[o],r=r.trim(),"."===r.charAt(0)){if(-1!==e.name.toLowerCase().indexOf(r.toLowerCase(),e.name.length-r.length))return!0}else if(/\/\*$/.test(r)){if(n===r.replace(/\/.*$/,""))return!0}else if(i===r)return!0;return!1},"undefined"!=typeof jQuery&&null!==jQuery&&(jQuery.fn.dropzone=function(t){return this.each(function(){return new e(this,t)})}),"undefined"!=typeof t&&null!==t?t.exports=e:window.Dropzone=e,e.ADDED="added",e.QUEUED="queued",e.ACCEPTED=e.QUEUED,e.UPLOADING="uploading",e.PROCESSING=e.UPLOADING,e.CANCELED="canceled",e.ERROR="error",e.SUCCESS="success",o=function(e){var t,n,i,r,o,s,a,l,c,u;for(a=e.naturalWidth,s=e.naturalHeight,n=document.createElement("canvas"),n.width=1,n.height=s,i=n.getContext("2d"),i.drawImage(e,0,0),r=i.getImageData(0,0,1,s).data,u=0,o=s,l=s;l>u;)t=r[4*(l-1)+3],0===t?o=l:u=l,l=o+u>>1;return c=l/s,0===c?1:c},s=function(e,t,n,i,r,s,a,l,c,u){var h;return h=o(t),e.drawImage(t,n,i,r,s,a,l,c,u/h)},r=function(e,t){var n,i,r,o,s,a,l,c,u;if(r=!1,u=!0,i=e.document,c=i.documentElement,n=i.addEventListener?"addEventListener":"attachEvent",l=i.addEventListener?"removeEventListener":"detachEvent",a=i.addEventListener?"":"on",o=function(n){return"readystatechange"!==n.type||"complete"===i.readyState?(("load"===n.type?e:i)[l](a+n.type,o,!1),!r&&(r=!0)?t.call(e,n.type||n):void 0):void 0},s=function(){var e;try{c.doScroll("left")}catch(t){return e=t,void setTimeout(s,50)}return o("poll")},"complete"!==i.readyState){if(i.createEventObject&&c.doScroll){try{u=!e.frameElement}catch(h){}u&&s()}return i[n](a+"DOMContentLoaded",o,!1),i[n](a+"readystatechange",o,!1),e[n](a+"load",o,!1)}},e._autoDiscoverFunction=function(){return e.autoDiscover?e.discover():void 0},r(window,e._autoDiscoverFunction)}).call(this)},{}],2:[function(e,t,n){function i(){u=!1,a.length?c=a.concat(c):h=-1,c.length&&r()}function r(){if(!u){var e=setTimeout(i);u=!0;for(var t=c.length;t;){for(a=c,c=[];++h<t;)a&&a[h].run();h=-1,t=c.length}a=null,u=!1,clearTimeout(e)}}function o(e,t){this.fun=e,this.array=t}function s(){}var a,l=t.exports={},c=[],u=!1,h=-1;l.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new o(e,t)),1!==c.length||u||setTimeout(r,0)},o.prototype.run=function(){this.fun.apply(null,this.array)},l.title="browser",l.browser=!0,l.env={},l.argv=[],l.version="",l.versions={},l.on=s,l.addListener=s,l.once=s,l.off=s,l.removeListener=s,l.removeAllListeners=s,l.emit=s,l.binding=function(e){throw new Error("process.binding is not supported")},l.cwd=function(){return"/"},l.chdir=function(e){throw new Error("process.chdir is not supported")},l.umask=function(){return 0}},{}],3:[function(e,t,n){function i(e){var t=e.unbuild;e.unbuild=function(e){if(!this.hotUpdating){var n=this.childVM&&this.childVM.constructor;o(n,this),e&&r(this.Component,this)}return t.call(this,e)}}function r(e,t){var n=e&&e.options.hotID;n&&(h[n]||(h[n]={Component:e,views:[],instances:[]}),h[n].views.push(t))}function o(e,t){var n=e&&e.options.hotID;n&&h[n].views.$remove(t)}function s(e,t){t.hotID=e,a(t,"created",function(){h[e].instances.push(this)}),a(t,"beforeDestroy",function(){h[e].instances.$remove(this)})}function a(e,t,n){var i=e[t];e[t]=i?Array.isArray(i)?i.concat(n):[i,n]:[n]}function l(e,t){if(e._bound){e.Component=t,e.hotUpdating=!0,e.vm._isCompiled=!1;var n=e.childVM.$data,i=e.keepAlive;e.keepAlive=!1,e.mountComponent(),e.keepAlive=i,e.childVM.$data=n,e.vm._isCompiled=!0,e.hotUpdating=!1}}function c(e){return e.match(/[^\/]+\.vue$/)[0]}var u,h=Object.create(null),p=!1,d=!1;n.install=function(e,t){if(!p){if(p=!0,u=e,d=t,n.compatible=!!u.internalDirectives,!n.compatible)return void console.warn("[HMR] vue-loader hot reload is only compatible with Vue.js 1.0.0+.");i(u.internalDirectives.component),console.log("[HMR] Vue component hot reload shim applied.");var r=u.elementDirective("router-view");r&&(i(r),console.log("[HMR] vue-router
}],24:[function(e,t,n){(function(n){function i(){}function r(e,t,i,r,o,s){this.vm=t,this.el=i,this.descriptor=e,this.name=e.name,this.expression=e.expression,this.arg=e.arg,this.modifiers=e.modifiers,this.filters=e.filters,this.literal=this.modifiers&&this.modifiers.literal,this._locked=!1,this._bound=!1,this._listeners=null,this._host=r,this._scope=o,this._frag=s,"production"!==n.env.NODE_ENV&&this.el&&(this.el._vue_directives=this.el._vue_directives||[],this.el._vue_directives.push(this))}var o=e("./util"),s=e("./watcher"),a=e("./parsers/expression");r.prototype._bind=function(){var e=this.name,t=this.descriptor;if(("cloak"!==e||this.vm._isCompiled)&&this.el&&this.el.removeAttribute){var n=t.attr||"v-"+e;this.el.removeAttribute(n)}var r=t.def;if("function"==typeof r?this.update=r:o.extend(this,r),this._setupParams(),this.bind&&this.bind(),this.literal)this.update&&this.update(t.raw);else if((this.expression||this.modifiers)&&(this.update||this.twoWay)&&!this._checkStatement()){var a=this;this.update?this._update=function(e,t){a._locked||a.update(e,t)}:this._update=i;var l=this._preProcess?o.bind(this._preProcess,this):null,c=this._postProcess?o.bind(this._postProcess,this):null,u=this._watcher=new s(this.vm,this.expression,this._update,{filters:this.filters,twoWay:this.twoWay,deep:this.deep,preProcess:l,postProcess:c,scope:this._scope});this.afterBind?this.afterBind():this.update&&this.update(u.value)}this._bound=!0},r.prototype._setupParams=function(){if(this.params){var e=this.params;this.params=Object.create(null);for(var t,n,i,r=e.length;r--;)t=e[r],i=o.camelize(t),n=o.getBindAttr(this.el,t),null!=n?this._setupParamWatcher(i,n):(n=o.attr(this.el,t),null!=n&&(this.params[i]=""===n?!0:n))}},r.prototype._setupParamWatcher=function(e,t){var n=this,i=!1,r=(this._scope||this.vm).$watch(t,function(t,r){if(n.params[e]=t,i){var o=n.paramWatchers&&n.paramWatchers[e];o&&o.call(n,t,r)}else i=!0},{immediate:!0});(this._paramUnwatchFns||(this._paramUnwatchFns=[])).push(r)},r.prototype._checkStatement=function(){var e=this.expression;if(e&&this.acceptStatement&&!a.isSimplePath(e)){var t=a.parse(e).get,n=this._scope||this.vm,i=function(){t.call(n,n)};return this.filters&&(i=n._applyFilters(i,null,this.filters)),this.update(i),!0}},r.prototype.set=function(e){this.twoWay?this._withLock(function(){this._watcher.set(e)}):"production"!==n.env.NODE_ENV&&o.warn("Directive.set() can only be used inside twoWaydirectives.")},r.prototype._withLock=function(e){var t=this;t._locked=!0,e.call(t),o.nextTick(function(){t._locked=!1})},r.prototype.on=function(e,t){o.on(this.el,e,t),(this._listeners||(this._listeners=[])).push([e,t])},r.prototype._teardown=function(){if(this._bound){this._bound=!1,this.unbind&&this.unbind(),this._watcher&&this._watcher.teardown();var e,t=this._listeners;if(t)for(e=t.length;e--;)o.off(this.el,t[e][0],t[e][1]);var i=this._paramUnwatchFns;if(i)for(e=i.length;e--;)i[e]();"production"!==n.env.NODE_ENV&&this.el&&this.el._vue_directives.$remove(this),this.vm=this.el=this._watcher=this._listeners=null}},t.exports=r}).call(this,e("_process"))},{"./parsers/expression":63,"./util":74,"./watcher":78,_process:2}],25:[function(e,t,n){n.slot=e("./slot"),n.partial=e("./partial")},{"./partial":26,"./slot":27}],26:[function(e,t,n){(function(n){var i=e("../../util"),r=e("../public/if"),o=e("../../fragment/factory");t.exports={priority:1750,params:["name"],paramWatchers:{name:function(e){r.remove.call(this),e&&this.insert(e)}},bind:function(){this.anchor=i.createAnchor("v-partial"),i.replace(this.el,this.anchor),this.insert(this.params.name)},insert:function(e){var t=i.resolveAsset(this.vm.$options,"partials",e);"production"!==n.env.NODE_ENV&&i.assertAsset(t,"partial",e),t&&(this.factory=new o(this.vm,t),r.insert.call(this))},unbind:function(){this.frag&&this.frag.destroy()}}}).call(this,e("_process"))},{"../../fragment/factory":52,"../../util":74,"../public/if":39,_process:2}],27:[function(e,t,n){function i(e,t,n){function i(e){!r.isTemplate(e)||e.hasAttribute("v-if")||e.hasAttribute("v-for")||(e=o.parse(e)),e=o.clone(e),s.appendCh
p.test(n)&&(n=n.replace(p,""),i=(e._scope||e._context).$eval(r[o].value,!0),e.$on(n.replace(p),i))}function r(e,t,n){if(n){var i,r,s,a;for(r in n)if(i=n[r],u.isArray(i))for(s=0,a=i.length;a>s;s++)o(e,t,r,i[s]);else o(e,t,r,i)}}function o(e,n,i,r,s){var a=typeof r;if("function"===a)e[n](i,r,s);else if("string"===a){var l=e.$options.methods,c=l&&l[r];c?e[n](i,c,s):"production"!==t.env.NODE_ENV&&u.warn('Unknown method: "'+r+'" when registering callback for '+n+': "'+i+'".')}else r&&"object"===a&&o(e,n,i,r.handler,r)}function s(){this._isAttached||(this._isAttached=!0,this.$children.forEach(a))}function a(e){!e._isAttached&&h(e.$el)&&e._callHook("attached")}function l(){this._isAttached&&(this._isAttached=!1,this.$children.forEach(c))}function c(e){e._isAttached&&!h(e.$el)&&e._callHook("detached")}var u=e("../util"),h=u.inDoc,p=/^v-on:|^@/;n._initEvents=function(){var e=this.$options;e._asComponent&&i(this,e.el),r(this,"$on",e.events),r(this,"$watch",e.watch)},n._initDOMHooks=function(){this.$on("hook:attached",s),this.$on("hook:detached",l)},n._callHook=function(e){var t=this.$options[e];if(t)for(var n=0,i=t.length;i>n;n++)t[n].call(this);this.$emit("hook:"+e)}}).call(this,e("_process"))},{"../util":74,_process:2}],55:[function(e,t,n){var i=e("../util").mergeOptions,r=0;n._init=function(e){e=e||{},this.$el=null,this.$parent=e.parent,this.$root=this.$parent?this.$parent.$root:this,this.$children=[],this.$refs={},this.$els={},this._watchers=[],this._directives=[],this._uid=r++,this._isVue=!0,this._events={},this._eventsCount={},this._shouldPropagate=!1,this._isFragment=!1,this._fragment=this._fragmentStart=this._fragmentEnd=null,this._isCompiled=this._isDestroyed=this._isReady=this._isAttached=this._isBeingDestroyed=!1,this._unlinkFn=null,this._context=e._context||this.$parent,this._scope=e._scope,this._frag=e._frag,this._frag&&this._frag.children.push(this),this.$parent&&this.$parent.$children.push(this),e=this.$options=i(this.constructor.options,e,this),this._updateRef(),this._data={},this._callHook("init"),this._initState(),this._initEvents(),this._callHook("created"),e.el&&this.$mount(e.el)}},{"../util":74}],56:[function(e,t,n){var i=e("../util"),r=e("../directive"),o=e("../compiler");n._updateRef=function(e){var t=this.$options._ref;if(t){var n=(this._scope||this._context).$refs;e?n[t]===this&&(n[t]=null):n[t]=this}},n._compile=function(e){var t=this.$options,n=e;e=o.transclude(e,t),this._initElement(e);var r,s=this._context&&this._context.$options,a=o.compileRoot(e,t,s),l=this.constructor;t._linkerCachable&&(r=l.linker,r||(r=l.linker=o.compile(e,t)));var c=a(this,e,this._scope),u=r?r(this,e):o.compile(e,t)(this,e);return this._unlinkFn=function(){c(),u(!0)},t.replace&&i.replace(n,e),this._isCompiled=!0,this._callHook("compiled"),e},n._initElement=function(e){e instanceof DocumentFragment?(this._isFragment=!0,this.$el=this._fragmentStart=e.firstChild,this._fragmentEnd=e.lastChild,3===this._fragmentStart.nodeType&&(this._fragmentStart.data=this._fragmentEnd.data=""),this._fragment=e):this.$el=e,this.$el.__vue__=this,this._callHook("beforeCompile")},n._bindDir=function(e,t,n,i,o){this._directives.push(new r(e,this,t,n,i,o))},n._destroy=function(e,t){if(this._isBeingDestroyed)return void(t||this._cleanup());this._callHook("beforeDestroy"),this._isBeingDestroyed=!0;var n,i=this.$parent;for(i&&!i._isBeingDestroyed&&(i.$children.$remove(this),this._updateRef(!0)),n=this.$children.length;n--;)this.$children[n].$destroy();for(this._propsUnlinkFn&&this._propsUnlinkFn(),this._unlinkFn&&this._unlinkFn(),n=this._watchers.length;n--;)this._watchers[n].teardown();this.$el&&(this.$el.__vue__=null);var r=this;e&&this.$el?this.$remove(function(){r._cleanup()}):t||this._cleanup()},n._cleanup=function(){this._isDestroyed||(this._frag&&this._frag.children.$remove(this),this._data.__ob__&&this._data.__ob__.removeVm(this),this.$el=this.$parent=this.$root=this.$children=this._watchers=this._context=this._scope=this._directives=null,this._isDestroyed=!0,this._callHook("destroyed"),this.$off())}},{"../compiler":21,"../directive":24,"../util":74
var i=Object.keys(n);for(t=i.length;t--;){var r=n[i[t]];"function"==typeof r&&(n[i[t]]={type:r})}}}function a(e){if(l.isArray(e)){for(var n,i={},r=e.length;r--;){n=e[r];var o="function"==typeof n?n.options&&n.options.name||n.id:n.name||n.id;o?i[o]=n:"production"!==t.env.NODE_ENV&&l.warn('Array-syntax assets must provide a "name" or "id" field.')}return i}return e}var l=e("./index"),c=e("../config"),u=l.extend,h=c.optionMergeStrategies=Object.create(null);h.data=function(e,n,r){return r?e||n?function(){var t="function"==typeof n?n.call(r):n,o="function"==typeof e?e.call(r):void 0;return t?i(t,o):o}:void 0:n?"function"!=typeof n?("production"!==t.env.NODE_ENV&&l.warn('The "data" option should be a function that returns a per-instance value in component definitions.'),e):e?function(){return i(n.call(this),e.call(this))}:n:e},h.el=function(e,n,i){if(!i&&n&&"function"!=typeof n)return void("production"!==t.env.NODE_ENV&&l.warn('The "el" option should be a function that returns a per-instance value in component definitions.'));var r=n||e;return i&&"function"==typeof r?r.call(i):r},h.init=h.created=h.ready=h.attached=h.detached=h.beforeCompile=h.compiled=h.beforeDestroy=h.destroyed=function(e,t){return t?e?e.concat(t):l.isArray(t)?t:[t]:e},h.paramAttributes=function(){"production"!==t.env.NODE_ENV&&l.warn('"paramAttributes" option has been deprecated in 0.12. Use "props" instead.')},c._assetTypes.forEach(function(e){h[e+"s"]=r}),h.watch=h.events=function(e,t){if(!t)return e;if(!e)return t;var n={};u(n,e);for(var i in t){var r=n[i],o=t[i];r&&!l.isArray(r)&&(r=[r]),n[i]=r?r.concat(o):[o]}return n},h.props=h.methods=h.computed=function(e,t){if(!t)return e;if(!e)return t;var n=Object.create(null);return u(n,e),u(n,t),n};var p=function(e,t){return void 0===t?e:t};n.mergeOptions=function d(e,t,n){function i(i){var r=h[i]||p;a[i]=r(e[i],t[i],n,i)}o(t),s(t);var r,a={};if(t.mixins)for(var l=0,c=t.mixins.length;c>l;l++)e=d(e,t.mixins[l],n);for(r in e)i(r);for(r in t)e.hasOwnProperty(r)||i(r);return a},n.resolveAsset=function(e,t,n){var i,r=e[t];return r[n]||r[i=l.camelize(n)]||r[i.charAt(0).toUpperCase()+i.slice(1)]}}).call(this,e("_process"))},{"../config":23,"./index":74,_process:2}],77:[function(e,t,n){(function(n){function i(e){this._init(e)}var r=e("./util"),o=r.extend;o(i,e("./api/global")),i.options={replace:!0,directives:e("./directives/public"),elementDirectives:e("./directives/element"),filters:e("./filters"),transitions:{},components:{},partials:{}};var s=i.prototype;Object.defineProperty(s,"$data",{get:function(){return this._data},set:function(e){e!==this._data&&this._setData(e)}}),o(s,e("./instance/init")),o(s,e("./instance/events")),o(s,e("./instance/state")),o(s,e("./instance/lifecycle")),o(s,e("./instance/misc")),o(s,e("./api/data")),o(s,e("./api/dom")),o(s,e("./api/events")),o(s,e("./api/lifecycle")),i.version="1.0.7",t.exports=r.Vue=i,"production"!==n.env.NODE_ENV&&r.inBrowser&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__.emit("init",i)}).call(this,e("_process"))},{"./api/data":12,"./api/dom":13,"./api/events":14,"./api/global":15,"./api/lifecycle":16,"./directives/element":25,"./directives/public":40,"./filters":51,"./instance/events":54,"./instance/init":55,"./instance/lifecycle":56,"./instance/misc":57,"./instance/state":58,"./util":74,_process:2}],78:[function(e,t,n){(function(n){function i(e,t,n,i){i&&o.extend(this,i);var r="function"==typeof t;if(this.vm=e,e._watchers.push(this),this.expression=r?t.toString():t,this.cb=n,this.id=++u,this.active=!0,this.dirty=this.lazy,this.deps=Object.create(null),this.newDeps=null,this.prevError=null,r)this.getter=t,this.setter=void 0;else{var s=l.parse(t,this.twoWay);this.getter=s.get,this.setter=s.set}this.value=this.lazy?void 0:this.get(),this.queued=this.shallow=!1}function r(e){var t,n;if(o.isArray(e))for(t=e.length;t--;)r(e[t]);else if(o.isObject(e))for(n=Object.keys(e),t=n.length;t--;)r(e[n[t]])}var o=e("./util"),s=e("./config"),a=e("./observer/dep"),l=e("./parsers/expression"),c=e("./batcher"),u=0;i.prototype.addDep=function(e){var t=e.id;thi
2015-12-02 05:30:21 +08:00
e=ht(e);for(var t=0;t<e.length;t++)if(E.call(e,t)&&e[t]&&1===e[t].nodeType){e[t].zcClippingId?-1===Je[e[t].zcClippingId].indexOf(this.id)&&Je[e[t].zcClippingId].push(this.id):(e[t].zcClippingId="zcClippingId_"+Ye++,Je[e[t].zcClippingId]=[this.id],J.autoActivate===!0&&pt(e[t]));var n=Ge[this.id]&&Ge[this.id].elements;-1===n.indexOf(e[t])&&n.push(e[t])}return this},st=function(e){var t=Ge[this.id];if(!t)return this;var n,i=t.elements;e="undefined"==typeof e?i.slice(0):ht(e);for(var r=e.length;r--;)if(E.call(e,r)&&e[r]&&1===e[r].nodeType){for(n=0;-1!==(n=i.indexOf(e[r],n));)i.splice(n,1);var o=Je[e[r].zcClippingId];if(o){for(n=0;-1!==(n=o.indexOf(this.id,n));)o.splice(n,1);0===o.length&&(J.autoActivate===!0&&dt(e[r]),delete e[r].zcClippingId)}}return this},at=function(){var e=Ge[this.id];return e&&e.elements?e.elements.slice(0):[]},lt=function(){Ge[this.id]&&(this.unclip(),this.off(),delete Ge[this.id])},ct=function(e){if(!e||!e.type)return!1;if(e.client&&e.client!==this)return!1;var t=Ge[this.id],n=t&&t.elements,i=!!n&&n.length>0,r=!e.target||i&&-1!==n.indexOf(e.target),o=e.relatedTarget&&i&&-1!==n.indexOf(e.relatedTarget),s=e.client&&e.client===this;return t&&(r||o||s)?!0:!1},ut=function(e){var t=Ge[this.id];if("object"==typeof e&&e&&e.type&&t){var n=ye(e),i=t&&t.handlers["*"]||[],r=t&&t.handlers[e.type]||[],o=i.concat(r);if(o&&o.length){var a,l,c,u,h,p=this;for(a=0,l=o.length;l>a;a++)c=o[a],u=p,"string"==typeof c&&"function"==typeof s[c]&&(c=s[c]),"object"==typeof c&&c&&"function"==typeof c.handleEvent&&(u=c,c=c.handleEvent),"function"==typeof c&&(h=A({},e),be(c,u,[h],n))}}},ht=function(e){return"string"==typeof e&&(e=[]),"number"!=typeof e.length?[e]:e},pt=function(e){if(e&&1===e.nodeType){var t=function(e){(e||(e=s.event))&&("js"!==e._source&&(e.stopImmediatePropagation(),e.preventDefault()),delete e._source)},n=function(n){(n||(n=s.event))&&(t(n),Ze.focus(e))};e.addEventListener("mouseover",n,!1),e.addEventListener("mouseout",t,!1),e.addEventListener("mouseenter",t,!1),e.addEventListener("mouseleave",t,!1),e.addEventListener("mousemove",t,!1),Ke[e.zcClippingId]={mouseover:n,mouseout:t,mouseenter:t,mouseleave:t,mousemove:t}}},dt=function(e){if(e&&1===e.nodeType){var t=Ke[e.zcClippingId];if("object"==typeof t&&t){for(var n,i,r=["move","leave","enter","out","over"],o=0,s=r.length;s>o;o++)n="mouse"+r[o],i=t[n],"function"==typeof i&&e.removeEventListener(n,i,!1);delete Ke[e.zcClippingId]}}};Ze._createClient=function(){et.apply(this,O(arguments))},Ze.prototype.on=function(){return tt.apply(this,O(arguments))},Ze.prototype.off=function(){return nt.apply(this,O(arguments))},Ze.prototype.handlers=function(){return it.apply(this,O(arguments))},Ze.prototype.emit=function(){return rt.apply(this,O(arguments))},Ze.prototype.clip=function(){return ot.apply(this,O(arguments))},Ze.prototype.unclip=function(){return st.apply(this,O(arguments))},Ze.prototype.elements=function(){return at.apply(this,O(arguments))},Ze.prototype.destroy=function(){return lt.apply(this,O(arguments))},Ze.prototype.setText=function(e){if(!Ge[this.id])throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");return Ze.setData("text/plain",e),this},Ze.prototype.setHtml=function(e){if(!Ge[this.id])throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");return Ze.setData("text/html",e),this},Ze.prototype.setRichText=function(e){if(!Ge[this.id])throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");return Ze.setData("application/rtf",e),this},Ze.prototype.setData=function(){if(!Ge[this.id])throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");return Ze.setData.apply(this,O(arguments)),this},Ze.prototype.clearData=function(){if(!Ge[this.id])throw new Error("Attempted to clear pending clipboard data from a destroyed ZeroClipboard client instance");return Ze.clearData.apply(this,O(arguments)),this},Ze.prototype.getData=function(){if(!Ge[this.id])throw new Error("Attemp