function readyMsgBox(){ Ext.MessageBox.show({ msg: '載入中...', progressText: 'Loading...', width:300, wait:true, waitConfig: {interval:200} }); } function getElementsByName_iefix(tag, name) { var elem = document.getElementsByTagName(tag); var arr = new Array(); for(i = 0,iarr = 0; i < elem.length; i++) { att = elem[i].getAttribute("name"); if(att == name) { arr[iarr] = elem[i]; iarr++; } } return arr; } function addwbr(oldString) { oldString = oldString.replace(/^\s+|\s+$/g, '') ; // trim var newString = ""; var inTag = false; var firstTag = -1; var flag = true; for(var i = 0; i < oldString.length; i++) { if(oldString.charAt(i) == '<') inTag = true; if(oldString.charAt(i) == '>') { if(oldString.charAt(i+1)=="<") { //dont do anything } else { inTag = false; //i++; } } if(!inTag) newString += oldString.charAt(i)+""; else newString += oldString.charAt(i); if(!inTag) flag = false; if(flag && inTag) firstTag = i; } firstbr = oldString.indexOf("
"); if(firstbr>=0 && firstbr/, "<_br>"); } firstbr = oldString.indexOf("
"); if(firstbr>=0 && firstbr/, "<_br>"); } newString = newString.replace(/
/gi, "").replace(//gi, ""); newString = newString.replace(/<_br>/gi, "
"); //alert(newString); return newString; } function changeLinks(){ changeLinks2("other_res_content"); } function changeLinks2(name) { //var divs = document.getElementsByName('res_content'); var divs = getElementsByName_iefix("div", name); if(divs){ for(k=0;k=0 || a[i].innerHTML.indexOf("https://")>=0 || a[i].innerHTML.indexOf("mms://")>=0){ var content = a[i].innerHTML; //content = content.replace(/
/gi, "").replace(//gi, ""); content = addwbr(content); content = content.replace(/&amp;/gi, "&"); content = content.replace(/&lt;/gi, "<"); content = content.replace(/&gt;/gi, ">"); content = content.replace(/&quot;/gi, """); content = content.replace(/&apos;/gi, "'"); a[i].innerHTML = content; } if(a[i].target=="") a[i].target = "_blank"; } } wrap(divs[k],"http"); } } } // getCategory.php line 126 add changeLinks()