Monday, November 08, 2010 at 12:00 AM.
scripting2Suite.editor.addBookmarkCallback
on addBookmarkCallback (adrobject, adrlogic, adrtitle) {
<<Changes
<<7/10/10; 4:13:52 AM by DW
<<The summit headline no longer has a text attribute. Instead call op.getlinetext to get the title.
<<6/29/10; 7:51:52 AM by DW
<<Called from bookmarksMenu.add when the user has added a bookmark. If he's in one of our editing windows, we offer to bookmark the post he's editing.
if scripting2Suite.editor.isEditingWindow (adrobject) {
local (atts, localoutline = adrobject^);
local (oldtarget = target.set (@localoutline));
op.go (left, infinity);
op.attributes.getall (@atts);
scratchpad.atts = atts;
if defined (atts.url) {
local (opmlurl = string.popsuffix (atts.url) + ".opml");
adrtitle^ = op.getlinetext (); //atts.text
adrlogic^ = "scripting2Suite.editor.openEditWindow (\"" + opmlurl + "\")";
return (true)}};
return (false)};
bundle { //test code
addBookmarkCallback (@scripting2Data.editor.workspace.outline, @scratchpad.logic, @scratchpad.title)}
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.