fix initial-message in codebox and use it in panels

pull/282/head
nightwing 2016-03-29 23:27:01 +04:00
rodzic 3a80895372
commit 2a72d18fd3
6 zmienionych plików z 33 dodań i 6 usunięć

Wyświetl plik

@ -55,7 +55,7 @@
"c9"
],
"c9plugins": {
"c9.ide.language": "#1d4d9fa21a",
"c9.ide.language": "#6d5a10ac4f",
"c9.ide.language.css": "#be07d72209",
"c9.ide.language.generic": "#92210f5a48",
"c9.ide.language.html": "#22fdc74869",
@ -94,7 +94,7 @@
"c9.ide.language.python": "#330b80e3b2",
"c9.ide.language.go": "#6ce1c7a7ef",
"c9.ide.mount": "#4c39359b87",
"c9.ide.navigate": "#bc87b56fc5",
"c9.ide.navigate": "#0b7ec7936c",
"c9.ide.newresource": "#981a408a7b",
"c9.ide.openfiles": "#2ae85a9e33",
"c9.ide.preview": "#5f5fff0185",

Wyświetl plik

@ -96,9 +96,18 @@ define(function(require, exports, module) {
}
function getHotkey(command) {
if (!commands[command] || !commands[command].bindKey)
return "";
return commands[command].bindKey[platform];
}
function getPrettyHotkey(command) {
var key = getHotkey(command);
if (platform == "mac")
key = apf.hotkeys.toMacNotation(key);
return key;
}
var markDirty = lang.delayedCall(function(){
emit("update");
}, 500);
@ -557,6 +566,14 @@ define(function(require, exports, module) {
*/
getHotkey: getHotkey,
/**
* returns result of getHotkey formatted for displaying in menus
*
* @param {String} name the name of the command.
* @return {String}
*/
getPrettyHotkey: getPrettyHotkey,
/**
* Executes the action tied to a command. This method will call
* the `isAvailable` method for a command and will not execute if

Wyświetl plik

@ -79,6 +79,9 @@ define(function(require, exports, module) {
// @TODO this is probably not sufficient
layout.on("resize", function(){ tree.resize() }, plugin);
var key = commands.getPrettyHotkey("commands");
txtFilter.setAttribute("initial-message", key);
tree.textInput = txtFilter.ace.textInput;
txtFilter.ace.commands.addCommands([

Wyświetl plik

@ -66,15 +66,12 @@
padding : 0;
}
.tb_console.tb_textboxInitial .sbtb_middle {
padding-right : 0 !important;
}
.tb_console.tb_textboxInitial .input {
font-size : 10px;
}
.tb_console.tb_textboxInitial .ace_scroller {
text-indent: 2px;
text-indent: 5px;
}
.tb_console.tb_textboxInitial .ace_cursor{
display : none;

Wyświetl plik

@ -147,6 +147,14 @@ define(function(require, module, exports) {
mnuItem.setAttribute("hotkey",
"{commands.commandManager." + options.name + "}");
if (button && button.setAttribute) {
var key = commands.getPrettyHotkey(options.name);
button.setAttribute("tooltip", options.name
+ (key ? " (" + key + ")" : ""));
}
return command;
}

Wyświetl plik

@ -199,6 +199,8 @@ require([
c.exec = function(name) {
commands[name].exec();
};
c.getPrettyHotkey = function(name) { return "" };
c.getHotkey = function(name) { return "" };
c.getExceptionList = function(){ return []; };
return c;