Les dejare lo que contiene cada codigo, bueno este es el manifest.json
Código:
{ "update_url":"http://api.flickr.com/", "name": "Buscador Falkudivers", "version": "1.0.1", "description": "Busca en Falkudivers con un simple click.", "icons": { "16": "16.png", "32": "32.png", "48": "48.png", "128": "128.png" }, "browser_action": { "default_icon": "19.png", "default_title": "Buscador Falkudivers", "popup": "search.html" }, "background_page": "background.html", "homepage_url": "http://www.falkudivers.org/?searchword=&searchphrase=any&limit=&ordering=newest&view=search&Itemid=99999999&option=com_search", "permissions": [ "http://api.flickr.com/" ] }
Este otro es el archivo script
Código:
var url = "http://www.falkudivers.org/?searchword=&searchphrase=any&limit=&ordering=newest&view=search&Itemid=99999999&option=com_search"; function init() { $("searchBox").focus(); $("searchButton").addEventListener("click",_search,false); $("searchBox").addEventListener("keyup",_keyUp,false); var as = new O($("searchBox")); } function _keyUp(e) { if (e.keyCode==13) { _search(); } } function _search() { var query = $("searchBox").value; chrome.tabs.create({url:url+query}) } function $(id) { return document.getElementById(id); } function O(g){var c=this;var A=null;var o="";c.d=null;var f= -1;var j=0;var C=false;c.G=function(){g.addEventListener("keydown",c.L,false);g.addEventListener("keyup",c.K,false);g.addEventListener("blur",c.H,false);},c.getData=function(m){var URL="http://clients1.google.com.ar/complete/search?%20hl=es&json=t&jsonp=callbackfunction&q="+m;var l;l=new XMLHttpRequest();l.open("GET",URL,true);l.onreadystatechange=function(){if(l.readyState==4){if(l.status==200){var response;if(o==m){if(c.d==null){c.d=document.createElement("div");document.body.appendChild(c.d);c.d.style.display='none';}c.d.setAttribute("class","fd");c.d.style.width=(g.clientWidth)+"px";c.F();c.d.innerHTML="";var D=l.responseText;var v=D.substring(new String("callbackfunction").length+1);var v=v.substring(0,v.length-1);var M=JSON.parse(v);c.d.style.display='block';var list=M[1];j=list.length;if(j>10)j=10;for(var i=0;i<j;i++){var r=list[i];var row=document.createElement("div");var pos=r.indexOf(m);if(pos!= -1){row.innerHTML=r.substr(0,pos+m.length)+"<b>"+r.substr(pos+m.length)+"</b>";}else{row.textContent=r;}row.setAttribute("id","gffg"+i);row.setAttribute("class","gffg");row.index=i;row.J=true;row.addEventListener("mouseover",function(e){var row=e.currentTarget;if(f!= -1)document.getElementById("gffg"+f).setAttribute("class","gffg");row.setAttribute("class","gffg selected");f=row.index;},false);row.addEventListener("mousedown",function(e){var row=e.currentTarget;g.value=row.textContent;c.B(row.textContent);},false);c.d.appendChild(row);}f= -1;if(j==0){c.d.style.display='none';C=false;}else{c.d.style.display='block';C=true;}I=27+j*17;document.getElementById("container").style.height=I+"px";}}}};l.send("");};c.K=function(e){var keyCode=e.keyCode;if(keyCode!=13){if((keyCode!=38)&&(keyCode!=40)&&(keyCode!=116)){if(A!=null){window.clearInterval(A);A=null;}o=g.value;A=setTimeout(c.getData,10,g.value)}else{}}else{}},c.L=function(e){var keyCode=e.keyCode;if(keyCode==13){if(f!= -1){g.value=document.getElementById("gffg"+f).textContent}c.B(g.value);return;}if((keyCode!=38)&&(keyCode!=40)){}else{if(keyCode==38){if(f!= -1)document.getElementById("gffg"+f).setAttribute("class","gffg");f--;if(f<0)f=j-1;}else{if(f!= -1)document.getElementById("gffg"+f).setAttribute("class","gffg");f++;if(f>=j)f=0;}var row=document.getElementById("gffg"+f);row.setAttribute("class","gffg selected");g.value=row.textContent;}};c.H=function(e){if((e.explicitOriginalTarget!=c.d)&&(e.explicitOriginalTarget.J==null)){o="--";if(c.d!=null){c.d.style.display='none';document.getElementById("container").style.height="3px";}}},c.F=function(){var k=g;var x=0;var y=g.offsetHeight-1;while((k.offsetParent)&&(k.tagName.toLowerCase()!='body')){x+=k.offsetLeft;y+=k.offsetTop;k=k.offsetParent;}x+=k.offsetLeft;y+=k.offsetTop;if(c.d!=null){c.d.style.left=x+"px";c.d.style.top=y+"px";}},c.B=function(m){o="--";if(c.d!=null){c.d.style.display='none';document.getElementById("container").style.height="29px";_search();}};c.G();}
El archivo search
Código:
Este es el archivo style<!DOCTYPE html> <html> <head> <link rel="stylesheet" type="text/css" href="style.css"> <script type="text/javascript" src="script.js"></script> </head> <body onload="init()"> <div id="container"> <table width="100%"> <tr> <td width="100%"> <input id="searchBox" type="text" value=""></input> </td> <td width="50"> <img src="search_btn.png" id="searchButton" title="Buscar"></img> </td> </table> </div> </body> </html>
Código:
html { margin:0px; padding:0px; overflow:hidden; } body { margin:2px; padding:2px; } table, tr, td { margin:0px; padding:0px; } table { border-collapse: collapse; } td { margin: 0px; padding: 0px; border: 0px #000 solid; } #container { width:255px; } #searchBox { width:202px; height:23px; font-size:13px; font-family:arial; color:#000000; margin-top:3px; background-image:url('favicon.ico'); background-repeat:no-repeat; background-position:4px 5px; padding-left:25px; padding-top:2px; border:1px solid #9a9a9a; border-right:0px; } #searchButton { float:right; width:28px; height:25px; margin-top:3px; cursor:pointer; border:1px solid #9a9a9a; border-left:0px; } .fd { position:absolute; z-index:1000; top:100px; left:0px; border:1px solid #7a7a7a; background-color:#ffffff; padding-bottom:1px; } .gffg { float:left; clear:both; font-size:13px; font-family:arial; width:225px; cursor:default; padding-top:1px; padding-left:2px; color:#1e1e2e; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; -moz-user-select : none; } .gffg.selected{ background-color:#d5e2ff; }
Que podra estar fallando???, que tengo que hacer para subirlo, casi no hay info de eso, gracias espero su ayuda