On 2 Jul., 03:39, twgrp <
matiasg...@gmail.com> wrote:
> If (when?) they make it possible to import individual tiddlers from
> other tiddlyspaces then I imagine it should be straight forward
> though. ("If password correct, then import tiddler x")
There have been discussions about this in TWdev group or TiddlyWeb
group but have no links at hand :)
> > {{myWrapper{<<hideWhen readOnly>> some text }}}
>
> Interesting! Forgive my ignorance but how do I actually define this?
> In StyleSheet I write something like this, yes? -
short version:
==========
just copy paste this
{{x{<<hideWhen readOnly>> some text }}}
into a tiddler.
make the tiddler public.
log out.
at my space "some text" it is hidden then.
geeky version:
==========
if you have a look at hideWhen plugin [1]
you'll see:
b)
window.removeElementWhen = function(test,place) {
window.hideWhenLastTest = test;
c)
if (test) {
jQuery(place).empty()
place.parentNode.removeChild(place);
}
};
merge(config.macros,{
hideWhen: { handler:
function(place,macroName,params,wikifier,paramString,tiddler) {
a)
removeElementWhen( eval(paramString), place );
}},
===
a) hideWhen: {handler: ...} calls removeElementWhen()
b) removeElementWhen is defined globally and asks for the test
variable and the place variable
c) if test it true the containing element (place) will be removed.
===
if the following line is rendered by TW
{{x{<<hideWhen readOnly>> some text }}}
it produces the "place" if readOnly is false
place-> <span class="x"> some text</span>
it readOnly is true it removes the "place" in the browsers DOM. So it
is not hidden with CSS, it is removed.
-m
[1]
http://mptw.tiddlyspot.com/#HideWhenPlugin