kopia lustrzana https://github.com/c9/core
Merge remote-tracking branch 'origin/master' into multi-domain
commit
dc3ccc2769
|
@ -212,7 +212,7 @@ AceEmmetEditor.prototype = {
|
|||
* @return {String}
|
||||
*/
|
||||
getProfileName: function() {
|
||||
switch(this.getSyntax()) {
|
||||
switch (this.getSyntax()) {
|
||||
case "css": return "css";
|
||||
case "xml":
|
||||
case "xsl":
|
||||
|
@ -223,8 +223,10 @@ AceEmmetEditor.prototype = {
|
|||
if (!profile)
|
||||
profile = this.ace.session.getLines(0,2).join("").search(/<!DOCTYPE[^>]+XHTML/i) != -1 ? "xhtml": "html";
|
||||
return profile;
|
||||
default:
|
||||
var mode = this.ace.session.$mode;
|
||||
return mode.emmetConfig && mode.emmetConfig.profile || "xhtml";
|
||||
}
|
||||
return "xhtml";
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -392,15 +394,18 @@ exports.updateCommands = function(editor, enabled) {
|
|||
}
|
||||
};
|
||||
|
||||
exports.isSupportedMode = function(modeId) {
|
||||
return modeId && /css|less|scss|sass|stylus|html|php|twig|ejs|handlebars/.test(modeId);
|
||||
exports.isSupportedMode = function(mode) {
|
||||
if (!mode) return false;
|
||||
if (mode.emmetConfig) return true;
|
||||
var id = mode.$id || mode;
|
||||
return /css|less|scss|sass|stylus|html|php|twig|ejs|handlebars/.test(id);
|
||||
};
|
||||
|
||||
var onChangeMode = function(e, target) {
|
||||
var editor = target;
|
||||
if (!editor)
|
||||
return;
|
||||
var enabled = exports.isSupportedMode(editor.session.$modeId);
|
||||
var enabled = exports.isSupportedMode(editor.session.$mode);
|
||||
if (e.enableEmmet === false)
|
||||
enabled = false;
|
||||
if (enabled) {
|
||||
|
|
|
@ -8,5 +8,8 @@ module.exports = function(length) {
|
|||
.toString("base64")
|
||||
.replace(/[^a-zA-Z0-9]/g, "");
|
||||
}
|
||||
return uid.slice(0, length);
|
||||
// HACK: make sure unique id is never syntactically valid JavaScript
|
||||
// See http://balpha.de/2013/02/plain-text-considered-harmful-a-cross-domain-exploit/
|
||||
uid = "9c" +uid.slice(0, length - 2);
|
||||
return uid;
|
||||
};
|
|
@ -74,7 +74,7 @@
|
|||
"c9.ide.find.replace": "#e4daf722b8",
|
||||
"c9.ide.run.debug": "#23a188b91a",
|
||||
"c9.automate": "#47e2c429c9",
|
||||
"c9.ide.ace.emmet": "#e5f1a92ac3",
|
||||
"c9.ide.ace.emmet": "#0ab4c6cd68",
|
||||
"c9.ide.ace.gotoline": "#4d1a93172c",
|
||||
"c9.ide.ace.keymaps": "#43445d6306",
|
||||
"c9.ide.ace.repl": "#f3a62c1f2a",
|
||||
|
|
|
@ -891,7 +891,11 @@ define(function(require, exports, module) {
|
|||
{ caption : "Timed", value : "true" }
|
||||
],
|
||||
position: 14000
|
||||
}
|
||||
},
|
||||
"Enable Wrapping For New Documents" : {
|
||||
type: "checkbox",
|
||||
path: "user/ace/@useWrapMode"
|
||||
},
|
||||
}
|
||||
}
|
||||
}, handle);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
define(function(require, exports, module) {
|
||||
main.consumes = [
|
||||
"Panel", "ui", "menus", "panels", "commands", "tabManager", "layout"
|
||||
"Panel", "ui", "menus", "panels", "commands", "tabManager", "layout",
|
||||
"settings"
|
||||
];
|
||||
main.provides = ["commands.panel"];
|
||||
return main;
|
||||
|
@ -13,6 +14,7 @@ define(function(require, exports, module) {
|
|||
var panels = imports.panels;
|
||||
var layout = imports.layout;
|
||||
var commands = imports.commands;
|
||||
var settings = imports.settings;
|
||||
|
||||
var markup = require("text!./panel.xml");
|
||||
var search = require('../c9.ide.navigate/search');
|
||||
|
@ -130,6 +132,7 @@ define(function(require, exports, module) {
|
|||
txtFilter.ace.on("input", function(e) {
|
||||
var val = txtFilter.getValue();
|
||||
filter(val);
|
||||
settings.set("state/commandPanel/@value", val);
|
||||
});
|
||||
|
||||
function onblur(e) {
|
||||
|
@ -154,8 +157,10 @@ define(function(require, exports, module) {
|
|||
setTimeout(function(){
|
||||
// Assign the dataprovider
|
||||
tree.setDataProvider(ldSearch);
|
||||
|
||||
tree.selection.$wrapAround = true;
|
||||
var val = settings.get("state/commandPanel/@value");
|
||||
if (val)
|
||||
txtFilter.ace.setValue(val);
|
||||
}, 200);
|
||||
}
|
||||
|
||||
|
|
|
@ -206,7 +206,7 @@ define(function(require, exports, module) {
|
|||
}]);
|
||||
|
||||
ace.onPaste = function(text) {
|
||||
this.send(text);
|
||||
this.send(text.replace(/\r\n/g, "\n"));
|
||||
};
|
||||
|
||||
ace.setKeyboardHandler(this);
|
||||
|
|
Ładowanie…
Reference in New Issue