QuickOpenTagPlugin - Add a "exclude xyz tag" function

2 views
Skip to first unread message

Eris of StrongHold [STRM]

unread,
Oct 1, 2008, 10:33:19 AM10/1/08
to TiddlyWikiDev
I love this plugin. . . .
http://mptw.tiddlyspot.com/#QuickOpenTagPlugin

But I have (1) troublesome tag I would like to exclude from the
dropdown list(s).
Any Javascript Magic that could make this happen?

Open to any suggestions :)

Thx,
Mike

Simon Baird

unread,
Oct 2, 2008, 1:27:22 AM10/2/08
to Tiddly...@googlegroups.com
Firstly, this plugin doesn't make the dropdown lists. The drop downs are done by onClickTag which is a core thing (that happens to be hijacked by http://mptw.tiddlyspot.com/#ExtendTagButtonPlugin if you're using the full MPTW).

Secondly, what do you mean by exclude a tag? Do you mean exclude a tiddler?

Eris of StrongHold [STRM]

unread,
Oct 2, 2008, 7:16:57 AM10/2/08
to TiddlyWikiDev
I am using extendTagButtonPlugin, but I am not sure if I am using the
full version (I started with MPTW & TW 2.2.4 about 1 year ago, and
have been updating and tweaking via plugins etc.)

I am sorry for the terminology mishap, I believe I am trying to
exclude an tiddler from the onClickTag.
(and I have been looking in all of the wrong places)
Is this already built in?

extentTagButtonPlugin Version: 3.2 ($Rev: 3861 $)
QuickOpenTagPlugin Version: 3.0.1 ($Rev: 3861 $)
TW Version: 2.4.1

Thx for the correction and any future direction,

Mike

On Oct 2, 12:27 am, "Simon Baird" <simon.ba...@gmail.com> wrote:
> Firstly, this plugin doesn't make the dropdown lists. The drop downs are
> done by onClickTag which is a core thing (that happens to be hijacked byhttp://mptw.tiddlyspot.com/#ExtendTagButtonPluginif you're using the full
> MPTW).
>
> Secondly, what do you mean by exclude a tag? Do you mean exclude a tiddler?
>
> On Thu, Oct 2, 2008 at 12:33 AM, Eris of StrongHold [STRM] <
>
> eris...@gmail.com> wrote:
>
> > I love this plugin. . . .
> >http://mptw.tiddlyspot.com/#QuickOpenTagPlugin
>
> > But I have (1) troublesome tag I would like to exclude from the
> > dropdown list(s).
> > Any Javascript Magic that could make this happen?
>
> > Open to any suggestions :)
>
> > Thx,
> > Mike
>
> --
> simon.ba...@gmail.com

Eris of StrongHold [STRM]

unread,
Oct 6, 2008, 10:32:49 AM10/6/08
to TiddlyWikiDev
/bump

Should I re-post this with a title that has the correct terminology?
I.E. onClickTag exclude "xyz" tiddler for extendTagButtonPlugin

http://mptw.tiddlyspot.com/#ExtendTagButtonPlugin

thx,

Mike

On Oct 2, 6:16 am, "Eris of StrongHold [STRM]" <eris...@gmail.com>
wrote:
> I am using extendTagButtonPlugin, but I am not sure if I am using the
> full version (I started with MPTW & TW 2.2.4 about 1 year ago, and
> have been updating and tweaking via plugins etc.)
>
> I am sorry for the terminology mishap, I believe I am trying to
> exclude an tiddler from the onClickTag.
> (and I have been looking in all of the wrong places)
> Is this already built in?
>
> extentTagButtonPlugin Version: 3.2 ($Rev: 3861 $)
> QuickOpenTagPlugin Version: 3.0.1 ($Rev: 3861 $)
> TW Version: 2.4.1
>
> Thx for the correction and any future direction,
>
> Mike
>
> On Oct 2, 12:27 am, "Simon Baird" <simon.ba...@gmail.com> wrote:
>
>
>
> > Firstly, this plugin doesn't make the dropdown lists. The drop downs are
> > done by onClickTag which is a core thing (that happens to be hijacked byhttp://mptw.tiddlyspot.com/#ExtendTagButtonPluginifyou're using the full
> > MPTW).
>
> > Secondly, what do you mean by exclude a tag? Do you mean exclude a tiddler?
>
> > On Thu, Oct 2, 2008 at 12:33 AM, Eris of StrongHold [STRM] <
>
> > eris...@gmail.com> wrote:
>
> > > I love this plugin. . . .
> > >http://mptw.tiddlyspot.com/#QuickOpenTagPlugin
>
> > > But I have (1) troublesome tag I would like to exclude from the
> > > dropdown list(s).
> > > Any Javascript Magic that could make this happen?
>
> > > Open to any suggestions :)
>
> > > Thx,
> > > Mike
>
> > --
> > simon.ba...@gmail.com- Hide quoted text -
>
> - Show quoted text -

Eric Shulman

unread,
Oct 6, 2008, 11:28:27 AM10/6/08
to TiddlyWikiDev
> Should I re-post this with a title that has the correct terminology?
> I.E. onClickTag exclude "xyz" tiddler for extendTagButtonPlugin

Try putting this tweak into a tiddler tagged with "systemConfig":
-------------------------------------
var fn=onClickTag.toString();
fn=fn.replace(
/for \(r = 0; r < tagged.length; r\+\+\) \{/,
'var
ex=store.getTiddlerText("ExcludeFromTagList","").readBracketedList();'
+'for(r=0;r<tagged.length;r++) { if (ex.contains(tagged[r].title))
continue;'
);
eval(fn);
-------------------------------------
(reminder: watch out for Google-added line breaks in the above
code...)

When invoked at startup, this tweak gets the core's definition of
onClickTag as a text string, then matches and replaces bit of code in
order to insert the additional handling needed to read a space-
separated, bracketed list of tiddler titles from
[[ExcludeFromTagList]], and then skip over those titles when rendering
the tag dropdown.

Note: Because ExtendTagButtonPlugin modifies the core's onClickTag()
function, and the above tweak must be applied to the unaltered core
function definition, you will need to name the tweak tiddler so that
it's title precedes "ExtendTagButtonPlugin" alphabetically. Try using
"." as the first 'letter' of the tiddler title... because it is sorted
before all letters, it will ensure that the tweak tiddler is invoked
first.

Once this tweak is loaded, any tiddler titles entered into
[[ExcludeFromTagList]] will be automatically omitted from all tag
dropdown lists.

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

Eris of StrongHold [STRM]

unread,
Oct 6, 2008, 2:25:23 PM10/6/08
to TiddlyWikiDev
I am missing a step . . .

I created the systemConfig tiddler .extendTweak
with your above code (4 lines [var, fn, /for, eval])
I also created a tiddler ExcludeFromTagList (tagged as .extendTweak so
I could find it easily)
My ExcludeFromTagList contains: [[TagDB]]

Not sure what I am missing - but I think I am headed in the right
direction !!
I can create a simple example if needed.

I really appreciate the help & I am very excited about the solution :D

Thx

Mike

Eris of StrongHold [STRM]

unread,
Oct 6, 2008, 3:08:57 PM10/6/08
to TiddlyWikiDev
An Example:
http://www.strm.us/Private/extendTweak.htm

On Oct 6, 1:25 pm, "Eris of StrongHold [STRM]" <eris...@gmail.com>
wrote:
> > TiddlyTools / ELS Design Studios- Hide quoted text -

Eric Shulman

unread,
Oct 6, 2008, 5:30:31 PM10/6/08
to TiddlyWikiDev
> An Example:http://www.strm.us/Private/extendTweak.htm

The problem originates with [[TaggerPlugin]], which completely
*redefines* onClickTag() rather than *hijacking* it. As a result, all
previous modifications of that function, including the code changes
made by [[.extendTweak]], are ignored.

In this particular instance, because there are three plugins that all
modify the same core function in different ways, the order in which
they are loaded is important: for the tweak to work, it must occur
*after* [[TaggerPlugin]], but *before* [[extendTagButtonPlugin]].

Try naming the tweak something like: [[extendTagButton.Tweak]]

(note the use of the "." embedded in the title, so that it will occur
just *before* [[extendTagButtonPlugin]]

Yeah... I know it's ugly.... but it should work....

-e

Eris of StrongHold [STRM]

unread,
Oct 6, 2008, 6:13:29 PM10/6/08
to TiddlyWikiDev
It is a ugly problem :D
I like the functionality of both. . .

After renaming the plugin I get a error:syntax error
http://www.strm.us/Private/extendTweak2.htm

Eric Shulman

unread,
Oct 6, 2008, 6:56:56 PM10/6/08
to TiddlyWikiDev
> After renaming the plugin I get a error:syntax errorhttp://www.strm.us/Private/extendTweak2.htm

oops! Change the last line from:
eval(fn);
to:
eval("window.onClickTag="+fn);

sorry about that :-)

-e

Eris of StrongHold [STRM]

unread,
Oct 6, 2008, 7:03:21 PM10/6/08
to TiddlyWikiDev
Woo Hoo
** Doing Happy Dance **

That appears to have fixed my "problem"

Thx,

Mike

Eris of StrongHold [STRM]

unread,
Oct 6, 2008, 7:05:29 PM10/6/08
to TiddlyWikiDev
P.S. Is (above) an acceptable way to post test cases?
Should I have included SaveAsPlugin ??

Once again THANKS 4 the help :D

Mike
Reply all
Reply to author
Forward
0 new messages