-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from johannhof/v1.0
1.0
- Loading branch information
Showing
35 changed files
with
1,552 additions
and
718 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
V=0.6.0 | ||
V=1.0.0 | ||
|
||
release: build | ||
rm -rf release/latest | ||
|
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
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
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
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
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
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
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
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 |
---|---|---|
@@ -1,39 +1,91 @@ | ||
var data = require("sdk/self").data; | ||
var ss = require("sdk/simple-storage"); | ||
var clipboard = require("sdk/clipboard"); | ||
var data = require("sdk/self").data; | ||
var ss = require("sdk/simple-storage"); | ||
var clipboard = require("sdk/clipboard"); | ||
var Panel = require("sdk/panel").Panel; | ||
var ToggleButton = require('sdk/ui/button/toggle').ToggleButton; | ||
var Hotkey = require("sdk/hotkeys").Hotkey; | ||
var tabs = require("sdk/tabs"); | ||
|
||
var text_entry = require("sdk/panel").Panel({ | ||
var panel, button, hotkey; | ||
|
||
panel = Panel({ | ||
width: 510, | ||
height: 370, | ||
contentURL: data.url("popup.html"), | ||
contentScriptFile: data.url("helper.js") | ||
contentScriptFile: data.url("helper.js"), | ||
onShow: function() { | ||
button.state('window', {checked: true}); | ||
}, | ||
onHide: function() { | ||
button.state('window', {checked: false}); | ||
} | ||
}); | ||
|
||
text_entry.port.on("copy", function(text) { | ||
// Create a button | ||
button = ToggleButton({ | ||
id: "show-emoji-panel", | ||
label: "Show Emoji Helper", | ||
icon: { | ||
"16": "./icon.png", | ||
"32": "./icon.png", | ||
"64": "./icon.png" | ||
}, | ||
onChange: function (state) { | ||
if (state.checked) { | ||
panel.show({ | ||
position: button | ||
}); | ||
} | ||
} | ||
}); | ||
|
||
function createHotkey(combo) { | ||
ss.storage.combo = combo; | ||
if(combo === 'none'){ | ||
return; | ||
} | ||
|
||
// create a keyboard shortcut | ||
hotkey = Hotkey({ | ||
combo: combo, | ||
onPress: function() { | ||
if (panel.isShowing) { | ||
panel.hide(); | ||
}else{ | ||
panel.show({ | ||
position: button | ||
}); | ||
} | ||
} | ||
}); | ||
} | ||
|
||
createHotkey(ss.storage.combo || "accel-e"); | ||
|
||
panel.port.on("combo", function(combo) { | ||
hotkey.destroy(); | ||
createHotkey(combo); | ||
}); | ||
|
||
panel.port.on("insert", function(text) { | ||
tabs.activeTab.attach({ | ||
contentScript: 'document.activeElement.value += "' + (text || "") + '"' | ||
}); | ||
}); | ||
|
||
panel.port.on("copy", function(text) { | ||
clipboard.set(text); | ||
}); | ||
|
||
text_entry.port.on("set", function(item) { | ||
panel.port.on("set", function(item) { | ||
ss.storage[item.key] = item.value; | ||
}); | ||
|
||
text_entry.port.on("get", function(key) { | ||
text_entry.port.emit("send", { | ||
panel.port.on("get", function(key) { | ||
panel.port.emit("send", { | ||
key: key, | ||
value: ss.storage[key] | ||
}); | ||
}); | ||
|
||
// Create a button | ||
require("sdk/ui/button/action").ActionButton({ | ||
id: "show-panel", | ||
label: "Show Emoji Helper", | ||
icon: { | ||
"16": "./icon.png", | ||
"32": "./icon.png", | ||
"64": "./icon.png" | ||
}, | ||
onClick: function() { | ||
text_entry.show(); | ||
} | ||
}); | ||
|
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
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,11 @@ | ||
exports.emoji = [ | ||
'../shared/img/emoji/clock9.png', | ||
'../shared/img/emoji/smiley.png', | ||
'../shared/img/emoji/cherry_blossom.png', | ||
'../shared/img/emoji/bell.png', | ||
'../shared/img/emoji/oncoming_automobile.png', | ||
'../shared/img/emoji/symbols.png', | ||
'../shared/img/emoji/hatched_chick.png', | ||
'../shared/img/emoji/whale.png', | ||
'../shared/img/emoji/heart.png' | ||
]; |
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
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
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
Empty file.
Binary file not shown.
Oops, something went wrong.