TWS - a basic TiddlyWiki Server for node.js

1,129 views
Skip to first unread message

Poul

unread,
Dec 31, 2011, 11:30:55 AM12/31/11
to TiddlyWiki
I have never been a fan of how TiddlyWiki works when it comes to
saving your work. It's becoming increasingly obvious that, for reasons
of security, the browser designers don't like it either. So, I've
created a basic TiddlyWiki server with an associated plugin, that
serves as an alternative to using TiddlyWiki's built-in methods for
saving your content. It writes portable TiddlyWiki files just like
TW's own code.

http://giewiki.appspot.com/Tutorials/nodepad
https://github.com/PoulStaugaard/TWS

Happy New Year
:-) Poul



PMario

unread,
Jan 1, 2012, 11:20:09 AM1/1/12
to TiddlyWiki
Hi Poul,
I think you should follow:
https://github.com/Jermolene/cook.js

Happy New Year
-m

FrD

unread,
Jan 2, 2012, 4:36:51 AM1/2/12
to tiddl...@googlegroups.com
Hi Poul,

Very interesting work !

I'm on ubuntu and firefox 8.0.

I've got a little problem with character encoding it seems :
When I save and then reload the page, some characters are replaced by strange ones.
So the "é" becomes "é".

Any idea to fix it ?

Thanks in advance

FrD

Bauwe Bijl

unread,
Jan 2, 2012, 7:51:39 AM1/2/12
to TiddlyWiki
Hi Poul

Great!
...Chrome,linux and tw...\o/
To make Chrome start on ubuntu I added (in browser.js):
"'/usr/bin/google-chrome'";

Bauwe

passingby

unread,
Jan 2, 2012, 10:48:58 AM1/2/12
to tiddl...@googlegroups.com
Hi Poul,
I tried and failed to run the application. I am on windows 7. The error message is:

Failed to start "C:\Users\sony/Local Settings/Application Data/Google/Chrome/Application/chrome.exe" --homepage "http://localhost:1337/"
{[Error:Command failed: The system cannot find the path specified.] killed:false, code:1, signal: null }

I searched and found chrome.exe's path on my system is: C:\Program Files (x86)\Google\Chrome\Application

So how do I fix this?

Poul

unread,
Jan 2, 2012, 6:01:30 PM1/2/12
to TiddlyWiki
OK - now github has a version that fixes this for Win7/x64 and ubuntu.

:-) Poul

passingby

unread,
Jan 3, 2012, 12:11:56 PM1/3/12
to tiddl...@googlegroups.com
Hello again Poul,
Thanks for the fix but my chrome still did not run. I think its because when I installed Google chrome I installed it for 'all users'. I think if one does that it installs chrome on the path :
C:\Program Files (x86)\Google\Chrome\Application
So in my case browser.js looks for user profile and assumes that since USERPROFILE exists chrome.exe must be on the path:
/Local Settings/Application Data/Google/Chrome/Application/chrome.exe

To fix this I just chucked out the whole if clause and just put in this line in browser.js:
exports.command= '"C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe" --homepage'

and it worked! Thanks for the neat app!
If a similar generic server can be created for all browsers it would be great!

-passingby

PS- for those on windows 7 and wish to open a command terminal inside a particular folder please read this
http://www.sevenforums.com/tutorials/27778-open-command-window-here.html



passingby

unread,
Jan 3, 2012, 12:36:22 PM1/3/12
to tiddl...@googlegroups.com
Another feedback. When I save manually it goes smoothly. But when I select the autosave option and make a change and close the tiddler's edit mode, the message given is:
"The Page at localhost:1337 says:
You need to save this Tiddlywiki to a file before you can save changes"

Måns

unread,
Oct 21, 2012, 5:00:47 AM10/21/12
to tiddl...@googlegroups.com


I've got a little problem with character encoding it seems :
When I save and then reload the page, some characters are replaced by strange ones.
So the "é" becomes "é".

Any idea to fix it ?


+1
??
Cheers Måns Mårtensson

Poul

unread,
Oct 21, 2012, 4:50:49 PM10/21/12
to tiddl...@googlegroups.com
I seem to recall this being a FireFox specific issue, but I didn't get to the bottom of it. Try using Chrome.

:-) Poul

FrD

unread,
Oct 27, 2012, 4:22:16 AM10/27/12
to tiddl...@googlegroups.com
Hi Poul,

I'm using version : PoulStaugaard-TWS-57eab16.
When working with a TW inside the folder that contains your js files, everything is fine and I appreciate this tool very much.
But I've tried to call tws on a TW located in another folder.
It opens well, but I've got a problem when I hit "save changes". This is the alert message I get :

Error: NETWORK_ERR: XMLHttpRequest Exception 101

And saving doesn't work.
I'd really like to use tws on a regular basis since I encounter some problems with Firefox (backups are corrupted) and sometimes the Icetea plugin (a kind of java plugin in ubuntu) crashes with Chrome.

FrD

FrD

unread,
Oct 27, 2012, 4:37:39 AM10/27/12
to tiddl...@googlegroups.com
Hi,

Me again.
I was not using tws the way I should have.
I was calling tws on the file name and it doesn't work that way.
When I call tws on the folder that contains the file and then choose the file on the displayed page, it works well and saving too.

FrD


On Saturday, October 27, 2012 10:22:16 AM UTC+2, FrD wrote:
Hi Poul,

I

Måns

unread,
Oct 28, 2012, 8:16:34 AM10/28/12
to TiddlyWiki
Hi Poul

> I seem to recall this being a FireFox specific issue, but I didn't get to
> the bottom of it. Try using Chrome.

You were right..

I use Chrome now.

Cheers Måns Mårtensson

FrD

unread,
Oct 28, 2012, 9:59:48 AM10/28/12
to tiddl...@googlegroups.com
Hi Poul,

I'm using TWS with a tiddlywiki that shows some videos in webm format so that both Chrome and Firefox can display them without the help of a plugin.

Her is the typical content of a video tiddler :
<html>
</br>
<video width="480" height="384" poster="./image.png" controls="controls"> 
   <source  src="./video.webm" />
</video>
</html>

The image (image.png) is displayed but I can't play the vidéo.
It works when the TW is directly loaded in Chrome or Firefox.

Any Idea of what causes this problem ?

Thanks


FrD

On Saturday, December 31, 2011 5:30:55 PM UTC+1, Poul wrote:

FrD

unread,
Oct 28, 2012, 3:06:15 PM10/28/12
to tiddl...@googlegroups.com
Hi,

I found a way to have it work :

I added webm type handling in files.js :

var filetypes = {
    find: function(ft)
    {
        var dflt = { value: 'text/html', encoding: 'utf8' };

        if (ft) switch (ft.toLowerCase())
        {
        case 'ico':
            return  { value: 'image/icon', encoding: false };
        case 'webm':
            return  { value: 'video/webm', encoding: false };
      ...

FrD
Reply all
Reply to author
Forward
0 new messages