Преглед изворни кода

write keysnail plugin list-current-urls.ks.js

pull/1/head
10sr пре 12 година
родитељ
комит
9ecbb96cd8
1 измењених фајлова са 1 додато и 37 уклоњено
  1. +1
    -37
      _keysnail.js

+ 1
- 37
_keysnail.js Прегледај датотеку

@@ -222,43 +222,6 @@ ext.add("strong-fullscreen", function(){

}, "go fullscreen with hiding toolbar and tabbar");

ext.add("list-page-url", function(){
// window.content.document.links
var urls = [];
var aa = window.content.document.getElementsByTagName("a");
var text = "";
var alt = "";
for (var i = 0; i < aa.length ; i++) {
if(aa[i].href == ""){ continue; }

if (aa[i].text == "" && aa[i].hasChildNodes() && aa[i].childNodes[0].nodeType == Node.ELEMENT_NODE){
alt = aa[i].childNodes[0].getAttribute("alt");
text = " " + aa[i].childNodes[0].nodeName + (alt ? ": " + alt : "");
}else{
text = aa[i].text;
}
urls.push([text, decodeURIComponent(aa[i].href)]);
}

if(urls.length == 0){
display.echoStatusBar("No url found.");
return;
}

prompt.selector(
{
message : "Select URL",
collection : urls,
width : [35, 65],
header : ["text", "url"],
callback : function (i) {
if (i >= 0)
openUILinkIn(urls[i][1], "tab"); // or current tabshifted window
}
}
);
}, "list url");

ext.add("bookmark-delicious", function(){
f= 'http://www.delicious.com/save?url=' + encodeURIComponent(window.content.location.href) +
'&title=' + encodeURIComponent(document.title) +
@@ -344,6 +307,7 @@ ext.add('auto-install-plugins', function(ev, arg){
'https://raw.github.com/10sr/keysnail-plugin/master/dig-url.ks.js',
'https://raw.github.com/10sr/keysnail-plugin/master/instapaper.ks.js',
'https://raw.github.com/10sr/keysnail-plugin/master/pixiv_autojump.ks.js',
'https://raw.github.com/10sr/keysnail-plugin/master/list-current-urls.ks.js',
'https://raw.github.com/gist/1976942/firefox-addon-manager.ks.js',
'https://raw.github.com/gist/1450594/mstranslator.ks.js'
];


Loading…
Откажи
Сачувај