Re: [tw] Re: Run jQuery code at startup

2010-01-18 Thread Michael Mahemoff
On Sat, Jan 16, 2010 at 6:18 PM, shavinder wrote:

> > The plugin is eval()'d by TiddlyWiki core after .header (and the page)
> has
> > loaded, so the body of jQuery(.header') never runs. You can just
> eliminate
> > it in your plugin and do:
> >
> > jQuery('.header').click(function(){
> >  alert('hello');
> >
> > });
> That did not work either. I then revisited classrecords.tiddlyspot.com
> and found that its easy to callup code from [[PageTemplate]]. I put
> this at the very bottom of my PageTemplate:
> 
>

Yes, I think my version above doesn't work because TiddlyWiki is re-applying
the page template some time after evaluating plugins. A nice workaround in
this context is jQuery's live functionality (
http://docs.jquery.com/Events/live). I've tested the following and it works:

jQuery('.header').live("click", function() {
  alert('hello');
});
-- 

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] Run jQuery code at startup

2010-01-15 Thread Michael Mahemoff
On Fri, Jan 15, 2010 at 5:58 PM, shavinder wrote:

> It looked it should work but it didnt:
> I have a tiddler [[zzz-myScript]] which is tagged with systemConfig
> and contains this:
>
> jQuery('.header').ready(function(){
>  jQuery('.header').click(function(){
>   alert('hello');
>  });
> });
>
> This code works when run from firebug console, but not via
> systemConfig tagged tiddler above.
> Why?
>
>
The plugin is eval()'d by TiddlyWiki core after .header (and the page) has
loaded, so the body of jQuery(.header') never runs. You can just eliminate
it in your plugin and do:

jQuery('.header').click(function(){
 alert('hello');
});
-- 

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] plugins to flip between publishing and editing mode

2009-11-17 Thread Michael Mahemoff
Hello,

I'm interested in plugins that flip between publishing and editing
mode. I'm aware there are a few things, like Saq's (PublisherPlugin
which I think is incomplete?) and Jeremy's plugin to move Tiddlers
list to Backstage. Is there anything else?

I'm ideally looking for a single plugin I can drop in, which will
perhaps keep the main menu and story, while moving the entire sidebar
to Backstage. Or perhaps a toggle beside Backstage to show and hide
the sidebar (with suitable alterations to the CSS layout).

None of this is too difficult to implement, but thought I'd check for
prior art before proceeding myself.

Thanks.

--

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=.




[tw] Re: plugin to edit/manage custom fields

2009-11-10 Thread Michael Mahemoff

Thanks FND.

On Tue, Nov 10, 2009 at 9:05 AM, FND  wrote:
>
>> Is there a plugin to support editing of tiddlywiki fields, and perhaps
>> creation/delete of fields?
>
> http://plugins.tiddlywiki.org/plugins/search/?query=fields
> http://visualtw.ouvaton.org/VisualTW.html#FieldsEditorPlugin
>
> HTH.
>
>
> -- F.
>
> >
>

--~--~-~--~~~---~--~~
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] plugin to edit/manage custom fields

2009-11-09 Thread Michael Mahemoff

Hello,

Is there a plugin to support editing of tiddlywiki fields, and perhaps
creation/delete of fields?

I'm aware there are various macros to allow fields to be edited (e.g.
"edit"), but I'm looking for a more general plugin that would change
the default templates to support generic editing. The application I'm
working on involves user-created Javascript and CSS, where it would be
messy to ask users to create slices or sections inside comments, so
fields are the most reasonable design strategy I can think of.

--~--~-~--~~~---~--~~
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] TiddlyWiki on the Command-Line

2009-10-27 Thread Michael Mahemoff

Ben's tiddle  project
(http://groups.google.com/group/tiddlywiki/browse_thread/thread/a129af93778dceee)
has got me thinking about whether there are any command-line
Unix-style tools to read and manipulate tiddlers?

Closest I've seen is tiddlywiki_cp http://tiddlywikicp.dachary.org/,
but I was thinking about something a bit different. A bit more like
todo.sh (http://todotxt.com/library/todo.sh/ ; thanks for the pointer
FND), where I could easily output a tiddler to stdout, or add a new
tiddler with a single command indicating its content.

--~--~-~--~~~---~--~~
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: Tracking time spent viewing tiddlers

2009-10-27 Thread Michael Mahemoff

On Tue, Oct 27, 2009 at 11:11 AM, dickon
 wrote:
>
> I really like this idea, and it is similar to something I asked about,
> but more sophisticated as it tracks actual time spent with the
> tiddlers open.  Would I be right that implicit within this
> functionality would be a kind of "hit-counter" for each tiddler that
> is opened?  I am interested in that as an additional function in my
> treatment manual (http://imp.peermore.com/imp/recipes/imp/
> tiddlers.wiki) so as to track which bits a worker is visiting, and
> which s/he is avoiding...

I should clarify that the plugin here just shows the information back
to the viewer, for their own purposes, rather than aggregating views
and providing server analytics.

It could be extended to do that. I could imagine a write-only (unless
you have admin permissions) tiddlyweb "views" bag that would contain a
tiddler for each time the user viewed something. It would grow big
quickly and therefore require something like the SQL store in most
cases. And it would need an analytics viewing tool too.

--~--~-~--~~~---~--~~
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: Tracking time spent viewing tiddlers

2009-10-26 Thread Michael Mahemoff

On Mon, Oct 26, 2009 at 2:53 PM, shavinder  wrote:
>
> @Mahemoff The link you just posted is blocked by my FF preferences
> with Google reporting it as a "Reported Attack Site!".
>
> Please look into this.
>
> Here is the details of what google says about this:

Yes, this came up this morning - my site was hacked among with
numerous other dreamhost sites in the past couple of months :(. I've
taken measures, but it will take a while for the message to clear.

You can click through anyway, or you can also find the code in my SVN area.
http://svn.tiddlywiki.org/Trunk/contributors/MichaelMahemoff/plugins/ViewingTimesPlugin/

--~--~-~--~~~---~--~~
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: Tracking time spent viewing tiddlers

2009-10-25 Thread Michael Mahemoff

On Fri, Oct 23, 2009 at 4:25 PM, Craig in Calgary
 wrote:
>
> For my TiddlyWiki Tutorial (http://groups.google.com/group/tiddlywiki/
> t/2cdca3a12bfdc630?hl=en) I will have "sets" of tiddlers, each "set"
> behaving like a slideshow. Is it possible for the TiddlyWiki to track
> the time spent from when the first tiddler in a "set" is opened for
> viewing until the last tiddler in the set is closed? I would store
> these durations with the hope of generating a report showing what
> "sets" have been viewed, how long was spent viewing each "set", and
> total time spent viewing all sets.
>

I found this an interesting idea, I had some ideas on implementing it
and decided to try it:

http://tiddlywiki.mahemoff.com/ViewingTimesPlugin.html

The plugin takes periodic samples (once a second) to see what the user
is viewing. It looks at the first element in the story, which will
work fine for a slideshow-type tiddlywiki or one using SinglePageMode,
though mightn't be ideal for other situations. You could also replace
the sampling technique by one which hijacks display events.

It doesn't address all of your concerns, but hopefully gives you some
ideas on how one might implement this.

--~--~-~--~~~---~--~~
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: JavaScript common to multiple tiddlers

2009-10-16 Thread Michael Mahemoff

On Thu, Oct 15, 2009 at 8:54 PM, FND  wrote:
>
>> why is it good practice for plugins to check if they've already been
>> loaded? (if version.extensions.) { } at the top of most plugins)
>
> Cargo-culting.
> This doesn't actually solve any useful purpose AFAICT. I'm not sure
> where it originates, but I don't include those bits in my plugins
> anymore (though I haven't gotten around to removing it from all existing
> plugins yet).
>

Funny as I do it all the time, and I don't think I'm the only one.

Does this mean I shouldn't be using "version.extensions." at all?

Thanks Eric for going through the scenarios. The probability is so low
that a plugins would appear twice, and exponentially lower that it
would actually have any more effect than the performance overhead of
loading twice, that it does seem unnecessary.

--~--~-~--~~~---~--~~
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: JavaScript common to multiple tiddlers

2009-10-15 Thread Michael Mahemoff

This raises a related question for me - why is it good practice for
plugins to check if they've already been loaded? (if
version.extensions.) { } at the top of most plugins). I've never
seen one plugin include the entire source of another plugin, so why is
there a risk a plugin will be loaded twice?

--~--~-~--~~~---~--~~
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: filter and sort in DefaultTiddlers

2009-10-10 Thread Michael Mahemoff

On Sat, Oct 10, 2009 at 12:42 PM, FND  wrote:
>
>> Is there a way I can filter *and* sort in DefaultTiddlers? I would
>> like to do something like"[tag[report]] [sort[+title]]"?
>
> That should work - take a look here:
> http://trac.tiddlywiki.org/browser/Trunk/verticals/tiddlywiki.com/shadows/DefaultTiddlers.tiddler
>
>     HelloThere NewFeatures [tag[blog]] [sort[created]]

Thanks Fred. I realised what it was - I was assuming it might do a
natural sort. So "10 October" appears before "9 October". (I was
assuming I had the wrong syntax anyway, as it was a guess, so I didn't
look any further.) As an aside, there are Javascript libraries around
for natural sort, which might be worth incorporating into the filter
mechanism some day.
(http://my.opera.com/GreyWyvern/blog/show.dml/1671288) I was just
doing this for a tiddlywiki demo, so I don't have any need for such a
thing myself.

--~--~-~--~~~---~--~~
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: editing tiddler with edit macro

2009-10-10 Thread Michael Mahemoff

On Sat, Oct 10, 2009 at 11:35 AM, Eric Shulman  wrote:
>
>> It seems that as soon as I put a <> macro in a
>> tiddler, it becomes impossible to edit the text from that point on
>> (from inside TiddlyWiki; I could always hack the file externally I
>> suppose!); hitting edit in the toolbar just focuses on the new input
>> field. Is that right, and is there anything I can do to edit the text
>> again?
>
> The <> macro was originally written for use from within an
> EditTemplate.
>
> When you embed <> within tiddler content to display the edit
> field in *view* mode, it confuses the core's view/edit template
> transition handling, which looks to see if a field created by the
> <> macro exists in the rendered tiddler.  If it does, it assumes
> that the tiddler is already in edit mode and doesn't switch templates.

This feels like a bug to me; is there a ticket for it?

> In addition, there's nothing you can *do* with any changes you enter
> into a "view mode input field"... because there is no 'done' button to
> press to tell the core to copy the changed value back to the tiddler
> field.

Similarly, when I added an edit macro to ViewTemplate, I found there
was no way to undo it because there was no way to get the "delete"
button to delete the ViewTemplate.

> Fortunately, I have a plugin that extends the core's <> field
> code so that it can handle both of these issues, making it possible to
> embed <> directly in tiddler content and have it actually work:
>
> http://www.TiddlyTools.com/#EditFieldPlugin
>
> After you install this plugin in your document, you will once again be
> able to edit the tiddler with the embedded <> macro.

Great work, good to know. Thanks Eric.

--~--~-~--~~~---~--~~
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] filter and sort in DefaultTiddlers

2009-10-10 Thread Michael Mahemoff

Hi,

Is there a way I can filter *and* sort in DefaultTiddlers? I would
like to do something like"[tag[report]] [sort[+title]]"?

--~--~-~--~~~---~--~~
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] editing tiddler with edit macro

2009-10-10 Thread Michael Mahemoff

Hi,

It seems that as soon as I put a <> macro in a
tiddler, it becomes impossible to edit the text from that point on
(from inside TiddlyWiki; I could always hack the file externally I
suppose!); hitting edit in the toolbar just focuses on the new input
field. Is that right, and is there anything I can do to edit the text
again?

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---