diff options
author | retlet | 2013-07-11 01:54:28 -0700 |
---|---|---|
committer | retlet | 2013-07-11 01:54:28 -0700 |
commit | b9447991aa530a1ef07091d3ad4a23cf48891438 (patch) | |
tree | ca76ee39a579c868170ebb81c5fd6ce1f6854b66 | |
parent | 57197aab3cfa645b1c69fe76ec69372fdd4bddf2 (diff) | |
parent | eedba602a516b14bc55acc42d07d3867abeb5cae (diff) | |
download | vimperator-plugins-b9447991aa530a1ef07091d3ad4a23cf48891438.tar.bz2 |
Merge pull request #48 from eagletmt/tombfix
Support Tombfix
-rw-r--r-- | hint-tombloo.js | 3 | ||||
-rw-r--r-- | tombloo.js | 12 |
2 files changed, 9 insertions, 6 deletions
diff --git a/hint-tombloo.js b/hint-tombloo.js index 09d9bd6..6ab3fcb 100644 --- a/hint-tombloo.js +++ b/hint-tombloo.js @@ -29,7 +29,8 @@ hints.addMode( hintKey, 'Share by Tombloo', function (elem) { - var tomblooService = Cc['@brasil.to/tombloo-service;1'].getService().wrappedJSObject.Tombloo.Service; + var tombloo = Cc['@tombfix.github.io/tombfix-service;1'] || Cc['@brasil.to/tombloo-service;1']; + var tomblooService = tombloo.getService().wrappedJSObject.Tombloo.Service; var d = window.content.document; var w = window.content.wrappedJSObject; @@ -103,12 +103,14 @@ commands.addUserCommand( // helper --- function getTombloo() { - const serviceId = '@brasil.to/tombloo-service;1'; + const serviceIds = ['@tombfix.github.io/tombfix-service;1', '@brasil.to/tombloo-service;1']; - if (!Cc[serviceId]) - throw new Error('Tombloo is not found. install from http://github.com/to/tombloo/wikis'); - - return Cc[serviceId].getService().wrappedJSObject; + for each (let serviceId in serviceIds) { + if (Cc[serviceId]) { + return Cc[serviceId].getService().wrappedJSObject; + } + } + throw new Error('Tombloo or Tombfix is not found. install from https://github.com/tombfix/core'); } function getContext() { |