|
Post by tunescool on May 30, 2010 0:07:05 GMT -8
could this have rememberance with the default off? would it work with cookies
and could it have its own field or something so its visible under the background
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. */
|
|
|
Post by Wormopolis on May 30, 2010 22:37:22 GMT -8
this line:
iChoice.checked=true;
is what defaults it to on, change it to false to default to off
after this line:
nCell.id = "livepreview";
add this: nCell.style.backgroundColor="FFFFFF";
|
|
|
Post by tunescool on May 31, 2010 3:26:13 GMT -8
i can see while its loading the whole cell changes color but its just the background when its loaded. its gonna look out of place the cell a diff color like that, is there any way to get like a text input box that expands with whatevers there. if not i think ill just go back to the original way.
|
|
|
Post by Wormopolis on May 31, 2010 5:06:17 GMT -8
if its a text input box, then HTML wont work inside it. a text input box would just repeat what they are typing into the message cell right above it.
|
|
|
Post by tunescool on May 31, 2010 5:49:11 GMT -8
is there any way to get anything that would clean up the appearance. and could you get it to remember if someone has checked live preview so the next time they come back its still checked. i use the code every time i post to see if all the pics are good(not half downloaded pics that are dead). its a big deal on my computer just to hit preview and reload every time
|
|
|
Post by Wormopolis on May 31, 2010 6:33:39 GMT -8
give this a shot
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.align="center"; nCell.style.backgroundColor="6D6D6D"; nCell.id = "livepreview_outer"; nwdv=nCell.appendChild(document.createElement('div')); nwdv.style.width="96%"; 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="+RegExp.$1+"; expires="+expDate+";"; } if (pGo.checked) { pDiv.innerHTML = document.postForm.message.value.htmlentities(); pDiv.innerHTML.parse(); pDiv.innerHTML.parse(); // IE fix } }
|
|
|
Post by tunescool on May 31, 2010 6:54:47 GMT -8
all that did was center the live preview. and it didnt remember, im not sure what you were doing tho
|
|
|
Post by Wormopolis on May 31, 2010 7:14:48 GMT -8
change this
document.cookie="LP_check="+RegExp.$1+"; expires="+expDate+";";
to this
document.cookie="LP_check="+pGo.checked+"; expires="+expDate+";";
change these lines:
nCell.className = "windowbg2"; nCell.align="center"; nCell.style.backgroundColor="6D6D6D"; nCell.id = "livepreview_outer"; nwdv=nCell.appendChild(document.createElement('div')); nwdv.style.width="96%"; nwdv.id="livepreview";
to this:
nCell.className = "windowbg2"; nCell.style.backgroundColor="6D6D6D"; nCell.id = "livepreview_outer"; nwdv=nCell.appendChild(document.createElement('div')); nwdv.style.backgroundColor="FFFFFF"; nwdv.id="livepreview";
|
|
|
Post by tunescool on May 31, 2010 7:52:15 GMT -8
that worked out perfect! and it remembered. i think i just wanna put the same background in as the text area in the box, cell, area thing you just added tho instead of a color
|
|
|
Post by Wormopolis on May 31, 2010 8:11:29 GMT -8
nwdv is where the preview will show up, and nCell is the area around it. if you want the nCell area to go back to the tan color, just remove the part that sets its color and it will default back to windowbg.
I set the nwdv to white so it would look more like the area you actually type in, but you can change it to whatever suits you.
|
|
|
Post by tunescool on May 31, 2010 8:52:10 GMT -8
no i wanna put a url to the grey background i have everywhere
|
|
|
Post by Wormopolis on May 31, 2010 11:40:28 GMT -8
oh. then instead of backgroundColor, use backgroundImage="url('URL OF IMAGE')";
|
|
|
Post by tunescool on May 31, 2010 13:35:44 GMT -8
that worked. the text comes up immediately as ive always seen it work but pics dont show rite away. its not a matter of time, i have to hit the mouse either anywhere on the text area or anywhere in the browser window or wherever i dont see a pattern, is there any way to speed up the pics
|
|
|
Post by randie on May 31, 2010 18:07:30 GMT -8
is there any way to speed up the pics Yes we all need this! Sell the code to PBS GOOGLE when you get er done Wormo! ;D
|
|
|
Post by Wormopolis on May 31, 2010 23:46:07 GMT -8
they are subject to loading. since they arent loaded with the page, they have a delay to them. its just a quirk in the code I guess.
The images show up quickly if they have been loaded into memory already for me.
|
|