Wednesday, February 16, 2011 at 12:00 AM.

river2Suite.static.buildJavaScriptInclude

on buildJavaScriptInclude (adruser) {
	<<Changes
		<<12/5/10; 2:57:26 PM by DW
			<<Maintain stats about how long it takes to build the JavaScript include page for the news page. Want to see if it's worth optimizing.
		<<11/9/10; 10:24:56 AM by DW
			<<Replace call to file.writewholefile with river2Suite.static.writeFile.
		<<5/4/10; 5:24:18 AM by DW
			<<Create a static JavaScript include file that includes all the current news items for the indicated user. 
	local (adrdata = river2suite.init (), nameuser = nameof (adruser^), pagetable, htmltext, startticks = clock.ticks ());
	river2Suite.static.setupPagetable (adruser, @pagetable, ".js");
	html.setpagetableaddress (@pagetable);
	htmltext = river2Suite.viewNews ();
	river2Suite.static.writeFile (pagetable.river2.staticFname, html.buildJavascriptInclude (htmltext), adruser);
	bundle { //log the stats, 12/5/10 by DW
		if adruser != nil {
			river2Suite.initUser (adruser);
			adruser^.stats.ctJsIncludeBuilds++;
			adruser^.stats.whenLastJsIncludeBuild = clock.now ();
			adruser^.stats.ctTicksLastJsBuild = clock.ticks () - startticks}}};
bundle { //test code
	buildJavaScriptInclude (@config.river2.users.nyblogs)}



This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.