Monday, 16. May 2005, 15:26:16
GTDTiddlyWiki
The problem is not the website ([url]http://shared.snapgrid.com/gtd_tiddlywiki.html), but the html-file you store on your local machine.This is a GTD (getting things done) "application" consisting of one html-file (including some javascript). Everything seems to work fine, except that when you've done changes to the file, you're not allowed to save. Instead a javascript error window pops up saying
"It's not possible to save changes using this browser. Use FireFox if you can"
Identifying Opera as IE or Mozilla does not help.
Ketil
Tuesday, 17. May 2005, 05:32:08
Unsurprisingly, neither of those techniques will work for any other browser. What works for Opera is using LiveConnect to access Java:
function operaSaveFile(filePath, content)
{
try{
var s = new java.io.PrintStream(new java.io.FileOutputStream(filePath));
s.print(content);
s.close();
} catch(e) {
opera.postError(e);
return null;
}
return true;
}
function operaLoadFile(filePath)
{
var content = '';
try {
var r = new java.io.BufferedReader(new java.io.FileReader(filePath));
var line;
while ((line = r.readLine()) != null) content += line + '\n';
r.close();
} catch(e) {
opera.postError(e);
return null;
}
return content;
}
You also need to modify your Java security policy, "C:\Documents and Settings\your-name\.java.policy":grant codeBase "file:/c:/gtd_tiddlywiki.html" {
permission java.io.FilePermission "c:\\gtd_tiddlywiki.html", "read,write";
permission java.io.FilePermission "c:\\gtd_tiddlywiki_backup.html", "read,write";
};setting the names appropriate to wherever the wiki file is.Feel free to get in touch with the developer of the wiki and pass this info on.
Thursday, 19. May 2005, 03:36:37
function saveFile(fileUrl, content)
{
var r = mozillaSaveFile(fileUrl, content);
if((r == null) || (r == false))
r = ieSaveFile(fileUrl, content);
[color=red] if((r == null) || (r == false))
r = operaSaveFile(fileUrl, content);[/color]
return(r);
}
function loadFile(fileUrl)
{
var r = mozillaLoadFile(fileUrl);
if((r == null) || (r == false))
r = ieLoadFile(fileUrl);
[color=red] if((r == null) || (r == false))
r = operaLoadFile(fileUrl);[/color]
return(r);
}
You'll need to install Java, and modify/create the policy file.Thursday, 19. May 2005, 09:23:20
I've added the changes to the code and updated the policy (I think...), but I keep getting "javascript error while saving":
[Error:
name: TypeError
message: Statement on line 1430: The Object does not implement [[Construct]]
Backtrace:
Line 1430 of inline#1 script in file://localhost/.../TiddlyWiki/gtd_tiddlywiki.html
var s = java.io.PrintStream(java.io.FileOutputStream(filePath));
Line 1461 of inline#1 script in file://localhost/.../TiddlyWiki/gtd_tiddlywiki.html
r = operaSaveFile(fileUrl, content);
Line 1338 of inline#1 script in file://localhost/.../TiddlyWiki/gtd_tiddlywiki.html
backup = saveFile(backupPath, original);
Line 1747 of inline#1 script in file://localhost/...TiddlyWiki/gtd_tiddlywiki.html
saveChanges();
At unknown location
[statement source code not available]
]
Thursday, 16. June 2005, 02:51:40
Friday, 17. June 2005, 08:35:55
Monday, 22. August 2005, 11:41:41
java.security.PrivilegedActionException: java.lang.ClassNotFoundException: java.io
at java.security.AccessController.doPrivileged(Native Method)
at com.opera.PrivilegedThread.run(LiveConnectPrivilegedActions.java:285)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: java.io
at com.opera.PluginClassLoader.findClass(PluginClassLoader.java:325)
at java.lang.ClassLoader.loadClass(Unknown Source)
at com.opera.PluginClassLoader.loadClass(PluginClassLoader.java:387)
at java.lang.ClassLoader.loadClass(Unknown Source)
at com.opera.PrivilegedFindClass.run(LiveConnectPrivilegedActions.java:261)
... 3 more
Caused by: java.io.FileNotFoundException: C:\java\io.class (The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)
at com.opera.PluginClassLoader.readClassFile(PluginClassLoader.java:336)
at com.opera.PluginClassLoader.access$100(PluginClassLoader.java:35)
at com.opera.PluginClassLoader$4.run(PluginClassLoader.java:315)
at java.security.AccessController.doPrivileged(Native Method)
at com.opera.PluginClassLoader.findClass(PluginClassLoader.java:312)
... 7 more
Monday, 22. August 2005, 15:48:23
Monday, 22. August 2005, 16:44:08
It's a straight cut and paste from your code to the files themselves. I even saved the wiki at the root of my C drive so that I would make sure I had the syntax correct for policy file.
Just so you know it does save, and you can write to the HTML file. It's just takes a few seconds for it to write to file. While it is writing none of the other functionality of the wiki is responsive to clicks. Just to see if there was anything going on in the java i opened up the console to watch and those errors above popped up. Javascript errors happned as well, but those stopped once I turned off the animation.
Tuesday, 23. August 2005, 04:18:51
Friday, 7. October 2005, 22:15:30
I've taken the code posted here and replaced Jeremy's functions with this (there were a few differences) and still no luck. I also performed the change to the .java.policy
Currently when I save Opera throws the following error:
=======================================================================
localhost:
[Error:
name: TypeError
message: Statement on line 2699: The Object does not implement [[Construct]]
Backtrace:
Line 2699 of inline#2 script in file://localhost/C:/tiddlywiki.htm
var r = new java.io.BufferedReader(new java.io.FileReader(filePath));
Line 2589 of inline#2 script in file://localhost/C:/tiddlywiki.htm
r = operaLoadFile(fileUrl);
Line 2389 of inline#2 script in file://localhost/C:/tiddlywiki.htm
var original = loadFile(localPath);
Line 1086 of inline#2 script in file://localhost/C:/tiddlywiki.htm
saveChanges();
return false;
At unknown location
[statement source code not available]
]
=================================================================================
I would really love to help get Opera saving working for all TW users. Any idea on what I'm missing? I realize that kln stated he had the same error (http://my.opera.com/community/forums/findpost.pl?id=935167) and it went away when he restarted Opera. Sadly it is still here for me.
-Clint
Saturday, 15. October 2005, 07:45:33
[color=red]function operaUrlToFilename(url)
{
var i = url.indexOf(':');
if (i > 0) url = url.substring(i - 1);
return url;
}[/color]
function operaSaveFile(filePath, content)
{
try
{
var s = new java.io.PrintStream(new java.io.FileOutputStream([color=red]operaUrlToFilename([/color]filePath[color=red])[/color]));
s.print(content);
s.close();
}
catch(e)
{
if(opera)
opera.postError(e);
return null;
}
return true;
}
function operaLoadFile(filePath)
{
var content = [];
try
{
var r = new java.io.BufferedReader(new java.io.FileReader([color=red]operaUrlToFilename([/color]filePath[color=red])[/color]));
var line;
while ((line = r.readLine()) != null)
content.push([color=red]new String([/color]line[color=red])[/color]);
r.close();
}
catch(e)
{
if(opera)
opera.postError(e);
return null;
}
return content.join("\n");
}New .java.policy file, which requires you place your Tiddlywiki into its own folder:grant codeBase "file:/c:/tiddlywiki-folder/tiddlywiki.html" {
permission java.io.FilePermission "c:\\tiddlywiki-folder\\*", "read,write";
};Edit: it's possible that Jeremy may make some small alterations to this for his final version.Monday, 17. October 2005, 14:21:31
I noticed that it took Opera about 58 seconds to save an almost empty TW file. Does it take this long for your version of Opera? (I'm using Opera 8.5 on Windows XP SP2, Java Version 1.5.0_04) Are there any tweaks I can make to improve the saving speed?
-Clint
Tuesday, 18. October 2005, 15:27:24
Yes, saving takes an age. I've been meaning to look into that. I suspect it's the line-by-line loading rather than the actual saving that's the problem. BTW, an "empty" TiddlyWiki is 124KB and has over 4500 lines!
Thursday, 23. March 2006, 17:32:16
The 770 weighs 8 oz and has an 800-pixel wide screen, which means I carry it around all the time in my hip bag and it's perfect for viewing a full web page.
So I'd like to use TiddlyWiki (or rather GTDTiddlyWiki) to take notes and keep reminders for myself, using Opera as the access program and keeping my gtd-wiki.html page on the 770's memory card. I really like TW's micro-content approach and the wiki method of linking notes (aka pages or, here, tiddlies). Much more natural than note-taking programs I've tried. Plus it's platform agnostic.
The Java workaround that permits Opera to save an html file locally doesn't work for me -- the 770 doesn't include Java.
I have, however, installed Python. And Ruby is available, as is Perl.
Can your fix be adapted to use one of these languages?
The combo of TiddlyWiki, Opera and the 770 could be extremely potent.
Thanks,
Roger
Monday, 31. July 2006, 03:37:02
As for access to Python, Ruby or Perl, well I don't know anything about the Nokia 770, but I'd guess they won't be usable from Opera via JavaScript.
IMO, Java on the 770 is only a matter of time...
Wednesday, 8. November 2006, 19:59:36
The version available of GTDTiddlyWiki at http://shared.snapgrid.com/index.html ( 1.0.6 Sept 3rd, 2005 )no longer have your code.
So, GTDTiddlyWiki no works anymore with Opera
Then I tried NextAction ( http://trimpath.com/project/wiki/NextAction ), a GTDTiddlyWiki-like "application".
But it also don´t works on Opera!
Try the demo at http://trimpath.com/demos/nextaction_static1/nextaction.htm
Any ideas?
TIA
Thursday, 9. November 2006, 01:09:44
GTDTiddlyWiki is a derivative project that I don't believe has ever incorporated the Opera saving code I've outlined in this thread. If you want to use GTDTiddlyWiki, you need to make the changes yourself.
Friday, 10. November 2006, 10:48:14 (edited)
nextaction.htm:
Line 673: Delete extra comma at end of line
nextaction_files/query:
Lines 451, 461, 501, 530, 544: change "theEval" to "eval"
The following are also bugs, but they don't prevent it working:
nextaction.htm:
Line 64: delete extra illegal colon ( : )
Line 99: change "text-weight" to "font-weight"
... And now that I see how they save things - it won't work in Opera because Opera doesn't save the page from the version that's been modified in memory. Opera saves the file originally downloaded that is in the cache.
Friday, 10. November 2006, 12:19:18
Tuesday, 19. June 2007, 20:59:44
It's a Widget named MyWiki.
Take a look at http://widgets.opera.com/widget/4861
Forums » Opera Community » Opera Community and other Opera services » Open the Web & Take Action
