initial commit

This commit is contained in:
Blue 2018-08-05 00:46:25 +03:00 committed by Юрий Губич
commit 4b60ece582
327 changed files with 28286 additions and 0 deletions

View file

@ -0,0 +1,40 @@
"use strict";
var Address = require("../wType/address");
var Vocabulary = require("./vocabulary");
var File = require("./file/file");
var ImagePane = Vocabulary.inherit({
"className": "ImagePane",
"constructor": function(addr) {
Vocabulary.fn.constructor.call(this, addr);
this._hasImage = false;
this.image = null;
},
"addElement": function(key, element) {
if (key === "image" && !this._hasImage) {
this._hasImage = true;
this.image = new File(new Address(["images", element.toString()]));
this.addForeignController("Corax", this.image);
}
Vocabulary.fn.addElement.call(this, key, element);
},
"hasImage": function() {
return this._hasImage;
},
"removeElement": function(key) {
Vocabulary.fn.removeElement.call(this, key);
if (key === "image" && this._hasImage) {
this.removeForeignController(this.image);
this._hasImage = false;
this.image.destructor();
this.image = null;
}
}
});
module.exports = ImagePane;