View Single Post
Posts: 30 | Thanked: 2 times | Joined on Jul 2007
#1
i'm a big fan of david allen's GTD and want to use tiddlywiki as a base for notetaking/daily planning, so with some modification, I ported tiddlywiki for the maemo opera browser using a locally run http/php server - here are my results (works! yay =]), installation instructions and development notes





###INSTALLATION###
1. There are some prereq's for my version of GTD, because it uses php for saving files - go and install these two packages in this order:
http://maemo-hackers.org/php5-fastcgi.install (PHP5)
http://maemo-hackers.org/nginx.install (HTTP Server)
(source: http://www.mail-archive.com/maemo-de.../msg08379.html )
2. Unzip the tiddlywiki of your choice (tiddlywiki_phpsave_v8.zip or gtd_tiddlywiki_phpsave_v2.zip) to /var/www/tw/
3. [EDIT] using the n800 terminal (or ssh) login as root (ssh root@localhost from your n800 or ssh root@your.ip.here from a remote computer) and run "chmod -R 777 /var/www/tw"
4. Use the Mameo-Browser and navigate to http://localhost/tw
5. Enjoy =]

Let me know if you have any installation problems

Quick Notes:
  • yes, i know it take a long time to save
  • if you want to rename your tiddlywiki, you have to change some settings in the html and php files
  • --in index.html search for: "var PHPLoadFile_fileUrl = "empty.html"; //location of your tiddlywiki" and change to your liking
  • --in tw_upload.php search for: "$tiddlywiki_filename = "index.html";" and change to your liking
  • recommended tweaks (goto the backstage)
  • --disable animations
  • --disable keep backup (the php doesn't save the backup as of now)
  • --if you save the file back to your computer (ex: email it to yourself) and save it as a regular file, it should save normally and the backup will work if you enable it





###DEV NOTES###
the vanilla GTD v2.2 is read-only for the maemo-browser because the mameo browser runs through 3 browser independent save methods, one for mozilla, ie, and java - unfortuently, the maemo opera browser supports none of these, therefore i created a plugin that allows you to save one any php-enabled server

first, i tried making a .html that would open a new window that you could save using document.documentElement.innerHTML to get the contents of the document and then apply the same changes as a normal save, but i couldn't get rid of the dirty flag that tiddlywiki implements

second, i tried using the http://tiddlywiki.bidix.info/ plugin for php upload - however, for some reason it doesn't work (i'm guessing mameo's opera is particularly picky about the xmlhttp request)

finally, i decided to take my own shot at a php-saving plugin and voila - here it is - as a disclaimer, i suck at javascript as i just dabble in programming (i'm going to a liberal arts college, geez =P ) so this might not be the most effective way to do it - i'm open to comments, suggestions and your own mods and would really like to see them! =]

random: xmlhttp has an interesting bug where the file sending a GET request can't request its own file, so the redirect.php file is there to well... redirect your GET request basically

oh yea - the linux top results while saving show that the browser takes >90% of cpu while saving and hogs a lot of ram - perhaps one of the better coders could help me cut ram usage and take care of the cpu issue? maybe using and older version of tiddlywiki would help as i don't think i need all the features of 2.2

and if someone wants to try my plugin with another version of tiddlywiki, lemme know how it goes - here're some tips for using my plugin with other tiddlywiki's





###PLUGIN ADAPTATION FOR OTHER TIDDLYWIKI VERSIONS###
-install the plugin as usual (you'll probably want to do this from file:// on your main comp)
-find the
Code:
// Options that can be set in the options panel and/or cookies
config.options = {
and change chkHttpReadOnly to false - this allows us to edit our tiddlywiki from http://localhost/
-find the line that requires the file:// url to save and comment it out
---on the vanilla tiddlywiki v2.2, this is what it looks like after it has been commented with /* and */
Code:
	/*if(originalPath.substr(0,5) != "file:") {
		alert(config.messages.notFileUrlError);
		if(store.tiddlerExists(config.messages.saveInstructions))
			story.displayTiddler(null,config.messages.saveInstructions);
		return;
	}*/
-find the function saveFile and function loadFile and add a call to the PHP plugin
------on the vanilla tiddlywiki v2.2, this is what it looks like after it has been changed (the original only has the mozilla, ie, and java):
Code:
function saveFile(fileUrl,content)
{
	var r = null;
	if(!r)
		r = mozillaSaveFile(fileUrl,content);
	if(!r)
		r = ieSaveFile(fileUrl,content);
	if(!r)
		r = javaSaveFile(fileUrl,content);
	if(!r)
		r = config.macros.PHPSaveFile(fileUrl,content);
	return r;
}

function loadFile(fileUrl)
{
	var r = null;
	if((r == null) || (r == false))
		r = mozillaLoadFile(fileUrl);
	if((r == null) || (r == false))
		r = ieLoadFile(fileUrl);
	if((r == null) || (r == false))
		r = javaLoadFile(fileUrl);
	if((r == null) || (r == false))
		r = config.macros.PHPLoadFile(fileUrl);
	return r;
}

###WHICH TIDDLYWIKI?###
Well, here are some very unscientific benchmarks for the save time of various browsers:

Maemo-Browser
Tiddlywiki v2.2 - >1 minute - renders pages well
GTD Tiddlywiki v1.2.32 - approx 3 sec - renders well

Minimo
Tiddlywiki v2.2 - approx 3-5 sec - some minor page artifacts, works well
GTD Tiddlywiki v1.2.32 - approx 3-5 sec


###ACCESSING LOCALHOST WHEN NOT ONLINE###
the mameo-browser is picky in that i won't let you access browsing features if you're not connected to a network. here's the solution:
http://www.internettablettalk.com/fo...p?t=842&page=2
Attached Files
File Type: zip gtd_tiddlywiki_phpsave_v2.zip (31.6 KB, 245 views)
File Type: zip tiddlywiki_phpsave_v8.zip (67.6 KB, 242 views)

Last edited by ifallacy; 2007-07-09 at 06:27. Reason: minor updates
 

The Following User Says Thank You to ifallacy For This Useful Post: