[tw] Re: Styles that only display for file://

2010-10-09 Thread okido
Hello Robert,

I gave it a try with your testcase.
It seems not to work.
The mainmenu is visible on a local system and on the webverion.
The only thing that is different is that the local version requests
almost every click a conformation to proceed as a possible unsafe
script is going to be executed.
I use FF3.5.13 and openSuse 11.

Have a nice day, Okido



On 10月8日, 午後6:24, rakugo jdlrob...@gmail.com wrote:
 Great. Glad that helped.
 TiddlySpace uses a similar thing on the frontpage to hide controls for
 non-members/non-logged in users.

 Obviously if you disable styles in your browser the content reappears
 but it is a good trick for hiding content for every day 
 users.http://frontpage.tiddlyspace.com/#AuthenticationCssPlugin

 Jon

 On 8 Oct, 15:53, Robert Pollard ecology2...@gmail.com wrote:

  Jon

  Thanks. That was simple, and does just what I need. I've updated the page 
  athttp://www.digital-bridges.net/themes.htm

  Robert

  On Fri, Oct 8, 2010 at 3:22 AM, rakugo jdlrob...@gmail.com wrote:
   Rather than create a new theme just for this why not do

   if(window.location.protocol ==file:) {
    jQuery(body).addClass(fileMode);
   } else {
   jQuery(body).addClass(onlineMode);
   }

   Now in your theme you can put specific rules for each theme.
   e.g.
   .onlineMode #sideBarTabs {
    display: none;
   }
   will hide the SideBarTabs for online users.
   This would be much more flexible and easier than maintaining 2 themes.

   Jon

-- 
You received this message because you are subscribed to the Google Groups 
TiddlyWiki group.
To post to this group, send email to tiddlyw...@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: Styles that only display for file://

2010-10-08 Thread Tobias Beer
@Jon

That sounds like a really good idea!

To be compatible with older versions of TiddlyWiki it would simply
read...

addClass(
document.body,
window.location.protocol=='file:'?'fileMode':'onlineMode'
);

Or are these helper functions going to be deprecated in a foreseeable
future?

Cheers, Tobias.

-- 
You received this message because you are subscribed to the Google Groups 
TiddlyWiki group.
To post to this group, send email to tiddlyw...@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.



Re: [tw] Re: Styles that only display for file://

2010-10-08 Thread Robert Pollard
Jon

Thanks. That was simple, and does just what I need. I've updated the page at
http://www.digital-bridges.net/themes.htm

Robert


On Fri, Oct 8, 2010 at 3:22 AM, rakugo jdlrob...@gmail.com wrote:

 Rather than create a new theme just for this why not do

 if(window.location.protocol ==file:) {
  jQuery(body).addClass(fileMode);
 } else {
 jQuery(body).addClass(onlineMode);
 }

 Now in your theme you can put specific rules for each theme.
 e.g.
 .onlineMode #sideBarTabs {
  display: none;
 }
 will hide the SideBarTabs for online users.
 This would be much more flexible and easier than maintaining 2 themes.

 Jon



-- 
You received this message because you are subscribed to the Google Groups 
TiddlyWiki group.
To post to this group, send email to tiddlyw...@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: Styles that only display for file://

2010-10-08 Thread rakugo
Great. Glad that helped.
TiddlySpace uses a similar thing on the frontpage to hide controls for
non-members/non-logged in users.

Obviously if you disable styles in your browser the content reappears
but it is a good trick for hiding content for every day users.
http://frontpage.tiddlyspace.com/#AuthenticationCssPlugin

Jon

On 8 Oct, 15:53, Robert Pollard ecology2...@gmail.com wrote:
 Jon

 Thanks. That was simple, and does just what I need. I've updated the page 
 athttp://www.digital-bridges.net/themes.htm

 Robert



 On Fri, Oct 8, 2010 at 3:22 AM, rakugo jdlrob...@gmail.com wrote:
  Rather than create a new theme just for this why not do

  if(window.location.protocol ==file:) {
   jQuery(body).addClass(fileMode);
  } else {
  jQuery(body).addClass(onlineMode);
  }

  Now in your theme you can put specific rules for each theme.
  e.g.
  .onlineMode #sideBarTabs {
   display: none;
  }
  will hide the SideBarTabs for online users.
  This would be much more flexible and easier than maintaining 2 themes.

  Jon

-- 
You received this message because you are subscribed to the Google Groups 
TiddlyWiki group.
To post to this group, send email to tiddlyw...@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: Styles that only display for file://

2010-10-07 Thread Tobias Beer
Don't want to be nitpicking but shouldn't that read

if(window.location.protocol!=file:)
  config.options.txtTheme = OnlineTheme;

?

...since I would think that the OnlineTheme is the one that is show
over 'http:' rather than 'file:'.

You could also use that logic to set any variable you like...

window.viewedOverHttp=window.location.protocol!=file:;

And then use HideWhenPlugin [1] to trigger different templates or
template elements.

div macro=hideWhen window.viewedOverHttpmy private stuff/div

Cheers, Tobias.

[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 tiddlyw...@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.



Re: [tw] Re: Styles that only display for file://

2010-10-07 Thread Robert Pollard
On Thu, Oct 7, 2010 at 7:35 PM, colmjude colmj...@gmail.com wrote:



 On Oct 7, 11:58 pm, Robert Pollard ecology2...@gmail.com wrote:
  Colm
 
  Thanks for your prompt response.

 No probs.

 I should say that the code I gave should read
 == http:
 not
 == file:
 to apply the OnlineTheme when the protocol is http


Yes, I had seen that slip (^_^)


  , however it doesn't load the styles for OnlineTheme that I have created
  following the format of the SampleTheme athttp://
 tiddlywiki.org/wiki/Themes
  Is there something I am missing?
 

 Is there anyway you could share the TW in question? Is it online
 somewhere?
 Or could you at least share the OnlineTheme and plugin you made so
 that I could have a look? I might be able to spot something that way.


http://www.digital-bridges.net/themes.htm


  Colm


Robert

-- 
You received this message because you are subscribed to the Google Groups 
TiddlyWiki group.
To post to this group, send email to tiddlyw...@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.