/*! * artDialog 4.1.7 * Date: 2013-03-03 08:04 * http://code.google.com/p/artdialog/ * (c) 2009-2012 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(G,k,z){G.noop=G.noop||function(){};var w,C,q,y,j=0,J=G(k),F=G(document),B=G("html"),I=document.documentElement,D=k.VBArray&&!k.XMLHttpRequest,x="createTouch" in document&&!("onmousemove" in I)||/(iPhone|iPad|iPod)/i.test(navigator.userAgent),H="artDialog"+ +(new Date),b=function(g,e,h){g=g||{};if(typeof g=="string"||g.nodeType===1){g={content:g,fixed:!x}}var n,d=b.defaults,m=g.follow=this.nodeType===1&&this||g.follow;for(var c in d){g[c]===z&&(g[c]=d[c])}return G.each({ok:"yesFn",cancel:"noFn",close:"closeFn",init:"initFn",okVal:"yesText",cancelVal:"noText"},function(f,a){g[f]=g[f]!==z?g[f]:g[a]}),typeof m=="string"&&(m=G(m)[0]),g.id=m&&m[H+"follow"]||g.id||H+j,n=b.list[g.id],m&&n?n.follow(m).zIndex().focus():n?n.zIndex().focus():(x&&(g.fixed=!1),G.isArray(g.button)||(g.button=g.button?[g.button]:[]),e!==z&&(g.ok=e),h!==z&&(g.cancel=h),g.ok&&g.button.push({name:g.okVal,callback:g.ok,focus:!0}),g.cancel&&g.button.push({name:g.cancelVal,callback:g.cancel}),b.defaults.zIndex=g.zIndex,j++,b.list[g.id]=w?w._init(g):new b.fn._init(g))};b.fn=b.prototype={version:"4.1.7",closed:!0,_init:function(d){var g=this,a,c=d.icon,f=c&&(D?{png:"icons/"+c+".png"}:{backgroundImage:"url('"+d.path+"/skins/icons/"+c+".png')"});return g.closed=!1,g.config=d,g.DOM=a=g.DOM||g._getDOM(),a.wrap.addClass(d.skin),a.close[d.cancel===!1?"hide":"show"](),a.icon[0].style.display=c?"":"none",a.iconBg.css(f||{background:"none"}),a.se.css("cursor",d.resize?"se-resize":"auto"),a.title.css("cursor",d.drag?"move":"auto"),a.content.css("padding",d.padding),g[d.show?"show":"hide"](!0),g.button(d.button).title(d.title).content(d.content,!0).size(d.width,d.height).time(d.time),d.follow?g.follow(d.follow):g.position(d.left,d.top),g.zIndex().focus(),d.lock&&g.lock(),g._addEvent(),g._ie6PngFix(),w=null,d.init&&d.init.call(g,k),g},content:function(O){var U,g,L,V,n=this,T=n.DOM,R=T.wrap[0],N=R.offsetWidth,K=R.offsetHeight,Q=parseInt(R.style.left),M=parseInt(R.style.top),m=R.style.width,P=T.content,S=P[0];return n._elemBack&&n._elemBack(),R.style.width="auto",O===z?S:(typeof O=="string"?P.html(O):O&&O.nodeType===1&&(V=O.style.display,U=O.previousSibling,g=O.nextSibling,L=O.parentNode,n._elemBack=function(){U&&U.parentNode?U.parentNode.insertBefore(O,U.nextSibling):g&&g.parentNode?g.parentNode.insertBefore(O,g):L&&L.appendChild(O),O.style.display=V,n._elemBack=null},P.html(""),S.appendChild(O),O.style.display="block"),arguments[1]||(n.config.follow?n.follow(n.config.follow):(N=R.offsetWidth-N,K=R.offsetHeight-K,Q-=N/2,M-=K/2,R.style.left=Math.max(Q,0)+"px",R.style.top=Math.max(M,0)+"px"),m&&m!=="auto"&&(R.style.width=R.offsetWidth+"px"),n._autoPositionType()),n._ie6SelectFix(),n._runScript(S),n)},title:function(g){var c=this.DOM,f=c.wrap,a=c.title,d="aui_state_noTitle";return g===z?a[0]:(g===!1?(a.hide().html(""),f.addClass(d)):(a.show().html(g||""),f.removeClass(d)),this)},position:function(N,U){var a=this,L=a.config,V=a.DOM.wrap[0],h=D?!1:L.fixed,T=D&&a.config.fixed,K=F.scrollLeft(),P=F.scrollTop(),f=h?0:K,O=h?0:P,S=J.width(),n=J.height(),M=V.offsetWidth,R=V.offsetHeight,Q=V.style;if(N||N===0){a._left=N.toString().indexOf("%")!==-1?N:null,N=a._toNumber(N,S-M),typeof N=="number"?(N=T?N+=K:N+f,Q.left=Math.max(N,f)+"px"):typeof N=="string"&&(Q.left=N)}if(U||U===0){a._top=U.toString().indexOf("%")!==-1?U:null,U=a._toNumber(U,n-R),typeof U=="number"?(U=T?U+=P:U+O,Q.top=Math.max(U,O)+"px"):typeof U=="string"&&(Q.top=U)}return N!==z&&U!==z&&(a._follow=null,a._autoPositionType()),a},size:function(N,Q){var m,a,K,R,g=this,P=g.config,M=g.DOM,v=M.wrap,O=M.main,L=v[0].style,d=O[0].style;return N&&(g._width=N.toString().indexOf("%")!==-1?N:null,m=J.width()-v[0].offsetWidth+O[0].offsetWidth,K=g._toNumber(N,m),N=K,typeof N=="number"?(L.width="auto",d.width=Math.max(g.config.minWidth,N)+"px",L.width=v[0].offsetWidth+"px"):typeof N=="string"&&(d.width=N,N==="auto"&&v.css("width","auto"))),Q&&(g._height=Q.toString().indexOf("%")!==-1?Q:null,a=J.height()-v[0].offsetHeight+O[0].offsetHeight,R=g._toNumber(Q,a),Q=R,typeof Q=="number"?d.height=Math.max(g.config.minHeight,Q)+"px":typeof Q=="string"&&(d.height=Q)),g._ie6SelectFix(),g},follow:function(P){var X,U=this,ab=U.config;if(typeof P=="string"||P&&P.nodeType===1){X=G(P),P=X[0]}if(!P||!P.offsetWidth&&!P.offsetHeight){return U.position(U._left,U._top)}var Q=H+"follow",W=J.width(),M=J.height(),Z=F.scrollLeft(),ad=F.scrollTop(),V=X.offset(),L=P.offsetWidth,Y=P.offsetHeight,ac=D?!1:ab.fixed,f=ac?V.left-Z:V.left,ae=ac?V.top-ad:V.top,K=U.DOM.wrap[0],O=K.style,d=K.offsetWidth,h=K.offsetHeight,a=f-(d-L)/2,e=ae+Y,R=ac?0:Z,aa=ac?0:ad;return a=aW&&f-d>R?f-d+L:a,e=e+h>M+aa&&ae-h>aa?ae-h:e,O.left=a+"px",O.top=e+"px",U._follow&&U._follow.removeAttribute(Q),U._follow=P,P[Q]=ab.id,U._autoPositionType(),U},button:function(){var g=this,l=arguments,e=g.DOM,h=e.buttons,n=h[0],d="aui_state_highlight",c=g._listeners=g._listeners||{},m=G.isArray(l[0])?l[0]:[].slice.call(l);return l[0]===z?n:(G.each(m,function(u,p){var a=p.name,o=!c[a],t=o?document.createElement("button"):c[a].elem;c[a]||(c[a]={}),p.callback&&(c[a].callback=p.callback),p.className&&(t.className=p.className),p.focus&&(g._focus&&g._focus.removeClass(d),g._focus=G(t).addClass(d),g.focus()),t.setAttribute("type","button"),t[H+"callback"]=a,t.disabled=!!p.disabled,o&&(t.innerHTML=a,c[a].elem=t,n.appendChild(t))}),h[0].style.display=m.length?"":"none",g._ie6SelectFix(),g)},show:function(){return this.DOM.wrap.show(),!arguments[0]&&this._lockMaskWrap&&this._lockMaskWrap.show(),this},hide:function(){return this.DOM.wrap.hide(),!arguments[0]&&this._lockMaskWrap&&this._lockMaskWrap.hide(),this},close:function(){if(this.closed){return this}var h=this,m=h.DOM,f=m.wrap,g=b.list,l=h.config.close,d=h.config.follow;h.time();if(typeof l=="function"&&l.call(h,k)===!1){return h}h.unlock(),h._elemBack&&h._elemBack(),f[0].className=f[0].style.cssText="",m.title.html(""),m.content.html(""),m.buttons.html(""),b.focus===h&&(b.focus=null),d&&d.removeAttribute(H+"follow"),delete g[h.config.id],h._removeEvent(),h.hide(!0)._setAbsolute();for(var c in h){h.hasOwnProperty(c)&&c!=="DOM"&&delete h[c]}return w?f.remove():w=h,h},time:function(d){var a=this,f=a.config.cancelVal,c=a._timer;return c&&clearTimeout(c),d&&(a._timer=setTimeout(function(){a._click(f)},1000*d)),a},focus:function(){try{if(this.config.focus){var c=this._focus&&this._focus[0]||this.DOM.close[0];c&&c.focus()}}catch(a){}return this},zIndex:function(){var f=this,c=f.DOM,g=c.wrap,d=b.focus,a=b.defaults.zIndex++;return g.css("zIndex",a),f._lockMask&&f._lockMask.css("zIndex",a-1),d&&d.DOM.wrap.removeClass("aui_state_focus"),b.focus=f,g.addClass("aui_state_focus"),f},lock:function(){if(this._lock){return this}var M=this,g=b.defaults.zIndex-1,e=M.DOM.wrap,m=M.config,N=F.width(),f=F.height(),L=M._lockMaskWrap||G(document.body.appendChild(document.createElement("div"))),K=M._lockMask||G(L[0].appendChild(document.createElement("div"))),h="(document).documentElement",v=x?"width:"+N+"px;height:"+f+"px":"width:100%;height:100%",p=D?"position:absolute;left:expression("+h+".scrollLeft);top:expression("+h+".scrollTop);width:expression("+h+".clientWidth);height:expression("+h+".clientHeight)":"";return M.zIndex(),e.addClass("aui_state_lock"),L[0].style.cssText=v+";position:fixed;z-index:"+g+";top:0;left:0;overflow:hidden;"+p,K[0].style.cssText="height:100%;background:"+m.background+";filter:alpha(opacity=0);opacity:0",D&&K.html(''),K.stop(),K.bind("click",function(){M._reset()}).bind("dblclick",function(){M._click(M.config.cancelVal)}),m.duration===0?K.css({opacity:m.opacity}):K.animate({opacity:m.opacity},m.duration),M._lockMaskWrap=L,M._lockMask=K,M._lock=!0,M},unlock:function(){var f=this,c=f._lockMaskWrap,g=f._lockMask;if(!f._lock){return f}var a=c[0].style,d=function(){D&&(a.removeExpression("width"),a.removeExpression("height"),a.removeExpression("left"),a.removeExpression("top")),a.cssText="display:none",w&&c.remove()};return g.stop().unbind(),f.DOM.wrap.removeClass("aui_state_lock"),f.config.duration?g.animate({opacity:0},f.config.duration,d):d(),f._lock=!1,f},_getDOM:function(){var d=document.createElement("div"),h=document.body;d.style.cssText="position:absolute;left:0;top:0",d.innerHTML=b._templates,h.insertBefore(d,h.firstChild);var f,c=0,e={wrap:G(d)},g=d.getElementsByTagName("*"),a=g.length;for(;c
',b.defaults={content:'
loading..
',title:"\u6d88\u606f",button:null,ok:null,cancel:null,init:null,close:null,okVal:"\u786e\u5b9a",cancelVal:"\u53d6\u6d88",width:"auto",height:"auto",minWidth:96,minHeight:32,padding:"20px 25px",skin:"",icon:null,time:null,esc:!0,focus:!0,show:!0,follow:null,path:y,lock:!1,background:"#000000",opacity:0.7,duration:300,fixed:!1,left:"50%",top:"38.2%",zIndex:1987,resize:!0,drag:!0},k.artDialog=G.dialog=G.artDialog=b})(this.art||this.jQuery&&(this.art=jQuery),this),function(g){var k,d,b=g(window),f=g(document),l=document.documentElement,c=!("minWidth" in l.style),j="onlosecapture" in l,h="setCapture" in l;artDialog.dragEvent=function(){var i=this,a=function(e){var m=i[e];i[e]=function(){return m.apply(i,arguments)}};a("start"),a("move"),a("end")},artDialog.dragEvent.prototype={onstart:g.noop,start:function(a){return f.bind("mousemove",this.move).bind("mouseup",this.end),this._sClientX=a.clientX,this._sClientY=a.clientY,this.onstart(a.clientX,a.clientY),!1},onmove:g.noop,move:function(a){return this._mClientX=a.clientX,this._mClientY=a.clientY,this.onmove(a.clientX-this._sClientX,a.clientY-this._sClientY),!1},onend:g.noop,end:function(a){return f.unbind("mousemove",this.move).unbind("mouseup",this.end),this.onend(a.clientX,a.clientY),!1}},d=function(w){var i,C,u,q,z,r,a=artDialog.focus,x=a.DOM,B=x.wrap,o=x.title,t=x.main,A="getSelection" in window?function(){window.getSelection().removeAllRanges()}:function(){try{document.selection.empty()}catch(m){}};k.onstart=function(m,p){r?(C=t[0].offsetWidth,u=t[0].offsetHeight):(q=B[0].offsetLeft,z=B[0].offsetTop),f.bind("dblclick",k.end),!c&&j?o.bind("losecapture",k.end):b.bind("blur",k.end),h&&o[0].setCapture(),B.addClass("aui_state_drag"),a.focus()},k.onmove=function(y,s){if(r){var v=B[0].style,p=t[0].style,E=y+C,n=s+u;v.width="auto",p.width=Math.max(0,E)+"px",v.width=B[0].offsetWidth+"px",p.height=Math.max(0,n)+"px"}else{var p=B[0].style,m=Math.max(i.minX,Math.min(i.maxX,y+q)),D=Math.max(i.minY,Math.min(i.maxY,s+z));p.left=m+"px",p.top=D+"px"}A(),a._ie6SelectFix()},k.onend=function(m,p){f.unbind("dblclick",k.end),!c&&j?o.unbind("losecapture",k.end):b.unbind("blur",k.end),h&&o[0].releaseCapture(),c&&!a.closed&&a._autoPositionType(),B.removeClass("aui_state_drag")},r=w.target===x.se[0]?!0:!1,i=function(){var D,H,p=a.DOM.wrap[0],I=p.style.position==="fixed",m=p.offsetWidth,G=p.offsetHeight,F=b.width(),y=b.height(),v=I?0:f.scrollLeft(),E=I?0:f.scrollTop(),D=F-m+v;return H=y-G+E,{minX:v,minY:E,maxX:D,maxY:H}}(),k.start(w)},f.bind("mousedown",function(p){var n=artDialog.focus;if(!n){return}var a=p.target,m=n.config,q=n.DOM;if(m.drag!==!1&&a===q.title[0]||m.resize!==!1&&a===q.se[0]){return k=k||new artDialog.dragEvent,d(p),!1}})}(this.art||this.jQuery&&(this.art=jQuery));