Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// -> if you're looking for disabled, check the init function :-)
// the moment that someone clicks this thing well call preinit
// (its already called if the user has it checked on IDE load)
"onprop.checked": function (ev) {
if (ev.value) {
_self.preinit();
}
// if weve already been loaded, then update the status here
// otherwise it'll be done in init
if (window.mdlStatusBar) {
apf.xmldb.setAttribute(mdlStatusBar.data.selectSingleNode("//state"), "showStatusbar", ev.value);
}
}
});
this.nodes.push(menus.addItemByPath("View/Status Bar", this.viewStatusBarMenuItem, 600));
},
_self.set(_self.currTheme);
}, 200);
}
},
onclick : function(e) {
var path = e.currentTarget.value;
_self.set(path);
ide.dispatchEvent("track_action", {type: "theme change", theme: path});
}
}));
}
for (var name in themes) {
if (themes[name] instanceof Array) {
menus.addItemByPath("View/Themes/" + name, new apf.item());
themes[name].forEach(function (n) {
var themeprop = Object.keys(n)[0];
themeMenuCreator(name + "/" + themeprop, n[themeprop]);
});
}
else {
themeMenuCreator(name);
}
}
this.themes = themes;
},
register : function(panelExt, options){
var _self = this;
panelExt.mnuItem = menus.addItemByPath(
"View/Side Bar/" + panelExt.name,
new apf.item({
type : "radio",
value : panelExt.path,
group : this.group,
hotkey : "{ide.commandManager." + options.command + "}",
onclick : function(){
if (panelExt.show)
panelExt.show();
},
"onprop.selected" : function(e){
if (e.value && !panelExt.show)
_self.activate(panelExt);
}
}), options.position);
hook : function(){
var _self = this;
this.markupInsertionPoint = searchRow;
commands.addCommand({
name: "searchinfiles",
hint: "search for a string through all files in the current workspace",
bindKey: {mac: "Shift-Command-F", win: "Ctrl-Shift-F"},
exec: function () {
_self.toggleDialog(1);
}
});
this.nodes.push(
menus.addItemByPath("Find/~", new apf.divider(), 10000),
menus.addItemByPath("Find/Find in Files...", new apf.item({
command : "searchinfiles"
}), 20000)
);
},
hook: function() {
var self = this;
commands.addCommand({
name: "revisionpanel",
hint: "File Revision History...",
bindKey: { mac: "Command-B", win: "Ctrl-B" },
isAvailable: function(editor) { return editor && !!editor.ceEditor; },
exec: function () { self.toggle(); }
});
this.nodes.push(
this.mnuSave = new apf.menu({ id: "mnuSave" }),
menus.addItemByPath("File/~", new apf.divider(), 800),
menus.addItemByPath("File/File Revision History...", new apf.item({
type: "check",
checked: "[{require('ext/settings/settings').model}::general/@revisionsvisible]",
disabled: "{!tabEditors.length}",
command: "revisionpanel"
}), 900),
menus.addItemByPath("File/~", new apf.divider(), 910)
);
ide.addEventListener("init.ext/tabbehaviors/tabbehaviors", function() {
menus.addItemByPath("~", new apf.divider(), 2000, mnuContextTabs);
menus.addItemByPath("File Revision History...", new apf.item({
command : "revisionpanel"
}), 2100, mnuContextTabs);
});
ide.addEventListener("init.ext/tabbehaviors/tabbehaviors", function() {
menus.addItemByPath("~", new apf.divider(), 2000, mnuContextTabs);
menus.addItemByPath("File Revision History...", new apf.item({
command : "revisionpanel"
}), 2100, mnuContextTabs);
});
init : function(amlNode){
var _self = this;
this.nodes.push(
this.group = apf.document.documentElement.appendChild(new apf.group({
value : "[{req" + "uire('core/settings').model}::auto/panels/@active]"
})),
menus.addItemByPath("View/Side Bar/", null, 100),
menus.addItemByPath("View/~", new apf.divider(), 200),
this.mnuPanelsNone =
menus.addItemByPath("View/Side Bar/None", new apf.item({
type: "radio",
selected : "true",
group: this.group,
"onclick": function(e){
_self.deactivate(null, true);
}
}), 100),
menus.addItemByPath("View/Side Bar/~", new apf.divider(), 200)
);
splitterPanelLeft.addEventListener("dragdrop", function(e){
if (!_self.currentPanel)
return;
this.nodes.push(
menus.$insertByIndex(barTools, new apf.button({
id : "btnSave",
icon : "save.png",
caption : "Save",
tooltip : "Save",
skin : "c9-toolbarbutton-glossy",
disabled : "{!!!tabEditors.activepage}",
command : "quicksave"
}), 1000)
);
var saveItem, saveAsItem, itmRevertToSaved;
this.nodes.push(
saveItem = menus.addItemByPath("File/Save", new apf.item({
command : "quicksave",
disabled : "{!!!tabEditors.activepage}"
}), 1000),
saveAsItem = menus.addItemByPath("File/Save As...", new apf.item({
command : "saveas",
disabled : "{!!!tabEditors.activepage}"
}), 1100),
menus.addItemByPath("File/Save All", new apf.item({
command : "saveall",
disabled : "{!!!tabEditors.activepage}"
}), 1200),
itmRevertToSaved = menus.addItemByPath("File/Revert to Saved", new apf.item({
command : "reverttosaved",
hint: "File Revision History...",
bindKey: { mac: "Command-B", win: "Ctrl-B" },
isAvailable: function(editor) { return editor && !!editor.ceEditor; },
exec: function () { self.toggle(); }
});
this.nodes.push(
this.mnuSave = new apf.menu({ id: "mnuSave" }),
menus.addItemByPath("File/~", new apf.divider(), 800),
menus.addItemByPath("File/File Revision History...", new apf.item({
type: "check",
checked: "[{require('ext/settings/settings').model}::general/@revisionsvisible]",
disabled: "{!tabEditors.length}",
command: "revisionpanel"
}), 900),
menus.addItemByPath("File/~", new apf.divider(), 910)
);
ide.addEventListener("init.ext/tabbehaviors/tabbehaviors", function() {
menus.addItemByPath("~", new apf.divider(), 2000, mnuContextTabs);
menus.addItemByPath("File Revision History...", new apf.item({
command : "revisionpanel"
}), 2100, mnuContextTabs);
});
ide.addEventListener("init.ext/code/code", function() {
self.nodes.push(
mnuCtxEditor.insertBefore(new apf.item({
id : "mnuCtxEditorRevisions",
caption : "File Revision History...",
command: "revisionpanel"
}), mnuCtxEditorCut),
init : function(amlNode){
var _self = this;
this.nodes.push(
this.group = apf.document.documentElement.appendChild(new apf.group({
value : "[{req" + "uire('core/settings').model}::auto/panels/@active]"
})),
menus.addItemByPath("View/Side Bar/", null, 100),
menus.addItemByPath("View/~", new apf.divider(), 200),
this.mnuPanelsNone =
menus.addItemByPath("View/Side Bar/None", new apf.item({
type: "radio",
selected : "true",
group: this.group,
"onclick": function(e){
_self.deactivate(null, true);
}
}), 100),
menus.addItemByPath("View/Side Bar/~", new apf.divider(), 200)
);
splitterPanelLeft.addEventListener("dragdrop", function(e){
if (!_self.currentPanel)
return;
var query = "auto/panels/panel[@path="
+ util.escapeXpathString(_self.currentPanel.path) + "]/@width";