Commit 441fed5a authored by Téo Vasseur's avatar Téo Vasseur

js : move constructors and main() to mocker

parent 7a0fecf3
......@@ -20,23 +20,6 @@ function View(id, parentId, classes) {
// parent.appendChild(node);
}
function Flex(id, parentId) {
View.call(this, id, parentId, "flex");
}
function Solid1(id, parentId) {
View.call(this, id, parentId, "solid1");
}
function Solid2(id, parentId) {
View.call(this, id, parentId, "solid2");
}
function Heavy(id, parentId) {
View.call(this, id, parentId, "heavy");
for (var i = 0 ; i < 10000 ; i++) this.node.appendChild(document.createElement('span'));
}
function setView(view, panel) {
if (panel) view.parentId = panel;
document.getElementById(view.parentId).appendChild(view.node);
......@@ -110,20 +93,3 @@ function setOverlays() {
setOverlay('B');
setOverlay('C');
}
function main() {
var v1 = new Flex("v1", 'A');
var v2 = new Flex("v2", 'A');
var v3 = new Flex("v3", 'B');
var v4 = new Flex("v4", 'C');
var v5 = new Solid1("v5", 'A');
var v6 = new Solid2("v6", 'B');
var v7 = new Heavy("v7", 'B');
setMenuOptions();
setOverlays();
}
main();
\ No newline at end of file
function Flex(id, parentId) {
View.call(this, id, parentId, "flex");
}
function Solid1(id, parentId) {
View.call(this, id, parentId, "solid1");
}
function Solid2(id, parentId) {
View.call(this, id, parentId, "solid2");
}
function Heavy(id, parentId) {
View.call(this, id, parentId, "heavy");
for (var i = 0 ; i < 10000 ; i++) this.node.appendChild(document.createElement('span'));
}
function main() {
var v1 = new Flex("v1", 'A');
var v2 = new Flex("v2", 'A');
var v3 = new Flex("v3", 'B');
var v4 = new Flex("v4", 'C');
var v5 = new Solid1("v5", 'A');
var v6 = new Solid2("v6", 'B');
var v7 = new Heavy("v7", 'B');
setMenuOptions();
setOverlays();
}
main();
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment