Changes

Jump to: navigation, search

Learning Collaborative Development Lab Fall 2008 Results

1,506 bytes added, 00:01, 12 September 2008
no edit summary
}
})
 
====Cuil Search====
[[User:cdpatel1|Chinmay Patel]]
<br />
Cuil is the new sensation in the search market. Cuil is the search engine for the future. That's why I have just implemented the search for CUIL. This is so simple but I'll try to make it better, efficient and useful.
The code is totally based on Zed's code(except only one line). It has just better Documentation.
 
CmdUtils.CreateCommand({
 
// Name of the Command
name: "cuil",
 
// Homepage
homepage: "http://zenit.senecac.on.ca/wiki/index.php/User:Cdpatel1",
 
// Author
author: { name: "Chinmay Patel", email: "cdpatel1@learn.senecac.on.ca"},
 
// Contributors
contributors: ["Chinmay Patel"],
 
// License
license: "Open For ALL ... any time ... any where ... in all conditions",
// Input from selection
takes: {"search zenit/wiki term": noun_arb_text},
 
/* Preview of the Command */
preview: function( previewBlock, searchQuery ) {
 
// HTML part for the preview block
previewBlock.innerHTML = "Search for" + searchQuery.text;
 
},
 
/* Execute Function*/
execute: function( searchQuery ) {
 
// Searching URL from cuil website. I just copied this URL from a search in CUIL
var url = "http://www.cuil.com/search?q={QUERY}"
 
// Putting our serching term in a variable
var query = searchQuery.text;
 
// replacing {QUERY} with the search terms
var urlString = url.replace("{QUERY}", query);
 
// When press enter, open new window with URL of urlString.
Utils.openUrlInBrowser(urlString);
}
})
 
----
1
edit

Navigation menu