Skip to content

Commit

Permalink
Merge branch 'master' of github.com:ajaxorg/cloud9
Browse files Browse the repository at this point in the history
Conflicts:
	common/ace
  • Loading branch information
fjakobs committed Sep 30, 2010
2 parents edd8a11 + 022cd9d commit 3e56185
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 37 deletions.
26 changes: 21 additions & 5 deletions client/ext/code/code.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,31 @@ return ext.register("ext/code/code", {
},

hook : function(){
var commitFunc = this.onCommit.bind(this);
var commitFunc = this.onCommit.bind(this),
name = this.name;
//Settings Support
ide.addEventListener("init.ext/settings/settings", function(e){
var page = e.ext.addSection("code", "Code Editor", "editors", commitFunc);
var page = e.ext.addSection("code", name, "editors", commitFunc);
page.insertMarkup(settings);
});
},

init : function(amlPage){
var def = ceEditor.getDefaults();
//check default settings...
var settings = require("ext/settings/settings"),
model = settings.model,
base = model.data.selectSingleNode("editors/code");
if (!base)
base = model.appendXml('<code name="' + this.name +'" page="' + settings.getSectionId(this.name) + '" />', "editors");
// go through all default settings and append them to the XML if they're not there yet
for (var prop in def) {
if (!prop) continue;
if (!base.getAttribute(prop))
base.setAttribute(prop, def[prop]);
}
apf.xmldb.applyChanges("synchronize", base);

amlPage.appendChild(ceEditor);
ceEditor.show();

Expand Down Expand Up @@ -82,7 +98,7 @@ return ext.register("ext/code/code", {
mnuView.appendChild(new apf.item({
type : "check",
caption : "Select Full Line",
checked : "{ceEditor.selectstyle == 'line'}",
checked : "{[{require('ext/settings/settings').model}::editors/code/@selectstyle] == 'line'}",
onclick : function(){
_self.toggleSetting("selectstyle");
}
Expand All @@ -97,7 +113,7 @@ return ext.register("ext/code/code", {
mnuView.appendChild(new apf.item({
type : "check",
caption : "Highlight Active Line",
checked : "{ceEditor.activeline}"
checked : "[{require('ext/settings/settings').model}::editors/code/@activeline]"
})),

mnuView.appendChild(new apf.divider()),
Expand All @@ -111,7 +127,7 @@ return ext.register("ext/code/code", {
mnuView.appendChild(new apf.item({
type : "check",
caption : "Show Print Margin",
checked : "{ceEditor.showprintmargin}"
checked : "[{require('ext/settings/settings').model}::editors/code/@showprintmargin]"
}))
// Wrap Lines (none),
// Overwrite mode (overwrite),
Expand Down
28 changes: 17 additions & 11 deletions client/ext/code/code.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,24 @@
return (SupportedModes[mime] || "Text");
}
]]></a:script>

<a:codeeditor id="ceEditor"
flex = "1"
anchors = "6 0 4 0"
visible = "false"
value = "[data]"
syntax = "{getSyntax([@contenttype])}"
showinvisibles = "[{require('ext/settings/settings').model}::editors/code/@showinvisibles]"
softtabs = "true"
contextmenu = "mnuCtxEditor"
debugger = "{location.host and stDebugProcessRunning.active and [@scriptid] ? dbg : null}"
readonly = "{location.host and stDebugProcessRunning.active and [@scriptid]}"
flex = "1"
anchors = "6 0 4 0"
visible = "false"
value = "[data]"
syntax = "{getSyntax([@contenttype])}"
overwrite = "[{require('ext/settings/settings').model}::editors/code/@overwrite]"
selectstyle = "[{require('ext/settings/settings').model}::editors/code/@selectstyle]"
activeline = "[{require('ext/settings/settings').model}::editors/code/@activeline]"
showinvisibles = "[{require('ext/settings/settings').model}::editors/code/@showinvisibles]"
showprintmargin = "[{require('ext/settings/settings').model}::editors/code/@showprintmargin]"
printmargincolumn = "[{require('ext/settings/settings').model}::editors/code/@printmargincolumn]"
softtabs = "[{require('ext/settings/settings').model}::editors/code/@softtabs]"
tabsize = "[{require('ext/settings/settings').model}::editors/code/@tabsize]"
contextmenu = "mnuCtxEditor"
debugger = "{location.host and stDebugProcessRunning.active and [@scriptid] ? dbg : null}"
readonly = "{location.host and stDebugProcessRunning.active and [@scriptid]}"
/>

<a:menu id="mnuCtxEditor" render="runtime">
Expand Down
1 change: 0 additions & 1 deletion client/ext/code/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<a:checkbox label="Wrap Lines" value="[@wrap]" />
<a:checkbox label="Overwrite mode" value="[@overwrite]" checked="false" />
<a:checkbox label="Full line selection" value="[@selectstyle]" values="line|text" checked="true"/>
<a:checkbox label="Read only" value="[@readonly]" checked="false" />
<a:checkbox label="Highlight active line" value="[@activeline]" checked="true"/>
<a:checkbox label="Show invisibles" value="[@showinvisibles]" checked="true"/>
</a:table>
Expand Down
8 changes: 6 additions & 2 deletions client/ext/settings/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,17 @@ return ext.register("ext/settings/settings", {
if (changed) {
if (ide.dispatchEvent("savesettings", {
model : this.model
}) === true)
}) !== false)
this.save();
}
},

getSectionId: function(part) {
return "pgSettings" + part.replace(/ /g, "_");
},

addSection : function(tagName, name, xpath, cbCommit){
var id = "pgSettings" + name.replace(/ /g, "_"),
var id = this.getSectionId(name),
page = pgSettings.getPage(id);
if (page)
return page;
Expand Down
4 changes: 3 additions & 1 deletion client/ext/settings/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
icon = "{[@icon] || 'folder.png'}"
startcollapsed = "false"
onafterselect = "
pgSettings.getPage(this.value).setAttribute('model', this.selected);
var page = pgSettings.getPage(this.value);
if (!page) return;
page.setAttribute('model', this.selected);
pgSettings.set(this.value);
"/>
</a:vbox>
Expand Down
7 changes: 0 additions & 7 deletions client/ext/tabbehaviors/settings.xml

This file was deleted.

10 changes: 2 additions & 8 deletions client/ext/tabbehaviors/tabbehaviors.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* @license GPLv3 <http://www.gnu.org/licenses/gpl.txt>
*/
require.def("ext/tabbehaviors/tabbehaviors",
["core/ide", "core/ext", "core/util", "text!ext/tabbehaviors/settings.xml"],
function(ide, ext, util, settings) {
["core/ide", "core/ext", "core/util"],
function(ide, ext, util) {

return ext.register("ext/tabbehaviors/tabbehaviors", {
name : "Tab Behaviors",
Expand All @@ -24,12 +24,6 @@ return ext.register("ext/tabbehaviors/tabbehaviors", {
nodes : [],

init : function(amlNode){
//Settings Support
ide.addEventListener("init.ext/settings/settings", function(e){
var page = e.ext.addSection("tab", "Tab Behaviors", "general");
page.insertMarkup(settings);
});

this.nodes.push(
mnuPanels.appendChild(new apf.divider()),
mnuPanels.appendChild(new apf.item({
Expand Down
2 changes: 1 addition & 1 deletion common/ace
Submodule ace updated from b646c0 to 45f2fe
2 changes: 1 addition & 1 deletion common/jsdav
Submodule jsdav updated from 55022d to 1ea306

0 comments on commit 3e56185

Please sign in to comment.