Skip to content

Commit

Permalink
Support Tombfix
Browse files Browse the repository at this point in the history
  • Loading branch information
eagletmt committed Jul 10, 2013
1 parent b84dff2 commit eedba60
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
3 changes: 2 additions & 1 deletion hint-tombloo.js
Expand Up @@ -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;
Expand Down
12 changes: 7 additions & 5 deletions tombloo.js
Expand Up @@ -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() {
Expand Down

0 comments on commit eedba60

Please sign in to comment.