I'm sure this has probably been done before, but I've only just
recently found TiddlyWiki and couldn't find a quick/easy answer to my
problem.
I wanted a TW with no server-side scripts or database, and share it on
a network drive but allow multi-user access with edit-locking.
So I made TiddlyLock.
TiddlyLock uses the small lock-file method of preventing updates by
other users. The lock file is created/updated when a user edits a
tiddler, and it's cleared when they save (or autosave). I the TW is
locked then the other user can still view the contents - they just
have to wait until it's unlocked.
And it seems to work quite nicely so far! ;)
I did it to satisfy a specific need - a small group of developers,
adding hints and tips to a common scrapbook as they discover them - so
it's not high usage and it doesn't require strong security (we're a
trusting bunch). Users are identified by a user/password combination,
but the password is not encrypted or obfuscated in any way. I'm sure
it wouldn't be too hard to do though, I just don't need to right now.
So, take a look at TiddlyLock and let me know what you think!
I have posted it at http://www.minormania.com/tiddlylock/tiddlylock.html
Cheers
Richard
It seems there is a problem: only part of the "raw" code appears in
the browser?
I am using Firefox
Cheers,
JCG
Cheers
Richard
On Apr 29, 2:49 am, "Simon Baird" <simon.ba...@gmail.com> wrote:
> The url doesn't work for me either.
>
> On 4/29/07, weta <rhob...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Hi
>
> > I'm sure this has probably been done before, but I've only just
> > recently found TiddlyWiki and couldn't find a quick/easy answer to my
> > problem.
>
> > I wanted a TW with no server-side scripts or database, and share it on
> > a network drive but allow multi-user access with edit-locking.
>
> > So I made TiddlyLock.
> > TiddlyLock uses the small lock-file method of preventing updates by
> > other users. The lock file is created/updated when a user edits a
> > tiddler, and it's cleared when they save (or autosave). I the TW is
> > locked then the other user can still view the contents - they just
> > have to wait until it's unlocked.
>
> > And it seems to work quite nicely so far! ;)
>
> > I did it to satisfy a specific need - a small group of developers,
> > adding hints and tips to a common scrapbook as they discover them - so
> > it's not high usage and it doesn't require strong security (we're a
> > trusting bunch). Users are identified by a user/password combination,
> > but the password is not encrypted or obfuscated in any way. I'm sure
> > it wouldn't be too hard to do though, I just don't need to right now.
>
> > So, take a look at TiddlyLock and let me know what you think!
> > I have posted it athttp://www.minormania.com/tiddlylock/tiddlylock.html
>
> > Cheers
> > Richard
>
> --
> Simon Baird <simon.ba...@gmail.com>- Hide quoted text -
>
> - Show quoted text -
-- all TiddlyLock objects are prefixed with "TL"
I must have added that comment after I last tested it with Firefox -
IE6 is (unfortunately) the corporate standard so I end up doing most
work in it. It looks like IE6 is ignoring the "--" at the start of the
line whilst Firefox appears to think it marks the end of the comment
section. I've removed the two dashes, re-uploaded and tested it in
Firefox and IE6. It's all good.
You might have to Shift-clik on the link to force a cache refresh and
load the new version
Cheers
Richard
On Apr 30, 12:57 pm, "Simon Baird" <simon.ba...@gmail.com> wrote:
> It's weird. See attached. I did a view source in FF1.5 and it looks correct.
> I wonder if the -- in the following is causing FF to bork. The syntax
> highlighting seems to imply this. I'm going to upgrade to FF2.0 now anyway.
>
> -- all TiddlyLock objects are prefixed with "TL"
>
> Simon Baird <simon.ba...@gmail.com>
>
> tl.GIF
> 72KViewDownload- Hide quoted text -
Cheers
Richard
> > > - Show quoted text -- Hide quoted text -
I've converted my changes into a plugin and it can now be imported
into your own TiddlyWiki with ImportTiddlers.
Use the following link as the source http://www.minormania.com/tiddlylock/tiddlylock.html
TiddlyLockPlugin is completely self-contained, adding a Password
option to the OptionsPanel. Simply enter a password and locking and
unlocking is done automatically as required.
If another user has locked the TiddlyWiki for editing, you will be
notified of the name of the user. Once they have finished theire
edits, simply reload the TiddlyWiki to see the changes they have made
and enable edits again.
Please let me know if you find any issues with it!
Cheers
Richard
Yes, TiddlyLock can help, but not 100%. The problem is that the
options for username and password are stored in cookies so if you have
two IE browser windows open on the same TiddlyWiki then the locking
won't work. If the TiddlyWiki is open in two different browsers, or
browsers that store cookies in their own sessions, then TiddlyLock
will work fine.
Cheers
Richard
On May 1, 11:18 pm, "Simon Baird" <simon.ba...@gmail.com> wrote:
> Sometimes I accidentally have the same TW open in two browser tabs or
> windows. Can TiddlyLock help prevent me from overwriting my file in that
> case? If not then it would be worth considering that case also.
>
> On 5/1/07, weta <rhob...@gmail.com> wrote:
>
>
>
>
>
> > Wow, that was easy :D
>
> > I've converted my changes into a plugin and it can now be imported
> > into your own TiddlyWiki with ImportTiddlers.
> > Use the following link as the source
> >http://www.minormania.com/tiddlylock/tiddlylock.html
>
> > TiddlyLockPlugin is completely self-contained, adding a Password
> > option to the OptionsPanel. Simply enter a password and locking and
> > unlocking is done automatically as required.
>
> > If another user has locked the TiddlyWiki for editing, you will be
> > notified of the name of the user. Once they have finished theire
> > edits, simply reload the TiddlyWiki to see the changes they have made
> > and enable edits again.
>
> > Please let me know if you find any issues with it!
>
> > Cheers
> > Richard
>
> --
> Simon Baird <simon.ba...@gmail.com>
great plugin, and something that quite a few people have asked for in the past.
I have some suggested improvements to the way you override functions:
instead of copying the body of the old function into the new function
you can, at runtime, create a copy of the old function and then call
it using the apply keyword. This has two advantages:
i) your code is more compact
ii) your code is more future-proof: it automatically reflects any
changes in the overridden functions
I'm particularly interested in (ii), since 2.2 is coming out soon, and
has made some changes in some of the areas you have overridden. A
couple of examples will clarify my meaning:
TiddlyLock = {}; // TiddlyLock 'namespace'
//...
//
// OVERRIDE cancelTiddler()
//
TiddlyLock.cancelTiddler = cancelTiddler;
config.commands.cancelTiddler.handler = function(event,src,title)
{
var ret = TiddlyLock.cancelTiddler.apply(this,arguments);
TLUnlock();
return ret;
};
//
// OVERRIDE saveChanges()
//
TiddlyLock.saveChanges = saveChanges;
saveChanges = function(onlyIfDirty)
{
TLUnlock();
TiddlyLock.saveChanges.apply(this,arguments);
};
The above pattern can be applied to all your function overrides. (Note
the above code is untested.)
Martin
In the meantime I have discovered a timing issue that needs to be
fixed - If two users load the TiddlyWiki at the same time and then
one edits it and saves all changes, then the other user edits it, the
second user will not be told of the changes and the TiddlyWiki will
not be locked. This means that changes by the first user will be lost
if the second user edits the same tiddler. I'm looking at fixing this
now and will post a new version soon.
Until then, please take a look at version 1.0.1 which is available
from the same link as before.
Cheers!
Richard
Thanks Richard, and to the rest of you guys as well!
cheers,
Charlie
Not only does it do away with the need for a 'password' to help
identify users but it also fixes the problem identified by Simon Baird
where multiple tabs/windows of the same browser could edit the same
TiddlyWiki at the same time.
So, I think TiddlyLock is ready for some serious use at last !8^D
I have tested it using both Firefox 2.0 and IE6 at the same time with
multiple windows and tabs all accessing the same TiddlyWiki - and the
locking mechanism works a treat.
Try it for yourself - import the TiddlyLockPlugn from here:-
http://www.minormania.com/tiddlylock/tiddlylock.html
Cheers
Richard Hobbis
Seems to work great - thanks a lot for this!!
(IMHO, it should be considered to include this in the core code, simply
to prevent the multiple tabs/windows issue.)
-- F.
I did notice, however, that whenever I turn on AutoSave that people
get locked out, even if the same person is using it. It does that
SavesChanges notice but it doesn't say it's unlocked. Is that because
I have too many plugins or does the lock not work with AutoSave?
On May 10, 7:59 am, weta <rhob...@gmail.com> wrote:
> I have now implemented a timestamp locking mechanism which makesTiddlyLockMUCH BETTER!
>
> Not only does it do away with the need for a 'password' to help
> identify users but it also fixes the problem identified by Simon Baird
> where multiple tabs/windows of the same browser could edit the same
> TiddlyWiki at the same time.
>
> So, I thinkTiddlyLockis ready for some serious use at last !8^D
>
> I have tested it using both Firefox 2.0 and IE6 at the same time with
> multiple windows and tabs all accessing the same TiddlyWiki - and the
> locking mechanism works a treat.
>
> Try it for yourself - import the TiddlyLockPlugn from here:-http://www.minormania.com/tiddlylock/tiddlylock.html
Was this fixed in 1.0.2? I'm still getting the hang of the code, but
I thought I saw a 'reload' in there somewhere. It didn't appear to
work when I installed it, but then I have a gazillion plugins so I
don't know if it's my TW.
Pleased to hear it :D
> I did notice, however, that whenever I turn on AutoSave that people
> get locked out, even if the same person is using it. It does that
> SavesChanges notice but it doesn't say it's unlocked. Is that because
> I have too many plugins or does the lock not work with AutoSave?
I have noticed a lock-out problem on occasion too although I haven't
tracked down exactly what's happening. I THINK a condition is
occurring where the TW is being closed before the lock file is updated
to remove the Locked By name. I'll take a closer look soon. In the
meantime the workaround is to simply delete the lock file manually.
Cheers
Richard
Yes this issue was fixed in 1.0.2 when I implemented timestamp/name
locking instead of using name/password.
I'm not sure what you're referring to by reload but if the TW is open
in two browsers and one person edits & saves it then the other tries
to edit it, the second user will get a message saying they have to
reload the TW before editing.
If any of your plugins add extra functions that bypass or also modify
the standard functions (such as a save&close toolbar button) then
there may be problems. TiddlyLock was coded without any other 'extra
functionality' type plugins installed so I can't guarantee that it'll
play nicely with everything. Please let me know if you find a specific
plugin that conflicts with TiddlyLock and I'll try to make it play
nice.
Cheers
Richard
K.
On Jun 19, 2:27 pm, weta <rhob...@gmail.com> wrote:
> On Jun 12, 9:07 pm, jyorraku <jyorr...@gmail.com> wrote:
>
> > > In the meantime I have discovered a timing issue that needs to be
> > > fixed - If two users load the TiddlyWiki at the same time and then
> > > one edits it and saves all changes, then the other user edits it, the
> > > second user will not be told of the changes and the TiddlyWiki will
> > > not be locked. This means that changes by the first user will be lost
> > > if the second user edits the same tiddler. I'm looking at fixing this
> > > now and will post a new version soon.
>
> > Was this fixed in 1.0.2? I'm still getting the hang of the code, but
> > I thought I saw a 'reload' in there somewhere. It didn't appear to
> > work when I installed it, but then I have a gazillion plugins so I
> > don't know if it's my TW.
>
> Yes this issue was fixed in 1.0.2 when I implemented timestamp/name
> locking instead of using name/password.
>
> I'm not sure what you're referring to by reload but if the TW is open
> in two browsers and one person edits & saves it then the other tries
> to edit it, the second user will get a message saying they have to
> reload the TW before editing.
>
> If any of your plugins add extra functions that bypass or also modify
> the standard functions (such as a save&close toolbar button) then
> there may be problems.TiddlyLockwas coded without any other 'extra
> functionality' type plugins installed so I can't guarantee that it'll
> play nicely with everything. Please let me know if you find a specific
> plugin that conflicts withTiddlyLockand I'll try to make it play
> nice.
>
> Cheers
> Richard
I have just updated TiddlyLock to version 1.0.3
This fixes a locking problem that occured when a user navigated away
from the TW or closed the browser whilst changes were outstanding.
This was keeping the TW locked, which is I think the cause of the
problem reported by jyorraku above.
Download the whole TW or import TiddlyLockPlugin from the usual
location, i.e.
http://www.minormania.com/tiddlylock/tiddlylock.html
NOTE: This file now uses the latest version (2.2.4) of the TW core
code
Cheers :D
Richard
Sorry, my website has been offline for a few days (the DNS settings
got screwed up) and the file was unavailable.
It's fixed now and I've updated TiddlyLock to version 1.0.4 and it is
now compatible with the MPTW double functions of Done/Close and Cancel/
Close.
Please let me know if you find any issues!
Cheers
Richard