removing Google Brix... no further comments

This commit is contained in:
Pablo Luna 2013-03-14 23:57:38 +00:00
parent 9e67329703
commit 9e7f289a9e
14 changed files with 1498 additions and 737 deletions

View File

@ -46,11 +46,9 @@ Start by creating the .zip file:
To test the javascript frontend you then do:
unzip target/wisemapping-3.0-SNAPSHOT-editor.zip
cd target/wisemapping-3.0-SNAPSHOT-editor
ruby -rwebrick -e 'WEBrick::HTTPServer.new(:Port=>8000,:DocumentRoot=>".").start'
ruby -rwebrick -e 'WEBrick::HTTPServer.new(:Port=>8000,:DocumentRoot=>".").start'
Now open a browser using the URL http://localhost:8000/
Now open a browser using the URL http://localhost:8000/wise-editor/src/main/webapp/
### Attaching drag and drop events.

View File

@ -193,9 +193,6 @@
<include>commands/AddFeatureToTopicCommand.js</include>
<include>commands/AddRelationshipCommand.js</include>
<include>commands/MoveControlPointCommand.js</include>
<include>collaboration/CollaborationManager.js</include>
<include>collaboration/framework/AbstractCollaborativeFramework.js</include>
<include>collaboration/framework/AbstractCollaborativeModelFactory.js</include>
<include>widget/ModalDialogNotifier.js</include>
<include>widget/ToolbarNotifier.js</include>
<include>widget/ToolbarItem.js</include>

View File

@ -1,153 +0,0 @@
/*
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the
* "powered by wisemapping" text requirement on every single page;
* you may not use this file except in compliance with the License.
* You may obtain a copy of the license at
*
* http://www.wisemapping.org/license
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
mindplot.BrixActionDispatcher = new Class({
Extends: mindplot.ActionDispatcher,
initialize: function(commandContext, fireOnChange) {
this.parent(commandContext, fireOnChange);
this._commandContext = commandContext;
},
dragTopic: function(topicId, position, order, parentTopic) {
var framework = this._getFramework();
var node = framework.getTopic(topicId);
// Set node order ...
if (order != null) {
node.setOrder(order);
} else if (position != null) {
// Set position ...
node.setPosition(position);
} else {
$assert("Illegal commnand state exception.");
}
// Finally, connect node ...
if ($defined(this._parentId)) {
var parentNode = topic.findTopics([this._parentId])[0];
node.disconnect();
node.connect(parentNode);
}
},
changeTextToTopic : function(topicsIds, text) {
var framework = this._getFramework();
var topicId;
if (!(topicsIds instanceof Array)) {
topicId = topicsIds;
} else {
topicId = topicsIds[0];
}
var node = framework.getTopic(topicId);
node.setText(text);
},
_getFramework:function () {
return mindplot.collaboration.CollaborationManager.getInstance().getCollaborativeFramework();
},
addTopics : function(nodeModel, parentTopicId) {
var framework = this._getFramework();
var cmindmap = framework.getModel();
var cparent = $defined(parentTopicId) ? framework.getTopic(parentTopicId) : cmindmap.getCentralTopic();
var cnode = cmindmap.createNode(nodeModel.getType(), nodeModel.getId());
nodeModel.copyTo(cnode);
cnode.connectTo(cparent);
},
changeFontSizeToTopic : function(topicsIds, size) {
topicsIds.each(function(topicId) {
var framework = this._getFramework();
var topic = framework.getTopic(topicId);
topic.setFontSize(size, true);
}.bind(this));
},
changeFontColorToTopic : function(topicsIds, color) {
topicsIds.each(function(topicId) {
var framework = this._getFramework();
var topic = framework.getTopic(topicId);
topic.setFontColor(color, true);
}.bind(this));
},
changeFontFamilyToTopic : function(topicsIds, family) {
topicsIds.each(function(topicId) {
var framework = this._getFramework();
var topic = framework.getTopic(topicId);
topic.setFontFamily(family, true);
}.bind(this));
},
changeFontStyleToTopic : function(topicsIds) {
topicsIds.each(function(topicId) {
var framework = this._getFramework();
var topic = framework.getTopic(topicId);
var style = ( topic.getFontStyle() == "italic") ? "normal" : "italic";
topic.setFontStyle(style, true);
}.bind(this));
},
changeShapeTypeToTopic : function(topicsIds, shapeType) {
topicsIds.each(function(topicId) {
var framework = this._getFramework();
var topic = framework.getTopic(topicId);
topic.setShapeType(shapeType);
}.bind(this))
},
changeFontWeightToTopic : function(topicsIds) {
topicsIds.each(function(topicId) {
var framework = this._getFramework();
var topic = framework.getTopic(topicId);
var weight = (topic.getFontWeight() == "bold") ? "normal" : "bold";
topic.setFontWeight(weight, true);
}.bind(this));
},
changeBackgroundColorToTopic : function(topicsIds, color) {
topicsIds.each(function(topicId) {
var framework = this._getFramework();
var topic = framework.getTopic(topicId);
topic.setBackgroundColor(color, true);
}.bind(this));
},
changeBorderColorToTopic : function(topicsIds, color) {
topicsIds.each(function(topicId) {
var framework = this._getFramework();
var topic = framework.getTopic(topicId);
topic.setBorderColor(color);
}.bind(this));
},
deleteEntities : function(topicsIds, relIds) {
$assert(topicsIds, "topicsIds can not be null");
var framework = this._getFramework();
var mindmap = framework.getModel();
topicsIds.each(function(topicId) {
var topic = framework.getTopic(topicId);
topic.deleteNode();
});
}
});

View File

@ -33,11 +33,7 @@ mindplot.Designer = new Class({
// Dispatcher manager ...
var commandContext = new mindplot.CommandContext(this);
if (!$defined(options.collab) || options.collab == 'standalone') {
this._actionDispatcher = new mindplot.StandaloneActionDispatcher(commandContext);
} else {
this._actionDispatcher = new mindplot.BrixActionDispatcher(commandContext);
}
this._actionDispatcher = new mindplot.StandaloneActionDispatcher(commandContext);
this._actionDispatcher.addEvent("modelUpdate", function (event) {
this.fireEvent("modelUpdate", event);

View File

@ -1,45 +0,0 @@
/*
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the
* "powered by wisemapping" text requirement on every single page;
* you may not use this file except in compliance with the License.
* You may obtain a copy of the license at
*
* http://www.wisemapping.org/license
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
mindplot.collaboration.CollaborationManager = new Class({
initialize:function() {
this.collaborativeModelReady = false;
this.collaborativeModelReady = null;
},
setCollaborativeFramework : function(framework) {
this._collaborativeFramework = framework;
},
buildMindmap: function() {
return this._collaborativeFramework.buildMindmap();
},
getCollaborativeFramework:function() {
return this._collaborativeFramework;
}
});
mindplot.collaboration.CollaborationManager.getInstance = function() {
if (!$defined(mindplot.collaboration.CollaborationManager.__collaborationManager)) {
mindplot.collaboration.CollaborationManager.__collaborationManager = new mindplot.collaboration.CollaborationManager();
}
return mindplot.collaboration.CollaborationManager.__collaborationManager;
};
mindplot.collaboration.CollaborationManager.getInstance();

View File

@ -1,54 +0,0 @@
mindplot.collaboration.framework.AbstractCollaborativeFramework = new Class({
initialize: function(model) {
$assert(model, "model can not be null");
this._model = model;
this._actionDispatcher = null;
},
getModel : function() {
return this._model;
},
buildMindmap : function() {
var cmind = this.getModel();
var mmind = new mindplot.model.Mindmap();
cmind.copyTo(mmind);
return mmind;
},
_findTopic : function(nodes, id) {
var result;
for (var i = 0; i < nodes.length; i++) {
var node = nodes[i];
if (node.getId() == id) {
result = node;
} else {
var children = node.getChildren();
result = this._findTopic(children, id)
}
if (result != null) {
break;
}
}
return result;
},
getTopic:function(id) {
$assert($defined(id), "id can not be null");
var branches = this.getModel().getBranches();
var result = this._findTopic(branches, id);
$assert(result, "Could not find topic:" + id);
return result;
},
getActionDispatcher:function() {
if (this._actionDispatcher == null) {
var context = mindplot.ActionDispatcher.getInstance()._commandContext;
this._actionDispatcher = new mindplot.StandaloneActionDispatcher(context);
}
return this._actionDispatcher;
}
});

View File

@ -1,26 +0,0 @@
/*
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the
* "powered by wisemapping" text requirement on every single page;
* you may not use this file except in compliance with the License.
* You may obtain a copy of the license at
*
* http://www.wisemapping.org/license
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
mindplot.collaboration.framework.AbstractCollaborativeModelFactory = new Class({
createNewMindmap:function() {
throw "Unsupported operation";
},
buildMindmap:function(model) {
throw "Unsupported operation";
}
});

View File

@ -1,37 +0,0 @@
/*
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the
* "powered by wisemapping" text requirement on every single page;
* you may not use this file except in compliance with the License.
* You may obtain a copy of the license at
*
* http://www.wisemapping.org/license
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
mindplot.collaboration.framework.brix.BrixCollaborativeModelFactory = new Class({
Extends:mindplot.collaboration.framework.AbstractCollaborativeModelFactory,
initialize:function(brixFramework) {
$assert(brixFramework, 'brixFramework can not be null');
this._brixFramework = brixFramework;
},
createNewMindmap : function() {
var mindmap = new mindplot.collaboration.framework.brix.model.Mindmap(this._brixFramework);
var node = mindmap.createNode(mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE, 0);
mindmap.setVersion('pela-brix');
mindmap.addBranch(node);
return mindmap;
},
buildMindmap : function(model) {
return new mindplot.collaboration.framework.brix.model.Mindmap(this._brixFramework, model);
}
});

View File

@ -1,88 +0,0 @@
/*
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the
* "powered by wisemapping" text requirement on every single page;
* you may not use this file except in compliance with the License.
* You may obtain a copy of the license at
*
* http://www.wisemapping.org/license
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
mindplot.collaboration.framework.brix.BrixFramework = new Class({
Extends: mindplot.collaboration.framework.AbstractCollaborativeFramework,
initialize: function(model, app) {
this._app = app;
var factory = new mindplot.collaboration.framework.brix.BrixCollaborativeModelFactory(this);
var root = this.getBrixModel().getRoot();
var cmodel = null;
var brixMap = root.get("mindmap");
if (brixMap != null) {
cmodel = factory.buildMindmap(brixMap);
} else {
cmodel = factory.createNewMindmap();
root.put("mindmap", cmodel.getBrixModel());
}
this.parent(cmodel);
console.log("cmodel:" + cmodel.inspect());
},
getBrixModel:function() {
return this._app.getModel();
}
});
instanciated = false;
mindplot.collaboration.framework.brix.BrixFramework.init = function(onload) {
$assert(onload, "load function can not be null");
if (!instanciated) {
var app = new goog.collab.CollaborativeApp();
mindplot.collaboration.framework.brix.BrixFramework.buildMenu(app);
app.start();
app.addListener('modelLoad', function(model) {
var framework = new mindplot.collaboration.framework.brix.BrixFramework(model, app);
mindplot.collaboration.CollaborationManager.getInstance().setCollaborativeFramework(framework);
onload();
}.bind(this));
instanciated = true;
}
};
mindplot.collaboration.framework.brix.BrixFramework.buildMenu = function(app) {
var menuBar = new goog.collab.ui.MenuBar();
// Configure toolbar menu ...
var fileMenu = menuBar.addSubMenu("File");
fileMenu.addItem("Save", function() {
});
fileMenu.addItem("Export", function() {
});
var editMenu = menuBar.addSubMenu("Edit");
editMenu.addItem("Undo", function() {
});
editMenu.addItem("Redo", function() {
});
var formatMenu = menuBar.addSubMenu("Format");
formatMenu.addItem("Bold", function() {
});
var helpMenu = menuBar.addSubMenu("Help");
helpMenu.addItem("Shortcuts", function() {
});
app.setMenuBar(menuBar);
};

View File

@ -1,106 +0,0 @@
/*
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the
* "powered by wisemapping" text requirement on every single page;
* you may not use this file except in compliance with the License.
* You may obtain a copy of the license at
*
* http://www.wisemapping.org/license
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
mindplot.collaboration.framework.brix.model.Mindmap = new Class({
Extends:mindplot.model.IMindmap,
initialize:function(brixFramework, brixModel) {
$assert(brixFramework, 'brixFramework can not be null');
this._brixFramework = brixFramework;
if (!$defined(brixModel)) {
this._brixModel = this._createBrixModel();
} else {
this._brixModel = brixModel;
}
},
getVersion: function() {
return this._brixModel.get('version');
},
setVersion: function(value) {
this._brixModel.put('version', value);
},
getDescription: function() {
return this._brixModel.get('description');
},
setDescription: function(value) {
this._brixModel.put('description', value);
},
_createBrixModel:function() {
var model = this._brixFramework.getBrixModel().create("Map");
var branches = this._brixFramework.getBrixModel().create("List");
model.put("branches", branches);
return model;
},
getBrixModel:function() {
return this._brixModel;
},
getBranches : function() {
var result = [];
var branches = this._brixModel.get("branches");
for (var i = 0; i < branches.size(); i++) {
var node = branches.get(i);
if (node != null) {
var nodeModel = new mindplot.collaboration.framework.brix.model.NodeModel(this._brixFramework, node, this);
result.push(nodeModel);
}
}
return result;
},
addBranch : function(nodeModel) {
$assert(nodeModel, "nodeModel can not be null");
var branches = this._brixModel.get("branches");
// @Todo: Hack ?
var newModel = mindplot.collaboration.framework.brix.model.NodeModel.create(this._brixFramework, this, nodeModel.getType(), nodeModel.getId());
nodeModel.copyTo(newModel);
branches.add(newModel);
},
removeBranch : function(nodeModel) {
$assert(nodeModel, "nodeModel can not be null");
$assert(nodeModel.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE, "central topic can not be removed");
var branches = this._brixModel.get("branches");
for (var i = 0; i < branches.size(); i++) {
// @Todo: remove should remove null elements ...
var branch = branches.get(i);
if (branch != null) {
if (branch == nodeModel.getBrixModel()) {
branches.remove(i);
break;
}
}
}
},
createNode : function(type, id) {
return mindplot.collaboration.framework.brix.model.NodeModel.create(this._brixFramework, this, type, id);
}
}
);

View File

@ -1,168 +0,0 @@
/*
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the
* "powered by wisemapping" text requirement on every single page;
* you may not use this file except in compliance with the License.
* You may obtain a copy of the license at
*
* http://www.wisemapping.org/license
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
mindplot.collaboration.framework.brix.model.NodeModel = new Class({
Extends: mindplot.model.INodeModel,
initialize : function(brixFramework, brixModel, mindmap) {
$assert(brixFramework, "brixFramework can not null");
$assert(brixModel, "brixModel can not null");
$assert(mindmap && mindmap.getBranches, "mindmap can not null");
this.parent(mindmap);
this._brixModel = brixModel;
this._brixFramework = brixFramework;
this._addBrixListeners();
},
_addBrixListeners : function() {
// Nodes creation should be cached ...
if (!this._brixModel.__registered) {
// Register listener for properties changes ....
var actionDispatcher = this._brixFramework.getActionDispatcher();
this._brixModel.addListener("valueChanged", function(event) {
var key = event.getProperty();
var value = event.getNewValue();
var funName = 'change' + key.capitalize() + 'ToTopic';
if (!$defined(actionDispatcher[funName])) {
throw "No implementation for:" + funName;
}
console.log("This action dispatcher:" + funName);
actionDispatcher[funName]([this.getId()], value);
}.bind(this));
var children = this._brixModel.get("children");
children.addListener("valuesAdded", function(event) {
try {
var brixChildren = event.getValues();
for (var i = 0; i < brixChildren.size(); i++) {
var brixNodeModel = brixChildren.get(0);
var cmodel = new mindplot.collaboration.framework.brix.model.NodeModel(this._brixFramework, brixNodeModel, this.getMindmap());
// @Todo: This is not ok. Is using designer global variable.
var model = new mindplot.model.NodeModel(cmodel.getType(), designer.getMindmap(), this.getId());
cmodel.copyTo(model);
actionDispatcher.addTopics([model], [this.getId()]);
}
} catch(e) {
console.trace();
}
}.bind(this));
children.addListener("valuesRemoved", function(event) {
try {
var brixChildren = event.getValues();
for (var i = 0; i < brixChildren.size(); i++) {
var brixNodeModel = brixChildren.get(i);
var cmodel = new mindplot.collaboration.framework.brix.model.NodeModel(this._brixFramework, brixNodeModel, this.getMindmap());
actionDispatcher.deleteEntities([cmodel.getId()]);
}
} catch(e) {
console.trace();
}
}.bind(this));
this._brixModel.__registered = true;
}
},
getChildren : function() {
var result = [];
var children = this._brixModel.get("children");
for (var i = 0; i < children.size(); i++) {
var node = children.get(i);
var nodeModel = new mindplot.collaboration.framework.brix.model.NodeModel(this._brixFramework, node, this.getMindmap());
nodeModel.setParent(this);
result.push(nodeModel);
}
return result;
},
getBrixModel:function() {
return this._brixModel;
},
putProperty : function(key, value) {
$defined(key, 'key can not be null');
this._brixModel.put(key, value);
},
getProperty : function(key) {
$defined(key, 'key can not be null');
return this._brixModel.get(key);
},
getPropertiesKeys : function() {
var keys = this._brixModel.getKeys();
keys.erase('children');
keys.erase('icons');
keys.erase('links');
keys.erase('notes');
return keys;
},
getParent : function() {
return this._brixModel._parent;
},
setParent : function(parent) {
this._brixModel._parent = parent;
},
appendChild : function(node) {
$assert(node && node.isNodeModel(), 'Only NodeModel can be appended to Mindmap object');
var children = this._brixModel.get("children");
children.add(node.getBrixModel());
this.setParent(this);
},
removeChild : function(child) {
$assert(child && child.isNodeModel(), 'Only NodeModel can be appended to Mindmap object.');
var children = this._brixModel.get("children");
for (var i = 0; i < children.size(); i++) {
if (children.get(i) == child.getBrixModel()) {
children.remove(i);
break;
}
}
this.setParent(null);
}
});
mindplot.collaboration.framework.brix.model.NodeModel.create = function(brixFramework, mindmap, type, id) {
$assert(brixFramework, 'brixFramework can not be null');
$assert(mindmap, 'mindmap can not be null');
$assert(type, 'type can not be null');
$assert($defined(id), 'id can not be null');
var brixModel = brixFramework.getBrixModel().create("Map");
brixModel.put("type", type);
brixModel.put("id", id);
var children = brixFramework.getBrixModel().create("List");
brixModel.put("children", children);
return new mindplot.collaboration.framework.brix.model.NodeModel(brixFramework, brixModel, mindmap);
};

View File

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<module relativePaths="false" type="J2EE_WEB_MODULE" version="4">
<component name="FacetManager">
<facet type="web" name="wise-editor">
<configuration>
<descriptors>
<deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/src/main/webapp/WEB-INF/web.xml" />
</descriptors>
<webroots>
<root url="file://$MODULE_DIR$/src/main/webapp" relative="/" />
</webroots>
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="core-js" />
<orderEntry type="module" module-name="mindplot" />
<orderEntry type="module" module-name="web2d" />
</component>
<component name="WebModuleBuildComponent">
<setting name="EXPLODED_URL" value="file://$MODULE_DIR$/target/wise-editor" />
</component>
<component name="WebModuleProperties">
<containerElement type="module" name="core-js">
<attribute name="method" value="5" />
<attribute name="URI" value="/WEB-INF/lib/core-js-3.0-SNAPSHOT.jar" />
</containerElement>
<containerElement type="module" name="mindplot">
<attribute name="method" value="5" />
<attribute name="URI" value="/WEB-INF/lib/mindplot-3.0-SNAPSHOT.jar" />
</containerElement>
<containerElement type="module" name="web2d">
<attribute name="method" value="5" />
<attribute name="URI" value="/WEB-INF/lib/web2d-3.0-SNAPSHOT.jar" />
</containerElement>
<deploymentDescriptor version="2.3" name="web.xml" optional="false" url="file://$MODULE_DIR$/src/main/webapp/WEB-INF/web.xml" />
<webroots>
<root relative="/" url="file://$MODULE_DIR$/src/main/webapp" />
</webroots>
</component>
</module>

File diff suppressed because it is too large Load Diff

View File

@ -1,48 +0,0 @@
<html>
<body>
<script type="text/javascript" src="http://docs.google.com/brix/static/api/js/jsapi.nocache.js"></script>
<script type="text/javascript">
var collabOnLoad = function() {
app = new goog.collab.CollaborativeApp();
app.start();
app.addListener('modelLoad', function(model) {
var root = app.getModel().getRoot();
var myList = root.get("myList");
if (!myList) {
myList = app.getModel().create("List");
root.put("myList", myList);
}
myList.addListener('valuesAdded', function(event) {
console.log("value added:" + myList.size());
});
myList.addListener('valuesRemoved', function(event) {
console.log("value removed:" + myList.size());
});
});
removedAction = function() {
var root = app.getModel().getRoot();
var myList = root.get("myList");
myList.remove(myList.size() - 1);
};
addAction = function() {
var root = app.getModel().getRoot();
var myList = root.get("myList");
myList.add("Some elem " + myList.size());
console.log("Click on adding...");
};
};
</script>
Funca?
<input style="font-size:20px;width:50px;height:50px;" type="button" value="Add" id="a2" onclick="addAction(this)"/>
<input style="font-size:20px;width:50px;height:50px;" type="button" value="Remove" id="a2"
onclick="removedAction(this)"/>
</body>
</html>