// WISE framework!!!! var WISE = { //--------------------------------------- //properties // list of apps will be added here as they get loaded in "apps":{}, // Gonna store a copy of the current query object here to keep in app scope "Q":false, // Some wise-apps will need this for getting to the php server "server":((typeof wise_server_to_use == "undefined") ? "" : wise_server_to_use), // current language of app "lang":false, // private objects to keep track of apps that are loaded, and whether the results for all apps in a query are hidden "loaded":{}, "hidden":{}, "cssloaded":{}, "checkOnCloud":{"count":0,"cloudcount":0,"apps":{}}, "q_categories":{}, "message":getspan("To learn how to build an app for search, click here."), //--------------------------------------- // utility functions (kt funcionality, getting/setting properties, etc // Some wise-apps will need this for getting relative time "getNowoffset":function(){return nowoffset}, // wrapper for parent i18n function to handle translation of text in javascript "gettext":function(string){return gettext(string)}, // a utility function to trim leading/trailing whitespace from a string // not sure why there is no native js function for this "trim":function(str) { return str.replace(/^\s*/, "").replace(/\s*$/, ""); }, "stripTags":function(str) { return str.stripTags(); }, // utility function to decode utf8 text "utfdecode":function(text) { try{text = decodeURIComponent( escape( text ) );} catch (ex){} return text; }, // utility function to encode utf8 text "utfencode":function(text) { try{text = encodeURIComponent( unescape( text ) );} catch (ex){} return text; }, // function used in apps when suggested term matching is used, and matched term is passed as a parameter... // this function will check if a passed value is one of the items in the list. (see lastfm) "isOneOf":function(text, list) { var list_parts = list.split(";"); for (var i=0; i" + obj.sel + ""; //""; annAdd(r,type,obj); }, "annRender":function(r) { annRender(r); }, "finalize":function(Q, id, r) { Q = this.getQ(); reviewKT(Q); // if the id is passed, call the function to clear out the wise holder tag // this allows for subsequent calls to the app to reload the new data // found it necessary in opera/safari if(id) this.clear(id); if(r) { this.addToList(id, r.id); //alert(r.id); this.getLoaded(); //add about link about_html = "
"+getspan("About this Application")+"
"; this.annAdd(r,"text",{"sel":about_html }); this.annRender(r); var app_links = $(r.id).getElementsByTagName("a"); for (var i=0; i-1) { if($(app_links[i]).readAttribute("onclick") && $(app_links[i]).readAttribute("onclick").indexOf("rDel") >-1) { if (app_links[i].attachEvent) app_links[i].attachEvent("onclick", function (e){ WISE.delete_app(id, r.id); }); else app_links[i].addEventListener("click", function (e){ WISE.delete_app(id, r.id); }, false); } } } }, "deleted":{}, "isDeleted":function(id) { this.getQ(); if(this.deleted[this.Q.q.toLowerCase()] && this.deleted[this.Q.q.toLowerCase()][id]) return true; else return false; }, "delete_app":function(id, result_id) { //alert("doing a wise delete on the " + id + " app."); this.getQ(); ktSave(WISE.Q,"wise",{"del":id}); this.removeFromDisplay(id); }, "removeFromDisplay":function(id) { if(this.loaded[this.Q.q.toLowerCase()] && this.loaded[this.Q.q.toLowerCase()][id] && this.loaded[this.Q.q.toLowerCase()][id].result) this.loaded[this.Q.q.toLowerCase()][id].result = (-1); this.getLoaded(); }, //--------------------------------------- // wrapper to call the clear function without calling finalize (which will process KT... thats only at the end) "finalizenoreview":function(id) { this.clear(id); }, "create":function(title, url, output, id, summary) { if( this.Q.q != Q.q ) return; if(!summary) summary = ""; if(!this.apps[id].isPlayGround) { this.getQ(); var r = WISE.resultAdd( WISE.Q,url,title,summary,true); WISE.annAdd(r,"text",{"sel":output}); WISE.annRender(r); WISE.finalize(WISE.Q, id, r); // apply any possible KT stuff return r; } else { this.showPlaygroundResult(title, url, output, id, summary); } }, "showPlaygroundResult":function(title, url, output, id, summary) { $("appoutput").innerHTML = "" + "
" + output + "
"; this.clear(id); this.pgShow("output") }, "pgShow":function(which) { if(which=="def") { $("appdef").rows = 15; $("appcode").rows = 1; } else if(which=="code") { $("appdef").rows = 1; $("appcode").rows = 15; } }, // after we are done with the data that loads from the api, we need to clear out the script tag // opera/safari wont reload subsequent calls if we dont do this, and we aim to please all browsers "clear":function(id) { var i = document.getElementById("WISE_"+id); if (i) { var doc = null; if(i.contentDocument) // Firefox, Opera doc = i.contentDocument; else if(i.contentWindow) // Internet Explorer doc = i.contentWindow.document; else if(i.document) // Others? doc = i.document; if(doc == null) throw "Document not initialized"; try { /* here's where it gets a little tricky / IE barfs if you try to add elements via the dom into these iframes once created (but not delete... weird) / (not a problem here, but will be later if we try to re-add the script tag / so............ we check if we can add an element (within a try block). / if not, must be IE, or some other browser that has the same problem, so we just forget it and handle differently in the call function (replace src) / if yes, remove the dummy element that we just added (dont want to keep adding unnecessary stuff :) ) / then remove the script tag, confident that we will be able to re add it later */ var body = doc.getElementsByTagName("body"); // macbre: extra check if (body && body.length > 0) { var t=document.createTextNode("t"); body[0].appendChild(t); body[0].removeChild(t); body[0].removeChild(doc.getElementById("WISE_holder")); } } catch (ex) {} } }, // we took away access to the parent outside of through the WISE object, but if we want functions/variables for post load event handling // we need to make them accessible via the WISE object. so this function adds them to the object for the app being processed // can be accessed in event handlers via "WISE.apps.appname.funcname" or "WISE.apps.appname.varname" "scope":function(varname, val, id) { var app = this.apps[id]; if (!app) return false; app[varname] = val; return app[varname]; }, // same thing for accessing dom elements after the page loads... need aninterface through the WISE object // just a wrapper for the prototype $ function to get access to parent level elements later. "getElement":function(el) { return $(el); }, "getBrowser":function() { try {return BrowserDetect;} catch (ex) {return false;} }, //--------------------------------------- // public functions //function to get called on search to check all regexes "scan":function(query, applist) { if(!applist) this.removeLoaded(); // get query in WISE scope for later this.Q = Q; if(!applist && ((typeof wise_cloudcount == "undefined" || wise_cloudcount < 2))) this.checkOnCloud={"count":0,"cloudcount":0,"apps":{}}; //check each app in array //if(!applist) WISE.createStyleSheet var app_list = (applist ? applist : this.apps); for(app in app_list) { var temp_query = false; var cur = WISE.apps[app]; // check the query against each the regex for each object var matches = false; if (cur.regex) { matches = cur.regex.exec(query); if (matches) { // we cant pass params to the functions in the file being included, // but they can access an array stored here in the WISE object for the app cur.params = new Array(); var param = (cur.param ? cur.param : 1); var q = false; // start at the first sub-match and go through all to see which is not undefined if (!cur.multimatch) { for (var i=param; i cur.othermatch.value; } q = query; break; // some apps get triggered if the suggestions that come back from the outside sites produce // certain terms that identify the type of query in some way case "suggest": // since the suggestions are getting loaded asynchronously from a 3rd party, we have to make sure // that they have loaded before we do this... // if they havent loaded by the time this scan function runs on the query (which is probably the case) // it gets called again as a callback when all of the sources load if(applist || (typeof wise_cloudcount != "undefined" && wise_cloudcount > 1)) { // get all of the links loaded into the suggestion cloud and load them into an object var cloud_suggestions = $("cloud").getElementsByTagName('a'); var suggest_names = {}; var sug_matches = cur.othermatch.keywords.split(";"); for (var sug_i = 0; sug_i -1) { doesMatch = true; // if the app specified that it wants to know which keyword it matched on, store that if(cur.othermatch.includeKeyword) { q = new Array(); q.push(query); q.push(sug_matches[sug_j].toLowerCase()); cur.multimatch=true; } else { q = query; } break; } } } } } else { this.checkOnCloud.apps[cur.id] = 1; this.checkOnCloud.count++; } break; } } //if we have a match run the app if (doesMatch && q && !this.isDeleted(cur.id)) { this.autoRun(q, cur.id); } } } // if no app list was passed in, then this was the first time the scan was run on, which means its a new query // therefore, set up the app box if(!applist) this.setAppBox(); if(typeof wise_cloudcount != "undefined" && wise_cloudcount > 1) wise_cloudcount = 0; }, /* // some wise tuples will categorize parts of the query... // we want to be able to run certain apps based on matching one or more categories in a query // for example, yelp is triggered if there is a "food" and a "place" in the query "cat_scan_old":function() { this.getQ(); var cat_obj = this.q_categories[this.Q.q.toLowerCase()]; var query = ""; for (var id in this.apps) { var cur = this.apps[id]; if (cur.categoryTriggers) { var cat_trig = cur.categoryTriggers.triggers.split(";"); var triggerApp = true; for (var i=0; i -1) { var cat_trig_parts = cat_trig[i].split("|"); var temp_trigger = false; for (var j=0; j -1) { var cat_trig_parts = cat_trig[i].split("|"); var temp_trigger = false; for (var j=0; j -1) { if(this.hidden[this.Q.q.toLowerCase()]) { if($("wise_ann_" + parseInt(this.loaded[this.Q.q.toLowerCase()][id].result))) { $("wise_ann_" + parseInt(this.loaded[this.Q.q.toLowerCase()][id].result)).show(); //$("wise_ann_show_" + parseInt(this.loaded[this.Q.q.toLowerCase()][id].result)).hide(); } } else { if($("wise_ann_" + parseInt(this.loaded[this.Q.q.toLowerCase()][id].result))) { $("wise_ann_" + parseInt(this.loaded[this.Q.q.toLowerCase()][id].result)).hide(); //$("wise_ann_show_" + parseInt(this.loaded[this.Q.q.toLowerCase()][id].result)).show(); } } } } if(this.hidden[this.Q.q.toLowerCase()]) $("wise_toggle_link").innerHTML = "(-)"; else $("wise_toggle_link").innerHTML = "(+)"; this.hidden[this.Q.q.toLowerCase()] = !this.hidden[this.Q.q.toLowerCase()]; } }, // added line to main.js to handle this on switching queries. // (will remove all loaded from the display, not from the object) and refill it with loaded apps from current query "getLoaded":function() { this.removeLoaded(); this.getQ(); var numResults = 0; if (this.loaded[this.Q.q.toLowerCase()]) { for(var id in this.loaded[this.Q.q.toLowerCase()]) { if(!WISE.apps[id].hideDisplay && this.loaded[this.Q.q.toLowerCase()][id].result > -1) { this.doAddDisplay(id); numResults++; } } } if(!numResults) { this.doAddDisplay(); } }, // some functions will need to include a file in their code to access external functions // this needs to be tested to make sure that the scope is ok "require":function(url, opt) { // document.write('"); doc.write(""); // include the appropriate wise file here (the file with the code for this app) if (!this.apps[id].inlineCode) doc.write(""); else doc.write(""); this.apps[id].inlineCode = false; doc.write(""); // set up the body with the onload function to call the specified action function and create the holder for calloutscripts doc.write(""); doc.close(); }, // we will need to get the data from the external site, and here's how "call":function(url,id) { // at this point, we already have the iframe container created... lets use it var i = document.getElementById("WISE_"+id); // get access to the iframe document var doc = null; if(i.contentDocument) // Firefox, Opera doc = i.contentDocument; else if(i.contentWindow) // Internet Explorer doc = i.contentWindow.document; else if(i.document) // Others? doc = i.document; if(doc == null) throw "Document not initialized"; // if the script holder exists and there is already a value for the src // (this will only ever happen on a second call in IE.. we just replace the src rather than delete and re-add the node) // IE-- anyway, its not just enough to handle it differently, we need to put in a 100 millisecond delay to make it work :( if(doc.getElementById("WISE_holder") && doc.getElementById("WISE_holder").src) { if (doc.getElementById("WISE_holder").addEventListener) doc.getElementById("WISE_holder").addEventListener("load", function(){setTimeout(function(){if(WISE.loadedFromMenu[id]) {WISE.loadToLightBox(id);}}, (WISE.apps[id].loadCheckDelay ? WISE.apps[id].loadCheckDelay : 500))}, false); else if(doc.getElementById("WISE_holder").readyState) WISE.loadCheckers[id]=setInterval(function(){if (doc.getElementById("WISE_holder").readyState == "loaded"){clearInterval(WISE.loadCheckers[id]); if(WISE.loadedFromMenu[id]) {WISE.loadToLightBox(id);}}}, (WISE.apps[id].loadCheckDelay ? WISE.apps[id].loadCheckDelay : 500)); setTimeout(function() {doc.getElementById("WISE_holder").src=url;}, 100); } // in every other case :) else { // if the WISE holder doesnt exist (this is in subsequent calls to this function in every browser but IE if(!doc.getElementById("WISE_holder")) { // re-create the element and add it to the body of the doc in the iframe var s = document.createElement("script"); s.setAttribute("id", "WISE_holder"); s.setAttribute("defer", true); s.setAttribute("type", "text/javascript"); doc.getElementsByTagName("body")[0].appendChild(s); } if (doc.getElementById("WISE_holder").addEventListener) doc.getElementById("WISE_holder").addEventListener("load", function(){setTimeout(function(){if(WISE.loadedFromMenu[id]) {WISE.loadToLightBox(id);}}, (WISE.apps[id].loadCheckDelay ? WISE.apps[id].loadCheckDelay : 500))}, false); else if(doc.getElementById("WISE_holder").readyState) WISE.loadCheckers[id]=setInterval(function(){if (doc.getElementById("WISE_holder").readyState == "loaded"){clearInterval(WISE.loadCheckers[id]); if(WISE.loadedFromMenu[id]) {WISE.loadToLightBox(id);}}}, (WISE.apps[id].loadCheckDelay ? WISE.apps[id].loadCheckDelay : 1500)); // otherwise, its the first time, we created the script tag earlier and its there, so give it a src doc.getElementById("WISE_holder").src=url; } }, // object to hold on to the interval variable used in the IE version of checking to see if the app has loaded when loaded from the menu // need to know when we have something to display in the lightbox. "loadCheckers":{}, // object to temporarily keep trackof apps that were loaded from the menu, so that when they load up, we know whether to use the lightbox or not "loadedFromMenu":{},"loadedFromMenuPersistent":{}, // function to load to lightbox "loadToLightBox":function(id, loading) { // temp var... start false, set to true if true var wasLoadedFromMenu = false; // if it was loaded from menu, set temp var to true, set attr of object back to false if(WISE.loadedFromMenu[id]) { wasLoadedFromMenu = true; if(!loading) WISE.loadedFromMenu[id] = false; } WISE.getQ(); if( !WISE.loadedFromMenuPersistent[WISE.Q.q]) WISE.loadedFromMenuPersistent[WISE.Q.q] = {}; if( wasLoadedFromMenu && !WISE.loadedFromMenuPersistent[Q.q][id] ){ WISE.loadedFromMenuPersistent[WISE.Q.q][id] = true } // keep global list of loadedfrommenu // check if it loaded results or not var result_id = WISE.thisHasResults(id); var clone; var hasResults = false; var wasDeleted = false; var wasDeletedLink = 0; // if it has a result div id (numerical, possibly equal to 0) and that div exists... (then we have results to display) if((result_id || result_id==0) && $(result_id)) { hasResults = true; wasDeleted = $(result_id).hasClassName("deleted"); if(wasDeleted) { //alert("true"); var app_links = $(result_id).getElementsByTagName("a"); //alert(app_links.length); for (var i=0; i-1) { if($(app_links[i]).readAttribute("onclick") && $(app_links[i]).readAttribute("onclick").indexOf("rUnDel") >-1) { wasDeletedLink = app_links[i]; } } wasDeleted = ""+result_id+""; if(!wasDeletedLink) wasDeletedLink = app_links[0]; $(result_id).removeClassName("deleted"); } // if it was hidden before (from previous load to lightbox, show it (we dont want to clone a hidden node //$(result_id).show(); // clone the result and all of its children... that sounds more evil than it is clone = $(result_id).cloneNode(true); // change the id and some of the formatting params of the new cloned node if(clone.id && clone.id == result_id) clone.setAttribute("id", result_id + "_lightbox"); var prev_divs = clone.getElementsByTagName("div"); for (var i=0; i= 1) { $("dialog-window").removeChild($("dialog-window").firstChild); } } var preview_app = $("dialog-window"); } else { var preview_app = document.createElement("div"); preview_app.setAttribute("id", "dialog-window"); document.body.appendChild(preview_app); } preview_app.style.position = "absolute"; //preview_app.style.top = "50px"; //preview_app.style.left = "300px"; var boxWidth = 700; preview_app.style.left = Math.floor((document.viewport.getWidth() - boxWidth)/2) + "px"; preview_app.style.width = boxWidth + "px"; preview_app.style.textAlign = "left"; preview_app.style.margin = "auto"; preview_app.style.zIndex = 100; //title and message var titlediv = document.createElement("h2"); titlediv.style.margin = "0 0 10px 0"; titlediv.style.padding = "0"; titlediv.innerHTML = (WISE.apps[id].name ? WISE.apps[id].name : id) + " Application"; // add parts to box // first link to close box (need one of those) var closediv = document.createElement("div"); closediv.style.fontSize = "10px"; //closediv.style.cssFloat = "right"; closediv.style.cssFloat = "right"; closediv.style.styleFloat = "right"; var scroll = document.createElement("a"); //scroll.className = "wise_link"; $(scroll).addClassName("wise_link"); if (scroll.attachEvent) { scroll.attachEvent("onclick", function (e){ WISE.hideLightBox();$( WISE.thisHasResults( id ) ).scrollTo() }); } else { scroll.addEventListener("click", function (e){ WISE.hideLightBox();$( WISE.thisHasResults( id ) ).scrollTo() }, false); } scroll.innerHTML = "Go to Result"; closediv.appendChild(scroll); var del = document.createElement("span"); del.innerHTML = " | "; closediv.appendChild(del); var close = document.createElement("a"); //close.className = "wise_link"; $(close).addClassName("wise_link"); if (close.attachEvent) { close.attachEvent("onclick", function (e){ WISE.hideLightBox(); }); } else { close.addEventListener("click", function (e){ WISE.hideLightBox(); }, false); } close.innerHTML = getspan("Close"); closediv.appendChild(close); // add the div withthe link to close and the div with the content (result or not) to the box $("dialog-window").appendChild(closediv); $("dialog-window").appendChild(titlediv); // if we detected results before, we have to add some other featurs/options if(hasResults) { // add text/link to save the result to KT adddiv = document.createElement("div"); addspan = document.createElement("span"); //style adddiv adddiv.style.margin = "0 0 10px 0"; adddiv.style.color = "#888"; if( WISE.loadedFromMenuPersistent[WISE.Q.q][id] ){ addspan.innerHTML = " "; //addspan.innerHTML = "This WISE app has been added to your current search results. If you would like to share this result with everyone by adding it to the overall result set for this search term, please "; var addlink = document.createElement("a"); //addlink.className = "wise_link"; $(addlink).addClassName("wise_link"); addlink.innerHTML = ""+getspan("Add this application")+"" if (addlink.attachEvent) { addlink.attachEvent("onclick", function (e){ WISE.save(id, wasDeleted, wasDeletedLink); WISE.hideLightBox(); }); } else { addlink.addEventListener("click", function (e){ WISE.save(id, wasDeleted, wasDeletedLink); WISE.hideLightBox(); }, false); } }else{ addspan.innerHTML = " "; var addlink = document.createElement("span"); addlink.innerHTML = getspan("This application always loads for this search result"); } // link for info about app //aboutdiv = document.createElement("div"); //aboutdiv.innerHTML += "

About Application

" + this.getAboutApp(id) + "
"; adddiv.appendChild(addspan); adddiv.appendChild(addlink); //adddiv.appendChild(aboutdiv); $("dialog-window").appendChild(adddiv); } $("dialog-window").appendChild(clone); $("dialog-window").style.display="block"; // do lightboxy stuff document.body.style.overflow="hidden"; window.scroll(0,0); }, // clear out stuff from the box, and hide it "hideLightBox":function() { if ($("dialog-window").hasChildNodes()) { while($("dialog-window").childNodes.length >= 1) { $("dialog-window").removeChild($("dialog-window").firstChild); } } if (document.getElementById("dialog-window")) document.getElementById("dialog-window").style.display = "none"; if (document.getElementById("dialog-lightbox")) document.getElementById("dialog-lightbox").style.display = "none"; document.body.style.overflow="auto"; }, // load up the info from the app def for everyone to see "getAboutApp":function( id ){ about = ""; if( WISE.apps[id].description ) { about += "
"+getspan("Description")+": " + getspan(WISE.apps[id].description) + "
"; } if( WISE.apps[id].author ) { about += "
"+getspan("Author")+": " + WISE.apps[id].author + "
"; } return about; }, //--------------------------------------- // private functions (not that they are actually private right now, but they are only called from other WISE code // function to load css classes for each app; "save":function (id, wasDeleted, wasDeletedLink){ WISE.getQ(); WISE.loadedFromMenuPersistent[WISE.Q.q][id] = false; ktSave(WISE.Q,"wise",{"app":id}); $( WISE.thisHasResults( id ) ).scrollTo() if (wasDeleted && wasDeletedLink) rUnDel(wasDeleted, wasDeletedLink); }, // css for WISE in general, and for each app is defined in the js // crate the necessary classes as each loads, and remember that it was already loaded, so as to not load again "load_css":function(id){ try{ // if there is not already a stylesheet to be used for wise (first time this gets created) if(!$("wise_stylesheet")) { var wise_style = document.createElement("style"); wise_style.setAttribute("id", "wise_stylesheet"); wise_style.setAttribute("type", "text/css"); document.body.appendChild(wise_style); wise_style = document.styleSheets[document.styleSheets.length-1]; } else { var wise_style = document.styleSheets[document.styleSheets.length-1]; } } catch(ex){ //alert(ex.message); } // if there is no id, this is the main WISE stylesheet... set the id to WISE var has_id = true; if(!id) { id="WISE"; has_id = false; } if(this.cssloaded[id]) { return; } // get the app specific css, or the main WISE css var the_css = (has_id ? WISE.apps[id].css : WISE.css) if(the_css) { try{ var app_css = the_css; //cycle through all of the classes for(var selector in app_css) { var property = ""; // cycle through each property for the class for (var each_prop in app_css[selector]) { property += each_prop + ": " + app_css[selector][each_prop] + "; "; } // create the selector for the class... put wise at the beginning, and then the appname if its an app // we dont want any regular css to get overwritten here, so we prepend the appname selector = ".wise_" + (has_id ? id + "_" : "") + selector; // add it in, and of course be nice to all browsers that handle it differently if (wise_style.insertRule) { wise_style.insertRule(selector + '{' + property + '}', wise_style.cssRules.length); } if (wise_style.addRule){ wise_style.addRule(selector, '{' + property + '}'); } } } catch(ex) { //alert(ex.message); } } this.cssloaded[id] = true; }, // private function for checking if an app is used for that language "check_lang": function (which, language) { var cur = WISE.apps[which] if(!language && typeof lang == "undefined") return false; if(!language && typeof lang != "undefined") language = lang; if(cur.lang && cur.lang.indexOf(language) == -1) return false; else return true; }, "run_urlreplace":function(query, which) { if (!WISE.check_lang(which)) return false; var cur = WISE.apps[which]; var temp_q = query; if(cur.urlreplace.lowercase) temp_q = temp_q.toLowerCase(); if(cur.urlreplace.uppercase) temp_q = temp_q.toUpperCase(); if(cur.urlreplace.spacechar) temp_q = temp_q.replace(" ", cur.urlreplace.spacechar); var url = cur.appurl.replace("$1", temp_q); var title = cur.apptitle.replace("$1", query); var summary = cur.appsummary.replace("$1", query); var output = ""; if(this.isLoaded(which)) return false; else this.addToList(which); this.create(title, url, output, cur.id, summary); }, // a private function called by the run function if the app is a regular app with its own file // called from generic wrapper function run (or menu_run) "run_reg":function(query, which) { if (!WISE.check_lang(which)) return false; var cur = WISE.apps[which]; if(this.isLoaded(which)) return false; else this.addToList(which); // we created a params array before. push the query in as a param. (its the only one we have for now :( ) cur.params = new Array(); if (cur.multimatch) cur.params = query; else cur.params.push(query); // use some dynamic iframe magic to load up the file that contains the code this.include(cur.url, cur.id); }, // private function to check if an app has been loaded or not, in order to not re-load the same app "isLoaded":function(id) { if(this.apps[id].isPlayGround) return false; this.getQ(); if(this.loaded[this.Q.q.toLowerCase()] && this.loaded[this.Q.q.toLowerCase()][id]) return true; else return false; }, // private function to check if an app has been loaded or not, in order to not re-load the same app "previewById":function(id) { this.getQ(); if(this.loaded[this.Q.q.toLowerCase()] && this.loaded[this.Q.q.toLowerCase()][id] && this.loaded[this.Q.q.toLowerCase()][id].result!=-1) this.loadToLightBox(this.loaded[this.Q.q.toLowerCase()][id].result); else return false; }, // private function to check if an app has been loaded or not, in order to not re-load the same app "thisHasResults":function(id) { this.getQ(); if(this.loaded[this.Q.q.toLowerCase()] && this.loaded[this.Q.q.toLowerCase()][id] && this.loaded[this.Q.q.toLowerCase()][id].result!=-1) return this.loaded[this.Q.q.toLowerCase()][id].result; else return false; }, // private function that on calling/rendering of an app adds/modifies it in the list of loaded apps "addToList":function(id, result) { this.getQ(); if(!this.loaded[this.Q.q.toLowerCase()]) this.loaded[this.Q.q.toLowerCase()] = {}; this.loaded[this.Q.q.toLowerCase()][id] = {"result": (typeof result != "undefined" ? result : -1)}; if(result && !WISE.apps[id].hideDisplay) this.doAddDisplay(id); }, // private function that will add the name of the app to the displayed list of added apps shown in the appbar at top "doAddDisplay":function(id) { if($("wise_appbar") && $("wise_appload")) { if(id) { // if the app loaded, and there are results, attach onclick and show the link with the app name if (this.loaded[this.Q.q.toLowerCase()][id] && this.loaded[this.Q.q.toLowerCase()][id].result && parseInt(this.loaded[this.Q.q.toLowerCase()][id].result) > -1) { this.getQ(); var addApp = document.createElement("a"); addApp = $(addApp); addApp.setAttribute("id", "appbar_"+id); if (addApp.attachEvent) { //addApp.attachEvent("onclick", function (e){ WISE.loadToLightBox(id); }); addApp.attachEvent("onclick", function (e){ $(WISE.thisHasResults(id)).scrollTo(); }); } else { //addApp.addEventListener("click", function (e){ WISE.loadToLightBox(id); }, false); addApp.addEventListener("click", function (e){ $(WISE.thisHasResults(id)).scrollTo(); }, false); } //addApp.style.color = "#0000FF"; addApp.style.cursor = "pointer"; addApp.innerHTML = ((WISE.apps[id].logo)?" ":"") + (WISE.apps[id].name ? WISE.apps[id].name : id) addApp.style.margin = "0 5px"; // update the number of apps that have loaded in the display var count = this.hasResults(); //$("wise_appcount").innerHTML = "| " + count + " " + " Loaded" //$("wise_appcount").innerHTML = "| " + count + " App" + (count>1 ? "s":"") + " Loaded" $("wise_appload").appendChild(addApp); } } else { var addApp = document.createElement("span"); addApp = $(addApp); addApp.setAttribute("id", "wise_noresults"); addApp.innerHTML = getspan("No applications loaded"); addApp.style.margin = "0 5px"; $("wise_appload").appendChild(addApp); } } }, // private function that will return if a given query has any apps that have returned results and are displayed "hasResults":function(q) { if (!q) q = this.getQ().q; var count = 0; if (this.loaded[q.toLowerCase()]) { for(var id in this.loaded[q.toLowerCase()]) { if(this.loaded[q.toLowerCase()][id].result > -1) count++; } } return count; }, // private function that steps through the appload display object and removes all children (and toggle link if present) "removeLoaded":function() { if ($("wise_appload")) { if ( $("wise_appload").hasChildNodes() ) { while ( $("wise_appload").childNodes.length >= 1 ) { $("wise_appload").removeChild( $("wise_appload").firstChild ); } } } if ($("wise_appcount")) { $("wise_appcount").innerHTML = "| 0 "+getspan("Loaded"); } /* if($("wise_toggle_link")) { $("wise_appbar").removeChild($("wise_toggle_link")); } */ }, // cool function that someone else wrote but we modified to handle mouse scrollwheel actions "getWheel":function(e) { var delta = 0; if (!e) /* For IE. */ e = window.event; if (e.wheelDelta) { /* IE/Opera. */ delta = e.wheelDelta/120; /** In Opera 9, delta differs in sign as compared to IE. */ //if (window.opera) delta = -delta; } else if (e.detail) { /** Mozilla case. */ /** In Mozilla, sign of delta is different than in IE. * Also, delta is multiple of 3. */ delta = -e.detail/3; } /** If delta is nonzero, handle it. * Basically, delta is now positive if wheel was scrolled up, * and negative, if wheel was scrolled down. */ if (delta) { var tb = e.target || e.srcElement; if(tb.parentNode.id.indexOf("wise-") == -1) tb = tb.parentNode; if(WISE.activecat && tb.parentNode.id=="wise-apps") this.scrollapps(delta, tb.parentNode, WISE.activecat); else this.scrollapps(delta, tb.parentNode); } /** Prevent default actions caused by mouse wheel. * That might be ugly, but we handle scrolls somehow * anyway, so don't bother here.. */ if (e.preventDefault) e.preventDefault(); e.returnValue = false; }, // all the app links for themenu (created in the setAppBox funcion) "applinks":new Array(), // all the category links for themenu (created in the setAppBox funcion) "appcatlinks":new Array(), // will hold the list of applinks for each category in here "appcategories":{}, // keeps track of what the first item displayed in the menu is (each category has its own also "applinkstart":0, // how many app links to display in each column of the menu "applinksshow":5, // which category is being displayed currently... will get set to "All" on load "activecat":false, // timer for settimeout of mouseover of scroll item "scrolltimer":false, // function to load all of the apps in tothe menu (on load and on change of category "loadscrollapps":function(appbox, category) { // get apps or categories if(!appbox) appbox = $("wise-categories"); else appbox = $(appbox); // get scroll buttons div for apps or categories var appbox_scroll = $(appbox.id + "-scroll"); // if its not a specific category, then get the category list if(!category) var app_array = this.appcatlinks; else var app_array = this.appcategories[category].apps; // clear old stuff out if (appbox.hasChildNodes()) { while(appbox.childNodes.length >= 1) { appbox.removeChild(appbox.firstChild); } } // clear old stuff out of the scroll divs also if (appbox_scroll.hasChildNodes()) { while(appbox_scroll.childNodes.length >= 1) { appbox_scroll.removeChild(appbox_scroll.firstChild); } } // create the header, either for the category list or for the app list var applink = document.createElement("div"); applink = $(applink); applink.setAttribute("class", "wise_listheader"); if(!category) { applink.innerHTML = getspan("Categories"); } else { // FIXME: Use sprintf() and ngettext() here: if(category == "All") applink.innerHTML = "All " + app_array.length + " " + " Application" + (app_array.length > 1 ? "s" : ""); else applink.innerHTML = app_array.length + " " + category + " Application" + (app_array.length > 1 ? "s" : ""); } appbox.appendChild(applink); // add each of the links and set them all to be shown to start for (var i=0; i this.applinksshow) { var applink = document.createElement("a"); //applink.className = "wise_applink wise_scrollbutton"; $(applink).addClassName("wise_applink wise_scrollbutton"); applink.innerHTML = "▲"; if (applink.attachEvent) { applink.attachEvent("onclick", function (e){ WISE.scrollapps(1, appbox, category); }); //applink.attachEvent("onmouseover", function (e){ WISE.scrolltimer = setInterval(function(){WISE.scrollapps(1, appbox, category);}, 200); }); //applink.attachEvent("onmouseout", function (e){ clearInterval(WISE.scrolltimer); }); } else { applink.addEventListener("click", function (e){ WISE.scrollapps(1, appbox, category);}, false); //applink.addEventListener("mouseover", function (e){ WISE.scrolltimer = setInterval(function(){WISE.scrollapps(1, appbox, category);}, 200); }, false); //applink.addEventListener("mouseout", function (e){ clearInterval(WISE.scrolltimer); }, false); } appbox_scroll.appendChild(applink); var applink = document.createElement("a"); //applink.className = "wise_applink wise_scrollbutton"; $(applink).addClassName("wise_applink wise_scrollbutton"); applink.innerHTML = "▼"; if (applink.attachEvent) { applink.attachEvent("onclick", function (e){ WISE.scrollapps(-1, appbox, category); }); //applink.attachEvent("onmouseover", function (e){ WISE.scrolltimer = setInterval(function(){WISE.scrollapps(-1, appbox, category);}, 200); }); //applink.attachEvent("onmouseout", function (e){ clearInterval(WISE.scrolltimer); }); } else { applink.addEventListener("click", function (e){ WISE.scrollapps(-1, appbox, category);}, false); //applink.addEventListener("mouseover", function (e){ WISE.scrolltimer = setInterval(function(){WISE.scrollapps(-1, appbox, category);}, 200); }, false); //applink.addEventListener("mouseout", function (e){ clearInterval(WISE.scrolltimer); }, false); } appbox_scroll.appendChild(applink); } // since we just loadad, and started the display from the start, set that param to 0 if(category) this.appcategories[category].applinkstart = 0; else this.applinkstart = 0; }, // function to handle hiding and showing of appropriate applinks on scrolling through the wise menu "scrollapps":function(delta, appbox, category) { // are we scrolling categories or apps? if(!appbox) appbox = $("wise-categories"); else appbox = $(appbox); if(!category) var app_array = this.appcatlinks; else var app_array = this.appcategories[category].apps; // different browsers handle the delta differently // so we just normalize it all to a -1 or a 1 so we can handle them the same if(delta>0) delta = 1; else if (delta < 0) delta = -1; //we either scrolled up 1 or down 1, so we are starting 1 off var appstart = ((category ? this.appcategories[category].applinkstart : this.applinkstart) - delta); // if we were already at 0, and tried to go lower, we wont allow it if(appstart < 0) { return false; } // likewise, we cant go past the bottom end else if (delta != 0 && appstart > (app_array.length - this.applinksshow)) { return false; } // instead of handling this by setting the 1 param at a time // quick wheel scrolling may make this function call too many times for that to be reliable // so we loop through to make sure that the last time it is called the display results are reliable //hide from 0 to start for(var i=0; i(b.name?b.name:b.id).toLowerCase() ? 1 : ((a.name?a.name:a.id).toLowerCase()<(b.name?b.name:b.id).toLowerCase() ? -1 : 0));}); for (var k=0; k -1 ){ //$("wise_appimage").setAttribute("src", "wise/images/wise_menu_close.png"); //}else{ //$("wise_appimage").setAttribute("src", "wise/images/wise_menu_open.png"); //} }); } else { applink.addEventListener("click", function (e){ $("wise-container").toggle(); //$("wise_appbar").style.borderRight = "1px solid #dcdcdc"; //$("wise_applink").style.backgroundColor = "#fff"; //if( $("wise_appimage").src.indexOf( "wise/images/wise_menu_open.png" ) > -1 ){ //$("wise_appimage").setAttribute("src", "wise/images/wise_menu_close.png"); //}else{ //$("wise_appimage").setAttribute("src", "wise/images/wise_menu_open.png"); //} }, false); } //applink.appendChild(appimg); //applink.innerHTML += "Applications"; applink.appendChild(document.createTextNode(gettext("Add Application"))); //applink.className = "wise_menu"; $(applink).addClassName("wise_menu"); applink.style.color = "blue"; applink.style.cursor = "pointer"; applink.style.margin = "0 5px 0 0"; applink.style.fontSize = "10px"; applink.style.whiteSpace = "nowrap"; applink.style.display = "block"; applink.style.cssFloat = "right"; applink.style.styleFloat = "right"; appbar.appendChild(applink); //var appcount = document.createElement("span"); //appcount.setAttribute("id", "wise_appcount"); //appcount.className = "wise_appcount"; //appcount.innerHTML = " | 0 Apps Loaded" //appbar.appendChild(appcount); var appload = document.createElement("span"); appload.setAttribute("id", "wise_appload"); appbar.appendChild(appload); var app_preview = document.createElement("div"); app_preview.setAttribute("id", "wise_apppreview"); app_preview = $(app_preview); app_preview.hide(); app_preview.style.position = "absolute"; app_preview.style.left="75px"; if(document.all)app_preview.style.marginTop = "20px"; app_preview.style.backgroundColor = "#FFFFFF"; app_preview.style.textAlign="left"; app_preview.style.zIndex = 1000; appbar.appendChild(app_preview); //appbox = $(appbox); appbar = $(appbar); //appbar.appendChild(appbox); appbar.style.width = "100%"; appbar.style.textAlign = "left"; appbar.style.marginTop = "2px"; appmsg.style.width = "100%"; appmsg.style.textAlign = "right"; appmsg.style.fontSize = "10px"; appmsg.style.marginTop = "6px"; //appbar.style.marginBottom = "5px"; //$(appbox).hide(); $("wise_placeholder").appendChild(appmsg); $("wise_placeholder").appendChild(appbar); //appbox.style.position = "absolute"; //appbox.style.right="33%"; //appbox.style.backgroundColor = "#EEEEEE"; //appbox.style.zIndex = 1000; //appbox.style.width = "300px"; var appcontainer = document.createElement("div"); appcontainer.setAttribute("id", "wise-container"); appcontainer.setAttribute("class", "wise_container"); //appcontainer.className = "wise_container"; $(appcontainer).addClassName("wise_container"); appcontainer.style.display = "none"; var appclose = document.createElement("a"); appclose.setAttribute("id", "wise-close"); $(appclose).addClassName("wise_about"); $(appclose).addClassName("wise_link"); appclose.innerHTML = "| "+getspan("Close"); if (appclose.attachEvent) { appclose.attachEvent("onclick", function (){ $("wise-container").hide(); }); } else { appclose.addEventListener("click", function (){ $("wise-container").hide(); }, false); } appcontainer.appendChild(appclose); /* var appabout = document.createElement("span"); $(appabout).addClassName("wise_about"); appabout.innerHTML = " | "; appcontainer.appendChild(appabout); */ var appabout = document.createElement("a"); appabout.setAttribute("id", "wise-about"); //appabout.className = "wise_about"; $(appabout).addClassName("wise_about"); $(appabout).addClassName("wise_link"); appabout.style.textDecoration = "none"; appabout.innerHTML = getspan("Develop an Application"); appabout.setAttribute("href", "http://search.wikia.com/wiki/Creating_a_WISE_Application") appcontainer.appendChild(appabout); //appcontainer.appendChild(document.createTextNode(" | ")); var appcategories = document.createElement("div"); appcategories.setAttribute("id", "wise-categories"); //appcategories.className = "wise_categories"; $(appcategories).addClassName("wise_categories"); appcontainer.appendChild(appcategories); var appcategoriesscroll = document.createElement("div"); appcategoriesscroll.setAttribute("id", "wise-categories-scroll"); //appcategoriesscroll.className = "wise_menuscroll"; $(appcategoriesscroll).addClassName("wise_menuscroll"); appcontainer.appendChild(appcategoriesscroll); var applist = document.createElement("div"); applist.setAttribute("id", "wise-apps"); //applist.className = "wise_apps"; $(applist).addClassName("wise_apps"); appcontainer.appendChild(applist); var applistscroll = document.createElement("div"); applistscroll.setAttribute("id", "wise-apps-scroll"); //applistscroll.className = "wise_menuscroll"; $(applistscroll).addClassName("wise_menuscroll"); appcontainer.appendChild(applistscroll); var appclear = document.createElement("div"); //appclear.className = "wise_clear"; $(appclear).addClassName("wise_clear"); appcontainer.appendChild(appclear); $("wise_placeholder").appendChild(appcontainer); //$("search-results-top").appendChild(appcontainer); this.loadscrollapps("wise-categories"); this.activecat = "All"; this.loadscrollapps("wise-apps", "All"); this.getLoaded(); } else { this.getLoaded(); if($("wise_applink")) $("wise_applink").innerHTML = getspan("Add Application"); } }, //--------------------------------------- // WISE subobject to handle processing of apps created by the app generator (no separate code file). "generic":{ "cur_gen_id":"", "buildItemUrl":function(base, params, obj) { var url = base; if (params) { for (var i=0; i 0) ? WISE.apps[id].gen_obj.response.size : r_obj[resp_hand.containerElement].length);} try{var maxlength = ((WISE.apps[id].gen_obj.response.size && obj_container && WISE.apps[id].gen_obj.response.size < obj_container.length && WISE.apps[id].gen_obj.response.size > 0) ? WISE.apps[id].gen_obj.response.size : obj_container.length);} catch(ex){var maxlength= (obj_container ? obj_container.length : 0)} for (var i=0; i" +((cur[resp_hand.titleField] && cur[resp_hand.titleField]!="undefined") ? cur[resp_hand.titleField] : cur[resp_hand.backupTitle]) + ""; if (resp_hand.titleField) { //var link_text = ((eval("cur." + resp_hand.titleField) && eval("cur." + resp_hand.titleField)!="undefined") ? eval("cur." + resp_hand.titleField) : cur[resp_hand.backupTitle]); var link_text = this.returnField(resp_hand.titleField, cur); link_text = (link_text && link_text!="undefined" ? link_text : cur[resp_hand.backupTitle]); cur_str += "" + WISE.utfdecode(link_text) + ""; } cur_str += ""; cur_str += "
"; if (resp_hand.image) { //if (resp_hand.image.field && cur[resp_hand.image.field]) cur_str += ""; //if (resp_hand.image.field && eval("cur." + resp_hand.image.field)) cur_str += ""; if (resp_hand.image.field && this.returnField(resp_hand.image.field, cur)) cur_str += ""; else cur_str += ""; } for (var j=0; j"; } if(typeof isGen != "undefined") { $("output").innerHTML = ""; } else { if(resp_str != "") { /* r = WISE.resultAdd( WISE.Q,app_url,app_title,"",true); WISE.annAdd(r,"text",{"sel":resp_str}); WISE.annRender(r); WISE.finalize(WISE.Q, id, r); // apply any possible KT stuff */ WISE.create(app_title, app_url, resp_str, id); } else { //WISE.finalizenoreview(id); WISE.clear(id); } if(WISE.loadedFromMenu[id]) WISE.loadToLightBox(id); } } //else resp_str = "error"; //$("output").innerHTML = resp_str; }, "returnField":function(field, cur_obj) { if (field) { var par_split = field.split("."); var obj_temp = cur_obj; for (var j=0; j curField.limit) ? fieldText.substr(0, curField.limit)+"..." : fieldText) + (curField.suffix ? curField.suffix : ""); } catch(ex){} if (from_sel && curField.for_desc) return_str = return_str.replace(/\<([^\>]+)\>/g, ""); return return_str; }, "load":function(q, id) { //this.query=q; if (!WISE.check_lang(id)) return false; this.cur_gen_id = id if(typeof isGen == "undefined") { if(WISE.isLoaded(id)) return false; else WISE.addToList(id); } if (WISE.apps[id] && WISE.apps[id].gen_obj) { var params = {}; WISE.apps[id].gen_obj.params = params; WISE.apps[id].params = new Array(); WISE.apps[id].params.push(q); var start; if (!params.start) start = (WISE.apps[id].gen_obj.request.start ? WISE.apps[id].gen_obj.request.start : 0); else start = params.start; //WISE.apps[id].gen_obj.start=start; WISE.apps[id].gen_obj.params.start = start; /* if (!this.test_obj.params.dis) this.test_obj.params.dis = "api-disambig"; if (!this.test_obj.params.sel) this.test_obj.params.sel = "select-screen"; if (!this.test_obj.params.screen) this.test_obj.params.screen = "api-screen"; */ //document.getElementById("api-disambig").innerHTML = "Loading..."; //$(this.test_obj.params.dis).innerHTML = "Loading..."; //var id=which; //check if need to redeclare callback if(WISE.apps[id].gen_obj.redeclare) { eval(WISE.apps[id].gen_obj.redeclare);} //build url var r = WISE.apps[id].gen_obj.request; var url = r.url; var custom_modify = new Array(); if(r.urlmodify && r.custom) { for (var i=0; i -1) url = url.replace(""+r.search+"", encodeURIComponent(q) + (r.q_append ? encodeURIComponent(r.q_append) : "")); else url += ((url.indexOf("?") > -1) ? "&" : "?") + r.search + "=" + encodeURIComponent(q)+ (r.q_append ? encodeURIComponent(r.q_append) : ""); } if (r.next && start) url += ((url.indexOf("?") > -1) ? "&" : "?")+r.next + "=" + (r.offset ? start+r.offset : start); /* //var id="test"; oScript = document.getElementById(id); var head = document.getElementsByTagName("head")[0]; if (oScript) { head.removeChild(oScript); } // Create object oScript = document.createElement("script"); oScript.setAttribute("src",url); oScript.setAttribute("id","WISE_"+id); head.appendChild(oScript); //document.getElementById("container").innerHTML = url + "

"; */ // use some dynamic iframe magic to load up the file that contains the code WISE.include(url, id); } } }, "embedSWF":function( url, flashvars, params, attributes ){ swfobject.embedSWF(url, "openplayer", "0", "0", "8.0.0", false, flashvars, params, attributes); }, "sendEvent":function sendEvent(typ,prm) { if( 1==1 /*isReady*/ ) { this.thisMovie('openplayer').sendEvent(typ,prm); } }, "thisMovie":function thisMovie(movieName) { return document.getElementById(movieName); if(navigator.appName.indexOf("Microsoft") != -1) { return window[movieName]; } else { return document[movieName]; } }, "css":{ "applink":{ "cursor":"pointer", "font-size":"12px", "display":"block", "white-space":"nowrap", "overflow":"hidden", "line-height":((document.all) ? "16px" : "15px"), "height":((document.all) ? "16px" : "15px") }, "applink:hover":{ "background-color":"#DDDDDD" }, "scrollbutton":{ "text-align":"center", "position":"relative", "top":((document.all && !window.opera) ? "62px" : "66px") }, "listheader":{ "font-size":"12px", "font-weight":"bold", "white-space":"nowrap", "margin-bottom":"3px", "line-height":((document.all) ? "16px" : "15px"), "height":((document.all) ? "16px" : "15px") }, "container":{ "background-color":"#fff", "border-right":"1px solid #dcdcdc", "border-left":"1px solid #dcdcdc", "border-bottom":"1px solid #dcdcdc", "width":"81%", "color":"#777", "padding":"5px", "z-index":"1000", "height":"100px" }, "about":{ "padding":"2px", "float":"right", "font-size":"10px" }, "categories":{ "padding":"2px 2px 2px 5px", "width":"25%", "overflow":"hidden", "float":"left", "font-size":"12px" }, "menuscroll":{ "padding":"2px 5px 2px 2px", "width":"20px", "float":"left", "font-size":"12px", "height":"100%" }, "apps":{ "padding":"2px 2px 2px 3px", "width":"25%", "overflow":"hidden", "float":"left", "font-size":"12px" }, "appcount":{ "padding":"0px 3px", "font-size":"11px", "color":"#666666" }, "clear":{ "clear":"both" }, "link":{ "color":"blue", "cursor":"pointer" } }, "log": function(data) { if (typeof console != 'undefined') { console.log(data); } } }; // APPS WISE.apps.weather = { "name":"Accuweather", "author": "Wikia Search", "description":"Get local forecasts from accuweather.com", "logo":"http://www.accuweather.com/favicon.ico", "categories":[ "News" ], "id":"weather", //"regex":/(?:.*(?:([0-9]{5}).*)|(?:(?:weather )(.+))|((.+)(?: weather)))/i, "regex":/(?:(?:weather|accuweather|forecast|current conditions|radar|humidity|hurricane|storm )(.+))|((.+)(?: weather|accuweather|forecast|current conditions|radar|humidity|hurricane|storm))/i, //"param":1, "url":"wise/apps/wise_weather.js?r=" + Math.random(), "useSpellSuggest":true, "action":"weatherFetch" }; /* WISE.apps.stock = { "id":"stock", "regex":/.*(?:stock )([A-Z]{1,5}).* /i, //"param":1, "url":"wise/apps/wise_stock.js?r=" + Math.random(), "action":"stockFetch" }; WISE.apps.traffic = { "id":"traffic", "regex":/.*(?:traffic )(.+)/i, //"param":1, "url":"wise/apps/wise_traffic.js?r=" + Math.random(), "action":"trafficFetch" }; WISE.apps.video = { "id":"video", "regex":/.*(?:video )(.+)/i, //"param":1, "url":"wise/apps/wise_video.js?r=" + Math.random(), "action":"videoFetch" }; WISE.apps.graph = { "id":"graph", "name":"Graph", "regex":/(cos\(.*\))|(sin\(.*\))|(tan\(.*\))|(sec.*)|f\(x\)=(.*)/i, //"param":1, "url":"wise/apps/wise_graph.js?r=" + Math.random(), "action":"graphFetch" }; WISE.apps.map = { "id":"map", "name":"Map", "regex":/.*(?:map )(.+)/i, //"param":1, "url":"wise/apps/wise_map.js?r=" + Math.random(), "action":"mapFetch" }; */ WISE.apps.flights = { "name":"Kayak", "logo":"http://www.kayak.com/favicon.ico", "author": "Wikia Search", "description":"Search for flights on kyak.com using airport codes", "categories":[ "Travel" ], "id":"flights", "regex":/.*([a-z]{3})(?: to )([a-z]{3}).*/i, "multimatch":new Array(1,2), "url":"wise/apps/wise_flights.js?r=" + Math.random(), "action":"flightsFetch" }; /* WISE.apps.heidy = { "id":"heidy", "regex":/.*(heidy).* /i, "url":"wise/apps/wise_heidy.js?r=" + Math.random(), "action":"heidyFetch" }; */ WISE.apps.digg = { "name":"Digg", "logo":"http://www.digg.com/favicon.ico", "author": "Wikia Search", "description":"Searches Digg.com for stories promoted within the last three days", "categories":[ "News", "Blogging" ], "id":"digg", "regex":/((?:(?:digg )(.+))|((.+)(?: digg)))/i, "app_blacklist":[ "weather" ], "othermatch":{"type":"numwords","value":3, "moreless":"<"}, "url":"wise/apps/wise_digg.js?r=" + Math.random(), "action":"diggFetch" }; /* WISE.apps.php = { "id":"php", "name":"PHP", "regex":/.*(?:php )(.+)/i, "url":"wise/apps/wise_php.js?r=" + Math.random(), "action":"phpFetch" }; */ WISE.apps.lastFM = { "name":"LastFM", "logo":"http://www.lastfm.com/favicon.ico", "author": "Wikia Search", "description":"Get song or artist info from Last.fm", "categories":[ "Music" ], "id":"lastFM", //"regex":/(song|artist)(.*)/i, //"multimatch":new Array(1,2), "othermatch":{"type":"suggest","includeKeyword":true,"keywords":"tour dates;singer;band;discography;albums;songs;song;lyrics;album"}, "url":"wise/apps/wise_lastFM.js?r=" + Math.random(), "action":"lastFMFetch" }; WISE.apps.yelp = { "name":"Yelp", "logo":"http://www.yelp.com/favicon.ico", "author": "Wikia Search", "description":"Search Yelp.com for Restaurant reviews", "categories":[ "Dining" ], "id":"yelp", "regex":/(.* (?:in|near|around|by|close to|at) .*)/i, "categoryTriggers":{"triggers":"food;place","exactMatch":true}, //"regex":/.*(?:yelp )(.+)/i, "url":"wise/apps/wise_yelp.js?r=" + Math.random(), "action":"yelpFetch", "loadCheckDelay":2000 }; /* WISE.apps.whitepages = { "name":"Phone Search", "logo":"http://www.whitepages.com/favicon.ico", "author": "Wikia Search", "description":"Returns related name and address from WhitePages.com based on a phone number.", "id":"whitepages", "regex":/\(?\d{3}\)?[-\s.]?\d{3}[-\s.]?\d{4}/, "url":"wise/apps/wise_whitepages.js?r=" + Math.random(), "action":"whitepagesFetch" }; */ WISE.apps.ebay = { "name":"eBay", "logo":"http://www.ebay.com/favicon.ico", "author": "Wikia Search", "description":"Searches for relevant results from EBay.com.", "categories":[ "Shopping" ], "id":"ebay", "regex":/(.+)(?: (auction|collectibles|memorabilia|merchandise))/i, "url":"wise/apps/wise_ebay.js?r=" + Math.random(), "action":"ebayFetch" }; /* WISE.apps.www = { "id":"www", "regex":/(where .+)|(when .+)|(who .+)|(what .+)/i, "url":"wise/apps/wise_www.js?r=" + Math.random(), "action":"wwwFetch" }; */ /* WISE.apps.twitter = { "categories":[ "Blogging" ], "id":"twitter", "regex":/.*(?:twitter )(.+)/i, "url":"wise/apps/wise_twitter.js?r=" + Math.random(), "action":"twitterFetch" }; */ document.write ("") /* WISE.apps.hexbin = { "id":"hexbin", "regex":/(.* in hex)|(.* in binary)|(.* in decimal)|(.* in octal)/i, "url":"wise/apps/wise_hexbin.js?r=" + Math.random(), "action":"hexbinFetch" }; */ WISE.apps.amazon = { "name":"Amazon", "logo":"http://www.amazon.com/favicon.ico", "author": "Wikia Search", "description":"Returns results from Amazon.com using its developer API.", "categories":[ "Shopping" ], "id":"amazon", "regex": /(?:(.*) (?:amazon|buy|for sale)|(?:amazon|buy|for sale) (.*))/i, //"regex":/(?:amazon )(.+)/i, "othermatch":{"type":"suggest","keywords":"books;book;film;dvd;movie;soundtrack;episodes;episode guide;tv series;board game;video game;sale;prices"}, "url":"wise/apps/wise_amazon.js?r=" + Math.random(), "action":"amazonFetch" }; WISE.apps.snooth = { "name":"Snooth", "logo":"http://media1.snooth.com/images/snoothicon.ico", "author": "Wikia Search", "description":"Returns wine related results from Snooth.com", "categories":[ "Dining" ], "id":"snooth", "regex":/(?:wine )(.+)/i, "othermatch":{"type":"suggest","keywords":"wine;grape;winery;vintage","contains":true}, "categoryTriggers":{"triggers":"wine","exactMatch":true}, "url":"wise/apps/wise_snooth.js?r=" + Math.random(), "action":"snoothFetch" }; /* WISE.apps.compare = { "name":"Search Result Comparison", "author": "Wikia Search", "description":"Compare yahoo, google, and wikia results", "id":"compare", "regex":/(?:compare )(.+)/i, //"regex":/(.*)/i, "url":"wise/apps/wise_compare.js?r=" + Math.random(), "action":"compareFetch" }; */ WISE.apps.meetup = { "name":"Meetup", "logo":"http://www.meetup.com/favicon.ico", "author": "Wikia Search", "description":"Displaying group meetings in your area from Meetup.com", "id":"meetup", //"regex":/(?:meetup )(.+)/i, "regex":/(.*)(?:meetups|meetup|meetings|meeting|groups|group|community|club)(.*)/i, "multimatch":new Array(1,2), "url":"wise/apps/wise_meetup.js?r=" + Math.random(), "action":"meetupFetch" }; WISE.apps.YES = { "name":"YES Radio", "logo":"http://www.yes.com/favicon.ico", "author": "Wikia Search", "description":"Displaying the now-playing information from YES.com", "categories":[ "Music" ], "id":"YES", "regex":/^(\w{4})$/i, "url":"wise/apps/wise_radio.js?r=" + Math.random(), "action":"yesFetch" }; /* WISE.apps.zillowRegionChart = { "id":"zillowDemographics", "multimatch":new Array(1,2), "regex":/.*(?:population )(.+)\s?,\s?([a-z]{2})$/i, "url":"wise/apps/wise_zillowDemographics.js?r=" + Math.random(), "action":"zillowDemographicsFetch" }; WISE.apps.trackUPS = { "name":"UPS", "author": "Wikia Search", "description":"Make shortcut links for tracking UPS packages", "categories":[ "Other" ], "id":"trackUPS", "regex":/^(1Z ?[0-9A-Z]{3} ?[0-9A-Z]{3} ?[0-9A-Z]{2} ?[0-9A-Z]{4} ?[0-9A-Z]{3} ?[0-9A-Z]|[\dT]\d\d\d ?\d\d\d\d ?\d\d\d)$/i, "url":"wise/apps/wise_track_ups.js?r=" + Math.random(), "action":"trackUPS" }; WISE.apps.trackFEDEX = { "name":"FedEx", "logo":"http://www.fedex.com/favicon.ico", "author": "Wikia Search", "description":"Make shortcut links for tracking FedEx packages", "categories":[ "Other" ], "id":"trackFEDEX", "regex":/^(\d\d\d\d ?\d\d\d\d ?\d\d\d\d)$/i, "url":"wise/apps/wise_track_fedex.js?r=" + Math.random(), "action":"trackFEDEX" }; WISE.apps.trackUSPS = { "name":"USPS", "logo":"http://www.digg.com/favicon.ico", "author": "Wikia Search", "description":"Make shortcut links for tracking USPS packages", "categories":[ "Other" ], "id":"trackUSPS", "regex":/^(\d\d\d\d ?\d\d\d\d ?\d\d\d\d ?\d\d\d\d ?\d\d\d\d ?\d\d|\d\d\d\d ?\d\d\d\d ?\d\d\d\d ?\d\d\d\d ?\d\d\d\d)$/i, "url":"wise/apps/wise_track_usps.js?r=" + Math.random(), "action":"trackUSPS" }; WISE.apps.wikipedia = { "id":"wikipedia", "logo":"http://www.wikipedia.com/favicon.ico", "name":"Wikipedia", "regex":/((?:(?:wikipedia )(.+))|((.+)(?: wikipedia)))/i, "categories":[ "Other" ], "url":"wise/apps/wise_wikipedia.js?r=" + Math.random(), "action":"wikipediaFetch" }; WISE.apps.google = { "id":"google", "logo":"http://www.google.com/favicon.ico", "name":"Google", "regex":/((?:(?:google )(.+))|((.+)(?: google)))/i, "categories":[ "Other" ], "url":"wise/apps/wise_google.js?r=" + Math.random(), "action":"googleFetch" }; */ WISE.apps.flickr = { "name":"Creative Commons", "logo":"http://www.creativecommons.org/favicon.ico", "author": "Wikia Search", "description":"Finds creative commons licensed images from Flickr", "categories":[ "Images" ], "id":"flickr", "regex":/(.+)(?: (images|image|pictures|pics|img|jpg|jpeg|photo|photographs|photograph|pic))$/i, "url":"wise/apps/wise_flickr.js?r=" + Math.random(), "action":"getFlickr" }; /* WISE.apps.webtraffic = { "name":"Web Traffic Comparison", "author": "Wikia Search", "description":"Takes two domains as input and returns traffic data for those domains", "categories":[ "Other" ], "id":"webtraffic", "regex":/(\w{1,}\.\w{2,3}) (\w{1,}\.\w{2,3})/i, "multimatch":new Array(1,2), "url":"wise/apps/wise_webtraffic.js?r=" + Math.random(), "action":"getWebTraffic" }; WISE.apps.crunchbase = { "name":"Crunch Base", "logo":"http://www.crunchbase.com/favicon.ico", "author": "Wikia Search", "description":"Searches Techcrunch's Techcrunch for company information", "id":"crunchbase", "regex":/(?:crunchbase )(.+)/i, "categories":[ "Other" ], "gen_obj":{"request": {"url":"http://api.crunchbase.com/v/1/search.js?callback=WISE.generic.processApiResult","search": "query"}, "response": {"size": "3", "containerElement":"results", "titleField": "name", "url": {"field": "crunchbase_url"},"contentFields": [{"prefix": "", "field": "overview", "suffix": "","limit": "350", "type": ""}]}} }; WISE.apps.bossnews={ "id": "bossnews", "logo":"http://www.yahoo.com/favicon.ico", "name": "Yahoo News", "author": "Wikia Search", "description": "News app using Yahoo Boss news service", "regex": /(?:news )(.*)/i, "categories":[ "News" ], "apptitle": "News Results From Yahoo Boss for $1", "appurl": "http://news.search.yahoo.com/news/search?p=$1", "gen_obj": {"request": {"url": "http://boss.yahooapis.com/ysearch/news/v1/$1?appid=GD2UGdfIkY1gi6EBoIck4Exv2xLUsVrm&callback=WISE.generic.processApiResult", "search": "$1"}, "response": {"styles": {"item_style": "padding-bottom:5px; border-bottom:1px solid #DCDCDC;", "last_item_style": "", "image_style": "", "url_style": "text-decoration:none;"}, "size": "3", "rootelement": "ysearchresponse", "containerElement": "resultset_news", "titleField": "title", "url": {"field": "clickurl"}, "contentFields": [{"prefix": "", "field": "abstract", "suffix": "
", "limit": "100", "type": ""}, {"prefix": "source:", "field": "source", "suffix": " | ", "limit": "", "type": ""}, {"prefix": "date: ", "field": "date", "suffix": "", "limit": "", "type": ""}, {"prefix": " ", "field": "time", "suffix": "", "limit": "", "type": ""}]}, "params": {"start": 0}}}; */ WISE.apps.dressme={"id": "dressme", "name": "Please Dress Me T-Shirt search", "logo":"http://pleasedress.me/favicon.ico", "author": "Wikia Search", "description": "Returns t-shirts from pleasedress.me", "regex": /(.*) (?:tshirts|tshirt|t-shirts|t-shirt|t shirts|t shirt|t\'s|tees)/i, "apptitle": "T-Shirt results from pleasedress.me for $1", "appurl": "http://www.pleasedress.me/?q=$1", "gen_obj": {"request": {"url": "http://fp029.sjc.wikia-inc.com/index.php?action=ajax&rs=wfGetGenericXMLtoJSON&rsargs[]=http%3A%2F%2Fpleasedress.me%2Fapi%2F1.0%2Fshirts%2Fsearch.xml%3Fq%3D&rsargs[]=WISE.generic.processApiResult", "search": "rsargs[]"}, "response": {"styles": {"item_style": "width: 130px; float:left;", "last_item_style": "", "image_style": "", "url_style": "text-decoration:none;display:block;width:125px;white-space:nowrap;overflow:hidden;"}, "size": "4", "rootelement": "result", "containerElement": "shirt", "titleField": "@attributes.title", "url": {"field": "@attributes.url"}, "contentFields": [{"prefix": "", "limit": "", "type": ""}, {"prefix": "", "limit": "", "type": ""}]}}, "params": ["tv"]}; /* WISE.apps.youtube={ "categories":[ "Video" ], "id": "youtube", "name": "YouTube", "author": "Wikia Search", "description": "Search Youtube videos and return top 4", "regex":/(?:(.*) (?:youtube)|(?:youtube) (.*))/i, "othermatch":{"type":"suggest","keywords":"youtube;you tube;video;videos"}, "apptitle": "YouTube videos about $1", "appurl": "http://www.youtube.com/results?search_query=$1", "gen_obj": {"request": {"url": "http://ajax.googleapis.com/ajax/services/search/video?v=1.0&callback=WISE.generic.processApiResult", "search": "q", "q_append": " site:youtube.com"}, "response": {"styles": {"item_style": "float:left; width:130px;", "last_item_style": "", "image_style": "", "url_style": "display:block;white-space:nowrap;overflow:hidden;width:125px;"}, "size": "4", "rootelement": "responseData", "containerElement": "results", "titleField": "titleNoFormatting", "url": {"field": "playUrl"}, "contentFields": [{"prefix": "", "limit": "52", "type": ""}, {"prefix": "", "limit": "52", "type": ""}]}}, "params": ["wikia"]}; */ WISE.apps.youtube={ "categories":[ "Video" ], "id": "youtube", "name": "YouTube", "logo":"http://www.youtube.com/favicon.ico", "author": "Wikia Search", "description": "Search videos from YouTube.com and return the top three videos.", "regex":/(?:(.*) (?:youtube)|(?:youtube) (.*))/i, "othermatch":{"type":"suggest","keywords":"youtube;you tube;video;videos"}, "apptitle": "YouTube videos about $1", "appurl": "http://www.youtube.com/results?search_query=$1", "gen_obj": {"request": {"url": "http://ajax.googleapis.com/ajax/services/search/video?v=1.0&callback=WISE.generic.processApiResult", "search": "q", "q_append": " site:youtube.com"}, "response": {"styles": {"item_style": "float:left; width:130px; padding-right:10px;", "last_item_style": "", "image_style": "", "url_style": "display:block;white-space:nowrap;overflow:hidden;width:125px;"}, "size": "3", "rootelement": "responseData", "containerElement": "results", "titleField": "titleNoFormatting", "url": {"field": "url"}, "contentFields": [{"prefix": "", "limit": "", "type": ""}, {"prefix": "", "limit": "", "type": ""}]}}, "params": ["wikia"]} /* WISE.apps.wikirage = { "name":"Wikirage", "author": "Wikia Search", "description":"Kicks off if query is found in top 100 pages in wikirage", "id":"wikirage", "regex":/(.*)/i, "url":"wise/apps/wise_wikirage.js?r=" + Math.random(), "action":"inWikirage", "hideDisplay":true }; */ /* WISE.apps.mlbtraderumors={ "categories":[ "Sports" ], "id": "mlbtraderumors", "name": "MLB Trade Rumors", "author": "Wikia Search", "description": "Returns baseball trade rumors from MLBTradeRumors.com", "regex": /(?:(.*) (?:rumors)|(?:rumors) (.*))/i, "apptitle": "$1 on MLBTradeRumors.com", "appurl": "http://www.mlbtraderumors.com", "gen_obj": {"request": {"url": "http://fp029.sjc.wikia-inc.com/index.php?action=ajax&rs=wfGetGenericXMLtoJSON&rsargs[]=http%3A%2F%2Fwww.google.com%2Fblogsearch_feeds%3Fhl%3D%26num%3D10%26output%3Drss%26q%3D&rsargs[]=WISE.generic.processApiResult", "search": "rsargs[]", "q_append": " site:MLBTraderumors.com"}, "response": {"styles": {"item_style": "", "last_item_style": "", "image_style": "", "url_style": ""}, "size": "3", "rootelement": "rss.channel", "containerElement": "item", "titleField": "title", "url": {"field": "link"}, "contentFields": []}, "params": {"start": 0}} }; */ /* WISE.apps.espn = { "name":"ESPN", "logo":"http://www.espn.com/favicon.ico", "author": "Wikia Search", "description":"Searches espn.com for stories on the search topic", "categories":[ "Sports" ], "id":"espn", "regex":/(?:(.*) (?:espn)|(?:espn) (.*))/i, "url":"wise/apps/wise_espn.js?r=" + Math.random(), "action":"espnFetch" }; */ //WISE.apps.indeed={"id": "indeed", "name": "Indeed.com Job Search", "author": "Wikia Search", "description": "Search for Jobs on Indeed.com", "regex": /(?:(.*) (?:jobs)|(?:jobs) (.*))/i, "apptitle": "Job Search Results from indeed.com for $1", "appurl": "http://www.indeed.com/jobs?q=$1", "gen_obj": {"request": {"url": "http://fp029.sjc.wikia-inc.com/index.php?action=ajax&rs=wfGetGenericXMLtoJSON&rsargs[]=http%3A%2F%2Fapi.indeed.com%2Fads%2Fapisearch%3Fpublisher%3D9710591231404182%26q%3D&rsargs[]=WISE.generic.processApiResult", "search": "rsargs[]"}, "response": {"styles": {"item_style": "", "last_item_style": "", "image_style": "", "url_style": ""}, "size": "3", "rootelement": "response.results", "containerElement": "result", "titleField": "jobtitle", "url": {"field": "url"}, "contentFields": [{"prefix": "", "field": "snippet", "suffix": "
", "limit": "", "type": ""}, {"prefix": "company: ", "field": "company", "suffix": ", ", "limit": "", "type": ""}, {"prefix": "city: ", "field": "city", "suffix": ", ", "limit": "", "type": ""}, {"prefix": "", "field": "state", "suffix": " ", "limit": "", "type": ""}, {"prefix": "", "field": "country", "suffix": "", "limit": "", "type": ""}]}}, "params": ["wikia"]}; WISE.apps.indeed = { "name":"Indeed", "logo":"http://www.indeed.com/favicon.ico", "author": "Wikia Search", "description":"Search for Jobs on Indeed.com", "categories":[ "Jobs" ], "id":"indeed", "regex":/(.*)(?:jobs)(.*)/i, "multimatch":new Array(1,2), "url":"wise/apps/wise_indeed.js?r=" + Math.random(), "action":"indeedFetch" }; /* WISE.apps.coupons={ "id": "coupons", "name": "Coupon Chief", "author": "Wikia Search", "description": "Get coupons from CouponChief.com", "categories":[ "Shopping" ], "regex": /(.*) (?:coupons|coupon)/i, "othermatch":{"type":"suggest","keywords":"coupons;coupon;coupon code"}, "apptitle": "Couponchief results for $1", "appurl": "http://www.couponchief.com/$1", "gen_obj": {"request": {"url": "http://fp029.sjc.wikia-inc.com/index.php?action=ajax&rs=wfGetGenericXMLtoJSON&rsargs[]=http%3A%2F%2Fwww.couponchief.com%2Frss%2F&rsargs[]=WISE.generic.processApiResult", "search": "rsargs[]"}, "response": {"styles": {"item_style": "", "last_item_style": "", "image_style": "", "url_style": ""}, "size": "3", "rootelement": "rss.channel", "containerElement": "item", "titleField": "title", "url": {"field": "link"}, "contentFields": [{"prefix": "", "field": "description", "suffix": "
", "limit": "", "type": ""}, {"prefix": "", "field": "pubDate", "suffix": "", "limit": "", "type": ""}]}}, "params": ["staples"] } */ WISE.apps.acronymfinder = { "name":"Acronym Finder", "logo":"http://www.acronymfinder.com/favicon.ico", "author": "Wikia Search", "description":"Uses the private acronym finder API found at acronymfinder.com", "categories":[ "Other" ], "id":"acronymfinder", "regex":/.*(?:acronym )(.+)/i, "categoryTriggers":{"triggers":"acronym", "exactMatch":true}, "url":"wise/apps/wise_acronym.js?r=" + Math.random(), "action":"acronymFinder" }; WISE.apps.polarrose = { "name":"Polar Rose", "author": "Wikia Search", "description":"Searches PolarRose.com for images.", "categories":[ "Images" ], "id":"polarrose", "regex":/.*(?:polarrose )(.+)/i, "othermatch":{"type":"suggest","keywords":"actor;actress;filmography;celebrity;movies;movie;movie list"}, "url":"wise/apps/wise_polarrose.js?r=" + Math.random(), "action":"polarroseFetch" }; /* WISE.apps.praxeon = { "name":"Praxeon", "logo":"http://www.praxeon.com/favicon.ico", "author": "Wikia Search", "description":"Medical definitions", "categories":[ "Health" ], "id":"praxeon", "regex":/.*(?:praxeon )(.+)/i, "othermatch":{"type":"suggest","keywords":"symptoms;symptom;treatment;diagnosis;virus;vaccine;contagious;infections;infection"}, "url":"wise/apps/wise_praxeon.js?r=" + Math.random(), "action":"praxeonFetch" }; */ /* WISE.apps.seeqpod = { "name":"Seeqpod", "logo":"http://www.seeqpod.com/favicon.ico", "author": "Wikia Search", "description":"Playable Search", "categories":[ "Music" ], "id":"seeqpod", "regex":/.*(?:seeqpod )(.+)/i, "othermatch":{"type":"suggest","keywords":"songs;song;lyrics"}, "url":"wise/apps/wise_seeqpod.js?r=" + Math.random(), "action":"seeqpodFetch" }; */ WISE.apps.reuters = { "name":"Reuters", "logo":"http://www.reuters.com/resources/images/favicon.ico", "author": "Wikia Search", "description":"Financial News From Reuters", "categories":[ "News" ], "id":"reuters", //"regex":/.*(?:reuters )(.+)/i, "regex":/(?:(.*) (?:reuters|news)|(?:reuters|news) (.*))/i, "categoryTriggers":{"triggers":"company|stock symbol", "exactMatch":true}, "url":"wise/apps/wise_reuters.js?r=" + Math.random(), "action":"reutersFetch" }; /* WISE.apps.imdb = { "name":"IMDb", "author": "Wikia Search", "description":"IMDb", "categories":[ "Movies", "Entertainment", "Television" ], "id":"imdb", "regex":/(?:(.*) (?:imdb)|(?:imdb) (.*))/i, "othermatch":{"type":"suggest","keywords":"imdb;movie;soundtrack;actor;actress;filmography;film;episodes;episode guide"}, "url":"wise/apps/wise_imdb.js?r=" + Math.random(), "action":"imdbFetch" }; */ WISE.apps.washingtonpost = { "name":"Washington Post", "logo":"http://www.washingtonpost.com/favicon.ico", "author": "Wikia Search", "description":"Searches for recent articles from the Washington Post", "categories":[ "News" ], "id":"washingtonpost", "regex":/(.*)/i, //"othermatch":{"type":"suggest","keywords":"songs;song;lyrics"}, "url":"wise/apps/wise_washingtonpost.js?r=" + Math.random(), "action":"washPostFetch" }; /* WISE.apps.tvguide = { "name":"TVGuide", "logo":"http://www.tvguide.com/favicon.ico", "author": "Wikia Search", "description":"Returns exclusive information and links about Television Shows directly from TVGuide", "categories":[ "Entertainment", "Television", "Celebrity" ], "id":"tvguide", "regex":/.*(?:tvguide )(.+)/i, //"othermatch":{"type":"suggest","keywords":"songs;song;lyrics"}, "url":"wise/apps/wise_tvguide.js?r=" + Math.random(), "action":"tvguideFetch" }; */ /* WISE.apps.nflwidget = { "name":"NFL.com Widget", "author": "Wikia Search", "description":"Returns a simple flash widget from NFL.com", "categories":[ "Sports" ], "id":"nflwidget", "regex":/.*(?:nfl|nfl standings|nfl games|nfl fantasy)/i, //"othermatch":{"type":"suggest","keywords":"songs;song;lyrics"}, "url":"wise/apps/wise_nflwidget.js?r=" + Math.random(), "action":"nflwidgetFetch" }; */ /* WISE.apps.nhlteams = { "name":"NHL.com Team Widget", "author": "Wikia Search", "description":"Returns a simple flash widget from NHL.com", "categories":[ "Sports" ], "id":"nhlteams", "regex":/.*(?:new jersey devils)/i, //"othermatch":{"type":"suggest","keywords":"songs;song;lyrics"}, "url":"wise/apps/wise_nhlwidget.js?r=" + Math.random(), "action":"nhlwidgetFetch" }; */ /* WISE.apps.nbaplayers = { "name":"NBA", "author": "Wikia Search", "description":"Returns a simple flash widget from NBA.com", "categories":[ "Sports" ], "id":"nbaplayers", "regex":/.*(?:nba )(.+)/i, //"othermatch":{"type":"suggest","keywords":"songs;song;lyrics"}, "url":"wise/apps/wise_nbaplayers.js?r=" + Math.random(), "action":"nbaplayerFetch" }; */ WISE.apps.amiestreet = { "name":"Amie Street", "logo":"http://amiestreet.com/favicon.ico", "author": "Wikia Search", "description":"Returns data from AmieStreet API [http://www.amiestreet.com]", "categories":[ "Music" ], "id":"amiestreet", "regex":/.*(?:amiestreet )(.+)/i, "othermatch":{"type":"suggest","includeKeyword":true,"keywords":"tour dates;singer;band;discography;albums;songs;song;lyrics;album"}, "categoryTriggers":{"triggers":"indie artist","exactMatch":true}, "url":"wise/apps/wise_amiestreet.js?r=" + Math.random(), "action":"amiestreetFetch" }; WISE.apps.miniarticle = { "name":"Mini Article", "author": "Wikia Search", "description":"Returns wiki page content for Mini: Articles", "categories":[ "Other" ], "id":"miniarticle", "regex":/.*(?:mini )(.+)/i, "url":"wise/apps/wise_miniarticle.js?r=" + Math.random(), "action":"miniarticleFetch" }; WISE.apps.crunchbasesearch = { "name":"Crunchbase Search", "author": "Wikia Search", "logo":"http://www.crunchbase.com/images/cb_favicon.png", "description":"Returns information on tech companies/products/people from Crunchbase", "categories":[ "Other","Tech" ], "id":"crunchbasesearch", "regex":/(?:(.*) (?:crunchbase)|(?:crunchbase) (.*))/i, "url":"wise/apps/wise_crunchbase.js?r=" + Math.random(), "action":"crunchbaseFetch" }; WISE.apps.crunchbasecompany = { "name":"CrunchBase Company", "author": "Wikia Search", "logo":"http://www.crunchbase.com/images/cb_favicon.png", "description":"Returns information on tech companies from Crunchbase", "categories":[ "Other","Tech" ], "id":"crunchbasecompany", "regex":/.*(?:company )(.+)/i, "categoryTriggers":{"triggers":"tech company","exactMatch":true}, "url":"wise/apps/wise_crunchbase_company.js?r=" + Math.random(), "action":"crunchbaseFetch" }; WISE.apps.crunchbasepeople = { "name":"CrunchBase People", "author": "Wikia Search", "logo":"http://www.crunchbase.com/images/cb_favicon.png", "description":"Returns information on tech people from Crunchbase", "categories":[ "Other","Tech" ], "id":"crunchbasepeople", "regex":/.*(?:techpeople )(.+)/i, "categoryTriggers":{"triggers":"tech people","exactMatch":true}, "url":"wise/apps/wise_crunchbase_people.js?r=" + Math.random(), "action":"crunchbaseFetch" }; /* WISE.apps.torrents={ "id": "torrents", "name": "Torrents", "author": "Wikia Search", "description": "searches torrent sites", "regex": /(.+)(?:torrent|torrents)/i, "url":"wise/apps/wise_torrents.js?r=" + Math.random(), "action":"torrentsFetch" }; WISE.apps.distance = { "name":"Distance Calculator", "author": "Wikia Search", "description":"Calculate the distance between two places.", "categories":[ "Other" ], "id":"distance", "regex":/(?:distance from )(.*)(?: to )(.*)/i, "multimatch":new Array(1,2), "url":"wise/apps/wise_distance.js?r=" + Math.random(), "action":"distanceFetch", "loadCheckDelay":2000 }; WISE.apps.patent = { "name":"Google Patents", "author": "maxwell", "description":"finds groovy patents from google", "categories":[ "Other" ], "id":"patent", "regex":/.*(?:patent|patents )(.+)/i, "othermatch":{"type":"suggest","keywords":"patent;patents;invention;made"}, "url":"wise/apps/wise_patent.js?r=" + Math.random(), "action":"patentFetch" }; WISE.apps.answers = { "name":"Yahoo Answers!", "author": "maxwell", "description":"Search Yahoo! Answers for answers to your questions. Powered By Yahoo! Answers", "categories":[ "Other" ], "id":"answers", "regex":/.*(?:answer|answers )(.+)/i, "othermatch":{"type":"suggest","keywords":"question;answer;where;what;when;how;why;"}, "url":"wise/apps/wise_answers.js?r=" + Math.random(), "action":"answersFetch" }; */ WISE.apps.dlewisnet={ "categories":[ "Blogs" ], "id": "dlewisnet", "name": "DLewis.net", "author": "Dan Lewis, User:DNL on Wikia Search", "description": "Returns blog posts from www.dlewis.net", "regex": /(?:(.*) (?:dlewisnet|dlewis|dan lewis)|(?:dlewisnet|dlewis|dan lewis) (.*))/i, "apptitle": "Posts about $1 on DLewis.net", "appurl": "http://www.dlewis.net", "gen_obj": {"request": {"url": "http://ajax.googleapis.com/ajax/services/search/blogs?v=1.0&callback=WISE.generic.processApiResult", "search": "q", "q_append": " site:dlewis.net"}, "response": {"styles": {"item_style": "", "last_item_style": "", "image_style": "", "url_style": ""}, "size": "3", "rootelement": "responseData", "containerElement": "results", "titleField": "titleNoFormatting", "url": {"field": "postUrl"}, "contentFields": [{"prefix": "", "field": "content", "suffix": "", "limit": "100", "type": ""}]}} }; WISE.apps.baseballmusings ={ "categories":[ "Blogs" ], "id": "baseballmusings", "name": "Baseball Musings", "author": " Dan Lewis, User:DNL on Wikia Search", "description": " Returns blog posts from www.baseballmusings.com", "regex": /(?:(.*) (?: baseballmusings|baseball musings|david pinto )|(?: baseballmusings|baseball musings|david pinto ) (.*))/i, "apptitle": "Posts about $1 on Baseball Musings", "appurl": " http://www.baseballmusings.com ", "gen_obj": {"request": {"url": "http://ajax.googleapis.com/ajax/services/search/blogs?v=1.0&callback=WISE.generic.processApiResult", "search": "q", "q_append": " site:baseballmusings.com"}, "response": {"styles": {"item_style": "", "last_item_style": "", "image_style": "", "url_style": ""}, "size": "3", "rootelement": "responseData", "containerElement": "results", "titleField": "titleNoFormatting", "url": {"field": "postUrl"}, "contentFields": [{"prefix": "", "field": "content", "suffix": "", "limit": "100", "type": ""}]}} }; WISE.apps.sportsagentblog = { "categories":[ "Blogs" ], "id": "sportsagentblog", "name": "SportsAgentBlog.com", "author": "Darren Heitner", "description": "A place for current and aspiring Sports Agents to keep abreast of the latest Sports business/law/agent news.", "regex": /(?:(.*) (?:sports agent|sports agent internships|darren heitner )|(?:sportsvagent|sports agent internships|darren heitner ) (.*))/i, "apptitle": "Posts about $1 on SportsAgentBlog.com", "appurl": "http://www.sportsagentblog.com", "gen_obj": {"request": {"url": "http://ajax.googleapis.com/ajax/services/search/blogs?v=1.0&callback=WISE.generic.processApiResult", "search": "q", "q_append": " site:SportsAgentBlog.com "}, "response": {"styles": {"item_style": "", "last_item_style": "", "image_style": "", "url_style": ""}, "size": "3", "rootelement": "responseData", "containerElement": "results", "titleField": "titleNoFormatting", "url": {"field": "postUrl"}, "contentFields": [{"prefix": "", "field": "content", "suffix": "", "limit": "100", "type": ""}]}}}; WISE.apps.archive= { "name":"Archive.org Wayback Machine", "logo":"http://archive.org/favicon.ico", "author": "Markie", "description":"Historical views of websites from the Archive.org Wayback Machine", "categories":[ "Other" ], "id":"archive", "regex":/(http.*)|(www.*)|(?:archive (?:(.*\.[a-z]{2,3}) )|(.*\.[a-z]{2,3}$))|(?:(.*\.[a-z]{2,3}) )|(.*\.[a-z]{2,3}$)/i, "appurl":"http://web.archive.org/web/*/$1", "apptitle":"Internet Archive Results for $1", "appsummary":"Historical page views of $1 from Archive.org", "urlreplace":{"lowercase":true,"spacechar":"+"} }; WISE.apps.BBC= { "name":"BBC", "logo":"http://bbc.co.uk/favicon.ico", "author": "Markie", "description":"Search results from BBC.co.uk", "categories":[ "News", "Other" ], "id":"BBC", "regex":/(?:bbc )(.+)|(.+)(?: bbc)/i, "appurl":"http://search.bbc.co.uk/search?q=$1", "apptitle":" Results from BBC.co.uk for $1", "appsummary":"Search results for $1 from BBC.co.uk", "urlreplace":{"lowercase":true,"spacechar":"+"} }; WISE.apps.wordpress= { "name":"Wordpress", "logo":"http://wordpress.com/favicon.ico", "author": "Markie", "description":"Blog posts from Wordpress.com", "categories":[ "Blogs", "Other" ], "id":"wordpress", "regex":/(?:wordpress|blog )(.+)|(.+)(?: wordpress|blog)/i, "appurl":"http://en.search.wordpress.com/?q=$1", "apptitle":" Blog posts from Wordpress.com for $1", "appsummary":"Blog posts for $1 from Wordpress.com", "urlreplace":{"lowercase":true,"spacechar":"+"} }; WISE.apps.alexa= { "name":"Alexa", "logo":"http://alexa.com/favicon.ico", "author": "Markie", "description":"Traffic ranking from Alexa.com", "categories":[ "Tech", "Other" ], "id":"alexa", "regex":/(http.*)|(www.*)|(?:alexa(?:(.*\.[a-z]{2,3}) )|(.*\.[a-z]{2,3}$))|(?:(.*\.[a-z]{2,3}) )|(.*\.[a-z]{2,3}$)/i, "appurl":"http://www.alexa.com/data/details/traffic_details/$1", "apptitle":"Traffic rankings from Alexa.com for $1", "appsummary":"Traffic ranking for $1 from Alexa.com", "urlreplace":{"lowercase":true,"spacechar":"+"} }; WISE.apps.openstreetmap= { "name":"Open Street Map", "logo":"http://openstreetmap.org/favicon.ico", "author": "Markie", "description":"Geographical information from OpenStreetMap.org", "categories":[ "Travel", "Other" ], "id":"openstreetmap", "regex":/(?:map |location )(.+)|(.+)(?: map| location)/i, "appurl":"http://gazetteer.openstreetmap.org/namefinder/?find=$1", "apptitle":"Geographical data from OpenStreetMap.org for $1", "appsummary":"Geographical data for $1 from OpenStreetMap.org", "urlreplace":{"lowercase":true,"spacechar":"+"} }; /* WISE.apps.nhlscoreboard = { "name":"NHL.com Team Scoreboard", "logo":"http://www.nhl.com/favicon.ico", "author": "David Pean", "description":"Returns a score or next game for NHL teams from NHL.com", "categories":[ "Sports" ], "id":"nhlscoreboard", "regex":/.*(?:new jersey devils)/i, "othermatch":{"type":"suggest","keywords":"hockey"}, "url":"wise/apps/wise_nhlscoreboard.js?r=" + Math.random(), "action":"nhlFetch" }; */ WISE.apps.netflix = { "name":"Netflix", "author": "Wikia Search", "description":"Results from a search on Netflix", "logo":"http://cdn-0.nflximg.com/us/icons/nficon.ico", "categories":[ "Movies", "Entertainment", "Television" ], "id":"netflix", "regex":/(?:(.*) (?:netflix|dvd)|(?:netflix|dvd) (.*))/i, "othermatch":{"type":"suggest","keywords":"imdb;movie;soundtrack;actor;actress;filmography;film;episodes;episode guide"}, "url":"wise/apps/wise_netflix.js?r=" + Math.random(), "action":"netflixFetch" }; WISE.apps.blip= { "name":"Blip", "logo":"http://static1.blip.pl/favicon.gif", "author": "Maciej 'macbre' Brencz", "description":"Ostatnie wpisy na blipie", "categories":[ "Blogs", "Other" ], "id":"blip", "regex":/(?:blip )(.+)|(.+)(?: blip)/i, "url":"wise/apps/wise_blip.js?r=" + Math.random(), "action":"blipFetch" }; WISE.apps.dev= { "name":"For developers", "logo": "http://www.gnu.org/favicon.ico", "author": "Maciej 'macbre' Brencz", "description":"Quick access to PHP, C, JS, RFC references", "categories":[ "Other" ], "id":"dev", "regex":/(rfc|c|cpp|php|css|js|man)(.*)/i, "url":"wise/apps/wise_dev.js?r=" + Math.random(), "action":"devFetch" };