Updating page editor hooks for v4.9.3

From Sohowiki
Jump to: navigation, search

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.

Personal tools