From: Jonny B. <jo...@ti...> - 2010-02-12 13:06:29
|
Hi Nelson and all (devels too) I was tempted to put this defensive code in too, but all it does is hide errors occurring elsewhere. For instance, the collapse and expandSign functions causing errors were examples of categorize_list.php being included and not ever used (errors now happening after the move JS to end of page project). The best way to fix this, obviously, is not include files that aren't needed, and the JS errors were giving an indication of things that need fixing. I wonder what we could do so we can see these errors during testing, but hide them in release mode... I'll try adding something based on $TWV->branch (trunk, unstable or stable) but anyone with better suggestions please step forward :) jb On 12 Feb 2010, at 01:27, nk...@us... wrote: > Revision: 25117 > http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=25117&view=rev > Author: nkoth > Date: 2010-02-12 01:27:32 +0000 (Fri, 12 Feb 2010) > > Log Message: > ----------- > [FIX] Just some cleanup and prevention of js errors due to undefined elements > > Modified Paths: > -------------- > trunk/lib/tiki-js.js > > Modified: trunk/lib/tiki-js.js > =================================================================== > --- trunk/lib/tiki-js.js 2010-02-12 00:06:28 UTC (rev 25116) > +++ trunk/lib/tiki-js.js 2010-02-12 01:27:32 UTC (rev 25117) > @@ -438,8 +438,12 @@ > > > function show(foo,f,section) { > - document.getElementById(foo).style.display = "block"; > - if (f) { setCookie(foo, "o", section); } > + if (document.getElementById(foo)) { > + document.getElementById(foo).style.display = "block"; > + } > + if (f) { > + setCookie(foo, "o", section); > + } > } > > function hide(foo,f, section) { > @@ -879,11 +883,15 @@ > } > > function expandSign(foo) { > - document.getElementById(foo).firstChild.nodeValue = "[+]"; > + if (document.getElementById(foo)) { > + document.getElementById(foo).firstChild.nodeValue = "[+]"; > + } > } > > function collapseSign(foo) { > - document.getElementById(foo).firstChild.nodeValue = "[-]"; > + if (document.getElementById(foo)) { > + document.getElementById(foo).firstChild.nodeValue = "[-]"; > + } > } // flipWithSign() > > // > > > This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. > > ------------------------------------------------------------------------------ > SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, > Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW > http://p.sf.net/sfu/solaris-dev2dev > _______________________________________________ > Tikiwiki-cvs mailing list > Tik...@li... > https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs |