Skip to content

Commit

Permalink
added startup logo to cloud9.js, fixed searchinfiles and its hotkey
Browse files Browse the repository at this point in the history
  • Loading branch information
mikedeboer committed Oct 15, 2010
1 parent 30094c2 commit 57d4f2a
Show file tree
Hide file tree
Showing 10 changed files with 87 additions and 40 deletions.
41 changes: 32 additions & 9 deletions bin/cloud9.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
* @copyright 2010, Ajax.org B.V.
* @license GPLv3 <http://www.gnu.org/licenses/gpl.txt>
*/
var Sys = require("sys");

function usage() {
console.log("USAGE: cloud9 [-w WORKSPACE_DIR ('.')] [-l LISTEN_IP ('127.0.0.1')] [-p PORT (3000)]");
Sys.puts("USAGE: cloud9 [-w WORKSPACE_DIR ('.')] [-l LISTEN_IP ('127.0.0.1')] [-p PORT (3000)]");
process.exit(0);
}

Expand Down Expand Up @@ -55,20 +56,42 @@ function parseArguments(argv) {


if (parseInt(process.version.split(".")[1]) < 2) {
console.log("ERROR: Cloud9 IDE requires node version 0.2.x but you use " + process.version);
Sys.puts("ERROR: Cloud9 IDE requires node version 0.2.x but you use " + process.version);
return;
}

var options = parseArguments(process.argv.slice(2));

require("../server/lib/cloud9").main(options.workspace, options.port, options.ip);
console.log("ajax.org Cloud9 IDE");
console.log("Project root is: " + options.workspace);
var url = "http://" + options.ip + ":" + options.port;

Sys.puts("\n\n . ..__%|iiiiiii=>,..\n\
_<iIIviiiiiiiiiillli<_.\n\
.ivIvilli%||+++++|iillllvs;_\n\
..nvlIlv|~`.......... -<*IIIvv=\n\
.)nvvvvv-.... . .. ... ~nvvvo=.\n\
.__i<iiiii><vvvvn(= . . ..i>, . ... +)nnnv..\n\
_i%vvvvllIIlIlIvIvvv( .. . lnnsi . :)vnvnsissvisi>__.\n\
.<vnvvvvvvIvvvvvvvlvvII;. . |nnvv: . . -)lvvlIIIIlvvIvnnns=_.\n\
.:vnvvvvvvvvvvvvvIvIvIIvv>: . . . |{}l. . :<lvIvvvvvvvvvvvvvvnov.\n\
|)nvnvnvnvnvnvvvvvvvvvvvvis . . . =ivvvvvvvvvvvnvnvnvnvnn..\n\
.nnnnnnvnnvnvnvnvvvnvvvvvvvnv_ . . :vnvvvvvvvnvnnvnnnnnnnnov;\n\
:2oonnnnnnnnnvnvnnvnvvnvvvvvIvvi==_i.. . .vvvvvvvvnvnnvnnnnnnnnooooc\n\
:nnooonnnnnnnnnnvvnvvvvvvvvIvIlIvvnI- .=vvvvvvvvnvnvnnnnnnnnnnooo2(\n\
|{XooooonnnnnvnvnvvvvvvvIIIIIIIIv|- .<vIlIIvIvvvvvnvvnvnnnnnooo2v(\n\
.){2ooooonnnnvnvnvvvvvIIIIIIlll+- . =)lllIIvIvvvvvvvnvnnnvnnooo22-`\n\
-{2oooonnnnnvvvvvvvlIIlllllil==_ ._iIllillllllIvvvvvvnvnnnnoooo*-\n\
. -.\"11oonnvvvnvvIIlIlliliiiiillii||iliiiiiiililllIIvvvvvnnnnn2}(~.\n\
. -+~!lvvnvIvIIllliiiii|i|||i||i|||i||iiiiilillIIvvvvvv}|\"- .\n\
. ..--~++++++++~+~+~+~+-+-+~+~+-+~+~++~++++++~~~-:.. .\n\
. . . . .... . . .... .. ... .. ... . . . .\n\n\
Ajax.org Cloud9 IDE\n\n\
Project root is: " + options.workspace);

var url = "http://" + options.ip + ":" + options.port;
if (options.start) {
console.log("Trying to start your browser in: "+url);
Sys.puts("Trying to start your browser in: "+url);
options.startargs.push(url);
require("child_process").spawn(options.start, options.startargs);
} else
console.log("Point you browser to "+url);
}
else {
Sys.puts("Point you browser to " + url);
}
4 changes: 2 additions & 2 deletions client/ext/console/console.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
</a:toolbar>

<a:tab id="tabConsole" skin="lowtab" flex="1" border="0">
<a:page caption="Console">
<a:page caption="Console" id="pgConsConsole">
<a:hbox anchors="0 0 0 0" padding="4">
<a:text id="txtConsole"
flex = "5"
Expand All @@ -69,7 +69,7 @@
require('ext/console/console').consoleTextHandler({keyCode:13,ctrlKey:true})
">Evaluate</a:button>
</a:page>
<a:page caption="Quick Watch" render="runtime">
<a:page caption="Quick Watch" id="pgConsQuickWatch" render="runtime">
<a:vbox anchors="0 0 0 0">
<a:textbox id="txtCurObject"
skin = "tbempty"
Expand Down
14 changes: 3 additions & 11 deletions client/ext/gotofile/gotofile.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,9 @@ return ext.register("ext/gotofile/gotofile", {

dgGoToFile.addEventListener("afterchoose", function(e) {
winGoToFile.hide();
var root = trFiles.selected;
while (root.tagName != "folder")
root = root.parentNode;
var path = root.getAttribute("path") + apf.getTextNode(e.xmlNode).nodeValue,
chunks = path.split("/"),
node = apf.n("<file />")
.attr("name", chunks[chunks.length-1])
.attr("contenttype", "application/javascript")
.attr("path", path)
.node();
ide.dispatchEvent("openfile", {node: node});
var root = trFiles.xmlRoot.selectSingleNode("folder[1]"),
path = root.getAttribute("path") + apf.getTextNode(e.xmlNode).nodeValue;
require("ext/debugger/debugger").showFile(path, 0, 0);
});
},

Expand Down
3 changes: 3 additions & 0 deletions client/ext/keybindings_default/default_mac.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ return keys.onLoad({
"search": "Command-F",
"searchreplace": "Command-Shift-R"
},
"searchinfiles" : {
"searchinfiles": "Command-Shift-F"
},
"formatjson" : {
"format" : "Command-Shift-J"
},
Expand Down
3 changes: 3 additions & 0 deletions client/ext/keybindings_default/default_win.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ return keys.onLoad({
"search": "Ctrl-F",
"searchreplace": "Ctrl-Shift-R"
},
"searchinfiles" : {
"searchinfiles": "Ctrl-Shift-F"
},
"formatjson" : {
"format" : "Ctrl-Shift-J"
},
Expand Down
23 changes: 14 additions & 9 deletions client/ext/searchinfiles/searchinfiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ return ext.register("ext/searchinfiles/searchinfiles", {
};
trSFResult.addEventListener("afterselect", function(e) {
var path,
root = trFiles.xmlRoot.selectSingleNode("folder[1]"),
node = trSFResult.selected,
line = 0;
if (node.tagName == "d:excerpt") {
Expand All @@ -78,14 +79,14 @@ return ext.register("ext/searchinfiles/searchinfiles", {
else {
path = node.getAttribute("path");
}
require("ext/debugger/debugger").showFile(path, line, 0);
require("ext/debugger/debugger").showFile(root.getAttribute("path") + "/" + path, line, 0);
});
},

getSelectedTreeNode: function() {
var node = trFiles.selected;
if (!node)
trFiles.select(node = trFiles.xmlRoot.selectSingleNode("folder[1]"));
node = trFiles.xmlRoot.selectSingleNode("folder[1]");
while (node.tagName != "folder")
node = node.parentNode;
return node;
Expand Down Expand Up @@ -141,24 +142,28 @@ return ext.register("ext/searchinfiles/searchinfiles", {

execFind: function() {
winSearchInFiles.hide();
console.enable(true);
// show the console (also used by the debugger):
console.enable();
if (!this.$panel) {
this.$panel = tabConsole.add(this.pageTitle, this.pageID);
this.$panel.appendChild(trSFResult);
trSFResult.setProperty("visible", true);
this.$model = trSFResult.getModel();
var _self = this;
// make sure the tab is shown when results come in
this.$model.addEventListener("afterload", function() {
tabConsole.set(_self.pageID);
});
// hide the debugger toolbar in the results tab
tabConsole.addEventListener("beforeswitch", function(e) {
tbDebug.setProperty("visible", (e.nextPage != _self.$panel));
});
}
// show the tab
tabConsole.set(this.pageID);
var node = trFiles.selected;
if (!node || grpSFScope.value == "projects")
trFiles.select(node = trFiles.xmlRoot.selectSingleNode("folder[1]"));
while (node.tagName != "folder")
node = node.parentNode;
//var node = trFiles.xmlRoot.selectSingleNode("folder[1]");
var node = this.$currentScope = grpSFScope.value == "projects"
? trFiles.xmlRoot.selectSingleNode("folder[1]")
: this.getSelectedTreeNode();
this.$model.load("{davProject.report('" + node.getAttribute("path")
+ "', 'codesearch', " + JSON.stringify(this.getOptions()) + ")}");
},
Expand Down
17 changes: 11 additions & 6 deletions client/ext/searchinfiles/searchinfiles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,16 @@
<a:label width="75">Replace With</a:label>
<a:textbox id="txtReplace" flex="1" />
</a:hbox-->
<a:hbox align="center">
<a:vbox flex="1">
<a:hbox align="center" padding="5">
<a:fieldset flex="1" caption="Options">
<a:checkbox id="chkSFMatchCase" height="20" checked="false" label="Match Case" />
<!--a:checkbox id="chkSFWholeWords" label="Whole Words" /-->
<a:checkbox id="chkSFRegEx" height="20" label="Regular Expressions" />
</a:vbox>
<a:vbox flex="1">
</a:fieldset>
<a:fieldset flex="1" caption="Scope">
<a:radiobutton group="grpSFScope" skin="classic" checked="true" value="projects" label="Open Projects" />
<a:radiobutton group="grpSFScope" id="rbSFSelection" skin="classic" checked="false" value="selection" label="Selection" />
</a:vbox>
</a:fieldset>
</a:hbox>
</a:vbox>
<a:divider />
Expand All @@ -88,7 +88,12 @@
</a:hbox>
</a:window>

<a:tree id="trSFResult" anchors="0 0 0 0" visible="false" class="searchinfiles" each="[d:response|d:excerpt]" autoselect="false">
<a:tree id = "trSFResult"
anchors = "0 0 0 0"
visible = "false"
class = "searchinfiles"
each = "[d:response|d:excerpt]"
autoselect = "false">
<a:model />
<a:caption match="[d:response]">[@path]</a:caption>
<a:caption match="[d:excerpt]"><div class="linenumber">[@line]</div><pre class="excerpt">[text()]</pre></a:caption>
Expand Down
12 changes: 9 additions & 3 deletions client/style/skins.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5514,8 +5514,8 @@
<a:radiobutton name="classic">
<a:style><![CDATA[
.rbclassic {
padding: 2px 2px 2px 2px;
_padding: 2px 2px 2px 0; /* IE6 fix */
padding: 1px;
_padding: 1px 1px 1px 0; /* IE6 fix */
position: relative;
min-height: 13px;
color: #333;
Expand Down Expand Up @@ -7488,8 +7488,14 @@
margin-top: -18px;
}
.searchinfiles LABEL {
padding: 1px 0 0 2px !important;
height: auto !important;
}
.searchinfiles DIV {
height: auto !important;
}
.tree DIV.loading LABEL{
Expand Down
9 changes: 9 additions & 0 deletions tools/generateGUID.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
var Fs = require("fs"),
Util = require(__dirname + "/../common/jsdav/lib/DAV/util"),
Cache = require(__dirname + "/guid_cache");

var guid;
while (!Util.empty(Cache[(guid = Util.uuid())])) {}
Cache[guid] = 1;
Fs.writeFileSync(__dirname + "/guid_cache.js", "module.exports = " + JSON.stringify(Cache));
console.log("New GUID for you to use: " + guid);
1 change: 1 addition & 0 deletions tools/guid_cache.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = {}

0 comments on commit 57d4f2a

Please sign in to comment.