Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
onclick : function(){
var defaultSettings = _self.defaultState,//settings.model.queryValue("auto/dockpanel_default/text()"),
state;
if (defaultSettings) {
// JSON parse COULD fail
try {
state = defaultSettings;//objSettings.state;
}
catch (ex) {}
_self.layout.loadState(state);
settings.model.setQueryValue("auto/dockpanel/text()", state)
_self.saveSettings();
ide.dispatchEvent("restorelayout");
}
}
}));
ide.addEventListener("extload", function(e){
var model = settings.model;
var strSettings = model.queryValue("auto/dockpanel/text()");
var state = _self.defaultState;
if (strSettings) {
// JSON parse COULD fail
try {
state = JSON.parse(strSettings);
}
catch (ex) {}
}
ide.dispatchEvent("dockpanel.load.settings", {state: state});
_self.layout.loadState(state);
_self.loaded = true;
});
trFiles.addEventListener("afterselect", this.$afterselect = function(e) {
if (settings.model && settings.model.data && trFiles.selected) {
var nodePath = trFiles.selected.getAttribute("path").replace(/"/g, """);
var nodeType = trFiles.selected.getAttribute("type");
var settingsData = settings.model.data;
var treeSelectionNode = settingsData.selectSingleNode("auto/tree_selection");
if(treeSelectionNode) {
apf.xmldb.setAttribute(treeSelectionNode, "path", nodePath);
apf.xmldb.setAttribute(treeSelectionNode, "type", nodeType);
}
else {
apf.xmldb.appendChild(settingsData.selectSingleNode("auto"),
apf.n("")
.attr("path", nodePath)
.attr("type", nodeType)
.node()
);
}
// Also update our own internal selection vars for when the
// user refreshes the tree
ide.addEventListener("settings.load", function(e){
var model = settings.model;
var strSettings = model.queryValue("auto/dockpanel/text()");
var state = _self.defaultState;
if (strSettings) {
// JSON parse COULD fail
try {
state = JSON.parse(strSettings);
var defaultBars = _self.defaultState.bars;
for (var i = 0, l = Math.max(state.bars.length, defaultBars.length); i < l; i++) {
if (!defaultBars[i]) {
state.bars[i] = null;
continue;
}
// Code update adding more dockables
if (!state.bars[i] || state.bars[i].sections.length < defaultBars[i].sections.length)
state.bars[i] = defaultBars[i];
uploadCanceled: function() {
this.uploadInProgress = false;
this.cancelAllUploads = false;
this.existingOverwriteAll = false;
this.existingSkipAll = false;
this.totalNumUploads = 0;
(davProject.realWebdav || davProject).setAttribute("showhidden", settings.model.queryValue("auto/projecttree/@showhidden"));
require("ext/tree/tree").refresh();
},
ide.addEventListener("settings.load", function(e) {
var showQS = require("ext/settings/settings").model.queryValue("auto/help/@show");
if(showQS === "" || showQS == "true") {
if(apf.getcookie("show-quick-start") == "false") {
require("ext/settings/settings").model.setQueryValue("auto/help/@show", "false");
}
else {
require("ext/settings/settings").model.setQueryValue("auto/help/@show", "true");
apf.xmldb.setAttribute(require("ext/settings/settings").model.queryNode("auto/help"), "show", "true");
//_self.launchQS();
}
}
});
},
trFiles.addEventListener("afterselect", this.$afterselect = function(e) {
if (settings.model && settings.model.data && trFiles.selected) {
var nodePath = trFiles.selected.getAttribute("path").replace(/"/g, """);
var nodeType = trFiles.selected.getAttribute("type");
var settingsData = settings.model.data;
var treeSelectionNode = settingsData.selectSingleNode("auto/tree_selection");
if(treeSelectionNode) {
apf.xmldb.setAttribute(treeSelectionNode, "path", nodePath);
apf.xmldb.setAttribute(treeSelectionNode, "type", nodeType);
}
else {
apf.xmldb.appendChild(settingsData.selectSingleNode("auto"),
apf.n("")
.attr("path", nodePath)
.attr("type", nodeType)
.node()
);
}
apf.addListener(document, "mouseup", function() {
if (!_self.isFocused)
return;
if (_self.handleLeftMove || _self.handleRightMove)
settings.model.setQueryValue("auto/zen/text()", _self.initialWidth);
_self.handleLeftMove = false;
_self.handleRightMove = false;
apf.layout.forceResize();
apf.dragMode = false;
});
},
saveHistory : function(searchTxt){
var settings = require("ext/settings/settings");
if (!settings.model)
return;
var history = settings.model;
var search = apf.createNodeFromXpath(history.data, "search");
if (!search.firstChild || search.firstChild.getAttribute("key") != searchTxt) {
var keyEl = apf.getXml("");
keyEl.setAttribute("key", searchTxt);
apf.xmldb.appendChild(search, keyEl, search.firstChild);
}
},
function(){
return apf.isTrue(settings.model.queryValue('general/@animateui'));
}
);