Ubiquity: Difference between revisions

From AniDB
Jump to navigation Jump to search
(New page: * http://labs.mozilla.com/2008/08/introducing-ubiquity/ CmdUtils.CreateCommand({ name: "anidb", icon: "http://static.anidb.net/favicon.ico", author: { name: "belgabor" }, ...)
 
m (add current links)
 
Line 1: Line 1:
* http://labs.mozilla.com/2008/08/introducing-ubiquity/
* https://wiki.mozilla.org/Labs/Ubiquity
 
* https://gchristensen.github.io/ubiquitywe/ / https://github.com/GChristensen/ubiquitywe
   CmdUtils.CreateCommand({
   CmdUtils.CreateCommand({
     name: "anidb",
     name: "anidb",

Latest revision as of 20:39, 27 January 2021

 CmdUtils.CreateCommand({
   name: "anidb",
   icon: "http://static.anidb.net/favicon.ico",
   author: { name: "belgabor" },
   license: "GPL",
   description: "Search anidb.net for animes, groups, producers, users or in your mylist.",
   help: "Type 'anidb (searchtopic) [in (animes, groups, producers, users or mylist)].",
   takes: {"input": noun_arb_text},
   modifiers:{"in": new CmdUtils.NounType("search-category",["Anime","Groups","Producers","Users","MyList"])},
   preview: function( pblock, input ) {
     pblock.innerHTML = "Search AniDB.net";
   },
   execute: function(directObj, modifiers) {
     var dblist = "animelist";
     var topic = directObj.text;
     if (modifiers.in && modifiers.in.text) {
       var cat = modifiers.in.text.toLowerCase();
       switch (cat) {
         case 'groups':
           dblist = "grouplist";
           break;
         case 'producers':
           dblist = "producerlist";
           break;
         case 'users':
           dblist = "userlist";
           break;
         case 'mylist':
           dblist = "mylist";
           break;
       }
     }
     var params = Utils.paramsToString({
       "do.search": "search",
       "adb.search": topic,
       "show": dblist
     });
     var url='http://anidb.net/perl-bin/animedb.pl' + params;
     Utils.openUrlInBrowser(url);
   }
 });