Empty Message Saved pop up window to autodisappear?

15 views
Skip to first unread message

tigger6333

unread,
Jan 14, 2008, 9:27:21 PM1/14/08
to TiddlyWiki
I would like the Empty Message Saved pop up window to autodisappear.
Please can someone help with what I need to do to get it to auto close
after
a set amount of time. eg. after 3 seconds.

Cheers
Tigg

Ken Girard

unread,
Jan 14, 2008, 10:44:56 PM1/14/08
to TiddlyWiki
Put the following in a tiddler (with a name like
AutoClearMessageMacro) and then tag it systemConfig and refresh your
browser.
--------------------------------------------------------------------
window.oldDisplayMessage = displayMessage;
displayMessage = function (text,linkText)
{ oldDisplayMessage(text,linkText);
setTimeout( 'clearMessage()', 3000 );
}
--------------------------------------------------------------------

3000 is 3 seconds

Ken Girard

Ken Girard

unread,
Jan 14, 2008, 10:46:43 PM1/14/08
to TiddlyWiki
I just realized that might need the InlineJavascriptPlugin
(http://www.TiddlyTools.com/#InlineJavascriptPlugin)

Ken Girard

wolfgang

unread,
Jan 14, 2008, 11:30:48 PM1/14/08
to TiddlyWiki
Hi,

the following originates from TiddlyDesktop, therefore is pretty old
code - but still does work with a systemConfig tag alone:

/***
!Bug Fixes / Core Changes
***/
/*{{{*/
//Alert errors in systemConfigs if messageArea not yet rendered
function checkDisplay(obj) {
var oldFunc = obj['displayMessage'];
obj['displayMessage'] = function(text, linkText) {
oldFunc.apply(this, arguments);

//remove the message after 6 secs
setTimeout(clearMessage,6000);
}

};

checkDisplay(this);
/*}}}*/

Regards,

W.

tigger6333

unread,
Jan 14, 2008, 11:46:14 PM1/14/08
to TiddlyWiki
Thankyou very much!
I went with the second option as it was very simple to implement with
no extra plugins needed.

thanks again.
Tigg

wolfgang

unread,
Jan 14, 2008, 11:57:12 PM1/14/08
to TiddlyWiki
> I went with the second option as it was very simple to implement with
> no extra plugins needed.

Just to be clear, every tiddler with a systemConfig tag is an extra
plugin.

And the big advantage of InlineJavascriptPlugin is that you can add
many such small functions, for which you otherwise would need a
systemConfig tagged tiddler (ie.Plugin). Additionally,
InlineJavascriptPlugin is ridiculously small and all those additional
scripts are only loaded once their need arises, differently from
plugins - which are loaded all at startup.

W.

tigger6333

unread,
Jan 16, 2008, 4:04:14 AM1/16/08
to TiddlyWiki
Thanks for that info. I learn more each day and I have now also
started using some
scripts which need the inlineJavascriptPlugin. Your reasoning about
the small memory
footprint and the "as needed" loading of the scripts is good.

Thanks all, for your help and teaching!

Cheers
Tigg
Reply all
Reply to author
Forward
0 new messages