» tagged pages
» logout
tiddlywiki
Return to tiddlywiki

TiddlyWiki Changes RSS

(or Cancel)

(Editing anonymously: to be credited for your changes, login or register a new account)

other page actions:

Tags Applied to this Topic

No one has tagged this page.

tiddlywiki Wiki Pages

Wednesday, September 03, 2008

SimpleSearchPlugin

NameSimpleSearchPlugin
Descriptiondisplays search results as a simple list of matching tiddlers
AuthorsFND
Version0.4.0
Statusstable
Sourcehttp://devpad.tiddlyspot.com/#SimpleSearchPlugin
CodeRepositoryhttp://svn.tiddlywiki.org/Trunk/contributors/FND/plugins/SimpleSearchPlugin.js
LicenseCreative Commons Attribution-ShareAlike 3.0 License
Keywordssearch

Revision History

v0.2.0 (2008-08-18)

  • initial release

v0.3.0 (2008-08-19)

  • added Open All button (renders Classic Search option obsolete)
  • sorting by relevance (title matches before content matches)

v0.4.0 (2008-08-26)

  • added tag matching

To Do

  • tag matching optional
  • animations for container creation and removal
  • when clicking on search results, do not scroll to the respective tiddler (optional)
  • use template for search results

Code

if(!version.extensions.SimpleSearchPlugin) { //# ensure that the plugin is only installed once
version.extensions.SimpleSearchPlugin = { installed: true };
if(!plugins) { var plugins = {}; } plugins.SimpleSearchPlugin = { heading: "Search Results", containerId: "searchResults", btnCloseLabel: "close", btnCloseTooltip: "dismiss search results", btnCloseId: "search_close", btnOpenLabel: "Open all", btnOpenTooltip: "open all search results", btnOpenId: "search_open", displayResults: function(matches, query) { story.refreshAllTiddlers(true); // update highlighting within story tiddlers var el = document.getElementById(this.containerId); query = '"""' + query + '"""'; // prevent WikiLinks if(el) { removeChildren(el); } else { //# fallback: use displayArea as parent var container = document.getElementById("displayArea"); el = document.createElement("div"); el.setAttribute("id", this.containerId); el = container.insertBefore(el, container.firstChild); } var msg = "!" + this.heading + "\n"; if(matches.length > 0) { msg += "''" + config.macros.search.successMsg.format([matches.length.toString(), query]) + ":''\n"; this.results = []; for(var i = 0 ; i < matches.length; i++) { this.results.push(matches[i].title); msg += "* [[" + matches[i].title + "]]\n"; } } else { msg += "''" + config.macros.search.failureMsg.format([query]) + "''"; // XXX: do not use bold here!? } createTiddlyButton(el, this.btnCloseLabel, this.btnCloseTooltip, plugins.SimpleSearchPlugin.closeResults, "button", this.btnCloseId); wikify(msg, el); if(matches.length > 0) { // XXX: redundant!? createTiddlyButton(el, this.btnOpenLabel, this.btnOpenTooltip, plugins.SimpleSearchPlugin.openAll, "button", this.btnOpenId); } },
closeResults: function() { var el = document.getElementById(plugins.SimpleSearchPlugin.containerId); removeNode(el); plugins.SimpleSearchPlugin.results = null; highlightHack = null; },
openAll: function(ev) { story.displayTiddlers(null, plugins.SimpleSearchPlugin.results); return false; } };
config.shadowTiddlers.StyleSheetSimpleSearch = "/*{{{*/\n" + "#" + plugins.SimpleSearchPlugin.containerId + " {\n" + "\toverflow: auto;\n" + "\tpadding: 5px 1em 10px;\n" + "\tbackground-color: [[ColorPalette::TertiaryPale]];\n" + "}\n\n" + "#" + plugins.SimpleSearchPlugin.containerId + " h1 {\n" + "\tmargin-top: 0;\n" + "\tborder: none;\n" + "}\n\n" + "#" + plugins.SimpleSearchPlugin.containerId + " ul {\n" + "\tmargin: 0.5em;\n" + "\tpadding-left: 1.5em;\n" + "}\n\n" + "#" + plugins.SimpleSearchPlugin.containerId + " .button {\n" + "\tdisplay: block;\n" + "\tborder-color: [[ColorPalette::TertiaryDark]];\n" + "\tpadding: 5px;\n" + "\tbackground-color: [[ColorPalette::TertiaryLight]];\n" + "}\n\n" + "#" + plugins.SimpleSearchPlugin.containerId + " .button:hover {\n" + "\tborder-color: [[ColorPalette::SecondaryMid]];\n" + "\tbackground-color: [[ColorPalette::SecondaryLight]];\n" + "}\n\n" + "#" + plugins.SimpleSearchPlugin.btnCloseId + " {\n" + "\tfloat: right;\n" + "\tmargin: -5px -1em 5px 5px;\n" + "}\n\n" + "#" + plugins.SimpleSearchPlugin.btnOpenId + " {\n" + "\tfloat: left;\n" + "\tmargin-top: 5px;\n" + "}\n" + "/*}}}*/"; store.addNotification("StyleSheetSimpleSearch", refreshStyles);
// override Story.search() Story.prototype.search = function(text, useCaseSensitive, useRegExp) { highlightHack = new RegExp(useRegExp ? text : text.escapeRegExp(), useCaseSensitive ? "mg" : "img"); var matches = store.search(highlightHack, null, "excludeSearch"); var q = useRegExp ? "/" : "'"; plugins.SimpleSearchPlugin.displayResults(matches, q + text + q); };
// override TiddlyWiki.search() to sort by relevance TiddlyWiki.prototype.search = function(searchRegExp, sortField, excludeTag, match) { var candidates = this.reverseLookup("tags", excludeTag, !!match); var primary = []; var secondary = []; var tertiary = []; for(var t = 0; t < candidates.length; t++) { if(candidates[t].title.search(searchRegExp) != -1) { primary.push(candidates[t]); } else if(candidates[t].tags.join(" ").search(searchRegExp) != -1) { secondary.push(candidates[t]); } else if(candidates[t].text.search(searchRegExp) != -1) { tertiary.push(candidates[t]); } } var results = primary.concat(secondary).concat(tertiary); if(sortField) { results.sort(function(a, b) { return a[sortField] < b[sortField] ? -1 : (a[sortField] == b[sortField] ? 0 : +1); }); } return results; };
} //# end of "install only once"

Thursday, August 28, 2008

Installation guidelines: Safari on Mac OS X

Follow these easy steps to get started! Note that these guidelines are for Safari 3.1.2 running on Mac OS X 10.5.4, but will apply to several other configurations (other versions of Safari and Opera too)

If these guidelines aren't appropriate, check the other browser-specific guidelines to find some that are right for you.

Step 1 - Check downloaded files

After Download, check first that you have automatically received a zip file containing two files (the contents of the zip file may have been extracted automatically - if not, open the zip file):
  • empty.html (this is your TiddlyWiki file)
  • TiddlySaver.jar (this is a java applet, which will make sure everything works in your chosen browser. Note a copy of this file must be kept in the same folder as any TiddlyWiki file you are using)

You can download the TiddlySaver.jar file on it's own from here if you need it.

Double click the empty.html file to get started.

Step 2 - Open file

The system will check you're happy to open the TiddlyWiki file. Click on 'Open'.


Step 3 - Trust applet

The TiddlySaver.jar applet has been signed by UnaMesa, who hold the rights to TiddlyWiki on behalf of the community. You can find out more about the applet itself here, and you'll need to click on 'Trust' in order for the TiddlyWiki to work. If you've accidentally clicked on 'Don't Trust' previously, don't worry - just restart the browser and you should get asked again.


Step 4 - You're done!

Thanks to the applet, you now have the full functionality of TiddlyWiki at your disposal. Be sure to check out the guidelines in Getting Started!

Thursday, August 28, 2008

Installation guidelines: Opera on Mac OS X

Follow these easy steps to get started! Note that these guidelines are for Opera 9.5.1 running on Mac OS X 10.5.4, but will apply to several other configurations (including most other versions of Opera)

If these guidelines aren't appropriate, check the other browser-specific guidelines to find some that are right for you.

Step 1 - Download files

Download the zip file to a location of your choice.


Step 2 - Check files

Open the zip file, and then check in the resulting folder that you have automatically received two files:
  • empty.html (this is your TiddlyWiki file)
  • TiddlySaver.jar (this is a java applet, which will make sure everything works in your chosen browser. Note a copy of this file must be kept in the same folder as any TiddlyWiki file you are using)

You can download the TiddlySaver file on it's own from here if you need it.

Open the empty.html file to get started.

Step 3 - Trust applet

The TiddlySaver.jar applet has been signed by UnaMesa, who hold the rights to TiddlyWiki on behalf of the community. You can find out more about the applet itself here, and you'll need to click on 'Trust' in order for the TiddlyWiki to work. If you've accidentally clicked on 'Don't Trust' previously, don't worry - just restart the browser and you should get asked again.


Step 4 - You're done!

Thanks to the applet, you now have the full functionality of TiddlyWiki at your disposal. Be sure to check out the guidelines in Getting Started!

Thursday, August 28, 2008

Installation guidelines: Firefox on Mac OS X

Follow these easy steps to get started! Note that these guidelines are for Firefox v3.0.1 running on Mac OS X 10.5.4.

If these guidelines aren't appropriate, check the other browser-specific guidelines to find some that are right for you.

Step 1 - Download file

You'll need to choose a name and location for your empty TiddlyWiki file - we recommend either your Desktop or Documents folder. Make sure you keep the .html file extension and leave the "Save As: Hypertext" default option as it is.

Step 2 - Download complete

Empty TiddlyWiki files are very small, and download should be completed quickly. You can now either launch the file from the download pane (shown below, double click on the file name to launch), or open your finder to open the file from there.

Step 3 - Open file

You'll be asked if you're sure you want to open the file - click "Open".

Step 4 - Grant authority

When you try to save your changes for the first time, Firefox may ask you to grant access to the file system. You will need to 'Allow' this for TiddlyWiki changes to be saved, and we recommend you tick the 'Remember this decision' checkbox so this dialogue box doesn't appear each time.



Step 5 - You're ready to start!

You're now ready to start playing with your TiddlyWiki file - be sure to check out the guidelines in Getting Started!

Thursday, August 28, 2008

Installation guidelines: Firefox on Windows Vista

Follow these steps to get started! These guidelines are for Firefox 3.0.1 running on Microsoft Windows Vista 6.0.0. Hopefully they will be helpful for your setup too.

If these guidelines aren't appropriate, check the other browser-specific guidelines to find some that are right for you.

Step 1 - Download file

You'll need to choose a name and location for your empty TiddlyWiki file - we recommend either your Desktop or Documents folder. Make sure you leave the "Save as type: HTML Document" default option as it is. Then click 'Save'.


Step 2 - Open file

Click on the file name in the Download dialogue box. This will open your TiddlyWiki file, and you'll be able to start editing immediately - but you'll need to complete Step 3 below to save your changes.


Step 3 - Enable advanced features

When you try to save changes for the first time, this dialogue box will appear. These features will enable the saving mechanism. Tick the 'Remember this decision' checkbox and then click on 'Allow'.


Step 4 - You're ready to start!

You're now ready to start playing with your TiddlyWiki file - be sure to check out the guidelines in Getting Started!

Thursday, August 28, 2008

Installation guidelines: Firefox on Windows

Follow these steps to get started! These guidelines are for Firefox 3.0.1 running on Microsoft Windows Vista 6.0.0. Hopefully they will be helpful for your setup too.

If these guidelines aren't appropriate, check the other browser-specific guidelines to find some that are right for you.

Step 1 - Download file

You'll need to choose a name and location for your empty TiddlyWiki file - we recommend either your Desktop or Documents folder. Make sure you leave the "Save as type: HTML Document" default option as it is. Then click 'Save'.


Step 2 - Open file

Click on the file name in the Download dialogue box. This will open your TiddlyWiki file, and you'll be able to start editing immediately - but you'll need to complete Step 3 below to save your changes.


Step 3 - Enable advanced features

When you try to save changes for the first time, this dialogue box will appear. These features will enable the saving mechanism. Tick the 'Remember this decision' checkbox and then click on 'Allow'.


Step 4 - You're ready to start!

You're now ready to start playing with your TiddlyWiki file - be sure to check out the guidelines in Getting Started!

Thursday, August 28, 2008

Installation guidelines: Firefox on Windows XP

Follow these steps to get started! These guidelines are for Firefox 3.0.1 running on Microsoft Windows XP, Service Pack 3. Hopefully they will be helpful for your setup too.

If these guidelines aren't appropriate, check the other browser-specific guidelines to find some that are right for you.

Step 1 - Download file

You'll need to choose a name and location for your empty TiddlyWiki file - we recommend either your Desktop or My Documents folder. Make sure you leave the "Save as type: Firefox Document" default option as it is. Then click 'Save'.


Step 2 - Open file

Double click on the file name in the Download dialogue box, shown below. This will open your TiddlyWiki file, and you'll be able to start editing immediately - but you'll need to complete Step 3 below to save your changes.


Step 3 - Enable advanced features

When you try to save changes for the first time, this dialogue box will appear. These features will enable the saving mechanism. Tick the 'Remember this decision' checkbox and then click on 'Allow'.

Step 4 - You're ready to start!

You're now ready to start playing with your TiddlyWiki file - be sure to check out the guidelines in Getting Started!

Thursday, August 28, 2008

Installation guidelines: Firefox on Ubuntu

Follow these easy steps to get started! Note that these guidelines are for Firefox v3.0.1 running on Ubuntu version 8.0.4 (Hardy Heron).

If these guidelines aren't appropriate, check the other browser-specific guidelines to find some that are right for you.

Step 1 - Download file

You'll need to choose a name and location for your empty TiddlyWiki file - we recommend either your Desktop or Documents folder. Make sure you keep the file type as HTML Document.


Step 2 - Download complete

Empty TiddlyWiki files are very small, and download should be completed quickly. You can now either launch the file from the download pane (shown below, double click on the file name to launch), or open your finder to open the file from there.



Step 3 - Grant authority

When you try to save your changes for the first time, Firefox may ask you to grant access to the file system. You will need to 'Allow' this for TiddlyWiki changes to be saved, and we recommend you tick the 'Remember this decision' checkbox so this dialogue box doesn't appear each time.



Step 4 - You're ready to start!

You're now ready to start playing with your TiddlyWiki file - be sure to check out the guidelines in Getting Started!

Thursday, August 28, 2008

Installation guidelines: Internet Explorer on Windows

Follow these steps to get started! These guidelines are for Internet Explorer 7.0 running on Microsoft Windows Vista 6.0.0. Hopefully they will be helpful for your setup too.

If these guidelines aren't appropriate, check the other browser-specific guidelines to find some that are right for you.

Step 1 - Download file

You'll need to choose a name and location for your empty TiddlyWiki file - we recommend either your Desktop or Documents folder. Make sure you leave the "Save as type: HTML Document" default option as it is. Then click 'Save'.


Step 2 - Open folder

Once the download has been completed, don't open the file yet - a minor modification is required before TiddlyWiki will work! Click on 'Open Folder'.


Step 3 - Modify properties

In the folder, right click on the file name and select 'Properties' from the bottom of the contextual menu.


Step 4 - Unblock file

In order to allow saving, you need to Unblock the file. Select 'Unblock' near the bottom of the dialogue box, then click on 'OK'. If the Unblock button doesn't appear, then you don't need to worry about it - click on OK and proceed to step 5.



Step 5 - Open file

Double click on the file name to open the file. Internet Explorer takes special care to block javascript from untrusted sources, so a screen will appear with a yellow bar at the top and a warning in red. Click on the yellow bar (this will make it turn blue, as shown below), and select 'Allow Blocked Content...'.



Step 6 - Allow active content

TiddlyWiki contains 'active content' that, for example, allows search and tagging to function. Approve this active content by clicking on 'Yes'.

Step 7 - Enable saving mechanism

One final hurdle! When you save for the first time, you'll be prompted to allow the activity. Click on 'Yes'.

Step 8 - You're ready to start!

You're now ready to start playing with your TiddlyWiki file - be sure to check out the guidelines in Getting Started!

Thursday, August 28, 2008

Installation guidelines: Internet Explorer on Windows Vista

Follow these steps to get started! These guidelines are for Internet Explorer 7.0 running on Microsoft Windows Vista 6.0.0. Hopefully they will be helpful for your setup too.

If these guidelines aren't appropriate, check the other browser-specific guidelines to find some that are right for you.

Step 1 - Download file

You'll need to choose a name and location for your empty TiddlyWiki file - we recommend either your Desktop or Documents folder. Make sure you leave the "Save as type: HTML Document" default option as it is. Then click 'Save'.


Step 2 - Open folder

Once the download has been completed, don't open the file yet - a minor modification is required before TiddlyWiki will work! Click on 'Open Folder'.


Step 3 - Modify properties

In the folder, right click on the file name and select 'Properties' from the bottom of the contextual menu.


Step 4 - Unblock file

In order to allow saving, you need to Unblock the file. Select 'Unblock' near the bottom of the dialogue box, then click on 'OK'. If the Unblock button doesn't appear, then you don't need to worry about it - click on OK and proceed to step 5.



Step 5 - Open file

Double click on the file name to open the file. Internet Explorer takes special care to block javascript from untrusted sources, so a screen will appear with a yellow bar at the top and a warning in red. Click on the yellow bar (this will make it turn blue, as shown below), and select 'Allow Blocked Content...'.



Step 6 - Allow active content

TiddlyWiki contains 'active content' that, for example, allows search and tagging to function. Approve this active content by clicking on 'Yes'.

Step 7 - Enable saving mechanism

One final hurdle! When you save for the first time, you'll be prompted to allow the activity. Click on 'Yes'.

Step 8 - You're ready to start!

You're now ready to start playing with your TiddlyWiki file - be sure to check out the guidelines in Getting Started!

Thursday, August 28, 2008

Installation guidelines: Internet Explorer on Windows XP

Follow these steps to get started! These guidelines are for Internet Explorer 7.0 running on Microsoft Windows XP, Service Pack 3. Hopefully they will be helpful for your setup too.

If these guidelines aren't appropriate, check the other browser-specific guidelines to find some that are right for you.

Step 1 - Download file

You'll need to choose a name and location for your empty TiddlyWiki file - we recommend either your Desktop or My Documents folder. Make sure you leave the "Save as type: HTML Document" default option as it is. Then click 'Save'.


Step 2 - Open folder

Once the download has been completed, don't open the file yet - a minor modification is required before TiddlyWiki will work! Click on 'Open Folder'.


Step 3 - Modify properties

In the folder, right click on the file name and select 'Properties' from the bottom of the contextual menu.


Step 4 - Unblock file

In order to allow saving, you need to Unblock the file. Select 'Unblock' near the bottom of the dialogue box, then click on 'OK'. If the Unblock button doesn't appear, then you don't need to worry about it - click on OK and proceed to step 5.



Step 5 - Open file

Now you've unblocked the file, you can double click on the file name to open the file. Internet Explorer takes special care to block javascript from untrusted sources, so a screen will appear with a yellow bar at the top and a warning in red. Click on the yellow bar (this will make it turn blue, as shown below), and select 'Allow Blocked Content...'.


Step 6 - Allow active content

TiddlyWiki contains 'active content' that, for example, allows animations to function. Approve this active content by clicking on 'Yes'.

Step 7 - Enable saving mechanism

One final hurdle! When you save for the first time, you'll be prompted to allow the activity. Click on 'Yes'.

Step 8 - You're ready to start!

You're now ready to start playing with your TiddlyWiki file - be sure to check out the guidelines in Getting Started!

Thursday, August 28, 2008

Browsers

Here is a table of PC / Mac / Linux browsers that work with TiddlyWiki:

BrowserVersionAllows changes to be saved locally?
InternetExplorer6.0+Yes
FireFox1.0+Yes
Safari1.0+Yes, using TiddlySaver plugin
Opera?Yes, using TiddlySaver plugin
Netscape Navigator7.0+Yes
Camino1.0+Yes
ChromeAllNo
WiiAllNo

Please let us know of any additions or corrections.

Thursday, August 28, 2008

Advanced download options

When you click on the blue download button, the website will detect your browser and operating system, and trigger a download for either an empty TiddlyWiki file or, if you're running Safari or Opera, a zip file which also includes the TiddlySaver file. This is version 2.4.1 of TiddlyWiki (release notes)

Advanced users may find these links helpful:

Thursday, August 28, 2008

Download

Thursday, August 28, 2008

WikiWordEscape

Sometimes it's handy to be able to write WikiWords without them being recognised as links (for people's names, for instance). You can do this by preceding the WikiWord with a tilde (~). For example, JamesBond, JavaScript and TiddlyWiki

Friday, August 24, 2007

VisualTWServer

Friday, August 24, 2007

PluginFormat

It is recommended that Plugins start with some standard information in TiddlerSlicing format. For example, see the ExamplePlugin:
|''Name:''|ExamplePlugin|
|''Description:''|To demonstrate how to write TiddlyWiki plugins|
|''Version:''|2.0.2|
|''Date:''|Jul 12, 2006|
|''Source:''|http://www.tiddlywiki.com/#ExamplePlugin|
|''Author:''|JeremyRuston (jeremy (at) osmosoft (dot) com)|
|''License:''|[[BSD open source license]]|
|''~CoreVersion:''|2.1.0|
|''Browser:''|Firefox 1.0.4+; Firefox 1.5; InternetExplorer 6.0|
At the moment, only CoreVersion affects how Plugins are processed: if the CoreVersion is specified for a plugin, TiddlyWiki will only execute the plugin if the core code version matches or exceeds the version specified. For example, if you specify a CoreVersion of 2.2, version 2.1.x of TiddlyWiki will refuse to execute the plugin.

To indicate an error, plugins should just throw an exception. The text of the exception will be displayed in the PluginManager.

Friday, August 24, 2007

TiddlyBookmarklets

Bookmarklets can be useful for TiddlyWiki hackers. They are browser bookmarks that contain embedded JavaScript that can reach into the currently loaded TiddlyWiki page to manipulate them and extract data.

Drag these links to your bookmark/favourites bar, or right click on them and choose "add to bookmarks" or "add to favourites":

If you're creating your own bookmarklets, this editor and these tips are useful resources.

Thursday, June 07, 2007

PrinceTiddlyWikiExtensionsServer

Thursday, June 07, 2007

Feedback

If you've any comments, corrections or observations about TiddlyWiki, the best way to get our attention is to post to the Community groups or write a blog entry.
Page 1 | Next >>
Username:
Password:
(or Cancel)