[TWC] TagSearchPlugin wirks and doesn't work - one other other depending on the file

76 views
Skip to first unread message

Anton Aylward

unread,
Feb 20, 2014, 10:46:47 PM2/20/14
to tiddl...@googlegroups.com
I downloaded TagSearchPlugin and configured it for the toolbar and with zzConfig
It came from http://tagsearch.tiddlyspot.com/
I've used it in the past.  I've set it up before as the site described.

And it didn't work.

So I set up another tiddywiki file and imported it there and it did work.

Both purport to be 2.8.1 and were derived from a late 'empty'

I've tried to make the non-working one as close to the working one as possible, same stylesheets and other plugins.
But the debug defeats me.  i'm not a javascript programmer anyway and don't know what tools i'm supposed to use to insect.

This is current firefox on current linux. 

PMario

unread,
Feb 21, 2014, 7:05:28 AM2/21/14
to tiddl...@googlegroups.com
On Friday, February 21, 2014 4:46:47 AM UTC+1, Anton Aylward wrote:
I've tried to make the non-working one as close to the working one as possible, same stylesheets and other plugins.
But the debug defeats me.  i'm not a javascript programmer anyway and don't know what tools i'm supposed to use to insect.

This is current firefox on current linux. 

You could try to open the dev tools with F12

So open your "non working" TW and hit F12
Select the "Console" tab
Klick the tagSearch button.

If we are lucky, there may be an error message. if yes copy past it to the group here.

If no :/   Can you describe a bit closer what "it doesn't work" means? eg: ... The dialog pops up, but doesn't have content. or "there is no dialog at all" ...

The best possibility would be if there would be a downloadable minimal "non working" testcase.html in dropbox or tiddlyspot.

mario

Anton Aylward

unread,
Feb 21, 2014, 8:43:02 AM2/21/14
to tiddl...@googlegroups.com
On 02/21/2014 07:05 AM, PMario wrote:
> On Friday, February 21, 2014 4:46:47 AM UTC+1, Anton Aylward wrote:
>
> I've tried to make the non-working one as close to the working one
> as possible, same stylesheets and other plugins.
> But the debug defeats me. i'm not a javascript programmer anyway
> and don't know what tools i'm supposed to use to insect.
>
> This is current firefox on current linux.
>
>
> You could try to open the dev tools with F12
>
> So open your "non working" TW and hit F12
> Select the "Console" tab
> Klick the tagSearch button.

You forgot that I had to tell the window to stay above others ...

>
> If we are lucky, there may be an error message. if yes copy past it to
> the group here.

Is this it?

08:09:50.765 ReferenceError: e is not defined BaseLine_Char_Loc.html:8454


And the code from the file around there reads

8475 // Check that a particular plugin is valid for execution
8476 function isPluginExecutable(plugin)
8477 {
8478 if(plugin.tiddler.isTagged("systemConfigForce")) {
8479 plugin.log.push(config.messages.pluginForced);
8480 return true;
8481 }
8482 if(plugin["CoreVersion"]) {
8483 var coreVersion = plugin["CoreVersion"].split(".");
8484 var w = parseInt(coreVersion[0],10) - version.major;
8485 if(w == 0 && coreVersion[1])
8486 w = parseInt(coreVersion[1],10) - version.minor;
8487 if(w == 0 && coreVersion[2])
8488 w = parseInt(coreVersion[2],10) - version.revision;
8489 if(w > 0) {
8490
plugin.log.push(config.messages.pluginVersionError);
8491 return false;
8492 }
8493 }
8494 return true;
8495 }

When I view the backstage/plugins pulldown it doesn't show any errors.
And no, the only tag on the plugin is 'systemConfig'

But also I don't see the variable 'e' in the above.

The header notes on TagSearchPlugin say it requires 2.5 or better,
This is 2.8.1

or this

Error loading source:
Could not load the source for javascript:;.
[Exception... "Component returned failure code: 0x80040111
(NS_ERROR_NOT_AVAILABLE) [nsIChannel.asyncOpen]" nsresult: "0x80040111
(NS_ERROR_NOT_AVAILABLE)" location: "JS frame ::
resource://gre/modules/devtools/dbg-server.jsm ->
resource://gre/modules/devtools/server/main.js ->
resource://gre/modules/devtools/server/actors/script.js :: fetch :: line
4257" data: no]



>
> If no :/ Can you describe a bit closer what "it doesn't work" means?
> eg: ... The dialog pops up, but doesn't have content. or "there is no
> dialog at all" ...

The dialogue box does not pop up.





> The best possibility would be if there would be a downloadable minimal
> "non working" testcase.html in dropbox or tiddlyspot.

I'll work on cutting away all the customizations...


--
I used to think that running an organization was equivalent to
conducting a symphony orchestra. But I don't think that's quite it; it's
more like jazz. There is more improvisation.
- Warren Bennis

PMario

unread,
Feb 21, 2014, 9:45:06 AM2/21/14
to tiddl...@googlegroups.com
TagSearchPlugin depends on GotoPlugin from tiddlytools.
Is gotoplugin installed?

It seems there is no dependency check?

-m

Anton Aylward

unread,
Feb 21, 2014, 10:03:29 AM2/21/14
to tiddl...@googlegroups.com
On 02/21/2014 09:45 AM, PMario wrote:
> TagSearchPlugin depends on GotoPlugin from tiddlytools.
> Is gotoplugin installed?
>

Yes it is installed and active.


--
Remember that it is far better to follow well than to lead indifferently.
- John G. Vance

PMario

unread,
Feb 21, 2014, 10:11:39 AM2/21/14
to tiddl...@googlegroups.com
On Friday, February 21, 2014 2:43:02 PM UTC+1, Anton Aylward wrote:
Is this it?

08:09:50.765 ReferenceError: e is not defined BaseLine_Char_Loc.html:8454

If you click the line number 8454 it doesn't jump to the code you posted. right?

Can you copy the code from http://tagsearch.tiddlyspot.com/#TagSearchSource
into the TagSearchPlguin. ... Tobias did minify the plugin code. So the variable names are obfuscated.
"View" the tiddler source above and copy paste it into your TagSearchPlugin. So may be we get a better line number, that may lead to the variable that is missing.

mario

Anton Aylward

unread,
Feb 21, 2014, 11:17:15 AM2/21/14
to tiddl...@googlegroups.com
I now get

10:55:47.684 ReferenceError: e is not defined BaseLine_Char_Loc.html:8910

and pasting from the file:

8906
8907 function invokeParamifier(params,handler)
8908 {
8909 if(!params || Params.length == undefined || Params.length <= 1)
8910 return;
8911 var i;
8912 for(i=1; i<params.length; i++) {
8913 var p = config.paramifiers[params[i].name];
8914 if(p && p[handler] instanceof Function)
8915 p[handler](params[i].value);
8916 else {
8917 var h =
config.optionHandlers[params[i].name.substr(0,3)];
8918 if(h && h.set instanceof Function)
8919 h.set(params[i].name,params[i].value);
8920 }
8921 }
8922 }

There isn't a 'e' in the calling functions.

I did a search for a "e =" to look for a place where "e" wasn't defined.
I found one but it wasn't related. Or at lest correcting it made no
differnce

9572 name: "customFormat",
9573 match: "@@|\\{\\{",
9574 handler: function(w)
9575 {
9576 switch(w.matchText) {
9577 case "@@":
9578 var e = createTiddlyElement(w.output,"span");
9579 var styles =
config.formatterHelpers.inlineCssHelper(w);
9580 if(styles.length == 0)
9581 e.className = "marked";
9582 else
9583
config.formatterHelpers.applyCssHelper(e,styles);
9584 w.subWikifyTerm(e,/(@@)/mg);
9585 break;
9586 case "{{":
9587 var lookaheadRegExp =
/\{\{[\s]*([\w]+[\s\w]*)[\s]*\{(\n?)/mg;
9588 lookaheadRegExp.lastIndex = w.matchStart;
9589 var lookaheadMatch =
lookaheadRegExp.exec(w.source);
9590 if(lookaheadMatch) {
9591 w.nextMatch =
lookaheadRegExp.lastIndex;
9592 e =
createTiddlyElement(w.output,lookaheadMatch[2] == "\n" ? "div" :
"span",null,lookaheadMatch[1]);
9593 w.subWikifyTerm(e,/(\}\}\})/mg);
9594 }
9595 break;
9596 }
9597 }
9598 },
9599


Aren't there supposed to be code scanners that look for things like this?

PMario

unread,
Feb 21, 2014, 11:35:15 AM2/21/14
to tiddl...@googlegroups.com
It seems, the line numbers we get aren't right. ... They point to the core code. :/

the e variable is often used to store the event information for event handlers. events are mouse click, keyboard ....
So sometimes if event handlers are overwritten by plugins, this can happen. ....

I actually have no good guesses any more. So a minimal test case may be the only option.

-m

PMario

unread,
Feb 21, 2014, 8:29:19 PM2/21/14
to tiddl...@googlegroups.com
Hi Anton,
With the testcase file it was possible to track the problem down. As you wrote, the problem was the TiddlerNotesPlugin.

The plugin added some extensions, that are part of the core, since 2007 in core version 2.2.6. I removed the offending functions, adjusted the dependencies gave the plugin a new home at tiddlyspot [1], since the old repos are not available anymore.

The plugin got a new "Revision section" and a new Version Number: 2.2

have fun!
mario
---------------------------------------
If anyone likes what I do, you may be able to 
click here -> to do me a favor and push one or all of my web space accounts :) or
visit my -> shopping whishlist.
---------------------------------------

[1] http://tiddlernotesplugin.tiddlyspot.com/


Reply all
Reply to author
Forward
0 new messages