inherit
118133
0
Feb 28, 2015 4:35:54 GMT -8
AMBERCAKES :)
- - ? - -
110
January 2008
crashcutiecrash
|
Post by AMBERCAKES :) on Jul 13, 2012 16:05:19 GMT -8
Forum URL: brokenhome007.proboards.com/index.cgiOne of my members on my site doesn't like that I have a live preview code but I like it. I looked through the code index and couldn't find one to where I could collapse the live preview code or make it show for others who like to use it. I've seen the other collapse codes for other codes but couldn't find this one? Can anyone help me out? Thanks.
|
|
inherit
118133
0
Feb 28, 2015 4:35:54 GMT -8
AMBERCAKES :)
- - ? - -
110
January 2008
crashcutiecrash
|
Post by AMBERCAKES :) on Jul 14, 2012 19:27:01 GMT -8
B U M P !
[/size] [/center]
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,022
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Jul 14, 2012 21:50:17 GMT -8
I originally had a code that enabled/disabled it but I rewrote it so it also collapsed. This means in order to toggle the expanding and collapsing a link had to be placed below the typing area next to the other "expand" pseudolink.
<script type="text/javascript"> <!-- (function(){ //live preview toggle (Install below live preview code) var a=document.getElementById('livepreview'),b= document.postForm if(a&&b){ b = document.getElementById('ta1'); b.style.cssFloat = b.style.styleFloat = "left"; b=b.parentNode.insertBefore(document.createElement('a'),b.nextSibling); b.parentNode.insertBefore(document.createTextNode("\xa0|\xa0"),b); b.href="javascript:void('livepreview "+ (/\bdisablelivepreview=1/.test(document.cookie)?"on":"off") +"')"; b.id="togglepreview"; b.appendChild(document.createTextNode("LivePreview")) b.onclick= function(){var lp=document.getElementById('livepreview'),t=document.getElementById("togglepreview"); if(/off/.test(t.href)){String.prototype.parse=String.prototype.htmlentities = function(){return '';}; lp.parentNode.style.display="none"; t.href="javascript:void('livepreview on')"; }else{String.prototype.parse=t.parse; String.prototype.htmlentities=t.htmlentities; lp.parentNode.style.display=""; t.href = "javascript:void('livepreview off')";} document.postForm.message.focus(); } b.parse=String.prototype.parse; b.htmlentities=String.prototype.htmlentities; if(!/off/.test(b.href)){String.prototype.parse=String.prototype.htmlentities = function(){return '';}; a.parentNode.style.display="none";} b.onblur = function EU_Cookie(){if(/\bdisablelivepreview=/.test(document.cookie) || confirm("Do you wish to save the current live preview setting to a cookie so it can be remembered for the next time?"))document.cookie = "disablelivepreview=" + (/off/.test(document.getElementById('togglepreview').href)?"0":"1") + ";expires=" + (new Date(new Date(+new Date).setFullYear(2017)).toGMTString()) + ";"} } })() // --> </script>
Since this stores a cookie in order to remember the user's selection for the next time it will ask before storing that cookie for the first time (or if deleted) in order to comply with the new EU data storage law.
|
|
inherit
118133
0
Feb 28, 2015 4:35:54 GMT -8
AMBERCAKES :)
- - ? - -
110
January 2008
crashcutiecrash
|
Post by AMBERCAKES :) on Jul 18, 2012 17:09:01 GMT -8
Where does this code go? (:
|
|
inherit
156679
0
Oct 9, 2012 14:53:28 GMT -8
KELSEY'S GOT A GUN
1,421
July 2010
wrpg
|
Post by KELSEY'S GOT A GUN on Jul 18, 2012 17:41:41 GMT -8
in the code, it says just below the live preview code
|
|
inherit
118133
0
Feb 28, 2015 4:35:54 GMT -8
AMBERCAKES :)
- - ? - -
110
January 2008
crashcutiecrash
|
Post by AMBERCAKES :) on Jul 19, 2012 16:38:22 GMT -8
Thank you.
|
|