|
Post by tunescool on Jun 1, 2010 0:02:36 GMT -8
alrite thanks for all the other stuff
|
|
|
Post by Wormopolis on Jun 1, 2010 5:49:44 GMT -8
you are welcome.
|
|
|
Post by tunescool on Aug 31, 2010 6:21:40 GMT -8
after hanging out on ad sites the posting and modify post pages dont make sense with all the description in the left column. i wanna take that column out, im not asking you, but i have to take the live preview description and checkbox out of it first. can you put the checkbox directly under the text area to the left(aligned). keep its own cell, and have the live preview open under the line beneath the checkbox.
<!-- 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"); var iPTxt = document.createTextNode("Live Preview"); 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.appendChild(iFont); nCell.appendChild(iChoice); nCell = nRow.insertCell(1); nCell.className = "windowbg2"; nCell.id = "livepreview_outer"; 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>
|
|
|
Post by Wormopolis on Aug 31, 2010 20:15:13 GMT -8
I will have to come back to this.... shouldnt be too bad though.
|
|
|
Post by Wormopolis on Sept 4, 2010 22:31:27 GMT -8
or so I thought... rereading what you wrote is confusing.. you want the checkbox under the post area and the preview under that?
perhaps a picture would make it clearer....
|
|
|
Post by tunescool on Sept 6, 2010 9:51:28 GMT -8
|
|
|
Post by Wormopolis on Sept 7, 2010 19:26:01 GMT -8
THAT is very helpful. brb
|
|
|
Post by Wormopolis on Sept 7, 2010 23:17:30 GMT -8
change
var nCell = nRow.insertCell(0); nCell.className = "windowbg2"; nCell.appendChild(iFont); nCell.appendChild(iChoice); nCell = nRow.insertCell(1); nCell.className = "windowbg2"; nCell.id = "livepreview_outer"; nwdv=nCell.appendChild(document.createElement('div')); nwdv.style.backgroundImage="url('http://i709.photobucket.com/albums/ww95/tunescool/nook/grey12.jpg')"; nwdv.id="livepreview";
to
var nCell = nRow.insertCell(0); nCell.className = "windowbg2"; nCell.appendChild(iFont); nCell = nRow.insertCell(1); nCell.className = "windowbg2"; nCell.id = "livepreview_outer"; nCell.appendChild(iChoice); nwdv=nCell.appendChild(document.createElement('div')); nwdv.style.backgroundImage="url('http://i709.photobucket.com/albums/ww95/tunescool/nook/grey12.jpg')"; nwdv.id="livepreview";
|
|
|
Post by tunescool on Sept 7, 2010 23:30:16 GMT -8
the checkbox is there and the preview works but could you add the text Live Preview to the rite of the checkbox
|
|
|
Post by Wormopolis on Sept 8, 2010 4:41:29 GMT -8
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";
|
|
|
Post by tunescool on Sept 8, 2010 5:00:58 GMT -8
thanks wormo
|
|
|
Post by tunescool on Sept 25, 2010 21:02:46 GMT -8
how can i change thefont and bold the text for this, i tried inside
function doLiveRow(){ var iFont = document.createElement("font"); var iPTxt = document.createTextNode('<font size="1"><b>"Live Preview - You Have To Hit The Text Area, Then The Background, Then The Text Area To Get Pics To Show Up"</b></font>'); var iChoice = document.createElement("input"); iChoice.type="checkbox"; iChoice.checked=false; if (document.cookie.match(/LP_check=(true|false)(;|$)/)) { iChoice.checked=RegExp.$1;
|
|
|
Post by Wormopolis on Sept 25, 2010 21:08:48 GMT -8
cant put HTML inside a text node. if you want the text to look different, you have to modify the iFont tag itself.
after var iFont = document.createElement("font");
put
iFont.size=1; iFont.style.fontWeight="bold";
|
|
|
Post by tunescool on Sept 25, 2010 21:30:52 GMT -8
thanks
|
|
|
Post by tunescool on Jun 14, 2012 10:57:03 GMT -8
wormer would it be possible to make the code make thumbnails open in a new tab? thumbs open in a new tab everywhere on the internet and preview on most forums but not in this live preview. im arranging all my threads so they look a certain way so they look good, otherwise pics come all over the place and it looks stupid. ill be moving pics around for like an hour in one thread because theres so many and all of a sudden because the mouse wheel is so loose ill be moving up and and it hits a thumb. they open in the same tab and everything i moved is gone, it goes back to the original post when i hit back. yea i hit modify alot of the time but i dont always remember and hitting modify every couple minutes is obnoxious
<!-- 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 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.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>
|
|