Created
January 26, 2009 15:43
-
-
Save lmrodriguezr/52847 to your computer and use it in GitHub Desktop.
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
CmdUtils.CreateCommand({ | |
name: "biblia", | |
takes: {"Tópico": noun_arb_text}, | |
icon: "http://www.biblegateway.com/favicon.ico", | |
preview: function (pblock, toSearch){ | |
if(!toSearch.text){ | |
pblock.innerHTML="Buscar tema en la Reina-Valera (versión de 1995 en español de la Biblia)"; | |
}else{ | |
var bibleBase="http://www.biblegateway.com/"; | |
var version="61"; | |
jQuery.get( | |
bibleBase+(toSearch.text?"quicksearch/?qs_version="+version+"&quicksearch="+toSearch.text:""), {}, | |
function(htmlReq){ | |
var lis=jQuery("li",jQuery('ol',htmlReq)[0]); | |
if(lis.length > 0 ){ | |
var out=""; | |
lis.each(function(li){ | |
var aa=jQuery("a",lis[li]); | |
aa.each(function(a){aa[a].href=bibleBase+aa[a].href.substr(18);}); | |
out+=lis[li].innerHTML+"<br/><br/>"; | |
}); | |
pblock.innerHTML="<div style='max-height:95%;overflow-y:auto;'>"+out+"</div>"; | |
}else{ | |
pblock.innerHTML="No se han encontrado coincidencias para <b>"+toSearch.text+"</b>."; | |
} | |
} | |
); | |
} | |
}, | |
execute: function( toSearch ) { | |
var bibleBase="http://www.biblegateway.com/"; | |
Utils.openUrlInBrowser( | |
bibleBase+(toSearch.text?"quicksearch/?qs_version=61&quicksearch="+toSearch.text:"") | |
); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment