-
-
Save cgardner/95883 to your computer and use it in GitHub Desktop.
Revisions
-
cgardner revised this gist
Apr 15, 2009 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ CmdUtils.CreateCommand( takes: {"function": noun_arb_text}, icon: "http://drupal.org/misc/favicon.ico", homepage: "http://craig-gardner.com", author: {name: "Craig Gardner", email: "craig.s.gardner@gmail.com"}, license: "MPL,GPL", description: "Quickly access Drpual modules", help: "Enter the name of a Drupal module", -
cgardner revised this gist
Apr 15, 2009 . 1 changed file with 28 additions and 28 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,29 +1,29 @@ CmdUtils.CreateCommand( { name: "drupal-module", takes: {"function": noun_arb_text}, icon: "http://drupal.org/misc/favicon.ico", homepage: "http://craig-gardner.com", author: {name: "Craig Gardner", email: "cgardner@goodpacket"}, license: "MPL,GPL", description: "Quickly access Drpual modules", help: "Enter the name of a Drupal module", execute: function(directObject) { var url = "http://drupal.org/project/{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 = "Find a Drupal Project"; return; } var previewTemplate = "Load the ${query} Drupal module"; var previewData = {query: searchText}; pblock.innerHTML = CmdUtils.renderTemplate(previewTemplate, previewData); } }); -
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ CmdUtils.CreateCommand( { name: "drupal-module", takes: {"function": noun_arb_text}, icon: "http://drupal.org/misc/favicon.ico", homepage: "http://craig-gardner.com", author: {name: "Craig Gardner", email: "cgardner@goodpacket"}, license: "MPL,GPL", description: "Quickly access Drpual modules", help: "Enter the name of a Drupal module", execute: function(directObject) { var url = "http://drupal.org/project/{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 = "Find a Drupal Project"; return; } var previewTemplate = "Load the ${query} Drupal module"; var previewData = {query: searchText}; pblock.innerHTML = CmdUtils.renderTemplate(previewTemplate, previewData); } });