Monday, November 08, 2010 at 12:00 AM.

scripting2Suite.menuCommands.chooseHeaderGraphic

on chooseHeaderGraphic () {
	<<Changes
		<<7/2/10; 6:27:55 AM by DW
			<<Created. 
	local (f, adrtemplate = @scripting2Suite.data.html.headerGraphicTemplate);
	if file.getfiledialog ("Image file containing header graphic?", @f, 0) {
		local (lowerf = string.lower (f));
		if (lowerf endswith "gif") or (lowerf endswith "jpg") or (lowerf endswith "jpeg") {
			local (url = scripting2Suite.editor.uploadImageFile (f), prefstable);
			local (img = scripting2Suite.editor.getImageClipboardText (f, url, adrtemplate));
			new (tabletype, @prefstable);
			prefstable.headerImage = img;
			scripting2Suite.editor.savePrefs (@prefstable)}
		else {
			scripterror ("Can't upload the file because header graphics must be GIF or JPEG.")}}};
bundle { //test code
	chooseHeaderGraphic ()}



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.