code
stringlengths
1
2.01M
repo_name
stringlengths
3
62
path
stringlengths
1
267
language
stringclasses
231 values
license
stringclasses
13 values
size
int64
1
2.01M
<?php /** * Created by JetBrains PhpStorm. * User: CAIXUDONG * Date: 11-6-16 * Time: 下午4:06 */ include '../bootstrap.php'; $_user = Model::getInstance('user'); $user_info = $_user->needLogin(); $role_name = $_input->post('role_name'); if(!$role_name){ $data = array( "statusCode"=>"300", "message"=>"必须填写角色名", ); echo Response::JSON($data); exit; } $ret = Model::getInstance('role')->addRole($role_name); if($ret){ $data = array( "statusCode"=>"200", "message"=>"添加成功", "navTabId"=>"role", ); echo Response::JSON($data); }else{ $data = array( "statusCode"=>"300", "message"=>"添加失败", ); echo Response::JSON($data); }
zyroot
trunk/admin/ajax/aj_add_role.php
PHP
art
798
<?php /** * Created by JetBrains PhpStorm. * User: CAIXUDONG * Date: 11-6-16 * Time: 下午4:06 */ include '../bootstrap.php'; $_user = Model::getInstance('user'); $user_info_l = $_user->needLogin(); $user_id = $_input->post('user_id'); $password = $_input->post('password'); $user_info = $user_id == $user_info['user_id'] ? $user_info_l : $_user->getUserById($user_id); $_password = substr(md5($password.PASSWORD_PREFIX),0,16); $is_super_admin = Model::getInstance('user')->isSuperAdmin($user_info_l['user_id']); if(!$is_super_admin && (!$password || $user_info['password'] != $_password)){ $data = array( "statusCode"=>"300", "message"=>"密码错误", ); echo Response::JSON($data); exit; } $newpassword = $_input->post('newpassword'); $repassword = $_input->post('repassword'); if($password && $newpassword != $repassword){ $data = array( "statusCode"=>"300", "message"=>"两次输入的密码不一致", ); echo Response::JSON($data); exit; } $user_name = $is_super_admin ? $_input->post('user_name') : $user_info['user_name']; $email = $_input->post('email'); $tel = $_input->post('tel'); $real_name = $_input->post('real_name'); $svn_user = $_input->post('svn_user'); $ret = Model::getInstance('user')->updateUser($user_id,$user_name,$newpassword,$email,$tel,$real_name,$svn_user); $role_ids = $_input->post('role_ids',false); if($ret){ if($role_ids){ $role_ids = explode(',',$role_ids); $role_ids = array_unique($role_ids); Model::getInstance('userhasrole')->delByUserId($user_id); foreach($role_ids as $v){ if($v){ Model::getInstance('userhasrole')->add($user_id,$v); } } } $data = array( "statusCode"=>"200", "message"=>"修改成功", "navTabId"=>"user", ); echo Response::JSON($data); }else{ $data = array( "statusCode"=>"300", "message"=>"修改失败", ); echo Response::JSON($data); }
zyroot
trunk/admin/ajax/aj_edit_user.php
PHP
art
2,112
<?php /** * Created by JetBrains PhpStorm. * User: CAIXUDONG * Date: 11-6-16 * Time: 下午4:06 */ include '../bootstrap.php'; $_user = Model::getInstance('user'); $user_info = $_user->needLogin(); $cate_ids = $_input->post('cate_ids'); $user_id = $_input->post('user_id'); Model::getInstance('catehasuser')->delByUserId($user_id); if($cate_ids){ $cate_ids = array_unique($cate_ids); foreach($cate_ids as $v){ if($v){ Model::getInstance('catehasuser')->add($v,$user_id); } } } $data = array( "statusCode"=>"200", "message"=>"权限设置成功!", "navTabId"=>"user", ); echo Response::JSON($data);
zyroot
trunk/admin/ajax/aj_set_user_role.php
PHP
art
693
<?php /** * Created by JetBrains PhpStorm. * User: CAIXUDONG * Date: 11-6-16 * Time: 下午4:06 */ include '../bootstrap.php'; $_user = Model::getInstance('user'); $user_info = $_user->needLogin(); $user_name = $_input->post('user_name'); $password = $_input->post('password'); $repassword = $_input->post('repassword'); if(!$user_name){ $data = array( "statusCode"=>"300", "message"=>"必须填写用户名", ); echo Response::JSON($data); exit; } if(!$password || $password != $repassword){ $data = array( "statusCode"=>"300", "message"=>"两次输入的密码不一致", ); echo Response::JSON($data); exit; } $email = $_input->post('email'); $tel = $_input->post('tel'); $real_name = $_input->post('real_name'); $svn_user = $_input->post('svn_user'); $ret = Model::getInstance('user')->addUser($user_name,$password,$email,$tel,$real_name,$svn_user); $role_ids = $_input->post('role_ids',false); if($ret){ if($role_ids){ $role_ids = explode(',',$role_ids); $role_ids = array_unique($role_ids); foreach($role_ids as $v){ if($v){ Model::getInstance('userhasrole')->add($ret,$v); } } } $data = array( "statusCode"=>"200", "message"=>"添加成功", "navTabId"=>"user", ); echo Response::JSON($data); }else{ $data = array( "statusCode"=>"300", "message"=>"添加失败", ); echo Response::JSON($data); }
zyroot
trunk/admin/ajax/aj_add_user.php
PHP
art
1,603
<?php /** * Created by JetBrains PhpStorm. * User: CAIXUDONG * Date: 11-6-16 * Time: 下午4:06 */ include '../bootstrap.php'; $_user = Model::getInstance('user'); $user_info = $_user->needLogin(); $cate_name = $_input->post('cate_name'); if(!$cate_name){ $data = array( "statusCode"=>"300", "message"=>"必须填写分类名", ); echo Response::JSON($data); exit; } $action = $_input->post('action'); $parent_cate_id = $_input->post('parent_cate_id',0); $role_ids = $_input->post('role_ids',false); $is_show = $_input->post('is_show'); $cate_id = $_input->post('cate_id'); $ret = Model::getInstance('cate')->updateCate($cate_id,$cate_name,$action,$parent_cate_id,$is_show); if($ret){ if($role_ids){ $role_ids = explode(',',$role_ids); $role_ids = array_unique($role_ids); Model::getInstance('catehasrole')->delByCateId($cate_id); foreach($role_ids as $v){ if($v){ Model::getInstance('catehasrole')->add($cate_id,$v); } } } $data = array( "statusCode"=>"200", "message"=>"更新成功", "navTabId"=>"cate", ); echo Response::JSON($data); }else{ $data = array( "statusCode"=>"300", "message"=>"更新失败", ); echo Response::JSON($data); }
zyroot
trunk/admin/ajax/aj_edit_cate.php
PHP
art
1,396
<?php /** * Created by JetBrains PhpStorm. * User: CAIXUDONG * Date: 11-6-16 * Time: 下午4:06 */ include '../bootstrap.php'; $_user = Model::getInstance('user'); $user_info = $_user->needLogin(); $role_ids = $_input->post('role_ids'); $user_id = $_input->post('user_id'); if(!$role_ids){ $data = array( "statusCode"=>"300", "message"=>"至少选择一个角色!", ); echo Response::JSON($data); exit; } Model::getInstance('userhasrole')->delByUserId($user_id); if($role_ids){ $role_ids = array_unique($role_ids); foreach($role_ids as $v){ if($v){ Model::getInstance('userhasrole')->add($user_id,$v); } } } $data = array( "statusCode"=>"200", "message"=>"角色设置成功!", ); echo Response::JSON($data);
zyroot
trunk/admin/ajax/aj_user_role.php
PHP
art
841
/* SWFObject v2.2 <http://code.google.com/p/swfobject/> is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> */ ;var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null; if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true; X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10); ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0;}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version"); if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)];}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}; }(),k=function(){if(!M.w3){return;}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f(); }if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false);}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee); f();}});if(O==top){(function(){if(J){return;}try{j.documentElement.doScroll("left");}catch(X){setTimeout(arguments.callee,0);return;}f();})();}}if(M.wk){(function(){if(J){return; }if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return;}f();})();}s(f);}}();function f(){if(J){return;}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span")); Z.parentNode.removeChild(Z);}catch(aa){return;}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]();}}function K(X){if(J){X();}else{U[U.length]=X;}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false); }else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false);}else{if(typeof O.attachEvent!=D){i(O,"onload",Y);}else{if(typeof O.onload=="function"){var X=O.onload; O.onload=function(){X();Y();};}else{O.onload=Y;}}}}}function h(){if(T){V();}else{H();}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r); aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(","); M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)];}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return;}}X.removeChild(aa);Z=null;H(); })();}else{H();}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y); if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa);}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall; ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class");}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align"); }var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value"); }}P(ai,ah,Y,ab);}else{p(ae);if(ab){ab(aa);}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z;}ab(aa);}}}}}function z(aa){var X=null; var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y;}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z;}}}return X;}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312); }function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null;}else{l=ae;Q=X;}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"; }if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137";}j.title=j.title.slice(0,47)+" - Flash Player Installation"; var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac; }else{ab.flashvars=ac;}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none"; (function(){if(ae.readyState==4){ae.parentNode.removeChild(ae);}else{setTimeout(arguments.callee,10);}})();}u(aa,ab,X);}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div"); Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y);}else{setTimeout(arguments.callee,10); }})();}else{Y.parentNode.replaceChild(g(Y),Y);}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML;}else{var Y=ab.getElementsByTagName(r)[0]; if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true)); }}}}}return aa;}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X;}if(aa){if(typeof ai.id==D){ai.id=Y;}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]; }else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"';}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"';}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'; }}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id);}else{var Z=C(r);Z.setAttribute("type",q); for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac]);}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac]); }}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab]);}}aa.parentNode.replaceChild(Z,aa);X=Z;}}return X;}function e(Z,X,Y){var aa=C("param"); aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa);}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none"; (function(){if(X.readyState==4){b(Y);}else{setTimeout(arguments.callee,10);}})();}else{X.parentNode.removeChild(X);}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null; }}Y.parentNode.removeChild(Y);}}function c(Z){var X=null;try{X=j.getElementById(Z);}catch(Y){}return X;}function C(X){return j.createElement(X);}function i(Z,X,Y){Z.attachEvent(X,Y); I[I.length]=[Z,X,Y];}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false; }function v(ac,Y,ad,ab){if(M.ie&&M.mac){return;}var aa=j.getElementsByTagName("head")[0];if(!aa){return;}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null; G=null;}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]; }G=X;}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y);}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}")); }}}function w(Z,X){if(!m){return;}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y;}else{v("#"+Z,"visibility:"+Y);}}function L(Y){var Z=/[\\\"<>\.;]/; var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y;}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length; for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2]);}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa]);}for(var Y in M){M[Y]=null;}M=null;for(var X in swfobject){swfobject[X]=null; }swfobject=null;});}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y; w(ab,false);}else{if(Z){Z({success:false,id:ab});}}},getObjectById:function(X){if(M.w3){return z(X);}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah}; if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al];}}aj.data=ab; aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak];}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]; }else{am.flashvars=ai+"="+Z[ai];}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true);}X.success=true;X.ref=an;}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac); return;}else{w(ah,true);}}if(ac){ac(X);}});}else{if(ac){ac(X);}}},switchOffAutoHideShow:function(){m=false;},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}; },hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X);}else{return undefined;}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y); }},removeSWF:function(X){if(M.w3){y(X);}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X);}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash; if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1];}if(aa==null){return L(Z);}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1))); }}}return"";},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"; }}if(E){E(B);}}a=false;}}};}(); /* SWFUpload: http://www.swfupload.org, http://swfupload.googlecode.com mmSWFUpload 1.0: Flash upload dialog - http://profandesign.se/swfupload/, http://www.vinterwebb.se/ SWFUpload is (c) 2006-2007 Lars Huring, Olov Nilzén and Mammon Media and is released under the MIT License: http://www.opensource.org/licenses/mit-license.php SWFUpload 2 is (c) 2007-2008 Jake Roberts and is released under the MIT License: http://www.opensource.org/licenses/mit-license.php */ var SWFUpload;if(SWFUpload==undefined){SWFUpload=function(a){this.initSWFUpload(a)}}SWFUpload.prototype.initSWFUpload=function(b){try{this.customSettings={};this.settings=b;this.eventQueue=[];this.movieName="SWFUpload_"+SWFUpload.movieCount++;this.movieElement=null;SWFUpload.instances[this.movieName]=this;this.initSettings();this.loadFlash();this.displayDebugInfo()}catch(a){delete SWFUpload.instances[this.movieName];throw a}};SWFUpload.instances={};SWFUpload.movieCount=0;SWFUpload.version="2.2.0 2009-03-25";SWFUpload.QUEUE_ERROR={QUEUE_LIMIT_EXCEEDED:-100,FILE_EXCEEDS_SIZE_LIMIT:-110,ZERO_BYTE_FILE:-120,INVALID_FILETYPE:-130};SWFUpload.UPLOAD_ERROR={HTTP_ERROR:-200,MISSING_UPLOAD_URL:-210,IO_ERROR:-220,SECURITY_ERROR:-230,UPLOAD_LIMIT_EXCEEDED:-240,UPLOAD_FAILED:-250,SPECIFIED_FILE_ID_NOT_FOUND:-260,FILE_VALIDATION_FAILED:-270,FILE_CANCELLED:-280,UPLOAD_STOPPED:-290};SWFUpload.FILE_STATUS={QUEUED:-1,IN_PROGRESS:-2,ERROR:-3,COMPLETE:-4,CANCELLED:-5};SWFUpload.BUTTON_ACTION={SELECT_FILE:-100,SELECT_FILES:-110,START_UPLOAD:-120};SWFUpload.CURSOR={ARROW:-1,HAND:-2};SWFUpload.WINDOW_MODE={WINDOW:"window",TRANSPARENT:"transparent",OPAQUE:"opaque"};SWFUpload.completeURL=function(a){if(typeof(a)!=="string"||a.match(/^https?:\/\//i)||a.match(/^\//)){return a}var c=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"");var b=window.location.pathname.lastIndexOf("/");if(b<=0){path="/"}else{path=window.location.pathname.substr(0,b)+"/"}return path+a};SWFUpload.prototype.initSettings=function(){this.ensureDefault=function(b,a){this.settings[b]=(this.settings[b]==undefined)?a:this.settings[b]};this.ensureDefault("upload_url","");this.ensureDefault("preserve_relative_urls",false);this.ensureDefault("file_post_name","Filedata");this.ensureDefault("post_params",{});this.ensureDefault("use_query_string",false);this.ensureDefault("requeue_on_error",false);this.ensureDefault("http_success",[]);this.ensureDefault("assume_success_timeout",0);this.ensureDefault("file_types","*.*");this.ensureDefault("file_types_description","All Files");this.ensureDefault("file_size_limit",0);this.ensureDefault("file_upload_limit",0);this.ensureDefault("file_queue_limit",0);this.ensureDefault("flash_url","swfupload.swf");this.ensureDefault("prevent_swf_caching",true);this.ensureDefault("button_image_url","");this.ensureDefault("button_width",1);this.ensureDefault("button_height",1);this.ensureDefault("button_text","");this.ensureDefault("button_text_style","color: #000000; font-size: 16pt;");this.ensureDefault("button_text_top_padding",0);this.ensureDefault("button_text_left_padding",0);this.ensureDefault("button_action",SWFUpload.BUTTON_ACTION.SELECT_FILES);this.ensureDefault("button_disabled",false);this.ensureDefault("button_placeholder_id","");this.ensureDefault("button_placeholder",null);this.ensureDefault("button_cursor",SWFUpload.CURSOR.ARROW);this.ensureDefault("button_window_mode",SWFUpload.WINDOW_MODE.WINDOW);this.ensureDefault("debug",false);this.settings.debug_enabled=this.settings.debug;this.settings.return_upload_start_handler=this.returnUploadStart;this.ensureDefault("swfupload_loaded_handler",null);this.ensureDefault("file_dialog_start_handler",null);this.ensureDefault("file_queued_handler",null);this.ensureDefault("file_queue_error_handler",null);this.ensureDefault("file_dialog_complete_handler",null);this.ensureDefault("upload_start_handler",null);this.ensureDefault("upload_progress_handler",null);this.ensureDefault("upload_error_handler",null);this.ensureDefault("upload_success_handler",null);this.ensureDefault("upload_complete_handler",null);this.ensureDefault("debug_handler",this.debugMessage);this.ensureDefault("custom_settings",{});this.customSettings=this.settings.custom_settings;if(!!this.settings.prevent_swf_caching){this.settings.flash_url=this.settings.flash_url+(this.settings.flash_url.indexOf("?")<0?"?":"&")+"preventswfcaching="+new Date().getTime()}if(!this.settings.preserve_relative_urls){this.settings.upload_url=SWFUpload.completeURL(this.settings.upload_url);this.settings.button_image_url=SWFUpload.completeURL(this.settings.button_image_url)}delete this.ensureDefault};SWFUpload.prototype.loadFlash=function(){var a,b;if(document.getElementById(this.movieName)!==null){throw"ID "+this.movieName+" is already in use. The Flash Object could not be added"}a=document.getElementById(this.settings.button_placeholder_id)||this.settings.button_placeholder;if(a==undefined){throw"Could not find the placeholder element: "+this.settings.button_placeholder_id}b=document.createElement("div");b.innerHTML=this.getFlashHTML();a.parentNode.replaceChild(b.firstChild,a);if(window[this.movieName]==undefined){window[this.movieName]=this.getMovieElement()}};SWFUpload.prototype.getFlashHTML=function(){return['<object id="',this.movieName,'" type="application/x-shockwave-flash" data="',this.settings.flash_url,'" width="',this.settings.button_width,'" height="',this.settings.button_height,'" class="swfupload">','<param name="wmode" value="',this.settings.button_window_mode,'" />','<param name="movie" value="',this.settings.flash_url,'" />','<param name="quality" value="high" />','<param name="menu" value="false" />','<param name="allowScriptAccess" value="always" />','<param name="flashvars" value="'+this.getFlashVars()+'" />',"</object>"].join("")};SWFUpload.prototype.getFlashVars=function(){var b=this.buildParamString();var a=this.settings.http_success.join(",");return["movieName=",encodeURIComponent(this.movieName),"&amp;uploadURL=",encodeURIComponent(this.settings.upload_url),"&amp;useQueryString=",encodeURIComponent(this.settings.use_query_string),"&amp;requeueOnError=",encodeURIComponent(this.settings.requeue_on_error),"&amp;httpSuccess=",encodeURIComponent(a),"&amp;assumeSuccessTimeout=",encodeURIComponent(this.settings.assume_success_timeout),"&amp;params=",encodeURIComponent(b),"&amp;filePostName=",encodeURIComponent(this.settings.file_post_name),"&amp;fileTypes=",encodeURIComponent(this.settings.file_types),"&amp;fileTypesDescription=",encodeURIComponent(this.settings.file_types_description),"&amp;fileSizeLimit=",encodeURIComponent(this.settings.file_size_limit),"&amp;fileUploadLimit=",encodeURIComponent(this.settings.file_upload_limit),"&amp;fileQueueLimit=",encodeURIComponent(this.settings.file_queue_limit),"&amp;debugEnabled=",encodeURIComponent(this.settings.debug_enabled),"&amp;buttonImageURL=",encodeURIComponent(this.settings.button_image_url),"&amp;buttonWidth=",encodeURIComponent(this.settings.button_width),"&amp;buttonHeight=",encodeURIComponent(this.settings.button_height),"&amp;buttonText=",encodeURIComponent(this.settings.button_text),"&amp;buttonTextTopPadding=",encodeURIComponent(this.settings.button_text_top_padding),"&amp;buttonTextLeftPadding=",encodeURIComponent(this.settings.button_text_left_padding),"&amp;buttonTextStyle=",encodeURIComponent(this.settings.button_text_style),"&amp;buttonAction=",encodeURIComponent(this.settings.button_action),"&amp;buttonDisabled=",encodeURIComponent(this.settings.button_disabled),"&amp;buttonCursor=",encodeURIComponent(this.settings.button_cursor)].join("")};SWFUpload.prototype.getMovieElement=function(){if(this.movieElement==undefined){this.movieElement=document.getElementById(this.movieName)}if(this.movieElement===null){throw"Could not find Flash element"}return this.movieElement};SWFUpload.prototype.buildParamString=function(){var c=this.settings.post_params;var b=[];if(typeof(c)==="object"){for(var a in c){if(c.hasOwnProperty(a)){b.push(encodeURIComponent(a.toString())+"="+encodeURIComponent(c[a].toString()))}}}return b.join("&amp;")};SWFUpload.prototype.destroy=function(){try{this.cancelUpload(null,false);var a=null;a=this.getMovieElement();if(a&&typeof(a.CallFunction)==="unknown"){for(var c in a){try{if(typeof(a[c])==="function"){a[c]=null}}catch(e){}}try{a.parentNode.removeChild(a)}catch(b){}}window[this.movieName]=null;SWFUpload.instances[this.movieName]=null;delete SWFUpload.instances[this.movieName];this.movieElement=null;this.settings=null;this.customSettings=null;this.eventQueue=null;this.movieName=null;return true}catch(d){return false}};SWFUpload.prototype.displayDebugInfo=function(){this.debug(["---SWFUpload Instance Info---\n","Version: ",SWFUpload.version,"\n","Movie Name: ",this.movieName,"\n","Settings:\n","\t","upload_url: ",this.settings.upload_url,"\n","\t","flash_url: ",this.settings.flash_url,"\n","\t","use_query_string: ",this.settings.use_query_string.toString(),"\n","\t","requeue_on_error: ",this.settings.requeue_on_error.toString(),"\n","\t","http_success: ",this.settings.http_success.join(", "),"\n","\t","assume_success_timeout: ",this.settings.assume_success_timeout,"\n","\t","file_post_name: ",this.settings.file_post_name,"\n","\t","post_params: ",this.settings.post_params.toString(),"\n","\t","file_types: ",this.settings.file_types,"\n","\t","file_types_description: ",this.settings.file_types_description,"\n","\t","file_size_limit: ",this.settings.file_size_limit,"\n","\t","file_upload_limit: ",this.settings.file_upload_limit,"\n","\t","file_queue_limit: ",this.settings.file_queue_limit,"\n","\t","debug: ",this.settings.debug.toString(),"\n","\t","prevent_swf_caching: ",this.settings.prevent_swf_caching.toString(),"\n","\t","button_placeholder_id: ",this.settings.button_placeholder_id.toString(),"\n","\t","button_placeholder: ",(this.settings.button_placeholder?"Set":"Not Set"),"\n","\t","button_image_url: ",this.settings.button_image_url.toString(),"\n","\t","button_width: ",this.settings.button_width.toString(),"\n","\t","button_height: ",this.settings.button_height.toString(),"\n","\t","button_text: ",this.settings.button_text.toString(),"\n","\t","button_text_style: ",this.settings.button_text_style.toString(),"\n","\t","button_text_top_padding: ",this.settings.button_text_top_padding.toString(),"\n","\t","button_text_left_padding: ",this.settings.button_text_left_padding.toString(),"\n","\t","button_action: ",this.settings.button_action.toString(),"\n","\t","button_disabled: ",this.settings.button_disabled.toString(),"\n","\t","custom_settings: ",this.settings.custom_settings.toString(),"\n","Event Handlers:\n","\t","swfupload_loaded_handler assigned: ",(typeof this.settings.swfupload_loaded_handler==="function").toString(),"\n","\t","file_dialog_start_handler assigned: ",(typeof this.settings.file_dialog_start_handler==="function").toString(),"\n","\t","file_queued_handler assigned: ",(typeof this.settings.file_queued_handler==="function").toString(),"\n","\t","file_queue_error_handler assigned: ",(typeof this.settings.file_queue_error_handler==="function").toString(),"\n","\t","upload_start_handler assigned: ",(typeof this.settings.upload_start_handler==="function").toString(),"\n","\t","upload_progress_handler assigned: ",(typeof this.settings.upload_progress_handler==="function").toString(),"\n","\t","upload_error_handler assigned: ",(typeof this.settings.upload_error_handler==="function").toString(),"\n","\t","upload_success_handler assigned: ",(typeof this.settings.upload_success_handler==="function").toString(),"\n","\t","upload_complete_handler assigned: ",(typeof this.settings.upload_complete_handler==="function").toString(),"\n","\t","debug_handler assigned: ",(typeof this.settings.debug_handler==="function").toString(),"\n"].join(""))};SWFUpload.prototype.addSetting=function(b,c,a){if(c==undefined){return(this.settings[b]=a)}else{return(this.settings[b]=c)}};SWFUpload.prototype.getSetting=function(a){if(this.settings[a]!=undefined){return this.settings[a]}return""};SWFUpload.prototype.callFlash=function(functionName,argumentArray){argumentArray=argumentArray||[];var movieElement=this.getMovieElement();var returnValue,returnString;try{returnString=movieElement.CallFunction('<invoke name="'+functionName+'" returntype="javascript">'+__flash__argumentsToXML(argumentArray,0)+"</invoke>");returnValue=eval(returnString)}catch(ex){throw"Call to "+functionName+" failed"}if(returnValue!=undefined&&typeof returnValue.post==="object"){returnValue=this.unescapeFilePostParams(returnValue)}return returnValue};SWFUpload.prototype.selectFile=function(){this.callFlash("SelectFile")};SWFUpload.prototype.selectFiles=function(){this.callFlash("SelectFiles")};SWFUpload.prototype.startUpload=function(a){this.callFlash("StartUpload",[a])};SWFUpload.prototype.cancelUpload=function(a,b){if(b!==false){b=true}this.callFlash("CancelUpload",[a,b])};SWFUpload.prototype.stopUpload=function(){this.callFlash("StopUpload")};SWFUpload.prototype.getStats=function(){return this.callFlash("GetStats")};SWFUpload.prototype.setStats=function(a){this.callFlash("SetStats",[a])};SWFUpload.prototype.getFile=function(a){if(typeof(a)==="number"){return this.callFlash("GetFileByIndex",[a])}else{return this.callFlash("GetFile",[a])}};SWFUpload.prototype.addFileParam=function(a,b,c){return this.callFlash("AddFileParam",[a,b,c])};SWFUpload.prototype.removeFileParam=function(a,b){this.callFlash("RemoveFileParam",[a,b])};SWFUpload.prototype.setUploadURL=function(a){this.settings.upload_url=a.toString();this.callFlash("SetUploadURL",[a])};SWFUpload.prototype.setPostParams=function(a){this.settings.post_params=a;this.callFlash("SetPostParams",[a])};SWFUpload.prototype.addPostParam=function(a,b){this.settings.post_params[a]=b;this.callFlash("SetPostParams",[this.settings.post_params])};SWFUpload.prototype.removePostParam=function(a){delete this.settings.post_params[a];this.callFlash("SetPostParams",[this.settings.post_params])};SWFUpload.prototype.setFileTypes=function(a,b){this.settings.file_types=a;this.settings.file_types_description=b;this.callFlash("SetFileTypes",[a,b])};SWFUpload.prototype.setFileSizeLimit=function(a){this.settings.file_size_limit=a;this.callFlash("SetFileSizeLimit",[a])};SWFUpload.prototype.setFileUploadLimit=function(a){this.settings.file_upload_limit=a;this.callFlash("SetFileUploadLimit",[a])};SWFUpload.prototype.setFileQueueLimit=function(a){this.settings.file_queue_limit=a;this.callFlash("SetFileQueueLimit",[a])};SWFUpload.prototype.setFilePostName=function(a){this.settings.file_post_name=a;this.callFlash("SetFilePostName",[a])};SWFUpload.prototype.setUseQueryString=function(a){this.settings.use_query_string=a;this.callFlash("SetUseQueryString",[a])};SWFUpload.prototype.setRequeueOnError=function(a){this.settings.requeue_on_error=a;this.callFlash("SetRequeueOnError",[a])};SWFUpload.prototype.setHTTPSuccess=function(a){if(typeof a==="string"){a=a.replace(" ","").split(",")}this.settings.http_success=a;this.callFlash("SetHTTPSuccess",[a])};SWFUpload.prototype.setAssumeSuccessTimeout=function(a){this.settings.assume_success_timeout=a;this.callFlash("SetAssumeSuccessTimeout",[a])};SWFUpload.prototype.setDebugEnabled=function(a){this.settings.debug_enabled=a;this.callFlash("SetDebugEnabled",[a])};SWFUpload.prototype.setButtonImageURL=function(a){if(a==undefined){a=""}this.settings.button_image_url=a;this.callFlash("SetButtonImageURL",[a])};SWFUpload.prototype.setButtonDimensions=function(c,a){this.settings.button_width=c;this.settings.button_height=a;var b=this.getMovieElement();if(b!=undefined){b.style.width=c+"px";b.style.height=a+"px"}this.callFlash("SetButtonDimensions",[c,a])};SWFUpload.prototype.setButtonText=function(a){this.settings.button_text=a;this.callFlash("SetButtonText",[a])};SWFUpload.prototype.setButtonTextPadding=function(b,a){this.settings.button_text_top_padding=a;this.settings.button_text_left_padding=b;this.callFlash("SetButtonTextPadding",[b,a])};SWFUpload.prototype.setButtonTextStyle=function(a){this.settings.button_text_style=a;this.callFlash("SetButtonTextStyle",[a])};SWFUpload.prototype.setButtonDisabled=function(a){this.settings.button_disabled=a;this.callFlash("SetButtonDisabled",[a])};SWFUpload.prototype.setButtonAction=function(a){this.settings.button_action=a;this.callFlash("SetButtonAction",[a])};SWFUpload.prototype.setButtonCursor=function(a){this.settings.button_cursor=a;this.callFlash("SetButtonCursor",[a])};SWFUpload.prototype.queueEvent=function(b,c){if(c==undefined){c=[]}else{if(!(c instanceof Array)){c=[c]}}var a=this;if(typeof this.settings[b]==="function"){this.eventQueue.push(function(){this.settings[b].apply(this,c)});setTimeout(function(){a.executeNextEvent()},0)}else{if(this.settings[b]!==null){throw"Event handler "+b+" is unknown or is not a function"}}};SWFUpload.prototype.executeNextEvent=function(){var a=this.eventQueue?this.eventQueue.shift():null;if(typeof(a)==="function"){a.apply(this)}};SWFUpload.prototype.unescapeFilePostParams=function(c){var e=/[$]([0-9a-f]{4})/i;var f={};var d;if(c!=undefined){for(var a in c.post){if(c.post.hasOwnProperty(a)){d=a;var b;while((b=e.exec(d))!==null){d=d.replace(b[0],String.fromCharCode(parseInt("0x"+b[1],16)))}f[d]=c.post[a]}}c.post=f}return c};SWFUpload.prototype.testExternalInterface=function(){try{return this.callFlash("TestExternalInterface")}catch(a){return false}};SWFUpload.prototype.flashReady=function(){var a=this.getMovieElement();if(!a){this.debug("Flash called back ready but the flash movie can't be found.");return}this.cleanUp(a);this.queueEvent("swfupload_loaded_handler")};SWFUpload.prototype.cleanUp=function(a){try{if(this.movieElement&&typeof(a.CallFunction)==="unknown"){this.debug("Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)");for(var c in a){try{if(typeof(a[c])==="function"){a[c]=null}}catch(b){}}}}catch(d){}window.__flash__removeCallback=function(e,f){try{if(e){e[f]=null}}catch(g){}}};SWFUpload.prototype.fileDialogStart=function(){this.queueEvent("file_dialog_start_handler")};SWFUpload.prototype.fileQueued=function(a){a=this.unescapeFilePostParams(a);this.queueEvent("file_queued_handler",a)};SWFUpload.prototype.fileQueueError=function(a,c,b){a=this.unescapeFilePostParams(a);this.queueEvent("file_queue_error_handler",[a,c,b])};SWFUpload.prototype.fileDialogComplete=function(b,c,a){this.queueEvent("file_dialog_complete_handler",[b,c,a])};SWFUpload.prototype.uploadStart=function(a){a=this.unescapeFilePostParams(a);this.queueEvent("return_upload_start_handler",a)};SWFUpload.prototype.returnUploadStart=function(a){var b;if(typeof this.settings.upload_start_handler==="function"){a=this.unescapeFilePostParams(a);b=this.settings.upload_start_handler.call(this,a)}else{if(this.settings.upload_start_handler!=undefined){throw"upload_start_handler must be a function"}}if(b===undefined){b=true}b=!!b;this.callFlash("ReturnUploadStart",[b])};SWFUpload.prototype.uploadProgress=function(a,c,b){a=this.unescapeFilePostParams(a);this.queueEvent("upload_progress_handler",[a,c,b])};SWFUpload.prototype.uploadError=function(a,c,b){a=this.unescapeFilePostParams(a);this.queueEvent("upload_error_handler",[a,c,b])};SWFUpload.prototype.uploadSuccess=function(b,a,c){b=this.unescapeFilePostParams(b);this.queueEvent("upload_success_handler",[b,a,c])};SWFUpload.prototype.uploadComplete=function(a){a=this.unescapeFilePostParams(a);this.queueEvent("upload_complete_handler",a)};SWFUpload.prototype.debug=function(a){this.queueEvent("debug_handler",a)};SWFUpload.prototype.debugMessage=function(c){if(this.settings.debug){var a,d=[];if(typeof c==="object"&&typeof c.name==="string"&&typeof c.message==="string"){for(var b in c){if(c.hasOwnProperty(b)){d.push(b+": "+c[b])}}a=d.join("\n")||"";d=a.split("\n");a="EXCEPTION: "+d.join("\nEXCEPTION: ");SWFUpload.Console.writeLine(a)}else{SWFUpload.Console.writeLine(c)}}};SWFUpload.Console={};SWFUpload.Console.writeLine=function(d){var b,a;try{b=document.getElementById("SWFUpload_Console");if(!b){a=document.createElement("form");document.getElementsByTagName("body")[0].appendChild(a);b=document.createElement("textarea");b.id="SWFUpload_Console";b.style.fontFamily="monospace";b.setAttribute("wrap","off");b.wrap="off";b.style.overflow="auto";b.style.width="700px";b.style.height="350px";b.style.margin="5px";a.appendChild(b)}b.value+=d+"\n";b.scrollTop=b.scrollHeight-b.clientHeight}catch(c){alert("Exception: "+c.name+" Message: "+c.message)}}; /* Uploadify v3.2 Copyright (c) 2012 Reactive Apps, Ronnie Garcia Released under the MIT License <http://www.opensource.org/licenses/mit-license.php> */ (function($) { // These methods can be called by adding them as the first argument in the uploadify plugin call var methods = { init : function(options, swfUploadOptions) { return this.each(function() { // Create a reference to the jQuery DOM object var $this = $(this); // Clone the original DOM object var $clone = $this.clone(); // Setup the default options var settings = $.extend({ // Required Settings id : $this.attr('id'), // The ID of the DOM object swf : 'uploadify.swf', // The path to the uploadify SWF file uploader : 'uploadify.php', // The path to the server-side upload script // Options auto : true, // Automatically upload files when added to the queue buttonClass : '', // A class name to add to the browse button DOM object buttonCursor : 'hand', // The cursor to use with the browse button buttonImage : null, // (String or null) The path to an image to use for the Flash browse button if not using CSS to style the button buttonText : 'SELECT FILES', // The text to use for the browse button checkExisting : false, // The path to a server-side script that checks for existing files on the server debug : false, // Turn on swfUpload debugging mode fileObjName : 'Filedata', // The name of the file object to use in your server-side script fileSizeLimit : 0, // The maximum size of an uploadable file in KB (Accepts units B KB MB GB if string, 0 for no limit) fileTypeDesc : 'All Files', // The description for file types in the browse dialog fileTypeExts : '*.*', // Allowed extensions in the browse dialog (server-side validation should also be used) height : 30, // The height of the browse button itemTemplate : false, // The template for the file item in the queue method : 'post', // The method to use when sending files to the server-side upload script multi : true, // Allow multiple file selection in the browse dialog formData : {}, // An object with additional data to send to the server-side upload script with every file upload preventCaching : true, // Adds a random value to the Flash URL to prevent caching of it (conflicts with existing parameters) progressData : 'percentage', // ('percentage' or 'speed') Data to show in the queue item during a file upload queueID : false, // The ID of the DOM object to use as a file queue (without the #) queueSizeLimit : 999, // The maximum number of files that can be in the queue at one time removeCompleted : true, // Remove queue items from the queue when they are done uploading removeTimeout : 3, // The delay in seconds before removing a queue item if removeCompleted is set to true requeueErrors : false, // Keep errored files in the queue and keep trying to upload them successTimeout : 30, // The number of seconds to wait for Flash to detect the server's response after the file has finished uploading uploadLimit : 0, // The maximum number of files you can upload width : 120, // The width of the browse button // Events overrideEvents : [] // (Array) A list of default event handlers to skip /* onCancel // Triggered when a file is cancelled from the queue onClearQueue // Triggered during the 'clear queue' method onDestroy // Triggered when the uploadify object is destroyed onDialogClose // Triggered when the browse dialog is closed onDialogOpen // Triggered when the browse dialog is opened onDisable // Triggered when the browse button gets disabled onEnable // Triggered when the browse button gets enabled onFallback // Triggered is Flash is not detected onInit // Triggered when Uploadify is initialized onQueueComplete // Triggered when all files in the queue have been uploaded onSelectError // Triggered when an error occurs while selecting a file (file size, queue size limit, etc.) onSelect // Triggered for each file that is selected onSWFReady // Triggered when the SWF button is loaded onUploadComplete // Triggered when a file upload completes (success or error) onUploadError // Triggered when a file upload returns an error onUploadSuccess // Triggered when a file is uploaded successfully onUploadProgress // Triggered every time a file progress is updated onUploadStart // Triggered immediately before a file upload starts */ }, options); // Prepare settings for SWFUpload var swfUploadSettings = { assume_success_timeout : settings.successTimeout, button_placeholder_id : settings.id, button_width : settings.width, button_height : settings.height, button_text : null, button_text_style : null, button_text_top_padding : 0, button_text_left_padding : 0, button_action : (settings.multi ? SWFUpload.BUTTON_ACTION.SELECT_FILES : SWFUpload.BUTTON_ACTION.SELECT_FILE), button_disabled : false, button_cursor : (settings.buttonCursor == 'arrow' ? SWFUpload.CURSOR.ARROW : SWFUpload.CURSOR.HAND), button_window_mode : SWFUpload.WINDOW_MODE.TRANSPARENT, debug : settings.debug, requeue_on_error : settings.requeueErrors, file_post_name : settings.fileObjName, file_size_limit : settings.fileSizeLimit, file_types : settings.fileTypeExts, file_types_description : settings.fileTypeDesc, file_queue_limit : settings.queueSizeLimit, file_upload_limit : settings.uploadLimit, flash_url : settings.swf, prevent_swf_caching : settings.preventCaching, post_params : settings.formData, upload_url : settings.uploader, use_query_string : (settings.method == 'get'), // Event Handlers file_dialog_complete_handler : handlers.onDialogClose, file_dialog_start_handler : handlers.onDialogOpen, file_queued_handler : handlers.onSelect, file_queue_error_handler : handlers.onSelectError, swfupload_loaded_handler : settings.onSWFReady, upload_complete_handler : handlers.onUploadComplete, upload_error_handler : handlers.onUploadError, upload_progress_handler : handlers.onUploadProgress, upload_start_handler : handlers.onUploadStart, upload_success_handler : handlers.onUploadSuccess } // Merge the user-defined options with the defaults if (swfUploadOptions) { swfUploadSettings = $.extend(swfUploadSettings, swfUploadOptions); } // Add the user-defined settings to the swfupload object swfUploadSettings = $.extend(swfUploadSettings, settings); // Detect if Flash is available var playerVersion = swfobject.getFlashPlayerVersion(); var flashInstalled = (playerVersion.major >= 9); if (flashInstalled) { // Create the swfUpload instance window['uploadify_' + settings.id] = new SWFUpload(swfUploadSettings); var swfuploadify = window['uploadify_' + settings.id]; // Add the SWFUpload object to the elements data object $this.data('uploadify', swfuploadify); // Wrap the instance var $wrapper = $('<div />', { 'id' : settings.id, 'class' : 'uploadify', 'css' : { 'height' : settings.height + 'px', 'width' : settings.width + 'px' } }); $('#' + swfuploadify.movieName).wrap($wrapper); // Recreate the reference to wrapper $wrapper = $('#' + settings.id); // Add the data object to the wrapper $wrapper.data('uploadify', swfuploadify); // Create the button var $button = $('<div />', { 'id' : settings.id + '-button', 'class' : 'uploadify-button ' + settings.buttonClass }); if (settings.buttonImage) { $button.css({ 'background-image' : "url('" + settings.buttonImage + "')", 'text-indent' : '-9999px' }); } $button.html('<span class="uploadify-button-text">' + settings.buttonText + '</span>') .css({ 'height' : settings.height + 'px', 'line-height' : settings.height + 'px', 'width' : settings.width + 'px' }); // Append the button to the wrapper $wrapper.append($button); // Adjust the styles of the movie $('#' + swfuploadify.movieName).css({ 'position' : 'absolute', 'z-index' : 1 }); // Create the file queue if (!settings.queueID) { var $queue = $('<div />', { 'id' : settings.id + '-queue', 'class' : 'uploadify-queue' }); $wrapper.after($queue); swfuploadify.settings.queueID = settings.id + '-queue'; swfuploadify.settings.defaultQueue = true; } // Create some queue related objects and variables swfuploadify.queueData = { files : {}, // The files in the queue filesSelected : 0, // The number of files selected in the last select operation filesQueued : 0, // The number of files added to the queue in the last select operation filesReplaced : 0, // The number of files replaced in the last select operation filesCancelled : 0, // The number of files that were cancelled instead of replaced filesErrored : 0, // The number of files that caused error in the last select operation uploadsSuccessful : 0, // The number of files that were successfully uploaded uploadsErrored : 0, // The number of files that returned errors during upload averageSpeed : 0, // The average speed of the uploads in KB queueLength : 0, // The number of files in the queue queueSize : 0, // The size in bytes of the entire queue uploadSize : 0, // The size in bytes of the upload queue queueBytesUploaded : 0, // The size in bytes that have been uploaded for the current upload queue uploadQueue : [], // The files currently to be uploaded errorMsg : 'Some files were not added to the queue:' }; // Save references to all the objects swfuploadify.original = $clone; swfuploadify.wrapper = $wrapper; swfuploadify.button = $button; swfuploadify.queue = $queue; // Call the user-defined init event handler if (settings.onInit) settings.onInit.call($this, swfuploadify); } else { // Call the fallback function if (settings.onFallback) settings.onFallback.call($this); } }); }, // Stop a file upload and remove it from the queue cancel : function(fileID, supressEvent) { var args = arguments; this.each(function() { // Create a reference to the jQuery DOM object var $this = $(this), swfuploadify = $this.data('uploadify'), settings = swfuploadify.settings, delay = -1; if (args[0]) { // Clear the queue if (args[0] == '*') { var queueItemCount = swfuploadify.queueData.queueLength; $('#' + settings.queueID).find('.uploadify-queue-item').each(function() { delay++; if (args[1] === true) { swfuploadify.cancelUpload($(this).attr('id'), false); } else { swfuploadify.cancelUpload($(this).attr('id')); } $(this).find('.data').removeClass('data').html(' - Cancelled'); $(this).find('.uploadify-progress-bar').remove(); $(this).delay(1000 + 100 * delay).fadeOut(500, function() { $(this).remove(); }); }); swfuploadify.queueData.queueSize = 0; swfuploadify.queueData.queueLength = 0; // Trigger the onClearQueue event if (settings.onClearQueue) settings.onClearQueue.call($this, queueItemCount); } else { for (var n = 0; n < args.length; n++) { swfuploadify.cancelUpload(args[n]); $('#' + args[n]).find('.data').removeClass('data').html(' - Cancelled'); $('#' + args[n]).find('.uploadify-progress-bar').remove(); $('#' + args[n]).delay(1000 + 100 * n).fadeOut(500, function() { $(this).remove(); }); } } } else { var item = $('#' + settings.queueID).find('.uploadify-queue-item').get(0); $item = $(item); swfuploadify.cancelUpload($item.attr('id')); $item.find('.data').removeClass('data').html(' - Cancelled'); $item.find('.uploadify-progress-bar').remove(); $item.delay(1000).fadeOut(500, function() { $(this).remove(); }); } }); }, // Revert the DOM object back to its original state destroy : function() { this.each(function() { // Create a reference to the jQuery DOM object var $this = $(this), swfuploadify = $this.data('uploadify'), settings = swfuploadify.settings; // Destroy the SWF object and swfuploadify.destroy(); // Destroy the queue if (settings.defaultQueue) { $('#' + settings.queueID).remove(); } // Reload the original DOM element $('#' + settings.id).replaceWith(swfuploadify.original); // Call the user-defined event handler if (settings.onDestroy) settings.onDestroy.call(this); delete swfuploadify; }); }, // Disable the select button disable : function(isDisabled) { this.each(function() { // Create a reference to the jQuery DOM object var $this = $(this), swfuploadify = $this.data('uploadify'), settings = swfuploadify.settings; // Call the user-defined event handlers if (isDisabled) { swfuploadify.button.addClass('disabled'); if (settings.onDisable) settings.onDisable.call(this); } else { swfuploadify.button.removeClass('disabled'); if (settings.onEnable) settings.onEnable.call(this); } // Enable/disable the browse button swfuploadify.setButtonDisabled(isDisabled); }); }, // Get or set the settings data settings : function(name, value, resetObjects) { var args = arguments; var returnValue = value; this.each(function() { // Create a reference to the jQuery DOM object var $this = $(this), swfuploadify = $this.data('uploadify'), settings = swfuploadify.settings; if (typeof(args[0]) == 'object') { for (var n in value) { setData(n,value[n]); } } if (args.length === 1) { returnValue = settings[name]; } else { switch (name) { case 'uploader': swfuploadify.setUploadURL(value); break; case 'formData': if (!resetObjects) { value = $.extend(settings.formData, value); } swfuploadify.setPostParams(settings.formData); break; case 'method': if (value == 'get') { swfuploadify.setUseQueryString(true); } else { swfuploadify.setUseQueryString(false); } break; case 'fileObjName': swfuploadify.setFilePostName(value); break; case 'fileTypeExts': swfuploadify.setFileTypes(value, settings.fileTypeDesc); break; case 'fileTypeDesc': swfuploadify.setFileTypes(settings.fileTypeExts, value); break; case 'fileSizeLimit': swfuploadify.setFileSizeLimit(value); break; case 'uploadLimit': swfuploadify.setFileUploadLimit(value); break; case 'queueSizeLimit': swfuploadify.setFileQueueLimit(value); break; case 'buttonImage': swfuploadify.button.css('background-image', settingValue); break; case 'buttonCursor': if (value == 'arrow') { swfuploadify.setButtonCursor(SWFUpload.CURSOR.ARROW); } else { swfuploadify.setButtonCursor(SWFUpload.CURSOR.HAND); } break; case 'buttonText': $('#' + settings.id + '-button').find('.uploadify-button-text').html(value); break; case 'width': swfuploadify.setButtonDimensions(value, settings.height); break; case 'height': swfuploadify.setButtonDimensions(settings.width, value); break; case 'multi': if (value) { swfuploadify.setButtonAction(SWFUpload.BUTTON_ACTION.SELECT_FILES); } else { swfuploadify.setButtonAction(SWFUpload.BUTTON_ACTION.SELECT_FILE); } break; } settings[name] = value; } }); if (args.length === 1) { return returnValue; } }, // Stop the current uploads and requeue what is in progress stop : function() { this.each(function() { // Create a reference to the jQuery DOM object var $this = $(this), swfuploadify = $this.data('uploadify'); // Reset the queue information swfuploadify.queueData.averageSpeed = 0; swfuploadify.queueData.uploadSize = 0; swfuploadify.queueData.bytesUploaded = 0; swfuploadify.queueData.uploadQueue = []; swfuploadify.stopUpload(); }); }, // Start uploading files in the queue upload : function() { var args = arguments; this.each(function() { // Create a reference to the jQuery DOM object var $this = $(this), swfuploadify = $this.data('uploadify'); // Reset the queue information swfuploadify.queueData.averageSpeed = 0; swfuploadify.queueData.uploadSize = 0; swfuploadify.queueData.bytesUploaded = 0; swfuploadify.queueData.uploadQueue = []; // Upload the files if (args[0]) { if (args[0] == '*') { swfuploadify.queueData.uploadSize = swfuploadify.queueData.queueSize; swfuploadify.queueData.uploadQueue.push('*'); swfuploadify.startUpload(); } else { for (var n = 0; n < args.length; n++) { swfuploadify.queueData.uploadSize += swfuploadify.queueData.files[args[n]].size; swfuploadify.queueData.uploadQueue.push(args[n]); } swfuploadify.startUpload(swfuploadify.queueData.uploadQueue.shift()); } } else { swfuploadify.startUpload(); } }); } } // These functions handle all the events that occur with the file uploader var handlers = { // Triggered when the file dialog is opened onDialogOpen : function() { // Load the swfupload settings var settings = this.settings; // Reset some queue info this.queueData.errorMsg = 'Some files were not added to the queue:'; this.queueData.filesReplaced = 0; this.queueData.filesCancelled = 0; // Call the user-defined event handler if (settings.onDialogOpen) settings.onDialogOpen.call(this); }, // Triggered when the browse dialog is closed onDialogClose : function(filesSelected, filesQueued, queueLength) { // Load the swfupload settings var settings = this.settings; // Update the queue information this.queueData.filesErrored = filesSelected - filesQueued; this.queueData.filesSelected = filesSelected; this.queueData.filesQueued = filesQueued - this.queueData.filesCancelled; this.queueData.queueLength = queueLength; // Run the default event handler if ($.inArray('onDialogClose', settings.overrideEvents) < 0) { if (this.queueData.filesErrored > 0) { alert(this.queueData.errorMsg); } } // Call the user-defined event handler if (settings.onDialogClose) settings.onDialogClose.call(this, this.queueData); // Upload the files if auto is true if (settings.auto) $('#' + settings.id).uploadify('upload', '*'); }, // Triggered once for each file added to the queue onSelect : function(file) { // Load the swfupload settings var settings = this.settings; // Check if a file with the same name exists in the queue var queuedFile = {}; for (var n in this.queueData.files) { queuedFile = this.queueData.files[n]; if (queuedFile.uploaded != true && queuedFile.name == file.name) { var replaceQueueItem = confirm('The file named "' + file.name + '" is already in the queue.\nDo you want to replace the existing item in the queue?'); if (!replaceQueueItem) { this.cancelUpload(file.id); this.queueData.filesCancelled++; return false; } else { $('#' + queuedFile.id).remove(); this.cancelUpload(queuedFile.id); this.queueData.filesReplaced++; } } } // Get the size of the file var fileSize = Math.round(file.size / 1024); var suffix = 'KB'; if (fileSize > 1000) { fileSize = Math.round(fileSize / 1000); suffix = 'MB'; } var fileSizeParts = fileSize.toString().split('.'); fileSize = fileSizeParts[0]; if (fileSizeParts.length > 1) { fileSize += '.' + fileSizeParts[1].substr(0,2); } fileSize += suffix; // Truncate the filename if it's too long var fileName = file.name; if (fileName.length > 25) { fileName = fileName.substr(0,25) + '...'; } // Create the file data object itemData = { 'fileID' : file.id, 'instanceID' : settings.id, 'fileName' : fileName, 'fileSize' : fileSize } // Create the file item template if (settings.itemTemplate == false) { settings.itemTemplate = '<div id="${fileID}" class="uploadify-queue-item">\ <div class="cancel">\ <a href="javascript:$(\'#${instanceID}\').uploadify(\'cancel\', \'${fileID}\')">X</a>\ </div>\ <span class="fileName">${fileName} (${fileSize})</span><span class="data"></span>\ <div class="uploadify-progress">\ <div class="uploadify-progress-bar"><!--Progress Bar--></div>\ </div>\ </div>'; } // Run the default event handler if ($.inArray('onSelect', settings.overrideEvents) < 0) { // Replace the item data in the template itemHTML = settings.itemTemplate; for (var d in itemData) { itemHTML = itemHTML.replace(new RegExp('\\$\\{' + d + '\\}', 'g'), itemData[d]); } // Add the file item to the queue $('#' + settings.queueID).append(itemHTML); } this.queueData.queueSize += file.size; this.queueData.files[file.id] = file; // Call the user-defined event handler if (settings.onSelect) settings.onSelect.apply(this, arguments); }, // Triggered when a file is not added to the queue onSelectError : function(file, errorCode, errorMsg) { // Load the swfupload settings var settings = this.settings; // Run the default event handler if ($.inArray('onSelectError', settings.overrideEvents) < 0) { switch(errorCode) { case SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED: if (settings.queueSizeLimit > errorMsg) { this.queueData.errorMsg += '\nThe number of files selected exceeds the remaining upload limit (' + errorMsg + ').'; } else { this.queueData.errorMsg += '\nThe number of files selected exceeds the queue size limit (' + settings.queueSizeLimit + ').'; } break; case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT: this.queueData.errorMsg += '\nThe file "' + file.name + '" exceeds the size limit (' + settings.fileSizeLimit + ').'; break; case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE: this.queueData.errorMsg += '\nThe file "' + file.name + '" is empty.'; break; case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT: this.queueData.errorMsg += '\nThe file "' + file.name + '" is not an accepted file type (' + settings.fileTypeDesc + ').'; break; } } if (errorCode != SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED) { delete this.queueData.files[file.id]; } // Call the user-defined event handler if (settings.onSelectError) settings.onSelectError.apply(this, arguments); }, // Triggered when all the files in the queue have been processed onQueueComplete : function() { if (this.settings.onQueueComplete) this.settings.onQueueComplete.call(this, this.settings.queueData); }, // Triggered when a file upload successfully completes onUploadComplete : function(file) { // Load the swfupload settings var settings = this.settings, swfuploadify = this; // Check if all the files have completed uploading var stats = this.getStats(); this.queueData.queueLength = stats.files_queued; if (this.queueData.uploadQueue[0] == '*') { if (this.queueData.queueLength > 0) { this.startUpload(); } else { this.queueData.uploadQueue = []; // Call the user-defined event handler for queue complete if (settings.onQueueComplete) settings.onQueueComplete.call(this, this.queueData); } } else { if (this.queueData.uploadQueue.length > 0) { this.startUpload(this.queueData.uploadQueue.shift()); } else { this.queueData.uploadQueue = []; // Call the user-defined event handler for queue complete if (settings.onQueueComplete) settings.onQueueComplete.call(this, this.queueData); } } // Call the default event handler if ($.inArray('onUploadComplete', settings.overrideEvents) < 0) { if (settings.removeCompleted) { switch (file.filestatus) { case SWFUpload.FILE_STATUS.COMPLETE: setTimeout(function() { if ($('#' + file.id)) { swfuploadify.queueData.queueSize -= file.size; swfuploadify.queueData.queueLength -= 1; delete swfuploadify.queueData.files[file.id] $('#' + file.id).fadeOut(500, function() { $(this).remove(); }); } }, settings.removeTimeout * 1000); break; case SWFUpload.FILE_STATUS.ERROR: if (!settings.requeueErrors) { setTimeout(function() { if ($('#' + file.id)) { swfuploadify.queueData.queueSize -= file.size; swfuploadify.queueData.queueLength -= 1; delete swfuploadify.queueData.files[file.id]; $('#' + file.id).fadeOut(500, function() { $(this).remove(); }); } }, settings.removeTimeout * 1000); } break; } } else { file.uploaded = true; } } // Call the user-defined event handler if (settings.onUploadComplete) settings.onUploadComplete.call(this, file); }, // Triggered when a file upload returns an error onUploadError : function(file, errorCode, errorMsg) { // Load the swfupload settings var settings = this.settings; // Set the error string var errorString = 'Error'; switch(errorCode) { case SWFUpload.UPLOAD_ERROR.HTTP_ERROR: errorString = 'HTTP Error (' + errorMsg + ')'; break; case SWFUpload.UPLOAD_ERROR.MISSING_UPLOAD_URL: errorString = 'Missing Upload URL'; break; case SWFUpload.UPLOAD_ERROR.IO_ERROR: errorString = 'IO Error'; break; case SWFUpload.UPLOAD_ERROR.SECURITY_ERROR: errorString = 'Security Error'; break; case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED: alert('The upload limit has been reached (' + errorMsg + ').'); errorString = 'Exceeds Upload Limit'; break; case SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED: errorString = 'Failed'; break; case SWFUpload.UPLOAD_ERROR.SPECIFIED_FILE_ID_NOT_FOUND: break; case SWFUpload.UPLOAD_ERROR.FILE_VALIDATION_FAILED: errorString = 'Validation Error'; break; case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED: errorString = 'Cancelled'; this.queueData.queueSize -= file.size; this.queueData.queueLength -= 1; if (file.status == SWFUpload.FILE_STATUS.IN_PROGRESS || $.inArray(file.id, this.queueData.uploadQueue) >= 0) { this.queueData.uploadSize -= file.size; } // Trigger the onCancel event if (settings.onCancel) settings.onCancel.call(this, file); delete this.queueData.files[file.id]; break; case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED: errorString = 'Stopped'; break; } // Call the default event handler if ($.inArray('onUploadError', settings.overrideEvents) < 0) { if (errorCode != SWFUpload.UPLOAD_ERROR.FILE_CANCELLED && errorCode != SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED) { $('#' + file.id).addClass('uploadify-error'); } // Reset the progress bar $('#' + file.id).find('.uploadify-progress-bar').css('width','1px'); // Add the error message to the queue item if (errorCode != SWFUpload.UPLOAD_ERROR.SPECIFIED_FILE_ID_NOT_FOUND && file.status != SWFUpload.FILE_STATUS.COMPLETE) { $('#' + file.id).find('.data').html(' - ' + errorString); } } var stats = this.getStats(); this.queueData.uploadsErrored = stats.upload_errors; // Call the user-defined event handler if (settings.onUploadError) settings.onUploadError.call(this, file, errorCode, errorMsg, errorString); }, // Triggered periodically during a file upload onUploadProgress : function(file, fileBytesLoaded, fileTotalBytes) { // Load the swfupload settings var settings = this.settings; // Setup all the variables var timer = new Date(); var newTime = timer.getTime(); var lapsedTime = newTime - this.timer; if (lapsedTime > 500) { this.timer = newTime; } var lapsedBytes = fileBytesLoaded - this.bytesLoaded; this.bytesLoaded = fileBytesLoaded; var queueBytesLoaded = this.queueData.queueBytesUploaded + fileBytesLoaded; var percentage = Math.round(fileBytesLoaded / fileTotalBytes * 100); // Calculate the average speed var suffix = 'KB/s'; var mbs = 0; var kbs = (lapsedBytes / 1024) / (lapsedTime / 1000); kbs = Math.floor(kbs * 10) / 10; if (this.queueData.averageSpeed > 0) { this.queueData.averageSpeed = Math.floor((this.queueData.averageSpeed + kbs) / 2); } else { this.queueData.averageSpeed = Math.floor(kbs); } if (kbs > 1000) { mbs = (kbs * .001); this.queueData.averageSpeed = Math.floor(mbs); suffix = 'MB/s'; } // Call the default event handler if ($.inArray('onUploadProgress', settings.overrideEvents) < 0) { if (settings.progressData == 'percentage') { $('#' + file.id).find('.data').html(' - ' + percentage + '%'); } else if (settings.progressData == 'speed' && lapsedTime > 500) { $('#' + file.id).find('.data').html(' - ' + this.queueData.averageSpeed + suffix); } $('#' + file.id).find('.uploadify-progress-bar').css('width', percentage + '%'); } // Call the user-defined event handler if (settings.onUploadProgress) settings.onUploadProgress.call(this, file, fileBytesLoaded, fileTotalBytes, queueBytesLoaded, this.queueData.uploadSize); }, // Triggered right before a file is uploaded onUploadStart : function(file) { // Load the swfupload settings var settings = this.settings; var timer = new Date(); this.timer = timer.getTime(); this.bytesLoaded = 0; if (this.queueData.uploadQueue.length == 0) { this.queueData.uploadSize = file.size; } if (settings.checkExisting) { $.ajax({ type : 'POST', async : false, url : settings.checkExisting, data : {filename: file.name}, success : function(data) { if (data == 1) { var overwrite = confirm('A file with the name "' + file.name + '" already exists on the server.\nWould you like to replace the existing file?'); if (!overwrite) { this.cancelUpload(file.id); $('#' + file.id).remove(); if (this.queueData.uploadQueue.length > 0 && this.queueData.queueLength > 0) { if (this.queueData.uploadQueue[0] == '*') { this.startUpload(); } else { this.startUpload(this.queueData.uploadQueue.shift()); } } } } } }); } // Call the user-defined event handler if (settings.onUploadStart) settings.onUploadStart.call(this, file); }, // Triggered when a file upload returns a successful code onUploadSuccess : function(file, data, response) { // Load the swfupload settings var settings = this.settings; var stats = this.getStats(); this.queueData.uploadsSuccessful = stats.successful_uploads; this.queueData.queueBytesUploaded += file.size; // Call the default event handler if ($.inArray('onUploadSuccess', settings.overrideEvents) < 0) { $('#' + file.id).find('.data').html(' - Complete'); } // Call the user-defined event handler if (settings.onUploadSuccess) settings.onUploadSuccess.call(this, file, data, response); } } $.fn.uploadify = function(method) { if (methods[method]) { return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); } else if (typeof method === 'object' || !method) { return methods.init.apply(this, arguments); } else { $.error('The method ' + method + ' does not exist in $.uploadify'); } } })($);
zyroot
trunk/admin/dwz1.4.5/uploadify/scripts/jquery.uploadify.js
JavaScript
art
65,808
/* Uploadify Copyright (c) 2012 Reactive Apps, Ronnie Garcia Released under the MIT License <http://www.opensource.org/licenses/mit-license.php> */ .uploadify { position: relative; margin-bottom: 1em; } .uploadify-button { background-color: #505050; background-image: linear-gradient(bottom, #505050 0%, #707070 100%); background-image: -o-linear-gradient(bottom, #505050 0%, #707070 100%); background-image: -moz-linear-gradient(bottom, #505050 0%, #707070 100%); background-image: -webkit-linear-gradient(bottom, #505050 0%, #707070 100%); background-image: -ms-linear-gradient(bottom, #505050 0%, #707070 100%); background-image: -webkit-gradient( linear, left bottom, left top, color-stop(0, #505050), color-stop(1, #707070) ); background-position: center top; background-repeat: no-repeat; -webkit-border-radius: 30px; -moz-border-radius: 30px; border-radius: 30px; border: 2px solid #808080; color: #FFF; font: bold 12px Arial, Helvetica, sans-serif; text-align: center; text-shadow: 0 -1px 0 rgba(0,0,0,0.25); width: 100%; } .uploadify-button span{line-height: inherit} .uploadify:hover .uploadify-button { background-color: #606060; background-image: linear-gradient(top, #606060 0%, #808080 100%); background-image: -o-linear-gradient(top, #606060 0%, #808080 100%); background-image: -moz-linear-gradient(top, #606060 0%, #808080 100%); background-image: -webkit-linear-gradient(top, #606060 0%, #808080 100%); background-image: -ms-linear-gradient(top, #606060 0%, #808080 100%); background-image: -webkit-gradient( linear, left bottom, left top, color-stop(0, #606060), color-stop(1, #808080) ); background-position: center bottom; } .uploadify-button.disabled { background-color: #D0D0D0; color: #808080; } .uploadify-queue { margin-bottom: 1em; } .uploadify-queue-item { background-color: #F5F5F5; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; font: 11px Verdana, Geneva, sans-serif; margin-top: 5px; max-width: 350px; padding: 10px; } .uploadify-error { background-color: #FDE5DD !important; } .uploadify-queue-item .cancel a { background: url('../img/uploadify-cancel.png') 0 0 no-repeat; float: right; height: 16px; text-indent: -9999px; width: 16px; } .uploadify-queue-item.completed { background-color: #E5E5E5; } .uploadify-progress { background-color: #E5E5E5; margin-top: 10px; width: 100%; } .uploadify-progress-bar { background-color: #0099FF; height: 3px; width: 1px; }
zyroot
trunk/admin/dwz1.4.5/uploadify/css/uploadify.css
CSS
art
2,589
<div class="pageContent"> <form method="post" action="demo/common/ajaxDone.html" class="pageForm" onsubmit="return validateCallback(this, dialogAjaxDone)"> <div class="pageFormContent" layoutH="58"> <div class="unit"> <label>用户名:</label> <input type="text" name="username" size="30" class="required"/> </div> <div class="unit"> <label>密码:</label> <input type="password" name="password" size="30" class="required"/> </div> </div> <div class="formBar"> <ul> <li><div class="buttonActive"><div class="buttonContent"><button type="submit">提交</button></div></div></li> <li><div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div></li> </ul> </div> </form> </div>
zyroot
trunk/admin/dwz1.4.5/login_dialog.html
HTML
art
812
<div class="pageContent"> <form method="post" action="demo_page1.html" class="pageForm" onsubmit="return navTabSearch(this);"> <div class="pageFormContent" layoutH="58"> <div class="unit"> <label>请输入检索条件:</label> <input type="text" size="50" minlength="3" maxlength="10"/> </div> <div class="divider">divider</div> <div class="unit"> <label>客户划分:</label> <label class="radioButton"><input name="name" type="radio" />全部</label> <label class="radioButton"><input name="name" type="radio" />企业</label> <label class="radioButton"><input name="name" type="radio" />商户</label> <label class="radioButton"><input name="name" type="radio" />农户</label> <label class="radioButton"><input name="name" type="radio" />个人</label> </div> <div class="unit"> <label>客户名称:</label> <input type="text" size="25" name="name"/> <span class="inputInfo">关键字或全称</span> </div> <div class="unit"> <label>识 别 码:</label> <input type="text" size="25" name="code" class="lettersonly"/> <span class="inputInfo">汉字拼音首字母</span> </div> <div class="unit"> <label>客 户 号:</label> <input type="text" size="25" name="accountNo" class="alphanumeric"/> <span class="inputInfo">完整的客户号</span> </div> <div class="unit"> <label>证件号码:</label> <input type="text" size="25" name="certNo" class="alphanumeric"/> <span class="inputInfo">完整的营业执照号、身份证号</span> </div> <div class="unit"> <label>组织机构代码:</label> <input type="text" size="25" /> <span class="inputInfo">完整的号码</span> </div> <div class="unit"> <label>法人姓名:</label> <input type="text" size="25" /> <span class="inputInfo">关键字或全名</span> </div> <div class="unit"> <label>客户类型:</label> <input type="text" size="25" /> <span class="inputInfo">可多选</span> </div> <div class="unit"> <label>信用等级:</label> <input type="text" size="25" /> <span class="inputInfo">可多选</span> </div> <div class="unit"> <label>所属行业:</label> <input type="text" size="25" /> <span class="inputInfo">可多选</span> </div> <div class="unit"> <label>曾用名称:</label> <input type="text" size="25" /> <span class="inputInfo">关键字或全称</span> </div> <div class="unit"> <label>建档日期:</label> <input type="text" size="25" name="date1" class="date"/> <span class="inputInfo">大于等于,小于等于</span> </div> <div class="unit"> <label>管户经理:</label> <input type="text" size="25" /> <span class="inputInfo">全辖查询时用</span> </div> <div class="divider">divider</div> <div class="unit"> <label>排序条件:</label> <select> <option>按客户号倒排</option> <option>按建档日期倒排</option> <option>按信用等级顺排</option> <option>按客户号顺排</option> <option>按建档日期顺排</option> <option>按所属行业顺排</option> </select> </div> </div> <div class="formBar"> <ul> <li><div class="buttonActive"><div class="buttonContent"><button type="submit">开始检索</button></div></div></li> <li><div class="button"><div class="buttonContent"><button type="reset">清空重输</button></div></div></li> </ul> </div> </form> </div>
zyroot
trunk/admin/dwz1.4.5/demo_page6.html
HTML
art
3,648
<h2 class="contentTitle">树形菜单</h2> <div id="resultBox"></div> <div style=" float:left; display:block; margin:10px; overflow:auto; width:200px; height:200px; overflow:auto; border:solid 1px #CCC; line-height:21px; background:#FFF;"> <p>treeFolder treeCheck expand</p> <form method="post" action="demo/common/ajaxDone.html" class="pageForm required-validate" onsubmit="return validateCallback(this)"> <ul class="tree treeFolder treeCheck expand" oncheck="kkk"> <li><a >框架面板</a> <ul> <li><a tname="name" tvalue="value1" checked="true">我的主页</a></li> <li><a tname="name" tvalue="value2">页面一</a></li> <li><a tname="name" tvalue="value3">替换页面一</a></li> <li><a tname="name" tvalue="value4">页面二</a></li> <li><a tname="name" tvalue="value5">页面三</a></li> </ul> </li> <li><a tname="name" tvalue="test1">Test 1</a> <ul> <li><a tname="name" tvalue="test1.1">Test 1.1</a> <ul> <li><a tname="name" tvalue="test1.1.1" checked="true">Test 1.1.1</a></li> <li><a tname="name" tvalue="test1.1.2" checked="false">Test 1.1.2</a></li> </ul> </li> <li><a tname="name" tvalue="test1.2" checked="true">Test 1.2</a></li> </ul> </li> <li><a tname="name" tvalue="test2" checked="true">Test 2</a></li> </ul> <input type="submit" value="Submit"/> </form> </div> <div style="float:left; display:block; margin:10px; overflow:auto; width:200px; height:200px; border:solid 1px #CCC; line-height:21px; background:#FFF;"> <p>treeFolder collapse</p> <ul class="tree treeFolder collapse"> <li><a href="tabsPage.html" target="navTab">框架面板</a> <ul> <li target="selectedObjId" rel="1"><a href="main.html" target="navTab" rel="main">我的主页</a></li> <li target="selectedObjId" rel="2"><a href="newPage1.html" target="navTab" rel="page1">页面一</a></li> <li><a href="newPage2.html" target="navTab" rel="page1">替换页面一</a></li> <li><a href="newPage2.html" target="navTab" rel="page2">页面二</a></li> <li><a href="newPage3.html" target="navTab" rel="page3" title="页面三(自定义标签名)">页面三</a></li> </ul> </li> <li><a href="w_panel.html" target="navTab" rel="w_panel">面板</a></li> <li><a href="w_tabs.html" target="navTab" rel="w_tabs">选项卡面板</a></li> <li><a href="w_dialog.html" target="navTab" rel="w_dialog">弹出窗口</a></li> <li><a href="w_alert.html" target="navTab" rel="w_alert">提示窗口</a></li> <li><a href="w_table.html" target="navTab" rel="w_table">表格容器</a></li> <li><a href="w_tree.html" target="navTab" rel="w_tree">树形菜单</a></li> <li><a href="w_editor.html" target="navTab" rel="w_editor">编辑器</a></li> </ul> </div> <div style=" float:left; display:block; margin:10px; overflow:auto; width:200px; height:200px; border:solid 1px #CCC; line-height:21px; background:#FFF;"> <ul class="tree"> <li><a href="tabsPage.html" target="navTab">框架面板</a> <ul> <li><a href="main.html" target="navTab" rel="main">我的主页</a></li> <li><a href="newPage1.html" target="navTab" rel="page1">页面一</a></li> <li><a href="newPage2.html" target="navTab" rel="page1">替换页面一</a></li> <li><a href="newPage2.html" target="navTab" rel="page2">页面二</a></li> <li><a href="newPage3.html" target="navTab" rel="page3" title="页面三(自定义标签名)">页面三</a></li> </ul> </li> <li><a href="w_panel.html" target="navTab" rel="w_panel">面板</a></li> <li><a href="w_tabs.html" target="navTab" rel="w_tabs">选项卡面板</a></li> <li><a href="w_dialog.html" target="navTab" rel="w_dialog">弹出窗口</a></li> <li><a href="w_alert.html" target="navTab" rel="w_alert">提示窗口</a></li> <li><a href="w_table.html" target="navTab" rel="w_table">表格容器</a></li> <li><a href="w_tree.html" target="navTab" rel="w_tree">树形菜单</a></li> <li><a href="w_editor.html" target="navTab" rel="w_editor">编辑器</a></li> </ul> </div> <script type="text/javascript"> function kkk(){ var json = arguments[0], result=""; // alert(json.checked); $(json.items).each(function(i){ result += "<p>name:"+this.name + " value:"+this.value+" text: "+this.text+"</p>"; }); $("#resultBox").html(result); } </script>
zyroot
trunk/admin/dwz1.4.5/w_tree.html
HTML
art
4,339
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=7" /> <title>简单实用国产jQuery UI框架 - DWZ富客户端框架(J-UI.com)</title> <link href="themes/default/style.css" rel="stylesheet" type="text/css" media="screen"/> <link href="themes/css/core.css" rel="stylesheet" type="text/css" media="screen"/> <link href="themes/css/print.css" rel="stylesheet" type="text/css" media="print"/> <link href="uploadify/css/uploadify.css" rel="stylesheet" type="text/css" media="screen"/> <!--[if IE]> <link href="themes/css/ieHack.css" rel="stylesheet" type="text/css" media="screen"/> <![endif]--> <style type="text/css"> #header{height:85px} #leftside, #container, #splitBar, #splitBarProxy{top:90px} </style> <!--[if lte IE 9]> <script src="js/speedup.js" type="text/javascript"></script> <![endif]--> <script src="js/jquery-1.7.2.min.js" type="text/javascript"></script> <script src="js/jquery.cookie.js" type="text/javascript"></script> <script src="js/jquery.validate.js" type="text/javascript"></script> <script src="js/jquery.bgiframe.js" type="text/javascript"></script> <script src="xheditor/xheditor-1.1.14-zh-cn.min.js" type="text/javascript"></script> <script src="uploadify/scripts/jquery.uploadify.min.js" type="text/javascript"></script> <script src="bin/dwz.min.js" type="text/javascript"></script> <script src="js/dwz.regional.zh.js" type="text/javascript"></script> <script type="text/javascript"> $(function(){ DWZ.init("dwz.frag.xml", { loginUrl:"login_dialog.html", loginTitle:"登录", // 弹出登录对话框 // loginUrl:"login.html", // 跳到登录页面 statusCode:{ok:200, error:300, timeout:301}, //【可选】 pageInfo:{pageNum:"pageNum", numPerPage:"numPerPage", orderField:"orderField", orderDirection:"orderDirection"}, //【可选】 debug:false, // 调试模式 【true|false】 callback:function(){ initEnv(); $("#themeList").theme({themeBase:"themes"}); setTimeout(function() {$("#sidebar .toggleCollapse div").trigger("click");}, 10); } }); }); </script> </head> <body scroll="no"> <div id="layout"> <div id="header"> <div class="headerNav"> <a class="logo" href="http://j-ui.com">标志</a> <ul class="nav"> <li id="switchEnvBox"><a href="javascript:">(<span>北京</span>)切换城市</a> <ul> <li><a href="sidebar_1.html">北京</a></li> <li><a href="sidebar_2.html">上海</a></li> <li><a href="sidebar_2.html">南京</a></li> <li><a href="sidebar_2.html">深圳</a></li> <li><a href="sidebar_2.html">广州</a></li> <li><a href="sidebar_2.html">天津</a></li> <li><a href="sidebar_2.html">杭州</a></li> </ul> </li> <li><a href="https://me.alipay.com/dwzteam" target="_blank">捐赠</a></li> <li><a href="changepwd.html" target="dialog" width="600">设置</a></li> <li><a href="http://www.cnblogs.com/dwzjs" target="_blank">博客</a></li> <li><a href="http://weibo.com/dwzui" target="_blank">微博</a></li> <li><a href="http://bbs.dwzjs.com" target="_blank">论坛</a></li> <li><a href="login.html">退出</a></li> </ul> <ul class="themeList" id="themeList"> <li theme="default"><div class="selected">蓝色</div></li> <li theme="green"><div>绿色</div></li> <!--<li theme="red"><div>红色</div></li>--> <li theme="purple"><div>紫色</div></li> <li theme="silver"><div>银色</div></li> <li theme="azure"><div>天蓝</div></li> </ul> </div> <div id="navMenu"> <ul> <li class="selected"><a href="sidebar_1.html"><span>资讯管理</span></a></li> <li><a href="sidebar_2.html"><span>订单管理</span></a></li> <li><a href="sidebar_1.html"><span>产品管理</span></a></li> <li><a href="sidebar_2.html"><span>会员管理</span></a></li> <li><a href="sidebar_1.html"><span>服务管理</span></a></li> <li><a href="sidebar_2.html"><span>系统设置</span></a></li> </ul> </div> </div> <div id="leftside"> <div id="sidebar_s"> <div class="collapse"> <div class="toggleCollapse"><div></div></div> </div> </div> <div id="sidebar"> <div class="toggleCollapse"><h2>主菜单</h2><div>收缩</div></div> <div class="accordion" fillSpace="sidebar"> <div class="accordionHeader"> <h2><span>Folder</span>界面组件</h2> </div> <div class="accordionContent"> <ul class="tree treeFolder"> <li><a href="tabsPage.html" target="navTab">主框架面板</a> <ul> <li><a href="main.html" target="navTab" rel="main">我的主页</a></li> <li><a href="http://www.baidu.com" target="navTab" rel="page1">页面一(外部页面)</a></li> <li><a href="demo_page2.html" target="navTab" rel="external" external="true">iframe navTab页面</a></li> <li><a href="demo_page1.html" target="navTab" rel="page1" fresh="false">替换页面一</a></li> <li><a href="demo_page2.html" target="navTab" rel="page2">页面二</a></li> <li><a href="demo_page4.html" target="navTab" rel="page3" title="页面三(自定义标签名)">页面三</a></li> <li><a href="demo_page4.html" target="navTab" rel="page4" fresh="false">测试页面(fresh="false")</a></li> <li><a href="w_editor.html" target="navTab">表单提交会话超时</a></li> <li><a href="demo/common/ajaxTimeout.html" target="navTab">navTab会话超时</a></li> <li><a href="demo/common/ajaxTimeout.html" target="dialog">dialog会话超时</a></li> </ul> </li> <li><a>常用组件</a> <ul> <li><a href="w_panel.html" target="navTab" rel="w_panel">面板</a></li> <li><a href="w_tabs.html" target="navTab" rel="w_tabs">选项卡面板</a></li> <li><a href="w_dialog.html" target="navTab" rel="w_dialog">弹出窗口</a></li> <li><a href="w_alert.html" target="navTab" rel="w_alert">提示窗口</a></li> <li><a href="w_list.html" target="navTab" rel="w_list">CSS表格容器</a></li> <li><a href="demo_page1.html" target="navTab" rel="w_table">表格容器</a></li> <li><a href="w_removeSelected.html" target="navTab" rel="w_table">表格数据库排序+批量删除</a></li> <li><a href="w_tree.html" target="navTab" rel="w_tree">树形菜单</a></li> <li><a href="w_accordion.html" target="navTab" rel="w_accordion">滑动菜单</a></li> <li><a href="w_editor.html" target="navTab" rel="w_editor">编辑器</a></li> <li><a href="w_datepicker.html" target="navTab" rel="w_datepicker">日期控件</a></li> <li><a href="demo/database/db_widget.html" target="navTab" rel="db">suggest+lookup+主从结构</a></li> <li><a href="demo/sortDrag/1.html" target="navTab" rel="sortDrag">单个sortDrag示例</a></li> <li><a href="demo/sortDrag/2.html" target="navTab" rel="sortDrag">多个sortDrag示例</a></li> </ul> </li> <li><a>表单组件</a> <ul> <li><a href="w_validation.html" target="navTab" rel="w_validation">表单验证</a></li> <li><a href="w_button.html" target="navTab" rel="w_button">按钮</a></li> <li><a href="w_textInput.html" target="navTab" rel="w_textInput">文本框/文本域</a></li> <li><a href="w_combox.html" target="navTab" rel="w_combox">下拉菜单</a></li> <li><a href="w_checkbox.html" target="navTab" rel="w_checkbox">多选框/单选框</a></li> <li><a href="demo_upload.html" target="navTab" rel="demo_upload">iframeCallback表单提交</a></li> <li><a href="w_uploadify.html" target="navTab" rel="w_uploadify">uploadify多文件上传</a></li> </ul> </li> <li><a>组合应用</a> <ul> <li><a href="demo/pagination/layout1.html" target="navTab" rel="pagination1">局部刷新分页1</a></li> <li><a href="demo/pagination/layout2.html" target="navTab" rel="pagination2">局部刷新分页2</a></li> </ul> </li> <li><a href="dwz.frag.xml" target="navTab" external="true">dwz.frag.xml</a></li> </ul> </div> <div class="accordionHeader"> <h2><span>Folder</span>典型页面</h2> </div> <div class="accordionContent"> <ul class="tree treeFolder treeCheck"> <li><a href="demo_page1.html" target="navTab" rel="demo_page1">查询我的客户</a></li> <li><a href="demo_page1.html" target="navTab" rel="demo_page2">表单查询页面</a></li> <li><a href="demo_page4.html" target="navTab" rel="demo_page4">表单录入页面</a></li> <li><a href="demo_page5.html" target="navTab" rel="demo_page5">有文本输入的表单</a></li> <li><a href="javascript:;">有提示的表单输入页面</a> <ul> <li><a href="javascript:;">页面一</a></li> <li><a href="javascript:;">页面二</a></li> </ul> </li> <li><a href="javascript:;">选项卡和图形的页面</a> <ul> <li><a href="javascript:;">页面一</a></li> <li><a href="javascript:;">页面二</a></li> </ul> </li> <li><a href="javascript:;">选项卡和图形切换的页面</a></li> <li><a href="javascript:;">左右两个互动的页面</a></li> <li><a href="javascript:;">列表输入的页面</a></li> <li><a href="javascript:;">双层栏目列表的页面</a></li> </ul> </div> <div class="accordionHeader"> <h2><span>Folder</span>流程演示</h2> </div> <div class="accordionContent"> <ul class="tree"> <li><a href="newPage1.html" target="dialog" rel="dlg_page">列表</a></li> <li><a href="newPage1.html" target="dialog" rel="dlg_page">列表</a></li> <li><a href="newPage1.html" target="dialog" rel="dlg_page2">列表</a></li> <li><a href="newPage1.html" target="dialog" rel="dlg_page2">列表</a></li> <li><a href="newPage1.html" target="dialog" rel="dlg_page2">列表</a></li> </ul> </div> </div> </div> </div> <div id="container"> <div id="navTab" class="tabsPage"> <div class="tabsPageHeader"> <div class="tabsPageHeaderContent"><!-- 显示左右控制时添加 class="tabsPageHeaderMargin" --> <ul class="navTab-tab"> <li tabid="main" class="main"><a href="javascript:;"><span><span class="home_icon">我的主页</span></span></a></li> </ul> </div> <div class="tabsLeft">left</div><!-- 禁用只需要添加一个样式 class="tabsLeft tabsLeftDisabled" --> <div class="tabsRight">right</div><!-- 禁用只需要添加一个样式 class="tabsRight tabsRightDisabled" --> <div class="tabsMore">more</div> </div> <ul class="tabsMoreList"> <li><a href="javascript:;">我的主页</a></li> </ul> <div class="navTab-panel tabsPageContent layoutBox"> <div class="page unitBox"> <div class="accountInfo"> <div class="alertInfo"> <h2><a href="doc/dwz-user-guide.pdf" target="_blank">DWZ框架使用手册(PDF)</a></h2> <a href="doc/dwz-user-guide.swf" target="_blank">DWZ框架演示视频</a> </div> <div class="right"> <p><a href="doc/dwz-user-guide.zip" target="_blank" style="line-height:19px">DWZ框架使用手册(CHM)</a></p> <p><a href="doc/dwz-ajax-develop.swf" target="_blank" style="line-height:19px">DWZ框架Ajax开发视频教材</a></p> </div> <p><span>DWZ富客户端框架</span></p> <p>DWZ官方微博:<a href="http://weibo.com/dwzui" target="_blank">http://weibo.com/dwzui</a></p> </div> <div class="pageFormContent" layoutH="80"> <iframe width="100%" height="430" class="share_self" frameborder="0" scrolling="no" src="http://widget.weibo.com/weiboshow/index.php?width=0&height=430&fansRow=2&ptype=1&speed=300&skin=1&isTitle=0&noborder=1&isWeibo=1&isFans=0&uid=1739071261&verifier=c683dfe7"></iframe> </div> </div> </div> </div> </div> </div> <div id="footer">Copyright &copy; 2010 <a href="demo_page2.html" target="dialog">DWZ团队</a></div> <!-- 注意此处js代码用于google站点统计,非DWZ代码,请删除 --> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-16716654-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? ' https://ssl' : ' http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </body> </html>
zyroot
trunk/admin/dwz1.4.5/index_menu.html
HTML
art
13,247
<h2 class="contentTitle">下拉菜单</h2> <div class="pageContent" layoutH="56"> <select class="combox" name="province" ref="w_combox_city" refUrl="demo/combox/city_{value}.html"> <option value="all">所有省市</option> <option value="bj">北京</option> <option value="sh">上海</option> </select> <select class="combox" name="city" id="w_combox_city" ref="w_combox_area" refUrl="demo/combox/area_{value}.html"> <option value="all">所有城市</option> </select> <select class="combox" name="area" id="w_combox_area"> <option value="all">所有区县</option> </select> <div class="divider"></div> <select class="combox" name="test"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> </select> </div>
zyroot
trunk/admin/dwz1.4.5/w_combox.html
HTML
art
991
<h2 class="contentTitle">主框架面板</h2> <div style="padding:0 10px; line-height:21px;"> <b>打开方式:</b><br /> 1. 新建Tab窗口:target="navTab" <br /> 2. 选择Tab窗口:每个Tab都有一个唯一的Id,通过打开方式中的 rel="" 对Tab定义<br /> 3. 自己定义Tab标签的名称:title=""<br /> <a class="button" href="newPage1.html" target="navTab" rel="newPage"><span>新建一个Tab窗口</span></a> </div>
zyroot
trunk/admin/dwz1.4.5/tabsPage.html
HTML
art
453
新建窗口2
zyroot
trunk/admin/dwz1.4.5/newPage2.html
HTML
art
13
<textarea style="width:95%;height:200px"> DWZ富客户端框架 在线演示地址 http://j-ui.com/ 下载地址 http://code.google.com/p/dwz/ 官方微博: http://weibo.com/dwzui DWZ创始人: [北京]杜权(UI设计) d@j-ui.com [杭州]吴平(Ajax开发) w@j-ui.com [北京]张慧华(Ajax开发) z@j-ui.com 新加入成员: [北京]张涛 QQ:122794105 [北京]冀刚 QQ:63502308 jiweigang2008@tom.com [北京]郑应海 QQ:55691650 [成都]COCO QQ:80095667 有问题尽量发邮件或微博 </textarea> <br>
zyroot
trunk/admin/dwz1.4.5/demo_page2.html
HTML
art
556
<form id="pagerForm" method="post" action="w_list.html"> <input type="hidden" name="pageNum" value="1" /> <input type="hidden" name="numPerPage" value="${model.numPerPage}" /> <input type="hidden" name="orderField" value="${param.orderField}" /> <input type="hidden" name="orderDirection" value="${param.orderDirection}" /> </form> <div class="pageHeader"> <form rel="pagerForm" onsubmit="return navTabSearch(this);" action="demo_page1.html" method="post"> <div class="searchBar"> <ul class="searchContent"> <li> <label>我的客户:</label> <input type="text" name="keywords"/> </li> <li> <select class="combox" name="province"> <option value="">所有省市</option> <option value="北京">北京</option> <option value="上海">上海</option> <option value="天津">天津</option> <option value="重庆">重庆</option> <option value="广东">广东</option> </select> </li> </ul> <!-- <table class="searchContent"> <tr> <td> 我的客户:<input type="text"/> </td> <td> <select class="combox" name="province"> <option value="">所有省市</option> <option value="北京">北京</option> <option value="上海">上海</option> <option value="天津">天津</option> <option value="重庆">重庆</option> <option value="广东">广东</option> </select> </td> </tr> </table> --> <div class="subBar"> <ul> <li><div class="buttonActive"><div class="buttonContent"><button type="submit">检索</button></div></div></li> <li><a class="button" href="demo_page6.html" target="dialog" mask="true" title="查询框"><span>高级检索</span></a></li> </ul> </div> </div> </form> </div> <div class="pageContent"> <div class="panelBar"> <ul class="toolBar"> <li><a class="add" href="demo_page4.html" target="navTab"><span>添加</span></a></li> <li><a class="delete" href="demo/common/ajaxDone.html?uid={sid_user}" target="ajaxTodo" title="确定要删除吗?" warn="请选择一个用户"><span>删除</span></a></li> <li><a class="edit" href="demo_page4.html?uid={sid_user}" target="navTab" warn="请选择一个用户"><span>修改</span></a></li> <li class="line">line</li> <li><a class="icon" href="demo/common/dwz-team.xls" target="dwzExport" targetType="navTab" title="实要导出这些记录吗?"><span>导出EXCEL</span></a></li> <li><a class="icon" href="javascript:$.printBox('w_list_print')"><span>打印</span></a></li> </ul> </div> <div id="w_list_print"> <table class="list" width="98%" targetType="navTab" asc="asc" desc="desc" layoutH="116"> <thead> <tr> <th colspan="2">客户信息</th> <th colspan="2">基本信息</th> <th colspan="3">资料信息</th> </tr> <tr> <th width="80" orderField="name" class="asc">客户号</th> <th width="100" orderField="num" class="desc">客户名称</th> <th width="100">客户划分</th> <th>证件号码</th> <th align="right" width="100">信用等级</th> <th width="100">企业性质</th> <th width="100">建档日期</th> </tr> </thead> <tbody> <tr target="sid_user" rel="1"> <td>iso127309</td> <td>北京市政府咿呀哟</td> <td>政府单位</td> <td>0-0001027766351528</td> <td>四等级</td> <td>政府单位</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="2"> <td>iso127309</td> <td>北京市政府咿呀哟</td> <td>政府单位</td> <td>0-0001027766351528</td> <td>四等级</td> <td>政府单位</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="3"> <td>iso127309</td> <td>北京市政府咿呀哟</td> <td>政府单位</td> <td>0-0001027766351528</td> <td>四等级</td> <td>政府单位</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="4"> <td>iso127309</td> <td>北京市政府咿呀哟</td> <td>政府单位</td> <td>0-0001027766351528</td> <td>四等级</td> <td>政府单位</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="5"> <td>iso127309</td> <td>北京市政府咿呀哟</td> <td>政府单位</td> <td>0-0001027766351528</td> <td>四等级</td> <td>政府单位</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="6"> <td>iso127309</td> <td>北京市政府咿呀哟</td> <td>政府单位</td> <td>0-0001027766351528</td> <td>四等级</td> <td>政府单位</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="7"> <td>iso127309</td> <td>北京市政府咿呀哟</td> <td>政府单位</td> <td>0-0001027766351528</td> <td>四等级</td> <td>政府单位</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="8"> <td>iso127309</td> <td>北京市政府咿呀哟</td> <td>政府单位</td> <td>0-0001027766351528</td> <td>四等级</td> <td>政府单位</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="9"> <td>iso127309</td> <td>北京市政府咿呀哟</td> <td>政府单位</td> <td>0-0001027766351528</td> <td>四等级</td> <td>政府单位</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="10"> <td>iso127309</td> <td>北京市政府咿呀哟</td> <td>政府单位</td> <td>0-0001027766351528</td> <td>四等级</td> <td>政府单位</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="11"> <td>iso127309</td> <td>北京市政府咿呀哟</td> <td>政府单位</td> <td>0-0001027766351528</td> <td>四等级</td> <td>政府单位</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="12"> <td>iso127309</td> <td>北京市政府咿呀哟</td> <td>政府单位</td> <td>0-0001027766351528</td> <td>四等级</td> <td>政府单位</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="13"> <td>iso127309</td> <td>北京市政府咿呀哟</td> <td>政府单位</td> <td>0-0001027766351528</td> <td>四等级</td> <td>政府单位</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="14"> <td>iso127309</td> <td>北京市政府咿呀哟</td> <td>政府单位</td> <td>0-0001027766351528</td> <td>四等级</td> <td>政府单位</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="15"> <td>iso127309</td> <td>北京市政府咿呀哟</td> <td>政府单位</td> <td>0-0001027766351528</td> <td>四等级</td> <td>政府单位</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="16"> <td>iso127309</td> <td>北京市政府咿呀哟</td> <td>政府单位</td> <td>0-0001027766351528</td> <td>四等级</td> <td>政府单位</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="17"> <td>iso127309</td> <td>北京市政府咿呀哟</td> <td>政府单位</td> <td>0-0001027766351528</td> <td>四等级</td> <td>政府单位</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="18"> <td>iso127309</td> <td>北京市政府咿呀哟</td> <td>政府单位</td> <td>0-0001027766351528</td> <td>四等级</td> <td>政府单位</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="19"> <td>iso127309</td> <td>北京市政府咿呀哟</td> <td>政府单位</td> <td>0-0001027766351528</td> <td>四等级</td> <td>政府单位</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="20"> <td>iso127309</td> <td>北京市政府咿呀哟</td> <td>政府单位</td> <td>0-0001027766351528</td> <td>四等级</td> <td>政府单位</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="21"> <td>iso127309</td> <td>北京市政府咿呀哟</td> <td>政府单位</td> <td>0-0001027766351528</td> <td>四等级</td> <td>政府单位</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="22"> <td>iso127309</td> <td>北京市政府咿呀哟</td> <td>政府单位</td> <td>0-0001027766351528</td> <td>四等级</td> <td>政府单位</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="23"> <td>iso127309</td> <td>北京市政府咿呀哟</td> <td>政府单位</td> <td>0-0001027766351528</td> <td>四等级</td> <td>政府单位</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="24"> <td>iso127309</td> <td>北京市政府咿呀哟</td> <td>政府单位</td> <td>0-0001027766351528</td> <td>四等级</td> <td>政府单位</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="25"> <td>iso127309</td> <td>北京市政府咿呀哟</td> <td>政府单位</td> <td>0-0001027766351528</td> <td>四等级</td> <td>政府单位</td> <td>2009-05-21</td> </tr> </tbody> </table> </div> <div class="panelBar" > <div class="pages"> <span>显示</span> <select name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})"> <option value="20">20</option> <option value="50">50</option> <option value="100">100</option> <option value="200">200</option> </select> <span>条,共23条</span> </div> <div class="pagination" targetType="navTab" totalCount="200" numPerPage="20" pageNumShown="10" currentPage="2"></div> </div> </div>
zyroot
trunk/admin/dwz1.4.5/w_list.html
HTML
art
9,896
<div class="accordion" fillSpace="sideBar"> <div class="accordionHeader"> <h2><span>Folder</span>典型页面</h2> </div> <div class="accordionContent"> <ul class="tree treeFolder treeCheck"> <li><a href="demo_upload.html" target="navTab" rel="demo_upload">文件上传表单提交示例</a></li> <li><a href="demo_page1.html" target="navTab" rel="demo_page1">查询我的客户</a></li> <li><a href="demo_page1.html" target="navTab" rel="demo_page2">表单查询页面</a></li> <li><a href="demo_page4.html" target="navTab" rel="demo_page4">表单录入页面</a></li> <li><a href="demo_page5.html" target="navTab" rel="demo_page5">有文本输入的表单</a></li> </ul> </div> <div class="accordionHeader"> <h2><span>Folder</span>流程演示</h2> </div> <div class="accordionContent"> <ul class="tree"> <li><a href="newPage1.html" target="dialog" rel="dlg_page">列表</a></li> </ul> </div> </div>
zyroot
trunk/admin/dwz1.4.5/sidebar_2.html
HTML
art
962
.xhe_nostyle table, .xhe_nostyle tr, .xhe_nostyle td, .xhe_nostyle iframe {border:0; margin:0; padding:0; background:transparent;text-decoration:none; font-weight:normal; color:#000} .xhe_nostyle table.xheLayout {display:inline-table;background:#FFF; border:1px solid #C5C5C5;width:100%;height:100%;} .xhe_nostyle td.xheTool{padding:0px 3px;border-bottom:1px solid #C5C5C5;} .xhe_nostyle td.xheTool span{float:left;margin:2px 0px;} .xhe_nostyle td.xheTool br{clear:left;} .xhe_nostyle span.xheGStart{display:none;} .xhe_nostyle span.xheGEnd{display:none;} .xhe_nostyle span.xheSeparator{display:block;height:22px;width:4px;margin:2px 2px !important;background:url(img/icons.gif) no-repeat -660px 0;} .xhe_nostyle a.xheButton{display:inline-block;margin:1px;border:0px;cursor:pointer;text-decoration:none;} .xhe_nostyle a.xheButton span{opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30);} .xhe_nostyle a.xheEnabled span{opacity:1; -ms-filter:'alpha(opacity=100)'; filter:alpha(opacity=100);} .xhe_nostyle a.xheEnabled:hover {margin:0px;border:1px solid #999;background:#fff;} .xhe_nostyle a.xheActive{margin:0px;border:1px solid #999; background:#fff;} .xhe_nostyle a.xheButton span{display:block;margin:0px;height:20px;width:20px;overflow:hidden;} .xhe_nostyle span.xheIcon{background:url(img/icons.gif) no-repeat 20px 20px} .xhe_nostyle span.xheBtnCut {background-position:0 0} .xhe_nostyle span.xheBtnCopy {background-position:-20px 0} .xhe_nostyle span.xheBtnPaste {background-position:-40px 0} .xhe_nostyle span.xheBtnPastetext {background-position:-60px 0} .xhe_nostyle span.xheBtnBlocktag {background-position:-80px 0} .xhe_nostyle span.xheBtnFontface {background-position:-100px 0} .xhe_nostyle span.xheBtnFontSize {background-position:-120px 0} .xhe_nostyle span.xheBtnBold {background-position:-140px 0} .xhe_nostyle span.xheBtnItalic {background-position:-160px 0} .xhe_nostyle span.xheBtnUnderline {background-position:-180px 0} .xhe_nostyle span.xheBtnStrikethrough {background-position:-200px 0} .xhe_nostyle span.xheBtnFontColor {background-position:-220px 0} .xhe_nostyle span.xheBtnBackColor {background-position:-240px 0} .xhe_nostyle span.xheBtnSelectAll {background-position:-260px 0} .xhe_nostyle span.xheBtnRemoveformat {background-position:-280px 0} .xhe_nostyle span.xheBtnAlign {background-position:-300px 0} .xhe_nostyle span.xheBtnList {background-position:-320px 0} .xhe_nostyle span.xheBtnOutdent {background-position:-340px 0} .xhe_nostyle span.xheBtnIndent {background-position:-360px 0} .xhe_nostyle span.xheBtnLink {background-position:-380px 0} .xhe_nostyle span.xheBtnUnlink {background-position:-400px 0} .xhe_nostyle span.xheBtnAnchor {background-position:-420px 0} .xhe_nostyle span.xheBtnImg {background-position:-440px 0} .xhe_nostyle span.xheBtnFlash {background-position:-460px 0} .xhe_nostyle span.xheBtnMedia {background-position:-480px 0} .xhe_nostyle span.xheBtnHr {background-position:-500px 0} .xhe_nostyle span.xheBtnEmot {background-position:-520px 0} .xhe_nostyle span.xheBtnTable {background-position:-540px 0} .xhe_nostyle span.xheBtnSource {background-position:-560px 0} .xhe_nostyle span.xheBtnPreview {background-position:-580px 0} .xhe_nostyle span.xheBtnPrint {background-position:-600px 0} .xhe_nostyle span.xheBtnFullscreen {background-position:-620px 0} .xhe_nostyle span.xheBtnAbout {background-position:-640px 0} .xhe_nostyle .xheIframeArea{height:100%;} .xhe_nostyle iframe {display:block;background:#fff;width:100%;height:100%;} #xheCntLine{display:none;position:absolute;z-index:1000001;background:#fff;height:1px;font-size:0;} #xhePanel{display:none;position:absolute;z-index:1000000;border:#999 1px solid;background:#fff;text-align:left;} #xheShadow{display:none;position:absolute;z-index:999999;background:#000;opacity:0.2; -ms-filter:'alpha(opacity=20)'; filter:alpha(opacity=20);} .xheFixCancel{position:absolute;z-index:999998;background-color:#FFF;opacity:0; -ms-filter:'alpha(opacity=0)'; filter:alpha(opacity=0);} .xheMenu{padding:2px;overflow-x:hidden;overflow-y:auto;max-height:230px;} .xheMenu .xheMenuSeparator{margin:3px 0;border-top:1px solid #D8D8D8;} .xheMenu a{display:block;padding:3px 20px 3px 3px;line-height:normal;font-size:12px;color:#000;text-decoration:none;white-space:nowrap;} .xheMenu a:hover{background:#e5e5e5;text-decoration:none;color:#000;} .xheMenu p,.xheMenu h1,.xheMenu h2,.xheMenu h3,.xheMenu h4,.xheMenu h5,.xheMenu h6,.xheMenu pre,.xheMenu address,.xheMenu div{margin:0} .xheEmot div{padding:5px;overflow-x:hidden;overflow-y:auto;} .xheEmot div a{display:inline-block;margin:3px;padding:3px;overflow:hidden;background-repeat:no-repeat;background-position:center;text-decoration:none;} .xheEmot div a:hover{border:1px solid #999;padding:2px;} .xheEmot ul{border-top:1px solid #999;list-style:none;padding:0 10px;margin:0;font-size:12px;} .xheEmot li{float:left;margin:0 2px 5px 0;} .xheEmot li a{background:#fff;display:block;padding:0 8px;text-decoration:none;color:#000;line-height:20px;} .xheEmot li a:hover{text-decoration:underline;} .xheEmot li.cur{border:1px solid #999;border-top:none;position:relative;bottom:1px;} .xheEmot li.cur a{cursor:text;padding-top:1px;} .xheEmot li.cur a:hover{text-decoration:none;} .xheColor{padding:5px;} .xheColor a{display:inline-block;margin:1px;border:#999 1px solid;width:17px;height:9px;font-size:0;} .xheColor a:hover{border:#000 1px solid;} .xheColor a img{display:none;} .xheDialog{padding:10px;font-size:12px;font-family:monospace;} .xheDialog a{text-decoration:underline;color:#00f;} .xheDialog a:hover{text-decoration:underline;color:#00f} .xheDialog div{padding:2px 0;} .xheDialog input{ margin:0;border-width:1px;border-style:solid;font-size:12px; *border-width:expression((type!="checkbox")?'1px':0);*padding:expression((type=="text")?'1px':'auto');*width:expression((type=="text")?'160px':'auto');*border-color:expression((type=="text")?'#ABADB3':'#fff #888 #888 #fff');*background:expression((type=="button")?'#F0F0F0':'#FFFFFF');*cursor:expression((type=="button")?'pointer':'');*font-size:expression((type=="button")?'13px':'12px'); } .xheDialog textarea{font-size:12px;resize:none;border:1px solid #ccc;} .xheDialog input[type=text]{padding:1px;width:160px;border-color:#ABADB3;} .xheDialog input[type=button]{margin:0;border-color:#fff #888 #888 #fff;background:#F0F0F0;cursor:pointer;font-size:13px;} .xheDialog input[type=file]{font-size:13px;} .xheDialog input[type=checkbox]{border:0;} .xheDialog select{margin:0;border:1px #ABADB3 solid;} .xheDialog input,.xheDialog select,.xheDialog textarea{border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;} .xheDialog input:focus,.xheDialog select:focus,.xheDialog textarea:focus{outline: 0;border-color: #EEC068;-webkit-box-shadow: 0 0 1px #EEC068;-moz-box-shadow: 0 0 1px #EEC068;box-shadow: 0 0 1px #EEC068;} .xheDialog .xheUpload{position: relative;display:inline-block;width:164px;} .xheDialog .xheUpload .xheBtn{position: absolute;top: 0px;left: 114px;width:50px;z-index: 1000001;padding:0;} .xheDialog .xheUpload .xheFile{cursor:pointer;position: absolute;top: 0px;left: 0px;width:164px;opacity:0;-ms-filter:'alpha(opacity=0)';filter:alpha(opacity=0);z-index: 1000002;} .xheDialog .xheUpload .xheText {position: absolute;width:107px;top: 0px;left: 0px;z-index: 1000003;} .xheModal{ position: fixed;z-index: 1000010;text-align:left;top:50%;left:50%;background:#FFF;border:1px solid #BBB;font-size:12px; _position:absolute;_margin-top:expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px'); } .xheModalTitle{padding:5px;background:#F0F0EE;border-bottom:1px solid #BBB;} .xheModalClose{float:right;width:16px;height:16px;background:url(img/close.gif);cursor:pointer;} .xheModalIfmWait{width:100%;height:100%;background:url(img/waiting.gif) no-repeat 50% 50%;margin:-16 0 0 -16;} .xheModalShadow{ position:fixed;z-index:1000009;top:50%;left:50%;background:#000;opacity:0.2; -ms-filter:'alpha(opacity=20)'; filter:alpha(opacity=20); _position:absolute;_margin-top:expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 5 + 'px'); } .xheModalOverlay{ position: fixed;z-index:1000008;top: 0px;left: 0px;height:100%;width:100%;background-color:#000;opacity:0.2; -ms-filter:'alpha(opacity=20)'; filter:alpha(opacity=20); _position:absolute;_height:expression(Math.max(document.documentElement.clientHeight,document.documentElement.scrollHeight)+'px');_width:expression(Math.max(document.documentElement.clientWidth,document.documentElement.scrollWidth)+'px'); } *html{ background-image:url(about:blank); background-attachment:fixed; } .xheProgress{position:relative;width:280px;margin:auto;border:1px solid #C1C1C1;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;background:url(img/progressbg.gif) #E9E9E9;} .xheProgress span{position:absolute;left:0;top:0;width:100%;text-align:center;line-height:15px;font-size:12px;color:#222;text-shadow: 1px 1px 0 #eee;} .xheProgress div{height:15px;width:1px;background:url(img/progress.gif) #31C135;} .xhe_Fullfix{overflow:hidden;} .xhe_Fullfix body{width:100%;height:100%;} .xhe_Fullscreen{ top:0px;left:0px;position:fixed;z-index:100000;width:100%;height:100%;background:#fff; _position:absolute;_top:expression((document.compatMode?documentElement.scrollTop:document.body.scrollTop)+'px');_width:expression((document.compatMode?documentElement.offsetWidth:document.body.offsetWidth) + 'px');_height:expression((document.compatMode?documentElement.offsetHeight:document.body.offsetHeight) + 'px'); } .xheHideArea{position:absolute;top:-1000px;left:-1000px;visibility:hidden;}
zyroot
trunk/admin/dwz1.4.5/xheditor/xheditor_skin/nostyle/ui.css
CSS
art
9,967
html{height:100%;background-color:#FFFFFF;} body,td,th{font-family:Arial,Helvetica,sans-serif;font-size:12px;} body{height:100%;*height:90%;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;} .xhe-border{border:1px dotted #d3d3d3;} .xhe-border th,.xhe-border td{border:1px dotted #d3d3d3;} .editMode{margin:0px;padding:5px;overflow-y:auto;word-break:break-word;word-wrap:break-word;} .editMode img:-moz-broken {-moz-force-broken-image-icon:1;height:24px;width:24px;} .editMode embed{display:inline-block;border:1px dashed #FF4E4E;} .editMode embed[type="application/x-shockwave-flash"]{background:url(img/flash.gif) center center no-repeat;} .editMode embed[type="application/x-mplayer2"]{background:url(img/wmp.gif) center center no-repeat;} .editMode .xhe-paste{position:absolute;left:-1000px;overflow:hidden;width:1px;height:1px;} .editMode .xhe-anchor{display:inline-block;background: url(img/anchor.gif) no-repeat;border: 1px dotted #0000FF;width:16px;height:15px;overflow:hidden;} .sourceMode{margin:0px;padding:0px;overflow:hidden;height:100%;} .sourceMode textarea{*position:absolute;border:0px;margin:0px;padding:0px;width:100%;height:100%;overflow-y:auto;font-family:'Courier New',Courier,monospace !important;font-size:10pt;outline:0;} .previewMode{margin:5px;padding:0px;} .showBlocktag p,.showBlocktag h1,.showBlocktag h2,.showBlocktag h3,.showBlocktag h4,.showBlocktag h5,.showBlocktag h6,.showBlocktag pre,.showBlocktag address,.showBlocktag div{background:none no-repeat scroll right top;border:1px dotted gray;} .showBlocktag p{background-image:url(img/tag-p.gif);} .showBlocktag h1{background-image:url(img/tag-h1.gif);} .showBlocktag h2{background-image:url(img/tag-h2.gif);} .showBlocktag h3{background-image:url(img/tag-h3.gif);} .showBlocktag h4{background-image:url(img/tag-h4.gif);} .showBlocktag h5{background-image:url(img/tag-h5.gif);} .showBlocktag h6{background-image:url(img/tag-h6.gif);} .showBlocktag pre{background-image:url(img/tag-pre.gif);} .showBlocktag address{background-image:url(img/tag-address.gif);} .showBlocktag div{background-image:url(img/tag-div.gif);}
zyroot
trunk/admin/dwz1.4.5/xheditor/xheditor_skin/nostyle/iframe.css
CSS
art
2,164
.xhe_o2007blue table, .xhe_o2007blue tr, .xhe_o2007blue td, .xhe_o2007blue iframe {border:0; margin:0; padding:0; background:transparent;text-decoration:none; font-weight:normal; color:#000} .xhe_o2007blue table.xheLayout {display:inline-table;background:#E5EFFD; border:1px solid #ABC6DD;width:100%;height:100%;} .xhe_o2007blue td.xheTool {padding:1px 3px;border-bottom:1px solid #ABC6DD;} .xhe_o2007blue td.xheTool span{float:left;margin:2px 0px;} .xhe_o2007blue td.xheTool br{clear:left;} .xhe_o2007blue span.xheGStart{display:block;width:1px;height:22px;background:url(img/buttonbg.gif) -22px 0;} .xhe_o2007blue span.xheGEnd{display:block;width:1px;height:22px;background:url(img/buttonbg.gif) -22px 0;} .xhe_o2007blue span.xheSeparator{display:block;height:22px;width:4px;} .xhe_o2007blue a.xheButton{display:inline-block;padding:1px;border:0px;background:url(img/buttonbg.gif);cursor:pointer;text-decoration:none;} .xhe_o2007blue a.xheButton span{opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30);} .xhe_o2007blue a.xheEnabled span{opacity:1; -ms-filter:'alpha(opacity=100)'; filter:alpha(opacity=100)} .xhe_o2007blue a.xheEnabled:hover {background-color:#B2BBD0; background-position:0 -22px} .xhe_o2007blue a.xheActive{background-color:#B2BBD0; background-position:0 -44px !important;} .xhe_o2007blue a.xheButton span{display:block;margin:0px;height:20px;width:20px;overflow:hidden;} .xhe_o2007blue span.xheIcon{background:url(img/icons.gif) no-repeat 20px 20px} .xhe_o2007blue span.xheBtnCut {background-position:0 0} .xhe_o2007blue span.xheBtnCopy {background-position:-20px 0} .xhe_o2007blue span.xheBtnPaste {background-position:-40px 0} .xhe_o2007blue span.xheBtnPastetext {background-position:-60px 0} .xhe_o2007blue span.xheBtnBlocktag {background-position:-80px 0} .xhe_o2007blue span.xheBtnFontface {background-position:-100px 0} .xhe_o2007blue span.xheBtnFontSize {background-position:-120px 0} .xhe_o2007blue span.xheBtnBold {background-position:-140px 0} .xhe_o2007blue span.xheBtnItalic {background-position:-160px 0} .xhe_o2007blue span.xheBtnUnderline {background-position:-180px 0} .xhe_o2007blue span.xheBtnStrikethrough {background-position:-200px 0} .xhe_o2007blue span.xheBtnFontColor {background-position:-220px 0} .xhe_o2007blue span.xheBtnBackColor {background-position:-240px 0} .xhe_o2007blue span.xheBtnSelectAll {background-position:-260px 0} .xhe_o2007blue span.xheBtnRemoveformat {background-position:-280px 0} .xhe_o2007blue span.xheBtnAlign {background-position:-300px 0} .xhe_o2007blue span.xheBtnList {background-position:-320px 0} .xhe_o2007blue span.xheBtnOutdent {background-position:-340px 0} .xhe_o2007blue span.xheBtnIndent {background-position:-360px 0} .xhe_o2007blue span.xheBtnLink {background-position:-380px 0} .xhe_o2007blue span.xheBtnUnlink {background-position:-400px 0} .xhe_o2007blue span.xheBtnAnchor {background-position:-420px 0} .xhe_o2007blue span.xheBtnImg {background-position:-440px 0} .xhe_o2007blue span.xheBtnFlash {background-position:-460px 0} .xhe_o2007blue span.xheBtnMedia {background-position:-480px 0} .xhe_o2007blue span.xheBtnHr {background-position:-500px 0} .xhe_o2007blue span.xheBtnEmot {background-position:-520px 0} .xhe_o2007blue span.xheBtnTable {background-position:-540px 0} .xhe_o2007blue span.xheBtnSource {background-position:-560px 0} .xhe_o2007blue span.xheBtnPreview {background-position:-580px 0} .xhe_o2007blue span.xheBtnPrint {background-position:-600px 0} .xhe_o2007blue span.xheBtnFullscreen {background-position:-620px 0} .xhe_o2007blue span.xheBtnAbout {background-position:-640px 0} .xhe_o2007blue .xheIframeArea{height:100%;} .xhe_o2007blue iframe {display:block;background:#fff;width:100%;height:100%;} #xheCntLine{display:none;position:absolute;z-index:1000001;background:#fff;height:1px;font-size:0;} #xhePanel{display:none;position:absolute;z-index:1000000;border:#ABC6DD 1px solid;background:#FDFEFF;text-align:left;} #xheShadow{display:none;position:absolute;z-index:999999;background:#000;opacity:0.2; -ms-filter:'alpha(opacity=20)'; filter:alpha(opacity=20);} .xheFixCancel{position:absolute;z-index:999998;background-color:#FFF;opacity:0; -ms-filter:'alpha(opacity=0)'; filter:alpha(opacity=0);} .xheMenu{padding:2px;overflow-x:hidden;overflow-y:auto;max-height:230px;} .xheMenu .xheMenuSeparator{margin:3px 0;border-top:1px solid #D8D8D8;} .xheMenu a{display:block;padding:3px 20px 3px 3px;line-height:normal;font-size:12px;color:#000;text-decoration:none;white-space:nowrap;} .xheMenu a:hover{background:#C6DAE9;text-decoration:none;color:#000;} .xheMenu p,.xheMenu h1,.xheMenu h2,.xheMenu h3,.xheMenu h4,.xheMenu h5,.xheMenu h6,.xheMenu pre,.xheMenu address,.xheMenu div{margin:0} .xheEmot div{padding:5px;overflow-x:hidden;overflow-y:auto;} .xheEmot div a{display:inline-block;margin:3px;padding:3px;overflow:hidden;background-repeat:no-repeat;background-position:center;text-decoration:none;} .xheEmot div a:hover{border:1px solid #ABC6DD;padding:2px;} .xheEmot ul{border-top:1px solid #ABC6DD;list-style:none;padding:0 10px;margin:0;font-size:12px;} .xheEmot li{float:left;margin:0 2px 5px 0;} .xheEmot li a{background:#fff;display:block;padding:0 8px;text-decoration:none;color:#000;line-height:20px;} .xheEmot li a:hover{text-decoration:underline;} .xheEmot li.cur{border:1px solid #ABC6DD;border-top:none;position:relative;bottom:1px;} .xheEmot li.cur a{cursor:text;padding-top:1px;} .xheEmot li.cur a:hover{text-decoration:none;} .xheColor{padding:5px;} .xheColor a{display:inline-block;margin:1px;border:#999 1px solid;width:17px;height:9px;font-size:0;} .xheColor a:hover{border:#000 1px solid;} .xheColor a img{display:none;} .xheDialog{padding:10px;font-size:12px;font-family:monospace;} .xheDialog a{text-decoration:underline;color:#00f;} .xheDialog a:hover{text-decoration:underline;color:#00f} .xheDialog div{padding:2px 0px;} .xheDialog input{ margin:0;border-width:1px;border-style:solid;font-size:12px; *border-width:expression((type!="checkbox")?'1px':0);*padding:expression((type=="text")?'1px':'auto');*width:expression((type=="text")?'160px':'auto');*border-color:expression((type=="text")?'#ABADB3':'#fff #888 #888 #fff');*background:expression((type=="button")?'#F0F0F0':'#FFFFFF');*cursor:expression((type=="button")?'pointer':'');*font-size:expression((type=="button")?'13px':'12px'); } .xheDialog textarea{font-size:12px;resize:none;border:1px solid #ccc;} .xheDialog input[type=text]{padding:1px;width:160px;border-color:#ABADB3;} .xheDialog input[type=button]{margin:0;border-color:#fff #888 #888 #fff;background:#F0F0F0;cursor:pointer;font-size:13px;} .xheDialog input[type=file]{font-size:13px;} .xheDialog input[type=checkbox]{border:0;} .xheDialog select{margin:0;border:1px #ABADB3 solid;} .xheDialog input,.xheDialog select,.xheDialog textarea{border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;} .xheDialog input:focus,.xheDialog select:focus,.xheDialog textarea:focus{outline: 0;border-color: #EEC068;-webkit-box-shadow: 0 0 1px #EEC068;-moz-box-shadow: 0 0 1px #EEC068;box-shadow: 0 0 1px #EEC068;} .xheDialog .xheUpload{position: relative;display:inline-block;width:164px;} .xheDialog .xheUpload .xheBtn{position: absolute;top: 0px;left: 114px;width:50px;z-index: 1000001;padding:0;} .xheDialog .xheUpload .xheFile{cursor:pointer;position: absolute;top: 0px;left: 0px;width:164px;opacity:0;-ms-filter:'alpha(opacity=0)';filter:alpha(opacity=0);z-index: 1000002;} .xheDialog .xheUpload .xheText {position: absolute;width:107px;top: 0px;left: 0px;z-index: 1000003;} .xheModal{ position: fixed;z-index: 1000010;text-align:left;top:50%;left:50%;background:#FFF;border:1px solid #ABC6DD;font-size:12px; _position:absolute;_margin-top:expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px'); } .xheModalTitle{padding:5px;background:#D1DEEF;border-bottom:1px solid #ABC6DD;} .xheModalClose{float:right;width:16px;height:16px;background:url(img/close.gif);cursor:pointer;} .xheModalIfmWait{width:100%;height:100%;background:url(img/waiting.gif) no-repeat 50% 50%;margin:-16 0 0 -16;} .xheModalShadow{ position:fixed;z-index:1000009;top:50%;left:50%;background:#000;opacity:0.2; -ms-filter:'alpha(opacity=20)'; filter:alpha(opacity=20); _position:absolute;_margin-top:expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 5 + 'px'); } .xheModalOverlay{ position: fixed;z-index:1000008;top: 0px;left: 0px;height:100%;width:100%;background-color:#000;opacity:0.2; -ms-filter:'alpha(opacity=20)'; filter:alpha(opacity=20); _position:absolute;_height:expression(Math.max(document.documentElement.clientHeight,document.documentElement.scrollHeight)+'px');_width:expression(Math.max(document.documentElement.clientWidth,document.documentElement.scrollWidth)+'px'); } *html{ background-image:url(about:blank); background-attachment:fixed; } .xheProgress{position:relative;width:280px;margin:auto;border:1px solid #C1C1C1;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;background:url(img/progressbg.gif) #E9E9E9;} .xheProgress span{position:absolute;left:0;top:0;width:100%;text-align:center;line-height:15px;font-size:12px;color:#000;text-shadow: 1px 1px 0 #eee;} .xheProgress div{height:15px;width:1px;background:url(img/progress.gif) #31C135;} .xhe_Fullfix{overflow:hidden;} .xhe_Fullfix body{width:100%;height:100%;} .xhe_Fullscreen{ top:0px;left:0px;position:fixed;z-index:100000;width:100%;height:100%;background:#fff; _position:absolute;_top:expression((document.compatMode?documentElement.scrollTop:document.body.scrollTop)+'px');_width:expression((document.compatMode?documentElement.offsetWidth:document.body.offsetWidth) + 'px');_height:expression((document.compatMode?documentElement.offsetHeight:document.body.offsetHeight) + 'px'); } .xheHideArea{position:absolute;top:-1000px;left:-1000px;visibility:hidden;}
zyroot
trunk/admin/dwz1.4.5/xheditor/xheditor_skin/o2007blue/ui.css
CSS
art
10,203
html{height:100%;background-color:#FFFFFF;} body,td,th{font-family:Arial,Helvetica,sans-serif;font-size:12px;} body{height:100%;*height:90%;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;} .xhe-border{border:1px dotted #d3d3d3;} .xhe-border th,.xhe-border td{border:1px dotted #d3d3d3;} .editMode{margin:0px;padding:5px;overflow-y:auto;word-break:break-word;word-wrap:break-word;} .editMode img:-moz-broken {-moz-force-broken-image-icon:1;height:24px;width:24px;} .editMode embed{display:inline-block;border:1px dashed #FF4E4E;} .editMode embed[type="application/x-shockwave-flash"]{background:url(img/flash.gif) center center no-repeat;} .editMode embed[type="application/x-mplayer2"]{background:url(img/wmp.gif) center center no-repeat;} .editMode .xhe-paste{position:absolute;left:-1000px;overflow:hidden;width:1px;height:1px;} .editMode .xhe-anchor{display:inline-block;background: url(img/anchor.gif) no-repeat;border: 1px dotted #0000FF;width:16px;height:15px;overflow:hidden;} .sourceMode{margin:0px;padding:0px;overflow:hidden;height:100%;} .sourceMode textarea{*position:absolute;border:0px;margin:0px;padding:0px;width:100%;height:100%;overflow-y:auto;font-family:'Courier New',Courier,monospace !important;font-size:10pt;resize:none;outline:0;} .previewMode{margin:5px;padding:0px;} .showBlocktag p,.showBlocktag h1,.showBlocktag h2,.showBlocktag h3,.showBlocktag h4,.showBlocktag h5,.showBlocktag h6,.showBlocktag pre,.showBlocktag address,.showBlocktag div{background:none no-repeat scroll right top;border:1px dotted gray;} .showBlocktag p{background-image:url(img/tag-p.gif);} .showBlocktag h1{background-image:url(img/tag-h1.gif);} .showBlocktag h2{background-image:url(img/tag-h2.gif);} .showBlocktag h3{background-image:url(img/tag-h3.gif);} .showBlocktag h4{background-image:url(img/tag-h4.gif);} .showBlocktag h5{background-image:url(img/tag-h5.gif);} .showBlocktag h6{background-image:url(img/tag-h6.gif);} .showBlocktag pre{background-image:url(img/tag-pre.gif);} .showBlocktag address{background-image:url(img/tag-address.gif);} .showBlocktag div{background-image:url(img/tag-div.gif);}
zyroot
trunk/admin/dwz1.4.5/xheditor/xheditor_skin/o2007blue/iframe.css
CSS
art
2,176
.xhe_o2007silver table, .xhe_o2007silver tr, .xhe_o2007silver td, .xhe_o2007silver iframe {border:0; margin:0; padding:0; background:transparent;text-decoration:none; font-weight:normal; color:#000} .xhe_o2007silver table.xheLayout {display:inline-table;background:#EEEEEE; border:1px solid #BBBBBB;width:100%;height:100%;} .xhe_o2007silver td.xheTool {padding:1px 3px;border-bottom:1px solid #BBBBBB;} .xhe_o2007silver td.xheTool span{float:left;margin:2px 0px;} .xhe_o2007silver td.xheTool br{clear:left;} .xhe_o2007silver span.xheGStart{display:block;width:1px;height:22px;background:url(img/buttonbg.gif) -22px 0;} .xhe_o2007silver span.xheGEnd{display:block;width:1px;height:22px;background:url(img/buttonbg.gif) -22px 0;} .xhe_o2007silver span.xheSeparator{display:block;height:22px;width:4px;} .xhe_o2007silver a.xheButton{display:inline-block;padding:1px;border:0px;background:url(img/buttonbg.gif);cursor:pointer;text-decoration:none;} .xhe_o2007silver a.xheButton span{opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30);} .xhe_o2007silver a.xheEnabled span{opacity:1; -ms-filter:'alpha(opacity=100)'; filter:alpha(opacity=100)} .xhe_o2007silver a.xheEnabled:hover {background-color:#B2BBD0; background-position:0 -22px} .xhe_o2007silver a.xheActive{background-color:#B2BBD0; background-position:0 -44px !important} .xhe_o2007silver a.xheButton span{display:block;margin:0px;height:20px;width:20px;overflow:hidden;} .xhe_o2007silver span.xheIcon{background:url(img/icons.gif) no-repeat 20px 20px} .xhe_o2007silver span.xheBtnCut {background-position:0 0} .xhe_o2007silver span.xheBtnCopy {background-position:-20px 0} .xhe_o2007silver span.xheBtnPaste {background-position:-40px 0} .xhe_o2007silver span.xheBtnPastetext {background-position:-60px 0} .xhe_o2007silver span.xheBtnBlocktag {background-position:-80px 0} .xhe_o2007silver span.xheBtnFontface {background-position:-100px 0} .xhe_o2007silver span.xheBtnFontSize {background-position:-120px 0} .xhe_o2007silver span.xheBtnBold {background-position:-140px 0} .xhe_o2007silver span.xheBtnItalic {background-position:-160px 0} .xhe_o2007silver span.xheBtnUnderline {background-position:-180px 0} .xhe_o2007silver span.xheBtnStrikethrough {background-position:-200px 0} .xhe_o2007silver span.xheBtnFontColor {background-position:-220px 0} .xhe_o2007silver span.xheBtnBackColor {background-position:-240px 0} .xhe_o2007silver span.xheBtnSelectAll {background-position:-260px 0} .xhe_o2007silver span.xheBtnRemoveformat {background-position:-280px 0} .xhe_o2007silver span.xheBtnAlign {background-position:-300px 0} .xhe_o2007silver span.xheBtnList {background-position:-320px 0} .xhe_o2007silver span.xheBtnOutdent {background-position:-340px 0} .xhe_o2007silver span.xheBtnIndent {background-position:-360px 0} .xhe_o2007silver span.xheBtnLink {background-position:-380px 0} .xhe_o2007silver span.xheBtnUnlink {background-position:-400px 0} .xhe_o2007silver span.xheBtnAnchor {background-position:-420px 0} .xhe_o2007silver span.xheBtnImg {background-position:-440px 0} .xhe_o2007silver span.xheBtnFlash {background-position:-460px 0} .xhe_o2007silver span.xheBtnMedia {background-position:-480px 0} .xhe_o2007silver span.xheBtnHr {background-position:-500px 0} .xhe_o2007silver span.xheBtnEmot {background-position:-520px 0} .xhe_o2007silver span.xheBtnTable {background-position:-540px 0} .xhe_o2007silver span.xheBtnSource {background-position:-560px 0} .xhe_o2007silver span.xheBtnPreview {background-position:-580px 0} .xhe_o2007silver span.xheBtnPrint {background-position:-600px 0} .xhe_o2007silver span.xheBtnFullscreen {background-position:-620px 0} .xhe_o2007silver span.xheBtnAbout {background-position:-640px 0} .xhe_o2007silver .xheIframeArea{height:100%;} .xhe_o2007silver iframe {display:block;background:#fff;width:100%;height:100%;} #xheCntLine{display:none;position:absolute;z-index:1000001;background:#fff;height:1px;font-size:0;} #xhePanel{display:none;position:absolute;z-index:1000000;border:#BBBBBB 1px solid;background:#FDFEFF;text-align:left;} #xheShadow{display:none;position:absolute;z-index:999999;background:#000;opacity:0.2; -ms-filter:'alpha(opacity=20)'; filter:alpha(opacity=20);} .xheFixCancel{position:absolute;z-index:999998;background-color:#FFF;opacity:0; -ms-filter:'alpha(opacity=0)'; filter:alpha(opacity=0);} .xheMenu{padding:2px;overflow-x:hidden;overflow-y:auto;max-height:230px;} .xheMenu .xheMenuSeparator{margin:3px 0;border-top:1px solid #D8D8D8;} .xheMenu a{display:block;padding:3px 20px 3px 3px;line-height:normal;font-size:12px;color:#000;text-decoration:none;white-space:nowrap;} .xheMenu a:hover{background:#e5e5e5;text-decoration:none;color:#000;} .xheMenu p,.xheMenu h1,.xheMenu h2,.xheMenu h3,.xheMenu h4,.xheMenu h5,.xheMenu h6,.xheMenu pre,.xheMenu address,.xheMenu div{margin:0} .xheEmot div{padding:5px;overflow-x:hidden;overflow-y:auto;} .xheEmot div a{display:inline-block;margin:3px;padding:3px;overflow:hidden;background-repeat:no-repeat;background-position:center;text-decoration:none;} .xheEmot div a:hover{border:1px solid #BBBBBB;padding:2px;} .xheEmot ul{border-top:1px solid #BBBBBB;list-style:none;padding:0 10px;margin:0;font-size:12px;} .xheEmot li{float:left;margin:0 2px 5px 0;} .xheEmot li a{background:#fff;display:block;padding:0 8px;text-decoration:none;color:#000;line-height:20px;} .xheEmot li a:hover{text-decoration:underline;} .xheEmot li.cur{border:1px solid #BBBBBB;border-top:none;position:relative;bottom:1px;} .xheEmot li.cur a{cursor:text;padding-top:1px;} .xheEmot li.cur a:hover{text-decoration:none;} .xheColor{padding:5px;} .xheColor a{display:inline-block;margin:1px;border:#999 1px solid;width:17px;height:9px;font-size:0;} .xheColor a:hover{border:#000 1px solid;} .xheColor a img{display:none;} .xheDialog{padding:10px;font-size:12px;font-family:monospace;} .xheDialog a{text-decoration:underline;color:#00f;} .xheDialog a:hover{text-decoration:underline;color:#00f} .xheDialog div{padding:2px 0px;} .xheDialog input{ margin:0;border-width:1px;border-style:solid;font-size:12px; *border-width:expression((type!="checkbox")?'1px':0);*padding:expression((type=="text")?'1px':'auto');*width:expression((type=="text")?'160px':'auto');*border-color:expression((type=="text")?'#ABADB3':'#fff #888 #888 #fff');*background:expression((type=="button")?'#F0F0F0':'#FFFFFF');*cursor:expression((type=="button")?'pointer':'');*font-size:expression((type=="button")?'13px':'12px'); } .xheDialog textarea{font-size:12px;resize:none;border:1px solid #ccc;} .xheDialog input[type=text]{padding:1px;width:160px;border-color:#ABADB3;} .xheDialog input[type=button]{margin:0;border-color:#fff #888 #888 #fff;background:#F0F0F0;cursor:pointer;font-size:13px;} .xheDialog input[type=file]{font-size:13px;} .xheDialog input[type=checkbox]{border:0;} .xheDialog select{margin:0;border:1px #ABADB3 solid;} .xheDialog input,.xheDialog select,.xheDialog textarea{border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;} .xheDialog input:focus,.xheDialog select:focus,.xheDialog textarea:focus{outline: 0;border-color: #EEC068;-webkit-box-shadow: 0 0 1px #EEC068;-moz-box-shadow: 0 0 1px #EEC068;box-shadow: 0 0 1px #EEC068;} .xheDialog .xheUpload{position: relative;display:inline-block;width:164px;} .xheDialog .xheUpload .xheBtn{position: absolute;top: 0px;left: 114px;width:50px;z-index: 1000001;padding:0;} .xheDialog .xheUpload .xheFile{cursor:pointer;position: absolute;top: 0px;left: 0px;width:164px;opacity:0;-ms-filter:'alpha(opacity=0)';filter:alpha(opacity=0);z-index: 1000002;} .xheDialog .xheUpload .xheText {position: absolute;width:107px;top: 0px;left: 0px;z-index: 1000003;} .xheModal{ position: fixed;z-index: 1000010;text-align:left;top:50%;left:50%;background:#FFF;border:1px solid #AAA;font-size:12px; _position:absolute;_margin-top:expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px'); } .xheModalTitle{padding:5px;background:#DDD;border-bottom:1px solid #AAA;} .xheModalClose{float:right;width:16px;height:16px;background:url(img/close.gif);cursor:pointer;} .xheModalIfmWait{width:100%;height:100%;background:url(img/waiting.gif) no-repeat 50% 50%;margin:-16 0 0 -16;} .xheModalShadow{ position:fixed;z-index:1000009;top:50%;left:50%;background:#000;opacity:0.2; -ms-filter:'alpha(opacity=20)'; filter:alpha(opacity=20); _position:absolute;_margin-top:expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 5 + 'px'); } .xheModalOverlay{ position: fixed;z-index:1000008;top: 0px;left: 0px;height:100%;width:100%;background-color:#000;opacity:0.2; -ms-filter:'alpha(opacity=20)'; filter:alpha(opacity=20); _position:absolute;_height:expression(Math.max(document.documentElement.clientHeight,document.documentElement.scrollHeight)+'px');_width:expression(Math.max(document.documentElement.clientWidth,document.documentElement.scrollWidth)+'px'); } *html{ background-image:url(about:blank); background-attachment:fixed; } .xheProgress{position:relative;width:280px;margin:auto;border:1px solid #C1C1C1;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;background:url(img/progressbg.gif) #E9E9E9;} .xheProgress span{position:absolute;left:0;top:0;width:100%;text-align:center;line-height:15px;font-size:12px;color:#000;text-shadow: 1px 1px 0 #eee;} .xheProgress div{height:15px;width:1px;background:url(img/progress.gif) #31C135;} .xhe_Fullfix{overflow:hidden;} .xhe_Fullfix body{width:100%;height:100%;} .xhe_Fullscreen{ top:0px;left:0px;position:fixed;z-index:100000;width:100%;height:100%;background:#fff; _position:absolute;_top:expression((document.compatMode?documentElement.scrollTop:document.body.scrollTop)+'px');_width:expression((document.compatMode?documentElement.offsetWidth:document.body.offsetWidth) + 'px');_height: expression((document.compatMode?documentElement.offsetHeight:document.body.offsetHeight) + 'px'); } .xheHideArea{position:absolute;top:-1000px;left:-1000px;visibility:hidden;}
zyroot
trunk/admin/dwz1.4.5/xheditor/xheditor_skin/o2007silver/ui.css
CSS
art
10,300
html{height:100%;background-color:#FFFFFF;} body,td,th{font-family:Arial,Helvetica,sans-serif;font-size:12px;} body{height:100%;*height:90%;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;} .xhe-border{border:1px dotted #d3d3d3;} .xhe-border th,.xhe-border td{border:1px dotted #d3d3d3;} .editMode{margin:0px;padding:5px;overflow-y:auto;word-break:break-word;word-wrap:break-word;} .editMode img:-moz-broken {-moz-force-broken-image-icon:1;height:24px;width:24px;} .editMode embed{display:inline-block;border:1px dashed #FF4E4E;} .editMode embed[type="application/x-shockwave-flash"]{background:url(img/flash.gif) center center no-repeat;} .editMode embed[type="application/x-mplayer2"]{background:url(img/wmp.gif) center center no-repeat;} .editMode .xhe-paste{position:absolute;left:-1000px;overflow:hidden;width:1px;height:1px;} .editMode .xhe-anchor{display:inline-block;background: url(img/anchor.gif) no-repeat;border: 1px dotted #0000FF;width:16px;height:15px;overflow:hidden;} .sourceMode{margin:0px;padding:0px;overflow:hidden;height:100%;} .sourceMode textarea{*position:absolute;border:0px;margin:0px;padding:0px;width:100%;height:100%;overflow-y:auto;font-family:'Courier New',Courier,monospace !important;font-size:10pt;resize:none;outline:0;} .previewMode{margin:5px;padding:0px;} .showBlocktag p,.showBlocktag h1,.showBlocktag h2,.showBlocktag h3,.showBlocktag h4,.showBlocktag h5,.showBlocktag h6,.showBlocktag pre,.showBlocktag address,.showBlocktag div{background:none no-repeat scroll right top;border:1px dotted gray;} .showBlocktag p{background-image:url(img/tag-p.gif);} .showBlocktag h1{background-image:url(img/tag-h1.gif);} .showBlocktag h2{background-image:url(img/tag-h2.gif);} .showBlocktag h3{background-image:url(img/tag-h3.gif);} .showBlocktag h4{background-image:url(img/tag-h4.gif);} .showBlocktag h5{background-image:url(img/tag-h5.gif);} .showBlocktag h6{background-image:url(img/tag-h6.gif);} .showBlocktag pre{background-image:url(img/tag-pre.gif);} .showBlocktag address{background-image:url(img/tag-address.gif);} .showBlocktag div{background-image:url(img/tag-div.gif);}
zyroot
trunk/admin/dwz1.4.5/xheditor/xheditor_skin/o2007silver/iframe.css
CSS
art
2,176
.xhe_default table, .xhe_default tr, .xhe_default td, .xhe_default iframe {border:0; margin:0; padding:0; background:transparent;text-decoration:none; font-weight:normal; color:#000} .xhe_default table.xheLayout {display:inline-table;background:#F0F0EE; border:1px solid #C5C5C5;width:100%;height:100%;} .xhe_default td.xheTool{padding:0px 3px;border-bottom:1px solid #C5C5C5;} .xhe_default td.xheTool span{float:left;margin:2px 0px;} .xhe_default td.xheTool br{clear:left;} .xhe_default span.xheGStart{display:none;} .xhe_default span.xheGEnd{display:none;} .xhe_default span.xheSeparator{display:block;height:22px;width:4px;margin:2px 2px !important;background:url(img/icons.gif) no-repeat -660px 0;} .xhe_default a.xheButton{display:inline-block;margin:1px;border:0px;cursor:pointer;text-decoration:none;} .xhe_default a.xheButton span{opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30);} .xhe_default a.xheEnabled span{opacity:1; -ms-filter:'alpha(opacity=100)'; filter:alpha(opacity=100);} .xhe_default a.xheEnabled:hover {margin:0px;border:1px solid #999;background:#fff;} .xhe_default a.xheActive{margin:0px;border:1px solid #999; background:#fff;} .xhe_default a.xheButton span{display:block;margin:0px;height:20px;width:20px;overflow:hidden;} .xhe_default span.xheIcon{background:url(img/icons.gif) no-repeat 20px 20px} .xhe_default span.xheBtnCut {background-position:0 0} .xhe_default span.xheBtnCopy {background-position:-20px 0} .xhe_default span.xheBtnPaste {background-position:-40px 0} .xhe_default span.xheBtnPastetext {background-position:-60px 0} .xhe_default span.xheBtnBlocktag {background-position:-80px 0} .xhe_default span.xheBtnFontface {background-position:-100px 0} .xhe_default span.xheBtnFontSize {background-position:-120px 0} .xhe_default span.xheBtnBold {background-position:-140px 0} .xhe_default span.xheBtnItalic {background-position:-160px 0} .xhe_default span.xheBtnUnderline {background-position:-180px 0} .xhe_default span.xheBtnStrikethrough {background-position:-200px 0} .xhe_default span.xheBtnFontColor {background-position:-220px 0} .xhe_default span.xheBtnBackColor {background-position:-240px 0} .xhe_default span.xheBtnSelectAll {background-position:-260px 0} .xhe_default span.xheBtnRemoveformat {background-position:-280px 0} .xhe_default span.xheBtnAlign {background-position:-300px 0} .xhe_default span.xheBtnList {background-position:-320px 0} .xhe_default span.xheBtnOutdent {background-position:-340px 0} .xhe_default span.xheBtnIndent {background-position:-360px 0} .xhe_default span.xheBtnLink {background-position:-380px 0} .xhe_default span.xheBtnUnlink {background-position:-400px 0} .xhe_default span.xheBtnAnchor {background-position:-420px 0} .xhe_default span.xheBtnImg {background-position:-440px 0} .xhe_default span.xheBtnFlash {background-position:-460px 0} .xhe_default span.xheBtnMedia {background-position:-480px 0} .xhe_default span.xheBtnHr {background-position:-500px 0} .xhe_default span.xheBtnEmot {background-position:-520px 0} .xhe_default span.xheBtnTable {background-position:-540px 0} .xhe_default span.xheBtnSource {background-position:-560px 0} .xhe_default span.xheBtnPreview {background-position:-580px 0} .xhe_default span.xheBtnPrint {background-position:-600px 0} .xhe_default span.xheBtnFullscreen {background-position:-620px 0} .xhe_default span.xheBtnAbout {background-position:-640px 0} .xhe_default .xheIframeArea{height:100%;} .xhe_default iframe {display:block;background:#fff;width:100%;height:100%;} #xheCntLine{display:none;position:absolute;z-index:1000001;background:#fff;height:1px;font-size:0;} #xhePanel{display:none;position:absolute;z-index:1000000;border:#999 1px solid;background:#fff;text-align:left;} #xheShadow{display:none;position:absolute;z-index:999999;background:#000;opacity:0.2; -ms-filter:'alpha(opacity=20)'; filter:alpha(opacity=20);} .xheFixCancel{position:absolute;z-index:999998;background-color:#FFF;opacity:0; -ms-filter:'alpha(opacity=0)'; filter:alpha(opacity=0);} .xheMenu{padding:2px;overflow-x:hidden;overflow-y:auto;max-height:230px;} .xheMenu .xheMenuSeparator{margin:3px 0;border-top:1px solid #D8D8D8;} .xheMenu a{display:block;padding:3px 20px 3px 3px;line-height:normal;font-size:12px;color:#000;text-decoration:none;white-space:nowrap;} .xheMenu a:hover{background:#e5e5e5;text-decoration:none;color:#000;} .xheMenu p,.xheMenu h1,.xheMenu h2,.xheMenu h3,.xheMenu h4,.xheMenu h5,.xheMenu h6,.xheMenu pre,.xheMenu address,.xheMenu div{margin:0} .xheEmot div{padding:5px;overflow-x:hidden;overflow-y:auto;} .xheEmot div a{display:inline-block;margin:3px;padding:3px;overflow:hidden;background-repeat:no-repeat;background-position:center;text-decoration:none;} .xheEmot div a:hover{border:1px solid #999;padding:2px;} .xheEmot ul{border-top:1px solid #999;list-style:none;padding:0 10px;margin:0;font-size:12px;} .xheEmot li{float:left;margin:0 2px 5px 0;} .xheEmot li a{background:#fff;display:block;padding:0 8px;text-decoration:none;color:#000;line-height:20px;} .xheEmot li a:hover{text-decoration:underline;} .xheEmot li.cur{border:1px solid #999;border-top:none;position:relative;bottom:1px;} .xheEmot li.cur a{cursor:text;padding-top:1px;} .xheEmot li.cur a:hover{text-decoration:none;} .xheColor{padding:5px;} .xheColor a{display:inline-block;margin:1px;border:#999 1px solid;width:17px;height:9px;font-size:0;} .xheColor a:hover{border:#000 1px solid;} .xheColor a img{display:none;} .xheDialog{padding:10px;font-size:12px;font-family:monospace;} .xheDialog a{text-decoration:underline;color:#00f;} .xheDialog a:hover{text-decoration:underline;color:#00f} .xheDialog div{padding:2px 0;} .xheDialog input{ margin:0;border-width:1px;border-style:solid;font-size:12px; *border-width:expression((type!="checkbox")?'1px':0);*padding:expression((type=="text")?'1px':'auto');*width:expression((type=="text")?'160px':'auto');*border-color:expression((type=="text")?'#ABADB3':'#fff #888 #888 #fff');*background:expression((type=="button")?'#F0F0F0':'#FFFFFF');*cursor:expression((type=="button")?'pointer':'');*font-size:expression((type=="button")?'13px':'12px'); } .xheDialog textarea{font-size:12px;resize:none;border:1px solid #ccc;} .xheDialog input[type=text]{padding:1px;width:160px;border-color:#ABADB3;} .xheDialog input[type=button]{margin:0;border-color:#fff #888 #888 #fff;background:#F0F0F0;cursor:pointer;font-size:13px;} .xheDialog input[type=file]{font-size:13px;} .xheDialog input[type=checkbox]{border:0;} .xheDialog select{margin:0;border:1px #ABADB3 solid;padding:1px;} .xheDialog input,.xheDialog select,.xheDialog textarea{border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;} .xheDialog input:focus,.xheDialog select:focus,.xheDialog textarea:focus{outline: 0;border-color: #EEC068;-webkit-box-shadow: 0 0 1px #EEC068;-moz-box-shadow: 0 0 1px #EEC068;box-shadow: 0 0 1px #EEC068;} .xheDialog .xheUpload{position: relative;display:inline-block;width:164px;} .xheDialog .xheUpload .xheBtn{position: absolute;top: 0px;left: 114px;width:50px;z-index: 1000001;padding:0;} .xheDialog .xheUpload .xheFile{cursor:pointer;position: absolute;top: 0px;left: 0px;width:164px;opacity:0;-ms-filter:'alpha(opacity=0)';filter:alpha(opacity=0);z-index: 1000002;} .xheDialog .xheUpload .xheText {position: absolute;width:107px;top: 0px;left: 0px;z-index: 1000003;} .xheModal{ position: fixed;z-index: 1000010;text-align:left;top:50%;left:50%;background:#FFF;border:1px solid #BBB;font-size:12px; _position:absolute;_margin-top:expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px'); } .xheModalTitle{padding:5px;background:#F0F0EE;border-bottom:1px solid #BBB;} .xheModalClose{float:right;width:16px;height:16px;background:url(img/close.gif);cursor:pointer;} .xheModalIfmWait{width:100%;height:100%;background:url(img/waiting.gif) no-repeat 50% 50%;margin:-16 0 0 -16;} .xheModalShadow{ position:fixed;z-index:1000009;top:50%;left:50%;background:#000;opacity:0.2; -ms-filter:'alpha(opacity=20)'; filter:alpha(opacity=20); _position:absolute;_margin-top:expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 5 + 'px'); } .xheModalOverlay{ position: fixed;z-index:1000008;top: 0px;left: 0px;height:100%;width:100%;background-color:#000;opacity:0.2; -ms-filter:'alpha(opacity=20)'; filter:alpha(opacity=20); _position:absolute;_height:expression(Math.max(document.documentElement.clientHeight,document.documentElement.scrollHeight)+'px');_width:expression(Math.max(document.documentElement.clientWidth,document.documentElement.scrollWidth)+'px'); } *html{ background-image:url(about:blank); background-attachment:fixed; } .xheProgress{position:relative;width:280px;margin:auto;border:1px solid #C1C1C1;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;background:url(img/progressbg.gif) #E9E9E9;} .xheProgress span{position:absolute;left:0;top:0;width:100%;text-align:center;line-height:15px;font-size:12px;color:#222;text-shadow: 1px 1px 0 #eee;} .xheProgress div{height:15px;width:1px;background:url(img/progress.gif) #31C135;} .xhe_Fullfix{overflow:hidden;} .xhe_Fullfix body{width:100%;height:100%;} .xhe_Fullscreen{ top:0px;left:0px;position:fixed;z-index:100000;width:100%;height:100%;background:#fff; _position:absolute;_top:expression((document.compatMode?documentElement.scrollTop:document.body.scrollTop)+'px');_width:expression((document.compatMode?documentElement.offsetWidth:document.body.offsetWidth) + 'px');_height:expression((document.compatMode?documentElement.offsetHeight:document.body.offsetHeight) + 'px'); } .xheHideArea{position:absolute;top:-1000px;left:-1000px;visibility:hidden;}
zyroot
trunk/admin/dwz1.4.5/xheditor/xheditor_skin/default/ui.css
CSS
art
9,983
html{height:100%;background-color:#FFFFFF;} body,td,th{font-family:Arial,Helvetica,sans-serif;font-size:12px;} body{height:100%;*height:90%;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;} .xhe-border{border:1px dotted #d3d3d3;} .xhe-border th,.xhe-border td{border:1px dotted #d3d3d3;} .wordImage{border:1px dotted #c00;background:url(img/wordimg.gif) #ffc center center no-repeat;} .editMode{margin:0px;padding:5px;overflow-y:auto;word-break:break-word;word-wrap:break-word;} .editMode img:-moz-broken {-moz-force-broken-image-icon:1;height:24px;width:24px;} .editMode embed{display:inline-block;border:1px dotted #c00;} .editMode embed[type="application/x-shockwave-flash"]{background:url(img/flash.gif) #ffc center center no-repeat;} .editMode embed[type="application/x-mplayer2"]{background:url(img/wmp.gif) center center no-repeat;} .editMode .xhe-paste{position:absolute;left:-1000px;overflow:hidden;width:1px;height:1px;} .editMode .xhe-anchor{display:inline-block;background: url(img/anchor.gif) no-repeat;border: 1px dotted #0000FF;width:16px;height:15px;overflow:hidden;} .sourceMode{margin:0px;padding:0px;overflow:hidden;height:100%;} .sourceMode textarea{*position:absolute;border:0px;margin:0px;padding:0px;width:100%;height:100%;overflow:auto;font-family:'Courier New',Courier,monospace !important;font-size:10pt;resize:none;outline:0;} .previewMode{margin:5px;padding:0px;} .showBlocktag p,.showBlocktag h1,.showBlocktag h2,.showBlocktag h3,.showBlocktag h4,.showBlocktag h5,.showBlocktag h6,.showBlocktag pre,.showBlocktag address,.showBlocktag div{background:none no-repeat scroll right top;border:1px dotted gray;} .showBlocktag p{background-image:url(img/tag-p.gif);} .showBlocktag h1{background-image:url(img/tag-h1.gif);} .showBlocktag h2{background-image:url(img/tag-h2.gif);} .showBlocktag h3{background-image:url(img/tag-h3.gif);} .showBlocktag h4{background-image:url(img/tag-h4.gif);} .showBlocktag h5{background-image:url(img/tag-h5.gif);} .showBlocktag h6{background-image:url(img/tag-h6.gif);} .showBlocktag pre{background-image:url(img/tag-pre.gif);} .showBlocktag address{background-image:url(img/tag-address.gif);} .showBlocktag div{background-image:url(img/tag-div.gif);}
zyroot
trunk/admin/dwz1.4.5/xheditor/xheditor_skin/default/iframe.css
CSS
art
2,277
.xhe_vista table, .xhe_vista tr, .xhe_vista td, .xhe_vista iframe {border:0; margin:0; padding:0; background:transparent;text-decoration:none; font-weight:normal; color:#000} .xhe_vista table.xheLayout {display:inline-table;background:#E0E8F5; border:1px solid #99BBE8;width:100%;height:100%;} .xhe_vista td.xheTool {padding:1px 3px;border-bottom:1px solid #99BBE8;} .xhe_vista td.xheTool span{float:left;margin:2px 0px;} .xhe_vista td.xheTool br{clear:left;} .xhe_vista span.xheGStart{display:block;width:4px;height:22px;background:url(img/buttonbg.gif) -22px 0;} .xhe_vista span.xheGEnd{display:block;width:4px;height:22px;background:url(img/buttonbg.gif) -26px 0;} .xhe_vista span.xheSeparator{display:block;height:22px;width:4px;} .xhe_vista a.xheButton{display:inline-block;padding:1px;border:0px;background:url(img/buttonbg.gif);cursor:pointer;text-decoration:none;} .xhe_vista a.xheButton span{opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30);} .xhe_vista a.xheEnabled span{opacity:1; -ms-filter:'alpha(opacity=100)'; filter:alpha(opacity=100);} .xhe_vista a.xheEnabled:hover {background-color:#B2BBD0; background-position:0 -22px} .xhe_vista a.xheActive{background-color:#B2BBD0; background-position:0 -44px !important;} .xhe_vista a.xheButton span{display:block;margin:0px;height:20px;width:20px;overflow:hidden;} .xhe_vista span.xheIcon{background:url(img/icons.gif) no-repeat 20px 20px} .xhe_vista span.xheBtnCut {background-position:0 0} .xhe_vista span.xheBtnCopy {background-position:-20px 0} .xhe_vista span.xheBtnPaste {background-position:-40px 0} .xhe_vista span.xheBtnPastetext {background-position:-60px 0} .xhe_vista span.xheBtnBlocktag {background-position:-80px 0} .xhe_vista span.xheBtnFontface {background-position:-100px 0} .xhe_vista span.xheBtnFontSize {background-position:-120px 0} .xhe_vista span.xheBtnBold {background-position:-140px 0} .xhe_vista span.xheBtnItalic {background-position:-160px 0} .xhe_vista span.xheBtnUnderline {background-position:-180px 0} .xhe_vista span.xheBtnStrikethrough {background-position:-200px 0} .xhe_vista span.xheBtnFontColor {background-position:-220px 0} .xhe_vista span.xheBtnBackColor {background-position:-240px 0} .xhe_vista span.xheBtnSelectAll {background-position:-260px 0} .xhe_vista span.xheBtnRemoveformat {background-position:-280px 0} .xhe_vista span.xheBtnAlign {background-position:-300px 0} .xhe_vista span.xheBtnList {background-position:-320px 0} .xhe_vista span.xheBtnOutdent {background-position:-340px 0} .xhe_vista span.xheBtnIndent {background-position:-360px 0} .xhe_vista span.xheBtnLink {background-position:-380px 0} .xhe_vista span.xheBtnUnlink {background-position:-400px 0} .xhe_vista span.xheBtnAnchor {background-position:-420px 0} .xhe_vista span.xheBtnImg {background-position:-440px 0} .xhe_vista span.xheBtnFlash {background-position:-460px 0} .xhe_vista span.xheBtnMedia {background-position:-480px 0} .xhe_vista span.xheBtnHr {background-position:-500px 0} .xhe_vista span.xheBtnEmot {background-position:-520px 0} .xhe_vista span.xheBtnTable {background-position:-540px 0} .xhe_vista span.xheBtnSource {background-position:-560px 0} .xhe_vista span.xheBtnPreview {background-position:-580px 0} .xhe_vista span.xheBtnPrint {background-position:-600px 0} .xhe_vista span.xheBtnFullscreen {background-position:-620px 0} .xhe_vista span.xheBtnAbout {background-position:-640px 0} .xhe_vista .xheIframeArea{height:100%;} .xhe_vista iframe {display:block;background:#fff;width:100%;height:100%;} #xheCntLine{display:none;position:absolute;z-index:1000001;background:#fff;height:1px;font-size:0;} #xhePanel{display:none;position:absolute;z-index:1000000;border:#99BBE8 1px solid;background:#FDFEFF;text-align:left;} #xheShadow{display:none;position:absolute;z-index:999999;background:#000;opacity:0.2; -ms-filter:'alpha(opacity=20)'; filter:alpha(opacity=20);} .xheFixCancel{position:absolute;z-index:999998;background-color:#FFF;opacity:0; -ms-filter:'alpha(opacity=0)'; filter:alpha(opacity=0);} .xheMenu{padding:2px;overflow-x:hidden;overflow-y:auto;max-height:230px;} .xheMenu .xheMenuSeparator{margin:3px 0;border-top:1px solid #D8D8D8;} .xheMenu a{display:block;padding:3px 20px 3px 3px;line-height:normal;font-size:12px;color:#000;text-decoration:none;white-space:nowrap;} .xheMenu a:hover{background:#B8CFEE;text-decoration:none;color:#000;} .xheMenu p,.xheMenu h1,.xheMenu h2,.xheMenu h3,.xheMenu h4,.xheMenu h5,.xheMenu h6,.xheMenu pre,.xheMenu address,.xheMenu div{margin:0} .xheEmot div{padding:5px;overflow-x:hidden;overflow-y:auto;} .xheEmot div a{display:inline-block;margin:3px;padding:3px;overflow:hidden;background-repeat:no-repeat;background-position:center;text-decoration:none;} .xheEmot div a:hover{border:1px solid #99BBE8;padding:2px;} .xheEmot ul{border-top:1px solid #99BBE8;list-style:none;padding:0 10px;margin:0;font-size:12px;} .xheEmot li{float:left;margin:0 2px 5px 0;} .xheEmot li a{background:#fff;display:block;padding:0 8px;text-decoration:none;color:#000;line-height:20px;} .xheEmot li a:hover{text-decoration:underline;} .xheEmot li.cur{border:1px solid #99BBE8;border-top:none;position:relative;bottom:1px;} .xheEmot li.cur a{cursor:text;padding-top:1px;} .xheEmot li.cur a:hover{text-decoration:none;} .xheColor{padding:5px;} .xheColor a{display:inline-block;margin:1px;border:#999 1px solid;width:17px;height:9px;font-size:0;} .xheColor a:hover{border:#000 1px solid;} .xheColor a img{display:none;} .xheDialog{padding:10px;font-size:12px;font-family:monospace;} .xheDialog a{text-decoration:underline;color:#00f;} .xheDialog a:hover{text-decoration:underline;color:#00f} .xheDialog div{padding:2px 0px;} .xheDialog input{ margin:0;border-width:1px;border-style:solid;font-size:12px; *border-width:expression((type!="checkbox")?'1px':0);*padding:expression((type=="text")?'1px':'auto');*width:expression((type=="text")?'160px':'auto');*border-color:expression((type=="text")?'#ABADB3':'#fff #888 #888 #fff');*background:expression((type=="button")?'#F0F0F0':'#FFFFFF');*cursor:expression((type=="button")?'pointer':'');*font-size:expression((type=="button")?'13px':'12px'); } .xheDialog textarea{font-size:12px;resize:none;border:1px solid #ccc;} .xheDialog input[type=text]{padding:1px;width:160px;border-color:#ABADB3;} .xheDialog input[type=button]{margin:0;border-color:#fff #888 #888 #fff;background:#F0F0F0;cursor:pointer;font-size:13px;} .xheDialog input[type=file]{font-size:13px;} .xheDialog input[type=checkbox]{border:0;} .xheDialog select{margin:0;border:1px #ABADB3 solid;} .xheDialog input,.xheDialog select,.xheDialog textarea{border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;} .xheDialog input:focus,.xheDialog select:focus,.xheDialog textarea:focus{outline: 0;border-color: #EEC068;-webkit-box-shadow: 0 0 1px #EEC068;-moz-box-shadow: 0 0 1px #EEC068;box-shadow: 0 0 1px #EEC068;} .xheDialog .xheUpload{position: relative;display:inline-block;width:164px;} .xheDialog .xheUpload .xheBtn{position: absolute;top: 0px;left: 114px;width:50px;z-index: 1000001;padding:0;} .xheDialog .xheUpload .xheFile{cursor:pointer;position: absolute;top: 0px;left: 0px;width:164px;opacity:0;-ms-filter:'alpha(opacity=0)';filter:alpha(opacity=0);z-index: 1000002;} .xheDialog .xheUpload .xheText {position: absolute;width:107px;top: 0px;left: 0px;z-index: 1000003;} .xheModal{ position: fixed;z-index: 1000010;text-align:left;top:50%;left:50%;background:#FFF;border:1px solid #99BBE8;font-size:12px; _position:absolute;_margin-top:expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px'); } .xheModalTitle{padding:3px;line-height:18px;background:url(img/titlebg.gif) repeat-x;border-bottom:1px solid #99BBE8;} .xheModalClose{float:right;width:30px;height:18px;background:url(img/close.gif);cursor:pointer;} .xheModalIfmWait{width:100%;height:100%;background:url(img/waiting.gif) no-repeat 50% 50%;margin:-16 0 0 -16;} .xheModalShadow{ position:fixed;z-index:1000009;top:50%;left:50%;background:#000;opacity:0.2; -ms-filter:'alpha(opacity=20)'; filter:alpha(opacity=20); _position:absolute;_margin-top:expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 5 + 'px'); } .xheModalOverlay{ position: fixed;z-index:1000008;top: 0px;left: 0px;height:100%;width:100%;background-color:#000;opacity:0.2; -ms-filter:'alpha(opacity=20)'; filter:alpha(opacity=20); _position:absolute;_height:expression(Math.max(document.documentElement.clientHeight,document.documentElement.scrollHeight)+'px');_width:expression(Math.max(document.documentElement.clientWidth,document.documentElement.scrollWidth)+'px'); } *html{ background-image:url(about:blank); background-attachment:fixed; } .xheProgress{position:relative;width:280px;margin:auto;border:1px solid #C1C1C1;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;background:url(img/progressbg.gif) #E9E9E9;} .xheProgress span{position:absolute;left:0;top:0;width:100%;text-align:center;line-height:15px;font-size:12px;color:#000;text-shadow: 1px 1px 0 #eee;} .xheProgress div{height:15px;width:1px;background:url(img/progress.gif) #31C135;} .xhe_Fullfix{overflow:hidden;} .xhe_Fullfix body{width:100%;height:100%;} .xhe_Fullscreen{ top:0px;left:0px;position:fixed;z-index:100000;width:100%;height:100%;background:#fff; _position:absolute;_top:expression((document.compatMode?documentElement.scrollTop:document.body.scrollTop)+'px');_width:expression((document.compatMode?documentElement.offsetWidth:document.body.offsetWidth) + 'px');_height:expression((document.compatMode?documentElement.offsetHeight:document.body.offsetHeight) + 'px'); } .xheHideArea{position:absolute;top:-1000px;left:-1000px;visibility:hidden;}
zyroot
trunk/admin/dwz1.4.5/xheditor/xheditor_skin/vista/ui.css
CSS
art
10,033
html{height:100%;background-color:#FFFFFF;} body,td,th{font-family:Arial,Helvetica,sans-serif;font-size:12px;} body{height:100%;*height:90%;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;} .xhe-border{border:1px dotted #d3d3d3;} .xhe-border th,.xhe-border td{border:1px dotted #d3d3d3;} .editMode{margin:0px;padding:5px;overflow-y:auto;word-break:break-word;word-wrap:break-word;} .editMode img:-moz-broken {-moz-force-broken-image-icon:1;height:24px;width:24px;} .editMode embed{display:inline-block;border:1px dashed #FF4E4E;} .editMode embed[type="application/x-shockwave-flash"]{background:url(img/flash.gif) center center no-repeat;} .editMode embed[type="application/x-mplayer2"]{background:url(img/wmp.gif) center center no-repeat;} .editMode .xhe-paste{position:absolute;left:-1000px;overflow:hidden;width:1px;height:1px;} .editMode .xhe-anchor{display:inline-block;background: url(img/anchor.gif) no-repeat;border: 1px dotted #0000FF;width:16px;height:15px;overflow:hidden;} .sourceMode{margin:0px;padding:0px;overflow:hidden;height:100%;} .sourceMode textarea{*position:absolute;border:0px;margin:0px;padding:0px;width:100%;height:100%;overflow-y:auto;font-family:'Courier New',Courier,monospace !important;font-size:10pt;resize:none;outline:0;} .previewMode{margin:5px;padding:0px;} .showBlocktag p,.showBlocktag h1,.showBlocktag h2,.showBlocktag h3,.showBlocktag h4,.showBlocktag h5,.showBlocktag h6,.showBlocktag pre,.showBlocktag address,.showBlocktag div{background:none no-repeat scroll right top;border:1px dotted gray;} .showBlocktag p{background-image:url(img/tag-p.gif);} .showBlocktag h1{background-image:url(img/tag-h1.gif);} .showBlocktag h2{background-image:url(img/tag-h2.gif);} .showBlocktag h3{background-image:url(img/tag-h3.gif);} .showBlocktag h4{background-image:url(img/tag-h4.gif);} .showBlocktag h5{background-image:url(img/tag-h5.gif);} .showBlocktag h6{background-image:url(img/tag-h6.gif);} .showBlocktag pre{background-image:url(img/tag-pre.gif);} .showBlocktag address{background-image:url(img/tag-address.gif);} .showBlocktag div{background-image:url(img/tag-div.gif);}
zyroot
trunk/admin/dwz1.4.5/xheditor/xheditor_skin/vista/iframe.css
CSS
art
2,176
/*! * MultiUpload for xheditor * @requires xhEditor * * @author Yanis.Wang<yanis.wang@gmail.com> * @site http://xheditor.com/ * @licence LGPL(http://www.opensource.org/licenses/lgpl-license.php) * * @Version: 0.9.2 (build 100505) */ var swfu,selQueue=[],selectID,arrMsg=[],allSize=0,uploadSize=0; function removeFile() { var file; if(!selectID)return; for(var i in selQueue) { file=selQueue[i]; if(file.id==selectID) { selQueue.splice(i,1); allSize-=file.size; swfu.cancelUpload(file.id); $('#'+file.id).remove(); selectID=null; break; } } $('#btnClear').hide(); if(selQueue.length==0)$('#controlBtns').hide(); } function startUploadFiles() { if(swfu.getStats().files_queued>0) { $('#controlBtns').hide(); swfu.startUpload(); } else alert('上传前请先添加文件'); } function setFileState(fileid,txt) { $('#'+fileid+'_state').text(txt); } function fileQueued(file)//队列添加成功 { for(var i in selQueue)if(selQueue[i].name==file.name){swfu.cancelUpload(file.id);return false;}//防止同名文件重复添加 if(selQueue.length==0)$('#controlBtns').show(); selQueue.push(file); allSize+=file.size; $('#listBody').append('<tr id="'+file.id+'"><td>'+file.name+'</td><td>'+formatBytes(file.size)+'</td><td id="'+file.id+'_state">就绪</td></tr>'); $('#'+file.id).hover(function(){$(this).addClass('hover');},function(){$(this).removeClass('hover');}) .click(function(){selectID=file.id;$('#listBody tr').removeClass('select');$(this).removeClass('hover').addClass('select');$('#btnClear').show();}) } function fileQueueError(file, errorCode, message)//队列添加失败 { var errorName=''; switch (errorCode) { case SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED: errorName = "只能同时上传 "+this.settings.file_upload_limit+" 个文件"; break; case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT: errorName = "选择的文件超过了当前大小限制:"+this.settings.file_size_limit; break; case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE: errorName = "零大小文件"; break; case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE: errorName = "文件扩展名必需为:"+this.settings.file_types_description+" ("+this.settings.file_types+")"; break; default: errorName = "未知错误"; break; } alert(errorName); } function uploadStart(file)//单文件上传开始 { setFileState(file.id,'上传中…'); } function uploadProgress(file, bytesLoaded, bytesTotal)//单文件上传进度 { var percent=Math.ceil((uploadSize+bytesLoaded)/allSize*100); $('#progressBar span').text(percent+'% ('+formatBytes(uploadSize+bytesLoaded)+' / '+formatBytes(allSize)+')'); $('#progressBar div').css('width',percent+'%'); } function uploadSuccess(file, serverData)//单文件上传成功 { var data=Object; try{eval("data=" + serverData);}catch(ex){}; if(data.err!=undefined&&data.msg!=undefined) { if(!data.err) { uploadSize+=file.size; arrMsg.push(data.msg); setFileState(file.id,'上传成功'); } else { setFileState(file.id,'上传失败'); alert(data.err); } } else setFileState(file.id,'上传失败!'); } function uploadError(file, errorCode, message)//单文件上传错误 { setFileState(file.id,'上传失败!'); } function uploadComplete(file)//文件上传周期结束 { if(swfu.getStats().files_queued>0)swfu.startUpload(); else uploadAllComplete(); } function uploadAllComplete()//全部文件上传成功 { callback(arrMsg); } function formatBytes(bytes) { var s = ['Byte', 'KB', 'MB', 'GB', 'TB', 'PB']; var e = Math.floor(Math.log(bytes)/Math.log(1024)); return (bytes/Math.pow(1024, Math.floor(e))).toFixed(2)+" "+s[e]; }
zyroot
trunk/admin/dwz1.4.5/xheditor/xheditor_plugins/multiupload/multiupload.js
JavaScript
art
3,808
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <meta name="robots" content="noindex, nofollow" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>MultiUpload Demo</title> <link href="multiupload.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="../../jquery/jquery-1.4.4.min.js"></script> <script type="text/javascript" src="swfupload/swfupload.js"></script> <script type="text/javascript" src="multiupload.js"></script> <script type="text/javascript"> $(window).load(pageInit); function pageInit() { var uploadurl='../upload.php',ext='所有文件 (*.*)',size='2 MB',count=5,useget=0,params={}//默认值 uploadurl=getQuery('uploadurl')||uploadurl;ext=getQuery('ext')||ext;size=getQuery('size')||size;count=getQuery('count')||count;useget=getQuery('useget')||useget; var tmpParams=getQuery('params'); if(tmpParams) { try{eval("tmpParams=" + tmpParams);}catch(ex){}; params=$.extend({},params,tmpParams); } ext=ext.match(/([^\(]+?)\s*\(\s*([^\)]+?)\s*\)/i); setTimeout(fixHeight,10); swfu = new SWFUpload({ // Flash组件 flash_url : "swfupload/swfupload.swf", prevent_swf_caching : false,//是否缓存SWF文件 // 服务器端 upload_url: uploadurl, file_post_name : "filedata", post_params: params,//随文件上传一同向上传接收程序提交的Post数据 use_query_string : useget=='1'?true:false,//是否用GET方式发送参数 // 文件设置 file_types : ext[2],//文件格式限制 file_types_description : ext[1],//文件格式描述 file_size_limit : size, // 文件大小限制 file_upload_limit : count,//上传文件总数 file_queue_limit:0,//上传队列总数 custom_settings : { test : "aaa" }, // 事件处理 file_queued_handler : fileQueued,//添加成功 file_queue_error_handler : fileQueueError,//添加失败 upload_start_handler : uploadStart,//上传开始 upload_progress_handler : uploadProgress,//上传进度 upload_error_handler : uploadError,//上传失败 upload_success_handler : uploadSuccess,//上传成功 upload_complete_handler : uploadComplete,//上传结束 // 按钮设置 button_placeholder_id : "divAddFiles", button_width: 69, button_height: 17, button_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT, button_cursor: SWFUpload.CURSOR.HAND, button_image_url : "img/add.gif", button_text: '<span class="theFont">添加文件</span>', button_text_style: ".theFont { font-size: 12px; }", button_text_left_padding: 20, button_text_top_padding: 0, // 调试设置 debug: false }); } function fixHeight(){$('#listArea').css('height',(document.body.clientHeight-56)+'px');} function getQuery(item){var svalue = location.search.match(new RegExp('[\?\&]' + item + '=([^\&]*)(\&?)','i'));return svalue?decodeURIComponent(svalue[1]):'';} //----------------跨域支持代码开始(非跨域环境请删除这段代码)---------------- var JSON = JSON || {}; JSON.stringify = JSON.stringify || function (obj) { var t = typeof (obj); if (t != "object" || obj === null) { if (t == "string")obj = '"'+obj+'"'; return String(obj); } else { var n, v, json = [], arr = (obj && obj.constructor == Array); for (n in obj) { v = obj[n]; t = typeof(v); if (t == "string") v = '"'+v+'"'; else if (t == "object" && v !== null) v = JSON.stringify(v); json.push((arr ? "" : '"' + n + '":') + String(v)); } return (arr ? "[" : "{") + String(json) + (arr ? "]" : "}"); } }; var callback= callback || function(v){ v=JSON.stringify(v); window.name=escape(v); window.location='http://'+location.search.match(/[\?&]parenthost=(.*)(&|$)/i)[1]+'/xheditorproxy.html';//这个文件最好是一个0字节文件,如果无此文件也会正常工作 } //----------------跨域支持代码结束---------------- </script> </head> <body> <div id="upload"> <div id="buttonArea"> <div id="controlBtns" style="display:none;"><a href="javascript:void(0);" id="btnClear" onclick="removeFile();" class="btn" style="display:none;"><span><img src="img/clear.gif" /> 删除文件</span></a> <a href="javascript:void(0);" id="btnStart" onclick="startUploadFiles();" class="btn"><span><img src="img/start.gif" /> 开始上传</span></a></div> <a href="javascript:void(0);" id="addFiles" class="btn"><span><div id="divAddFiles">添加文件</div></span></a> </div> <div id="listArea"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <thead id="listTitle"><tr><td width="53%">文件名</td><td width="25%">大小</td><td width="22%">状态</td></tr></thead> <tbody id="listBody"> </tbody> </table> </div> <div id="progressArea"> <div id="progressBar"><span>0%</span><div id="progress" style="width:1px;"></div></div> </div> </div> </body> </html>
zyroot
trunk/admin/dwz1.4.5/xheditor/xheditor_plugins/multiupload/multiupload.html
HTML
art
5,042
html,body{ font-size:12px; padding:0px;margin:0; overflow:hidden; width:100%;height:100%; } #buttonArea{ background:url(img/bg1.gif); border-top:1px solid #F0F5FA; border-bottom:1px solid #99BBE8; padding:3px; } #controlBtns{ float:right; } .btn{ display:inline-block; color:#000; text-decoration:none; padding-right:3px; cursor:pointer; } .btn span{ display:inline-block; height:17px; line-height:17px; padding:2px; } .btn img{border:0;vertical-align:text-bottom;} .btn:hover{background:url(img/btnbgr.gif) top right;} .btn:hover span{background:url(img/btnbg.gif);} #listArea{ overflow-x:hidden; overflow-y:auto; } #listTitle tr{background:url(img/bg2.gif);} #listTitle td{padding:5px;border-top:1px solid #F0F5FA;border-left:1px solid #fff;border-right:1px solid #ccc;border-bottom:1px solid #D0D0D0;} #listBody tr{cursor:pointer;} #listBody .hover{background:#F0F0F0;} #listBody .select{background:#DFE8F6;} #listBody td{padding:5px;border-bottom:1px solid #EDEDED;} #progressArea{ background:#D4E1F2; border-top:1px solid #99BBE8; padding:3px; } #progressBar{ position: relative; border:1px solid #6593CF; padding:1px; } #progress{ height:16px; background:#8FB5E8 url(img/progressbg.gif); } #progressBar span{ position: absolute; text-align: center; width:100%;line-height:16px; color:#396095; }
zyroot
trunk/admin/dwz1.4.5/xheditor/xheditor_plugins/multiupload/multiupload.css
CSS
art
1,392
<h2 class="contentTitle">面板</h2> <div class="pageContent sortDrag" selector="h1" layoutH="42"> <div class="panel" defH="150"> <h1>不可折叠面板1</h1> <div> <table class="list" width="98%"> <thead> <tr> <th width="80">序号</th> <th>姓名</th> <th>性别</th> </tr> </thead> <tbody> <tr> <td>1</td> <td>张三</td> <td>男</td> </tr> <tr> <td>2</td> <td>李四</td> <td>女</td> </tr> <tr> <td>1</td> <td>张三</td> <td>男</td> </tr> <tr> <td>2</td> <td>李四</td> <td>女</td> </tr> <tr> <td>1</td> <td>张三</td> <td>男</td> </tr> <tr> <td>2</td> <td>李四</td> <td>女</td> </tr> </tbody> </table> </div> </div> <div class="panel close collapse" defH="150"> <h1>可折叠默认关闭面板</h1> <div> <p>内容</p> <p>内容</p> <p>内容</p> </div> </div> <div class="panel collapse" minH="100" defH="150"> <h1>可折叠默认打开面板</h1> <div> <p>内容</p> <p>内容</p> <p>内容</p> </div> </div> </div>
zyroot
trunk/admin/dwz1.4.5/w_panel.html
HTML
art
1,271
<h2 class="contentTitle">表单验证</h2> <div class="pageContent"> <form method="post" action="demo/common/ajaxDone.html" class="pageForm required-validate" onsubmit="return validateCallback(this)"> <div class="pageFormContent nowrap" layoutH="97"> <dl> <dt>必填:</dt> <dd> <input type="text" name="name" maxlength="20" class="required" /> <span class="info">class="required"</span> </dd> </dl> <dl> <dt>必填+邮箱:</dt> <dd> <input type="text" name="email" class="required email" alt="请输入您的电子邮件"/> <span class="info">class="required email"</span> </dd> </dl> <dl> <dt>电话:</dt> <dd> <input type="text" name="phone" class="phone" alt="请输入您的电话"/> <span class="info">class="phone"</span> </dd> </dl> <dl> <dt>密码:</dt> <dd> <input id="w_validation_pwd" type="password" name="password" class="required alphanumeric" minlength="6" maxlength="20" alt="字母、数字、下划线 6-20位"/> <span class="info">class="required alphanumeric" minlength="6" maxlength="20"</span> </dd> </dl> <dl> <dt>确认密码:</dt> <dd> <input type="password" name="password" class="required" equalto="#w_validation_pwd"/> <span class="info">class="required" equalto="#xxxId"</span> </dd> </dl> <dl> <dt>整数:</dt> <dd> <input type="text" name="digits" class="digits" /> <span class="info">class="digits"</span> </dd> </dl> <dl> <dt>浮点数:</dt> <dd> <input type="text" name="number" class="number" /> <span class="info">class="number"</span> </dd> </dl> <dl> <dt>最小值:</dt> <dd> <input type="text" name="min" min="1"/> <span class="info">min="1"</span> </dd> </dl> <dl> <dt>最大值:</dt> <dd> <input type="text" name="max" max="10"/> <span class="info">max="10"</span> </dd> </dl> <dl> <dt>最小值-最大值:</dt> <dd> <input type="text" name="min_max" min="1" max="10"/> <span class="info">min="1" max="10"</span> </dd> </dl> <dl> <dt>最小长度:</dt> <dd> <input type="text" name="minlength_maxlength" minlength="6" /> <span class="info">min="6"</span> </dd> </dl> <dl> <dt>最大长度:</dt> <dd> <input type="text" name="minlength_maxlength" maxlength="10"/> <span class="info">max="10"</span> </dd> </dl> <dl> <dt>最小长度-最大长度:</dt> <dd> <input type="text" name="minlength_maxlength" minlength="6" maxlength="20"/> <span class="info">minlength="6" maxlength="20"</span> </dd> </dl> <dl> <dt>信用卡:</dt> <dd> <input type="text" name="creditcard" class="creditcard" /> <span class="info">class="creditcard"</span> </dd> </dl> <dl> <dt>字母、数字、下划线:</dt> <dd> <input type="text" name="alphanumeric" class="alphanumeric" /> <span class="info">class="alphanumeric"</span> </dd> </dl> <dl> <dt>字母:</dt> <dd> <input type="text" name="lettersonly" class="lettersonly" /> <span class="info">class="lettersonly"</span> </dd> </dl> <dl> <dt>网址:</dt> <dd> <input type="text" name="url" class="url" /> <span class="info">class="url"</span> </dd> </dl> <dl> <dt>remote:</dt> <dd> <input type="text" name="remote" remote="validate_remote.html"/> <span class="info">唯一性验证input添加属性:remote="xxxUrl"</span> </dd> </dl> <div class="divider"></div> <p>自定义扩展请参照:dwz.validate.method.js</p> <p>错误提示信息国际化请参照:dwz.regional.zh.js</p> </div> <div class="formBar"> <ul> <li><div class="buttonActive"><div class="buttonContent"><button type="submit">提交</button></div></div></li> <li><div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div></li> </ul> </div> </form> </div>
zyroot
trunk/admin/dwz1.4.5/w_validation.html
HTML
art
4,284
/*! jQuery Validation Plugin - v1.10.0 - 9/7/2012 * https://github.com/jzaefferer/jquery-validation * Copyright (c) 2012 Jörn Zaefferer; Licensed MIT, GPL */ /*! * jQuery Validation Plugin 1.10.0 * * http://bassistance.de/jquery-plugins/jquery-plugin-validation/ * http://docs.jquery.com/Plugins/Validation * * Copyright (c) 2006 - 2011 Jörn Zaefferer * * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html */ (function() { function stripHtml(value) { // remove html tags and space chars return value.replace(/<.[^<>]*?>/g, ' ').replace(/&nbsp;|&#160;/gi, ' ') // remove punctuation .replace(/[.(),;:!?%#$'"_+=\/-]*/g,''); } jQuery.validator.addMethod("maxWords", function(value, element, params) { return this.optional(element) || stripHtml(value).match(/\b\w+\b/g).length <= params; }, jQuery.validator.format("Please enter {0} words or less.")); jQuery.validator.addMethod("minWords", function(value, element, params) { return this.optional(element) || stripHtml(value).match(/\b\w+\b/g).length >= params; }, jQuery.validator.format("Please enter at least {0} words.")); jQuery.validator.addMethod("rangeWords", function(value, element, params) { var valueStripped = stripHtml(value); var regex = /\b\w+\b/g; return this.optional(element) || valueStripped.match(regex).length >= params[0] && valueStripped.match(regex).length <= params[1]; }, jQuery.validator.format("Please enter between {0} and {1} words.")); })(); jQuery.validator.addMethod("letterswithbasicpunc", function(value, element) { return this.optional(element) || /^[a-z\-.,()'\"\s]+$/i.test(value); }, "Letters or punctuation only please"); jQuery.validator.addMethod("alphanumeric", function(value, element) { return this.optional(element) || /^\w+$/i.test(value); }, "Letters, numbers, and underscores only please"); jQuery.validator.addMethod("lettersonly", function(value, element) { return this.optional(element) || /^[a-z]+$/i.test(value); }, "Letters only please"); jQuery.validator.addMethod("nowhitespace", function(value, element) { return this.optional(element) || /^\S+$/i.test(value); }, "No white space please"); jQuery.validator.addMethod("ziprange", function(value, element) { return this.optional(element) || /^90[2-5]\d\{2\}-\d{4}$/.test(value); }, "Your ZIP-code must be in the range 902xx-xxxx to 905-xx-xxxx"); jQuery.validator.addMethod("zipcodeUS", function(value, element) { return this.optional(element) || /\d{5}-\d{4}$|^\d{5}$/.test(value) }, "The specified US ZIP Code is invalid"); jQuery.validator.addMethod("integer", function(value, element) { return this.optional(element) || /^-?\d+$/.test(value); }, "A positive or negative non-decimal number please"); /** * Return true, if the value is a valid vehicle identification number (VIN). * * Works with all kind of text inputs. * * @example <input type="text" size="20" name="VehicleID" class="{required:true,vinUS:true}" /> * @desc Declares a required input element whose value must be a valid vehicle identification number. * * @name jQuery.validator.methods.vinUS * @type Boolean * @cat Plugins/Validate/Methods */ jQuery.validator.addMethod("vinUS", function(v) { if (v.length != 17) { return false; } var i, n, d, f, cd, cdv; var LL = ["A","B","C","D","E","F","G","H","J","K","L","M","N","P","R","S","T","U","V","W","X","Y","Z"]; var VL = [1,2,3,4,5,6,7,8,1,2,3,4,5,7,9,2,3,4,5,6,7,8,9]; var FL = [8,7,6,5,4,3,2,10,0,9,8,7,6,5,4,3,2]; var rs = 0; for(i = 0; i < 17; i++){ f = FL[i]; d = v.slice(i,i+1); if (i == 8) { cdv = d; } if (!isNaN(d)) { d *= f; } else { for (n = 0; n < LL.length; n++) { if (d.toUpperCase() === LL[n]) { d = VL[n]; d *= f; if (isNaN(cdv) && n == 8) { cdv = LL[n]; } break; } } } rs += d; } cd = rs % 11; if (cd == 10) { cd = "X"; } if (cd == cdv) { return true; } return false; }, "The specified vehicle identification number (VIN) is invalid."); /** * Return true, if the value is a valid date, also making this formal check dd/mm/yyyy. * * @example jQuery.validator.methods.date("01/01/1900") * @result true * * @example jQuery.validator.methods.date("01/13/1990") * @result false * * @example jQuery.validator.methods.date("01.01.1900") * @result false * * @example <input name="pippo" class="{dateITA:true}" /> * @desc Declares an optional input element whose value must be a valid date. * * @name jQuery.validator.methods.dateITA * @type Boolean * @cat Plugins/Validate/Methods */ jQuery.validator.addMethod("dateITA", function(value, element) { var check = false; var re = /^\d{1,2}\/\d{1,2}\/\d{4}$/; if( re.test(value)){ var adata = value.split('/'); var gg = parseInt(adata[0],10); var mm = parseInt(adata[1],10); var aaaa = parseInt(adata[2],10); var xdata = new Date(aaaa,mm-1,gg); if ( ( xdata.getFullYear() == aaaa ) && ( xdata.getMonth () == mm - 1 ) && ( xdata.getDate() == gg ) ) check = true; else check = false; } else check = false; return this.optional(element) || check; }, "Please enter a correct date"); jQuery.validator.addMethod("dateNL", function(value, element) { return this.optional(element) || /^\d\d?[\.\/-]\d\d?[\.\/-]\d\d\d?\d?$/.test(value); }, "Vul hier een geldige datum in."); jQuery.validator.addMethod("time", function(value, element) { return this.optional(element) || /^([0-1]\d|2[0-3]):([0-5]\d)$/.test(value); }, "Please enter a valid time, between 00:00 and 23:59"); jQuery.validator.addMethod("time12h", function(value, element) { return this.optional(element) || /^((0?[1-9]|1[012])(:[0-5]\d){0,2}(\ [AP]M))$/i.test(value); }, "Please enter a valid time, between 00:00 am and 12:00 pm"); /** * matches US phone number format * * where the area code may not start with 1 and the prefix may not start with 1 * allows '-' or ' ' as a separator and allows parens around area code * some people may want to put a '1' in front of their number * * 1(212)-999-2345 or * 212 999 2344 or * 212-999-0983 * * but not * 111-123-5434 * and not * 212 123 4567 */ jQuery.validator.addMethod("phoneUS", function(phone_number, element) { phone_number = phone_number.replace(/\s+/g, ""); return this.optional(element) || phone_number.length > 9 && phone_number.match(/^(\+?1-?)?(\([2-9]\d{2}\)|[2-9]\d{2})-?[2-9]\d{2}-?\d{4}$/); }, "Please specify a valid phone number"); jQuery.validator.addMethod('phoneUK', function(phone_number, element) { phone_number = phone_number.replace(/\(|\)|\s+|-/g,''); return this.optional(element) || phone_number.length > 9 && phone_number.match(/^(?:(?:(?:00\s?|\+)44\s?)|(?:\(?0))(?:(?:\d{5}\)?\s?\d{4,5})|(?:\d{4}\)?\s?(?:\d{5}|\d{3}\s?\d{3}))|(?:\d{3}\)?\s?\d{3}\s?\d{3,4})|(?:\d{2}\)?\s?\d{4}\s?\d{4}))$/); }, 'Please specify a valid phone number'); jQuery.validator.addMethod('mobileUK', function(phone_number, element) { phone_number = phone_number.replace(/\s+|-/g,''); return this.optional(element) || phone_number.length > 9 && phone_number.match(/^(?:(?:(?:00\s?|\+)44\s?|0)7(?:[45789]\d{2}|624)\s?\d{3}\s?\d{3})$/); }, 'Please specify a valid mobile number'); //Matches UK landline + mobile, accepting only 01-3 for landline or 07 for mobile to exclude many premium numbers jQuery.validator.addMethod('phonesUK', function(phone_number, element) { phone_number = phone_number.replace(/\s+|-/g,''); return this.optional(element) || phone_number.length > 9 && phone_number.match(/^(?:(?:(?:00\s?|\+)44\s?|0)(?:1\d{8,9}|[23]\d{9}|7(?:[45789]\d{8}|624\d{6})))$/); }, 'Please specify a valid uk phone number'); // On the above three UK functions, do the following server side processing: // Compare with ^((?:00\s?|\+)(44)\s?)?\(?0?(?:\)\s?)?([1-9]\d{1,4}\)?[\d\s]+) // Extract $2 and set $prefix to '+44<space>' if $2 is '44' otherwise set $prefix to '0' // Extract $3 and remove spaces and parentheses. Phone number is combined $2 and $3. // A number of very detailed GB telephone number RegEx patterns can also be found at: // http://www.aa-asterisk.org.uk/index.php/Regular_Expressions_for_Validating_and_Formatting_UK_Telephone_Numbers //Matches UK postcode. based on http://snipplr.com/view/3152/postcode-validation/ jQuery.validator.addMethod('postcodeUK', function(postcode, element) { postcode = (postcode.toUpperCase()).replace(/\s+/g,''); return this.optional(element) || postcode.match(/^([^QZ][^IJZ]{0,1}\d{1,2})(\d[^CIKMOV]{2})$/) || postcode.match(/^([^QV]\d[ABCDEFGHJKSTUW])(\d[^CIKMOV]{2})$/) || postcode.match(/^([^QV][^IJZ]\d[ABEHMNPRVWXY])(\d[^CIKMOV]{2})$/) || postcode.match(/^(GIR)(0AA)$/) || postcode.match(/^(BFPO)(\d{1,4})$/) || postcode.match(/^(BFPO)(C\/O\d{1,3})$/); }, 'Please specify a valid postcode'); // TODO check if value starts with <, otherwise don't try stripping anything jQuery.validator.addMethod("strippedminlength", function(value, element, param) { return jQuery(value).text().length >= param; }, jQuery.validator.format("Please enter at least {0} characters")); // same as email, but TLD is optional jQuery.validator.addMethod("email2", function(value, element, param) { return this.optional(element) || /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(value); }, jQuery.validator.messages.email); // same as url, but TLD is optional jQuery.validator.addMethod("url2", function(value, element, param) { return this.optional(element) || /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value); }, jQuery.validator.messages.url); // NOTICE: Modified version of Castle.Components.Validator.CreditCardValidator // Redistributed under the the Apache License 2.0 at http://www.apache.org/licenses/LICENSE-2.0 // Valid Types: mastercard, visa, amex, dinersclub, enroute, discover, jcb, unknown, all (overrides all other settings) jQuery.validator.addMethod("creditcardtypes", function(value, element, param) { if (/[^0-9-]+/.test(value)) { return false; } value = value.replace(/\D/g, ""); var validTypes = 0x0000; if (param.mastercard) validTypes |= 0x0001; if (param.visa) validTypes |= 0x0002; if (param.amex) validTypes |= 0x0004; if (param.dinersclub) validTypes |= 0x0008; if (param.enroute) validTypes |= 0x0010; if (param.discover) validTypes |= 0x0020; if (param.jcb) validTypes |= 0x0040; if (param.unknown) validTypes |= 0x0080; if (param.all) validTypes = 0x0001 | 0x0002 | 0x0004 | 0x0008 | 0x0010 | 0x0020 | 0x0040 | 0x0080; if (validTypes & 0x0001 && /^(5[12345])/.test(value)) { //mastercard return value.length == 16; } if (validTypes & 0x0002 && /^(4)/.test(value)) { //visa return value.length == 16; } if (validTypes & 0x0004 && /^(3[47])/.test(value)) { //amex return value.length == 15; } if (validTypes & 0x0008 && /^(3(0[012345]|[68]))/.test(value)) { //dinersclub return value.length == 14; } if (validTypes & 0x0010 && /^(2(014|149))/.test(value)) { //enroute return value.length == 15; } if (validTypes & 0x0020 && /^(6011)/.test(value)) { //discover return value.length == 16; } if (validTypes & 0x0040 && /^(3)/.test(value)) { //jcb return value.length == 16; } if (validTypes & 0x0040 && /^(2131|1800)/.test(value)) { //jcb return value.length == 15; } if (validTypes & 0x0080) { //unknown return true; } return false; }, "Please enter a valid credit card number."); jQuery.validator.addMethod("ipv4", function(value, element, param) { return this.optional(element) || /^(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)$/i.test(value); }, "Please enter a valid IP v4 address."); jQuery.validator.addMethod("ipv6", function(value, element, param) { return this.optional(element) || /^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$/i.test(value); }, "Please enter a valid IP v6 address."); /** * Return true if the field value matches the given format RegExp * * @example jQuery.validator.methods.pattern("AR1004",element,/^AR\d{4}$/) * @result true * * @example jQuery.validator.methods.pattern("BR1004",element,/^AR\d{4}$/) * @result false * * @name jQuery.validator.methods.pattern * @type Boolean * @cat Plugins/Validate/Methods */ jQuery.validator.addMethod("pattern", function(value, element, param) { if (this.optional(element)) { return true; } if (typeof param === 'string') { param = new RegExp('^(?:' + param + ')$'); } return param.test(value); }, "Invalid format."); /* * Lets you say "at least X inputs that match selector Y must be filled." * * The end result is that neither of these inputs: * * <input class="productinfo" name="partnumber"> * <input class="productinfo" name="description"> * * ...will validate unless at least one of them is filled. * * partnumber: {require_from_group: [1,".productinfo"]}, * description: {require_from_group: [1,".productinfo"]} * */ jQuery.validator.addMethod("require_from_group", function(value, element, options) { var validator = this; var selector = options[1]; var validOrNot = $(selector, element.form).filter(function() { return validator.elementValue(this); }).length >= options[0]; if(!$(element).data('being_validated')) { var fields = $(selector, element.form); fields.data('being_validated', true); fields.valid(); fields.data('being_validated', false); } return validOrNot; }, jQuery.format("Please fill at least {0} of these fields.")); /* * Lets you say "either at least X inputs that match selector Y must be filled, * OR they must all be skipped (left blank)." * * The end result, is that none of these inputs: * * <input class="productinfo" name="partnumber"> * <input class="productinfo" name="description"> * <input class="productinfo" name="color"> * * ...will validate unless either at least two of them are filled, * OR none of them are. * * partnumber: {skip_or_fill_minimum: [2,".productinfo"]}, * description: {skip_or_fill_minimum: [2,".productinfo"]}, * color: {skip_or_fill_minimum: [2,".productinfo"]} * */ jQuery.validator.addMethod("skip_or_fill_minimum", function(value, element, options) { var validator = this; numberRequired = options[0]; selector = options[1]; var numberFilled = $(selector, element.form).filter(function() { return validator.elementValue(this); }).length; var valid = numberFilled >= numberRequired || numberFilled === 0; if(!$(element).data('being_validated')) { var fields = $(selector, element.form); fields.data('being_validated', true); fields.valid(); fields.data('being_validated', false); } return valid; }, jQuery.format("Please either skip these fields or fill at least {0} of them.")); // Accept a value from a file input based on a required mimetype jQuery.validator.addMethod("accept", function(value, element, param) { // Split mime on commas incase we have multiple types we can accept var typeParam = typeof param === "string" ? param.replace(/,/g, '|') : "image/*", optionalValue = this.optional(element), i, file; // Element is optional if(optionalValue) { return optionalValue; } if($(element).attr("type") === "file") { // If we are using a wildcard, make it regex friendly typeParam = typeParam.replace("*", ".*"); // Check if the element has a FileList before checking each file if(element.files && element.files.length) { for(i = 0; i < element.files.length; i++) { file = element.files[i]; // Grab the mimtype from the loaded file, verify it matches if(!file.type.match(new RegExp( ".?(" + typeParam + ")$", "i"))) { return false; } } } } // Either return true because we've validated each file, or because the // browser does not support element.files and the FileList feature return true; }, jQuery.format("Please enter a value with a valid mimetype.")); // Older "accept" file extension method. Old docs: http://docs.jquery.com/Plugins/Validation/Methods/accept jQuery.validator.addMethod("extension", function(value, element, param) { param = typeof param === "string" ? param.replace(/,/g, '|') : "png|jpe?g|gif"; return this.optional(element) || value.match(new RegExp(".(" + param + ")$", "i")); }, jQuery.format("Please enter a value with a valid extension."));
zyroot
trunk/admin/dwz1.4.5/js/additional-methods.js
JavaScript
art
19,106
/** * @author zhanghuihua@msn.com */ (function($){ var menu, shadow, hash; $.fn.extend({ contextMenu: function(id, options){ var op = $.extend({ shadow : true, bindings:{}, ctrSub:null }, options ); if (!menu) { menu = $('<div id="contextmenu"></div>').appendTo('body').hide(); } if (!shadow) { shadow = $('<div id="contextmenuShadow"></div>').appendTo('body').hide(); } hash = hash || []; hash.push({ id : id, shadow: op.shadow, bindings: op.bindings || {}, ctrSub: op.ctrSub }); var index = hash.length - 1; $(this).bind('contextmenu', function(e) { display(index, this, e, op); return false; }); return this; } }); function display(index, trigger, e, options) { var cur = hash[index]; var content = $(DWZ.frag[cur.id]); content.find('li').hoverClass(); // Send the content to the menu menu.html(content); $.each(cur.bindings, function(id, func) { $("[rel='"+id+"']", menu).bind('click', function(e) { hide(); func($(trigger), $("#"+cur.id)); }); }); var posX = e.pageX; var posY = e.pageY; if ($(window).width() < posX + menu.width()) posX -= menu.width(); if ($(window).height() < posY + menu.height()) posY -= menu.height(); menu.css({'left':posX,'top':posY}).show(); if (cur.shadow) shadow.css({width:menu.width(),height:menu.height(),left:posX+3,top:posY+3}).show(); $(document).one('click', hide); if ($.isFunction(cur.ctrSub)) {cur.ctrSub($(trigger), $("#"+cur.id));} } function hide() { menu.hide(); shadow.hide(); } })(jQuery);
zyroot
trunk/admin/dwz1.4.5/js/dwz.contextmenu.js
JavaScript
art
1,699
/** * @desc 兼容不同的浏览器居中scrollCenter * @author ZhangHuihua@msn.com */ (function($){ $.fn.extend({ getWindowSize: function(){ if ($.browser.opera) { return { width: window.innerWidth, height: window.innerHeight }; } return { width: $(window).width(), height: $(window).height() }; }, /** * @param options */ scrollCenter: function(options){ // 扩展参数 var op = $.extend({ z: 1000000, mode:"WH"}, options); // 追加到 document.body 并设置其样式 var windowSize = this.getWindowSize(); if (op.mode == "W") { this.appendTo(document.body).css({ 'left': (windowSize.width - this.width()) / 2 + $(window).scrollLeft() + 'px' }); } else if (op.model == "H"){ this.appendTo(document.body).css({ 'top': (windowSize.height - this.height()) / 2 + $(window).scrollTop() + 'px' }); } else { this.appendTo(document.body).css({ // 'position': 'absolute', // 'z-index': op.z, 'top': (windowSize.height - this.height()) / 2 + $(window).scrollTop() + 'px', 'left': (windowSize.width - this.width()) / 2 + $(window).scrollLeft() + 'px' }); } // 保存当前位置参数 var bodyScrollTop = $(document).scrollTop(); var bodyScrollLeft = $(document).scrollLeft(); var movedivTop = this.offset().top; var movedivLeft = this.offset().left; var thisjQuery = this; // 滚动事件 $(window).scroll(function(e){ var windowSize = thisjQuery.getWindowSize(); var tmpBodyScrollTop = $(document).scrollTop(); var tmpBodyScrollLeft = $(document).scrollLeft(); movedivTop += tmpBodyScrollTop - bodyScrollTop; movedivLeft += tmpBodyScrollLeft - bodyScrollLeft; bodyScrollTop = tmpBodyScrollTop; bodyScrollLeft = tmpBodyScrollLeft; // 以动画方式进行移动 if (op.mode == "W") { thisjQuery.stop().animate({ 'left': movedivLeft + 'px' }); } else if (op.mode == "H") { thisjQuery.stop().animate({ 'top': movedivTop + 'px' }); } else { thisjQuery.stop().animate({ 'top': movedivTop + 'px', 'left': movedivLeft + 'px' }); } }); // 窗口大小重设事件 $(window).resize(function(){ var windowSize = thisjQuery.getWindowSize(); movedivTop = (windowSize.height - thisjQuery.height()) / 2 + $(document).scrollTop(); movedivLeft = (windowSize.width - thisjQuery.width()) / 2 + $(document).scrollLeft(); if (op.mode == "W") { thisjQuery.stop().animate({ 'left': movedivLeft + 'px' }); } else if (op.mode == "H") { thisjQuery.stop().animate({ 'top': movedivTop + 'px' }); } else { thisjQuery.stop().animate({ 'top': movedivTop + 'px', 'left': movedivLeft + 'px' }); } }); return this; } }); })(jQuery);
zyroot
trunk/admin/dwz1.4.5/js/dwz.scrollCenter.js
JavaScript
art
2,975
function initEnv() { $("body").append(DWZ.frag["dwzFrag"]); if ( $.browser.msie && /6.0/.test(navigator.userAgent) ) { try { document.execCommand("BackgroundImageCache", false, true); }catch(e){} } //清理浏览器内存,只对IE起效 if ($.browser.msie) { window.setInterval("CollectGarbage();", 10000); } $(window).resize(function(){ initLayout(); $(this).trigger(DWZ.eventType.resizeGrid); }); var ajaxbg = $("#background,#progressBar"); ajaxbg.hide(); $(document).ajaxStart(function(){ ajaxbg.show(); }).ajaxStop(function(){ ajaxbg.hide(); }); $("#leftside").jBar({minW:150, maxW:700}); if ($.taskBar) $.taskBar.init(); navTab.init(); if ($.fn.switchEnv) $("#switchEnvBox").switchEnv(); if ($.fn.navMenu) $("#navMenu").navMenu(); setTimeout(function(){ initLayout(); initUI(); // navTab styles var jTabsPH = $("div.tabsPageHeader"); jTabsPH.find(".tabsLeft").hoverClass("tabsLeftHover"); jTabsPH.find(".tabsRight").hoverClass("tabsRightHover"); jTabsPH.find(".tabsMore").hoverClass("tabsMoreHover"); }, 10); } function initLayout(){ var iContentW = $(window).width() - (DWZ.ui.sbar ? $("#sidebar").width() + 10 : 34) - 5; var iContentH = $(window).height() - $("#header").height() - 34; $("#container").width(iContentW); $("#container .tabsPageContent").height(iContentH - 34).find("[layoutH]").layoutH(); $("#sidebar, #sidebar_s .collapse, #splitBar, #splitBarProxy").height(iContentH - 5); $("#taskbar").css({top: iContentH + $("#header").height() + 5, width:$(window).width()}); } function initUI(_box){ var $p = $(_box || document); $("div.panel", $p).jPanel(); //tables $("table.table", $p).jTable(); // css tables $('table.list', $p).cssTable(); //auto bind tabs $("div.tabs", $p).each(function(){ var $this = $(this); var options = {}; options.currentIndex = $this.attr("currentIndex") || 0; options.eventType = $this.attr("eventType") || "click"; $this.tabs(options); }); $("ul.tree", $p).jTree(); $('div.accordion', $p).each(function(){ var $this = $(this); $this.accordion({fillSpace:$this.attr("fillSpace"),alwaysOpen:true,active:0}); }); $(":button.checkboxCtrl, :checkbox.checkboxCtrl", $p).checkboxCtrl($p); if ($.fn.combox) $("select.combox",$p).combox(); if ($.fn.xheditor) { $("textarea.editor", $p).each(function(){ var $this = $(this); var op = {html5Upload:false, skin: 'vista',tools: $this.attr("tools") || 'full'}; var upAttrs = [ ["upLinkUrl","upLinkExt","zip,rar,txt"], ["upImgUrl","upImgExt","jpg,jpeg,gif,png"], ["upFlashUrl","upFlashExt","swf"], ["upMediaUrl","upMediaExt","avi"] ]; $(upAttrs).each(function(i){ var urlAttr = upAttrs[i][0]; var extAttr = upAttrs[i][1]; if ($this.attr(urlAttr)) { op[urlAttr] = $this.attr(urlAttr); op[extAttr] = $this.attr(extAttr) || upAttrs[i][2]; } }); $this.xheditor(op); }); } if ($.fn.uploadify) { $(":file[uploaderOption]", $p).each(function(){ var $this = $(this); var options = { fileObjName: $this.attr("name") || "file", auto: true, multi: true, onUploadError: uploadifyError }; var uploaderOption = DWZ.jsonEval($this.attr("uploaderOption")); $.extend(options, uploaderOption); DWZ.debug("uploaderOption: "+DWZ.obj2str(uploaderOption)); $this.uploadify(options); }); } // init styles $("input[type=text], input[type=password], textarea", $p).addClass("textInput").focusClass("focus"); $("input[readonly], textarea[readonly]", $p).addClass("readonly"); $("input[disabled=true], textarea[disabled=true]", $p).addClass("disabled"); $("input[type=text]", $p).not("div.tabs input[type=text]", $p).filter("[alt]").inputAlert(); //Grid ToolBar $("div.panelBar li, div.panelBar", $p).hoverClass("hover"); //Button $("div.button", $p).hoverClass("buttonHover"); $("div.buttonActive", $p).hoverClass("buttonActiveHover"); //tabsPageHeader $("div.tabsHeader li, div.tabsPageHeader li, div.accordionHeader, div.accordion", $p).hoverClass("hover"); //validate form $("form.required-validate", $p).each(function(){ var $form = $(this); $form.validate({ onsubmit: false, focusInvalid: false, focusCleanup: true, errorElement: "span", ignore:".ignore", invalidHandler: function(form, validator) { var errors = validator.numberOfInvalids(); if (errors) { var message = DWZ.msg("validateFormError",[errors]); alertMsg.error(message); } } }); $form.find('input[customvalid]').each(function(){ var $input = $(this); $input.rules("add", { customvalid: $input.attr("customvalid") }) }); }); if ($.fn.datepicker){ $('input.date', $p).each(function(){ var $this = $(this); var opts = {}; if ($this.attr("dateFmt")) opts.pattern = $this.attr("dateFmt"); if ($this.attr("minDate")) opts.minDate = $this.attr("minDate"); if ($this.attr("maxDate")) opts.maxDate = $this.attr("maxDate"); if ($this.attr("mmStep")) opts.mmStep = $this.attr("mmStep"); if ($this.attr("ssStep")) opts.ssStep = $this.attr("ssStep"); $this.datepicker(opts); }); } // navTab $("a[target=navTab]", $p).each(function(){ $(this).click(function(event){ var $this = $(this); var title = $this.attr("title") || $this.text(); var tabid = $this.attr("rel") || "_blank"; var fresh = eval($this.attr("fresh") || "true"); var external = eval($this.attr("external") || "false"); var url = unescape($this.attr("href")).replaceTmById($(event.target).parents(".unitBox:first")); DWZ.debug(url); if (!url.isFinishedTm()) { alertMsg.error($this.attr("warn") || DWZ.msg("alertSelectMsg")); return false; } navTab.openTab(tabid, url,{title:title, fresh:fresh, external:external}); event.preventDefault(); }); }); //dialogs $("a[target=dialog]", $p).each(function(){ $(this).click(function(event){ var $this = $(this); var title = $this.attr("title") || $this.text(); var rel = $this.attr("rel") || "_blank"; var options = {}; var w = $this.attr("width"); var h = $this.attr("height"); if (w) options.width = w; if (h) options.height = h; options.max = eval($this.attr("max") || "false"); options.mask = eval($this.attr("mask") || "false"); options.maxable = eval($this.attr("maxable") || "true"); options.minable = eval($this.attr("minable") || "true"); options.fresh = eval($this.attr("fresh") || "true"); options.resizable = eval($this.attr("resizable") || "true"); options.drawable = eval($this.attr("drawable") || "true"); options.close = eval($this.attr("close") || ""); options.param = $this.attr("param") || ""; var url = unescape($this.attr("href")).replaceTmById($(event.target).parents(".unitBox:first")); DWZ.debug(url); if (!url.isFinishedTm()) { alertMsg.error($this.attr("warn") || DWZ.msg("alertSelectMsg")); return false; } $.pdialog.open(url, rel, title, options); return false; }); }); $("a[target=ajax]", $p).each(function(){ $(this).click(function(event){ var $this = $(this); var rel = $this.attr("rel"); if (rel) { var $rel = $("#"+rel); $rel.loadUrl($this.attr("href"), {}, function(){ $rel.find("[layoutH]").layoutH(); }); } event.preventDefault(); }); }); $("div.pagination", $p).each(function(){ var $this = $(this); $this.pagination({ targetType:$this.attr("targetType"), rel:$this.attr("rel"), totalCount:$this.attr("totalCount"), numPerPage:$this.attr("numPerPage"), pageNumShown:$this.attr("pageNumShown"), currentPage:$this.attr("currentPage") }); }); if ($.fn.sortDrag) $("div.sortDrag", $p).sortDrag(); // dwz.ajax.js if ($.fn.ajaxTodo) $("a[target=ajaxTodo]", $p).ajaxTodo(); if ($.fn.dwzExport) $("a[target=dwzExport]", $p).dwzExport(); if ($.fn.lookup) $("a[lookupGroup]", $p).lookup(); if ($.fn.multLookup) $("[multLookup]:button", $p).multLookup(); if ($.fn.suggest) $("input[suggestFields]", $p).suggest(); if ($.fn.itemDetail) $("table.itemDetail", $p).itemDetail(); if ($.fn.selectedTodo) $("a[target=selectedTodo]", $p).selectedTodo(); if ($.fn.pagerForm) $("form[rel=pagerForm]", $p).pagerForm({parentBox:$p}); // 这里放其他第三方jQuery插件... }
zyroot
trunk/admin/dwz1.4.5/js/dwz.ui.js
JavaScript
art
8,590
/** * jQuery ajax history plugins * @author ZhangHuihua@msn.com */ (function($){ $.extend({ History: { _hash: new Array(), _cont: undefined, _currentHash: "", _callback: undefined, init: function(cont, callback){ $.History._cont = cont; $.History._callback = callback; var current_hash = location.hash.replace(/\?.*$/, ''); $.History._currentHash = current_hash; if ($.browser.msie) { if ($.History._currentHash == '') { $.History._currentHash = '#'; } $("body").append('<iframe id="jQuery_history" style="display: none;" src="about:blank"></iframe>'); var ihistory = $("#jQuery_history")[0]; var iframe = ihistory.contentDocument || ihistory.contentWindow.document; iframe.open(); iframe.close(); iframe.location.hash = current_hash; } if ($.isFunction(this._callback)) $.History._callback(current_hash.skipChar("#")); setInterval($.History._historyCheck, 100); }, _historyCheck: function(){ var current_hash = ""; if ($.browser.msie) { var ihistory = $("#jQuery_history")[0]; var iframe = ihistory.contentWindow; current_hash = iframe.location.hash.skipChar("#").replace(/\?.*$/, ''); } else { current_hash = location.hash.skipChar('#').replace(/\?.*$/, ''); } // if (!current_hash) { // if (current_hash != $.History._currentHash) { // $.History._currentHash = current_hash; // //TODO // } // } else { if (current_hash != $.History._currentHash) { $.History._currentHash = current_hash; $.History.loadHistory(current_hash); } // } }, addHistory: function(hash, fun, args){ $.History._currentHash = hash; var history = [hash, fun, args]; $.History._hash.push(history); if ($.browser.msie) { var ihistory = $("#jQuery_history")[0]; var iframe = ihistory.contentDocument || ihistory.contentWindow.document; iframe.open(); iframe.close(); iframe.location.hash = hash.replace(/\?.*$/, ''); location.hash = hash.replace(/\?.*$/, ''); } else { location.hash = hash.replace(/\?.*$/, ''); } }, loadHistory: function(hash){ if ($.browser.msie) { location.hash = hash; } for (var i = 0; i < $.History._hash.length; i += 1) { if ($.History._hash[i][0] == hash) { $.History._hash[i][1]($.History._hash[i][2]); return; } } } } }); })(jQuery);
zyroot
trunk/admin/dwz1.4.5/js/dwz.history.js
JavaScript
art
2,545
/** * Theme Plugins * @author ZhangHuihua@msn.com */ (function($){ $.fn.extend({ cssTable: function(options){ return this.each(function(){ var $this = $(this); var $trs = $this.find('tbody>tr'); var $grid = $this.parent(); // table var nowrap = $this.hasClass("nowrap"); $trs.hoverClass("hover").each(function(index){ var $tr = $(this); if (!nowrap && index % 2 == 1) $tr.addClass("trbg"); $tr.click(function(){ $trs.filter(".selected").removeClass("selected"); $tr.addClass("selected"); var sTarget = $tr.attr("target"); if (sTarget) { if ($("#"+sTarget, $grid).size() == 0) { $grid.prepend('<input id="'+sTarget+'" type="hidden" />'); } $("#"+sTarget, $grid).val($tr.attr("rel")); } }); }); $this.find("thead [orderField]").orderBy({ targetType: $this.attr("targetType"), rel:$this.attr("rel"), asc: $this.attr("asc") || "asc", desc: $this.attr("desc") || "desc" }); }); } }); })(jQuery);
zyroot
trunk/admin/dwz1.4.5/js/dwz.cssTable.js
JavaScript
art
1,099
/** * @author Roger Wu v1.0 * @author ZhangHuihua@msn.com 2011-4-1 */ (function($){ $.fn.jTable = function(options){ return this.each(function(){ var $table = $(this), nowrapTD = $table.attr("nowrapTD"); var tlength = $table.width(); var aStyles = []; var $tc = $table.parent().addClass("j-resizeGrid"); // table parent container var layoutH = $(this).attr("layoutH"); var oldThs = $table.find("thead>tr:last-child").find("th"); for(var i = 0, l = oldThs.size(); i < l; i++) { var $th = $(oldThs[i]); var style = [], width = $th.innerWidth() - (100 * $th.innerWidth() / tlength)-2; style[0] = parseInt(width); style[1] = $th.attr("align"); aStyles[aStyles.length] = style; } $(this).wrap("<div class='grid'></div>"); var $grid = $table.parent().html($table.html()); var thead = $grid.find("thead"); thead.wrap("<div class='gridHeader'><div class='gridThead'><table style='width:" + (tlength - 20) + "px;'></table></div></div>"); var lastH = $(">tr:last-child", thead); var ths = $(">th", lastH); $("th",thead).each(function(){ var $th = $(this); $th.html("<div class='gridCol' title='"+$th.text()+"'>"+ $th.html() +"</div>"); }); ths.each(function(i){ var $th = $(this), style = aStyles[i]; $th.addClass(style[1]).hoverClass("hover").removeAttr("align").removeAttr("width").width(style[0]); }).filter("[orderField]").orderBy({ targetType: $table.attr("targetType"), rel:$table.attr("rel"), asc: $table.attr("asc") || "asc", desc: $table.attr("desc") || "desc" }); var tbody = $grid.find(">tbody"); var layoutStr = layoutH ? " layoutH='" + layoutH + "'" : ""; tbody.wrap("<div class='gridScroller'" + layoutStr + " style='width:" + $tc.width() + "px;'><div class='gridTbody'><table style='width:" + (tlength - 20) + "px;'></table></div></div>"); var ftr = $(">tr:first-child", tbody); var $trs = tbody.find('>tr'); $trs.hoverClass().each(function(){ var $tr = $(this); var $ftds = $(">td", this); for (var i=0; i < $ftds.size(); i++) { var $ftd = $($ftds[i]); if (nowrapTD != "false") $ftd.html("<div>" + $ftd.html() + "</div>"); if (i < aStyles.length) $ftd.addClass(aStyles[i][1]); } $tr.click(function(){ $trs.filter(".selected").removeClass("selected"); $tr.addClass("selected"); var sTarget = $tr.attr("target"); if (sTarget) { if ($("#"+sTarget, $grid).size() == 0) { $grid.prepend('<input id="'+sTarget+'" type="hidden" />'); } $("#"+sTarget, $grid).val($tr.attr("rel")); } }); }); $(">td",ftr).each(function(i){ if (i < aStyles.length) $(this).width(aStyles[i][0]); }); $grid.append("<div class='resizeMarker' style='height:300px; left:57px;display:none;'></div><div class='resizeProxy' style='height:300px; left:377px;display:none;'></div>"); var scroller = $(".gridScroller", $grid); scroller.scroll(function(event){ var header = $(".gridThead", $grid); if(scroller.scrollLeft() > 0){ header.css("position", "relative"); var scroll = scroller.scrollLeft(); header.css("left", scroller.cssv("left") - scroll); } if(scroller.scrollLeft() == 0) { header.css("position", "relative"); header.css("left", "0px"); } return false; }); $(">tr", thead).each(function(){ $(">th", this).each(function(i){ var th = this, $th = $(this); $th.mouseover(function(event){ var offset = $.jTableTool.getOffset(th, event).offsetX; if($th.outerWidth() - offset < 5) { $th.css("cursor", "col-resize").mousedown(function(event){ $(".resizeProxy", $grid).show().css({ left: $.jTableTool.getRight(th)- $(".gridScroller", $grid).scrollLeft(), top:$.jTableTool.getTop(th), height:$.jTableTool.getHeight(th,$grid), cursor:"col-resize" }); $(".resizeMarker", $grid).show().css({ left: $.jTableTool.getLeft(th) + 1 - $(".gridScroller", $grid).scrollLeft(), top: $.jTableTool.getTop(th), height:$.jTableTool.getHeight(th,$grid) }); $(".resizeProxy", $grid).jDrag($.extend(options, {scop:true, cellMinW:20, relObj:$(".resizeMarker", $grid)[0], move: "horizontal", event:event, stop: function(){ var pleft = $(".resizeProxy", $grid).position().left; var mleft = $(".resizeMarker", $grid).position().left; var move = pleft - mleft - $th.outerWidth() -9; var cols = $.jTableTool.getColspan($th); var cellNum = $.jTableTool.getCellNum($th); var oldW = $th.width(), newW = $th.width() + move; var $dcell = $(">td", ftr).eq(cellNum - 1); $th.width(newW + "px"); $dcell.width(newW+"px"); var $table1 = $(thead).parent(); $table1.width(($table1.width() - oldW + newW)+"px"); var $table2 = $(tbody).parent(); $table2.width(($table2.width() - oldW + newW)+"px"); $(".resizeMarker,.resizeProxy", $grid).hide(); } }) ); }); } else { $th.css("cursor", $th.attr("orderField") ? "pointer" : "default"); $th.unbind("mousedown"); } return false; }); }); }); function _resizeGrid(){ $("div.j-resizeGrid").each(function(){ var width = $(this).innerWidth(); if (width){ $("div.gridScroller", this).width(width+"px"); } }); } $(window).unbind(DWZ.eventType.resizeGrid).bind("resizeGrid", _resizeGrid); }); }; $.jTableTool = { getLeft:function(obj) { var width = 0; $(obj).prevAll().each(function(){ width += $(this).outerWidth(); }); return width - 1; }, getRight:function(obj) { var width = 0; $(obj).prevAll().andSelf().each(function(){ width += $(this).outerWidth(); }); return width - 1; }, getTop:function(obj) { var height = 0; $(obj).parent().prevAll().each(function(){ height += $(this).outerHeight(); }); return height; }, getHeight:function(obj, parent) { var height = 0; var head = $(obj).parent(); head.nextAll().andSelf().each(function(){ height += $(this).outerHeight(); }); $(".gridTbody", parent).children().each(function(){ height += $(this).outerHeight(); }); return height; }, getCellNum:function(obj) { return $(obj).prevAll().andSelf().size(); }, getColspan:function(obj) { return $(obj).attr("colspan") || 1; }, getStart:function(obj) { var start = 1; $(obj).prevAll().each(function(){ start += parseInt($(this).attr("colspan") || 1); }); return start; }, getPageCoord:function(element){ var coord = {x: 0, y: 0}; while (element){ coord.x += element.offsetLeft; coord.y += element.offsetTop; element = element.offsetParent; } return coord; }, getOffset:function(obj, evt){ if($.browser.msie ) { var objset = $(obj).offset(); var evtset = { offsetX:evt.pageX || evt.screenX, offsetY:evt.pageY || evt.screenY }; var offset ={ offsetX: evtset.offsetX - objset.left, offsetY: evtset.offsetY - objset.top }; return offset; } var target = evt.target; if (target.offsetLeft == undefined){ target = target.parentNode; } var pageCoord = $.jTableTool.getPageCoord(target); var eventCoord ={ x: window.pageXOffset + evt.clientX, y: window.pageYOffset + evt.clientY }; var offset ={ offsetX: eventCoord.x - pageCoord.x, offsetY: eventCoord.y - pageCoord.y }; return offset; } }; })(jQuery);
zyroot
trunk/admin/dwz1.4.5/js/dwz.stable.js
JavaScript
art
8,033
/** * @author Roger Wu */ (function($){ var allSelectBox = []; var killAllBox = function(bid){ $.each(allSelectBox, function(i){ if (allSelectBox[i] != bid) { if (!$("#" + allSelectBox[i])[0]) { $("#op_" + allSelectBox[i]).remove(); //allSelectBox.splice(i,1); } else { $("#op_" + allSelectBox[i]).css({ height: "", width: "" }).hide(); } $(document).unbind("click", killAllBox); } }); }; $.extend($.fn, { comboxSelect: function(options){ var op = $.extend({ selector: ">a" }, options); return this.each(function(){ var box = $(this); var selector = $(op.selector, box); allSelectBox.push(box.attr("id")); $(op.selector, box).click(function(){ var options = $("#op_"+box.attr("id")); if (options.is(":hidden")) { if(options.height() > 300) { options.css({height:"300px",overflow:"scroll"}); } var top = box.offset().top+box[0].offsetHeight-50; if(top + options.height() > $(window).height() - 20) { top = $(window).height() - 20 - options.height(); } options.css({top:top,left:box.offset().left}).show(); killAllBox(box.attr("id")); $(document).click(killAllBox); } else { $(document).unbind("click", killAllBox); killAllBox(); } return false; }); $("#op_"+box.attr("id")).find(">li").comboxOption(selector, box); }); }, comboxOption: function(selector, box){ return this.each(function(){ $(">a", this).click(function(){ var $this = $(this); $this.parent().parent().find(".selected").removeClass("selected"); $this.addClass("selected"); selector.text($this.text()); var $input = $("select", box); if ($input.val() != $this.attr("value")) { $("select", box).val($this.attr("value")).trigger("change"); } }); }); }, combox:function(){ /* 清理下拉层 */ var _selectBox = []; $.each(allSelectBox, function(i){ if ($("#" + allSelectBox[i])[0]) { _selectBox.push(allSelectBox[i]); } else { $("#op_" + allSelectBox[i]).remove(); } }); allSelectBox = _selectBox; return this.each(function(i){ var $this = $(this).removeClass("combox"); var name = $this.attr("name"); var value= $this.val(); var label = $("option[value=" + value + "]",$this).text(); var ref = $this.attr("ref"); var refUrl = $this.attr("refUrl") || ""; var cid = $this.attr("id") || Math.round(Math.random()*10000000); var select = '<div class="combox"><div id="combox_'+ cid +'" class="select"' + (ref?' ref="' + ref + '"' : '') + '>'; select += '<a href="javascript:" class="'+$this.attr("class")+'" name="' + name +'" value="' + value + '">' + label +'</a></div></div>'; var options = '<ul class="comboxop" id="op_combox_'+ cid +'">'; $("option", $this).each(function(){ var option = $(this); options +="<li><a class=\""+ (value==option[0].value?"selected":"") +"\" href=\"#\" value=\"" + option[0].value + "\">" + option[0].text + "</a></li>"; }); options +="</ul>"; $("body").append(options); $this.after(select); $("div.select", $this.next()).comboxSelect().append($this); if (ref && refUrl) { function _onchange(event){ var $ref = $("#"+ref); if ($ref.size() == 0) return false; $.ajax({ type:'POST', dataType:"json", url:refUrl.replace("{value}", encodeURIComponent($this.attr("value"))), cache: false, data:{}, success: function(json){ if (!json) return; var html = ''; $.each(json, function(i){ if (json[i] && json[i].length > 1){ html += '<option value="'+json[i][0]+'">' + json[i][1] + '</option>'; } }); var $refCombox = $ref.parents("div.combox:first"); $ref.html(html).insertAfter($refCombox); $refCombox.remove(); $ref.trigger("change").combox(); }, error: DWZ.ajaxError }); } $this.unbind("change", _onchange).bind("change", _onchange); } }); } }); })(jQuery);
zyroot
trunk/admin/dwz1.4.5/js/dwz.combox.js
JavaScript
art
4,267
/** * @author ZhangHuihua@msn.com */ (function($){ // jQuery validate $.extend($.validator.messages, { required: "必填字段", remote: "请修正该字段", email: "请输入正确格式的电子邮件", url: "请输入合法的网址", date: "请输入合法的日期", dateISO: "请输入合法的日期 (ISO).", number: "请输入合法的数字", digits: "只能输入整数", creditcard: "请输入合法的信用卡号", equalTo: "请再次输入相同的值", accept: "请输入拥有合法后缀名的字符串", maxlength: $.validator.format("长度最多是 {0} 的字符串"), minlength: $.validator.format("长度最少是 {0} 的字符串"), rangelength: $.validator.format("长度介于 {0} 和 {1} 之间的字符串"), range: $.validator.format("请输入一个介于 {0} 和 {1} 之间的值"), max: $.validator.format("请输入一个最大为 {0} 的值"), min: $.validator.format("请输入一个最小为 {0} 的值"), alphanumeric: "字母、数字、下划线", lettersonly: "必须是字母", phone: "数字、空格、括号" }); // DWZ regional $.setRegional("datepicker", { dayNames: ['日', '一', '二', '三', '四', '五', '六'], monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'] }); $.setRegional("alertMsg", { title:{error:"错误", info:"提示", warn:"警告", correct:"成功", confirm:"确认提示"}, butMsg:{ok:"确定", yes:"是", no:"否", cancel:"取消"} }); })(jQuery);
zyroot
trunk/admin/dwz1.4.5/js/dwz.regional.zh.js
JavaScript
art
1,606
/** * @author Roger Wu * reference:dwz.drag.js, dwz.dialogDrag.js, dwz.resize.js, dwz.taskBar.js */ (function($){ $.pdialog = { _op:{height:300, width:580, minH:40, minW:50, total:20, max:false, mask:false, resizable:true, drawable:true, maxable:true,minable:true,fresh:true}, _current:null, _zIndex:42, getCurrent:function(){ return this._current; }, reload:function(url, options){ var op = $.extend({data:{}, dialogId:"", callback:null}, options); var dialog = (op.dialogId && $("body").data(op.dialogId)) || this._current; if (dialog){ var jDContent = dialog.find(".dialogContent"); jDContent.ajaxUrl({ type:"POST", url:url, data:op.data, callback:function(response){ jDContent.find("[layoutH]").layoutH(jDContent); $(".pageContent", dialog).width($(dialog).width()-14); $(":button.close", dialog).click(function(){ $.pdialog.close(dialog); return false; }); if ($.isFunction(op.callback)) op.callback(response); } }); } }, //打开一个层 open:function(url, dlgid, title, options) { var op = $.extend({},$.pdialog._op, options); var dialog = $("body").data(dlgid); //重复打开一个层 if(dialog) { if(dialog.is(":hidden")) { dialog.show(); } if(op.fresh || url != $(dialog).data("url")){ dialog.data("url",url); dialog.find(".dialogHeader").find("h1").html(title); this.switchDialog(dialog); var jDContent = dialog.find(".dialogContent"); jDContent.loadUrl(url, {}, function(){ jDContent.find("[layoutH]").layoutH(jDContent); $(".pageContent", dialog).width($(dialog).width()-14); $("button.close").click(function(){ $.pdialog.close(dialog); return false; }); }); } } else { //打开一个全新的层 $("body").append(DWZ.frag["dialogFrag"]); dialog = $(">.dialog:last-child", "body"); dialog.data("id",dlgid); dialog.data("url",url); if(options.close) dialog.data("close",options.close); if(options.param) dialog.data("param",options.param); ($.fn.bgiframe && dialog.bgiframe()); dialog.find(".dialogHeader").find("h1").html(title); $(dialog).css("zIndex", ($.pdialog._zIndex+=2)); $("div.shadow").css("zIndex", $.pdialog._zIndex - 3).show(); $.pdialog._init(dialog, options); $(dialog).click(function(){ $.pdialog.switchDialog(dialog); }); if(op.resizable) dialog.jresize(); if(op.drawable) dialog.dialogDrag(); $("a.close", dialog).click(function(event){ $.pdialog.close(dialog); return false; }); if (op.maxable) { $("a.maximize", dialog).show().click(function(event){ $.pdialog.switchDialog(dialog); $.pdialog.maxsize(dialog); dialog.jresize("destroy").dialogDrag("destroy"); return false; }); } else { $("a.maximize", dialog).hide(); } $("a.restore", dialog).click(function(event){ $.pdialog.restore(dialog); dialog.jresize().dialogDrag(); return false; }); if (op.minable) { $("a.minimize", dialog).show().click(function(event){ $.pdialog.minimize(dialog); return false; }); } else { $("a.minimize", dialog).hide(); } $("div.dialogHeader a", dialog).mousedown(function(){ return false; }); $("div.dialogHeader", dialog).dblclick(function(){ if($("a.restore",dialog).is(":hidden")) $("a.maximize",dialog).trigger("click"); else $("a.restore",dialog).trigger("click"); }); if(op.max) { // $.pdialog.switchDialog(dialog); $.pdialog.maxsize(dialog); dialog.jresize("destroy").dialogDrag("destroy"); } $("body").data(dlgid, dialog); $.pdialog._current = dialog; $.pdialog.attachShadow(dialog); //load data var jDContent = $(".dialogContent",dialog); jDContent.loadUrl(url, {}, function(){ jDContent.find("[layoutH]").layoutH(jDContent); $(".pageContent", dialog).width($(dialog).width()-14); $("button.close").click(function(){ $.pdialog.close(dialog); return false; }); }); } if (op.mask) { $(dialog).css("zIndex", 1000); $("a.minimize",dialog).hide(); $(dialog).data("mask", true); $("#dialogBackground").show(); }else { //add a task to task bar if(op.minable) $.taskBar.addDialog(dlgid,title); } }, /** * 切换当前层 * @param {Object} dialog */ switchDialog:function(dialog) { var index = $(dialog).css("zIndex"); $.pdialog.attachShadow(dialog); if($.pdialog._current) { var cindex = $($.pdialog._current).css("zIndex"); $($.pdialog._current).css("zIndex", index); $(dialog).css("zIndex", cindex); $("div.shadow").css("zIndex", cindex - 1); $.pdialog._current = dialog; } $.taskBar.switchTask(dialog.data("id")); }, /** * 给当前层附上阴隐层 * @param {Object} dialog */ attachShadow:function(dialog) { var shadow = $("div.shadow"); if(shadow.is(":hidden")) shadow.show(); shadow.css({ top: parseInt($(dialog)[0].style.top) - 2, left: parseInt($(dialog)[0].style.left) - 4, height: parseInt($(dialog).height()) + 8, width: parseInt($(dialog).width()) + 8, zIndex:parseInt($(dialog).css("zIndex")) - 1 }); $(".shadow_c", shadow).children().andSelf().each(function(){ $(this).css("height", $(dialog).outerHeight() - 4); }); }, _init:function(dialog, options) { var op = $.extend({}, this._op, options); var height = op.height>op.minH?op.height:op.minH; var width = op.width>op.minW?op.width:op.minW; if(isNaN(dialog.height()) || dialog.height() < height){ $(dialog).height(height+"px"); $(".dialogContent",dialog).height(height - $(".dialogHeader", dialog).outerHeight() - $(".dialogFooter", dialog).outerHeight() - 6); } if(isNaN(dialog.css("width")) || dialog.width() < width) { $(dialog).width(width+"px"); } var iTop = ($(window).height()-dialog.height())/2; dialog.css({ left: ($(window).width()-dialog.width())/2, top: iTop > 0 ? iTop : 0 }); }, /** * 初始化半透明层 * @param {Object} resizable * @param {Object} dialog * @param {Object} target */ initResize:function(resizable, dialog,target) { $("body").css("cursor", target + "-resize"); resizable.css({ top: $(dialog).css("top"), left: $(dialog).css("left"), height:$(dialog).css("height"), width:$(dialog).css("width") }); resizable.show(); }, /** * 改变阴隐层 * @param {Object} target * @param {Object} options */ repaint:function(target,options){ var shadow = $("div.shadow"); if(target != "w" && target != "e") { shadow.css("height", shadow.outerHeight() + options.tmove); $(".shadow_c", shadow).children().andSelf().each(function(){ $(this).css("height", $(this).outerHeight() + options.tmove); }); } if(target == "n" || target =="nw" || target == "ne") { shadow.css("top", options.otop - 2); } if(options.owidth && (target != "n" || target != "s")) { shadow.css("width", options.owidth + 8); } if(target.indexOf("w") >= 0) { shadow.css("left", options.oleft - 4); } }, /** * 改变左右拖动层的高度 * @param {Object} target * @param {Object} tmove * @param {Object} dialog */ resizeTool:function(target, tmove, dialog) { $("div[class^='resizable']", dialog).filter(function(){ return $(this).attr("tar") == 'w' || $(this).attr("tar") == 'e'; }).each(function(){ $(this).css("height", $(this).outerHeight() + tmove); }); }, /** * 改变原始层的大小 * @param {Object} obj * @param {Object} dialog * @param {Object} target */ resizeDialog:function(obj, dialog, target) { var oleft = parseInt(obj.style.left); var otop = parseInt(obj.style.top); var height = parseInt(obj.style.height); var width = parseInt(obj.style.width); if(target == "n" || target == "nw") { tmove = parseInt($(dialog).css("top")) - otop; } else { tmove = height - parseInt($(dialog).css("height")); } $(dialog).css({left:oleft,width:width,top:otop,height:height}); $(".dialogContent", dialog).css("width", (width-12) + "px"); $(".pageContent", dialog).css("width", (width-14) + "px"); if (target != "w" && target != "e") { var content = $(".dialogContent", dialog); content.css({height:height - $(".dialogHeader", dialog).outerHeight() - $(".dialogFooter", dialog).outerHeight() - 6}); content.find("[layoutH]").layoutH(content); $.pdialog.resizeTool(target, tmove, dialog); } $.pdialog.repaint(target, {oleft:oleft,otop: otop,tmove: tmove,owidth:width}); $(window).trigger(DWZ.eventType.resizeGrid); }, close:function(dialog) { if(typeof dialog == 'string') dialog = $("body").data(dialog); var close = dialog.data("close"); var go = true; if(close && $.isFunction(close)) { var param = dialog.data("param"); if(param && param != ""){ param = DWZ.jsonEval(param); go = close(param); } else { go = close(); } if(!go) return; } $(dialog).hide(); $("div.shadow").hide(); if($(dialog).data("mask")){ $("#dialogBackground").hide(); } else{ if ($(dialog).data("id")) $.taskBar.closeDialog($(dialog).data("id")); } $("body").removeData($(dialog).data("id")); $(dialog).trigger(DWZ.eventType.pageClear).remove(); }, closeCurrent:function(){ this.close($.pdialog._current); }, checkTimeout:function(){ var $conetnt = $(".dialogContent", $.pdialog._current); var json = DWZ.jsonEval($conetnt.html()); if (json && json.statusCode == DWZ.statusCode.timeout) this.closeCurrent(); }, maxsize:function(dialog) { $(dialog).data("original",{ top:$(dialog).css("top"), left:$(dialog).css("left"), width:$(dialog).css("width"), height:$(dialog).css("height") }); $("a.maximize",dialog).hide(); $("a.restore",dialog).show(); var iContentW = $(window).width(); var iContentH = $(window).height() - 34; $(dialog).css({top:"0px",left:"0px",width:iContentW+"px",height:iContentH+"px"}); $.pdialog._resizeContent(dialog,iContentW,iContentH); }, restore:function(dialog) { var original = $(dialog).data("original"); var dwidth = parseInt(original.width); var dheight = parseInt(original.height); $(dialog).css({ top:original.top, left:original.left, width:dwidth, height:dheight }); $.pdialog._resizeContent(dialog,dwidth,dheight); $("a.maximize",dialog).show(); $("a.restore",dialog).hide(); $.pdialog.attachShadow(dialog); }, minimize:function(dialog){ $(dialog).hide(); $("div.shadow").hide(); var task = $.taskBar.getTask($(dialog).data("id")); $(".resizable").css({ top: $(dialog).css("top"), left: $(dialog).css("left"), height:$(dialog).css("height"), width:$(dialog).css("width") }).show().animate({top:$(window).height()-60,left:task.position().left,width:task.outerWidth(),height:task.outerHeight()},250,function(){ $(this).hide(); $.taskBar.inactive($(dialog).data("id")); }); }, _resizeContent:function(dialog,width,height) { var content = $(".dialogContent", dialog); content.css({width:(width-12) + "px",height:height - $(".dialogHeader", dialog).outerHeight() - $(".dialogFooter", dialog).outerHeight() - 6}); content.find("[layoutH]").layoutH(content); $(".pageContent", dialog).css("width", (width-14) + "px"); $(window).trigger(DWZ.eventType.resizeGrid); } }; })(jQuery);
zyroot
trunk/admin/dwz1.4.5/js/dwz.dialog.js
JavaScript
art
11,630
/** * @author ZhangHuihua@msn.com * */ var navTab = { componentBox: null, // tab component. contain tabBox, prevBut, nextBut, panelBox _tabBox: null, _prevBut: null, _nextBut: null, _panelBox: null, _moreBut:null, _moreBox:null, _currentIndex: 0, _op: {id:"navTab", stTabBox:".navTab-tab", stPanelBox:".navTab-panel", mainTabId:"main", close$:"a.close", prevClass:"tabsLeft", nextClass:"tabsRight", stMore:".tabsMore", stMoreLi:"ul.tabsMoreList"}, init: function(options){ if ($.History) $.History.init("#container"); var $this = this; $.extend(this._op, options); this.componentBox = $("#"+this._op.id); this._tabBox = this.componentBox.find(this._op.stTabBox); this._panelBox = this.componentBox.find(this._op.stPanelBox); this._prevBut = this.componentBox.find("."+this._op.prevClass); this._nextBut = this.componentBox.find("."+this._op.nextClass); this._moreBut = this.componentBox.find(this._op.stMore); this._moreBox = this.componentBox.find(this._op.stMoreLi); this._prevBut.click(function(event) {$this._scrollPrev()}); this._nextBut.click(function(event) {$this._scrollNext()}); this._moreBut.click(function(){ $this._moreBox.show(); return false; }); $(document).click(function(){$this._moreBox.hide()}); this._contextmenu(this._tabBox); this._contextmenu(this._getTabs()); this._init(); this._ctrlScrollBut(); }, _init: function(){ var $this = this; this._getTabs().each(function(iTabIndex){ $(this).unbind("click").click(function(event){ $this._switchTab(iTabIndex); }); $(this).find(navTab._op.close$).unbind("click").click(function(){ $this._closeTab(iTabIndex); }); }); this._getMoreLi().each(function(iTabIndex){ $(this).find(">a").unbind("click").click(function(event){ $this._switchTab(iTabIndex); }); }); this._switchTab(this._currentIndex); }, _contextmenu:function($obj){ // navTab右键菜单 var $this = this; $obj.contextMenu('navTabCM', { bindings:{ reload:function(t,m){ $this._reload(t, true); }, closeCurrent:function(t,m){ var tabId = t.attr("tabid"); if (tabId) $this.closeTab(tabId); else $this.closeCurrentTab(); }, closeOther:function(t,m){ var index = $this._indexTabId(t.attr("tabid")); $this._closeOtherTab(index > 0 ? index : $this._currentIndex); }, closeAll:function(t,m){ $this.closeAllTab(); } }, ctrSub:function(t,m){ var mReload = m.find("[rel='reload']"); var mCur = m.find("[rel='closeCurrent']"); var mOther = m.find("[rel='closeOther']"); var mAll = m.find("[rel='closeAll']"); var $tabLi = $this._getTabs(); if ($tabLi.size() < 2) { mCur.addClass("disabled"); mOther.addClass("disabled"); mAll.addClass("disabled"); } if ($this._currentIndex == 0 || t.attr("tabid") == $this._op.mainTabId) { mCur.addClass("disabled"); mReload.addClass("disabled"); } else if ($tabLi.size() == 2) { mOther.addClass("disabled"); } } }); }, _getTabs: function(){ return this._tabBox.find("> li"); }, _getPanels: function(){ return this._panelBox.find("> div"); }, _getMoreLi: function(){ return this._moreBox.find("> li"); }, _getTab: function(tabid){ var index = this._indexTabId(tabid); if (index >= 0) return this._getTabs().eq(index); }, getPanel: function(tabid){ var index = this._indexTabId(tabid); if (index >= 0) return this._getPanels().eq(index); }, _getTabsW: function(iStart, iEnd){ return this._tabsW(this._getTabs().slice(iStart, iEnd)); }, _tabsW:function($tabs){ var iW = 0; $tabs.each(function(){ iW += $(this).outerWidth(true); }); return iW; }, _indexTabId: function(tabid){ if (!tabid) return -1; var iOpenIndex = -1; this._getTabs().each(function(index){ if ($(this).attr("tabid") == tabid){iOpenIndex = index; return;} }); return iOpenIndex; }, _getLeft: function(){ return this._tabBox.position().left; }, _getScrollBarW: function(){ return this.componentBox.width()-55; }, _visibleStart: function(){ var iLeft = this._getLeft(), iW = 0; var $tabs = this._getTabs(); for (var i=0; i<$tabs.size(); i++){ if (iW + iLeft >= 0) return i; iW += $tabs.eq(i).outerWidth(true); } return 0; }, _visibleEnd: function(){ var iLeft = this._getLeft(), iW = 0; var $tabs = this._getTabs(); for (var i=0; i<$tabs.size(); i++){ iW += $tabs.eq(i).outerWidth(true); if (iW + iLeft > this._getScrollBarW()) return i; } return $tabs.size(); }, _scrollPrev: function(){ var iStart = this._visibleStart(); if (iStart > 0){ this._scrollTab(-this._getTabsW(0, iStart-1)); } }, _scrollNext: function(){ var iEnd = this._visibleEnd(); if (iEnd < this._getTabs().size()){ this._scrollTab(-this._getTabsW(0, iEnd+1) + this._getScrollBarW()); } }, _scrollTab: function(iLeft, isNext){ var $this = this; this._tabBox.animate({ left: iLeft+'px' }, 200, function(){$this._ctrlScrollBut();}); }, _scrollCurrent: function(){ // auto scroll current tab var iW = this._tabsW(this._getTabs()); if (iW <= this._getScrollBarW()){ this._scrollTab(0); } else if (this._getLeft() < this._getScrollBarW() - iW){ this._scrollTab(this._getScrollBarW()-iW); } else if (this._currentIndex < this._visibleStart()) { this._scrollTab(-this._getTabsW(0, this._currentIndex)); } else if (this._currentIndex >= this._visibleEnd()) { this._scrollTab(this._getScrollBarW() - this._getTabs().eq(this._currentIndex).outerWidth(true) - this._getTabsW(0, this._currentIndex)); } }, _ctrlScrollBut: function(){ var iW = this._tabsW(this._getTabs()); if (this._getScrollBarW() > iW){ this._prevBut.hide(); this._nextBut.hide(); this._tabBox.parent().removeClass("tabsPageHeaderMargin"); } else { this._prevBut.show().removeClass("tabsLeftDisabled"); this._nextBut.show().removeClass("tabsRightDisabled"); this._tabBox.parent().addClass("tabsPageHeaderMargin"); if (this._getLeft() >= 0){ this._prevBut.addClass("tabsLeftDisabled"); } else if (this._getLeft() <= this._getScrollBarW() - iW) { this._nextBut.addClass("tabsRightDisabled"); } } }, _switchTab: function(iTabIndex){ var $tab = this._getTabs().removeClass("selected").eq(iTabIndex).addClass("selected"); this._getPanels().hide().eq(iTabIndex).show(); this._getMoreLi().removeClass("selected").eq(iTabIndex).addClass("selected"); this._currentIndex = iTabIndex; this._scrollCurrent(); this._reload($tab); }, _closeTab: function(index, openTabid){ this._getTabs().eq(index).remove(); this._getPanels().eq(index).trigger(DWZ.eventType.pageClear).remove(); this._getMoreLi().eq(index).remove(); if (this._currentIndex >= index) this._currentIndex--; if (openTabid) { var openIndex = this._indexTabId(openTabid); if (openIndex > 0) this._currentIndex = openIndex; } this._init(); this._scrollCurrent(); this._reload(this._getTabs().eq(this._currentIndex)); }, closeTab: function(tabid){ var index = this._indexTabId(tabid); if (index > 0) { this._closeTab(index); } }, closeCurrentTab: function(openTabid){ //openTabid 可以为空,默认关闭当前tab后,打开最后一个tab if (this._currentIndex > 0) {this._closeTab(this._currentIndex, openTabid);} }, closeAllTab: function(){ this._getTabs().filter(":gt(0)").remove(); this._getPanels().filter(":gt(0)").trigger(DWZ.eventType.pageClear).remove(); this._getMoreLi().filter(":gt(0)").remove(); this._currentIndex = 0; this._init(); this._scrollCurrent(); }, _closeOtherTab: function(index){ index = index || this._currentIndex; if (index > 0) { var str$ = ":eq("+index+")"; this._getTabs().not(str$).filter(":gt(0)").remove(); this._getPanels().not(str$).filter(":gt(0)").trigger(DWZ.eventType.pageClear).remove(); this._getMoreLi().not(str$).filter(":gt(0)").remove(); this._currentIndex = 1; this._init(); this._scrollCurrent(); } else { this.closeAllTab(); } }, _loadUrlCallback: function($panel){ $panel.find("[layoutH]").layoutH(); $panel.find(":button.close").click(function(){ navTab.closeCurrentTab(); }); }, _reload: function($tab, flag){ flag = flag || $tab.data("reloadFlag"); var url = $tab.attr("url"); if (flag && url) { $tab.data("reloadFlag", null); var $panel = this.getPanel($tab.attr("tabid")); if ($tab.hasClass("external")){ navTab.openExternal(url, $panel); }else { //获取pagerForm参数 var $pagerForm = $("#pagerForm", $panel); var args = $pagerForm.size()>0 ? $pagerForm.serializeArray() : {} $panel.loadUrl(url, args, function(){navTab._loadUrlCallback($panel);}); } } }, reloadFlag: function(tabid){ var $tab = this._getTab(tabid); if ($tab){ if (this._indexTabId(tabid) == this._currentIndex) this._reload($tab, true); else $tab.data("reloadFlag", 1); } }, reload: function(url, options){ var op = $.extend({data:{}, navTabId:"", callback:null}, options); var $tab = op.navTabId ? this._getTab(op.navTabId) : this._getTabs().eq(this._currentIndex); var $panel = op.navTabId ? this.getPanel(op.navTabId) : this._getPanels().eq(this._currentIndex); if ($panel){ if (!url) { url = $tab.attr("url"); } if (url) { if ($tab.hasClass("external")) { navTab.openExternal(url, $panel); } else { if ($.isEmptyObject(op.data)) { //获取pagerForm参数 var $pagerForm = $("#pagerForm", $panel); op.data = $pagerForm.size()>0 ? $pagerForm.serializeArray() : {} } $panel.ajaxUrl({ type:"POST", url:url, data:op.data, callback:function(response){ navTab._loadUrlCallback($panel); if ($.isFunction(op.callback)) op.callback(response); } }); } } } }, getCurrentPanel: function() { return this._getPanels().eq(this._currentIndex); }, checkTimeout:function(){ var json = DWZ.jsonEval(this.getCurrentPanel().html()); if (json && json.statusCode == DWZ.statusCode.timeout) this.closeCurrentTab(); }, openExternal:function(url, $panel){ var ih = navTab._panelBox.height(); $panel.html(DWZ.frag["externalFrag"].replaceAll("{url}", url).replaceAll("{height}", ih+"px")); }, /** * * @param {Object} tabid * @param {Object} url * @param {Object} params: title, data, fresh */ openTab: function(tabid, url, options){ //if found tabid replace tab, else create a new tab. var op = $.extend({title:"New Tab", data:{}, fresh:true, external:false}, options); var iOpenIndex = this._indexTabId(tabid); if (iOpenIndex >= 0){ var $tab = this._getTabs().eq(iOpenIndex); var span$ = $tab.attr("tabid") == this._op.mainTabId ? "> span > span" : "> span"; $tab.find(">a").attr("title", op.title).find(span$).text(op.title); var $panel = this._getPanels().eq(iOpenIndex); if(op.fresh || $tab.attr("url") != url) { $tab.attr("url", url); if (op.external || url.isExternalUrl()) { $tab.addClass("external"); navTab.openExternal(url, $panel); } else { $tab.removeClass("external"); $panel.ajaxUrl({ type:"GET", url:url, data:op.data, callback:function(){ navTab._loadUrlCallback($panel); } }); } } this._currentIndex = iOpenIndex; } else { var tabFrag = '<li tabid="#tabid#"><a href="javascript:" title="#title#" class="#tabid#"><span>#title#</span></a><a href="javascript:;" class="close">close</a></li>'; this._tabBox.append(tabFrag.replaceAll("#tabid#", tabid).replaceAll("#title#", op.title)); this._panelBox.append('<div class="page unitBox"></div>'); this._moreBox.append('<li><a href="javascript:" title="#title#">#title#</a></li>'.replaceAll("#title#", op.title)); var $tabs = this._getTabs(); var $tab = $tabs.filter(":last"); var $panel = this._getPanels().filter(":last"); if (op.external || url.isExternalUrl()) { $tab.addClass("external"); navTab.openExternal(url, $panel); } else { $tab.removeClass("external"); $panel.ajaxUrl({ type:"GET", url:url, data:op.data, callback:function(){ navTab._loadUrlCallback($panel); } }); } if ($.History) { setTimeout(function(){ $.History.addHistory(tabid, function(tabid){ var i = navTab._indexTabId(tabid); if (i >= 0) navTab._switchTab(i); }, tabid); }, 10); } this._currentIndex = $tabs.size() - 1; this._contextmenu($tabs.filter(":last").hoverClass("hover")); } this._init(); this._scrollCurrent(); this._getTabs().eq(this._currentIndex).attr("url", url); } };
zyroot
trunk/admin/dwz1.4.5/js/dwz.navTab.js
JavaScript
art
13,069
/** * @author Roger Wu * @version 1.0 * added extend property oncheck */ (function($){ $.extend($.fn, { jTree:function(options) { var op = $.extend({checkFn:null, selected:"selected", exp:"expandable", coll:"collapsable", firstExp:"first_expandable", firstColl:"first_collapsable", lastExp:"last_expandable", lastColl:"last_collapsable", folderExp:"folder_expandable", folderColl:"folder_collapsable", endExp:"end_expandable", endColl:"end_collapsable",file:"file",ck:"checked", unck:"unchecked"}, options); return this.each(function(){ var $this = $(this); var cnum = $this.children().length; $(">li", $this).each(function(){ var $li = $(this); var first = $li.prev()[0]?false:true; var last = $li.next()[0]?false:true; $li.genTree({ icon:$this.hasClass("treeFolder"), ckbox:$this.hasClass("treeCheck"), options: op, level: 0, exp:(cnum>1?(first?op.firstExp:(last?op.lastExp:op.exp)):op.endExp), coll:(cnum>1?(first?op.firstColl:(last?op.lastColl:op.coll)):op.endColl), showSub:(!$this.hasClass("collapse") && ($this.hasClass("expand") || (cnum>1?(first?true:false):true))), isLast:(cnum>1?(last?true:false):true) }); }); setTimeout(function(){ if($this.hasClass("treeCheck")){ var checkFn = eval($this.attr("oncheck")); if(checkFn && $.isFunction(checkFn)) { $("div.ckbox", $this).each(function(){ var ckbox = $(this); ckbox.click(function(){ var checked = $(ckbox).hasClass("checked"); var items = []; if(checked){ var tnode = $(ckbox).parent().parent(); var boxes = $("input", tnode); if(boxes.size() > 1) { $(boxes).each(function(){ items[items.length] = {name:$(this).attr("name"), value:$(this).val(), text:$(this).attr("text")}; }); } else { items = {name:boxes.attr("name"), value:boxes.val(), text:boxes.attr("text")}; } } checkFn({checked:checked, items:items}); }); }); } } $("a", $this).click(function(event){ $("div." + op.selected, $this).removeClass(op.selected); var parent = $(this).parent().addClass(op.selected); var $li = $(this).parents("li:first"), sTarget = $li.attr("target"); if (sTarget) { if ($("#"+sTarget, $this).size() == 0) { $this.prepend('<input id="'+sTarget+'" type="hidden" />'); } $("#"+sTarget, $this).val($li.attr("rel")); } $(".ckbox",parent).trigger("click"); event.stopPropagation(); $(document).trigger("click"); if (!$(this).attr("target")) return false; }); },1); }); }, subTree:function(op, level) { return this.each(function(){ $(">li", this).each(function(){ var $this = $(this); var isLast = ($this.next()[0]?false:true); $this.genTree({ icon:op.icon, ckbox:op.ckbox, exp:isLast?op.options.lastExp:op.options.exp, coll:isLast?op.options.lastColl:op.options.coll, options:op.options, level:level, space:isLast?null:op.space, showSub:op.showSub, isLast:isLast }); }); }); }, genTree:function(options) { var op = $.extend({icon:options.icon,ckbox:options.ckbox,exp:"", coll:"", showSub:false, level:0, options:null, isLast:false}, options); return this.each(function(){ var node = $(this); var tree = $(">ul", node); var parent = node.parent().prev(); var checked = 'unchecked'; if(op.ckbox) { if($(">.checked",parent).size() > 0) checked = 'checked'; } if (tree.size()>0) { node.children(":first").wrap("<div></div>"); $(">div", node).prepend("<div class='" + (op.showSub ? op.coll : op.exp) + "'></div>"+(op.ckbox ?"<div class='ckbox " + checked + "'></div>":"")+(op.icon?"<div class='"+ (op.showSub ? op.options.folderColl : op.options.folderExp) +"'></div>":"")); op.showSub ? tree.show() : tree.hide(); $(">div>div:first,>div>a", node).click(function(){ var $fnode = $(">li:first",tree); if($fnode.children(":first").isTag('a')) tree.subTree(op, op.level + 1); var $this = $(this); var isA = $this.isTag('a'); var $this = isA?$(">div>div", node).eq(op.level):$this; if (!isA || tree.is(":hidden")) { $this.toggleClass(op.exp).toggleClass(op.coll); if (op.icon) { $(">div>div:last", node).toggleClass(op.options.folderExp).toggleClass(op.options.folderColl); } } (tree.is(":hidden"))?tree.slideDown("fast"):(isA?"":tree.slideUp("fast")); return false; }); addSpace(op.level, node); if(op.showSub) tree.subTree(op, op.level + 1); } else { node.children().wrap("<div></div>"); $(">div", node).prepend("<div class='node'></div>"+(op.ckbox?"<div class='ckbox "+checked+"'></div>":"")+(op.icon?"<div class='file'></div>":"")); addSpace(op.level, node); if(op.isLast)$(node).addClass("last"); } if (op.ckbox) node._check(op); $(">div",node).mouseover(function(){ $(this).addClass("hover"); }).mouseout(function(){ $(this).removeClass("hover"); }); if($.browser.msie) $(">div",node).click(function(){ $("a", this).trigger("click"); return false; }); }); function addSpace(level,node) { if (level > 0) { var parent = node.parent().parent(); var space = !parent.next()[0]?"indent":"line"; var plist = "<div class='" + space + "'></div>"; if (level > 1) { var next = $(">div>div", parent).filter(":first"); var prev = ""; while(level > 1){ prev = prev + "<div class='" + next.attr("class") + "'></div>"; next = next.next(); level--; } plist = prev + plist; } $(">div", node).prepend(plist); } } }, _check:function(op) { var node = $(this); var ckbox = $(">div>.ckbox", node); var $input = node.find("a"); var tname = $input.attr("tname"), tvalue = $input.attr("tvalue"); var attrs = "text='"+$input.text()+"' "; if (tname) attrs += "name='"+tname+"' "; if (tvalue) attrs += "value='"+tvalue+"' "; ckbox.append("<input type='checkbox' style='display:none;' " + attrs + "/>").click(function(){ var cked = ckbox.hasClass("checked"); var aClass = cked?"unchecked":"checked"; var rClass = cked?"checked":"unchecked"; ckbox.removeClass(rClass).removeClass(!cked?"indeterminate":"").addClass(aClass); $("input", ckbox).attr("checked", !cked); $(">ul", node).find("li").each(function(){ var box = $("div.ckbox", this); box.removeClass(rClass).removeClass(!cked?"indeterminate":"").addClass(aClass) .find("input").attr("checked", !cked); }); $(node)._checkParent(); return false; }); var cAttr = $input.attr("checked") || false; if (cAttr) { ckbox.find("input").attr("checked", true); ckbox.removeClass("unchecked").addClass("checked"); $(node)._checkParent(); } }, _checkParent:function(){ if($(this).parent().hasClass("tree")) return; var parent = $(this).parent().parent(); var stree = $(">ul", parent); var ckbox = stree.find(">li>a").size()+stree.find("div.ckbox").size(); var ckboxed = stree.find("div.checked").size(); var aClass = (ckboxed==ckbox?"checked":(ckboxed!=0?"indeterminate":"unchecked")); var rClass = (ckboxed==ckbox?"indeterminate":(ckboxed!=0?"checked":"indeterminate")); $(">div>.ckbox", parent).removeClass("unchecked").removeClass("checked").removeClass(rClass).addClass(aClass); var $checkbox = $(":checkbox", parent); if (aClass == "checked") $checkbox.attr("checked","checked"); else $checkbox.removeAttr("checked"); parent._checkParent(); } }); })(jQuery);
zyroot
trunk/admin/dwz1.4.5/js/dwz.tree.js
JavaScript
art
7,881
/** * @author ZhangHuihua@msn.com * */ var DWZ = { // sbar: show sidebar keyCode: { ENTER: 13, ESC: 27, END: 35, HOME: 36, SHIFT: 16, TAB: 9, LEFT: 37, RIGHT: 39, UP: 38, DOWN: 40, DELETE: 46, BACKSPACE:8 }, eventType: { pageClear:"pageClear", // 用于重新ajaxLoad、关闭nabTab, 关闭dialog时,去除xheditor等需要特殊处理的资源 resizeGrid:"resizeGrid" // 用于窗口或dialog大小调整 }, isOverAxis: function(x, reference, size) { //Determines when x coordinate is over "b" element axis return (x > reference) && (x < (reference + size)); }, isOver: function(y, x, top, left, height, width) { //Determines when x, y coordinates is over "b" element return this.isOverAxis(y, top, height) && this.isOverAxis(x, left, width); }, pageInfo: {pageNum:"pageNum", numPerPage:"numPerPage", orderField:"orderField", orderDirection:"orderDirection"}, statusCode: {ok:200, error:300, timeout:301}, ui:{sbar:true}, frag:{}, //page fragment _msg:{}, //alert message _set:{ loginUrl:"", //session timeout loginTitle:"", //if loginTitle open a login dialog debug:false }, msg:function(key, args){ var _format = function(str,args) { args = args || []; var result = str || ""; for (var i = 0; i < args.length; i++){ result = result.replace(new RegExp("\\{" + i + "\\}", "g"), args[i]); } return result; } return _format(this._msg[key], args); }, debug:function(msg){ if (this._set.debug) { if (typeof(console) != "undefined") console.log(msg); else alert(msg); } }, loadLogin:function(){ if ($.pdialog && DWZ._set.loginTitle) { $.pdialog.open(DWZ._set.loginUrl, "login", DWZ._set.loginTitle, {mask:true,width:520,height:260}); } else { window.location = DWZ._set.loginUrl; } }, /* * json to string */ obj2str:function(o) { var r = []; if(typeof o =="string") return "\""+o.replace(/([\'\"\\])/g,"\\$1").replace(/(\n)/g,"\\n").replace(/(\r)/g,"\\r").replace(/(\t)/g,"\\t")+"\""; if(typeof o == "object"){ if(!o.sort){ for(var i in o) r.push(i+":"+DWZ.obj2str(o[i])); if(!!document.all && !/^\n?function\s*toString\(\)\s*\{\n?\s*\[native code\]\n?\s*\}\n?\s*$/.test(o.toString)){ r.push("toString:"+o.toString.toString()); } r="{"+r.join()+"}" }else{ for(var i =0;i<o.length;i++) { r.push(DWZ.obj2str(o[i])); } r="["+r.join()+"]" } return r; } return o.toString(); }, jsonEval:function(data) { try{ if ($.type(data) == 'string') return eval('(' + data + ')'); else return data; } catch (e){ return {}; } }, ajaxError:function(xhr, ajaxOptions, thrownError){ if (alertMsg) { alertMsg.error("<div>Http status: " + xhr.status + " " + xhr.statusText + "</div>" + "<div>ajaxOptions: "+ajaxOptions + "</div>" + "<div>thrownError: "+thrownError + "</div>" + "<div>"+xhr.responseText+"</div>"); } else { alert("Http status: " + xhr.status + " " + xhr.statusText + "\najaxOptions: " + ajaxOptions + "\nthrownError:"+thrownError + "\n" +xhr.responseText); } }, ajaxDone:function(json){ if(json.statusCode == DWZ.statusCode.error) { if(json.message && alertMsg) alertMsg.error(json.message); } else if (json.statusCode == DWZ.statusCode.timeout) { if(alertMsg) alertMsg.error(json.message || DWZ.msg("sessionTimout"), {okCall:DWZ.loadLogin}); else DWZ.loadLogin(); } else { if(json.message && alertMsg) alertMsg.correct(json.message); }; }, init:function(pageFrag, options){ var op = $.extend({ loginUrl:"login.html", loginTitle:null, callback:null, debug:false, statusCode:{} }, options); this._set.loginUrl = op.loginUrl; this._set.loginTitle = op.loginTitle; this._set.debug = op.debug; $.extend(DWZ.statusCode, op.statusCode); $.extend(DWZ.pageInfo, op.pageInfo); jQuery.ajax({ type:'GET', url:pageFrag, dataType:'xml', timeout: 50000, cache: false, error: function(xhr){ alert('Error loading XML document: ' + pageFrag + "\nHttp status: " + xhr.status + " " + xhr.statusText); }, success: function(xml){ $(xml).find("_PAGE_").each(function(){ var pageId = $(this).attr("id"); if (pageId) DWZ.frag[pageId] = $(this).text(); }); $(xml).find("_MSG_").each(function(){ var id = $(this).attr("id"); if (id) DWZ._msg[id] = $(this).text(); }); if (jQuery.isFunction(op.callback)) op.callback(); } }); var _doc = $(document); if (!_doc.isBind(DWZ.eventType.pageClear)) { _doc.bind(DWZ.eventType.pageClear, function(event){ var box = event.target; if ($.fn.xheditor) { $("textarea.editor", box).xheditor(false); } }); } } }; (function($){ // DWZ set regional $.setRegional = function(key, value){ if (!$.regional) $.regional = {}; $.regional[key] = value; }; $.fn.extend({ /** * @param {Object} op: {type:GET/POST, url:ajax请求地址, data:ajax请求参数列表, callback:回调函数 } */ ajaxUrl: function(op){ var $this = $(this); $this.trigger(DWZ.eventType.pageClear); $.ajax({ type: op.type || 'GET', url: op.url, data: op.data, cache: false, success: function(response){ var json = DWZ.jsonEval(response); if (json.statusCode==DWZ.statusCode.error){ if (json.message) alertMsg.error(json.message); } else { $this.html(response).initUI(); if ($.isFunction(op.callback)) op.callback(response); } if (json.statusCode==DWZ.statusCode.timeout){ if ($.pdialog) $.pdialog.checkTimeout(); if (navTab) navTab.checkTimeout(); alertMsg.error(json.message || DWZ.msg("sessionTimout"), {okCall:function(){ DWZ.loadLogin(); }}); } }, error: DWZ.ajaxError, statusCode: { 503: function(xhr, ajaxOptions, thrownError) { alert(DWZ.msg("statusCode_503") || thrownError); } } }); }, loadUrl: function(url,data,callback){ $(this).ajaxUrl({url:url, data:data, callback:callback}); }, initUI: function(){ return this.each(function(){ if($.isFunction(initUI)) initUI(this); }); }, /** * adjust component inner reference box height * @param {Object} refBox: reference box jQuery Obj */ layoutH: function($refBox){ return this.each(function(){ var $this = $(this); if (! $refBox) $refBox = $this.parents("div.layoutBox:first"); var iRefH = $refBox.height(); var iLayoutH = parseInt($this.attr("layoutH")); var iH = iRefH - iLayoutH > 50 ? iRefH - iLayoutH : 50; if ($this.isTag("table")) { $this.removeAttr("layoutH").wrap('<div layoutH="'+iLayoutH+'" style="overflow:auto;height:'+iH+'px"></div>'); } else { $this.height(iH).css("overflow","auto"); } }); }, hoverClass: function(className, speed){ var _className = className || "hover"; return this.each(function(){ var $this = $(this), mouseOutTimer; $this.hover(function(){ if (mouseOutTimer) clearTimeout(mouseOutTimer); $this.addClass(_className); },function(){ mouseOutTimer = setTimeout(function(){$this.removeClass(_className);}, speed||10); }); }); }, focusClass: function(className){ var _className = className || "textInputFocus"; return this.each(function(){ $(this).focus(function(){ $(this).addClass(_className); }).blur(function(){ $(this).removeClass(_className); }); }); }, inputAlert: function(){ return this.each(function(){ var $this = $(this); function getAltBox(){ return $this.parent().find("label.alt"); } function altBoxCss(opacity){ var position = $this.position(); return { width:$this.width(), top:position.top+'px', left:position.left +'px', opacity:opacity || 1 }; } if (getAltBox().size() < 1) { if (!$this.attr("id")) $this.attr("id", $this.attr("name") + "_" +Math.round(Math.random()*10000)); var $label = $('<label class="alt" for="'+$this.attr("id")+'">'+$this.attr("alt")+'</label>').appendTo($this.parent()); $label.css(altBoxCss(1)); if ($this.val()) $label.hide(); } $this.focus(function(){ getAltBox().css(altBoxCss(0.3)); }).blur(function(){ if (!$(this).val()) getAltBox().show().css("opacity",1); }).keydown(function(){ getAltBox().hide(); }); }); }, isTag:function(tn) { if(!tn) return false; return $(this)[0].tagName.toLowerCase() == tn?true:false; }, /** * 判断当前元素是否已经绑定某个事件 * @param {Object} type */ isBind:function(type) { var _events = $(this).data("events"); return _events && type && _events[type]; }, /** * 输出firebug日志 * @param {Object} msg */ log:function(msg){ return this.each(function(){ if (console) console.log("%s: %o", msg, this); }); } }); /** * 扩展String方法 */ $.extend(String.prototype, { isPositiveInteger:function(){ return (new RegExp(/^[1-9]\d*$/).test(this)); }, isInteger:function(){ return (new RegExp(/^\d+$/).test(this)); }, isNumber: function(value, element) { return (new RegExp(/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/).test(this)); }, trim:function(){ return this.replace(/(^\s*)|(\s*$)|\r|\n/g, ""); }, startsWith:function (pattern){ return this.indexOf(pattern) === 0; }, endsWith:function(pattern) { var d = this.length - pattern.length; return d >= 0 && this.lastIndexOf(pattern) === d; }, replaceSuffix:function(index){ return this.replace(/\[[0-9]+\]/,'['+index+']').replace('#index#',index); }, trans:function(){ return this.replace(/&lt;/g, '<').replace(/&gt;/g,'>').replace(/&quot;/g, '"'); }, encodeTXT: function(){ return (this).replaceAll('&', '&amp;').replaceAll("<","&lt;").replaceAll(">", "&gt;").replaceAll(" ", "&nbsp;"); }, replaceAll:function(os, ns){ return this.replace(new RegExp(os,"gm"),ns); }, replaceTm:function($data){ if (!$data) return this; return this.replace(RegExp("({[A-Za-z_]+[A-Za-z0-9_]*})","g"), function($1){ return $data[$1.replace(/[{}]+/g, "")]; }); }, replaceTmById:function(_box){ var $parent = _box || $(document); return this.replace(RegExp("({[A-Za-z_]+[A-Za-z0-9_]*})","g"), function($1){ var $input = $parent.find("#"+$1.replace(/[{}]+/g, "")); return $input.val() ? $input.val() : $1; }); }, isFinishedTm:function(){ return !(new RegExp("{[A-Za-z_]+[A-Za-z0-9_]*}").test(this)); }, skipChar:function(ch) { if (!this || this.length===0) {return '';} if (this.charAt(0)===ch) {return this.substring(1).skipChar(ch);} return this; }, isValidPwd:function() { return (new RegExp(/^([_]|[a-zA-Z0-9]){6,32}$/).test(this)); }, isValidMail:function(){ return(new RegExp(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/).test(this.trim())); }, isSpaces:function() { for(var i=0; i<this.length; i+=1) { var ch = this.charAt(i); if (ch!=' '&& ch!="\n" && ch!="\t" && ch!="\r") {return false;} } return true; }, isPhone:function() { return (new RegExp(/(^([0-9]{3,4}[-])?\d{3,8}(-\d{1,6})?$)|(^\([0-9]{3,4}\)\d{3,8}(\(\d{1,6}\))?$)|(^\d{3,8}$)/).test(this)); }, isUrl:function(){ return (new RegExp(/^[a-zA-z]+:\/\/([a-zA-Z0-9\-\.]+)([-\w .\/?%&=:]*)$/).test(this)); }, isExternalUrl:function(){ return this.isUrl() && this.indexOf("://"+document.domain) == -1; } }); })(jQuery); /** * You can use this map like this: * var myMap = new Map(); * myMap.put("key","value"); * var key = myMap.get("key"); * myMap.remove("key"); */ function Map(){ this.elements = new Array(); this.size = function(){ return this.elements.length; } this.isEmpty = function(){ return (this.elements.length < 1); } this.clear = function(){ this.elements = new Array(); } this.put = function(_key, _value){ this.remove(_key); this.elements.push({key: _key, value: _value}); } this.remove = function(_key){ try { for (i = 0; i < this.elements.length; i++) { if (this.elements[i].key == _key) { this.elements.splice(i, 1); return true; } } } catch (e) { return false; } return false; } this.get = function(_key){ try { for (i = 0; i < this.elements.length; i++) { if (this.elements[i].key == _key) { return this.elements[i].value; } } } catch (e) { return null; } } this.element = function(_index){ if (_index < 0 || _index >= this.elements.length) { return null; } return this.elements[_index]; } this.containsKey = function(_key){ try { for (i = 0; i < this.elements.length; i++) { if (this.elements[i].key == _key) { return true; } } } catch (e) { return false; } return false; } this.values = function(){ var arr = new Array(); for (i = 0; i < this.elements.length; i++) { arr.push(this.elements[i].value); } return arr; } this.keys = function(){ var arr = new Array(); for (i = 0; i < this.elements.length; i++) { arr.push(this.elements[i].key); } return arr; } }
zyroot
trunk/admin/dwz1.4.5/js/dwz.core.js
JavaScript
art
13,669
/** * @author ZhangHuihua@msn.com * ---------------------------------------------------------- * These functions use the same 'format' strings as the * java.text.SimpleDateFormat class, with minor exceptions. * The format string consists of the following abbreviations: * * Field | Full Form | Short Form * -------------+--------------------+----------------------- * Year | yyyy (4 digits) | yy (2 digits), y (2 or 4 digits) * Month | MMM (name or abbr.)| MM (2 digits), M (1 or 2 digits) * | NNN (abbr.) | * Day of Month | dd (2 digits) | d (1 or 2 digits) * Day of Week | EE (name) | E (abbr) * Hour (1-12) | hh (2 digits) | h (1 or 2 digits) * Hour (0-23) | HH (2 digits) | H (1 or 2 digits) * Hour (0-11) | KK (2 digits) | K (1 or 2 digits) * Hour (1-24) | kk (2 digits) | k (1 or 2 digits) * Minute | mm (2 digits) | m (1 or 2 digits) * Second | ss (2 digits) | s (1 or 2 digits) * AM/PM | a | * * NOTE THE DIFFERENCE BETWEEN MM and mm! Month=MM, not mm! * Examples: * "MMM d, y" matches: January 01, 2000 * Dec 1, 1900 * Nov 20, 00 * "M/d/yy" matches: 01/20/00 * 9/2/00 * "MMM dd, yyyy hh:mm:ssa" matches: "January 01, 2000 12:30:45AM" * ---------------------------------------------------------- */ (function(){ var MONTH_NAMES=new Array('January','February','March','April','May','June','July','August','September','October','November','December','Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'); var DAY_NAMES=new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sun','Mon','Tue','Wed','Thu','Fri','Sat'); function LZ(x) {return(x<0||x>9?"":"0")+x} /** * formatDate (date_object, format) * Returns a date in the output format specified. * The format string uses the same abbreviations as in parseDate() * @param {Object} date * @param {Object} format */ function formatDate(date,format) { format=format+""; var result=""; var i_format=0; var c=""; var token=""; var y=date.getYear()+""; var M=date.getMonth()+1; var d=date.getDate(); var E=date.getDay(); var H=date.getHours(); var m=date.getMinutes(); var s=date.getSeconds(); var yyyy,yy,MMM,MM,dd,hh,h,mm,ss,ampm,HH,H,KK,K,kk,k; // Convert real date parts into formatted versions var value={}; if (y.length < 4) {y=""+(y-0+1900);} value["y"]=""+y; value["yyyy"]=y; value["yy"]=y.substring(2,4); value["M"]=M; value["MM"]=LZ(M); value["MMM"]=MONTH_NAMES[M-1]; value["NNN"]=MONTH_NAMES[M+11]; value["d"]=d; value["dd"]=LZ(d); value["E"]=DAY_NAMES[E+7]; value["EE"]=DAY_NAMES[E]; value["H"]=H; value["HH"]=LZ(H); if (H==0){value["h"]=12;} else if (H>12){value["h"]=H-12;} else {value["h"]=H;} value["hh"]=LZ(value["h"]); if (H>11){value["K"]=H-12;} else {value["K"]=H;} value["k"]=H+1; value["KK"]=LZ(value["K"]); value["kk"]=LZ(value["k"]); if (H > 11) { value["a"]="PM"; } else { value["a"]="AM"; } value["m"]=m; value["mm"]=LZ(m); value["s"]=s; value["ss"]=LZ(s); while (i_format < format.length) { c=format.charAt(i_format); token=""; while ((format.charAt(i_format)==c) && (i_format < format.length)) { token += format.charAt(i_format++); } if (value[token] != null) { result += value[token]; } else { result += token; } } return result; } function _isInteger(val) { return (new RegExp(/^\d+$/).test(val)); } function _getInt(str,i,minlength,maxlength) { for (var x=maxlength; x>=minlength; x--) { var token=str.substring(i,i+x); if (token.length < minlength) { return null; } if (_isInteger(token)) { return token; } } return null; } /** * parseDate( date_string , format_string ) * * This function takes a date string and a format string. It matches * If the date string matches the format string, it returns the date. * If it does not match, it returns 0. * @param {Object} val * @param {Object} format */ function parseDate(val,format) { val=val+""; format=format+""; var i_val=0; var i_format=0; var c=""; var token=""; var token2=""; var x,y; var now=new Date(1900,0,1); var year=now.getYear(); var month=now.getMonth()+1; var date=1; var hh=now.getHours(); var mm=now.getMinutes(); var ss=now.getSeconds(); var ampm=""; while (i_format < format.length) { // Get next token from format string c=format.charAt(i_format); token=""; while ((format.charAt(i_format)==c) && (i_format < format.length)) { token += format.charAt(i_format++); } // Extract contents of value based on format token if (token=="yyyy" || token=="yy" || token=="y") { if (token=="yyyy") { x=4;y=4; } if (token=="yy") { x=2;y=2; } if (token=="y") { x=2;y=4; } year=_getInt(val,i_val,x,y); if (year==null) { return 0; } i_val += year.length; if (year.length==2) { if (year > 70) { year=1900+(year-0); } else { year=2000+(year-0); } } } else if (token=="MMM"||token=="NNN"){ month=0; for (var i=0; i<MONTH_NAMES.length; i++) { var month_name=MONTH_NAMES[i]; if (val.substring(i_val,i_val+month_name.length).toLowerCase()==month_name.toLowerCase()) { if (token=="MMM"||(token=="NNN"&&i>11)) { month=i+1; if (month>12) { month -= 12; } i_val += month_name.length; break; } } } if ((month < 1)||(month>12)){return 0;} } else if (token=="EE"||token=="E"){ for (var i=0; i<DAY_NAMES.length; i++) { var day_name=DAY_NAMES[i]; if (val.substring(i_val,i_val+day_name.length).toLowerCase()==day_name.toLowerCase()) { i_val += day_name.length; break; } } } else if (token=="MM"||token=="M") { month=_getInt(val,i_val,token.length,2); if(month==null||(month<1)||(month>12)){return 0;} i_val+=month.length; } else if (token=="dd"||token=="d") { date=_getInt(val,i_val,token.length,2); if(date==null||(date<1)||(date>31)){return 0;} i_val+=date.length; } else if (token=="hh"||token=="h") { hh=_getInt(val,i_val,token.length,2); if(hh==null||(hh<1)||(hh>12)){return 0;} i_val+=hh.length; } else if (token=="HH"||token=="H") { hh=_getInt(val,i_val,token.length,2); if(hh==null||(hh<0)||(hh>23)){return 0;} i_val+=hh.length;} else if (token=="KK"||token=="K") { hh=_getInt(val,i_val,token.length,2); if(hh==null||(hh<0)||(hh>11)){return 0;} i_val+=hh.length; } else if (token=="kk"||token=="k") { hh=_getInt(val,i_val,token.length,2); if(hh==null||(hh<1)||(hh>24)){return 0;} i_val+=hh.length;hh--; } else if (token=="mm"||token=="m") { mm=_getInt(val,i_val,token.length,2); if(mm==null||(mm<0)||(mm>59)){return 0;} i_val+=mm.length; } else if (token=="ss"||token=="s") { ss=_getInt(val,i_val,token.length,2); if(ss==null||(ss<0)||(ss>59)){return 0;} i_val+=ss.length; } else if (token=="a") { if (val.substring(i_val,i_val+2).toLowerCase()=="am") {ampm="AM";} else if (val.substring(i_val,i_val+2).toLowerCase()=="pm") {ampm="PM";} else {return 0;} i_val+=2; } else { if (val.substring(i_val,i_val+token.length)!=token) {return 0;} else {i_val+=token.length;} } } // If there are any trailing characters left in the value, it doesn't match if (i_val != val.length) { return 0; } // Is date valid for month? if (month==2) { // Check for leap year if ( ( (year%4==0)&&(year%100 != 0) ) || (year%400==0) ) { // leap year if (date > 29){ return 0; } } else { if (date > 28) { return 0; } } } if ((month==4)||(month==6)||(month==9)||(month==11)) { if (date > 30) { return 0; } } // Correct hours value if (hh<12 && ampm=="PM") { hh=hh-0+12; } else if (hh>11 && ampm=="AM") { hh-=12; } return new Date(year,month-1,date,hh,mm,ss); } Date.prototype.formatDate = function(dateFmt) { return formatDate(this, dateFmt); }; String.prototype.parseDate = function(dateFmt) { if (this.length < dateFmt.length) { dateFmt = dateFmt.slice(0,this.length); } return parseDate(this, dateFmt); }; /** * replaceTmEval("{1+2}-{2-1}") */ function replaceTmEval(data){ return data.replace(RegExp("({[A-Za-z0-9_+-]*})","g"), function($1){ return eval('(' + $1.replace(/[{}]+/g, "") + ')'); }); } /** * dateFmt:%y-%M-%d * %y-%M-{%d+1} * ex: new Date().formatDateTm('%y-%M-{%d-1}') * new Date().formatDateTm('2012-1') */ Date.prototype.formatDateTm = function(dateFmt) { var y = this.getFullYear(); var m = this.getMonth()+1; var d = this.getDate(); var sDate = dateFmt.replaceAll("%y",y).replaceAll("%M",m).replaceAll("%d",d); sDate = replaceTmEval(sDate); var _y=1900, _m=0, _d=1; var aDate = sDate.split('-'); if (aDate.length > 0) _y = aDate[0]; if (aDate.length > 1) _m = aDate[1]-1; if (aDate.length > 2) _d = aDate[2]; return new Date(_y,_m,_d).formatDate('yyyy-MM-dd'); }; })();
zyroot
trunk/admin/dwz1.4.5/js/dwz.util.date.js
JavaScript
art
8,906
/** * @author ZhangHuihua@msn.com */ (function($){ $.fn.extend({ checkboxCtrl: function(parent){ return this.each(function(){ var $trigger = $(this); $trigger.click(function(){ var group = $trigger.attr("group"); if ($trigger.is(":checkbox")) { var type = $trigger.is(":checked") ? "all" : "none"; if (group) $.checkbox.select(group, type, parent); } else { if (group) $.checkbox.select(group, $trigger.attr("selectType") || "all", parent); } }); }); } }); $.checkbox = { selectAll: function(_name, _parent){ this.select(_name, "all", _parent); }, unSelectAll: function(_name, _parent){ this.select(_name, "none", _parent); }, selectInvert: function(_name, _parent){ this.select(_name, "invert", _parent); }, select: function(_name, _type, _parent){ $parent = $(_parent || document); $checkboxLi = $parent.find(":checkbox[name='"+_name+"']"); switch(_type){ case "invert": $checkboxLi.each(function(){ $checkbox = $(this); $checkbox.attr('checked', !$checkbox.is(":checked")); }); break; case "none": $checkboxLi.attr('checked', false); break; default: $checkboxLi.attr('checked', true); break; } } }; })(jQuery);
zyroot
trunk/admin/dwz1.4.5/js/dwz.checkbox.js
JavaScript
art
1,340
/** * Theme Plugins * @author ZhangHuihua@msn.com */ (function($){ $.fn.extend({ theme: function(options){ var op = $.extend({themeBase:"themes"}, options); var _themeHref = op.themeBase + "/#theme#/style.css"; return this.each(function(){ var jThemeLi = $(this).find(">li[theme]"); var setTheme = function(themeName){ $("head").find("link[href$='style.css']").attr("href", _themeHref.replace("#theme#", themeName)); jThemeLi.find(">div").removeClass("selected"); jThemeLi.filter("[theme="+themeName+"]").find(">div").addClass("selected"); if ($.isFunction($.cookie)) $.cookie("dwz_theme", themeName); } jThemeLi.each(function(index){ var $this = $(this); var themeName = $this.attr("theme"); $this.addClass(themeName).click(function(){ setTheme(themeName); }); }); if ($.isFunction($.cookie)){ var themeName = $.cookie("dwz_theme"); if (themeName) { setTheme(themeName); } } }); } }); })(jQuery);
zyroot
trunk/admin/dwz1.4.5/js/dwz.theme.js
JavaScript
art
1,074
/** * reference dwz.util.date.js * @author ZhangHuihua@msn.com * */ (function($){ $.setRegional("datepicker", { dayNames:['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], monthNames:['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] }); $.fn.datepicker = function(opts){ var setting = { box$:"#calendar", year$:"#calendar [name=year]", month$:"#calendar [name=month]", tmInputs$:"#calendar .time :text", hour$:"#calendar .time .hh", minute$:"#calendar .time .mm", second$:"#calendar .time .ss", tmBox$:"#calendar .tm", tmUp$:"#calendar .time .up", tmDown$:"#calendar .time .down", close$:"#calendar .close", calIcon$:"a.inputDateButton", main$:"#calendar .main", days$:"#calendar .days", dayNames$:"#calendar .dayNames", clearBut$:"#calendar .clearBut", okBut$:"#calendar .okBut" }; function changeTmMenu(sltClass){ var $tm = $(setting.tmBox$); $tm.removeClass("hh").removeClass("mm").removeClass("ss"); if (sltClass) { $tm.addClass(sltClass); $(setting.tmInputs$).removeClass("slt").filter("." + sltClass).addClass("slt"); } } function clickTmMenu($input, type){ $(setting.tmBox$).find("."+type+" li").each(function(){ var $li = $(this); $li.click(function(){ $input.val($li.text()); }); }); } function keydownInt(e){ if (!((e.keyCode >= 48 && e.keyCode <= 57) || (e.keyCode == DWZ.keyCode.DELETE || e.keyCode == DWZ.keyCode.BACKSPACE))) { return false; } } function changeTm($input, type){ var ivalue = parseInt($input.val()), istart = parseInt($input.attr("start")) || 0, iend = parseInt($input.attr("end")); var istep = parseInt($input.attr('step') || 1); if (type == 1) { if (ivalue <= iend-istep){$input.val(ivalue + istep);} } else if (type == -1){ if (ivalue >= istart+istep){$input.val(ivalue - istep);} } else if (ivalue > iend) { $input.val(iend); } else if (ivalue < istart) { $input.val(istart); } } return this.each(function(){ var $this = $(this); var dp = new Datepicker($this.val(), opts); function generateCalendar(dp){ var dw = dp.getDateWrap(); var minDate = dp.getMinDate(); var maxDate = dp.getMaxDate(); var monthStart = new Date(dw.year,dw.month-1,1); var startDay = monthStart.getDay(); var dayStr=""; if (startDay > 0){ monthStart.setMonth(monthStart.getMonth() - 1); var prevDateWrap = dp.getDateWrap(monthStart); for(var t=prevDateWrap.days-startDay+1;t<=prevDateWrap.days;t++) { var _date = new Date(dw.year,dw.month-2,t); var _ctrClass = (_date >= minDate && _date <= maxDate) ? '' : 'disabled'; dayStr+='<dd class="other '+_ctrClass+'" chMonth="-1" day="' + t + '">'+t+'</dd>'; } } for(var t=1;t<=dw.days;t++){ var _date = new Date(dw.year,dw.month-1,t); var _ctrClass = (_date >= minDate && _date <= maxDate) ? '' : 'disabled'; if(t==dw.day){ dayStr+='<dd class="slt '+_ctrClass+'" day="' + t + '">'+t+'</dd>'; }else{ dayStr+='<dd class="'+_ctrClass+'" day="' + t + '">'+t+'</dd>'; } } for(var t=1;t<=42-startDay-dw.days;t++){ var _date = new Date(dw.year,dw.month,t); var _ctrClass = (_date >= minDate && _date <= maxDate) ? '' : 'disabled'; dayStr+='<dd class="other '+_ctrClass+'" chMonth="1" day="' + t + '">'+t+'</dd>'; } var $days = $(setting.days$).html(dayStr).find("dd"); $days.not('.disabled').click(function(){ var $day = $(this); if (!dp.hasTime()) { $this.val(dp.formatDate(dp.changeDay($day.attr("day"), $day.attr("chMonth")))); closeCalendar(); } else { $days.removeClass("slt"); $day.addClass("slt"); } }); if (!dp.hasDate()) $(setting.main$).addClass('nodate'); // 仅时间,无日期 if (dp.hasTime()) { $("#calendar .time").show(); var $hour = $(setting.hour$).val(dw.hour).focus(function(){ changeTmMenu("hh"); }); var iMinute = parseInt(dw.minute / dp.opts.mmStep) * dp.opts.mmStep; var $minute = $(setting.minute$).val(iMinute).attr('step',dp.opts.mmStep).focus(function(){ changeTmMenu("mm"); }); var $second = $(setting.second$).val(dp.hasSecond() ? dw.second : 0).attr('step',dp.opts.ssStep).focus(function(){ changeTmMenu("ss"); }); $hour.add($minute).add($second).click(function(){return false}); clickTmMenu($hour,"hh"); clickTmMenu($minute,"mm"); clickTmMenu($second,"ss"); $(setting.box$).click(function(){ changeTmMenu(); }); var $inputs = $(setting.tmInputs$); $inputs.keydown(keydownInt).each(function(){ var $input = $(this); $input.keyup(function(){ changeTm($input, 0); }); }); $(setting.tmUp$).click(function(){ $inputs.filter(".slt").each(function(){ changeTm($(this), 1); }); }); $(setting.tmDown$).click(function(){ $inputs.filter(".slt").each(function(){ changeTm($(this), -1); }); }); if (!dp.hasHour()) $hour.attr("disabled",true); if (!dp.hasMinute()) $minute.attr("disabled",true); if (!dp.hasSecond()) $second.attr("disabled",true); } } function closeCalendar() { $(setting.box$).remove(); $(document).unbind("click", closeCalendar); } $this.click(function(event){ closeCalendar(); var dp = new Datepicker($this.val(), opts); var offset = $this.offset(); var iTop = offset.top+this.offsetHeight; $(DWZ.frag['calendarFrag']).appendTo("body").css({ left:offset.left+'px', top:iTop+'px' }).show().click(function(event){ event.stopPropagation(); }); ($.fn.bgiframe && $(setting.box$).bgiframe()); var dayNames = ""; $.each($.regional.datepicker.dayNames, function(i,v){ dayNames += "<dt>" + v + "</dt>" }); $(setting.dayNames$).html(dayNames); var dw = dp.getDateWrap(); var $year = $(setting.year$); var yearstart = dp.getMinDate().getFullYear(); var yearend = dp.getMaxDate().getFullYear(); for(y=yearstart; y<=yearend; y++){ $year.append('<option value="'+ y +'"'+ (dw.year==y ? 'selected="selected"' : '') +'>'+ y +'</option>'); } var $month = $(setting.month$); $.each($.regional.datepicker.monthNames, function(i,v){ var m = i+1; $month.append('<option value="'+ m +'"'+ (dw.month==m ? 'selected="selected"' : '') +'>'+ v +'</option>'); }); // generate calendar generateCalendar(dp); $year.add($month).change(function(){ dp.changeDate($year.val(), $month.val()); generateCalendar(dp); }); // fix top var iBoxH = $(setting.box$).outerHeight(true); if (iTop > iBoxH && iTop > $(window).height()-iBoxH) { $(setting.box$).css("top", offset.top - iBoxH); } $(setting.close$).click(function(){ closeCalendar(); }); $(setting.clearBut$).click(function(){ $this.val(""); closeCalendar(); }); $(setting.okBut$).click(function(){ var $dd = $(setting.days$).find("dd.slt"); if ($dd.hasClass("disabled")) return false; var date = dp.changeDay($dd.attr("day"), $dd.attr("chMonth")); if (dp.hasTime()) { date.setHours(parseInt($(setting.hour$).val())); date.setMinutes(parseInt($(setting.minute$).val())); date.setSeconds(parseInt($(setting.second$).val())); } $this.val(dp.formatDate(date)); closeCalendar(); }); $(document).bind("click", closeCalendar); return false; }); $this.parent().find(setting.calIcon$).click(function(){ $this.trigger("click"); return false; }); }); } var Datepicker = function(sDate, opts) { this.opts = $.extend({ pattern:'yyyy-MM-dd', minDate:"1900-01-01", maxDate:"2099-12-31", mmStep:1, ssStep:1 }, opts); //动态minDate、maxDate var now = new Date(); this.opts.minDate = now.formatDateTm(this.opts.minDate); this.opts.maxDate = now.formatDateTm(this.opts.maxDate); this.sDate = sDate.trim(); } $.extend(Datepicker.prototype, { get: function(name) { return this.opts[name]; }, _getDays: function (y,m){//获取某年某月的天数 return m==2?(y%4||!(y%100)&&y%400?28:29):(/4|6|9|11/.test(m)?30:31); }, _minMaxDate: function(sDate){ var _count = sDate.split('-').length -1; var _format = 'y-M-d'; if (_count == 1) _format = 'y-M'; else if (_count == 0) _format = 'y'; return sDate.parseDate(_format); }, getMinDate: function(){ return this._minMaxDate(this.opts.minDate); }, getMaxDate: function(){ var _sDate = this.opts.maxDate; var _count = _sDate.split('-').length -1; var _date = this._minMaxDate(_sDate); if (_count < 2) { //format:y-M、y var _day = this._getDays(_date.getFullYear(), _date.getMonth()+1); _date.setDate(_day); if (_count == 0) {//format:y _date.setMonth(11); } } return _date; }, getDateWrap: function(date){ //得到年,月,日 if (!date) date = this.parseDate(this.sDate) || new Date(); var y = date.getFullYear(); var m = date.getMonth()+1; var days = this._getDays(y,m); return { year:y, month:m, day:date.getDate(), hour:date.getHours(),minute:date.getMinutes(),second:date.getSeconds(), days: days, date:date } }, /** * @param {year:2010, month:05, day:24} */ changeDate: function(y, m, d){ var date = new Date(y, m - 1, d || 1); this.sDate = this.formatDate(date); return date; }, changeDay: function(day, chMonth){ if (!chMonth) chMonth = 0; var dw = this.getDateWrap(); return this.changeDate(dw.year, dw.month+parseInt(chMonth), day); }, parseDate: function(sDate){ if (!sDate) return null; return sDate.parseDate(this.opts.pattern); }, formatDate: function(date){ return date.formatDate(this.opts.pattern); }, hasHour: function() { return this.opts.pattern.indexOf("H") != -1; }, hasMinute: function() { return this.opts.pattern.indexOf("m") != -1; }, hasSecond: function() { return this.opts.pattern.indexOf("s") != -1; }, hasTime: function() { return this.hasHour() || this.hasMinute() || this.hasSecond(); }, hasDate: function() { var _dateKeys = ['y','M','d','E']; for (var i=0; i<_dateKeys.length; i++){ if (this.opts.pattern.indexOf(_dateKeys[i]) != -1) return true; } return false; } }); })(jQuery);
zyroot
trunk/admin/dwz1.4.5/js/dwz.datepicker.js
JavaScript
art
10,891
/** * @author ZhangHuihua@msn.com * */ /** * 普通ajax表单提交 * @param {Object} form * @param {Object} callback * @param {String} confirmMsg 提示确认信息 */ function validateCallback(form, callback, confirmMsg) { var $form = $(form); if (!$form.valid()) { return false; } var _submitFn = function(){ $.ajax({ type: form.method || 'POST', url:$form.attr("action"), data:$form.serializeArray(), dataType:"json", cache: false, success: callback || DWZ.ajaxDone, error: DWZ.ajaxError }); } if (confirmMsg) { alertMsg.confirm(confirmMsg, {okCall: _submitFn}); } else { _submitFn(); } return false; } /** * 带文件上传的ajax表单提交 * @param {Object} form * @param {Object} callback */ function iframeCallback(form, callback){ var $form = $(form), $iframe = $("#callbackframe"); if(!$form.valid()) {return false;} if ($iframe.size() == 0) { $iframe = $("<iframe id='callbackframe' name='callbackframe' src='about:blank' style='display:none'></iframe>").appendTo("body"); } if(!form.ajax) { $form.append('<input type="hidden" name="ajax" value="1" />'); } form.target = "callbackframe"; _iframeResponse($iframe[0], callback || DWZ.ajaxDone); } function _iframeResponse(iframe, callback){ var $iframe = $(iframe), $document = $(document); $document.trigger("ajaxStart"); $iframe.bind("load", function(event){ $iframe.unbind("load"); $document.trigger("ajaxStop"); if (iframe.src == "javascript:'%3Chtml%3E%3C/html%3E';" || // For Safari iframe.src == "javascript:'<html></html>';") { // For FF, IE return; } var doc = iframe.contentDocument || iframe.document; // fixing Opera 9.26,10.00 if (doc.readyState && doc.readyState != 'complete') return; // fixing Opera 9.64 if (doc.body && doc.body.innerHTML == "false") return; var response; if (doc.XMLDocument) { // response is a xml document Internet Explorer property response = doc.XMLDocument; } else if (doc.body){ try{ response = $iframe.contents().find("body").text(); response = jQuery.parseJSON(response); } catch (e){ // response is html document or plain text response = doc.body.innerHTML; } } else { // response is a xml document response = doc; } callback(response); }); } /** * navTabAjaxDone是DWZ框架中预定义的表单提交回调函数. * 服务器转回navTabId可以把那个navTab标记为reloadFlag=1, 下次切换到那个navTab时会重新载入内容. * callbackType如果是closeCurrent就会关闭当前tab * 只有callbackType="forward"时需要forwardUrl值 * navTabAjaxDone这个回调函数基本可以通用了,如果还有特殊需要也可以自定义回调函数. * 如果表单提交只提示操作是否成功, 就可以不指定回调函数. 框架会默认调用DWZ.ajaxDone() * <form action="/user.do?method=save" onsubmit="return validateCallback(this, navTabAjaxDone)"> * * form提交后返回json数据结构statusCode=DWZ.statusCode.ok表示操作成功, 做页面跳转等操作. statusCode=DWZ.statusCode.error表示操作失败, 提示错误原因. * statusCode=DWZ.statusCode.timeout表示session超时,下次点击时跳转到DWZ.loginUrl * {"statusCode":"200", "message":"操作成功", "navTabId":"navNewsLi", "forwardUrl":"", "callbackType":"closeCurrent", "rel"."xxxId"} * {"statusCode":"300", "message":"操作失败"} * {"statusCode":"301", "message":"会话超时"} * */ function navTabAjaxDone(json){ DWZ.ajaxDone(json); if (json.statusCode == DWZ.statusCode.ok){ if (json.navTabId){ //把指定navTab页面标记为需要“重新载入”。注意navTabId不能是当前navTab页面的 navTab.reloadFlag(json.navTabId); } else { //重新载入当前navTab页面 var $pagerForm = $("#pagerForm", navTab.getCurrentPanel()); var args = $pagerForm.size()>0 ? $pagerForm.serializeArray() : {} navTabPageBreak(args, json.rel); } if ("closeCurrent" == json.callbackType) { setTimeout(function(){navTab.closeCurrentTab(json.navTabId);}, 100); } else if ("forward" == json.callbackType) { navTab.reload(json.forwardUrl); } else if ("forwardConfirm" == json.callbackType) { alertMsg.confirm(json.confirmMsg || DWZ.msg("forwardConfirmMsg"), { okCall: function(){ navTab.reload(json.forwardUrl); } }); } else { navTab.getCurrentPanel().find(":input[initValue]").each(function(){ var initVal = $(this).attr("initValue"); $(this).val(initVal); }); } } } /** * dialog上的表单提交回调函数 * 服务器转回navTabId,可以重新载入指定的navTab. statusCode=DWZ.statusCode.ok表示操作成功, 自动关闭当前dialog * * form提交后返回json数据结构,json格式和navTabAjaxDone一致 */ function dialogAjaxDone(json){ DWZ.ajaxDone(json); if (json.statusCode == DWZ.statusCode.ok){ if (json.navTabId){ navTab.reload(json.forwardUrl, {navTabId: json.navTabId}); } else if (json.rel) { var $pagerForm = $("#pagerForm", navTab.getCurrentPanel()); var args = $pagerForm.size()>0 ? $pagerForm.serializeArray() : {} navTabPageBreak(args, json.rel); } if ("closeCurrent" == json.callbackType) { $.pdialog.closeCurrent(); } } } /** * 处理navTab上的查询, 会重新载入当前navTab * @param {Object} form */ function navTabSearch(form, navTabId){ var $form = $(form); if (form[DWZ.pageInfo.pageNum]) form[DWZ.pageInfo.pageNum].value = 1; navTab.reload($form.attr('action'), {data: $form.serializeArray(), navTabId:navTabId}); return false; } /** * 处理dialog弹出层上的查询, 会重新载入当前dialog * @param {Object} form */ function dialogSearch(form){ var $form = $(form); if (form[DWZ.pageInfo.pageNum]) form[DWZ.pageInfo.pageNum].value = 1; $.pdialog.reload($form.attr('action'), {data: $form.serializeArray()}); return false; } function dwzSearch(form, targetType){ if (targetType == "dialog") dialogSearch(form); else navTabSearch(form); return false; } /** * 处理div上的局部查询, 会重新载入指定div * @param {Object} form */ function divSearch(form, rel){ var $form = $(form); if (form[DWZ.pageInfo.pageNum]) form[DWZ.pageInfo.pageNum].value = 1; if (rel) { var $box = $("#" + rel); $box.ajaxUrl({ type:"POST", url:$form.attr("action"), data: $form.serializeArray(), callback:function(){ $box.find("[layoutH]").layoutH(); } }); } return false; } /** * * @param {Object} args {pageNum:"",numPerPage:"",orderField:"",orderDirection:""} * @param String formId 分页表单选择器,非必填项默认值是 "pagerForm" */ function _getPagerForm($parent, args) { var form = $("#pagerForm", $parent).get(0); if (form) { if (args["pageNum"]) form[DWZ.pageInfo.pageNum].value = args["pageNum"]; if (args["numPerPage"]) form[DWZ.pageInfo.numPerPage].value = args["numPerPage"]; if (args["orderField"]) form[DWZ.pageInfo.orderField].value = args["orderField"]; if (args["orderDirection"] && form[DWZ.pageInfo.orderDirection]) form[DWZ.pageInfo.orderDirection].value = args["orderDirection"]; } return form; } /** * 处理navTab中的分页和排序 * targetType: navTab 或 dialog * rel: 可选 用于局部刷新div id号 * data: pagerForm参数 {pageNum:"n", numPerPage:"n", orderField:"xxx", orderDirection:""} * callback: 加载完成回调函数 */ function dwzPageBreak(options){ var op = $.extend({ targetType:"navTab", rel:"", data:{pageNum:"", numPerPage:"", orderField:"", orderDirection:""}, callback:null}, options); var $parent = op.targetType == "dialog" ? $.pdialog.getCurrent() : navTab.getCurrentPanel(); if (op.rel) { var $box = $parent.find("#" + op.rel); var form = _getPagerForm($box, op.data); if (form) { $box.ajaxUrl({ type:"POST", url:$(form).attr("action"), data: $(form).serializeArray(), callback:function(){ $box.find("[layoutH]").layoutH(); } }); } } else { var form = _getPagerForm($parent, op.data); var params = $(form).serializeArray(); if (op.targetType == "dialog") { if (form) $.pdialog.reload($(form).attr("action"), {data: params, callback: op.callback}); } else { if (form) navTab.reload($(form).attr("action"), {data: params, callback: op.callback}); } } } /** * 处理navTab中的分页和排序 * @param args {pageNum:"n", numPerPage:"n", orderField:"xxx", orderDirection:""} * @param rel: 可选 用于局部刷新div id号 */ function navTabPageBreak(args, rel){ dwzPageBreak({targetType:"navTab", rel:rel, data:args}); } /** * 处理dialog中的分页和排序 * 参数同 navTabPageBreak */ function dialogPageBreak(args, rel){ dwzPageBreak({targetType:"dialog", rel:rel, data:args}); } function ajaxTodo(url, callback){ var $callback = callback || navTabAjaxDone; if (! $.isFunction($callback)) $callback = eval('(' + callback + ')'); $.ajax({ type:'POST', url:url, dataType:"json", cache: false, success: $callback, error: DWZ.ajaxError }); } /** * http://www.uploadify.com/documentation/uploadify/onqueuecomplete/ */ function uploadifyQueueComplete(queueData){ var msg = "The total number of files uploaded: "+queueData.uploadsSuccessful+"<br/>" + "The total number of errors while uploading: "+queueData.uploadsErrored+"<br/>" + "The total number of bytes uploaded: "+queueData.queueBytesUploaded+"<br/>" + "The average speed of all uploaded files: "+queueData.averageSpeed; if (queueData.uploadsErrored) { alertMsg.error(msg); } else { alertMsg.correct(msg); } } /** * http://www.uploadify.com/documentation/uploadify/onuploadsuccess/ */ function uploadifySuccess(file, data, response){ alert(data) } /** * http://www.uploadify.com/documentation/uploadify/onuploaderror/ */ function uploadifyError(file, errorCode, errorMsg) { alertMsg.error(errorCode+": "+errorMsg); } /** * http://www.uploadify.com/documentation/ * @param {Object} event * @param {Object} queueID * @param {Object} fileObj * @param {Object} errorObj */ function uploadifyError(event, queueId, fileObj, errorObj){ alert("event:" + event + "\nqueueId:" + queueId + "\nfileObj.name:" + fileObj.name + "\nerrorObj.type:" + errorObj.type + "\nerrorObj.info:" + errorObj.info); } $.fn.extend({ ajaxTodo:function(){ return this.each(function(){ var $this = $(this); $this.click(function(event){ var url = unescape($this.attr("href")).replaceTmById($(event.target).parents(".unitBox:first")); DWZ.debug(url); if (!url.isFinishedTm()) { alertMsg.error($this.attr("warn") || DWZ.msg("alertSelectMsg")); return false; } var title = $this.attr("title"); if (title) { alertMsg.confirm(title, { okCall: function(){ ajaxTodo(url, $this.attr("callback")); } }); } else { ajaxTodo(url, $this.attr("callback")); } event.preventDefault(); }); }); }, dwzExport: function(){ function _doExport($this) { var $p = $this.attr("targetType") == "dialog" ? $.pdialog.getCurrent() : navTab.getCurrentPanel(); var $form = $("#pagerForm", $p); var url = $this.attr("href"); window.location = url+(url.indexOf('?') == -1 ? "?" : "&")+$form.serialize(); } return this.each(function(){ var $this = $(this); $this.click(function(event){ var title = $this.attr("title"); if (title) { alertMsg.confirm(title, { okCall: function(){_doExport($this);} }); } else {_doExport($this);} event.preventDefault(); }); }); } });
zyroot
trunk/admin/dwz1.4.5/js/dwz.ajax.js
JavaScript
art
11,898
/** * @author Roger Wu * @version 1.0 */ (function($){ $.fn.cssv = function(pre){ var cssPre = $(this).css(pre); return cssPre.substring(0, cssPre.indexOf("px")) * 1; }; $.fn.jBar = function(options){ var op = $.extend({container:"#container", collapse:".collapse", toggleBut:".toggleCollapse div", sideBar:"#sidebar", sideBar2:"#sidebar_s", splitBar:"#splitBar", splitBar2:"#splitBarProxy"}, options); return this.each(function(){ var jbar = this; var sbar = $(op.sideBar2, jbar); var bar = $(op.sideBar, jbar); $(op.toggleBut, bar).click(function(){ DWZ.ui.sbar = false; $(op.splitBar).hide(); var sbarwidth = sbar.cssv("left") + sbar.outerWidth(); var barleft = sbarwidth - bar.outerWidth(); var cleft = $(op.container).cssv("left") - (bar.outerWidth() - sbar.outerWidth()); var cwidth = bar.outerWidth() - sbar.outerWidth() + $(op.container).outerWidth(); $(op.container).animate({left: cleft,width: cwidth},50,function(){ bar.animate({left: barleft}, 500, function(){ bar.hide(); sbar.show().css("left", -50).animate({left: 5}, 200); $(window).trigger(DWZ.eventType.resizeGrid); }); }); $(op.collapse,sbar).click(function(){ var sbarwidth = sbar.cssv("left") + sbar.outerWidth(); if(bar.is(":hidden")) { $(op.toggleBut, bar).hide(); bar.show().animate({left: sbarwidth}, 500); $(op.container).click(_hideBar); } else { bar.animate({left: barleft}, 500, function(){ bar.hide(); }); } function _hideBar() { $(op.container).unbind("click", _hideBar); if (!DWZ.ui.sbar) { bar.animate({left: barleft}, 500, function(){ bar.hide(); }); } } return false; }); return false; }); $(op.toggleBut, sbar).click(function(){ DWZ.ui.sbar = true; sbar.animate({left: -25}, 200, function(){ bar.show(); }); bar.animate({left: 5}, 800, function(){ $(op.splitBar).show(); $(op.toggleBut, bar).show(); var cleft = 5 + bar.outerWidth() + $(op.splitBar).outerWidth(); var cwidth = $(op.container).outerWidth() - (cleft - $(op.container).cssv("left")); $(op.container).css({left: cleft,width: cwidth}); $(op.collapse, sbar).unbind('click'); $(window).trigger(DWZ.eventType.resizeGrid); }); return false; }); $(op.splitBar).mousedown(function(event){ $(op.splitBar2).each(function(){ var spbar2 = $(this); setTimeout(function(){spbar2.show();}, 100); spbar2.css({visibility: "visible",left: $(op.splitBar).css("left")}); spbar2.jDrag($.extend(options, {obj:$("#sidebar"), move:"horizontal", event:event,stop: function(){ $(this).css("visibility", "hidden"); var move = $(this).cssv("left") - $(op.splitBar).cssv("left"); var sbarwidth = bar.outerWidth() + move; var cleft = $(op.container).cssv("left") + move; var cwidth = $(op.container).outerWidth() - move; bar.css("width", sbarwidth); $(op.splitBar).css("left", $(this).css("left")); $(op.container).css({left: cleft,width: cwidth}); }})); return false; }); }); }); } })(jQuery);
zyroot
trunk/admin/dwz1.4.5/js/dwz.barDrag.js
JavaScript
art
3,304
/** * @author ZhangHuihua@msn.com * */ (function($){ $.printBox = function(rel){ var _printBoxId = 'printBox'; var $contentBox = rel ? $('#'+rel) : $("body"), $printBox = $('#'+_printBoxId); if ($printBox.size()==0){ $printBox = $('<div id="'+_printBoxId+'"></div>').appendTo("body"); } $printBox.html($contentBox.html()).find("[layoutH]").height("auto"); window.print(); } })(jQuery);
zyroot
trunk/admin/dwz1.4.5/js/dwz.print.js
JavaScript
art
437
/** * @author Roger Wu */ (function($){ $.fn.dialogDrag = function(options){ if (typeof options == 'string') { if (options == 'destroy') return this.each(function() { var dialog = this; $("div.dialogHeader", dialog).unbind("mousedown"); }); } return this.each(function(){ var dialog = $(this); $("div.dialogHeader", dialog).mousedown(function(e){ $.pdialog.switchDialog(dialog); dialog.data("task",true); setTimeout(function(){ if(dialog.data("task"))$.dialogDrag.start(dialog,e); },100); return false; }).mouseup(function(e){ dialog.data("task",false); return false; }); }); }; $.dialogDrag = { currId:null, _init:function(dialog) { this.currId = new Date().getTime(); var shadow = $("#dialogProxy"); if (!shadow.size()) { shadow = $(DWZ.frag["dialogProxy"]); $("body").append(shadow); } $("h1", shadow).html($(".dialogHeader h1", dialog).text()); }, start:function(dialog,event){ this._init(dialog); var sh = $("#dialogProxy"); sh.css({ left: dialog.css("left"), top: dialog.css("top"), height: dialog.css("height"), width: dialog.css("width"), zIndex:parseInt(dialog.css("zIndex")) + 1 }).show(); $("div.dialogContent",sh).css("height",$("div.dialogContent",dialog).css("height")); sh.data("dialog",dialog); dialog.css({left:"-10000px",top:"-10000px"}); $(".shadow").hide(); $(sh).jDrag({ selector:".dialogHeader", stop: this.stop, event:event }); return false; }, stop:function(){ var sh = $(arguments[0]); var dialog = sh.data("dialog"); $(dialog).css({left:$(sh).css("left"),top:$(sh).css("top")}); $.pdialog.attachShadow(dialog); $(sh).hide(); } } })(jQuery);
zyroot
trunk/admin/dwz1.4.5/js/dwz.dialogDrag.js
JavaScript
art
1,899
/** * @author Roger Wu */ (function($){ $.fn.jDrag = function(options){ if (typeof options == 'string') { if (options == 'destroy') return this.each(function(){ $(this).unbind('mousedown', $.rwdrag.start); $.data(this, 'pp-rwdrag', null); }); } return this.each(function(){ var el = $(this); $.data($.rwdrag, 'pp-rwdrag', { options: $.extend({ el: el, obj: el }, options) }); if (options.event) $.rwdrag.start(options.event); else { var select = options.selector; $(select, obj).bind('mousedown', $.rwdrag.start); } }); }; $.rwdrag = { start: function(e){ document.onselectstart=function(e){return false};//禁止选择 var data = $.data(this, 'pp-rwdrag'); var el = data.options.el[0]; $.data(el, 'pp-rwdrag', { options: data.options }); if (!$.rwdrag.current) { $.rwdrag.current = { el: el, oleft: parseInt(el.style.left) || 0, otop: parseInt(el.style.top) || 0, ox: e.pageX || e.screenX, oy: e.pageY || e.screenY }; $(document).bind("mouseup", $.rwdrag.stop).bind("mousemove", $.rwdrag.drag); } }, drag: function(e){ if (!e) var e = window.event; var current = $.rwdrag.current; var data = $.data(current.el, 'pp-rwdrag'); var left = (current.oleft + (e.pageX || e.clientX) - current.ox); var top = (current.otop + (e.pageY || e.clientY) - current.oy); if (top < 1) top = 0; if (data.options.move == 'horizontal') { if ((data.options.minW && left >= $(data.options.obj).cssv("left") + data.options.minW) && (data.options.maxW && left <= $(data.options.obj).cssv("left") + data.options.maxW)) current.el.style.left = left + 'px'; else if (data.options.scop) { if (data.options.relObj) { if ((left - parseInt(data.options.relObj.style.left)) > data.options.cellMinW) { current.el.style.left = left + 'px'; } } else current.el.style.left = left + 'px'; } } else if (data.options.move == 'vertical') { current.el.style.top = top + 'px'; } else { var selector = data.options.selector ? $(data.options.selector, data.options.obj) : $(data.options.obj); if (left >= -selector.outerWidth() * 2 / 3 && top >= 0 && (left + selector.outerWidth() / 3 < $(window).width()) && (top + selector.outerHeight() < $(window).height())) { current.el.style.left = left + 'px'; current.el.style.top = top + 'px'; } } if (data.options.drag) { data.options.drag.apply(current.el, [current.el]); } return $.rwdrag.preventEvent(e); }, stop: function(e){ var current = $.rwdrag.current; var data = $.data(current.el, 'pp-rwdrag'); $(document).unbind('mousemove', $.rwdrag.drag).unbind('mouseup', $.rwdrag.stop); if (data.options.stop) { data.options.stop.apply(current.el, [current.el]); } $.rwdrag.current = null; document.onselectstart=function(e){return true};//启用选择 return $.rwdrag.preventEvent(e); }, preventEvent:function(e){ if (e.stopPropagation) e.stopPropagation(); if (e.preventDefault) e.preventDefault(); return false; } }; })(jQuery);
zyroot
trunk/admin/dwz1.4.5/js/dwz.drag.js
JavaScript
art
3,271
/** * @author ZhangHuihua@msn.com */ (function($){ var _op = { cursor: 'move', // selector 的鼠标手势 sortBoxs: 'div.sortDrag', //拖动排序项父容器 replace: true, //2个sortBox之间拖动替换 items: '> *', //拖动排序项选择器 selector: '', //拖动排序项用于拖动的子元素的选择器,为空时等于item zIndex: 1000 }; var sortDrag = { start:function($sortBox, $item, event, op){ var $placeholder = this._createPlaceholder($item); var $helper = $item.clone(); var position = $item.position(); $helper.data('$sortBox', $sortBox).data('op', op).data('$item', $item).data('$placeholder', $placeholder); $helper.addClass('sortDragHelper').css({position:'absolute',top:position.top,left:position.left,zIndex:op.zIndex,width:$item.width()+'px',height:$item.height()+'px'}).jDrag({ selector:op.selector, drag:this.drag, stop:this.stop, event:event }); $item.before($placeholder).before($helper).hide(); return false; }, drag:function(){ var $helper = $(arguments[0]), $sortBox = $helper.data('$sortBox'), $placeholder = $helper.data('$placeholder'); var $items = $sortBox.find($helper.data('op')['items']).filter(':visible').filter(':not(.sortDragPlaceholder, .sortDragHelper)'); var helperPos = $helper.position(), firstPos = $items.eq(0).position(); var $overBox = sortDrag._getOverSortBox($helper); if ($overBox.length > 0 && $overBox[0] != $sortBox[0]){ //移动到其他容器 $placeholder.appendTo($overBox); $helper.data('$sortBox', $overBox); } else { for (var i=0; i<$items.length; i++) { var $this = $items.eq(i), position = $this.position(); if (helperPos.top > position.top + 10) { $this.after($placeholder); } else if (helperPos.top <= position.top) { $this.before($placeholder); break; } } } }, stop:function(){ var $helper = $(arguments[0]), $item = $helper.data('$item'), $placeholder = $helper.data('$placeholder'); var position = $placeholder.position(); $helper.animate({ top: position.top + "px", left: position.left + "px" }, { complete: function(){ if ($helper.data('op')['replace']){ //2个sortBox之间替换处理 $srcBox = $item.parents(_op.sortBoxs+":first"); $destBox = $placeholder.parents(_op.sortBoxs+":first"); if ($srcBox[0] != $destBox[0]) { //判断是否移动到其他容器中 $replaceItem = $placeholder.next(); if ($replaceItem.size() > 0) { $replaceItem.insertAfter($item); } } } $item.insertAfter($placeholder).show(); $placeholder.remove(); $helper.remove(); }, duration: 300 }); }, _createPlaceholder:function($item){ return $('<'+$item[0].nodeName+' class="sortDragPlaceholder"/>').css({ width:$item.outerWidth()+'px', height:$item.outerHeight()+'px', marginTop:$item.css('marginTop'), marginRight:$item.css('marginRight'), marginBottom:$item.css('marginBottom'), marginLeft:$item.css('marginLeft') }); }, _getOverSortBox:function($item){ var itemPos = $item.position(); var y = itemPos.top+($item.height()/2), x = itemPos.left+($item.width()/2); return $(_op.sortBoxs).filter(':visible').filter(function(){ var $sortBox = $(this), sortBoxPos = $sortBox.position(); return DWZ.isOver(y, x, sortBoxPos.top, sortBoxPos.left, $sortBox.height(), $sortBox.width()); }); } }; $.fn.sortDrag = function(options){ return this.each(function(){ var op = $.extend({}, _op, options); var $sortBox = $(this); if ($sortBox.attr('selector')) op.selector = $sortBox.attr('selector'); $sortBox.find(op.items).each(function(i){ var $item = $(this), $selector = $item; if (op.selector) { $selector = $item.find(op.selector).css({cursor:op.cursor}); } $selector.mousedown(function(event){ sortDrag.start($sortBox, $item, event, op); event.preventDefault(); }); }); }); } })(jQuery);
zyroot
trunk/admin/dwz1.4.5/js/dwz.sortDrag.js
JavaScript
art
4,155
/** * @requires jquery.validate.js * @author ZhangHuihua@msn.com */ (function($){ if ($.validator) { $.validator.addMethod("alphanumeric", function(value, element) { return this.optional(element) || /^\w+$/i.test(value); }, "Letters, numbers or underscores only please"); $.validator.addMethod("lettersonly", function(value, element) { return this.optional(element) || /^[a-z]+$/i.test(value); }, "Letters only please"); $.validator.addMethod("phone", function(value, element) { return this.optional(element) || /^[0-9 \(\)]{7,30}$/.test(value); }, "Please specify a valid phone number"); $.validator.addMethod("postcode", function(value, element) { return this.optional(element) || /^[0-9 A-Za-z]{5,20}$/.test(value); }, "Please specify a valid postcode"); $.validator.addMethod("date", function(value, element) { value = value.replace(/\s+/g, ""); if (String.prototype.parseDate){ var $input = $(element); var pattern = $input.attr('dateFmt') || 'yyyy-MM-dd'; return !$input.val() || $input.val().parseDate(pattern); } else { return this.optional(element) || value.match(/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/); } }, "Please enter a valid date."); /*自定义js函数验证 * <input type="text" name="xxx" customvalid="xxxFn(element)" title="xxx" /> */ $.validator.addMethod("customvalid", function(value, element, params) { try{ return eval('(' + params + ')'); }catch(e){ return false; } }, "Please fix this field."); $.validator.addClassRules({ date: {date: true}, alphanumeric: { alphanumeric: true }, lettersonly: { lettersonly: true }, phone: { phone: true }, postcode: {postcode: true} }); $.validator.setDefaults({errorElement:"span"}); $.validator.autoCreateRanges = true; } })(jQuery);
zyroot
trunk/admin/dwz1.4.5/js/dwz.validate.method.js
JavaScript
art
1,891
/** * @author Roger Wu * @version 1.0 */ (function($){ $.extend($.fn, { jPanel:function(options){ var op = $.extend({header:"panelHeader", headerC:"panelHeaderContent", content:"panelContent", coll:"collapsable", exp:"expandable", footer:"panelFooter", footerC:"panelFooterContent"}, options); return this.each(function(){ var $panel = $(this); var close = $panel.hasClass("close"); var collapse = $panel.hasClass("collapse"); var $content = $(">div", $panel).addClass(op.content); var title = $(">h1",$panel).wrap('<div class="'+op.header+'"><div class="'+op.headerC+'"></div></div>'); if(collapse)$("<a href=\"\"></a>").addClass(close?op.exp:op.coll).insertAfter(title); var header = $(">div:first", $panel); var footer = $('<div class="'+op.footer+'"><div class="'+op.footerC+'"></div></div>').appendTo($panel); var defaultH = $panel.attr("defH")?$panel.attr("defH"):0; var minH = $panel.attr("minH")?$panel.attr("minH"):0; if (close) $content.css({ height: "0px", display: "none" }); else { if (defaultH > 0) $content.height(defaultH + "px"); else if(minH > 0){ $content.css("minHeight", minH+"px"); } } if(!collapse) return; var $pucker = $("a", header); var inH = $content.innerHeight() - 6; if(minH > 0 && minH >= inH) defaultH = minH; else defaultH = inH; $pucker.click(function(){ if($pucker.hasClass(op.exp)){ $content.jBlindDown({to:defaultH,call:function(){ $pucker.removeClass(op.exp).addClass(op.coll); if(minH > 0) $content.css("minHeight",minH+"px"); }}); } else { if(minH > 0) $content.css("minHeight",""); if(minH >= inH) $content.css("height", minH+"px"); $content.jBlindUp({call:function(){ $pucker.removeClass(op.coll).addClass(op.exp); }}); } return false; }); }); } }); })(jQuery);
zyroot
trunk/admin/dwz1.4.5/js/dwz.panel.js
JavaScript
art
1,952
/** * * @author ZhangHuihua@msn.com * @param {Object} opts Several options */ (function($){ $.fn.extend({ pagination: function(opts){ var setting = { first$:"li.j-first", prev$:"li.j-prev", next$:"li.j-next", last$:"li.j-last", nums$:"li.j-num>a", jumpto$:"li.jumpto", pageNumFrag:'<li class="#liClass#"><a href="javascript:;">#pageNum#</a></li>' }; return this.each(function(){ var $this = $(this); var pc = new Pagination(opts); var interval = pc.getInterval(); var pageNumFrag = ''; for (var i=interval.start; i<interval.end;i++){ pageNumFrag += setting.pageNumFrag.replaceAll("#pageNum#", i).replaceAll("#liClass#", i==pc.getCurrentPage() ? 'selected j-num' : 'j-num'); } $this.html(DWZ.frag["pagination"].replaceAll("#pageNumFrag#", pageNumFrag).replaceAll("#currentPage#", pc.getCurrentPage())).find("li").hoverClass(); var $first = $this.find(setting.first$); var $prev = $this.find(setting.prev$); var $next = $this.find(setting.next$); var $last = $this.find(setting.last$); if (pc.hasPrev()){ $first.add($prev).find(">span").hide(); _bindEvent($prev, pc.getCurrentPage()-1, pc.targetType(), pc.rel()); _bindEvent($first, 1, pc.targetType(), pc.rel()); } else { $first.add($prev).addClass("disabled").find(">a").hide(); } if (pc.hasNext()) { $next.add($last).find(">span").hide(); _bindEvent($next, pc.getCurrentPage()+1, pc.targetType(), pc.rel()); _bindEvent($last, pc.numPages(), pc.targetType(), pc.rel()); } else { $next.add($last).addClass("disabled").find(">a").hide(); } $this.find(setting.nums$).each(function(i){ _bindEvent($(this), i+interval.start, pc.targetType(), pc.rel()); }); $this.find(setting.jumpto$).each(function(){ var $this = $(this); var $inputBox = $this.find(":text"); var $button = $this.find(":button"); $button.click(function(event){ var pageNum = $inputBox.val(); if (pageNum && pageNum.isPositiveInteger()) { dwzPageBreak({targetType:pc.targetType(), rel:pc.rel(), data: {pageNum:pageNum}}); } }); $inputBox.keyup(function(event){ if (event.keyCode == DWZ.keyCode.ENTER) $button.click(); }); }); }); function _bindEvent($target, pageNum, targetType, rel){ $target.bind("click", {pageNum:pageNum}, function(event){ dwzPageBreak({targetType:targetType, rel:rel, data:{pageNum:event.data.pageNum}}); event.preventDefault(); }); } }, orderBy: function(options){ var op = $.extend({ targetType:"navTab", rel:"", asc:"asc", desc:"desc"}, options); return this.each(function(){ var $this = $(this).css({cursor:"pointer"}).click(function(){ var orderField = $this.attr("orderField"); var orderDirection = $this.hasClass(op.asc) ? op.desc : op.asc; dwzPageBreak({targetType:op.targetType, rel:op.rel, data:{orderField: orderField, orderDirection: orderDirection}}); }); }); }, pagerForm: function(options){ var op = $.extend({pagerForm$:"#pagerForm", parentBox:document}, options); var frag = '<input type="hidden" name="#name#" value="#value#" />'; return this.each(function(){ var $searchForm = $(this), $pagerForm = $(op.pagerForm$, op.parentBox); var actionUrl = $pagerForm.attr("action").replaceAll("#rel#", $searchForm.attr("action")); $pagerForm.attr("action", actionUrl); $searchForm.find(":input").each(function(){ var $input = $(this), name = $input.attr("name"); if (name && (!$input.is(":checkbox,:radio") || $input.is(":checked"))){ if ($pagerForm.find(":input[name='"+name+"']").length == 0) { var inputFrag = frag.replaceAll("#name#", name).replaceAll("#value#", $input.val()); $pagerForm.append(inputFrag); } } }); }); } }); var Pagination = function(opts) { this.opts = $.extend({ targetType:"navTab", // navTab, dialog rel:"", //用于局部刷新div id号 totalCount:0, numPerPage:10, pageNumShown:10, currentPage:1, callback:function(){return false;} }, opts); } $.extend(Pagination.prototype, { targetType:function(){return this.opts.targetType}, rel:function(){return this.opts.rel}, numPages:function() { return Math.ceil(this.opts.totalCount/this.opts.numPerPage); }, getInterval:function(){ var ne_half = Math.ceil(this.opts.pageNumShown/2); var np = this.numPages(); var upper_limit = np - this.opts.pageNumShown; var start = this.getCurrentPage() > ne_half ? Math.max( Math.min(this.getCurrentPage() - ne_half, upper_limit), 0 ) : 0; var end = this.getCurrentPage() > ne_half ? Math.min(this.getCurrentPage()+ne_half, np) : Math.min(this.opts.pageNumShown, np); return {start:start+1, end:end+1}; }, getCurrentPage:function(){ var currentPage = parseInt(this.opts.currentPage); if (isNaN(currentPage)) return 1; return currentPage; }, hasPrev:function(){ return this.getCurrentPage() > 1; }, hasNext:function(){ return this.getCurrentPage() < this.numPages(); } }); })(jQuery);
zyroot
trunk/admin/dwz1.4.5/js/dwz.pagination.js
JavaScript
art
5,267
/** * @author Roger Wu * @version 1.0 */ (function($){ $.fn.extend({ jTask:function(options){ return this.each(function(){ var $task = $(this); var id = $task.attr("id"); $task.click(function(e){ var dialog = $("body").data(id); if ($task.hasClass("selected")) { $("a.minimize", dialog).trigger("click"); } else { if (dialog.is(":hidden")) { $.taskBar.restoreDialog(dialog); } else $(dialog).trigger("click"); } $.taskBar.scrollCurrent($(this)); return false; }); $("div.close", $task).click(function(e){ $.pdialog.close(id) return false; }).hoverClass("closeHover"); $task.hoverClass("hover"); }); } }); $.taskBar = { _taskBar:null, _taskBox:null, _prevBut:null, _nextBut:null, _op:{id:"taskbar", taskBox:"div.taskbarContent",prevBut:".taskbarLeft",prevDis:"taskbarLeftDisabled", nextBut:".taskbarRight",nextDis:"taskbarRightDisabled", selected:"selected",boxMargin:"taskbarMargin"}, init:function(options) { var $this = this; $.extend(this._op, options); this._taskBar = $("#" + this._op.id); if (this._taskBar.size() == 0) { this._taskBar = $(DWZ.frag["taskbar"]).appendTo($("#layout")); this._taskBar.find(".taskbarLeft").hoverClass("taskbarLeftHover"); this._taskBar.find(".taskbarRight").hoverClass("taskbarRightHover"); } this._taskBox = this._taskBar.find(this._op.taskBox); this._taskList = this._taskBox.find(">ul"); this._prevBut = this._taskBar.find(this._op.prevBut); this._nextBut = this._taskBar.find(this._op.nextBut); this._prevBut.click(function(e){$this.scrollLeft()}); this._nextBut.click(function(e){$this.scrollRight()}); this._contextmenu(this._taskBox); // taskBar右键菜单 }, _contextmenu:function(obj) { $(obj).contextMenu('dialogCM', { bindings:{ closeCurrent:function(t,m){ var obj = t.isTag("li")?t:$.taskBar._getCurrent(); $("div.close", obj).trigger("click"); }, closeOther:function(t,m){ var selector = t.isTag("li")?("#" +t.attr("id")):".selected"; var tasks = $.taskBar._taskList.find(">li:not(:"+selector+")"); tasks.each(function(i){ $("div.close",tasks[i]).trigger("click"); }); }, closeAll:function(t,m){ var tasks = $.taskBar._getTasks(); tasks.each(function(i){ $("div.close",tasks[i]).trigger("click"); }); } }, ctrSub:function(t,m){ var mCur = m.find("[rel='closeCurrent']"); var mOther = m.find("[rel='closeOther']"); if(!$.taskBar._getCurrent()[0]) { mCur.addClass("disabled"); mOther.addClass("disabled"); } else { if($.taskBar._getTasks().size() == 1) mOther.addClass("disabled"); } } }); }, _scrollCurrent:function(){ var iW = this._tasksW(this._getTasks()); if (iW > this._getTaskBarW()) { var $this = this; var lTask = $(">li:last-child", this._taskList); var left = this._getTaskBarW() - lTask.position().left - lTask.outerWidth(true); this._taskList.animate({ left: left + 'px' }, 200, function(){ $this._ctrlScrollBut(); }); } else { this._ctrlScrollBut(); } }, _getTaskBarW:function(){ return this._taskBox.width()- (this._prevBut.is(":hidden")?this._prevBut.width()+2:0) - (this._nextBut.is(":hidden")?this._nextBut.width()+2:0); }, _scrollTask:function(task){ var $this = this; if(task.position().left + this._getLeft()+task.outerWidth() > this._getBarWidth()) { var left = this._getTaskBarW()- task.position().left - task.outerWidth(true) - 2; this._taskList.animate({left: left + 'px'}, 200, function(){ $this._ctrlScrollBut(); }); } else if(task.position().left + this._getLeft() < 0) { var left = this._getLeft()-(task.position().left + this._getLeft()); this._taskList.animate({left: left + 'px'}, 200, function(){ $this._ctrlScrollBut(); }); } }, /** * 控制左右移动按钮何时显示与隐藏 */ _ctrlScrollBut:function(){ var iW = this._tasksW(this._getTasks()); if (this._getTaskBarW() > iW) { this._taskBox.removeClass(this._op.boxMargin); this._nextBut.hide(); this._prevBut.hide(); if(this._getTasks().eq(0)[0])this._scrollTask(this._getTasks().eq(0)); } else { this._taskBox.addClass(this._op.boxMargin); this._nextBut.show().removeClass(this._op.nextDis); this._prevBut.show().removeClass(this._op.prevDis); if (this._getLeft() >= 0){ this._prevBut.addClass(this._op.prevDis); } if (this._getLeft() <= this._getTaskBarW() - iW) { this._nextBut.addClass(this._op.nextDis); } } }, _getLeft: function(){ return this._taskList.position().left; }, /** * 取得第一个完全显示在taskbar上的任务 */ _visibleStart: function(){ var iLeft = this._getLeft(); var jTasks = this._getTasks(); for (var i=0; i<jTasks.size(); i++){ if (jTasks.eq(i).position().left + jTasks.eq(i).outerWidth(true) + iLeft >= 0) return jTasks.eq(i); } return jTasks.eq(0); }, /** * 取得最后一个完全显示在taskbar上的任务 */ _visibleEnd: function(){ var iLeft = this._getLeft(); var jTasks = this._getTasks(); for (var i=0; i<jTasks.size(); i++){ if (jTasks.eq(i).position().left + jTasks.eq(i).outerWidth(true) + iLeft > this._getBarWidth()) return jTasks.eq(i); } return jTasks.eq(jTasks.size()-1); }, /** * 取得所有的任务 */ _getTasks:function(){ return this._taskList.find(">li"); }, /** * 计算所传入的所有任务的宽度和 * @param {Object} jTasks */ _tasksW:function(jTasks){ var iW = 0; jTasks.each(function(){ iW += $(this).outerWidth(true); }); return iW; }, _getBarWidth: function() { return this._taskBar.innerWidth(true); }, /** * 在任务栏上新加一个任务 * @param {Object} id * @param {Object} title */ addDialog: function(id, title){ this.show(); var task = $("#"+id,this._taskList); if (!task[0]) { var taskFrag = '<li id="#taskid#"><div class="taskbutton"><span>#title#</span></div><div class="close">Close</div></li>'; this._taskList.append(taskFrag.replace("#taskid#", id).replace("#title#", title)); task = $("#"+id,this._taskList); task.jTask(); } else { $(">div>span", task).text(title); } this._contextmenu(task); this.switchTask(id); this._scrollTask(task); }, /** * 关闭一个任务 * @param {Object} id */ closeDialog: function(obj){ var task = (typeof obj == 'string')? $("#"+obj, this._taskList):obj; task.remove(); if(this._getTasks().size() == 0){ this.hide(); } this._scrollCurrent(); }, /** * * @param {Object} id or dialog */ restoreDialog:function(obj){ var dialog = (typeof obj == 'string')?$("body").data(obj):obj; var id = (typeof obj == 'string')?obj:dialog.data("id"); var task = $.taskBar.getTask(id); $(".resizable").css({top: $(window).height()-60,left:$(task).position().left,height:$(task).outerHeight(),width:$(task).outerWidth() }).show().animate({top:$(dialog).css("top"),left: $(dialog).css("left"),width:$(dialog).css("width"),height:$(dialog).css("height")},250,function(){ $(this).hide(); $(dialog).show(); $.pdialog.attachShadow(dialog); }); $.taskBar.switchTask(id); }, /** * 把任务变成不是当前的 * @param {Object} id */ inactive:function(id){ $("#" + id, this._taskList).removeClass("selected"); }, /** * 向左移一个任务 */ scrollLeft: function(){ var task = this._visibleStart(); this._scrollTask(task); }, /** * 向右移一个任务 */ scrollRight: function(){ var task = this._visibleEnd(); this._scrollTask(task); }, /** * 移出当前点击的任务 * @param {Object} task */ scrollCurrent:function(task){ this._scrollTask(task); }, /** * 切换任务 * @param {Object} id */ switchTask:function(id) { this._getCurrent().removeClass("selected"); this.getTask(id).addClass("selected"); }, _getCurrent:function() { return this._taskList.find(">.selected"); }, getTask:function(id) { return $("#" + id, this._taskList); }, /** * 显示任务栏 */ show:function(){ if (this._taskBar.is(":hidden")) { this._taskBar.css("top", $(window).height() - 34 + this._taskBar.outerHeight()).show(); this._taskBar.animate({ top: $(window).height() - this._taskBar.outerHeight() }, 500); } }, /** * 隐藏任务栏 */ hide:function(){ this._taskBar.animate({ top: $(window).height() - 29 + this._taskBar.outerHeight(true) }, 500,function(){ $.taskBar._taskBar.hide(); }); } } })(jQuery);
zyroot
trunk/admin/dwz1.4.5/js/dwz.taskBar.js
JavaScript
art
8,837
/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net) * Licensed under the MIT License (LICENSE.txt). * * Version 2.1.3-pre */ (function($){ $.fn.bgiframe = ($.browser.msie && /msie 6\.0/i.test(navigator.userAgent) ? function(s) { s = $.extend({ top : 'auto', // auto == .currentStyle.borderTopWidth left : 'auto', // auto == .currentStyle.borderLeftWidth width : 'auto', // auto == offsetWidth height : 'auto', // auto == offsetHeight opacity : true, src : 'javascript:false;' }, s); var html = '<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+s.src+'"'+ 'style="display:block;position:absolute;z-index:-1;'+ (s.opacity !== false?'filter:Alpha(Opacity=\'0\');':'')+ 'top:'+(s.top=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+\'px\')':prop(s.top))+';'+ 'left:'+(s.left=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+\'px\')':prop(s.left))+';'+ 'width:'+(s.width=='auto'?'expression(this.parentNode.offsetWidth+\'px\')':prop(s.width))+';'+ 'height:'+(s.height=='auto'?'expression(this.parentNode.offsetHeight+\'px\')':prop(s.height))+';'+ '"/>'; return this.each(function() { if ( $(this).children('iframe.bgiframe').length === 0 ) this.insertBefore( document.createElement(html), this.firstChild ); }); } : function() { return this; }); // old alias $.fn.bgIframe = $.fn.bgiframe; function prop(n) { return n && n.constructor === Number ? n + 'px' : n; } })(jQuery);
zyroot
trunk/admin/dwz1.4.5/js/jquery.bgiframe.js
JavaScript
art
1,728
/** * @author Roger Wu * @version 1.0 */ (function($){ $.fn.extend({jresize:function(options) { if (typeof options == 'string') { if (options == 'destroy') return this.each(function() { var dialog = this; $("div[class^='resizable']",dialog).each(function() { $(this).hide(); }); }); } return this.each(function(){ var dialog = $(this); var resizable = $(".resizable"); $("div[class^='resizable']",dialog).each(function() { var bar = this; $(bar).mousedown(function(event) { $.pdialog.switchDialog(dialog); $.resizeTool.start(resizable, dialog, event, $(bar).attr("tar")); return false; }).show(); }); }); }}); $.resizeTool = { start:function(resizable, dialog, e, target) { $.pdialog.initResize(resizable, dialog, target); $.data(resizable[0], 'layer-drag', { options: $.extend($.pdialog._op, {target:target, dialog:dialog,stop:$.resizeTool.stop}) }); $.layerdrag.start(resizable[0], e, $.pdialog._op); }, stop:function(){ var data = $.data(arguments[0], 'layer-drag'); $.pdialog.resizeDialog(arguments[0], data.options.dialog, data.options.target); $("body").css("cursor", ""); $(arguments[0]).hide(); } }; $.layerdrag = { start:function(obj, e, options) { if (!$.layerdrag.current) { $.layerdrag.current = { el: obj, oleft: parseInt(obj.style.left) || 0, owidth: parseInt(obj.style.width) || 0, otop: parseInt(obj.style.top) || 0, oheight:parseInt(obj.style.height) || 0, ox: e.pageX || e.screenX, oy: e.pageY || e.clientY }; $(document).bind('mouseup', $.layerdrag.stop); $(document).bind('mousemove', $.layerdrag.drag); } return $.layerdrag.preventEvent(e); }, drag: function(e) { if (!e) var e = window.event; var current = $.layerdrag.current; var data = $.data(current.el, 'layer-drag'); var lmove = (e.pageX || e.screenX) - current.ox; var tmove = (e.pageY || e.clientY) - current.oy; if((e.pageY || e.clientY) <= 0 || (e.pageY || e.clientY) >= ($(window).height() - $(".dialogHeader", $(data.options.dialog)).outerHeight())) return false; var target = data.options.target; var width = current.owidth; var height = current.oheight; if (target != "n" && target != "s") { width += (target.indexOf("w") >= 0)?-lmove:lmove; } if (width >= $.pdialog._op.minW) { if (target.indexOf("w") >= 0) { current.el.style.left = (current.oleft + lmove) + 'px'; } if (target != "n" && target != "s") { current.el.style.width = width + 'px'; } } if (target != "w" && target != "e") { height += (target.indexOf("n") >= 0)?-tmove:tmove; } if (height >= $.pdialog._op.minH) { if (target.indexOf("n") >= 0) { current.el.style.top = (current.otop + tmove) + 'px'; } if (target != "w" && target != "e") { current.el.style.height = height + 'px'; } } return $.layerdrag.preventEvent(e); }, stop: function(e) { var current = $.layerdrag.current; var data = $.data(current.el, 'layer-drag'); $(document).unbind('mousemove', $.layerdrag.drag); $(document).unbind('mouseup', $.layerdrag.stop); if (data.options.stop) { data.options.stop.apply(current.el, [ current.el ]); } $.layerdrag.current = null; return $.layerdrag.preventEvent(e); }, preventEvent:function(e) { if (e.stopPropagation) e.stopPropagation(); if (e.preventDefault) e.preventDefault(); return false; } }; })(jQuery);
zyroot
trunk/admin/dwz1.4.5/js/dwz.resize.js
JavaScript
art
3,896
/** * @author Roger Wu */ (function($) { var jmenus = new Map(); // If the DWZ scope is not available, add it $.dwz = $.dwz || {}; $(window).resize(function(){ setTimeout(function(){ for (var i=0; i<jmenus.size();i++){ fillSpace(jmenus.element(i).key); } }, 100); }); $.fn.extend({ accordion: function(options, data) { var args = Array.prototype.slice.call(arguments, 1); return this.each(function() { if (options.fillSpace) jmenus.put(options.fillSpace, this); if (typeof options == "string") { var accordion = $.data(this, "dwz-accordion"); accordion[options].apply(accordion, args); // INIT with optional options } else if (!$(this).is(".dwz-accordion")) $.data(this, "dwz-accordion", new $.dwz.accordion(this, options)); }); }, /** * deprecated, use accordion("activate", index) instead * @param {Object} index */ activate: function(index) { return this.accordion("activate", index); } }); $.dwz.accordion = function(container, options) { // setup configuration this.options = options = $.extend({}, $.dwz.accordion.defaults, options); this.element = container; $(container).addClass("dwz-accordion"); if ( options.navigation ) { var current = $(container).find("a").filter(options.navigationFilter); if ( current.length ) { if ( current.filter(options.header).length ) { options.active = current; } else { options.active = current.parent().parent().prev(); current.addClass("current"); } } } // calculate active if not specified, using the first header options.headers = $(container).find(options.header); options.active = findActive(options.headers, options.active); if ( options.fillSpace ) { fillSpace(options.fillSpace); } else if ( options.autoheight ) { var maxHeight = 0; options.headers.next().each(function() { maxHeight = Math.max(maxHeight, $(this).outerHeight()); }).height(maxHeight); } options.headers .not(options.active || "") .next() .hide(); options.active.find("h2").addClass(options.selectedClass); if (options.event) $(container).bind((options.event) + ".dwz-accordion", clickHandler); }; $.dwz.accordion.prototype = { activate: function(index) { // call clickHandler with custom event clickHandler.call(this.element, { target: findActive( this.options.headers, index )[0] }); }, enable: function() { this.options.disabled = false; }, disable: function() { this.options.disabled = true; }, destroy: function() { this.options.headers.next().css("display", ""); if ( this.options.fillSpace || this.options.autoheight ) { this.options.headers.next().css("height", ""); } $.removeData(this.element, "dwz-accordion"); $(this.element).removeClass("dwz-accordion").unbind(".dwz-accordion"); } } function scopeCallback(callback, scope) { return function() { return callback.apply(scope, arguments); }; } function completed(cancel) { // if removed while animated data can be empty if (!$.data(this, "dwz-accordion")) return; var instance = $.data(this, "dwz-accordion"); var options = instance.options; options.running = cancel ? 0 : --options.running; if ( options.running ) return; if ( options.clearStyle ) { options.toShow.add(options.toHide).css({ height: "", overflow: "" }); } $(this).triggerHandler("change.dwz-accordion", [options.data], options.change); } function fillSpace(key){ var obj = jmenus.get(key); if (!obj) return; var parent = $(obj).parent(); var height = parent.height() - (($(".accordionHeader", obj).size()) * ($(".accordionHeader:first-child", obj).outerHeight())) -2; var os = parent.children().not(obj); $.each(os, function(i){ height -= $(os[i]).outerHeight(); }); $(".accordionContent",obj).height(height); } function toggle(toShow, toHide, data, clickedActive, down) { var options = $.data(this, "dwz-accordion").options; options.toShow = toShow; options.toHide = toHide; options.data = data; var complete = scopeCallback(completed, this); // count elements to animate options.running = toHide.size() == 0 ? toShow.size() : toHide.size(); if ( options.animated ) { if ( !options.alwaysOpen && clickedActive ) { $.dwz.accordion.animations[options.animated]({ toShow: jQuery([]), toHide: toHide, complete: complete, down: down, autoheight: options.autoheight }); } else { $.dwz.accordion.animations[options.animated]({ toShow: toShow, toHide: toHide, complete: complete, down: down, autoheight: options.autoheight }); } } else { if ( !options.alwaysOpen && clickedActive ) { toShow.toggle(); } else { toHide.hide(); toShow.show(); } complete(true); } } function clickHandler(event) { var options = $.data(this, "dwz-accordion").options; if (options.disabled) return false; // called only when using activate(false) to close all parts programmatically if ( !event.target && !options.alwaysOpen ) { options.active.find("h2").toggleClass(options.selectedClass); var toHide = options.active.next(), data = { instance: this, options: options, newHeader: jQuery([]), oldHeader: options.active, newContent: jQuery([]), oldContent: toHide }, toShow = options.active = $([]); toggle.call(this, toShow, toHide, data ); return false; } // get the click target var clicked = $(event.target); // due to the event delegation model, we have to check if one // of the parent elements is our actual header, and find that if ( clicked.parents(options.header).length ) while ( !clicked.is(options.header) ) clicked = clicked.parent(); var clickedActive = clicked[0] == options.active[0]; // if animations are still active, or the active header is the target, ignore click if (options.running || (options.alwaysOpen && clickedActive)) return false; if (!clicked.is(options.header)) return; // switch classes options.active.find("h2").toggleClass(options.selectedClass); if ( !clickedActive ) { clicked.find("h2").addClass(options.selectedClass); } // find elements to show and hide var toShow = clicked.next(), toHide = options.active.next(), //data = [clicked, options.active, toShow, toHide], data = { instance: this, options: options, newHeader: clicked, oldHeader: options.active, newContent: toShow, oldContent: toHide }, down = options.headers.index( options.active[0] ) > options.headers.index( clicked[0] ); options.active = clickedActive ? $([]) : clicked; toggle.call(this, toShow, toHide, data, clickedActive, down ); return false; }; function findActive(headers, selector) { return selector != undefined ? typeof selector == "number" ? headers.filter(":eq(" + selector + ")") : headers.not(headers.not(selector)) : selector === false ? $([]) : headers.filter(":eq(0)"); } $.extend($.dwz.accordion, { defaults: { selectedClass: "collapsable", alwaysOpen: true, animated: 'slide', event: "click", header: ".accordionHeader", autoheight: true, running: 0, navigationFilter: function() { return this.href.toLowerCase() == location.href.toLowerCase(); } }, animations: { slide: function(options, additions) { options = $.extend({ easing: "swing", duration: 300 }, options, additions); if ( !options.toHide.size() ) { options.toShow.animate({height: "show"}, options); return; } var hideHeight = options.toHide.height(), showHeight = options.toShow.height(), difference = showHeight / hideHeight; options.toShow.css({ height: 0}).show(); options.toHide.filter(":hidden").each(options.complete).end().filter(":visible").animate({height:"hide"},{ step: function(now) { var current = (hideHeight - now) * difference; if ($.browser.msie || $.browser.opera) { current = Math.ceil(current); } options.toShow.height( current ); }, duration: options.duration, easing: options.easing, complete: function() { if ( !options.autoheight ) { options.toShow.css({height:"auto"}); } options.toShow.css({overflow:"auto"}); options.complete(); } }); }, bounceslide: function(options) { this.slide(options, { easing: options.down ? "bounceout" : "swing", duration: options.down ? 1000 : 200 }); }, easeslide: function(options) { this.slide(options, { easing: "easeinout", duration: 700 }) } } }); })(jQuery);
zyroot
trunk/admin/dwz1.4.5/js/dwz.accordion.js
JavaScript
art
8,768
/** * @author ZhangHuihua@msn.com */ $.setRegional("alertMsg", { title:{error:"Error", info:"Information", warn:"Warning", correct:"Successful", confirm:"Confirmation"}, butMsg:{ok:"OK", yes:"Yes", no:"No", cancel:"Cancel"} }); var alertMsg = { _boxId: "#alertMsgBox", _bgId: "#alertBackground", _closeTimer: null, _types: {error:"error", info:"info", warn:"warn", correct:"correct", confirm:"confirm"}, _getTitle: function(key){ return $.regional.alertMsg.title[key]; }, _keydownOk: function(event){ if (event.keyCode == DWZ.keyCode.ENTER) event.data.target.trigger("click"); return false; }, _keydownEsc: function(event){ if (event.keyCode == DWZ.keyCode.ESC) event.data.target.trigger("click"); }, /** * * @param {Object} type * @param {Object} msg * @param {Object} buttons [button1, button2] */ _open: function(type, msg, buttons){ $(this._boxId).remove(); var butsHtml = ""; if (buttons) { for (var i = 0; i < buttons.length; i++) { var sRel = buttons[i].call ? "callback" : ""; butsHtml += DWZ.frag["alertButFrag"].replace("#butMsg#", buttons[i].name).replace("#callback#", sRel); } } var boxHtml = DWZ.frag["alertBoxFrag"].replace("#type#", type).replace("#title#", this._getTitle(type)).replace("#message#", msg).replace("#butFragment#", butsHtml); $(boxHtml).appendTo("body").css({top:-$(this._boxId).height()+"px"}).animate({top:"0px"}, 500); if (this._closeTimer) { clearTimeout(this._closeTimer); this._closeTimer = null; } if (this._types.info == type || this._types.correct == type){ this._closeTimer = setTimeout(function(){alertMsg.close()}, 3500); } else { $(this._bgId).show(); } //用于屏蔽点击回车,触发click事件,再次打开alert $('<input type="text" style="width:0;height:0;" name="_alertFocusCtr"/>').appendTo(this._boxId).focus().hide(); var jButs = $(this._boxId).find("a.button"); var jCallButs = jButs.filter("[rel=callback]"); var jDoc = $(document); for (var i = 0; i < buttons.length; i++) { if (buttons[i].call) jCallButs.eq(i).click(buttons[i].call); if (buttons[i].keyCode == DWZ.keyCode.ENTER) { jDoc.bind("keydown",{target:jButs.eq(i)}, this._keydownOk); } if (buttons[i].keyCode == DWZ.keyCode.ESC) { jDoc.bind("keydown",{target:jButs.eq(i)}, this._keydownEsc); } } }, close: function(){ $(document).unbind("keydown", this._keydownOk).unbind("keydown", this._keydownEsc); $(this._boxId).animate({top:-$(this._boxId).height()}, 500, function(){ $(this).remove(); }); $(this._bgId).hide(); }, error: function(msg, options) { this._alert(this._types.error, msg, options); }, info: function(msg, options) { this._alert(this._types.info, msg, options); }, warn: function(msg, options) { this._alert(this._types.warn, msg, options); }, correct: function(msg, options) { this._alert(this._types.correct, msg, options); }, _alert: function(type, msg, options) { var op = {okName:$.regional.alertMsg.butMsg.ok, okCall:null}; $.extend(op, options); var buttons = [ {name:op.okName, call: op.okCall, keyCode:DWZ.keyCode.ENTER} ]; this._open(type, msg, buttons); }, /** * * @param {Object} msg * @param {Object} options {okName, okCal, cancelName, cancelCall} */ confirm: function(msg, options) { var op = {okName:$.regional.alertMsg.butMsg.ok, okCall:null, cancelName:$.regional.alertMsg.butMsg.cancel, cancelCall:null}; $.extend(op, options); var buttons = [ {name:op.okName, call: op.okCall, keyCode:DWZ.keyCode.ENTER}, {name:op.cancelName, call: op.cancelCall, keyCode:DWZ.keyCode.ESC} ]; this._open(this._types.confirm, msg, buttons); } };
zyroot
trunk/admin/dwz1.4.5/js/dwz.alertMsg.js
JavaScript
art
3,809
/** * @author Roger Wu */ /*@cc_on _d=document;eval('var document=_d')@*/ /*@cc_on eval((function(props) {var code = [];for (var i = 0,l = props.length;i<l;i++){var prop = props[i];window['_'+prop]=window[prop];code.push(prop+'=_'+prop);}return 'var '+code.join(',');})('document self top parent alert setInterval clearInterval setTimeout clearTimeout'.split(' ')))@*/
zyroot
trunk/admin/dwz1.4.5/js/speedup.js
JavaScript
art
374
(function(){ function formatCurrency(num) { num = num.toString().replace(/\$|\,/g,''); if(isNaN(num)) {num = "0";} var sign = (num == (num = Math.abs(num))); num = Math.floor(num*100+0.50000000001); var cents = num%100; num = Math.floor(num/100).toString(); if(cents<10) {cents = "0" + cents;} for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++){ num = num.substring(0,num.length-(4*i+3))+','+num.substring(num.length-(4*i+3)); } return (((sign)?'':'-') + num + '.' + cents); } function parseCurrency(str) { if (!str) return 0; str = str.replace(',', ''); return $.isNumeric(str) ? parseFloat(str) : 0; } /** * 数字转中文大写 */ function amountInWords(dValue, maxDec){ // 验证输入金额数值或数值字符串: dValue = dValue.toString().replace(/,/g, ""); dValue = dValue.replace(/^0+/, ""); // 金额数值转字符、移除逗号、移除前导零 if (dValue == "") { return "零元整"; } // (错误:金额为空!) else if (isNaN(dValue)) { return "错误:金额不是合法的数值!"; } var minus = ""; // 负数的符号“-”的大写:“负”字。可自定义字符,如“(负)”。 var CN_SYMBOL = ""; // 币种名称(如“人民币”,默认空) if (dValue.length > 1) { if (dValue.indexOf('-') == 0) { dValue = dValue.replace("-", ""); minus = "负"; } // 处理负数符号“-” if (dValue.indexOf('+') == 0) { dValue = dValue.replace("+", ""); } // 处理前导正数符号“+”(无实际意义) } // 变量定义: var vInt = "", vDec = ""; // 字符串:金额的整数部分、小数部分 var resAIW; // 字符串:要输出的结果 var parts; // 数组(整数部分.小数部分),length=1时则仅为整数。 var digits, radices, bigRadices, decimals; // 数组:数字(0~9——零~玖);基(十进制记数系统中每个数字位的基是10——拾,佰,仟);大基(万,亿,兆,京,垓,杼,穰,沟,涧,正);辅币(元以下,角/分/厘/毫/丝)。 var zeroCount; // 零计数 var i, p, d; // 循环因子;前一位数字;当前位数字。 var quotient, modulus; // 整数部分计算用:商数、模数。 // 金额数值转换为字符,分割整数部分和小数部分:整数、小数分开来搞(小数部分有可能四舍五入后对整数部分有进位)。 var NoneDecLen = (typeof(maxDec) == "undefined" || maxDec == null || Number(maxDec) < 0 || Number(maxDec) > 5); // 是否未指定有效小数位(true/false) parts = dValue.split('.'); // 数组赋值:(整数部分.小数部分),Array的length=1则仅为整数。 if (parts.length > 1) { vInt = parts[0]; vDec = parts[1]; // 变量赋值:金额的整数部分、小数部分 if(NoneDecLen) { maxDec = vDec.length > 5 ? 5 : vDec.length; } // 未指定有效小数位参数值时,自动取实际小数位长但不超5。 var rDec = Number("0." + vDec); rDec *= Math.pow(10, maxDec); rDec = Math.round(Math.abs(rDec)); rDec /= Math.pow(10, maxDec); // 小数四舍五入 var aIntDec = rDec.toString().split('.'); if(Number(aIntDec[0]) == 1) { vInt = (Number(vInt) + 1).toString(); } // 小数部分四舍五入后有可能向整数部分的个位进位(值1) if(aIntDec.length > 1) { vDec = aIntDec[1]; } else { vDec = ""; } } else { vInt = dValue; vDec = ""; if(NoneDecLen) { maxDec = 0; } } if(vInt.length > 44) { return "错误:金额值太大了!整数位长【" + vInt.length.toString() + "】超过了上限——44位/千正/10^43(注:1正=1万涧=1亿亿亿亿亿,10^40)!"; } // 准备各字符数组 Prepare the characters corresponding to the digits: digits = new Array("零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"); radices = new Array("", "拾", "佰", "仟"); // 拾,佰,仟 bigRadices = new Array("", "万", "亿", "兆", "京", "垓", "杼", "穰" ,"沟", "涧", "正"); decimals = new Array("角", "分", "厘", "毫", "丝"); resAIW = ""; // 开始处理 // 处理整数部分(如果有) if (Number(vInt) > 0) { zeroCount = 0; for (i = 0; i < vInt.length; i++) { p = vInt.length - i - 1; d = vInt.substr(i, 1); quotient = p / 4; modulus = p % 4; if (d == "0") { zeroCount++; } else { if (zeroCount > 0) { resAIW += digits[0]; } zeroCount = 0; resAIW += digits[Number(d)] + radices[modulus]; } if (modulus == 0 && zeroCount < 4) { resAIW += bigRadices[quotient]; } } resAIW += "元"; } // 处理小数部分(如果有) for (i = 0; i < vDec.length; i++) { d = vDec.substr(i, 1); if (d != "0") { resAIW += digits[Number(d)] + decimals[i]; } } // 处理结果 if (resAIW == "") { resAIW = "零" + "元"; } // 零元 if (vDec == "") { resAIW += "整"; } // ...元整 resAIW = CN_SYMBOL + minus + resAIW; // 人民币/负......元角分/整 return resAIW; } Number.prototype.formatCurrency = function(format) { return formatCurrency(this); }; Number.prototype.amountInWords = function(maxDec) { return amountInWords(this, maxDec); } String.prototype.parseCurrency = function(format) { return parseCurrency(this); }; String.prototype.amountInWords = function(maxDec) { var dValue = parseCurrency(this); return amountInWords(dValue, maxDec); } })();
zyroot
trunk/admin/dwz1.4.5/js/dwz.util.number.js
JavaScript
art
5,416
/** * @author Roger Wu */ (function($){ $.extend($.fn, { jBlindUp: function(options){ var op = $.extend({duration: 500, easing: "swing", call: function(){}}, options); return this.each(function(){ var $this = $(this); $(this).animate({height: 0}, { step: function(){}, duration: op.duration, easing: op.easing, complete: function(){ $this.css({display: "none"}); op.call(); } }); }); }, jBlindDown: function(options){ var op = $.extend({to:0, duration: 500,easing: "swing",call: function(){}}, options); return this.each(function(){ var $this = $(this); var fixedPanelHeight = (op.to > 0)?op.to:$.effect.getDimensions($this[0]).height; $this.animate({height: fixedPanelHeight}, { step: function(){}, duration: op.duration, easing: op.easing, complete: function(){ $this.css({display: ""}); op.call(); } }); }); }, jSlideUp:function(options) { var op = $.extend({to:0, duration: 500,easing: "swing",call: function(){}}, options); return this.each(function(){ var $this = $(this); $this.wrapInner("<div></div>"); var fixedHeight = (op.to > 0)?op.to:$.effect.getDimensions($(">div",$this)[0]).height; $this.css({overflow:"visible",position:"relative"}); $(">div",$this).css({position:"relative"}).animate({top: -fixedHeight}, { easing: op.easing, duration: op.duration, complete:function(){$this.html($(this).html());} }); }); }, jSlideDown:function(options) { var op = $.extend({to:0, duration: 500,easing: "swing",call: function(){}}, options); return this.each(function(){ var $this = $(this); var fixedHeight = (op.to > 0)?op.to:$.effect.getDimensions($this[0]).height; $this.wrapInner("<div style=\"top:-" + fixedHeight + "px;\"></div>"); $this.css({overflow:"visible",position:"relative", height:"0px"}) .animate({height: fixedHeight}, { duration: op.duration, easing: op.easing, complete: function(){ $this.css({display: "", overflow:""}); op.call(); } }); $(">div",$this).css({position:"relative"}).animate({top: 0}, { easing: op.easing, duration: op.duration, complete:function(){$this.html($(this).html());} }); }); } }); $.effect = { getDimensions: function(element, displayElement){ var dimensions = new $.effect.Rectangle; var displayOrig = $(element).css('display'); var visibilityOrig = $(element).css('visibility'); var isZero = $(element).height()==0?true:false; if ($(element).is(":hidden")) { $(element).css({visibility: 'hidden', display: 'block'}); if(isZero)$(element).css("height",""); if ($.browser.opera) refElement.focus(); } dimensions.height = $(element).outerHeight(); dimensions.width = $(element).outerWidth(); if (displayOrig == 'none'){ $(element).css({visibility: visibilityOrig, display: 'none'}); if(isZero) if(isZero)$(element).css("height","0px"); } return dimensions; } } $.effect.Rectangle = function(){ this.width = 0; this.height = 0; this.unit = "px"; } })(jQuery);
zyroot
trunk/admin/dwz1.4.5/js/dwz.effects.js
JavaScript
art
3,138
/** * @author ZhangHuihua@msn.com * */ (function($){ $.fn.extend({ /** * options: reverse[true, false], eventType[click, hover], currentIndex[default index 0] * stTab[tabs selector], stTabPanel[tab panel selector] * ajaxClass[ajax load], closeClass[close tab] */ tabs: function (options){ var op = $.extend({reverse:false, eventType:"click", currentIndex:0, stTabHeader:"> .tabsHeader", stTab:">.tabsHeaderContent>ul", stTabPanel:"> .tabsContent", ajaxClass:"j-ajax", closeClass:"close", prevClass:"tabsLeft", nextClass:"tabsRight"}, options); return this.each(function(){ initTab($(this)); }); function initTab(jT){ var jSelector = jT.add($("> *", jT)); var jTabHeader = $(op.stTabHeader, jSelector); var jTabs = $(op.stTab + " li", jTabHeader); var jGroups = $(op.stTabPanel + " > *", jSelector); jTabs.unbind().find("a").unbind(); jTabHeader.find("."+op.prevClass).unbind(); jTabHeader.find("."+op.nextClass).unbind(); jTabs.each(function(iTabIndex){ if (op.currentIndex == iTabIndex) $(this).addClass("selected"); else $(this).removeClass("selected"); if (op.eventType == "hover") $(this).hover(function(event){switchTab(jT, iTabIndex)}); else $(this).click(function(event){switchTab(jT, iTabIndex)}); $("a", this).each(function(){ if ($(this).hasClass(op.ajaxClass)) { $(this).click(function(event){ var jGroup = jGroups.eq(iTabIndex); if (this.href && !jGroup.attr("loaded")) jGroup.loadUrl(this.href,{},function(){ jGroup.find("[layoutH]").layoutH(); jGroup.attr("loaded",true); }); event.preventDefault(); }); } else if ($(this).hasClass(op.closeClass)) { $(this).click(function(event){ jTabs.eq(iTabIndex).remove(); jGroups.eq(iTabIndex).remove(); if (iTabIndex == op.currentIndex) { op.currentIndex = (iTabIndex+1 < jTabs.size()) ? iTabIndex : iTabIndex - 1; } else if (iTabIndex < op.currentIndex){ op.currentIndex = iTabIndex; } initTab(jT); return false; }); } }); }); switchTab(jT, op.currentIndex); } function switchTab(jT, iTabIndex){ var jSelector = jT.add($("> *", jT)); var jTabHeader = $(op.stTabHeader, jSelector); var jTabs = $(op.stTab + " li", jTabHeader); var jGroups = $(op.stTabPanel + " > *", jSelector); var jTab = jTabs.eq(iTabIndex); var jGroup = jGroups.eq(iTabIndex); if (op.reverse && (jTab.hasClass("selected") )) { jTabs.removeClass("selected"); jGroups.hide(); } else { op.currentIndex = iTabIndex; jTabs.removeClass("selected"); jTab.addClass("selected"); jGroups.hide().eq(op.currentIndex).show(); } if (!jGroup.attr("inited")){ jGroup.attr("inited", 1000).find("input[type=text]").filter("[alt]").inputAlert(); } } } }); })(jQuery);
zyroot
trunk/admin/dwz1.4.5/js/dwz.tab.js
JavaScript
art
3,094
/** * Cookie plugin * * Copyright (c) 2006 Klaus Hartl (stilbuero.de) * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * */ /** * Create a cookie with the given name and value and other optional parameters. * * @example $.cookie('the_cookie', 'the_value'); * @desc Set the value of a cookie. * @example $.cookie('the_cookie', 'the_value', {expires: 7, path: '/', domain: 'jquery.com', secure: true}); * @desc Create a cookie with all available options. * @example $.cookie('the_cookie', 'the_value'); * @desc Create a session cookie. * @example $.cookie('the_cookie', null); * @desc Delete a cookie by passing null as value. * * @param String name The name of the cookie. * @param String value The value of the cookie. * @param Object options An object literal containing key/value pairs to provide optional cookie attributes. * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object. * If a negative value is specified (e.g. a date in the past), the cookie will be deleted. * If set to null or omitted, the cookie will be a session cookie and will not be retained * when the the browser exits. * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie). * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie). * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will * require a secure protocol (like HTTPS). * @type undefined * * @name $.cookie * @cat Plugins/Cookie * @author Klaus Hartl/klaus.hartl@stilbuero.de */ /** * Get the value of a cookie with the given name. * * @example $.cookie('the_cookie'); * @desc Get the value of a cookie. * * @param String name The name of the cookie. * @return The value of the cookie. * @type String * * @name $.cookie * @cat Plugins/Cookie * @author Klaus Hartl/klaus.hartl@stilbuero.de */ jQuery.cookie = function(name, value, options) { if (typeof value != 'undefined') { // name and value given, set cookie options = options || {}; if (value === null) { value = ''; options.expires = -1; } var expires = ''; if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) { var date; if (typeof options.expires == 'number') { date = new Date(); date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000)); } else { date = options.expires; } expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE } var path = options.path ? '; path=' + options.path : ''; var domain = options.domain ? '; domain=' + options.domain : ''; var secure = options.secure ? '; secure' : ''; document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join(''); } else { // only name given, get cookie var cookieValue = null; if (document.cookie && document.cookie != '') { var cookies = document.cookie.split(';'); for (var i = 0; i < cookies.length; i++) { var cookie = jQuery.trim(cookies[i]); // Does this cookie string begin with the name we want? if (cookie.substring(0, name.length + 1) == (name + '=')) { cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); break; } } } return cookieValue; } };
zyroot
trunk/admin/dwz1.4.5/js/jquery.cookie.js
JavaScript
art
4,028
/** * @author ZhangHuihua@msn.com */ (function($){ var _lookup = {currentGroup:"", suffix:"", $target:null, pk:"id"}; var _util = { _lookupPrefix: function(key){ var strDot = _lookup.currentGroup ? "." : ""; return _lookup.currentGroup + strDot + key + _lookup.suffix; }, lookupPk: function(key){ return this._lookupPrefix(key); }, lookupField: function(key){ return this.lookupPk(key); } }; $.extend({ bringBackSuggest: function(args){ var $box = _lookup['$target'].parents(".unitBox:first"); $box.find(":input").each(function(){ var $input = $(this), inputName = $input.attr("name"); for (var key in args) { var name = (_lookup.pk == key) ? _util.lookupPk(key) : _util.lookupField(key); if (name == inputName) { $input.val(args[key]); break; } } }); }, bringBack: function(args){ $.bringBackSuggest(args); $.pdialog.closeCurrent(); } }); $.fn.extend({ lookup: function(){ return this.each(function(){ var $this = $(this), options = {mask:true, width:$this.attr('width')||820, height:$this.attr('height')||400, maxable:eval($this.attr("maxable") || "true"), resizable:eval($this.attr("resizable") || "true") }; $this.click(function(event){ _lookup = $.extend(_lookup, { currentGroup: $this.attr("lookupGroup") || "", suffix: $this.attr("suffix") || "", $target: $this, pk: $this.attr("lookupPk") || "id" }); var url = unescape($this.attr("href")).replaceTmById($(event.target).parents(".unitBox:first")); if (!url.isFinishedTm()) { alertMsg.error($this.attr("warn") || DWZ.msg("alertSelectMsg")); return false; } $.pdialog.open(url, "_blank", $this.attr("title") || $this.text(), options); return false; }); }); }, multLookup: function(){ return this.each(function(){ var $this = $(this), args={}; $this.click(function(event){ var $unitBox = $this.parents(".unitBox:first"); $unitBox.find("[name='"+$this.attr("multLookup")+"']").filter(":checked").each(function(){ var _args = DWZ.jsonEval($(this).val()); for (var key in _args) { var value = args[key] ? args[key]+"," : ""; args[key] = value + _args[key]; } }); if ($.isEmptyObject(args)) { alertMsg.error($this.attr("warn") || DWZ.msg("alertSelectMsg")); return false; } $.bringBack(args); }); }); }, suggest: function(){ var op = {suggest$:"#suggest", suggestShadow$: "#suggestShadow"}; var selectedIndex = -1; return this.each(function(){ var $input = $(this).attr('autocomplete', 'off').keydown(function(event){ if (event.keyCode == DWZ.keyCode.ENTER && $(op.suggest$).is(':visible')) return false; //屏蔽回车提交 }); var suggestFields=$input.attr('suggestFields').split(","); function _show(event){ var offset = $input.offset(); var iTop = offset.top+this.offsetHeight; var $suggest = $(op.suggest$); if ($suggest.size() == 0) $suggest = $('<div id="suggest"></div>').appendTo($('body')); $suggest.css({ left:offset.left+'px', top:iTop+'px' }).show(); _lookup = $.extend(_lookup, { currentGroup: $input.attr("lookupGroup") || "", suffix: $input.attr("suffix") || "", $target: $input, pk: $input.attr("lookupPk") || "id" }); var url = unescape($input.attr("suggestUrl")).replaceTmById($(event.target).parents(".unitBox:first")); if (!url.isFinishedTm()) { alertMsg.error($input.attr("warn") || DWZ.msg("alertSelectMsg")); return false; } var postData = {}; postData[$input.attr("postField")||"inputValue"] = $input.val(); $.ajax({ global:false, type:'POST', dataType:"json", url:url, cache: false, data: postData, success: function(response){ if (!response) return; var html = ''; $.each(response, function(i){ var liAttr = '', liLabel = ''; for (var i=0; i<suggestFields.length; i++){ var str = this[suggestFields[i]]; if (str) { if (liLabel) liLabel += '-'; liLabel += str; } } for (var key in this) { if (liAttr) liAttr += ','; liAttr += key+":'"+this[key]+"'"; } html += '<li lookupAttrs="'+liAttr+'">' + liLabel + '</li>'; }); var $lis = $suggest.html('<ul>'+html+'</ul>').find("li"); $lis.hoverClass("selected").click(function(){ _select($(this)); }); if ($lis.size() == 1 && event.keyCode != DWZ.keyCode.BACKSPACE) { _select($lis.eq(0)); } else if ($lis.size() == 0){ var jsonStr = ""; for (var i=0; i<suggestFields.length; i++){ if (_util.lookupField(suggestFields[i]) == event.target.name) { break; } if (jsonStr) jsonStr += ','; jsonStr += suggestFields[i]+":''"; } jsonStr = "{"+_lookup.pk+":''," + jsonStr +"}"; $.bringBackSuggest(DWZ.jsonEval(jsonStr)); } }, error: function(){ $suggest.html(''); } }); $(document).bind("click", _close); return false; } function _select($item){ var jsonStr = "{"+ $item.attr('lookupAttrs') +"}"; $.bringBackSuggest(DWZ.jsonEval(jsonStr)); } function _close(){ $(op.suggest$).html('').hide(); selectedIndex = -1; $(document).unbind("click", _close); } $input.focus(_show).click(false).keyup(function(event){ var $items = $(op.suggest$).find("li"); switch(event.keyCode){ case DWZ.keyCode.ESC: case DWZ.keyCode.TAB: case DWZ.keyCode.SHIFT: case DWZ.keyCode.HOME: case DWZ.keyCode.END: case DWZ.keyCode.LEFT: case DWZ.keyCode.RIGHT: break; case DWZ.keyCode.ENTER: _close(); break; case DWZ.keyCode.DOWN: if (selectedIndex >= $items.size()-1) selectedIndex = -1; else selectedIndex++; break; case DWZ.keyCode.UP: if (selectedIndex < 0) selectedIndex = $items.size()-1; else selectedIndex--; break; default: _show(event); } $items.removeClass("selected"); if (selectedIndex>=0) { var $item = $items.eq(selectedIndex).addClass("selected"); _select($item); } }); }); }, itemDetail: function(){ return this.each(function(){ var $table = $(this).css("clear","both"), $tbody = $table.find("tbody"); var fields=[]; $table.find("tr:first th[type]").each(function(i){ var $th = $(this); var field = { type: $th.attr("type") || "text", patternDate: $th.attr("dateFmt") || "yyyy-MM-dd", name: $th.attr("name") || "", defaultVal: $th.attr("defaultVal") || "", size: $th.attr("size") || "12", enumUrl: $th.attr("enumUrl") || "", lookupGroup: $th.attr("lookupGroup") || "", lookupUrl: $th.attr("lookupUrl") || "", lookupPk: $th.attr("lookupPk") || "id", suggestUrl: $th.attr("suggestUrl"), suggestFields: $th.attr("suggestFields"), postField: $th.attr("postField") || "", fieldClass: $th.attr("fieldClass") || "", fieldAttrs: $th.attr("fieldAttrs") || "" }; fields.push(field); }); $tbody.find("a.btnDel").click(function(){ var $btnDel = $(this); if ($btnDel.is("[href^=javascript:]")){ $btnDel.parents("tr:first").remove(); initSuffix($tbody); return false; } function delDbData(){ $.ajax({ type:'POST', dataType:"json", url:$btnDel.attr('href'), cache: false, success: function(){ $btnDel.parents("tr:first").remove(); initSuffix($tbody); }, error: DWZ.ajaxError }); } if ($btnDel.attr("title")){ alertMsg.confirm($btnDel.attr("title"), {okCall: delDbData}); } else { delDbData(); } return false; }); var addButTxt = $table.attr('addButton') || "Add New"; if (addButTxt) { var $addBut = $('<div class="button"><div class="buttonContent"><button type="button">'+addButTxt+'</button></div></div>').insertBefore($table).find("button"); var $rowNum = $('<input type="text" name="dwz_rowNum" class="textInput" style="margin:2px;" value="1" size="2"/>').insertBefore($table); var trTm = ""; $addBut.click(function(){ if (! trTm) trTm = trHtml(fields); var rowNum = 1; try{rowNum = parseInt($rowNum.val())} catch(e){} for (var i=0; i<rowNum; i++){ var $tr = $(trTm); $tr.appendTo($tbody).initUI().find("a.btnDel").click(function(){ $(this).parents("tr:first").remove(); initSuffix($tbody); return false; }); } initSuffix($tbody); }); } }); /** * 删除时重新初始化下标 */ function initSuffix($tbody) { $tbody.find('>tr').each(function(i){ $(':input, a.btnLook, a.btnAttach', this).each(function(){ var $this = $(this), name = $this.attr('name'), val = $this.val(); if (name) $this.attr('name', name.replaceSuffix(i)); var lookupGroup = $this.attr('lookupGroup'); if (lookupGroup) {$this.attr('lookupGroup', lookupGroup.replaceSuffix(i));} var suffix = $this.attr("suffix"); if (suffix) {$this.attr('suffix', suffix.replaceSuffix(i));} if (val && val.indexOf("#index#") >= 0) $this.val(val.replace('#index#',i+1)); }); }); } function tdHtml(field){ var html = '', suffix = ''; if (field.name.endsWith("[#index#]")) suffix = "[#index#]"; else if (field.name.endsWith("[]")) suffix = "[]"; var suffixFrag = suffix ? ' suffix="' + suffix + '" ' : ''; var attrFrag = ''; if (field.fieldAttrs){ var attrs = DWZ.jsonEval(field.fieldAttrs); for (var key in attrs) { attrFrag += key+'="'+attrs[key]+'"'; } } switch(field.type){ case 'del': html = '<a href="javascript:void(0)" class="btnDel '+ field.fieldClass + '">删除</a>'; break; case 'lookup': var suggestFrag = ''; if (field.suggestFields) { suggestFrag = 'autocomplete="off" lookupGroup="'+field.lookupGroup+'"'+suffixFrag+' suggestUrl="'+field.suggestUrl+'" suggestFields="'+field.suggestFields+'"' + ' postField="'+field.postField+'"'; } html = '<input type="hidden" name="'+field.lookupGroup+'.'+field.lookupPk+suffix+'"/>' + '<input type="text" name="'+field.name+'"'+suggestFrag+' lookupPk="'+field.lookupPk+'" size="'+field.size+'" class="'+field.fieldClass+'"/>' + '<a class="btnLook" href="'+field.lookupUrl+'" lookupGroup="'+field.lookupGroup+'" '+suggestFrag+' lookupPk="'+field.lookupPk+'" title="查找带回">查找带回</a>'; break; case 'attach': html = '<input type="hidden" name="'+field.lookupGroup+'.'+field.lookupPk+suffix+'"/>' + '<input type="text" name="'+field.name+'" size="'+field.size+'" readonly="readonly" class="'+field.fieldClass+'"/>' + '<a class="btnAttach" href="'+field.lookupUrl+'" lookupGroup="'+field.lookupGroup+'" '+suggestFrag+' lookupPk="'+field.lookupPk+'" width="560" height="300" title="查找带回">查找带回</a>'; break; case 'enum': $.ajax({ type:"POST", dataType:"html", async: false, url:field.enumUrl, data:{inputName:field.name}, success:function(response){ html = response; } }); break; case 'date': html = '<input type="text" name="'+field.name+'" value="'+field.defaultVal+'" class="date '+field.fieldClass+'" dateFmt="'+field.patternDate+'" size="'+field.size+'"/>' +'<a class="inputDateButton" href="javascript:void(0)">选择</a>'; break; default: html = '<input type="text" name="'+field.name+'" value="'+field.defaultVal+'" size="'+field.size+'" class="'+field.fieldClass+'" '+attrFrag+'/>'; break; } return '<td>'+html+'</td>'; } function trHtml(fields){ var html = ''; $(fields).each(function(){ html += tdHtml(this); }); return '<tr class="unitBox">'+html+'</tr>'; } }, selectedTodo: function(){ function _getIds(selectedIds, targetType){ var ids = ""; var $box = targetType == "dialog" ? $.pdialog.getCurrent() : navTab.getCurrentPanel(); $box.find("input:checked").filter("[name='"+selectedIds+"']").each(function(i){ var val = $(this).val(); ids += i==0 ? val : ","+val; }); return ids; } return this.each(function(){ var $this = $(this); var selectedIds = $this.attr("rel") || "ids"; var postType = $this.attr("postType") || "map"; $this.click(function(){ var targetType = $this.attr("targetType"); var ids = _getIds(selectedIds, targetType); if (!ids) { alertMsg.error($this.attr("warn") || DWZ.msg("alertSelectMsg")); return false; } var _callback = $this.attr("callback") || (targetType == "dialog" ? dialogAjaxDone : navTabAjaxDone); if (! $.isFunction(_callback)) _callback = eval('(' + _callback + ')'); function _doPost(){ $.ajax({ type:'POST', url:$this.attr('href'), dataType:'json', cache: false, data: function(){ if (postType == 'map'){ return $.map(ids.split(','), function(val, i) { return {name: selectedIds, value: val}; }) } else { var _data = {}; _data[selectedIds] = ids; return _data; } }(), success: _callback, error: DWZ.ajaxError }); } var title = $this.attr("title"); if (title) { alertMsg.confirm(title, {okCall: _doPost}); } else { _doPost(); } return false; }); }); } }); })(jQuery);
zyroot
trunk/admin/dwz1.4.5/js/dwz.database.js
JavaScript
art
14,454
/** * @author zhanghuihua@msn.com */ (function($){ $.fn.navMenu = function(){ return this.each(function(){ var $box = $(this); $box.find("li>a").click(function(){ var $a = $(this); $.post($a.attr("href"), {}, function(html){ $("#sidebar").find(".accordion").remove().end().append(html).initUI(); $box.find("li").removeClass("selected"); $a.parent().addClass("selected"); navTab.closeAllTab(); }); return false; }); }); } $.fn.switchEnv = function(){ var op = {cities$:">ul>li", boxTitle$:">a>span"}; return this.each(function(){ var $this = $(this); $this.click(function(){ if ($this.hasClass("selected")){ _hide($this); } else { _show($this); } return false; }); $this.find(op.cities$).click(function(){ var $li = $(this); $.post($li.find(">a").attr("href"), {}, function(html){ _hide($this); $this.find(op.boxTitle$).html($li.find(">a").html()); navTab.closeAllTab(); $("#sidebar").find(".accordion").remove().end().append(html).initUI(); }); return false; }); }); } function _show($box){ $box.addClass("selected"); $(document).bind("click",{box:$box}, _handler); } function _hide($box){ $box.removeClass("selected"); $(document).unbind("click", _handler); } function _handler(event){ _hide(event.data.box); } })(jQuery);
zyroot
trunk/admin/dwz1.4.5/js/dwz.switchEnv.js
JavaScript
art
1,453
/* * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ * * Uses the built in easing capabilities added In jQuery 1.1 * to offer multiple easing options * * TERMS OF USE - jQuery Easing * * Open source under the BSD License. * * Copyright © 2008 George McGinley Smith * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * Neither the name of the author nor the names of contributors may be used to endorse * or promote products derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * */ // t: current time, b: begInnIng value, c: change In value, d: duration jQuery.easing['jswing'] = jQuery.easing['swing']; jQuery.extend( jQuery.easing, { def: 'easeOutQuad', swing: function (x, t, b, c, d) { //alert(jQuery.easing.default); return jQuery.easing[jQuery.easing.def](x, t, b, c, d); }, easeInQuad: function (x, t, b, c, d) { return c*(t/=d)*t + b; }, easeOutQuad: function (x, t, b, c, d) { return -c *(t/=d)*(t-2) + b; }, easeInOutQuad: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t + b; return -c/2 * ((--t)*(t-2) - 1) + b; }, easeInCubic: function (x, t, b, c, d) { return c*(t/=d)*t*t + b; }, easeOutCubic: function (x, t, b, c, d) { return c*((t=t/d-1)*t*t + 1) + b; }, easeInOutCubic: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t*t + b; return c/2*((t-=2)*t*t + 2) + b; }, easeInQuart: function (x, t, b, c, d) { return c*(t/=d)*t*t*t + b; }, easeOutQuart: function (x, t, b, c, d) { return -c * ((t=t/d-1)*t*t*t - 1) + b; }, easeInOutQuart: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t*t*t + b; return -c/2 * ((t-=2)*t*t*t - 2) + b; }, easeInQuint: function (x, t, b, c, d) { return c*(t/=d)*t*t*t*t + b; }, easeOutQuint: function (x, t, b, c, d) { return c*((t=t/d-1)*t*t*t*t + 1) + b; }, easeInOutQuint: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b; return c/2*((t-=2)*t*t*t*t + 2) + b; }, easeInSine: function (x, t, b, c, d) { return -c * Math.cos(t/d * (Math.PI/2)) + c + b; }, easeOutSine: function (x, t, b, c, d) { return c * Math.sin(t/d * (Math.PI/2)) + b; }, easeInOutSine: function (x, t, b, c, d) { return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; }, easeInExpo: function (x, t, b, c, d) { return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b; }, easeOutExpo: function (x, t, b, c, d) { return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b; }, easeInOutExpo: function (x, t, b, c, d) { if (t==0) return b; if (t==d) return b+c; if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b; return c/2 * (-Math.pow(2, -10 * --t) + 2) + b; }, easeInCirc: function (x, t, b, c, d) { return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b; }, easeOutCirc: function (x, t, b, c, d) { return c * Math.sqrt(1 - (t=t/d-1)*t) + b; }, easeInOutCirc: function (x, t, b, c, d) { if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b; return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b; }, easeInElastic: function (x, t, b, c, d) { var s=1.70158;var p=0;var a=c; if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; if (a < Math.abs(c)) { a=c; var s=p/4; } else var s = p/(2*Math.PI) * Math.asin (c/a); return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; }, easeOutElastic: function (x, t, b, c, d) { var s=1.70158;var p=0;var a=c; if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; if (a < Math.abs(c)) { a=c; var s=p/4; } else var s = p/(2*Math.PI) * Math.asin (c/a); return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; }, easeInOutElastic: function (x, t, b, c, d) { var s=1.70158;var p=0;var a=c; if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5); if (a < Math.abs(c)) { a=c; var s=p/4; } else var s = p/(2*Math.PI) * Math.asin (c/a); if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; }, easeInBack: function (x, t, b, c, d, s) { if (s == undefined) s = 1.70158; return c*(t/=d)*t*((s+1)*t - s) + b; }, easeOutBack: function (x, t, b, c, d, s) { if (s == undefined) s = 1.70158; return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; }, easeInOutBack: function (x, t, b, c, d, s) { if (s == undefined) s = 1.70158; if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; }, easeInBounce: function (x, t, b, c, d) { return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b; }, easeOutBounce: function (x, t, b, c, d) { if ((t/=d) < (1/2.75)) { return c*(7.5625*t*t) + b; } else if (t < (2/2.75)) { return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; } else if (t < (2.5/2.75)) { return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; } else { return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; } }, easeInOutBounce: function (x, t, b, c, d) { if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b; return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b; } }); /* * * TERMS OF USE - EASING EQUATIONS * * Open source under the BSD License. * * Copyright © 2001 Robert Penner * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * Neither the name of the author nor the names of contributors may be used to endorse * or promote products derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * */
zyroot
trunk/admin/dwz1.4.5/js/jquery.easing.1.3.js
JavaScript
art
8,097
<h2 class="contentTitle">日历控件</h2> <div class="pageContent"> <form method="post" action="demo/common/ajaxDone.html" class="pageForm required-validate" onsubmit="return validateCallback(this, navTabAjaxDone);"> <div class="pageFormContent" layoutH="98"> <p> <label>默认格式:</label> <input type="text" name="date1" class="date" readonly="true"/> <a class="inputDateButton" href="javascript:;">选择</a> <span class="info">yyyy-MM-dd</span> </p> <p> <label>定义日期范围:</label> <input type="text" name="date2" value="2000-01-15" class="date" minDate="2000-01-15" maxDate="2012-12-15" readonly="true"/> <a class="inputDateButton" href="javascript:;">选择</a> </p> <p> <label>自定义日期格式:</label> <input type="text" name="date3" class="date" dateFmt="yyyy/MM/dd" minDate="2000-01" maxDate="2012-06" readonly="true" /> <a class="inputDateButton" href="javascript:;">选择</a> <span class="info">yyyy/MM/dd</span> </p> <p> <label>自定义日期格式:</label> <input type="text" name="date4" class="date" dateFmt="dd/MM/yyyy" minDate="2000" maxDate="2012" readonly="true"/> <a class="inputDateButton" href="javascript:;">选择</a> <span class="info">dd/MM/yyyy</span> </p> <p> <label>动态参数minDate:</label> <input type="text" name="date5" class="date" dateFmt="dd/MM/yy" minDate="{%y-10}-%M-%d" maxDate="{%y}-%M-{%d+1}"/> <a class="inputDateButton" href="javascript:;">选择</a> <span class="info">dd/MM/yy</span> </p> <p> <label>自定义日期格式:</label> <input type="text" name="date6" class="date" dateFmt="yyyyMMdd" minDate="2000-01-01" maxDate="2020-12-31"/> <a class="inputDateButton" href="javascript:;">选择</a> <span class="info">yyyyMMdd</span> </p> <p> <label>自定义日期格式:</label> <input type="text" name="date7" class="date" dateFmt="yyyy年MM月dd日" minDate="2000-01-01" maxDate="2020-12-31"/> <a class="inputDateButton" href="javascript:;">选择</a> <span class="info">yyyy年MM月dd日</span> </p> <p> <label>自定义日期格式:</label> <input type="text" name="date8" class="date" dateFmt="y年M月d日" minDate="2000-01-01" maxDate="2020-12-31"/> <a class="inputDateButton" href="javascript:;">选择</a> <span class="info">y年M月d日</span> </p> <div class="divider"></div> <h3>日期 + 时间</h3> <div class="unit"> <label>自定义日期格式:</label> <input type="text" name="date10" class="date" dateFmt="yyyy-MM-dd HH:mm:ss" readonly="true"/> <a class="inputDateButton" href="javascript:;">选择</a> <span class="info">yyyy-MM-dd HH:mm:ss</span> </div> <div class="unit"> <label>自定义日期格式:</label> <input type="text" name="date11" class="date" dateFmt="yyyy-MM-dd HH:mm" readonly="true"/> <a class="inputDateButton" href="javascript:;">选择</a> <span class="info">yyyy-MM-dd HH:mm</span> </div> <div class="unit"> <label>自定义日期格式:</label> <input type="text" name="date12" class="date" dateFmt="yyyy-MM-dd HH:ss" readonly="true"/> <a class="inputDateButton" href="javascript:;">选择</a> <span class="info">yyyy-MM-dd HH:ss</span> </div> <div class="unit"> <label>自定义日期格式:</label> <input type="text" name="date13" class="date" dateFmt="y年M月d日 H点" readonly="true"/> <a class="inputDateButton" href="javascript:;">选择</a> <span class="info">y年M月d日 H点</span> </div> <div class="unit"> <label>自定义日期格式:</label> <input type="text" name="date14" class="date" dateFmt="EEE HH:mm:ss" readonly="true"/> <a class="inputDateButton" href="javascript:;">选择</a> <span class="info">EEE HH:mm:ss</span> </div> <div class="unit"> <label>自定义只有时间:</label> <input type="text" name="date15" class="date" dateFmt="HH:mm:ss" readonly="true"/> <a class="inputDateButton" href="javascript:;">选择</a> <span class="info">HH:mm:ss</span> </div> <div class="unit"> <label>自定义时间:</label> <input type="text" name="date16" class="date" dateFmt="HH:mm" mmStep="15" readonly="true"/> <a class="inputDateButton" href="javascript:;">选择</a> <span class="info">HH:mm</span> </div> <div class="nowrap"> <p> 定义日期范围属性minDate,maxDate静态格式y-M-d或y-M或y,支持以下几种写法:<br/> minDate="2000-01-15" maxDate="2012-12-15"<br/> minDate="2000-01" maxDate="2012-12"<br/> minDate="2000" maxDate="2012"<br/> </p> <p> 定义日期范围属性minDate,maxDate动态态格式%y-%M-%d或%y-%M或%y,支持以下几种写法:<br/> minDate="{%y-10}-%M-%d" maxDate="{%y}-%M-{%d+1}"<br/> minDate="{%y-10}-%M" maxDate="{%y+10}-%M"<br/> minDate="{%y-10}" maxDate="{%y+10}"<br/> </p> </div> </div> <div class="formBar"> <ul> <li><div class="buttonActive"><div class="buttonContent"><button type="submit">提交</button></div></div></li> <li> <div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div> </li> </ul> </div> </form> </div>
zyroot
trunk/admin/dwz1.4.5/w_datepicker.html
HTML
art
5,409
<div class="pageContent"> <form method="post" action="demo/common/ajaxDone.html" enctype="multipart/form-data" class="pageForm required-validate" onsubmit="return iframeCallback(this);"> <div class="pageFormContent" layoutH="56"> <p> <label>文件一:</label> <input name="file1" type="file" /> </p> <p> <label>文件二:</label> <input name="file2" type="file" /> </p> <p><label>多文件上传:</label> <a rel="w_uploadify" target="navTab" href="w_uploadify.html" class="button"><span>uploadify上传示例</span></a> </p> </div> <div class="formBar"> <ul> <li><div class="buttonActive"><div class="buttonContent"><button type="submit">提交</button></div></div></li> <li><div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div></li> </ul> </div> </form> </div>
zyroot
trunk/admin/dwz1.4.5/demo_upload.html
HTML
art
917
<form id="pagerForm" method="post" action="#rel#"> <input type="hidden" name="pageNum" value="1" /> <input type="hidden" name="numPerPage" value="${model.numPerPage}" /> <input type="hidden" name="orderField" value="${param.orderField}" /> <input type="hidden" name="orderDirection" value="${param.orderDirection}" /> </form> <div class="pageHeader"> <form rel="pagerForm" onsubmit="return navTabSearch(this);" action="w_removeSelected.html" method="post"> <div class="searchBar"> <ul class="searchContent"> <li> <label>我的客户:</label> <input type="text" name="keywords" value=""/> </li> <li> <select class="combox" name="province"> <option value="">所有省市</option> <option value="北京">北京</option> <option value="上海">上海</option> <option value="天津">天津</option> <option value="重庆">重庆</option> <option value="广东">广东</option> </select> </li> </ul> <!-- <table class="searchContent"> <tr> <td> 我的客户:<input type="text"/> </td> <td> <select class="combox" name="province"> <option value="">所有省市</option> <option value="北京">北京</option> <option value="上海">上海</option> <option value="天津">天津</option> <option value="重庆">重庆</option> <option value="广东">广东</option> </select> </td> </tr> </table> --> <div class="subBar"> <ul> <li><div class="buttonActive"><div class="buttonContent"><button type="submit">检索</button></div></div></li> <li><a class="button" href="demo_page6.html" target="dialog" mask="true" title="查询框"><span>高级检索</span></a></li> </ul> </div> </div> </form> </div> <div class="pageContent"> <div class="panelBar"> <ul class="toolBar"> <li><a class="add" href="demo_page4.html" target="navTab"><span>添加</span></a></li> <li><a title="确实要删除这些记录吗?" target="selectedTodo" rel="ids" href="demo/common/ajaxDone.html" class="delete"><span>批量删除默认方式</span></a></li> <li><a title="确实要删除这些记录吗?" target="selectedTodo" rel="ids" postType="string" href="demo/common/ajaxDone.html" class="delete"><span>批量删除逗号分隔</span></a></li> <li><a class="edit" href="demo_page4.html?uid={sid_user}" target="navTab" warn="请选择一个用户"><span>修改</span></a></li> <li class="line">line</li> <li><a class="icon" href="demo/common/dwz-team.xls" target="dwzExport" targetType="navTab" title="实要导出这些记录吗?"><span>导出EXCEL</span></a></li> </ul> </div> <table class="table" width="1200" layoutH="138"> <thead> <tr> <th width="22"><input type="checkbox" group="ids" class="checkboxCtrl"></th> <th width="120" orderField="accountNo" class="asc">客户号</th> <th orderField="accountName">客户名称</th> <th width="80" orderField="accountType">客户类型</th> <th width="130" orderField="accountCert">证件号码</th> <th width="60" align="center" orderField="accountLevel">信用等级</th> <th width="70">所属行业</th> <th width="70">建档日期</th> <th width="70">操作</th> </tr> </thead> <tbody> <tr target="sid_user" rel="1"> <td><input name="ids" value="xxx" type="checkbox"></td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> <td> <a title="删除" target="ajaxTodo" href="demo/common/ajaxDone.html?id=xxx" class="btnDel">删除</a> <a title="编辑" target="navTab" href="demo_page4.html?id=xxx" class="btnEdit">编辑</a> </td> </tr> <tr target="sid_user" rel="2"> <td><input name="ids" value="xxx" type="checkbox"></td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> <td> <a title="删除" target="ajaxTodo" href="demo/common/ajaxDone.html?id=xxx" class="btnDel">删除</a> <a title="编辑" target="navTab" href="demo_page4.html?id=xxx" class="btnEdit">编辑</a> </td> </tr> <tr target="sid_user" rel="3"> <td><input name="ids" value="xxx" type="checkbox"></td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> <td> <a title="删除" target="ajaxTodo" href="demo/common/ajaxDone.html?id=xxx" class="btnDel">删除</a> <a title="编辑" target="navTab" href="demo_page4.html?id=xxx" class="btnEdit">编辑</a> </td> </tr> <tr target="sid_user" rel="4"> <td><input name="ids" value="xxx" type="checkbox"></td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> <td> <a title="删除" target="ajaxTodo" href="demo/common/ajaxDone.html?id=xxx" class="btnDel">删除</a> <a title="编辑" target="navTab" href="demo_page4.html?id=xxx" class="btnEdit">编辑</a> </td> </tr> <tr target="sid_user" rel="5"> <td><input name="ids" value="xxx" type="checkbox"></td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> <td> <a title="删除" target="ajaxTodo" href="demo/common/ajaxDone.html?id=xxx" class="btnDel">删除</a> <a title="编辑" target="navTab" href="demo_page4.html?id=xxx" class="btnEdit">编辑</a> </td> </tr> <tr target="sid_user" rel="6"> <td><input name="ids" value="xxx" type="checkbox"></td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> <td> <a title="删除" target="ajaxTodo" href="demo/common/ajaxDone.html?id=xxx" class="btnDel">删除</a> <a title="编辑" target="navTab" href="demo_page4.html?id=xxx" class="btnEdit">编辑</a> </td> </tr> <tr target="sid_user" rel="7"> <td><input name="ids" value="xxx" type="checkbox"></td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> <td> <a title="删除" target="ajaxTodo" href="demo/common/ajaxDone.html?id=xxx" class="btnDel">删除</a> <a title="编辑" target="navTab" href="demo_page4.html?id=xxx" class="btnEdit">编辑</a> </td> </tr> <tr target="sid_user" rel="8"> <td><input name="ids" value="xxx" type="checkbox"></td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> <td> <a title="删除" target="ajaxTodo" href="demo/common/ajaxDone.html?id=xxx" class="btnDel">删除</a> <a title="编辑" target="navTab" href="demo_page4.html?id=xxx" class="btnEdit">编辑</a> </td> </tr> <tr target="sid_user" rel="9"> <td><input name="ids" value="xxx" type="checkbox"></td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> <td> <a title="删除" target="ajaxTodo" href="demo/common/ajaxDone.html?id=xxx" class="btnDel">删除</a> <a title="编辑" target="navTab" href="demo_page4.html?id=xxx" class="btnEdit">编辑</a> </td> </tr> <tr target="sid_user" rel="10"> <td><input name="ids" value="xxx" type="checkbox"></td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> <td> <a title="删除" target="ajaxTodo" href="demo/common/ajaxDone.html?id=xxx" class="btnDel">删除</a> <a title="编辑" target="navTab" href="demo_page4.html?id=xxx" class="btnEdit">编辑</a> </td> </tr> <tr target="sid_user" rel="11"> <td><input name="ids" value="xxx" type="checkbox"></td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> <td> <a title="删除" target="ajaxTodo" href="demo/common/ajaxDone.html?id=xxx" class="btnDel">删除</a> <a title="编辑" target="navTab" href="demo_page4.html?id=xxx" class="btnEdit">编辑</a> </td> </tr> <tr target="sid_user" rel="12"> <td><input name="ids" value="xxx" type="checkbox"></td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> <td> <a title="删除" target="ajaxTodo" href="demo/common/ajaxDone.html?id=xxx" class="btnDel">删除</a> <a title="编辑" target="navTab" href="demo_page4.html?id=xxx" class="btnEdit">编辑</a> </td> </tr> <tr target="sid_user" rel="13"> <td><input name="ids" value="xxx" type="checkbox"></td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> <td> <a title="删除" target="ajaxTodo" href="demo/common/ajaxDone.html?id=xxx" class="btnDel">删除</a> <a title="编辑" target="navTab" href="demo_page4.html?id=xxx" class="btnEdit">编辑</a> </td> </tr> <tr target="sid_user" rel="14"> <td><input name="ids" value="xxx" type="checkbox"></td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> <td> <a title="删除" target="ajaxTodo" href="demo/common/ajaxDone.html?id=xxx" class="btnDel">删除</a> <a title="编辑" target="navTab" href="demo_page4.html?id=xxx" class="btnEdit">编辑</a> </td> </tr> <tr target="sid_user" rel="15"> <td><input name="ids" value="xxx" type="checkbox"></td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> <td> <a title="删除" target="ajaxTodo" href="demo/common/ajaxDone.html?id=xxx" class="btnDel">删除</a> <a title="编辑" target="navTab" href="demo_page4.html?id=xxx" class="btnEdit">编辑</a> </td> </tr> <tr target="sid_user" rel="16"> <td><input name="ids" value="xxx" type="checkbox"></td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> <td> <a title="删除" target="ajaxTodo" href="demo/common/ajaxDone.html?id=xxx" class="btnDel">删除</a> <a title="编辑" target="navTab" href="demo_page4.html?id=xxx" class="btnEdit">编辑</a> </td> </tr> <tr target="sid_user" rel="17"> <td><input name="ids" value="xxx" type="checkbox"></td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> <td> <a title="删除" target="ajaxTodo" href="demo/common/ajaxDone.html?id=xxx" class="btnDel">删除</a> <a title="编辑" target="navTab" href="demo_page4.html?id=xxx" class="btnEdit">编辑</a> </td> </tr> <tr target="sid_user" rel="18"> <td><input name="ids" value="xxx" type="checkbox"></td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> <td> <a title="删除" target="ajaxTodo" href="demo/common/ajaxDone.html?id=xxx" class="btnDel">删除</a> <a title="编辑" target="navTab" href="demo_page4.html?id=xxx" class="btnEdit">编辑</a> </td> </tr> <tr target="sid_user" rel="19"> <td><input name="ids" value="xxx" type="checkbox"></td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> <td> <a title="删除" target="ajaxTodo" href="demo/common/ajaxDone.html?id=xxx" class="btnDel">删除</a> <a title="编辑" target="navTab" href="demo_page4.html?id=xxx" class="btnEdit">编辑</a> </td> </tr> <tr target="sid_user" rel="20"> <td><input name="ids" value="xxx" type="checkbox"></td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> <td> <a title="删除" target="ajaxTodo" href="demo/common/ajaxDone.html?id=xxx" class="btnDel">删除</a> <a title="编辑" target="navTab" href="demo_page4.html?id=xxx" class="btnEdit">编辑</a> </td> </tr> </tbody> </table> <div class="panelBar"> <div class="pages"> <span>显示</span> <select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})"> <option value="20">20</option> <option value="50">50</option> <option value="100">100</option> <option value="200">200</option> </select> <span>条,共${totalCount}条</span> </div> <div class="pagination" targetType="navTab" totalCount="200" numPerPage="20" pageNumShown="10" currentPage="1"></div> </div> </div>
zyroot
trunk/admin/dwz1.4.5/w_removeSelected.html
HTML
art
14,951
<div class="pageContent" layoutH="0"> <div class="accordion" style="width:300px;float:left;margin:5px;"> <div class="accordionHeader"> <h2><span>Folder</span>界面组件</h2> </div> <div class="accordionContent"> <ul class="tree treeFolder"> <li><a href="tabsPage.html" target="navTab">框架面板</a> <ul> <li><a href="main.html" target="navTab" rel="main">我的主页</a></li> <li><a href="demo_page1.html" target="navTab" rel="page1">页面一</a></li> <li><a href="demo_page1.html" target="navTab" rel="page1">替换页面一</a></li> <li><a href="demo_page2.html" target="navTab" rel="page2">页面二</a></li> <li><a href="demo_page4.html" target="navTab" rel="page3" title="页面三(自定义标签名)">页面三</a></li> </ul> </li> <li><a href="w_panel.html" target="navTab" rel="w_panel">面板</a></li> <li><a href="w_tabs.html" target="navTab" rel="w_tabs">选项卡面板</a></li> <li><a href="w_dialog.html" target="navTab" rel="w_dialog">弹出窗口</a></li> <li><a href="w_alert.html" target="navTab" rel="w_alert">提示窗口</a></li> <li><a href="w_list.html" target="navTab" rel="w_list">CSS表格容器</a></li> <li><a href="demo_page1.html" target="navTab" rel="w_table">表格容器</a></li> <li><a href="w_tree.html" target="navTab" rel="w_tree">树形菜单</a></li> <li><a href="w_editor.html" target="navTab" rel="w_editor">编辑器</a></li> <li><a href="w_validation.html" target="navTab" rel="w_validation">表单组件</a> <ul> <li><a href="w_validation.html" target="navTab" rel="w_validation">表单验证</a></li> <li><a href="w_datepicker.html" target="navTab" rel="w_datepicker">日期控件</a></li> <li><a href="w_button.html" target="navTab" rel="w_button">按钮</a></li> <li><a href="w_textInput.html" target="navTab" rel="w_textInput">文本框/文本域</a></li> <li><a href="w_combox.html" target="navTab" rel="w_combox">下拉菜单</a></li> <li><a href="w_checkbox.html" target="navTab" rel="w_checkbox">多选框/单选框</a></li> </ul> </li> </ul> </div> <div class="accordionHeader"> <h2><span>Folder</span>典型页面</h2> </div> <div class="accordionContent"> <ul class="tree treeFolder treeCheck"> <li><a href="demo_upload.html" tname="name" tvalue="roger" target="navTab" rel="demo_upload">文件上传表单提交示例</a></li> <li><a href="demo_page1.html" tname="name" tvalue="roger" target="navTab" rel="demo_page1">查询我的客户</a></li> <li><a href="demo_page1.html" tname="name" tvalue="roger" target="navTab" rel="demo_page2">表单查询页面</a></li> <li><a href="demo_page4.html" tname="name" tvalue="roger" target="navTab" rel="demo_page4">表单录入页面</a></li> <li><a href="demo_page5.html" tname="name" tvalue="roger" target="navTab" rel="demo_page5">有文本输入的表单</a></li> <li><a href="#" tname="name" tvalue="roger">有提示的表单输入页面</a> <ul> <li><a href="#" tname="name" tvalue="roger" >页面一</a></li> <li><a href="#" tname="name" tvalue="roger" >页面二</a></li> </ul> </li> <li><a href="#" tname="name" tvalue="roger" >选项卡和图形的页面</a> <ul> <li><a href="#" tname="name" tvalue="roger" >页面一</a></li> <li><a href="#" tname="name" tvalue="roger" >页面二</a></li> </ul> </li> <li><a href="#" tname="name" tvalue="roger" >选项卡和图形切换的页面</a></li> <li><a href="#" tname="name" tvalue="roger" >左右两个互动的页面</a></li> <li><a href="#" tname="name" tvalue="roger" >列表输入的页面</a></li> <li><a href="#" tname="name" tvalue="roger" >双层栏目列表的页面</a></li> </ul> </div> <div class="accordionHeader"> <h2><span>Folder</span>流程演示</h2> </div> <div class="accordionContent"> <ul class="tree"> <li><a href="newPage1.html" target="dialog" rel="dlg_page">列表</a></li> <li><a href="newPage1.html" target="dialog" rel="dlg_page">列表</a></li> <li><a href="newPage1.html" target="dialog" rel="dlg_page2">列表</a></li> <li><a href="newPage1.html" target="dialog" rel="dlg_page2">列表</a></li> </ul> </div> </div> <div class="accordion" style="width:300px;float:left;margin:5px;"> <div class="accordionHeader"> <h2><span>icon</span>面板1</h2> </div> <div class="accordionContent" style="height:200px"> 内容1 </div> <div class="accordionHeader"> <h2><span>icon</span>面板2</h2> </div> <div class="accordionContent"> 内容2 </div> <div class="accordionHeader"> <h2><span>icon</span>面板3</h2> </div> <div class="accordionContent"> 内容3 </div> </div> </div>
zyroot
trunk/admin/dwz1.4.5/w_accordion.html
HTML
art
4,824
<script type="text/javascript"> function testConfirmMsg(url, data){ alertMsg.confirm("您修改的资料未保存,请选择保存或取消!", { okCall: function(){ $.post(url, data, DWZ.ajaxDone, "json"); } }); } </script> <h2 class="contentTitle">提示对话框演示</h2> <div style="padding:0 10px;"> <div class="tabs"> <div class="tabsHeader"> <div class="tabsHeaderContent"> <ul> <li class="selected"><a href="javascript:;"><span>示例</span></a></li> <li><a href="javascript:;"><span>代码</span></a></li> </ul> </div> </div> <div class="tabsContent" layoutH="100"> <div> <a class="button" href="javascript:;" onclick="testConfirmMsg('demo/common/ajaxDone.html')"><span>确认(是/否)</span></a><br /><br /><br /> <a class="button" href="javascript:;" onclick="alertMsg.error('您提交的数据有误,请检查后重新提交!')"><span>错误提示</span></a><br /><br /><br /> <a class="button" href="javascript:;" onclick="alertMsg.info('您提交的数据有误,请检查后重新提交!')"><span>信息提示</span></a><br /><br /><br /> <a class="button" href="javascript:;" onclick="alertMsg.warn('您提交的数据有误,请检查后重新提交!')"><span>警告提示</span></a><br /><br /><br /> <a class="button" href="javascript:;" onclick="alertMsg.correct('您的数据提交成功!')"><span>成功提示</span></a><br /><br /> </div> <div> <textarea name="textarea" cols="100" rows="15"> <script type="text/javascript"> function testConfirmMsg(url, data){ alertMsg.confirm("您修改的资料未保存,请选择保存或取消!", { okCall: function(){ $.post(url, data, DWZ.ajaxDone, "json"); } }); } </script> <a class="button" href="javascript:;" onclick="testConfirmMsg('demo/common/ajaxDone.html')"><span>确认(是/否)</span></a><br /><br /> <a class="button" href="javascript:;" onclick="alertMsg.error('您提交的数据有误,请检查后重新提交!')"><span>错误提示</span></a><br /><br /> <a class="button" href="javascript:;" onclick="alertMsg.info('您提交的数据有误,请检查后重新提交!')"><span>信息提示</span></a><br /><br /> <a class="button" href="javascript:;" onclick="alertMsg.warn('您提交的数据有误,请检查后重新提交!')"><span>警告提示</span></a><br /><br /> <a class="button" href="javascript:;" onclick="alertMsg.correct('您的数据提交成功!')"><span>成功提示</span></a><br /><br /> </textarea> </div> </div> <div class="tabsFooter"> <div class="tabsFooterContent"></div> </div> </div> </div>
zyroot
trunk/admin/dwz1.4.5/w_alert.html
HTML
art
2,704
<h2 class="contentTitle">多选框/单选框</h2> <form method="post" action="demo/common/ajaxDone.html" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone)"> <div class="pageFormContent" layoutH="98"> <label><input type="radio" name="r1" />选择1</label> <label><input type="radio" name="r1" />选择2</label> <label><input type="radio" name="r1" />选择3</label> <label><input type="radio" name="r1" />选择4</label> <label><input type="radio" name="r1" />选择5</label> <div class="divider"></div> <label><input type="checkbox" name="c1" value="1" />选择1</label> <label><input type="checkbox" name="c1" value="2" />选择2</label> <label><input type="checkbox" name="c1" value="3" />选择3</label> <label><input type="checkbox" name="c1" value="4" />选择4</label> <label><input type="checkbox" name="c1" value="5" />选择5</label> <label><input type="checkbox" name="c1" value="6" />选择6</label> <label><input type="checkbox" name="c1" value="7" />选择7</label> <label><input type="checkbox" name="c1" value="8" />选择8</label> <label><input type="checkbox" name="c1" value="9" />选择9</label> <label><input type="checkbox" name="c1" value="10" />选择10</label> </div> <div class="formBar"> <label style="float:left"><input type="checkbox" class="checkboxCtrl" group="c1" />全选</label> <ul> <li><div class="button"><div class="buttonContent"><button type="button" class="checkboxCtrl" group="c1" selectType="invert">反选</button></div></div></li> <li><div class="buttonActive"><div class="buttonContent"><button type="submit">提交</button></div></div></li> </ul> </div> </form>
zyroot
trunk/admin/dwz1.4.5/w_checkbox.html
HTML
art
1,729
<h2 class="contentTitle">选项卡面板演示</h2> <div class="pageContent"> <div class="tabs" currentIndex="1" eventType="click"> <div class="tabsHeader"> <div class="tabsHeaderContent"> <ul> <li><a href="javascript:;"><span>标题1</span></a></li> <li><a href="javascript:;"><span>标题2</span></a></li> <li><a href="demo_page2.html" class="j-ajax"><span>标题3</span></a></li> </ul> </div> </div> <div class="tabsContent" style="height:150px;"> <div> <pre> currentIndex: 0-n default:0 eventType: click|hover default:click </pre> </div> <div>内容2</div> <div></div> </div> <div class="tabsFooter"> <div class="tabsFooterContent"></div> </div> </div> <p>&nbsp;</p> <div class="tabs" currentIndex="0" eventType="click"> <div class="tabsHeader"> <div class="tabsHeaderContent"> <ul> <li><a href="javascript:;"><span>标题1</span></a></li> <li><a href="javascript:;"><span>标题2</span></a></li> </ul> </div> </div> <div class="tabsContent" style="height:250px;"> <div>内容1 <p> <label>客户名称:</label> <input name="name" class="required" type="hover" size="30" value="" alt="请输入客户名称"/> </p> </div> <div> <div class="tabs" currentIndex="0" eventType="click" style="width:300px"> <div class="tabsHeader"> <div class="tabsHeaderContent"> <ul> <li><a href="javascript:;"><span>标题1</span></a></li> <li><a href="javascript:;"><span>标题2</span></a></li> </ul> </div> </div> <div class="tabsContent" style="height:150px;"> <div>内容1</div> <div>内容2</div> </div> <div class="tabsFooter"> <div class="tabsFooterContent"></div> </div> </div> </div> </div> <div class="tabsFooter"> <div class="tabsFooterContent"></div> </div> </div> </div>
zyroot
trunk/admin/dwz1.4.5/w_tabs.html
HTML
art
1,985
<div class="pageContent"> <form method="post" action="demo/common/ajaxDone.html" class="pageForm required-validate" onsubmit="return validateCallback(this, navTabAjaxDone);"> <div class="pageFormContent" layoutH="57"> <dl> <dt>资产总额:</dt> <dd><input class="required" name="total" type="text" size="30" /></dd> </dl> <dl class="nowrap"> <dt>数据来源:</dt> <dd><textarea cols="45" rows="5" name="source"></textarea></dd> </dl> <div class="divider"></div> <dl> <dt>最新修改时间:</dt> <dd><input readonly="readonly" type="text" size="30" /></dd> </dl> <dl> <dt>最新修改人员:</dt> <dd><input readonly="readonly" type="text" size="30" /></dd> </dl> </div> <div class="formBar"> <ul> <li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li> <li><div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div></li> </ul> </div> </form> </div>
zyroot
trunk/admin/dwz1.4.5/demo_page5.html
HTML
art
1,084
<h2 class="contentTitle">按钮</h2> <div class="pageFormContent" layoutH="60"> <fieldset> <legend>正常按钮</legend> <dl class="nowrap"> <dt>button:</dt> <dd><div class="button"><div class="buttonContent"><button>按钮</button></div></div></dd> </dl> <dl class="nowrap"> <dt>buttonActive:</dt> <dd><div class="buttonActive"><div class="buttonContent"><button>按钮</button></div></div></dd> </dl> <dl class="nowrap"> <dt>buttonDisabled:</dt> <dd><div class="buttonDisabled"><div class="buttonContent"><button>按钮</button></div></div></dd> </dl> </fieldset> <fieldset> <legend>A链接按钮</legend> <dl class="nowrap"> <dt>button:</dt> <dd><a class="button" href="javascript:;"><span>按钮</span></a></dd> </dl> <dl class="nowrap"> <dt>buttonActive:</dt> <dd><a class="buttonActive" href="javascript:;"><span>按钮</span></a></dd> </dl> <dl class="nowrap"> <dt>buttonDisabled:</dt> <dd><a class="buttonDisabled" href="javascript:;"><span>按钮</span></a></dd> </dl> </fieldset> </div>
zyroot
trunk/admin/dwz1.4.5/w_button.html
HTML
art
1,113
<script type="text/javascript"> var options = { stacked: false, gutter:20, axis: "0 0 1 1", // Where to put the labels (trbl) axisystep: 10 // How many x interval labels to render (axisystep does the same for the y axis) }; $(function() { // Creates canvas var r = Raphael("chartHolder"); var data = [[10,20,30,50],[15,25,35,50]] // stacked: false var chart1 = r.hbarchart(40, 10, 320, 220, data, options).hover(function() { this.flag = r.popup(this.bar.x, this.bar.y, this.bar.value, "right").insertBefore(this); }, function() { this.flag.animate({opacity: 0}, 500, ">", function () {this.remove();}); }); chart1.label([["A1", "A2", "A3", "A4"],["B1", "B2", "B3", "B4"]],true); // stacked: true options.stacked=true; var chart2 = r.hbarchart(400, 10, 320, 220, data, options).hoverColumn(function() { var y = [], res = []; for (var i = this.bars.length; i--;) { y.push(this.bars[i].y); res.push(this.bars[i].value || "0"); } this.flag = r.popup(this.bars[0].x, Math.min.apply(Math, y), res.join(", "), "right").insertBefore(this); }, function() { this.flag.animate({opacity: 0}, 500, ">", function () {this.remove();}); }); chart2.label([["A1", "A2", "A3", "A4"],["B1", "B2", "B3", "B4"]],true); }); </script> <div id="chartHolder"></div>
zyroot
trunk/admin/dwz1.4.5/chart/test/hbarchart.html
HTML
art
1,468
<script type="text/javascript"> var options = { axis: "0 0 1 1", // Where to put the labels (trbl) axisxstep: 10, // How many x interval labels to render (axisystep does the same for the y axis) shade:false, // true, false smooth:true, //曲线 symbol:"circle" }; $(function () { // Make the raphael object var r = Raphael("chartHolder"); var lines = r.linechart( 20, // X start in pixels 10, // Y start in pixels 600, // Width of chart in pixels 400, // Height of chart in pixels [[.5,1.5,2,2.5,3,3.5,4,4.5,5],[.5,1.5,2,2.5,3,3.5,4,4.5,5]], // Array of x coordinates equal in length to ycoords [[7,11,9,16,3,19,12,12,15],[1,2,3,4,3,6,7,5,9]], // Array of y coordinates equal in length to xcoords options // opts object ).hoverColumn(function () { this.tags = r.set(); for (var i = 0, ii = this.y.length; i < ii; i++) { this.tags.push(r.tag(this.x, this.y[i], this.values[i], 160, 10).insertBefore(this).attr([{ fill: "#fff" }, { fill: this.symbols[i].attr("fill") }])); } }, function () { this.tags && this.tags.remove(); }); lines.symbols.attr({ r: 6 }); }); </script> <div id="chartHolder" style="width: 650px;height: 450px"></div>
zyroot
trunk/admin/dwz1.4.5/chart/test/linechart2.html
HTML
art
1,223
<script type="text/javascript"> var options = { axis: "0 0 1 1", // Where to put the labels (trbl) axisxstep: 11, // How many x interval labels to render (axisystep does the same for the y axis) axisxlables: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], axisystep: 20, shade:false, // true, false smooth:true, //曲线 symbol:"circle" }; $(function () { // Make the raphael object var r = Raphael("chartHolder"); var lines = r.linechart( 20, // X start in pixels 20, // Y start in pixels 600, // Width of chart in pixels 400, // Height of chart in pixels [0,1,2,3,4,5,6,7,8,9,10,11], // Array of x coordinates equal in length to ycoords [[584, 535, 406, 254, 171, 47, 24, 58, 104, 255, 396, 564],[100,20,300,400,300,582,70,50,90,100,110,120]], // Array of y coordinates equal in length to xcoords options // opts object ).hoverColumn(function () { this.tags = r.set(); var box_x = this.x, box_y = 30, box_w = 100, box_h = 80; if (box_x + box_w > r.width) box_x -= box_w; var box = r.rect(box_x,box_y,box_w,box_h).attr({stroke: "#f00", "stroke-width": 1, r:5}); this.tags.push(box); for (var i = 0; i < this.y.length; i++) { //this.tags.push(r.blob(this.x, this.y[i], "$"+this.values[i]).insertBefore(this).attr([{ fill: "#ffa500", stroke: "#000"}, { fill: this.symbols[i].attr("fill") }])); var t = r.text(box_x+20, box_y+10 + i*16,"$"+this.values[i]).attr({fill: this.symbols[i].attr("fill")}) this.tags.push(t); } }, function () { this.tags && this.tags.remove(); }); lines.symbols.attr({ r: 6 }); }); </script> <div id="chartHolder" style="width: 650px;height: 450px"></div>
zyroot
trunk/admin/dwz1.4.5/chart/test/linechart3.html
HTML
art
1,747
<script type="text/javascript" charset="utf-8"> /* Title settings */ title = "October Browser Statistics"; titleXpos = 390; titleYpos = 85; /* Pie Data */ pieRadius = 130; pieXpos = 150; pieYpos = 180; pieData = [1149422, 551315, 172095, 166565, 53329, 18060, 8074, 1941, 1393, 1104, 2110]; pieLegend = [ "%%.%% – Firefox", "%%.%% – Internet Explorer", "%%.%% – Chrome", "%%.%% – Safari", "%%.%% – Opera", "%%.%% – Mozilla", "%%.%% – Mozilla Compatible Agent", "%%.%% – Opera Mini", "%%.%% – SeaMonkey", "%%.%% – Camino", "%%.%% – Other"]; pieLegendPos = "east"; $(function () { var r = Raphael("chartHolder"); r.text(titleXpos, titleYpos, title).attr({"font-size": 20}); var pie = r.piechart(pieXpos, pieYpos, pieRadius, pieData, {legend: pieLegend, legendpos: pieLegendPos}); pie.hover(function () { this.sector.stop(); this.sector.scale(1.1, 1.1, this.cx, this.cy); if (this.label) { this.label[0].stop(); this.label[0].attr({ r: 7.5 }); this.label[1].attr({"font-weight": 800}); } }, function () { this.sector.animate({ transform: 's1 1 ' + this.cx + ' ' + this.cy }, 500, "bounce"); if (this.label) { this.label[0].animate({ r: 5 }, 500, "bounce"); this.label[1].attr({"font-weight": 400}); } }); }); </script> <div id="chartHolder"></div>
zyroot
trunk/admin/dwz1.4.5/chart/test/piechart.html
HTML
art
1,326
<script type="text/javascript"> var options = { stacked: false, gutter:20, axis: "0 0 1 1", // Where to put the labels (trbl) axisystep: 10 // How many x interval labels to render (axisystep does the same for the y axis) }; $(function() { // Creates canvas var r = Raphael("chartHolder"); var data = [[10,20,30,50],[15,25,35,50]] // stacked: false var chart1 = r.barchart(40, 10, 320, 220, data, options).hover(function() { this.flag = r.popup(this.bar.x, this.bar.y, this.bar.value).insertBefore(this); }, function() { this.flag.animate({opacity: 0}, 500, ">", function () {this.remove();}); }); chart1.label([["A1", "A2", "A3", "A4"],["B1", "B2", "B3", "B4"]],true); // stacked: true options.stacked=true; var chart2 = r.barchart(400, 10, 320, 220, data, options).hoverColumn(function() { var y = [], res = []; for (var i = this.bars.length; i--;) { y.push(this.bars[i].y); res.push(this.bars[i].value || "0"); } this.flag = r.popup(this.bars[0].x, Math.min.apply(Math, y), res.join(", ")).insertBefore(this); }, function() { this.flag.animate({opacity: 0}, 500, ">", function () {this.remove();}); }); chart2.label([["A"],["B"],["C"],["D"]],true); }); </script> <div id="chartHolder"></div>
zyroot
trunk/admin/dwz1.4.5/chart/test/barchart.html
HTML
art
1,424
<script type="text/javascript"> var options = { axis: "0 0 1 1", // Where to put the labels (trbl) axisxstep: 16, // How many x interval labels to render (axisystep does the same for the y axis) shade:true, // true, false smooth:false, //曲线 symbol:"circle", colors:["#F44"] }; $(function () { // Make the raphael object var r = Raphael("chartHolder"); var lines = r.linechart( 20, // X start in pixels 10, // Y start in pixels 600, // Width of chart in pixels 400, // Height of chart in pixels [.5,1.5,2,2.5,3,3.5,4,4.5,5], // Array of x coordinates equal in length to ycoords [7,11,9,16,3,19,12,12,15], // Array of y coordinates equal in length to xcoords options // opts object ); // Modify the x axis labels var xText = lines.axis[0].text.items; for(var i in xText){ // Iterate through the array of dom elems, the current dom elem will be i var _oldLabel = (xText[i].attr('text') + "").split('.'), // Get the current dom elem in the loop, and split it on the decimal _newLabel = _oldLabel[0] + ":" + (_oldLabel[1] == undefined ? '00' : '30'); // Format the result into time strings xText[i].attr({'text': _newLabel}); // Set the text of the current elem with the result }; }); </script> <div id="chartHolder" style="width: 650px;height: 450px"></div>
zyroot
trunk/admin/dwz1.4.5/chart/test/linechart.html
HTML
art
1,304
/*! * g.Raphael 0.5 - Charting library, based on Raphaël * * Copyright (c) 2009 Dmitry Baranovskiy (http://g.raphaeljs.com) * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license. */ /* * Tooltips on Element prototype */ /*\ * Element.popup [ method ] ** * Puts the context Element in a 'popup' tooltip. Can also be used on sets. ** > Parameters ** - dir (string) location of Element relative to the tail: `'down'`, `'left'`, `'up'` [default], or `'right'`. - size (number) amount of bevel/padding around the Element, as well as half the width and height of the tail [default: `5`] - x (number) x coordinate of the popup's tail [default: Element's `x` or `cx`] - y (number) y coordinate of the popup's tail [default: Element's `y` or `cy`] ** = (object) path element of the popup > Usage | paper.circle(50, 50, 5).attr({ | stroke: "#fff", | fill: "0-#c9de96-#8ab66b:44-#398235" | }).popup(); \*/ Raphael.el.popup = function (dir, size, x, y) { var paper = this.paper || this[0].paper, bb, xy, center, cw, ch; if (!paper) return; switch (this.type) { case 'text': case 'circle': case 'ellipse': center = true; break; default: center = false; } dir = dir == null ? 'up' : dir; size = size || 5; bb = this.getBBox(); x = typeof x == 'number' ? x : (center ? bb.x + bb.width / 2 : bb.x); y = typeof y == 'number' ? y : (center ? bb.y + bb.height / 2 : bb.y); cw = Math.max(bb.width / 2 - size, 0); ch = Math.max(bb.height / 2 - size, 0); this.translate(x - bb.x - (center ? bb.width / 2 : 0), y - bb.y - (center ? bb.height / 2 : 0)); bb = this.getBBox(); var paths = { up: [ 'M', x, y, 'l', -size, -size, -cw, 0, 'a', size, size, 0, 0, 1, -size, -size, 'l', 0, -bb.height, 'a', size, size, 0, 0, 1, size, -size, 'l', size * 2 + cw * 2, 0, 'a', size, size, 0, 0, 1, size, size, 'l', 0, bb.height, 'a', size, size, 0, 0, 1, -size, size, 'l', -cw, 0, 'z' ].join(','), down: [ 'M', x, y, 'l', size, size, cw, 0, 'a', size, size, 0, 0, 1, size, size, 'l', 0, bb.height, 'a', size, size, 0, 0, 1, -size, size, 'l', -(size * 2 + cw * 2), 0, 'a', size, size, 0, 0, 1, -size, -size, 'l', 0, -bb.height, 'a', size, size, 0, 0, 1, size, -size, 'l', cw, 0, 'z' ].join(','), left: [ 'M', x, y, 'l', -size, size, 0, ch, 'a', size, size, 0, 0, 1, -size, size, 'l', -bb.width, 0, 'a', size, size, 0, 0, 1, -size, -size, 'l', 0, -(size * 2 + ch * 2), 'a', size, size, 0, 0, 1, size, -size, 'l', bb.width, 0, 'a', size, size, 0, 0, 1, size, size, 'l', 0, ch, 'z' ].join(','), right: [ 'M', x, y, 'l', size, -size, 0, -ch, 'a', size, size, 0, 0, 1, size, -size, 'l', bb.width, 0, 'a', size, size, 0, 0, 1, size, size, 'l', 0, size * 2 + ch * 2, 'a', size, size, 0, 0, 1, -size, size, 'l', -bb.width, 0, 'a', size, size, 0, 0, 1, -size, -size, 'l', 0, -ch, 'z' ].join(',') }; xy = { up: { x: -!center * (bb.width / 2), y: -size * 2 - (center ? bb.height / 2 : bb.height) }, down: { x: -!center * (bb.width / 2), y: size * 2 + (center ? bb.height / 2 : bb.height) }, left: { x: -size * 2 - (center ? bb.width / 2 : bb.width), y: -!center * (bb.height / 2) }, right: { x: size * 2 + (center ? bb.width / 2 : bb.width), y: -!center * (bb.height / 2) } }[dir]; this.translate(xy.x, xy.y); return paper.path(paths[dir]).attr({ fill: "#000", stroke: "none" }).insertBefore(this.node ? this : this[0]); }; /*\ * Element.tag [ method ] ** * Puts the context Element in a 'tag' tooltip. Can also be used on sets. ** > Parameters ** - angle (number) angle of orientation in degrees [default: `0`] - r (number) radius of the loop [default: `5`] - x (number) x coordinate of the center of the tag loop [default: Element's `x` or `cx`] - y (number) y coordinate of the center of the tag loop [default: Element's `x` or `cx`] ** = (object) path element of the tag > Usage | paper.circle(50, 50, 15).attr({ | stroke: "#fff", | fill: "0-#c9de96-#8ab66b:44-#398235" | }).tag(60); \*/ Raphael.el.tag = function (angle, r, x, y) { var d = 3, paper = this.paper || this[0].paper; if (!paper) return; var p = paper.path().attr({ fill: '#000', stroke: '#000' }), bb = this.getBBox(), dx, R, center, tmp; switch (this.type) { case 'text': case 'circle': case 'ellipse': center = true; break; default: center = false; } angle = angle || 0; x = typeof x == 'number' ? x : (center ? bb.x + bb.width / 2 : bb.x); y = typeof y == 'number' ? y : (center ? bb.y + bb.height / 2 : bb.y); r = r == null ? 5 : r; R = .5522 * r; if (bb.height >= r * 2) { p.attr({ path: [ "M", x, y + r, "a", r, r, 0, 1, 1, 0, -r * 2, r, r, 0, 1, 1, 0, r * 2, "m", 0, -r * 2 -d, "a", r + d, r + d, 0, 1, 0, 0, (r + d) * 2, "L", x + r + d, y + bb.height / 2 + d, "l", bb.width + 2 * d, 0, 0, -bb.height - 2 * d, -bb.width - 2 * d, 0, "L", x, y - r - d ].join(",") }); } else { dx = Math.sqrt(Math.pow(r + d, 2) - Math.pow(bb.height / 2 + d, 2)); p.attr({ path: [ "M", x, y + r, "c", -R, 0, -r, R - r, -r, -r, 0, -R, r - R, -r, r, -r, R, 0, r, r - R, r, r, 0, R, R - r, r, -r, r, "M", x + dx, y - bb.height / 2 - d, "a", r + d, r + d, 0, 1, 0, 0, bb.height + 2 * d, "l", r + d - dx + bb.width + 2 * d, 0, 0, -bb.height - 2 * d, "L", x + dx, y - bb.height / 2 - d ].join(",") }); } angle = 360 - angle; p.rotate(angle, x, y); if (this.attrs) { //elements this.attr(this.attrs.x ? 'x' : 'cx', x + r + d + (!center ? this.type == 'text' ? bb.width : 0 : bb.width / 2)).attr('y', center ? y : y - bb.height / 2); this.rotate(angle, x, y); angle > 90 && angle < 270 && this.attr(this.attrs.x ? 'x' : 'cx', x - r - d - (!center ? bb.width : bb.width / 2)).rotate(180, x, y); } else { //sets if (angle > 90 && angle < 270) { this.translate(x - bb.x - bb.width - r - d, y - bb.y - bb.height / 2); this.rotate(angle - 180, bb.x + bb.width + r + d, bb.y + bb.height / 2); } else { this.translate(x - bb.x + r + d, y - bb.y - bb.height / 2); this.rotate(angle, bb.x - r - d, bb.y + bb.height / 2); } } return p.insertBefore(this.node ? this : this[0]); }; /*\ * Element.drop [ method ] ** * Puts the context Element in a 'drop' tooltip. Can also be used on sets. ** > Parameters ** - angle (number) angle of orientation in degrees [default: `0`] - x (number) x coordinate of the drop's point [default: Element's `x` or `cx`] - y (number) y coordinate of the drop's point [default: Element's `x` or `cx`] ** = (object) path element of the drop > Usage | paper.circle(50, 50, 8).attr({ | stroke: "#fff", | fill: "0-#c9de96-#8ab66b:44-#398235" | }).drop(60); \*/ Raphael.el.drop = function (angle, x, y) { var bb = this.getBBox(), paper = this.paper || this[0].paper, center, size, p, dx, dy; if (!paper) return; switch (this.type) { case 'text': case 'circle': case 'ellipse': center = true; break; default: center = false; } angle = angle || 0; x = typeof x == 'number' ? x : (center ? bb.x + bb.width / 2 : bb.x); y = typeof y == 'number' ? y : (center ? bb.y + bb.height / 2 : bb.y); size = Math.max(bb.width, bb.height) + Math.min(bb.width, bb.height); p = paper.path([ "M", x, y, "l", size, 0, "A", size * .4, size * .4, 0, 1, 0, x + size * .7, y - size * .7, "z" ]).attr({fill: "#000", stroke: "none"}).rotate(22.5 - angle, x, y); angle = (angle + 90) * Math.PI / 180; dx = (x + size * Math.sin(angle)) - (center ? 0 : bb.width / 2); dy = (y + size * Math.cos(angle)) - (center ? 0 : bb.height / 2); this.attrs ? this.attr(this.attrs.x ? 'x' : 'cx', dx).attr(this.attrs.y ? 'y' : 'cy', dy) : this.translate(dx - bb.x, dy - bb.y); return p.insertBefore(this.node ? this : this[0]); }; /*\ * Element.flag [ method ] ** * Puts the context Element in a 'flag' tooltip. Can also be used on sets. ** > Parameters ** - angle (number) angle of orientation in degrees [default: `0`] - x (number) x coordinate of the flag's point [default: Element's `x` or `cx`] - y (number) y coordinate of the flag's point [default: Element's `x` or `cx`] ** = (object) path element of the flag > Usage | paper.circle(50, 50, 10).attr({ | stroke: "#fff", | fill: "0-#c9de96-#8ab66b:44-#398235" | }).flag(60); \*/ Raphael.el.flag = function (angle, x, y) { var d = 3, paper = this.paper || this[0].paper; if (!paper) return; var p = paper.path().attr({ fill: '#000', stroke: '#000' }), bb = this.getBBox(), h = bb.height / 2, center; switch (this.type) { case 'text': case 'circle': case 'ellipse': center = true; break; default: center = false; } angle = angle || 0; x = typeof x == 'number' ? x : (center ? bb.x + bb.width / 2 : bb.x); y = typeof y == 'number' ? y : (center ? bb.y + bb.height / 2: bb.y); p.attr({ path: [ "M", x, y, "l", h + d, -h - d, bb.width + 2 * d, 0, 0, bb.height + 2 * d, -bb.width - 2 * d, 0, "z" ].join(",") }); angle = 360 - angle; p.rotate(angle, x, y); if (this.attrs) { //elements this.attr(this.attrs.x ? 'x' : 'cx', x + h + d + (!center ? this.type == 'text' ? bb.width : 0 : bb.width / 2)).attr('y', center ? y : y - bb.height / 2); this.rotate(angle, x, y); angle > 90 && angle < 270 && this.attr(this.attrs.x ? 'x' : 'cx', x - h - d - (!center ? bb.width : bb.width / 2)).rotate(180, x, y); } else { //sets if (angle > 90 && angle < 270) { this.translate(x - bb.x - bb.width - h - d, y - bb.y - bb.height / 2); this.rotate(angle - 180, bb.x + bb.width + h + d, bb.y + bb.height / 2); } else { this.translate(x - bb.x + h + d, y - bb.y - bb.height / 2); this.rotate(angle, bb.x - h - d, bb.y + bb.height / 2); } } return p.insertBefore(this.node ? this : this[0]); }; /*\ * Element.label [ method ] ** * Puts the context Element in a 'label' tooltip. Can also be used on sets. ** = (object) path element of the label. > Usage | paper.circle(50, 50, 10).attr({ | stroke: "#fff", | fill: "0-#c9de96-#8ab66b:44-#398235" | }).label(); \*/ Raphael.el.label = function () { var bb = this.getBBox(), paper = this.paper || this[0].paper, r = Math.min(20, bb.width + 10, bb.height + 10) / 2; if (!paper) return; return paper.rect(bb.x - r / 2, bb.y - r / 2, bb.width + r, bb.height + r, r).attr({ stroke: 'none', fill: '#000' }).insertBefore(this.node ? this : this[0]); }; /*\ * Element.blob [ method ] ** * Puts the context Element in a 'blob' tooltip. Can also be used on sets. ** > Parameters ** - angle (number) angle of orientation in degrees [default: `0`] - x (number) x coordinate of the blob's tail [default: Element's `x` or `cx`] - y (number) y coordinate of the blob's tail [default: Element's `x` or `cx`] ** = (object) path element of the blob > Usage | paper.circle(50, 50, 8).attr({ | stroke: "#fff", | fill: "0-#c9de96-#8ab66b:44-#398235" | }).blob(60); \*/ Raphael.el.blob = function (angle, x, y) { var bb = this.getBBox(), rad = Math.PI / 180, paper = this.paper || this[0].paper, p, center, size; if (!paper) return; switch (this.type) { case 'text': case 'circle': case 'ellipse': center = true; break; default: center = false; } p = paper.path().attr({ fill: "#000", stroke: "none" }); angle = (+angle + 1 ? angle : 45) + 90; size = Math.min(bb.height, bb.width); x = typeof x == 'number' ? x : (center ? bb.x + bb.width / 2 : bb.x); y = typeof y == 'number' ? y : (center ? bb.y + bb.height / 2 : bb.y); var w = Math.max(bb.width + size, size * 25 / 12), h = Math.max(bb.height + size, size * 25 / 12), x2 = x + size * Math.sin((angle - 22.5) * rad), y2 = y + size * Math.cos((angle - 22.5) * rad), x1 = x + size * Math.sin((angle + 22.5) * rad), y1 = y + size * Math.cos((angle + 22.5) * rad), dx = (x1 - x2) / 2, dy = (y1 - y2) / 2, rx = w / 2, ry = h / 2, k = -Math.sqrt(Math.abs(rx * rx * ry * ry - rx * rx * dy * dy - ry * ry * dx * dx) / (rx * rx * dy * dy + ry * ry * dx * dx)), cx = k * rx * dy / ry + (x1 + x2) / 2, cy = k * -ry * dx / rx + (y1 + y2) / 2; p.attr({ x: cx, y: cy, path: [ "M", x, y, "L", x1, y1, "A", rx, ry, 0, 1, 1, x2, y2, "z" ].join(",") }); this.translate(cx - bb.x - bb.width / 2, cy - bb.y - bb.height / 2); return p.insertBefore(this.node ? this : this[0]); }; /* * Tooltips on Paper prototype */ /*\ * Paper.label [ method ] ** * Puts the given `text` into a 'label' tooltip. The text is given a default style according to @g.txtattr. See @Element.label ** > Parameters ** - x (number) x coordinate of the center of the label - y (number) y coordinate of the center of the label - text (string) text to place inside the label ** = (object) set containing the label path and the text element > Usage | paper.label(50, 50, "$9.99"); \*/ Raphael.fn.label = function (x, y, text) { var set = this.set(); text = this.text(x, y, text).attr(Raphael.g.txtattr); return set.push(text.label(), text); }; /*\ * Paper.popup [ method ] ** * Puts the given `text` into a 'popup' tooltip. The text is given a default style according to @g.txtattr. See @Element.popup * * Note: The `dir` parameter has changed from g.Raphael 0.4.1 to 0.5. The options `0`, `1`, `2`, and `3` has been changed to `'down'`, `'left'`, `'up'`, and `'right'` respectively. ** > Parameters ** - x (number) x coordinate of the popup's tail - y (number) y coordinate of the popup's tail - text (string) text to place inside the popup - dir (string) location of the text relative to the tail: `'down'`, `'left'`, `'up'` [default], or `'right'`. - size (number) amount of padding around the Element [default: `5`] ** = (object) set containing the popup path and the text element > Usage | paper.popup(50, 50, "$9.99", 'down'); \*/ Raphael.fn.popup = function (x, y, text, dir, size) { var set = this.set(); text = this.text(x, y, text).attr(Raphael.g.txtattr); return set.push(text.popup(dir, size), text); }; /*\ * Paper.tag [ method ] ** * Puts the given text into a 'tag' tooltip. The text is given a default style according to @g.txtattr. See @Element.tag ** > Parameters ** - x (number) x coordinate of the center of the tag loop - y (number) y coordinate of the center of the tag loop - text (string) text to place inside the tag - angle (number) angle of orientation in degrees [default: `0`] - r (number) radius of the loop [default: `5`] ** = (object) set containing the tag path and the text element > Usage | paper.tag(50, 50, "$9.99", 60); \*/ Raphael.fn.tag = function (x, y, text, angle, r) { var set = this.set(); text = this.text(x, y, text).attr(Raphael.g.txtattr); return set.push(text.tag(angle, r), text); }; /*\ * Paper.flag [ method ] ** * Puts the given `text` into a 'flag' tooltip. The text is given a default style according to @g.txtattr. See @Element.flag ** > Parameters ** - x (number) x coordinate of the flag's point - y (number) y coordinate of the flag's point - text (string) text to place inside the flag - angle (number) angle of orientation in degrees [default: `0`] ** = (object) set containing the flag path and the text element > Usage | paper.flag(50, 50, "$9.99", 60); \*/ Raphael.fn.flag = function (x, y, text, angle) { var set = this.set(); text = this.text(x, y, text).attr(Raphael.g.txtattr); return set.push(text.flag(angle), text); }; /*\ * Paper.drop [ method ] ** * Puts the given text into a 'drop' tooltip. The text is given a default style according to @g.txtattr. See @Element.drop ** > Parameters ** - x (number) x coordinate of the drop's point - y (number) y coordinate of the drop's point - text (string) text to place inside the drop - angle (number) angle of orientation in degrees [default: `0`] ** = (object) set containing the drop path and the text element > Usage | paper.drop(50, 50, "$9.99", 60); \*/ Raphael.fn.drop = function (x, y, text, angle) { var set = this.set(); text = this.text(x, y, text).attr(Raphael.g.txtattr); return set.push(text.drop(angle), text); }; /*\ * Paper.blob [ method ] ** * Puts the given text into a 'blob' tooltip. The text is given a default style according to @g.txtattr. See @Element.blob ** > Parameters ** - x (number) x coordinate of the blob's tail - y (number) y coordinate of the blob's tail - text (string) text to place inside the blob - angle (number) angle of orientation in degrees [default: `0`] ** = (object) set containing the blob path and the text element > Usage | paper.blob(50, 50, "$9.99", 60); \*/ Raphael.fn.blob = function (x, y, text, angle) { var set = this.set(); text = this.text(x, y, text).attr(Raphael.g.txtattr); return set.push(text.blob(angle), text); }; /** * zhanghuihua */ Raphael.fn.axis=function (x, y, length, from, to, steps, orientation, labels, type, dashsize) { return Raphael.g.axis(x, y, length, from, to, steps, orientation, labels, type, dashsize, this) ; }; /** * Brightness functions on the Element prototype */ /*\ * Element.lighter [ method ] ** * Makes the context element lighter by increasing the brightness and reducing the saturation by a given factor. Can be called on Sets. ** > Parameters ** - times (number) adjustment factor [default: `2`] ** = (object) Element > Usage | paper.circle(50, 50, 20).attr({ | fill: "#ff0000", | stroke: "#fff", | "stroke-width": 2 | }).lighter(6); \*/ Raphael.el.lighter = function (times) { times = times || 2; var fs = [this.attrs.fill, this.attrs.stroke]; this.fs = this.fs || [fs[0], fs[1]]; fs[0] = Raphael.rgb2hsb(Raphael.getRGB(fs[0]).hex); fs[1] = Raphael.rgb2hsb(Raphael.getRGB(fs[1]).hex); fs[0].b = Math.min(fs[0].b * times, 1); fs[0].s = fs[0].s / times; fs[1].b = Math.min(fs[1].b * times, 1); fs[1].s = fs[1].s / times; this.attr({fill: "hsb(" + [fs[0].h, fs[0].s, fs[0].b] + ")", stroke: "hsb(" + [fs[1].h, fs[1].s, fs[1].b] + ")"}); return this; }; /*\ * Element.darker [ method ] ** * Makes the context element darker by decreasing the brightness and increasing the saturation by a given factor. Can be called on Sets. ** > Parameters ** - times (number) adjustment factor [default: `2`] ** = (object) Element > Usage | paper.circle(50, 50, 20).attr({ | fill: "#ff0000", | stroke: "#fff", | "stroke-width": 2 | }).darker(6); \*/ Raphael.el.darker = function (times) { times = times || 2; var fs = [this.attrs.fill, this.attrs.stroke]; this.fs = this.fs || [fs[0], fs[1]]; fs[0] = Raphael.rgb2hsb(Raphael.getRGB(fs[0]).hex); fs[1] = Raphael.rgb2hsb(Raphael.getRGB(fs[1]).hex); fs[0].s = Math.min(fs[0].s * times, 1); fs[0].b = fs[0].b / times; fs[1].s = Math.min(fs[1].s * times, 1); fs[1].b = fs[1].b / times; this.attr({fill: "hsb(" + [fs[0].h, fs[0].s, fs[0].b] + ")", stroke: "hsb(" + [fs[1].h, fs[1].s, fs[1].b] + ")"}); return this; }; /*\ * Element.resetBrightness [ method ] ** * Resets brightness and saturation levels to their original values. See @Element.lighter and @Element.darker. Can be called on Sets. ** = (object) Element > Usage | paper.circle(50, 50, 20).attr({ | fill: "#ff0000", | stroke: "#fff", | "stroke-width": 2 | }).lighter(6).resetBrightness(); \*/ Raphael.el.resetBrightness = function () { if (this.fs) { this.attr({ fill: this.fs[0], stroke: this.fs[1] }); delete this.fs; } return this; }; //alias to set prototype (function () { var brightness = ['lighter', 'darker', 'resetBrightness'], tooltips = ['popup', 'tag', 'flag', 'label', 'drop', 'blob']; for (var f in tooltips) (function (name) { Raphael.st[name] = function () { return Raphael.el[name].apply(this, arguments); }; })(tooltips[f]); for (var f in brightness) (function (name) { Raphael.st[name] = function () { for (var i = 0; i < this.length; i++) { this[i][name].apply(this[i], arguments); } return this; }; })(brightness[f]); })(); //chart prototype for storing common functions Raphael.g = { /*\ * g.shim [ object ] ** * An attribute object that charts will set on all generated shims (shims being the invisible objects that mouse events are bound to) ** > Default value | { stroke: 'none', fill: '#000', 'fill-opacity': 0 } \*/ shim: { stroke: 'none', fill: '#000', 'fill-opacity': 0 }, /*\ * g.txtattr [ object ] ** * An attribute object that charts and tooltips will set on any generated text ** > Default value | { font: '12px Arial, sans-serif', fill: '#fff' } \*/ txtattr: { font: '12px Arial, sans-serif', fill: '#fff' }, /*\ * g.colors [ array ] ** * An array of color values that charts will iterate through when drawing chart data values. ** \*/ colors: (function () { var hues = [.6, .2, .05, .1333, .75, 0], colors = []; for (var i = 0; i < 10; i++) { if (i < hues.length) { colors.push('hsb(' + hues[i] + ',.75, .75)'); } else { colors.push('hsb(' + hues[i - hues.length] + ', 1, .5)'); } } return colors; })(), snapEnds: function(from, to, steps) { var f = from, t = to; if (f == t) { return {from: f, to: t, power: 0}; } function round(a) { return Math.abs(a - .5) < .25 ? ~~(a) + .5 : Math.ceil(a); } var d = (t - f) / steps, r = ~~(d), R = r, i = 0; if (r) { while (R) { i--; R = ~~(d * Math.pow(10, i)) / Math.pow(10, i); } i ++; } else { while (!r) { i = i || 1; r = ~~(d * Math.pow(10, i)) / Math.pow(10, i); i++; } i && i--; } t = round(to * Math.pow(10, i)) / Math.pow(10, i); if (t < to) { t = round((to + .5) * Math.pow(10, i)) / Math.pow(10, i); } f = round((from - (i > 0 ? 0 : .5)) * Math.pow(10, i)) / Math.pow(10, i); return { from: f, to: t, power: i }; }, axis: function (x, y, length, from, to, steps, orientation, labels, type, dashsize, paper) { dashsize = dashsize == null ? 2 : dashsize; type = type || "t"; steps = steps || 10; paper = arguments[arguments.length-1] //paper is always last argument var path = type == "|" || type == " " ? ["M", x + .5, y, "l", 0, .001] : orientation == 1 || orientation == 3 ? ["M", x + .5, y, "l", 0, -length] : ["M", x, y + .5, "l", length, 0], ends = this.snapEnds(from, to, steps), f = ends.from, t = ends.to, i = ends.power, j = 0, txtattr = { font: "11px 'Fontin Sans', Fontin-Sans, sans-serif" }, text = paper.set(), d; d = (t - f) / steps; var label = f, rnd = i > 0 ? i : 0; dx = length / steps; if (+orientation == 1 || +orientation == 3) { var Y = y, addon = (orientation - 1 ? 1 : -1) * (dashsize + 3 + !!(orientation - 1)); while (Y >= y - length) { type != "-" && type != " " && (path = path.concat(["M", x - (type == "+" || type == "|" ? dashsize : !(orientation - 1) * dashsize * 2), Y + .5, "l", dashsize * 2 + 1, 0])); text.push(paper.text(x + addon, Y, (labels && labels[j++]) || (Math.round(label) == label ? label : +label.toFixed(rnd))).attr(txtattr).attr({ "text-anchor": orientation - 1 ? "start" : "end" })); label += d; Y -= dx; } if (Math.round(Y + dx - (y - length))) { type != "-" && type != " " && (path = path.concat(["M", x - (type == "+" || type == "|" ? dashsize : !(orientation - 1) * dashsize * 2), y - length + .5, "l", dashsize * 2 + 1, 0])); text.push(paper.text(x + addon, y - length, (labels && labels[j]) || (Math.round(label) == label ? label : +label.toFixed(rnd))).attr(txtattr).attr({ "text-anchor": orientation - 1 ? "start" : "end" })); } } else { label = f; rnd = (i > 0) * i; addon = (orientation ? -1 : 1) * (dashsize + 9 + !orientation); var X = x, dx = length / steps, txt = 0, prev = 0; while (X <= x + length) { type != "-" && type != " " && (path = path.concat(["M", X + .5, y - (type == "+" ? dashsize : !!orientation * dashsize * 2), "l", 0, dashsize * 2 + 1])); text.push(txt = paper.text(X, y + addon, (labels && labels[j++]) || (Math.round(label) == label ? label : +label.toFixed(rnd))).attr(txtattr)); var bb = txt.getBBox(); if (prev >= bb.x - 5) { text.pop(text.length - 1).remove(); } else { prev = bb.x + bb.width; } label += d; X += dx; } if (Math.round(X - dx - x - length)) { type != "-" && type != " " && (path = path.concat(["M", x + length + .5, y - (type == "+" ? dashsize : !!orientation * dashsize * 2), "l", 0, dashsize * 2 + 1])); text.push(paper.text(x + length, y + addon, (labels && labels[j]) || (Math.round(label) == label ? label : +label.toFixed(rnd))).attr(txtattr)); } } var res = paper.path(path); res.text = text; res.all = paper.set([res, text]); res.remove = function () { this.text.remove(); this.constructor.prototype.remove.call(this); }; return res; }, labelise: function(label, val, total) { if (label) { return (label + "").replace(/(##+(?:\.#+)?)|(%%+(?:\.%+)?)/g, function (all, value, percent) { if (value) { return (+val).toFixed(value.replace(/^#+\.?/g, "").length); } if (percent) { return (val * 100 / total).toFixed(percent.replace(/^%+\.?/g, "").length) + "%"; } }); } else { return (+val).toFixed(0); } } }
zyroot
trunk/admin/dwz1.4.5/chart/g.raphael.js
JavaScript
art
28,394
/*! * g.Raphael 0.5 - Charting library, based on Raphaël * * Copyright (c) 2009 Dmitry Baranovskiy (http://g.raphaeljs.com) * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license. */ (function () { var colorValue = function (value, total, s, b) { return 'hsb(' + [Math.min((1 - value / total) * .4, 1), s || .75, b || .75] + ')'; }; function Dotchart(paper, x, y, width, height, valuesx, valuesy, size, opts) { var chartinst = this; function drawAxis(ax) { +ax[0] && (ax[0] = chartinst.axis(x + gutter, y + gutter, width - 2 * gutter, minx, maxx, opts.axisxstep || Math.floor((width - 2 * gutter) / 20), 2, opts.axisxlabels || null, opts.axisxtype || "t", null, paper)); +ax[1] && (ax[1] = chartinst.axis(x + width - gutter, y + height - gutter, height - 2 * gutter, miny, maxy, opts.axisystep || Math.floor((height - 2 * gutter) / 20), 3, opts.axisylabels || null, opts.axisytype || "t", null, paper)); +ax[2] && (ax[2] = chartinst.axis(x + gutter, y + height - gutter + maxR, width - 2 * gutter, minx, maxx, opts.axisxstep || Math.floor((width - 2 * gutter) / 20), 0, opts.axisxlabels || null, opts.axisxtype || "t", null, paper)); +ax[3] && (ax[3] = chartinst.axis(x + gutter - maxR, y + height - gutter, height - 2 * gutter, miny, maxy, opts.axisystep || Math.floor((height - 2 * gutter) / 20), 1, opts.axisylabels || null, opts.axisytype || "t", null, paper)); } opts = opts || {}; var xdim = chartinst.snapEnds(Math.min.apply(Math, valuesx), Math.max.apply(Math, valuesx), valuesx.length - 1), minx = xdim.from, maxx = xdim.to, gutter = opts.gutter || 10, ydim = chartinst.snapEnds(Math.min.apply(Math, valuesy), Math.max.apply(Math, valuesy), valuesy.length - 1), miny = ydim.from, maxy = ydim.to, len = Math.max(valuesx.length, valuesy.length, size.length), symbol = paper[opts.symbol] || "circle", res = paper.set(), series = paper.set(), max = opts.max || 100, top = Math.max.apply(Math, size), R = [], k = Math.sqrt(top / Math.PI) * 2 / max; for (var i = 0; i < len; i++) { R[i] = Math.min(Math.sqrt(size[i] / Math.PI) * 2 / k, max); } gutter = Math.max.apply(Math, R.concat(gutter)); var axis = paper.set(), maxR = Math.max.apply(Math, R); if (opts.axis) { var ax = (opts.axis + "").split(/[,\s]+/); drawAxis.call(chartinst, ax); var g = [], b = []; for (var i = 0, ii = ax.length; i < ii; i++) { var bb = ax[i].all ? ax[i].all.getBBox()[["height", "width"][i % 2]] : 0; g[i] = bb + gutter; b[i] = bb; } gutter = Math.max.apply(Math, g.concat(gutter)); for (var i = 0, ii = ax.length; i < ii; i++) if (ax[i].all) { ax[i].remove(); ax[i] = 1; } drawAxis.call(chartinst, ax); for (var i = 0, ii = ax.length; i < ii; i++) if (ax[i].all) { axis.push(ax[i].all); } res.axis = axis; } var kx = (width - gutter * 2) / ((maxx - minx) || 1), ky = (height - gutter * 2) / ((maxy - miny) || 1); for (var i = 0, ii = valuesy.length; i < ii; i++) { var sym = paper.raphael.is(symbol, "array") ? symbol[i] : symbol, X = x + gutter + (valuesx[i] - minx) * kx, Y = y + height - gutter - (valuesy[i] - miny) * ky; sym && R[i] && series.push(paper[sym](X, Y, R[i]).attr({ fill: opts.heat ? colorValue(R[i], maxR) : chartinst.colors[0], "fill-opacity": opts.opacity ? R[i] / max : 1, stroke: "none" })); } var covers = paper.set(); for (var i = 0, ii = valuesy.length; i < ii; i++) { var X = x + gutter + (valuesx[i] - minx) * kx, Y = y + height - gutter - (valuesy[i] - miny) * ky; covers.push(paper.circle(X, Y, maxR).attr(chartinst.shim)); opts.href && opts.href[i] && covers[i].attr({href: opts.href[i]}); covers[i].r = +R[i].toFixed(3); covers[i].x = +X.toFixed(3); covers[i].y = +Y.toFixed(3); covers[i].X = valuesx[i]; covers[i].Y = valuesy[i]; covers[i].value = size[i] || 0; covers[i].dot = series[i]; } res.covers = covers; res.series = series; res.push(series, axis, covers); res.hover = function (fin, fout) { covers.mouseover(fin).mouseout(fout); return this; }; res.click = function (f) { covers.click(f); return this; }; res.each = function (f) { if (!paper.raphael.is(f, "function")) { return this; } for (var i = covers.length; i--;) { f.call(covers[i]); } return this; }; res.href = function (map) { var cover; for (var i = covers.length; i--;) { cover = covers[i]; if (cover.X == map.x && cover.Y == map.y && cover.value == map.value) { cover.attr({href: map.href}); } } }; return res; }; //inheritance var F = function() {}; F.prototype = Raphael.g Dotchart.prototype = new F; //public Raphael.fn.dotchart = function(x, y, width, height, valuesx, valuesy, size, opts) { return new Dotchart(this, x, y, width, height, valuesx, valuesy, size, opts); } })();
zyroot
trunk/admin/dwz1.4.5/chart/g.dot.js
JavaScript
art
5,896
/* * g.Raphael 0.5 - Charting library, based on Raphaël * * Copyright (c) 2009 Dmitry Baranovskiy (http://g.raphaeljs.com) * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license. */ (function () { function Piechart(paper, cx, cy, r, values, opts) { opts = opts || {}; var chartinst = this, sectors = [], covers = paper.set(), chart = paper.set(), series = paper.set(), order = [], len = values.length, angle = 0, total = 0, others = 0, cut = 9, defcut = true; function sector(cx, cy, r, startAngle, endAngle, fill) { var rad = Math.PI / 180, x1 = cx + r * Math.cos(-startAngle * rad), x2 = cx + r * Math.cos(-endAngle * rad), xm = cx + r / 2 * Math.cos(-(startAngle + (endAngle - startAngle) / 2) * rad), y1 = cy + r * Math.sin(-startAngle * rad), y2 = cy + r * Math.sin(-endAngle * rad), ym = cy + r / 2 * Math.sin(-(startAngle + (endAngle - startAngle) / 2) * rad), res = [ "M", cx, cy, "L", x1, y1, "A", r, r, 0, +(Math.abs(endAngle - startAngle) > 180), 1, x2, y2, "z" ]; res.middle = { x: xm, y: ym }; return res; } chart.covers = covers; if (len == 1) { series.push(paper.circle(cx, cy, r).attr({ fill: chartinst.colors[0], stroke: opts.stroke || "#fff", "stroke-width": opts.strokewidth == null ? 1 : opts.strokewidth })); covers.push(paper.circle(cx, cy, r).attr(chartinst.shim)); total = values[0]; values[0] = { value: values[0], order: 0, valueOf: function () { return this.value; } }; series[0].middle = {x: cx, y: cy}; series[0].mangle = 180; } else { for (var i = 0; i < len; i++) { total += values[i]; values[i] = { value: values[i], order: i, valueOf: function () { return this.value; } }; } values.sort(function (a, b) { return b.value - a.value; }); for (i = 0; i < len; i++) { if (defcut && values[i] * 360 / total <= 1.5) { cut = i; defcut = false; } if (i > cut) { defcut = false; values[cut].value += values[i]; values[cut].others = true; others = values[cut].value; } } len = Math.min(cut + 1, values.length); others && values.splice(len) && (values[cut].others = true); for (i = 0; i < len; i++) { var mangle = angle - 360 * values[i] / total / 2; if (!i) { angle = 90 - mangle; mangle = angle - 360 * values[i] / total / 2; } if (opts.init) { var ipath = sector(cx, cy, 1, angle, angle - 360 * values[i] / total).join(","); } var path = sector(cx, cy, r, angle, angle -= 360 * values[i] / total); var p = paper.path(opts.init ? ipath : path).attr({ fill: opts.colors && opts.colors[i] || chartinst.colors[i] || "#666", stroke: opts.stroke || "#fff", "stroke-width": (opts.strokewidth == null ? 1 : opts.strokewidth), "stroke-linejoin": "round" }); p.value = values[i]; p.middle = path.middle; p.mangle = mangle; sectors.push(p); series.push(p); opts.init && p.animate({ path: path.join(",") }, (+opts.init - 1) || 1000, ">"); } for (i = 0; i < len; i++) { p = paper.path(sectors[i].attr("path")).attr(chartinst.shim); opts.href && opts.href[i] && p.attr({ href: opts.href[i] }); p.attr = function () {}; covers.push(p); series.push(p); } } chart.hover = function (fin, fout) { fout = fout || function () {}; var that = this; for (var i = 0; i < len; i++) { (function (sector, cover, j) { var o = { sector: sector, cover: cover, cx: cx, cy: cy, mx: sector.middle.x, my: sector.middle.y, mangle: sector.mangle, r: r, value: values[j], total: total, label: that.labels && that.labels[j] }; cover.mouseover(function () { fin.call(o); }).mouseout(function () { fout.call(o); }); })(series[i], covers[i], i); } return this; }; // x: where label could be put // y: where label could be put // value: value to show // total: total number to count % chart.each = function (f) { var that = this; for (var i = 0; i < len; i++) { (function (sector, cover, j) { var o = { sector: sector, cover: cover, cx: cx, cy: cy, x: sector.middle.x, y: sector.middle.y, mangle: sector.mangle, r: r, value: values[j], total: total, label: that.labels && that.labels[j] }; f.call(o); })(series[i], covers[i], i); } return this; }; chart.click = function (f) { var that = this; for (var i = 0; i < len; i++) { (function (sector, cover, j) { var o = { sector: sector, cover: cover, cx: cx, cy: cy, mx: sector.middle.x, my: sector.middle.y, mangle: sector.mangle, r: r, value: values[j], total: total, label: that.labels && that.labels[j] }; cover.click(function () { f.call(o); }); })(series[i], covers[i], i); } return this; }; chart.inject = function (element) { element.insertBefore(covers[0]); }; var legend = function (labels, otherslabel, mark, dir) { var x = cx + r + r / 5, y = cy, h = y + 10; labels = labels || []; dir = (dir && dir.toLowerCase && dir.toLowerCase()) || "east"; mark = paper[mark && mark.toLowerCase()] || "circle"; chart.labels = paper.set(); for (var i = 0; i < len; i++) { var clr = series[i].attr("fill"), j = values[i].order, txt; values[i].others && (labels[j] = otherslabel || "Others"); labels[j] = chartinst.labelise(labels[j], values[i], total); chart.labels.push(paper.set()); chart.labels[i].push(paper[mark](x + 5, h, 5).attr({ fill: clr, stroke: "none" })); chart.labels[i].push(txt = paper.text(x + 20, h, labels[j] || values[j]).attr(chartinst.txtattr).attr({ fill: opts.legendcolor || "#000", "text-anchor": "start"})); covers[i].label = chart.labels[i]; h += txt.getBBox().height * 1.2; } var bb = chart.labels.getBBox(), tr = { east: [0, -bb.height / 2], west: [-bb.width - 2 * r - 20, -bb.height / 2], north: [-r - bb.width / 2, -r - bb.height - 10], south: [-r - bb.width / 2, r + 10] }[dir]; chart.labels.translate.apply(chart.labels, tr); chart.push(chart.labels); }; if (opts.legend) { legend(opts.legend, opts.legendothers, opts.legendmark, opts.legendpos); } chart.push(series, covers); chart.series = series; chart.covers = covers; return chart; }; //inheritance var F = function() {}; F.prototype = Raphael.g; Piechart.prototype = new F; //public Raphael.fn.piechart = function(cx, cy, r, values, opts) { return new Piechart(this, cx, cy, r, values, opts); } })();
zyroot
trunk/admin/dwz1.4.5/chart/g.pie.js
JavaScript
art
9,208
/*! * g.Raphael 0.5 - Charting library, based on Raphaël * * Copyright (c) 2009 Dmitry Baranovskiy (http://g.raphaeljs.com) * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license. */ (function () { function shrink(values, dim) { var k = values.length / dim, j = 0, l = k, sum = 0, res = []; while (j < values.length) { l--; if (l < 0) { sum += values[j] * (1 + l); res.push(sum / k); sum = values[j++] * -l; l += k; } else { sum += values[j++]; } } return res; } function getAnchors(p1x, p1y, p2x, p2y, p3x, p3y) { var l1 = (p2x - p1x) / 2, l2 = (p3x - p2x) / 2, a = Math.atan((p2x - p1x) / Math.abs(p2y - p1y)), b = Math.atan((p3x - p2x) / Math.abs(p2y - p3y)); a = p1y < p2y ? Math.PI - a : a; b = p3y < p2y ? Math.PI - b : b; var alpha = Math.PI / 2 - ((a + b) % (Math.PI * 2)) / 2, dx1 = l1 * Math.sin(alpha + a), dy1 = l1 * Math.cos(alpha + a), dx2 = l2 * Math.sin(alpha + b), dy2 = l2 * Math.cos(alpha + b); return { x1: p2x - dx1, y1: p2y + dy1, x2: p2x + dx2, y2: p2y + dy2 }; } function Linechart(paper, x, y, width, height, valuesx, valuesy, opts) { var chartinst = this; opts = opts || {}; if (!paper.raphael.is(valuesx[0], "array")) { valuesx = [valuesx]; } if (!paper.raphael.is(valuesy[0], "array")) { valuesy = [valuesy]; } var gutter = opts.gutter || 10, len = Math.max(valuesx[0].length, valuesy[0].length), symbol = opts.symbol || "", colors = opts.colors || chartinst.colors, columns = null, dots = null, chart = paper.set(), path = []; for (var i = 0, ii = valuesy.length; i < ii; i++) { len = Math.max(len, valuesy[i].length); } var shades = paper.set(); for (i = 0, ii = valuesy.length; i < ii; i++) { if (opts.shade) { shades.push(paper.path().attr({ stroke: "none", fill: colors[i], opacity: opts.nostroke ? 1 : .3 })); } if (valuesy[i].length > width - 2 * gutter) { valuesy[i] = shrink(valuesy[i], width - 2 * gutter); len = width - 2 * gutter; } if (valuesx[i] && valuesx[i].length > width - 2 * gutter) { valuesx[i] = shrink(valuesx[i], width - 2 * gutter); } } var allx = Array.prototype.concat.apply([], valuesx), ally = Array.prototype.concat.apply([], valuesy), xdim = chartinst.snapEnds(Math.min.apply(Math, allx), Math.max.apply(Math, allx), valuesx[0].length - 1), minx = xdim.from, maxx = xdim.to, ydim = chartinst.snapEnds(Math.min.apply(Math, ally), Math.max.apply(Math, ally), valuesy[0].length - 1), miny = ydim.from, maxy = ydim.to, kx = (width - gutter * 2) / ((maxx - minx) || 1), ky = (height - gutter * 2) / ((maxy - miny) || 1); var axis = paper.set(); if (opts.axis) { miny = 0; maxy = ydim.to; ky = (height - gutter * 2) / ((maxy - miny) || 1); var ax = (opts.axis + "").split(/[,\s]+/); +ax[0] && axis.push(chartinst.axis(x + gutter, y + gutter, width - 2 * gutter, minx, maxx, opts.axisxstep || Math.floor((width - 2 * gutter) / 20), 2, opts.axisxlables, paper)); +ax[1] && axis.push(chartinst.axis(x + width - gutter, y + height - gutter, height - 2 * gutter, ydim.from, ydim.to, opts.axisystep || Math.floor((height - 2 * gutter) / 20), 3, paper)); +ax[2] && axis.push(chartinst.axis(x + gutter, y + height - gutter, width - 2 * gutter, minx, maxx, opts.axisxstep || Math.floor((width - 2 * gutter) / 20), 0, opts.axisxlables, paper)); //+ax[3] && axis.push(chartinst.axis(x + gutter, y + height - gutter, height - 2 * gutter, ydim.from, ydim.to, opts.axisystep || Math.floor((height - 2 * gutter) / 20), 1, paper)); +ax[3] && axis.push(chartinst.axis(x + gutter, y + height - gutter, height - 2 * gutter, miny, maxy, opts.axisystep || Math.floor((height - 2 * gutter) / 20), 1, paper)); } var lines = paper.set(), symbols = paper.set(), line; for (i = 0, ii = valuesy.length; i < ii; i++) { if (!opts.nostroke) { lines.push(line = paper.path().attr({ stroke: colors[i], "stroke-width": opts.width || 2, "stroke-linejoin": "round", "stroke-linecap": "round", "stroke-dasharray": opts.dash || "" })); } var sym = Raphael.is(symbol, "array") ? symbol[i] : symbol, symset = paper.set(); path = []; for (var j = 0, jj = valuesy[i].length; j < jj; j++) { var X = x + gutter + ((valuesx[i] || valuesx[0])[j] - minx) * kx, Y = y + height - gutter - (valuesy[i][j] - miny) * ky; (Raphael.is(sym, "array") ? sym[j] : sym) && symset.push(paper[Raphael.is(sym, "array") ? sym[j] : sym](X, Y, (opts.width || 2) * 3).attr({ fill: colors[i], stroke: "none" })); if (opts.smooth) { if (j && j != jj - 1) { var X0 = x + gutter + ((valuesx[i] || valuesx[0])[j - 1] - minx) * kx, Y0 = y + height - gutter - (valuesy[i][j - 1] - miny) * ky, X2 = x + gutter + ((valuesx[i] || valuesx[0])[j + 1] - minx) * kx, Y2 = y + height - gutter - (valuesy[i][j + 1] - miny) * ky, a = getAnchors(X0, Y0, X, Y, X2, Y2); path = path.concat([a.x1, a.y1, X, Y, a.x2, a.y2]); } if (!j) { path = ["M", X, Y, "C", X, Y]; } } else { path = path.concat([j ? "L" : "M", X, Y]); } } if (opts.smooth) { path = path.concat([X, Y, X, Y]); } symbols.push(symset); if (opts.shade) { shades[i].attr({ path: path.concat(["L", X, y + height - gutter, "L", x + gutter + ((valuesx[i] || valuesx[0])[0] - minx) * kx, y + height - gutter, "z"]).join(",") }); } !opts.nostroke && line.attr({ path: path.join(",") }); } function createColumns(f) { // unite Xs together var Xs = []; for (var i = 0, ii = valuesx.length; i < ii; i++) { Xs = Xs.concat(valuesx[i]); } Xs.sort(function(a,b){return a-b;}); // remove duplicates var Xs2 = [], xs = []; for (i = 0, ii = Xs.length; i < ii; i++) { Xs[i] != Xs[i - 1] && Xs2.push(Xs[i]) && xs.push(x + gutter + (Xs[i] - minx) * kx); } Xs = Xs2; ii = Xs.length; var cvrs = f || paper.set(); for (i = 0; i < ii; i++) { var X = xs[i] - (xs[i] - (xs[i - 1] || x)) / 2, w = ((xs[i + 1] || x + width) - xs[i]) / 2 + (xs[i] - (xs[i - 1] || x)) / 2, C; f ? (C = {}) : cvrs.push(C = paper.rect(X - 1, y, Math.max(w + 1, 1), height).attr({ stroke: "none", fill: "#000", opacity: 0 })); C.values = []; C.symbols = paper.set(); C.y = []; C.x = xs[i]; C.axis = Xs[i]; for (var j = 0, jj = valuesy.length; j < jj; j++) { Xs2 = valuesx[j] || valuesx[0]; for (var k = 0, kk = Xs2.length; k < kk; k++) { if (Xs2[k] == Xs[i]) { C.values.push(valuesy[j][k]); C.y.push(y + height - gutter - (valuesy[j][k] - miny) * ky); C.symbols.push(chart.symbols[j][k]); } } } f && f.call(C); } !f && (columns = cvrs); } function createDots(f) { var cvrs = f || paper.set(), C; for (var i = 0, ii = valuesy.length; i < ii; i++) { for (var j = 0, jj = valuesy[i].length; j < jj; j++) { var X = x + gutter + ((valuesx[i] || valuesx[0])[j] - minx) * kx, nearX = x + gutter + ((valuesx[i] || valuesx[0])[j ? j - 1 : 1] - minx) * kx, Y = y + height - gutter - (valuesy[i][j] - miny) * ky; f ? (C = {}) : cvrs.push(C = paper.circle(X, Y, Math.abs(nearX - X) / 2).attr({ stroke: "none", fill: "#000", opacity: 0 })); C.x = X; C.y = Y; C.value = valuesy[i][j]; C.line = chart.lines[i]; C.shade = chart.shades[i]; C.symbol = chart.symbols[i][j]; C.symbols = chart.symbols[i]; C.axis = (valuesx[i] || valuesx[0])[j]; f && f.call(C); } } !f && (dots = cvrs); } chart.push(lines, shades, symbols, axis, columns, dots); chart.lines = lines; chart.shades = shades; chart.symbols = symbols; chart.axis = axis; chart.hoverColumn = function (fin, fout) { !columns && createColumns(); columns.mouseover(fin).mouseout(fout); return this; }; chart.clickColumn = function (f) { !columns && createColumns(); columns.click(f); return this; }; chart.hrefColumn = function (cols) { var hrefs = paper.raphael.is(arguments[0], "array") ? arguments[0] : arguments; if (!(arguments.length - 1) && typeof cols == "object") { for (var x in cols) { for (var i = 0, ii = columns.length; i < ii; i++) if (columns[i].axis == x) { columns[i].attr("href", cols[x]); } } } !columns && createColumns(); for (i = 0, ii = hrefs.length; i < ii; i++) { columns[i] && columns[i].attr("href", hrefs[i]); } return this; }; chart.hover = function (fin, fout) { !dots && createDots(); dots.mouseover(fin).mouseout(fout); return this; }; chart.click = function (f) { !dots && createDots(); dots.click(f); return this; }; chart.each = function (f) { createDots(f); return this; }; chart.eachColumn = function (f) { createColumns(f); return this; }; return chart; }; //inheritance var F = function() {}; F.prototype = Raphael.g; Linechart.prototype = new F; //public Raphael.fn.linechart = function(x, y, width, height, valuesx, valuesy, opts) { return new Linechart(this, x, y, width, height, valuesx, valuesy, opts); } })();
zyroot
trunk/admin/dwz1.4.5/chart/g.line.js
JavaScript
art
11,901
/*! * g.Raphael 0.5 - Charting library, based on Raphaël * * Copyright (c) 2009 Dmitry Baranovskiy (http://g.raphaeljs.com) * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license. */ (function () { var mmin = Math.min, mmax = Math.max; function finger(x, y, width, height, dir, ending, isPath, paper) { var path, ends = { round: 'round', sharp: 'sharp', soft: 'soft', square: 'square' }; // dir 0 for horizontal and 1 for vertical if ((dir && !height) || (!dir && !width)) { return isPath ? "" : paper.path(); } ending = ends[ending] || "square"; height = Math.round(height); width = Math.round(width); x = Math.round(x); y = Math.round(y); switch (ending) { case "round": if (!dir) { var r = ~~(height / 2); if (width < r) { r = width; path = [ "M", x + .5, y + .5 - ~~(height / 2), "l", 0, 0, "a", r, ~~(height / 2), 0, 0, 1, 0, height, "l", 0, 0, "z" ]; } else { path = [ "M", x + .5, y + .5 - r, "l", width - r, 0, "a", r, r, 0, 1, 1, 0, height, "l", r - width, 0, "z" ]; } } else { r = ~~(width / 2); if (height < r) { r = height; path = [ "M", x - ~~(width / 2), y, "l", 0, 0, "a", ~~(width / 2), r, 0, 0, 1, width, 0, "l", 0, 0, "z" ]; } else { path = [ "M", x - r, y, "l", 0, r - height, "a", r, r, 0, 1, 1, width, 0, "l", 0, height - r, "z" ]; } } break; case "sharp": if (!dir) { var half = ~~(height / 2); path = [ "M", x, y + half, "l", 0, -height, mmax(width - half, 0), 0, mmin(half, width), half, -mmin(half, width), half + (half * 2 < height), "z" ]; } else { half = ~~(width / 2); path = [ "M", x + half, y, "l", -width, 0, 0, -mmax(height - half, 0), half, -mmin(half, height), half, mmin(half, height), half, "z" ]; } break; case "square": if (!dir) { path = [ "M", x, y + ~~(height / 2), "l", 0, -height, width, 0, 0, height, "z" ]; } else { path = [ "M", x + ~~(width / 2), y, "l", 1 - width, 0, 0, -height, width - 1, 0, "z" ]; } break; case "soft": if (!dir) { r = mmin(width, Math.round(height / 5)); path = [ "M", x + .5, y + .5 - ~~(height / 2), "l", width - r, 0, "a", r, r, 0, 0, 1, r, r, "l", 0, height - r * 2, "a", r, r, 0, 0, 1, -r, r, "l", r - width, 0, "z" ]; } else { r = mmin(Math.round(width / 5), height); path = [ "M", x - ~~(width / 2), y, "l", 0, r - height, "a", r, r, 0, 0, 1, r, -r, "l", width - 2 * r, 0, "a", r, r, 0, 0, 1, r, r, "l", 0, height - r, "z" ]; } } if (isPath) { return path.join(","); } else { return paper.path(path); } } /* * Vertical Barchart */ function VBarchart(paper, x, y, width, height, values, opts) { opts = opts || {}; var chartinst = this, type = opts.type || "square", gutter = parseFloat(opts.gutter || "20%"), chart = paper.set(), bars = paper.set(), covers = paper.set(), covers2 = paper.set(), total = Math.max.apply(Math, values), stacktotal = [], multi = 0, colors = opts.colors || chartinst.colors, len = values.length; if (Raphael.is(values[0], "array")) { total = []; multi = len; len = 0; for (var i = values.length; i--;) { bars.push(paper.set()); total.push(Math.max.apply(Math, values[i])); len = Math.max(len, values[i].length); } if (opts.stacked) { for (var i = len; i--;) { var tot = 0; for (var j = values.length; j--;) { tot +=+ values[j][i] || 0; } stacktotal.push(tot); } } for (var i = values.length; i--;) { if (values[i].length < len) { for (var j = len; j--;) { values[i].push(0); } } } total = Math.max.apply(Math, opts.stacked ? stacktotal : total); } total = (opts.to) || total; var barwidth = width / (len * (100 + gutter) + gutter) * 100, barhgutter = barwidth * gutter / 100, barvgutter = opts.vgutter == null ? 20 : opts.vgutter, stack = [], X = x + barhgutter, Y = (height - 2 * barvgutter) / total; if (!opts.stretch) { barhgutter = Math.round(barhgutter); barwidth = Math.floor(barwidth); } !opts.stacked && (barwidth /= multi || 1); for (var i = 0; i < len; i++) { stack = []; for (var j = 0; j < (multi || 1); j++) { var h = Math.round((multi ? values[j][i] : values[i]) * Y), top = y + height - barvgutter - h, bar = finger(Math.round(X + barwidth / 2), top + h, barwidth, h, true, type, null, paper).attr({ stroke: "none", fill: colors[multi ? j : i] }); if (multi) { bars[j].push(bar); } else { bars.push(bar); } bar.y = top; bar.x = Math.round(X + barwidth / 2); bar.w = barwidth; bar.h = h; bar.value = multi ? values[j][i] : values[i]; if (!opts.stacked) { X += barwidth; } else { stack.push(bar); } } if (opts.stacked) { var cvr; covers2.push(cvr = paper.rect(stack[0].x - stack[0].w / 2, y, barwidth, height).attr(chartinst.shim)); cvr.bars = paper.set(); var size = 0; for (var s = stack.length; s--;) { stack[s].toFront(); } for (var s = 0, ss = stack.length; s < ss; s++) { var bar = stack[s], cover, h = (size + bar.value) * Y, path = finger(bar.x, y + height - barvgutter - !!size * .5, barwidth, h, true, type, 1, paper); cvr.bars.push(bar); size && bar.attr({path: path}); bar.h = h; bar.y = y + height - barvgutter - !!size * .5 - h; covers.push(cover = paper.rect(bar.x - bar.w / 2, bar.y, barwidth, bar.value * Y).attr(chartinst.shim)); cover.bar = bar; cover.value = bar.value; size += bar.value; } X += barwidth; } X += barhgutter; } covers2.toFront(); X = x + barhgutter; if (!opts.stacked) { for (var i = 0; i < len; i++) { for (var j = 0; j < (multi || 1); j++) { var cover; covers.push(cover = paper.rect(Math.round(X), y + barvgutter, barwidth, height - barvgutter).attr(chartinst.shim)); cover.bar = multi ? bars[j][i] : bars[i]; cover.value = cover.bar.value; X += barwidth; } X += barhgutter; } } var xdim = chartinst.snapEnds(0, len, 1), minx = xdim.from, maxx = xdim.to, ydim = chartinst.snapEnds(0, total, 1), miny = ydim.from, maxy = ydim.to; var axis = paper.set(); if (opts.axis) { var ax = (opts.axis + "").split(/[,\s]+/); // +ax[0] && axis.push(chartinst.axis(x, y + gutter, width, minx, maxx, opts.axisxstep || Math.floor((width) / 20), 2, paper)); +ax[0] && axis.push(paper.path(["M", x, y + gutter + 0.5,"h", width])); +ax[1] && axis.push(chartinst.axis(x + width, y + height - gutter, height - 2 * gutter, miny, maxy, opts.axisystep || Math.floor((height - gutter) / 20), 3, paper)); // +ax[2] && axis.push(chartinst.axis(x, y + height - gutter, width, minx, maxx, opts.axisxstep || Math.floor((width) / 20), 0, paper)); +ax[2] && axis.push(paper.path(["M", x, y + height - gutter + 0.5,"h", width])); +ax[3] && axis.push(chartinst.axis(x, y + height - gutter, height - 2 * gutter, miny, maxy, opts.axisystep || Math.floor((height - gutter) / 20), 1, paper)); } chart.label = function (labels, isBottom) { labels = labels || []; this.labels = paper.set(); var L, l = -Infinity; if (opts.stacked) { for (var i = 0; i < len; i++) { var tot = 0; for (var j = 0; j < (multi || 1); j++) { tot += multi ? values[j][i] : values[i]; var bar = multi ? bars[j][i] : bars[i]; if (j == multi - 1) { var label = chartinst.labelise(labels[i], tot, total); L = paper.text(bar.x, y + height - barvgutter / 2, label).insertBefore(covers[i * (multi || 1) + j]); var bb = L.getBBox(); if (bb.x - 7 < l) { L.remove(); } else { this.labels.push(L); l = bb.x + bb.width; } } } } } else { for (var i = 0; i < len; i++) { for (var j = 0; j < (multi || 1); j++) { var label = chartinst.labelise(multi ? labels[j] && labels[j][i] : labels[i], multi ? values[j][i] : values[i], total); var bar = multi ? bars[j][i] : bars[i]; L = paper.text(bar.x, isBottom ? y + height - barvgutter / 2 : bar.y - 10, label).insertBefore(covers[i * (multi || 1) + j]); var bb = L.getBBox(); if (bb.x - 7 < l) { L.remove(); } else { this.labels.push(L); l = bb.x + bb.width; } } } } return this; }; chart.hover = function (fin, fout) { covers2.hide(); covers.show(); covers.mouseover(fin).mouseout(fout); return this; }; chart.hoverColumn = function (fin, fout) { covers.hide(); covers2.show(); fout = fout || function () {}; covers2.mouseover(fin).mouseout(fout); return this; }; chart.click = function (f) { covers2.hide(); covers.show(); covers.click(f); return this; }; chart.each = function (f) { if (!Raphael.is(f, "function")) { return this; } for (var i = covers.length; i--;) { f.call(covers[i]); } return this; }; chart.eachColumn = function (f) { if (!Raphael.is(f, "function")) { return this; } for (var i = covers2.length; i--;) { f.call(covers2[i]); } return this; }; chart.clickColumn = function (f) { covers.hide(); covers2.show(); covers2.click(f); return this; }; chart.push(bars, covers, covers2); chart.bars = bars; chart.covers = covers; chart.axis = axis; return chart; }; /** * Horizontal Barchart */ function HBarchart(paper, x, y, width, height, values, opts) { opts = opts || {}; var chartinst = this, type = opts.type || "square", gutter = parseFloat(opts.gutter || "20%"), chart = paper.set(), bars = paper.set(), covers = paper.set(), covers2 = paper.set(), total = Math.max.apply(Math, values), stacktotal = [], multi = 0, colors = opts.colors || chartinst.colors, len = values.length; if (Raphael.is(values[0], "array")) { total = []; multi = len; len = 0; for (var i = values.length; i--;) { bars.push(paper.set()); total.push(Math.max.apply(Math, values[i])); len = Math.max(len, values[i].length); } if (opts.stacked) { for (var i = len; i--;) { var tot = 0; for (var j = values.length; j--;) { tot +=+ values[j][i] || 0; } stacktotal.push(tot); } } for (var i = values.length; i--;) { if (values[i].length < len) { for (var j = len; j--;) { values[i].push(0); } } } total = Math.max.apply(Math, opts.stacked ? stacktotal : total); } total = (opts.to) || total; var barheight = Math.floor(height / (len * (100 + gutter) + gutter) * 100), bargutter = Math.floor(barheight * gutter / 100), stack = [], Y = y + bargutter, X = (width - 1) / total; !opts.stacked && (barheight /= multi || 1); for (var i = 0; i < len; i++) { stack = []; for (var j = 0; j < (multi || 1); j++) { var val = multi ? values[j][i] : values[i], bar = finger(x, Y + barheight / 2, Math.round(val * X), barheight - 1, false, type, null, paper).attr({stroke: "none", fill: colors[multi ? j : i]}); if (multi) { bars[j].push(bar); } else { bars.push(bar); } bar.x = x + Math.round(val * X); bar.y = Y + barheight / 2; bar.w = Math.round(val * X); bar.h = barheight; bar.value = +val; if (!opts.stacked) { Y += barheight; } else { stack.push(bar); } } if (opts.stacked) { var cvr = paper.rect(x, stack[0].y - stack[0].h / 2, width, barheight).attr(chartinst.shim); covers2.push(cvr); cvr.bars = paper.set(); var size = 0; for (var s = stack.length; s--;) { stack[s].toFront(); } for (var s = 0, ss = stack.length; s < ss; s++) { var bar = stack[s], cover, val = Math.round((size + bar.value) * X), path = finger(x, bar.y, val, barheight - 1, false, type, 1, paper); cvr.bars.push(bar); size && bar.attr({ path: path }); bar.w = val; bar.x = x + val; covers.push(cover = paper.rect(x + size * X, bar.y - bar.h / 2, bar.value * X, barheight).attr(chartinst.shim)); cover.bar = bar; size += bar.value; } Y += barheight; } Y += bargutter; } covers2.toFront(); Y = y + bargutter; if (!opts.stacked) { for (var i = 0; i < len; i++) { for (var j = 0; j < (multi || 1); j++) { var cover = paper.rect(x, Y, width, barheight).attr(chartinst.shim); covers.push(cover); cover.bar = multi ? bars[j][i] : bars[i]; cover.value = cover.bar.value; Y += barheight; } Y += bargutter; } } var xdim = chartinst.snapEnds(0, total, 1), minx = xdim.from, maxx = xdim.to, ydim = chartinst.snapEnds(0, len, 1), miny = ydim.from, maxy = ydim.to; var axis = paper.set(); if (opts.axis) { var ax = (opts.axis + "").split(/[,\s]+/); +ax[0] && axis.push(chartinst.axis(x, y, width, minx, maxx, opts.axisxstep || Math.floor((width) / 20), 2, paper)); //+ax[1] && axis.push(chartinst.axis(x + width, y + height, height, miny, maxy, opts.axisystep || Math.floor((height - gutter) / 20), 3, paper)); +ax[1] && axis.push(paper.path(["M", x+width+ 0.5, y,"v", height])); +ax[2] && axis.push(chartinst.axis(x, y + height, width, minx, maxx, opts.axisxstep || Math.floor((width) / 20), 0, paper)); //+ax[3] && axis.push(chartinst.axis(x, y + height, height, miny, maxy, opts.axisystep || Math.floor((height - gutter) / 20), 1, paper)); +ax[3] && axis.push(paper.path(["M", x+ 0.5, y,"v", height])); } chart.label = function (labels, isRight) { labels = labels || []; this.labels = paper.set(); for (var i = 0; i < len; i++) { for (var j = 0; j < multi; j++) { var bar = multi ? bars[j][i] : bars[i]; var label = chartinst.labelise(multi ? labels[j] && labels[j][i] : labels[i], multi ? values[j][i] : values[i], total), X = isRight ? bar.x - barheight / 2 + 3 : x + 5, A = isRight ? "end" : "start", L; this.labels.push(L = paper.text(X, bar.y, label).attr({ "text-anchor": A }).insertBefore(covers[i * (multi || 1) + j])); if (L.getBBox().x < x + 5) { L.attr({x: x + 5, "text-anchor": "start"}); } else { bar.label = L; } } } return this; }; chart.hover = function (fin, fout) { covers2.hide(); covers.show(); fout = fout || function () {}; covers.mouseover(fin).mouseout(fout); return this; }; chart.hoverColumn = function (fin, fout) { covers.hide(); covers2.show(); fout = fout || function () {}; covers2.mouseover(fin).mouseout(fout); return this; }; chart.each = function (f) { if (!Raphael.is(f, "function")) { return this; } for (var i = covers.length; i--;) { f.call(covers[i]); } return this; }; chart.eachColumn = function (f) { if (!Raphael.is(f, "function")) { return this; } for (var i = covers2.length; i--;) { f.call(covers2[i]); } return this; }; chart.click = function (f) { covers2.hide(); covers.show(); covers.click(f); return this; }; chart.clickColumn = function (f) { covers.hide(); covers2.show(); covers2.click(f); return this; }; chart.push(bars, covers, covers2); chart.bars = bars; chart.covers = covers; return chart; }; //inheritance var F = function() {}; F.prototype = Raphael.g; HBarchart.prototype = VBarchart.prototype = new F; Raphael.fn.hbarchart = function(x, y, width, height, values, opts) { return new HBarchart(this, x, y, width, height, values, opts); }; Raphael.fn.barchart = function(x, y, width, height, values, opts) { return new VBarchart(this, x, y, width, height, values, opts); }; })();
zyroot
trunk/admin/dwz1.4.5/chart/g.bar.js
JavaScript
art
16,268
// ┌─────────────────────────────────────────────────────────────────────┐ \\ // │ Raphaël 2.0.1 - JavaScript Vector Library │ \\ // ├─────────────────────────────────────────────────────────────────────┤ \\ // │ Copyright (c) 2008-2011 Dmitry Baranovskiy (http://raphaeljs.com) │ \\ // │ Copyright (c) 2008-2011 Sencha Labs (http://sencha.com) │ \\ // │ Licensed under the MIT (http://raphaeljs.com/license.html) license. │ \\ // └─────────────────────────────────────────────────────────────────────┘ \\ // ┌──────────────────────────────────────────────────────────────────────────────────────┐ \\ // │ Eve 0.4.0 - JavaScript Events Library │ \\ // ├──────────────────────────────────────────────────────────────────────────────────────┤ \\ // │ Copyright (c) 2008-2011 Dmitry Baranovskiy (http://dmitry.baranovskiy.com/) │ \\ // │ Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license. │ \\ // └──────────────────────────────────────────────────────────────────────────────────────┘ \\ (function (glob) { var version = "0.4.0", has = "hasOwnProperty", separator = /[\.\/]/, wildcard = "*", fun = function () {}, numsort = function (a, b) { return a - b; }, current_event, stop, events = {n: {}}, eve = function (name, scope) { var e = events, oldstop = stop, args = Array.prototype.slice.call(arguments, 2), listeners = eve.listeners(name), z = 0, f = false, l, indexed = [], queue = {}, out = [], errors = []; current_event = name; stop = 0; for (var i = 0, ii = listeners.length; i < ii; i++) if ("zIndex" in listeners[i]) { indexed.push(listeners[i].zIndex); if (listeners[i].zIndex < 0) { queue[listeners[i].zIndex] = listeners[i]; } } indexed.sort(numsort); while (indexed[z] < 0) { l = queue[indexed[z++]]; out.push(l.apply(scope, args)); if (stop) { stop = oldstop; return out; } } for (i = 0; i < ii; i++) { l = listeners[i]; if ("zIndex" in l) { if (l.zIndex == indexed[z]) { out.push(l.apply(scope, args)); if (stop) { stop = oldstop; return out; } do { z++; l = queue[indexed[z]]; l && out.push(l.apply(scope, args)); if (stop) { stop = oldstop; return out; } } while (l) } else { queue[l.zIndex] = l; } } else { out.push(l.apply(scope, args)); if (stop) { stop = oldstop; return out; } } } stop = oldstop; return out.length ? out : null; }; eve.listeners = function (name) { var names = name.split(separator), e = events, item, items, k, i, ii, j, jj, nes, es = [e], out = []; for (i = 0, ii = names.length; i < ii; i++) { nes = []; for (j = 0, jj = es.length; j < jj; j++) { e = es[j].n; items = [e[names[i]], e[wildcard]]; k = 2; while (k--) { item = items[k]; if (item) { nes.push(item); out = out.concat(item.f || []); } } } es = nes; } return out; }; eve.on = function (name, f) { var names = name.split(separator), e = events; for (var i = 0, ii = names.length; i < ii; i++) { e = e.n; !e[names[i]] && (e[names[i]] = {n: {}}); e = e[names[i]]; } e.f = e.f || []; for (i = 0, ii = e.f.length; i < ii; i++) if (e.f[i] == f) { return fun; } e.f.push(f); return function (zIndex) { if (+zIndex == +zIndex) { f.zIndex = +zIndex; } }; }; eve.stop = function () { stop = 1; }; eve.nt = function (subname) { if (subname) { return new RegExp("(?:\\.|\\/|^)" + subname + "(?:\\.|\\/|$)").test(current_event); } return current_event; }; eve.unbind = function (name, f) { var names = name.split(separator), e, key, splice, i, ii, j, jj, cur = [events]; for (i = 0, ii = names.length; i < ii; i++) { for (j = 0; j < cur.length; j += splice.length - 2) { splice = [j, 1]; e = cur[j].n; if (names[i] != wildcard) { if (e[names[i]]) { splice.push(e[names[i]]); } } else { for (key in e) if (e[has](key)) { splice.push(e[key]); } } cur.splice.apply(cur, splice); } } for (i = 0, ii = cur.length; i < ii; i++) { e = cur[i]; while (e.n) { if (f) { if (e.f) { for (j = 0, jj = e.f.length; j < jj; j++) if (e.f[j] == f) { e.f.splice(j, 1); break; } !e.f.length && delete e.f; } for (key in e.n) if (e.n[has](key) && e.n[key].f) { var funcs = e.n[key].f; for (j = 0, jj = funcs.length; j < jj; j++) if (funcs[j] == f) { funcs.splice(j, 1); break; } !funcs.length && delete e.n[key].f; } } else { delete e.f; for (key in e.n) if (e.n[has](key) && e.n[key].f) { delete e.n[key].f; } } e = e.n; } } }; eve.once = function (name, f) { var f2 = function () { f.apply(this, arguments); eve.unbind(name, f2); }; return eve.on(name, f2); }; eve.version = version; eve.toString = function () { return "You are running Eve " + version; }; (typeof module != "undefined" && module.exports) ? (module.exports = eve) : (glob.eve = eve); })(this); // ┌─────────────────────────────────────────────────────────────────────┐ \\ // │ "Raphaël 2.0.1" - JavaScript Vector Library │ \\ // ├─────────────────────────────────────────────────────────────────────┤ \\ // │ Copyright (c) 2008-2011 Dmitry Baranovskiy (http://raphaeljs.com) │ \\ // │ Copyright (c) 2008-2011 Sencha Labs (http://sencha.com) │ \\ // │ Licensed under the MIT (http://raphaeljs.com/license.html) license. │ \\ // └─────────────────────────────────────────────────────────────────────┘ \\ (function () { function R(first) { if (R.is(first, "function")) { return loaded ? first() : eve.on("DOMload", first); } else if (R.is(first, array)) { return R._engine.create[apply](R, first.splice(0, 3 + R.is(first[0], nu))).add(first); } else { var args = Array.prototype.slice.call(arguments, 0); if (R.is(args[args.length - 1], "function")) { var f = args.pop(); return loaded ? f.call(R._engine.create[apply](R, args)) : eve.on("DOMload", function () { f.call(R._engine.create[apply](R, args)); }); } else { return R._engine.create[apply](R, arguments); } } } R.version = "2.0.1"; R.eve = eve; var loaded, separator = /[, ]+/, elements = {circle: 1, rect: 1, path: 1, ellipse: 1, text: 1, image: 1}, formatrg = /\{(\d+)\}/g, proto = "prototype", has = "hasOwnProperty", g = { doc: document, win: window }, oldRaphael = { was: Object.prototype[has].call(g.win, "Raphael"), is: g.win.Raphael }, Paper = function () { this.ca = this.customAttributes = {}; }, paperproto, appendChild = "appendChild", apply = "apply", concat = "concat", supportsTouch = "createTouch" in g.doc, E = "", S = " ", Str = String, split = "split", events = "click dblclick mousedown mousemove mouseout mouseover mouseup touchstart touchmove touchend touchcancel"[split](S), touchMap = { mousedown: "touchstart", mousemove: "touchmove", mouseup: "touchend" }, lowerCase = Str.prototype.toLowerCase, math = Math, mmax = math.max, mmin = math.min, abs = math.abs, pow = math.pow, PI = math.PI, nu = "number", string = "string", array = "array", toString = "toString", fillString = "fill", objectToString = Object.prototype.toString, paper = {}, push = "push", ISURL = R._ISURL = /^url\(['"]?([^\)]+?)['"]?\)$/i, colourRegExp = /^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i, isnan = {"NaN": 1, "Infinity": 1, "-Infinity": 1}, bezierrg = /^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/, round = math.round, setAttribute = "setAttribute", toFloat = parseFloat, toInt = parseInt, upperCase = Str.prototype.toUpperCase, availableAttrs = R._availableAttrs = { "arrow-end": "none", "arrow-start": "none", blur: 0, "clip-rect": "0 0 1e9 1e9", cursor: "default", cx: 0, cy: 0, fill: "#fff", "fill-opacity": 1, font: '10px "Arial"', "font-family": '"Arial"', "font-size": "10", "font-style": "normal", "font-weight": 400, gradient: 0, height: 0, href: "http://raphaeljs.com/", "letter-spacing": 0, opacity: 1, path: "M0,0", r: 0, rx: 0, ry: 0, src: "", stroke: "#000", "stroke-dasharray": "", "stroke-linecap": "butt", "stroke-linejoin": "butt", "stroke-miterlimit": 0, "stroke-opacity": 1, "stroke-width": 1, target: "_blank", "text-anchor": "middle", title: "Raphael", transform: "", width: 0, x: 0, y: 0 }, availableAnimAttrs = R._availableAnimAttrs = { blur: nu, "clip-rect": "csv", cx: nu, cy: nu, fill: "colour", "fill-opacity": nu, "font-size": nu, height: nu, opacity: nu, path: "path", r: nu, rx: nu, ry: nu, stroke: "colour", "stroke-opacity": nu, "stroke-width": nu, transform: "transform", width: nu, x: nu, y: nu }, commaSpaces = /\s*,\s*/, hsrg = {hs: 1, rg: 1}, p2s = /,?([achlmqrstvxz]),?/gi, pathCommand = /([achlmrqstvz])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?\s*,?\s*)+)/ig, tCommand = /([rstm])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?\s*,?\s*)+)/ig, pathValues = /(-?\d*\.?\d*(?:e[\-+]?\d+)?)\s*,?\s*/ig, radial_gradient = R._radial_gradient = /^r(?:\(([^,]+?)\s*,\s*([^\)]+?)\))?/, eldata = {}, sortByKey = function (a, b) { return a.key - b.key; }, sortByNumber = function (a, b) { return toFloat(a) - toFloat(b); }, fun = function () {}, pipe = function (x) { return x; }, rectPath = R._rectPath = function (x, y, w, h, r) { if (r) { return [["M", x + r, y], ["l", w - r * 2, 0], ["a", r, r, 0, 0, 1, r, r], ["l", 0, h - r * 2], ["a", r, r, 0, 0, 1, -r, r], ["l", r * 2 - w, 0], ["a", r, r, 0, 0, 1, -r, -r], ["l", 0, r * 2 - h], ["a", r, r, 0, 0, 1, r, -r], ["z"]]; } return [["M", x, y], ["l", w, 0], ["l", 0, h], ["l", -w, 0], ["z"]]; }, ellipsePath = function (x, y, rx, ry) { if (ry == null) { ry = rx; } return [["M", x, y], ["m", 0, -ry], ["a", rx, ry, 0, 1, 1, 0, 2 * ry], ["a", rx, ry, 0, 1, 1, 0, -2 * ry], ["z"]]; }, getPath = R._getPath = { path: function (el) { return el.attr("path"); }, circle: function (el) { var a = el.attrs; return ellipsePath(a.cx, a.cy, a.r); }, ellipse: function (el) { var a = el.attrs; return ellipsePath(a.cx, a.cy, a.rx, a.ry); }, rect: function (el) { var a = el.attrs; return rectPath(a.x, a.y, a.width, a.height, a.r); }, image: function (el) { var a = el.attrs; return rectPath(a.x, a.y, a.width, a.height); }, text: function (el) { var bbox = el._getBBox(); return rectPath(bbox.x, bbox.y, bbox.width, bbox.height); } }, mapPath = R.mapPath = function (path, matrix) { if (!matrix) { return path; } var x, y, i, j, ii, jj, pathi; path = path2curve(path); for (i = 0, ii = path.length; i < ii; i++) { pathi = path[i]; for (j = 1, jj = pathi.length; j < jj; j += 2) { x = matrix.x(pathi[j], pathi[j + 1]); y = matrix.y(pathi[j], pathi[j + 1]); pathi[j] = x; pathi[j + 1] = y; } } return path; }; R._g = g; R.type = (g.win.SVGAngle || g.doc.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") ? "SVG" : "VML"); if (R.type == "VML") { var d = g.doc.createElement("div"), b; d.innerHTML = '<v:shape adj="1"/>'; b = d.firstChild; b.style.behavior = "url(#default#VML)"; if (!(b && typeof b.adj == "object")) { return (R.type = E); } d = null; } R.svg = !(R.vml = R.type == "VML"); R._Paper = Paper; R.fn = paperproto = Paper.prototype = R.prototype; R._id = 0; R._oid = 0; R.is = function (o, type) { type = lowerCase.call(type); if (type == "finite") { return !isnan[has](+o); } if (type == "array") { return o instanceof Array; } return (type == "null" && o === null) || (type == typeof o && o !== null) || (type == "object" && o === Object(o)) || (type == "array" && Array.isArray && Array.isArray(o)) || objectToString.call(o).slice(8, -1).toLowerCase() == type; }; R.angle = function (x1, y1, x2, y2, x3, y3) { if (x3 == null) { var x = x1 - x2, y = y1 - y2; if (!x && !y) { return 0; } return (180 + math.atan2(-y, -x) * 180 / PI + 360) % 360; } else { return R.angle(x1, y1, x3, y3) - R.angle(x2, y2, x3, y3); } }; R.rad = function (deg) { return deg % 360 * PI / 180; }; R.deg = function (rad) { return rad * 180 / PI % 360; }; R.snapTo = function (values, value, tolerance) { tolerance = R.is(tolerance, "finite") ? tolerance : 10; if (R.is(values, array)) { var i = values.length; while (i--) if (abs(values[i] - value) <= tolerance) { return values[i]; } } else { values = +values; var rem = value % values; if (rem < tolerance) { return value - rem; } if (rem > values - tolerance) { return value - rem + values; } } return value; }; var createUUID = R.createUUID = (function (uuidRegEx, uuidReplacer) { return function () { return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(uuidRegEx, uuidReplacer).toUpperCase(); }; })(/[xy]/g, function (c) { var r = math.random() * 16 | 0, v = c == "x" ? r : (r & 3 | 8); return v.toString(16); }); R.setWindow = function (newwin) { eve("setWindow", R, g.win, newwin); g.win = newwin; g.doc = g.win.document; if (R._engine.initWin) { R._engine.initWin(g.win); } }; var toHex = function (color) { if (R.vml) { // http://dean.edwards.name/weblog/2009/10/convert-any-colour-value-to-hex-in-msie/ var trim = /^\s+|\s+$/g; var bod; try { var docum = new ActiveXObject("htmlfile"); docum.write("<body>"); docum.close(); bod = docum.body; } catch(e) { bod = createPopup().document.body; } var range = bod.createTextRange(); toHex = cacher(function (color) { try { bod.style.color = Str(color).replace(trim, E); var value = range.queryCommandValue("ForeColor"); value = ((value & 255) << 16) | (value & 65280) | ((value & 16711680) >>> 16); return "#" + ("000000" + value.toString(16)).slice(-6); } catch(e) { return "none"; } }); } else { var i = g.doc.createElement("i"); i.title = "Rapha\xebl Colour Picker"; i.style.display = "none"; g.doc.body.appendChild(i); toHex = cacher(function (color) { i.style.color = color; return g.doc.defaultView.getComputedStyle(i, E).getPropertyValue("color"); }); } return toHex(color); }, hsbtoString = function () { return "hsb(" + [this.h, this.s, this.b] + ")"; }, hsltoString = function () { return "hsl(" + [this.h, this.s, this.l] + ")"; }, rgbtoString = function () { return this.hex; }, prepareRGB = function (r, g, b) { if (g == null && R.is(r, "object") && "r" in r && "g" in r && "b" in r) { b = r.b; g = r.g; r = r.r; } if (g == null && R.is(r, string)) { var clr = R.getRGB(r); r = clr.r; g = clr.g; b = clr.b; } if (r > 1 || g > 1 || b > 1) { r /= 255; g /= 255; b /= 255; } return [r, g, b]; }, packageRGB = function (r, g, b, o) { r *= 255; g *= 255; b *= 255; var rgb = { r: r, g: g, b: b, hex: R.rgb(r, g, b), toString: rgbtoString }; R.is(o, "finite") && (rgb.opacity = o); return rgb; }; R.color = function (clr) { var rgb; if (R.is(clr, "object") && "h" in clr && "s" in clr && "b" in clr) { rgb = R.hsb2rgb(clr); clr.r = rgb.r; clr.g = rgb.g; clr.b = rgb.b; clr.hex = rgb.hex; } else if (R.is(clr, "object") && "h" in clr && "s" in clr && "l" in clr) { rgb = R.hsl2rgb(clr); clr.r = rgb.r; clr.g = rgb.g; clr.b = rgb.b; clr.hex = rgb.hex; } else { if (R.is(clr, "string")) { clr = R.getRGB(clr); } if (R.is(clr, "object") && "r" in clr && "g" in clr && "b" in clr) { rgb = R.rgb2hsl(clr); clr.h = rgb.h; clr.s = rgb.s; clr.l = rgb.l; rgb = R.rgb2hsb(clr); clr.v = rgb.b; } else { clr = {hex: "none"}; clr.r = clr.g = clr.b = clr.h = clr.s = clr.v = clr.l = -1; } } clr.toString = rgbtoString; return clr; }; R.hsb2rgb = function (h, s, v, o) { if (this.is(h, "object") && "h" in h && "s" in h && "b" in h) { v = h.b; s = h.s; h = h.h; o = h.o; } h *= 360; var R, G, B, X, C; h = (h % 360) / 60; C = v * s; X = C * (1 - abs(h % 2 - 1)); R = G = B = v - C; h = ~~h; R += [C, X, 0, 0, X, C][h]; G += [X, C, C, X, 0, 0][h]; B += [0, 0, X, C, C, X][h]; return packageRGB(R, G, B, o); }; R.hsl2rgb = function (h, s, l, o) { if (this.is(h, "object") && "h" in h && "s" in h && "l" in h) { l = h.l; s = h.s; h = h.h; } if (h > 1 || s > 1 || l > 1) { h /= 360; s /= 100; l /= 100; } h *= 360; var R, G, B, X, C; h = (h % 360) / 60; C = 2 * s * (l < .5 ? l : 1 - l); X = C * (1 - abs(h % 2 - 1)); R = G = B = l - C / 2; h = ~~h; R += [C, X, 0, 0, X, C][h]; G += [X, C, C, X, 0, 0][h]; B += [0, 0, X, C, C, X][h]; return packageRGB(R, G, B, o); }; R.rgb2hsb = function (r, g, b) { b = prepareRGB(r, g, b); r = b[0]; g = b[1]; b = b[2]; var H, S, V, C; V = mmax(r, g, b); C = V - mmin(r, g, b); H = (C == 0 ? null : V == r ? (g - b) / C : V == g ? (b - r) / C + 2 : (r - g) / C + 4 ); H = ((H + 360) % 6) * 60 / 360; S = C == 0 ? 0 : C / V; return {h: H, s: S, b: V, toString: hsbtoString}; }; R.rgb2hsl = function (r, g, b) { b = prepareRGB(r, g, b); r = b[0]; g = b[1]; b = b[2]; var H, S, L, M, m, C; M = mmax(r, g, b); m = mmin(r, g, b); C = M - m; H = (C == 0 ? null : M == r ? (g - b) / C : M == g ? (b - r) / C + 2 : (r - g) / C + 4); H = ((H + 360) % 6) * 60 / 360; L = (M + m) / 2; S = (C == 0 ? 0 : L < .5 ? C / (2 * L) : C / (2 - 2 * L)); return {h: H, s: S, l: L, toString: hsltoString}; }; R._path2string = function () { return this.join(",").replace(p2s, "$1"); }; function repush(array, item) { for (var i = 0, ii = array.length; i < ii; i++) if (array[i] === item) { return array.push(array.splice(i, 1)[0]); } } function cacher(f, scope, postprocessor) { function newf() { var arg = Array.prototype.slice.call(arguments, 0), args = arg.join("\u2400"), cache = newf.cache = newf.cache || {}, count = newf.count = newf.count || []; if (cache[has](args)) { repush(count, args); return postprocessor ? postprocessor(cache[args]) : cache[args]; } count.length >= 1e3 && delete cache[count.shift()]; count.push(args); cache[args] = f[apply](scope, arg); return postprocessor ? postprocessor(cache[args]) : cache[args]; } return newf; } var preload = R._preload = function (src, f) { var img = g.doc.createElement("img"); img.style.cssText = "position:absolute;left:-9999em;top:-9999em"; img.onload = function () { f.call(this); this.onload = null; g.doc.body.removeChild(this); }; img.onerror = function () { g.doc.body.removeChild(this); }; g.doc.body.appendChild(img); img.src = src; }; function clrToString() { return this.hex; } R.getRGB = cacher(function (colour) { if (!colour || !!((colour = Str(colour)).indexOf("-") + 1)) { return {r: -1, g: -1, b: -1, hex: "none", error: 1, toString: clrToString}; } if (colour == "none") { return {r: -1, g: -1, b: -1, hex: "none", toString: clrToString}; } !(hsrg[has](colour.toLowerCase().substring(0, 2)) || colour.charAt() == "#") && (colour = toHex(colour)); var res, red, green, blue, opacity, t, values, rgb = colour.match(colourRegExp); if (rgb) { if (rgb[2]) { blue = toInt(rgb[2].substring(5), 16); green = toInt(rgb[2].substring(3, 5), 16); red = toInt(rgb[2].substring(1, 3), 16); } if (rgb[3]) { blue = toInt((t = rgb[3].charAt(3)) + t, 16); green = toInt((t = rgb[3].charAt(2)) + t, 16); red = toInt((t = rgb[3].charAt(1)) + t, 16); } if (rgb[4]) { values = rgb[4][split](commaSpaces); red = toFloat(values[0]); values[0].slice(-1) == "%" && (red *= 2.55); green = toFloat(values[1]); values[1].slice(-1) == "%" && (green *= 2.55); blue = toFloat(values[2]); values[2].slice(-1) == "%" && (blue *= 2.55); rgb[1].toLowerCase().slice(0, 4) == "rgba" && (opacity = toFloat(values[3])); values[3] && values[3].slice(-1) == "%" && (opacity /= 100); } if (rgb[5]) { values = rgb[5][split](commaSpaces); red = toFloat(values[0]); values[0].slice(-1) == "%" && (red *= 2.55); green = toFloat(values[1]); values[1].slice(-1) == "%" && (green *= 2.55); blue = toFloat(values[2]); values[2].slice(-1) == "%" && (blue *= 2.55); (values[0].slice(-3) == "deg" || values[0].slice(-1) == "\xb0") && (red /= 360); rgb[1].toLowerCase().slice(0, 4) == "hsba" && (opacity = toFloat(values[3])); values[3] && values[3].slice(-1) == "%" && (opacity /= 100); return R.hsb2rgb(red, green, blue, opacity); } if (rgb[6]) { values = rgb[6][split](commaSpaces); red = toFloat(values[0]); values[0].slice(-1) == "%" && (red *= 2.55); green = toFloat(values[1]); values[1].slice(-1) == "%" && (green *= 2.55); blue = toFloat(values[2]); values[2].slice(-1) == "%" && (blue *= 2.55); (values[0].slice(-3) == "deg" || values[0].slice(-1) == "\xb0") && (red /= 360); rgb[1].toLowerCase().slice(0, 4) == "hsla" && (opacity = toFloat(values[3])); values[3] && values[3].slice(-1) == "%" && (opacity /= 100); return R.hsl2rgb(red, green, blue, opacity); } rgb = {r: red, g: green, b: blue, toString: clrToString}; rgb.hex = "#" + (16777216 | blue | (green << 8) | (red << 16)).toString(16).slice(1); R.is(opacity, "finite") && (rgb.opacity = opacity); return rgb; } return {r: -1, g: -1, b: -1, hex: "none", error: 1, toString: clrToString}; }, R); R.hsb = cacher(function (h, s, b) { return R.hsb2rgb(h, s, b).hex; }); R.hsl = cacher(function (h, s, l) { return R.hsl2rgb(h, s, l).hex; }); R.rgb = cacher(function (r, g, b) { return "#" + (16777216 | b | (g << 8) | (r << 16)).toString(16).slice(1); }); R.getColor = function (value) { var start = this.getColor.start = this.getColor.start || {h: 0, s: 1, b: value || .75}, rgb = this.hsb2rgb(start.h, start.s, start.b); start.h += .075; if (start.h > 1) { start.h = 0; start.s -= .2; start.s <= 0 && (this.getColor.start = {h: 0, s: 1, b: start.b}); } return rgb.hex; }; R.getColor.reset = function () { delete this.start; }; // http://schepers.cc/getting-to-the-point function catmullRom2bezier(crp) { var d = []; for (var i = 0, iLen = crp.length; iLen - 2 > i; i += 2) { var p = [{x: +crp[i], y: +crp[i + 1]}, {x: +crp[i], y: +crp[i + 1]}, {x: +crp[i + 2], y: +crp[i + 3]}, {x: +crp[i + 4], y: +crp[i + 5]}]; if (iLen - 4 == i) { p[0] = {x: +crp[i - 2], y: +crp[i - 1]}; p[3] = p[2]; } else if (i) { p[0] = {x: +crp[i - 2], y: +crp[i - 1]}; } d.push(["C", (-p[0].x + 6 * p[1].x + p[2].x) / 6, (-p[0].y + 6 * p[1].y + p[2].y) / 6, (p[1].x + 6 * p[2].x - p[3].x) / 6, (p[1].y + 6*p[2].y - p[3].y) / 6, p[2].x, p[2].y ]); } return d; } R.parsePathString = cacher(function (pathString) { if (!pathString) { return null; } var paramCounts = {a: 7, c: 6, h: 1, l: 2, m: 2, r: 4, q: 4, s: 4, t: 2, v: 1, z: 0}, data = []; if (R.is(pathString, array) && R.is(pathString[0], array)) { // rough assumption data = pathClone(pathString); } if (!data.length) { Str(pathString).replace(pathCommand, function (a, b, c) { var params = [], name = b.toLowerCase(); c.replace(pathValues, function (a, b) { b && params.push(+b); }); if (name == "m" && params.length > 2) { data.push([b][concat](params.splice(0, 2))); name = "l"; b = b == "m" ? "l" : "L"; } if (name == "r") { data.push([b][concat](params)); } else while (params.length >= paramCounts[name]) { data.push([b][concat](params.splice(0, paramCounts[name]))); if (!paramCounts[name]) { break; } } }); } data.toString = R._path2string; return data; }); R.parseTransformString = cacher(function (TString) { if (!TString) { return null; } var paramCounts = {r: 3, s: 4, t: 2, m: 6}, data = []; if (R.is(TString, array) && R.is(TString[0], array)) { // rough assumption data = pathClone(TString); } if (!data.length) { Str(TString).replace(tCommand, function (a, b, c) { var params = [], name = lowerCase.call(b); c.replace(pathValues, function (a, b) { b && params.push(+b); }); data.push([b][concat](params)); }); } data.toString = R._path2string; return data; }); R.findDotsAtSegment = function (p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) { var t1 = 1 - t, t13 = pow(t1, 3), t12 = pow(t1, 2), t2 = t * t, t3 = t2 * t, x = t13 * p1x + t12 * 3 * t * c1x + t1 * 3 * t * t * c2x + t3 * p2x, y = t13 * p1y + t12 * 3 * t * c1y + t1 * 3 * t * t * c2y + t3 * p2y, mx = p1x + 2 * t * (c1x - p1x) + t2 * (c2x - 2 * c1x + p1x), my = p1y + 2 * t * (c1y - p1y) + t2 * (c2y - 2 * c1y + p1y), nx = c1x + 2 * t * (c2x - c1x) + t2 * (p2x - 2 * c2x + c1x), ny = c1y + 2 * t * (c2y - c1y) + t2 * (p2y - 2 * c2y + c1y), ax = t1 * p1x + t * c1x, ay = t1 * p1y + t * c1y, cx = t1 * c2x + t * p2x, cy = t1 * c2y + t * p2y, alpha = (90 - math.atan2(mx - nx, my - ny) * 180 / PI); (mx > nx || my < ny) && (alpha += 180); return { x: x, y: y, m: {x: mx, y: my}, n: {x: nx, y: ny}, start: {x: ax, y: ay}, end: {x: cx, y: cy}, alpha: alpha }; }; R._removedFactory = function (methodname) { return function () { throw new Error("Rapha\xebl: you are calling to method \u201c" + methodname + "\u201d of removed object"); }; }; var pathDimensions = cacher(function (path) { if (!path) { return {x: 0, y: 0, width: 0, height: 0}; } path = path2curve(path); var x = 0, y = 0, X = [], Y = [], p; for (var i = 0, ii = path.length; i < ii; i++) { p = path[i]; if (p[0] == "M") { x = p[1]; y = p[2]; X.push(x); Y.push(y); } else { var dim = curveDim(x, y, p[1], p[2], p[3], p[4], p[5], p[6]); X = X[concat](dim.min.x, dim.max.x); Y = Y[concat](dim.min.y, dim.max.y); x = p[5]; y = p[6]; } } var xmin = mmin[apply](0, X), ymin = mmin[apply](0, Y); return { x: xmin, y: ymin, width: mmax[apply](0, X) - xmin, height: mmax[apply](0, Y) - ymin }; }, null, function (o) { return { x: o.x, y: o.y, width: o.width, height: o.height }; }), pathClone = function (pathArray) { var res = []; if (!R.is(pathArray, array) || !R.is(pathArray && pathArray[0], array)) { // rough assumption pathArray = R.parsePathString(pathArray); } for (var i = 0, ii = pathArray.length; i < ii; i++) { res[i] = []; for (var j = 0, jj = pathArray[i].length; j < jj; j++) { res[i][j] = pathArray[i][j]; } } res.toString = R._path2string; return res; }, pathToRelative = R._pathToRelative = cacher(function (pathArray) { if (!R.is(pathArray, array) || !R.is(pathArray && pathArray[0], array)) { // rough assumption pathArray = R.parsePathString(pathArray); } var res = [], x = 0, y = 0, mx = 0, my = 0, start = 0; if (pathArray[0][0] == "M") { x = pathArray[0][1]; y = pathArray[0][2]; mx = x; my = y; start++; res.push(["M", x, y]); } for (var i = start, ii = pathArray.length; i < ii; i++) { var r = res[i] = [], pa = pathArray[i]; if (pa[0] != lowerCase.call(pa[0])) { r[0] = lowerCase.call(pa[0]); switch (r[0]) { case "a": r[1] = pa[1]; r[2] = pa[2]; r[3] = pa[3]; r[4] = pa[4]; r[5] = pa[5]; r[6] = +(pa[6] - x).toFixed(3); r[7] = +(pa[7] - y).toFixed(3); break; case "v": r[1] = +(pa[1] - y).toFixed(3); break; case "m": mx = pa[1]; my = pa[2]; default: for (var j = 1, jj = pa.length; j < jj; j++) { r[j] = +(pa[j] - ((j % 2) ? x : y)).toFixed(3); } } } else { r = res[i] = []; if (pa[0] == "m") { mx = pa[1] + x; my = pa[2] + y; } for (var k = 0, kk = pa.length; k < kk; k++) { res[i][k] = pa[k]; } } var len = res[i].length; switch (res[i][0]) { case "z": x = mx; y = my; break; case "h": x += +res[i][len - 1]; break; case "v": y += +res[i][len - 1]; break; default: x += +res[i][len - 2]; y += +res[i][len - 1]; } } res.toString = R._path2string; return res; }, 0, pathClone), pathToAbsolute = R._pathToAbsolute = cacher(function (pathArray) { if (!R.is(pathArray, array) || !R.is(pathArray && pathArray[0], array)) { // rough assumption pathArray = R.parsePathString(pathArray); } if (!pathArray || !pathArray.length) { return [["M", 0, 0]]; } var res = [], x = 0, y = 0, mx = 0, my = 0, start = 0; if (pathArray[0][0] == "M") { x = +pathArray[0][1]; y = +pathArray[0][2]; mx = x; my = y; start++; res[0] = ["M", x, y]; } for (var r, pa, i = start, ii = pathArray.length; i < ii; i++) { res.push(r = []); pa = pathArray[i]; if (pa[0] != upperCase.call(pa[0])) { r[0] = upperCase.call(pa[0]); switch (r[0]) { case "A": r[1] = pa[1]; r[2] = pa[2]; r[3] = pa[3]; r[4] = pa[4]; r[5] = pa[5]; r[6] = +(pa[6] + x); r[7] = +(pa[7] + y); break; case "V": r[1] = +pa[1] + y; break; case "H": r[1] = +pa[1] + x; break; case "R": var dots = [x, y][concat](pa.slice(1)); for (var j = 2, jj = dots.length; j < jj; j++) { dots[j] = +dots[j] + x; dots[++j] = +dots[j] + y; } res.pop(); res = res[concat](catmullRom2bezier(dots)); break; case "M": mx = +pa[1] + x; my = +pa[2] + y; default: for (j = 1, jj = pa.length; j < jj; j++) { r[j] = +pa[j] + ((j % 2) ? x : y); } } } else if (pa[0] == "R") { dots = [x, y][concat](pa.slice(1)); res.pop(); res = res[concat](catmullRom2bezier(dots)); r = ["R"][concat](pa.slice(-2)); } else { for (var k = 0, kk = pa.length; k < kk; k++) { r[k] = pa[k]; } } switch (r[0]) { case "Z": x = mx; y = my; break; case "H": x = r[1]; break; case "V": y = r[1]; break; case "M": mx = r[r.length - 2]; my = r[r.length - 1]; default: x = r[r.length - 2]; y = r[r.length - 1]; } } res.toString = R._path2string; return res; }, null, pathClone), l2c = function (x1, y1, x2, y2) { return [x1, y1, x2, y2, x2, y2]; }, q2c = function (x1, y1, ax, ay, x2, y2) { var _13 = 1 / 3, _23 = 2 / 3; return [ _13 * x1 + _23 * ax, _13 * y1 + _23 * ay, _13 * x2 + _23 * ax, _13 * y2 + _23 * ay, x2, y2 ]; }, a2c = function (x1, y1, rx, ry, angle, large_arc_flag, sweep_flag, x2, y2, recursive) { // for more information of where this math came from visit: // http://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes var _120 = PI * 120 / 180, rad = PI / 180 * (+angle || 0), res = [], xy, rotate = cacher(function (x, y, rad) { var X = x * math.cos(rad) - y * math.sin(rad), Y = x * math.sin(rad) + y * math.cos(rad); return {x: X, y: Y}; }); if (!recursive) { xy = rotate(x1, y1, -rad); x1 = xy.x; y1 = xy.y; xy = rotate(x2, y2, -rad); x2 = xy.x; y2 = xy.y; var cos = math.cos(PI / 180 * angle), sin = math.sin(PI / 180 * angle), x = (x1 - x2) / 2, y = (y1 - y2) / 2; var h = (x * x) / (rx * rx) + (y * y) / (ry * ry); if (h > 1) { h = math.sqrt(h); rx = h * rx; ry = h * ry; } var rx2 = rx * rx, ry2 = ry * ry, k = (large_arc_flag == sweep_flag ? -1 : 1) * math.sqrt(abs((rx2 * ry2 - rx2 * y * y - ry2 * x * x) / (rx2 * y * y + ry2 * x * x))), cx = k * rx * y / ry + (x1 + x2) / 2, cy = k * -ry * x / rx + (y1 + y2) / 2, f1 = math.asin(((y1 - cy) / ry).toFixed(9)), f2 = math.asin(((y2 - cy) / ry).toFixed(9)); f1 = x1 < cx ? PI - f1 : f1; f2 = x2 < cx ? PI - f2 : f2; f1 < 0 && (f1 = PI * 2 + f1); f2 < 0 && (f2 = PI * 2 + f2); if (sweep_flag && f1 > f2) { f1 = f1 - PI * 2; } if (!sweep_flag && f2 > f1) { f2 = f2 - PI * 2; } } else { f1 = recursive[0]; f2 = recursive[1]; cx = recursive[2]; cy = recursive[3]; } var df = f2 - f1; if (abs(df) > _120) { var f2old = f2, x2old = x2, y2old = y2; f2 = f1 + _120 * (sweep_flag && f2 > f1 ? 1 : -1); x2 = cx + rx * math.cos(f2); y2 = cy + ry * math.sin(f2); res = a2c(x2, y2, rx, ry, angle, 0, sweep_flag, x2old, y2old, [f2, f2old, cx, cy]); } df = f2 - f1; var c1 = math.cos(f1), s1 = math.sin(f1), c2 = math.cos(f2), s2 = math.sin(f2), t = math.tan(df / 4), hx = 4 / 3 * rx * t, hy = 4 / 3 * ry * t, m1 = [x1, y1], m2 = [x1 + hx * s1, y1 - hy * c1], m3 = [x2 + hx * s2, y2 - hy * c2], m4 = [x2, y2]; m2[0] = 2 * m1[0] - m2[0]; m2[1] = 2 * m1[1] - m2[1]; if (recursive) { return [m2, m3, m4][concat](res); } else { res = [m2, m3, m4][concat](res).join()[split](","); var newres = []; for (var i = 0, ii = res.length; i < ii; i++) { newres[i] = i % 2 ? rotate(res[i - 1], res[i], rad).y : rotate(res[i], res[i + 1], rad).x; } return newres; } }, findDotAtSegment = function (p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) { var t1 = 1 - t; return { x: pow(t1, 3) * p1x + pow(t1, 2) * 3 * t * c1x + t1 * 3 * t * t * c2x + pow(t, 3) * p2x, y: pow(t1, 3) * p1y + pow(t1, 2) * 3 * t * c1y + t1 * 3 * t * t * c2y + pow(t, 3) * p2y }; }, curveDim = cacher(function (p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y) { var a = (c2x - 2 * c1x + p1x) - (p2x - 2 * c2x + c1x), b = 2 * (c1x - p1x) - 2 * (c2x - c1x), c = p1x - c1x, t1 = (-b + math.sqrt(b * b - 4 * a * c)) / 2 / a, t2 = (-b - math.sqrt(b * b - 4 * a * c)) / 2 / a, y = [p1y, p2y], x = [p1x, p2x], dot; abs(t1) > "1e12" && (t1 = .5); abs(t2) > "1e12" && (t2 = .5); if (t1 > 0 && t1 < 1) { dot = findDotAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t1); x.push(dot.x); y.push(dot.y); } if (t2 > 0 && t2 < 1) { dot = findDotAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t2); x.push(dot.x); y.push(dot.y); } a = (c2y - 2 * c1y + p1y) - (p2y - 2 * c2y + c1y); b = 2 * (c1y - p1y) - 2 * (c2y - c1y); c = p1y - c1y; t1 = (-b + math.sqrt(b * b - 4 * a * c)) / 2 / a; t2 = (-b - math.sqrt(b * b - 4 * a * c)) / 2 / a; abs(t1) > "1e12" && (t1 = .5); abs(t2) > "1e12" && (t2 = .5); if (t1 > 0 && t1 < 1) { dot = findDotAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t1); x.push(dot.x); y.push(dot.y); } if (t2 > 0 && t2 < 1) { dot = findDotAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t2); x.push(dot.x); y.push(dot.y); } return { min: {x: mmin[apply](0, x), y: mmin[apply](0, y)}, max: {x: mmax[apply](0, x), y: mmax[apply](0, y)} }; }), path2curve = R._path2curve = cacher(function (path, path2) { var p = pathToAbsolute(path), p2 = path2 && pathToAbsolute(path2), attrs = {x: 0, y: 0, bx: 0, by: 0, X: 0, Y: 0, qx: null, qy: null}, attrs2 = {x: 0, y: 0, bx: 0, by: 0, X: 0, Y: 0, qx: null, qy: null}, processPath = function (path, d) { var nx, ny; if (!path) { return ["C", d.x, d.y, d.x, d.y, d.x, d.y]; } !(path[0] in {T:1, Q:1}) && (d.qx = d.qy = null); switch (path[0]) { case "M": d.X = path[1]; d.Y = path[2]; break; case "A": path = ["C"][concat](a2c[apply](0, [d.x, d.y][concat](path.slice(1)))); break; case "S": nx = d.x + (d.x - (d.bx || d.x)); ny = d.y + (d.y - (d.by || d.y)); path = ["C", nx, ny][concat](path.slice(1)); break; case "T": d.qx = d.x + (d.x - (d.qx || d.x)); d.qy = d.y + (d.y - (d.qy || d.y)); path = ["C"][concat](q2c(d.x, d.y, d.qx, d.qy, path[1], path[2])); break; case "Q": d.qx = path[1]; d.qy = path[2]; path = ["C"][concat](q2c(d.x, d.y, path[1], path[2], path[3], path[4])); break; case "L": path = ["C"][concat](l2c(d.x, d.y, path[1], path[2])); break; case "H": path = ["C"][concat](l2c(d.x, d.y, path[1], d.y)); break; case "V": path = ["C"][concat](l2c(d.x, d.y, d.x, path[1])); break; case "Z": path = ["C"][concat](l2c(d.x, d.y, d.X, d.Y)); break; } return path; }, fixArc = function (pp, i) { if (pp[i].length > 7) { pp[i].shift(); var pi = pp[i]; while (pi.length) { pp.splice(i++, 0, ["C"][concat](pi.splice(0, 6))); } pp.splice(i, 1); ii = mmax(p.length, p2 && p2.length || 0); } }, fixM = function (path1, path2, a1, a2, i) { if (path1 && path2 && path1[i][0] == "M" && path2[i][0] != "M") { path2.splice(i, 0, ["M", a2.x, a2.y]); a1.bx = 0; a1.by = 0; a1.x = path1[i][1]; a1.y = path1[i][2]; ii = mmax(p.length, p2 && p2.length || 0); } }; for (var i = 0, ii = mmax(p.length, p2 && p2.length || 0); i < ii; i++) { p[i] = processPath(p[i], attrs); fixArc(p, i); p2 && (p2[i] = processPath(p2[i], attrs2)); p2 && fixArc(p2, i); fixM(p, p2, attrs, attrs2, i); fixM(p2, p, attrs2, attrs, i); var seg = p[i], seg2 = p2 && p2[i], seglen = seg.length, seg2len = p2 && seg2.length; attrs.x = seg[seglen - 2]; attrs.y = seg[seglen - 1]; attrs.bx = toFloat(seg[seglen - 4]) || attrs.x; attrs.by = toFloat(seg[seglen - 3]) || attrs.y; attrs2.bx = p2 && (toFloat(seg2[seg2len - 4]) || attrs2.x); attrs2.by = p2 && (toFloat(seg2[seg2len - 3]) || attrs2.y); attrs2.x = p2 && seg2[seg2len - 2]; attrs2.y = p2 && seg2[seg2len - 1]; } return p2 ? [p, p2] : p; }, null, pathClone), parseDots = R._parseDots = cacher(function (gradient) { var dots = []; for (var i = 0, ii = gradient.length; i < ii; i++) { var dot = {}, par = gradient[i].match(/^([^:]*):?([\d\.]*)/); dot.color = R.getRGB(par[1]); if (dot.color.error) { return null; } dot.color = dot.color.hex; par[2] && (dot.offset = par[2] + "%"); dots.push(dot); } for (i = 1, ii = dots.length - 1; i < ii; i++) { if (!dots[i].offset) { var start = toFloat(dots[i - 1].offset || 0), end = 0; for (var j = i + 1; j < ii; j++) { if (dots[j].offset) { end = dots[j].offset; break; } } if (!end) { end = 100; j = ii; } end = toFloat(end); var d = (end - start) / (j - i + 1); for (; i < j; i++) { start += d; dots[i].offset = start + "%"; } } } return dots; }), tear = R._tear = function (el, paper) { el == paper.top && (paper.top = el.prev); el == paper.bottom && (paper.bottom = el.next); el.next && (el.next.prev = el.prev); el.prev && (el.prev.next = el.next); }, tofront = R._tofront = function (el, paper) { if (paper.top === el) { return; } tear(el, paper); el.next = null; el.prev = paper.top; paper.top.next = el; paper.top = el; }, toback = R._toback = function (el, paper) { if (paper.bottom === el) { return; } tear(el, paper); el.next = paper.bottom; el.prev = null; paper.bottom.prev = el; paper.bottom = el; }, insertafter = R._insertafter = function (el, el2, paper) { tear(el, paper); el2 == paper.top && (paper.top = el); el2.next && (el2.next.prev = el); el.next = el2.next; el.prev = el2; el2.next = el; }, insertbefore = R._insertbefore = function (el, el2, paper) { tear(el, paper); el2 == paper.bottom && (paper.bottom = el); el2.prev && (el2.prev.next = el); el.prev = el2.prev; el2.prev = el; el.next = el2; }, extractTransform = R._extractTransform = function (el, tstr) { if (tstr == null) { return el._.transform; } tstr = Str(tstr).replace(/\.{3}|\u2026/g, el._.transform || E); var tdata = R.parseTransformString(tstr), deg = 0, dx = 0, dy = 0, sx = 1, sy = 1, _ = el._, m = new Matrix; _.transform = tdata || []; if (tdata) { for (var i = 0, ii = tdata.length; i < ii; i++) { var t = tdata[i], tlen = t.length, command = Str(t[0]).toLowerCase(), absolute = t[0] != command, inver = absolute ? m.invert() : 0, x1, y1, x2, y2, bb; if (command == "t" && tlen == 3) { if (absolute) { x1 = inver.x(0, 0); y1 = inver.y(0, 0); x2 = inver.x(t[1], t[2]); y2 = inver.y(t[1], t[2]); m.translate(x2 - x1, y2 - y1); } else { m.translate(t[1], t[2]); } } else if (command == "r") { if (tlen == 2) { bb = bb || el.getBBox(1); m.rotate(t[1], bb.x + bb.width / 2, bb.y + bb.height / 2); deg += t[1]; } else if (tlen == 4) { if (absolute) { x2 = inver.x(t[2], t[3]); y2 = inver.y(t[2], t[3]); m.rotate(t[1], x2, y2); } else { m.rotate(t[1], t[2], t[3]); } deg += t[1]; } } else if (command == "s") { if (tlen == 2 || tlen == 3) { bb = bb || el.getBBox(1); m.scale(t[1], t[tlen - 1], bb.x + bb.width / 2, bb.y + bb.height / 2); sx *= t[1]; sy *= t[tlen - 1]; } else if (tlen == 5) { if (absolute) { x2 = inver.x(t[3], t[4]); y2 = inver.y(t[3], t[4]); m.scale(t[1], t[2], x2, y2); } else { m.scale(t[1], t[2], t[3], t[4]); } sx *= t[1]; sy *= t[2]; } } else if (command == "m" && tlen == 7) { m.add(t[1], t[2], t[3], t[4], t[5], t[6]); } _.dirtyT = 1; el.matrix = m; } } el.matrix = m; _.sx = sx; _.sy = sy; _.deg = deg; _.dx = dx = m.e; _.dy = dy = m.f; if (sx == 1 && sy == 1 && !deg && _.bbox) { _.bbox.x += +dx; _.bbox.y += +dy; } else { _.dirtyT = 1; } }, getEmpty = function (item) { var l = item[0]; switch (l.toLowerCase()) { case "t": return [l, 0, 0]; case "m": return [l, 1, 0, 0, 1, 0, 0]; case "r": if (item.length == 4) { return [l, 0, item[2], item[3]]; } else { return [l, 0]; } case "s": if (item.length == 5) { return [l, 1, 1, item[3], item[4]]; } else if (item.length == 3) { return [l, 1, 1]; } else { return [l, 1]; } } }, equaliseTransform = R._equaliseTransform = function (t1, t2) { t2 = Str(t2).replace(/\.{3}|\u2026/g, t1); t1 = R.parseTransformString(t1) || []; t2 = R.parseTransformString(t2) || []; var maxlength = mmax(t1.length, t2.length), from = [], to = [], i = 0, j, jj, tt1, tt2; for (; i < maxlength; i++) { tt1 = t1[i] || getEmpty(t2[i]); tt2 = t2[i] || getEmpty(tt1); if ((tt1[0] != tt2[0]) || (tt1[0].toLowerCase() == "r" && (tt1[2] != tt2[2] || tt1[3] != tt2[3])) || (tt1[0].toLowerCase() == "s" && (tt1[3] != tt2[3] || tt1[4] != tt2[4])) ) { return; } from[i] = []; to[i] = []; for (j = 0, jj = mmax(tt1.length, tt2.length); j < jj; j++) { j in tt1 && (from[i][j] = tt1[j]); j in tt2 && (to[i][j] = tt2[j]); } } return { from: from, to: to }; }; R._getContainer = function (x, y, w, h) { var container; container = h == null && !R.is(x, "object") ? g.doc.getElementById(x) : x; if (container == null) { return; } if (container.tagName) { if (y == null) { return { container: container, width: container.style.pixelWidth || container.offsetWidth, height: container.style.pixelHeight || container.offsetHeight }; } else { return { container: container, width: y, height: w }; } } return { container: 1, x: x, y: y, width: w, height: h }; }; R.pathToRelative = pathToRelative; R._engine = {}; R.path2curve = path2curve; R.matrix = function (a, b, c, d, e, f) { return new Matrix(a, b, c, d, e, f); }; function Matrix(a, b, c, d, e, f) { if (a != null) { this.a = +a; this.b = +b; this.c = +c; this.d = +d; this.e = +e; this.f = +f; } else { this.a = 1; this.b = 0; this.c = 0; this.d = 1; this.e = 0; this.f = 0; } } (function (matrixproto) { matrixproto.add = function (a, b, c, d, e, f) { var out = [[], [], []], m = [[this.a, this.c, this.e], [this.b, this.d, this.f], [0, 0, 1]], matrix = [[a, c, e], [b, d, f], [0, 0, 1]], x, y, z, res; if (a && a instanceof Matrix) { matrix = [[a.a, a.c, a.e], [a.b, a.d, a.f], [0, 0, 1]]; } for (x = 0; x < 3; x++) { for (y = 0; y < 3; y++) { res = 0; for (z = 0; z < 3; z++) { res += m[x][z] * matrix[z][y]; } out[x][y] = res; } } this.a = out[0][0]; this.b = out[1][0]; this.c = out[0][1]; this.d = out[1][1]; this.e = out[0][2]; this.f = out[1][2]; }; matrixproto.invert = function () { var me = this, x = me.a * me.d - me.b * me.c; return new Matrix(me.d / x, -me.b / x, -me.c / x, me.a / x, (me.c * me.f - me.d * me.e) / x, (me.b * me.e - me.a * me.f) / x); }; matrixproto.clone = function () { return new Matrix(this.a, this.b, this.c, this.d, this.e, this.f); }; matrixproto.translate = function (x, y) { this.add(1, 0, 0, 1, x, y); }; matrixproto.scale = function (x, y, cx, cy) { y == null && (y = x); (cx || cy) && this.add(1, 0, 0, 1, cx, cy); this.add(x, 0, 0, y, 0, 0); (cx || cy) && this.add(1, 0, 0, 1, -cx, -cy); }; matrixproto.rotate = function (a, x, y) { a = R.rad(a); x = x || 0; y = y || 0; var cos = +math.cos(a).toFixed(9), sin = +math.sin(a).toFixed(9); this.add(cos, sin, -sin, cos, x, y); this.add(1, 0, 0, 1, -x, -y); }; matrixproto.x = function (x, y) { return x * this.a + y * this.c + this.e; }; matrixproto.y = function (x, y) { return x * this.b + y * this.d + this.f; }; matrixproto.get = function (i) { return +this[Str.fromCharCode(97 + i)].toFixed(4); }; matrixproto.toString = function () { return R.svg ? "matrix(" + [this.get(0), this.get(1), this.get(2), this.get(3), this.get(4), this.get(5)].join() + ")" : [this.get(0), this.get(2), this.get(1), this.get(3), 0, 0].join(); }; matrixproto.toFilter = function () { return "progid:DXImageTransform.Microsoft.Matrix(M11=" + this.get(0) + ", M12=" + this.get(2) + ", M21=" + this.get(1) + ", M22=" + this.get(3) + ", Dx=" + this.get(4) + ", Dy=" + this.get(5) + ", sizingmethod='auto expand')"; }; matrixproto.offset = function () { return [this.e.toFixed(4), this.f.toFixed(4)]; }; function norm(a) { return a[0] * a[0] + a[1] * a[1]; } function normalize(a) { var mag = math.sqrt(norm(a)); a[0] && (a[0] /= mag); a[1] && (a[1] /= mag); } matrixproto.split = function () { var out = {}; // translation out.dx = this.e; out.dy = this.f; // scale and shear var row = [[this.a, this.c], [this.b, this.d]]; out.scalex = math.sqrt(norm(row[0])); normalize(row[0]); out.shear = row[0][0] * row[1][0] + row[0][1] * row[1][1]; row[1] = [row[1][0] - row[0][0] * out.shear, row[1][1] - row[0][1] * out.shear]; out.scaley = math.sqrt(norm(row[1])); normalize(row[1]); out.shear /= out.scaley; // rotation var sin = -row[0][1], cos = row[1][1]; if (cos < 0) { out.rotate = R.deg(math.acos(cos)); if (sin < 0) { out.rotate = 360 - out.rotate; } } else { out.rotate = R.deg(math.asin(sin)); } out.isSimple = !+out.shear.toFixed(9) && (out.scalex.toFixed(9) == out.scaley.toFixed(9) || !out.rotate); out.isSuperSimple = !+out.shear.toFixed(9) && out.scalex.toFixed(9) == out.scaley.toFixed(9) && !out.rotate; out.noRotation = !+out.shear.toFixed(9) && !out.rotate; return out; }; matrixproto.toTransformString = function (shorter) { var s = shorter || this[split](); if (s.isSimple) { s.scalex = +s.scalex.toFixed(4); s.scaley = +s.scaley.toFixed(4); s.rotate = +s.rotate.toFixed(4); return (s.dx && s.dy ? "t" + [s.dx, s.dy] : E) + (s.scalex != 1 || s.scaley != 1 ? "s" + [s.scalex, s.scaley, 0, 0] : E) + (s.rotate ? "r" + [s.rotate, 0, 0] : E); } else { return "m" + [this.get(0), this.get(1), this.get(2), this.get(3), this.get(4), this.get(5)]; } }; })(Matrix.prototype); // WebKit rendering bug workaround method var version = navigator.userAgent.match(/Version\/(.*?)\s/) || navigator.userAgent.match(/Chrome\/(\d+)/); if ((navigator.vendor == "Apple Computer, Inc.") && (version && version[1] < 4 || navigator.platform.slice(0, 2) == "iP") || (navigator.vendor == "Google Inc." && version && version[1] < 8)) { paperproto.safari = function () { var rect = this.rect(-99, -99, this.width + 99, this.height + 99).attr({stroke: "none"}); setTimeout(function () {rect.remove();}); }; } else { paperproto.safari = fun; } var preventDefault = function () { this.returnValue = false; }, preventTouch = function () { return this.originalEvent.preventDefault(); }, stopPropagation = function () { this.cancelBubble = true; }, stopTouch = function () { return this.originalEvent.stopPropagation(); }, addEvent = (function () { if (g.doc.addEventListener) { return function (obj, type, fn, element) { var realName = supportsTouch && touchMap[type] ? touchMap[type] : type, f = function (e) { var scrollY = g.doc.documentElement.scrollTop || g.doc.body.scrollTop, scrollX = g.doc.documentElement.scrollLeft || g.doc.body.scrollLeft, x = e.clientX + scrollX, y = e.clientY + scrollY; if (supportsTouch && touchMap[has](type)) { for (var i = 0, ii = e.targetTouches && e.targetTouches.length; i < ii; i++) { if (e.targetTouches[i].target == obj) { var olde = e; e = e.targetTouches[i]; e.originalEvent = olde; e.preventDefault = preventTouch; e.stopPropagation = stopTouch; break; } } } return fn.call(element, e, x, y); }; obj.addEventListener(realName, f, false); return function () { obj.removeEventListener(realName, f, false); return true; }; }; } else if (g.doc.attachEvent) { return function (obj, type, fn, element) { var f = function (e) { e = e || g.win.event; var scrollY = g.doc.documentElement.scrollTop || g.doc.body.scrollTop, scrollX = g.doc.documentElement.scrollLeft || g.doc.body.scrollLeft, x = e.clientX + scrollX, y = e.clientY + scrollY; e.preventDefault = e.preventDefault || preventDefault; e.stopPropagation = e.stopPropagation || stopPropagation; return fn.call(element, e, x, y); }; obj.attachEvent("on" + type, f); var detacher = function () { obj.detachEvent("on" + type, f); return true; }; return detacher; }; } })(), drag = [], dragMove = function (e) { var x = e.clientX, y = e.clientY, scrollY = g.doc.documentElement.scrollTop || g.doc.body.scrollTop, scrollX = g.doc.documentElement.scrollLeft || g.doc.body.scrollLeft, dragi, j = drag.length; while (j--) { dragi = drag[j]; if (supportsTouch) { var i = e.touches.length, touch; while (i--) { touch = e.touches[i]; if (touch.identifier == dragi.el._drag.id) { x = touch.clientX; y = touch.clientY; (e.originalEvent ? e.originalEvent : e).preventDefault(); break; } } } else { e.preventDefault(); } var node = dragi.el.node, o, next = node.nextSibling, parent = node.parentNode, display = node.style.display; g.win.opera && parent.removeChild(node); node.style.display = "none"; o = dragi.el.paper.getElementByPoint(x, y); node.style.display = display; g.win.opera && (next ? parent.insertBefore(node, next) : parent.appendChild(node)); o && eve("drag.over." + dragi.el.id, dragi.el, o); x += scrollX; y += scrollY; eve("drag.move." + dragi.el.id, dragi.move_scope || dragi.el, x - dragi.el._drag.x, y - dragi.el._drag.y, x, y, e); } }, dragUp = function (e) { R.unmousemove(dragMove).unmouseup(dragUp); var i = drag.length, dragi; while (i--) { dragi = drag[i]; dragi.el._drag = {}; eve("drag.end." + dragi.el.id, dragi.end_scope || dragi.start_scope || dragi.move_scope || dragi.el, e); } drag = []; }, elproto = R.el = {}; for (var i = events.length; i--;) { (function (eventName) { R[eventName] = elproto[eventName] = function (fn, scope) { if (R.is(fn, "function")) { this.events = this.events || []; this.events.push({name: eventName, f: fn, unbind: addEvent(this.shape || this.node || g.doc, eventName, fn, scope || this)}); } return this; }; R["un" + eventName] = elproto["un" + eventName] = function (fn) { var events = this.events, l = events.length; while (l--) if (events[l].name == eventName && events[l].f == fn) { events[l].unbind(); events.splice(l, 1); !events.length && delete this.events; return this; } return this; }; })(events[i]); } elproto.data = function (key, value) { var data = eldata[this.id] = eldata[this.id] || {}; if (arguments.length == 1) { if (R.is(key, "object")) { for (var i in key) if (key[has](i)) { this.data(i, key[i]); } return this; } eve("data.get." + this.id, this, data[key], key); return data[key]; } data[key] = value; eve("data.set." + this.id, this, value, key); return this; }; elproto.removeData = function (key) { if (key == null) { eldata[this.id] = {}; } else { eldata[this.id] && delete eldata[this.id][key]; } return this; }; elproto.hover = function (f_in, f_out, scope_in, scope_out) { return this.mouseover(f_in, scope_in).mouseout(f_out, scope_out || scope_in); }; elproto.unhover = function (f_in, f_out) { return this.unmouseover(f_in).unmouseout(f_out); }; var draggable = []; elproto.drag = function (onmove, onstart, onend, move_scope, start_scope, end_scope) { function start(e) { (e.originalEvent || e).preventDefault(); var scrollY = g.doc.documentElement.scrollTop || g.doc.body.scrollTop, scrollX = g.doc.documentElement.scrollLeft || g.doc.body.scrollLeft; this._drag.x = e.clientX + scrollX; this._drag.y = e.clientY + scrollY; this._drag.id = e.identifier; !drag.length && R.mousemove(dragMove).mouseup(dragUp); drag.push({el: this, move_scope: move_scope, start_scope: start_scope, end_scope: end_scope}); onstart && eve.on("drag.start." + this.id, onstart); onmove && eve.on("drag.move." + this.id, onmove); onend && eve.on("drag.end." + this.id, onend); eve("drag.start." + this.id, start_scope || move_scope || this, e.clientX + scrollX, e.clientY + scrollY, e); } this._drag = {}; draggable.push({el: this, start: start}); this.mousedown(start); return this; }; elproto.onDragOver = function (f) { f ? eve.on("drag.over." + this.id, f) : eve.unbind("drag.over." + this.id); }; elproto.undrag = function () { var i = draggable.length; while (i--) if (draggable[i].el == this) { this.unmousedown(draggable[i].start); draggable.splice(i, 1); eve.unbind("drag.*." + this.id); } !draggable.length && R.unmousemove(dragMove).unmouseup(dragUp); }; paperproto.circle = function (x, y, r) { var out = R._engine.circle(this, x || 0, y || 0, r || 0); this.__set__ && this.__set__.push(out); return out; }; paperproto.rect = function (x, y, w, h, r) { var out = R._engine.rect(this, x || 0, y || 0, w || 0, h || 0, r || 0); this.__set__ && this.__set__.push(out); return out; }; paperproto.ellipse = function (x, y, rx, ry) { var out = R._engine.ellipse(this, x || 0, y || 0, rx || 0, ry || 0); this.__set__ && this.__set__.push(out); return out; }; paperproto.path = function (pathString) { pathString && !R.is(pathString, string) && !R.is(pathString[0], array) && (pathString += E); var out = R._engine.path(R.format[apply](R, arguments), this); this.__set__ && this.__set__.push(out); return out; }; paperproto.image = function (src, x, y, w, h) { var out = R._engine.image(this, src || "about:blank", x || 0, y || 0, w || 0, h || 0); this.__set__ && this.__set__.push(out); return out; }; paperproto.text = function (x, y, text) { var out = R._engine.text(this, x || 0, y || 0, Str(text)); this.__set__ && this.__set__.push(out); return out; }; paperproto.set = function (itemsArray) { !R.is(itemsArray, "array") && (itemsArray = Array.prototype.splice.call(arguments, 0, arguments.length)); var out = new Set(itemsArray); this.__set__ && this.__set__.push(out); return out; }; paperproto.setStart = function (set) { this.__set__ = set || this.set(); }; paperproto.setFinish = function (set) { var out = this.__set__; delete this.__set__; return out; }; paperproto.setSize = function (width, height) { return R._engine.setSize.call(this, width, height); }; paperproto.setViewBox = function (x, y, w, h, fit) { return R._engine.setViewBox.call(this, x, y, w, h, fit); }; paperproto.top = paperproto.bottom = null; paperproto.raphael = R; var getOffset = function (elem) { var box = elem.getBoundingClientRect(), doc = elem.ownerDocument, body = doc.body, docElem = doc.documentElement, clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0, top = box.top + (g.win.pageYOffset || docElem.scrollTop || body.scrollTop ) - clientTop, left = box.left + (g.win.pageXOffset || docElem.scrollLeft || body.scrollLeft) - clientLeft; return { y: top, x: left }; }; paperproto.getElementByPoint = function (x, y) { var paper = this, svg = paper.canvas, target = g.doc.elementFromPoint(x, y); if (g.win.opera && target.tagName == "svg") { var so = getOffset(svg), sr = svg.createSVGRect(); sr.x = x - so.x; sr.y = y - so.y; sr.width = sr.height = 1; var hits = svg.getIntersectionList(sr, null); if (hits.length) { target = hits[hits.length - 1]; } } if (!target) { return null; } while (target.parentNode && target != svg.parentNode && !target.raphael) { target = target.parentNode; } target == paper.canvas.parentNode && (target = svg); target = target && target.raphael ? paper.getById(target.raphaelid) : null; return target; }; paperproto.getById = function (id) { var bot = this.bottom; while (bot) { if (bot.id == id) { return bot; } bot = bot.next; } return null; }; paperproto.forEach = function (callback, thisArg) { var bot = this.bottom; while (bot) { if (callback.call(thisArg, bot) === false) { return this; } bot = bot.next; } return this; }; function x_y() { return this.x + S + this.y; } function x_y_w_h() { return this.x + S + this.y + S + this.width + " \xd7 " + this.height; } elproto.getBBox = function (isWithoutTransform) { if (this.removed) { return {}; } var _ = this._; if (isWithoutTransform) { if (_.dirty || !_.bboxwt) { this.realPath = getPath[this.type](this); _.bboxwt = pathDimensions(this.realPath); _.bboxwt.toString = x_y_w_h; _.dirty = 0; } return _.bboxwt; } if (_.dirty || _.dirtyT || !_.bbox) { if (_.dirty || !this.realPath) { _.bboxwt = 0; this.realPath = getPath[this.type](this); } _.bbox = pathDimensions(mapPath(this.realPath, this.matrix)); _.bbox.toString = x_y_w_h; _.dirty = _.dirtyT = 0; } return _.bbox; }; elproto.clone = function () { if (this.removed) { return null; } var out = this.paper[this.type]().attr(this.attr()); this.__set__ && this.__set__.push(out); return out; }; elproto.glow = function (glow) { if (this.type == "text") { return null; } glow = glow || {}; var s = { width: (glow.width || 10) + (+this.attr("stroke-width") || 1), fill: glow.fill || false, opacity: glow.opacity || .5, offsetx: glow.offsetx || 0, offsety: glow.offsety || 0, color: glow.color || "#000" }, c = s.width / 2, r = this.paper, out = r.set(), path = this.realPath || getPath[this.type](this); path = this.matrix ? mapPath(path, this.matrix) : path; for (var i = 1; i < c + 1; i++) { out.push(r.path(path).attr({ stroke: s.color, fill: s.fill ? s.color : "none", "stroke-linejoin": "round", "stroke-linecap": "round", "stroke-width": +(s.width / c * i).toFixed(3), opacity: +(s.opacity / c).toFixed(3) })); } return out.insertBefore(this).translate(s.offsetx, s.offsety); }; var curveslengths = {}, getPointAtSegmentLength = function (p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, length) { var len = 0, precision = 100, name = [p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y].join(), cache = curveslengths[name], old, dot; !cache && (curveslengths[name] = cache = {data: []}); cache.timer && clearTimeout(cache.timer); cache.timer = setTimeout(function () {delete curveslengths[name];}, 2e3); if (length != null && !cache.precision) { var total = getPointAtSegmentLength(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y); cache.precision = ~~total * 10; cache.data = []; } precision = cache.precision || precision; for (var i = 0; i < precision + 1; i++) { if (cache.data[i * precision]) { dot = cache.data[i * precision]; } else { dot = R.findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, i / precision); cache.data[i * precision] = dot; } i && (len += pow(pow(old.x - dot.x, 2) + pow(old.y - dot.y, 2), .5)); if (length != null && len >= length) { return dot; } old = dot; } if (length == null) { return len; } }, getLengthFactory = function (istotal, subpath) { return function (path, length, onlystart) { path = path2curve(path); var x, y, p, l, sp = "", subpaths = {}, point, len = 0; for (var i = 0, ii = path.length; i < ii; i++) { p = path[i]; if (p[0] == "M") { x = +p[1]; y = +p[2]; } else { l = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6]); if (len + l > length) { if (subpath && !subpaths.start) { point = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6], length - len); sp += ["C" + point.start.x, point.start.y, point.m.x, point.m.y, point.x, point.y]; if (onlystart) {return sp;} subpaths.start = sp; sp = ["M" + point.x, point.y + "C" + point.n.x, point.n.y, point.end.x, point.end.y, p[5], p[6]].join(); len += l; x = +p[5]; y = +p[6]; continue; } if (!istotal && !subpath) { point = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6], length - len); return {x: point.x, y: point.y, alpha: point.alpha}; } } len += l; x = +p[5]; y = +p[6]; } sp += p.shift() + p; } subpaths.end = sp; point = istotal ? len : subpath ? subpaths : R.findDotsAtSegment(x, y, p[0], p[1], p[2], p[3], p[4], p[5], 1); point.alpha && (point = {x: point.x, y: point.y, alpha: point.alpha}); return point; }; }; var getTotalLength = getLengthFactory(1), getPointAtLength = getLengthFactory(), getSubpathsAtLength = getLengthFactory(0, 1); R.getTotalLength = getTotalLength; R.getPointAtLength = getPointAtLength; R.getSubpath = function (path, from, to) { if (this.getTotalLength(path) - to < 1e-6) { return getSubpathsAtLength(path, from).end; } var a = getSubpathsAtLength(path, to, 1); return from ? getSubpathsAtLength(a, from).end : a; }; elproto.getTotalLength = function () { if (this.type != "path") {return;} if (this.node.getTotalLength) { return this.node.getTotalLength(); } return getTotalLength(this.attrs.path); }; elproto.getPointAtLength = function (length) { if (this.type != "path") {return;} return getPointAtLength(this.attrs.path, length); }; elproto.getSubpath = function (from, to) { if (this.type != "path") {return;} return R.getSubpath(this.attrs.path, from, to); }; var ef = R.easing_formulas = { linear: function (n) { return n; }, "<": function (n) { return pow(n, 1.7); }, ">": function (n) { return pow(n, .48); }, "<>": function (n) { var q = .48 - n / 1.04, Q = math.sqrt(.1734 + q * q), x = Q - q, X = pow(abs(x), 1 / 3) * (x < 0 ? -1 : 1), y = -Q - q, Y = pow(abs(y), 1 / 3) * (y < 0 ? -1 : 1), t = X + Y + .5; return (1 - t) * 3 * t * t + t * t * t; }, backIn: function (n) { var s = 1.70158; return n * n * ((s + 1) * n - s); }, backOut: function (n) { n = n - 1; var s = 1.70158; return n * n * ((s + 1) * n + s) + 1; }, elastic: function (n) { if (n == !!n) { return n; } return pow(2, -10 * n) * math.sin((n - .075) * (2 * PI) / .3) + 1; }, bounce: function (n) { var s = 7.5625, p = 2.75, l; if (n < (1 / p)) { l = s * n * n; } else { if (n < (2 / p)) { n -= (1.5 / p); l = s * n * n + .75; } else { if (n < (2.5 / p)) { n -= (2.25 / p); l = s * n * n + .9375; } else { n -= (2.625 / p); l = s * n * n + .984375; } } } return l; } }; ef.easeIn = ef["ease-in"] = ef["<"]; ef.easeOut = ef["ease-out"] = ef[">"]; ef.easeInOut = ef["ease-in-out"] = ef["<>"]; ef["back-in"] = ef.backIn; ef["back-out"] = ef.backOut; var animationElements = [], requestAnimFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (callback) { setTimeout(callback, 16); }, animation = function () { var Now = +new Date, l = 0; for (; l < animationElements.length; l++) { var e = animationElements[l]; if (e.el.removed || e.paused) { continue; } var time = Now - e.start, ms = e.ms, easing = e.easing, from = e.from, diff = e.diff, to = e.to, t = e.t, that = e.el, set = {}, now, init = {}, key; if (e.initstatus) { time = (e.initstatus * e.anim.top - e.prev) / (e.percent - e.prev) * ms; e.status = e.initstatus; delete e.initstatus; e.stop && animationElements.splice(l--, 1); } else { e.status = (e.prev + (e.percent - e.prev) * (time / ms)) / e.anim.top; } if (time < 0) { continue; } if (time < ms) { var pos = easing(time / ms); for (var attr in from) if (from[has](attr)) { switch (availableAnimAttrs[attr]) { case nu: now = +from[attr] + pos * ms * diff[attr]; break; case "colour": now = "rgb(" + [ upto255(round(from[attr].r + pos * ms * diff[attr].r)), upto255(round(from[attr].g + pos * ms * diff[attr].g)), upto255(round(from[attr].b + pos * ms * diff[attr].b)) ].join(",") + ")"; break; case "path": now = []; for (var i = 0, ii = from[attr].length; i < ii; i++) { now[i] = [from[attr][i][0]]; for (var j = 1, jj = from[attr][i].length; j < jj; j++) { now[i][j] = +from[attr][i][j] + pos * ms * diff[attr][i][j]; } now[i] = now[i].join(S); } now = now.join(S); break; case "transform": if (diff[attr].real) { now = []; for (i = 0, ii = from[attr].length; i < ii; i++) { now[i] = [from[attr][i][0]]; for (j = 1, jj = from[attr][i].length; j < jj; j++) { now[i][j] = from[attr][i][j] + pos * ms * diff[attr][i][j]; } } } else { var get = function (i) { return +from[attr][i] + pos * ms * diff[attr][i]; }; // now = [["r", get(2), 0, 0], ["t", get(3), get(4)], ["s", get(0), get(1), 0, 0]]; now = [["m", get(0), get(1), get(2), get(3), get(4), get(5)]]; } break; case "csv": if (attr == "clip-rect") { now = []; i = 4; while (i--) { now[i] = +from[attr][i] + pos * ms * diff[attr][i]; } } break; default: var from2 = [][concat](from[attr]); now = []; i = that.paper.customAttributes[attr].length; while (i--) { now[i] = +from2[i] + pos * ms * diff[attr][i]; } break; } set[attr] = now; } that.attr(set); (function (id, that, anim) { setTimeout(function () { eve("anim.frame." + id, that, anim); }); })(that.id, that, e.anim); } else { (function(f, el, a) { setTimeout(function() { eve("anim.frame." + el.id, el, a); eve("anim.finish." + el.id, el, a); R.is(f, "function") && f.call(el); }); })(e.callback, that, e.anim); that.attr(to); animationElements.splice(l--, 1); if (e.repeat > 1 && !e.next) { for (key in to) if (to[has](key)) { init[key] = e.totalOrigin[key]; } e.el.attr(init); runAnimation(e.anim, e.el, e.anim.percents[0], null, e.totalOrigin, e.repeat - 1); } if (e.next && !e.stop) { runAnimation(e.anim, e.el, e.next, null, e.totalOrigin, e.repeat); } } } R.svg && that && that.paper && that.paper.safari(); animationElements.length && requestAnimFrame(animation); }, upto255 = function (color) { return color > 255 ? 255 : color < 0 ? 0 : color; }; elproto.animateWith = function (element, anim, params, ms, easing, callback) { var a = params ? R.animation(params, ms, easing, callback) : anim, status = element.status(anim); return this.animate(a).status(a, status * anim.ms / a.ms); }; function CubicBezierAtTime(t, p1x, p1y, p2x, p2y, duration) { var cx = 3 * p1x, bx = 3 * (p2x - p1x) - cx, ax = 1 - cx - bx, cy = 3 * p1y, by = 3 * (p2y - p1y) - cy, ay = 1 - cy - by; function sampleCurveX(t) { return ((ax * t + bx) * t + cx) * t; } function solve(x, epsilon) { var t = solveCurveX(x, epsilon); return ((ay * t + by) * t + cy) * t; } function solveCurveX(x, epsilon) { var t0, t1, t2, x2, d2, i; for(t2 = x, i = 0; i < 8; i++) { x2 = sampleCurveX(t2) - x; if (abs(x2) < epsilon) { return t2; } d2 = (3 * ax * t2 + 2 * bx) * t2 + cx; if (abs(d2) < 1e-6) { break; } t2 = t2 - x2 / d2; } t0 = 0; t1 = 1; t2 = x; if (t2 < t0) { return t0; } if (t2 > t1) { return t1; } while (t0 < t1) { x2 = sampleCurveX(t2); if (abs(x2 - x) < epsilon) { return t2; } if (x > x2) { t0 = t2; } else { t1 = t2; } t2 = (t1 - t0) / 2 + t0; } return t2; } return solve(t, 1 / (200 * duration)); } elproto.onAnimation = function (f) { f ? eve.on("anim.frame." + this.id, f) : eve.unbind("anim.frame." + this.id); return this; }; function Animation(anim, ms) { var percents = [], newAnim = {}; this.ms = ms; this.times = 1; if (anim) { for (var attr in anim) if (anim[has](attr)) { newAnim[toFloat(attr)] = anim[attr]; percents.push(toFloat(attr)); } percents.sort(sortByNumber); } this.anim = newAnim; this.top = percents[percents.length - 1]; this.percents = percents; } Animation.prototype.delay = function (delay) { var a = new Animation(this.anim, this.ms); a.times = this.times; a.del = +delay || 0; return a; }; Animation.prototype.repeat = function (times) { var a = new Animation(this.anim, this.ms); a.del = this.del; a.times = math.floor(mmax(times, 0)) || 1; return a; }; function runAnimation(anim, element, percent, status, totalOrigin, times) { percent = toFloat(percent); var params, isInAnim, isInAnimSet, percents = [], next, prev, timestamp, ms = anim.ms, from = {}, to = {}, diff = {}; if (status) { for (i = 0, ii = animationElements.length; i < ii; i++) { var e = animationElements[i]; if (e.el.id == element.id && e.anim == anim) { if (e.percent != percent) { animationElements.splice(i, 1); isInAnimSet = 1; } else { isInAnim = e; } element.attr(e.totalOrigin); break; } } } else { status = +to; // NaN } for (var i = 0, ii = anim.percents.length; i < ii; i++) { if (anim.percents[i] == percent || anim.percents[i] > status * anim.top) { percent = anim.percents[i]; prev = anim.percents[i - 1] || 0; ms = ms / anim.top * (percent - prev); next = anim.percents[i + 1]; params = anim.anim[percent]; break; } else if (status) { element.attr(anim.anim[anim.percents[i]]); } } if (!params) { return; } if (!isInAnim) { for (var attr in params) if (params[has](attr)) { if (availableAnimAttrs[has](attr) || element.paper.customAttributes[has](attr)) { from[attr] = element.attr(attr); (from[attr] == null) && (from[attr] = availableAttrs[attr]); to[attr] = params[attr]; switch (availableAnimAttrs[attr]) { case nu: diff[attr] = (to[attr] - from[attr]) / ms; break; case "colour": from[attr] = R.getRGB(from[attr]); var toColour = R.getRGB(to[attr]); diff[attr] = { r: (toColour.r - from[attr].r) / ms, g: (toColour.g - from[attr].g) / ms, b: (toColour.b - from[attr].b) / ms }; break; case "path": var pathes = path2curve(from[attr], to[attr]), toPath = pathes[1]; from[attr] = pathes[0]; diff[attr] = []; for (i = 0, ii = from[attr].length; i < ii; i++) { diff[attr][i] = [0]; for (var j = 1, jj = from[attr][i].length; j < jj; j++) { diff[attr][i][j] = (toPath[i][j] - from[attr][i][j]) / ms; } } break; case "transform": var _ = element._, eq = equaliseTransform(_[attr], to[attr]); if (eq) { from[attr] = eq.from; to[attr] = eq.to; diff[attr] = []; diff[attr].real = true; for (i = 0, ii = from[attr].length; i < ii; i++) { diff[attr][i] = [from[attr][i][0]]; for (j = 1, jj = from[attr][i].length; j < jj; j++) { diff[attr][i][j] = (to[attr][i][j] - from[attr][i][j]) / ms; } } } else { var m = (element.matrix || new Matrix), to2 = { _: {transform: _.transform}, getBBox: function () { return element.getBBox(1); } }; from[attr] = [ m.a, m.b, m.c, m.d, m.e, m.f ]; extractTransform(to2, to[attr]); to[attr] = to2._.transform; diff[attr] = [ (to2.matrix.a - m.a) / ms, (to2.matrix.b - m.b) / ms, (to2.matrix.c - m.c) / ms, (to2.matrix.d - m.d) / ms, (to2.matrix.e - m.e) / ms, (to2.matrix.e - m.f) / ms ]; // from[attr] = [_.sx, _.sy, _.deg, _.dx, _.dy]; // var to2 = {_:{}, getBBox: function () { return element.getBBox(); }}; // extractTransform(to2, to[attr]); // diff[attr] = [ // (to2._.sx - _.sx) / ms, // (to2._.sy - _.sy) / ms, // (to2._.deg - _.deg) / ms, // (to2._.dx - _.dx) / ms, // (to2._.dy - _.dy) / ms // ]; } break; case "csv": var values = Str(params[attr])[split](separator), from2 = Str(from[attr])[split](separator); if (attr == "clip-rect") { from[attr] = from2; diff[attr] = []; i = from2.length; while (i--) { diff[attr][i] = (values[i] - from[attr][i]) / ms; } } to[attr] = values; break; default: values = [][concat](params[attr]); from2 = [][concat](from[attr]); diff[attr] = []; i = element.paper.customAttributes[attr].length; while (i--) { diff[attr][i] = ((values[i] || 0) - (from2[i] || 0)) / ms; } break; } } } var easing = params.easing, easyeasy = R.easing_formulas[easing]; if (!easyeasy) { easyeasy = Str(easing).match(bezierrg); if (easyeasy && easyeasy.length == 5) { var curve = easyeasy; easyeasy = function (t) { return CubicBezierAtTime(t, +curve[1], +curve[2], +curve[3], +curve[4], ms); }; } else { easyeasy = pipe; } } timestamp = params.start || anim.start || +new Date; e = { anim: anim, percent: percent, timestamp: timestamp, start: timestamp + (anim.del || 0), status: 0, initstatus: status || 0, stop: false, ms: ms, easing: easyeasy, from: from, diff: diff, to: to, el: element, callback: params.callback, prev: prev, next: next, repeat: times || anim.times, origin: element.attr(), totalOrigin: totalOrigin }; animationElements.push(e); if (status && !isInAnim && !isInAnimSet) { e.stop = true; e.start = new Date - ms * status; if (animationElements.length == 1) { return animation(); } } if (isInAnimSet) { e.start = new Date - e.ms * status; } animationElements.length == 1 && requestAnimFrame(animation); } else { isInAnim.initstatus = status; isInAnim.start = new Date - isInAnim.ms * status; } eve("anim.start." + element.id, element, anim); } R.animation = function (params, ms, easing, callback) { if (params instanceof Animation) { return params; } if (R.is(easing, "function") || !easing) { callback = callback || easing || null; easing = null; } params = Object(params); ms = +ms || 0; var p = {}, json, attr; for (attr in params) if (params[has](attr) && toFloat(attr) != attr && toFloat(attr) + "%" != attr) { json = true; p[attr] = params[attr]; } if (!json) { return new Animation(params, ms); } else { easing && (p.easing = easing); callback && (p.callback = callback); return new Animation({100: p}, ms); } }; elproto.animate = function (params, ms, easing, callback) { var element = this; if (element.removed) { callback && callback.call(element); return element; } var anim = params instanceof Animation ? params : R.animation(params, ms, easing, callback); runAnimation(anim, element, anim.percents[0], null, element.attr()); return element; }; elproto.setTime = function (anim, value) { if (anim && value != null) { this.status(anim, mmin(value, anim.ms) / anim.ms); } return this; }; elproto.status = function (anim, value) { var out = [], i = 0, len, e; if (value != null) { runAnimation(anim, this, -1, mmin(value, 1)); return this; } else { len = animationElements.length; for (; i < len; i++) { e = animationElements[i]; if (e.el.id == this.id && (!anim || e.anim == anim)) { if (anim) { return e.status; } out.push({ anim: e.anim, status: e.status }); } } if (anim) { return 0; } return out; } }; elproto.pause = function (anim) { for (var i = 0; i < animationElements.length; i++) if (animationElements[i].el.id == this.id && (!anim || animationElements[i].anim == anim)) { if (eve("anim.pause." + this.id, this, animationElements[i].anim) !== false) { animationElements[i].paused = true; } } return this; }; elproto.resume = function (anim) { for (var i = 0; i < animationElements.length; i++) if (animationElements[i].el.id == this.id && (!anim || animationElements[i].anim == anim)) { var e = animationElements[i]; if (eve("anim.resume." + this.id, this, e.anim) !== false) { delete e.paused; this.status(e.anim, e.status); } } return this; }; elproto.stop = function (anim) { for (var i = 0; i < animationElements.length; i++) if (animationElements[i].el.id == this.id && (!anim || animationElements[i].anim == anim)) { if (eve("anim.stop." + this.id, this, animationElements[i].anim) !== false) { animationElements.splice(i--, 1); } } return this; }; elproto.toString = function () { return "Rapha\xebl\u2019s object"; }; // Set var Set = function (items) { this.items = []; this.length = 0; this.type = "set"; if (items) { for (var i = 0, ii = items.length; i < ii; i++) { if (items[i] && (items[i].constructor == elproto.constructor || items[i].constructor == Set)) { this[this.items.length] = this.items[this.items.length] = items[i]; this.length++; } } } }, setproto = Set.prototype; setproto.push = function () { var item, len; for (var i = 0, ii = arguments.length; i < ii; i++) { item = arguments[i]; if (item && (item.constructor == elproto.constructor || item.constructor == Set)) { len = this.items.length; this[len] = this.items[len] = item; this.length++; } } return this; }; setproto.pop = function () { this.length && delete this[this.length--]; return this.items.pop(); }; setproto.forEach = function (callback, thisArg) { for (var i = 0, ii = this.items.length; i < ii; i++) { if (callback.call(thisArg, this.items[i], i) === false) { return this; } } return this; }; for (var method in elproto) if (elproto[has](method)) { setproto[method] = (function (methodname) { return function () { var arg = arguments; return this.forEach(function (el) { el[methodname][apply](el, arg); }); }; })(method); } setproto.attr = function (name, value) { if (name && R.is(name, array) && R.is(name[0], "object")) { for (var j = 0, jj = name.length; j < jj; j++) { this.items[j].attr(name[j]); } } else { for (var i = 0, ii = this.items.length; i < ii; i++) { this.items[i].attr(name, value); } } return this; }; setproto.clear = function () { while (this.length) { this.pop(); } }; setproto.splice = function (index, count, insertion) { index = index < 0 ? mmax(this.length + index, 0) : index; count = mmax(0, mmin(this.length - index, count)); var tail = [], todel = [], args = [], i; for (i = 2; i < arguments.length; i++) { args.push(arguments[i]); } for (i = 0; i < count; i++) { todel.push(this[index + i]); } for (; i < this.length - index; i++) { tail.push(this[index + i]); } var arglen = args.length; for (i = 0; i < arglen + tail.length; i++) { this.items[index + i] = this[index + i] = i < arglen ? args[i] : tail[i - arglen]; } i = this.items.length = this.length -= count - arglen; while (this[i]) { delete this[i++]; } return new Set(todel); }; setproto.exclude = function (el) { for (var i = 0, ii = this.length; i < ii; i++) if (this[i] == el) { this.splice(i, 1); return true; } }; setproto.animate = function (params, ms, easing, callback) { (R.is(easing, "function") || !easing) && (callback = easing || null); var len = this.items.length, i = len, item, set = this, collector; if (!len) { return this; } callback && (collector = function () { !--len && callback.call(set); }); easing = R.is(easing, string) ? easing : collector; var anim = R.animation(params, ms, easing, collector); item = this.items[--i].animate(anim); while (i--) { this.items[i] && !this.items[i].removed && this.items[i].animateWith(item, anim); } return this; }; setproto.insertAfter = function (el) { var i = this.items.length; while (i--) { this.items[i].insertAfter(el); } return this; }; setproto.getBBox = function () { var x = [], y = [], w = [], h = []; for (var i = this.items.length; i--;) if (!this.items[i].removed) { var box = this.items[i].getBBox(); x.push(box.x); y.push(box.y); w.push(box.x + box.width); h.push(box.y + box.height); } x = mmin[apply](0, x); y = mmin[apply](0, y); return { x: x, y: y, width: mmax[apply](0, w) - x, height: mmax[apply](0, h) - y }; }; setproto.clone = function (s) { s = new Set; for (var i = 0, ii = this.items.length; i < ii; i++) { s.push(this.items[i].clone()); } return s; }; setproto.toString = function () { return "Rapha\xebl\u2018s set"; }; R.registerFont = function (font) { if (!font.face) { return font; } this.fonts = this.fonts || {}; var fontcopy = { w: font.w, face: {}, glyphs: {} }, family = font.face["font-family"]; for (var prop in font.face) if (font.face[has](prop)) { fontcopy.face[prop] = font.face[prop]; } if (this.fonts[family]) { this.fonts[family].push(fontcopy); } else { this.fonts[family] = [fontcopy]; } if (!font.svg) { fontcopy.face["units-per-em"] = toInt(font.face["units-per-em"], 10); for (var glyph in font.glyphs) if (font.glyphs[has](glyph)) { var path = font.glyphs[glyph]; fontcopy.glyphs[glyph] = { w: path.w, k: {}, d: path.d && "M" + path.d.replace(/[mlcxtrv]/g, function (command) { return {l: "L", c: "C", x: "z", t: "m", r: "l", v: "c"}[command] || "M"; }) + "z" }; if (path.k) { for (var k in path.k) if (path[has](k)) { fontcopy.glyphs[glyph].k[k] = path.k[k]; } } } } return font; }; paperproto.getFont = function (family, weight, style, stretch) { stretch = stretch || "normal"; style = style || "normal"; weight = +weight || {normal: 400, bold: 700, lighter: 300, bolder: 800}[weight] || 400; if (!R.fonts) { return; } var font = R.fonts[family]; if (!font) { var name = new RegExp("(^|\\s)" + family.replace(/[^\w\d\s+!~.:_-]/g, E) + "(\\s|$)", "i"); for (var fontName in R.fonts) if (R.fonts[has](fontName)) { if (name.test(fontName)) { font = R.fonts[fontName]; break; } } } var thefont; if (font) { for (var i = 0, ii = font.length; i < ii; i++) { thefont = font[i]; if (thefont.face["font-weight"] == weight && (thefont.face["font-style"] == style || !thefont.face["font-style"]) && thefont.face["font-stretch"] == stretch) { break; } } } return thefont; }; paperproto.print = function (x, y, string, font, size, origin, letter_spacing) { origin = origin || "middle"; // baseline|middle letter_spacing = mmax(mmin(letter_spacing || 0, 1), -1); var out = this.set(), letters = Str(string)[split](E), shift = 0, path = E, scale; R.is(font, string) && (font = this.getFont(font)); if (font) { scale = (size || 16) / font.face["units-per-em"]; var bb = font.face.bbox[split](separator), top = +bb[0], height = +bb[1] + (origin == "baseline" ? bb[3] - bb[1] + (+font.face.descent) : (bb[3] - bb[1]) / 2); for (var i = 0, ii = letters.length; i < ii; i++) { var prev = i && font.glyphs[letters[i - 1]] || {}, curr = font.glyphs[letters[i]]; shift += i ? (prev.w || font.w) + (prev.k && prev.k[letters[i]] || 0) + (font.w * letter_spacing) : 0; curr && curr.d && out.push(this.path(curr.d).attr({ fill: "#000", stroke: "none", transform: [["t", shift * scale, 0]] })); } out.transform(["...s", scale, scale, top, height, "t", (x - top) / scale, (y - height) / scale]); } return out; }; paperproto.add = function (json) { if (R.is(json, "array")) { var res = this.set(), i = 0, ii = json.length, j; for (; i < ii; i++) { j = json[i] || {}; elements[has](j.type) && res.push(this[j.type]().attr(j)); } } return res; }; R.format = function (token, params) { var args = R.is(params, array) ? [0][concat](params) : arguments; token && R.is(token, string) && args.length - 1 && (token = token.replace(formatrg, function (str, i) { return args[++i] == null ? E : args[i]; })); return token || E; }; R.fullfill = (function () { var tokenRegex = /\{([^\}]+)\}/g, objNotationRegex = /(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g, // matches .xxxxx or ["xxxxx"] to run over object properties replacer = function (all, key, obj) { var res = obj; key.replace(objNotationRegex, function (all, name, quote, quotedName, isFunc) { name = name || quotedName; if (res) { if (name in res) { res = res[name]; } typeof res == "function" && isFunc && (res = res()); } }); res = (res == null || res == obj ? all : res) + ""; return res; }; return function (str, obj) { return String(str).replace(tokenRegex, function (all, key) { return replacer(all, key, obj); }); }; })(); R.ninja = function () { oldRaphael.was ? (g.win.Raphael = oldRaphael.is) : delete Raphael; return R; }; R.st = setproto; // Firefox <3.6 fix: http://webreflection.blogspot.com/2009/11/195-chars-to-help-lazy-loading.html (function (doc, loaded, f) { if (doc.readyState == null && doc.addEventListener){ doc.addEventListener(loaded, f = function () { doc.removeEventListener(loaded, f, false); doc.readyState = "complete"; }, false); doc.readyState = "loading"; } function isLoaded() { (/in/).test(doc.readyState) ? setTimeout(isLoaded, 9) : R.eve("DOMload"); } isLoaded(); })(document, "DOMContentLoaded"); oldRaphael.was ? (g.win.Raphael = R) : (Raphael = R); eve.on("DOMload", function () { loaded = true; }); })(); // ┌─────────────────────────────────────────────────────────────────────┐ \\ // │ Raphaël - JavaScript Vector Library │ \\ // ├─────────────────────────────────────────────────────────────────────┤ \\ // │ SVG Module │ \\ // ├─────────────────────────────────────────────────────────────────────┤ \\ // │ Copyright (c) 2008-2011 Dmitry Baranovskiy (http://raphaeljs.com) │ \\ // │ Copyright (c) 2008-2011 Sencha Labs (http://sencha.com) │ \\ // │ Licensed under the MIT (http://raphaeljs.com/license.html) license. │ \\ // └─────────────────────────────────────────────────────────────────────┘ \\ window.Raphael.svg && function (R) { var has = "hasOwnProperty", Str = String, toFloat = parseFloat, toInt = parseInt, math = Math, mmax = math.max, abs = math.abs, pow = math.pow, separator = /[, ]+/, eve = R.eve, E = "", S = " "; var xlink = "http://www.w3.org/1999/xlink", markers = { block: "M5,0 0,2.5 5,5z", classic: "M5,0 0,2.5 5,5 3.5,3 3.5,2z", diamond: "M2.5,0 5,2.5 2.5,5 0,2.5z", open: "M6,1 1,3.5 6,6", oval: "M2.5,0A2.5,2.5,0,0,1,2.5,5 2.5,2.5,0,0,1,2.5,0z" }, markerCounter = {}; R.toString = function () { return "Your browser supports SVG.\nYou are running Rapha\xebl " + this.version; }; var $ = function (el, attr) { if (attr) { if (typeof el == "string") { el = $(el); } for (var key in attr) if (attr[has](key)) { if (key.substring(0, 6) == "xlink:") { el.setAttributeNS(xlink, key.substring(6), Str(attr[key])); } else { el.setAttribute(key, Str(attr[key])); } } } else { el = R._g.doc.createElementNS("http://www.w3.org/2000/svg", el); el.style && (el.style.webkitTapHighlightColor = "rgba(0,0,0,0)"); } return el; }, addGradientFill = function (element, gradient) { var type = "linear", id = element.id + gradient, fx = .5, fy = .5, o = element.node, SVG = element.paper, s = o.style, el = R._g.doc.getElementById(id); if (!el) { gradient = Str(gradient).replace(R._radial_gradient, function (all, _fx, _fy) { type = "radial"; if (_fx && _fy) { fx = toFloat(_fx); fy = toFloat(_fy); var dir = ((fy > .5) * 2 - 1); pow(fx - .5, 2) + pow(fy - .5, 2) > .25 && (fy = math.sqrt(.25 - pow(fx - .5, 2)) * dir + .5) && fy != .5 && (fy = fy.toFixed(5) - 1e-5 * dir); } return E; }); gradient = gradient.split(/\s*\-\s*/); if (type == "linear") { var angle = gradient.shift(); angle = -toFloat(angle); if (isNaN(angle)) { return null; } var vector = [0, 0, math.cos(R.rad(angle)), math.sin(R.rad(angle))], max = 1 / (mmax(abs(vector[2]), abs(vector[3])) || 1); vector[2] *= max; vector[3] *= max; if (vector[2] < 0) { vector[0] = -vector[2]; vector[2] = 0; } if (vector[3] < 0) { vector[1] = -vector[3]; vector[3] = 0; } } var dots = R._parseDots(gradient); if (!dots) { return null; } id = id.replace(/[\(\)\s,\xb0#]/g, "_"); if (element.gradient && id != element.gradient.id) { SVG.defs.removeChild(element.gradient); delete element.gradient; } if (!element.gradient) { el = $(type + "Gradient", {id: id}); element.gradient = el; $(el, type == "radial" ? { fx: fx, fy: fy } : { x1: vector[0], y1: vector[1], x2: vector[2], y2: vector[3], gradientTransform: element.matrix.invert() }); SVG.defs.appendChild(el); for (var i = 0, ii = dots.length; i < ii; i++) { el.appendChild($("stop", { offset: dots[i].offset ? dots[i].offset : i ? "100%" : "0%", "stop-color": dots[i].color || "#fff" })); } } } $(o, { fill: "url(#" + id + ")", opacity: 1, "fill-opacity": 1 }); s.fill = E; s.opacity = 1; s.fillOpacity = 1; return 1; }, updatePosition = function (o) { var bbox = o.getBBox(1); $(o.pattern, {patternTransform: o.matrix.invert() + " translate(" + bbox.x + "," + bbox.y + ")"}); }, addArrow = function (o, value, isEnd) { if (o.type == "path") { var values = Str(value).toLowerCase().split("-"), p = o.paper, se = isEnd ? "end" : "start", node = o.node, attrs = o.attrs, stroke = attrs["stroke-width"], i = values.length, type = "classic", from, to, dx, refX, attr, w = 3, h = 3, t = 5; while (i--) { switch (values[i]) { case "block": case "classic": case "oval": case "diamond": case "open": case "none": type = values[i]; break; case "wide": h = 5; break; case "narrow": h = 2; break; case "long": w = 5; break; case "short": w = 2; break; } } if (type == "open") { w += 2; h += 2; t += 2; dx = 1; refX = isEnd ? 4 : 1; attr = { fill: "none", stroke: attrs.stroke }; } else { refX = dx = w / 2; attr = { fill: attrs.stroke, stroke: "none" }; } if (o._.arrows) { if (isEnd) { o._.arrows.endPath && markerCounter[o._.arrows.endPath]--; o._.arrows.endMarker && markerCounter[o._.arrows.endMarker]--; } else { o._.arrows.startPath && markerCounter[o._.arrows.startPath]--; o._.arrows.startMarker && markerCounter[o._.arrows.startMarker]--; } } else { o._.arrows = {}; } if (type != "none") { var pathId = "raphael-marker-" + type, markerId = "raphael-marker-" + se + type + w + h; if (!R._g.doc.getElementById(pathId)) { p.defs.appendChild($($("path"), { "stroke-linecap": "round", d: markers[type], id: pathId })); markerCounter[pathId] = 1; } else { markerCounter[pathId]++; } var marker = R._g.doc.getElementById(markerId), use; if (!marker) { marker = $($("marker"), { id: markerId, markerHeight: h, markerWidth: w, orient: "auto", refX: refX, refY: h / 2 }); use = $($("use"), { "xlink:href": "#" + pathId, transform: (isEnd ? " rotate(180 " + w / 2 + " " + h / 2 + ") " : S) + "scale(" + w / t + "," + h / t + ")", "stroke-width": 1 / ((w / t + h / t) / 2) }); marker.appendChild(use); p.defs.appendChild(marker); markerCounter[markerId] = 1; } else { markerCounter[markerId]++; use = marker.getElementsByTagName("use")[0]; } $(use, attr); var delta = dx * (type != "diamond" && type != "oval"); if (isEnd) { from = o._.arrows.startdx * stroke || 0; to = R.getTotalLength(attrs.path) - delta * stroke; } else { from = delta * stroke; to = R.getTotalLength(attrs.path) - (o._.arrows.enddx * stroke || 0); } attr = {}; attr["marker-" + se] = "url(#" + markerId + ")"; if (to || from) { attr.d = Raphael.getSubpath(attrs.path, from, to); } $(node, attr); o._.arrows[se + "Path"] = pathId; o._.arrows[se + "Marker"] = markerId; o._.arrows[se + "dx"] = delta; o._.arrows[se + "Type"] = type; o._.arrows[se + "String"] = value; } else { if (isEnd) { from = o._.arrows.startdx * stroke || 0; to = R.getTotalLength(attrs.path) - from; } else { from = 0; to = R.getTotalLength(attrs.path) - (o._.arrows.enddx * stroke || 0); } o._.arrows[se + "Path"] && $(node, {d: Raphael.getSubpath(attrs.path, from, to)}); delete o._.arrows[se + "Path"]; delete o._.arrows[se + "Marker"]; delete o._.arrows[se + "dx"]; delete o._.arrows[se + "Type"]; delete o._.arrows[se + "String"]; } for (attr in markerCounter) if (markerCounter[has](attr) && !markerCounter[attr]) { var item = R._g.doc.getElementById(attr); item && item.parentNode.removeChild(item); } } }, dasharray = { "": [0], "none": [0], "-": [3, 1], ".": [1, 1], "-.": [3, 1, 1, 1], "-..": [3, 1, 1, 1, 1, 1], ". ": [1, 3], "- ": [4, 3], "--": [8, 3], "- .": [4, 3, 1, 3], "--.": [8, 3, 1, 3], "--..": [8, 3, 1, 3, 1, 3] }, addDashes = function (o, value, params) { value = dasharray[Str(value).toLowerCase()]; if (value) { var width = o.attrs["stroke-width"] || "1", butt = {round: width, square: width, butt: 0}[o.attrs["stroke-linecap"] || params["stroke-linecap"]] || 0, dashes = [], i = value.length; while (i--) { dashes[i] = value[i] * width + ((i % 2) ? 1 : -1) * butt; } $(o.node, {"stroke-dasharray": dashes.join(",")}); } }, setFillAndStroke = function (o, params) { var node = o.node, attrs = o.attrs, vis = node.style.visibility; node.style.visibility = "hidden"; for (var att in params) { if (params[has](att)) { if (!R._availableAttrs[has](att)) { continue; } var value = params[att]; attrs[att] = value; switch (att) { case "blur": o.blur(value); break; case "href": case "title": case "target": var pn = node.parentNode; if (pn.tagName.toLowerCase() != "a") { var hl = $("a"); pn.insertBefore(hl, node); hl.appendChild(node); pn = hl; } if (att == "target" && value == "blank") { pn.setAttributeNS(xlink, "show", "new"); } else { pn.setAttributeNS(xlink, att, value); } break; case "cursor": node.style.cursor = value; break; case "transform": o.transform(value); break; case "arrow-start": addArrow(o, value); break; case "arrow-end": addArrow(o, value, 1); break; case "clip-rect": var rect = Str(value).split(separator); if (rect.length == 4) { o.clip && o.clip.parentNode.parentNode.removeChild(o.clip.parentNode); var el = $("clipPath"), rc = $("rect"); el.id = R.createUUID(); $(rc, { x: rect[0], y: rect[1], width: rect[2], height: rect[3] }); el.appendChild(rc); o.paper.defs.appendChild(el); $(node, {"clip-path": "url(#" + el.id + ")"}); o.clip = rc; } if (!value) { var path = node.getAttribute("clip-path"); if (path) { var clip = R._g.doc.getElementById(path.replace(/(^url\(#|\)$)/g, E)); clip && clip.parentNode.removeChild(clip); $(node, {"clip-path": E}); delete o.clip; } } break; case "path": if (o.type == "path") { $(node, {d: value ? attrs.path = R._pathToAbsolute(value) : "M0,0"}); o._.dirty = 1; if (o._.arrows) { "startString" in o._.arrows && addArrow(o, o._.arrows.startString); "endString" in o._.arrows && addArrow(o, o._.arrows.endString, 1); } } break; case "width": node.setAttribute(att, value); o._.dirty = 1; if (attrs.fx) { att = "x"; value = attrs.x; } else { break; } case "x": if (attrs.fx) { value = -attrs.x - (attrs.width || 0); } case "rx": if (att == "rx" && o.type == "rect") { break; } case "cx": node.setAttribute(att, value); o.pattern && updatePosition(o); o._.dirty = 1; break; case "height": node.setAttribute(att, value); o._.dirty = 1; if (attrs.fy) { att = "y"; value = attrs.y; } else { break; } case "y": if (attrs.fy) { value = -attrs.y - (attrs.height || 0); } case "ry": if (att == "ry" && o.type == "rect") { break; } case "cy": node.setAttribute(att, value); o.pattern && updatePosition(o); o._.dirty = 1; break; case "r": if (o.type == "rect") { $(node, {rx: value, ry: value}); } else { node.setAttribute(att, value); } o._.dirty = 1; break; case "src": if (o.type == "image") { node.setAttributeNS(xlink, "href", value); } break; case "stroke-width": if (o._.sx != 1 || o._.sy != 1) { value /= mmax(abs(o._.sx), abs(o._.sy)) || 1; } if (o.paper._vbSize) { value *= o.paper._vbSize; } node.setAttribute(att, value); if (attrs["stroke-dasharray"]) { addDashes(o, attrs["stroke-dasharray"], params); } if (o._.arrows) { "startString" in o._.arrows && addArrow(o, o._.arrows.startString); "endString" in o._.arrows && addArrow(o, o._.arrows.endString, 1); } break; case "stroke-dasharray": addDashes(o, value, params); break; case "fill": var isURL = Str(value).match(R._ISURL); if (isURL) { el = $("pattern"); var ig = $("image"); el.id = R.createUUID(); $(el, {x: 0, y: 0, patternUnits: "userSpaceOnUse", height: 1, width: 1}); $(ig, {x: 0, y: 0, "xlink:href": isURL[1]}); el.appendChild(ig); (function (el) { R._preload(isURL[1], function () { var w = this.offsetWidth, h = this.offsetHeight; $(el, {width: w, height: h}); $(ig, {width: w, height: h}); o.paper.safari(); }); })(el); o.paper.defs.appendChild(el); node.style.fill = "url(#" + el.id + ")"; $(node, {fill: "url(#" + el.id + ")"}); o.pattern = el; o.pattern && updatePosition(o); break; } var clr = R.getRGB(value); if (!clr.error) { delete params.gradient; delete attrs.gradient; !R.is(attrs.opacity, "undefined") && R.is(params.opacity, "undefined") && $(node, {opacity: attrs.opacity}); !R.is(attrs["fill-opacity"], "undefined") && R.is(params["fill-opacity"], "undefined") && $(node, {"fill-opacity": attrs["fill-opacity"]}); } else if ((o.type == "circle" || o.type == "ellipse" || Str(value).charAt() != "r") && addGradientFill(o, value)) { if ("opacity" in attrs || "fill-opacity" in attrs) { var gradient = R._g.doc.getElementById(node.getAttribute("fill").replace(/^url\(#|\)$/g, E)); if (gradient) { var stops = gradient.getElementsByTagName("stop"); $(stops[stops.length - 1], {"stop-opacity": ("opacity" in attrs ? attrs.opacity : 1) * ("fill-opacity" in attrs ? attrs["fill-opacity"] : 1)}); } } attrs.gradient = value; attrs.fill = "none"; break; } clr[has]("opacity") && $(node, {"fill-opacity": clr.opacity > 1 ? clr.opacity / 100 : clr.opacity}); case "stroke": clr = R.getRGB(value); node.setAttribute(att, clr.hex); att == "stroke" && clr[has]("opacity") && $(node, {"stroke-opacity": clr.opacity > 1 ? clr.opacity / 100 : clr.opacity}); if (att == "stroke" && o._.arrows) { "startString" in o._.arrows && addArrow(o, o._.arrows.startString); "endString" in o._.arrows && addArrow(o, o._.arrows.endString, 1); } break; case "gradient": (o.type == "circle" || o.type == "ellipse" || Str(value).charAt() != "r") && addGradientFill(o, value); break; case "opacity": if (attrs.gradient && !attrs[has]("stroke-opacity")) { $(node, {"stroke-opacity": value > 1 ? value / 100 : value}); } // fall case "fill-opacity": if (attrs.gradient) { gradient = R._g.doc.getElementById(node.getAttribute("fill").replace(/^url\(#|\)$/g, E)); if (gradient) { stops = gradient.getElementsByTagName("stop"); $(stops[stops.length - 1], {"stop-opacity": value}); } break; } default: att == "font-size" && (value = toInt(value, 10) + "px"); var cssrule = att.replace(/(\-.)/g, function (w) { return w.substring(1).toUpperCase(); }); node.style[cssrule] = value; o._.dirty = 1; node.setAttribute(att, value); break; } } } tuneText(o, params); node.style.visibility = vis; }, leading = 1.2, tuneText = function (el, params) { if (el.type != "text" || !(params[has]("text") || params[has]("font") || params[has]("font-size") || params[has]("x") || params[has]("y"))) { return; } var a = el.attrs, node = el.node, fontSize = node.firstChild ? toInt(R._g.doc.defaultView.getComputedStyle(node.firstChild, E).getPropertyValue("font-size"), 10) : 10; if (params[has]("text")) { a.text = params.text; while (node.firstChild) { node.removeChild(node.firstChild); } var texts = Str(params.text).split("\n"), tspans = [], tspan; for (var i = 0, ii = texts.length; i < ii; i++) { tspan = $("tspan"); i && $(tspan, {dy: fontSize * leading, x: a.x}); tspan.appendChild(R._g.doc.createTextNode(texts[i])); node.appendChild(tspan); tspans[i] = tspan; } } else { tspans = node.getElementsByTagName("tspan"); for (i = 0, ii = tspans.length; i < ii; i++) if (i) { $(tspans[i], {dy: fontSize * leading, x: a.x}); } else { $(tspans[0], {dy: 0}); } } $(node, {x: a.x, y: a.y}); el._.dirty = 1; var bb = el._getBBox(), dif = a.y - (bb.y + bb.height / 2); dif && R.is(dif, "finite") && $(tspans[0], {dy: dif}); }, Element = function (node, svg) { var X = 0, Y = 0; this[0] = this.node = node; node.raphael = true; this.id = R._oid++; node.raphaelid = this.id; this.matrix = R.matrix(); this.realPath = null; this.paper = svg; this.attrs = this.attrs || {}; this._ = { transform: [], sx: 1, sy: 1, deg: 0, dx: 0, dy: 0, dirty: 1 }; !svg.bottom && (svg.bottom = this); this.prev = svg.top; svg.top && (svg.top.next = this); svg.top = this; this.next = null; }, elproto = R.el; Element.prototype = elproto; elproto.constructor = Element; R._engine.path = function (pathString, SVG) { var el = $("path"); SVG.canvas && SVG.canvas.appendChild(el); var p = new Element(el, SVG); p.type = "path"; setFillAndStroke(p, { fill: "none", stroke: "#000", path: pathString }); return p; }; elproto.rotate = function (deg, cx, cy) { if (this.removed) { return this; } deg = Str(deg).split(separator); if (deg.length - 1) { cx = toFloat(deg[1]); cy = toFloat(deg[2]); } deg = toFloat(deg[0]); (cy == null) && (cx = cy); if (cx == null || cy == null) { var bbox = this.getBBox(1); cx = bbox.x + bbox.width / 2; cy = bbox.y + bbox.height / 2; } this.transform(this._.transform.concat([["r", deg, cx, cy]])); return this; }; elproto.scale = function (sx, sy, cx, cy) { if (this.removed) { return this; } sx = Str(sx).split(separator); if (sx.length - 1) { sy = toFloat(sx[1]); cx = toFloat(sx[2]); cy = toFloat(sx[3]); } sx = toFloat(sx[0]); (sy == null) && (sy = sx); (cy == null) && (cx = cy); if (cx == null || cy == null) { var bbox = this.getBBox(1); } cx = cx == null ? bbox.x + bbox.width / 2 : cx; cy = cy == null ? bbox.y + bbox.height / 2 : cy; this.transform(this._.transform.concat([["s", sx, sy, cx, cy]])); return this; }; elproto.translate = function (dx, dy) { if (this.removed) { return this; } dx = Str(dx).split(separator); if (dx.length - 1) { dy = toFloat(dx[1]); } dx = toFloat(dx[0]) || 0; dy = +dy || 0; this.transform(this._.transform.concat([["t", dx, dy]])); return this; }; elproto.transform = function (tstr) { var _ = this._; if (tstr == null) { return _.transform; } R._extractTransform(this, tstr); this.clip && $(this.clip, {transform: this.matrix.invert()}); this.pattern && updatePosition(this); this.node && $(this.node, {transform: this.matrix}); if (_.sx != 1 || _.sy != 1) { var sw = this.attrs[has]("stroke-width") ? this.attrs["stroke-width"] : 1; this.attr({"stroke-width": sw}); } return this; }; elproto.hide = function () { !this.removed && this.paper.safari(this.node.style.display = "none"); return this; }; elproto.show = function () { !this.removed && this.paper.safari(this.node.style.display = ""); return this; }; elproto.remove = function () { if (this.removed) { return; } var paper = this.paper; paper.__set__ && paper.__set__.exclude(this); eve.unbind("*.*." + this.id); if (this.gradient) { paper.defs.removeChild(this.gradient); } R._tear(this, paper); this.node.parentNode.removeChild(this.node); for (var i in this) { this[i] = typeof this[i] == "function" ? R._removedFactory(i) : null; } this.removed = true; }; elproto._getBBox = function () { if (this.node.style.display == "none") { this.show(); var hide = true; } var bbox = {}; try { bbox = this.node.getBBox(); } catch(e) { // Firefox 3.0.x plays badly here } finally { bbox = bbox || {}; } hide && this.hide(); return bbox; }; elproto.attr = function (name, value) { if (this.removed) { return this; } if (name == null) { var res = {}; for (var a in this.attrs) if (this.attrs[has](a)) { res[a] = this.attrs[a]; } res.gradient && res.fill == "none" && (res.fill = res.gradient) && delete res.gradient; res.transform = this._.transform; return res; } if (value == null && R.is(name, "string")) { if (name == "fill" && this.attrs.fill == "none" && this.attrs.gradient) { return this.attrs.gradient; } if (name == "transform") { return this._.transform; } var names = name.split(separator), out = {}; for (var i = 0, ii = names.length; i < ii; i++) { name = names[i]; if (name in this.attrs) { out[name] = this.attrs[name]; } else if (R.is(this.paper.customAttributes[name], "function")) { out[name] = this.paper.customAttributes[name].def; } else { out[name] = R._availableAttrs[name]; } } return ii - 1 ? out : out[names[0]]; } if (value == null && R.is(name, "array")) { out = {}; for (i = 0, ii = name.length; i < ii; i++) { out[name[i]] = this.attr(name[i]); } return out; } if (value != null) { var params = {}; params[name] = value; } else if (name != null && R.is(name, "object")) { params = name; } for (var key in params) { eve("attr." + key + "." + this.id, this, params[key]); } for (key in this.paper.customAttributes) if (this.paper.customAttributes[has](key) && params[has](key) && R.is(this.paper.customAttributes[key], "function")) { var par = this.paper.customAttributes[key].apply(this, [].concat(params[key])); this.attrs[key] = params[key]; for (var subkey in par) if (par[has](subkey)) { params[subkey] = par[subkey]; } } setFillAndStroke(this, params); return this; }; elproto.toFront = function () { if (this.removed) { return this; } if (this.node.parentNode.tagName.toLowerCase() == "a") { this.node.parentNode.parentNode.appendChild(this.node.parentNode); } else { this.node.parentNode.appendChild(this.node); } var svg = this.paper; svg.top != this && R._tofront(this, svg); return this; }; elproto.toBack = function () { if (this.removed) { return this; } var parent = this.node.parentNode; if (parent.tagName.toLowerCase() == "a") { parent.parentNode.insertBefore(this.node.parentNode, this.node.parentNode.parentNode.firstChild); } else if (parent.firstChild != this.node) { parent.insertBefore(this.node, this.node.parentNode.firstChild); } R._toback(this, this.paper); var svg = this.paper; return this; }; elproto.insertAfter = function (element) { if (this.removed) { return this; } var node = element.node || element[element.length - 1].node; if (node.nextSibling) { node.parentNode.insertBefore(this.node, node.nextSibling); } else { node.parentNode.appendChild(this.node); } R._insertafter(this, element, this.paper); return this; }; elproto.insertBefore = function (element) { if (this.removed) { return this; } var node = element.node || element[0].node; node.parentNode.insertBefore(this.node, node); R._insertbefore(this, element, this.paper); return this; }; elproto.blur = function (size) { // Experimental. No Safari support. Use it on your own risk. var t = this; if (+size !== 0) { var fltr = $("filter"), blur = $("feGaussianBlur"); t.attrs.blur = size; fltr.id = R.createUUID(); $(blur, {stdDeviation: +size || 1.5}); fltr.appendChild(blur); t.paper.defs.appendChild(fltr); t._blur = fltr; $(t.node, {filter: "url(#" + fltr.id + ")"}); } else { if (t._blur) { t._blur.parentNode.removeChild(t._blur); delete t._blur; delete t.attrs.blur; } t.node.removeAttribute("filter"); } }; R._engine.circle = function (svg, x, y, r) { var el = $("circle"); svg.canvas && svg.canvas.appendChild(el); var res = new Element(el, svg); res.attrs = {cx: x, cy: y, r: r, fill: "none", stroke: "#000"}; res.type = "circle"; $(el, res.attrs); return res; }; R._engine.rect = function (svg, x, y, w, h, r) { var el = $("rect"); svg.canvas && svg.canvas.appendChild(el); var res = new Element(el, svg); res.attrs = {x: x, y: y, width: w, height: h, r: r || 0, rx: r || 0, ry: r || 0, fill: "none", stroke: "#000"}; res.type = "rect"; $(el, res.attrs); return res; }; R._engine.ellipse = function (svg, x, y, rx, ry) { var el = $("ellipse"); svg.canvas && svg.canvas.appendChild(el); var res = new Element(el, svg); res.attrs = {cx: x, cy: y, rx: rx, ry: ry, fill: "none", stroke: "#000"}; res.type = "ellipse"; $(el, res.attrs); return res; }; R._engine.image = function (svg, src, x, y, w, h) { var el = $("image"); $(el, {x: x, y: y, width: w, height: h, preserveAspectRatio: "none"}); el.setAttributeNS(xlink, "href", src); svg.canvas && svg.canvas.appendChild(el); var res = new Element(el, svg); res.attrs = {x: x, y: y, width: w, height: h, src: src}; res.type = "image"; return res; }; R._engine.text = function (svg, x, y, text) { var el = $("text"); // $(el, {x: x, y: y, "text-anchor": "middle"}); svg.canvas && svg.canvas.appendChild(el); var res = new Element(el, svg); res.attrs = { x: x, y: y, "text-anchor": "middle", text: text, font: R._availableAttrs.font, stroke: "none", fill: "#000" }; res.type = "text"; setFillAndStroke(res, res.attrs); return res; }; R._engine.setSize = function (width, height) { this.width = width || this.width; this.height = height || this.height; this.canvas.setAttribute("width", this.width); this.canvas.setAttribute("height", this.height); if (this._viewBox) { this.setViewBox.apply(this, this._viewBox); } return this; }; R._engine.create = function () { var con = R._getContainer.apply(0, arguments), container = con && con.container, x = con.x, y = con.y, width = con.width, height = con.height; if (!container) { throw new Error("SVG container not found."); } var cnvs = $("svg"), css = "overflow:hidden;", isFloating; x = x || 0; y = y || 0; width = width || 512; height = height || 342; $(cnvs, { height: height, version: 1.1, width: width, xmlns: "http://www.w3.org/2000/svg" }); if (container == 1) { cnvs.style.cssText = css + "position:absolute;left:" + x + "px;top:" + y + "px"; R._g.doc.body.appendChild(cnvs); isFloating = 1; } else { cnvs.style.cssText = css + "position:relative"; if (container.firstChild) { container.insertBefore(cnvs, container.firstChild); } else { container.appendChild(cnvs); } } container = new R._Paper; container.width = width; container.height = height; container.canvas = cnvs; // plugins.call(container, container, R.fn); container.clear(); container._left = container._top = 0; isFloating && (container.renderfix = function () {}); container.renderfix(); return container; }; R._engine.setViewBox = function (x, y, w, h, fit) { eve("setViewBox", this, this._viewBox, [x, y, w, h, fit]); var size = mmax(w / this.width, h / this.height), top = this.top, aspectRatio = fit ? "meet" : "xMinYMin", vb, sw; if (x == null) { if (this._vbSize) { size = 1; } delete this._vbSize; vb = "0 0 " + this.width + S + this.height; } else { this._vbSize = size; vb = x + S + y + S + w + S + h; } $(this.canvas, { viewBox: vb, preserveAspectRatio: aspectRatio }); while (size && top) { sw = "stroke-width" in top.attrs ? top.attrs["stroke-width"] : 1; top.attr({"stroke-width": sw}); top._.dirty = 1; top._.dirtyT = 1; top = top.prev; } this._viewBox = [x, y, w, h, !!fit]; return this; }; R.prototype.renderfix = function () { var cnvs = this.canvas, s = cnvs.style, pos = cnvs.getScreenCTM() || cnvs.createSVGMatrix(), left = -pos.e % 1, top = -pos.f % 1; if (left || top) { if (left) { this._left = (this._left + left) % 1; s.left = this._left + "px"; } if (top) { this._top = (this._top + top) % 1; s.top = this._top + "px"; } } }; R.prototype.clear = function () { R.eve("clear", this); var c = this.canvas; while (c.firstChild) { c.removeChild(c.firstChild); } this.bottom = this.top = null; (this.desc = $("desc")).appendChild(R._g.doc.createTextNode("Created with Rapha\xebl " + R.version)); c.appendChild(this.desc); c.appendChild(this.defs = $("defs")); }; R.prototype.remove = function () { eve("remove", this); this.canvas.parentNode && this.canvas.parentNode.removeChild(this.canvas); for (var i in this) { this[i] = typeof this[i] == "function" ? R._removedFactory(i) : null; } }; var setproto = R.st; for (var method in elproto) if (elproto[has](method) && !setproto[has](method)) { setproto[method] = (function (methodname) { return function () { var arg = arguments; return this.forEach(function (el) { el[methodname].apply(el, arg); }); }; })(method); } }(window.Raphael); // ┌─────────────────────────────────────────────────────────────────────┐ \\ // │ Raphaël - JavaScript Vector Library │ \\ // ├─────────────────────────────────────────────────────────────────────┤ \\ // │ VML Module │ \\ // ├─────────────────────────────────────────────────────────────────────┤ \\ // │ Copyright (c) 2008-2011 Dmitry Baranovskiy (http://raphaeljs.com) │ \\ // │ Copyright (c) 2008-2011 Sencha Labs (http://sencha.com) │ \\ // │ Licensed under the MIT (http://raphaeljs.com/license.html) license. │ \\ // └─────────────────────────────────────────────────────────────────────┘ \\ window.Raphael.vml && function (R) { var has = "hasOwnProperty", Str = String, toFloat = parseFloat, math = Math, round = math.round, mmax = math.max, mmin = math.min, abs = math.abs, fillString = "fill", separator = /[, ]+/, eve = R.eve, ms = " progid:DXImageTransform.Microsoft", S = " ", E = "", map = {M: "m", L: "l", C: "c", Z: "x", m: "t", l: "r", c: "v", z: "x"}, bites = /([clmz]),?([^clmz]*)/gi, blurregexp = / progid:\S+Blur\([^\)]+\)/g, val = /-?[^,\s-]+/g, cssDot = "position:absolute;left:0;top:0;width:1px;height:1px", zoom = 21600, pathTypes = {path: 1, rect: 1, image: 1}, ovalTypes = {circle: 1, ellipse: 1}, path2vml = function (path) { var total = /[ahqstv]/ig, command = R._pathToAbsolute; Str(path).match(total) && (command = R._path2curve); total = /[clmz]/g; if (command == R._pathToAbsolute && !Str(path).match(total)) { var res = Str(path).replace(bites, function (all, command, args) { var vals = [], isMove = command.toLowerCase() == "m", res = map[command]; args.replace(val, function (value) { if (isMove && vals.length == 2) { res += vals + map[command == "m" ? "l" : "L"]; vals = []; } vals.push(round(value * zoom)); }); return res + vals; }); return res; } var pa = command(path), p, r; res = []; for (var i = 0, ii = pa.length; i < ii; i++) { p = pa[i]; r = pa[i][0].toLowerCase(); r == "z" && (r = "x"); for (var j = 1, jj = p.length; j < jj; j++) { r += round(p[j] * zoom) + (j != jj - 1 ? "," : E); } res.push(r); } return res.join(S); }, compensation = function (deg, dx, dy) { var m = R.matrix(); m.rotate(-deg, .5, .5); return { dx: m.x(dx, dy), dy: m.y(dx, dy) }; }, setCoords = function (p, sx, sy, dx, dy, deg) { var _ = p._, m = p.matrix, fillpos = _.fillpos, o = p.node, s = o.style, y = 1, flip = "", dxdy, kx = zoom / sx, ky = zoom / sy; s.visibility = "hidden"; if (!sx || !sy) { return; } o.coordsize = abs(kx) + S + abs(ky); s.rotation = deg * (sx * sy < 0 ? -1 : 1); if (deg) { var c = compensation(deg, dx, dy); dx = c.dx; dy = c.dy; } sx < 0 && (flip += "x"); sy < 0 && (flip += " y") && (y = -1); s.flip = flip; o.coordorigin = (dx * -kx) + S + (dy * -ky); if (fillpos || _.fillsize) { var fill = o.getElementsByTagName(fillString); fill = fill && fill[0]; o.removeChild(fill); if (fillpos) { c = compensation(deg, m.x(fillpos[0], fillpos[1]), m.y(fillpos[0], fillpos[1])); fill.position = c.dx * y + S + c.dy * y; } if (_.fillsize) { fill.size = _.fillsize[0] * abs(sx) + S + _.fillsize[1] * abs(sy); } o.appendChild(fill); } s.visibility = "visible"; }; R.toString = function () { return "Your browser doesn\u2019t support SVG. Falling down to VML.\nYou are running Rapha\xebl " + this.version; }; var addArrow = function (o, value, isEnd) { var values = Str(value).toLowerCase().split("-"), se = isEnd ? "end" : "start", i = values.length, type = "classic", w = "medium", h = "medium"; while (i--) { switch (values[i]) { case "block": case "classic": case "oval": case "diamond": case "open": case "none": type = values[i]; break; case "wide": case "narrow": h = values[i]; break; case "long": case "short": w = values[i]; break; } } var stroke = o.node.getElementsByTagName("stroke")[0]; stroke[se + "arrow"] = type; stroke[se + "arrowlength"] = w; stroke[se + "arrowwidth"] = h; }, setFillAndStroke = function (o, params) { // o.paper.canvas.style.display = "none"; o.attrs = o.attrs || {}; var node = o.node, a = o.attrs, s = node.style, xy, newpath = pathTypes[o.type] && (params.x != a.x || params.y != a.y || params.width != a.width || params.height != a.height || params.cx != a.cx || params.cy != a.cy || params.rx != a.rx || params.ry != a.ry || params.r != a.r), isOval = ovalTypes[o.type] && (a.cx != params.cx || a.cy != params.cy || a.r != params.r || a.rx != params.rx || a.ry != params.ry), res = o; for (var par in params) if (params[has](par)) { a[par] = params[par]; } if (newpath) { a.path = R._getPath[o.type](o); o._.dirty = 1; } params.href && (node.href = params.href); params.title && (node.title = params.title); params.target && (node.target = params.target); params.cursor && (s.cursor = params.cursor); "blur" in params && o.blur(params.blur); if (params.path && o.type == "path" || newpath) { node.path = path2vml(~Str(a.path).toLowerCase().indexOf("r") ? R._pathToAbsolute(a.path) : a.path); if (o.type == "image") { o._.fillpos = [a.x, a.y]; o._.fillsize = [a.width, a.height]; setCoords(o, 1, 1, 0, 0, 0); } } "transform" in params && o.transform(params.transform); if (isOval) { var cx = +a.cx, cy = +a.cy, rx = +a.rx || +a.r || 0, ry = +a.ry || +a.r || 0; node.path = R.format("ar{0},{1},{2},{3},{4},{1},{4},{1}x", round((cx - rx) * zoom), round((cy - ry) * zoom), round((cx + rx) * zoom), round((cy + ry) * zoom), round(cx * zoom)); } if ("clip-rect" in params) { var rect = Str(params["clip-rect"]).split(separator); if (rect.length == 4) { rect[2] = +rect[2] + (+rect[0]); rect[3] = +rect[3] + (+rect[1]); var div = node.clipRect || R._g.doc.createElement("div"), dstyle = div.style; dstyle.clip = R.format("rect({1}px {2}px {3}px {0}px)", rect); if (!node.clipRect) { dstyle.position = "absolute"; dstyle.top = 0; dstyle.left = 0; dstyle.width = o.paper.width + "px"; dstyle.height = o.paper.height + "px"; node.parentNode.insertBefore(div, node); div.appendChild(node); node.clipRect = div; } } if (!params["clip-rect"]) { node.clipRect && (node.clipRect.style.clip = "auto"); } } if (o.textpath) { var textpathStyle = o.textpath.style; params.font && (textpathStyle.font = params.font); params["font-family"] && (textpathStyle.fontFamily = '"' + params["font-family"].split(",")[0].replace(/^['"]+|['"]+$/g, E) + '"'); params["font-size"] && (textpathStyle.fontSize = params["font-size"]); params["font-weight"] && (textpathStyle.fontWeight = params["font-weight"]); params["font-style"] && (textpathStyle.fontStyle = params["font-style"]); } if ("arrow-start" in params) { addArrow(res, params["arrow-start"]); } if ("arrow-end" in params) { addArrow(res, params["arrow-end"], 1); } if (params.opacity != null || params["stroke-width"] != null || params.fill != null || params.src != null || params.stroke != null || params["stroke-width"] != null || params["stroke-opacity"] != null || params["fill-opacity"] != null || params["stroke-dasharray"] != null || params["stroke-miterlimit"] != null || params["stroke-linejoin"] != null || params["stroke-linecap"] != null) { var fill = node.getElementsByTagName(fillString), newfill = false; fill = fill && fill[0]; !fill && (newfill = fill = createNode(fillString)); if (o.type == "image" && params.src) { fill.src = params.src; } params.fill && (fill.on = true); if (fill.on == null || params.fill == "none" || params.fill === null) { fill.on = false; } if (fill.on && params.fill) { var isURL = Str(params.fill).match(R._ISURL); if (isURL) { fill.parentNode == node && node.removeChild(fill); fill.rotate = true; fill.src = isURL[1]; fill.type = "tile"; var bbox = o.getBBox(1); fill.position = bbox.x + S + bbox.y; o._.fillpos = [bbox.x, bbox.y]; R._preload(isURL[1], function () { o._.fillsize = [this.offsetWidth, this.offsetHeight]; }); } else { fill.color = R.getRGB(params.fill).hex; fill.src = E; fill.type = "solid"; if (R.getRGB(params.fill).error && (res.type in {circle: 1, ellipse: 1} || Str(params.fill).charAt() != "r") && addGradientFill(res, params.fill, fill)) { a.fill = "none"; a.gradient = params.fill; fill.rotate = false; } } } if ("fill-opacity" in params || "opacity" in params) { var opacity = ((+a["fill-opacity"] + 1 || 2) - 1) * ((+a.opacity + 1 || 2) - 1) * ((+R.getRGB(params.fill).o + 1 || 2) - 1); opacity = mmin(mmax(opacity, 0), 1); fill.opacity = opacity; if (fill.src) { fill.color = "none"; } } node.appendChild(fill); var stroke = (node.getElementsByTagName("stroke") && node.getElementsByTagName("stroke")[0]), newstroke = false; !stroke && (newstroke = stroke = createNode("stroke")); if ((params.stroke && params.stroke != "none") || params["stroke-width"] || params["stroke-opacity"] != null || params["stroke-dasharray"] || params["stroke-miterlimit"] || params["stroke-linejoin"] || params["stroke-linecap"]) { stroke.on = true; } (params.stroke == "none" || params.stroke === null || stroke.on == null || params.stroke == 0 || params["stroke-width"] == 0) && (stroke.on = false); var strokeColor = R.getRGB(params.stroke); stroke.on && params.stroke && (stroke.color = strokeColor.hex); opacity = ((+a["stroke-opacity"] + 1 || 2) - 1) * ((+a.opacity + 1 || 2) - 1) * ((+strokeColor.o + 1 || 2) - 1); var width = (toFloat(params["stroke-width"]) || 1) * .75; opacity = mmin(mmax(opacity, 0), 1); params["stroke-width"] == null && (width = a["stroke-width"]); params["stroke-width"] && (stroke.weight = width); width && width < 1 && (opacity *= width) && (stroke.weight = 1); stroke.opacity = opacity; params["stroke-linejoin"] && (stroke.joinstyle = params["stroke-linejoin"] || "miter"); stroke.miterlimit = params["stroke-miterlimit"] || 8; params["stroke-linecap"] && (stroke.endcap = params["stroke-linecap"] == "butt" ? "flat" : params["stroke-linecap"] == "square" ? "square" : "round"); if (params["stroke-dasharray"]) { var dasharray = { "-": "shortdash", ".": "shortdot", "-.": "shortdashdot", "-..": "shortdashdotdot", ". ": "dot", "- ": "dash", "--": "longdash", "- .": "dashdot", "--.": "longdashdot", "--..": "longdashdotdot" }; stroke.dashstyle = dasharray[has](params["stroke-dasharray"]) ? dasharray[params["stroke-dasharray"]] : E; } newstroke && node.appendChild(stroke); } if (res.type == "text") { res.paper.canvas.style.display = E; var span = res.paper.span, m = 100, fontSize = a.font && a.font.match(/\d+(?:\.\d*)?(?=px)/); s = span.style; a.font && (s.font = a.font); a["font-family"] && (s.fontFamily = a["font-family"]); a["font-weight"] && (s.fontWeight = a["font-weight"]); a["font-style"] && (s.fontStyle = a["font-style"]); fontSize = toFloat(a["font-size"] || fontSize && fontSize[0]) || 10; s.fontSize = fontSize * m + "px"; res.textpath.string && (span.innerHTML = Str(res.textpath.string).replace(/</g, "&#60;").replace(/&/g, "&#38;").replace(/\n/g, "<br>")); var brect = span.getBoundingClientRect(); res.W = a.w = (brect.right - brect.left) / m; res.H = a.h = (brect.bottom - brect.top) / m; // res.paper.canvas.style.display = "none"; res.X = a.x; res.Y = a.y + res.H / 2; ("x" in params || "y" in params) && (res.path.v = R.format("m{0},{1}l{2},{1}", round(a.x * zoom), round(a.y * zoom), round(a.x * zoom) + 1)); var dirtyattrs = ["x", "y", "text", "font", "font-family", "font-weight", "font-style", "font-size"]; for (var d = 0, dd = dirtyattrs.length; d < dd; d++) if (dirtyattrs[d] in params) { res._.dirty = 1; break; } // text-anchor emulation switch (a["text-anchor"]) { case "start": res.textpath.style["v-text-align"] = "left"; res.bbx = res.W / 2; break; case "end": res.textpath.style["v-text-align"] = "right"; res.bbx = -res.W / 2; break; default: res.textpath.style["v-text-align"] = "center"; res.bbx = 0; break; } res.textpath.style["v-text-kern"] = true; } // res.paper.canvas.style.display = E; }, addGradientFill = function (o, gradient, fill) { o.attrs = o.attrs || {}; var attrs = o.attrs, pow = Math.pow, opacity, oindex, type = "linear", fxfy = ".5 .5"; o.attrs.gradient = gradient; gradient = Str(gradient).replace(R._radial_gradient, function (all, fx, fy) { type = "radial"; if (fx && fy) { fx = toFloat(fx); fy = toFloat(fy); pow(fx - .5, 2) + pow(fy - .5, 2) > .25 && (fy = math.sqrt(.25 - pow(fx - .5, 2)) * ((fy > .5) * 2 - 1) + .5); fxfy = fx + S + fy; } return E; }); gradient = gradient.split(/\s*\-\s*/); if (type == "linear") { var angle = gradient.shift(); angle = -toFloat(angle); if (isNaN(angle)) { return null; } } var dots = R._parseDots(gradient); if (!dots) { return null; } o = o.shape || o.node; if (dots.length) { o.removeChild(fill); fill.on = true; fill.method = "none"; fill.color = dots[0].color; fill.color2 = dots[dots.length - 1].color; var clrs = []; for (var i = 0, ii = dots.length; i < ii; i++) { dots[i].offset && clrs.push(dots[i].offset + S + dots[i].color); } fill.colors = clrs.length ? clrs.join() : "0% " + fill.color; if (type == "radial") { fill.type = "gradientTitle"; fill.focus = "100%"; fill.focussize = "0 0"; fill.focusposition = fxfy; fill.angle = 0; } else { // fill.rotate= true; fill.type = "gradient"; fill.angle = (270 - angle) % 360; } o.appendChild(fill); } return 1; }, Element = function (node, vml) { this[0] = this.node = node; node.raphael = true; this.id = R._oid++; node.raphaelid = this.id; this.X = 0; this.Y = 0; this.attrs = {}; this.paper = vml; this.matrix = R.matrix(); this._ = { transform: [], sx: 1, sy: 1, dx: 0, dy: 0, deg: 0, dirty: 1, dirtyT: 1 }; !vml.bottom && (vml.bottom = this); this.prev = vml.top; vml.top && (vml.top.next = this); vml.top = this; this.next = null; }; var elproto = R.el; Element.prototype = elproto; elproto.constructor = Element; elproto.transform = function (tstr) { if (tstr == null) { return this._.transform; } var vbs = this.paper._viewBoxShift, vbt = vbs ? "s" + [vbs.scale, vbs.scale] + "-1-1t" + [vbs.dx, vbs.dy] : E, oldt; if (vbs) { oldt = tstr = Str(tstr).replace(/\.{3}|\u2026/g, this._.transform || E); } R._extractTransform(this, vbt + tstr); var matrix = this.matrix.clone(), skew = this.skew, o = this.node, split, isGrad = ~Str(this.attrs.fill).indexOf("-"), isPatt = !Str(this.attrs.fill).indexOf("url("); matrix.translate(-.5, -.5); if (isPatt || isGrad || this.type == "image") { skew.matrix = "1 0 0 1"; skew.offset = "0 0"; split = matrix.split(); if ((isGrad && split.noRotation) || !split.isSimple) { o.style.filter = matrix.toFilter(); var bb = this.getBBox(), bbt = this.getBBox(1), dx = bb.x - bbt.x, dy = bb.y - bbt.y; o.coordorigin = (dx * -zoom) + S + (dy * -zoom); setCoords(this, 1, 1, dx, dy, 0); } else { o.style.filter = E; setCoords(this, split.scalex, split.scaley, split.dx, split.dy, split.rotate); } } else { o.style.filter = E; skew.matrix = Str(matrix); skew.offset = matrix.offset(); } oldt && (this._.transform = oldt); return this; }; elproto.rotate = function (deg, cx, cy) { if (this.removed) { return this; } if (deg == null) { return; } deg = Str(deg).split(separator); if (deg.length - 1) { cx = toFloat(deg[1]); cy = toFloat(deg[2]); } deg = toFloat(deg[0]); (cy == null) && (cx = cy); if (cx == null || cy == null) { var bbox = this.getBBox(1); cx = bbox.x + bbox.width / 2; cy = bbox.y + bbox.height / 2; } this._.dirtyT = 1; this.transform(this._.transform.concat([["r", deg, cx, cy]])); return this; }; elproto.translate = function (dx, dy) { if (this.removed) { return this; } dx = Str(dx).split(separator); if (dx.length - 1) { dy = toFloat(dx[1]); } dx = toFloat(dx[0]) || 0; dy = +dy || 0; if (this._.bbox) { this._.bbox.x += dx; this._.bbox.y += dy; } this.transform(this._.transform.concat([["t", dx, dy]])); return this; }; elproto.scale = function (sx, sy, cx, cy) { if (this.removed) { return this; } sx = Str(sx).split(separator); if (sx.length - 1) { sy = toFloat(sx[1]); cx = toFloat(sx[2]); cy = toFloat(sx[3]); isNaN(cx) && (cx = null); isNaN(cy) && (cy = null); } sx = toFloat(sx[0]); (sy == null) && (sy = sx); (cy == null) && (cx = cy); if (cx == null || cy == null) { var bbox = this.getBBox(1); } cx = cx == null ? bbox.x + bbox.width / 2 : cx; cy = cy == null ? bbox.y + bbox.height / 2 : cy; this.transform(this._.transform.concat([["s", sx, sy, cx, cy]])); this._.dirtyT = 1; return this; }; elproto.hide = function () { !this.removed && (this.node.style.display = "none"); return this; }; elproto.show = function () { !this.removed && (this.node.style.display = E); return this; }; elproto._getBBox = function () { if (this.removed) { return {}; } return { x: this.X + (this.bbx || 0) - this.W / 2, y: this.Y - this.H, width: this.W, height: this.H }; }; elproto.remove = function () { if (this.removed) { return; } this.paper.__set__ && this.paper.__set__.exclude(this); R.eve.unbind("*.*." + this.id); R._tear(this, this.paper); this.node.parentNode.removeChild(this.node); this.shape && this.shape.parentNode.removeChild(this.shape); for (var i in this) { this[i] = typeof this[i] == "function" ? R._removedFactory(i) : null; } this.removed = true; }; elproto.attr = function (name, value) { if (this.removed) { return this; } if (name == null) { var res = {}; for (var a in this.attrs) if (this.attrs[has](a)) { res[a] = this.attrs[a]; } res.gradient && res.fill == "none" && (res.fill = res.gradient) && delete res.gradient; res.transform = this._.transform; return res; } if (value == null && R.is(name, "string")) { if (name == fillString && this.attrs.fill == "none" && this.attrs.gradient) { return this.attrs.gradient; } var names = name.split(separator), out = {}; for (var i = 0, ii = names.length; i < ii; i++) { name = names[i]; if (name in this.attrs) { out[name] = this.attrs[name]; } else if (R.is(this.paper.customAttributes[name], "function")) { out[name] = this.paper.customAttributes[name].def; } else { out[name] = R._availableAttrs[name]; } } return ii - 1 ? out : out[names[0]]; } if (this.attrs && value == null && R.is(name, "array")) { out = {}; for (i = 0, ii = name.length; i < ii; i++) { out[name[i]] = this.attr(name[i]); } return out; } var params; if (value != null) { params = {}; params[name] = value; } value == null && R.is(name, "object") && (params = name); for (var key in params) { eve("attr." + key + "." + this.id, this, params[key]); } if (params) { for (key in this.paper.customAttributes) if (this.paper.customAttributes[has](key) && params[has](key) && R.is(this.paper.customAttributes[key], "function")) { var par = this.paper.customAttributes[key].apply(this, [].concat(params[key])); this.attrs[key] = params[key]; for (var subkey in par) if (par[has](subkey)) { params[subkey] = par[subkey]; } } // this.paper.canvas.style.display = "none"; if (params.text && this.type == "text") { this.textpath.string = params.text; } setFillAndStroke(this, params); // this.paper.canvas.style.display = E; } return this; }; elproto.toFront = function () { !this.removed && this.node.parentNode.appendChild(this.node); this.paper && this.paper.top != this && R._tofront(this, this.paper); return this; }; elproto.toBack = function () { if (this.removed) { return this; } if (this.node.parentNode.firstChild != this.node) { this.node.parentNode.insertBefore(this.node, this.node.parentNode.firstChild); R._toback(this, this.paper); } return this; }; elproto.insertAfter = function (element) { if (this.removed) { return this; } if (element.constructor == R.st.constructor) { element = element[element.length - 1]; } if (element.node.nextSibling) { element.node.parentNode.insertBefore(this.node, element.node.nextSibling); } else { element.node.parentNode.appendChild(this.node); } R._insertafter(this, element, this.paper); return this; }; elproto.insertBefore = function (element) { if (this.removed) { return this; } if (element.constructor == R.st.constructor) { element = element[0]; } element.node.parentNode.insertBefore(this.node, element.node); R._insertbefore(this, element, this.paper); return this; }; elproto.blur = function (size) { var s = this.node.runtimeStyle, f = s.filter; f = f.replace(blurregexp, E); if (+size !== 0) { this.attrs.blur = size; s.filter = f + S + ms + ".Blur(pixelradius=" + (+size || 1.5) + ")"; s.margin = R.format("-{0}px 0 0 -{0}px", round(+size || 1.5)); } else { s.filter = f; s.margin = 0; delete this.attrs.blur; } }; R._engine.path = function (pathString, vml) { var el = createNode("shape"); el.style.cssText = cssDot; el.coordsize = zoom + S + zoom; el.coordorigin = vml.coordorigin; var p = new Element(el, vml), attr = {fill: "none", stroke: "#000"}; pathString && (attr.path = pathString); p.type = "path"; p.path = []; p.Path = E; setFillAndStroke(p, attr); vml.canvas.appendChild(el); var skew = createNode("skew"); skew.on = true; el.appendChild(skew); p.skew = skew; p.transform(E); return p; }; R._engine.rect = function (vml, x, y, w, h, r) { var path = R._rectPath(x, y, w, h, r), res = vml.path(path), a = res.attrs; res.X = a.x = x; res.Y = a.y = y; res.W = a.width = w; res.H = a.height = h; a.r = r; a.path = path; res.type = "rect"; return res; }; R._engine.ellipse = function (vml, x, y, rx, ry) { var res = vml.path(), a = res.attrs; res.X = x - rx; res.Y = y - ry; res.W = rx * 2; res.H = ry * 2; res.type = "ellipse"; setFillAndStroke(res, { cx: x, cy: y, rx: rx, ry: ry }); return res; }; R._engine.circle = function (vml, x, y, r) { var res = vml.path(), a = res.attrs; res.X = x - r; res.Y = y - r; res.W = res.H = r * 2; res.type = "circle"; setFillAndStroke(res, { cx: x, cy: y, r: r }); return res; }; R._engine.image = function (vml, src, x, y, w, h) { var path = R._rectPath(x, y, w, h), res = vml.path(path).attr({stroke: "none"}), a = res.attrs, node = res.node, fill = node.getElementsByTagName(fillString)[0]; a.src = src; res.X = a.x = x; res.Y = a.y = y; res.W = a.width = w; res.H = a.height = h; a.path = path; res.type = "image"; fill.parentNode == node && node.removeChild(fill); fill.rotate = true; fill.src = src; fill.type = "tile"; res._.fillpos = [x, y]; res._.fillsize = [w, h]; node.appendChild(fill); setCoords(res, 1, 1, 0, 0, 0); return res; }; R._engine.text = function (vml, x, y, text) { var el = createNode("shape"), path = createNode("path"), o = createNode("textpath"); x = x || 0; y = y || 0; text = text || ""; path.v = R.format("m{0},{1}l{2},{1}", round(x * zoom), round(y * zoom), round(x * zoom) + 1); path.textpathok = true; o.string = Str(text); o.on = true; el.style.cssText = cssDot; el.coordsize = zoom + S + zoom; el.coordorigin = "0 0"; var p = new Element(el, vml), attr = { fill: "#000", stroke: "none", font: R._availableAttrs.font, text: text }; p.shape = el; p.path = path; p.textpath = o; p.type = "text"; p.attrs.text = Str(text); p.attrs.x = x; p.attrs.y = y; p.attrs.w = 1; p.attrs.h = 1; setFillAndStroke(p, attr); el.appendChild(o); el.appendChild(path); vml.canvas.appendChild(el); var skew = createNode("skew"); skew.on = true; el.appendChild(skew); p.skew = skew; p.transform(E); return p; }; R._engine.setSize = function (width, height) { var cs = this.canvas.style; this.width = width; this.height = height; width == +width && (width += "px"); height == +height && (height += "px"); cs.width = width; cs.height = height; cs.clip = "rect(0 " + width + " " + height + " 0)"; if (this._viewBox) { R._engine.setViewBox.apply(this, this._viewBox); } return this; }; R._engine.setViewBox = function (x, y, w, h, fit) { R.eve("setViewBox", this, this._viewBox, [x, y, w, h, fit]); var width = this.width, height = this.height, size = 1 / mmax(w / width, h / height), H, W; if (fit) { H = height / h; W = width / w; if (w * H < width) { x -= (width - w * H) / 2 / H; } if (h * W < height) { y -= (height - h * W) / 2 / W; } } this._viewBox = [x, y, w, h, !!fit]; this._viewBoxShift = { dx: -x, dy: -y, scale: size }; this.forEach(function (el) { el.transform("..."); }); return this; }; var createNode; R._engine.initWin = function (win) { var doc = win.document; doc.createStyleSheet().addRule(".rvml", "behavior:url(#default#VML)"); try { !doc.namespaces.rvml && doc.namespaces.add("rvml", "urn:schemas-microsoft-com:vml"); createNode = function (tagName) { return doc.createElement('<rvml:' + tagName + ' class="rvml">'); }; } catch (e) { createNode = function (tagName) { return doc.createElement('<' + tagName + ' xmlns="urn:schemas-microsoft.com:vml" class="rvml">'); }; } }; R._engine.initWin(R._g.win); R._engine.create = function () { var con = R._getContainer.apply(0, arguments), container = con.container, height = con.height, s, width = con.width, x = con.x, y = con.y; if (!container) { throw new Error("VML container not found."); } var res = new R._Paper, c = res.canvas = R._g.doc.createElement("div"), cs = c.style; x = x || 0; y = y || 0; width = width || 512; height = height || 342; res.width = width; res.height = height; width == +width && (width += "px"); height == +height && (height += "px"); res.coordsize = zoom * 1e3 + S + zoom * 1e3; res.coordorigin = "0 0"; res.span = R._g.doc.createElement("span"); res.span.style.cssText = "position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;"; c.appendChild(res.span); cs.cssText = R.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden", width, height); if (container == 1) { R._g.doc.body.appendChild(c); cs.left = x + "px"; cs.top = y + "px"; cs.position = "absolute"; } else { if (container.firstChild) { container.insertBefore(c, container.firstChild); } else { container.appendChild(c); } } // plugins.call(res, res, R.fn); res.renderfix = function () {}; return res; }; R.prototype.clear = function () { R.eve("clear", this); this.canvas.innerHTML = E; this.span = R._g.doc.createElement("span"); this.span.style.cssText = "position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;"; this.canvas.appendChild(this.span); this.bottom = this.top = null; }; R.prototype.remove = function () { R.eve("remove", this); this.canvas.parentNode.removeChild(this.canvas); for (var i in this) { this[i] = typeof this[i] == "function" ? R._removedFactory(i) : null; } return true; }; var setproto = R.st; for (var method in elproto) if (elproto[has](method) && !setproto[has](method)) { setproto[method] = (function (methodname) { return function () { var arg = arguments; return this.forEach(function (el) { el[methodname].apply(el, arg); }); }; })(method); } }(window.Raphael);
zyroot
trunk/admin/dwz1.4.5/chart/raphael.js
JavaScript
art
206,712
新建窗口1
zyroot
trunk/admin/dwz1.4.5/newPage1.html
HTML
art
13
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>简单实用国产jQuery UI框架 - DWZ富客户端框架(J-UI.com)</title> <script type="text/javascript"> var width = screen.width -10, height = screen.height -10; window.open('index.html','_blank','width='+width+',height='+height+',top=0,left=0,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no'); </script> </head> <body> </body> </html>
zyroot
trunk/admin/dwz1.4.5/window_open.html
HTML
art
471
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>风险管理平台</title> <link href="themes/css/login.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="login"> <div id="login_header"> <h1 class="login_logo"> <a href="http://demo.dwzjs.com"><img src="themes/default/images/login_logo.gif" /></a> </h1> <div class="login_headerContent"> <div class="navList"> <ul> <li><a href="#">设为首页</a></li> <li><a href="http://bbs.dwzjs.com">反馈</a></li> <li><a href="doc/dwz-user-guide.pdf" target="_blank">帮助</a></li> </ul> </div> <h2 class="login_title"><img src="themes/default/images/login_title.png" /></h2> </div> </div> <div id="login_content"> <div class="loginForm"> <form action="index.html"> <p> <label>用户名:</label> <input type="text" name="username" size="20" class="login_input" /> </p> <p> <label>密码:</label> <input type="password" name="password" size="20" class="login_input" /> </p> <p> <label>验证码:</label> <input class="code" type="text" size="5" /> <span><img src="themes/default/images/header_bg.png" alt="" width="75" height="24" /></span> </p> <div class="login_bar"> <input class="sub" type="submit" value=" " /> </div> </form> </div> <div class="login_banner"><img src="themes/default/images/login_banner.jpg" /></div> <div class="login_main"> <ul class="helpList"> <li><a href="#">下载驱动程序</a></li> <li><a href="#">如何安装密钥驱动程序?</a></li> <li><a href="#">忘记密码怎么办?</a></li> <li><a href="#">为什么登录失败?</a></li> </ul> <div class="login_inner"> <p>您可以使用 网易网盘 ,随时存,随地取</p> <p>您还可以使用 闪电邮 在桌面随时提醒邮件到达,快速收发邮件。</p> <p>在 百宝箱 里您可以查星座,订机票,看小说,学做菜…</p> </div> </div> </div> <div id="login_footer"> Copyright &copy; 2009 www.dwzjs.com Inc. All Rights Reserved. </div> </div> </body> </html>
zyroot
trunk/admin/dwz1.4.5/login.html
HTML
art
2,442
@charset "utf-8"; /* Icon */ .tabsHeader li.main a span span, #taskbar li .taskbutton span { background:url(./images/icon.png) no-repeat;} /* Panel */ .panel, .panel .panelHeader, .panel .panelHeaderContent, .panel .panelHeaderContent h1, .panel .panelFooter, .panel .panelFooterContent { background:url(./images/panel/panel.png) no-repeat;} .panel .expandable, .panel .collapsable { background:url(./images/panel/panel_icon.png) no-repeat;} .panel .panelHeaderContent h1 { color:#183152; } .panel .panelContent { border-color:#b8d0d6; background:#eef4f5;} .panel .grid { border-color:#b8d0d6;} /* Tabs */ .tabs, .tabsHeader, .tabsHeaderContent, .tabs .tabsHeader ul, .tabs .tabsHeader li, .tabs .tabsHeader li a, .tabs .tabsHeader li span, .tabs .tabsFooter, .tabs .tabsFooterContent { background:url(./images/tabs/tabspanel.png) no-repeat;} .tabs .tabsHeader li a { color:#03408b;} .tabs .tabsHeader li span { color:#183152;} .tabs .tabsContent { border-color:#b8d0d6; background:#eef4f5;} /* TabsPage */ .tabsPage .tabsPageHeader, .tabsPage .tabsPageHeader li, .tabsPage .tabsPageHeader li a, .tabsPage .tabsPageHeader li span { background:url(./images/tabs/tabspage.png) no-repeat;} .tabsPage .tabsPageHeader { background-color:#e9f0f2;} .tabsPage .tabsPageHeader { border-color:#b8d0d6;} .tabsPage .tabsPageHeader li a { color:#183152;} .tabsPage .tabsPageHeader li .close, .tabsPage .tabsPageHeader li.hover .close, .tabsPage .tabsPageHeader li.selected .close { background:url(./images/tabs/tabspage_icon.png) no-repeat;} .tabsPage .tabsLeft, .tabsPage .tabsRight, .tabsPage .tabsMore { background:url(./images/tabs/tabscontrol.png) no-repeat;} .tabsPage .tabsMoreList { border-color:#b8d0d6; background:#FFF;} .tabsPage .tabsPageHeader .home_icon { background:url(./images/icon.png) no-repeat;} .tabsPage .tabsPageContent { border-color:#b8d0d6; background:#FFF;} /* Alert */ .alert .alertFooter, .alert .alertFooter_r, .alert .alertFooter_c { background:url(./images/alert/alertpanel.png) no-repeat;} .alert .alertContent { border-color:#b8d0d6; background:#eef4f5;} .alert .warn .alertInner { border-color:#e83e09; background:#fefacf;} .alert .error .alertInner { border-color:#e50000; background:#fefacf;} .alert .correct .alertInner, .alert .info .alertInner { border-color:#b8d0d6; background:#fefacf;} .alert .confirm .alertInner { border-color:#b8d0d6; background:#fefacf;} .alert h1 { border-color:#CCC; background:url(./images/alert/alertpanel_icon.png) no-repeat;} /* Dialog */ .dialog .dialogHeader, .dialog .dialogHeader_r, .dialog .dialogHeader_c, .dialog .dialogFooter, .dialog .dialogFooter_r, .dialog .dialogFooter_c { background:url(./images/dialog/dialogpanel.png) no-repeat;} .dialog .dialogHeader h1, .dialog .dialogHeader .close, .dialog .dialogHeader .maximize, .dialog .dialogHeader .restore, .dialog .dialogHeader .minimize, .resizable_f_r { background:url(./images/dialog/dialogpanel_icon.png) no-repeat;} .dialog .dialogHeader h1 { color:#183152;} .dialog .dialogContent { border-color:#b8d0d6; background:#eef4f5;} .resizable { border-color:#081629; background:#c3d7dc;} /* Shadow */ .shadow .shadow_h_l { background:url(./images/shadow/shadow_h_l.png) no-repeat;} .shadow .shadow_h_r { background:url(./images/shadow/shadow_h_r.png) no-repeat;} .shadow .shadow_h_c { background:url(./images/shadow/shadow_h_c.png) repeat-x;} .shadow .shadow_c_l { background:url(./images/shadow/shadow_c_l.png) repeat-y;} .shadow .shadow_c_r { background:url(./images/shadow/shadow_c_r.png) repeat-y;} .shadow .shadow_c_c { background:url(./images/shadow/shadow_c_c.png) repeat;} .shadow .shadow_f_l { background:url(./images/shadow/shadow_f_l.png) no-repeat;} .shadow .shadow_f_r { background:url(./images/shadow/shadow_f_r.png) no-repeat;} .shadow .shadow_f_c { background:url(./images/shadow/shadow_f_c.png) repeat-x;} /* Tree */ .tree div div { background:url(./images/tree/tree.png) no-repeat;} .tree .folder_collapsable, .tree .folder_expandable, .tree .file { background:url(./images/tree/folder.png) no-repeat;} .tree .checked, .tree .unchecked, .tree .indeterminate { background:url(./images/tree/check.png) no-repeat;} .tree ul { background:#FFF;} .tree li a, .tree li span { color:#183152;} .tree .hover { background:#f5f5f5;} .tree .selected { background-color:#e8edf3;} /* Accordion */ .accordion .accordionHeader, .accordion .accordionHeader h2, .accordion .accordionHeader h2 span { color:#183152; background:url(./images/accordion/accordion.png);} .accordion { border-color:#b8d0d6; background:#FFF;} .accordion .accordionHeader { background-color:#eaf4ff;} .accordion .accordionContent { border-color:#b8d0d6;} /* Grid */ .panelBar, .toolBar li.hover, .toolBar li.hover a, .toolBar li.hover span, .toolBar span, .pagination, .pagination li.hover, .pagination li.hover a, .pagination li span, .pagination li.disabled span span, .panelBar .line, .pagination li.jumpto, .pagination li.jumpto .goto { background:url(./images/grid/grid.png) no-repeat;} .panelBar { border-color:#b8d0d6; background-color:#efefef;} .grid .gridHeader { background:#EEE;} .grid { background:#FFF;} .grid table { border-color:#d0d0d0;} .grid .gridHeader, .grid .gridHeader th { border-color:#d0d0d0; background:#f0eff0 url(./images/grid/tableth.png) repeat-x;} .grid table th div { border-left-color:#EEE; border-right-color:#d0d0d0;} .grid table td { border-color:#ededed;} .grid .resizeMarker, .grid .resizeProxy { background:url(./images/grid/resizeCol.png) repeat-y;} .grid .gridHeader th.hover, .grid .gridHeader th.thSelected { border-color:#aaccf6; } .grid .gridTbody .gridRowBg { background:#f7f7f7;} .grid .gridTbody .gridRow { border-color:#ededed;} .grid .gridTbody .gridRow td.tdLast { border-color:#ededed;} .grid .gridTbody .hover { border-color:#dddddd; background:#f5f5f5;} .grid .gridTbody .hover .tdSelected { background:#f5f5f5;} .grid .gridTbody .selected { border-color:#b8d0d6; background:#7cc5e5;} .grid .gridTbody .selected .tdSelected { background:#e8edf3;} .grid .gridTbody .tdSelected { background:#f8f8f8;} .grid .error{background:#fb7e81;} /* ProgressBar */ .progressBar { border:solid 2px #86a5ad; background:#FFF url(./images/progressBar/progressBar_m.gif) no-repeat 10px 10px;} /* ----------------------------------------------------------------- Form */ /* TextInput */ .textInput, input.focus, input.required, input.error, input.readonly, input.disabled, textarea.focus, textarea.required, textarea.error, textarea.readonly, textarea.disabled { background:url(./images/form/input_bg.png) no-repeat scroll;} .textInput, .textArea { border-color:#a2bac0 #b8d0d6 #b8d0d6 #a2bac0; background-color:#FFF;} input.required, textarea.required { border-color:#a2bac0 #b8d0d6 #b8d0d6 #a2bac0; background-color:#FFF;} input.error, textarea.error { border-color:#F80C11 #FB7E81 #FB7E81 #F80C11;} input.focus, textarea.focus { border-color:#64aabc #a9d7e3 #a9d7e3 #64aabc; background-color:#f8fafc;} input.readonly, textarea.readonly { border-color:#9eabb3 #d5dbdf #d5dbdf #9eabb3; background-color:#F6F6F6;} input.disabled, textarea.disabled { border-color:#9eabb3 #d5dbdf #d5dbdf #9eabb3; background-color:#F6F6F6;} .inputButton, .inputDateButton { background:url(./images/form/input_bt.png) no-repeat;} /* Button */ .button, .button span, .buttonDisabled, .buttonDisabled span, .buttonActive, .buttonActive span, .button .buttonContent, .buttonHover, .buttonHover .buttonContent, .buttonActive .buttonContent, .buttonActiveHover, .buttonActiveHover .buttonContent, .buttonDisabled .buttonContent { background:url(./images/button/button_s.png) no-repeat;} .button span, .buttonDisabled span, .buttonActive span, .button .buttonContent, .buttonHover, .buttonHover .buttonContent, .buttonActive .buttonContent, .buttonDisabled .buttonContent, .button button, .buttonHover button, .buttonActive button, .buttonDisabled button { color:#183152;} .buttonDisabled span, .buttonDisabled:hover span, .buttonDisabled button { color:#999;} /* ----------------------------------------------------------------- Pages */ /* Layout */ body, #splitBar { background:#e5edef;} #splitBarProxy { border-color:#c0c0c0; background:#CCC;} #header, #header .headerNav { background:url(./images/header_bg.png) repeat-x;} #header { background-color:#102c4a;} #header .logo { background:url(./images/logo.png) no-repeat;} #header .nav li { float:left; margin-left:-1px; padding:0 8px; line-height:11px; background:url(./images/listLine.png) no-repeat;} #header .nav li a { color:#b9ccda;} #header .themeList li div { background:url(./images/themeButton.png) no-repeat;} .toggleCollapse, .toggleCollapse div { background:url(./images/layout/toggleSidebar.png) no-repeat;} .toggleCollapse { border-style:solid; border-width:1px 1px 0 1px; border-color:#b8d0d6; background-color:#e7eff0;} .toggleCollapse h2 { color:#183152;} #sidebar_s .collapse { border:solid 1px #b8d0d6; background:#eff5f6;} #sidebar_s .collapse:hover { background:#f5f9fa;} #taskbar, #taskbar li, #taskbar li .taskbutton { background:url(./images/layout/taskbar.png) no-repeat;} #taskbar .close, #taskbar .restore, #taskbar .minimize { background:url(./images/layout/taskbar_icon.png) no-repeat;} #taskbar li .taskbutton span { color:#FFF;} #taskbar .taskbarLeft, #taskbar .taskbarRight { background:url(./images/layout/taskbar_control.png) no-repeat;} /* Menu */ #navMenu, #navMenu li, #navMenu li.selected a, #navMenu li.selected span { background:url(../default/images/menu/menu.png) no-repeat;} #navMenu { background-color:#1871dd; } #navMenu li a, #navMenu li span { color:#FFF; } #navMenu li.selected span { color:#000; } /* Homepage */ .sidebarContent { display:block; overflow:auto; height:500px; border:solid 1px #86B4EC; background:#FFF;} .accountInfo { display:block; overflow:hidden; height:60px; padding:0 10px; background:url(./images/account_info_bg.png) repeat-x} .accountInfo p { padding:8px 0 0 0; line-height:19px;} .accountInfo p span { font-size:14px; font-weight:bold;} .accountInfo .right { float:right; padding-right:10px; text-align:right;} .accountInfo .alertInfo { float:right; width:300px; height:60px; padding-left:10px; border-left:solid 1px #accdf4;} .accountInfo .alertInfo h2 { padding:8px 0; line-height:17px;} .accountInfo .alertInfo a { padding:6px 0 0 0; line-height:21px;} /* Pages */ .pageForm .inputInfo { color:#999;} /* Pages dialog */ .dialog .pageHeader, .dialog .pageContent { border-color:#b8d0d6;} .dialog .pageContent .pageFormContent { border-color:#b8d0d6; background:#FFF;} /* Pages default */ .page .pageHeader, .formBar { border-color:#b8d0d6; background:#ebf0f5 url(../default/images/pageHeader_bg.png) repeat-x;} .page .searchBar label { color:#183152;} /* Pages Form */ .formBar { border-color:#b8d0d6;} .divider { border-color:#b8d0d6;} /* combox */ .combox .select a { color:#183152; } .comboxop { border-color:#B8D0D6; } .combox, .combox div, .combox div a { background:url(../default/images/search-bg.gif) no-repeat; }
zyroot
trunk/admin/dwz1.4.5/themes/default/style.css
CSS
art
11,198
@charset "utf-8"; /* Icon */ .tabsHeader li.main a span span, #taskbar li .taskbutton span { background:url(../default/images/icon.png) no-repeat;} /* Panel */ .panel, .panel .panelHeader, .panel .panelHeaderContent, .panel .panelHeaderContent h1, .panel .panelFooter, .panel .panelFooterContent { background:url(./images/panel/panel.png) no-repeat;} .panel .expandable, .panel .collapsable { background:url(./images/panel/panel_icon.png) no-repeat;} .panel .panelHeaderContent h1 { color:#183152; } .panel .panelContent { border-color:#C1C1C1; background:#eef4f5;} .panel .grid { border-color:#C1C1C1;} /* Tabs */ .tabs, .tabsHeader, .tabsHeaderContent, .tabs .tabsHeader ul, .tabs .tabsHeader li, .tabs .tabsHeader li a, .tabs .tabsHeader li span, .tabs .tabsFooter, .tabs .tabsFooterContent { background:url(./images/tabs/tabspanel.png) no-repeat;} .tabs .tabsHeader li a { color:#03408b;} .tabs .tabsHeader li span { color:#183152;} .tabs .tabsContent { border-color:#C1C1C1; background:#eef4f5;} /* TabsPage */ .tabsPage .tabsPageHeader, .tabsPage .tabsPageHeader li, .tabsPage .tabsPageHeader li a, .tabsPage .tabsPageHeader li span { background:url(./images/tabs/tabspage.png) no-repeat;} .tabsPage .tabsPageHeader { background-color:#e9f0f2;} .tabsPage .tabsPageHeader { border-color:#C1C1C1;} .tabsPage .tabsPageHeader li a { color:#183152;} .tabsPage .tabsPageHeader li .close, .tabsPage .tabsPageHeader li.hover .close, .tabsPage .tabsPageHeader li.selected .close { background:url(./images/tabs/tabspage_icon.png) no-repeat;} .tabsPage .tabsLeft, .tabsPage .tabsRight, .tabsPage .tabsMore { background:url(./images/tabs/tabscontrol.png) no-repeat;} .tabsPage .tabsMoreList { border-color:#C1C1C1; background:#FFF;} .tabsPage .tabsPageHeader .home_icon { background:url(../default/images/icon.png) no-repeat;} .tabsPage .tabsPageContent { border-color:#C1C1C1; background:#FFF;} /* Alert */ .alert .alertFooter, .alert .alertFooter_r, .alert .alertFooter_c { background:url(./images/alert/alertpanel.png) no-repeat;} .alert .alertContent { border-color:#C1C1C1; background:#eef4f5;} .alert .warn .alertInner { border-color:#e83e09; background:#fefacf;} .alert .error .alertInner { border-color:#e50000; background:#fefacf;} .alert .correct .alertInner, .alert .info .alertInner { border-color:#C1C1C1; background:#fefacf;} .alert .confirm .alertInner { border-color:#C1C1C1; background:#fefacf;} .alert h1 { border-color:#CCC; background:url(./images/alert/alertpanel_icon.png) no-repeat;} /* Dialog */ .dialog .dialogHeader, .dialog .dialogHeader_r, .dialog .dialogHeader_c, .dialog .dialogFooter, .dialog .dialogFooter_r, .dialog .dialogFooter_c { background:url(./images/dialog/dialogpanel.png) no-repeat;} .dialog .dialogHeader h1, .dialog .dialogHeader .close, .dialog .dialogHeader .maximize, .dialog .dialogHeader .restore, .dialog .dialogHeader .minimize, .resizable_f_r { background:url(./images/dialog/dialogpanel_icon.png) no-repeat;} .dialog .dialogHeader h1 { color:#183152;} .dialog .dialogContent { border-color:#C1C1C1; background:#eef4f5;} .resizable { border-color:#081629; background:#c3d7dc;} /* Shadow */ .shadow .shadow_h_l { background:url(./images/shadow/shadow_h_l.png) no-repeat;} .shadow .shadow_h_r { background:url(./images/shadow/shadow_h_r.png) no-repeat;} .shadow .shadow_h_c { background:url(./images/shadow/shadow_h_c.png) repeat-x;} .shadow .shadow_c_l { background:url(./images/shadow/shadow_c_l.png) repeat-y;} .shadow .shadow_c_r { background:url(./images/shadow/shadow_c_r.png) repeat-y;} .shadow .shadow_c_c { background:url(./images/shadow/shadow_c_c.png) repeat;} .shadow .shadow_f_l { background:url(./images/shadow/shadow_f_l.png) no-repeat;} .shadow .shadow_f_r { background:url(./images/shadow/shadow_f_r.png) no-repeat;} .shadow .shadow_f_c { background:url(./images/shadow/shadow_f_c.png) repeat-x;} /* Tree */ .tree div div { background:url(./images/tree/tree.png) no-repeat;} .tree .folder_collapsable, .tree .folder_expandable, .tree .file { background:url(./images/tree/folder.png) no-repeat;} .tree .checked, .tree .unchecked, .tree .indeterminate { background:url(./images/tree/check.png) no-repeat;} .tree ul { background:#FFF;} .tree li a, .tree li span { color:#183152;} .tree .hover { background:#f5f5f5;} .tree .selected { background-color:#e8edf3;} /* Accordion */ .accordion .accordionHeader, .accordion .accordionHeader h2, .accordion .accordionHeader h2 span { color:#183152; background:url(./images/accordion/accordion.png);} .accordion { border-color:#C1C1C1; background:#FFF;} .accordion .accordionHeader { background-color:#eaf4ff;} .accordion .accordionContent { border-color:#C1C1C1;} /* Grid */ .panelBar, .toolBar li.hover, .toolBar li.hover a, .toolBar li.hover span, .toolBar span, .pagination, .pagination li.hover, .pagination li.hover a, .pagination li span, .pagination li.disabled span span, .panelBar .line, .pagination li.jumpto, .pagination li.jumpto .goto { background:url(./images/grid/grid.png) no-repeat;} .panelBar { border-color:#C1C1C1; background-color:#efefef;} .grid .gridHeader { background:#EEE;} .grid { background:#FFF;} .grid table { border-color:#d0d0d0;} .grid .gridHeader, .grid .gridHeader th { border-color:#d0d0d0; background:#f0eff0 url(./images/grid/tableth.png) repeat-x;} .grid table th div { border-left-color:#EEE; border-right-color:#d0d0d0;} .grid table td { border-color:#ededed;} .grid .resizeMarker, .grid .resizeProxy { background:url(./images/grid/resizeCol.png) repeat-y;} .grid .gridHeader th.hover, .grid .gridHeader th.thSelected { border-color:#aaccf6; } .grid .gridTbody .gridRowBg { background:#f7f7f7;} .grid .gridTbody .gridRow { border-color:#ededed;} .grid .gridTbody .gridRow td.tdLast { border-color:#ededed;} .grid .gridTbody .hover { border-color:#dddddd; background:#f5f5f5;} .grid .gridTbody .hover .tdSelected { background:#f5f5f5;} .grid .gridTbody .selected { border-color:#C1C1C1; background:#7cc5e5;} .grid .gridTbody .selected .tdSelected { background:#e8edf3;} .grid .error{background:#fb7e81;} /* ProgressBar */ .progressBar { border:solid 2px #86a5ad; background:#FFF url(./images/progressBar/progressBar_m.gif) no-repeat 10px 10px;} /* ----------------------------------------------------------------- Form */ /* TextInput */ .textInput, input.focus, input.required, input.error, input.readonly, input.disabled, textarea.focus, textarea.required, textarea.error, textarea.readonly, textarea.disabled { background:url(./images/form/input_bg.png) no-repeat scroll;} .textInput, .textArea { border-color:#a2bac0 #C1C1C1 #C1C1C1 #a2bac0; background-color:#FFF;} input.required, textarea.required { border-color:#a2bac0 #C1C1C1 #C1C1C1 #a2bac0; background-color:#FFF;} input.error, textarea.error { border-color:#F80C11 #FB7E81 #FB7E81 #F80C11;} input.focus, textarea.focus { border-color:#64aabc #a9d7e3 #a9d7e3 #64aabc; background-color:#f8fafc;} input.readonly, textarea.readonly { border-color:#9eabb3 #d5dbdf #d5dbdf #9eabb3; background-color:#F6F6F6;} input.disabled, textarea.disabled { border-color:#9eabb3 #d5dbdf #d5dbdf #9eabb3; background-color:#F6F6F6;} .inputButton, .inputDateButton { background:url(./images/form/input_bt.png) no-repeat;} /* Button */ .button, .button span, .buttonDisabled, .buttonDisabled span, .buttonActive, .buttonActive span, .button .buttonContent, .buttonHover, .buttonHover .buttonContent, .buttonActive .buttonContent, .buttonActiveHover, .buttonActiveHover .buttonContent, .buttonDisabled .buttonContent { background:url(./images/button/button_s.png) no-repeat;} .button span, .buttonDisabled span, .buttonActive span, .button .buttonContent, .buttonHover, .buttonHover .buttonContent, .buttonActive .buttonContent, .buttonDisabled .buttonContent, .button button, .buttonHover button, .buttonActive button, .buttonDisabled button { color:#183152;} .buttonDisabled span, .buttonDisabled:hover span, .buttonDisabled button { color:#999;} /* ----------------------------------------------------------------- Pages */ /* Layout */ body, #splitBar { background:#EDEDED;} #splitBarProxy { border-color:#c0c0c0; background:#CCC;} #header, #header .headerNav { background:url(./images/header_bg.png) repeat-x;} #header { background-color:#102c4a;} #header .logo { background:url(../default/images/logo.png) no-repeat;} #header .nav li { float:left; margin-left:-1px; padding:0 8px; line-height:11px; background:url(./images/listLine.png) no-repeat;} #header .nav li a { color:#fff;} #header .themeList li div { background:url(../default/images/themeButton.png) no-repeat;} .toggleCollapse, .toggleCollapse div { background:url(./images/layout/toggleSidebar.png) no-repeat;} .toggleCollapse { border-style:solid; border-width:1px 1px 0 1px; border-color:#C1C1C1; background-color:#e7eff0;} .toggleCollapse h2 { color:#183152;} #sidebar_s .collapse { border:solid 1px #C1C1C1; background:#eff5f6;} #sidebar_s .collapse:hover { background:#f5f9fa;} #taskbar, #taskbar li, #taskbar li .taskbutton { background:url(./images/layout/taskbar.png) no-repeat;} #taskbar .close, #taskbar .restore, #taskbar .minimize { background:url(./images/layout/taskbar_icon.png) no-repeat;} #taskbar li .taskbutton span { color:#FFF;} #taskbar .taskbarLeft, #taskbar .taskbarRight { background:url(./images/layout/taskbar_control.png) no-repeat;} /* Menu */ #navMenu, #navMenu li, #navMenu li.selected a, #navMenu li.selected span { background:url(../default/images/menu/menu.png) no-repeat;} #navMenu { background-color:#1871dd; } #navMenu li a, #navMenu li span { color:#FFF; } #navMenu li.selected span { color:#000; } /* Homepage */ .sidebarContent { display:block; overflow:auto; height:500px; border:solid 1px #86B4EC; background:#FFF;} .accountInfo { display:block; overflow:hidden; height:60px; padding:0 10px; background:url(./images/account_info_bg.png) repeat-x} .accountInfo p { padding:8px 0 0 0; line-height:19px;} .accountInfo p span { font-size:14px; font-weight:bold;} .accountInfo .right { float:right; padding-right:10px; text-align:right;} .accountInfo .alertInfo { float:right; width:300px; height:60px; padding-left:10px; border-left:solid 1px #accdf4;} .accountInfo .alertInfo h2 { padding:8px 0; line-height:17px;} .accountInfo .alertInfo a { padding:6px 0 0 0; line-height:21px;} /* Pages */ .pageForm .inputInfo { color:#999;} /* Pages dialog */ .dialog .pageHeader, .dialog .pageContent { border-color:#C1C1C1;} .dialog .pageContent .pageFormContent { border-color:#C1C1C1; background:#FFF;} /* Pages default */ .page .pageHeader, .pageForm .formBar { border-color:#C1C1C1; background:#ebf0f5 url(../default/images/pageHeader_bg.png) repeat-x;} .page .searchBar label { color:#183152;} /* Pages Form */ .pageForm .formBar { border-color:#C1C1C1;} .divider { border-color:#C1C1C1;} /* combox */ .combox .select a { color:#183152; } .comboxop { border-color:#B8D0D6; } .combox, .combox div, .combox div a { background:url(../default/images/search-bg.gif) no-repeat; }
zyroot
trunk/admin/dwz1.4.5/themes/silver/style.css
CSS
art
11,190
@charset "utf-8"; /* Core Code */ html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td { padding:0; margin:0; font-size:12px; line-height:100%; font-family:Arial, sans-serif;} /* Remember to define focus styles! */ :focus { outline: 0;} body { width:100%; height:100%; text-align:center; color:black; } ul, ol { list-style:none;} /* Tables still need 'cellspacing="0"' in the markup. */ table { border-collapse:separate; border-spacing:0;} caption, th, td { font-weight:normal;} /* Remove possible quote marks (") from <q>, <blockquote>. */ blockquote:before, blockquote:after, q:before, q:after { content: "";} blockquote, q { quotes: "" "";} img { border:none;} a { color:#000; text-decoration:none;} a:hover {text-decoration:underline;} /* Panel */ .panel { display:block; background-position:0 100%; background-repeat:repeat-x;} .panel .panelHeader { display:block; height:28px; padding-left:5px; background-position:0 0;} .panel .panelHeaderContent { display:block; height:28px; padding-right:5px; background-position:100% -50px; position:relative;} .panel .panelHeaderContent h1 { display:block; overflow:hidden; height:28px; padding:0 5px;line-height:28px; background-position:0 -100px; background-repeat:repeat-x;} .panel .panelContent { display:block; overflow:auto; padding:5px 5px 1px 5px; border-style:solid; border-width:0 1px;} .panel .panelFooter { display:block; overflow:hidden; height:5px; padding-left:5px; background-position:0 -150px;} .panel .panelFooterContent { display:block; overflow:hidden; height:5px; padding-right:5px; background-position:100% -200px;} .panel .collapsable, .panel .expandable { display:block; overflow:hidden; width:20px; height:21px; text-indent:-1000px; position:absolute; top:4px; right:4px;} .panel .collapsable:hover { background-position:0 -50px;} .panel .expandable { background-position:0 -100px;} .panel .expandable:hover { background-position:0 -150px;} /* Tabs */ .tabs { background-position:0 100%; background-repeat:repeat-x;} .tabs .tabsHeader { display:block; overflow:hidden; height:28px; padding-left:5px; background-position:0 0;} .tabs .tabsHeaderContent { display:block; overflow:hidden; height:28px; padding-right:5px; background-position:100% -50px;} .tabs .tabsHeader ul { display:block; height:28px; background-position:0 -100px; background-repeat:repeat-x;} .tabs .tabsHeader li { float:left; display:block; height:28px; margin-right:2px; background-position:0 -250px; background-repeat:repeat-x; cursor:pointer;} .tabs .tabsHeader li a { float:left; display:block; height:28px; padding-left:5px; background-position:0 -150px;} .tabs .tabsHeader li a:hover { text-decoration:none;} .tabs .tabsHeader li span { float:left; display:block; overflow:hidden; height:28px; padding:2px 10px 0 5px; line-height:25px; background-position:100% -200px; cursor:pointer;} .tabs .tabsHeader li.hover { background-position:0 -400px; background-repeat:repeat-x;} .tabs .tabsHeader li.hover a { background-position:0 -300px;} .tabs .tabsHeader li.hover span { background-position:100% -350px;} .tabs .tabsHeader li.selected { background-position:0 -550px;} .tabs .tabsHeader li.selected a { background-position:0 -450px;} .tabs .tabsHeader li.selected span { font-weight:bold; background-position:100% -500px;} .tabs .tabsContent { display:block; overflow:auto; padding:5px 5px 1px 5px; border-style:solid; border-width:0 1px;} .tabs .tabsFooter { display:block; overflow:hidden; height:5px; background-position:0 -600px;} .tabs .tabsFooterContent { display:block; overflow:hidden; height:5px; background-position:100% -650px;} .tabsPage .tabsPageHeader { display:block; height:27px; border-style:solid; border-width:1px 1px 0 1px; background-position:0 -450px; background-repeat:repeat-x; position:relative;} .tabsPage .tabsPageHeaderContent { display:block; overflow:hidden; height:27px; margin-right:19px; position:relative;} .tabsPage .tabsPageHeaderMargin { margin:0 34px 0 17px;} .tabsPage .tabsPageHeader ul { display:block; width:10000px; height:26px; z-index:1; position:absolute;} .tabsPage .tabsPageHeader li { float:left; display:block; height:26px; margin-left:2px; background-position:0 -100px; background-repeat:repeat-x; position:relative; cursor:pointer;} .tabsPage .tabsPageHeader li a { float:left; display:block; overflow:hidden; height:26px; padding-left:5px; line-height:25px; background-position:0 0; } .tabsPage .tabsPageHeader li a:hover { text-decoration:none;} .tabsPage .tabsPageHeader li span { float:left; display:block; overflow:hidden; width:92px; height:24px; padding:2px 20px 0 3px; line-height:21px; background-position:100% -50px; cursor:pointer;} .tabsPage .tabsPageHeader li.hover { background-position:0 -250px; background-repeat:repeat-x;} .tabsPage .tabsPageHeader li.hover a { background-position:0 -150px;} .tabsPage .tabsPageHeader li.hover span { background-position:100% -200px;} .tabsPage .tabsPageHeader li.selected { background-position:0 -400px; background-repeat:repeat-x;} .tabsPage .tabsPageHeader li.selected a { font-weight:bold; background-position:0 -300px;} .tabsPage .tabsPageHeader li.selected span { background-position:100% -350px;} .tabsPage .tabsPageHeader li .close { display:block; overflow:hidden; width:11px; height:11px; padding:0; text-indent:-1000px; position:absolute; top:3px; right:2px;} .tabsPage .tabsPageHeader li .close:hover { background-position:0 -50px;} .tabsPage .tabsPageHeader li.main span { padding:2px 8px 0 3px;} .tabsPage .tabsPageHeader li .home_icon, .tabsPage .tabsPageHeader li.main .home_icon { width:auto; padding:0 0 0 15px; background-position:0 3px;} .tabsPage .tabsMove { height:25px; position:absolute; top:0; right:0; z-index:2;} .tabsPage .tabsLeft, .tabsPage .tabsRight, .tabsPage .tabsMore { display:block; overflow:hidden; width:17px; height:23px; text-indent:-1000px; position:absolute; z-index:2;} .tabsPage .tabsLeft { background-position:0 0; top:1px; left:0; cursor:pointer;} .tabsPage .tabsLeftHover { background-position:0 -50px;} .tabsPage .tabsLeftDisabled { background-position:0 -100px; top:1px; left:0; cursor:default;} .tabsPage .tabsRight { background-position:0 -150px; top:1px; right:17px; cursor:pointer;} .tabsPage .tabsRightHover { background-position:0 -200px;} .tabsPage .tabsRightDisabled { background-position:0 -250px; top:1px; right:17px; cursor:default;} .tabsPage .tabsMore { background-position:0 -300px; top:1px; right:0; cursor:pointer;} .tabsPage .tabsMoreHover { background-position:0 -350px;} .tabsPage .tabsMoreList { display:none; overflow-x:hidden; overflow-y:auto; width:170px; max-height:380px; padding:2px; border-style:solid; border-width:1px; position:absolute; top:24px; right:0; z-index:3;} .tabsPage .tabsMoreList li { display:block; overflow:hidden; height:23px; line-height:21px;} .tabsPage .tabsMoreList li a { display:block; width:148px; height:21px; padding:0 10px; border:solid 1px #FFF; white-space:nowrap; line-height:21px;} .tabsPage .tabsMoreList li a:hover { border-color:#ececec; text-decoration:none; background:#f5f5f5;} .tabsPage .tabsMoreList li.selected a { font-weight:bold; border-color:#dfe5ed; background:#e8edf3;} .tabsPage .tabsPageContent { display:block; overflow:hidden; border-style:solid; border-width:0 1px 1px 1px; position:relative;} /* Alert */ /*.alert { overflow:hidden; position:absolute; z-index:101; width:300px; top:0}*/ .alert { overflow:hidden; z-index:1011; display:block; width:300px; margin-left:-150px; position:absolute; top:0; left:50%;} .alert .alertContent { display:block; overflow:hidden; padding:5px 5px 1px 5px; border-style:solid; border-width:0 1px;} .alert .alertInner { display:block; padding:0 9px 9px 9px; text-align:left; border-style:solid; border-width:1px;} .alert .alertInner .msg { margin:10px; max-height: 200px; overflow: auto; line-height: 1.3em} .alert h1 { display:block; overflow:hidden; height:30px; margin-bottom:10px; padding:0 0 0 25px; line-height:30px; border-style:solid; border-width:0 0 1px 0; line-height:30px;} .alert .error h1 { background-position:2px -42px;} .alert .info h1, .alert .warn h1 { background-position:2px 8px;} .alert .correct h1 { background-position:2px -92px;} .alert .confirm h1 { background-position:2px 8px;} .alert p { margin:10px;} .alert .toolBar { display:block; overflow:hidden; height:25px; padding-top:5px; text-align:right;} .alert .toolBar ul { float:right;} .alert .toolBar li { float:left;} .alert .toolBar .button, .alert .toolBar .buttonActive { margin-left:5px;} .alert .alertFooter_c { display:block; overflow:hidden; height:5px;} .alert .alertFooter { padding-left:5px; background-position:0 0;} .alert .alertFooter_r { padding-right:5px; background-position:100% -50px;} .alert .alertFooter_c { padding:0; background-position:0 -100px; background-repeat:repeat-x;} /* Dialog */ .dialog { display:block; text-align:left; position:absolute; z-index:42;} .dialog .dialogHeader, .dialog .dialogHeader_r, .dialog .dialogHeader_c { display:block; overflow:hidden; height:28px;} .dialog .dialogHeader .close, .dialog .dialogHeader .maximize, .dialog .dialogHeader .restore, .dialog .dialogHeader .minimize { display:block; overflow:hidden; text-indent:-1000px; width:19px; height:19px; position:absolute; top:5px;} .dialog .dialogHeader h1 { display:block; overflow:hidden; height:28px; padding:0 5px 0 20px; line-height:28px; background-position:0 -450px;} .dialog .dialogHeader { padding-left:5px; background-position:0 0; position:relative; cursor:move;} .dialog .dialogHeader_r { padding-right:5px; background-position:100% -50px;} .dialog .dialogHeader_c { padding:0; background-position:0 -100px; background-repeat:repeat-x;} .dialog .dialogHeader .close { background-position:0 0; right:4px;} .dialog .dialogHeader .close:hover { background-position:0 -50px;} .dialog .dialogHeader .maximize { background-position:0 -100px; right:23px;} .dialog .dialogHeader .maximize:hover { background-position:0 -150px;} .dialog .dialogHeader .restore { display:none; background-position:0 -200px; right:23px;} .dialog .dialogHeader .restore:hover { background-position:0 -250px;} .dialog .dialogHeader .minimize { background-position:0 -300px; right:42px;} .dialog .dialogHeader .minimize:hover { background-position:0 -350px;} .dialog .dialogContent { display:block; overflow:hidden; padding:5px 5px 1px 5px; border-style:solid; border-width:0 1px;} .dialog .panelFooter_r, .dialog .dialogFooter_c { display:block; overflow:hidden; height:5px;} .dialog .dialogFooter { padding-left:5px; background-position:0 -150px;} .dialog .dialogFooter_r { padding-right:5px; background-position:100% -200px;} .dialog .dialogFooter_c { padding:0; background-position:0 -250px; background-repeat:repeat-x;} .dialogProxy { opacity:0.8; filter:alpha(opacity=80);} .dialog .resizable_f_r { width:11px; height:11px; background-position:0 -400px;} /* Dialog Resizable */ .resizable { display:none; overflow:hidden; border-style:dashed; border-width:1px; opacity:0.5; filter:alpha(opacity=50); position:absolute; top:0; left:0; z-index:100;} .resizable_h_l, .resizable_h_r, .resizable_h_c, .resizable_c_l, .resizable_c_r, .resizable_f_l, .resizable_f_r, .resizable_f_c { display:block; overflow:hidden; width:6px; height:6px; position:absolute;} .resizable_h_l { cursor:nw-resize; top:0; left:0; z-index:2;} .resizable_h_r { cursor:ne-resize; top:0; right:0; z-index:2;} .resizable_h_c { width:100%; cursor:n-resize; top:0; left:0; z-index:1;} .resizable_c_l { cursor:w-resize; top:0; left:0; z-index:1;} .resizable_c_r { cursor:e-resize; top:0; right:0; z-index:1;} .resizable_f_l { cursor:sw-resize; bottom:0; left:0; z-index:2;} .resizable_f_r { cursor:se-resize; bottom:0; right:0; z-index:2;} .resizable_f_c { width:100%; cursor:s-resize; bottom:0; left:0; z-index:1;} /* Shadow */ .shadow { display:none; overflow:hidden; position:absolute; z-index:41;} .shadow .shadow_h, .shadow .shadow_h_l, .shadow .shadow_h_r, .shadow .shadow_h_c, .shadow .shadow_f, .shadow .shadow_f_l, .shadow .shadow_f_r, .shadow .shadow_f_c { display:block; overflow:hidden; height:6px;} .shadow .shadow_h, .shadow .shadow_c, .shadow .shadow_f { position:relative;} .shadow .shadow_h_l, .shadow .shadow_c_l, .shadow .shadow_f_l { width:6px; position:absolute; top:0; left:0;} .shadow .shadow_h_r, .shadow .shadow_c_r, .shadow .shadow_f_r { width:6px; position:absolute; top:0; right:0;} .shadow .shadow_h_c, .shadow .shadow_c_c, .shadow .shadow_f_c { margin:0 6px;} .shadow .shadow_c, .shadow .shadow_c_l, .shadow .shadow_c_r, .shadow .shadow_c_c { display:block; overflow:hidden; height:100%;} /* Tree */ .tree li { clear:both; display:block; line-height:22px; cursor:pointer;} .tree div, .tree a, .tree span { display:inherit; height:22px; line-height:22px;} .tree div { display:block; overflow:hidden;} .tree div div { float:left; display:block; overflow:hidden; width:22px; height:22px; border:none; background-position:0 -100px;} .tree a, .tree a:hover { text-decoration:none;} .tree .collapsable { background-position:0 -300px;} .tree .first_collapsable { background-position:0 -250px;} .tree .last_collapsable { background-position:0 -350px;} .tree .expandable { background-position:0 -100px;} .tree .first_expandable { background-position:0 -50px;} .tree .last_expandable { background-position:0 -150px;} .tree .end_expandable { background-position:0 0;} .tree .end_collapsable { background-position:0 -200px;} .tree .indent { background:none;} .tree .line { background-position:0 -400px;} .tree .node { background-position:0 -450px;} .tree .last .node { background-position:0 -500px;} .tree .folder_expandable { background-position:0 0;} .tree .folder_collapsable { background-position:0 -50px;} .tree .file { background-position:0 -100px;} .tree .unchecked { background-position:0 0;} .tree .hover .unchecked { background-position:0 -50px;} .tree .checked { background-position:0 -100px;} .tree .hover .checked { background-position:0 -150px;} .tree .indeterminate { background-position:0 -200px;} .tree .hover .indeterminate { background-position:0 -250px;} /* Accordion */ .accordion { display:block; border-style:solid; border-width:1px 1px 0 1px;} .accordion .accordionHeader { display:block; overflow:hidden; background-repeat:repeat-x; cursor:pointer;} .accordion .accordionHeader h2 { display:block; overflow:hidden; padding:0 25px 0 5px; height:25px; line-height:24px;} .accordion .accordionHeader h2 span { float:left; display:block; overflow:hidden; text-indent:-1000px; width:20px; height:25px;} .accordion .accordionContent { display:block; overflow:auto; border-style:solid; border-width:0 0 1px 0;} .accordion .accordionHeader.hover { background-position:0 -25px;} .accordion .accordionHeader h2 { background-repeat:no-repeat; background-position:100% -50px;} .accordion .accordionHeader.hover h2 { background-position:100% -75px;} .accordion .accordionHeader .collapsable { background-position:100% -100px;} .accordion .accordionHeader.hover .collapsable { background-position:100% -125px;} .accordion .accordionHeader h2 span { background-position:0 -150px;} /* Grid */ .panel .grid { border-style:solid; border-width:0 1px;} .panel .panelBar { border-width:1px;} .panelBar { display:block; overflow:hidden; height:25px; border-style:solid; border-width:1px 0; background-repeat:repeat-x; } .panelBar ul { padding:1px;} .panelBar li { float:left; display:block; overflow:hidden; height:23px; padding:0 0 0 5px;} .panelBar li.hover { background-position:0 -100px;} .panelBar li.hover a { background-position:100% -150px;} .panelBar .toolBar li, .panelBar .toolBar li.hover { padding:0 0 0 5px; background-position:0 -100px;} .panelBar .toolBar a, .panelBar .toolBar li.hover a { float:left; display:block; overflow:hidden; padding:0 5px 0 0; text-decoration:none; background-position:100% -150px;} .panelBar .toolBar span, .panelBar .toolBar li.hover span { float:left; display:block; overflow:hidden; height:23px; padding:0 0 0 20px; line-height:23px; cursor:pointer;} .panelBar .toolBar a.add span { background-position:0 -696px;} .panelBar .toolBar a.delete span { background-position:0 -746px;} .panelBar .toolBar a.edit span { background-position:0 -796px;} .panelBar .toolBar a.icon span { background-position:0 -846px;} .panelBar .toolBar li.line { display:block; overflow:hidden; width:12px; padding:0; text-indent:-1000px; background-position:5px -200px;} .panelBar .pages { float:left; overflow:hidden; height:21px; padding:2px 5px;} .panelBar .pages span { float:left; line-height:21px;} .panelBar .pages select { float:left; margin:0 3px; font-size:12px;} .pagination { float:right; padding-left:7px; background-position:0 -199px;} .pagination li, .pagination li.hover { padding:0 0 0 5px; background-position:0 -100px;} .pagination a, .pagination li.hover a, .pagination li span { float:left; display:block; padding:0 5px 0 0; text-decoration:none; line-height:23px; background-position:100% -150px;} .pagination li.selected a{color:red; font-weight:bold;} .pagination span, .pagination li.hover span { float:left; display:block; height:23px; line-height:23px; cursor:pointer;} .pagination li .first span, .panelBar li .previous span { padding:0 0 0 10px;} .pagination li .next span, .panelBar li .last span { padding:0 10px 0 0;} .pagination li .first span { background-position:0 -244px;} .pagination li .previous span { background-position:0 -294px;} .pagination li .next span { background-position:100% -344px;} .pagination li .last span { background-position:100% -394px;} .pagination li .last { margin-right:5px;} .pagination li.disabled { background:none;} .pagination li.disabled span, .grid .pagination li.disabled a { background-position:0 100px; cursor:default;} .pagination li.disabled span span { color:#666;} .pagination li.disabled .first span { background-position:0 -444px;} .pagination li.disabled .previous span { background-position:0 -494px;} .pagination li.disabled .next span { background-position:100% -544px;} .pagination li.disabled .last span { background-position:100% -594px;} .pagination li.disabled .last { margin-right:5px;} .pagination li.jumpto { padding:2px 2px 0 7px; background-position:0 -200px;} .pagination li.jumpto .textInput { float:left; width:30px; padding:1px; border-color:#acaeaf;} .pagination li.jumpto .goto { float:left; display:block; overflow:hidden; width:16px; height:19px; border:0; text-indent:-1000px; background-position:0 -650px; cursor:pointer;} .grid { display:block; overflow:hidden; width:100%; border-width:0 1px; position:relative;} .grid .gridHeader { display:block; overflow:hidden; width:auto;} .grid .gridThead { } .grid .gridScroller { display:block; overflow:auto; position:relative;} .grid .gridTbody { } .grid table { border:0; border-collapse:collapse;table-layout:fixed;} .grid .gridHeader th { padding:0 3px; border-style:solid; border-width:0 1px 1px 0; vertical-align:top; white-space:nowrap; line-height:21px; cursor:default;} .grid .gridHeader th.hover, .grid .gridHeader th.thSelected { background-position:0 -50px;} .grid .gridTbody td { border-right:solid 1px #ededed; overflow:hidden; padding:0 3px; border-bottom:solid 1px #ededed; vertical-align:middle; line-height:21px;} .grid .gridTbody td div { display:block; overflow:hidden; height:21px; white-space:nowrap; line-height:21px;} .grid .gridTbody td div a{line-height:21px;} .grid .gridRow { border-style:solid; border-width:0 0 1px 0; cursor:default;} .grid .gridRow td.tdLast { padding:0 4px 0 5px; border-right:solid 1px;} .grid .gridCol { width:100%; display:block; overflow:hidden; height:21px; line-height:21px; white-space:nowrap;} .grid .gridTbody .selected td { border-bottom-style:dotted; border-bottom-width:1px;} .grid .gridTbody .selected .tdSelected {} .grid .gridTbody .tdSelected { } .grid .resizeMarker, .grid .resizeProxy { display:block; overflow:hidden; width:1px; position:absolute;} .grid .left { text-align:left;} .grid .right { text-align:right;} .grid .center { text-align:center;} /* CSS Table */ table.list {border-collapse:collapse; border:solid 1px #ededed;} table.list thead tr {background:url("../default/images/grid/tableth.png") repeat-x scroll 0 0 #F0EFF0;} table.list th {padding:1px 2px; line-height:21px; border-right: solid 1px #D0D0D0; border-bottom:solid 1px #D0D0D0; font-weight:bolder; } table.list td {padding:1px 2px; line-height:21px; border-right:solid 1px #ededed;} table.list th.asc, .grid .gridHeader th.asc{background-position: 100% 0; background:url(../default/images/order_up.gif) no-repeat right; cursor:pointer;} table.list th.desc, .grid .gridHeader th.desc{background-position: 100% 0; background:url(../default/images/order_down.gif) no-repeat right; cursor:pointer;} table.list tbody {background-color:#fff;} table.list .right {text-align:right;} table.list .trbg {background-color:#F8F8F8;} table.list .hot {background-color:#fff5c0;} table.list .hover {background-color:#e4f5ff;} table.list .selected {background-color:#7cc5e5;border-color:#b8d0d6; } table.list a {color:#3C7FB1; font-size:11px; line-height:20px;} table.list a:hover {text-decoration:underline; line-height:20px;} table.list td span.error {z-index:-1} table.nowrap tbody tr {border-bottom:solid 1px #ededed;} /* Taskbar */ #taskbar { overflow:hidden; height:29px; border-style:solid; border-width: 0; border-color:#0f3255; background-color:#112746; background-repeat:repeat-x; position:absolute; z-index:30;} #taskbar .taskbarContent { display:block; overflow:hidden; height:29px; position:relative;} #taskbar .taskbarMargin { margin:0 20px;} #taskbar ul { position:absolute; width:10000px;} #taskbar li { float:left; height:27px; margin-left:2px; padding-left:5px; background-position:0 -50px; position:relative; cursor:pointer;} #taskbar li .taskbutton { float:left; display:block; overflow:hidden; height:27px; background-position:100% -100px;} #taskbar li .taskbutton span { display:block; overflow:hidden; width:70px; height:27px; line-height:29px; padding:0 25px 0 20px; background-position:3px -42px;} #taskbar .selected { background-position:0 -250px;} #taskbar .selected .taskbutton { background-position:100% -300px;} #taskbar .hover { background-position:0 -150px;} #taskbar .hover .taskbutton { background-position:100% -200px;} #taskbar .close, #taskbar .restore, #taskbar .minimize { display:block; overflow:hidden; width:11px; height:11px; padding:0; text-indent:-1000px; position:absolute; top:5px;} #taskbar .close { right:3px;} #taskbar .closeHover { background-position:0 -50px;} #taskbar .restore { right:14px; background-position:0 -100px;} #taskbar .restoreHover { background-position:0 -150px;} #taskbar .minimize { right:14px; background-position:0 -200px;} #taskbar .minimizeHover { background-position:0 -250px;} #taskbar .taskbarLeft, #taskbar .taskbarRight { display:block; overflow:hidden; width:18px; height:29px; text-indent:-1000px; position:absolute; top:0;} #taskbar .taskbarLeft { background-position:0 0; left:2px; cursor:pointer;} #taskbar .taskbarLeftHover { background-position:0 -50px;} #taskbar .taskbarLeftDisabled { background-position:0 -100px; cursor:default;} #taskbar .taskbarRight { background-position:0 -150px; right:2px; cursor:pointer;} #taskbar .taskbarRightHover { background-position:0 -200px;} #taskbar .taskbarRightDisabled { background-position:0 -250px; cursor:default;} /* ProgressBar */ .progressBar { display:block; width:148px; height:28px; position:fixed; top:50%; left:50%; margin-left:-74px; margin-top:-14px; padding:10px 10px 10px 50px; text-align:left; line-height:27px; font-weight:bold; position:absolute; z-index:2001;} .background { display:block; width:100%; height:100%; opacity:0.4; filter:alpha(opacity=40); background:#FFF; position:absolute; top:0; left:0; z-index:2000;} .alertBackground { display:none; width:100%; height:100%; opacity:0.4; filter:alpha(opacity=40); background:#FFF; position:absolute; top:0; left:0; z-index:1010;} .dialogBackground { display:none; width:100%; height:100%; opacity:0.4; filter:alpha(opacity=40); background:#FFF; position:absolute; top:0; left:0; z-index:900;} /* ----------------------------------------------------------------- Form */ /* TextInput */ .textInput, input.focus, input.required, input.error, input.readonly, input.disabled, textarea.focus, textarea.required, textarea.error, textarea.readonly, textarea.disabled { padding:2px; margin:0; line-height:15px; font-size:12px; border-style:solid; border-width:1px;} input.required, textarea.required { background-position:100% 0;} input.gray, textarea.gray{color:gray;} select { border:1px solid; border-color: #A2BAC0 #B8D0D6 #B8D0D6 #A2BAC0} .inputButton { float:left; display:block; overflow:hidden; text-indent:-1000px; width:16px; height:21px;} .inputButton:hover { background-position:0 -50px;} .inputDateButton { float:left; display:block; overflow:hidden; text-indent:-1000px; width:16px; height:21px; background-position:0 -100px;} .inputDateButton:hover { background-position:0 -150px;} span.error { display:block; overflow:hidden; width:165px; height:21px; padding:0 3px; line-height:21px; background:#F00; color:#FFF; position:absolute; top:5px; left:318px;} label.alt {display:block; overflow:hidden; position:absolute;line-height:20px} /* Button */ .button, .buttonActive, .buttonDisabled { float:left; display:block; overflow:hidden; height:25px; padding-left:5px;} .button span, .buttonDisabled span, .buttonActive span, .button .buttonContent, .buttonHover, .buttonHover .buttonContent, .buttonActive .buttonContent, .buttonDisabled .buttonContent { float:left; display:block; overflow:hidden; height:25px; line-height:25px; font-weight:bold;} .button { background-position:0 0;} .button .buttonContent { padding:0 5px 0 0; background-position:100% -50px;} .button span { padding:0 10px 0 5px; background-position:100% -50px; cursor:pointer;} .button:hover { text-decoration:none; background-position:0 -100px;} .button:hover span { background-position:100% -150px;} .buttonHover { padding-left:5px; background-position:0 -100px;} .buttonHover .buttonContent { padding:0 5px 0 0; background-position:100% -150px;} .buttonActive { background-position:0 -200px;} .buttonActive .buttonContent { padding:0 5px 0 0; background-position:100% -250px;} .buttonActive span { padding:0 10px 0 5px; background-position:100% -250px; cursor:pointer;} .buttonActive:hover { text-decoration:none; background-position:0 -300px;} .buttonActive:hover span { background-position:100% -350px;} .buttonActiveHover { background-position:0 -300px;} .buttonActiveHover .buttonContent { padding:0 5px 0 0; background-position:100% -350px;} .buttonDisabled, .buttonDisabled:hover { text-decoration:none; background-position:0 -400px;} .buttonDisabled span, .buttonDisabled:hover span { padding:0 10px 0 5px; background-position:100% -450px; cursor:default;} .buttonDisabled .buttonContent { padding:0 5px 0 0; background-position:100% -450px;} .button button, .buttonHover button, .buttonActive button, .buttonDisabled button { width:auto; height:25px; margin:0; padding:0 0 5px 0; border:0; font-size:12px; font-weight:bold; background:none; cursor:pointer;} .buttonDisabled button { cursor:default;} /* ----------------------------------------------------------------- Pages */ /* Layout */ #layout { text-align:left;} body { overflow:hidden;} #layout { display:block; height:100%; position:relative;} #header { display:block; overflow:hidden; height:50px; z-index:30} #leftside { position:absolute; top:55px; left:0; z-index:20;} #sidebar { width:200px; position:absolute; top:0; left:5px; z-index:20; overflow:hidden;} #sidebar_s { display:none; width:24px; position:absolute; top:0; left:0; z-index:21;} #container { position:absolute; top:55px; left:210px;} #splitBar { display:block; overflow:hidden; width:5px; cursor:col-resize; position:absolute; top:55px; left:205px; z-index:20;} #splitBarProxy { display:none; overflow:hidden; width:3px; border-style:solid; border-width:1px; cursor:col-resize; position:absolute; top:55px; left:205px; z-index:20;} #footer {position:absolute; bottom:0; left:0; text-align:center; width:100%; height:21px; padding:0 5px;z-index:-1} #header .headerNav { height:50px; background-repeat:no-repeat; background-position:100% -50px;} #header .logo { float:left; width:250px; height:50px; text-indent:-1000px;} #header .nav { display:block; height:21px; position:absolute; top:8px; right:0; z-index:31;} #header .nav li { float:left; margin-left:-1px; padding:0 10px; line-height:11px; position:relative;} #header .nav li a { line-height:11px;} #header .nav ul { display:none; width:230px; border:solid 1px #06223e; overflow:hidden; background:#FFF; position:absolute; top:20px; right:0;} #header .nav ul li { margin-top:10px; height:21px;} #header .nav ul li a { color:#000;} #header .nav .selected ul {display:block;} #header .themeList { position:absolute; top:30px; right:10px;} #header .themeList li { float:left; padding:0 3px;} #header .themeList li div { display:block; overflow:hidden; width:13px; height:11px; text-indent:-100px; cursor:pointer;} #header .themeList li.default div { background-position:0 0;} #header .themeList li.default .selected { background-position:0 -20px;} #header .themeList li.green div { background-position:-20px 0;} #header .themeList li.green .selected { background-position:-20px -20px;} #header .themeList li.red div { background-position:-40px 0;} #header .themeList li.red .selected { background-position:-40px -20px;} #header .themeList li.purple div { background-position:-60px 0;} #header .themeList li.purple .selected { background-position:-60px -20px;} #header .themeList li.silver div { background-position:-80px 0;} #header .themeList li.silver .selected { background-position:-80px -20px;} #header .themeList li.azure div { background-position:-100px 0;} #header .themeList li.azure .selected { background-position:-100px -20px;} .toggleCollapse { display:block; overflow:hidden; height:26px; border-style:solid; border-width:1px 1px 0 1px; background-repeat:repeat-x;} .toggleCollapse h2 { float:left; padding-left:8px; line-height:26px;} .toggleCollapse div { float:right; display:block; overflow:hidden; width:25px; height:25px; text-indent:-100px; background-position:100% -47px; cursor:pointer;} .toggleCollapse div:hover { background-position:100% -97px;} #sidebar_s .collapse { height:430px; cursor:pointer;} #sidebar_s .toggleCollapse { border:0; background:none;} #sidebar_s .toggleCollapse div { width:21px; border:0; background-position:-2px -147px;} #sidebar_s .toggleCollapse div:hover { background-position:-2px -197px;} /* Menu */ #navMenu { display:block; overflow:hidden; height:35px; padding:0 5px; background-repeat:repeat-x;} #navMenu ul { float:left; display:block; overflow:hidden; position:relative;} #navMenu li { float:left; margin-left:-1px; background-position:0 -50px; position:relative;} #navMenu li a { float:left;} #navMenu li span { float:left; font-weight:bold; cursor:pointer; padding:0 15px;} #navMenu li a, #navMenu li span { line-height:35px; font-size:14px;} #navMenu li.selected { z-index:1;} #navMenu li.selected a, #navMenu li.selected a:hover { text-decoration:none; background-position:100% -150px;} #navMenu li.selected span { padding:0 8px; background-position:0 -100px;} /* Pages default */ .page { display:block; overflow:hidden;float:left; width:100%;} .pageHeader { display:block; overflow:auto; margin-bottom:1px; padding:5px; border-style:solid; border-width:0 0 1px 0; position:relative;} .searchBar {} .searchBar ul.searchContent { display:block; overflow:hidden; height:25px;} .searchBar ul.searchContent li { float:left; display:block; overflow:hidden; width:300px; height:21px; padding:2px 0;} .searchBar label { float:left; width:80px; padding:0 5px; line-height:23px;} .searchBar .searchContent td{padding-right:20px; white-space:nowrap; height:25px} .searchBar .subBar { height:25px;} .searchBar .subBar ul { float:right;} .searchBar .subBar li { float:left; margin-left:5px;} .pageContent { display:block;overflow:auto;position:relative;} .dateRange input{width:72px;} .dateRange .limit {text-align: center; width: 15px; line-height:21px; } /* Pages Form */ .pageForm { display:block; overflow:auto;} .pageFormContent { display:block; overflow:auto; padding:10px 5px; position:relative;} .pageFormContent div.unit {display:block; margin:0; padding:5px 0; position:relative;clear:both;} .pageFormContent p { float:left; display:block; width:380px; height:21px; margin:0; padding:5px 0; position:relative;} .pageFormContent p.nowrap { height:auto; width: 100%} .pageFormContent .radioGroup { float:left; display:block; overflow:hidden;} .pageFormContent label { float:left; width:120px; padding:0 5px; line-height:21px;} .pageFormContent label.radioButton { float:left; width:auto; padding:0 10px 0 0; line-height:21px;} .pageFormContent .textInput { float:left;} .pageFormContent select { float:left;} .pageFormContent .inputInfo { padding:0 5px; line-height:21px;} .pageFormContent span.unit, .pageFormContent a.unit { padding:0 5px; line-height:21px;} .pageFormContent span.info{color:#7F7F7F;display:block;line-height:21px;float:left;} .pageFormContent dl { float:left; display:block; width:380px; height:21px; margin:0; padding:5px 0; position:relative;} .pageFormContent dt { float:left; width:120px; padding:0 5px; line-height:21px;} .pageFormContent dd {display:block;line-height:21px;width:220px;float:left;} .pageFormContent dl.nowrap, .nowrap dl{width:100%; height:auto; clear: both;} .pageFormContent dl.nowrap dd, .nowrap dd {width: 560px;} fieldset {padding:3px; margin:0 0 5px 0; border:1px dotted #B8D0D6;} fieldset legend {padding:2px; border:1px dotted #B8D0D6; font-weight: bold;} fieldset legend:hover {background-color: #dddddd;} .formBar { clear:both; padding:0 5px; height:30px; padding-top:5px; border-style:solid; border-width:1px 0 0 0;} .formBar ul { float:right;} .formBar li { float:left; margin-left:5px;} .divider { clear:both; display:block; overflow:hidden; text-indent:-1000px; width:auto; height:1px; padding:4px 0 0 0; margin-bottom:5px; border-style:dotted; border-width:0 0 1px 0;} /* Pages dialog */ .dialog .pageHeader { border-style:solid; border-width:1px;margin:0} .dialog .pageContent { border-style:solid; border-width:0 1px; background-color:#fff} .dialog .pageFormContent, .dialog .viewInfo { border-style:solid; border-width:1px 0 0 0;} .dialog .formBar { border-style:solid; border-width:1px 0;} .combox { float:left; margin-right:3px; background-position:100% -25px;} .combox select { display:none} .combox .select { float:left;} .combox .select a { float:left; display:block; overflow:hidden; height:23px; padding:0 22px 0 6px; line-height:21px; text-decoration:none; font-size:12px; background-position:100% -50px;} .comboxop { position: absolute; z-index: 1001; display:none; padding:4px; border-style:solid; border-width:1px 2px 2px 1px; background:#fff; position:absolute; top:22px; left:1px;} .comboxop a { width:50px; height:21px; padding:0 5px; line-height:21px; text-align:left; color:#000; background:none;} .comboxop a:hover { background:#e0e0e0;} .comboxop .selected { background:#e0e0e0; } .comboxop li { text-align:left; } /* contentTitle */ h2.contentTitle{margin-bottom:10px; padding:0 10px; line-height:30px; font-size:14px; border-bottom:solid 1px #CCC;} h3.contentTitle{margin-bottom:5px; line-height:25px; font-size:13px; border-bottom:solid 1px #CCC;clear:both;} .dialog h2.contentTitle {border:none} /* rightMenu */ #contextmenu{display:none; position:absolute; z-index:500; left:0; top:0;} #contextmenu ul{list-style:none; padding:1px; margin:0; background-color:#fff; border:1px solid #999; width:150px;} #contextmenu li{display:block; color:#000; padding:3px; margin:0; border:1px solid #fff; background-color:transparent; text-align:left; cursor:default;} #contextmenu li.hover{border:1px solid #0a246a; background-color:#b6bdd2} #contextmenu li.disabled{color:#666;} #contextmenuShadow{display:none; position:absolute; opacity:0.2; filter:alpha(opacity=20); background-color:#000; z-index:499; } /* calendar */ #calendar{margin:0; width:208px; z-index:1001; position:absolute; display:block; border:1px solid #B3E4EB; display:none;} #calendar *{margin:0; padding:0; font-size:12px; line-height:18px} #calendar .main{margin:auto; padding:2px; text-align:center; background:#ffffff; zoom:1; position:relative;} #calendar .head{background:#EDF8FF; border:1px solid #BEE9F0} #calendar .head select{width:60px;} #calendar .body{margin:2px 0; padding:2px; clear:both; overflow:hidden; border:1px solid #BEE9F0;position:relative;} #calendar .foot{background:#EDF8FF; border:1px solid #BEE9F0; text-align:right;padding:1px} #calendar .nodate .head, #calendar .nodate .body{display:none;} #calendar dl{clear:both; margin:auto; overflow:hidden;} #calendar dt, #calendar dd, #calendar span{width:26px; height:18px; display:block; float:left; overflow:hidden;zoom:1; border:1px solid #fff;} #calendar dt{margin-top:4px;font-weight:bold;color:#666666;} #calendar .days dd{cursor:pointer;} #calendar .days dd.other{color:#6A6AFF} #calendar .days dd.slt{ background:#B3E4EB; border:1px solid #66CCCC;} #calendar .days dd:hover{ border:1px solid #66CCCC;} #calendar .days dd.disabled {background:#ccc;} #calendar .close{width:16px;height:16px; font-size:16px; display:block;cursor:pointer;border:1px solid #CCC;text-align:center; } #calendar .clearBut, #calendar .okBut { background-color: #CFEBEE; border: 1px solid #38B1B9; color: #08575B; width: 40px; } #calendar .time{border-collapse:collapse;float:left;background-color:#fff;display:none;} #calendar .time td{border:1px solid #61CAD0; line-height:16px; vertical-align:center;} #calendar .time .hh, #calendar .time .mm, #calendar .time .ss{width:18px; height:16px; border: none} #calendar .time ul {list-style:none} #calendar .time .up, #calendar .time .down {font-size:8px;height:8px;line-height:100%;border:1px solid #BEE9F0;cursor:pointer;} #calendar .tm {text-align:center;} #calendar .tm .hh, #calendar .tm .mm, #calendar .tm .ss{border:1px solid #A3C6C8;position:absolute;left:4px;bottom:34px;background-color:#ffffc0;width:120px;display:none;} #calendar .hh .hh, #calendar .mm .mm, #calendar .ss .ss{display:block;} #calendar .tm .hh li, #calendar .tm .mm li, #calendar .tm .ss li{display:block;float:left;cursor:pointer;width:20px;line-height:21px} #calendar .tm .hh li:hover, #calendar .tm .mm li:hover, #calendar .tm .ss li:hover{ background:#B3E4EB;} /* suggest */ #suggest{position:absolute; z-index:2000; left:0; top:0;} #suggest ul{list-style:none; padding:1px; margin:0; background-color:#fff; border:1px solid #999; width:150px;} #suggest li{display:block; color:#000; padding:3px; margin:0; border:1px solid #fff; background-color:transparent; text-align:left; cursor:default;} #suggest li.selected{border:1px solid #0a246a; background-color:#b6bdd2} /* button */ a.btnAdd, a.btnDel, a.btnView, a.btnEdit, a.btnSelect, a.btnInfo, a.btnAssign, a.btnLook, a.btnAttach{background:url(../default/images/button/imgX.gif) no-repeat; display:block; width:22px; height:20px; text-indent:-1000px; overflow:hidden; float:left; margin-right: 3px} a.btnAdd{background-position:0 0} a.btnDel{background-position: -23px 0} a.btnInfo{background-position: -46px 0} a.btnAssign{background-position: -69px 0} a.btnView{background-position: -115px 0} a.btnEdit{background-position: -138px 0} a.btnSelect{background-position: -92px 0} a.btnLook{background-position: -161px 0} a.btnAttach{background-position: -183px 0} .center a.btnAdd, .center a.btnDel, .center a.btnView, .center a.btnEdit, .center a.btnSelect, .center a.btnInfo, .center a.btnAssign, .center a.btnLook, .center a.btnAttach {display:inline-block;float:none} .right a.btnAdd, .right a.btnDel, .right a.btnView, .right a.btnEdit, .right a.btnSelect, .right a.btnInfo, .right a.btnAssign, .right a.btnLook, .right a.btnAttach {display:inline-block;float:none;text-indent:1000px} .viewInfo {padding: 10px 5px} .viewInfo dl { float:left; display:block; width:380px; height:21px; margin:0; padding:5px 0; position:relative;} .viewInfo dt { float:left; width:120px; padding:0 5px; line-height:21px; text-align:right;} .viewInfo dd {display:block;line-height:21px;width:220px;float:left;border-bottom: 1px dotted #999; min-height:21px} .viewInfo dl.nowrap {width:100%; height:auto; clear: both;} .viewInfo dl.nowrap dt {} .viewInfo dl.nowrap dd {width: auto;} .dialogContent .viewInfo {background-color:#fff} .pageContent .panel {clear:both; margin: 5px} .sortDragPlaceholder {border:1px dashed #ccc;} #printBox {display:none}
zyroot
trunk/admin/dwz1.4.5/themes/css/core.css
CSS
art
41,583
@charset "utf-8"; html, body { *overflow:hidden;} #header .nav li a { line-height:14px;} #header .menu li a, #header .menu li span { line-height:37px;} #taskbar li .taskbutton span { line-height:31px;} .toggleCollapse h2 { line-height:27px;} /* Panel */ .panel .panelHeaderContent h1 { line-height:32px;} /* Accordion */ .accordion .accordionHeader h2 { line-height:27px;} /* Tabs */ .tabsHeader li span { line-height:32px;} .tabsPanel .panelHeader li span { line-height:30px;} .tabsPanel .panelHeader li.selected span { line-height:32px;} .tabsPage .tabsPageHeader { width:auto;} .tabsPage .tabsPageHeader li span { _line-height:24px; font-family:"宋体"} .tabsPage .tabsRight { _right:16px;} .tabsPage .tabsMore { _right:-1px;} .tabsPage .tabsMoreList { _right:-1px;} .tabsPage .tabsMoreList li a { line-height:23px;} /* Alert */ .alert h1, .alert h1 { line-height:34px;} /* Dialog */ .dialog .dialogHeader h1 { line-height:32px;} /* Shadow */ .shadow .shadow_h_l { _background:none; _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale, src="themes/default/images/shadow/shadow_h_l.png");} .shadow .shadow_h_r { _background:none; _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale, src="themes/default/images/shadow/shadow_h_r.png");} .shadow .shadow_h_c { _background:none; _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale, src="themes/default/images/shadow/shadow_h_c.png");} .shadow .shadow_c_l { _background:none; _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale, src="themes/default/images/shadow/shadow_c_l.png");} .shadow .shadow_c_r { _background:none; _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale, src="themes/default/images/shadow/shadow_c_r.png");} .shadow .shadow_c_c { _background:none; _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale, src="themes/default/images/shadow/shadow_c_c.png");} .shadow .shadow_f_l { _background:none; _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale, src="themes/default/images/shadow/shadow_f_l.png");} .shadow .shadow_f_r { _background:none; _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale, src="themes/default/images/shadow/shadow_f_r.png");} .shadow .shadow_f_c { _background:none; _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale, src="themes/default/images/shadow/shadow_f_c.png");} /* Tree */ .tree a, .tree span { line-height:24px;} .tree a { _margin-left:-3px;} /* Grid */ .panelBar .toolBar span, .panelBar .toolBar li.hover span, .panelBar .pagination span, .panelBar .pagination li.hover span { line-height:25px;} .grid .gridCol { line-height:23px;} /* ----------------------------------------------------------------- Form */ /* TextInput */ .textInput, .textInputHover, .textInputRequired, .textInputInvalid, .textInputReadonly, .textInputDisabled, .textArea, .textAreaHover, .textAreaRequired, .textAreaInvalid, .textAreaReadonly, .textAreaDisabled { padding:3px 2px 1px 2px;} /* Button */ .button span, .buttonDisabled span, .buttonActive span, .button button, .buttonActive button, .buttonDisabled button { line-height:27px;} /* calendar */ #calendar .time .hh, #calendar .time .mm, #calendar .time .ss {border:0} #calendar .time .up, #calendar .time .down {font-size:7px;}
zyroot
trunk/admin/dwz1.4.5/themes/css/ieHack.css
CSS
art
3,612