Rename Event listener

Remove hacks
This commit is contained in:
Paulo Veiga 2011-08-21 12:42:00 -03:00
parent 0e854c8942
commit ad13c296ad
42 changed files with 276 additions and 2944 deletions

View File

@ -50,13 +50,11 @@
<includes> <includes>
<include>${basedir}/target/tmp/header-min.js</include> <include>${basedir}/target/tmp/header-min.js</include>
<include>${basedir}/target/tmp/Functions-min.js</include> <include>${basedir}/target/tmp/Functions-min.js</include>
<include>${basedir}/target/tmp/log4js-min.js</include>
<include>${basedir}/target/tmp/Monitor-min.js</include> <include>${basedir}/target/tmp/Monitor-min.js</include>
<include>${basedir}/target/tmp/Point-min.js</include> <include>${basedir}/target/tmp/Point-min.js</include>
<include>${basedir}/target/tmp/Utils-min.js</include> <include>${basedir}/target/tmp/Utils-min.js</include>
<include>${basedir}/target/tmp/WaitDialog-min.js</include> <include>${basedir}/target/tmp/WaitDialog-min.js</include>
<include>${basedir}/target/tmp/footer-min.js</include> <include>${basedir}/target/tmp/footer-min.js</include>
<include>${basedir}/target/tmp/Executor-min.js</include>
</includes> </includes>
</aggregation> </aggregation>
</aggregations> </aggregations>

View File

@ -1,55 +0,0 @@
/*
* Copyright [2011] [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.
*/
/**
* I need this class to clean up things after loading has finished. Without this, async functions at startup are a
* nightmare.
*/
core.Executor = new Class({
options:{
isLoading:true
},
initialize:function(options){
this._pendingFunctions=[];
},
setLoading:function(isLoading){
this.options.isLoading = isLoading;
if(!isLoading){
this._pendingFunctions.forEach(function(item){
var result = item.fn.attempt(item.args, item.bind);
$assert(result!=false, "execution failed");
});
this._pendingFunctions=[];
}
},
isLoading:function(){
return this.options.isLoading;
},
delay:function(fn, delay, bind, args){
if(this.options.isLoading){
this._pendingFunctions.push({fn:fn, bind:bind, args:args});
}
else{
fn.delay(delay, bind, args);
}
}
});
core.Executor.instance = new core.Executor();

View File

@ -1,44 +1,43 @@
/* /*
* Copyright [2011] [wisemapping] * Copyright [2011] [wisemapping]
* *
* Licensed under WiseMapping Public License, Version 1.0 (the "License"). * Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the * It is basically the Apache License, Version 2.0 (the "License") plus the
* "powered by wisemapping" text requirement on every single page; * "powered by wisemapping" text requirement on every single page;
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the license at * You may obtain a copy of the license at
* *
* http://www.wisemapping.org/license * http://www.wisemapping.org/license
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
core.Point = function(x, y) core.Point = new Class({
{ initialize : function(x, y) {
this.x = x; this.x = x;
this.y = y; this.y = y;
}; },
core.Point.prototype.setValue = function(x, y) setValue : function(x, y) {
{ this.x = x;
this.x = x; this.y = y;
this.y = y; },
};
core.Point.prototype.inspect = function() inspect : function() {
{ return "{x:" + this.x + ",y:" + this.y + "}";
return "{x:" + this.x + ",y:" + this.y + "}"; },
};
core.Point.prototype.clone = function() clone : function() {
{ return new core.Point(this.x, this.y);
return new core.Point(this.x, this.y); },
};
core.Point.fromString = function(point) { fromString :
var values = point.split(','); function(point) {
return new core.Point(values[0], values[1]); var values = point.split(',');
}; return new core.Point(values[0], values[1]);
}
});

File diff suppressed because it is too large Load Diff

View File

@ -318,7 +318,7 @@
<include>collaboration/frameworks/brix/BrixFramework-min.js</include> <include>collaboration/frameworks/brix/BrixFramework-min.js</include>
<include>widget/IconPanel-min.js</include> <include>widget/IconPanel-min.js</include>
<include>widget/ToolbarPanel-min.js</include> <include>widget/ListToolbarPanel-min.js</include>
<include>widget/FontFamilyPanel-min.js</include> <include>widget/FontFamilyPanel-min.js</include>
<include>widget/FontSizePanel-min.js</include> <include>widget/FontSizePanel-min.js</include>
<include>widget/TopicShapePanel-min.js</include> <include>widget/TopicShapePanel-min.js</include>

View File

@ -31,8 +31,8 @@ mindplot.ActionIcon = new Class({
this.getImage().setPosition(x - size.width / 2, y - size.height / 2); this.getImage().setPosition(x - size.width / 2, y - size.height / 2);
}, },
addEventListener:function(event, fn) { addEvent:function(event, fn) {
this.getImage().addEventListener(event, fn); this.getImage().addEvent(event, fn);
}, },
addToGroup:function(group) { addToGroup:function(group) {

View File

@ -27,7 +27,7 @@ mindplot.CentralTopic = new Class({
this.parent(); this.parent();
// This disable the drag of the central topic. But solves the problem of deselecting the nodes when the screen is clicked. // This disable the drag of the central topic. But solves the problem of deselecting the nodes when the screen is clicked.
this.addEventListener('mousedown', function(event) { this.addEvent('mousedown', function(event) {
event.stopPropagation(); event.stopPropagation();
}); });
}, },

View File

@ -24,12 +24,12 @@ mindplot.ControlPoint = new Class({
new web2d.Line({strokeColor:"#6589de", strokeWidth:1, opacity:0.3})]; new web2d.Line({strokeColor:"#6589de", strokeWidth:1, opacity:0.3})];
this._isBinded = false; this._isBinded = false;
this._controlPointsController[0].addEventListener('mousedown', this._mouseDown.bindWithEvent(this, mindplot.ControlPoint.FROM)); this._controlPointsController[0].addEvent('mousedown', this._mouseDown.bindWithEvent(this, mindplot.ControlPoint.FROM));
this._controlPointsController[0].addEventListener('click', this._mouseClick.bindWithEvent(this)); this._controlPointsController[0].addEvent('click', this._mouseClick.bindWithEvent(this));
this._controlPointsController[0].addEventListener('dblclick', this._mouseClick.bindWithEvent(this)); this._controlPointsController[0].addEvent('dblclick', this._mouseClick.bindWithEvent(this));
this._controlPointsController[1].addEventListener('mousedown', this._mouseDown.bindWithEvent(this, mindplot.ControlPoint.TO)); this._controlPointsController[1].addEvent('mousedown', this._mouseDown.bindWithEvent(this, mindplot.ControlPoint.TO));
this._controlPointsController[1].addEventListener('click', this._mouseClick.bindWithEvent(this)); this._controlPointsController[1].addEvent('click', this._mouseClick.bindWithEvent(this));
this._controlPointsController[1].addEventListener('dblclick', this._mouseClick.bindWithEvent(this)); this._controlPointsController[1].addEvent('dblclick', this._mouseClick.bindWithEvent(this));
}, },
@ -77,9 +77,9 @@ mindplot.ControlPoint = new Class({
if (!this._isBinded) { if (!this._isBinded) {
this._isBinded = true; this._isBinded = true;
this._mouseMoveFunction = this._mouseMove.bindWithEvent(this, point); this._mouseMoveFunction = this._mouseMove.bindWithEvent(this, point);
this._workspace.getScreenManager().addEventListener('mousemove', this._mouseMoveFunction); this._workspace.getScreenManager().addEvent('mousemove', this._mouseMoveFunction);
this._mouseUpFunction = this._mouseUp.bindWithEvent(this, point); this._mouseUpFunction = this._mouseUp.bindWithEvent(this, point);
this._workspace.getScreenManager().addEventListener('mouseup', this._mouseUpFunction); this._workspace.getScreenManager().addEvent('mouseup', this._mouseUpFunction);
} }
event.preventDefault(); event.preventDefault();
event.stop(); event.stop();
@ -111,8 +111,8 @@ mindplot.ControlPoint = new Class({
}, },
_mouseUp : function(event, point) { _mouseUp : function(event, point) {
this._workspace.getScreenManager().removeEventListener('mousemove', this._mouseMoveFunction); this._workspace.getScreenManager().removeEvent('mousemove', this._mouseMoveFunction);
this._workspace.getScreenManager().removeEventListener('mouseup', this._mouseUpFunction); this._workspace.getScreenManager().removeEvent('mouseup', this._mouseUpFunction);
var actionDispatcher = mindplot.ActionDispatcher.getInstance(); var actionDispatcher = mindplot.ActionDispatcher.getInstance();
actionDispatcher.moveControlPoint(this, point); actionDispatcher.moveControlPoint(this, point);

View File

@ -186,7 +186,7 @@ mindplot.DesignerKeyboard = new Class({
var regex = /^(?:shift|control|ctrl|alt|meta)$/; var regex = /^(?:shift|control|ctrl|alt|meta)$/;
var modifiers = ['shift', 'control', 'alt', 'meta']; var modifiers = ['shift', 'control', 'alt', 'meta'];
var excludes = ['esc','capslock','tab']; var excludes = ['esc','capslock','tab','f3','f4','f5','f6','f7','f8','f9','10','11','12'];
$(document).addEvent('keydown', function(event) { $(document).addEvent('keydown', function(event) {

View File

@ -58,7 +58,7 @@ mindplot.DragManager.prototype.add = function(node)
window.document.body.style.cursor = 'move'; window.document.body.style.cursor = 'move';
} }
}; };
node.addEventListener('mousedown', mouseDownListener); node.addEvent('mousedown', mouseDownListener);
}; };
mindplot.DragManager.prototype.remove = function(node) mindplot.DragManager.prototype.remove = function(node)
@ -154,7 +154,7 @@ mindplot.DragManager.prototype._buildMouseUpListener = function(workspace, node,
* - dragging * - dragging
* - enddragging * - enddragging
*/ */
mindplot.DragManager.prototype. addEventListener = function(type, listener) mindplot.DragManager.prototype. addEvent = function(type, listener)
{ {
this._listeners[type] = listener; this._listeners[type] = listener;
}; };

View File

@ -55,7 +55,7 @@ mindplot.IconGroup = new Class({
}, },
addIcon : function(icon) { addIcon : function(icon) {
$defined(icon,"icon is not defined"); $defined(icon, "icon is not defined");
icon.setGroup(this); icon.setGroup(this);
var newIcon = icon.getImage(); var newIcon = icon.getImage();
@ -136,7 +136,6 @@ mindplot.IconGroup = new Class({
var iconSize = nativeImage.getSize(); var iconSize = nativeImage.getSize();
var size = this.options.nativeElem.getSize(); var size = this.options.nativeElem.getSize();
var position = nativeImage.getPosition(); var position = nativeImage.getPosition();
var childs = this.options.nativeElem.removeChild(nativeImage);
this.options.icons.each(function(icon, index) { this.options.icons.each(function(icon, index) {
var img = icon.getImage(); var img = icon.getImage();
var pos = img.getPosition(); var pos = img.getPosition();
@ -148,7 +147,7 @@ mindplot.IconGroup = new Class({
this.setSize(size.width, size.height); this.setSize(size.width, size.height);
}, },
getNativeElement : function() { getNativeElement : function() {
return this.options.nativeElem; return this.options.nativeElem;
}, },
@ -157,22 +156,13 @@ mindplot.IconGroup = new Class({
}, },
registerListeners : function() { registerListeners : function() {
this.options.nativeElem.addEventListener('click', function(event) { this.options.nativeElem.addEvent('click', function(event) {
// Avoid node creation ... // Avoid node creation ...
if ($defined(event.stopPropagation)) { event.stopPropagation();
event.stopPropagation(true);
} else {
event.cancelBubble = true;
}
}); });
this.options.nativeElem.addEventListener('dblclick', function(event) { this.options.nativeElem.addEvent('dblclick', function(event) {
// Avoid node creation ... event.stopPropagation();
if ($defined(event.stopPropagation)) {
event.stopPropagation();
} else {
event.cancelBubble = true;
}
}); });
}, },

View File

@ -52,7 +52,7 @@ mindplot.ImageIcon = new Class({
//Icon //Icon
var image = this.getImage(); var image = this.getImage();
image.addEventListener('click', function() { image.addEvent('click', function() {
var iconType = iconModel.getIconType(); var iconType = iconModel.getIconType();
var newIconType = this._getNextFamilyIconId(iconType); var newIconType = this._getNextFamilyIconId(iconType);
@ -63,15 +63,15 @@ mindplot.ImageIcon = new Class({
}.bind(this)); }.bind(this));
image.addEventListener('mouseover', function(event) { image.addEvent('mouseover', function(event) {
tip.open(event, container, this); tip.open(event, container, this);
}.bind(this)); }.bind(this));
image.addEventListener('mouseout', function(event) { image.addEvent('mouseout', function(event) {
tip.close(event); tip.close(event);
}); });
image.addEventListener('mousemove', function(event) { image.addEvent('mousemove', function(event) {
tip.updatePosition(event); tip.updatePosition(event);
}); });

View File

@ -138,13 +138,13 @@ mindplot.LinkIcon = new Class({
} }
var linkIcon = this; var linkIcon = this;
image.addEventListener('mouseover', function(event) { image.addEvent('mouseover', function(event) {
bubbleTip.open(event, container, linkIcon); bubbleTip.open(event, container, linkIcon);
}); });
image.addEventListener('mousemove', function(event) { image.addEvent('mousemove', function(event) {
bubbleTip.updatePosition(event); bubbleTip.updatePosition(event);
}); });
image.addEventListener('mouseout', function(event) { image.addEvent('mouseout', function(event) {
bubbleTip.close(event); bubbleTip.close(event);
}); });
}, },

View File

@ -118,7 +118,7 @@ mindplot.LocalActionDispatcher = new Class({
var result = topic.getFontFamily(); var result = topic.getFontFamily();
topic.setFontFamily(fontFamily, true); topic.setFontFamily(fontFamily, true);
core.Executor.instance.delay(topic.updateNode, 0, topic); topic.updateNode.delay(0, topic);
return result; return result;
}; };
@ -179,7 +179,7 @@ mindplot.LocalActionDispatcher = new Class({
var result = topic.getFontSize(); var result = topic.getFontSize();
topic.setFontSize(size, true); topic.setFontSize(size, true);
core.Executor.instance.delay(topic.updateNode, 0, topic); topic.updateNode.delay(0, topic);
return result; return result;
}; };
@ -209,11 +209,7 @@ mindplot.LocalActionDispatcher = new Class({
var weight = (result == "bold") ? "normal" : "bold"; var weight = (result == "bold") ? "normal" : "bold";
topic.setFontWeight(weight, true); topic.setFontWeight(weight, true);
core.Executor.instance.delay(topic.updateNode, 0, topic); topic.updateNode.delay(0, topic);
/*var updated = function() {
topic.updateNode();
};
updated.delay(0);*/
return result; return result;
}; };

View File

@ -64,7 +64,7 @@ mindplot.MindmapDesigner = new Class({
mindplot.DesignerKeyboard.register(this); mindplot.DesignerKeyboard.register(this);
// To prevent the user from leaving the page with changes ... // To prevent the user from leaving the page with changes ...
window.addEvent('beforeunload', function () { $(window).addEvent('beforeunload', function () {
if (this.needsSave()) { if (this.needsSave()) {
this.save(null, false) this.save(null, false)
} }
@ -123,7 +123,7 @@ mindplot.MindmapDesigner = new Class({
return topics[0]; return topics[0];
}, },
addEventListener : function(eventType, listener) { addEvent : function(eventType, listener) {
this._events[eventType] = listener; this._events[eventType] = listener;
}, },
@ -154,7 +154,7 @@ mindplot.MindmapDesigner = new Class({
this._layoutManager.registerListenersOnNode(topic); this._layoutManager.registerListenersOnNode(topic);
// If a node had gained focus, clean the rest of the nodes ... // If a node had gained focus, clean the rest of the nodes ...
topic.addEventListener('mousedown', function(event) { topic.addEvent('mousedown', function(event) {
this.onObjectFocusEvent(topic, event); this.onObjectFocusEvent(topic, event);
}.bind(this)); }.bind(this));
} }
@ -164,7 +164,6 @@ mindplot.MindmapDesigner = new Class({
if (isConnected) { if (isConnected) {
// Improve this ... // Improve this ...
var targetTopicModel = model.getParent(); var targetTopicModel = model.getParent();
var targetTopicId = targetTopicModel.getId();
var targetTopic = null; var targetTopic = null;
for (var i = 0; i < topics.length; i++) { for (var i = 0; i < topics.length; i++) {
@ -295,7 +294,7 @@ mindplot.MindmapDesigner = new Class({
} }
, ,
addRelationShip2SelectedNode : function(event) { addRelationShip : function(event) {
var screen = this._workspace.getScreenManager(); var screen = this._workspace.getScreenManager();
var pos = screen.getWorkspaceMousePosition(event); var pos = screen.getWorkspaceMousePosition(event);
var selectedTopics = this.getSelectedNodes(); var selectedTopics = this.getSelectedNodes();
@ -456,10 +455,9 @@ mindplot.MindmapDesigner = new Class({
} }
var relationships = mindmapModel.getRelationships(); var relationships = mindmapModel.getRelationships();
for (var j = 0; j < relationships.length; j++) { for (var j = 0; j < relationships.length; j++) {
var relationship = this._relationshipModelToRelationship(relationships[j]); this._relationshipModelToRelationship(relationships[j]);
} }
} }
core.Executor.instance.setLoading(false);
this._getTopics().forEach(function(topic) { this._getTopics().forEach(function(topic) {
delete topic.getModel()._finalPosition; delete topic.getModel()._finalPosition;
}); });
@ -578,7 +576,7 @@ mindplot.MindmapDesigner = new Class({
relationLine.setModel(model); relationLine.setModel(model);
//Add Listeners //Add Listeners
relationLine.addEventListener('onfocus', function(event) { relationLine.addEvent('onfocus', function(event) {
elem.onObjectFocusEvent.attempt([relationLine, event], elem); elem.onObjectFocusEvent.attempt([relationLine, event], elem);
}); });
@ -624,7 +622,7 @@ mindplot.MindmapDesigner = new Class({
}, },
setFont2SelectedNode : function(font) { changeFontFamily : function(font) {
var validSelectedObjects = this._getValidSelectedObjectsIds(); var validSelectedObjects = this._getValidSelectedObjectsIds();
var topicsIds = validSelectedObjects.nodes; var topicsIds = validSelectedObjects.nodes;
if (topicsIds.length > 0) { if (topicsIds.length > 0) {
@ -641,7 +639,8 @@ mindplot.MindmapDesigner = new Class({
} }
}, },
setFontColor2SelectedNode : function(color) { changeFontColor : function(color) {
$assert(color,"color can not be null");
var validSelectedObjects = this._getValidSelectedObjectsIds(); var validSelectedObjects = this._getValidSelectedObjectsIds();
var topicsIds = validSelectedObjects.nodes; var topicsIds = validSelectedObjects.nodes;
if (topicsIds.length > 0) { if (topicsIds.length > 0) {
@ -649,7 +648,7 @@ mindplot.MindmapDesigner = new Class({
} }
}, },
setBackColor2SelectedNode : function(color) { changeBackgroundColor : function(color) {
var validateFunc = function(topic) { var validateFunc = function(topic) {
return topic.getShapeType() != mindplot.model.NodeModel.SHAPE_TYPE_LINE return topic.getShapeType() != mindplot.model.NodeModel.SHAPE_TYPE_LINE
@ -700,7 +699,7 @@ mindplot.MindmapDesigner = new Class({
return result; return result;
}, },
setBorderColor2SelectedNode : function(color) { changeBorderColor : function(color) {
var validateFunc = function(topic) { var validateFunc = function(topic) {
return topic.getShapeType() != mindplot.model.NodeModel.SHAPE_TYPE_LINE return topic.getShapeType() != mindplot.model.NodeModel.SHAPE_TYPE_LINE
}; };
@ -713,7 +712,7 @@ mindplot.MindmapDesigner = new Class({
} }
}, },
setFontSize2SelectedNode : function(size) { changeFontSize : function(size) {
var validSelectedObjects = this._getValidSelectedObjectsIds(); var validSelectedObjects = this._getValidSelectedObjectsIds();
var topicsIds = validSelectedObjects.nodes; var topicsIds = validSelectedObjects.nodes;
if (topicsIds.length > 0) { if (topicsIds.length > 0) {
@ -722,7 +721,7 @@ mindplot.MindmapDesigner = new Class({
} }
, ,
setShape2SelectedNode : function(shape) { changeTopicShape : function(shape) {
var validateFunc = function(topic) { var validateFunc = function(topic) {
return !(topic.getType() == mindplot.model.NodeModel.CENTRAL_TOPIC_TYPE && shape == mindplot.model.NodeModel.SHAPE_TYPE_LINE) return !(topic.getType() == mindplot.model.NodeModel.CENTRAL_TOPIC_TYPE && shape == mindplot.model.NodeModel.SHAPE_TYPE_LINE)
}; };
@ -743,7 +742,7 @@ mindplot.MindmapDesigner = new Class({
} }
}, },
addIconType2SelectedNode : function(iconType) { addIconType : function(iconType) {
var validSelectedObjects = this._getValidSelectedObjectsIds(); var validSelectedObjects = this._getValidSelectedObjectsIds();
var topicsIds = validSelectedObjects.nodes; var topicsIds = validSelectedObjects.nodes;
if (topicsIds.length > 0) { if (topicsIds.length > 0) {
@ -759,7 +758,7 @@ mindplot.MindmapDesigner = new Class({
} }
}, },
addLink2SelectedNode : function() { addLink : function() {
var selectedTopics = this.getSelectedNodes(); var selectedTopics = this.getSelectedNodes();
var topic = null; var topic = null;
if (selectedTopics.length > 0) { if (selectedTopics.length > 0) {
@ -811,7 +810,7 @@ mindplot.MindmapDesigner = new Class({
} }
}, },
addNote2SelectedNode : function() { addNote : function() {
var selectedTopics = this.getSelectedNodes(); var selectedTopics = this.getSelectedNodes();
var topic = null; var topic = null;
if (selectedTopics.length > 0) { if (selectedTopics.length > 0) {

View File

@ -52,9 +52,9 @@ mindplot.NodeGraph = new Class({
this._model.setPosition(point.x, point.y); this._model.setPosition(point.x, point.y);
}, },
addEventListener : function(type, listener) { addEvent : function(type, listener) {
var elem = this.get2DElement(); var elem = this.get2DElement();
elem.addEventListener(type, listener); elem.addEvent(type, listener);
}, },
setMouseEventsEnabled : function(isEnabled) { setMouseEventsEnabled : function(isEnabled) {

View File

@ -96,7 +96,7 @@ mindplot.Note = new Class({
} }
var note = this; var note = this;
image.addEventListener('mouseover', function(event) { image.addEvent('mouseover', function(event) {
var text = textModel.getText(); var text = textModel.getText();
text = unescape(text); text = unescape(text);
text = text.replace(/\n/ig, "<br/>"); text = text.replace(/\n/ig, "<br/>");
@ -106,10 +106,10 @@ mindplot.Note = new Class({
bubbleTip.open(event, container, note); bubbleTip.open(event, container, note);
}.bind(this)); }.bind(this));
image.addEventListener('mousemove', function(event) { image.addEvent('mousemove', function(event) {
bubbleTip.updatePosition(event); bubbleTip.updatePosition(event);
}); });
image.addEventListener('mouseout', function(event) { image.addEvent('mouseout', function(event) {
bubbleTip.close(event); bubbleTip.close(event);
}); });
}, },

View File

@ -119,7 +119,7 @@ mindplot.RelationshipLine = new Class({
workspace.appendChild(this._focusShape); workspace.appendChild(this._focusShape);
workspace.appendChild(this._controlPointsController); workspace.appendChild(this._controlPointsController);
this._controlPointControllerListener = this._initializeControlPointController.bindWithEvent(this, workspace); this._controlPointControllerListener = this._initializeControlPointController.bindWithEvent(this, workspace);
this._line2d.addEventListener('click', this._controlPointControllerListener); this._line2d.addEvent('click', this._controlPointControllerListener);
this._isInWorkspace = true; this._isInWorkspace = true;
workspace.appendChild(this._startArrow); workspace.appendChild(this._startArrow);
@ -135,7 +135,7 @@ mindplot.RelationshipLine = new Class({
removeFromWorkspace : function(workspace) { removeFromWorkspace : function(workspace) {
workspace.removeChild(this._focusShape); workspace.removeChild(this._focusShape);
workspace.removeChild(this._controlPointsController); workspace.removeChild(this._controlPointsController);
this._line2d.removeEventListener('click', this._controlPointControllerListener); this._line2d.removeEvent('click', this._controlPointControllerListener);
this._isInWorkspace = false; this._isInWorkspace = false;
workspace.removeChild(this._startArrow); workspace.removeChild(this._startArrow);
workspace.removeChild(this._endArrow); workspace.removeChild(this._endArrow);
@ -175,14 +175,14 @@ mindplot.RelationshipLine = new Class({
//this._focusShape.setDestControlPoint(ctrlPoints[1]); //this._focusShape.setDestControlPoint(ctrlPoints[1]);
}, },
addEventListener : function(type, listener) { addEvent : function(type, listener) {
// Translate to web 2d events ... // Translate to web 2d events ...
if (type == 'onfocus') { if (type == 'onfocus') {
type = 'mousedown'; type = 'mousedown';
} }
var line = this._line2d; var line = this._line2d;
line.addEventListener(type, listener); line.addEvent(type, listener);
}, },
isOnFocus : function() { isOnFocus : function() {

View File

@ -24,7 +24,7 @@ mindplot.ShirinkConnector = new Class({
elipse.setFill('#f7f7f7'); elipse.setFill('#f7f7f7');
elipse.setSize(mindplot.Topic.CONNECTOR_WIDTH, mindplot.Topic.CONNECTOR_WIDTH); elipse.setSize(mindplot.Topic.CONNECTOR_WIDTH, mindplot.Topic.CONNECTOR_WIDTH);
elipse.addEventListener('click', function(event) { elipse.addEvent('click', function(event) {
var model = topic.getModel(); var model = topic.getModel();
var collapse = !model.areChildrenShrinked(); var collapse = !model.areChildrenShrinked();
@ -37,24 +37,25 @@ mindplot.ShirinkConnector = new Class({
}); });
elipse.addEventListener('mousedown', function(event) { elipse.addEvent('mousedown', function(event) {
// Avoid node creation ... // Avoid node creation ...
var e = new Event(event).stop(); var e = new Event(event).stop();
e.preventDefault(); e.preventDefault();
}); });
elipse.addEventListener('dblclick', function(event) { elipse.addEvent('dblclick', function(event) {
// Avoid node creation ... // Avoid node creation ...
event = new Event(event).stop(); event = new Event(event).stop();
event.preventDefault(); event.preventDefault();
}); });
elipse.addEventListener('mouseover', function(event) { elipse.addEvent('mouseover', function(event) {
this.setFill('#009900');
this.setFill('rgb(153, 0, 255)');
}); });
elipse.addEventListener('mouseout', function(event) { elipse.addEvent('mouseout', function(event) {
var color = topic.getBackgroundColor(); var color = topic.getBackgroundColor();
this.setFill(color); this.setFill(color);
}); });

View File

@ -45,7 +45,7 @@ mindplot.TextEditor = new Class({
var inputText = new Element('input', {type:"text",tabindex:'-1', value:""}); var inputText = new Element('input', {type:"text",tabindex:'-1', value:""});
inputText.setStyles({ inputText.setStyles({
border:"none", border:"none",
background:"transparent" background:"red"
}); });
inputText.inject(inputContainer); inputText.inject(inputContainer);

View File

@ -43,11 +43,11 @@ mindplot.Topic = new Class({
this.setMouseEventsEnabled(true); this.setMouseEventsEnabled(true);
// Prevent click on the topics being propagated ... // Prevent click on the topics being propagated ...
this.addEventListener('click', function(event) { this.addEvent('click', function(event) {
event.stopPropagation(); event.stopPropagation();
}); });
this.addEventListener('dblclick', function (event) { this.addEvent('dblclick', function (event) {
this._textEditor.show(); this._textEditor.show();
event.stopPropagation(true); event.stopPropagation(true);
}.bind(this)); }.bind(this));
@ -83,7 +83,7 @@ mindplot.Topic = new Class({
if ($defined(dispatcher)) { if ($defined(dispatcher)) {
for (var i = 1; i < dispatcher._listeners.length; i++) { for (var i = 1; i < dispatcher._listeners.length; i++) {
innerShape.addEventListener('mousedown', dispatcher._listeners[i]); innerShape.addEvent('mousedown', dispatcher._listeners[i]);
} }
} }
@ -373,17 +373,8 @@ mindplot.Topic = new Class({
this._icon = null; this._icon = null;
} }
} }
/*var elem = this;
var executor = function(editor)
{
return function()
{
elem.updateNode();
};
};
setTimeout(executor(this), 0);*/ this.updateNode.delay(0, this);
core.Executor.instance.delay(this.updateNode, 0, this);
this._note = null; this._note = null;
this._hasNote = false; this._hasNote = false;
}, },
@ -414,7 +405,7 @@ mindplot.Topic = new Class({
if (!disableEventsListeners) { if (!disableEventsListeners) {
// Propagate mouse events ... // Propagate mouse events ...
var topic = this; var topic = this;
result.addEventListener('mousedown', function(event) { result.addEvent('mousedown', function(event) {
var eventDispatcher = topic.getInnerShape()._dispatcherByEventType['mousedown']; var eventDispatcher = topic.getInnerShape()._dispatcherByEventType['mousedown'];
if ($defined(eventDispatcher)) { if ($defined(eventDispatcher)) {
eventDispatcher.eventListener(event); eventDispatcher.eventListener(event);
@ -466,7 +457,7 @@ mindplot.Topic = new Class({
var model = this.getModel(); var model = this.getModel();
model.setFontFamily(value); model.setFontFamily(value);
} }
core.Executor.instance.delay(this.updateNode, 0, this, [updateModel]); this.updateNode.delay(0, this, [updateModel]);
}, },
setFontSize : function(value, updateModel) { setFontSize : function(value, updateModel) {
@ -476,7 +467,7 @@ mindplot.Topic = new Class({
var model = this.getModel(); var model = this.getModel();
model.setFontSize(value); model.setFontSize(value);
} }
core.Executor.instance.delay(this.updateNode, 0, this, [updateModel]); this.updateNode.delay(0, this, [updateModel]);
}, },
@ -487,7 +478,7 @@ mindplot.Topic = new Class({
var model = this.getModel(); var model = this.getModel();
model.setFontStyle(value); model.setFontStyle(value);
} }
core.Executor.instance.delay(this.updateNode, 0, this, [updateModel]); this.updateNode.delay(0, this, [updateModel]);
}, },
setFontWeight : function(value, updateModel) { setFontWeight : function(value, updateModel) {
@ -561,7 +552,7 @@ mindplot.Topic = new Class({
_setText : function(text, updateModel) { _setText : function(text, updateModel) {
var textShape = this.getTextShape(); var textShape = this.getTextShape();
textShape.setText(text); textShape.setText(text);
core.Executor.instance.delay(this.updateNode, 0, this, [updateModel]); this.updateNode.delay(0, this, [updateModel]);
if ($defined(updateModel) && updateModel) { if ($defined(updateModel) && updateModel) {
var model = this.getModel(); var model = this.getModel();
@ -674,14 +665,14 @@ mindplot.Topic = new Class({
topic.handleMouseOver(event); topic.handleMouseOver(event);
} }
}; };
elem.addEventListener('mouseover', mouseOver); elem.addEvent('mouseover', mouseOver);
var outout = function(event) { var outout = function(event) {
if (topic.isMouseEventsEnabled()) { if (topic.isMouseEventsEnabled()) {
topic.handleMouseOut(event); topic.handleMouseOut(event);
} }
}; };
elem.addEventListener('mouseout', outout); elem.addEvent('mouseout', outout);
// Focus events ... // Focus events ...
var mouseDown = function(event) { var mouseDown = function(event) {
@ -693,7 +684,7 @@ mindplot.Topic = new Class({
} }
topic.setOnFocus(value); topic.setOnFocus(value);
}.bind(this); }.bind(this);
elem.addEventListener('mousedown', mouseDown); elem.addEvent('mousedown', mouseDown);
}, },
areChildrenShrinked : function() { areChildrenShrinked : function() {
@ -937,23 +928,23 @@ mindplot.Topic = new Class({
* type: * type:
* onfocus * onfocus
*/ */
addEventListener : function(type, listener) { addEvent : function(type, listener) {
// Translate to web 2d events ... // Translate to web 2d events ...
if (type == 'onfocus') { if (type == 'onfocus') {
type = 'mousedown'; type = 'mousedown';
} }
var shape = this.get2DElement(); var shape = this.get2DElement();
shape.addEventListener(type, listener); shape.addEvent(type, listener);
}, },
removeEventListener : function(type, listener) { removeEvent : function(type, listener) {
// Translate to web 2d events ... // Translate to web 2d events ...
if (type == 'onfocus') { if (type == 'onfocus') {
type = 'mousedown'; type = 'mousedown';
} }
var shape = this.get2DElement(); var shape = this.get2DElement();
shape.removeEventListener(type, listener); shape.removeEvent(type, listener);
}, },
@ -1135,6 +1126,10 @@ mindplot.Topic = new Class({
if ($defined(targetTopic)) { if ($defined(targetTopic)) {
result.connectTo(targetTopic); result.connectTo(targetTopic);
} }
// If a drag node is create for it, let's hide the editor.
this._textEditor.close();
return result; return result;
}, },

View File

@ -87,12 +87,12 @@ mindplot.Workspace = new Class({
} }
}, },
addEventListener: function(type, listener) { addEvent: function(type, listener) {
this._workspace.addEventListener(type, listener); this._workspace.addEvent(type, listener);
}, },
removeEventListener: function(type, listener) { removeEvent: function(type, listener) {
this._workspace.removeEventListener(type, listener); this._workspace.removeEvent(type, listener);
}, },
getSize: function() { getSize: function() {

View File

@ -52,7 +52,7 @@ mindplot.layout.FreeMindLayoutManager = mindplot.layout.BaseLayoutManager.extend
var id = topic.getId(); var id = topic.getId();
// Register node listeners ... // Register node listeners ...
var designer = this.getDesigner(); var designer = this.getDesigner();
topic.addEventListener('click', function(event) topic.addEvent('click', function(event)
{ {
designer.onObjectFocusEvent.attempt([topic, event], designer); designer.onObjectFocusEvent.attempt([topic, event], designer);
}); });
@ -60,7 +60,7 @@ mindplot.layout.FreeMindLayoutManager = mindplot.layout.BaseLayoutManager.extend
// Add drag behaviour ... // Add drag behaviour ...
if (topic.getType() != mindplot.model.NodeModel.CENTRAL_TOPIC_TYPE) if (topic.getType() != mindplot.model.NodeModel.CENTRAL_TOPIC_TYPE)
{ {
topic.addEventListener("mousedown",this._reconnectMouseDownListener.bindWithEvent(this,[topic])); topic.addEvent("mousedown",this._reconnectMouseDownListener.bindWithEvent(this,[topic]));
} }
}, },
@ -97,11 +97,11 @@ mindplot.layout.FreeMindLayoutManager = mindplot.layout.BaseLayoutManager.extend
// Register mouse move listener ... // Register mouse move listener ...
this._mouseMoveListenerInstance = this._mouseMoveListener.bindWithEvent(this,[topic]); this._mouseMoveListenerInstance = this._mouseMoveListener.bindWithEvent(this,[topic]);
screen.addEventListener('mousemove', this._mouseMoveListenerInstance); screen.addEvent('mousemove', this._mouseMoveListenerInstance);
// Register mouse up listeners ... // Register mouse up listeners ...
this._mouseUpListenerInstance = this._mouseUpListener.bindWithEvent(this,[topic]); this._mouseUpListenerInstance = this._mouseUpListener.bindWithEvent(this,[topic]);
screen.addEventListener('mouseup', this._mouseUpListenerInstance); screen.addEvent('mouseup', this._mouseUpListenerInstance);
// Change cursor. // Change cursor.
window.document.body.style.cursor = 'move'; window.document.body.style.cursor = 'move';
@ -192,8 +192,8 @@ mindplot.layout.FreeMindLayoutManager = mindplot.layout.BaseLayoutManager.extend
var screen = this._designer.getWorkSpace().getScreenManager(); var screen = this._designer.getWorkSpace().getScreenManager();
// Remove all the events. // Remove all the events.
screen.removeEventListener('mousemove', this._mouseMoveListenerInstance); screen.removeEvent('mousemove', this._mouseMoveListenerInstance);
screen.removeEventListener('mouseup', this._mouseUpListenerInstance); screen.removeEvent('mouseup', this._mouseUpListenerInstance);
delete this._mouseMoveListenerInstance; delete this._mouseMoveListenerInstance;
delete this._mouseUpListenerInstance; delete this._mouseUpListenerInstance;
@ -289,7 +289,7 @@ mindplot.layout.FreeMindLayoutManager = mindplot.layout.BaseLayoutManager.extend
mindplot.EventBus.instance.addEvent(mindplot.EventBus.events.NodeMouseOverEvent,show); mindplot.EventBus.instance.addEvent(mindplot.EventBus.events.NodeMouseOverEvent,show);
mindplot.EventBus.instance.addEvent(mindplot.EventBus.events.NodeMouseOutEvent,hide); mindplot.EventBus.instance.addEvent(mindplot.EventBus.events.NodeMouseOutEvent,hide);
node.addHelper(moveShape); node.addHelper(moveShape);
moveShape.addEventListener("mousedown",this._mousedownListener.bindWithEvent(this,[node])); moveShape.addEvent("mousedown",this._mousedownListener.bindWithEvent(this,[node]));
}, },
needsPrepositioning:function(){ needsPrepositioning:function(){
@ -320,10 +320,10 @@ mindplot.layout.FreeMindLayoutManager = mindplot.layout.BaseLayoutManager.extend
topics[i].setMouseEventsEnabled(false); topics[i].setMouseEventsEnabled(false);
if(topics[i].getId()!=topic.getId()){ if(topics[i].getId()!=topic.getId()){
var overListener = this._reconnectMouseOverListener.bindWithEvent(topics[i],[this]); var overListener = this._reconnectMouseOverListener.bindWithEvent(topics[i],[this]);
topics[i].addEventListener('mouseover',overListener); topics[i].addEvent('mouseover',overListener);
this._mouseOverListeners.set(topics[i].getId(),overListener); this._mouseOverListeners.set(topics[i].getId(),overListener);
var outListener = this._reconnectMouseOutListener.bindWithEvent(topics[i],[this]); var outListener = this._reconnectMouseOutListener.bindWithEvent(topics[i],[this]);
topics[i].addEventListener('mouseout',outListener); topics[i].addEvent('mouseout',outListener);
this._mouseOutListeners.set(topics[i].getId(),outListener); this._mouseOutListeners.set(topics[i].getId(),outListener);
} }
} }
@ -342,11 +342,11 @@ mindplot.layout.FreeMindLayoutManager = mindplot.layout.BaseLayoutManager.extend
// Register mouse move listener ... // Register mouse move listener ...
this._mouseMoveListenerInstance = this._reconnectMouseMoveListener.bindWithEvent(this,[topic]); this._mouseMoveListenerInstance = this._reconnectMouseMoveListener.bindWithEvent(this,[topic]);
screen.addEventListener('mousemove', this._mouseMoveListenerInstance); screen.addEvent('mousemove', this._mouseMoveListenerInstance);
// Register mouse up listeners ... // Register mouse up listeners ...
this._mouseUpListenerInstance = this._reconnectMouseUpListener.bindWithEvent(this,[topic]); this._mouseUpListenerInstance = this._reconnectMouseUpListener.bindWithEvent(this,[topic]);
screen.addEventListener('mouseup', this._mouseUpListenerInstance); screen.addEvent('mouseup', this._mouseUpListenerInstance);
// Change cursor. // Change cursor.
window.document.body.style.cursor = 'move'; window.document.body.style.cursor = 'move';
@ -390,8 +390,8 @@ mindplot.layout.FreeMindLayoutManager = mindplot.layout.BaseLayoutManager.extend
_reconnectMouseUpListener:function(event, node){ _reconnectMouseUpListener:function(event, node){
var screen = this._designer.getWorkSpace().getScreenManager(); var screen = this._designer.getWorkSpace().getScreenManager();
// Remove all the events. // Remove all the events.
screen.removeEventListener('mousemove', this._mouseMoveListenerInstance); screen.removeEvent('mousemove', this._mouseMoveListenerInstance);
screen.removeEventListener('mouseup', this._mouseUpListenerInstance); screen.removeEvent('mouseup', this._mouseUpListenerInstance);
delete this._mouseMoveListenerInstance; delete this._mouseMoveListenerInstance;
delete this._mouseUpListenerInstance; delete this._mouseUpListenerInstance;
@ -402,9 +402,9 @@ mindplot.layout.FreeMindLayoutManager = mindplot.layout.BaseLayoutManager.extend
topics[i].setMouseEventsEnabled(true); topics[i].setMouseEventsEnabled(true);
if(topics[i].getId()!=node.getId()){ if(topics[i].getId()!=node.getId()){
var overListener = this._mouseOverListeners.get(topics[i].getId()); var overListener = this._mouseOverListeners.get(topics[i].getId());
topics[i].removeEventListener('mouseover',overListener); topics[i].removeEvent('mouseover',overListener);
var outListener = this._mouseOutListeners.get(topics[i].getId()); var outListener = this._mouseOutListeners.get(topics[i].getId());
topics[i].removeEventListener('mouseout',outListener); topics[i].removeEvent('mouseout',outListener);
} }
} }

View File

@ -83,19 +83,19 @@ mindplot.layout.OriginalLayoutManager = new Class({
var dragTopicPositioner = this.getDragTopicPositioner(); var dragTopicPositioner = this.getDragTopicPositioner();
dragger.addEventListener('startdragging', function(event, node) { dragger.addEvent('startdragging', function(event, node) {
// Enable all mouse events. // Enable all mouse events.
for (var i = 0; i < topics.length; i++) { for (var i = 0; i < topics.length; i++) {
topics[i].setMouseEventsEnabled(false); topics[i].setMouseEventsEnabled(false);
} }
}); });
dragger.addEventListener('dragging', function(event, dragTopic) { dragger.addEvent('dragging', function(event, dragTopic) {
// Update the state and connections of the topic ... // Update the state and connections of the topic ...
dragTopicPositioner.positionateDragTopic(dragTopic); dragTopicPositioner.positionateDragTopic(dragTopic);
}); });
dragger.addEventListener('enddragging', function(event, dragTopic) { dragger.addEvent('enddragging', function(event, dragTopic) {
// Enable all mouse events. // Enable all mouse events.
for (var i = 0; i < topics.length; i++) { for (var i = 0; i < topics.length; i++) {
topics[i].setMouseEventsEnabled(true); topics[i].setMouseEventsEnabled(true);

View File

@ -56,7 +56,7 @@ mindplot.widget.Menu = new Class({
}, },
setValue: function(value) { setValue: function(value) {
designer.setFont2SelectedNode(value); designer.changeFontFamily(value);
} }
}; };
@ -77,7 +77,7 @@ mindplot.widget.Menu = new Class({
return result; return result;
}, },
setValue: function(value) { setValue: function(value) {
designer.setFontSize2SelectedNode(value); designer.changeFontSize(value);
} }
}; };
this._toolbarElems.push(new mindplot.widget.FontSizePanel("fontSize", fontSizeModel)); this._toolbarElems.push(new mindplot.widget.FontSizePanel("fontSize", fontSizeModel));
@ -97,7 +97,7 @@ mindplot.widget.Menu = new Class({
return result; return result;
}, },
setValue: function(value) { setValue: function(value) {
designer.setShape2SelectedNode(value); designer.changeTopicShape(value);
} }
}; };
this._toolbarElems.push(new mindplot.widget.TopicShapePanel("topicShape", topicShapeModel)); this._toolbarElems.push(new mindplot.widget.TopicShapePanel("topicShape", topicShapeModel));
@ -108,7 +108,7 @@ mindplot.widget.Menu = new Class({
return null; return null;
}, },
setValue: function(value) { setValue: function(value) {
designer.addIconType2SelectedNode(value); designer.addIconType(value);
} }
}; };
this._toolbarElems.push(new mindplot.widget.IconPanel('topicIcon', topicIconModel)); this._toolbarElems.push(new mindplot.widget.IconPanel('topicIcon', topicIconModel));
@ -130,7 +130,7 @@ mindplot.widget.Menu = new Class({
return result; return result;
}, },
setValue : function (hex) { setValue : function (hex) {
designer.setBackColor2SelectedNode(hex); designer.changeBackgroundColor(hex);
} }
}; };
this._toolbarElems.push(new mindplot.widget.ColorPalettePanel('topicColor', topicColorModel, baseUrl)); this._toolbarElems.push(new mindplot.widget.ColorPalettePanel('topicColor', topicColorModel, baseUrl));
@ -152,7 +152,7 @@ mindplot.widget.Menu = new Class({
return result; return result;
}, },
setValue : function (hex) { setValue : function (hex) {
designer.setBorderColor2SelectedNode(hex); designer.changeBorderColor(hex);
} }
}; };
this._toolbarElems.push(new mindplot.widget.ColorPalettePanel('topicBorder', borderColorModel, baseUrl)); this._toolbarElems.push(new mindplot.widget.ColorPalettePanel('topicBorder', borderColorModel, baseUrl));
@ -174,7 +174,7 @@ mindplot.widget.Menu = new Class({
return result; return result;
}, },
setValue : function (hex) { setValue : function (hex) {
designer.setFontColor2SelectedNode(hex); designer.changeFontColor(hex);
} }
}; };
this._toolbarElems.push(new mindplot.widget.ColorPalettePanel('fontColor', fontColorModel, baseUrl)); this._toolbarElems.push(new mindplot.widget.ColorPalettePanel('fontColor', fontColorModel, baseUrl));
@ -214,16 +214,16 @@ mindplot.widget.Menu = new Class({
$('topicLink').addEvent('click', function(event) { $('topicLink').addEvent('click', function(event) {
designer.addLink2SelectedNode(); designer.addLink();
}); });
$('topicRelation').addEvent('click', function(event) { $('topicRelation').addEvent('click', function(event) {
designer.addRelationShip2SelectedNode(event); designer.addRelationShip(event);
}); });
$('topicNote').addEvent('click', function(event) { $('topicNote').addEvent('click', function(event) {
designer.addNote2SelectedNode(); designer.addNote();
}); });
@ -235,7 +235,7 @@ mindplot.widget.Menu = new Class({
designer.changeFontStyle(); designer.changeFontStyle();
}); });
designer.addEventListener("modelUpdate", function(event) { designer.addEvent("modelUpdate", function(event) {
if (event.undoSteps > 0) { if (event.undoSteps > 0) {
$("undoEdition").setStyle("background-image", "url(../images/file_undo.png)"); $("undoEdition").setStyle("background-image", "url(../images/file_undo.png)");
} else { } else {

View File

@ -114,20 +114,17 @@
<table class="palette-table" cellspacing="0" cellpadding="0" role="grid"> <table class="palette-table" cellspacing="0" cellpadding="0" role="grid">
<tbody class="palette-body"> <tbody class="palette-body">
<tr class="palette-row"> <tr class="palette-row">
<td class="palette-cell" <td class="palette-cell">
>
<div class="palette-colorswatch" <div class="palette-colorswatch"
style="background-color: rgb(244, 204, 204);" style="background-color: rgb(244, 204, 204);"
title="RGB (244, 204, 204)"></div> title="RGB (244, 204, 204)"></div>
</td> </td>
<td class="palette-cell" <td class="palette-cell">
>
<div class="palette-colorswatch" <div class="palette-colorswatch"
style="background-color: rgb(252, 229, 205);" style="background-color: rgb(252, 229, 205);"
title="RGB (252, 229, 205)"></div> title="RGB (252, 229, 205)"></div>
</td> </td>
<td class="palette-cell" <td class="palette-cell">
>
<div class="palette-colorswatch" <div class="palette-colorswatch"
style="background-color: rgb(255, 242, 204);" style="background-color: rgb(255, 242, 204);"
title="RGB (255, 242, 204)"></div> title="RGB (255, 242, 204)"></div>
@ -337,7 +334,7 @@
<td class="palette-cell" <td class="palette-cell"
> >
<div class="palette-colorswatch" <div class="palette-colorswatch"
style="background-color: #525c61;" style="background-color: rgb(53, 28, 117)"
title="RGB (53, 28, 117)"></div> title="RGB (53, 28, 117)"></div>
</td> </td>
<td class="palette-cell" <td class="palette-cell"

View File

@ -93,7 +93,7 @@ web2d.Element.prototype._supportedEvents = ["click","dblclick","mousemove","mous
* The following events types are supported: * The following events types are supported:
* *
*/ */
web2d.Element.prototype.addEventListener = function(type, listener) web2d.Element.prototype.addEvent = function(type, listener)
{ {
if (!this._supportedEvents.include(type)) if (!this._supportedEvents.include(type))
{ {
@ -106,7 +106,7 @@ web2d.Element.prototype.addEventListener = function(type, listener)
this._dispatcherByEventType[type] = new web2d.EventDispatcher(this); this._dispatcherByEventType[type] = new web2d.EventDispatcher(this);
var eventListener = this._dispatcherByEventType[type].eventListener; var eventListener = this._dispatcherByEventType[type].eventListener;
this._peer.addEventListener(type, eventListener); this._peer.addEvent(type, eventListener);
} }
this._dispatcherByEventType[type].addListener(type, listener); this._dispatcherByEventType[type].addListener(type, listener);
@ -122,7 +122,7 @@ web2d.Element.prototype.addEventListener = function(type, listener)
* The listener parameter takes an interface implemented by the user which contains the methods to be called when the event occurs. * The listener parameter takes an interface implemented by the user which contains the methods to be called when the event occurs.
* This interace will be invoked passing an event as argument and the 'this' referece in the function will be the element. * This interace will be invoked passing an event as argument and the 'this' referece in the function will be the element.
*/ */
web2d.Element.prototype.removeEventListener = function(type, listener) web2d.Element.prototype.removeEvent = function(type, listener)
{ {
var dispatcher = this._dispatcherByEventType[type]; var dispatcher = this._dispatcherByEventType[type];
if (dispatcher == null) if (dispatcher == null)
@ -134,7 +134,7 @@ web2d.Element.prototype.removeEventListener = function(type, listener)
// If there is not listeners, EventDispatcher must be removed. // If there is not listeners, EventDispatcher must be removed.
if (dispatcher.getListenersCount() <= 0) if (dispatcher.getListenersCount() <= 0)
{ {
this._peer.removeEventListener(type, dispatcher.eventListener); this._peer.removeEvent(type, dispatcher.eventListener);
this._dispatcherByEventType[type] = null; this._dispatcherByEventType[type] = null;
} }
}; };

View File

@ -1,25 +1,23 @@
/* /*
* Copyright [2011] [wisemapping] * Copyright [2011] [wisemapping]
* *
* Licensed under WiseMapping Public License, Version 1.0 (the "License"). * Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the * It is basically the Apache License, Version 2.0 (the "License") plus the
* "powered by wisemapping" text requirement on every single page; * "powered by wisemapping" text requirement on every single page;
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the license at * You may obtain a copy of the license at
* *
* http://www.wisemapping.org/license * http://www.wisemapping.org/license
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
web2d.peer.svg.ElementPeer = function(svgElement) web2d.peer.svg.ElementPeer = function(svgElement) {
{
this._native = svgElement; this._native = svgElement;
this._dblClickListeners = new Hash();
this._size = {width:1,height:1}; this._size = {width:1,height:1};
this._changeListeners = {}; this._changeListeners = {};
// http://support.adobe.com/devsup/devsup.nsf/docs/50493.htm // http://support.adobe.com/devsup/devsup.nsf/docs/50493.htm
@ -28,34 +26,28 @@ web2d.peer.svg.ElementPeer = function(svgElement)
web2d.peer.svg.ElementPeer.prototype.svgNamespace = 'http://www.w3.org/2000/svg'; web2d.peer.svg.ElementPeer.prototype.svgNamespace = 'http://www.w3.org/2000/svg';
web2d.peer.svg.ElementPeer.prototype.linkNamespace = 'http://www.w3.org/1999/xlink'; web2d.peer.svg.ElementPeer.prototype.linkNamespace = 'http://www.w3.org/1999/xlink';
web2d.peer.svg.ElementPeer.prototype.setChildren = function(children) web2d.peer.svg.ElementPeer.prototype.setChildren = function(children) {
{
this._children = children; this._children = children;
}; };
web2d.peer.svg.ElementPeer.prototype.getChildren = function() web2d.peer.svg.ElementPeer.prototype.getChildren = function() {
{
var result = this._children; var result = this._children;
if (!$defined(result)) if (!$defined(result)) {
{
result = []; result = [];
this._children = result; this._children = result;
} }
return result; return result;
}; };
web2d.peer.svg.ElementPeer.prototype.getParent = function() web2d.peer.svg.ElementPeer.prototype.getParent = function() {
{
return this._parent; return this._parent;
}; };
web2d.peer.svg.ElementPeer.prototype.setParent = function(parent) web2d.peer.svg.ElementPeer.prototype.setParent = function(parent) {
{
this._parent = parent; this._parent = parent;
}; };
web2d.peer.svg.ElementPeer.prototype.appendChild = function(elementPeer) web2d.peer.svg.ElementPeer.prototype.appendChild = function(elementPeer) {
{
// Store parent and child relationship. // Store parent and child relationship.
elementPeer.setParent(this); elementPeer.setParent(this);
var children = this.getChildren(); var children = this.getChildren();
@ -69,8 +61,7 @@ web2d.peer.svg.ElementPeer.prototype.appendChild = function(elementPeer)
}; };
web2d.peer.svg.ElementPeer.prototype.removeChild = function(elementPeer) web2d.peer.svg.ElementPeer.prototype.removeChild = function(elementPeer) {
{
// Store parent and child relationship. // Store parent and child relationship.
elementPeer.setParent(null); elementPeer.setParent(null);
var children = this.getChildren(); var children = this.getChildren();
@ -81,85 +72,34 @@ web2d.peer.svg.ElementPeer.prototype.removeChild = function(elementPeer)
children.erase(elementPeer); children.erase(elementPeer);
var newLength = children.length; var newLength = children.length;
if (newLength >= length) if (newLength >= length) {
{
throw "Could not remove the element."; throw "Could not remove the element.";
} }
/*var found = false;
children = children.reject(function(iter)
{
var equals = (iter._native == elementPeer._native);
if (equals)
{
found = true;
}
return equals;
});
// Could found the element ?
if (!found)
{
throw "Could not remove the element.";
}*/
// Append element as a child. // Append element as a child.
this._native.removeChild(elementPeer._native); this._native.removeChild(elementPeer._native);
}; };
/** /**
* http://www.w3.org/TR/DOM-Level-3-Events/events.html * http://www.w3.org/TR/DOM-Level-3-Events/events.html
* http://developer.mozilla.org/en/docs/addEventListener * http://developer.mozilla.org/en/docs/addEvent
*/ */
web2d.peer.svg.ElementPeer.prototype.addEventListener = function(type, listener) web2d.peer.svg.ElementPeer.prototype.addEvent = function(type, listener) {
{
if (type == 'dblclick') this._native.addEventListener(type, listener, false);
{
// This is workaround to support double click...
var dblListener = function(e)
{
if (e.detail >= 2)
{
listener.call(this, e);
}
};
this._dblClickListeners[listener] = dblListener;
this._native.addEventListener(type, dblListener, false);
} else
{
this._native.addEventListener(type, listener, false);
}
}; };
web2d.peer.svg.ElementPeer.prototype.removeEventListener = function(type, listener) web2d.peer.svg.ElementPeer.prototype.removeEvent = function(type, listener) {
{ this._native.removeEventListener(type, listener, false);
if (type == 'dblclick')
{
// This is workaround to support double click...
var dblClickListener = this._dblClickListeners[listener];
if (dblClickListener == null)
{
throw "Could not find listener to remove";
}
type = 'click';
this._native.removeEventListener(type, dblClickListener, false);
delete this._dblClickListeners[listener];
} else
{
this._native.removeEventListener(type, listener, false);
}
}; };
web2d.peer.svg.ElementPeer.prototype.setSize = function(width, height) web2d.peer.svg.ElementPeer.prototype.setSize = function(width, height) {
{ if ($defined(width) && this._size.width != parseInt(width)) {
if ($defined(width) && this._size.width != parseInt(width))
{
this._size.width = parseInt(width); this._size.width = parseInt(width);
this._native.setAttribute('width', parseInt(width)); this._native.setAttribute('width', parseInt(width));
} }
if ($defined(height) && this._size.height != parseInt(height)) if ($defined(height) && this._size.height != parseInt(height)) {
{
this._size.height = parseInt(height); this._size.height = parseInt(height);
this._native.setAttribute('height', parseInt(height)); this._native.setAttribute('height', parseInt(height));
} }
@ -167,32 +107,26 @@ web2d.peer.svg.ElementPeer.prototype.setSize = function(width, height)
web2d.peer.utils.EventUtils.broadcastChangeEvent(this, "strokeStyle"); web2d.peer.utils.EventUtils.broadcastChangeEvent(this, "strokeStyle");
}; };
web2d.peer.svg.ElementPeer.prototype.getSize = function() web2d.peer.svg.ElementPeer.prototype.getSize = function() {
{
return {width:this._size.width,height:this._size.height}; return {width:this._size.width,height:this._size.height};
}; };
web2d.peer.svg.ElementPeer.prototype.setFill = function(color, opacity) web2d.peer.svg.ElementPeer.prototype.setFill = function(color, opacity) {
{ if ($defined(color)) {
if ($defined(color))
{
this._native.setAttribute('fill', color); this._native.setAttribute('fill', color);
} }
if ($defined(opacity)) if ($defined(opacity)) {
{
this._native.setAttribute('fill-opacity', opacity); this._native.setAttribute('fill-opacity', opacity);
} }
}; };
web2d.peer.svg.ElementPeer.prototype.getFill = function() web2d.peer.svg.ElementPeer.prototype.getFill = function() {
{
var color = this._native.getAttribute('fill'); var color = this._native.getAttribute('fill');
var opacity = this._native.getAttribute('fill-opacity'); var opacity = this._native.getAttribute('fill-opacity');
return {color:color, opacity:Number(opacity)}; return {color:color, opacity:Number(opacity)};
}; };
web2d.peer.svg.ElementPeer.prototype.getStroke = function() web2d.peer.svg.ElementPeer.prototype.getStroke = function() {
{
var vmlStroke = this._native; var vmlStroke = this._native;
var color = vmlStroke.getAttribute('stroke'); var color = vmlStroke.getAttribute('stroke');
var dashstyle = this._stokeStyle; var dashstyle = this._stokeStyle;
@ -202,18 +136,14 @@ web2d.peer.svg.ElementPeer.prototype.getStroke = function()
}; };
web2d.peer.svg.ElementPeer.prototype.__stokeStyleToStrokDasharray = {solid:[],dot:[1,3],dash:[4,3],longdash:[10,2],dashdot:[5,3,1,3]}; web2d.peer.svg.ElementPeer.prototype.__stokeStyleToStrokDasharray = {solid:[],dot:[1,3],dash:[4,3],longdash:[10,2],dashdot:[5,3,1,3]};
web2d.peer.svg.ElementPeer.prototype.setStroke = function(width, style, color, opacity) web2d.peer.svg.ElementPeer.prototype.setStroke = function(width, style, color, opacity) {
{ if ($defined(width)) {
if ($defined(width))
{
this._native.setAttribute('stroke-width', width + "px"); this._native.setAttribute('stroke-width', width + "px");
} }
if ($defined(color)) if ($defined(color)) {
{
this._native.setAttribute('stroke', color); this._native.setAttribute('stroke', color);
} }
if ($defined(style)) if ($defined(style)) {
{
// Scale the dash array in order to be equal to VML. In VML, stroke style doesn't scale. // Scale the dash array in order to be equal to VML. In VML, stroke style doesn't scale.
var dashArrayPoints = this.__stokeStyleToStrokDasharray[style]; var dashArrayPoints = this.__stokeStyleToStrokDasharray[style];
var scale = 1 / web2d.peer.utils.TransformUtil.workoutScale(this).width; var scale = 1 / web2d.peer.utils.TransformUtil.workoutScale(this).width;
@ -222,8 +152,7 @@ web2d.peer.svg.ElementPeer.prototype.setStroke = function(width, style, color, o
strokeWidth = parseFloat(strokeWidth); strokeWidth = parseFloat(strokeWidth);
var scaledPoints = []; var scaledPoints = [];
for (var i = 0; i < dashArrayPoints.length; i++) for (var i = 0; i < dashArrayPoints.length; i++) {
{
// VML scale the stroke based on the stroke width. // VML scale the stroke based on the stroke width.
scaledPoints[i] = dashArrayPoints[i] * strokeWidth; scaledPoints[i] = dashArrayPoints[i] * strokeWidth;
@ -235,53 +164,43 @@ web2d.peer.svg.ElementPeer.prototype.setStroke = function(width, style, color, o
this._stokeStyle = style; this._stokeStyle = style;
} }
if ($defined(opacity)) if ($defined(opacity)) {
{
this._native.setAttribute('stroke-opacity', opacity); this._native.setAttribute('stroke-opacity', opacity);
} }
}; };
/* /*
* style='visibility: visible' * style='visibility: visible'
*/ */
web2d.peer.svg.ElementPeer.prototype.setVisibility = function(isVisible) web2d.peer.svg.ElementPeer.prototype.setVisibility = function(isVisible) {
{
this._native.setAttribute('visibility', (isVisible) ? 'visible' : 'hidden'); this._native.setAttribute('visibility', (isVisible) ? 'visible' : 'hidden');
}; };
web2d.peer.svg.ElementPeer.prototype.isVisible = function() web2d.peer.svg.ElementPeer.prototype.isVisible = function() {
{
var visibility = this._native.getAttribute('visibility'); var visibility = this._native.getAttribute('visibility');
return !(visibility == 'hidden'); return !(visibility == 'hidden');
}; };
web2d.peer.svg.ElementPeer.prototype.updateStrokeStyle = function() web2d.peer.svg.ElementPeer.prototype.updateStrokeStyle = function() {
{
var strokeStyle = this._stokeStyle; var strokeStyle = this._stokeStyle;
if (this.getParent()) if (this.getParent()) {
{ if (strokeStyle && strokeStyle != 'solid') {
if (strokeStyle && strokeStyle != 'solid')
{
this.setStroke(null, strokeStyle); this.setStroke(null, strokeStyle);
} }
} }
}; };
web2d.peer.svg.ElementPeer.prototype.attachChangeEventListener = function(type, listener) web2d.peer.svg.ElementPeer.prototype.attachChangeEventListener = function(type, listener) {
{
var listeners = this.getChangeEventListeners(type); var listeners = this.getChangeEventListeners(type);
if (!$defined(listener)) if (!$defined(listener)) {
{
throw "Listener can not be null"; throw "Listener can not be null";
} }
listeners.push(listener); listeners.push(listener);
}; };
web2d.peer.svg.ElementPeer.prototype.getChangeEventListeners = function(type) web2d.peer.svg.ElementPeer.prototype.getChangeEventListeners = function(type) {
{
var listeners = this._changeListeners[type]; var listeners = this._changeListeners[type];
if (!$defined(listeners)) if (!$defined(listeners)) {
{
listeners = []; listeners = [];
this._changeListeners[type] = listeners; this._changeListeners[type] = listeners;
} }
@ -291,20 +210,17 @@ web2d.peer.svg.ElementPeer.prototype.getChangeEventListeners = function(type)
/** /**
* Move element to the front * Move element to the front
*/ */
web2d.peer.svg.ElementPeer.prototype.moveToFront = function() web2d.peer.svg.ElementPeer.prototype.moveToFront = function() {
{
this._native.parentNode.appendChild(this._native); this._native.parentNode.appendChild(this._native);
}; };
/** /**
* Move element to the back * Move element to the back
*/ */
web2d.peer.svg.ElementPeer.prototype.moveToBack = function() web2d.peer.svg.ElementPeer.prototype.moveToBack = function() {
{
this._native.parentNode.insertBefore(this._native, this._native.parentNode.firstChild); this._native.parentNode.insertBefore(this._native, this._native.parentNode.firstChild);
}; };
web2d.peer.svg.ElementPeer.prototype.setCursor = function(type) web2d.peer.svg.ElementPeer.prototype.setCursor = function(type) {
{
this._native.style.cursor = type; this._native.style.cursor = type;
}; };

View File

@ -239,8 +239,8 @@ function testElementEventHandling()
var listener = function() { /* Dummy event listener */ var listener = function() { /* Dummy event listener */
}; };
elem.addEventListener(eventType, listener); elem.addEvent(eventType, listener);
elem.removeEventListener(eventType, listener); elem.removeEvent(eventType, listener);
}; };
testEventHandling(workspace, null, 'mouseover'); testEventHandling(workspace, null, 'mouseover');

View File

@ -59,13 +59,13 @@ function testEventTest()
alert("My Listener 2"); alert("My Listener 2");
}; };
workspace.addEventListener("click", firstListener); workspace.addEvent("click", firstListener);
// Handle gracefully invalid event types... // Handle gracefully invalid event types...
var catchException = false var catchException = false
try try
{ {
workspace.addEventListener("click2", firstListener); workspace.addEvent("click2", firstListener);
} catch(e) } catch(e)
{ {
catchException = true; catchException = true;
@ -77,7 +77,7 @@ function testEventTest()
catchException = false catchException = false
try try
{ {
workspace.removeEventListener("click", secondListener); workspace.removeEvent("click", secondListener);
} catch(e) } catch(e)
{ {
catchException = true; catchException = true;
@ -85,13 +85,13 @@ function testEventTest()
assert("Invalid remove operation seems to be broken", catchException); assert("Invalid remove operation seems to be broken", catchException);
//// Remove a valid listener. //// Remove a valid listener.
workspace.removeEventListener("click", firstListener); workspace.removeEvent("click", firstListener);
//// It has been removed? //// It has been removed?
catchException = false; catchException = false;
try try
{ {
workspace.removeEventListener("click", firstListener); workspace.removeEvent("click", firstListener);
} catch(e) } catch(e)
{ {
catchException = true; catchException = true;
@ -101,16 +101,16 @@ function testEventTest()
// Check multiple registation of a type ... // Check multiple registation of a type ...
//// Add two listeners ... //// Add two listeners ...
workspace.addEventListener("dblclick", firstListener); workspace.addEvent("dblclick", firstListener);
workspace.addEventListener("dblclick", secondListener); workspace.addEvent("dblclick", secondListener);
//// Remove it ... //// Remove it ...
workspace.removeEventListener("dblclick", firstListener); workspace.removeEvent("dblclick", firstListener);
workspace.removeEventListener("dblclick", secondListener); workspace.removeEvent("dblclick", secondListener);
/// Check multiple registration on different types ... /// Check multiple registration on different types ...
workspace.addEventListener("click", firstListener); workspace.addEvent("click", firstListener);
workspace.addEventListener("mouseover", secondListener); workspace.addEvent("mouseover", secondListener);
} }

View File

@ -73,10 +73,10 @@
this._enable = !this._enable; this._enable = !this._enable;
if (this._enable) if (this._enable)
{ {
this._element.addEventListener(this._type, this._listener); this._element.addEvent(this._type, this._listener);
} else } else
{ {
this._element.removeEventListener(this._type, this._listener); this._element.removeEvent(this._type, this._listener);
} }
return this._enable; return this._enable;
}; };
@ -95,7 +95,7 @@
alert("Listener #:" + count); alert("Listener #:" + count);
}; };
this._listeners.push(listener); this._listeners.push(listener);
this._element.addEventListener(this._type, listener); this._element.addEvent(this._type, listener);
} }
@ -109,7 +109,7 @@
if (this._listeners.length > 0) if (this._listeners.length > 0)
{ {
var listener = this._listeners.pop(); var listener = this._listeners.pop();
this._element.removeEventListener(this._type, listener); this._element.removeEvent(this._type, listener);
} }
} }

View File

@ -135,9 +135,9 @@
var listener = function(e) { var listener = function(e) {
alert("Click event on:" + this.getType()) alert("Click event on:" + this.getType())
}; };
group.addEventListener("click", listener); group.addEvent("click", listener);
elipseLeft.addEventListener("click", listener); elipseLeft.addEvent("click", listener);
elipseRight.addEventListener("click", listener); elipseRight.addEvent("click", listener);
workspace.addItAsChildTo($("groupEventsContainer")); workspace.addItAsChildTo($("groupEventsContainer"));
} }
@ -301,7 +301,7 @@
group.setSize(100, 100); group.setSize(100, 100);
group.setPosition(0, 0); group.setPosition(0, 0);
group.setCoordSize(100, 100); group.setCoordSize(100, 100);
group.addEventListener("mouseover", function() { group.addEvent("mouseover", function() {
alert("Mouse Over Group"); alert("Mouse Over Group");
}); });
workspace.appendChild(group); workspace.appendChild(group);
@ -309,7 +309,7 @@
elipseOuter = new web2d.Elipse(); elipseOuter = new web2d.Elipse();
elipseOuter.setPosition(50, 50); elipseOuter.setPosition(50, 50);
elipseOuter.setSize(50, 50); elipseOuter.setSize(50, 50);
group.addEventListener("mouseover", function() { group.addEvent("mouseover", function() {
alert("Mouse Over elipseOuter"); alert("Mouse Over elipseOuter");
}); });
group.appendChild(elipseOuter); group.appendChild(elipseOuter);

View File

@ -112,17 +112,17 @@
workspace.appendChild(nodeGroup); workspace.appendChild(nodeGroup);
// Add behaviour ... // Add behaviour ...
inerRect.addEventListener("mouseover", function() { inerRect.addEvent("mouseover", function() {
outerRect.setVisibility(true); outerRect.setVisibility(true);
}); });
inerRect.addEventListener("mouseout", function() { inerRect.addEvent("mouseout", function() {
if (!nodeGroup._drag) if (!nodeGroup._drag)
{ {
outerRect.setVisibility(false); outerRect.setVisibility(false);
} }
}); });
nodeGroup.addEventListener("mousedown", function(e) nodeGroup.addEvent("mousedown", function(e)
{ {
var shadowGroup = new web2d.Group(); var shadowGroup = new web2d.Group();
shadowGroup.setSize(200, 60); shadowGroup.setSize(200, 60);
@ -165,7 +165,7 @@
shadowGroup.setPosition(posx - 50, posy - 150); shadowGroup.setPosition(posx - 50, posy - 150);
}; };
} }
workspace.addEventListener("mousemove", workspace._moveFunction); workspace.addEvent("mousemove", workspace._moveFunction);
var mouseUp = function(e) var mouseUp = function(e)
{ {
@ -175,11 +175,11 @@
nodeGroup.setPosition(pos.x, pos.y); nodeGroup.setPosition(pos.x, pos.y);
nodeGroup._drag = false; nodeGroup._drag = false;
outerRect.setVisibility(true); outerRect.setVisibility(true);
workspace.removeEventListener("mousemove", workspace._moveFunction); workspace.removeEvent("mousemove", workspace._moveFunction);
workspace.removeEventListener("mouseup", mouseUp); workspace.removeEvent("mouseup", mouseUp);
}; };
workspace.addEventListener("mouseup", mouseUp); workspace.addEvent("mouseup", mouseUp);
}); });

View File

@ -246,7 +246,7 @@
var rect = new web2d.Rect(0, rectAttributes); var rect = new web2d.Rect(0, rectAttributes);
rect.setPosition(120, 20); rect.setPosition(120, 20);
workspace.appendChild(rect); workspace.appendChild(rect);
rect.addEventListener("mouseover", function() { rect.addEvent("mouseover", function() {
alert("Mouse Over"); alert("Mouse Over");
}); });

View File

@ -84,9 +84,9 @@ web2d.Loader =
web2d.Loader.checkLoaded(filename); web2d.Loader.checkLoaded(filename);
} }
if(typeof(js.addEventListener) != 'undefined') { if(typeof(js.addEvent) != 'undefined') {
/* The FF, Chrome, Safari, Opera way */ /* The FF, Chrome, Safari, Opera way */
js.addEventListener('load',calltheCBcmn,false); js.addEvent('load',calltheCBcmn,false);
} }
else { else {
/* The MS IE 8+ way (may work with others - I dunno)*/ /* The MS IE 8+ way (may work with others - I dunno)*/

View File

@ -1,6 +1,7 @@
- Ver de que algunos de los colores de las paleta sean los utilizados. - Ver de que algunos de los colores de las paleta sean los utilizados.
- Resize de la ventana ajuste el workspace - Resize de la ventana ajuste el workspace
- Fixiar metodo de drag del workspace... - Fixiar metodo de drag del workspace...
- Cambiar el nodo on type
- f2 - documentar el select , unselect all y otros
- documentar el select and unselect all - Implementar el f1
- Ver como re-implementar el log4j para que vuelva loguear los errores en el server. Se borro por que pesa mucho.

View File

@ -13,7 +13,7 @@
<!--<script type='text/javascript' src='../js/wiseLibrary.js'></script>--> <!--<script type='text/javascript' src='../js/wiseLibrary.js'></script>-->
<script type='text/javascript' src='../js/mootools-core-1.3.2-full-compat.js'></script> <script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/mootools/1.3.2/mootools-yui-compressed.js'></script>
<script type='text/javascript' src='../js/mootools-more-1.3.2.1-yui.js'></script> <script type='text/javascript' src='../js/mootools-more-1.3.2.1-yui.js'></script>
<!--<script type='text/javascript' src='../js/common.js'></script>--> <!--<script type='text/javascript' src='../js/common.js'></script>-->

View File

@ -68,7 +68,7 @@ return false
}if(!Log4js.loggers[categoryName]){Log4js.loggers[categoryName]=new Log4js.Logger(categoryName) }if(!Log4js.loggers[categoryName]){Log4js.loggers[categoryName]=new Log4js.Logger(categoryName)
}return Log4js.loggers[categoryName] }return Log4js.loggers[categoryName]
},getDefaultLogger:function(){return Log4js.getLogger("[default]") },getDefaultLogger:function(){return Log4js.getLogger("[default]")
},attachEvent:function(element,name,observer){if(element.addEventListener){element.addEventListener(name,observer,false) },attachEvent:function(element,name,observer){if(element.addEvent){element.addEvent(name,observer,false)
}else{if(element.attachEvent){element.attachEvent("on"+name,observer) }else{if(element.attachEvent){element.attachEvent("on"+name,observer)
}}}}; }}}};
Log4js.extend=function(destination,source){for(property in source){destination[property]=source[property] Log4js.extend=function(destination,source){for(property in source){destination[property]=source[property]

View File

@ -11,6 +11,6 @@ function C(){var b=document.getElementsByTagName(hb);for(var c=0,d=b.length;c<d;
function D(a){var b=s[a];return b==null?null:b} function D(a){var b=s[a];return b==null?null:b}
function E(a,b){var c=v;for(var d=0,e=a.length-1;d<e;++d){c=c[a[d]]||(c[a[d]]=[])}c[a[e]]=b} function E(a,b){var c=v;for(var d=0,e=a.length-1;d<e;++d){c=c[a[d]]||(c[a[d]]=[])}c[a[e]]=b}
function F(a){var b=u[a](),c=t[a];if(b in c){return b}var d=[];for(var e in c){d[c[e]]=e}if(y){y(a,d,b)}throw null} function F(a){var b=u[a](),c=t[a];if(b in c){return b}var d=[];for(var e in c){d[c[e]]=e}if(y){y(a,d,b)}throw null}
u[tb]=function(){var c=navigator.userAgent.toLowerCase();var d=function(a){return parseInt(a[1])*1000+parseInt(a[2])};if(function(){return c.indexOf(ub)!=-1}())return ub;if(function(){return c.indexOf(vb)!=-1||function(){if(c.indexOf(wb)!=-1){return true}if(typeof window[xb]!=bb){try{var b=new ActiveXObject(yb);if(b){b.registerBhoIfNeeded();return true}}catch(a){}}return false}()}())return zb;if(function(){return c.indexOf(Ab)!=-1&&m.documentMode>=9}())return Bb;if(function(){return c.indexOf(Ab)!=-1&&m.documentMode>=8}())return Cb;if(function(){var a=/msie ([0-9]+)\.([0-9]+)/.exec(c);if(a&&a.length==3)return d(a)>=6000}())return Db;if(function(){return c.indexOf(Eb)!=-1}())return Fb;return Gb};t[tb]={gecko1_8:0,ie6:1,ie8:2,ie9:3,opera:4,safari:5};jsapi.onScriptLoad=function(a){jsapi.onScriptLoad=null;p=a;A()};if(z()){alert(Hb+Ib);return}C();B();n&&n({moduleName:M,sessionId:o,subSystem:N,evtGroup:O,millis:(new Date).getTime(),type:Jb});var G;try{E([Db],Kb);E([zb],Lb);E([ub],Mb);E([Fb],Nb);E([Cb],Ob);E([Bb],Pb);G=v[F(tb)];var H=G.indexOf(Qb);if(H!=-1){w=Number(G.substring(H+1));G=G.substring(0,H)}}catch(a){return}var I;function J(){if(!q){q=true;A();if(m.removeEventListener){m.removeEventListener(Rb,J,false)}if(I){clearInterval(I)}}} u[tb]=function(){var c=navigator.userAgent.toLowerCase();var d=function(a){return parseInt(a[1])*1000+parseInt(a[2])};if(function(){return c.indexOf(ub)!=-1}())return ub;if(function(){return c.indexOf(vb)!=-1||function(){if(c.indexOf(wb)!=-1){return true}if(typeof window[xb]!=bb){try{var b=new ActiveXObject(yb);if(b){b.registerBhoIfNeeded();return true}}catch(a){}}return false}()}())return zb;if(function(){return c.indexOf(Ab)!=-1&&m.documentMode>=9}())return Bb;if(function(){return c.indexOf(Ab)!=-1&&m.documentMode>=8}())return Cb;if(function(){var a=/msie ([0-9]+)\.([0-9]+)/.exec(c);if(a&&a.length==3)return d(a)>=6000}())return Db;if(function(){return c.indexOf(Eb)!=-1}())return Fb;return Gb};t[tb]={gecko1_8:0,ie6:1,ie8:2,ie9:3,opera:4,safari:5};jsapi.onScriptLoad=function(a){jsapi.onScriptLoad=null;p=a;A()};if(z()){alert(Hb+Ib);return}C();B();n&&n({moduleName:M,sessionId:o,subSystem:N,evtGroup:O,millis:(new Date).getTime(),type:Jb});var G;try{E([Db],Kb);E([zb],Lb);E([ub],Mb);E([Fb],Nb);E([Cb],Ob);E([Bb],Pb);G=v[F(tb)];var H=G.indexOf(Qb);if(H!=-1){w=Number(G.substring(H+1));G=G.substring(0,H)}}catch(a){return}var I;function J(){if(!q){q=true;A();if(m.removeEvent){m.removeEvent(Rb,J,false)}if(I){clearInterval(I)}}}
if(m.addEventListener){m.addEventListener(Rb,function(){J()},false)}var I=setInterval(function(){if(/loaded|complete/.test(m.readyState)){J()}},50);n&&n({moduleName:M,sessionId:o,subSystem:N,evtGroup:O,millis:(new Date).getTime(),type:U});n&&n({moduleName:M,sessionId:o,subSystem:N,evtGroup:Sb,millis:(new Date).getTime(),type:P});var K=Tb+r+G+Ub;m.write(Vb+Wb+Xb+Yb+Zb+$b+_b+Yb+Zb+ac+bc+cc+K+dc+ec+fc+gc)} if(m.addEvent){m.addEvent(Rb,function(){J()},false)}var I=setInterval(function(){if(/loaded|complete/.test(m.readyState)){J()}},50);n&&n({moduleName:M,sessionId:o,subSystem:N,evtGroup:O,millis:(new Date).getTime(),type:U});n&&n({moduleName:M,sessionId:o,subSystem:N,evtGroup:Sb,millis:(new Date).getTime(),type:P});var K=Tb+r+G+Ub;m.write(Vb+Wb+Xb+Yb+Zb+$b+_b+Yb+Zb+ac+bc+cc+K+dc+ec+fc+gc)}
jsapi(); jsapi();

View File

@ -1338,7 +1338,7 @@ if (document.execCommand) try {
} catch (e){} } catch (e){}
/*<ltIE9>*/ /*<ltIE9>*/
if (this.attachEvent && !this.addEventListener){ if (this.attachEvent && !this.addEvent){
var unloadEvent = function(){ var unloadEvent = function(){
this.detachEvent('onunload', unloadEvent); this.detachEvent('onunload', unloadEvent);
document.head = document.html = document.window = null; document.head = document.html = document.window = null;
@ -3758,13 +3758,13 @@ Element.implement('hasChild', function(element){
} else { } else {
collected[$uid(this)] = this; collected[$uid(this)] = this;
} }
if (this.addEventListener) this.addEventListener(type, fn, !!arguments[2]); if (this.addEvent) this.addEvent(type, fn, !!arguments[2]);
else this.attachEvent('on' + type, fn); else this.attachEvent('on' + type, fn);
return this; return this;
}, },
removeListener: function(type, fn){ removeListener: function(type, fn){
if (this.removeEventListener) this.removeEventListener(type, fn, !!arguments[2]); if (this.removeEvent) this.removeEvent(type, fn, !!arguments[2]);
else this.detachEvent('on' + type, fn); else this.detachEvent('on' + type, fn);
return this; return this;
}, },
@ -3790,7 +3790,7 @@ Element.implement('hasChild', function(element){
}); });
/*<ltIE9>*/ /*<ltIE9>*/
if (window.attachEvent && !window.addEventListener) window.addListener('unload', function(){ if (window.attachEvent && !window.addEvent) window.addListener('unload', function(){
Object.each(collected, clean); Object.each(collected, clean);
if (window.CollectGarbage) CollectGarbage(); if (window.CollectGarbage) CollectGarbage();
}); });

View File

@ -1075,7 +1075,7 @@ if (document.execCommand) try {
} catch (e){} } catch (e){}
/*<ltIE9>*/ /*<ltIE9>*/
if (this.attachEvent && !this.addEventListener){ if (this.attachEvent && !this.addEvent){
var unloadEvent = function(){ var unloadEvent = function(){
this.detachEvent('onunload', unloadEvent); this.detachEvent('onunload', unloadEvent);
document.head = document.html = document.window = null; document.head = document.html = document.window = null;
@ -3348,13 +3348,13 @@ if (!document.createElement('div').contains) Element.implement(contains);
} else { } else {
collected[$uid(this)] = this; collected[$uid(this)] = this;
} }
if (this.addEventListener) this.addEventListener(type, fn, !!arguments[2]); if (this.addEvent) this.addEvent(type, fn, !!arguments[2]);
else this.attachEvent('on' + type, fn); else this.attachEvent('on' + type, fn);
return this; return this;
}, },
removeListener: function(type, fn){ removeListener: function(type, fn){
if (this.removeEventListener) this.removeEventListener(type, fn, !!arguments[2]); if (this.removeEvent) this.removeEvent(type, fn, !!arguments[2]);
else this.detachEvent('on' + type, fn); else this.detachEvent('on' + type, fn);
return this; return this;
}, },
@ -3380,7 +3380,7 @@ if (!document.createElement('div').contains) Element.implement(contains);
}); });
/*<ltIE9>*/ /*<ltIE9>*/
if (window.attachEvent && !window.addEventListener) window.addListener('unload', function(){ if (window.attachEvent && !window.addEvent) window.addListener('unload', function(){
Object.each(collected, clean); Object.each(collected, clean);
if (window.CollectGarbage) CollectGarbage(); if (window.CollectGarbage) CollectGarbage();
}); });

View File

@ -144,11 +144,11 @@ var bkLib = {
isMSIE : (navigator.appVersion.indexOf("MSIE") != -1), isMSIE : (navigator.appVersion.indexOf("MSIE") != -1),
addEvent : function(obj, type, fn) { addEvent : function(obj, type, fn) {
(obj.addEventListener) ? obj.addEventListener( type, fn, false ) : obj.attachEvent("on"+type, fn); (obj.addEvent) ? obj.addEvent( type, fn, false ) : obj.attachEvent("on"+type, fn);
}, },
removeEvent : function(obj, type, fn) { removeEvent : function(obj, type, fn) {
(obj.removeEventListener) ? obj.removeEventListener( type, fn, false ) : obj.detachEvent("on"+type, fn); (obj.removeEvent) ? obj.removeEvent( type, fn, false ) : obj.detachEvent("on"+type, fn);
}, },
toArray : function(iterable) { toArray : function(iterable) {
@ -194,8 +194,8 @@ var bkLib = {
}, },
onDomLoaded : function(fireThis) { onDomLoaded : function(fireThis) {
this.domLoad.push(fireThis); this.domLoad.push(fireThis);
if (document.addEventListener) { if (document.addEvent) {
document.addEventListener("DOMContentLoaded", bkLib.domLoaded, null); document.addEvent("DOMContentLoaded", bkLib.domLoaded, null);
} else if(bkLib.isMSIE) { } else if(bkLib.isMSIE) {
document.write("<style>.nicEdit-main p { margin: 0; }</style><scr"+"ipt id=__ie_onload defer " + ((location.protocol == "https:") ? "src='javascript:void(0)'" : "src=//0") + "><\/scr"+"ipt>"); document.write("<style>.nicEdit-main p { margin: 0; }</style><scr"+"ipt id=__ie_onload defer " + ((location.protocol == "https:") ? "src='javascript:void(0)'" : "src=//0") + "><\/scr"+"ipt>");
$BK("__ie_onload").onreadystatechange = function() { $BK("__ie_onload").onreadystatechange = function() {