[tw] Re: Method to hide/show bits of tiddler content. Other suggestions?

2012-07-02 Thread PMario
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

-- 
You received this message because you are subscribed to the Google Groups 
TiddlyWiki group.
To post to this group, send email to tiddlywiki@googlegroups.com.
To unsubscribe from this group, send email to 
tiddlywiki+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/tiddlywiki?hl=en.



[tw] Re: Method to hide/show bits of tiddler content. Other suggestions?

2012-07-01 Thread PMario
I guess the ideal would be some kind of local tags like:
This is public but privatethis is private and/private some things
are private if user==president only relevant for your eyes such as/
private secrets...
uuups
This type of markup doesn't provide privacy, since the server would
need to filter every tiddlers text. At the moment TW does the
rendering clientside so the TW core would filter the private stuff
while rendering. The server will send the whole text to the client. If
you have a look at the TW source code and search for private you'd
get a nice list of private stuff. IMO this is a no go, if you think
of privacy or security. It's ok if you need to deal with visibility.

While TiddlyWeb recipe system knows about different (per bag) access
types, it hasn't been implemented client side. So there is no UI to
configure it and TS isn't designed to use it (yet).



showWhenTagged also only deals with visibility but it is a macro, so
it should be useable inside a tiddler

eg:
a)
{{myWrapper{showWhenTagged test some text }}}
b)
{{myWrapper{hideWhen readOnly some text }}}

all these hide/show mptw macros remove the containing DOM element, if
they need to hide stuff. Thats why a wrapper like {{x{...}}} is
needed.
So example b) may be what you want. It will hide the text if you are
not a member of the space.  IMO it's ugly but it would work for small
junks of text.

hope this helps
-mario





-- 
You received this message because you are subscribed to the Google Groups 
TiddlyWiki group.
To post to this group, send email to tiddlywiki@googlegroups.com.
To unsubscribe from this group, send email to 
tiddlywiki+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/tiddlywiki?hl=en.



[tw] Re: Method to hide/show bits of tiddler content. Other suggestions?

2012-07-01 Thread twgrp
 This type of markup doesn't provide privacy,
 It's ok if you need to deal with visibility.

Ah, yes, invisibility would be enough. I guess security is always at
risk when it all is downloaded to the viewer, encrypted or not.

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)

 a)
 {{myWrapper{showWhenTagged test some text }}}
 b)
 {{myWrapper{hideWhen readOnly some text }}}

Interesting! Forgive my ignorance but how do I actually define this?
In StyleSheet I write something like this, yes? -

#contentWrapper
.hide {  }

Thanks!

:-)

-- 
You received this message because you are subscribed to the Google Groups 
TiddlyWiki group.
To post to this group, send email to tiddlywiki@googlegroups.com.
To unsubscribe from this group, send email to 
tiddlywiki+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/tiddlywiki?hl=en.