TiddlyWikiComplexSearchPlugin

From TiddlyWikiGoogleTagCombinations

The extended TiddlyWiki Plugin Code

This small TiddlyWiki.com hack makes the SearchTagPlugin by the author FND [[1]] even more useful (especially for) collaborative work.

if(!version.extensions.SearchTagPlugin) {
version.extensions.SearchTagPlugin = {
	installed: true,
	URL: "http://google.com/search?q=",
	label: "G",
/* Fridemar introduced these labelTags ... */
	labelTags: [["0|",""],
	["1|","TiddlyWiki "],["2","JavaScript "]]
};

// hijack createTiddlyLink() to prepend search link
createTiddlyLink_SearchTag = window.createTiddlyLink;
window.createTiddlyLink = function(place, title, includeText, className, isStatic, linkedFromTiddler, noToggle) {
	var cfg = version.extensions.SearchTagPlugin;

/* ... and the following for-loop to demonstrate, how this
   allows complex Google queries, bound to standard tags.
   Now you can imagine the power of option boxes before each
   Wiki-link */

	for (var i=0;i<cfg.labelTags.length;i++) {
		createTiddlyText(createExternalLink(place,
			cfg.URL + cfg.labelTags[i][1]+title),
			cfg.labelTags[i][0]);
	}

	createTiddlyText(place, " ");
	return createTiddlyLink_SearchTag.apply(this, arguments);
};

} //# end of "install only once"

What it produces

On the start of TiddlyWiki

each WikiLink is additionally prefixed by external Google query links

Our012TiddlyWiki.jpg

After clicking the zero link

e.g. before GettingStarted, only the following WikiLink is queried by Google.

Google GettingStarted.jpg


After clicking the one link

e.g. before GettingStarted, the following WikiLink, combined with the additional, blank-delimited searchword "TiddlyWiki", is queried by Google.

Google TiddlyWiki GettingStarted.jpg


After clicking the two link

e.g. before GettingStarted, the following WikiLink, combined with the additional, blank-delimited searchword "JavaScript", is queried by Google.


Google JavaScript GettingStarted.jpg

Note

This is a real timesaver for collaborative Googling on filtering topics, especially, if we make it enduser-selectable by checkboxes. Let's call the next extension with checkboxes for userdefined complex Google queries CheckItTiddlyWiki.

GoogleGroupTiddlyWikiCallForCollaboration

fridemar 17:29, 31 July 2008 (PDT) fridemar 16:14, 31 July 2008 (PDT)



Retrieved from "http://aboutus.com/index.php?title=TiddlyWikiComplexSearchPlugin&oldid=16126276"