Updating page editor hooks for v4.9.3
From Sohowiki
(Difference between revisions)
(→The Easy Way To Update) |
(→Final note) |
||
(9 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
− | == | + | ==How To Update== |
Within your object javascript simply add the following to the end, that is, after you have placed your object into the cell. | Within your object javascript simply add the following to the end, that is, after you have placed your object into the cell. | ||
<pre> | <pre> | ||
Line 7: | Line 7: | ||
</pre> | </pre> | ||
− | + | Our scrolling newsbox OkScrollData() function now looks like this. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
<pre> | <pre> | ||
function OkScrollData() { | function OkScrollData() { | ||
− | + | doOperation = 0; | |
− | + | ||
− | + | var dataTrue = dataData.search("pixel.gif"); | |
− | + | ||
− | var | + | disOne = document.getElementById('scrollname').selectedIndex; |
− | + | tscrollval = eval("document.getElementById('scrollname').options["+disOne+"].value"); | |
− | + | tscrollname = eval("document.getElementById('scrollname').options["+disOne+"].innerHTML"); | |
− | disOne = | + | |
− | tscrollval = eval(" | + | |
− | tscrollname = eval(" | + | |
tscrollname = tscrollname.toString(); | tscrollname = tscrollname.toString(); | ||
− | |||
− | |||
− | |||
− | / | + | TextHeader = "<img src=images/text_header.gif width=199 height=15 border=0 align=left vspace=0 hspace=0 style='cursor: move;'><BR CLEAR=ALL>"; |
− | + | TableStart = "<table border=0 cellpadding=2 cellspacing=0 style='border: 1px inset black; background: #EFEFEF;'><tr><td width=199 align=center valign=top>"; | |
+ | TableEnd = "</td></tr></table><!-- ~~~ -->"; | ||
− | + | if (dataTrue > 0) { | |
− | if ( | + | sText = TableStart+TextHeader+"<font style='font-family: Arial; font-size: 8pt;'><U><font color=darkblue>Scroll Box : "+tscrollname+"</font></U></FONT><!-- ##SCROLLNEWS;"+tscrollval+"## -->"+TableEnd; |
− | + | doOperation = 1; | |
+ | } else { | ||
+ | sText = dataData+"<BR>"+TableStart+TextHeader+"<font style='font-family: Arial; font-size: 8pt;'><U><font color=darkblue>Scroll Box : "+tscrollname+"</font></U></FONT><!-- ##SCROLLNEWS;"+tscrollval+"## -->"+TableEnd; | ||
+ | doOperation = 1; | ||
} | } | ||
− | + | if (doOperation == 1) { | |
− | + | document.getElementById(ColRowID).innerHTML= sText; | |
+ | document.getElementById(ColRowID).style.backgroundColor= "#FFFFFF"; | ||
+ | } | ||
+ | document.getElementById('scrollname').selectedIndex = 0; // Reset Selection to Nothing(Null) | ||
− | + | if ( window.checkPageAreas ){ | |
− | + | checkPageAreas('start'); | |
+ | } | ||
} | } | ||
</pre> | </pre> | ||
− | + | And thats it :) | |
− | + | ||
− | + | ==Final note== | |
− | + | The new page_editor.php uses a XHTML 1.0 Strict doctype and may effect the look/feel of your properties layer and will effect ill formed javascript. | |
− | + | ||
− | + | Meaning that the following is no longer acceptable javascript. | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
<pre> | <pre> | ||
− | + | myFoo = foo.selectedIndex; | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
</pre> | </pre> | ||
− | + | It must be | |
<pre> | <pre> | ||
− | + | myFoo = document.getElementById('foo').selectedIndex; | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
</pre> | </pre> | ||
− | |||
− | + | To test your code changes with the v4.9.3 version please enable installation of testing builds through Software Updates and install on a development domain. | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
[[Category:Plugins]] | [[Category:Plugins]] |
Latest revision as of 13:14, 27 November 2007
How To Update
Within your object javascript simply add the following to the end, that is, after you have placed your object into the cell.
if ( window.checkPageAreas ){ checkPageAreas('start'); }
Our scrolling newsbox OkScrollData() function now looks like this.
function OkScrollData() { doOperation = 0; var dataTrue = dataData.search("pixel.gif"); disOne = document.getElementById('scrollname').selectedIndex; tscrollval = eval("document.getElementById('scrollname').options["+disOne+"].value"); tscrollname = eval("document.getElementById('scrollname').options["+disOne+"].innerHTML"); tscrollname = tscrollname.toString(); TextHeader = "<img src=images/text_header.gif width=199 height=15 border=0 align=left vspace=0 hspace=0 style='cursor: move;'><BR CLEAR=ALL>"; TableStart = "<table border=0 cellpadding=2 cellspacing=0 style='border: 1px inset black; background: #EFEFEF;'><tr><td width=199 align=center valign=top>"; TableEnd = "</td></tr></table><!-- ~~~ -->"; if (dataTrue > 0) { sText = TableStart+TextHeader+"<font style='font-family: Arial; font-size: 8pt;'><U><font color=darkblue>Scroll Box : "+tscrollname+"</font></U></FONT><!-- ##SCROLLNEWS;"+tscrollval+"## -->"+TableEnd; doOperation = 1; } else { sText = dataData+"<BR>"+TableStart+TextHeader+"<font style='font-family: Arial; font-size: 8pt;'><U><font color=darkblue>Scroll Box : "+tscrollname+"</font></U></FONT><!-- ##SCROLLNEWS;"+tscrollval+"## -->"+TableEnd; doOperation = 1; } if (doOperation == 1) { document.getElementById(ColRowID).innerHTML= sText; document.getElementById(ColRowID).style.backgroundColor= "#FFFFFF"; } document.getElementById('scrollname').selectedIndex = 0; // Reset Selection to Nothing(Null) if ( window.checkPageAreas ){ checkPageAreas('start'); } }
And thats it :)
Final note
The new page_editor.php uses a XHTML 1.0 Strict doctype and may effect the look/feel of your properties layer and will effect ill formed javascript.
Meaning that the following is no longer acceptable javascript.
myFoo = foo.selectedIndex;
It must be
myFoo = document.getElementById('foo').selectedIndex;
To test your code changes with the v4.9.3 version please enable installation of testing builds through Software Updates and install on a development domain.