You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

9 lines
14 KiB
JavaScript

2 years ago
/*!
* artDialog 5.0.4
* Date: 2013-07-31
* https://github.com/aui/artDialog
* (c) 2009-2013 TangBin, http://www.planeArt.cn
*
* This is licensed under the GNU LGPL, version 2.1 or later.
* For details, see: http://creativecommons.org/licenses/LGPL/2.1/
*/!function(a,b){function f(a,b,c){b=b||document,c=c||"*";for(var d=0,e=0,f=[],g=b.getElementsByTagName(c),h=g.length,i=new RegExp("(^|\\s)"+a+"(\\s|$)");h>d;d++)i.test(g[d].className)&&(f[e]=g[d],e++);return f}function g(d){var e=c.expando,f=d===a?0:d[e];return f===b&&(d[e]=f=++c.uuid),f}function h(a){return c.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}var c=a.art=function(a,b){return new c.fn.constructor(a,b)},d=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,e=/[\n\t]/g;return a.$===b&&(a.$=c),c.fn=c.prototype={constructor:function(a,b){var c,e;return b=b||document,a?a.nodeType?(this[0]=a,this):"string"==typeof a&&(c=d.exec(a),c&&c[2])?(e=b.getElementById(c[2]),e&&e.parentNode&&(this[0]=e),this):(this[0]=a,this):this},hasClass:function(a){var b=" "+a+" ";return(" "+this[0].className+" ").replace(e," ").indexOf(b)>-1?!0:!1},addClass:function(a){return this.hasClass(a)||(this[0].className+=" "+a),this},removeClass:function(a){var b=this[0];return a?this.hasClass(a)&&(b.className=b.className.replace(a," ")):b.className="",this},css:function(a,d){var e,f=this[0],g=arguments[0];if("string"==typeof a){if(d===b)return c.css(f,a);f.style[a]=d}else for(e in g)f.style[e]=g[e];return this},show:function(){return this.css("display","block")},hide:function(){return this.css("display","none")},offset:function(){var a=this[0],b=a.getBoundingClientRect(),c=a.ownerDocument,d=c.body,e=c.documentElement,f=e.clientTop||d.clientTop||0,g=e.clientLeft||d.clientLeft||0,h=b.top+(self.pageYOffset||e.scrollTop)-f,i=b.left+(self.pageXOffset||e.scrollLeft)-g;return{left:i,top:h}},html:function(a){var d=this[0];return a===b?d.innerHTML:(c.cleanData(d.getElementsByTagName("*")),d.innerHTML=a,this)},remove:function(){var a=this[0];return c.cleanData(a.getElementsByTagName("*")),c.cleanData([a]),a.parentNode.removeChild(a),this},bind:function(a,b){return c.event.add(this[0],a,b),this},unbind:function(a,b){return c.event.remove(this[0],a,b),this}},c.fn.constructor.prototype=c.fn,c.isWindow=function(a){return a&&"object"==typeof a&&"setInterval"in a},c.fn.find=function(a){var b,d=this[0],e=a.split(".")[1];return b=e?document.getElementsByClassName?d.getElementsByClassName(e):f(e,d):d.getElementsByTagName(a),c(b[0])},c.each=function(a,c){var d,e=0,f=a.length,g=f===b;if(g){for(d in a)if(c.call(a[d],d,a[d])===!1)break}else for(var h=a[0];f>e&&c.call(h,e,h)!==!1;h=a[++e]);return a},c.data=function(a,d,e){var f=c.cache,h=g(a);return d===b?f[h]:(f[h]||(f[h]={}),e!==b&&(f[h][d]=e),f[h][d])},c.removeData=function(a,b){var d=!0,e=c.expando,f=c.cache,h=g(a),i=h&&f[h];if(i)if(b){delete i[b];for(var j in i)d=!1;d&&delete c.cache[h]}else delete f[h],a.removeAttribute?a.removeAttribute(e):a[e]=null},c.uuid=0,c.cache={},c.expando="@cache"+ +new Date,c.event={add:function(a,b,d){var e,f,g=c.event,h=c.data(a,"@events")||c.data(a,"@events",{});e=h[b]=h[b]||{},f=e.listeners=e.listeners||[],f.push(d),e.handler||(e.elem=a,e.handler=g.handler(e),a.addEventListener?a.addEventListener(b,e.handler,!1):a.attachEvent("on"+b,e.handler))},remove:function(a,b,d){var e,f,g,h=c.event,i=!0,j=c.data(a,"@events");if(j)if(b){if(f=j[b]){if(g=f.listeners,d)for(e=0;e<g.length;e++)g[e]===d&&g.splice(e--,1);else f.listeners=[];if(0===f.listeners.length){a.removeEventListener?a.removeEventListener(b,f.handler,!1):a.detachEvent("on"+b,f.handler),delete j[b],f=c.data(a,"@events");for(var k in f)i=!1;i&&c.removeData(a,"@events")}}}else for(e in j)h.remove(a,e)},handler:function(b){return function(d){d=c.event.fix(d||a.event);for(var g,e=0,f=b.listeners;g=f[e++];)g.call(b.elem,d)===!1&&(d.preventDefault(),d.stopPropagation())}},fix:function(a){if(a.target)return a;var b={target:a.srcElement||document,preventDefault:function(){a.returnValue=!1},stopPropagation:function(){a.cancelBubble=!0}};for(var c in a)b[c]=a[c];return b}},c.cleanData=function(a){for(var d,b=0,e=a.length,f=c.event.remove,g=c.removeData;e>b;b++)d=a[b],f(d),g(d)},c.css="defaultView"in document&&"getComputedStyle"in document.defaultView?function(a,b){return document.defaultView.getComputedStyle(a,!1)[b]}:function(a,b)