pull/125/merge
nightwing 2017-04-11 16:07:10 +04:00
rodzic 6f2c99ae3e
commit 38d0861c9b
4 zmienionych plików z 4 dodań i 148 usunięć

Wyświetl plik

@ -363,7 +363,6 @@ define(function(require, module, exports) {
menus.addItemToMenu(mnuEditors,
new ui.item({
caption: "New File",
// TODO
hotkey: "commands.newfile",
onclick: function(e) {
e.pane = this.parentNode.pane;

Wyświetl plik

@ -17,18 +17,6 @@ apf.popup = {
height: height
};
content.style.position = "absolute";
//if(content.parentNode) content.parentNode.removeChild(content);
//if(style) apf.importCssString(style, this.popup.document);
content.onmousedown = function(e) {
if (!e) e = event;
//@todo can this cancelBubble just go?
//apf.cancelBubble(e, null, true);
//e.cancelBubble = true;
};
return content.ownerDocument;
},
@ -1042,7 +1030,6 @@ apf.divider = function(struct, tagName) {
this.minwidth = 0;
this.minheight = 0;
// this.implement(apf.ChildValue);
this.$childProperty = "caption";
//@todo apf3.0 fix this
@ -1143,8 +1130,6 @@ apf.item = function(struct, tagName) {
this.checked = false;
this.selected = false;
// this.implement(apf.ChildValue);
// *** Properties and Attributes *** //
this.$booleanProperties["checked"] = true;

Wyświetl plik

@ -7801,7 +7801,7 @@ apf.AmlNode = function(){
};
this.hasAttributes = function(){
return Object.kesy(this.attributes).length;
return Object.keys(this.attributes).length;
};
this.hasChildNodes = function(){
@ -14485,7 +14485,7 @@ function findNode(htmlNode, textNode, parts, maxRecur) {
index = parseInt(x.slice(1, -1)) - 1;
return "";
});
// allows to emulate xpath features like vbox|hbox
var re = new RegExp("^(" + textNode + ")$", "i");
var ch = htmlNode.childNodes;
@ -18736,127 +18736,7 @@ apf.aml.setElement("skin", apf.skin);
this.$includesRemaining = 0;
this.$propHandlers["src"] = function(value) {
if (value.trim().charAt(0) == "<") {
apf.skins.Init(apf.getXml(value), this, this.$path);
return;
}
this.$path = apf.getAbsolutePath(apf.hostPath, value)
getSkin.call(this, this.$path);
}
this.$propHandlers["name"] = function(value) {
if (!this.src && !this.getAttribute("src")) {
this.$path = apf.getAbsolutePath(apf.hostPath, value) + "/index.xml";
getSkin.call(this, this.$path);
}
};
/**
* @private
*/
function checkForAmlNamespace(xmlNode) {
if (!xmlNode.ownerDocument.documentElement)
return false;
debugger
var nodes = xmlNode.ownerDocument.documentElement.attributes;
for (var found = false, i=0; i<nodes.length; i++) {
if (nodes[i].nodeValue == apf.ns.aml) {
found = true;
break;
}
}
return found;
}
function getSkin(path) {
var domParser = this.ownerDocument.$domParser;
if (!apf.skins.$first)
apf.skins.$first = this;
var defer = this.getAttribute("defer");
if (!apf.isTrue(defer)) {
domParser.$pauseParsing.apply(domParser,
this.$parseContext = domParser.$parseContext || [this.ownerDocument.documentElement]);
}
loadSkinFile.call(this, path);
}
function finish(xmlNode) {
if (xmlNode)
apf.skins.Init(xmlNode, this, this.$path);
if (!this.defer) {// && this.$parseContext
var domParser = this.ownerDocument.$domParser;
domParser.$continueParsing(this.$parseContext[0]);
}
}
function loadSkinFile(path) {
var _self = this;
apf.getData(
path, {
callback: function(xmlString, state, extra) {
if (state != apf.SUCCESS) {
var oError = new Error(apf.formatErrorString(1007,
_self, "Loading skin file", "Could not load skin file '"
+ (path || _self.src)
+ "'\nReason: " + extra.message));
if (extra.tpModule.retryTimeout(extra, state, null, oError) === true)
return true;
throw oError;
}
//if (!apf.supportNamespaces)
xmlString = xmlString.replace(/\<\!DOCTYPE[^>]*>/, "")
.replace(/^[\r\n\s]*/, "") //.replace(/&nbsp;/g, " ")
.replace(/xmlns\=\"[^"]*\"/g, "");
if (!xmlString) {
throw new Error(apf.formatErrorString(0, _self,
"Loading skin",
"Empty skin file. Maybe the file does not exist?", _self));
}
var xmlNode = apf.getXml(xmlString);//apf.getAmlDocFromString(xmlString);
if (!xmlNode) {
throw new Error(apf.formatErrorString(0, _self,
"Loading skin",
"Could not parse skin. Maybe the file does not exist?", _self));
}
xmlNode.setAttribute("filename", extra.url);
{
finish.call(_self, xmlNode);
}
},
async: true,
ignoreOffline: true
});
apf.skins.Init(apf.getXml(value), this, this.$path);
}
//@todo use mutation events to update
@ -18865,14 +18745,6 @@ debugger
return;
apf.skins.Init(this.$aml || this);
//@todo implied skin
/*if (this.parentNode && this.parentNode.parentNode) {
var name = "skin" + Math.round(Math.random() * 100000);
q.parentNode.setAttribute("skin", name);
apf.skins.skins[name] = {name: name, templates: {}};
apf.skins.skins[name].templates[q.parentNode[apf.TAGNAME]] = q;
}*/
});
}).call(apf.skin.prototype = new apf.AmlElement());

Wyświetl plik

@ -63,7 +63,7 @@ define(function(require, exports, module) {
commands.commandManager.off("prop." + oldHandler.prop, oldHandler.handler);
}
if (value && /^commands./.test(value) && commands.commandManager) {
// TODO replace this with the mechanism from events
// this allows to remove event handler when node.destroy is called
oldHandler = amlNode.$funcHandlers.hotkey = oldHandler || {
handler: function(e) {
amlNode.$propHandlers["hotkey"].call(amlNode, amlNode.hotkey);