|
Post by tunescool on Oct 14, 2010 18:26:00 GMT -8
|
|
|
Post by tunescool on Oct 15, 2010 0:10:05 GMT -8
<script type="text/Javascript"> // "What Are You Doing?" When Posting v1 By Chris // Do not redistirbute without permission of the creator // Mods by Wormopolis
var enableImg = "Yes"; // Should they be able to add an image before the information?
var firstColor = "#00138E"; // Color for first object. Leave blank to disable.
var opts = [ // First set of quotations is the title in the dropdown // Each extra input box is defined by an extra set of quotations. If you're confused with editing, // just ask for help. ["Nothing..."], //default text in the drop down - no options ["Listening To", " Listening To - ", " By", " From"], ["Watching", " Watching - ", " On" ], ["Headlines", " Headlines - " ], ["Mood", " Mood - " ], ["Plans", " Plans - " ] ];
// DON'T EDIT if(enableImg){ for(a=1;a<opts.length;a++){ opts[a].push("<br>Image:"); } }
function changeBox(n){ var st = []; var p = document.postForm.message;
if(p.value.match(waydReg)){ n = RegExp.$1; st = RegExp.$2.split(/-_-_-/); p.value = p.value.replace(waydReg, ""); document.getElementById("waydselect").selectedIndex = n; }
var x = document.getElementById("waydhold"); var g = "";
for(a=1;a<opts[n].length;a++){ g += opts[n][a]+" <input id='waydbox"+a+"' "+(st[a-1] && st[a-1] != " "?"value='"+st[a-1]+"'":"")+" />"; }
x.innerHTML = g; }
function saveForm(){ if(document.postForm.message.value.length == 0) return;
var s = []; var n = 1;
while(document.getElementById("waydbox"+n)){ if(document.getElementById("waydbox"+n).value.length == 0){ if(n == 0) return; s.push(" "); } else { s.push(document.getElementById("waydbox"+n).value); } n++; } var x = document.getElementById("waydselect"); if (x.selectedIndex!=0 || s[0].length>1) { s = "[wayd:"+x.options[x.selectedIndex].value+":"+s.join("-_-_-")+"]"; document.postForm.message.value += s; }
}
var waydReg = /\[wayd:(\d+):(.+?)\]/i; var aFO = document.getElementsByTagName("font"); if(document.postForm && document.postForm.color && !document.postForm.to && !document.postForm.month){ var d = "<select id='waydselect' onchange='changeBox(this.options[this.selectedIndex].value)'>";
for(a=0;a<opts.length;a++){ d += "<option value='"+a+"'>"+opts[a][0]+"</option>"; } d += "</select>"; var n = document.postForm.icon.parentNode.parentNode; var r = n.parentNode.insertRow(n.rowIndex+2); var c1 = r.insertCell(0); c1.className = "windowbg"; c1.innerHTML = "<font size='2'>Tunes/Screen/Headlines/Plans</font>"; var c2 = r.insertCell(1); c2.className = "windowbg"; c2.innerHTML = d+" <span id='waydhold'></span>";
changeBox(0); if(document.addEventListener) document.postForm.addEventListener("submit", saveForm, true); else document.postForm.attachEvent("onsubmit", saveForm);
if(document.postForm.value.match(waydReg)){ document.postForm.value = document.postForm.value.replace(waydReg, ""); }
} else if(location.href.match(/action=display/) || document.title.match(/\s-\sSearch\sResults/)){ for(a=0;a<aFO.length;a++){ if(aFO[a].size == 2 && aFO[a].innerHTML.match(waydReg)){ var id = RegExp.$1; var st = RegExp.$2.split(/-_-_-/); var str = "<b><font color='"+firstColor+"'>"+opts[id][1]+"</font> "; var str2=""; if (st[0].match(/http:/)) { str2 += "<img align='absmiddle' src='"+st[0]+"' height='50' width='50' /> "; } else { str+="<i>"+st[0]+"</i>"; }
var n = 1; while(st[n]){ if(st[n] != " "){ if(!st[n+1] && st[n].match(/http:/)){ str2 = "<img align='absmiddle' src='"+st[n]+"' height='50' width='50' /> "; } else { str += opts[id][n+1]+" "+st[n]+" "; } } n++; } nwtbl='<table width="100%"><tr><td width="5%">'+str2+'</td><td>'+str+'</td></tr></table>'; aFO[a].innerHTML = aFO[a].innerHTML.replace(waydReg, ""); var d = document.createElement("div"); d.innerHTML = nwtbl+"</b><hr size='1' class='hr' />"; aFO[a].parentNode.insertBefore(d, aFO[a]); } } } </script>
<!-- SCRIPT DIVIDER: Live Preview -->
<script type="text/javascript"> <!-- /* Live Preview - Global footer
Created by Peter
This code cannot be reposted at anywhere other than SSDesigns or ProBoards, without permission.
This header must stay intact at all times.
Modifications for checkbox by Wormopolis. */
var smileysObj = new Object();
var iRegSmileys = [ /\s:\)/g, /\s;\)/g, /\s:D/g, /\s;D/g, /\s>:\(/g, /\s:\(/g, /\s:o/g, /\s8\-\)/g, /\s\?\?\?/g, /\s::\)/g, /\s:P/g, /\s:-\[/g, /\s:\-X/g, /\s:\-\//g, /\s:\-\*/g, /\s:\'\(/g ];
var iRegUBBC = [ [/\[(\/)?(b|i|u|s|sup|sub)\]/gim, "<$1$2>"], [/\[(\/)?(hr|pre|blockquote)\]/gim, "<$1$2>"], [/\[(left|center|right)\]/gim, "<div align='$1'>"], [/\[\/(left|center|right)\]/gim, "</div>"], [/\[url=(http:\/\/)?(.*?)\](.*?)\[\/url\]/gim, "<a href=\"http://$2\">$3</a>"], [/\[url\]((\[\w+\])*)((http:\/\/)?(.*?)((\[\/\w+\])*))\[\/url\]/gim, "<a href=\"http://$5\">$1$4$6</a>"], [/\[email\]((\[\w+\])*)(.*?)((\[\/\w+\])*)\[\/email\]/gim, "<a href=\"mailto:$3\">$1$3$4</a>"], [/\[img\](.*?)\[\/img\]/gim, "<img src=\"$1\" border=\"0\" />"], [/\[size=(\d+)\]/gim, "<font size=\"$1\">"], [/\[\/size\]/gim, "</font>"], [/\[color=(\#[0-9A-F]{6}|[a-z]+)\]/gim, "<span style=\"color: $1;\">"], [/\[font=(.*?)\]/gim, "<span style=\"font-family: $1;\">"], [/\[\/(font|color)\]/gim, "</span>"], [/\[table\]/gim, "<table border='1'>"], [/\[(\/table|\/?tr|\/?td)\]/gim, "<$1>"], [/\[quote\]/gim, '<br /><b>Quote:</b><table class="bordercolor" cellspacing="1" width="90%"><tr><td width="100%"><table class="quote" cellpadding="2" cellspacing="0" width="100%"><tr><td width="100%"><font class="quote" face="Arial,Helvetica" size="1">'], [/\[\/quote\]/gim, "</font></td></tr></table></td></tr></table>"], [/\[list\]/gim, "<ul><br />"], [/\[\/list]/gim, "</ul>"], [/\[\*\]/gim, "<li>"], [/\[\/*\]/gim, "<br /></li>"], [/\[code\]/gim, '<blockquote><b>Code:</b><table class="bordercolor" cellspacing="1" width="90%"><tr><td><table class="code" cellpadding="2" cellspacing="0" width="100%"><tr><td><font class="code" face="Courier New" size="2">'], [/\[\/code\]/gim, "</font></td></tr></tbody></table></td></tr></tbody></table></blockquote>"] ];
String.prototype.htmlentities = function(){ var iTemp = this;
if(this){ for(m = 0; m < this.length; m ++){ switch(this.charCodeAt(m)){ case 60 : iTemp = iTemp.replace(this.charAt(m), "<"); break; case 62 : iTemp = iTemp.replace(this.charAt(m), ">"); break; } } } return iTemp.replace(/\n/g, "<br />"); }
String.prototype.str_replace = function(){ var pDiv = document.getElementById("livepreview"); if(this && arguments.length == 2){ if(new RegExp(arguments[0]).exec(this)){ pDiv.innerHTML = this.replace(arguments[0], arguments[1]); } } }
String.prototype.parse = function(){ var pDiv = document.getElementById("livepreview"); var noUBBCRe = /\[noubbc\](.*?)\[\/noubbc\]/gim;
if(this.match(noUBBCRe)){ var inPat = RegExp.$1.replace(/\]/g, "<font>]</font>"); pDiv.innerHTML = pDiv.innerHTML.replace(noUBBCRe, inPat); }
for(s = 0; s < iRegSmileys.length; s ++){ if(new RegExp(iRegSmileys[s]).test(this)){ pDiv.innerHTML = pDiv.innerHTML.replace(new RegExp(iRegSmileys[s]), ' <img src="' + smileysObj.has[s][0] + '" border="0" />'); } }
for(r = 0; r < iRegUBBC.length; r ++){ if(iRegUBBC[r][0].test(this)){ pDiv.innerHTML.str_replace(iRegUBBC[r][0], iRegUBBC[r][1]); } } }
function grabSmileys(obj){ if(obj){ var smileys = []; var iImg = obj.getElementsByTagName("img");
for(i = 0; i < iImg.length; i ++){ if(iImg.item(i).parentNode.href){ if(iImg.item(i).parentNode.href.match(/add\("%20(.*?)"\)/i)){ smileys.push([iImg.item(i).src, RegExp.$1]); } } } smileysObj.has = smileys; } }
function doLiveRow(){ var iFont = document.createElement("font"); iFont.size=1; iFont.style.fontWeight="bold"; var iPTxt = document.createTextNode("Live Preview - You Have To Hit The Text Area, Then The Background, Then The Text Area To Get Pics To Show Up"); var iChoice = document.createElement("input"); iChoice.type="checkbox"; iChoice.checked=false; if (document.cookie.match(/LP_check=(true|false)(;|$)/)) { iChoice.checked=RegExp.$1; } iChoice.id="power"; var iCell = document.getElementsByTagName("td");
iFont.size = "2"; iFont.appendChild(iPTxt);
for(c = 0; c < iCell.length; c ++){ if(iCell.item(c).className == "windowbg2" && iCell.item(c).width == "30%" && iCell.item(c).innerHTML.match(/Message:/)){ grabSmileys(iCell.item(c + 1)); var rowNum = (iCell.item(c).parentNode.rowIndex + 1); var nRow = iCell.item(c).parentNode.parentNode.insertRow(rowNum); var nCell = nRow.insertCell(0); nCell.className = "windowbg2"; nCell = nRow.insertCell(1); nCell.className = "windowbg2"; nCell.id = "livepreview_outer"; nCell.appendChild(iChoice); nCell.appendChild(iFont); nwdv=nCell.appendChild(document.createElement('div')); nwdv.style.backgroundImage="url('http://i709.photobucket.com/albums/ww95/tunescool/nook/grey12.jpg')"; nwdv.id="livepreview";
} } }
function livePreview(){ var pDiv = document.getElementById("livepreview"); var pGo = document.getElementById("power"); if ((document.cookie.match(/LP_check=(true|false)(;|$)/) && pGo.checked!=RegExp.$1) || !document.cookie.match(/LP_check=(true|false)(;|$)/)) { expDate=new Date(); expDate.setFullYear(expDate.getFullYear()+1); document.cookie="LP_check="+pGo.checked+"; expires="+expDate+";"; } if (pGo.checked) { pDiv.innerHTML = document.postForm.message.value.htmlentities(); pDiv.innerHTML.parse(); pDiv.innerHTML.parse(); // IE fix } }
if(document.postForm && document.postForm.message){ doLiveRow(); document.postForm.message.onkeyup = livePreview; document.postForm.message.onfocus = livePreview; }
//--> </script>
<script type="text/javascript"> <!-- // Posting Page Checkboxes Merge // by Wormopolis - wormocodes.proboards.com // keep header intact
if (document.postForm) { placehold=document.postForm.counter.parentNode.parentNode; nwrw=placehold.parentNode.insertRow(placehold.rowIndex+1); var nwcl=nwrw.insertCell(0); nwcl.appendChild(document.createElement('font')); nwcl.firstChild.size=2; nwcl.className="windowbg2"; nwcl.firstChild.appendChild(document.createTextNode('Bookmarks')); nwcl=nwrw.insertCell(-1); nwcl.id="options"; nwcl.className="windowbg2"; spacer=document.createTextNode(" ");
function comp(vict) { vict.id=vict.name+'orig'; cls=vict.parentNode; nwbx=document.createElement('input'); nwbx.type="checkbox"; nwbx.id=vict.name; nwbx.style.verticalAlign="middle"; if(document.getElementById(vict.id).checked) nwbx.defaultChecked=true; nwbx.onclick= function () {v=this.id+'orig'; document.getElementById(v).checked=this.checked;}; desc=cls.parentNode.firstChild.cloneNode(true); desc.innerHTML=desc.innerHTML.replace(/\:/,''); nwcl.appendChild(nwbx); nwcl.appendChild(desc.firstChild); nwcl.appendChild(spacer.cloneNode(true)); cls.parentNode.style.display="none"; }
function hide(vict) { cls=vict.parentNode; cls.parentNode.style.display="none"; }
// use hide() to hide option, use comp() to compact it
if (document.postForm.notify) comp(document.postForm.notify); if (document.postForm.nosmiles) hide(document.postForm.nosmiles); if (document.postForm.lock) comp(document.postForm.lock); if (document.postForm.sticky) comp(document.postForm.sticky); if (document.postForm.announcements) comp(document.postForm.announcements);
} // --> </script>
|
|
|
Post by Wormopolis on Oct 15, 2010 0:20:31 GMT -8
Im not really all that interested in having to rewrite 3 codes just to make one code work. what happens if you move the code that hides the left column to be the last one that runs?
|
|
|
Post by tunescool on Oct 15, 2010 0:48:41 GMT -8
all you have to do is take stuff out, im not removing the new code, i have everything saved if it makes you happier
|
|
|
Post by Wormopolis on Oct 15, 2010 7:20:39 GMT -8
didnt say remove the new code. I said move it to be after the other 3.
|
|
|
Post by tunescool on Oct 15, 2010 9:17:50 GMT -8
i really didnt read it, i tried it and it didnt change anything
|
|
|
Post by Wormopolis on Oct 15, 2010 13:40:54 GMT -8
live preview code, remove these 2 lines.
nCell.className = "windowbg2"; nCell = nRow.insertCell(1);
and I already saw Todge took care of the other 2.
|
|
|
Post by tunescool on Oct 15, 2010 14:22:39 GMT -8
thanks it looks real nice
|
|