⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qzfl.js

📁 dev控件,C#开发中使用的控件
💻 JS
📖 第 1 页 / 共 5 页
字号:
return null;},swapNode:function(node1,node2){if(node1.swapNode){node1.swapNode(node2);}else{var parent=node2.parentNode;var next=node2.nextSibling;if(next==node1){parent.insertBefore(node1,node2);}else if(node2==node1.nextSibling){parent.insertBefore(node2,node1);}else{node1.parentNode.replaceChild(node2,node1);parent.insertBefore(node1,next);}}},createElementIn:function(tagName,el,insertFirst,attributes){tagName=tagName||"div";el=this.get(el)||document.body;var _doc=el.ownerDocument;var _e=_doc.createElement(tagName);if(attributes){for(var k in attributes){if(/class/.test(k)){_e.className=attributes[k];}else if(/style/.test(k)){_e.style.cssText=attributes[k];}else{_e[k]=attributes[k];}}}if(insertFirst){el.insertBefore(_e,el.firstChild);}else{el.appendChild(_e);}return _e;},getStyle:function(el,property){el=this.get(el);var w3cMode=document.defaultView&&document.defaultView.getComputedStyle;var computed=!w3cMode?null:document.defaultView.getComputedStyle(el,'');var value="";switch(property){case"float":property=w3cMode?"cssFloat":"styleFloat";break;case"opacity":if(!w3cMode){var val=100;try{val=el.filters['DXImageTransform.Microsoft.Alpha'].opacity;}catch(e){try{val=el.filters('alpha').opacity;}catch(e){}}return val/100;}break;case"backgroundPositionX":if(w3cMode){property="backgroundPosition";return((computed||el.style)[property]).split(" ")[0];}break;case"backgroundPositionY":if(w3cMode){property="backgroundPosition";return((computed||el.style)[property]).split(" ")[1];}break;}if(w3cMode){return(computed||el.style)[property];}else{return(el.currentStyle[property]||el.style[property]);}},setStyle:function(el,property,value){el=this.get(el);if(!el){return false;}var w3cMode=document.defaultView&&document.defaultView.getComputedStyle;switch(property){case"float":property=w3cMode?"cssFloat":"styleFloat";case"opacity":if(!w3cMode){if(value>=1){el.style.filter="";return;}el.style.filter='alpha(opacity='+(value*100)+')';return true;}else{el.style[property]=value;return true;}break;case"backgroundPositionX":if(w3cMode){var _y=QZFL.dom.getStyle(el,"backgroundPositionY");el.style["backgroundPosition"]=value+" "+(_y||"top");}else{el.style[property]=value;}break;case"backgroundPositionY":if(w3cMode){var _x=QZFL.dom.getStyle(el,"backgroundPositionX");el.style["backgroundPosition"]=(_x||"left")+" "+value;}else{el.style[property]=value;}break;default:if(typeof el.style[property]=="undefined"){return false}el.style[property]=value;return true;}},createNamedElement:function(type,name,doc){doc=doc||document;var element;try{element=doc.createElement('<'+type+' name="'+name+'">');}catch(ignore){}if(!element||!element.name){element=doc.createElement(type);element.name=name;}return element;},getPosition:function(el){var xy=QZFL.dom.getXY(el);var size=QZFL.dom.getSize(el);return{"top":xy[1],"left":xy[0],"width":size[0],"height":size[1]};},setPosition:function(el,pos){QZFL.dom.setXY(el,pos['left'],pos['top']);QZFL.dom.setSize(el,pos['width'],pos['height']);},getXY:function(el){var _t=0;var _l=0;if(document.documentElement.getBoundingClientRect){var box=el.getBoundingClientRect();var oDoc=el.ownerDocument;var _fix=QZFL.userAgent.ie?2:0;_t=box.top-_fix+this.getScrollTop(oDoc);_l=box.left-_fix+this.getScrollLeft(oDoc);}else{while(el.offsetParent){_t+=el.offsetTop;_l+=el.offsetLeft;el=el.offsetParent;}}return[_l,_t];},getSize:function(el){var _w=el.offsetWidth;var _h=el.offsetHeight;return[_w,_h];},setXY:function(el,x,y){el=this.get(el);var _ml=parseInt(this.getStyle(el,"marginLeft"))||0;var _mt=parseInt(this.getStyle(el,"marginTop"))||0;this.setStyle(el,"left",parseInt(x)-_ml+"px");this.setStyle(el,"top",parseInt(y)-_mt+"px");},getScrollLeft:function(doc){doc=doc||document;return Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft);},getScrollTop:function(doc){doc=doc||document;return Math.max(doc.documentElement.scrollTop,doc.body.scrollTop);},getScrollHeight:function(doc){doc=doc||document;return Math.max(doc.documentElement.scrollHeight,doc.body.scrollHeight);},getScrollWidth:function(doc){doc=doc||document;return Math.max(doc.documentElement.scrollWidth,doc.body.scrollWidth);},setScrollLeft:function(value,doc){doc=doc||document;doc[doc.compatMode=="CSS1Compat"&&!QZFL.userAgent.safari?"documentElement":"body"].scrollLeft=value;},setScrollTop:function(value,doc){doc=doc||document;doc[doc.compatMode=="CSS1Compat"&&!QZFL.userAgent.safari?"documentElement":"body"].scrollTop=value;},getClientHeight:function(doc){doc=doc||document;return doc.compatMode=="CSS1Compat"?doc.documentElement.clientHeight:doc.body.clientHeight;},getClientWidth:function(doc){doc=doc||document;return doc.compatMode=="CSS1Compat"?doc.documentElement.clientWidth:doc.body.clientWidth;},setSize:function(el,width,height){el=this.get(el);var _wFix=/\d+([a-z%]+)/i.exec(width);_wFix=_wFix?_wFix[1]:"";var _hFix=/\d+([a-z%]+)/i.exec(height);_hFix=_hFix?_hFix[1]:"";this.setStyle(el,"width",(!width||width<0||/auto/i.test(width))?"auto":(parseInt(width)+(_wFix||"px")));this.setStyle(el,"height",(!height||height<0||/auto/i.test(height))?"auto":(parseInt(height)+(_hFix||"px")));},getDocumentWindow:function(doc){_doc=doc||document;return _doc.parentWindow||_doc.defaultView;},getElementsByTagNameNS:function(node,ns,tgn){var res=[];if(node){if(node.getElementsByTagNameNS){return node.getElementsByTagName(ns+":"+tgn);}else if(node.getElementsByTagName){var n=document.namespaces;if(n.length>0){var l=node.getElementsByTagName(tgn);for(var i=0,len=l.length;i<len;++i){if(l[i].scopeName==ns){res.push(l[i]);}}}}}return res;}};var _CN=QZFL.dom.createNamedElement;var $=QZFL.dom.getById;var removeNode=QZFL.dom.removeElement;function copyToClip(text){if(ua.ie){return clipboardData.setData("Text",text);}else{var o=QZFL.shareObject.getValidSO();return o?o.setClipboard(text):false;}}function _showHashmap(object){var descString=[];var n=20;for(var value in object){try{descString.push(value+" ==> "+object[value]);}catch(exception){descString.push(value+" =!> "+exception.message);}if(!n--){alert(descString.join("\n"));descString=[];n=20;}}if(descString.length>0){alert(descString.join("\n"));}else{alert(object);}}function evalGlobal(js){var obj=document.createElement('script');obj.type='text/javascript';obj.id="__evalGlobal_"+evalGlobal._counter;try{obj.innerHTML=js;}catch(e){obj.text=js;}document.body.appendChild(obj);evalGlobal._counter++;setTimeout('removeNode($("'+obj.id+'"));',50);}evalGlobal._counter=0;function runStyleGlobal(st){if(ua.safari){var obj=document.createElement('style');obj.type='text/css';obj.id="__runStyle_"+runStyleGlobal._counter;try{obj.textContent=st;}catch(e){alert(e.message);}var h=document.getElementsByTagName("head")[0];if(h){h.appendChild(obj);runStyleGlobal._counter++;}}else{rt.warn("plz use runStyleGlobal() in Safari!");}}runStyleGlobal._counter=0;function URI(s){if(!isString(s)){return null;}var depart=s.split("://");if(isArray(depart)&&depart.length>1&&(/^[a-zA-Z]+$/).test(depart[0])){this.protocol=depart[0].toLowerCase();var h=depart[1].split("/");if(isArray(h)&&h[0].length>0){this.host=h[0];this.pathname="/"+h.slice(1).join("/").replace(/(\?|\#).+/i,"");this.href=s;var se=depart[1].lastIndexOf("?");var ha=depart[1].lastIndexOf("#");this.search=(se>=0)?depart[1].substring(se):"";this.hash=(ha>=0)?depart[1].substring(ha):"";if(this.search.length>0&&this.hash.length>0){if(ha<se){this.search="";}else{this.search=depart[1].substring(se,ha);}}return this;}else{return null;}}else{return null;}}function genHttpParamString(o){if(QZFL.lang.isHashMap(o)){var r=new StringBuilder();try{for(var i in o){r.append(i+"="+customEncode(o[i],"URICPT"));}}catch(ignore){return'';}return r.toString("&");}else if(typeof(o)=='string'){return o;}else{return'';}}function splitHttpParamString(s){return commonDictionarySplit(s,"&");}function commonDictionarySplit(s,esp,vq){if(typeof(esp)=='undefined'){esp="&";}if(typeof(vq)=='undefined'){vq="";}var re_vq=new RegExp("^"+vq+"|"+vq+"$","g");if(isString(s)){var l=s.split(vq+esp);var tmp;var res={};for(var i=0,len=l.length;i<len;i++){tmp=l[i].split("=");if(tmp.length>1){res[tmp[0]]=(tmp.slice(1).join("=")).replace(re_vq,"");}else{res[l[i]]=true;}}return res;}else{return{};}}QZFL.lang={isString:function(o){return(typeof(o)!='undefined')&&(o!==null)&&(typeof(o)=='string'||!!o.toString);},isArray:function(o){return(typeof(o)=='object'&&o&&(o.constructor.toString().indexOf("function Array")>=0));},isHashMap:function(o){return((o!==null)&&(typeof(o)=='object'));},isNode:function(o){if(typeof(Node)=='undefined'){Node=null;}try{if(!o||!((Node!=undefined&&o instanceof Node)||o.nodeName)){return false;}}catch(ignored){return false;}return true;},isElement:function(o){return o&&o.nodeType==1;},isValidXMLdom:function(o){if(!o){return false;}if(!o.xml){return false;}if(o.xml==""){return false;}if(!(/^<\?xml/.test(o.xml))){return false;}return true;},arg2arr:function(refArgs,start){if(typeof start=='undefined'){start=0;}return Array.prototype.slice.apply(refArgs,[start,refArgs.length]);},getObjByNameSpace:function(ns){if(typeof(ns)=='undefined')return ns;var l=ns.split(".");var r=window;try{for(var i=0,len=l.length;i<len;++i){r=r[l[i]];if(typeof(r)=='undefined')return void(0);}return r;}catch(ignore){return void(0);}},objectClone:function(obj,preventName){if((typeof obj)=='object'){var res=(QZFL.lang.isArray(obj))?[]:{};for(var i in obj){if(i!=preventName)res[i]=objectClone(obj[i],preventName);}return res;}else if((typeof obj)=='function'){return(new obj()).constructor;}return obj;},obj2str:function(obj){var t,sw;if((typeof obj)=='object'){if(obj===null){return'null';}sw=QZFL.lang.isArray(obj);t=[];for(var i in obj){t.push((sw?"":("\""+escString(i)+"\":"))+obj2str(obj[i]));}t=t.join();return sw?("["+t+"]"):("{"+t+"}");}else if((typeof obj)=='function'){return'';}else if((typeof obj)=='undefined'){return'undefined';}else if((typeof obj)=='number'){return obj.toString();}return!obj?"\"\"":("\""+escString(obj)+"\"");},propertieCopy:function(s,b,propertiSet){if(typeof propertiSet=='undefined'){for(var p in b){s[p]=b[p];}}else{for(var p in propertiSet){s[p]=b[p];}}return s;},tryThese:function(){var res;for(var ii=0,len=arguments.length;ii<len;ii++){try{res=arguments[ii]();return res;}catch(ignore){}}return res;},chain:function(u,v){var calls=[];for(var ii=0,len=arguments.length;ii<len;ii++){calls.push(arguments[ii]);}return(function(){for(var ii=0,len=calls.length;ii<len;ii++){if(calls[ii]&&calls[ii].apply(null,arguments)===false){return false;}}return true;});},uniqueArray:function(arr){var flag={};var index=0;while(index<arr.length){if(flag[arr[index]]==typeof(arr[index])){arr.splice(index,1);continue;}flag[arr[index].toString()]=typeof(arr[index]);++index;}return arr;}};QZFL.namespace.map(QZFL.lang);QZFL.config={defaultDataCharacterSet:"GB2312",DCCookieDomain:"qzone.qq.com",domainPrefix:"qq.com",gbEncoderPath:"http://imgcache.qq.com/qzone/v5/toolpages/",FSHelperPage:"http://imgcache.qq.com/qzone/v5/toolpages/fp_gbk.html",defaultShareObject:"http://imgcache.qq.com/qzone/v5/toolpages/getset.swf"};QZFL.enviroment=(function(){var _p={};var hookPool={};function envGet(kname){return _p[kname];}function envDel(kname){delete _p[kname];return true;}function envSet(kname,value){if(typeof value=='undefined'){if(typeof kname=='undefined'){return false;}else if(!(_p[kname]===undefined)){QZFL.runTime.warn("Do you want to set env var {0:q} to 'undefined'",kname);return false;}}else{_p[kname]=value;return true;}}return{get:envGet,set:envSet,del:envDel,hookPool:hookPool};})();var ENV=QZFL.enviroment;QZFL.pageEvents=(function(){function _ihp(){var qs=location.search.substring(1);var qh=location.hash.substring(1);ENV.set("_queryString",qs);ENV.set("_queryHash",qh);ENV.set("queryString",splitHttpParamString(qs));ENV.set("queryHash",splitHttpParamString(qh));}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -