Selaa lähdekoodia

Add new ext astl-open-from-clipboard

pull/15/head
10sr 9 vuotta sitten
vanhempi
commit
18affc8f4d
1 muutettua tiedostoa jossa 21 lisäystä ja 1 poistoa
  1. +21
    -1
      _keysnail.js

+ 21
- 1
_keysnail.js Näytä tiedosto

@@ -347,15 +347,35 @@ var autoSaveTabList = (function(){
"Tab List saved: " + filename);
}

function openFromFile(){
var file = selectFile();
openFromLFSplittedString(util.readTextFile(file));
}

function openFromClipboard(){
openFromLFSplittedString(command.getClipboardText());
}

function openFromLFSplittedString(str) {
var urls = str.split("\n");
for (var i = i; i < urls.length; i++) {
if (urls[i].match(/^http/)) {
window.openUILinkIn(urls[i], "tab");
}
}
}

return {
selectDirectory: selectDirectory,
setup: setup,
getTabList: getTabList,
saveCurrentList: saveCurrentList
saveCurrentList: saveCurrentList,
openFromClipboard: openFromClipboard
};
})();

ext.add("astl-setup", autoSaveTabList.setup, "Auto save tab list - Setup");
ext.add("astl-open-from-clipboard", autoSaveTabList.openFromClipboard, "Auto save tab list - Open tabs from clipboard");
ext.add("astl-save-current", autoSaveTabList.saveCurrentList,
"Auto save tab list - Save current list");



Ladataan…
Peruuta
Tallenna