-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
802 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#Wallabag-next | ||
Post URL to Wallabag | ||
|
||
Does the same as wallabag-extension from Wallabag but using the latest Firefox SDK instead of the old XUL. | ||
|
||
Original Add-on : [Wallabag firefox-ext](https://addons.mozilla.org/fr/firefox/addon/wallabag/) | ||
Original source code : [Wallabag firefox-ext source code](https://github.com/wallabag/firefox-ext) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
self.port.on('ping', function wallabagPing(){ | ||
var url = document.URL; | ||
|
||
var pageInfos = { | ||
wallaUrl: url, | ||
}; | ||
|
||
self.port.emit('pong', pageInfos); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
var self = require('sdk/self'); | ||
var tabs = require('sdk/tabs'); | ||
var workers = require('sdk/content/worker'); | ||
|
||
var {ActionButton} = require('sdk/ui/button/action'); | ||
var {openDialog} = require('sdk/window/utils'); | ||
|
||
var base64 = require('sdk/base64'); | ||
|
||
var toolbarButton = ActionButton({ | ||
id: 'wallabag-toolbar-button', | ||
label: 'Bag it !', | ||
icon: { | ||
'16': self.data.url('icon-16.png'), | ||
'32': self.data.url('icon-32.png'), | ||
'64': self.data.url('icon-64.png') | ||
} | ||
}); | ||
|
||
var wallabag = { | ||
buttonClick: function wallabagButtonClick(state) { | ||
var worker = tabs.activeTab.attach({ | ||
contentScriptFile: self.data.url('js/wallabag-get-infos.js') | ||
}); | ||
|
||
worker.port.emit('ping'); | ||
worker.port.on('pong', wallabag.postLink); | ||
}, | ||
|
||
postLink: function wallabagPostLink(linkInfo) { | ||
var wallabagUrl = require('sdk/simple-prefs').prefs.wallabagUrl; | ||
var height = require('sdk/simple-prefs').prefs.wallabagHeight; | ||
var width = require('sdk/simple-prefs').prefs.wallabagWidth; | ||
|
||
var url = linkInfo.wallaUrl; | ||
var title = linkInfo.wallaTitle; | ||
var description = linkInfo.wallaDescription; | ||
|
||
var GET = [ | ||
'action=add', | ||
'autoclose=true', | ||
'url='+base64.encode(url), | ||
]; | ||
|
||
var features = [ | ||
'height='+height, | ||
'width='+width, | ||
'centerscreen=yes', | ||
'toolbar=no', | ||
'menubar=no', | ||
'scrollbars=no', | ||
'status=no', | ||
'dialog' | ||
]; | ||
|
||
openDialog({ | ||
url: wallabagUrl+"?"+GET.join('&'), | ||
features: features.join(',') | ||
}); | ||
} | ||
}; | ||
|
||
toolbarButton.on('click', wallabag.buttonClick); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"title": "Wallabag-next", | ||
"name": "wallabag-next", | ||
"version": "1.0.0", | ||
"description": "Post URL to Wallabag", | ||
"main": "index.js", | ||
"author": "Alda Marteau-Hardi", | ||
"engines": { | ||
"firefox": ">=38.0a1" | ||
}, | ||
"license": "GPLv3", | ||
"updateURL": "https://raw.githubusercontent.com/Aldarone/wallabag-extension-next/master/update.rdf", | ||
"preferences": [ | ||
{ | ||
"name": "wallabagUrl", | ||
"title": "Wallabag URL", | ||
"type": "string", | ||
"value": "" | ||
}, | ||
{ | ||
"name": "wallabagWidth", | ||
"title": "Window width", | ||
"type": "integer", | ||
"value": 600 | ||
}, | ||
{ | ||
"name": "wallabagHeight", | ||
"title": "Window height", | ||
"type": "integer", | ||
"value": 530 | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | ||
xmlns:em="http://www.mozilla.org/2004/em-rdf#"> | ||
|
||
<!-- This Description resource includes all the update and compatibility information for | ||
a single add-on with the id foobar@developer.mozilla.org. You can list multiple | ||
add-ons information in the same RDF file. --> | ||
<RDF:Description about="urn:mozilla:extension:@wallabag-next"> | ||
<em:updates> | ||
<RDF:Seq> | ||
|
||
</RDF:Seq> | ||
</em:updates> | ||
</RDF:Description> | ||
</RDF:RDF> |