Updating page editor hooks for v4.9.3
From Sohowiki
(Difference between revisions)
(→The Easy Way To Update) |
(→The Easy Way To Update) |
||
Line 4: | Line 4: | ||
if ( window.checkPageAreas ){ | if ( window.checkPageAreas ){ | ||
checkPageAreas('start'); | checkPageAreas('start'); | ||
+ | } | ||
+ | </pre> | ||
+ | |||
+ | Our scrolling newsbox OkScrollData() function now looks like this. | ||
+ | |||
+ | <pre> | ||
+ | function OkScrollData() { | ||
+ | doOperation = 0; | ||
+ | |||
+ | var dataTrue = dataData.search("pixel.gif"); | ||
+ | |||
+ | disOne = $('scrollname').selectedIndex; | ||
+ | tscrollval = eval("$('scrollname').options["+disOne+"].value"); | ||
+ | tscrollname = eval("$('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><!-- ~~~ -->"; | ||
+ | |||
+ | // TableStart = "<div id=\"scrollId1\" style=\"height: 120px;\" class=\"droppedItem\"><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></div><!-- ~~~ -->"; | ||
+ | |||
+ | 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"; | ||
+ | } | ||
+ | $('scrollname').selectedIndex = 0; // Reset Selection to Nothing(Null) | ||
+ | |||
+ | if ( window.checkPageAreas ){ | ||
+ | checkPageAreas('start'); | ||
+ | } | ||
} | } | ||
</pre> | </pre> |
Revision as of 12:05, 27 November 2007
The Easy Way 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 = $('scrollname').selectedIndex; tscrollval = eval("$('scrollname').options["+disOne+"].value"); tscrollname = eval("$('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><!-- ~~~ -->"; // TableStart = "<div id=\"scrollId1\" style=\"height: 120px;\" class=\"droppedItem\"><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></div><!-- ~~~ -->"; 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"; } $('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.