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

📄 spaces.utility.js

📁 Sun的高速缓存CachedRowSet方案资料档
💻 JS
📖 第 1 页 / 共 2 页
字号:
function OpenFriendWindow(b){window.open(b,"_blank","height=572,width=766,resizable=no,menubar=no,toolbar=no,status=yes");}function ValidateNonEmptyString(c){c=c.trim();if(c.length==0)return false;else return true;}function ValidateEmail(e){var emailReg=/^([a-zA-Z0-9_\-\.\+]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;return emailReg.test(e);}function ValidateEmailEx(g){var emailReg=/^[\w\.\+\-]+@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;return emailReg.test(g);}function ValidateAlphaNumeric(h){var alphaReg=/[^a-zA-Z0-9]/g;return !alphaReg.test(h);}function encodeURI(j){var returnString;returnString=escape(j);returnString=returnString.replace(/\+/g,"%2B");return returnString;}function decodeURI(k){return unescape(k);}function GetXmlHttpObject(){var xmlHttp;if(!window.XMLHttpRequest){try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP.4.0");return xmlHttp;}catch(ex){}try{xmlHttp=new ActiveXObject("MSXML2.XMLHTTP");return xmlHttp;}catch(ex){}try{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");return xmlHttp;}catch(ex){}return null;}else{try{xmlHttp=new XMLHttpRequest();return xmlHttp;}catch(ex){}return null;}}function XMLHttp(l,m,n){var assoc=XMLHttpEx(l,m,n);return assoc.ResponseText;}function XMLHttpEx(o,p,q){var assocRet=new Array();assocRet["Exception"]=false;assocRet["ResponseText"]="";var getorpost=typeof q!="undefined"&&q==true?"GET":"POST";xmlhttp=GetXmlHttpObject();try{if(xmlhttp!=null){xmlhttp.open(getorpost,p,false);xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");xmlhttp.send(o);assocRet["ResponseText"]=xmlhttp.responseText;assocRet["Status"]=xmlhttp.status;}}catch(ex){assocRet["Exception"]=true;}return assocRet;}var g_spudPopOver;function LoadPhotoUploadcontrol(r,s){var height=540;g_spudPopOver=new Live.ControlsEx.Popover.SimpleModal();g_spudPopOver.width=705;g_spudPopOver.header="<span id=\"photoUploadTitle\"></span>";g_spudPopOver.body="<iframe src =\""+r+"\" id=\"__photoUploadFrame\" style=\"height:"+height+"px; width:705px\" frameborder=\"0\"> </iframe>";g_spudPopOver.bodyPadding=false;g_spudPopOver.showFooter=false;g_spudPopOver.show(onPhotoUploadDismiss,s);return null;}function onPhotoUploadDismiss(t,u,v){g_spudPopOver=null;var deleteArray=new Array();var deleteElem=__photoUploadFrame.window.document.getElementById("MyComputer");deleteArray.push(deleteElem);while(deleteArray.length>0){var topElem=deleteArray.pop();if(topElem.children)addChildToArray(deleteArray,topElem);}return true;}function addChildToArray(w,x){for(var i=x.children.length-1;i>=0;i--){var oChild=x.children[i];w.push(oChild);x.removeChild(oChild);}}function RecopyRTE(y){if(y&&y.RichEdit)y.value=y.RichEdit.GetValue();}function BlogIt(z){var subj=document.getElementById("subj"+z);var msg=document.getElementById("msg"+z);if(subj!=null&&msg!=null){url=BlogJSBlogEntryUrl;var f=document.createElement("form");f.action=url;f.method="post";f.id="doTrackback";f.style.display="none";var elSubject=document.createElement("textarea");elSubject.name="Title";elSubject.value=subj.innerText;f.appendChild(elSubject);var elBody=document.createElement("textarea");elBody.name="Description";elBody.value=msg.innerHTML;f.appendChild(elBody);var elSubject=document.createElement("textarea");elSubject.name="SourceURL";elSubject.value=BlogJSPersonalSpaceurl+"blog/"+z+".entry";f.appendChild(elSubject);var elTrackback=document.createElement("textarea");elTrackback.name="Trackback";elTrackback.value=BlogJSPersonalSpaceurl+"blog/"+z+".trak";f.appendChild(elTrackback);var elBlogIt=document.createElement("textarea");elBlogIt.name="BlogIt";elBlogIt.value="true";f.appendChild(elBlogIt);if(document.getElementById("doTrackback"))getElementById("doTrackback").outerHTML="";var elF=document.body.appendChild(f);elF.submit();}}function ScaleImageContactImage(A){window.setTimeout(function(){ScaleImageContactImageCb(A);},1);}function ScaleImageContactImageCb(B){if(null!=B){var unscaledImage=new Image();unscaledImage.src=B.src;if(null==unscaledImage.width||0==unscaledImage.width||null==unscaledImage.height||0==unscaledImage.height||0==B.width||0==B.height)return;var scale=Math.min(B.width/unscaledImage.width,B.height/unscaledImage.height);var newWidth=scale*unscaledImage.width;var newHeight=scale*unscaledImage.height;var leftInc=(B.width-newWidth)/2;var topInc=(B.height-newHeight)/2;try{B.style.width=newWidth+"px";B.style.height=newHeight+"px";var par=B.parentNode;var num;if(null!=par){num=parseInt(par.style.paddingTop);par.style.paddingTop=(isNaN(num)?0:num)+topInc+"px";num=parseInt(par.style.paddingLeft);par.style.paddingLeft=(isNaN(num)?0:num)+leftInc+"px";}}catch(e){}}}SpacesUrlBuilder=new function(){this.ConstructFrontdoorUrl=function(path,query){;if(query!=null){var url="http://{0}{1}?{2}";return url.format(C_FRONTDOOR_HOSTNAME,path,query);}else{var url="http://{0}{1}";return url.format(C_FRONTDOOR_HOSTNAME,path);}};this.ConstructUserUrl=function(alias,path,query){;var hostName=C_WEB_HOSTNAME.format(alias);if(query!=null){var url="http://{0}{1}?{2}";return url.format(hostName,path,query);}else{var url="http://{0}{1}";return url.format(hostName,path);}};this.ConstructUserUrlFromCid=function(cid,path,query){var C_CIDALIAS="cid-{0}";var formatCidAsHex=function(cid){var digits="0123456789ABCDEF";var isNegative=0;if(cid.charAt(0)=="-"){isNegative=1;cid=cid.substr(1,cid.length-1);}var cidAsHex="";while(cid!=""){var dividedCid="";var remainder=0;for(var i=0;i<cid.length;i+=1){var d=digits.indexOf(cid.charAt(i))+10*remainder;var q=Math.floor(d/16);remainder=d%16;if(q!=0||dividedCid.length>0)dividedCid+=digits.charAt(q);}cid=dividedCid;cidAsHex=digits.charAt(remainder)+cidAsHex;}while(cidAsHex.length<16){cidAsHex="0"+cidAsHex;}if(isNegative!=0){for(var i=cidAsHex.length-1;i>=0;i--){cidAsHex=cidAsHex.substr(0,i)+digits.charAt(15-digits.indexOf(cidAsHex.charAt(i)))+cidAsHex.substr(i+1,cidAsHex.length-i-1);}var carry=1;for(var i=cidAsHex.length-1;i>=0;i--){var x=digits.indexOf(cidAsHex.charAt(i))+carry;if(x>15)x-=16;else carry=0;cidAsHex=cidAsHex.substr(0,i)+digits.charAt(x)+cidAsHex.substr(i+1,cidAsHex.length-i-1);}}return cidAsHex;};;return SpacesUrlBuilder.ConstructUserUrl(C_CIDALIAS.format(formatCidAsHex(cid)),path,query);};}();PathUtility=new function(){this.MapPathType=new Object();this.MapPathType.Image="image";this.MapPathType.Css="css";this.MapPathType.Script="script";this.MapPathType.XML="xml";this.MapPathServerType=new Object();this.MapPathServerType.SpacesWeb="SpacesWeb";var pathUtilityInitialized=false;var uplevelHash=true;var staticContentSelector=null;var staticImagesSelector=null;function InitializePathUtility(){try{var spaceCode=" ".charCodeAt(0);}catch(ex){uplevelHash=false;}staticContentSelector=new Array();for(var i=0;i<C_STATIC_CONTENT_SERVER_COUNT;i++){staticContentSelector[i]=C_STATIC_CONTENT_URL_FORMAT.replace("{0}",i+1);}if(C_STATIC_IMAGES_URL_FORMAT&&C_STATIC_IMAGES_URL_FORMAT.length>0){staticImagesSelector=new Array();for(var i=0;i<C_STATIC_CONTENT_SERVER_COUNT;i++){staticImagesSelector[i]=C_STATIC_IMAGES_URL_FORMAT.replace("{0}",i+1);}}else staticImagesSelector=staticContentSelector;pathUtilityInitialized=true;}this.MapPath=function(mapPathType,mapServerType,serverPath,relPath){if(!pathUtilityInitialized)InitializePathUtility();var lowerCaseRelPath=null;if(relPath!=null)lowerCaseRelPath=relPath.toLowerCase();var path=SelectStaticContentUrl(mapPathType,lowerCaseRelPath);switch(mapServerType.toString()){case this.MapPathServerType.SpacesWeb.toString():path+="web";break;default:alert("Unexpected MapPathServerType");}if(serverPath!=null){if(serverPath!=""||serverPath[0]!="/")path+="/";path+=serverPath;}if(path[path.length-1]!="/")path+="/";switch(mapPathType.toString()){case this.MapPathType.Image.toString():path+="images";break;case this.MapPathType.Css.toString():path+="css";break;case this.MapPathType.Script.toString():path+="script";break;case this.MapPathType.XML.toString():path+="xml";break;default:alert("Unexpected mapPathType");}if(lowerCaseRelPath==null||lowerCaseRelPath.length==0||lowerCaseRelPath[0]!="/")path+="/";if(lowerCaseRelPath!=null)path+=lowerCaseRelPath;return path;};function SelectStaticContentUrl(mapPathType,path){var selector=mapPathType.toString()==PathUtility.MapPathType.Image.toString()?staticImagesSelector:staticContentSelector;var url=selector[C_STATIC_CONTENT_DEFAULT_INDEX];if(path!=null&&uplevelHash==true){var selection=Math.abs(GetPathHashCode(path))%C_STATIC_CONTENT_SERVER_COUNT;url=selector[selection];}return url;}function GetPathHashCode(path){if(path==null)return 0;var length=path.length;var hash=0;for(var i=0;i<length;i++){hash=hash^path.charCodeAt(i);}return hash;}this.GetFetchUrlService=function(feedUrl,numHeadLines){;var fetchUrl=C_FETCH_URL_SERVICE.format(numHeadLines,feedUrl.encodeURI());if(Web.Utility.extractHost(C_FETCH_URL_SERVICE).indexOf(document.location.host)==0)return fetchUrl+"&nocache="+Math.random();else return this.GetProxyUrlService(fetchUrl);};this.GetProxyUrlService=function(url){;return Web.Utility.extractHost(document.location,true)+"/pr.aspx?url="+url.encodeURI()+"&nocache="+Math.random();};}();Live_Spaces_Ads=function(C,D){Live_Spaces_Ads.initializeBase(this,arguments);D=this.getParameters();var m_this=this;var m_iRefresh=0;var m_oRefreshTimeout;this.id=C.id;this.initialize=function(E){Live_Spaces_Ads.getBaseMethod(this,"initialize","Web.Bindings.Base").call(this,E);;if(D.refreshperiod){;;m_iRefreshPeriod=D.refreshperiod;if(D.refreshstart&&D.refreshstart==1)m_this.startTimedRefresh();}Web.Network.RegisterBaseDomain();dapMgr.enableACB(C.id,false);dapMgr.renderAd(C.id,D.callstring,D.width,D.height);};this.dispose=function(F){m_this=null;Live_Spaces_Ads.getBaseMethod(this,"dispose","Web.Bindings.Base").call(this,F);};this.refresh=function(){m_this.stopTimedRefresh();refreshInternal();m_this.startTimedRefresh();};this.refreshOnce=function(){m_this.stopTimedRefresh();refreshInternal();};this.setRefreshPeriod=function(G){if(G!=m_iRefreshPeriod){m_iRefreshPeriod=G;m_this.startTimedRefresh();}};this.stopTimedRefresh=function(){if(m_oRefreshTimeout){clearTimeout(m_oRefreshTimeout);m_oRefreshTimeout=null;}};this.startTimedRefresh=function(){;if(m_iRefreshPeriod>0)m_oRefreshTimeout=setTimeout(onRefreshTimeoutExpire,m_iRefreshPeriod*1000);else m_this.stopTimedRefresh();};this.isHeaderBanner=function(){if(m_this.id=="dap_header")return true;else return false;};var onRefreshTimeoutExpire=function(){;refreshInternal();m_oRefreshTimeout=setTimeout(onRefreshTimeoutExpire,m_iRefreshPeriod*1000);};var refreshInternal=function(){if(!(Web.Browser.isIE()&&window.navigator.appVersion.toLowerCase().indexOf("msie 6")>=0))dapMgr.trackEvent(eventType.click);};};Live_Spaces_Ads.Params=Web.Enum.create("callstring","width","height","refreshperiod","refreshstart");Live_Spaces_Ads.registerClass("Live_Spaces_Ads","Web.Bindings.Base");Live_Spaces_Ads.skipClass=true;if(typeof Web!="undefined"&&Web&&Web.Bindings){registerNamespace("Spaces.Utility");Spaces.Utility.GetString=function(H,I){if(H){if(H[I])return H[I];};return "";};Spaces.Utility.JScriptStringEscape=function(J){var returnString=J;returnString=returnString.replace(/\\/g,"\\\\");returnString=returnString.replace(new RegExp("/","g"),"\\/");returnString=returnString.replace(/</g,"\\x3C");returnString=returnString.replace(/>/g,"\\x3E");returnString=returnString.replace(/'/g,"\\x27");returnString=returnString.replace(/\"/g,"\\x22");returnString=returnString.replace(/\r/g,"\\r");returnString=returnString.replace(/\n/g,"\\n");returnString=returnString.replace(/\t/g,"\\t");return returnString;};}if(typeof Web!="undefined"&&Web&&Web.Bindings){registerNamespace("Spaces.Lists");registerNamespace("Spaces.PopOvers");var g_currSimplePopover;function ComplexDialogData(K,L,M,N,O,P,Q){if(Q==null)Q=false;this.LabelArray=K;this.DefaultsArray=L;this.DialogItemDetails=M;this.BtnOk=N;this.BtnCancel=O;this.LimitsArray=P;this.LabelsHtmlSafe=Q;}function SimpleDialogData(R,S,T,U,V,W,X){return new ComplexDialogData(new Array(R,T),new Array(S,U),V,W,X);}Spaces.PopOvers.SimplePopOver=function(Y,Z,ab,bb,eb,gb,hb){if(typeof Live=="undefined"||typeof Live.ControlsEx=="undefined"||typeof Live.ControlsEx.Popover=="undefined")return;var m_popover=new Live.ControlsEx.Popover.SimpleModal();var m_body=document.getElementById("SpacesPopOversSimplePopOver");if(m_body==null){m_body=document.createElement("div");m_body.id="SpacesPopOversSimplePopOver";g_currSimplePopover=m_popover;document.body.appendChild(m_body);};var m_popoverData=new Array();function jb(){if(gb){var realAnchor=gb;var temp=gb;for(var i=0;i<10;i++){if(temp.tagName.toLowerCase()=="a"){realAnchor=temp;break;}if(temp.parentElement)temp=temp.parentElement;}}kb();if(hb)m_popover.width=hb;else m_popover.width=400;m_popover.header=Z;m_popover.body=m_body;g_currSimplePopover=m_popover;var okBtnText=ab.BtnOk?ab.BtnOk:Spaces.Utility.GetString(Spaces.Common.Strings,"global_ok");var cancelBtnText=ab.BtnCancel?ab.BtnCancel:Spaces.Utility.GetString(Spaces.Common.Strings,"global_cancel");m_popover.addButton("ok",okBtnText,true,false);m_popover.addButton("cancel",cancelBtnText,false,true);ob();m_popover.show(onDismiss,realAnchor);pb();if(Y=="TitleTaglineCustomization")tnt_GetPreview(ab.DefaultsArray);}function kb(){var sBodyHeader="";if(ab.DialogItemDetails)sBodyHeader="<div style=\"margin-bottom:10px\">"+ab.DialogItemDetails+"</div>";var sBodyFooter="";var sBody="";if(Y=="Confirmation")sBody="<div id=\"pvrLabel1\"></div>";else{if(Y=="Message")sBody="<b><div id=\"pvrLabel1\"></div></b>";else{if(Y=="ChangeAd"){sBody="<label id=\"pvrLabel1\" for=\"pvrValue1\"></label><div class=\"InputWrapper\" style=\"border-style:solid\"><input id=\"pvrValue1\" name=\"checkbox\" type=\"text\" onkeyup=\"Spaces.PopOvers.SimplePopOver.ValidateTextboxInput()\" /></div><label id=\"pvrLabel2\" for=\"pvrValue2\"></label><div class=\"InputWrapper\" style=\"border-style:solid\"><input id=\"pvrValue2\" name=\"checkbox\" type=\"text\" onkeyup=\"Spaces.PopOvers.SimplePopOver.ValidateTextboxInput()\"/></div>";if(ab.DefaultsArray[2]=="true")sBody+="<input id=\"pvrValue3\" type=\"checkbox\" CHECKED /><label for=\"pvrValue3\" id=\"pvrLabel3\">";else sBody+="<input id=\"pvrValue3\" type=\"checkbox\" /><label for=\"pvrValue3\" id=\"pvrLabel3\">";}else{if(Y=="AddOrEditList")var sBody="<label id=\"pvrLabel1\" for=\"pvrValue1\"></label><div class=\"InputWrapper\" style=\"border-style:solid; margin-bottom:4px\"><input id=\"pvrValue1\" name=\"checkbox\" type=\"text\" onkeyup=\"Spaces.PopOvers.SimplePopOver.ValidateTextboxInput()\" /></div><label id=\"pvrLabel2\" for=\"pvrValue2\"></label><div class=\"InputWrapper\" style=\"border-style:solid\"><input id=\"pvrValue2\" name=\"textbox\" type=\"text\" /></div>";else{if(Y=="NameDropDown")var sBody="<label id=\"pvrLabel1\" for=\"pvrValue1\"></label><div class=\"InputWrapper\" style=\"border-style:solid; margin-bottom:10px\"><input id=\"pvrValue1\" name=\"checkbox\" type=\"text\" onkeyup=\"Spaces.PopOvers.SimplePopOver.ValidateTextboxInput()\" /></div><label id=\"pvrLabel2\" for=\"pvrValue2\"></label><div class=\"InputWrapper\" style=\"border-style:solid; margin-bottom:10px\"\"><input id=\"pvrValue2\" name=\"textbox\" type=\"text\" /></div><label id=\"pvrLabel3\" for=\"pvrValue3\"></label><div class=\"InputWrapper\" style=\"border-style:none;padding-bottom:0px\"><select id=\"pvrValue3\">    <option value=\"links\">"+Spaces.Utility.GetString(Spaces.Lists.Strings,"mainnav_Links")+"</option>"+"    <option value=\"booklist\">"+Spaces.Utility.GetString(Spaces.Lists.Strings,"mainnav_Booklist")+"</option>"+"    <option value=\"friendslist\">"+Spaces.Utility.GetString(Spaces.Lists.Strings,"mainnav_FriendList")+"</option>"+(g_spaceMarket=="en-us"?"    <option value=\"movielist\">"+Spaces.Utility.GetString(Spaces.Lists.Strings,"mainnav_Movielist")+"</option>":"")+"</select></div>";else{if(Y=="SingleNameValue")var sBody="<label id=\"pvrLabel1\" for=\"pvrValue1\"></label><div class=\"InputWrapper\" style=\"border-style:solid\"><input id=\"pvrValue1\" name=\"checkbox\" type=\"text\" onkeyup=\"Spaces.PopOvers.SimplePopOver.ValidateTextboxInput()\" /></div>";else{if(Y=="TitleTaglineCustomization")var sBody=GetTitleTagline();else var sBody="";}}}}}}m_body.innerHTML=sBodyHeader+sBody+sBodyFooter;}var onDismiss=function(lb,mb,nb){var fClose=true;if(mb=="ok"){var retObj=qb();var fTemp=eb({"obj":retObj,"Popover":lb});if(fTemp==false)fClose=false;}if(fClose){m_popover=null;g_currSimplePopover=null;}return fClose;};function ob(){if(ab.LabelArray!=null)for(var x=0;x<ab.LabelArray.length;x++){if(document.getElementById("pvrLabel"+(x+1))!=null){if(ab.LabelsHtmlSafe)document.getElementById("pvrLabel"+(x+1)).innerHTML=ab.LabelArray[x];else document.getElementById("pvrLabel"+(x+1)).innerText=ab.LabelArray[x];}}if(ab.DefaultsArray!=null)for(var x=0;x<ab.DefaultsArray.length;x++){var currentElement=document.getElementById("pvrValue"+(x+1));if(currentElement!=null){if(currentElement.type=="checkbox"){if(ab.DefaultsArray[x]=="true")currentElement.checked=true;}else currentElement.value=ab.DefaultsArray[x];}}if(ab.LimitsArray!=null)for(var x=0;x<ab.LimitsArray.length;x++){if(document.getElementById("pvrValue"+(x+1))!=null)document.getElementById("pvrValue"+(x+1)).maxLength=ab.LimitsArray[x];}}function pb(){if(document.getElementById("pvrValue1")!=null)Spaces.PopOvers.SimplePopOver.ValidateTextboxInput();}function qb(){var x;var returnObj=new Object();returnObj.Action="NameValueReturn";for(x=1;true;x++){if(document.getElementById("pvrValue"+x)==null)break;}x=x-1;var returnArray=new Array(x);var currentElement;for(var y=0;y<x;y++){currentElement=document.getElementById("pvrValue"+(y+1));if(currentElement.type=="checkbox"){if(currentElement.checked==true)returnArray[y]="true";else returnArray[y]="false";}else returnArray[y]=currentElement.value;}returnObj.ReturnValues=returnArray;return returnObj;}jb();};Spaces.PopOvers.SimplePopOver.ValidateTextboxInput=function(){;if(!g_currSimplePopover)return;var disableFalg=false;var checkboxes=Spaces.PopOvers.SimplePopOver.GetCheckboxes();if(!checkboxes)return;for(var i=0;i<checkboxes.length;i++){if(""==checkboxes[i].value&&checkboxes[i].getAttribute("name")=="checkbox"){g_currSimplePopover.disableButton("ok");disableFalg=true;break;}}if(!disableFalg)g_currSimplePopover.enableButton("ok");};Spaces.PopOvers.SimplePopOver.GetCheckboxes=function(){var frameBody=document.getElementById("SpacesPopOversSimplePopOver");if(frameBody)var checkboxes=frameBody.getElementsByTagName("INPUT");return checkboxes;};}

⌨️ 快捷键说明

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