Permalink
Browse files

added filetypes

  • Loading branch information...
1 parent 10a18a3 commit 8083f3e2e310101d172970b01d3a3c8a3cd8a175 @mikedeboer mikedeboer committed Nov 17, 2011
Showing with 16 additions and 9 deletions.
  1. +8 −8 client/ext/searchinfiles/searchinfiles.js
  2. +8 −1 client/ext/searchinfiles/searchinfiles.xml
@@ -118,7 +118,7 @@ module.exports = ext.register("ext/searchinfiles/searchinfiles", {
toggleDialog: function(isReplace, forceShow) {
ext.initExtension(this);
- if (apf.isWin && (location.host.indexOf('localhost') > -1 || location.host.indexOf('127.0.0.1') > -1)) {
+ if (apf.isWin && (location.host.indexOf("localhost") > -1 || location.host.indexOf("127.0.0.1") > -1)) {
return util.alert("Search in Files", "Not Supported",
"I'm sorry, searching through files is not yet supported on the Windows platform.");
}
@@ -140,7 +140,7 @@ module.exports = ext.register("ext/searchinfiles/searchinfiles", {
},
onHide : function() {
- var editor = require('ext/editors/editors').currentEditor;
+ var editor = editors.currentEditor;
if (editor && editor.ceEditor)
editor.ceEditor.focus();
},
@@ -160,12 +160,12 @@ module.exports = ext.register("ext/searchinfiles/searchinfiles", {
},
getOptions: function() {
- var matchCase = '0';
+ var matchCase = "0";
if (chkSFMatchCase.checked)
- matchCase = '1';
- var regex = '0';
+ matchCase = "1";
+ var regex = "0";
if (chkSFRegEx.checked)
- regex = '1';
+ regex = "1";
return {
query: txtSFFind.value,
pattern: ddSFPatterns.value,
@@ -196,13 +196,13 @@ module.exports = ext.register("ext/searchinfiles/searchinfiles", {
? trFiles.xmlRoot.selectSingleNode("folder[1]")
: this.getSelectedTreeNode();
- var findValueSanitized = txtSFFind.value.trim().replace(/([\[\]\{\}])/g, '\\$1');
+ var findValueSanitized = txtSFFind.value.trim().replace(/([\[\]\{\}])/g, "\\$1");
_self.$model.clear();
trSFResult.setAttribute("empty-message", "Searching for '" + findValueSanitized + "'...");
davProject.report(node.getAttribute("path"), "codesearch", this.getOptions(), function(data, state, extra){
if (state !== apf.SUCCESS)
return;
- if (data.getAttribute("count") == "0")
+ if (!parseInt(data.getAttribute("count"), 10))
trSFResult.setAttribute("empty-message", "No results found for '" + findValueSanitized + "'");
else
_self.$model.load(data);
@@ -25,19 +25,24 @@
<a:item value="asm">Assembler files</a:item>
<a:item value="batch">Batch files</a:item>
<a:item value="cc">C files</a:item>
+ <a:item value="clojure">Clojure files</a:item>
<a:item value="cfmx">Coldfusion files</a:item>
+ <a:item value="coffee">Coffeescript files</a:item>
<a:item value="cpp">C++ files</a:item>
<a:item value="csharp">C# files</a:item>
<a:item value="css">CSS files</a:item>
<a:item value="elisp">ELisp files</a:item>
<a:item value="erlang">Erlang files</a:item>
<a:item value="fortran">Fortran files</a:item>
+ <a:item value="groovy">Groovy files</a:item>
<a:item value="haskell">Haskell files</a:item>
<a:item value="hh">Header files</a:item>
<a:item value="html">HTML files</a:item>
<a:item value="java">Java files</a:item>
<a:item value="js">Javascript files</a:item>
+ <a:item value="json">JSON files</a:item>
<a:item value="jsp">JSP files</a:item>
+ <a:item value="latex">Latex files</a:item>
<a:item value="lisp">Lisp files</a:item>
<a:item value="lua">Lua files</a:item>
<a:item value="make">Make files</a:item>
@@ -49,6 +54,7 @@
<a:item value="perl">Perl files</a:item>
<a:item value="php">PHP files</a:item>
<a:item value="plone">Plone files</a:item>
+ <a:item value="powershell">Powershell files</a:item>
<a:item value="python">Python files</a:item>
<a:item value="rake">Rake files</a:item>
<a:item value="ruby">Ruby files</a:item>
@@ -60,6 +66,7 @@
<a:item value="tcl">TCL files</a:item>
<a:item value="tex">Tex files</a:item>
<a:item value="text">Text files</a:item>
+ <a:item value="textile">Textile files</a:item>
<a:item value="tt">TT files</a:item>
<a:item value="vb">Visual Basic files</a:item>
<a:item value="vim">Vim files</a:item>
@@ -102,7 +109,7 @@
style = "position:absolute;top:0;left:0;bottom:0;right:17px;"
autoselect = "false">
<a:model />
- <a:caption match="[d:querydetail]">Search results for '[@query]'</a:caption>
+ <a:caption match="[d:querydetail]">Search results for '{apf.htmlentities([@query])}'</a:caption>
<a:caption match="[d:maxreached]">Your search yielded too many results. The first hits are listed below:</a:caption>
<a:caption match="[d:response]">[@path] (#[d:excerpt])</a:caption>
<a:caption match="[d:excerpt]"><div class="linenumber">[@line]</div><pre class="excerpt">{apf.htmlentities([text()])}</pre></a:caption>

0 comments on commit 8083f3e

Please sign in to comment.