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

@@ -318,7 +318,7 @@
<include>collaboration/frameworks/brix/BrixFramework-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/FontSizePanel-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);
},
addEventListener:function(event, fn) {
this.getImage().addEventListener(event, fn);
addEvent:function(event, fn) {
this.getImage().addEvent(event, fn);
},
addToGroup:function(group) {

View File

@@ -27,7 +27,7 @@ mindplot.CentralTopic = new Class({
this.parent();
// 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();
});
},

View File

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

View File

@@ -186,7 +186,7 @@ mindplot.DesignerKeyboard = new Class({
var regex = /^(?:shift|control|ctrl|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) {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -64,7 +64,7 @@ mindplot.MindmapDesigner = new Class({
mindplot.DesignerKeyboard.register(this);
// To prevent the user from leaving the page with changes ...
window.addEvent('beforeunload', function () {
$(window).addEvent('beforeunload', function () {
if (this.needsSave()) {
this.save(null, false)
}
@@ -123,7 +123,7 @@ mindplot.MindmapDesigner = new Class({
return topics[0];
},
addEventListener : function(eventType, listener) {
addEvent : function(eventType, listener) {
this._events[eventType] = listener;
},
@@ -154,7 +154,7 @@ mindplot.MindmapDesigner = new Class({
this._layoutManager.registerListenersOnNode(topic);
// 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);
}.bind(this));
}
@@ -164,7 +164,6 @@ mindplot.MindmapDesigner = new Class({
if (isConnected) {
// Improve this ...
var targetTopicModel = model.getParent();
var targetTopicId = targetTopicModel.getId();
var targetTopic = null;
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 pos = screen.getWorkspaceMousePosition(event);
var selectedTopics = this.getSelectedNodes();
@@ -456,10 +455,9 @@ mindplot.MindmapDesigner = new Class({
}
var relationships = mindmapModel.getRelationships();
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) {
delete topic.getModel()._finalPosition;
});
@@ -578,7 +576,7 @@ mindplot.MindmapDesigner = new Class({
relationLine.setModel(model);
//Add Listeners
relationLine.addEventListener('onfocus', function(event) {
relationLine.addEvent('onfocus', function(event) {
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 topicsIds = validSelectedObjects.nodes;
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 topicsIds = validSelectedObjects.nodes;
if (topicsIds.length > 0) {
@@ -649,7 +648,7 @@ mindplot.MindmapDesigner = new Class({
}
},
setBackColor2SelectedNode : function(color) {
changeBackgroundColor : function(color) {
var validateFunc = function(topic) {
return topic.getShapeType() != mindplot.model.NodeModel.SHAPE_TYPE_LINE
@@ -700,7 +699,7 @@ mindplot.MindmapDesigner = new Class({
return result;
},
setBorderColor2SelectedNode : function(color) {
changeBorderColor : function(color) {
var validateFunc = function(topic) {
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 topicsIds = validSelectedObjects.nodes;
if (topicsIds.length > 0) {
@@ -722,7 +721,7 @@ mindplot.MindmapDesigner = new Class({
}
,
setShape2SelectedNode : function(shape) {
changeTopicShape : function(shape) {
var validateFunc = function(topic) {
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 topicsIds = validSelectedObjects.nodes;
if (topicsIds.length > 0) {
@@ -759,7 +758,7 @@ mindplot.MindmapDesigner = new Class({
}
},
addLink2SelectedNode : function() {
addLink : function() {
var selectedTopics = this.getSelectedNodes();
var topic = null;
if (selectedTopics.length > 0) {
@@ -811,7 +810,7 @@ mindplot.MindmapDesigner = new Class({
}
},
addNote2SelectedNode : function() {
addNote : function() {
var selectedTopics = this.getSelectedNodes();
var topic = null;
if (selectedTopics.length > 0) {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -52,7 +52,7 @@ mindplot.layout.FreeMindLayoutManager = mindplot.layout.BaseLayoutManager.extend
var id = topic.getId();
// Register node listeners ...
var designer = this.getDesigner();
topic.addEventListener('click', function(event)
topic.addEvent('click', function(event)
{
designer.onObjectFocusEvent.attempt([topic, event], designer);
});
@@ -60,7 +60,7 @@ mindplot.layout.FreeMindLayoutManager = mindplot.layout.BaseLayoutManager.extend
// Add drag behaviour ...
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 ...
this._mouseMoveListenerInstance = this._mouseMoveListener.bindWithEvent(this,[topic]);
screen.addEventListener('mousemove', this._mouseMoveListenerInstance);
screen.addEvent('mousemove', this._mouseMoveListenerInstance);
// Register mouse up listeners ...
this._mouseUpListenerInstance = this._mouseUpListener.bindWithEvent(this,[topic]);
screen.addEventListener('mouseup', this._mouseUpListenerInstance);
screen.addEvent('mouseup', this._mouseUpListenerInstance);
// Change cursor.
window.document.body.style.cursor = 'move';
@@ -192,8 +192,8 @@ mindplot.layout.FreeMindLayoutManager = mindplot.layout.BaseLayoutManager.extend
var screen = this._designer.getWorkSpace().getScreenManager();
// Remove all the events.
screen.removeEventListener('mousemove', this._mouseMoveListenerInstance);
screen.removeEventListener('mouseup', this._mouseUpListenerInstance);
screen.removeEvent('mousemove', this._mouseMoveListenerInstance);
screen.removeEvent('mouseup', this._mouseUpListenerInstance);
delete this._mouseMoveListenerInstance;
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.NodeMouseOutEvent,hide);
node.addHelper(moveShape);
moveShape.addEventListener("mousedown",this._mousedownListener.bindWithEvent(this,[node]));
moveShape.addEvent("mousedown",this._mousedownListener.bindWithEvent(this,[node]));
},
needsPrepositioning:function(){
@@ -320,10 +320,10 @@ mindplot.layout.FreeMindLayoutManager = mindplot.layout.BaseLayoutManager.extend
topics[i].setMouseEventsEnabled(false);
if(topics[i].getId()!=topic.getId()){
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);
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);
}
}
@@ -342,11 +342,11 @@ mindplot.layout.FreeMindLayoutManager = mindplot.layout.BaseLayoutManager.extend
// Register mouse move listener ...
this._mouseMoveListenerInstance = this._reconnectMouseMoveListener.bindWithEvent(this,[topic]);
screen.addEventListener('mousemove', this._mouseMoveListenerInstance);
screen.addEvent('mousemove', this._mouseMoveListenerInstance);
// Register mouse up listeners ...
this._mouseUpListenerInstance = this._reconnectMouseUpListener.bindWithEvent(this,[topic]);
screen.addEventListener('mouseup', this._mouseUpListenerInstance);
screen.addEvent('mouseup', this._mouseUpListenerInstance);
// Change cursor.
window.document.body.style.cursor = 'move';
@@ -390,8 +390,8 @@ mindplot.layout.FreeMindLayoutManager = mindplot.layout.BaseLayoutManager.extend
_reconnectMouseUpListener:function(event, node){
var screen = this._designer.getWorkSpace().getScreenManager();
// Remove all the events.
screen.removeEventListener('mousemove', this._mouseMoveListenerInstance);
screen.removeEventListener('mouseup', this._mouseUpListenerInstance);
screen.removeEvent('mousemove', this._mouseMoveListenerInstance);
screen.removeEvent('mouseup', this._mouseUpListenerInstance);
delete this._mouseMoveListenerInstance;
delete this._mouseUpListenerInstance;
@@ -402,9 +402,9 @@ mindplot.layout.FreeMindLayoutManager = mindplot.layout.BaseLayoutManager.extend
topics[i].setMouseEventsEnabled(true);
if(topics[i].getId()!=node.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());
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();
dragger.addEventListener('startdragging', function(event, node) {
dragger.addEvent('startdragging', function(event, node) {
// Enable all mouse events.
for (var i = 0; i < topics.length; i++) {
topics[i].setMouseEventsEnabled(false);
}
});
dragger.addEventListener('dragging', function(event, dragTopic) {
dragger.addEvent('dragging', function(event, dragTopic) {
// Update the state and connections of the topic ...
dragTopicPositioner.positionateDragTopic(dragTopic);
});
dragger.addEventListener('enddragging', function(event, dragTopic) {
dragger.addEvent('enddragging', function(event, dragTopic) {
// Enable all mouse events.
for (var i = 0; i < topics.length; i++) {
topics[i].setMouseEventsEnabled(true);

View File

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

View File

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