How to use the ext/settings/settings.model function in ext

To help you get started, we’ve selected a few ext examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pylonide / pylon / client / ext / dockpanel / dockpanel.js View on Github external
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");
                }
            }
        }));
github pylonide / pylon / client / ext / dockpanel / dockpanel.js View on Github external
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;
        });
github pylonide / pylon / plugins-client / ext.tree / tree.js View on Github external
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
github pylonide / pylon / plugins-client / ext.dockpanel / dockpanel.js View on Github external
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];
github pylonide / pylon / plugins-client / ext.uploadfiles / uploadfiles.js View on Github external
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();
    },
github pylonide / pylon / plugins-client / ext.quickstart / quickstart.js View on Github external
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();
                }
             }
         });
    },
github pylonide / pylon / plugins-client / ext.tree / tree.js View on Github external
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()
                    );
                }
github pylonide / pylon / plugins-client / ext.zen / zen.js View on Github external
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;
        });
    },
github pylonide / pylon / plugins-client / ext.quicksearch / quicksearch.js View on Github external
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);
        }
    },
github pylonide / pylon / plugins-client / ext.dockpanel / dockpanel.js View on Github external
function(){
                return apf.isTrue(settings.model.queryValue('general/@animateui'));
            }
        );