Skip to content

Instantly share code, notes, and snippets.

/x
Created Jan 8, 2009

Embed
What would you like to do?
CmdUtils.CreateCommand({
name: "postgres",
takes: {"text": noun_arb_text},
homepage: "http://newmedia.nl/",
icon: "http://www.postgresql.org/search/favicon.ico",
author: { name: "Stefan Verstege", email: "stefan.verstege@newmedia.nl"},
description: "Search all Postgres Documentation",
help: "Select some text to search the postgres documentation",
execute: function(directObject){
var url = "http://search.postgresql.org/search?a=1&submit=Search&q={QUERY}";
var urlString = url.replace("{QUERY}", directObject.text);
Utils.openUrlInBrowser(urlString);
},
preview: function(pblock, directObject) {
searchText = jQuery.trim(directObject.text);
if(searchText.length <= 0){
pblock.innerHTML = "Search all Postgres Documentation";
return;
}
var previewTemplate = "Search all postgres documentation for ${query}";
var previewData = {query: searchText};
pblock.innerHTML = CmdUtils.renderTemplate(previewTemplate, previewData);
}
});
CmdUtils.CreateCommand({
name: "postgres83",
takes: {"text": noun_arb_text},
homepage: "http://newmedia.nl/",
icon: "http://www.postgresql.org/search/favicon.ico",
author: { name: "Stefan Verstege", email: "stefan.verstege@newmedia.nl"},
description: "Search Postgres 8.3 Documentation",
help: "Select some text to search the postgres 8.3 documentation",
execute: function(directObject){
var url = "http://search.postgresql.org/search?u=/docs/8.3/interactive/&q={QUERY}";
var urlString = url.replace("{QUERY}", directObject.text);
Utils.openUrlInBrowser(urlString);
},
preview: function(pblock, directObject) {
searchText = jQuery.trim(directObject.text);
if(searchText.length <= 0){
pblock.innerHTML = "Search Postgres 8.3 Documentation";
return;
}
var previewTemplate = "Search postgres 8.3 documentation for ${query}";
var previewData = {query: searchText};
pblock.innerHTML = CmdUtils.renderTemplate(previewTemplate, previewData);
}
});
CmdUtils.CreateCommand({
name: "postgres82",
takes: {"text": noun_arb_text},
homepage: "http://newmedia.nl/",
icon: "http://www.postgresql.org/search/favicon.ico",
author: { name: "Stefan Verstege", email: "stefan.verstege@newmedia.nl"},
description: "Search All Postgres Documentation",
help: "Select some text to search the postgres 8.2 documentation",
execute: function(directObject){
var url = "http://search.postgresql.org/search?u=/docs/8.2/interactive/&q={QUERY}";
var urlString = url.replace("{QUERY}", directObject.text);
Utils.openUrlInBrowser(urlString);
},
preview: function(pblock, directObject) {
searchText = jQuery.trim(directObject.text);
if(searchText.length <= 0){
pblock.innerHTML = "Search Postgres 8.2 Documentation";
return;
}
var previewTemplate = "Search postgres 8.2 documentation for ${query}";
var previewData = {query: searchText};
pblock.innerHTML = CmdUtils.renderTemplate(previewTemplate, previewData);
}
});
CmdUtils.CreateCommand({
name: "postgres81",
takes: {"text": noun_arb_text},
homepage: "http://newmedia.nl/",
icon: "http://www.postgresql.org/search/favicon.ico",
author: { name: "Stefan Verstege", email: "stefan.verstege@newmedia.nl"},
description: "Search All Postgres Documentation",
help: "Select some text to search the postgres 8.1 documentation",
execute: function(directObject){
var url = "http://search.postgresql.org/search?u=/docs/8.1/interactive/&q={QUERY}";
var urlString = url.replace("{QUERY}", directObject.text);
Utils.openUrlInBrowser(urlString);
},
preview: function(pblock, directObject) {
searchText = jQuery.trim(directObject.text);
if(searchText.length <= 0){
pblock.innerHTML = "Search Postgres 8.1 Documentation";
return;
}
var previewTemplate = "Search postgres 8.1 documentation for ${query}";
var previewData = {query: searchText};
pblock.innerHTML = CmdUtils.renderTemplate(previewTemplate, previewData);
}
});
CmdUtils.CreateCommand({
name: "postgres80",
takes: {"text": noun_arb_text},
homepage: "http://newmedia.nl/",
icon: "http://www.postgresql.org/search/favicon.ico",
author: { name: "Stefan Verstege", email: "stefan.verstege@newmedia.nl"},
description: "Search All Postgres Documentation",
help: "Select some text to search the postgres 8.0 documentation",
execute: function(directObject){
var url = "http://search.postgresql.org/search?u=/docs/8.0/interactive/&q={QUERY}";
var urlString = url.replace("{QUERY}", directObject.text);
Utils.openUrlInBrowser(urlString);
},
preview: function(pblock, directObject) {
searchText = jQuery.trim(directObject.text);
if(searchText.length <= 0){
pblock.innerHTML = "Search Postgres 8.0 Documentation";
return;
}
var previewTemplate = "Search postgres 8.0 documentation for ${query}";
var previewData = {query: searchText};
pblock.innerHTML = CmdUtils.renderTemplate(previewTemplate, previewData);
}
});
CmdUtils.CreateCommand({
name: "postgres74",
takes: {"text": noun_arb_text},
homepage: "http://newmedia.nl/",
icon: "http://www.postgresql.org/search/favicon.ico",
author: { name: "Stefan Verstege", email: "stefan.verstege@newmedia.nl"},
description: "Search All Postgres Documentation",
help: "Select some text to search the postgres 7.4 documentation",
execute: function(directObject){
var url = "http://search.postgresql.org/search?u=docs/7.4/interactive/&q={QUERY}";
var urlString = url.replace("{QUERY}", directObject.text);
Utils.openUrlInBrowser(urlString);
},
preview: function(pblock, directObject) {
searchText = jQuery.trim(directObject.text);
if(searchText.length <= 0){
pblock.innerHTML = "Search Postgres 7.4 Documentation";
return;
}
var previewTemplate = "Search postgres 7.4 documentation for ${query}";
var previewData = {query: searchText};
pblock.innerHTML = CmdUtils.renderTemplate(previewTemplate, previewData);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.