From 3506a6212d35dc9a906fa3ce952d282111bbda14 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Tue, 16 Dec 2008 18:34:29 +1100 Subject: [PATCH] allow hints to function on pages where authorStyleDisabled has been set via means other than 'usermode' --- common/content/commands.js | 8 ++++++-- common/content/hints.js | 6 +++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/common/content/commands.js b/common/content/commands.js index 3edebfa5..0db3d315 100644 --- a/common/content/commands.js +++ b/common/content/commands.js @@ -764,7 +764,9 @@ function Commands() //{{{ else func = "completion." + completeOptionMap[completeOpt]; - completeFunc = eval(func); + //completeFunc = eval(func); + completeFunc = func; + liberator.log(func) } if (!commands.addUserCommand( @@ -775,7 +777,9 @@ function Commands() //{{{ argCount: nargsOpt, bang: bangOpt, count: countOpt, - completer: completeFunc, + // TODO: handle missing function + //completer: completeFunc, + completer: function (context, args) eval(completeFunc + "(context, args)"), replacementText: args.literalArg }, args.bang) diff --git a/common/content/hints.js b/common/content/hints.js index 83befe3e..4e60ef5f 100644 --- a/common/content/hints.js +++ b/common/content/hints.js @@ -250,7 +250,11 @@ function Hints() //{{{ } } - if (options.usermode) + // TODO: is it better to set up an observer for this property and set + // 'usermode' appropriately? We're generally not very well integrated + // into FF so having menu items toggle Vimperator options may be + // confusing. --djk + if (window.getMarkupDocumentViewer().authorStyleDisabled) { let css = []; // FIXME: Broken for imgspans.