Skip to content

Commit 28e9ce8

Browse files
committed
adding escapes to string-wise XML buildup, replaced with apf.n() method where applicable
1 parent 7f51f75 commit 28e9ce8

File tree

44 files changed

+1264
-1374
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1264
-1374
lines changed

plugins-client/cloud9.core/www/core/ext.js

+16-12
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ var util = require("core/util");
2828
// apf.nameserver.register(this.localName, value, this);
2929
// apf.nameserver.register("all", value, this);
3030
// //#endif
31-
//
31+
//
3232
// this.name = value;
3333
//};
3434

@@ -82,9 +82,13 @@ module.exports = ext = {
8282
this.model.load("<plugins />");
8383

8484
if (!this.model.queryNode("plugin[@path='" + path + "']"))
85-
this.model.appendXml('<plugin type="' + this.typeLut[oExtension.type]
86-
+ '" name="' + (oExtension.name || "") + '" path="' + path
87-
+ '" dev="' + (oExtension.dev || "") + '" enabled="1" userext="0" />');
85+
this.model.appendXml(apf.n("<plugin/>")
86+
.attr("type=", this.typeLut[oExtension.type])
87+
.attr("name", oExtension.name || "")
88+
.attr("path", path)
89+
.attr("dev", oExtension.dev || "")
90+
.attr("enabled", "1")
91+
.attr("userext", "0").node());
8892
else
8993
this.model.setQueryValue("plugin[@path='" + path + "']/@enabled", 1);
9094

@@ -104,15 +108,15 @@ module.exports = ext = {
104108

105109
if (oExtension.hook) {
106110
oExtension.hook();
107-
111+
108112
ide.addEventListener("$event.hook." + oExtension.path, function(callback){
109113
callback.call(this, {ext : oExtension});
110114
});
111115
ide.dispatchEvent("hook." + oExtension.path, {
112116
ext : oExtension
113117
});
114118
}
115-
119+
116120
var initTime = parseInt(this.model.queryValue("plugin[@path='" + path + "']/@init") || 0);
117121
this.model.queryNode("plugin[@path='" + path + "']").setAttribute("hook", Number(new Date() - dt) - initTime);
118122

@@ -176,17 +180,17 @@ module.exports = ext = {
176180

177181
return true;
178182
},
179-
183+
180184
getExtension : function(extension) {
181185
return this.extLut[extension];
182186
},
183187

184188
initExtension : function(oExtension, amlParent) {
185189
if (oExtension.inited)
186190
return;
187-
191+
188192
var dt = new Date();
189-
193+
190194
oExtension.inited = true; // Prevent Re-entry
191195

192196
var skin = oExtension.skin;
@@ -199,7 +203,7 @@ module.exports = ext = {
199203

200204
//Load markup
201205
var markup = oExtension.markup;
202-
if (markup)
206+
if (markup)
203207
(oExtension.markupInsertionPoint || amlParent || apf.document.documentElement).insertMarkup(markup);
204208

205209
var deps = oExtension.deps;
@@ -221,14 +225,14 @@ module.exports = ext = {
221225
}
222226

223227
oExtension.init(amlParent);
224-
228+
225229
ide.addEventListener("$event.init." + oExtension.path, function(callback){
226230
callback.call(this, {ext : oExtension});
227231
});
228232
ide.dispatchEvent("init." + oExtension.path, {
229233
ext : oExtension
230234
});
231-
235+
232236
this.model.queryNode("plugin[@path='" + oExtension.path + "']").setAttribute("init", Number(new Date() - dt));
233237
},
234238

plugins-client/cloud9.core/www/core/ide.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ define(function(require, exports, module) {
8080
ide.start();
8181

8282
// fire up the socket connection:
83-
if (window.cloud9config.debug) console.info("Connecting", JSON.parse(window.cloud9config.smithIo));
83+
if (window.cloud9config.debug)
84+
console.info("Connecting", JSON.parse(window.cloud9config.smithIo));
8485

8586
SMITH_IO.connect(JSON.parse(window.cloud9config.smithIo), function(err, connection) {
8687
if (err)

plugins-client/cloud9.core/www/core/settings.js

-2
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,9 @@ module.exports = {
145145

146146
if (resetSettings)
147147
xml = template;
148-
149148
// Load from local storage
150149
else if (localStorage[sIdent])
151150
xml = localStorage[sIdent];
152-
153151
// Load from template
154152
else if (!cloud9config.settings || cloud9config.settings == "defaults")
155153
xml = template;

0 commit comments

Comments
 (0)