blobList.hideBlobs(); | blobList.hideBlobs(); | ||||
}, | }, | ||||
clickClipboard: function() { | |||||
if (!blobList.visible) | |||||
return; | |||||
var blob = blobList.blobs[blobList.currentKey]; | |||||
if (!blob) | |||||
return; | |||||
if (!blob.linkElem.href) | |||||
return; | |||||
self.port.emit("clipboard_set", blob.linkElem.href); | |||||
blobList.hideBlobs(); | |||||
}, | |||||
appendKey: function(c) { | appendKey: function(c) { | ||||
blobList.currentKey += c; | blobList.currentKey += c; | ||||
blobList.overview.innerHTML = blobList.currentKey; | blobList.overview.innerHTML = blobList.currentKey; | ||||
blobList.click(); | blobList.click(); | ||||
} else if (onWebPage && blobList.visible && isMatch(keys.blobs_click_new_tab, evt)) { | } else if (onWebPage && blobList.visible && isMatch(keys.blobs_click_new_tab, evt)) { | ||||
blobList.clickNewTab(); | blobList.clickNewTab(); | ||||
} else if (onWebPage && blobList.visible && isMatch(keys.blobs_click_clipboard, evt)) { | |||||
blobList.clickClipboard(); | |||||
//Scrolling | //Scrolling | ||||
} else if (onWebPage && isMatch(keys.scroll_up, evt)) { | } else if (onWebPage && isMatch(keys.scroll_up, evt)) { |
var tabs = require("sdk/tabs"); | var tabs = require("sdk/tabs"); | ||||
var self = require("sdk/self"); | var self = require("sdk/self"); | ||||
var simple_prefs = require("sdk/simple-prefs"); | var simple_prefs = require("sdk/simple-prefs"); | ||||
var clipboard = require("sdk/clipboard"); | |||||
var conf = {}; | var conf = {}; | ||||
var keys = {}; | var keys = {}; | ||||
worker.port.on("move_tab_right", function() { | worker.port.on("move_tab_right", function() { | ||||
moveRelativeTab(1); | moveRelativeTab(1); | ||||
}); | }); | ||||
worker.port.on("clipboard_set", function(text) { | |||||
clipboard.set(text); | |||||
}); | |||||
}); | }); |
{ | { | ||||
"title": "Mouseless", | "title": "Mouseless", | ||||
"name": "mouseless", | "name": "mouseless", | ||||
"version": "0.4.1", | |||||
"version": "0.5.0", | |||||
"description": "For a mouseless future.", | "description": "For a mouseless future.", | ||||
"main": "index.js", | "main": "index.js", | ||||
"author": "Martin Dørum Nygaard", | "author": "Martin Dørum Nygaard", | ||||
"name": "blobs_click_new_tab", "title": "Open in New Tab", | "name": "blobs_click_new_tab", "title": "Open in New Tab", | ||||
"type": "string", | "type": "string", | ||||
"value": "<Shift>Enter" | "value": "<Shift>Enter" | ||||
}, { | |||||
"name": "blobs_click_clipboard", "title": "Copy Link", | |||||
"type": "string", | |||||
"value": "<Control>Enter" | |||||
}, { | }, { | ||||
"name": "blobs_backspace", "title": "Blobs Backspace", | "name": "blobs_backspace", "title": "Blobs Backspace", | ||||
"type": "string", | "type": "string", |