mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-09-12 07:10:07 +02:00
Merge branch 'wise-doc' into collaboration
Conflicts: mindplot/pom.xml mindplot/src/main/javascript/DesignerActionRunner.js mindplot/src/main/javascript/DragTopic.js mindplot/src/main/javascript/MindmapDesigner.js wise-doc/src/main/webapp/html/editor.html wise-doc/src/main/webapp/js/editor.js
This commit is contained in:
commit
18dfd82c1d
@ -1,86 +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.
|
||||
*/
|
||||
|
||||
core.Loader =
|
||||
{
|
||||
load: function(scriptPath, stylePath,jsFileName)
|
||||
{
|
||||
var headElement = document.getElementsByTagName('head');
|
||||
var htmlDoc = headElement.item(0);
|
||||
var baseUrl = this.baseUrl(jsFileName);
|
||||
if (scriptPath && scriptPath.length > 0)
|
||||
{
|
||||
for (var i = 0; i < scriptPath.length; i++)
|
||||
{
|
||||
this.includeScriptNode(baseUrl + scriptPath[i]);
|
||||
}
|
||||
}
|
||||
if (stylePath && stylePath.length > 0)
|
||||
{
|
||||
for (var i = 0; i < stylePath.length; i++)
|
||||
{
|
||||
this.includeStyleNode(baseUrl + stylePath[i]);
|
||||
}
|
||||
}
|
||||
},
|
||||
baseUrl: function(jsFileName)
|
||||
{
|
||||
var headElement = document.getElementsByTagName('head');
|
||||
var htmlDoc = headElement.item(0);
|
||||
var headChildren = htmlDoc.childNodes;
|
||||
var result = null;
|
||||
for (var i = 0; i < headChildren.length; i++)
|
||||
{
|
||||
var node = headChildren.item(i);
|
||||
if (node.nodeName && node.nodeName.toLowerCase() == "script")
|
||||
{
|
||||
var libraryUrl = node.src;
|
||||
if (libraryUrl.indexOf(jsFileName) != -1)
|
||||
{
|
||||
var index = libraryUrl.lastIndexOf("/");
|
||||
index = libraryUrl.lastIndexOf("/", index - 1);
|
||||
result = libraryUrl.substring(0, index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
throw "Could not obtain the base url directory.";
|
||||
}
|
||||
return result;
|
||||
},
|
||||
includeScriptNode: function(filename) {
|
||||
var html_doc = document.getElementsByTagName('head').item(0);
|
||||
var js = document.createElement('script');
|
||||
js.setAttribute('language', 'javascript');
|
||||
js.setAttribute('type', 'text/javascript');
|
||||
js.setAttribute('src', filename);
|
||||
html_doc.appendChild(js);
|
||||
return false;
|
||||
},
|
||||
includeStyleNode: function(filename) {
|
||||
var html_doc = document.getElementsByTagName('head').item(0);
|
||||
var js = document.createElement('link');
|
||||
js.setAttribute('rel', 'stylesheet');
|
||||
js.setAttribute('type', 'text/css');
|
||||
js.setAttribute('href', filename);
|
||||
html_doc.appendChild(js);
|
||||
return false;
|
||||
}
|
||||
};
|
@ -78,14 +78,6 @@ Math.sign = function(value) {
|
||||
};
|
||||
|
||||
|
||||
// Extensions ....
|
||||
function $import(src) {
|
||||
var scriptElem = document.createElement('script');
|
||||
scriptElem.setAttribute('src', src);
|
||||
scriptElem.setAttribute('type', 'text/javascript');
|
||||
document.getElementsByTagName('head')[0].appendChild(scriptElem);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the mouse position.
|
||||
*/
|
||||
@ -274,6 +266,7 @@ core.Utils.calculateDefaultControlPoints = function(srcPos, tarPos) {
|
||||
core.Utils.setVisibilityAnimated = function(elems, isVisible, doneFn) {
|
||||
core.Utils.animateVisibility(elems, isVisible, doneFn);
|
||||
};
|
||||
|
||||
core.Utils.setChildrenVisibilityAnimated = function(rootElem, isVisible) {
|
||||
var children = core.Utils._addInnerChildrens(rootElem);
|
||||
core.Utils.animateVisibility(children, isVisible);
|
||||
|
@ -55,6 +55,9 @@
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="model/Mindmap.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="model/NodeModel.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="model/RelationshipModel.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="ActionDispatcher.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="BrixActionDispatcher.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="LocalActionDispatcher.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="MindmapDesigner.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="ScreenManager.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="Workspace.js"/>
|
||||
@ -67,7 +70,6 @@
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="DragManager.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="DragPivot.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="Board.js"/>
|
||||
<!--<filelist dir="${basedir}/src/main/javascript/" files="TopicBoard.js"/>-->
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="CentralTopicBoard.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="MainTopicBoard.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="ConnectionLine.js"/>
|
||||
@ -171,6 +173,18 @@
|
||||
files="collaboration/frameworks/brix/BrixFramework.js"/>
|
||||
|
||||
|
||||
<filelist dir="${basedir}/src/main/javascript/"
|
||||
files="widget/IconPanel.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/"
|
||||
files="widget/ToolbarPanel.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/"
|
||||
files="widget/FontFamilyPanel.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/"
|
||||
files="widget/FontSizePanel.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/"
|
||||
files="widget/TopicShapePanel.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/"
|
||||
files="widget/Menu.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="footer.js"/>
|
||||
</concat>
|
||||
|
||||
|
116
mindplot/src/main/javascript/ActionDispatcher.js
Normal file
116
mindplot/src/main/javascript/ActionDispatcher.js
Normal file
@ -0,0 +1,116 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
//noinspection JSUnusedLocalSymbols
|
||||
mindplot.ActionDispatcher = new Class({
|
||||
Implements:[Events],
|
||||
initialize: function(commandContext) {
|
||||
$assert(commandContext, "commandContext can not be null");
|
||||
},
|
||||
|
||||
addIconToTopic: function(topicId, iconType) {
|
||||
throw "method must be implemented.";
|
||||
},
|
||||
|
||||
addLinkToTopic: function(topicId, url) {
|
||||
throw "method must be implemented.";
|
||||
},
|
||||
|
||||
addNoteToTopic: function(topicId, text) {
|
||||
throw "method must be implemented.";
|
||||
},
|
||||
|
||||
addRelationship: function(model, mindmap) {
|
||||
throw "method must be implemented.";
|
||||
},
|
||||
|
||||
addTopic: function(model, parentTopicId, animated) {
|
||||
throw "method must be implemented.";
|
||||
},
|
||||
|
||||
deleteTopics: function(topicsIds) {
|
||||
throw "method must be implemented.";
|
||||
},
|
||||
|
||||
dragTopic: function(topicId, position, order, parentTopic) {
|
||||
throw "method must be implemented.";
|
||||
},
|
||||
|
||||
moveControlPoint: function(ctrlPoint, point) {
|
||||
throw "method must be implemented.";
|
||||
},
|
||||
|
||||
removeIconFromTopic: function(topicId, iconModel) {
|
||||
throw "method must be implemented.";
|
||||
},
|
||||
|
||||
removeLinkFromTopic: function(topicId) {
|
||||
throw "method must be implemented.";
|
||||
},
|
||||
|
||||
removeNoteFromTopic: function(topicId) {
|
||||
throw "method must be implemented.";
|
||||
},
|
||||
|
||||
changeFontFamilyToTopic: function(topicIds, fontFamily) {
|
||||
throw "method must be implemented.";
|
||||
},
|
||||
|
||||
changeFontStyleToTopic: function(topicsIds) {
|
||||
throw "method must be implemented.";
|
||||
},
|
||||
|
||||
changeFontColorToTopic: function(topicsIds, color) {
|
||||
throw "method must be implemented.";
|
||||
},
|
||||
|
||||
changeBackgroundColorToTopic: function(topicsIds, color) {
|
||||
throw "method must be implemented.";
|
||||
},
|
||||
|
||||
changeBorderColorToTopic: function(topicsIds, color) {
|
||||
throw "method must be implemented.";
|
||||
},
|
||||
|
||||
changeShapeToTopic : function(topicsIds, shapeType) {
|
||||
throw "method must be implemented.";
|
||||
},
|
||||
|
||||
changeFontWeightToTopic : function(topicsIds) {
|
||||
throw "method must be implemented.";
|
||||
},
|
||||
|
||||
changeTextOnTopic : function(topicsIds, text) {
|
||||
throw "method must be implemented.";
|
||||
},
|
||||
|
||||
shrinkBranch : function(topicsIds, collapse)
|
||||
{
|
||||
throw "method must be implemented.";
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
mindplot.ActionDispatcher.setInstance = function(dispatcher) {
|
||||
mindplot.ActionDispatcher._instance = dispatcher;
|
||||
};
|
||||
|
||||
mindplot.ActionDispatcher.getInstance = function() {
|
||||
return mindplot.ActionDispatcher._instance;
|
||||
};
|
||||
|
@ -19,7 +19,7 @@
|
||||
mindplot.ActionIcon = new Class({
|
||||
Extends:mindplot.Icon,
|
||||
initialize: function(topic, url) {
|
||||
mindplot.Icon.call(this, url);
|
||||
this.parent(url);
|
||||
this._node = topic;
|
||||
},
|
||||
getNode:function() {
|
||||
|
@ -1,51 +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.
|
||||
*/
|
||||
|
||||
mindplot.BaseCommandDispatcher = new Class({
|
||||
|
||||
initialize: function() {
|
||||
},
|
||||
addIconToTopic: function() {
|
||||
throw "method must be implemented.";
|
||||
},
|
||||
addLinkToTopic: function() {
|
||||
throw "method must be implemented.";
|
||||
},
|
||||
addNoteToTopic: function() {
|
||||
throw "method must be implemented.";
|
||||
},addRelationship: function() {
|
||||
throw "method must be implemented.";
|
||||
},addTopic: function() {
|
||||
throw "method must be implemented.";
|
||||
},changeIcon: function() {
|
||||
throw "method must be implemented.";
|
||||
},deleteTopic: function() {
|
||||
throw "method must be implemented.";
|
||||
},dragTopic: function() {
|
||||
throw "method must be implemented.";
|
||||
},moveControllPoint: function() {
|
||||
throw "method must be implemented.";
|
||||
} ,removeIconFromTopic: function() {
|
||||
throw "method must be implemented.";
|
||||
},removeLinkFromTopic: function() {
|
||||
throw "method must be implemented.";
|
||||
},removeNodeFromTopic: function() {
|
||||
throw "method must be implemented.";
|
||||
}
|
||||
});
|
||||
|
25
mindplot/src/main/javascript/BrixActionDispatcher.js
Normal file
25
mindplot/src/main/javascript/BrixActionDispatcher.js
Normal file
@ -0,0 +1,25 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
mindplot.BrixActionDispatcher = new Class({
|
||||
Extends: mindplot.ActionDispatcher,
|
||||
initialize: function(commandContext, fireOnChange) {
|
||||
this.parent(commandContext, fireOnChange);
|
||||
}
|
||||
});
|
||||
|
@ -33,7 +33,7 @@ mindplot.CentralTopic = new Class({
|
||||
|
||||
setCursor : function(type) {
|
||||
type = (type == 'move') ? 'default' : type;
|
||||
mindplot.Topic.prototype.setCursor.call(this, type);
|
||||
this.parent(type);
|
||||
},
|
||||
|
||||
isConnectedToCentralTopic : function() {
|
||||
|
@ -113,8 +113,10 @@ mindplot.ControlPoint = new Class({
|
||||
_mouseUp : function(event, point) {
|
||||
this._workspace.getScreenManager().removeEventListener('mousemove', this._mouseMoveFunction);
|
||||
this._workspace.getScreenManager().removeEventListener('mouseup', this._mouseUpFunction);
|
||||
var command = new mindplot.commands.MoveControlPointCommand(this, point);
|
||||
designer._actionRunner.execute(command); //todo:Uggly!! designer is global!!
|
||||
|
||||
var actionDispatcher = mindplot.ActionDispatcher.getInstance();
|
||||
actionDispatcher.moveControlPoint(this, point);
|
||||
|
||||
this._isBinded = false;
|
||||
/*event.preventDefault();
|
||||
event.stop();
|
||||
|
@ -17,40 +17,34 @@
|
||||
*/
|
||||
|
||||
mindplot.DesignerActionRunner = new Class({
|
||||
initialize: function(designer) {
|
||||
this._designer = designer;
|
||||
initialize: function(commandContext, notifier) {
|
||||
$assert(commandContext, "commandContext can not be null");
|
||||
|
||||
this._undoManager = new mindplot.DesignerUndoManager();
|
||||
this._context = new mindplot.CommandContext(this._designer);
|
||||
this._context = commandContext;
|
||||
this._notifier = notifier;
|
||||
},
|
||||
|
||||
execute:function(command) {
|
||||
$assert(command, "command can not be null");
|
||||
// Execute action ...
|
||||
command.execute(this._context);
|
||||
|
||||
// Enqueue it ...
|
||||
this._undoManager.enqueue(command);
|
||||
|
||||
// Fire event
|
||||
var event = this._undoManager._buildEvent();
|
||||
this._designer._fireEvent("change", event);
|
||||
this.fireChangeEvent();
|
||||
},
|
||||
|
||||
undo: function() {
|
||||
this._undoManager.execUndo(this._context);
|
||||
|
||||
// Fire event
|
||||
var event = this._undoManager._buildEvent();
|
||||
this._designer._fireEvent("change", event);
|
||||
this.fireChangeEvent();
|
||||
},
|
||||
|
||||
redo: function() {
|
||||
this._undoManager.execRedo(this._context);
|
||||
this.fireChangeEvent();
|
||||
},
|
||||
|
||||
// Fire event
|
||||
var event = this._undoManager._buildEvent();
|
||||
this._designer._fireEvent("change", event);
|
||||
|
||||
fireChangeEvent : function () {
|
||||
var event = this._undoManager.buildEvent();
|
||||
this._notifier.fireEvent("modelUpdate", event);
|
||||
},
|
||||
|
||||
markAsChangeBase: function() {
|
||||
@ -60,75 +54,3 @@ mindplot.DesignerActionRunner = new Class({
|
||||
return this._undoManager.hasBeenChanged();
|
||||
}
|
||||
});
|
||||
|
||||
mindplot.CommandContext = new Class({
|
||||
initialize: function(designer) {
|
||||
this._designer = designer;
|
||||
},
|
||||
findTopics:function(topicsIds) {
|
||||
var designerTopics = this._designer._topics;
|
||||
if (!(topicsIds instanceof Array)) {
|
||||
topicsIds = [topicsIds];
|
||||
}
|
||||
|
||||
var result = designerTopics.filter(function(topic) {
|
||||
var found = false;
|
||||
if (topic != null) {
|
||||
var topicId = topic.getId();
|
||||
found = topicsIds.contains(topicId);
|
||||
}
|
||||
return found;
|
||||
|
||||
});
|
||||
return result;
|
||||
},
|
||||
deleteTopic:function(topic) {
|
||||
this._designer._removeNode(topic);
|
||||
},
|
||||
createTopic:function(model, isVisible) {
|
||||
$assert(model, "model can not be null");
|
||||
var topic = this._designer._nodeModelToNodeGraph(model, isVisible);
|
||||
|
||||
return topic;
|
||||
},
|
||||
createModel:function() {
|
||||
var mindmap = this._designer.getMindmap();
|
||||
var model = mindmap.createNode(mindplot.model.NodeModel.MAIN_TOPIC_TYPE);
|
||||
return model;
|
||||
},
|
||||
connect:function(childTopic, parentTopic, isVisible) {
|
||||
childTopic.connectTo(parentTopic, this._designer._workspace, isVisible);
|
||||
} ,
|
||||
disconnect:function(topic) {
|
||||
topic.disconnect(this._designer._workspace);
|
||||
},
|
||||
createRelationship:function(model) {
|
||||
$assert(model, "model cannot be null");
|
||||
var relationship = this._designer.createRelationship(model);
|
||||
return relationship;
|
||||
},
|
||||
removeRelationship:function(model) {
|
||||
this._designer.removeRelationship(model);
|
||||
},
|
||||
findRelationships:function(lineIds) {
|
||||
var result = [];
|
||||
lineIds.forEach(function(lineId, index) {
|
||||
var line = this._designer._relationships[lineId];
|
||||
if ($defined(line)) {
|
||||
result.push(line);
|
||||
}
|
||||
}.bind(this));
|
||||
return result;
|
||||
},
|
||||
getSelectedRelationshipLines:function() {
|
||||
return this._designer.getSelectedRelationshipLines();
|
||||
}
|
||||
});
|
||||
|
||||
mindplot.DesignerActionRunner.setInstance = function(actionRunner) {
|
||||
mindplot.DesignerActionRunner._instance = actionRunner;
|
||||
};
|
||||
|
||||
mindplot.DesignerActionRunner.getInstance = function() {
|
||||
return mindplot.DesignerActionRunner._instance;
|
||||
};
|
||||
|
@ -17,10 +17,12 @@
|
||||
*/
|
||||
|
||||
mindplot.DesignerUndoManager = new Class({
|
||||
initialize: function() {
|
||||
initialize: function(fireChange) {
|
||||
this._undoQueue = [];
|
||||
this._redoQueue = [];
|
||||
this._baseId = 0;
|
||||
this._fireChange = fireChange;
|
||||
|
||||
},
|
||||
|
||||
enqueue:function(command) {
|
||||
@ -55,7 +57,7 @@ mindplot.DesignerUndoManager = new Class({
|
||||
}
|
||||
},
|
||||
|
||||
_buildEvent: function() {
|
||||
buildEvent: function() {
|
||||
return {undoSteps: this._undoQueue.length, redoSteps:this._redoQueue.length};
|
||||
},
|
||||
|
||||
|
@ -201,8 +201,11 @@ mindplot.DragPivot = new Class({
|
||||
// Connected to Rect ...
|
||||
var connectRect = this._connectRect;
|
||||
var targetSize = targetTopic.getSize();
|
||||
var width = targetSize.width;
|
||||
var height = targetSize.height;
|
||||
|
||||
// Add 4 pixel in order to keep create a rect bigger than the topic.
|
||||
var width = targetSize.width + 4;
|
||||
var height = targetSize.height + 4;
|
||||
|
||||
connectRect.setSize(width, height);
|
||||
|
||||
var targetPosition = targetTopic.getPosition();
|
||||
|
@ -1,239 +1,203 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
mindplot.DragTopic = function(dragShape, draggedNode)
|
||||
{
|
||||
$assert(dragShape, 'Rect can not be null.');
|
||||
$assert(draggedNode, 'draggedNode can not be null.');
|
||||
mindplot.DragTopic = new Class({
|
||||
initialize:function(dragShape, draggedNode) {
|
||||
$assert(dragShape, 'Rect can not be null.');
|
||||
$assert(draggedNode, 'draggedNode can not be null.');
|
||||
|
||||
this._elem2d = dragShape;
|
||||
this._order = null;
|
||||
this._draggedNode = draggedNode;
|
||||
this._position = new core.Point();
|
||||
};
|
||||
this._elem2d = dragShape;
|
||||
this._order = null;
|
||||
this._draggedNode = draggedNode;
|
||||
this._position = new core.Point();
|
||||
},
|
||||
|
||||
mindplot.DragTopic.initialize = function(workspace)
|
||||
{
|
||||
setOrder : function(order) {
|
||||
this._order = order;
|
||||
},
|
||||
|
||||
setPosition : function(x, y) {
|
||||
this._position.setValue(x, y);
|
||||
|
||||
// Elements are positioned in the center.
|
||||
// All topic element must be positioned based on the innerShape.
|
||||
var draggedNode = this._draggedNode;
|
||||
var size = draggedNode.getSize();
|
||||
|
||||
var cx = Math.ceil(x - (size.width / 2));
|
||||
var cy = Math.ceil(y - (size.height / 2));
|
||||
|
||||
// Update visual position.
|
||||
this._elem2d.setPosition(cx, cy);
|
||||
},
|
||||
|
||||
getInnerShape : function() {
|
||||
return this._elem2d;
|
||||
},
|
||||
|
||||
disconnect : function(workspace) {
|
||||
// Clear connection line ...
|
||||
var dragPivot = this._getDragPivot();
|
||||
dragPivot.disconnect(workspace);
|
||||
},
|
||||
|
||||
canBeConnectedTo : function(targetTopic) {
|
||||
$assert(targetTopic, 'parent can not be null');
|
||||
|
||||
var result = true;
|
||||
if (!targetTopic.areChildrenShrinked() && !targetTopic.isCollapsed()) {
|
||||
// Dragged node can not be connected to himself.
|
||||
if (targetTopic == this._draggedNode) {
|
||||
result = false;
|
||||
} else {
|
||||
var draggedNode = this.getDraggedTopic();
|
||||
var topicPosition = this.getPosition();
|
||||
|
||||
var targetTopicModel = targetTopic.getModel();
|
||||
var childTopicModel = draggedNode.getModel();
|
||||
|
||||
result = targetTopicModel.canBeConnected(childTopicModel, topicPosition, 18);
|
||||
}
|
||||
} else {
|
||||
result = false;
|
||||
}
|
||||
return result;
|
||||
},
|
||||
|
||||
connectTo : function(parent) {
|
||||
$assert(parent, 'Parent connection node can not be null.');
|
||||
|
||||
var dragPivot = this._getDragPivot();
|
||||
dragPivot.connectTo(parent);
|
||||
},
|
||||
|
||||
getDraggedTopic : function() {
|
||||
return this._draggedNode;
|
||||
},
|
||||
|
||||
|
||||
removeFromWorkspace : function(workspace) {
|
||||
// Remove drag shadow.
|
||||
workspace.removeChild(this._elem2d);
|
||||
|
||||
// Remove pivot shape. To improve performace it will not be removed. Only the visilility will be changed.
|
||||
var dragPivot = this._getDragPivot();
|
||||
dragPivot.setVisibility(false);
|
||||
},
|
||||
|
||||
addToWorkspace : function(workspace) {
|
||||
workspace.appendChild(this._elem2d);
|
||||
var dragPivot = this._getDragPivot();
|
||||
|
||||
dragPivot.addToWorkspace(workspace);
|
||||
dragPivot.setVisibility(true);
|
||||
},
|
||||
|
||||
_getDragPivot : function() {
|
||||
return mindplot.DragTopic.__getDragPivot();
|
||||
},
|
||||
|
||||
getPosition:function() {
|
||||
return this._position;
|
||||
}
|
||||
,
|
||||
|
||||
isDragTopic : function() {
|
||||
return true;
|
||||
},
|
||||
|
||||
updateDraggedTopic : function(workspace) {
|
||||
$assert(workspace, 'workspace can not be null');
|
||||
|
||||
var dragPivot = this._getDragPivot();
|
||||
var draggedTopic = this.getDraggedTopic();
|
||||
|
||||
var isDragConnected = this.isConnected();
|
||||
// @Todo: Remove this static ...
|
||||
var actionDispatcher = mindplot.ActionDispatcher.getInstance();
|
||||
var topicId = draggedTopic.getId();
|
||||
|
||||
if (isDragConnected) {
|
||||
|
||||
var targetTopic = this.getConnectedToTopic();
|
||||
if (targetTopic.getType() == mindplot.NodeModel.CENTRAL_TOPIC_TYPE) {
|
||||
// Update topic position ...
|
||||
var dragPivotPosition = dragPivot.getPosition();
|
||||
|
||||
// Must position the dragged topic taking into account the current node size.
|
||||
var pivotSize = dragPivot.getSize();
|
||||
var draggedTopicSize = draggedTopic.getSize();
|
||||
var xOffset = draggedTopicSize.width - pivotSize.width;
|
||||
xOffset = Math.round(xOffset / 2);
|
||||
|
||||
if (dragPivotPosition.x > 0) {
|
||||
dragPivotPosition.x = parseInt(dragPivotPosition.x) + xOffset;
|
||||
}
|
||||
else {
|
||||
dragPivotPosition.x = parseInt(dragPivotPosition.x) - xOffset;
|
||||
}
|
||||
// Set new position ...
|
||||
actionDispatcher.dragTopic(topicId, dragPivotPosition, null, targetTopic);
|
||||
|
||||
} else {
|
||||
// Main topic connections can be positioned only with the order ...
|
||||
actionDispatcher.dragTopic(topicId, null, this._order, targetTopic);
|
||||
}
|
||||
} else {
|
||||
|
||||
// If the node is not connected, positionate based on the original drag topic position.
|
||||
var dragPosition = this.getPosition();
|
||||
actionDispatcher.dragTopic(topicId, dragPosition);
|
||||
}
|
||||
},
|
||||
|
||||
setBoardPosition : function(point) {
|
||||
$assert(point, 'point can not be null');
|
||||
var dragPivot = this._getDragPivot();
|
||||
dragPivot.setPosition(point);
|
||||
},
|
||||
|
||||
getConnectedToTopic : function() {
|
||||
var dragPivot = this._getDragPivot();
|
||||
return dragPivot.getTargetTopic();
|
||||
},
|
||||
|
||||
isConnected : function() {
|
||||
return this.getConnectedToTopic() != null;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
mindplot.DragTopic.PIVOT_SIZE = {width:50,height:10};
|
||||
|
||||
mindplot.DragTopic.init = function(workspace) {
|
||||
|
||||
$assert(workspace, "workspace can not be null");
|
||||
var pivot = mindplot.DragTopic.__getDragPivot();
|
||||
workspace.appendChild(pivot);
|
||||
};
|
||||
}
|
||||
|
||||
mindplot.DragTopic.prototype.setOrder = function(order)
|
||||
{
|
||||
this._order = order;
|
||||
};
|
||||
|
||||
mindplot.DragTopic.prototype.setPosition = function(x, y)
|
||||
{
|
||||
this._position.setValue(x, y);
|
||||
|
||||
// Elements are positioned in the center.
|
||||
// All topic element must be positioned based on the innerShape.
|
||||
var draggedNode = this._draggedNode;
|
||||
var size = draggedNode.getSize();
|
||||
|
||||
var cx = Math.ceil(x - (size.width / 2));
|
||||
var cy = Math.ceil(y - (size.height / 2));
|
||||
|
||||
// Update visual position.
|
||||
this._elem2d.setPosition(cx, cy);
|
||||
};
|
||||
|
||||
mindplot.DragTopic.prototype.getInnerShape = function()
|
||||
{
|
||||
return this._elem2d;
|
||||
};
|
||||
|
||||
mindplot.DragTopic.prototype.disconnect = function(workspace)
|
||||
{
|
||||
// Clear connection line ...
|
||||
var dragPivot = this._getDragPivot();
|
||||
dragPivot.disconnect(workspace);
|
||||
};
|
||||
|
||||
mindplot.DragTopic.prototype.canBeConnectedTo = function(targetTopic)
|
||||
{
|
||||
$assert(targetTopic, 'parent can not be null');
|
||||
|
||||
var result = true;
|
||||
if (!targetTopic.areChildrenShrinked() && !targetTopic.isCollapsed())
|
||||
{
|
||||
// Dragged node can not be connected to himself.
|
||||
if (targetTopic == this._draggedNode)
|
||||
{
|
||||
result = false;
|
||||
} else
|
||||
{
|
||||
var draggedNode = this.getDraggedTopic();
|
||||
var topicPosition = this.getPosition();
|
||||
|
||||
var targetTopicModel = targetTopic.getModel();
|
||||
var childTopicModel = draggedNode.getModel();
|
||||
|
||||
result = targetTopicModel.canBeConnected(childTopicModel, topicPosition, 18);
|
||||
}
|
||||
} else
|
||||
{
|
||||
result = false;
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
mindplot.DragTopic.prototype.connectTo = function(parent)
|
||||
{
|
||||
$assert(parent, 'Parent connection node can not be null.');
|
||||
|
||||
var dragPivot = this._getDragPivot();
|
||||
dragPivot.connectTo(parent);
|
||||
};
|
||||
|
||||
mindplot.DragTopic.prototype.getDraggedTopic = function()
|
||||
{
|
||||
return this._draggedNode;
|
||||
};
|
||||
|
||||
|
||||
mindplot.DragTopic.prototype.removeFromWorkspace = function(workspace)
|
||||
{
|
||||
// Remove drag shadow.
|
||||
workspace.removeChild(this._elem2d);
|
||||
|
||||
// Remove pivot shape. To improve performace it will not be removed. Only the visilility will be changed.
|
||||
var dragPivot = this._getDragPivot();
|
||||
dragPivot.setVisibility(false);
|
||||
};
|
||||
|
||||
mindplot.DragTopic.prototype.addToWorkspace = function(workspace)
|
||||
{
|
||||
workspace.appendChild(this._elem2d);
|
||||
var dragPivot = this._getDragPivot();
|
||||
|
||||
dragPivot.addToWorkspace(workspace);
|
||||
dragPivot.setVisibility(true);
|
||||
};
|
||||
|
||||
mindplot.DragTopic.prototype._getDragPivot = function()
|
||||
{
|
||||
return mindplot.DragTopic.__getDragPivot();
|
||||
};
|
||||
|
||||
mindplot.DragTopic.__getDragPivot = function()
|
||||
{
|
||||
mindplot.DragTopic.__getDragPivot = function() {
|
||||
var result = mindplot.DragTopic._dragPivot;
|
||||
if (!$defined(result))
|
||||
{
|
||||
if (!$defined(result)) {
|
||||
result = new mindplot.DragPivot();
|
||||
mindplot.DragTopic._dragPivot = result;
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
|
||||
mindplot.DragTopic.prototype.getPosition = function()
|
||||
{
|
||||
return this._position;
|
||||
};
|
||||
|
||||
mindplot.DragTopic.prototype.isDragTopic = function()
|
||||
{
|
||||
return true;
|
||||
};
|
||||
|
||||
mindplot.DragTopic.prototype.updateDraggedTopic = function(workspace)
|
||||
{
|
||||
$assert(workspace, 'workspace can not be null');
|
||||
|
||||
var dragPivot = this._getDragPivot();
|
||||
var draggedTopic = this.getDraggedTopic();
|
||||
|
||||
var isDragConnected = this.isConnected();
|
||||
var actionRunner = mindplot.DesignerActionRunner.getInstance();
|
||||
var topicId = draggedTopic.getId();
|
||||
var command = new mindplot.commands.DragTopicCommand(topicId);
|
||||
|
||||
if (isDragConnected)
|
||||
{
|
||||
|
||||
var targetTopic = this.getConnectedToTopic();
|
||||
if (targetTopic.getType() == mindplot.model.NodeModel.CENTRAL_TOPIC_TYPE)
|
||||
{
|
||||
// Update topic position ...
|
||||
var dragPivotPosition = dragPivot.getPosition();
|
||||
|
||||
// Must position the dragged topic taking into account the current node size.
|
||||
var pivotSize = dragPivot.getSize();
|
||||
var draggedTopicSize = draggedTopic.getSize();
|
||||
var xOffset = draggedTopicSize.width - pivotSize.width;
|
||||
xOffset = Math.round(xOffset / 2);
|
||||
|
||||
if (dragPivotPosition.x > 0)
|
||||
{
|
||||
dragPivotPosition.x = parseInt(dragPivotPosition.x) + xOffset;
|
||||
}
|
||||
else
|
||||
{
|
||||
dragPivotPosition.x = parseInt(dragPivotPosition.x) - xOffset;
|
||||
}
|
||||
// Set new position ...
|
||||
command.setPosition(dragPivotPosition);
|
||||
|
||||
} else
|
||||
{
|
||||
// Main topic connections can be positioned only with the order ...
|
||||
command.setOrder(this._order);
|
||||
}
|
||||
|
||||
// Set new parent topic ..
|
||||
command.setParetTopic(targetTopic);
|
||||
} else {
|
||||
|
||||
// If the node is not connected, positionate based on the original drag topic position.
|
||||
var dragPosition = this.getPosition();
|
||||
command = new mindplot.commands.DragTopicCommand(topicId, dragPosition);
|
||||
command.setPosition(dragPosition);
|
||||
}
|
||||
actionRunner.execute(command);
|
||||
};
|
||||
|
||||
mindplot.DragTopic.prototype.setBoardPosition = function(point)
|
||||
{
|
||||
$assert(point, 'point can not be null');
|
||||
var dragPivot = this._getDragPivot();
|
||||
dragPivot.setPosition(point);
|
||||
};
|
||||
|
||||
|
||||
mindplot.DragTopic.prototype.getBoardPosition = function(point)
|
||||
{
|
||||
$assert(point, 'point can not be null');
|
||||
var dragPivot = this._getDragPivot();
|
||||
return dragPivot.getPosition();
|
||||
};
|
||||
|
||||
mindplot.DragTopic.prototype.getConnectedToTopic = function()
|
||||
{
|
||||
var dragPivot = this._getDragPivot();
|
||||
return dragPivot.getTargetTopic();
|
||||
};
|
||||
|
||||
mindplot.DragTopic.prototype.isConnected = function()
|
||||
{
|
||||
return this.getConnectedToTopic() != null;
|
||||
};
|
||||
|
||||
mindplot.DragTopic.PIVOT_SIZE = {width:50,height:10};
|
||||
}
|
||||
|
||||
|
@ -71,7 +71,8 @@ mindplot.DragTopicPositioner = new Class({
|
||||
// Finally, connect nodes ...
|
||||
if (!dragTopic.isConnected()) {
|
||||
var centalTopic = topics[0];
|
||||
if ($defined(mainTopicToMainTopicConnection)) {
|
||||
if ($defined(mainTopicToMainTopicConnection))
|
||||
{
|
||||
dragTopic.connectTo(mainTopicToMainTopicConnection);
|
||||
} else if (Math.abs(dragTopic.getPosition().x - centalTopic.getPosition().x) <= mindplot.DragTopicPositioner.CENTRAL_TO_MAINTOPIC_MAX_HORIZONTAL_DISTANCE) {
|
||||
dragTopic.connectTo(centalTopic);
|
||||
@ -82,7 +83,6 @@ mindplot.DragTopicPositioner = new Class({
|
||||
_lookUpForMainTopicToMainTopicConnection : function(dragTopic) {
|
||||
var topics = this._topics;
|
||||
var result = null;
|
||||
var clouserDistance = -1;
|
||||
var draggedNode = dragTopic.getDraggedTopic();
|
||||
var distance = null;
|
||||
|
||||
|
@ -55,9 +55,12 @@ mindplot.IconGroup = new Class({
|
||||
},
|
||||
|
||||
addIcon : function(icon) {
|
||||
$defined(icon,"icon is not defined");
|
||||
icon.setGroup(this);
|
||||
|
||||
var newIcon = icon.getImage();
|
||||
var nativeElem = this.options.nativeElem;
|
||||
|
||||
var iconSize = newIcon.getSize();
|
||||
var size = nativeElem.getSize();
|
||||
newIcon.setPosition(size.width, 0);
|
||||
@ -186,8 +189,10 @@ mindplot.IconGroup = new Class({
|
||||
_calculateOffsets : function() {
|
||||
var offset = this.options.topic.getOffset();
|
||||
var text = this.options.topic.getTextShape();
|
||||
|
||||
var sizeHeight = text.getHtmlFontSize();
|
||||
var yOffset = offset;
|
||||
|
||||
var shape = this.options.topic.getShapeType();
|
||||
yOffset = text.getPosition().y + (sizeHeight - 18) / 2 + 1;
|
||||
return {x:offset, y:yOffset};
|
||||
|
@ -16,13 +16,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
mindplot.ImageIcon = new Class(
|
||||
{
|
||||
mindplot.ImageIcon = new Class({
|
||||
Extends:mindplot.Icon,
|
||||
initialize:function(iconModel, topic, designer) {
|
||||
$assert(iconModel, 'iconModel can not be null');
|
||||
$assert(topic, 'topic can not be null');
|
||||
$assert(designer, 'designer can not be null');
|
||||
|
||||
this._topic = topic;
|
||||
this._iconModel = iconModel;
|
||||
this._designer = designer;
|
||||
@ -44,16 +44,16 @@ mindplot.ImageIcon = new Class(
|
||||
|
||||
if (!$defined(designer._viewMode) || ($defined(designer._viewMode) && !designer._viewMode)) {
|
||||
|
||||
removeImage.addEvent('click', function(event) {
|
||||
var actionRunner = designer._actionRunner;
|
||||
var command = new mindplot.commands.RemoveIconFromTopicCommand(this._topic.getId(), iconModel);
|
||||
actionRunner.execute(command);
|
||||
removeImage.addEvent('click', function() {
|
||||
var actionDispatcher = mindplot.ActionDispatcher.getInstance();
|
||||
actionDispatcher.removeIconFromTopic(this._topic.getId(), iconModel);
|
||||
tip.forceClose();
|
||||
}.bindWithEvent(this));
|
||||
});
|
||||
|
||||
//Icon
|
||||
var image = this.getImage();
|
||||
image.addEventListener('click', function(event) {
|
||||
image.addEventListener('click', function() {
|
||||
|
||||
var iconType = iconModel.getIconType();
|
||||
var newIconType = this._getNextFamilyIconId(iconType);
|
||||
iconModel.setIconType(newIconType);
|
||||
@ -61,21 +61,16 @@ mindplot.ImageIcon = new Class(
|
||||
var imgUrl = this._getImageUrl(newIconType);
|
||||
this._image.setHref(imgUrl);
|
||||
|
||||
// // @Todo: Support revert of change icon ...
|
||||
// var actionRunner = designer._actionRunner;
|
||||
// var command = new mindplot.commands.ChangeIconFromTopicCommand(this._topic.getId());
|
||||
// this._actionRunner.execute(command);
|
||||
}.bind(this));
|
||||
|
||||
|
||||
}.bindWithEvent(this));
|
||||
|
||||
var imageIcon = this;
|
||||
image.addEventListener('mouseover', function(event) {
|
||||
tip.open(event, container, imageIcon);
|
||||
});
|
||||
tip.open(event, container, this);
|
||||
}.bind(this));
|
||||
|
||||
image.addEventListener('mouseout', function(event) {
|
||||
tip.close(event);
|
||||
});
|
||||
|
||||
image.addEventListener('mousemove', function(event) {
|
||||
tip.updatePosition(event);
|
||||
});
|
||||
@ -83,7 +78,7 @@ mindplot.ImageIcon = new Class(
|
||||
}
|
||||
},
|
||||
|
||||
_getImageUrl : function(iconId) {
|
||||
_getImageUrl : function(iconId) {
|
||||
return "../icons/" + iconId + ".png";
|
||||
},
|
||||
|
||||
@ -99,7 +94,6 @@ mindplot.ImageIcon = new Class(
|
||||
var result = null;
|
||||
for (var i = 0; i < familyIcons.length && result == null; i++) {
|
||||
if (familyIcons[i] == iconId) {
|
||||
var nextIconId;
|
||||
//Is last one?
|
||||
if (i == (familyIcons.length - 1)) {
|
||||
result = familyIcons[0];
|
||||
@ -164,7 +158,7 @@ mindplot.ImageIcon.prototype.ICON_FAMILIES = [
|
||||
{"id": "bullet", "icons" : ["bullet_black","bullet_blue","bullet_green","bullet_orange","bullet_red","bullet_pink","bullet_purple"]},
|
||||
{"id": "tag", "icons" : ["tag_blue","tag_green","tag_orange","tag_red","tag_pink","tag_yellow"]},
|
||||
{"id": "object", "icons" : ["object_bell","object_clanbomber","object_key","object_pencil","object_phone","object_magnifier","object_clip","object_music","object_star","object_wizard","object_house","object_cake","object_camera","object_palette","object_rainbow"]}
|
||||
]
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
@ -90,8 +90,9 @@ mindplot.LinkIcon = new Class({
|
||||
removeBtn.setStyle("margin-left", "3px");
|
||||
|
||||
removeBtn.addEvent('click', function(event) {
|
||||
var command = new mindplot.commands.RemoveLinkFromTopicCommand(this._topic.getId());
|
||||
designer._actionRunner.execute(command);
|
||||
|
||||
var actionDispatcher = mindplot.ActionDispatcher.getInstance();
|
||||
actionDispatcher.removeLinkFromTopic(this._topic.getId());
|
||||
bubbleTip.forceClose();
|
||||
}.bindWithEvent(this));
|
||||
|
||||
@ -148,7 +149,7 @@ mindplot.LinkIcon = new Class({
|
||||
});
|
||||
},
|
||||
|
||||
getUrl : function() {
|
||||
getUrl : function() {
|
||||
return this._url;
|
||||
},
|
||||
|
||||
|
310
mindplot/src/main/javascript/LocalActionDispatcher.js
Normal file
310
mindplot/src/main/javascript/LocalActionDispatcher.js
Normal file
@ -0,0 +1,310 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
mindplot.LocalActionDispatcher = new Class({
|
||||
Extends: mindplot.ActionDispatcher,
|
||||
initialize: function(commandContext) {
|
||||
this.parent(commandContext);
|
||||
this._actionRunner = new mindplot.DesignerActionRunner(commandContext, this);
|
||||
},
|
||||
|
||||
hasBeenChanged: function() {
|
||||
// @todo: This don't seems to belong here.
|
||||
this._actionRunner.hasBeenChanged();
|
||||
},
|
||||
|
||||
addIconToTopic: function(topicId, iconType) {
|
||||
var command = new mindplot.commands.AddIconToTopicCommand(topicId, iconType);
|
||||
this.execute(command);
|
||||
},
|
||||
|
||||
addLinkToTopic: function(topicId, url) {
|
||||
var command = new mindplot.commands.AddLinkToTopicCommand(topicId, url);
|
||||
this.execute(command);
|
||||
},
|
||||
|
||||
addTopic:function(model, parentTopicId, animated) {
|
||||
var command = new mindplot.commands.AddTopicCommand(model, parentTopicId, animated);
|
||||
this.execute(command);
|
||||
},
|
||||
|
||||
addNoteToTopic: function(topicId, text) {
|
||||
var command = new mindplot.commands.AddNoteToTopicCommand(topicId, text);
|
||||
this.execute(command);
|
||||
},
|
||||
|
||||
addRelationship: function(model, mindmap) {
|
||||
var command = new mindplot.commands.AddRelationshipCommand(model, mindmap);
|
||||
this.execute(command);
|
||||
},
|
||||
|
||||
deleteTopics: function(topicsIds) {
|
||||
var command = new mindplot.commands.DeleteTopicCommand(topicsIds);
|
||||
this.execute(command);
|
||||
},
|
||||
|
||||
dragTopic: function(topicId, position, order, parentTopic) {
|
||||
var command = new mindplot.commands.DragTopicCommand(topicId, position, order, parentTopic);
|
||||
this.execute(command);
|
||||
},
|
||||
|
||||
moveControlPoint: function(ctrlPoint, point) {
|
||||
var command = new mindplot.commands.MoveControlPointCommand(ctrlPoint, point);
|
||||
this.execute(command);
|
||||
},
|
||||
|
||||
removeIconFromTopic: function(topicId, iconModel) {
|
||||
var command = new mindplot.commands.RemoveIconFromTopicCommand(topicId, iconModel);
|
||||
this.execute(command);
|
||||
},
|
||||
removeLinkFromTopic: function(topicId) {
|
||||
var command = new mindplot.commands.RemoveLinkFromTopicCommand(topicId);
|
||||
this.execute(command);
|
||||
},
|
||||
|
||||
removeNoteFromTopic: function(topicId) {
|
||||
var command = new mindplot.commands.RemoveNoteFromTopicCommand(topicId);
|
||||
this.execute(command);
|
||||
},
|
||||
changeFontStyleToTopic: function(topicsIds) {
|
||||
|
||||
var commandFunc = function(topic) {
|
||||
var result = topic.getFontStyle();
|
||||
var style = (result == "italic") ? "normal" : "italic";
|
||||
topic.setFontStyle(style, true);
|
||||
return result;
|
||||
};
|
||||
var command = new mindplot.commands.GenericFunctionCommand(commandFunc, topicsIds);
|
||||
this._actionRunner.execute(command);
|
||||
|
||||
},
|
||||
|
||||
changeTextOnTopic : function(topicsIds, text) {
|
||||
$assert(topicsIds, "topicsIds can not be null");
|
||||
|
||||
var commandFunc = function(topic, value) {
|
||||
|
||||
var result = topic.getText();
|
||||
topic.setText(value);
|
||||
return result;
|
||||
};
|
||||
|
||||
var command = new mindplot.commands.GenericFunctionCommand(commandFunc, topicsIds, text);
|
||||
this._actionRunner.execute(command);
|
||||
},
|
||||
|
||||
changeFontFamilyToTopic: function(topicIds, fontFamily) {
|
||||
$assert(topicIds, "topicIds can not be null");
|
||||
$assert(fontFamily, "fontFamily can not be null");
|
||||
|
||||
|
||||
var commandFunc = function(topic, fontFamily) {
|
||||
var result = topic.getFontFamily();
|
||||
topic.setFontFamily(fontFamily, true);
|
||||
|
||||
core.Executor.instance.delay(topic.updateNode, 0, topic);
|
||||
return result;
|
||||
};
|
||||
|
||||
var command = new mindplot.commands.GenericFunctionCommand(commandFunc, topicIds, fontFamily);
|
||||
this.execute(command);
|
||||
},
|
||||
|
||||
changeFontColorToTopic: function(topicsIds, color) {
|
||||
$assert(topicsIds, "topicIds can not be null");
|
||||
$assert(color, "color can not be null");
|
||||
|
||||
var commandFunc = function(topic, color) {
|
||||
var result = topic.getFontColor();
|
||||
topic.setFontColor(color, true);
|
||||
return result;
|
||||
};
|
||||
|
||||
var command = new mindplot.commands.GenericFunctionCommand(commandFunc, topicsIds, color);
|
||||
command.discartDuplicated = "fontColorCommandId";
|
||||
this.execute(command);
|
||||
},
|
||||
|
||||
changeBackgroundColorToTopic: function(topicsIds, color) {
|
||||
$assert(topicsIds, "topicIds can not be null");
|
||||
$assert(color, "color can not be null");
|
||||
|
||||
var commandFunc = function(topic, color) {
|
||||
var result = topic.getBackgroundColor();
|
||||
topic.setBackgroundColor(color);
|
||||
return result;
|
||||
};
|
||||
|
||||
var command = new mindplot.commands.GenericFunctionCommand(commandFunc, topicsIds, color);
|
||||
command.discartDuplicated = "backColor";
|
||||
this.execute(command);
|
||||
},
|
||||
|
||||
changeBorderColorToTopic : function(topicsIds, color) {
|
||||
$assert(topicsIds, "topicIds can not be null");
|
||||
$assert(color, "topicIds can not be null");
|
||||
|
||||
var commandFunc = function(topic, color) {
|
||||
var result = topic.getBorderColor();
|
||||
topic.setBorderColor(color);
|
||||
return result;
|
||||
};
|
||||
|
||||
var command = new mindplot.commands.GenericFunctionCommand(commandFunc, topicsIds, color);
|
||||
command.discartDuplicated = "borderColorCommandId";
|
||||
this.execute(command);
|
||||
},
|
||||
|
||||
changeFontSizeToTopic : function(topicsIds, size) {
|
||||
$assert(topicsIds, "topicIds can not be null");
|
||||
$assert(size, "size can not be null");
|
||||
|
||||
var commandFunc = function(topic, size) {
|
||||
var result = topic.getFontSize();
|
||||
topic.setFontSize(size, true);
|
||||
|
||||
core.Executor.instance.delay(topic.updateNode, 0, topic);
|
||||
return result;
|
||||
};
|
||||
|
||||
var command = new mindplot.commands.GenericFunctionCommand(commandFunc, topicsIds, size);
|
||||
this.execute(command);
|
||||
},
|
||||
|
||||
changeShapeToTopic : function(topicsIds, shapeType) {
|
||||
$assert(topicsIds, "topicsIds can not be null");
|
||||
$assert(shapeType, "shapeType can not be null");
|
||||
|
||||
var commandFunc = function(topic, shapeType) {
|
||||
var result = topic.getShapeType();
|
||||
topic.setShapeType(shapeType, true);
|
||||
return result;
|
||||
};
|
||||
|
||||
var command = new mindplot.commands.GenericFunctionCommand(commandFunc, topicsIds, shapeType);
|
||||
this.execute(command);
|
||||
},
|
||||
|
||||
changeFontWeightToTopic : function(topicsIds) {
|
||||
$assert(topicsIds, "topicsIds can not be null");
|
||||
|
||||
var commandFunc = function(topic) {
|
||||
var result = topic.getFontWeight();
|
||||
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);*/
|
||||
return result;
|
||||
};
|
||||
|
||||
var command = new mindplot.commands.GenericFunctionCommand(commandFunc, topicsIds);
|
||||
this.execute(command);
|
||||
},
|
||||
|
||||
shrinkBranch : function(topicsIds, collapse) {
|
||||
$assert(topicsIds, "topicsIds can not be null");
|
||||
|
||||
var commandFunc = function(topic, isShrink) {
|
||||
topic.setChildrenShrinked(isShrink);
|
||||
return !isShrink;
|
||||
};
|
||||
|
||||
var command = new mindplot.commands.GenericFunctionCommand(commandFunc, topicsIds, collapse);
|
||||
this.execute(command);
|
||||
},
|
||||
|
||||
execute:function(command) {
|
||||
this._actionRunner.execute(command);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
mindplot.CommandContext = new Class({
|
||||
initialize: function(designer) {
|
||||
$assert(designer, "designer can not be null");
|
||||
this._designer = designer;
|
||||
},
|
||||
findTopics:function(topicsIds) {
|
||||
var designerTopics = this._designer._topics;
|
||||
if (!(topicsIds instanceof Array)) {
|
||||
topicsIds = [topicsIds];
|
||||
}
|
||||
|
||||
var result = designerTopics.filter(function(topic) {
|
||||
var found = false;
|
||||
if (topic != null) {
|
||||
var topicId = topic.getId();
|
||||
found = topicsIds.contains(topicId);
|
||||
}
|
||||
return found;
|
||||
|
||||
});
|
||||
return result;
|
||||
},
|
||||
|
||||
deleteTopic:function(topic) {
|
||||
this._designer._removeNode(topic);
|
||||
},
|
||||
|
||||
createTopic:function(model, isVisible) {
|
||||
$assert(model, "model can not be null");
|
||||
return this._designer._nodeModelToNodeGraph(model, isVisible);
|
||||
},
|
||||
|
||||
createModel:function() {
|
||||
var mindmap = this._designer.getMindmap();
|
||||
return mindmap.createNode(mindplot.NodeModel.MAIN_TOPIC_TYPE);
|
||||
},
|
||||
|
||||
connect:function(childTopic, parentTopic, isVisible) {
|
||||
childTopic.connectTo(parentTopic, this._designer._workspace, isVisible);
|
||||
} ,
|
||||
|
||||
disconnect:function(topic) {
|
||||
topic.disconnect(this._designer._workspace);
|
||||
},
|
||||
|
||||
createRelationship:function(model) {
|
||||
$assert(model, "model cannot be null");
|
||||
return this._designer.createRelationship(model);
|
||||
},
|
||||
removeRelationship:function(model) {
|
||||
this._designer.removeRelationship(model);
|
||||
},
|
||||
|
||||
findRelationships:function(lineIds) {
|
||||
var result = [];
|
||||
lineIds.forEach(function(lineId, index) {
|
||||
var line = this._designer._relationships[lineId];
|
||||
if ($defined(line)) {
|
||||
result.push(line);
|
||||
}
|
||||
}.bind(this));
|
||||
return result;
|
||||
},
|
||||
|
||||
getSelectedRelationshipLines:function() {
|
||||
return this._designer.getSelectedRelationshipLines();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -119,7 +119,7 @@ mindplot.MainTopic = new Class({
|
||||
},
|
||||
|
||||
disconnect : function(workspace) {
|
||||
mindplot.Topic.prototype.disconnect.call(this, workspace);
|
||||
this.parent(workspace);
|
||||
var size = this.getSize();
|
||||
|
||||
var model = this.getModel();
|
||||
|
@ -22,9 +22,14 @@ mindplot.MindmapDesigner = new Class({
|
||||
$assert(profile.zoom, "zoom must be defined");
|
||||
$assert(divElement, "divElement must be defined");
|
||||
|
||||
// Undo manager ...
|
||||
this._actionRunner = new mindplot.DesignerActionRunner(this);
|
||||
mindplot.DesignerActionRunner.setInstance(this._actionRunner);
|
||||
// Dispatcher manager ...
|
||||
var commandContext = new mindplot.CommandContext(this);
|
||||
this._actionDispatcher = new mindplot.LocalActionDispatcher(commandContext);
|
||||
this._actionDispatcher.addEvent("modelUpdate", function(event) {
|
||||
this._fireEvent("modelUpdate", event);
|
||||
}.bind(this));
|
||||
|
||||
mindplot.ActionDispatcher.setInstance(this._actionDispatcher);
|
||||
|
||||
// Initial Zoom
|
||||
this._zoom = profile.zoom;
|
||||
@ -39,18 +44,13 @@ mindplot.MindmapDesigner = new Class({
|
||||
var editorClass = mindplot.TextEditorFactory.getTextEditorFromName(mindplot.EditorOptions.textEditor);
|
||||
this._editor = new editorClass(this, this._actionRunner);
|
||||
|
||||
|
||||
// Init layout managers ...
|
||||
this._topics = [];
|
||||
// var layoutManagerClass = mindplot.layout.LayoutManagerFactory.getManagerByName(mindplot.EditorOptions.LayoutManager);
|
||||
// this._layoutManager = new layoutManagerClass(this);
|
||||
this._layoutManager = new mindplot.layout.OriginalLayoutManager(this);
|
||||
|
||||
// Register handlers..
|
||||
this._registerEvents();
|
||||
|
||||
this._relationships = {};
|
||||
|
||||
this._events = {};
|
||||
},
|
||||
|
||||
@ -63,11 +63,8 @@ mindplot.MindmapDesigner = new Class({
|
||||
return topics[0];
|
||||
},
|
||||
|
||||
|
||||
addEventListener : function(eventType, listener) {
|
||||
|
||||
this._events[eventType] = listener;
|
||||
|
||||
},
|
||||
|
||||
_fireEvent : function(eventType, event) {
|
||||
@ -87,7 +84,7 @@ mindplot.MindmapDesigner = new Class({
|
||||
// Create nodes on double click...
|
||||
screenManager.addEventListener('click', function(event) {
|
||||
if (workspace.isWorkspaceEventsEnabled()) {
|
||||
var t = mindmapDesigner.getEditor().isVisible();
|
||||
mindmapDesigner.getEditor().isVisible();
|
||||
mindmapDesigner.getEditor().lostFocus();
|
||||
// @todo: Puaj hack...
|
||||
mindmapDesigner._cleanScreen();
|
||||
@ -110,8 +107,7 @@ mindplot.MindmapDesigner = new Class({
|
||||
var centralTopicId = centralTopic.getId();
|
||||
|
||||
// Execute action ...
|
||||
var command = new mindplot.commands.AddTopicCommand(model, centralTopicId, true);
|
||||
this._actionRunner.execute(command);
|
||||
this._actionDispatcher.addTopic(model, centralTopicId, true);
|
||||
}
|
||||
}.bind(this));
|
||||
}
|
||||
@ -159,14 +155,14 @@ mindplot.MindmapDesigner = new Class({
|
||||
onObjectFocusEvent : function(currentObject, event) {
|
||||
this.getEditor().lostFocus();
|
||||
var selectableObjects = this.getSelectedObjects();
|
||||
|
||||
// Disable all nodes on focus but not the current if Ctrl key isn't being pressed
|
||||
if (!$defined(event) || event.ctrlKey == false) {
|
||||
for (var i = 0; i < selectableObjects.length; i++) {
|
||||
var selectableObject = selectableObjects[i];
|
||||
selectableObjects.forEach(function(selectableObject) {
|
||||
if (selectableObject.isOnFocus() && selectableObject != currentObject) {
|
||||
selectableObject.setOnFocus(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
@ -214,8 +210,9 @@ mindplot.MindmapDesigner = new Class({
|
||||
var parentTopicId = centalTopic.getId();
|
||||
var childModel = centalTopic.createChildModel(this._layoutManager.needsPrepositioning());
|
||||
|
||||
var command = new mindplot.commands.AddTopicCommand(childModel, parentTopicId, true);
|
||||
this._actionRunner.execute(command);
|
||||
// Execute event ...
|
||||
this._actionDispatcher.addTopic(childModel, parentTopicId, true);
|
||||
|
||||
},
|
||||
|
||||
createSiblingForSelectedNode : function() {
|
||||
@ -241,9 +238,8 @@ mindplot.MindmapDesigner = new Class({
|
||||
var parentTopic = topic.getOutgoingConnectedTopic();
|
||||
var siblingModel = topic.createSiblingModel(this._layoutManager.needsPrepositioning());
|
||||
var parentTopicId = parentTopic.getId();
|
||||
var command = new mindplot.commands.AddTopicCommand(siblingModel, parentTopicId, true);
|
||||
|
||||
this._actionRunner.execute(command);
|
||||
this._actionDispatcher.addTopic(siblingModel, parentTopicId, true);
|
||||
}
|
||||
},
|
||||
|
||||
@ -303,8 +299,8 @@ mindplot.MindmapDesigner = new Class({
|
||||
var mindmap = this.getMindmap();
|
||||
var model = mindmap.createRelationship(fromNode.getModel().getId(), toNode.getModel().getId());
|
||||
|
||||
var command = new mindplot.commands.AddRelationshipCommand(model, mindmap);
|
||||
this._actionRunner.execute(command);
|
||||
this._actionDispatcher.addRelationship(model, mindmap);
|
||||
|
||||
},
|
||||
|
||||
needsSave : function() {
|
||||
@ -364,7 +360,8 @@ mindplot.MindmapDesigner = new Class({
|
||||
|
||||
this._fireEvent("loadsuccess");
|
||||
|
||||
},
|
||||
}
|
||||
,
|
||||
|
||||
load : function(mapId) {
|
||||
$assert(mapId, 'mapName can not be null');
|
||||
@ -383,7 +380,8 @@ mindplot.MindmapDesigner = new Class({
|
||||
this._goToNode.attempt(centralTopic, this);
|
||||
|
||||
this._fireEvent("loadsuccess");
|
||||
},
|
||||
}
|
||||
,
|
||||
|
||||
_loadMap : function(mapId, mindmapModel) {
|
||||
var designer = this;
|
||||
@ -396,7 +394,7 @@ mindplot.MindmapDesigner = new Class({
|
||||
for (var i = 0; i < branches.length; i++) {
|
||||
// NodeModel -> NodeGraph ...
|
||||
var nodeModel = branches[i];
|
||||
var nodeGraph = this._nodeModelToNodeGraph(nodeModel);
|
||||
var nodeGraph = this._nodeModelToNodeGraph(nodeModel, false);
|
||||
|
||||
// Update shrink render state...
|
||||
nodeGraph.setBranchVisibility(true);
|
||||
@ -412,42 +410,46 @@ mindplot.MindmapDesigner = new Class({
|
||||
});
|
||||
this._fireEvent("loadsuccess");
|
||||
|
||||
},
|
||||
}
|
||||
,
|
||||
|
||||
|
||||
getMindmap : function() {
|
||||
return this._mindmap;
|
||||
},
|
||||
}
|
||||
,
|
||||
|
||||
undo : function() {
|
||||
this._actionRunner.undo();
|
||||
},
|
||||
}
|
||||
,
|
||||
|
||||
redo : function() {
|
||||
this._actionRunner.redo();
|
||||
},
|
||||
}
|
||||
,
|
||||
|
||||
_nodeModelToNodeGraph : function(nodeModel, isVisible) {
|
||||
$assert(nodeModel, "Node model can not be null");
|
||||
var nodeGraph = this._buildNodeGraph(nodeModel);
|
||||
|
||||
if ($defined(isVisible))
|
||||
if (isVisible)
|
||||
nodeGraph.setVisibility(isVisible);
|
||||
|
||||
var children = nodeModel.getChildren().slice();
|
||||
|
||||
children = this._layoutManager.prepareNode(nodeGraph, children);
|
||||
|
||||
for (var i = 0; i < children.length; i++) {
|
||||
var child = children[i];
|
||||
if ($defined(child))
|
||||
this._nodeModelToNodeGraph(child);
|
||||
this._nodeModelToNodeGraph(child, false);
|
||||
}
|
||||
|
||||
var workspace = this._workspace;
|
||||
workspace.appendChild(nodeGraph);
|
||||
return nodeGraph;
|
||||
},
|
||||
}
|
||||
,
|
||||
|
||||
_relationshipModelToRelationship : function(model) {
|
||||
$assert(model, "Node model can not be null");
|
||||
@ -480,7 +482,6 @@ mindplot.MindmapDesigner = new Class({
|
||||
},
|
||||
|
||||
_buildRelationship : function (model) {
|
||||
var workspace = this._workspace;
|
||||
var elem = this;
|
||||
|
||||
var fromNodeId = model.getFromNode();
|
||||
@ -521,7 +522,6 @@ mindplot.MindmapDesigner = new Class({
|
||||
relationLine.setModel(model);
|
||||
|
||||
//Add Listeners
|
||||
var elem = this;
|
||||
relationLine.addEventListener('onfocus', function(event) {
|
||||
elem.onObjectFocusEvent.attempt([relationLine, event], elem);
|
||||
});
|
||||
@ -567,8 +567,7 @@ mindplot.MindmapDesigner = new Class({
|
||||
var validateError = 'Central topic can not be deleted.';
|
||||
var selectedObjects = this._getValidSelectedObjectsIds(validateFunc, validateError);
|
||||
if (selectedObjects.nodes.length > 0 || selectedObjects.relationshipLines.length > 0) {
|
||||
var command = new mindplot.commands.DeleteTopicCommand(selectedObjects);
|
||||
this._actionRunner.execute(command);
|
||||
this._actionDispatcher.deleteTopics(selectedObjects);
|
||||
}
|
||||
|
||||
},
|
||||
@ -577,19 +576,8 @@ mindplot.MindmapDesigner = new Class({
|
||||
var validSelectedObjects = this._getValidSelectedObjectsIds();
|
||||
var topicsIds = validSelectedObjects.nodes;
|
||||
if (topicsIds.length > 0) {
|
||||
var commandFunc = function(topic, font) {
|
||||
var result = topic.getFontFamily();
|
||||
topic.setFontFamily(font, true);
|
||||
this._actionDispatcher.changeFontFamilyToTopic(topicsIds, font);
|
||||
|
||||
core.Executor.instance.delay(topic.updateNode, 0, topic);
|
||||
/*var updated = function() {
|
||||
topic.updateNode();
|
||||
};
|
||||
updated.delay(0);*/
|
||||
return result;
|
||||
}
|
||||
var command = new mindplot.commands.GenericFunctionCommand(commandFunc, font, topicsIds);
|
||||
this._actionRunner.execute(command);
|
||||
}
|
||||
},
|
||||
|
||||
@ -597,14 +585,7 @@ mindplot.MindmapDesigner = new Class({
|
||||
var validSelectedObjects = this._getValidSelectedObjectsIds();
|
||||
var topicsIds = validSelectedObjects.nodes;
|
||||
if (topicsIds.length > 0) {
|
||||
var commandFunc = function(topic) {
|
||||
var result = topic.getFontStyle();
|
||||
var style = (result == "italic") ? "normal" : "italic";
|
||||
topic.setFontStyle(style, true);
|
||||
return result;
|
||||
}
|
||||
var command = new mindplot.commands.GenericFunctionCommand(commandFunc, "", topicsIds);
|
||||
this._actionRunner.execute(command);
|
||||
this._actionDispatcher.changeFontStyleToTopic(topicsIds);
|
||||
}
|
||||
},
|
||||
|
||||
@ -612,14 +593,7 @@ mindplot.MindmapDesigner = new Class({
|
||||
var validSelectedObjects = this._getValidSelectedObjectsIds();
|
||||
var topicsIds = validSelectedObjects.nodes;
|
||||
if (topicsIds.length > 0) {
|
||||
var commandFunc = function(topic, color) {
|
||||
var result = topic.getFontColor();
|
||||
topic.setFontColor(color, true);
|
||||
return result;
|
||||
}
|
||||
var command = new mindplot.commands.GenericFunctionCommand(commandFunc, color, topicsIds);
|
||||
command.discartDuplicated = "fontColorCommandId";
|
||||
this._actionRunner.execute(command);
|
||||
this._actionDispatcher.changeFontColorToTopic(topicsIds, color);
|
||||
}
|
||||
},
|
||||
|
||||
@ -628,20 +602,11 @@ mindplot.MindmapDesigner = new Class({
|
||||
var validateFunc = function(topic) {
|
||||
return topic.getShapeType() != mindplot.model.NodeModel.SHAPE_TYPE_LINE
|
||||
};
|
||||
var validateError = 'Color can not be setted to line topics.';
|
||||
var validateError = 'Color can not be set to line topics.';
|
||||
var validSelectedObjects = this._getValidSelectedObjectsIds(validateFunc, validateError);
|
||||
;
|
||||
var topicsIds = validSelectedObjects.nodes;
|
||||
|
||||
if (topicsIds.length > 0) {
|
||||
var commandFunc = function(topic, color) {
|
||||
var result = topic.getBackgroundColor();
|
||||
topic.setBackgroundColor(color);
|
||||
return result;
|
||||
}
|
||||
var command = new mindplot.commands.GenericFunctionCommand(commandFunc, color, topicsIds);
|
||||
command.discartDuplicated = "backColor";
|
||||
this._actionRunner.execute(command);
|
||||
this._actionDispatcher.changeBackgroundColorToTopic(topicsIds, color);
|
||||
}
|
||||
},
|
||||
|
||||
@ -688,20 +653,12 @@ mindplot.MindmapDesigner = new Class({
|
||||
var validateFunc = function(topic) {
|
||||
return topic.getShapeType() != mindplot.model.NodeModel.SHAPE_TYPE_LINE
|
||||
};
|
||||
var validateError = 'Color can not be setted to line topics.';
|
||||
var validateError = 'Color can not be set to line topics.';
|
||||
var validSelectedObjects = this._getValidSelectedObjectsIds(validateFunc, validateError);
|
||||
;
|
||||
var topicsIds = validSelectedObjects.nodes;
|
||||
|
||||
if (topicsIds.length > 0) {
|
||||
var commandFunc = function(topic, color) {
|
||||
var result = topic.getBorderColor();
|
||||
topic.setBorderColor(color);
|
||||
return result;
|
||||
}
|
||||
var command = new mindplot.commands.GenericFunctionCommand(commandFunc, color, topicsIds);
|
||||
command.discartDuplicated = "borderColorCommandId";
|
||||
this._actionRunner.execute(command);
|
||||
this._actionDispatcher.changeBorderColorToTopic(topicsIds, color);
|
||||
}
|
||||
},
|
||||
|
||||
@ -709,19 +666,7 @@ mindplot.MindmapDesigner = new Class({
|
||||
var validSelectedObjects = this._getValidSelectedObjectsIds();
|
||||
var topicsIds = validSelectedObjects.nodes;
|
||||
if (topicsIds.length > 0) {
|
||||
var commandFunc = function(topic, size) {
|
||||
var result = topic.getFontSize();
|
||||
topic.setFontSize(size, true);
|
||||
|
||||
core.Executor.instance.delay(topic.updateNode, 0, topic);
|
||||
/*var updated = function() {
|
||||
topic.updateNode();
|
||||
};
|
||||
updated.delay(0);*/
|
||||
return result;
|
||||
}
|
||||
var command = new mindplot.commands.GenericFunctionCommand(commandFunc, size, topicsIds);
|
||||
this._actionRunner.execute(command);
|
||||
this._actionDispatcher.changeFontSizeToTopic(topicsIds, size);
|
||||
}
|
||||
},
|
||||
|
||||
@ -734,13 +679,7 @@ mindplot.MindmapDesigner = new Class({
|
||||
var topicsIds = validSelectedObjects.nodes;
|
||||
|
||||
if (topicsIds.length > 0) {
|
||||
var commandFunc = function(topic, size) {
|
||||
var result = topic.getShapeType();
|
||||
topic.setShapeType(size, true);
|
||||
return result;
|
||||
}
|
||||
var command = new mindplot.commands.GenericFunctionCommand(commandFunc, shape, topicsIds);
|
||||
this._actionRunner.execute(command);
|
||||
this._actionDispatcher.changeShapeToTopic(topicsIds, shape);
|
||||
}
|
||||
},
|
||||
|
||||
@ -749,30 +688,15 @@ mindplot.MindmapDesigner = new Class({
|
||||
var validSelectedObjects = this._getValidSelectedObjectsIds();
|
||||
var topicsIds = validSelectedObjects.nodes;
|
||||
if (topicsIds.length > 0) {
|
||||
var commandFunc = function(topic) {
|
||||
var result = topic.getFontWeight();
|
||||
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);*/
|
||||
return result;
|
||||
}
|
||||
var command = new mindplot.commands.GenericFunctionCommand(commandFunc, "", topicsIds);
|
||||
this._actionRunner.execute(command);
|
||||
this._actionDispatcher.changeFontWeightToTopic(topicsIds);
|
||||
}
|
||||
},
|
||||
|
||||
addImage2SelectedNode : function(iconType) {
|
||||
addIconType2SelectedNode : function(iconType) {
|
||||
var validSelectedObjects = this._getValidSelectedObjectsIds();
|
||||
var topicsIds = validSelectedObjects.nodes;
|
||||
if (topicsIds.length > 0) {
|
||||
|
||||
var command = new mindplot.commands.AddIconToTopicCommand(topicsIds[0], iconType);
|
||||
this._actionRunner.execute(command);
|
||||
this._actionDispatcher.addIconToTopic(topicsIds[0], iconType);
|
||||
}
|
||||
},
|
||||
|
||||
@ -780,8 +704,7 @@ mindplot.MindmapDesigner = new Class({
|
||||
var validSelectedObjects = this._getValidSelectedObjectsIds();
|
||||
var topicsIds = validSelectedObjects.nodes;
|
||||
if (topicsIds.length > 0) {
|
||||
var command = new mindplot.commands.AddLinkToTopicCommand(topicsIds[0], url);
|
||||
this._actionRunner.execute(command);
|
||||
this._actionDispatcher.addLinkToTopic(topicsIds[0], url);
|
||||
}
|
||||
},
|
||||
|
||||
@ -793,11 +716,11 @@ mindplot.MindmapDesigner = new Class({
|
||||
if (!$defined(topic._hasLink)) {
|
||||
var msg = new Element('div');
|
||||
var urlText = new Element('div').inject(msg);
|
||||
urlText.innerHTML = "URL:"
|
||||
urlText.innerHTML = "URL:";
|
||||
var formElem = new Element('form', {'action': 'none', 'id':'linkFormId'});
|
||||
var urlInput = new Element('input', {'type': 'text', 'size':30});
|
||||
urlInput.inject(formElem);
|
||||
formElem.inject(msg)
|
||||
formElem.inject(msg);
|
||||
|
||||
var okButtonId = "linkOkButtonId";
|
||||
formElem.addEvent('submit', function(e) {
|
||||
@ -833,8 +756,7 @@ mindplot.MindmapDesigner = new Class({
|
||||
var validSelectedObjects = this._getValidSelectedObjectsIds();
|
||||
var topicsIds = validSelectedObjects.nodes;
|
||||
if (topicsIds.length > 0) {
|
||||
var command = new mindplot.commands.AddNoteToTopicCommand(topicsIds[0], text);
|
||||
this._actionRunner.execute(command);
|
||||
this._actionDispatcher.addNoteToTopic(topicsIds[0], text);
|
||||
}
|
||||
},
|
||||
|
||||
@ -881,27 +803,6 @@ mindplot.MindmapDesigner = new Class({
|
||||
}
|
||||
},
|
||||
|
||||
removeLastImageFromSelectedNode : function() {
|
||||
var nodes = this._getSelectedNodes();
|
||||
if (nodes.length == 0) {
|
||||
core.Monitor.getInstance().logMessage('A topic must be selected in order to execute this operation.');
|
||||
} else {
|
||||
var elem = nodes[0];
|
||||
elem.removeLastIcon(this);
|
||||
core.Executor.instance.delay(elem.updateNode, 0, elem);
|
||||
/*var executor = function(editor)
|
||||
{
|
||||
return function()
|
||||
{
|
||||
elem.updateNode();
|
||||
};
|
||||
};
|
||||
|
||||
setTimeout(executor(this), 0);*/
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
_getSelectedNodes : function() {
|
||||
var result = new Array();
|
||||
for (var i = 0; i < this._topics.length; i++) {
|
||||
@ -951,6 +852,7 @@ mindplot.MindmapDesigner = new Class({
|
||||
evt.returnValue = false;
|
||||
}
|
||||
else {
|
||||
// @ToDo: I think that some of the keys has been removed ... Check this...
|
||||
evt = new Event(event);
|
||||
var key = evt.key;
|
||||
if (!this._editor.isVisible()) {
|
||||
@ -961,6 +863,8 @@ mindplot.MindmapDesigner = new Class({
|
||||
this._showEditor(key);
|
||||
}
|
||||
else {
|
||||
var nodes;
|
||||
var node;
|
||||
switch (key) {
|
||||
case 'delete':
|
||||
this.deleteCurrentNode();
|
||||
@ -974,9 +878,9 @@ mindplot.MindmapDesigner = new Class({
|
||||
this.createChildForSelectedNode();
|
||||
break;
|
||||
case 'right':
|
||||
var nodes = this._getSelectedNodes();
|
||||
nodes = this._getSelectedNodes();
|
||||
if (nodes.length > 0) {
|
||||
var node = nodes[0];
|
||||
node = nodes[0];
|
||||
if (node.getTopicType() == mindplot.model.NodeModel.CENTRAL_TOPIC_TYPE) {
|
||||
this._goToSideChild(node, 'RIGHT');
|
||||
}
|
||||
@ -991,9 +895,9 @@ mindplot.MindmapDesigner = new Class({
|
||||
}
|
||||
break;
|
||||
case 'left':
|
||||
var nodes = this._getSelectedNodes();
|
||||
nodes = this._getSelectedNodes();
|
||||
if (nodes.length > 0) {
|
||||
var node = nodes[0];
|
||||
node = nodes[0];
|
||||
if (node.getTopicType() == mindplot.model.NodeModel.CENTRAL_TOPIC_TYPE) {
|
||||
this._goToSideChild(node, 'LEFT');
|
||||
}
|
||||
@ -1008,18 +912,18 @@ mindplot.MindmapDesigner = new Class({
|
||||
}
|
||||
break;
|
||||
case'up':
|
||||
var nodes = this._getSelectedNodes();
|
||||
nodes = this._getSelectedNodes();
|
||||
if (nodes.length > 0) {
|
||||
var node = nodes[0];
|
||||
node = nodes[0];
|
||||
if (node.getTopicType() != mindplot.model.NodeModel.CENTRAL_TOPIC_TYPE) {
|
||||
this._goToBrother(node, 'UP');
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'down':
|
||||
var nodes = this._getSelectedNodes();
|
||||
nodes = this._getSelectedNodes();
|
||||
if (nodes.length > 0) {
|
||||
var node = nodes[0];
|
||||
node = nodes[0];
|
||||
if (node.getTopicType() != mindplot.model.NodeModel.CENTRAL_TOPIC_TYPE) {
|
||||
this._goToBrother(node, 'DOWN');
|
||||
}
|
||||
@ -1029,8 +933,7 @@ mindplot.MindmapDesigner = new Class({
|
||||
this._showEditor();
|
||||
break;
|
||||
case 'space':
|
||||
|
||||
var nodes = this._getSelectedNodes();
|
||||
nodes = this._getSelectedNodes();
|
||||
if (nodes.length > 0) {
|
||||
var topic = nodes[0];
|
||||
|
||||
@ -1043,9 +946,9 @@ mindplot.MindmapDesigner = new Class({
|
||||
evt.preventDefault();
|
||||
break;
|
||||
case 'esc':
|
||||
var nodes = this._getSelectedNodes();
|
||||
nodes = this._getSelectedNodes();
|
||||
for (var i = 0; i < nodes.length; i++) {
|
||||
var node = nodes[i];
|
||||
node = nodes[i];
|
||||
node.setOnFocus(false);
|
||||
}
|
||||
break;
|
||||
@ -1170,17 +1073,6 @@ mindplot.MindmapDesigner = new Class({
|
||||
|
||||
getWorkSpace : function() {
|
||||
return this._workspace;
|
||||
},
|
||||
|
||||
findRelationShipsByTopicId : function(topicId) {
|
||||
var result = [];
|
||||
for (var relationshipId in this._relationships) {
|
||||
var relationship = this._relationships[relationshipId];
|
||||
if (relationship.getModel().getFromNode() == topicId || relationship.getModel().getToNode() == topicId) {
|
||||
result.push(relationship);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
mindplot.NodeGraph = new Class({
|
||||
initialize:function(nodeModel) {
|
||||
$assert(nodeModel,"model can not be null");
|
||||
$assert(nodeModel, "model can not be null");
|
||||
this._mouseEvents = true;
|
||||
this.setModel(nodeModel);
|
||||
this._onFocus = false;
|
||||
@ -74,13 +74,10 @@ mindplot.NodeGraph = new Class({
|
||||
this._model.setSize(size.width, size.height);
|
||||
},
|
||||
|
||||
getModel
|
||||
:
|
||||
function() {
|
||||
$assert(this._model, 'Model has not been initialized yet');
|
||||
return this._model;
|
||||
}
|
||||
,
|
||||
getModel:function() {
|
||||
$assert(this._model, 'Model has not been initialized yet');
|
||||
return this._model;
|
||||
},
|
||||
|
||||
setModel : function(model) {
|
||||
$assert(model, 'Model can not be null');
|
||||
|
@ -21,7 +21,7 @@ mindplot.Note = new Class({
|
||||
initialize : function(textModel, topic, designer) {
|
||||
var divContainer = designer.getWorkSpace().getScreenManager().getContainer();
|
||||
var bubbleTip = mindplot.BubbleTip.getInstance(divContainer);
|
||||
mindplot.Icon.call(this, mindplot.Note.IMAGE_URL);
|
||||
this.parent(mindplot.Note.IMAGE_URL);
|
||||
this._noteModel = textModel;
|
||||
this._topic = topic;
|
||||
this._designer = designer;
|
||||
@ -50,8 +50,9 @@ mindplot.Note = new Class({
|
||||
removeBtn.setStyle("margin-left", "3px");
|
||||
|
||||
removeBtn.addEvent('click', function(event) {
|
||||
var command = new mindplot.commands.RemoveNoteFromTopicCommand(this._topic.getId());
|
||||
designer._actionRunner.execute(command);
|
||||
var actionDispatcher = mindplot.ActionDispatcher.getInstance();
|
||||
actionDispatcher.removeNoteFromTopic(this._topic.getId());
|
||||
|
||||
bubbleTip.forceClose();
|
||||
}.bindWithEvent(this));
|
||||
|
||||
|
@ -45,8 +45,7 @@ mindplot.RelationshipLine = new Class({
|
||||
},
|
||||
|
||||
setStroke : function(color, style, opacity) {
|
||||
// @Todo: How this is supported in mootools ?
|
||||
mindplot.ConnectionLine.prototype.setStroke.call(this, color, style, opacity);
|
||||
this.parent(color, style, opacity);
|
||||
this._startArrow.setStrokeColor(color);
|
||||
},
|
||||
|
||||
@ -126,7 +125,7 @@ mindplot.RelationshipLine = new Class({
|
||||
workspace.appendChild(this._startArrow);
|
||||
workspace.appendChild(this._endArrow);
|
||||
|
||||
mindplot.ConnectionLine.prototype.addToWorkspace.call(this, workspace);
|
||||
this.parent(workspace);
|
||||
},
|
||||
|
||||
_initializeControlPointController : function(event, workspace) {
|
||||
@ -141,7 +140,7 @@ mindplot.RelationshipLine = new Class({
|
||||
workspace.removeChild(this._startArrow);
|
||||
workspace.removeChild(this._endArrow);
|
||||
|
||||
mindplot.ConnectionLine.prototype.removeFromWorkspace.call(this, workspace);
|
||||
this.parent(workspace);
|
||||
},
|
||||
|
||||
getType : function() {
|
||||
@ -195,13 +194,13 @@ mindplot.RelationshipLine = new Class({
|
||||
},
|
||||
|
||||
setVisibility : function(value) {
|
||||
mindplot.ConnectionLine.prototype.setVisibility.call(this, value);
|
||||
this.parent(value);
|
||||
this._endArrow.setVisibility(this._showEndArrow && value);
|
||||
this._startArrow.setVisibility(this._showStartArrow && value);
|
||||
},
|
||||
|
||||
setOpacity : function(opacity) {
|
||||
mindplot.ConnectionLine.prototype.setOpacity.call(this, opacity);
|
||||
this.parent(opacity);
|
||||
if (this._showEndArrow)
|
||||
this._endArrow.setOpacity(opacity);
|
||||
if (this._showStartArrow)
|
||||
|
@ -26,18 +26,11 @@ mindplot.ShirinkConnector = new Class({
|
||||
elipse.setSize(mindplot.Topic.CONNECTOR_WIDTH, mindplot.Topic.CONNECTOR_WIDTH);
|
||||
elipse.addEventListener('click', function(event) {
|
||||
var model = topic.getModel();
|
||||
var isShrink = !model.areChildrenShrinked();
|
||||
var collapse = !model.areChildrenShrinked();
|
||||
|
||||
var actionRunner = mindplot.DesignerActionRunner.getInstance();
|
||||
var topicId = topic.getId();
|
||||
|
||||
var commandFunc = function(topic, isShrink) {
|
||||
topic.setChildrenShrinked(isShrink);
|
||||
return !isShrink;
|
||||
};
|
||||
|
||||
var command = new mindplot.commands.GenericFunctionCommand(commandFunc, isShrink, [topicId]);
|
||||
actionRunner.execute(command);
|
||||
var actionDispatcher = mindplot.ActionDispatcher.getInstance();
|
||||
actionDispatcher.shrinkBranch([topicId],collapse);
|
||||
|
||||
var e = new Event(event).stop();
|
||||
e.preventDefault();
|
||||
|
@ -1,53 +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.
|
||||
*/
|
||||
|
||||
mindplot.SingleCommandDispatcher = new Class(
|
||||
{
|
||||
Extends:mindplot.BaseCommandDispatcher,
|
||||
initialize: function() {
|
||||
|
||||
},
|
||||
addIconToTopic: function() {
|
||||
throw "method must be implemented.";
|
||||
},
|
||||
addLinkToTopic: function() {
|
||||
throw "method must be implemented.";
|
||||
},
|
||||
addNoteToTopic: function() {
|
||||
throw "method must be implemented.";
|
||||
},addRelationship: function() {
|
||||
throw "method must be implemented.";
|
||||
},addTopic: function() {
|
||||
throw "method must be implemented.";
|
||||
},changeIcon: function() {
|
||||
throw "method must be implemented.";
|
||||
},deleteTopic: function() {
|
||||
throw "method must be implemented.";
|
||||
},dragTopic: function() {
|
||||
throw "method must be implemented.";
|
||||
},moveControllPoint: function() {
|
||||
throw "method must be implemented.";
|
||||
} ,removeIconFromTopic: function() {
|
||||
throw "method must be implemented.";
|
||||
},removeLinkFromTopic: function() {
|
||||
throw "method must be implemented.";
|
||||
},removeNodeFromTopic: function() {
|
||||
throw "method must be implemented.";
|
||||
}
|
||||
});
|
||||
|
@ -17,11 +17,10 @@
|
||||
*/
|
||||
|
||||
mindplot.TextEditor = new Class({
|
||||
initialize:function(designer, actionRunner) {
|
||||
initialize:function(designer) {
|
||||
this._designer = designer;
|
||||
this._screenManager = designer.getWorkSpace().getScreenManager();
|
||||
this._container = this._screenManager.getContainer();
|
||||
this._actionRunner = actionRunner;
|
||||
this._isVisible = false;
|
||||
|
||||
//Create editor ui
|
||||
@ -132,13 +131,8 @@ mindplot.TextEditor = new Class({
|
||||
var text = this.getText();
|
||||
var topicId = this._currentNode.getId();
|
||||
|
||||
var commandFunc = function(topic, value) {
|
||||
var result = topic.getText();
|
||||
topic.setText(value);
|
||||
return result;
|
||||
};
|
||||
var command = new mindplot.commands.GenericFunctionCommand(commandFunc, text, [topicId]);
|
||||
this._actionRunner.execute(command);
|
||||
var actionDispatcher = mindplot.ActionDispatcher.getInstance();
|
||||
actionDispatcher.changeTextOnTopic([topicId], text);
|
||||
}
|
||||
},
|
||||
|
||||
@ -221,7 +215,6 @@ mindplot.TextEditor = new Class({
|
||||
};
|
||||
|
||||
setTimeout(executor(this), 10);
|
||||
//console.log('init done');
|
||||
},
|
||||
|
||||
setStyle : function (fontStyle) {
|
||||
|
@ -30,8 +30,7 @@ mindplot.Topic = new Class({
|
||||
this._buildShape();
|
||||
this.setMouseEventsEnabled(true);
|
||||
|
||||
// Positionate topic ....
|
||||
var model = this.getModel();
|
||||
// Position a topic ....
|
||||
var pos = model.getPosition();
|
||||
if (pos != null && model.getType() == mindplot.model.NodeModel.CENTRAL_TOPIC_TYPE) {
|
||||
this.setPosition(pos);
|
||||
@ -65,8 +64,8 @@ mindplot.Topic = new Class({
|
||||
|
||||
//Let's register all the events. The first one is the default one. The others will be copied.
|
||||
//this._registerDefaultListenersToElement(innerShape, this);
|
||||
|
||||
var dispatcher = dispatcherByEventType['mousedown'];
|
||||
|
||||
if ($defined(dispatcher)) {
|
||||
for (var i = 1; i < dispatcher._listeners.length; i++) {
|
||||
innerShape.addEventListener('mousedown', dispatcher._listeners[i]);
|
||||
@ -245,7 +244,7 @@ mindplot.Topic = new Class({
|
||||
return this._icon;
|
||||
},
|
||||
|
||||
_buildIconGroup : function(disableEventsListeners) {
|
||||
_buildIconGroup : function() {
|
||||
var result = new mindplot.IconGroup(this);
|
||||
var model = this.getModel();
|
||||
|
||||
@ -455,16 +454,6 @@ mindplot.Topic = new Class({
|
||||
var model = this.getModel();
|
||||
model.setFontFamily(value);
|
||||
}
|
||||
/*var elem = this;
|
||||
var executor = function(editor)
|
||||
{
|
||||
return function()
|
||||
{
|
||||
elem.updateNode(updateModel);
|
||||
};
|
||||
};
|
||||
|
||||
setTimeout(executor(this), 0);*/
|
||||
core.Executor.instance.delay(this.updateNode, 0, this, [updateModel]);
|
||||
},
|
||||
|
||||
@ -475,16 +464,6 @@ mindplot.Topic = new Class({
|
||||
var model = this.getModel();
|
||||
model.setFontSize(value);
|
||||
}
|
||||
/*var elem = this;
|
||||
var executor = function(editor)
|
||||
{
|
||||
return function()
|
||||
{
|
||||
elem.updateNode(updateModel);
|
||||
};
|
||||
};
|
||||
|
||||
setTimeout(executor(this), 0);*/
|
||||
core.Executor.instance.delay(this.updateNode, 0, this, [updateModel]);
|
||||
|
||||
},
|
||||
@ -496,16 +475,6 @@ mindplot.Topic = new Class({
|
||||
var model = this.getModel();
|
||||
model.setFontStyle(value);
|
||||
}
|
||||
/*var elem = this;
|
||||
var executor = function(editor)
|
||||
{
|
||||
return function()
|
||||
{
|
||||
elem.updateNode(updateModel);
|
||||
};
|
||||
};
|
||||
|
||||
setTimeout(executor(this), 0);*/
|
||||
core.Executor.instance.delay(this.updateNode, 0, this, [updateModel]);
|
||||
},
|
||||
|
||||
@ -870,9 +839,7 @@ mindplot.Topic = new Class({
|
||||
},
|
||||
|
||||
moveToBack : function() {
|
||||
// this._helpers.forEach(function(helper, index){
|
||||
// helper.moveToBack();
|
||||
// });
|
||||
|
||||
// Update relationship lines
|
||||
for (var j = 0; j < this._relationships.length; j++) {
|
||||
this._relationships[j].moveToBack();
|
||||
@ -883,8 +850,6 @@ mindplot.Topic = new Class({
|
||||
}
|
||||
|
||||
this.get2DElement().moveToBack();
|
||||
|
||||
|
||||
},
|
||||
|
||||
moveToFront : function() {
|
||||
@ -906,7 +871,6 @@ mindplot.Topic = new Class({
|
||||
},
|
||||
|
||||
_setRelationshipLinesVisibility : function(value) {
|
||||
//var relationships = designer.findRelationShipsByTopicId(this.getId());
|
||||
this._relationships.forEach(function(relationship, index) {
|
||||
relationship.setVisibility(value);
|
||||
});
|
||||
@ -974,14 +938,6 @@ mindplot.Topic = new Class({
|
||||
type = 'mousedown';
|
||||
}
|
||||
|
||||
/* var textShape = this.getTextShape();
|
||||
textShape.addEventListener(type, listener);
|
||||
|
||||
var outerShape = this.getOuterShape();
|
||||
outerShape.addEventListener(type, listener);
|
||||
|
||||
var innerShape = this.getInnerShape();
|
||||
innerShape.addEventListener(type, listener);*/
|
||||
var shape = this.get2DElement();
|
||||
shape.addEventListener(type, listener);
|
||||
},
|
||||
@ -991,15 +947,6 @@ mindplot.Topic = new Class({
|
||||
if (type == 'onfocus') {
|
||||
type = 'mousedown';
|
||||
}
|
||||
/*var textShape = this.getTextShape();
|
||||
textShape.removeEventListener(type, listener);
|
||||
|
||||
var outerShape = this.getOuterShape();
|
||||
outerShape.removeEventListener(type, listener);
|
||||
|
||||
var innerShape = this.getInnerShape();
|
||||
innerShape.removeEventListener(type, listener);*/
|
||||
|
||||
var shape = this.get2DElement();
|
||||
shape.removeEventListener(type, listener);
|
||||
},
|
||||
@ -1013,7 +960,6 @@ mindplot.Topic = new Class({
|
||||
|
||||
var outerShape = this.getOuterShape();
|
||||
var innerShape = this.getInnerShape();
|
||||
var connector = this.getShrinkConnector();
|
||||
|
||||
outerShape.setSize(size.width + 4, size.height + 6);
|
||||
innerShape.setSize(size.width, size.height);
|
||||
@ -1177,14 +1123,14 @@ mindplot.Topic = new Class({
|
||||
},
|
||||
|
||||
createDragNode : function() {
|
||||
var dragNode = mindplot.NodeGraph.prototype.createDragNode.call(this);
|
||||
var result = this.parent();
|
||||
|
||||
// Is the node already connected ?
|
||||
var targetTopic = this.getOutgoingConnectedTopic();
|
||||
if ($defined(targetTopic)) {
|
||||
dragNode.connectTo(targetTopic);
|
||||
result.connectTo(targetTopic);
|
||||
}
|
||||
return dragNode;
|
||||
return result;
|
||||
},
|
||||
|
||||
updateNode : function(updatePosition) {
|
||||
|
@ -1,53 +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.
|
||||
*/
|
||||
|
||||
//@Todo: Por que lo cambiaste a Board ?
|
||||
mindplot.TopicBoard = new Class({
|
||||
|
||||
initialize: function() {
|
||||
this._height = null;
|
||||
},
|
||||
|
||||
_removeEntryByOrder : function(order, position) {
|
||||
var board = this._getBoard(position);
|
||||
var entry = board.lookupEntryByOrder(order);
|
||||
|
||||
$assert(!entry.isAvailable(), 'Entry must not be available in order to be removed.Entry Order:' + order);
|
||||
entry.removeTopic();
|
||||
board.update(entry);
|
||||
},
|
||||
|
||||
removeTopicFromBoard : function(topic) {
|
||||
var position = topic.getPosition();
|
||||
var order = topic.getOrder();
|
||||
|
||||
this._removeEntryByOrder(order, position);
|
||||
topic.setOrder(null);
|
||||
},
|
||||
|
||||
positionateDragTopic :function(dragTopic) {
|
||||
throw "this method must be overrided";
|
||||
},
|
||||
|
||||
getHeight: function() {
|
||||
var board = this._getBoard();
|
||||
return board.getHeight();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
@ -29,6 +29,7 @@ mindplot.collaboration.frameworks.brix.BrixFramework.instanciate=function(){
|
||||
if($defined(isGoogleBrix) && !instanciated){
|
||||
instanciated=true;
|
||||
var app = new goog.collab.CollaborativeApp();
|
||||
mindplot.collaboration.frameworks.brix.BrixFramework.buildMenu(app);
|
||||
app.start();
|
||||
app.addListener('modelLoad', function(model){
|
||||
var framework = new mindplot.collaboration.frameworks.brix.BrixFramework(model, app);
|
||||
@ -37,6 +38,32 @@ mindplot.collaboration.frameworks.brix.BrixFramework.instanciate=function(){
|
||||
}
|
||||
};
|
||||
|
||||
mindplot.collaboration.frameworks.brix.BrixFramework.buildMenu=function(app){
|
||||
var menuBar = new goog.collab.ui.MenuBar();
|
||||
|
||||
// Configure toolbar menu ...
|
||||
var fileMenu = menuBar.addSubMenu("File");
|
||||
fileMenu.addItem("Save", function() {
|
||||
});
|
||||
fileMenu.addItem("Export", function() {
|
||||
});
|
||||
|
||||
var editMenu = menuBar.addSubMenu("Edit");
|
||||
editMenu.addItem("Undo", function() {
|
||||
});
|
||||
editMenu.addItem("Redo", function() {
|
||||
});
|
||||
|
||||
var formatMenu = menuBar.addSubMenu("Format");
|
||||
formatMenu.addItem("Bold", function() {
|
||||
});
|
||||
|
||||
var helpMenu = menuBar.addSubMenu("Help");
|
||||
helpMenu.addItem("Shortcuts", function() {
|
||||
});
|
||||
|
||||
app.setMenuBar(menuBar);
|
||||
};
|
||||
mindplot.collaboration.frameworks.brix.BrixFramework.instanciate();
|
||||
|
||||
|
||||
|
@ -1,33 +1,30 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
mindplot.commands.AddIconToTopicCommand = new Class(
|
||||
{
|
||||
mindplot.commands.AddIconToTopicCommand = new Class({
|
||||
Extends:mindplot.Command,
|
||||
initialize: function(topicId, iconType)
|
||||
{
|
||||
initialize: function(topicId, iconType) {
|
||||
$assert(topicId, 'topicId can not be null');
|
||||
$assert(iconType, 'iconType can not be null');
|
||||
this._selectedObjectsIds = topicId;
|
||||
this._iconType = iconType;
|
||||
},
|
||||
execute: function(commandContext)
|
||||
{
|
||||
execute: function(commandContext) {
|
||||
var topic = commandContext.findTopics(this._selectedObjectsIds)[0];
|
||||
var updated = function() {
|
||||
var iconImg = topic.addIcon(this._iconType, commandContext._designer);
|
||||
@ -36,8 +33,7 @@ mindplot.commands.AddIconToTopicCommand = new Class(
|
||||
}.bind(this);
|
||||
updated.delay(0);
|
||||
},
|
||||
undoExecute: function(commandContext)
|
||||
{
|
||||
undoExecute: function(commandContext) {
|
||||
var topic = commandContext.findTopics(this._selectedObjectsIds)[0];
|
||||
var updated = function() {
|
||||
topic.removeIcon(this._iconModel);
|
||||
|
@ -1,42 +1,38 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
mindplot.commands.AddLinkToTopicCommand =new Class(
|
||||
{
|
||||
mindplot.commands.AddLinkToTopicCommand = new Class({
|
||||
Extends:mindplot.Command,
|
||||
initialize: function(topicId,url)
|
||||
{
|
||||
initialize: function(topicId, url) {
|
||||
$assert(topicId, 'topicId can not be null');
|
||||
this._selectedObjectsIds = topicId;
|
||||
this._url = url;
|
||||
this._id = mindplot.Command._nextUUID();
|
||||
},
|
||||
execute: function(commandContext)
|
||||
{
|
||||
execute: function(commandContext) {
|
||||
var topic = commandContext.findTopics(this._selectedObjectsIds)[0];
|
||||
var updated = function() {
|
||||
topic.addLink(this._url,commandContext._designer);
|
||||
topic.addLink(this._url, commandContext._designer);
|
||||
topic.updateNode();
|
||||
}.bind(this);
|
||||
updated.delay(0);
|
||||
},
|
||||
undoExecute: function(commandContext)
|
||||
{
|
||||
undoExecute: function(commandContext) {
|
||||
var topic = commandContext.findTopics(this._selectedObjectsIds)[0];
|
||||
var updated = function() {
|
||||
topic.removeLink();
|
||||
|
@ -1,42 +1,38 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
mindplot.commands.AddNoteToTopicCommand = new Class(
|
||||
{
|
||||
mindplot.commands.AddNoteToTopicCommand = new Class({
|
||||
Extends:mindplot.Command,
|
||||
initialize: function(topicId,text)
|
||||
{
|
||||
initialize: function(topicId, text) {
|
||||
$assert(topicId, 'topicId can not be null');
|
||||
this._selectedObjectsIds = topicId;
|
||||
this._text = text;
|
||||
this._id = mindplot.Command._nextUUID();
|
||||
},
|
||||
execute: function(commandContext)
|
||||
{
|
||||
execute: function(commandContext) {
|
||||
var topic = commandContext.findTopics(this._selectedObjectsIds)[0];
|
||||
var updated = function() {
|
||||
topic.addNote(this._text,commandContext._designer);
|
||||
topic.addNote(this._text, commandContext._designer);
|
||||
topic.updateNode();
|
||||
}.bind(this);
|
||||
updated.delay(0);
|
||||
},
|
||||
undoExecute: function(commandContext)
|
||||
{
|
||||
undoExecute: function(commandContext) {
|
||||
var topic = commandContext.findTopics(this._selectedObjectsIds)[0];
|
||||
var updated = function() {
|
||||
topic.removeNote();
|
||||
|
@ -1,40 +1,36 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
mindplot.commands.AddRelationshipCommand = new Class(
|
||||
{
|
||||
* 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.
|
||||
*/
|
||||
mindplot.commands.AddRelationshipCommand = new Class({
|
||||
Extends:mindplot.Command,
|
||||
initialize: function(model, mindmap)
|
||||
{
|
||||
initialize: function(model, mindmap) {
|
||||
$assert(model, 'Relationship model can not be null');
|
||||
this._model = model;
|
||||
this._mindmap = mindmap;
|
||||
this._id = mindplot.Command._nextUUID();
|
||||
},
|
||||
execute: function(commandContext)
|
||||
{
|
||||
execute: function(commandContext) {
|
||||
var relationship = commandContext.createRelationship(this._model);
|
||||
// Finally, focus ...
|
||||
var designer = commandContext._designer;
|
||||
designer.onObjectFocusEvent.attempt(relationship, designer);
|
||||
relationship.setOnFocus(true);
|
||||
},
|
||||
undoExecute: function(commandContext)
|
||||
{
|
||||
undoExecute: function(commandContext) {
|
||||
var relationship = commandContext.removeRelationship(this._model);
|
||||
this._mindmap.removeRelationship(this._model);
|
||||
}
|
||||
|
@ -1,69 +1,67 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
mindplot.commands.AddTopicCommand = new Class(
|
||||
{
|
||||
Extends:mindplot.Command,
|
||||
initialize: function(model, parentTopicId, animated)
|
||||
{
|
||||
$assert(model, 'Model can not be null');
|
||||
this._model = model;
|
||||
this._parentId = parentTopicId;
|
||||
this._id = mindplot.Command._nextUUID();
|
||||
this._animated = $defined(animated)?animated:false;
|
||||
},
|
||||
execute: function(commandContext)
|
||||
{
|
||||
// Add a new topic ...
|
||||
Extends:mindplot.Command,
|
||||
initialize: function(model, parentTopicId, animated) {
|
||||
$assert(model, 'Model can not be null');
|
||||
this._model = model;
|
||||
this._parentId = parentTopicId;
|
||||
this._id = mindplot.Command._nextUUID();
|
||||
this._animated = $defined(animated) ? animated : false;
|
||||
},
|
||||
|
||||
var topic = commandContext.createTopic(this._model, !this._animated);
|
||||
execute: function(commandContext) {
|
||||
|
||||
// Connect to topic ...
|
||||
if ($defined(this._parentId))
|
||||
{
|
||||
var parentTopic = commandContext.findTopics(this._parentId)[0];
|
||||
commandContext.connect(topic, parentTopic, !this._animated);
|
||||
// Add a new topic ...
|
||||
var topic = commandContext.createTopic(this._model, !this._animated);
|
||||
|
||||
// Connect to topic ...
|
||||
if ($defined(this._parentId)) {
|
||||
var parentTopic = commandContext.findTopics(this._parentId)[0];
|
||||
commandContext.connect(topic, parentTopic, !this._animated);
|
||||
}
|
||||
|
||||
var doneFn = function() {
|
||||
// Finally, focus ...
|
||||
var designer = commandContext._designer;
|
||||
designer.onObjectFocusEvent(topic);
|
||||
topic.setOnFocus(true);
|
||||
};
|
||||
|
||||
if (this._animated) {
|
||||
core.Utils.setVisibilityAnimated([topic,topic.getOutgoingLine()], true, doneFn);
|
||||
} else
|
||||
doneFn.attempt();
|
||||
},
|
||||
|
||||
undoExecute: function(commandContext) {
|
||||
// Finally, delete the topic from the workspace ...
|
||||
var topicId = this._model.getId();
|
||||
var topic = commandContext.findTopics(topicId)[0];
|
||||
var doneFn = function() {
|
||||
commandContext.deleteTopic(topic);
|
||||
};
|
||||
if (this._animated) {
|
||||
core.Utils.setVisibilityAnimated([topic,topic.getOutgoingLine()], false, doneFn);
|
||||
}
|
||||
else
|
||||
doneFn.attempt();
|
||||
}
|
||||
|
||||
var doneFn = function(){
|
||||
// Finally, focus ...
|
||||
var designer = commandContext._designer;
|
||||
designer.onObjectFocusEvent.attempt(topic, designer);
|
||||
topic.setOnFocus(true);
|
||||
};
|
||||
|
||||
if(this._animated){
|
||||
core.Utils.setVisibilityAnimated([topic,topic.getOutgoingLine()],true,doneFn);
|
||||
} else
|
||||
doneFn.attempt();
|
||||
},
|
||||
undoExecute: function(commandContext)
|
||||
{
|
||||
// Finally, delete the topic from the workspace ...
|
||||
var topicId = this._model.getId();
|
||||
var topic = commandContext.findTopics(topicId)[0];
|
||||
var doneFn = function(){
|
||||
commandContext.deleteTopic(topic);
|
||||
};
|
||||
if(this._animated){
|
||||
core.Utils.setVisibilityAnimated([topic,topic.getOutgoingLine()],false, doneFn);
|
||||
}
|
||||
else
|
||||
doneFn.attempt();
|
||||
}
|
||||
});
|
||||
});
|
@ -1,49 +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.
|
||||
*/
|
||||
|
||||
mindplot.commands.ChangeIconFromTopicCommand = new Class(
|
||||
{
|
||||
Extends:mindplot.Command,
|
||||
initialize: function(topicId, iconId, iconType)
|
||||
{
|
||||
$assert(topicId, 'topicId can not be null');
|
||||
$assert(iconId, 'iconId can not be null');
|
||||
$assert(iconType, 'iconType can not be null');
|
||||
this._selectedObjectsIds = topicId;
|
||||
this._iconModel = iconId;
|
||||
this._iconType = iconType;
|
||||
},
|
||||
execute: function(commandContext)
|
||||
{
|
||||
var topic = commandContext.findTopics(this._selectedObjectsIds)[0];
|
||||
var updated = function() {
|
||||
topic.removeIcon(this._iconModel);
|
||||
topic.updateNode();
|
||||
}.bind(this);
|
||||
updated.delay(0);
|
||||
},
|
||||
undoExecute: function(commandContext)
|
||||
{
|
||||
var topic = commandContext.findTopics(this._selectedObjectsIds)[0];
|
||||
var updated = function() {
|
||||
topic.addIcon(this._iconModel, commandContext._designer);
|
||||
topic.updateNode();
|
||||
}.bind(this);
|
||||
updated.delay(0);
|
||||
}
|
||||
});
|
@ -1,26 +1,24 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
mindplot.commands.DeleteTopicCommand = new Class(
|
||||
{
|
||||
mindplot.commands.DeleteTopicCommand = new Class({
|
||||
Extends:mindplot.Command,
|
||||
initialize: function(topicsIds)
|
||||
{
|
||||
initialize: function(topicsIds) {
|
||||
$assert(topicsIds, "topicsIds must be defined");
|
||||
this._selectedObjectsIds = topicsIds;
|
||||
this._deletedTopicModels = [];
|
||||
@ -28,18 +26,16 @@ mindplot.commands.DeleteTopicCommand = new Class(
|
||||
this._deletedRelationships = [];
|
||||
this._id = mindplot.Command._nextUUID();
|
||||
},
|
||||
execute: function(commandContext)
|
||||
{
|
||||
execute: function(commandContext) {
|
||||
var topics = commandContext.findTopics(this._selectedObjectsIds.nodes);
|
||||
if(topics.length>0){
|
||||
topics.forEach(
|
||||
function(topic, index)
|
||||
{
|
||||
if (topics.length > 0) {
|
||||
topics.forEach(
|
||||
function(topic, index) {
|
||||
var model = topic.getModel().clone();
|
||||
|
||||
//delete relationships
|
||||
//delete relationships
|
||||
var relationships = topic.getRelationships();
|
||||
while(relationships.length>0){
|
||||
while (relationships.length > 0) {
|
||||
var relationship = relationships[0];
|
||||
this._deletedRelationships.push(relationship.getModel().clone());
|
||||
commandContext.removeRelationship(relationship.getModel());
|
||||
@ -50,8 +46,7 @@ mindplot.commands.DeleteTopicCommand = new Class(
|
||||
// Is connected?.
|
||||
var outTopic = topic.getOutgoingConnectedTopic();
|
||||
var outTopicId = null;
|
||||
if (outTopic != null)
|
||||
{
|
||||
if (outTopic != null) {
|
||||
outTopicId = outTopic.getId();
|
||||
}
|
||||
this._parentTopicIds.push(outTopicId);
|
||||
@ -60,41 +55,39 @@ mindplot.commands.DeleteTopicCommand = new Class(
|
||||
commandContext.deleteTopic(topic);
|
||||
|
||||
}.bind(this)
|
||||
); }
|
||||
);
|
||||
}
|
||||
var lines = commandContext.findRelationships(this._selectedObjectsIds.relationshipLines);
|
||||
if(lines.length>0){
|
||||
lines.forEach(function(line,index){
|
||||
if(line.isInWorkspace()){
|
||||
if (lines.length > 0) {
|
||||
lines.forEach(function(line, index) {
|
||||
if (line.isInWorkspace()) {
|
||||
this._deletedRelationships.push(line.getModel().clone());
|
||||
commandContext.removeRelationship(line.getModel());
|
||||
commandContext.removeRelationship(line.getModel());
|
||||
}
|
||||
}.bind(this));
|
||||
}
|
||||
},
|
||||
undoExecute: function(commandContext)
|
||||
{
|
||||
undoExecute: function(commandContext) {
|
||||
|
||||
var topics = commandContext.findTopics(this._selectedObjectsIds);
|
||||
var parent = commandContext.findTopics(this._parentTopicIds);
|
||||
|
||||
this._deletedTopicModels.forEach(
|
||||
function(model, index)
|
||||
{
|
||||
var topic = commandContext.createTopic(model);
|
||||
function(model, index) {
|
||||
var topic = commandContext.createTopic(model);
|
||||
|
||||
// Was the topic connected?
|
||||
var parentTopic = parent[index];
|
||||
if (parentTopic != null)
|
||||
{
|
||||
commandContext.connect(topic, parentTopic);
|
||||
}
|
||||
// Was the topic connected?
|
||||
var parentTopic = parent[index];
|
||||
if (parentTopic != null) {
|
||||
commandContext.connect(topic, parentTopic);
|
||||
}
|
||||
|
||||
}.bind(this)
|
||||
);
|
||||
}.bind(this)
|
||||
);
|
||||
this._deletedRelationships.forEach(
|
||||
function(relationship, index){
|
||||
commandContext.createRelationship(relationship);
|
||||
}.bind(this));
|
||||
function(relationship, index) {
|
||||
commandContext.createRelationship(relationship);
|
||||
}.bind(this));
|
||||
|
||||
this._deletedTopicModels = [];
|
||||
this._parentTopicIds = [];
|
||||
|
@ -1,35 +1,35 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
mindplot.commands.DragTopicCommand = new Class(
|
||||
{
|
||||
mindplot.commands.DragTopicCommand = new Class({
|
||||
Extends:mindplot.Command,
|
||||
initialize: function(topicId)
|
||||
{
|
||||
$assert(topicId, "topicId must be defined");
|
||||
this._selectedObjectsIds = topicId;
|
||||
this._parentTopic = null;
|
||||
this._position = null;
|
||||
this._order = null;
|
||||
initialize: function(topicIds, position, order, parentTopic) {
|
||||
$assert(topicIds, "topicIds must be defined");
|
||||
|
||||
this._selectedObjectsIds = topicIds;
|
||||
if ($defined(parentTopic))
|
||||
this._parentId = parentTopic.getId();
|
||||
|
||||
this._position = position;
|
||||
this._order = order;
|
||||
this._id = mindplot.Command._nextUUID();
|
||||
},
|
||||
execute: function(commandContext)
|
||||
{
|
||||
execute: function(commandContext) {
|
||||
|
||||
var topic = commandContext.findTopics([this._selectedObjectsIds])[0];
|
||||
|
||||
@ -39,70 +39,51 @@ mindplot.commands.DragTopicCommand = new Class(
|
||||
var origPosition = null;
|
||||
// if (topic.getType() == mindplot.model.NodeModel.MAIN_TOPIC_TYPE && origParentTopic != null && origParentTopic.getType() == mindplot.model.NodeModel.MAIN_TOPIC_TYPE)
|
||||
// {
|
||||
// In this case, topics are positioned using order ...
|
||||
origOrder = topic.getOrder();
|
||||
// In this case, topics are positioned using order ...
|
||||
origOrder = topic.getOrder();
|
||||
// } else
|
||||
// {
|
||||
origPosition = topic.getPosition().clone();
|
||||
origPosition = topic.getPosition().clone();
|
||||
// }
|
||||
|
||||
// Disconnect topic ..
|
||||
if ($defined(origParentTopic))
|
||||
{
|
||||
if ($defined(origParentTopic)) {
|
||||
commandContext.disconnect(topic);
|
||||
}
|
||||
|
||||
|
||||
// Set topic order ...
|
||||
if (this._order != null)
|
||||
{
|
||||
if (this._order != null) {
|
||||
topic.setOrder(this._order);
|
||||
} else if (this._position != null)
|
||||
{
|
||||
} else if (this._position != null) {
|
||||
// Set position ...
|
||||
topic.setPosition(this._position);
|
||||
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
$assert("Illegal commnad state exception.");
|
||||
}
|
||||
this._order = origOrder;
|
||||
this._position = origPosition;
|
||||
|
||||
// Finally, connect topic ...
|
||||
if ($defined(this._parentId))
|
||||
{
|
||||
if ($defined(this._parentId)) {
|
||||
var parentTopic = commandContext.findTopics([this._parentId])[0];
|
||||
commandContext.connect(topic, parentTopic);
|
||||
}
|
||||
|
||||
// Backup old parent id ...
|
||||
this._parentId = null;
|
||||
if ($defined(origParentTopic))
|
||||
{
|
||||
if ($defined(origParentTopic)) {
|
||||
this._parentId = origParentTopic.getId();
|
||||
}
|
||||
|
||||
},
|
||||
undoExecute: function(commandContext)
|
||||
{
|
||||
undoExecute: function(commandContext) {
|
||||
this.execute(commandContext);
|
||||
var selectedRelationships = commandContext.getSelectedRelationshipLines();
|
||||
selectedRelationships.forEach(function(relationshipLine,index){
|
||||
selectedRelationships.forEach(function(relationshipLine) {
|
||||
relationshipLine.redraw();
|
||||
});
|
||||
|
||||
},
|
||||
setPosition: function(point)
|
||||
{
|
||||
this._position = point;
|
||||
},
|
||||
setParetTopic: function(topic) {
|
||||
this._parentId = topic.getId();
|
||||
|
||||
},
|
||||
setOrder: function(order)
|
||||
{
|
||||
this._order = order
|
||||
}
|
||||
});
|
@ -1,66 +1,57 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
mindplot.commands.GenericFunctionCommand =new Class(
|
||||
{
|
||||
mindplot.commands.GenericFunctionCommand = new Class({
|
||||
Extends:mindplot.Command,
|
||||
initialize: function(commandFunc,value,topicsIds)
|
||||
{
|
||||
initialize: function(commandFunc, topicsIds,value) {
|
||||
$assert(commandFunc, "commandFunc must be defined");
|
||||
$assert(topicsIds, "topicsIds must be defined");
|
||||
|
||||
this._value = value;
|
||||
this._selectedObjectsIds = topicsIds;
|
||||
this._commandFunc = commandFunc;
|
||||
this._oldValues = [];
|
||||
this._id = mindplot.Command._nextUUID();
|
||||
},
|
||||
execute: function(commandContext)
|
||||
{
|
||||
if (!this.applied)
|
||||
{
|
||||
execute: function(commandContext) {
|
||||
if (!this.applied) {
|
||||
var topics = commandContext.findTopics(this._selectedObjectsIds);
|
||||
topics.forEach(function(topic)
|
||||
{
|
||||
topics.forEach(function(topic) {
|
||||
var oldValue = this._commandFunc(topic, this._value);
|
||||
this._oldValues.push(oldValue);
|
||||
}.bind(this));
|
||||
this.applied = true;
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
throw "Command can not be applied two times in a row.";
|
||||
}
|
||||
|
||||
},
|
||||
undoExecute: function(commandContext)
|
||||
{
|
||||
if (this.applied)
|
||||
{
|
||||
undoExecute: function(commandContext) {
|
||||
if (this.applied) {
|
||||
var topics = commandContext.findTopics(this._selectedObjectsIds);
|
||||
topics.forEach(function(topic,index)
|
||||
{
|
||||
topics.forEach(function(topic, index) {
|
||||
this._commandFunc(topic, this._oldValues[index]);
|
||||
|
||||
}.bind(this));
|
||||
|
||||
this.applied = false;
|
||||
this._oldValues = [];
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
throw "undo can not be applied.";
|
||||
}
|
||||
}
|
||||
|
@ -1,33 +1,32 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
mindplot.commands.MoveControlPointCommand = new Class(
|
||||
{
|
||||
* 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.
|
||||
*/
|
||||
mindplot.commands.MoveControlPointCommand = new Class({
|
||||
Extends:mindplot.Command,
|
||||
initialize: function(ctrlPointController, point)
|
||||
{
|
||||
initialize: function(ctrlPointController, point) {
|
||||
$assert(ctrlPointController, 'line can not be null');
|
||||
$assert(point, 'point can not be null');
|
||||
|
||||
this._ctrlPointControler = ctrlPointController;
|
||||
this._line = ctrlPointController._line;
|
||||
var model = this._line.getModel();
|
||||
this._controlPoint = this._ctrlPointControler.getControlPoint(point).clone();
|
||||
this._oldControlPoint= this._ctrlPointControler.getOriginalCtrlPoint(point).clone();
|
||||
this._oldControlPoint = this._ctrlPointControler.getOriginalCtrlPoint(point).clone();
|
||||
this._originalEndPoint = this._ctrlPointControler.getOriginalEndPoint(point).clone();
|
||||
switch (point){
|
||||
switch (point) {
|
||||
case 0:
|
||||
this._wasCustom = this._line.getLine().isSrcControlPointCustom();
|
||||
this._endPoint = this._line.getLine().getFrom().clone();
|
||||
@ -40,10 +39,9 @@ mindplot.commands.MoveControlPointCommand = new Class(
|
||||
this._id = mindplot.Command._nextUUID();
|
||||
this._point = point;
|
||||
},
|
||||
execute: function(commandContext)
|
||||
{
|
||||
execute: function(commandContext) {
|
||||
var model = this._line.getModel();
|
||||
switch (this._point){
|
||||
switch (this._point) {
|
||||
case 0:
|
||||
model.setSrcCtrlPoint(this._controlPoint.clone());
|
||||
this._line.setFrom(this._endPoint.x, this._endPoint.y);
|
||||
@ -58,36 +56,35 @@ mindplot.commands.MoveControlPointCommand = new Class(
|
||||
this._line.setDestControlPoint(this._controlPoint.clone());
|
||||
break;
|
||||
}
|
||||
if(this._line.isOnFocus()){
|
||||
if (this._line.isOnFocus()) {
|
||||
this._line._refreshSelectedShape();
|
||||
this._ctrlPointControler.setLine(this._line);
|
||||
}
|
||||
this._line.getLine().updateLine(this._point);
|
||||
},
|
||||
undoExecute: function(commandContext)
|
||||
{
|
||||
undoExecute: function(commandContext) {
|
||||
var line = this._line;
|
||||
var model = line.getModel();
|
||||
switch (this._point){
|
||||
switch (this._point) {
|
||||
case 0:
|
||||
if($defined(this._oldControlPoint)){
|
||||
if ($defined(this._oldControlPoint)) {
|
||||
line.setFrom(this._originalEndPoint.x, this._originalEndPoint.y);
|
||||
model.setSrcCtrlPoint(this._oldControlPoint.clone());
|
||||
line.setSrcControlPoint(this._oldControlPoint.clone());
|
||||
line.setIsSrcControlPointCustom(this._wasCustom);
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case 1:
|
||||
if($defined(this._oldControlPoint)){
|
||||
if ($defined(this._oldControlPoint)) {
|
||||
line.setTo(this._originalEndPoint.x, this._originalEndPoint.y);
|
||||
model.setDestCtrlPoint(this._oldControlPoint.clone());
|
||||
line.setDestControlPoint(this._oldControlPoint.clone());
|
||||
line.setIsDestControlPointCustom(this._wasCustom);
|
||||
}
|
||||
break;
|
||||
break;
|
||||
}
|
||||
this._line.getLine().updateLine(this._point);
|
||||
if(this._line.isOnFocus()){
|
||||
if (this._line.isOnFocus()) {
|
||||
this._ctrlPointControler.setLine(line);
|
||||
line._refreshSelectedShape();
|
||||
}
|
||||
|
@ -16,8 +16,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
mindplot.commands.RemoveIconFromTopicCommand = new Class(
|
||||
{
|
||||
mindplot.commands.RemoveIconFromTopicCommand = new Class({
|
||||
Extends:mindplot.Command,
|
||||
initialize: function(topicId, iconModel)
|
||||
{
|
||||
|
@ -1,31 +1,28 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
mindplot.commands.RemoveLinkFromTopicCommand =new Class(
|
||||
{
|
||||
mindplot.commands.RemoveLinkFromTopicCommand = new Class({
|
||||
Extends:mindplot.Command,
|
||||
initialize: function(topicId)
|
||||
{
|
||||
initialize: function(topicId) {
|
||||
$assert(topicId, 'topicId can not be null');
|
||||
this._selectedObjectsIds = topicId;
|
||||
},
|
||||
execute: function(commandContext)
|
||||
{
|
||||
execute: function(commandContext) {
|
||||
var topic = commandContext.findTopics(this._selectedObjectsIds)[0];
|
||||
this._url = topic._link.getUrl();
|
||||
var updated = function() {
|
||||
@ -33,11 +30,10 @@ mindplot.commands.RemoveLinkFromTopicCommand =new Class(
|
||||
}.bind(this);
|
||||
updated.delay(0);
|
||||
},
|
||||
undoExecute: function(commandContext)
|
||||
{
|
||||
undoExecute: function(commandContext) {
|
||||
var topic = commandContext.findTopics(this._selectedObjectsIds)[0];
|
||||
var updated = function() {
|
||||
topic.addLink(this._url,commandContext._designer);
|
||||
topic.addLink(this._url, commandContext._designer);
|
||||
topic.updateNode();
|
||||
}.bind(this);
|
||||
updated.delay(0);
|
||||
|
@ -16,8 +16,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
mindplot.commands.RemoveNoteFromTopicCommand = new Class(
|
||||
{
|
||||
mindplot.commands.RemoveNoteFromTopicCommand = new Class({
|
||||
Extends:mindplot.Command,
|
||||
initialize: function(topicId)
|
||||
{
|
||||
|
@ -15,8 +15,3 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
if($defined(afterMindpotLibraryLoading))
|
||||
{
|
||||
afterMindpotLibraryLoading();
|
||||
}
|
||||
|
@ -25,4 +25,5 @@
|
||||
var mindplot = {};
|
||||
mindplot.util = {};
|
||||
mindplot.commands = {};
|
||||
mindplot.layout = {};
|
||||
mindplot.layout = {};
|
||||
mindplot.widget = {};
|
@ -24,12 +24,13 @@ mindplot.layout.OriginalLayoutManager = new Class({
|
||||
initialize:function(designer, options) {
|
||||
this.parent(designer, options);
|
||||
this._dragTopicPositioner = new mindplot.DragTopicPositioner(this);
|
||||
// Init dragger manager.
|
||||
|
||||
// Init drag manager.
|
||||
var workSpace = this.getDesigner().getWorkSpace();
|
||||
this._dragger = this._buildDragManager(workSpace);
|
||||
|
||||
// Add shapes to speed up the loading process ...
|
||||
mindplot.DragTopic.initialize(workSpace);
|
||||
mindplot.DragTopic.init(workSpace);
|
||||
},
|
||||
prepareNode:function(node, children) {
|
||||
// Sort children by order to solve adding order in for OriginalLayoutManager...
|
||||
@ -62,15 +63,19 @@ mindplot.layout.OriginalLayoutManager = new Class({
|
||||
nodesByOrder = null;
|
||||
return node.getTopicType() != mindplot.model.NodeModel.CENTRAL_TOPIC_TYPE ? result : children;
|
||||
},
|
||||
|
||||
_nodeResizeEvent:function(node) {
|
||||
|
||||
},
|
||||
|
||||
_nodeRepositionateEvent:function(node) {
|
||||
this.getTopicBoardForTopic(node).repositionate();
|
||||
},
|
||||
|
||||
getDragTopicPositioner : function() {
|
||||
return this._dragTopicPositioner;
|
||||
},
|
||||
|
||||
_buildDragManager: function(workspace) {
|
||||
// Init dragger manager.
|
||||
var dragger = new mindplot.DragManager(workspace);
|
||||
@ -115,11 +120,12 @@ mindplot.layout.OriginalLayoutManager = new Class({
|
||||
|
||||
return dragger;
|
||||
},
|
||||
|
||||
registerListenersOnNode : function(topic) {
|
||||
// Register node listeners ...
|
||||
var designer = this.getDesigner();
|
||||
topic.addEventListener('onfocus', function(event) {
|
||||
designer.onObjectFocusEvent.attempt([topic, event], designer);
|
||||
designer.onObjectFocusEvent(topic, event);
|
||||
});
|
||||
|
||||
// Add drag behaviour ...
|
||||
@ -136,12 +142,15 @@ mindplot.layout.OriginalLayoutManager = new Class({
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
_createMainTopicBoard:function(node) {
|
||||
return new mindplot.MainTopicBoard(node, this);
|
||||
},
|
||||
|
||||
_createCentralTopicBoard:function(node) {
|
||||
return new mindplot.CentralTopicBoard(node, this);
|
||||
},
|
||||
|
||||
getClassName:function() {
|
||||
return mindplot.layout.OriginalLayoutManager.NAME;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
mindplot.layout.boards = {};
|
||||
|
||||
mindplot.layout.boards.Board = new Class({
|
||||
|
||||
Implements: [Events,Options],
|
||||
options: {
|
||||
|
||||
},
|
||||
@ -31,6 +31,3 @@ mindplot.layout.boards.Board = new Class({
|
||||
});
|
||||
|
||||
mindplot.layout.boards.Board.NAME = "Board";
|
||||
|
||||
mindplot.layout.boards.Board.implement(new Events);
|
||||
mindplot.layout.boards.Board.implement(new Options);
|
37
mindplot/src/main/javascript/widget/FontFamilyPanel.js
Normal file
37
mindplot/src/main/javascript/widget/FontFamilyPanel.js
Normal file
@ -0,0 +1,37 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
mindplot.widget.FontFamilyPanel = new Class({
|
||||
Extends : mindplot.widget.ToolbarPanel,
|
||||
initialize : function(buttonId, model) {
|
||||
this.parent(buttonId, model);
|
||||
},
|
||||
|
||||
buildPanel: function() {
|
||||
|
||||
var content = new Element("div", {'class':'toolbarPanel','id':'fontFamilyPanel'});
|
||||
content.innerHTML = '' +
|
||||
'<div id="times" model="Times" class="toolbarPanelLink" style="font-family:times;">Times</div>' +
|
||||
'<div id="arial" model="Arial" style="font-family:arial;">Arial</div>' +
|
||||
'<div id="tahoma" model="Tahoma" style="font-family:tahoma;">Tahoma</div>' +
|
||||
'<div id="verdana" model="Verdana" style="font-family:verdana;">Verdana</div>';
|
||||
|
||||
return content;
|
||||
|
||||
}
|
||||
});
|
37
mindplot/src/main/javascript/widget/FontSizePanel.js
Normal file
37
mindplot/src/main/javascript/widget/FontSizePanel.js
Normal file
@ -0,0 +1,37 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
mindplot.widget.FontSizePanel = new Class({
|
||||
Extends : mindplot.widget.ToolbarPanel,
|
||||
initialize : function(buttonId, model) {
|
||||
this.parent(buttonId, model);
|
||||
},
|
||||
|
||||
buildPanel: function() {
|
||||
|
||||
var content = new Element("div", {'class':'toolbarPanel','id':'fontSizePanel'});
|
||||
content.innerHTML = '' +
|
||||
'<div id="small" model="6" style="font-size:8px">Small</div>' +
|
||||
'<div id="normal" model="8" style="font-size:12px">Normal</div>' +
|
||||
'<div id="large" model="10" style="font-size:15px">Large</div>' +
|
||||
'<div id="huge" model="15" style="font-size:24px">Huge</div>';
|
||||
|
||||
return content;
|
||||
|
||||
}
|
||||
});
|
141
mindplot/src/main/javascript/widget/IconPanel.js
Normal file
141
mindplot/src/main/javascript/widget/IconPanel.js
Normal file
@ -0,0 +1,141 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
mindplot.widget.IconPanel = new Class({
|
||||
Implements:[Options,Events],
|
||||
options:{
|
||||
width:253,
|
||||
initialWidth:0,
|
||||
height:200,
|
||||
panel:null,
|
||||
onStart:Class.empty,
|
||||
state:'close'
|
||||
},
|
||||
|
||||
initialize:function(buttonId, model) {
|
||||
this._buttonId = buttonId;
|
||||
this._model = model;
|
||||
|
||||
this.options.content = this._build();
|
||||
this.init();
|
||||
|
||||
},
|
||||
|
||||
init:function() {
|
||||
var panel = new Element('div');
|
||||
var buttonElem = $(this._buttonId);
|
||||
|
||||
var coord = buttonElem.getCoordinates();
|
||||
var top = buttonElem.getTop() + coord.height + 2;
|
||||
var left = buttonElem.getLeft();
|
||||
|
||||
panel.setStyles({
|
||||
width:this.options.initialWidth,
|
||||
height:0,position:'absolute',
|
||||
top:top,
|
||||
left:left,
|
||||
background:'#e5e5e5',
|
||||
border:'1px solid #BBB4D6',
|
||||
zIndex:20,
|
||||
overflow:'hidden'}
|
||||
);
|
||||
|
||||
this.options.panel = panel;
|
||||
this.options.content.inject(panel);
|
||||
|
||||
this.options.content.addEvent('click', function() {
|
||||
this.hide();
|
||||
}.bind(this));
|
||||
|
||||
panel.setStyle('opacity', 0);
|
||||
panel.inject($(document.body));
|
||||
this.registerOpenPanel();
|
||||
},
|
||||
|
||||
show:function() {
|
||||
this.fireEvent("show");
|
||||
if (this.options.state == 'close') {
|
||||
if (!$defined(this.options.panel)) {
|
||||
this.init();
|
||||
}
|
||||
|
||||
var panel = this.options.panel;
|
||||
panel.setStyles({
|
||||
border: '1px solid #636163',
|
||||
opacity:100,
|
||||
height:this.options.height,
|
||||
width:this.options.width
|
||||
});
|
||||
this.fireEvent('onStart');
|
||||
this.registerClosePanel();
|
||||
this.options.state = 'open';
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
hide:function() {
|
||||
if (this.options.state == 'open') {
|
||||
// Magic, disappear effect ;)
|
||||
this.options.panel.setStyles({border: '1px solid transparent', opacity:0});
|
||||
this.registerOpenPanel();
|
||||
this.options.state = 'close';
|
||||
}
|
||||
},
|
||||
|
||||
registerOpenPanel:function() {
|
||||
$(this._buttonId).removeEvents('click');
|
||||
$(this._buttonId).addEvent('click', function() {
|
||||
this.show();
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
registerClosePanel:function() {
|
||||
$(this._buttonId).removeEvents('click');
|
||||
$(this._buttonId).addEvent('click', function() {
|
||||
this.hide();
|
||||
}.bind(this));
|
||||
} ,
|
||||
|
||||
_build : function() {
|
||||
var content = new Element('div').setStyles({width:253,height:200,padding:5});
|
||||
var count = 0;
|
||||
for (var i = 0; i < mindplot.ImageIcon.prototype.ICON_FAMILIES.length; i = i + 1) {
|
||||
var familyIcons = mindplot.ImageIcon.prototype.ICON_FAMILIES[i].icons;
|
||||
for (var j = 0; j < familyIcons.length; j = j + 1) {
|
||||
// Separate icons by line ...
|
||||
var familyContent;
|
||||
if ((count % 12) == 0) {
|
||||
familyContent = new Element('div').inject(content);
|
||||
}
|
||||
|
||||
var iconId = familyIcons[j];
|
||||
var img = new Element('img').setStyles({width:16,height:16,padding:"0px 2px"}).inject(familyContent);
|
||||
img.id = iconId;
|
||||
img.src = mindplot.ImageIcon.prototype._getImageUrl(iconId);
|
||||
|
||||
img.addEvent('click', function() {
|
||||
this._model.setValue(img.id);
|
||||
}.bind(this));
|
||||
|
||||
count = count + 1;
|
||||
}
|
||||
}
|
||||
return content;
|
||||
}
|
||||
|
||||
});
|
150
mindplot/src/main/javascript/widget/Menu.js
Normal file
150
mindplot/src/main/javascript/widget/Menu.js
Normal file
@ -0,0 +1,150 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
mindplot.widget.Menu = new Class({
|
||||
initialize : function(designer) {
|
||||
this._designer = designer;
|
||||
this._toolbarElems = [];
|
||||
this._colorPickers = [];
|
||||
|
||||
var fontFamilyModel = {
|
||||
getValue: function() {
|
||||
var nodes = designer.getSelectedNodes();
|
||||
var length = nodes.length;
|
||||
if (length == 1) {
|
||||
return nodes[0].getFontFamily();
|
||||
}
|
||||
},
|
||||
|
||||
setValue: function(value) {
|
||||
designer.setFont2SelectedNode(value);
|
||||
|
||||
}
|
||||
};
|
||||
var fontFamilyPanel = new mindplot.widget.FontFamilyPanel("fontFamily", fontFamilyModel);
|
||||
fontFamilyPanel.addEvent('show',function(){this.clear()}.bind(this));
|
||||
this._toolbarElems.push(fontFamilyPanel);
|
||||
|
||||
var fontSizeModel = {
|
||||
getValue: function() {
|
||||
var nodes = designer.getSelectedNodes();
|
||||
var length = nodes.length;
|
||||
if (length == 1) {
|
||||
return nodes[0].getFontSize();
|
||||
}
|
||||
},
|
||||
setValue: function(value) {
|
||||
designer.setFontSize2SelectedNode(value);
|
||||
}
|
||||
};
|
||||
var fontSizePanel = new mindplot.widget.FontSizePanel("fontSize", fontSizeModel);
|
||||
fontSizePanel.addEvent('show',function(){this.clear()}.bind(this));
|
||||
this._toolbarElems.push(fontSizePanel);
|
||||
|
||||
var topicShapeModel = {
|
||||
getValue: function() {
|
||||
var nodes = designer.getSelectedNodes();
|
||||
var length = nodes.length;
|
||||
if (length == 1) {
|
||||
return nodes[0].getShapeType();
|
||||
}
|
||||
},
|
||||
setValue: function(value) {
|
||||
designer.setShape2SelectedNode(value);
|
||||
}
|
||||
};
|
||||
var topicShapePanel = new mindplot.widget.TopicShapePanel("topicShape", topicShapeModel);
|
||||
topicShapePanel.addEvent('show',function(){this.clear()}.bind(this));
|
||||
this._toolbarElems.push(topicShapePanel);
|
||||
|
||||
// Create icon panel dialog ...
|
||||
var topicIconModel = {
|
||||
getValue: function() {
|
||||
return null;
|
||||
},
|
||||
setValue: function(value) {
|
||||
designer.addIconType2SelectedNode(value);
|
||||
}
|
||||
};
|
||||
var iconPanel = new mindplot.widget.IconPanel('topicIcon', topicIconModel);
|
||||
iconPanel.addEvent('show',function(){this.clear()}.bind(this));
|
||||
this._toolbarElems.push(iconPanel);
|
||||
|
||||
|
||||
var topicColorPicker = new MooRainbow('topicColor', {
|
||||
id: 'topicColor',
|
||||
imgPath: '../images/',
|
||||
startColor: [255, 255, 255],
|
||||
onInit: function() {
|
||||
this.clear();
|
||||
}.bind(this),
|
||||
|
||||
onChange: function(color) {
|
||||
designer.setBackColor2SelectedNode(color.hex);
|
||||
},
|
||||
onComplete: function() {
|
||||
this.clear();
|
||||
}.bind(this)
|
||||
});
|
||||
this._colorPickers.push(topicColorPicker);
|
||||
|
||||
var borderColorPicker = new MooRainbow('topicBorder', {
|
||||
id: 'topicBorder',
|
||||
imgPath: '../images/',
|
||||
startColor: [255, 255, 255],
|
||||
onInit: function() {
|
||||
this.clear();
|
||||
}.bind(this),
|
||||
onChange: function(color) {
|
||||
designer.setBorderColor2SelectedNode(color.hex);
|
||||
},
|
||||
onComplete: function() {
|
||||
this.clear();
|
||||
}.bind(this)
|
||||
|
||||
});
|
||||
this._colorPickers.push(borderColorPicker);
|
||||
|
||||
var fontColorPicker = new MooRainbow('fontColor', {
|
||||
id: 'fontColor',
|
||||
imgPath: '../images/',
|
||||
startColor: [255, 255, 255],
|
||||
onInit: function() {
|
||||
this.clear();
|
||||
}.bind(this),
|
||||
onChange: function(color) {
|
||||
designer.setFontColor2SelectedNode(color.hex);
|
||||
},
|
||||
onComplete: function() {
|
||||
this.clear();
|
||||
}.bind(this)
|
||||
});
|
||||
this._colorPickers.push(fontColorPicker);
|
||||
},
|
||||
|
||||
clear : function() {
|
||||
this._toolbarElems.forEach(function(elem) {
|
||||
elem.hide();
|
||||
});
|
||||
|
||||
this._colorPickers.forEach(function(elem) {
|
||||
$clear(elem);
|
||||
elem.hide();
|
||||
});
|
||||
}
|
||||
});
|
89
mindplot/src/main/javascript/widget/ToolbarPanel.js
Normal file
89
mindplot/src/main/javascript/widget/ToolbarPanel.js
Normal file
@ -0,0 +1,89 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
mindplot.widget.ToolbarPanel = new Class({
|
||||
Implements:[Events],
|
||||
initialize : function(buttonId, model) {
|
||||
$assert(buttonId, "buttonId can not be null");
|
||||
$assert(model, "model can not be null");
|
||||
this._model = model;
|
||||
this._panelId = this.initPanel(buttonId);
|
||||
},
|
||||
|
||||
buildPanel : function() {
|
||||
throw "Method must be implemented";
|
||||
}.protect(),
|
||||
|
||||
initPanel: function (buttonId) {
|
||||
$assert(buttonId, "buttonId can not be null");
|
||||
|
||||
var panelElem = this.buildPanel();
|
||||
var buttonElem = $(buttonId);
|
||||
|
||||
// Add panel content ..
|
||||
panelElem.setStyle('display', 'none');
|
||||
panelElem.inject(buttonElem);
|
||||
|
||||
// Register on toolbar elements ...
|
||||
var menuElems = panelElem.getElements('div');
|
||||
menuElems.forEach(function(elem) {
|
||||
elem.addEvent('click', function() {
|
||||
var value = $defined(elem.getAttribute('model')) ? elem.getAttribute('model') : elem.id;
|
||||
this._model.setValue(value);
|
||||
this.hide();
|
||||
}.bind(this));
|
||||
}.bind(this));
|
||||
|
||||
// Font family event handling ....
|
||||
buttonElem.addEvent('click', function() {
|
||||
|
||||
// Is the panel being displayed ?
|
||||
if (this.isVisible()) {
|
||||
this.hide();
|
||||
} else {
|
||||
this.show();
|
||||
}
|
||||
|
||||
}.bind(this));
|
||||
return panelElem.id;
|
||||
},
|
||||
|
||||
show : function() {
|
||||
this.fireEvent('show');
|
||||
|
||||
var menuElems = $(this._panelId).getElements('div');
|
||||
var value = this._model.getValue();
|
||||
menuElems.forEach(function(elem) {
|
||||
var elemValue = $defined(elem.getAttribute('model')) ? elem.getAttribute('model') : elem.id;
|
||||
if (elemValue == value)
|
||||
elem.className = "toolbarPanelLinkSelectedLink";
|
||||
else
|
||||
elem.className = "toolbarPanelLink";
|
||||
});
|
||||
$(this._panelId).setStyle('display', 'block');
|
||||
|
||||
},
|
||||
|
||||
hide : function() {
|
||||
$(this._panelId).setStyle('display', 'none');
|
||||
},
|
||||
|
||||
isVisible : function() {
|
||||
return $(this._panelId).getStyle('display') == 'block';
|
||||
}
|
||||
});
|
37
mindplot/src/main/javascript/widget/TopicShapePanel.js
Normal file
37
mindplot/src/main/javascript/widget/TopicShapePanel.js
Normal file
@ -0,0 +1,37 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
mindplot.widget.TopicShapePanel = new Class({
|
||||
Extends : mindplot.widget.ToolbarPanel,
|
||||
initialize : function(buttonId, model) {
|
||||
this.parent(buttonId, model);
|
||||
},
|
||||
|
||||
buildPanel: function() {
|
||||
|
||||
var content = new Element("div", {'class':'toolbarPanel','id':'topicShapePanel'});
|
||||
content.innerHTML = '' +
|
||||
'<div id="rectagle" model="rectagle"><img src="../images/shape-rectangle.png" alt="Rectangle" width="40" height="25"></div>' +
|
||||
'<div id="rounded_rectagle" model="rounded rectagle" ><img src="../images/shape-rectangle-rounded.png"alt="Rounded Rectangle" width="40" height="25"></div>' +
|
||||
'<div id="line" model="line"><img src="../images/shape-line.png" alt="Line" width="40" height="7"></div>' +
|
||||
'<div id="elipse" model="elipse" class="toolbarPanelLink"><img src="../images/shape-elipse.png" alt="Elipse" width="40" height="25"></div>';
|
||||
|
||||
return content;
|
||||
|
||||
}
|
||||
});
|
@ -24,7 +24,7 @@ html {
|
||||
top: 30px;
|
||||
}
|
||||
|
||||
#waitingContainer,#errorContainer {
|
||||
#waitingContainer, #errorContainer {
|
||||
position: relative;
|
||||
top: 80px;
|
||||
height: 120px; /*background: whitesmoke;*/
|
||||
@ -33,7 +33,7 @@ html {
|
||||
padding: 15px;
|
||||
width: 100%;
|
||||
border: 1px solid;
|
||||
border-color:#a9a9a9;
|
||||
border-color: #a9a9a9;
|
||||
|
||||
}
|
||||
|
||||
@ -62,7 +62,7 @@ html {
|
||||
vertical-align: text-bottom;
|
||||
height: 30px;
|
||||
float: right;
|
||||
padding-left:120px;
|
||||
padding-left: 120px;
|
||||
}
|
||||
|
||||
#waitingContainer .loadingIcon {
|
||||
@ -123,7 +123,7 @@ html {
|
||||
color: #ffffff;
|
||||
border-bottom: 2px solid black;
|
||||
position: absolute;
|
||||
top: 35px;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
div#toolbar .buttonContainer {
|
||||
@ -134,9 +134,8 @@ div#toolbar .buttonContainer {
|
||||
|
||||
.buttonContainer fieldset {
|
||||
border: 1px solid #BBB4D6;
|
||||
padding: 2px;
|
||||
margin: 1px;
|
||||
padding-bottom: 4px;
|
||||
padding: 2px 2px 4px;
|
||||
margin: 8px 1px 1px;
|
||||
}
|
||||
|
||||
.buttonContainer legend {
|
||||
@ -158,6 +157,11 @@ div#toolbar .button {
|
||||
margin: 0 2px 2px 2px;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
-webkit-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-o-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
div#toolbar .comboButton {
|
||||
@ -190,7 +194,7 @@ div#toolbar .toolbarLabel {
|
||||
top: 55%;
|
||||
text-align: center;
|
||||
width: 34px;
|
||||
height: 36px;
|
||||
height: 10px;
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
@ -209,15 +213,15 @@ div#file, div#zoom, div#node, div#font, div#share {
|
||||
}
|
||||
|
||||
div#zoom {
|
||||
left: 229px;
|
||||
left: 84px;
|
||||
}
|
||||
|
||||
div#node {
|
||||
left: 311px;
|
||||
left: 165px;
|
||||
}
|
||||
|
||||
div#font {
|
||||
left: 679px; /*left:581px;*/
|
||||
left: 532px; /*left:581px;*/
|
||||
}
|
||||
|
||||
div#share {
|
||||
@ -250,15 +254,15 @@ div#redoEdition {
|
||||
|
||||
#export {
|
||||
background: url(../images/file_export.png) no-repeat center top;
|
||||
position:relative;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#exportAnchor {
|
||||
position:absolute;
|
||||
width:100%;
|
||||
height:100%;
|
||||
top:0;
|
||||
left:0;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
div#zoomIn {
|
||||
@ -380,7 +384,13 @@ div#fontColor {
|
||||
display: none;
|
||||
position: absolute;
|
||||
z-index: 4;
|
||||
top: 71px;
|
||||
top: 53px;
|
||||
text-align: left;
|
||||
-webkit-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-o-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
div.toolbarPanelLink {
|
||||
@ -547,7 +557,7 @@ div#tabs {
|
||||
div.tabContent {
|
||||
clear: left;
|
||||
width: 100%;
|
||||
height: 63px;
|
||||
height: 50px;
|
||||
border-bottom: 1px solid #bbb4d6;
|
||||
border-top: 1px solid #bbb4d6;
|
||||
background: #E5E5E5;
|
||||
@ -608,7 +618,7 @@ ol#toc span {
|
||||
|
||||
#mindplot {
|
||||
position: relative;
|
||||
top: 103px;
|
||||
top: 53px;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
border: 0;
|
||||
@ -722,21 +732,21 @@ div#small_error_icon {
|
||||
}
|
||||
|
||||
div#toolbar .topicRelation {
|
||||
width:56px;
|
||||
width: 56px;
|
||||
background: url(../images/topic_relationship.png) no-repeat center top;
|
||||
z-index: 4;
|
||||
}
|
||||
|
||||
div#toolbar .topicRelation:hover {
|
||||
width:56px;
|
||||
width: 56px;
|
||||
background: url(../images/topic_relationship.png) no-repeat center top;
|
||||
z-index: 4;
|
||||
}
|
||||
|
||||
div#toolbar .relationshiplabel{
|
||||
width:56px;
|
||||
div#toolbar .relationshiplabel {
|
||||
width: 56px;
|
||||
}
|
||||
|
||||
.nicEdit-main {
|
||||
outline:none;
|
||||
outline: none;
|
||||
}
|
47
wise-doc/src/main/webapp/html/collab.html
Normal file
47
wise-doc/src/main/webapp/html/collab.html
Normal file
@ -0,0 +1,47 @@
|
||||
<html>
|
||||
<body>
|
||||
<script type="text/javascript" src="http://docs.google.com/brix/static/api/js/jsapi.nocache.js"></script>
|
||||
<script type="text/javascript">
|
||||
var collabOnLoad = function() {
|
||||
app = new goog.collab.CollaborativeApp();
|
||||
app.start();
|
||||
|
||||
app.addListener('modelLoad', function(model) {
|
||||
var root = app.getModel().getRoot();
|
||||
if (!root.get("mindmap7")) {
|
||||
|
||||
console.log("Creating empty map ...");
|
||||
|
||||
// var topics = app.getModel().create("List");
|
||||
root.put("mindmap7", "start_");
|
||||
}
|
||||
|
||||
root.addListener('valueChanged', function(e) {
|
||||
console.log("New item added ...:");
|
||||
console.log(app.getModel().getRoot().get("mindmap7"));
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
function addTopic() {
|
||||
|
||||
console.log("Adding new item ver:2 ...");
|
||||
|
||||
var root = app.getModel().getRoot();
|
||||
var topics = root.get("mindmap7");
|
||||
|
||||
// var topic = app.getModel().create("Map");
|
||||
// topic.put("id", "topic_x");
|
||||
// topic.put("text", "topic X text");
|
||||
// topics.add(topic);
|
||||
|
||||
// root.put("mindmap7", topics);
|
||||
root.put("mindmap7", app.getModel().getRoot().get("mindmap7") + "_algo");
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
Este es este no ?
|
||||
<input style="font-size:20px;width:50px;height:50px;" type="button" value=" " id="a2" onclick="addTopic(this)"/>
|
||||
</body>
|
||||
</html>
|
@ -13,6 +13,8 @@
|
||||
<link rel="stylesheet" type="text/css" href="../css/bubble.css"/>
|
||||
|
||||
<!--<script type='text/javascript' src='../js/wiseLibrary.js'></script>-->
|
||||
|
||||
<!--<script type='text/javascript' src='http://docs.google.com/brix/static/api/js/jsapi.nocache.js'></script>-->
|
||||
<script type='text/javascript' src='../js/mootools-core-1.3.2-full-compat.js'></script>
|
||||
<script type='text/javascript' src='../js/mootools-more-1.3.2.1-yui.js'></script>
|
||||
|
||||
@ -24,6 +26,7 @@
|
||||
<!--<script type='text/javascript' src='../js/mooRainbow.js'></script>-->
|
||||
|
||||
|
||||
<script type='text/javascript' src='../../../../../wise-webapp/src/main/webapp/js/mooRainbow.js'></script>
|
||||
|
||||
<script type='text/javascript' src='../js/core.js'></script>
|
||||
<script type="text/javascript">
|
||||
@ -42,7 +45,6 @@
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<form method="post" id="printForm" name="printForm" action='' style="height:100%;" target="${mindmap.title}">
|
||||
<input type="hidden" name="action" value="print">
|
||||
<input type="hidden" name="mapId" value="${mindmap.id}">
|
||||
@ -53,7 +55,7 @@
|
||||
<div id="waitingContainer">
|
||||
<div class="loadingIcon"></div>
|
||||
<div class="loadingText">
|
||||
SYMB_EDITOR.LOADING
|
||||
Loading ...
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -62,7 +64,7 @@
|
||||
<div id="errorContainer">
|
||||
<div class="loadingIcon"></div>
|
||||
<div class="loadingText">
|
||||
SYMB_EDITOR.ERROR_LOADING
|
||||
Unexpected error loading your map :(
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -78,277 +80,130 @@
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
// @Todo: This must be persited in the map properties ...
|
||||
var mapId = '1';
|
||||
var mapXml = '<map name="38298" version="pela"><topic central="true" text="test" id="1"/></map>';
|
||||
|
||||
// @Todo: This must be persiste in the map properties ...
|
||||
var editorProperties = {zoom:0.85,saveOnLoad:true};
|
||||
|
||||
function printMap() {
|
||||
document.printForm.mapSvg.value = $("workspaceContainer").innerHTML;
|
||||
document.printForm.submit();
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<div id="colorPalette">
|
||||
<div id="paletteHeader"></div>
|
||||
</div>
|
||||
|
||||
<div id="fontFamilyPanel" class="toolbarPanel">
|
||||
<div id="times" class="toolbarPanelLink" style="font-family:times;">Times</div>
|
||||
<div id="arial" class="toolbarPanelLink" style="font-family:arial;">Arial</div>
|
||||
<div id="tahoma" class="toolbarPanelLink" style="font-family:tahoma;">Tahoma</div>
|
||||
<div id="verdana" class="toolbarPanelLink" style="font-family:verdana;">Verdana</div>
|
||||
</div>
|
||||
|
||||
<div id="fontSizePanel" class="toolbarPanel">
|
||||
<div id="small" class="toolbarPanelLink" style="font-size:8px">Small</div>
|
||||
<div id="normal" class="toolbarPanelLink" style="font-size:12px">Normal</div>
|
||||
<div id="large" class="toolbarPanelLink" style="font-size:15px">Large</div>
|
||||
<div id="huge" class="toolbarPanelLink" style="font-size:24px">Huge</div>
|
||||
</div>
|
||||
|
||||
<div id="topicShapePanel" class="toolbarPanel">
|
||||
<!--<div id="automatic" class="toolbarPanelLink">Automatic</div>-->
|
||||
<div id="rectagle" class="toolbarPanelLink"><img src="../images/shape-rectangle.png" alt="Rectangle" width="40"
|
||||
height="25"></div>
|
||||
<div id="rounded_rectagle" class="toolbarPanelLink"><img src="../images/shape-rectangle-rounded.png"
|
||||
alt="Rounded Rectangle" width="40" height="25"></div>
|
||||
<div id="line" class="toolbarPanelLink"><img src="../images/shape-line.png" alt="Line" width="40" height="7"></div>
|
||||
<div id="elipse" class="toolbarPanelLink"><img src="../images/shape-elipse.png" alt="Elipse" width="40" height="25">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="actionsContainer">
|
||||
</div>
|
||||
|
||||
<div id="toolbar">
|
||||
<div id="editTab" class="tabContent">
|
||||
<div id="file" class="buttonContainer" title="SYMB_ FILE">
|
||||
<fieldset>
|
||||
<legend>
|
||||
SYMB_FILE
|
||||
</legend>
|
||||
<div id="saveButton" class="button" title="SYMB_ SAVE">
|
||||
<div class="toolbarLabel">
|
||||
<p>
|
||||
SYMB_SAVE
|
||||
</p>
|
||||
</div>
|
||||
<div id="editTab" class="tabContent">
|
||||
<div id="file" class="buttonContainer" title="SYMB_ FILE">
|
||||
<fieldset>
|
||||
<div id="undoEdition" class="button" title="Undo Edition">
|
||||
<div class="toolbarLabel">
|
||||
<p>Undo</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="redoEdition" class="button" title="Redo Edition">
|
||||
<div class="toolbarLabel">
|
||||
<p>Redo</p>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div id="discardButton" class="button" title="SYMB_ CLOSE">
|
||||
<div class="toolbarLabel">
|
||||
<p>
|
||||
SYMB_CLOSE
|
||||
</p>
|
||||
</div>
|
||||
<div id="zoom" class="buttonContainer" title="Zoom In">
|
||||
<fieldset>
|
||||
<div id="zoomIn" class="button" title="Zoom In">
|
||||
<div class="toolbarLabel">
|
||||
<p>In</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="zoomOut" class="button" title="Zoom Out">
|
||||
<div class="toolbarLabel">
|
||||
<p>Out</p>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div id="undoEdition" class="button" title="SYMB_ UNDO_EDITION">
|
||||
<div class="toolbarLabel">
|
||||
<p>
|
||||
SYMB_UNDO
|
||||
</p>
|
||||
</div>
|
||||
<div id="node" class="buttonContainer" title="Node Properties">
|
||||
<fieldset>
|
||||
<div id="topicShape" class="button comboButton" title="SYMB_TOPIC_SHAPE">
|
||||
<div class="toolbarLabel">
|
||||
<p>Shape</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="addTopic" class="button" title="SYMB_ TOPIC_ADD">
|
||||
<div class="toolbarLabel">
|
||||
<p>Add</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="deleteTopic" class="button" title="SYMB_ TOPIC_DELETE">
|
||||
<div class="toolbarLabel">
|
||||
<p>Delete</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="topicBorder" class="button comboButton" title="SYMB_ TOPIC_BORDER_COLOR">
|
||||
<div class="toolbarLabel">
|
||||
<p>Border</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="topicColor" class="button comboButton" title="Background Color">
|
||||
<div class="toolbarLabel">
|
||||
<p>Color</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="topicIcon" class="button comboButton" title="Change Icon">
|
||||
<div class="toolbarLabel">
|
||||
<p>Icon</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="topicNote" class="button comboButton" title="Add Note">
|
||||
<div class="toolbarLabel">
|
||||
<p>Note</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="topicLink" class="button" title="Add Link">
|
||||
<div class="toolbarLabel">
|
||||
<p>Link</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="topicRelation" class="topicRelation button" title="Add Relationship">
|
||||
<div class="relationshiplabel toolbarLabel">
|
||||
<p>Relationship</p>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div id="redoEdition" class="button" title="SYMB_ REDO_EDITION">
|
||||
<div class="toolbarLabel">
|
||||
<p>
|
||||
SYMB_REDO
|
||||
</p>
|
||||
</div>
|
||||
<div id="font" class="buttonContainer" title="Font Properties">
|
||||
<fieldset>
|
||||
<div id="fontFamily" class="button comboButton" title="Font Style">
|
||||
<div class="toolbarLabel">
|
||||
<p>Style</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="fontSize" class="button comboButton" title="Font Size">
|
||||
<div class="toolbarLabel">
|
||||
<p>Size</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="fontBold" class="button" title="Bold Style">
|
||||
<div class="toolbarLabel">
|
||||
<p>Bold</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="fontItalic" class="button" title="Italic Style">
|
||||
<div class="toolbarLabel">
|
||||
<p>Italic</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="fontColor" class="button comboButton" title="Fond Color">
|
||||
<div class="toolbarLabel">
|
||||
<p>Color</p>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div id="print" class="button" title="SYMB_ PRINT" onclick="printMap();">
|
||||
<div class="toolbarLabel">
|
||||
<p>
|
||||
SYMB_PRINT
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="export" class="button" title="SYMB_ EXPORT">
|
||||
<div class="toolbarLabel">
|
||||
<p>
|
||||
SYMB_EXPORT
|
||||
</p>
|
||||
</div>
|
||||
<a id="exportAnchor" href="export.htm?mapId=${mindmap.id}" rel="moodalbox 600px 400px"
|
||||
title="SYMB_ EXPORT_DETAILS">
|
||||
</a>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div id="zoom" class="buttonContainer" title="Zoom In">
|
||||
<fieldset>
|
||||
<legend>
|
||||
SYMB_ZOOM
|
||||
</legend>
|
||||
<div id="zoomIn" class="button" title="SYMB_ ZOOM_IN">
|
||||
<div class="toolbarLabel">
|
||||
<p>
|
||||
SYMB_IN
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="zoomOut" class="button" title="SYMB_ ZOOM_OUT">
|
||||
<div class="toolbarLabel">
|
||||
<p>
|
||||
SYMB_OUT
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div id="node" class="buttonContainer" title="Node Properties">
|
||||
<fieldset>
|
||||
<legend>
|
||||
SYMB_TOPIC
|
||||
</legend>
|
||||
<div id="topicShape" class="button comboButton" title="SYMB_ TOPIC_SHAPE">
|
||||
<div class="toolbarLabel">
|
||||
<p>
|
||||
SYMB_SHAPE
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="addTopic" class="button" title="SYMB_ TOPIC_ADD">
|
||||
<div class="toolbarLabel">
|
||||
<p>
|
||||
SYMB_ADD
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="deleteTopic" class="button" title="SYMB_ TOPIC_DELETE">
|
||||
<div class="toolbarLabel">
|
||||
<p>
|
||||
SYMB_DELETE
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="topicBorder" class="button comboButton" title="SYMB_ TOPIC_BORDER_COLOR">
|
||||
<div class="toolbarLabel">
|
||||
<p>
|
||||
SYMB_BORDER
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="topicColor" class="button comboButton" title="SYMB_ TOPIC_BACKGROUND_COLOR">
|
||||
<div class="toolbarLabel">
|
||||
<p>
|
||||
SYMB_COLOR
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="topicIcon" class="button comboButton" title="SYMB_ TOPIC_ICON">
|
||||
<div class="toolbarLabel">
|
||||
<p>
|
||||
SYMB_ICON
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="topicNote" class="button comboButton" title="SYMB_ TOPIC_NOTE">
|
||||
<div class="toolbarLabel">
|
||||
<p>
|
||||
SYMB_NOTE
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="topicLink" class="button" title="SYMB_ TOPIC_LINK">
|
||||
<div class="toolbarLabel">
|
||||
<p>
|
||||
SYMB_LINK
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="topicRelation" class="topicRelation button" title="SYMB_ TOPIC_RELATIONSHIP">
|
||||
<div class="relationshiplabel toolbarLabel">
|
||||
<p>
|
||||
SYMB_TOPIC_RELATIONSHIP
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div id="font" class="buttonContainer" title="Font Properties">
|
||||
<fieldset>
|
||||
<legend>
|
||||
SYMB_FONT
|
||||
</legend>
|
||||
<div id="fontFamily" class="button comboButton" title="SYMB_ FONT_TYPE">
|
||||
<div class="toolbarLabel">
|
||||
<p>
|
||||
SYMB_TYPE
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="fontSize" class="button comboButton" title="SYMB_ FONT_SIZE">
|
||||
<div class="toolbarLabel">
|
||||
<p>
|
||||
SYMB_SIZE
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="fontBold" class="button" title="SYMB_ FONT_BOLD">
|
||||
<div class="toolbarLabel">
|
||||
<p>
|
||||
SYMB_BOLD
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="fontItalic" class="button" title="SYMB_ FONT_ITALIC">
|
||||
<div class="toolbarLabel">
|
||||
<p>
|
||||
SYMB_ITALIC
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="fontColor" class="button comboButton" title="SYMB_ FONT_COLOR">
|
||||
<div class="toolbarLabel">
|
||||
<p>
|
||||
SYMB_COLOR
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div id="share" class="buttonContainer" title="Share Properties">
|
||||
|
||||
<fieldset>
|
||||
<legend>
|
||||
SYMB_COLLABORATION
|
||||
</legend>
|
||||
<div id="tagIt" class="button" title="SYMB_ TAG">
|
||||
<div class="toolbarLabel">
|
||||
<p>
|
||||
SYMB_TAG
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="shareIt" class="button" title="SYMB_ COLLABORATE">
|
||||
<div class="toolbarLabel">
|
||||
<p>
|
||||
SYMB_SHARE
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="publishIt" class="button" title="SYMB_ PUBLISH">
|
||||
<div class="toolbarLabel">
|
||||
<p>
|
||||
SYMB_PUBLISH
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="history" class="button" title="SYMB_ HISTORY_MSG">
|
||||
<div class="toolbarLabel">
|
||||
<p>
|
||||
SYMB_HISTORY
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="mindplot"></div>
|
||||
|
BIN
wise-doc/src/main/webapp/images/bin.png
Normal file
BIN
wise-doc/src/main/webapp/images/bin.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 476 B |
@ -16,9 +16,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
$import("../js/mindplot.svg.js");
|
||||
|
||||
var designer = null;
|
||||
|
||||
// CSS helper functions
|
||||
@ -180,12 +177,11 @@ function afterMindpotLibraryLoading() {
|
||||
});
|
||||
}
|
||||
|
||||
var iconChooser = buildIconChooser();
|
||||
// iconPanel = new IconPanel({button:$('topicIcon'), onStart:cleanScreenEvent, content:iconChooser});
|
||||
// Register Events ...
|
||||
$(document).addEvent('keydown', designer.keyEventHandler.bindWithEvent(designer));
|
||||
$("ffoxWorkarroundInput").addEvent('keydown', designer.keyEventHandler.bindWithEvent(designer));
|
||||
//
|
||||
// Register Key Events ...
|
||||
$(document).addEvent('keydown', designer.keyEventHandler.bind(designer));
|
||||
$("ffoxWorkarroundInput").addEvent('keydown', designer.keyEventHandler.bind(designer));
|
||||
|
||||
// Register toolbar events ...
|
||||
$('zoomIn').addEvent('click', function(event) {
|
||||
designer.zoomIn();
|
||||
});
|
||||
@ -202,7 +198,7 @@ function afterMindpotLibraryLoading() {
|
||||
designer.redo();
|
||||
});
|
||||
|
||||
designer.addEventListener("change", function(event) {
|
||||
designer.addEventListener("modelUpdate", function(event) {
|
||||
if (event.undoSteps > 0) {
|
||||
$("undoEdition").setStyle("background-image", "url(../images/file_undo.png)");
|
||||
} else {
|
||||
@ -222,42 +218,10 @@ function afterMindpotLibraryLoading() {
|
||||
});
|
||||
|
||||
$('deleteTopic').addEvent('click', function(event) {
|
||||
var topics = designer.getSelectedNodes();
|
||||
designer.deleteCurrentNode();
|
||||
});
|
||||
|
||||
var context = this;
|
||||
/*var colorPicker1 = new MooRainbow('topicColor', {
|
||||
id: 'topicColor',
|
||||
imgPath: '../images/',
|
||||
startColor: [255, 255, 255],
|
||||
onInit: function(color) {
|
||||
cleanScreenEvent.bind(context).attempt();
|
||||
setCurrentColorPicker.attempt(colorPicker1, context);
|
||||
},
|
||||
onChange: function(color) {
|
||||
designer.setBackColor2SelectedNode(color.hex);
|
||||
},
|
||||
onComplete: function(color) {
|
||||
removeCurrentColorPicker.attempt(colorPicker1, context);
|
||||
}
|
||||
});
|
||||
var colorPicker2 = new MooRainbow('topicBorder', {
|
||||
id: 'topicBorder',
|
||||
imgPath: '../images/',
|
||||
startColor: [255, 255, 255],
|
||||
onInit: function(color) {
|
||||
cleanScreenEvent.bind(context).attempt();
|
||||
setCurrentColorPicker.attempt(colorPicker2, context);
|
||||
},
|
||||
onChange: function(color) {
|
||||
designer.setBorderColor2SelectedNode(color.hex);
|
||||
},
|
||||
onComplete: function(color) {
|
||||
removeCurrentColorPicker.attempt(colorPicker2, context);
|
||||
}
|
||||
});*/
|
||||
$('topicLink').addEvent('click', function(event) {
|
||||
$('topicLink').addEvent('click', function() {
|
||||
designer.addLink2SelectedNode();
|
||||
|
||||
});
|
||||
@ -266,73 +230,32 @@ function afterMindpotLibraryLoading() {
|
||||
designer.addRelationShip2SelectedNode(event);
|
||||
});
|
||||
|
||||
$('topicNote').addEvent('click', function(event) {
|
||||
$('topicNote').addEvent('click', function() {
|
||||
designer.addNote2SelectedNode();
|
||||
|
||||
});
|
||||
|
||||
|
||||
$('fontBold').addEvent('click', function(event) {
|
||||
$('fontBold').addEvent('click', function() {
|
||||
designer.setWeight2SelectedNode();
|
||||
});
|
||||
|
||||
$('fontItalic').addEvent('click', function(event) {
|
||||
$('fontItalic').addEvent('click', function() {
|
||||
designer.setStyle2SelectedNode();
|
||||
});
|
||||
|
||||
/*var colorPicker3 = new MooRainbow('fontColor', {
|
||||
id: 'fontColor',
|
||||
imgPath: '../images/',
|
||||
startColor: [255, 255, 255],
|
||||
onInit: function(color) {
|
||||
cleanScreenEvent.bind(context).attempt();
|
||||
setCurrentColorPicker.attempt(colorPicker3, context);
|
||||
},
|
||||
onChange: function(color) {
|
||||
designer.setFontColor2SelectedNode(color.hex);
|
||||
},
|
||||
onComplete: function(color) {
|
||||
removeCurrentColorPicker.attempt(colorPicker3, context);
|
||||
}
|
||||
});*/
|
||||
|
||||
// Save event handler ....
|
||||
var saveButton = $('saveButton');
|
||||
saveButton.addEvent('click', function(event) {
|
||||
|
||||
|
||||
saveButton.setStyle('cursor', 'wait');
|
||||
var saveFunc = function() {
|
||||
designer.save(function() {
|
||||
var monitor = core.Monitor.getInstance();
|
||||
monitor.logMessage('Save completed successfully');
|
||||
saveButton.setStyle('cursor', 'pointer');
|
||||
}, true);
|
||||
}
|
||||
saveFunc.delay(1);
|
||||
|
||||
});
|
||||
|
||||
var discardButton = $('discardButton');
|
||||
discardButton.addEvent('click', function(event) {
|
||||
|
||||
displayLoading();
|
||||
window.document.location = "mymaps.htm";
|
||||
});
|
||||
|
||||
// To prevent the user from leaving the page with changes ...
|
||||
window.onbeforeunload = function confirmExit() {
|
||||
window.onbeforeunload = function () {
|
||||
if (designer.needsSave()) {
|
||||
designer.save(null, false)
|
||||
}
|
||||
}
|
||||
};
|
||||
var menu = new mindplot.widget.Menu(designer);
|
||||
|
||||
// Build panels ...
|
||||
fontFamilyPanel();
|
||||
shapeTypePanel();
|
||||
fontSizePanel();
|
||||
// If a node has focus, focus can be move to another node using the keys.
|
||||
designer._cleanScreen = function(){menu.clear()};
|
||||
|
||||
// If not problem has occured, I close the dialog ...
|
||||
|
||||
// If not problem has arisen, close the dialog ...
|
||||
var closeDialog = function() {
|
||||
|
||||
if (!window.hasUnexpectedErrors) {
|
||||
@ -341,44 +264,6 @@ function afterMindpotLibraryLoading() {
|
||||
}.delay(500);
|
||||
}
|
||||
|
||||
function buildIconChooser() {
|
||||
var content = new Element('div').setStyles({width:253,height:200,padding:5});
|
||||
var count = 0;
|
||||
for (var i = 0; i < mindplot.ImageIcon.prototype.ICON_FAMILIES.length; i = i + 1) {
|
||||
var familyIcons = mindplot.ImageIcon.prototype.ICON_FAMILIES[i].icons;
|
||||
for (var j = 0; j < familyIcons.length; j = j + 1) {
|
||||
// Separate icons by line ...
|
||||
var familyContent;
|
||||
if ((count % 12) == 0) {
|
||||
familyContent = new Element('div').inject(content);
|
||||
}
|
||||
|
||||
|
||||
var iconId = familyIcons[j];
|
||||
var img = new Element('img').setStyles({width:16,height:16,padding:"0px 2px"}).inject(familyContent);
|
||||
img.id = iconId;
|
||||
img.src = mindplot.ImageIcon.prototype._getImageUrl(iconId);
|
||||
img.addEvent('click', function(event, id) {
|
||||
designer.addImage2SelectedNode(this.id);
|
||||
}.bindWithEvent(img));
|
||||
count = count + 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return content;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function setCurrentColorPicker(colorPicker) {
|
||||
this.currentColorPicker = colorPicker;
|
||||
}
|
||||
|
||||
function removeCurrentColorPicker(colorPicker) {
|
||||
$clear(this.currentColorPicker);
|
||||
}
|
||||
|
||||
function buildMindmapDesigner() {
|
||||
// Initialize message logger ...
|
||||
// var monitor = new core.Monitor($('msgLoggerContainer'), $('msgLogger'));
|
||||
@ -391,7 +276,7 @@ function buildMindmapDesigner() {
|
||||
var screenHeight = window.getHeight();
|
||||
|
||||
// header - footer
|
||||
screenHeight = screenHeight - 90 - 61;
|
||||
screenHeight = screenHeight - 115;
|
||||
|
||||
// body margin ...
|
||||
editorProperties.width = screenWidth;
|
||||
@ -407,143 +292,80 @@ function buildMindmapDesigner() {
|
||||
|
||||
function buildStandaloneMindmapDesigner(){
|
||||
designer.loadFromXML(mapId, mapXml);
|
||||
|
||||
// If a node has focus, focus can be move to another node using the keys.
|
||||
designer._cleanScreen = cleanScreenEvent.bind(this);
|
||||
}
|
||||
|
||||
function buildCollaborativeMindmapDesigner(){
|
||||
if($wise_collaborationManager.isCollaborativeFrameworkReady()){
|
||||
designer.loadFromCollaborativeModel($wise_collaborationManager);
|
||||
// If a node has focus, focus can be move to another node using the keys.
|
||||
designer._cleanScreen = cleanScreenEvent.bind(this);
|
||||
}else{
|
||||
$wise_collaborationManager.setWiseReady(true);
|
||||
}
|
||||
}
|
||||
|
||||
function createColorPalette(container, onSelectFunction, event) {
|
||||
cleanScreenEvent();
|
||||
_colorPalette = new core.ColorPicker();
|
||||
_colorPalette.onSelect = function(color) {
|
||||
onSelectFunction.call(this, color);
|
||||
cleanScreenEvent();
|
||||
};
|
||||
//######################### Libraries Loading ##################################
|
||||
function JSPomLoader(pomUrl, callback) {
|
||||
console.log("POM Load URL:" + pomUrl);
|
||||
var jsUrls;
|
||||
var request = new Request({
|
||||
url: pomUrl,
|
||||
method: 'get',
|
||||
onRequest: function() {
|
||||
console.log("loading ...");
|
||||
},
|
||||
onSuccess: function(responseText, responseXML) {
|
||||
|
||||
// dojo.event.kwConnect({srcObj: this._colorPalette,srcFunc:"onColorSelect",targetObj:this._colorPalette, targetFunc:"onSelect", once:true});
|
||||
var mouseCoords = core.Utils.getMousePosition(event);
|
||||
var colorPaletteElement = $("colorPalette");
|
||||
colorPaletteElement.setStyle('left', (mouseCoords.x - 80) + "px");
|
||||
colorPaletteElement.setStyle('display', "block");
|
||||
}
|
||||
;
|
||||
// Collect JS Urls ...
|
||||
var concatRoot = responseXML.getElementsByTagName('concat');
|
||||
var fileSetArray = Array.filter(concatRoot[0].childNodes, function(elem) {
|
||||
return elem.nodeType == Node.ELEMENT_NODE
|
||||
});
|
||||
|
||||
function cleanScreenEvent() {
|
||||
/*if (this.currentColorPicker) {
|
||||
this.currentColorPicker.hide();
|
||||
}*/
|
||||
$("fontFamilyPanel").setStyle('display', "none");
|
||||
$("fontSizePanel").setStyle('display', "none");
|
||||
$("topicShapePanel").setStyle('display', "none");
|
||||
// iconPanel.close();
|
||||
}
|
||||
jsUrls = new Array();
|
||||
Array.each(fileSetArray, function(elem) {
|
||||
var jsUrl = elem.getAttribute("dir") + elem.getAttribute("files");
|
||||
jsUrls.push(jsUrl.replace("${basedir}", pomUrl.substring(0, pomUrl.lastIndexOf('/'))));
|
||||
}
|
||||
);
|
||||
|
||||
function fontFamilyPanel() {
|
||||
var supportedFonts = ['times','arial','tahoma','verdana'];
|
||||
var updateFunction = function(value) {
|
||||
value = value.charAt(0).toUpperCase() + value.substring(1, value.length);
|
||||
designer.setFont2SelectedNode(value);
|
||||
};
|
||||
// Load all JS dynamically ....
|
||||
jsUrls = jsUrls.reverse();
|
||||
|
||||
var onFocusValue = function(selectedNode) {
|
||||
return selectedNode.getFontFamily();
|
||||
};
|
||||
function jsRecLoad(urls) {
|
||||
if (urls.length == 0) {
|
||||
if ($defined(callback))
|
||||
callback();
|
||||
} else {
|
||||
var url = urls.pop();
|
||||
// console.log("load url:" + url);
|
||||
Asset.javascript(url, {
|
||||
onLoad: function() {
|
||||
jsRecLoad(urls)
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
buildPanel('fontFamily', 'fontFamilyPanel', supportedFonts, updateFunction, onFocusValue);
|
||||
}
|
||||
|
||||
function shapeTypePanel() {
|
||||
var shapeTypePanel = ['rectagle','rounded_rectagle','line','elipse'];
|
||||
var updateFunction = function(value) {
|
||||
designer.setShape2SelectedNode(value.replace('_', ' '));
|
||||
};
|
||||
|
||||
var onFocusValue = function(selectedNode) {
|
||||
|
||||
return selectedNode.getShapeType().replace(' ', '_');
|
||||
};
|
||||
|
||||
buildPanel('topicShape', 'topicShapePanel', shapeTypePanel, updateFunction, onFocusValue);
|
||||
}
|
||||
|
||||
function fontSizePanel() {
|
||||
var shapeTypePanel = ['small','normal','large','huge'];
|
||||
var map = {small:'6',normal:'8',large:'10',huge:'15'};
|
||||
var updateFunction = function(value) {
|
||||
var nodes = designer.getSelectedNodes();
|
||||
var value = map[value];
|
||||
designer.setFontSize2SelectedNode(value);
|
||||
};
|
||||
|
||||
var onFocusValue = function(selectedNode) {
|
||||
var fontSize = selectedNode.getFontSize();
|
||||
var result = "";
|
||||
if (fontSize <= 6) {
|
||||
result = 'small';
|
||||
} else if (fontSize <= 8) {
|
||||
result = 'normal';
|
||||
} else if (fontSize <= 10) {
|
||||
result = 'large';
|
||||
} else if (fontSize >= 15) {
|
||||
result = 'huge';
|
||||
jsRecLoad(jsUrls);
|
||||
},
|
||||
onFailure: function() {
|
||||
console.log('Sorry, your request failed :(');
|
||||
}
|
||||
return result;
|
||||
};
|
||||
buildPanel('fontSize', 'fontSizePanel', shapeTypePanel, updateFunction, onFocusValue);
|
||||
}
|
||||
|
||||
function buildPanel(buttonElemId, elemLinksContainer, elemLinkIds, updateFunction, onFocusValue) {
|
||||
// Font family event handling ....
|
||||
$(buttonElemId).addEvent('click', function(event) {
|
||||
var container = $(elemLinksContainer);
|
||||
var isRendered = container.getStyle('display') == 'block';
|
||||
cleanScreenEvent();
|
||||
|
||||
// Restore default css.
|
||||
for (var i = 0; i < elemLinkIds.length; i++) {
|
||||
var elementId = elemLinkIds[i];
|
||||
$(elementId).className = 'toolbarPanelLink';
|
||||
}
|
||||
|
||||
// Select current element ...
|
||||
var nodes = designer.getSelectedNodes();
|
||||
var lenght = nodes.length;
|
||||
if (lenght == 1) {
|
||||
var selectedNode = nodes[0];
|
||||
var selectedElementId = onFocusValue(selectedNode);
|
||||
selectedElementId = selectedElementId.toLowerCase();
|
||||
var selectedElement = $(selectedElementId);
|
||||
selectedElement.className = 'toolbarPanelLinkSelectedLink';
|
||||
}
|
||||
|
||||
container.setStyle('display', 'block');
|
||||
|
||||
var mouseCoords = core.Utils.getMousePosition(event);
|
||||
if (!isRendered) {
|
||||
container.setStyle('left', (mouseCoords.x - 10) + "px");
|
||||
}
|
||||
|
||||
});
|
||||
request.send();
|
||||
|
||||
var fontOnClick = function(event) {
|
||||
var value = this.getAttribute('id');
|
||||
updateFunction(value);
|
||||
cleanScreenEvent();
|
||||
};
|
||||
}
|
||||
|
||||
// Register event listeners on elements ...
|
||||
for (var i = 0; i < elemLinkIds.length; i++) {
|
||||
var elementId = elemLinkIds[i];
|
||||
$(elementId).addEvent('click', fontOnClick.bind($(elementId)));
|
||||
}
|
||||
var localEnv = true;
|
||||
if (localEnv) {
|
||||
Asset.javascript("../../../../../web2d/target/classes/web2d.svg-min.js", {
|
||||
onLoad: function() {
|
||||
JSPomLoader('../../../../../mindplot/pom.xml', afterMindpotLibraryLoading)
|
||||
}
|
||||
});
|
||||
} else {
|
||||
Asset.javascript("../js/mindplot.svg.js", {
|
||||
onLoad: function() {
|
||||
afterMindpotLibraryLoading();
|
||||
}
|
||||
});
|
||||
}
|
16
wise-doc/src/main/webapp/js/jsapi.nocache.js
Normal file
16
wise-doc/src/main/webapp/js/jsapi.nocache.js
Normal file
@ -0,0 +1,16 @@
|
||||
function jsapi(){var L='',ec='\n-',sb='" for "gwt:onLoadErrorFn"',qb='" for "gwt:onPropertyErrorFn"',Tb='"<script src=\\"',eb='"><\/script>',V='#',dc=');',Xb='-\n',fc='-><\/scr',Ub='.cache.js\\"><\/scr" + "ipt>"',X='/',Kb='15E29CA8DC1A1C8B011D7C585C4B973A',Lb='4EB28EA94ADC3D2A72B265B7E1F49499',Mb='5BEC632F6A7363F01782687E72EA6800',Nb='5FE13ACCADA904725EF2CCBB12308628',Ob='6C98EFA9BBD2AAF79BC20EE641A805FF',Pb='9681D35AB367AC97C6F502FCBD81A95B',Qb=':',kb='::',Vb='<scr',db='<script id="',nb='=',W='?',xb='ActiveXObject',pb='Bad handler "',yb='ChromeTab.ChromeFrame',Hb='Cross-site hosted mode not yet implemented. See issue ',Rb='DOMContentLoaded',fb='SCRIPT',cb='__gwt_marker_jsapi',gb='base',$='baseUrl',P='begin',O='bootstrap',wb='chromeframe',Z='clear.cache.gif',mb='content',cc='document.write(',U='end',$b='evtGroup: "loadExternalRefs", millis:(new Date()).getTime(),',ac='evtGroup: "moduleStartup", millis:(new Date()).getTime(),',Eb='gecko',Fb='gecko1_8',Q='gwt.codesvr=',R='gwt.hosted=',S='gwt.hybrid',rb='gwt:onLoadErrorFn',ob='gwt:onPropertyErrorFn',lb='gwt:property',Ib='http://code.google.com/p/google-web-toolkit/issues/detail?id=2079',Db='ie6',Cb='ie8',Bb='ie9',Y='img',gc='ipt>',Wb='ipt><!-',M='jsapi',ab='jsapi.nocache.js',jb='jsapi::',Sb='loadExternalRefs',hb='meta',Zb='moduleName:"jsapi", sessionId:window.__gwtStatsSessionId, subSystem:"startup",',T='moduleStartup',Ab='msie',ib='name',ub='opera',zb='safari',_='script',Jb='selectingPermutation',N='startup',_b='type: "end"});',bc='type: "moduleRequested"});',bb='undefined',Gb='unknown',tb='user.agent',vb='webkit',Yb='window.__gwtStatsEvent && window.__gwtStatsEvent({';var l=window,m=document,n=l.__gwtStatsEvent?function(a){return l.__gwtStatsEvent(a)}:null,o=l.__gwtStatsSessionId?l.__gwtStatsSessionId:null,p,q,r=L,s={},t=[],u=[],v=[],w=0,x,y;n&&n({moduleName:M,sessionId:o,subSystem:N,evtGroup:O,millis:(new Date).getTime(),type:P});if(!l.__gwt_stylesLoaded){l.__gwt_stylesLoaded={}}if(!l.__gwt_scriptsLoaded){l.__gwt_scriptsLoaded={}}function z(){var b=false;try{var c=l.location.search;return (c.indexOf(Q)!=-1||(c.indexOf(R)!=-1||l.external&&l.external.gwtOnLoad))&&c.indexOf(S)==-1}catch(a){}z=function(){return b};return b}
|
||||
function A(){if(p&&q){p(x,M,r,w);n&&n({moduleName:M,sessionId:o,subSystem:N,evtGroup:T,millis:(new Date).getTime(),type:U})}}
|
||||
function B(){function e(a){var b=a.lastIndexOf(V);if(b==-1){b=a.length}var c=a.indexOf(W);if(c==-1){c=a.length}var d=a.lastIndexOf(X,Math.min(c,b));return d>=0?a.substring(0,d+1):L}
|
||||
function f(a){if(a.match(/^\w+:\/\//)){}else{var b=m.createElement(Y);b.src=a+Z;a=e(b.src)}return a}
|
||||
function g(){var a=D($);if(a!=null){return a}return L}
|
||||
function h(){var a=m.getElementsByTagName(_);for(var b=0;b<a.length;++b){if(a[b].src.indexOf(ab)!=-1){return e(a[b].src)}}return L}
|
||||
function i(){var a;if(typeof isBodyLoaded==bb||!isBodyLoaded()){var b=cb;var c;m.write(db+b+eb);c=m.getElementById(b);a=c&&c.previousSibling;while(a&&a.tagName!=fb){a=a.previousSibling}if(c){c.parentNode.removeChild(c)}if(a&&a.src){return e(a.src)}}return L}
|
||||
function j(){var a=m.getElementsByTagName(gb);if(a.length>0){return a[a.length-1].href}return L}
|
||||
var k=g();if(k==L){k=h()}if(k==L){k=i()}if(k==L){k=j()}if(k==L){k=e(m.location.href)}k=f(k);r=k;return k}
|
||||
function C(){var b=document.getElementsByTagName(hb);for(var c=0,d=b.length;c<d;++c){var e=b[c],f=e.getAttribute(ib),g;if(f){f=f.replace(jb,L);if(f.indexOf(kb)>=0){continue}if(f==lb){g=e.getAttribute(mb);if(g){var h,i=g.indexOf(nb);if(i>=0){f=g.substring(0,i);h=g.substring(i+1)}else{f=g;h=L}s[f]=h}}else if(f==ob){g=e.getAttribute(mb);if(g){try{y=eval(g)}catch(a){alert(pb+g+qb)}}}else if(f==rb){g=e.getAttribute(mb);if(g){try{x=eval(g)}catch(a){alert(pb+g+sb)}}}}}}
|
||||
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 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)}}}
|
||||
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)}
|
||||
jsapi();
|
@ -1,6 +1,6 @@
|
||||
// MooTools: the javascript framework.
|
||||
// Load this file's selection again by visiting: http://mootools.net/more/a6e9cfc60901e7c04a3ebf1805354b50
|
||||
// Or build this file again with packager using: packager build More/More More/String.Extras More/URI More/URI.Relative More/Hash More/Hash.Extras More/Fx.Elements More/Fx.Accordion More/Fx.Move More/Fx.Reveal More/Fx.Scroll More/Fx.Slide More/Fx.SmoothScroll More/Fx.Sort More/Drag More/Drag.Move More/Color
|
||||
// Load this file's selection again by visiting: http://mootools.net/more/979a28b1cc76ab15b6da1704eb6e4c2c
|
||||
// Or build this file again with packager using: packager build More/More More/String.Extras More/URI More/URI.Relative More/Hash More/Hash.Extras More/Fx.Elements More/Fx.Accordion More/Fx.Move More/Fx.Reveal More/Fx.Scroll More/Fx.Slide More/Fx.SmoothScroll More/Fx.Sort More/Drag More/Drag.Move More/Assets More/Color More/Locale
|
||||
/*
|
||||
---
|
||||
copyrights:
|
||||
@ -215,16 +215,34 @@ if(c.getStyle("position")=="fixed"){var a=window.getScroll();b.left+=a.x;b.right
|
||||
var b=this.mouse.now;return(b.x>d.left&&b.x<d.right&&b.y<d.bottom&&b.y>d.top);},this).getLast();if(this.overed!=a){if(this.overed){this.fireEvent("leave",[this.element,this.overed]);
|
||||
}if(a){this.fireEvent("enter",[this.element,a]);}this.overed=a;}},drag:function(a){this.parent(a);if(this.options.checkDroppables&&this.droppables.length){this.checkDroppables();
|
||||
}},stop:function(a){this.checkDroppables();this.fireEvent("drop",[this.element,this.overed,a]);this.overed=null;return this.parent(a);}});Element.implement({makeDraggable:function(a){var b=new Drag.Move(this,a);
|
||||
this.store("dragger",b);return b;}});(function(){var a=this.Color=new Type("Color",function(c,d){if(arguments.length>=3){d="rgb";c=Array.slice(arguments,0,3);
|
||||
}else{if(typeof c=="string"){if(c.match(/rgb/)){c=c.rgbToHex().hexToRgb(true);}else{if(c.match(/hsb/)){c=c.hsbToRgb();}else{c=c.hexToRgb(true);}}}}d=d||"rgb";
|
||||
switch(d){case"hsb":var b=c;c=c.hsbToRgb();c.hsb=b;break;case"hex":c=c.hexToRgb(true);break;}c.rgb=c.slice(0,3);c.hsb=c.hsb||c.rgbToHsb();c.hex=c.rgbToHex();
|
||||
return Object.append(c,this);});a.implement({mix:function(){var b=Array.slice(arguments);var d=(typeOf(b.getLast())=="number")?b.pop():50;var c=this.slice();
|
||||
b.each(function(e){e=new a(e);for(var f=0;f<3;f++){c[f]=Math.round((c[f]/100*(100-d))+(e[f]/100*d));}});return new a(c,"rgb");},invert:function(){return new a(this.map(function(b){return 255-b;
|
||||
}));},setHue:function(b){return new a([b,this.hsb[1],this.hsb[2]],"hsb");},setSaturation:function(b){return new a([this.hsb[0],b,this.hsb[2]],"hsb");},setBrightness:function(b){return new a([this.hsb[0],this.hsb[1],b],"hsb");
|
||||
this.store("dragger",b);return b;}});var Asset={javascript:function(f,c){if(!c){c={};}var a=new Element("script",{src:f,type:"text/javascript"}),g=c.document||document,b=0,d=c.onload||c.onLoad;
|
||||
var e=d?function(){if(++b==1){d.call(this);}}:function(){};delete c.onload;delete c.onLoad;delete c.document;return a.addEvents({load:e,readystatechange:function(){if(["loaded","complete"].contains(this.readyState)){e.call(this);
|
||||
}}}).set(c).inject(g.head);},css:function(d,a){if(!a){a={};}var b=new Element("link",{rel:"stylesheet",media:"screen",type:"text/css",href:d});var c=a.onload||a.onLoad,e=a.document||document;
|
||||
delete a.onload;delete a.onLoad;delete a.document;if(c){b.addEvent("load",c);}return b.set(a).inject(e.head);},image:function(c,b){if(!b){b={};}var d=new Image(),a=document.id(d)||new Element("img");
|
||||
["load","abort","error"].each(function(e){var g="on"+e,f="on"+e.capitalize(),h=b[g]||b[f]||function(){};delete b[f];delete b[g];d[g]=function(){if(!d){return;
|
||||
}if(!a.parentNode){a.width=d.width;a.height=d.height;}d=d.onload=d.onabort=d.onerror=null;h.delay(1,a,a);a.fireEvent(e,a,1);};});d.src=a.src=c;if(d&&d.complete){d.onload.delay(1);
|
||||
}return a.set(b);},images:function(c,b){c=Array.from(c);var d=function(){},a=0;b=Object.merge({onComplete:d,onProgress:d,onError:d,properties:{}},b);return new Elements(c.map(function(f,e){return Asset.image(f,Object.append(b.properties,{onload:function(){a++;
|
||||
b.onProgress.call(this,a,e,f);if(a==c.length){b.onComplete();}},onerror:function(){a++;b.onError.call(this,a,e,f);if(a==c.length){b.onComplete();}}}));
|
||||
}));}};(function(){var a=this.Color=new Type("Color",function(c,d){if(arguments.length>=3){d="rgb";c=Array.slice(arguments,0,3);}else{if(typeof c=="string"){if(c.match(/rgb/)){c=c.rgbToHex().hexToRgb(true);
|
||||
}else{if(c.match(/hsb/)){c=c.hsbToRgb();}else{c=c.hexToRgb(true);}}}}d=d||"rgb";switch(d){case"hsb":var b=c;c=c.hsbToRgb();c.hsb=b;break;case"hex":c=c.hexToRgb(true);
|
||||
break;}c.rgb=c.slice(0,3);c.hsb=c.hsb||c.rgbToHsb();c.hex=c.rgbToHex();return Object.append(c,this);});a.implement({mix:function(){var b=Array.slice(arguments);
|
||||
var d=(typeOf(b.getLast())=="number")?b.pop():50;var c=this.slice();b.each(function(e){e=new a(e);for(var f=0;f<3;f++){c[f]=Math.round((c[f]/100*(100-d))+(e[f]/100*d));
|
||||
}});return new a(c,"rgb");},invert:function(){return new a(this.map(function(b){return 255-b;}));},setHue:function(b){return new a([b,this.hsb[1],this.hsb[2]],"hsb");
|
||||
},setSaturation:function(b){return new a([this.hsb[0],b,this.hsb[2]],"hsb");},setBrightness:function(b){return new a([this.hsb[0],this.hsb[1],b],"hsb");
|
||||
}});this.$RGB=function(e,d,c){return new a([e,d,c],"rgb");};this.$HSB=function(e,d,c){return new a([e,d,c],"hsb");};this.$HEX=function(b){return new a(b,"hex");
|
||||
};Array.implement({rgbToHsb:function(){var c=this[0],d=this[1],k=this[2],h=0;var j=Math.max(c,d,k),f=Math.min(c,d,k);var l=j-f;var i=j/255,g=(j!=0)?l/j:0;
|
||||
if(g!=0){var e=(j-c)/l;var b=(j-d)/l;var m=(j-k)/l;if(c==j){h=m-b;}else{if(d==j){h=2+e-m;}else{h=4+b-e;}}h/=6;if(h<0){h++;}}return[Math.round(h*360),Math.round(g*100),Math.round(i*100)];
|
||||
},hsbToRgb:function(){var d=Math.round(this[2]/100*255);if(this[1]==0){return[d,d,d];}else{var b=this[0]%360;var g=b%60;var h=Math.round((this[2]*(100-this[1]))/10000*255);
|
||||
var e=Math.round((this[2]*(6000-this[1]*g))/600000*255);var c=Math.round((this[2]*(6000-this[1]*(60-g)))/600000*255);switch(Math.floor(b/60)){case 0:return[d,c,h];
|
||||
case 1:return[e,d,h];case 2:return[h,d,c];case 3:return[h,e,d];case 4:return[c,h,d];case 5:return[d,h,e];}}return false;}});String.implement({rgbToHsb:function(){var b=this.match(/\d{1,3}/g);
|
||||
return(b)?b.rgbToHsb():null;},hsbToRgb:function(){var b=this.match(/\d{1,3}/g);return(b)?b.hsbToRgb():null;}});})();
|
||||
return(b)?b.rgbToHsb():null;},hsbToRgb:function(){var b=this.match(/\d{1,3}/g);return(b)?b.hsbToRgb():null;}});})();(function(){var b=null,a={},e={};var d=function(g){if(instanceOf(g,f.Set)){return g;
|
||||
}else{return a[g];}};var f=this.Locale={define:function(g,k,i,j){var h;if(instanceOf(g,f.Set)){h=g.name;if(h){a[h]=g;}}else{h=g;if(!a[h]){a[h]=new f.Set(h);
|
||||
}g=a[h];}if(k){g.define(k,i,j);}if(k=="cascade"){return f.inherit(h,i);}if(!b){b=g;}return g;},use:function(g){g=d(g);if(g){b=g;this.fireEvent("change",g);
|
||||
this.fireEvent("langChange",g.name);}return this;},getCurrent:function(){return b;},get:function(h,g){return(b)?b.get(h,g):"";},inherit:function(g,h,i){g=d(g);
|
||||
if(g){g.inherit(h,i);}return this;},list:function(){return Object.keys(a);}};Object.append(f,new Events);f.Set=new Class({sets:{},inherits:{locales:[],sets:{}},initialize:function(g){this.name=g||"";
|
||||
},define:function(j,h,i){var g=this.sets[j];if(!g){g={};}if(h){if(typeOf(h)=="object"){g=Object.merge(g,h);}else{g[h]=i;}}this.sets[j]=g;return this;},get:function(s,k,r){var q=Object.getFromPath(this.sets,s);
|
||||
if(q!=null){var n=typeOf(q);if(n=="function"){q=q.apply(null,Array.from(k));}else{if(n=="object"){q=Object.clone(q);}}return q;}var j=s.indexOf("."),p=j<0?s:s.substr(0,j),m=(this.inherits.sets[p]||[]).combine(this.inherits.locales).include("en-US");
|
||||
if(!r){r=[];}for(var h=0,g=m.length;h<g;h++){if(r.contains(m[h])){continue;}r.include(m[h]);var o=a[m[h]];if(!o){continue;}q=o.get(s,k,r);if(q!=null){return q;
|
||||
}}return"";},inherit:function(h,i){h=Array.from(h);if(i&&!this.inherits.sets[i]){this.inherits.sets[i]=[];}var g=h.length;while(g--){(i?this.inherits.sets[i]:this.inherits.locales).unshift(h[g]);
|
||||
}return this;}});var c=MooTools.lang={};Object.append(c,f,{setLanguage:f.use,getCurrentLanguage:function(){var g=f.getCurrent();return(g)?g.name:null;},set:function(){f.define.apply(this,arguments);
|
||||
return this;},get:function(i,h,g){if(h){i+="."+h;}return f.get(i,g);}});})();
|
@ -1,128 +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.
|
||||
*/
|
||||
|
||||
var IconPanel = new Class({
|
||||
Implements:[Options,Events],
|
||||
options:{
|
||||
width:253,
|
||||
initialWidth:0,
|
||||
height:200,
|
||||
content:null,
|
||||
panel:null,
|
||||
button:null,
|
||||
onStart:Class.empty,
|
||||
state:'close'
|
||||
},
|
||||
|
||||
initialize:function(options) {
|
||||
this.setOptions(options);
|
||||
if ($defined(this.options.button)) {
|
||||
this.init();
|
||||
}
|
||||
},
|
||||
|
||||
setButton:function(button) {
|
||||
this.options.button = button;
|
||||
},
|
||||
|
||||
init:function() {
|
||||
var panel = new Element('div');
|
||||
var coord = this.options.button.getCoordinates();
|
||||
var top = this.options.button.getTop() + coord.height + 2;
|
||||
var left = this.options.button.getLeft();
|
||||
panel.setStyles({
|
||||
width:this.options.initialWidth,
|
||||
height:0,position:'absolute',
|
||||
top:top,
|
||||
left:left,
|
||||
background:'#e5e5e5',
|
||||
border:'1px solid #BBB4D6',
|
||||
zIndex:20,
|
||||
overflow:'hidden'}
|
||||
);
|
||||
|
||||
this.options.panel = panel;
|
||||
this.options.content.inject(panel);
|
||||
|
||||
this.options.content.addEvent('click', function(event) {
|
||||
this.close();
|
||||
}.bind(this));
|
||||
|
||||
panel.setStyle('opacity', 0);
|
||||
panel.inject($(document.body));
|
||||
this.registerOpenPanel();
|
||||
},
|
||||
|
||||
open:function() {
|
||||
if (this.options.state == 'close') {
|
||||
if (!$defined(this.options.panel)) {
|
||||
this.init();
|
||||
}
|
||||
|
||||
var panel = this.options.panel;
|
||||
panel.setStyles({border: '1px solid #636163', opacity:100});
|
||||
this.fireEvent('onStart');
|
||||
|
||||
// Resize dialog to show a cool effect ;)
|
||||
panel.set('morph', {duration: 'long', transition: 'bounce:out'});
|
||||
panel.morph({
|
||||
height:[0,this.options.height],
|
||||
width:[this.options.initialWidth, this.options.width]
|
||||
});
|
||||
panel.addEvent('complete', function() {
|
||||
this.registerClosePanel();
|
||||
}.bind(this));
|
||||
|
||||
this.options.state = 'open';
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
close:function() {
|
||||
if (this.options.state == 'open') {
|
||||
|
||||
// Magic, disappear effect ;)
|
||||
var panel = this.options.panel;
|
||||
panel.set('morph', {duration: 'long', transition: 'bounce:in'});
|
||||
panel.morph({
|
||||
height:[this.options.height,0],
|
||||
width:[this.options.width, this.options.initialWidth]
|
||||
});
|
||||
panel.addEvent('complete', function() {
|
||||
this.options.panel.setStyles({border: '1px solid transparent', opacity:0});
|
||||
this.registerOpenPanel();
|
||||
}.bind(this));
|
||||
|
||||
this.options.state = 'close';
|
||||
}
|
||||
},
|
||||
|
||||
registerOpenPanel:function() {
|
||||
this.options.button.removeEvents('click');
|
||||
this.options.button.addEvent('click', function(event) {
|
||||
this.open();
|
||||
}.bindWithEvent(this));
|
||||
},
|
||||
|
||||
registerClosePanel:function() {
|
||||
this.options.button.removeEvents('click');
|
||||
this.options.button.addEvent('click', function(event) {
|
||||
this.close();
|
||||
}.bindWithEvent(this));
|
||||
}
|
||||
});
|
@ -1,23 +1,26 @@
|
||||
/*
|
||||
* 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.
|
||||
* 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.
|
||||
*/
|
||||
|
||||
|
||||
$import("../js/mindplot.svg.js");
|
||||
Asset.javascript('../js/mindplot.svg.js', {
|
||||
id: 'MindplotSVGLib',
|
||||
onLoad: function() {
|
||||
afterMindpotLibraryLoading();
|
||||
}
|
||||
});
|
||||
|
||||
var designer = null;
|
||||
/* JavaScript tabs changer */
|
||||
@ -76,8 +79,7 @@ Tabs = {
|
||||
if (div.className.match(/\btabContent\b/i)) {
|
||||
if (div.id == "_" + contentId)
|
||||
div.style.display = "block";
|
||||
else
|
||||
{
|
||||
else {
|
||||
divsToHide.push(div);
|
||||
}
|
||||
}
|
||||
@ -102,8 +104,7 @@ Tabs = {
|
||||
},
|
||||
|
||||
Init: function () {
|
||||
if (!document.getElementsByTagName)
|
||||
{
|
||||
if (!document.getElementsByTagName) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -158,18 +159,15 @@ var contentId = window.location.hash || "#Introduction";
|
||||
|
||||
var iconPanel = null;
|
||||
|
||||
function afterMindpotLibraryLoading()
|
||||
{
|
||||
function afterMindpotLibraryLoading() {
|
||||
buildMindmapDesigner();
|
||||
|
||||
if ($('helpButton') != null)
|
||||
{
|
||||
if ($('helpButton') != null) {
|
||||
var helpPanel = new Panel({panelButton:$('helpButton'), backgroundColor:'black'});
|
||||
helpPanel.setContent(Help.buildHelp(helpPanel));
|
||||
}
|
||||
|
||||
if ($('helpButtonFirstSteps') != null)
|
||||
{
|
||||
if ($('helpButtonFirstSteps') != null) {
|
||||
var firstStepsPanel = $('helpButtonFirstSteps')
|
||||
firstStepsPanel.addEvent('click', function(event) {
|
||||
var firstStepWindow = window.open("firststeps.htm", "WiseMapping", "width=100px, height=100px");
|
||||
@ -179,16 +177,19 @@ function afterMindpotLibraryLoading()
|
||||
});
|
||||
}
|
||||
|
||||
if ($('helpButtonKeyboard') != null)
|
||||
{
|
||||
if ($('helpButtonKeyboard') != null) {
|
||||
var keyboardPanel = $('helpButtonKeyboard')
|
||||
keyboardPanel.addEvent('click', function(event) {
|
||||
MOOdalBox.open('keyboard.htm', 'KeyBoard Shortcuts', '500px 400px', false)
|
||||
});
|
||||
}
|
||||
|
||||
var iconChooser = buildIconChooser();
|
||||
iconPanel = new IconPanel({button:$('topicIcon'), onStart:cleanScreenEvent, content:iconChooser});
|
||||
// Crate icon panel dialog ...
|
||||
iconPanel = new mindplot.widget.IconPanel({button:$('topicIcon'), onStart:cleanScreenEvent});
|
||||
iconPanel.addEvent("selected", function(event) {
|
||||
designer.addIconType2SelectedNode(event.iconType);
|
||||
});
|
||||
|
||||
// Register Events ...
|
||||
$(document).addEvent('keydown', designer.keyEventHandler.bindWithEvent(designer));
|
||||
$("ffoxWorkarroundInput").addEvent('keydown', designer.keyEventHandler.bindWithEvent(designer));
|
||||
@ -208,20 +209,17 @@ function afterMindpotLibraryLoading()
|
||||
$('redoEdition').addEvent('click', function(event) {
|
||||
designer.redo();
|
||||
});
|
||||
designer.addEventListener("change", function(event) {
|
||||
if (event.undoSteps > 0)
|
||||
{
|
||||
|
||||
designer.addEventListener("modelUpdate", function(event) {
|
||||
if (event.undoSteps > 0) {
|
||||
$("undoEdition").setStyle("background-image", "url(../images/file_undo.png)");
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
$("undoEdition").setStyle("background-image", "url(../images/file_undo_dis.png)");
|
||||
}
|
||||
|
||||
if (event.redoSteps > 0)
|
||||
{
|
||||
if (event.redoSteps > 0) {
|
||||
$("redoEdition").setStyle("background-image", "url(../images/file_redo.png)");
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
$("redoEdition").setStyle("background-image", "url(../images/file_redo_dis.png)");
|
||||
}
|
||||
|
||||
@ -230,10 +228,11 @@ function afterMindpotLibraryLoading()
|
||||
$('addTopic').addEvent('click', function(event) {
|
||||
designer.createSiblingForSelectedNode();
|
||||
});
|
||||
|
||||
$('deleteTopic').addEvent('click', function(event) {
|
||||
var topics = designer.getSelectedNodes();
|
||||
designer.deleteCurrentNode();
|
||||
});
|
||||
|
||||
var context = this;
|
||||
var colorPicker1 = new MooRainbow('topicColor', {
|
||||
id: 'topicColor',
|
||||
@ -250,6 +249,7 @@ function afterMindpotLibraryLoading()
|
||||
removeCurrentColorPicker.attempt(colorPicker1, context);
|
||||
}
|
||||
});
|
||||
|
||||
var colorPicker2 = new MooRainbow('topicBorder', {
|
||||
id: 'topicBorder',
|
||||
imgPath: '../images/',
|
||||
@ -265,6 +265,7 @@ function afterMindpotLibraryLoading()
|
||||
removeCurrentColorPicker.attempt(colorPicker2, context);
|
||||
}
|
||||
});
|
||||
|
||||
$('topicLink').addEvent('click', function(event) {
|
||||
designer.addLink2SelectedNode();
|
||||
|
||||
@ -279,7 +280,6 @@ function afterMindpotLibraryLoading()
|
||||
|
||||
});
|
||||
|
||||
|
||||
$('fontBold').addEvent('click', function(event) {
|
||||
designer.setWeight2SelectedNode();
|
||||
});
|
||||
@ -308,101 +308,87 @@ function afterMindpotLibraryLoading()
|
||||
var saveButton = $('saveButton');
|
||||
saveButton.addEvent('click', function(event) {
|
||||
|
||||
if (!isTryMode)
|
||||
{
|
||||
if (!isTryMode) {
|
||||
saveButton.setStyle('cursor', 'wait');
|
||||
var saveFunc = function()
|
||||
{
|
||||
designer.save(function()
|
||||
{
|
||||
var saveFunc = function() {
|
||||
designer.save(function() {
|
||||
var monitor = core.Monitor.getInstance();
|
||||
monitor.logMessage('Save completed successfully');
|
||||
saveButton.setStyle('cursor', 'pointer');
|
||||
}, true);
|
||||
}
|
||||
saveFunc.delay(1);
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
new Windoo.Confirm('This option is not enabled in try mode. You must by signed in order to execute this action.<br/> to create an account click <a href="userRegistration.htm">here</a>',
|
||||
{
|
||||
'window': {theme:Windoo.Themes.wise,
|
||||
title:''
|
||||
}
|
||||
});
|
||||
{
|
||||
'window': {theme:Windoo.Themes.wise,
|
||||
title:''
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
var discardButton = $('discardButton');
|
||||
discardButton.addEvent('click', function(event) {
|
||||
|
||||
if (!isTryMode)
|
||||
{
|
||||
if (!isTryMode) {
|
||||
displayLoading();
|
||||
window.document.location = "mymaps.htm";
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
displayLoading();
|
||||
window.document.location = "home.htm";
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
if (isTryMode)
|
||||
{
|
||||
$('tagIt').addEvent('click', function(event)
|
||||
{
|
||||
if (isTryMode) {
|
||||
$('tagIt').addEvent('click', function(event) {
|
||||
new Windoo.Confirm('This option is not enabled in try mode. You must by signed in order to execute this action.',
|
||||
{
|
||||
'window': {theme:Windoo.Themes.wise,
|
||||
title:''
|
||||
}
|
||||
});
|
||||
{
|
||||
'window': {theme:Windoo.Themes.wise,
|
||||
title:''
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$('shareIt').addEvent('click', function(event)
|
||||
{
|
||||
$('shareIt').addEvent('click', function(event) {
|
||||
new Windoo.Confirm('This option is not enabled in try mode. You must by signed in order to execute this action.',
|
||||
{
|
||||
'window': {theme:Windoo.Themes.wise,
|
||||
title:''
|
||||
}
|
||||
});
|
||||
{
|
||||
'window': {theme:Windoo.Themes.wise,
|
||||
title:''
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$('publishIt').addEvent('click', function(event)
|
||||
{
|
||||
$('publishIt').addEvent('click', function(event) {
|
||||
new Windoo.Confirm('This option is not enabled in try mode. You must by signed in order to execute this action.',
|
||||
{
|
||||
'window': {theme:Windoo.Themes.wise,
|
||||
title:''
|
||||
}
|
||||
});
|
||||
{
|
||||
'window': {theme:Windoo.Themes.wise,
|
||||
title:''
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$('history').addEvent('click', function(event)
|
||||
{
|
||||
$('history').addEvent('click', function(event) {
|
||||
new Windoo.Confirm('This option is not enabled in try mode. You must by signed in order to execute this action.',
|
||||
{
|
||||
'window': {theme:Windoo.Themes.wise,
|
||||
title:''
|
||||
}
|
||||
});
|
||||
{
|
||||
'window': {theme:Windoo.Themes.wise,
|
||||
title:''
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// Autosave ...
|
||||
if (!isTryMode)
|
||||
{
|
||||
if (!isTryMode) {
|
||||
var autosave = function() {
|
||||
|
||||
if (designer.needsSave())
|
||||
{
|
||||
designer.save(function()
|
||||
{
|
||||
if (designer.needsSave()) {
|
||||
designer.save(function() {
|
||||
var monitor = core.Monitor.getInstance();
|
||||
}, false);
|
||||
}
|
||||
@ -410,74 +396,35 @@ function afterMindpotLibraryLoading()
|
||||
autosave.periodical(30000);
|
||||
|
||||
// To prevent the user from leaving the page with changes ...
|
||||
window.onbeforeunload = function confirmExit()
|
||||
{
|
||||
if (designer.needsSave())
|
||||
{
|
||||
window.onbeforeunload = function() {
|
||||
if (designer.needsSave()) {
|
||||
designer.save(null, false)
|
||||
}
|
||||
}
|
||||
}
|
||||
// Build panels ...
|
||||
fontFamilyPanel();
|
||||
shapeTypePanel();
|
||||
fontSizePanel();
|
||||
var fontPanel = new mindplot.widget.FontFamilyPanel();
|
||||
// shapeTypePanel();
|
||||
// fontSizePanel();
|
||||
|
||||
// If not problem has occured, I close the dialod ...
|
||||
var closeDialog = function(){
|
||||
var closeDialog = function() {
|
||||
|
||||
if(!window.hasUnexpectedErrors)
|
||||
{
|
||||
if (!window.hasUnexpectedErrors) {
|
||||
waitDialog.deactivate();
|
||||
}
|
||||
}.delay(500);
|
||||
}
|
||||
|
||||
function buildIconChooser() {
|
||||
var content = new Element('div').setStyles({width:253,height:200,padding:5});
|
||||
var count = 0;
|
||||
for (var i = 0; i < mindplot.ImageIcon.prototype.ICON_FAMILIES.length; i = i + 1)
|
||||
{
|
||||
var familyIcons = mindplot.ImageIcon.prototype.ICON_FAMILIES[i].icons;
|
||||
for (var j = 0; j < familyIcons.length; j = j + 1)
|
||||
{
|
||||
// Separate icons by line ...
|
||||
var familyContent;
|
||||
if ((count % 12) == 0)
|
||||
{
|
||||
familyContent = new Element('div').inject(content);
|
||||
}
|
||||
|
||||
|
||||
var iconId = familyIcons[j];
|
||||
var img = new Element('img').setStyles({width:16,height:16,padding:"0px 2px"}).inject(familyContent);
|
||||
img.id = iconId;
|
||||
img.src = mindplot.ImageIcon.prototype._getImageUrl(iconId);
|
||||
img.addEvent('click', function(event, id) {
|
||||
designer.addImage2SelectedNode(this.id);
|
||||
}.bindWithEvent(img));
|
||||
count = count + 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return content;
|
||||
}
|
||||
;
|
||||
|
||||
|
||||
function setCurrentColorPicker(colorPicker)
|
||||
{
|
||||
function setCurrentColorPicker(colorPicker) {
|
||||
this.currentColorPicker = colorPicker;
|
||||
}
|
||||
|
||||
function removeCurrentColorPicker(colorPicker)
|
||||
{
|
||||
function removeCurrentColorPicker(colorPicker) {
|
||||
$clear(this.currentColorPicker);
|
||||
}
|
||||
|
||||
function buildMindmapDesigner()
|
||||
{
|
||||
function buildMindmapDesigner() {
|
||||
|
||||
// Initialize message logger ...
|
||||
var monitor = new core.Monitor($('msgLoggerContainer'), $('msgLogger'));
|
||||
@ -506,19 +453,16 @@ function buildMindmapDesigner()
|
||||
|
||||
|
||||
// Save map on load ....
|
||||
if (editorProperties.saveOnLoad)
|
||||
{
|
||||
if (editorProperties.saveOnLoad) {
|
||||
var saveOnLoad = function() {
|
||||
designer.save(function() {
|
||||
}, false);
|
||||
}.delay(1000)
|
||||
}
|
||||
|
||||
}
|
||||
;
|
||||
};
|
||||
|
||||
function createColorPalette(container, onSelectFunction, event)
|
||||
{
|
||||
function createColorPalette(container, onSelectFunction, event) {
|
||||
cleanScreenEvent();
|
||||
_colorPalette = new core.ColorPicker();
|
||||
_colorPalette.onSelect = function(color) {
|
||||
@ -534,10 +478,8 @@ function createColorPalette(container, onSelectFunction, event)
|
||||
}
|
||||
;
|
||||
|
||||
function cleanScreenEvent()
|
||||
{
|
||||
if (this.currentColorPicker)
|
||||
{
|
||||
function cleanScreenEvent() {
|
||||
if (this.currentColorPicker) {
|
||||
this.currentColorPicker.hide();
|
||||
}
|
||||
$("fontFamilyPanel").setStyle('display', "none");
|
||||
@ -546,66 +488,39 @@ function cleanScreenEvent()
|
||||
iconPanel.close();
|
||||
}
|
||||
|
||||
function fontFamilyPanel()
|
||||
{
|
||||
var supportedFonts = ['times','arial','tahoma','verdana'];
|
||||
var updateFunction = function(value)
|
||||
{
|
||||
value = value.charAt(0).toUpperCase() + value.substring(1, value.length);
|
||||
designer.setFont2SelectedNode(value);
|
||||
};
|
||||
|
||||
var onFocusValue = function(selectedNode)
|
||||
{
|
||||
return selectedNode.getFontFamily();
|
||||
};
|
||||
|
||||
buildPanel('fontFamily', 'fontFamilyPanel', supportedFonts, updateFunction, onFocusValue);
|
||||
}
|
||||
|
||||
function shapeTypePanel()
|
||||
{
|
||||
function shapeTypePanel() {
|
||||
var shapeTypePanel = ['rectagle','rounded_rectagle','line','elipse'];
|
||||
var updateFunction = function(value)
|
||||
{
|
||||
designer.setShape2SelectedNode(value.replace('_',' '));
|
||||
var updateFunction = function(value) {
|
||||
designer.setShape2SelectedNode(value.replace('_', ' '));
|
||||
};
|
||||
|
||||
var onFocusValue = function(selectedNode)
|
||||
{
|
||||
var onFocusValue = function(selectedNode) {
|
||||
|
||||
return selectedNode.getShapeType().replace(' ','_');
|
||||
return selectedNode.getShapeType().replace(' ', '_');
|
||||
};
|
||||
|
||||
buildPanel('topicShape', 'topicShapePanel', shapeTypePanel, updateFunction, onFocusValue);
|
||||
}
|
||||
|
||||
function fontSizePanel()
|
||||
{
|
||||
function fontSizePanel() {
|
||||
var shapeTypePanel = ['small','normal','large','huge'];
|
||||
var map = {small:'6',normal:'8',large:'10',huge:'15'};
|
||||
var updateFunction = function(value)
|
||||
{
|
||||
var updateFunction = function(value) {
|
||||
var nodes = designer.getSelectedNodes();
|
||||
var value = map[value];
|
||||
designer.setFontSize2SelectedNode(value);
|
||||
};
|
||||
|
||||
var onFocusValue = function(selectedNode)
|
||||
{
|
||||
var onFocusValue = function(selectedNode) {
|
||||
var fontSize = selectedNode.getFontSize();
|
||||
var result = "";
|
||||
if (fontSize <= 6)
|
||||
{
|
||||
if (fontSize <= 6) {
|
||||
result = 'small';
|
||||
} else if (fontSize <= 8)
|
||||
{
|
||||
} else if (fontSize <= 8) {
|
||||
result = 'normal';
|
||||
} else if (fontSize <= 10)
|
||||
{
|
||||
} else if (fontSize <= 10) {
|
||||
result = 'large';
|
||||
} else if (fontSize >= 15)
|
||||
{
|
||||
} else if (fontSize >= 15) {
|
||||
result = 'huge';
|
||||
}
|
||||
return result;
|
||||
@ -613,18 +528,15 @@ function fontSizePanel()
|
||||
buildPanel('fontSize', 'fontSizePanel', shapeTypePanel, updateFunction, onFocusValue);
|
||||
}
|
||||
|
||||
function buildPanel(buttonElemId, elemLinksContainer, elemLinkIds, updateFunction, onFocusValue)
|
||||
{
|
||||
function buildPanel(buttonElemId, elemLinksContainer, elemLinkIds, updateFunction, onFocusValue) {
|
||||
// Font family event handling ....
|
||||
$(buttonElemId).addEvent('click', function(event)
|
||||
{
|
||||
$(buttonElemId).addEvent('click', function(event) {
|
||||
var container = $(elemLinksContainer);
|
||||
var isRendered = container.getStyle('display') == 'block';
|
||||
cleanScreenEvent();
|
||||
|
||||
// Restore default css.
|
||||
for (var i = 0; i < elemLinkIds.length; i++)
|
||||
{
|
||||
for (var i = 0; i < elemLinkIds.length; i++) {
|
||||
var elementId = elemLinkIds[i];
|
||||
$(elementId).className = 'toolbarPanelLink';
|
||||
}
|
||||
@ -632,8 +544,7 @@ function buildPanel(buttonElemId, elemLinksContainer, elemLinkIds, updateFunctio
|
||||
// Select current element ...
|
||||
var nodes = designer.getSelectedNodes();
|
||||
var lenght = nodes.length;
|
||||
if (lenght == 1)
|
||||
{
|
||||
if (lenght == 1) {
|
||||
var selectedNode = nodes[0];
|
||||
var selectedElementId = onFocusValue(selectedNode);
|
||||
selectedElementId = selectedElementId.toLowerCase();
|
||||
@ -644,23 +555,20 @@ function buildPanel(buttonElemId, elemLinksContainer, elemLinkIds, updateFunctio
|
||||
container.setStyle('display', 'block');
|
||||
|
||||
var mouseCoords = core.Utils.getMousePosition(event);
|
||||
if (!isRendered)
|
||||
{
|
||||
if (!isRendered) {
|
||||
container.setStyle('left', (mouseCoords.x - 10) + "px");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
var fontOnClick = function(event)
|
||||
{
|
||||
var fontOnClick = function(event) {
|
||||
var value = this.getAttribute('id');
|
||||
updateFunction(value);
|
||||
cleanScreenEvent();
|
||||
};
|
||||
|
||||
// Register event listeners on elements ...
|
||||
for (var i = 0; i < elemLinkIds.length; i++)
|
||||
{
|
||||
for (var i = 0; i < elemLinkIds.length; i++) {
|
||||
var elementId = elemLinkIds[i];
|
||||
$(elementId).addEvent('click', fontOnClick.bind($(elementId)));
|
||||
}
|
||||
|
@ -1,30 +1,29 @@
|
||||
/*
|
||||
* 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.
|
||||
* 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.
|
||||
*/
|
||||
|
||||
function afterCoreLoading()
|
||||
{
|
||||
$import("../js/mindplot.svg-min.js");
|
||||
};
|
||||
Asset.javascript('../js/mindplot.svg.js', {
|
||||
id: 'MindplotSVGLib',
|
||||
onLoad: function() {
|
||||
afterMindpotLibraryLoading();
|
||||
}
|
||||
});
|
||||
|
||||
afterCoreLoading();
|
||||
|
||||
function afterMindpotLibraryLoading()
|
||||
{
|
||||
function afterMindpotLibraryLoading() {
|
||||
buildMindmapDesigner();
|
||||
|
||||
$('zoomIn').addEvent('click', function(event) {
|
||||
@ -39,22 +38,19 @@ function afterMindpotLibraryLoading()
|
||||
// If not problem has occured, I close the dialod ...
|
||||
var closeDialog = function() {
|
||||
|
||||
if (!window.hasUnexpectedErrors)
|
||||
{
|
||||
if (!window.hasUnexpectedErrors) {
|
||||
waitDialog.deactivate();
|
||||
}
|
||||
}.delay(500);
|
||||
|
||||
}
|
||||
|
||||
function setCurrentColorPicker(colorPicker)
|
||||
{
|
||||
function setCurrentColorPicker(colorPicker) {
|
||||
this.currentColorPicker = colorPicker;
|
||||
}
|
||||
|
||||
|
||||
function buildMindmapDesigner()
|
||||
{
|
||||
function buildMindmapDesigner() {
|
||||
|
||||
var container = $('mindplot');
|
||||
|
||||
|
@ -1,450 +0,0 @@
|
||||
/*
|
||||
---
|
||||
MooTools: the javascript framework
|
||||
|
||||
web build:
|
||||
- http://mootools.net/core/7c56cfef9dddcf170a5d68e3fb61cfd7
|
||||
|
||||
packager build:
|
||||
- packager build Core/Core Core/Array Core/String Core/Number Core/Function Core/Object Core/Event Core/Browser Core/Class Core/Class.Extras Core/Slick.Parser Core/Slick.Finder Core/Element Core/Element.Style Core/Element.Event Core/Element.Dimensions Core/Fx Core/Fx.CSS Core/Fx.Tween Core/Fx.Morph Core/Fx.Transitions Core/Request Core/Request.HTML Core/Request.JSON Core/Cookie Core/JSON Core/DOMReady Core/Swiff
|
||||
|
||||
copyrights:
|
||||
- [MooTools](http://mootools.net)
|
||||
|
||||
licenses:
|
||||
- [MIT License](http://mootools.net/license.txt)
|
||||
...
|
||||
*/
|
||||
(function(){this.MooTools={version:"1.3.2",build:"c9f1ff10e9e7facb65e9481049ed1b450959d587"};var o=this.typeOf=function(i){if(i==null){return"null";}if(i.$family){return i.$family();
|
||||
}if(i.nodeName){if(i.nodeType==1){return"element";}if(i.nodeType==3){return(/\S/).test(i.nodeValue)?"textnode":"whitespace";}}else{if(typeof i.length=="number"){if(i.callee){return"arguments";
|
||||
}if("item" in i){return"collection";}}}return typeof i;};var j=this.instanceOf=function(t,i){if(t==null){return false;}var s=t.$constructor||t.constructor;
|
||||
while(s){if(s===i){return true;}s=s.parent;}return t instanceof i;};var f=this.Function;var p=true;for(var k in {toString:1}){p=null;}if(p){p=["hasOwnProperty","valueOf","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","constructor"];
|
||||
}f.prototype.overloadSetter=function(s){var i=this;return function(u,t){if(u==null){return this;}if(s||typeof u!="string"){for(var v in u){i.call(this,v,u[v]);
|
||||
}if(p){for(var w=p.length;w--;){v=p[w];if(u.hasOwnProperty(v)){i.call(this,v,u[v]);}}}}else{i.call(this,u,t);}return this;};};f.prototype.overloadGetter=function(s){var i=this;
|
||||
return function(u){var v,t;if(s||typeof u!="string"){v=u;}else{if(arguments.length>1){v=arguments;}}if(v){t={};for(var w=0;w<v.length;w++){t[v[w]]=i.call(this,v[w]);
|
||||
}}else{t=i.call(this,u);}return t;};};f.prototype.extend=function(i,s){this[i]=s;}.overloadSetter();f.prototype.implement=function(i,s){this.prototype[i]=s;
|
||||
}.overloadSetter();var n=Array.prototype.slice;f.from=function(i){return(o(i)=="function")?i:function(){return i;};};Array.from=function(i){if(i==null){return[];
|
||||
}return(a.isEnumerable(i)&&typeof i!="string")?(o(i)=="array")?i:n.call(i):[i];};Number.from=function(s){var i=parseFloat(s);return isFinite(i)?i:null;
|
||||
};String.from=function(i){return i+"";};f.implement({hide:function(){this.$hidden=true;return this;},protect:function(){this.$protected=true;return this;
|
||||
}});var a=this.Type=function(u,t){if(u){var s=u.toLowerCase();var i=function(v){return(o(v)==s);};a["is"+u]=i;if(t!=null){t.prototype.$family=(function(){return s;
|
||||
}).hide();}}if(t==null){return null;}t.extend(this);t.$constructor=a;t.prototype.$constructor=t;return t;};var e=Object.prototype.toString;a.isEnumerable=function(i){return(i!=null&&typeof i.length=="number"&&e.call(i)!="[object Function]");
|
||||
};var q={};var r=function(i){var s=o(i.prototype);return q[s]||(q[s]=[]);};var b=function(t,x){if(x&&x.$hidden){return;}var s=r(this);for(var u=0;u<s.length;
|
||||
u++){var w=s[u];if(o(w)=="type"){b.call(w,t,x);}else{w.call(this,t,x);}}var v=this.prototype[t];if(v==null||!v.$protected){this.prototype[t]=x;}if(this[t]==null&&o(x)=="function"){m.call(this,t,function(i){return x.apply(i,n.call(arguments,1));
|
||||
});}};var m=function(i,t){if(t&&t.$hidden){return;}var s=this[i];if(s==null||!s.$protected){this[i]=t;}};a.implement({implement:b.overloadSetter(),extend:m.overloadSetter(),alias:function(i,s){b.call(this,i,this.prototype[s]);
|
||||
}.overloadSetter(),mirror:function(i){r(this).push(i);return this;}});new a("Type",a);var d=function(s,w,u){var t=(w!=Object),A=w.prototype;if(t){w=new a(s,w);
|
||||
}for(var x=0,v=u.length;x<v;x++){var B=u[x],z=w[B],y=A[B];if(z){z.protect();}if(t&&y){delete A[B];A[B]=y.protect();}}if(t){w.implement(A);}return d;};d("String",String,["charAt","charCodeAt","concat","indexOf","lastIndexOf","match","quote","replace","search","slice","split","substr","substring","toLowerCase","toUpperCase"])("Array",Array,["pop","push","reverse","shift","sort","splice","unshift","concat","join","slice","indexOf","lastIndexOf","filter","forEach","every","map","some","reduce","reduceRight"])("Number",Number,["toExponential","toFixed","toLocaleString","toPrecision"])("Function",f,["apply","call","bind"])("RegExp",RegExp,["exec","test"])("Object",Object,["create","defineProperty","defineProperties","keys","getPrototypeOf","getOwnPropertyDescriptor","getOwnPropertyNames","preventExtensions","isExtensible","seal","isSealed","freeze","isFrozen"])("Date",Date,["now"]);
|
||||
Object.extend=m.overloadSetter();Date.extend("now",function(){return +(new Date);});new a("Boolean",Boolean);Number.prototype.$family=function(){return isFinite(this)?"number":"null";
|
||||
}.hide();Number.extend("random",function(s,i){return Math.floor(Math.random()*(i-s+1)+s);});var g=Object.prototype.hasOwnProperty;Object.extend("forEach",function(i,t,u){for(var s in i){if(g.call(i,s)){t.call(u,i[s],s,i);
|
||||
}}});Object.each=Object.forEach;Array.implement({forEach:function(u,v){for(var t=0,s=this.length;t<s;t++){if(t in this){u.call(v,this[t],t,this);}}},each:function(i,s){Array.forEach(this,i,s);
|
||||
return this;}});var l=function(i){switch(o(i)){case"array":return i.clone();case"object":return Object.clone(i);default:return i;}};Array.implement("clone",function(){var s=this.length,t=new Array(s);
|
||||
while(s--){t[s]=l(this[s]);}return t;});var h=function(s,i,t){switch(o(t)){case"object":if(o(s[i])=="object"){Object.merge(s[i],t);}else{s[i]=Object.clone(t);
|
||||
}break;case"array":s[i]=t.clone();break;default:s[i]=t;}return s;};Object.extend({merge:function(z,u,t){if(o(u)=="string"){return h(z,u,t);}for(var y=1,s=arguments.length;
|
||||
y<s;y++){var w=arguments[y];for(var x in w){h(z,x,w[x]);}}return z;},clone:function(i){var t={};for(var s in i){t[s]=l(i[s]);}return t;},append:function(w){for(var v=1,t=arguments.length;
|
||||
v<t;v++){var s=arguments[v]||{};for(var u in s){w[u]=s[u];}}return w;}});["Object","WhiteSpace","TextNode","Collection","Arguments"].each(function(i){new a(i);
|
||||
});var c=Date.now();String.extend("uniqueID",function(){return(c++).toString(36);});})();Array.implement({every:function(c,d){for(var b=0,a=this.length;
|
||||
b<a;b++){if((b in this)&&!c.call(d,this[b],b,this)){return false;}}return true;},filter:function(d,e){var c=[];for(var b=0,a=this.length;b<a;b++){if((b in this)&&d.call(e,this[b],b,this)){c.push(this[b]);
|
||||
}}return c;},indexOf:function(c,d){var a=this.length;for(var b=(d<0)?Math.max(0,a+d):d||0;b<a;b++){if(this[b]===c){return b;}}return -1;},map:function(d,e){var c=[];
|
||||
for(var b=0,a=this.length;b<a;b++){if(b in this){c[b]=d.call(e,this[b],b,this);}}return c;},some:function(c,d){for(var b=0,a=this.length;b<a;b++){if((b in this)&&c.call(d,this[b],b,this)){return true;
|
||||
}}return false;},clean:function(){return this.filter(function(a){return a!=null;});},invoke:function(a){var b=Array.slice(arguments,1);return this.map(function(c){return c[a].apply(c,b);
|
||||
});},associate:function(c){var d={},b=Math.min(this.length,c.length);for(var a=0;a<b;a++){d[c[a]]=this[a];}return d;},link:function(c){var a={};for(var e=0,b=this.length;
|
||||
e<b;e++){for(var d in c){if(c[d](this[e])){a[d]=this[e];delete c[d];break;}}}return a;},contains:function(a,b){return this.indexOf(a,b)!=-1;},append:function(a){this.push.apply(this,a);
|
||||
return this;},getLast:function(){return(this.length)?this[this.length-1]:null;},getRandom:function(){return(this.length)?this[Number.random(0,this.length-1)]:null;
|
||||
},include:function(a){if(!this.contains(a)){this.push(a);}return this;},combine:function(c){for(var b=0,a=c.length;b<a;b++){this.include(c[b]);}return this;
|
||||
},erase:function(b){for(var a=this.length;a--;){if(this[a]===b){this.splice(a,1);}}return this;},empty:function(){this.length=0;return this;},flatten:function(){var d=[];
|
||||
for(var b=0,a=this.length;b<a;b++){var c=typeOf(this[b]);if(c=="null"){continue;}d=d.concat((c=="array"||c=="collection"||c=="arguments"||instanceOf(this[b],Array))?Array.flatten(this[b]):this[b]);
|
||||
}return d;},pick:function(){for(var b=0,a=this.length;b<a;b++){if(this[b]!=null){return this[b];}}return null;},hexToRgb:function(b){if(this.length!=3){return null;
|
||||
}var a=this.map(function(c){if(c.length==1){c+=c;}return c.toInt(16);});return(b)?a:"rgb("+a+")";},rgbToHex:function(d){if(this.length<3){return null;}if(this.length==4&&this[3]==0&&!d){return"transparent";
|
||||
}var b=[];for(var a=0;a<3;a++){var c=(this[a]-0).toString(16);b.push((c.length==1)?"0"+c:c);}return(d)?b:"#"+b.join("");}});String.implement({test:function(a,b){return((typeOf(a)=="regexp")?a:new RegExp(""+a,b)).test(this);
|
||||
},contains:function(a,b){return(b)?(b+this+b).indexOf(b+a+b)>-1:this.indexOf(a)>-1;},trim:function(){return this.replace(/^\s+|\s+$/g,"");},clean:function(){return this.replace(/\s+/g," ").trim();
|
||||
},camelCase:function(){return this.replace(/-\D/g,function(a){return a.charAt(1).toUpperCase();});},hyphenate:function(){return this.replace(/[A-Z]/g,function(a){return("-"+a.charAt(0).toLowerCase());
|
||||
});},capitalize:function(){return this.replace(/\b[a-z]/g,function(a){return a.toUpperCase();});},escapeRegExp:function(){return this.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1");
|
||||
},toInt:function(a){return parseInt(this,a||10);},toFloat:function(){return parseFloat(this);},hexToRgb:function(b){var a=this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);
|
||||
return(a)?a.slice(1).hexToRgb(b):null;},rgbToHex:function(b){var a=this.match(/\d{1,3}/g);return(a)?a.rgbToHex(b):null;},substitute:function(a,b){return this.replace(b||(/\\?\{([^{}]+)\}/g),function(d,c){if(d.charAt(0)=="\\"){return d.slice(1);
|
||||
}return(a[c]!=null)?a[c]:"";});}});Number.implement({limit:function(b,a){return Math.min(a,Math.max(b,this));},round:function(a){a=Math.pow(10,a||0).toFixed(a<0?-a:0);
|
||||
return Math.round(this*a)/a;},times:function(b,c){for(var a=0;a<this;a++){b.call(c,a,this);}},toFloat:function(){return parseFloat(this);},toInt:function(a){return parseInt(this,a||10);
|
||||
}});Number.alias("each","times");(function(b){var a={};b.each(function(c){if(!Number[c]){a[c]=function(){return Math[c].apply(null,[this].concat(Array.from(arguments)));
|
||||
};}});Number.implement(a);})(["abs","acos","asin","atan","atan2","ceil","cos","exp","floor","log","max","min","pow","sin","sqrt","tan"]);Function.extend({attempt:function(){for(var b=0,a=arguments.length;
|
||||
b<a;b++){try{return arguments[b]();}catch(c){}}return null;}});Function.implement({attempt:function(a,c){try{return this.apply(c,Array.from(a));}catch(b){}return null;
|
||||
},bind:function(c){var a=this,b=(arguments.length>1)?Array.slice(arguments,1):null;return function(){if(!b&&!arguments.length){return a.call(c);}if(b&&arguments.length){return a.apply(c,b.concat(Array.from(arguments)));
|
||||
}return a.apply(c,b||arguments);};},pass:function(b,c){var a=this;if(b!=null){b=Array.from(b);}return function(){return a.apply(c,b||arguments);};},delay:function(b,c,a){return setTimeout(this.pass((a==null?[]:a),c),b);
|
||||
},periodical:function(c,b,a){return setInterval(this.pass((a==null?[]:a),b),c);}});(function(){var a=Object.prototype.hasOwnProperty;Object.extend({subset:function(d,g){var f={};
|
||||
for(var e=0,b=g.length;e<b;e++){var c=g[e];if(c in d){f[c]=d[c];}}return f;},map:function(b,e,f){var d={};for(var c in b){if(a.call(b,c)){d[c]=e.call(f,b[c],c,b);
|
||||
}}return d;},filter:function(b,e,g){var d={};for(var c in b){var f=b[c];if(a.call(b,c)&&e.call(g,f,c,b)){d[c]=f;}}return d;},every:function(b,d,e){for(var c in b){if(a.call(b,c)&&!d.call(e,b[c],c)){return false;
|
||||
}}return true;},some:function(b,d,e){for(var c in b){if(a.call(b,c)&&d.call(e,b[c],c)){return true;}}return false;},keys:function(b){var d=[];for(var c in b){if(a.call(b,c)){d.push(c);
|
||||
}}return d;},values:function(c){var b=[];for(var d in c){if(a.call(c,d)){b.push(c[d]);}}return b;},getLength:function(b){return Object.keys(b).length;},keyOf:function(b,d){for(var c in b){if(a.call(b,c)&&b[c]===d){return c;
|
||||
}}return null;},contains:function(b,c){return Object.keyOf(b,c)!=null;},toQueryString:function(b,c){var d=[];Object.each(b,function(h,g){if(c){g=c+"["+g+"]";
|
||||
}var f;switch(typeOf(h)){case"object":f=Object.toQueryString(h,g);break;case"array":var e={};h.each(function(k,j){e[j]=k;});f=Object.toQueryString(e,g);
|
||||
break;default:f=g+"="+encodeURIComponent(h);}if(h!=null){d.push(f);}});return d.join("&");}});})();(function(){var k=this.document;var i=k.window=this;
|
||||
var b=1;this.$uid=(i.ActiveXObject)?function(e){return(e.uid||(e.uid=[b++]))[0];}:function(e){return e.uid||(e.uid=b++);};$uid(i);$uid(k);var a=navigator.userAgent.toLowerCase(),c=navigator.platform.toLowerCase(),j=a.match(/(opera|ie|firefox|chrome|version)[\s\/:]([\w\d\.]+)?.*?(safari|version[\s\/:]([\w\d\.]+)|$)/)||[null,"unknown",0],f=j[1]=="ie"&&k.documentMode;
|
||||
var o=this.Browser={extend:Function.prototype.extend,name:(j[1]=="version")?j[3]:j[1],version:f||parseFloat((j[1]=="opera"&&j[4])?j[4]:j[2]),Platform:{name:a.match(/ip(?:ad|od|hone)/)?"ios":(a.match(/(?:webos|android)/)||c.match(/mac|win|linux/)||["other"])[0]},Features:{xpath:!!(k.evaluate),air:!!(i.runtime),query:!!(k.querySelector),json:!!(i.JSON)},Plugins:{}};
|
||||
o[o.name]=true;o[o.name+parseInt(o.version,10)]=true;o.Platform[o.Platform.name]=true;o.Request=(function(){var q=function(){return new XMLHttpRequest();
|
||||
};var p=function(){return new ActiveXObject("MSXML2.XMLHTTP");};var e=function(){return new ActiveXObject("Microsoft.XMLHTTP");};return Function.attempt(function(){q();
|
||||
return q;},function(){p();return p;},function(){e();return e;});})();o.Features.xhr=!!(o.Request);var h=(Function.attempt(function(){return navigator.plugins["Shockwave Flash"].description;
|
||||
},function(){return new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version");})||"0 r0").match(/\d+/g);o.Plugins.Flash={version:Number(h[0]||"0."+h[1])||0,build:Number(h[2])||0};
|
||||
o.exec=function(p){if(!p){return p;}if(i.execScript){i.execScript(p);}else{var e=k.createElement("script");e.setAttribute("type","text/javascript");e.text=p;
|
||||
k.head.appendChild(e);k.head.removeChild(e);}return p;};String.implement("stripScripts",function(p){var e="";var q=this.replace(/<script[^>]*>([\s\S]*?)<\/script>/gi,function(r,s){e+=s+"\n";
|
||||
return"";});if(p===true){o.exec(e);}else{if(typeOf(p)=="function"){p(e,q);}}return q;});o.extend({Document:this.Document,Window:this.Window,Element:this.Element,Event:this.Event});
|
||||
this.Window=this.$constructor=new Type("Window",function(){});this.$family=Function.from("window").hide();Window.mirror(function(e,p){i[e]=p;});this.Document=k.$constructor=new Type("Document",function(){});
|
||||
k.$family=Function.from("document").hide();Document.mirror(function(e,p){k[e]=p;});k.html=k.documentElement;if(!k.head){k.head=k.getElementsByTagName("head")[0];
|
||||
}if(k.execCommand){try{k.execCommand("BackgroundImageCache",false,true);}catch(g){}}if(this.attachEvent&&!this.addEventListener){var d=function(){this.detachEvent("onunload",d);
|
||||
k.head=k.html=k.window=null;};this.attachEvent("onunload",d);}var m=Array.from;try{m(k.html.childNodes);}catch(g){Array.from=function(p){if(typeof p!="string"&&Type.isEnumerable(p)&&typeOf(p)!="array"){var e=p.length,q=new Array(e);
|
||||
while(e--){q[e]=p[e];}return q;}return m(p);};var l=Array.prototype,n=l.slice;["pop","push","reverse","shift","sort","splice","unshift","concat","join","slice"].each(function(e){var p=l[e];
|
||||
Array[e]=function(q){return p.apply(Array.from(q),n.call(arguments,1));};});}})();var Event=new Type("Event",function(a,i){if(!i){i=window;}var o=i.document;
|
||||
a=a||i.event;if(a.$extended){return a;}this.$extended=true;var n=a.type,k=a.target||a.srcElement,m={},c={},q=null,h,l,b,p;while(k&&k.nodeType==3){k=k.parentNode;
|
||||
}if(n.indexOf("key")!=-1){b=a.which||a.keyCode;p=Object.keyOf(Event.Keys,b);if(n=="keydown"){var d=b-111;if(d>0&&d<13){p="f"+d;}}if(!p){p=String.fromCharCode(b).toLowerCase();
|
||||
}}else{if((/click|mouse|menu/i).test(n)){o=(!o.compatMode||o.compatMode=="CSS1Compat")?o.html:o.body;m={x:(a.pageX!=null)?a.pageX:a.clientX+o.scrollLeft,y:(a.pageY!=null)?a.pageY:a.clientY+o.scrollTop};
|
||||
c={x:(a.pageX!=null)?a.pageX-i.pageXOffset:a.clientX,y:(a.pageY!=null)?a.pageY-i.pageYOffset:a.clientY};if((/DOMMouseScroll|mousewheel/).test(n)){l=(a.wheelDelta)?a.wheelDelta/120:-(a.detail||0)/3;
|
||||
}h=(a.which==3)||(a.button==2);if((/over|out/).test(n)){q=a.relatedTarget||a[(n=="mouseover"?"from":"to")+"Element"];var j=function(){while(q&&q.nodeType==3){q=q.parentNode;
|
||||
}return true;};var g=(Browser.firefox2)?j.attempt():j();q=(g)?q:null;}}else{if((/gesture|touch/i).test(n)){this.rotation=a.rotation;this.scale=a.scale;
|
||||
this.targetTouches=a.targetTouches;this.changedTouches=a.changedTouches;var f=this.touches=a.touches;if(f&&f[0]){var e=f[0];m={x:e.pageX,y:e.pageY};c={x:e.clientX,y:e.clientY};
|
||||
}}}}return Object.append(this,{event:a,type:n,page:m,client:c,rightClick:h,wheel:l,relatedTarget:document.id(q),target:document.id(k),code:b,key:p,shift:a.shiftKey,control:a.ctrlKey,alt:a.altKey,meta:a.metaKey});
|
||||
});Event.Keys={enter:13,up:38,down:40,left:37,right:39,esc:27,space:32,backspace:8,tab:9,"delete":46};Event.implement({stop:function(){return this.stopPropagation().preventDefault();
|
||||
},stopPropagation:function(){if(this.event.stopPropagation){this.event.stopPropagation();}else{this.event.cancelBubble=true;}return this;},preventDefault:function(){if(this.event.preventDefault){this.event.preventDefault();
|
||||
}else{this.event.returnValue=false;}return this;}});(function(){var a=this.Class=new Type("Class",function(h){if(instanceOf(h,Function)){h={initialize:h};
|
||||
}var g=function(){e(this);if(g.$prototyping){return this;}this.$caller=null;var i=(this.initialize)?this.initialize.apply(this,arguments):this;this.$caller=this.caller=null;
|
||||
return i;}.extend(this).implement(h);g.$constructor=a;g.prototype.$constructor=g;g.prototype.parent=c;return g;});var c=function(){if(!this.$caller){throw new Error('The method "parent" cannot be called.');
|
||||
}var g=this.$caller.$name,h=this.$caller.$owner.parent,i=(h)?h.prototype[g]:null;if(!i){throw new Error('The method "'+g+'" has no parent.');}return i.apply(this,arguments);
|
||||
};var e=function(g){for(var h in g){var j=g[h];switch(typeOf(j)){case"object":var i=function(){};i.prototype=j;g[h]=e(new i);break;case"array":g[h]=j.clone();
|
||||
break;}}return g;};var b=function(g,h,j){if(j.$origin){j=j.$origin;}var i=function(){if(j.$protected&&this.$caller==null){throw new Error('The method "'+h+'" cannot be called.');
|
||||
}var l=this.caller,m=this.$caller;this.caller=m;this.$caller=i;var k=j.apply(this,arguments);this.$caller=m;this.caller=l;return k;}.extend({$owner:g,$origin:j,$name:h});
|
||||
return i;};var f=function(h,i,g){if(a.Mutators.hasOwnProperty(h)){i=a.Mutators[h].call(this,i);if(i==null){return this;}}if(typeOf(i)=="function"){if(i.$hidden){return this;
|
||||
}this.prototype[h]=(g)?i:b(this,h,i);}else{Object.merge(this.prototype,h,i);}return this;};var d=function(g){g.$prototyping=true;var h=new g;delete g.$prototyping;
|
||||
return h;};a.implement("implement",f.overloadSetter());a.Mutators={Extends:function(g){this.parent=g;this.prototype=d(g);},Implements:function(g){Array.from(g).each(function(j){var h=new j;
|
||||
for(var i in h){f.call(this,i,h[i],true);}},this);}};})();(function(){this.Chain=new Class({$chain:[],chain:function(){this.$chain.append(Array.flatten(arguments));
|
||||
return this;},callChain:function(){return(this.$chain.length)?this.$chain.shift().apply(this,arguments):false;},clearChain:function(){this.$chain.empty();
|
||||
return this;}});var a=function(b){return b.replace(/^on([A-Z])/,function(c,d){return d.toLowerCase();});};this.Events=new Class({$events:{},addEvent:function(d,c,b){d=a(d);
|
||||
this.$events[d]=(this.$events[d]||[]).include(c);if(b){c.internal=true;}return this;},addEvents:function(b){for(var c in b){this.addEvent(c,b[c]);}return this;
|
||||
},fireEvent:function(e,c,b){e=a(e);var d=this.$events[e];if(!d){return this;}c=Array.from(c);d.each(function(f){if(b){f.delay(b,this,c);}else{f.apply(this,c);
|
||||
}},this);return this;},removeEvent:function(e,d){e=a(e);var c=this.$events[e];if(c&&!d.internal){var b=c.indexOf(d);if(b!=-1){delete c[b];}}return this;
|
||||
},removeEvents:function(d){var e;if(typeOf(d)=="object"){for(e in d){this.removeEvent(e,d[e]);}return this;}if(d){d=a(d);}for(e in this.$events){if(d&&d!=e){continue;
|
||||
}var c=this.$events[e];for(var b=c.length;b--;){if(b in c){this.removeEvent(e,c[b]);}}}return this;}});this.Options=new Class({setOptions:function(){var b=this.options=Object.merge.apply(null,[{},this.options].append(arguments));
|
||||
if(this.addEvent){for(var c in b){if(typeOf(b[c])!="function"||!(/^on[A-Z]/).test(c)){continue;}this.addEvent(c,b[c]);delete b[c];}}return this;}});})();
|
||||
(function(){var k,n,l,g,a={},c={},m=/\\/g;var e=function(q,p){if(q==null){return null;}if(q.Slick===true){return q;}q=(""+q).replace(/^\s+|\s+$/g,"");g=!!p;
|
||||
var o=(g)?c:a;if(o[q]){return o[q];}k={Slick:true,expressions:[],raw:q,reverse:function(){return e(this.raw,true);}};n=-1;while(q!=(q=q.replace(j,b))){}k.length=k.expressions.length;
|
||||
return o[k.raw]=(g)?h(k):k;};var i=function(o){if(o==="!"){return" ";}else{if(o===" "){return"!";}else{if((/^!/).test(o)){return o.replace(/^!/,"");}else{return"!"+o;
|
||||
}}}};var h=function(u){var r=u.expressions;for(var p=0;p<r.length;p++){var t=r[p];var q={parts:[],tag:"*",combinator:i(t[0].combinator)};for(var o=0;o<t.length;
|
||||
o++){var s=t[o];if(!s.reverseCombinator){s.reverseCombinator=" ";}s.combinator=s.reverseCombinator;delete s.reverseCombinator;}t.reverse().push(q);}return u;
|
||||
};var f=function(o){return o.replace(/[-[\]{}()*+?.\\^$|,#\s]/g,function(p){return"\\"+p;});};var j=new RegExp("^(?:\\s*(,)\\s*|\\s*(<combinator>+)\\s*|(\\s+)|(<unicode>+|\\*)|\\#(<unicode>+)|\\.(<unicode>+)|\\[\\s*(<unicode1>+)(?:\\s*([*^$!~|]?=)(?:\\s*(?:([\"']?)(.*?)\\9)))?\\s*\\](?!\\])|(:+)(<unicode>+)(?:\\((?:(?:([\"'])([^\\13]*)\\13)|((?:\\([^)]+\\)|[^()]*)+))\\))?)".replace(/<combinator>/,"["+f(">+~`!@$%^&={}\\;</")+"]").replace(/<unicode>/g,"(?:[\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])").replace(/<unicode1>/g,"(?:[:\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])"));
|
||||
function b(x,s,D,z,r,C,q,B,A,y,u,F,G,v,p,w){if(s||n===-1){k.expressions[++n]=[];l=-1;if(s){return"";}}if(D||z||l===-1){D=D||" ";var t=k.expressions[n];
|
||||
if(g&&t[l]){t[l].reverseCombinator=i(D);}t[++l]={combinator:D,tag:"*"};}var o=k.expressions[n][l];if(r){o.tag=r.replace(m,"");}else{if(C){o.id=C.replace(m,"");
|
||||
}else{if(q){q=q.replace(m,"");if(!o.classList){o.classList=[];}if(!o.classes){o.classes=[];}o.classList.push(q);o.classes.push({value:q,regexp:new RegExp("(^|\\s)"+f(q)+"(\\s|$)")});
|
||||
}else{if(G){w=w||p;w=w?w.replace(m,""):null;if(!o.pseudos){o.pseudos=[];}o.pseudos.push({key:G.replace(m,""),value:w,type:F.length==1?"class":"element"});
|
||||
}else{if(B){B=B.replace(m,"");u=(u||"").replace(m,"");var E,H;switch(A){case"^=":H=new RegExp("^"+f(u));break;case"$=":H=new RegExp(f(u)+"$");break;case"~=":H=new RegExp("(^|\\s)"+f(u)+"(\\s|$)");
|
||||
break;case"|=":H=new RegExp("^"+f(u)+"(-|$)");break;case"=":E=function(I){return u==I;};break;case"*=":E=function(I){return I&&I.indexOf(u)>-1;};break;
|
||||
case"!=":E=function(I){return u!=I;};break;default:E=function(I){return !!I;};}if(u==""&&(/^[*$^]=$/).test(A)){E=function(){return false;};}if(!E){E=function(I){return I&&H.test(I);
|
||||
};}if(!o.attributes){o.attributes=[];}o.attributes.push({key:B,operator:A,value:u,test:E});}}}}}return"";}var d=(this.Slick||{});d.parse=function(o){return e(o);
|
||||
};d.escapeRegExp=f;if(!this.Slick){this.Slick=d;}}).apply((typeof exports!="undefined")?exports:this);(function(){var j={},l={},b=Object.prototype.toString;
|
||||
j.isNativeCode=function(c){return(/\{\s*\[native code\]\s*\}/).test(""+c);};j.isXML=function(c){return(!!c.xmlVersion)||(!!c.xml)||(b.call(c)=="[object XMLDocument]")||(c.nodeType==9&&c.documentElement.nodeName!="HTML");
|
||||
};j.setDocument=function(w){var t=w.nodeType;if(t==9){}else{if(t){w=w.ownerDocument;}else{if(w.navigator){w=w.document;}else{return;}}}if(this.document===w){return;
|
||||
}this.document=w;var y=w.documentElement,u=this.getUIDXML(y),o=l[u],A;if(o){for(A in o){this[A]=o[A];}return;}o=l[u]={};o.root=y;o.isXMLDocument=this.isXML(w);
|
||||
o.brokenStarGEBTN=o.starSelectsClosedQSA=o.idGetsName=o.brokenMixedCaseQSA=o.brokenGEBCN=o.brokenCheckedQSA=o.brokenEmptyAttributeQSA=o.isHTMLDocument=o.nativeMatchesSelector=false;
|
||||
var m,n,x,q,r;var s,c="slick_uniqueid";var z=w.createElement("div");var p=w.body||w.getElementsByTagName("body")[0]||y;p.appendChild(z);try{z.innerHTML='<a id="'+c+'"></a>';
|
||||
o.isHTMLDocument=!!w.getElementById(c);}catch(v){}if(o.isHTMLDocument){z.style.display="none";z.appendChild(w.createComment(""));n=(z.getElementsByTagName("*").length>1);
|
||||
try{z.innerHTML="foo</foo>";s=z.getElementsByTagName("*");m=(s&&!!s.length&&s[0].nodeName.charAt(0)=="/");}catch(v){}o.brokenStarGEBTN=n||m;try{z.innerHTML='<a name="'+c+'"></a><b id="'+c+'"></b>';
|
||||
o.idGetsName=w.getElementById(c)===z.firstChild;}catch(v){}if(z.getElementsByClassName){try{z.innerHTML='<a class="f"></a><a class="b"></a>';z.getElementsByClassName("b").length;
|
||||
z.firstChild.className="b";q=(z.getElementsByClassName("b").length!=2);}catch(v){}try{z.innerHTML='<a class="a"></a><a class="f b a"></a>';x=(z.getElementsByClassName("a").length!=2);
|
||||
}catch(v){}o.brokenGEBCN=q||x;}if(z.querySelectorAll){try{z.innerHTML="foo</foo>";s=z.querySelectorAll("*");o.starSelectsClosedQSA=(s&&!!s.length&&s[0].nodeName.charAt(0)=="/");
|
||||
}catch(v){}try{z.innerHTML='<a class="MiX"></a>';o.brokenMixedCaseQSA=!z.querySelectorAll(".MiX").length;}catch(v){}try{z.innerHTML='<select><option selected="selected">a</option></select>';
|
||||
o.brokenCheckedQSA=(z.querySelectorAll(":checked").length==0);}catch(v){}try{z.innerHTML='<a class=""></a>';o.brokenEmptyAttributeQSA=(z.querySelectorAll('[class*=""]').length!=0);
|
||||
}catch(v){}}try{z.innerHTML='<form action="s"><input id="action"/></form>';r=(z.firstChild.getAttribute("action")!="s");}catch(v){}o.nativeMatchesSelector=y.matchesSelector||y.mozMatchesSelector||y.webkitMatchesSelector;
|
||||
if(o.nativeMatchesSelector){try{o.nativeMatchesSelector.call(y,":slick");o.nativeMatchesSelector=null;}catch(v){}}}try{y.slick_expando=1;delete y.slick_expando;
|
||||
o.getUID=this.getUIDHTML;}catch(v){o.getUID=this.getUIDXML;}p.removeChild(z);z=s=p=null;o.getAttribute=(o.isHTMLDocument&&r)?function(D,B){var E=this.attributeGetters[B];
|
||||
if(E){return E.call(D);}var C=D.getAttributeNode(B);return(C)?C.nodeValue:null;}:function(C,B){var D=this.attributeGetters[B];return(D)?D.call(C):C.getAttribute(B);
|
||||
};o.hasAttribute=(y&&this.isNativeCode(y.hasAttribute))?function(C,B){return C.hasAttribute(B);}:function(C,B){C=C.getAttributeNode(B);return !!(C&&(C.specified||C.nodeValue));
|
||||
};o.contains=(y&&this.isNativeCode(y.contains))?function(B,C){return B.contains(C);}:(y&&y.compareDocumentPosition)?function(B,C){return B===C||!!(B.compareDocumentPosition(C)&16);
|
||||
}:function(B,C){if(C){do{if(C===B){return true;}}while((C=C.parentNode));}return false;};o.documentSorter=(y.compareDocumentPosition)?function(C,B){if(!C.compareDocumentPosition||!B.compareDocumentPosition){return 0;
|
||||
}return C.compareDocumentPosition(B)&4?-1:C===B?0:1;}:("sourceIndex" in y)?function(C,B){if(!C.sourceIndex||!B.sourceIndex){return 0;}return C.sourceIndex-B.sourceIndex;
|
||||
}:(w.createRange)?function(E,C){if(!E.ownerDocument||!C.ownerDocument){return 0;}var D=E.ownerDocument.createRange(),B=C.ownerDocument.createRange();D.setStart(E,0);
|
||||
D.setEnd(E,0);B.setStart(C,0);B.setEnd(C,0);return D.compareBoundaryPoints(Range.START_TO_END,B);}:null;y=null;for(A in o){this[A]=o[A];}};var e=/^([#.]?)((?:[\w-]+|\*))$/,g=/\[.+[*$^]=(?:""|'')?\]/,f={};
|
||||
j.search=function(U,z,H,s){var p=this.found=(s)?null:(H||[]);if(!U){return p;}else{if(U.navigator){U=U.document;}else{if(!U.nodeType){return p;}}}var F,O,V=this.uniques={},I=!!(H&&H.length),y=(U.nodeType==9);
|
||||
if(this.document!==(y?U:U.ownerDocument)){this.setDocument(U);}if(I){for(O=p.length;O--;){V[this.getUID(p[O])]=true;}}if(typeof z=="string"){var r=z.match(e);
|
||||
simpleSelectors:if(r){var u=r[1],v=r[2],A,E;if(!u){if(v=="*"&&this.brokenStarGEBTN){break simpleSelectors;}E=U.getElementsByTagName(v);if(s){return E[0]||null;
|
||||
}for(O=0;A=E[O++];){if(!(I&&V[this.getUID(A)])){p.push(A);}}}else{if(u=="#"){if(!this.isHTMLDocument||!y){break simpleSelectors;}A=U.getElementById(v);
|
||||
if(!A){return p;}if(this.idGetsName&&A.getAttributeNode("id").nodeValue!=v){break simpleSelectors;}if(s){return A||null;}if(!(I&&V[this.getUID(A)])){p.push(A);
|
||||
}}else{if(u=="."){if(!this.isHTMLDocument||((!U.getElementsByClassName||this.brokenGEBCN)&&U.querySelectorAll)){break simpleSelectors;}if(U.getElementsByClassName&&!this.brokenGEBCN){E=U.getElementsByClassName(v);
|
||||
if(s){return E[0]||null;}for(O=0;A=E[O++];){if(!(I&&V[this.getUID(A)])){p.push(A);}}}else{var T=new RegExp("(^|\\s)"+d.escapeRegExp(v)+"(\\s|$)");E=U.getElementsByTagName("*");
|
||||
for(O=0;A=E[O++];){className=A.className;if(!(className&&T.test(className))){continue;}if(s){return A;}if(!(I&&V[this.getUID(A)])){p.push(A);}}}}}}if(I){this.sort(p);
|
||||
}return(s)?null:p;}querySelector:if(U.querySelectorAll){if(!this.isHTMLDocument||f[z]||this.brokenMixedCaseQSA||(this.brokenCheckedQSA&&z.indexOf(":checked")>-1)||(this.brokenEmptyAttributeQSA&&g.test(z))||(!y&&z.indexOf(",")>-1)||d.disableQSA){break querySelector;
|
||||
}var S=z,x=U;if(!y){var C=x.getAttribute("id"),t="slickid__";x.setAttribute("id",t);S="#"+t+" "+S;U=x.parentNode;}try{if(s){return U.querySelector(S)||null;
|
||||
}else{E=U.querySelectorAll(S);}}catch(Q){f[z]=1;break querySelector;}finally{if(!y){if(C){x.setAttribute("id",C);}else{x.removeAttribute("id");}U=x;}}if(this.starSelectsClosedQSA){for(O=0;
|
||||
A=E[O++];){if(A.nodeName>"@"&&!(I&&V[this.getUID(A)])){p.push(A);}}}else{for(O=0;A=E[O++];){if(!(I&&V[this.getUID(A)])){p.push(A);}}}if(I){this.sort(p);
|
||||
}return p;}F=this.Slick.parse(z);if(!F.length){return p;}}else{if(z==null){return p;}else{if(z.Slick){F=z;}else{if(this.contains(U.documentElement||U,z)){(p)?p.push(z):p=z;
|
||||
return p;}else{return p;}}}}this.posNTH={};this.posNTHLast={};this.posNTHType={};this.posNTHTypeLast={};this.push=(!I&&(s||(F.length==1&&F.expressions[0].length==1)))?this.pushArray:this.pushUID;
|
||||
if(p==null){p=[];}var M,L,K;var B,J,D,c,q,G,W;var N,P,o,w,R=F.expressions;search:for(O=0;(P=R[O]);O++){for(M=0;(o=P[M]);M++){B="combinator:"+o.combinator;
|
||||
if(!this[B]){continue search;}J=(this.isXMLDocument)?o.tag:o.tag.toUpperCase();D=o.id;c=o.classList;q=o.classes;G=o.attributes;W=o.pseudos;w=(M===(P.length-1));
|
||||
this.bitUniques={};if(w){this.uniques=V;this.found=p;}else{this.uniques={};this.found=[];}if(M===0){this[B](U,J,D,q,G,W,c);if(s&&w&&p.length){break search;
|
||||
}}else{if(s&&w){for(L=0,K=N.length;L<K;L++){this[B](N[L],J,D,q,G,W,c);if(p.length){break search;}}}else{for(L=0,K=N.length;L<K;L++){this[B](N[L],J,D,q,G,W,c);
|
||||
}}}N=this.found;}}if(I||(F.expressions.length>1)){this.sort(p);}return(s)?(p[0]||null):p;};j.uidx=1;j.uidk="slick-uniqueid";j.getUIDXML=function(m){var c=m.getAttribute(this.uidk);
|
||||
if(!c){c=this.uidx++;m.setAttribute(this.uidk,c);}return c;};j.getUIDHTML=function(c){return c.uniqueNumber||(c.uniqueNumber=this.uidx++);};j.sort=function(c){if(!this.documentSorter){return c;
|
||||
}c.sort(this.documentSorter);return c;};j.cacheNTH={};j.matchNTH=/^([+-]?\d*)?([a-z]+)?([+-]\d+)?$/;j.parseNTHArgument=function(p){var n=p.match(this.matchNTH);
|
||||
if(!n){return false;}var o=n[2]||false;var m=n[1]||1;if(m=="-"){m=-1;}var c=+n[3]||0;n=(o=="n")?{a:m,b:c}:(o=="odd")?{a:2,b:1}:(o=="even")?{a:2,b:0}:{a:0,b:m};
|
||||
return(this.cacheNTH[p]=n);};j.createNTHPseudo=function(o,m,c,n){return function(r,p){var t=this.getUID(r);if(!this[c][t]){var z=r.parentNode;if(!z){return false;
|
||||
}var q=z[o],s=1;if(n){var y=r.nodeName;do{if(q.nodeName!=y){continue;}this[c][this.getUID(q)]=s++;}while((q=q[m]));}else{do{if(q.nodeType!=1){continue;
|
||||
}this[c][this.getUID(q)]=s++;}while((q=q[m]));}}p=p||"n";var u=this.cacheNTH[p]||this.parseNTHArgument(p);if(!u){return false;}var x=u.a,w=u.b,v=this[c][t];
|
||||
if(x==0){return w==v;}if(x>0){if(v<w){return false;}}else{if(w<v){return false;}}return((v-w)%x)==0;};};j.pushArray=function(o,c,q,n,m,p){if(this.matchSelector(o,c,q,n,m,p)){this.found.push(o);
|
||||
}};j.pushUID=function(p,c,r,o,m,q){var n=this.getUID(p);if(!this.uniques[n]&&this.matchSelector(p,c,r,o,m,q)){this.uniques[n]=true;this.found.push(p);}};
|
||||
j.matchNode=function(m,n){if(this.isHTMLDocument&&this.nativeMatchesSelector){try{return this.nativeMatchesSelector.call(m,n.replace(/\[([^=]+)=\s*([^'"\]]+?)\s*\]/g,'[$1="$2"]'));
|
||||
}catch(u){}}var t=this.Slick.parse(n);if(!t){return true;}var r=t.expressions,p,s=0,q;for(q=0;(currentExpression=r[q]);q++){if(currentExpression.length==1){var o=currentExpression[0];
|
||||
if(this.matchSelector(m,(this.isXMLDocument)?o.tag:o.tag.toUpperCase(),o.id,o.classes,o.attributes,o.pseudos)){return true;}s++;}}if(s==t.length){return false;
|
||||
}var c=this.search(this.document,t),v;for(q=0;v=c[q++];){if(v===m){return true;}}return false;};j.matchPseudo=function(p,c,o){var m="pseudo:"+c;if(this[m]){return this[m](p,o);
|
||||
}var n=this.getAttribute(p,c);return(o)?o==n:!!n;};j.matchSelector=function(n,u,c,o,p,r){if(u){var s=(this.isXMLDocument)?n.nodeName:n.nodeName.toUpperCase();
|
||||
if(u=="*"){if(s<"@"){return false;}}else{if(s!=u){return false;}}}if(c&&n.getAttribute("id")!=c){return false;}var q,m,t;if(o){for(q=o.length;q--;){t=n.getAttribute("class")||n.className;
|
||||
if(!(t&&o[q].regexp.test(t))){return false;}}}if(p){for(q=p.length;q--;){m=p[q];if(m.operator?!m.test(this.getAttribute(n,m.key)):!this.hasAttribute(n,m.key)){return false;
|
||||
}}}if(r){for(q=r.length;q--;){m=r[q];if(!this.matchPseudo(n,m.key,m.value)){return false;}}}return true;};var i={" ":function(p,v,m,q,r,t,o){var s,u,n;
|
||||
if(this.isHTMLDocument){getById:if(m){u=this.document.getElementById(m);if((!u&&p.all)||(this.idGetsName&&u&&u.getAttributeNode("id").nodeValue!=m)){n=p.all[m];
|
||||
if(!n){return;}if(!n[0]){n=[n];}for(s=0;u=n[s++];){var c=u.getAttributeNode("id");if(c&&c.nodeValue==m){this.push(u,v,null,q,r,t);break;}}return;}if(!u){if(this.contains(this.root,p)){return;
|
||||
}else{break getById;}}else{if(this.document!==p&&!this.contains(p,u)){return;}}this.push(u,v,null,q,r,t);return;}getByClass:if(q&&p.getElementsByClassName&&!this.brokenGEBCN){n=p.getElementsByClassName(o.join(" "));
|
||||
if(!(n&&n.length)){break getByClass;}for(s=0;u=n[s++];){this.push(u,v,m,null,r,t);}return;}}getByTag:{n=p.getElementsByTagName(v);if(!(n&&n.length)){break getByTag;
|
||||
}if(!this.brokenStarGEBTN){v=null;}for(s=0;u=n[s++];){this.push(u,v,m,q,r,t);}}},">":function(o,c,q,n,m,p){if((o=o.firstChild)){do{if(o.nodeType==1){this.push(o,c,q,n,m,p);
|
||||
}}while((o=o.nextSibling));}},"+":function(o,c,q,n,m,p){while((o=o.nextSibling)){if(o.nodeType==1){this.push(o,c,q,n,m,p);break;}}},"^":function(o,c,q,n,m,p){o=o.firstChild;
|
||||
if(o){if(o.nodeType==1){this.push(o,c,q,n,m,p);}else{this["combinator:+"](o,c,q,n,m,p);}}},"~":function(p,c,r,o,m,q){while((p=p.nextSibling)){if(p.nodeType!=1){continue;
|
||||
}var n=this.getUID(p);if(this.bitUniques[n]){break;}this.bitUniques[n]=true;this.push(p,c,r,o,m,q);}},"++":function(o,c,q,n,m,p){this["combinator:+"](o,c,q,n,m,p);
|
||||
this["combinator:!+"](o,c,q,n,m,p);},"~~":function(o,c,q,n,m,p){this["combinator:~"](o,c,q,n,m,p);this["combinator:!~"](o,c,q,n,m,p);},"!":function(o,c,q,n,m,p){while((o=o.parentNode)){if(o!==this.document){this.push(o,c,q,n,m,p);
|
||||
}}},"!>":function(o,c,q,n,m,p){o=o.parentNode;if(o!==this.document){this.push(o,c,q,n,m,p);}},"!+":function(o,c,q,n,m,p){while((o=o.previousSibling)){if(o.nodeType==1){this.push(o,c,q,n,m,p);
|
||||
break;}}},"!^":function(o,c,q,n,m,p){o=o.lastChild;if(o){if(o.nodeType==1){this.push(o,c,q,n,m,p);}else{this["combinator:!+"](o,c,q,n,m,p);}}},"!~":function(p,c,r,o,m,q){while((p=p.previousSibling)){if(p.nodeType!=1){continue;
|
||||
}var n=this.getUID(p);if(this.bitUniques[n]){break;}this.bitUniques[n]=true;this.push(p,c,r,o,m,q);}}};for(var h in i){j["combinator:"+h]=i[h];}var k={empty:function(c){var m=c.firstChild;
|
||||
return !(m&&m.nodeType==1)&&!(c.innerText||c.textContent||"").length;},not:function(c,m){return !this.matchNode(c,m);},contains:function(c,m){return(c.innerText||c.textContent||"").indexOf(m)>-1;
|
||||
},"first-child":function(c){while((c=c.previousSibling)){if(c.nodeType==1){return false;}}return true;},"last-child":function(c){while((c=c.nextSibling)){if(c.nodeType==1){return false;
|
||||
}}return true;},"only-child":function(n){var m=n;while((m=m.previousSibling)){if(m.nodeType==1){return false;}}var c=n;while((c=c.nextSibling)){if(c.nodeType==1){return false;
|
||||
}}return true;},"nth-child":j.createNTHPseudo("firstChild","nextSibling","posNTH"),"nth-last-child":j.createNTHPseudo("lastChild","previousSibling","posNTHLast"),"nth-of-type":j.createNTHPseudo("firstChild","nextSibling","posNTHType",true),"nth-last-of-type":j.createNTHPseudo("lastChild","previousSibling","posNTHTypeLast",true),index:function(m,c){return this["pseudo:nth-child"](m,""+c+1);
|
||||
},even:function(c){return this["pseudo:nth-child"](c,"2n");},odd:function(c){return this["pseudo:nth-child"](c,"2n+1");},"first-of-type":function(c){var m=c.nodeName;
|
||||
while((c=c.previousSibling)){if(c.nodeName==m){return false;}}return true;},"last-of-type":function(c){var m=c.nodeName;while((c=c.nextSibling)){if(c.nodeName==m){return false;
|
||||
}}return true;},"only-of-type":function(n){var m=n,o=n.nodeName;while((m=m.previousSibling)){if(m.nodeName==o){return false;}}var c=n;while((c=c.nextSibling)){if(c.nodeName==o){return false;
|
||||
}}return true;},enabled:function(c){return !c.disabled;},disabled:function(c){return c.disabled;},checked:function(c){return c.checked||c.selected;},focus:function(c){return this.isHTMLDocument&&this.document.activeElement===c&&(c.href||c.type||this.hasAttribute(c,"tabindex"));
|
||||
},root:function(c){return(c===this.root);},selected:function(c){return c.selected;}};for(var a in k){j["pseudo:"+a]=k[a];}j.attributeGetters={"class":function(){return this.getAttribute("class")||this.className;
|
||||
},"for":function(){return("htmlFor" in this)?this.htmlFor:this.getAttribute("for");},href:function(){return("href" in this)?this.getAttribute("href",2):this.getAttribute("href");
|
||||
},style:function(){return(this.style)?this.style.cssText:this.getAttribute("style");},tabindex:function(){var c=this.getAttributeNode("tabindex");return(c&&c.specified)?c.nodeValue:null;
|
||||
},type:function(){return this.getAttribute("type");}};var d=j.Slick=(this.Slick||{});d.version="1.1.5";d.search=function(m,n,c){return j.search(m,n,c);
|
||||
};d.find=function(c,m){return j.search(c,m,null,true);};d.contains=function(c,m){j.setDocument(c);return j.contains(c,m);};d.getAttribute=function(m,c){return j.getAttribute(m,c);
|
||||
};d.match=function(m,c){if(!(m&&c)){return false;}if(!c||c===m){return true;}j.setDocument(m);return j.matchNode(m,c);};d.defineAttributeGetter=function(c,m){j.attributeGetters[c]=m;
|
||||
return this;};d.lookupAttributeGetter=function(c){return j.attributeGetters[c];};d.definePseudo=function(c,m){j["pseudo:"+c]=function(o,n){return m.call(o,n);
|
||||
};return this;};d.lookupPseudo=function(c){var m=j["pseudo:"+c];if(m){return function(n){return m.call(this,n);};}return null;};d.override=function(m,c){j.override(m,c);
|
||||
return this;};d.isXML=j.isXML;d.uidOf=function(c){return j.getUIDHTML(c);};if(!this.Slick){this.Slick=d;}}).apply((typeof exports!="undefined")?exports:this);
|
||||
var Element=function(b,g){var h=Element.Constructors[b];if(h){return h(g);}if(typeof b!="string"){return document.id(b).set(g);}if(!g){g={};}if(!(/^[\w-]+$/).test(b)){var e=Slick.parse(b).expressions[0][0];
|
||||
b=(e.tag=="*")?"div":e.tag;if(e.id&&g.id==null){g.id=e.id;}var d=e.attributes;if(d){for(var f=0,c=d.length;f<c;f++){var a=d[f];if(g[a.key]!=null){continue;
|
||||
}if(a.value!=null&&a.operator=="="){g[a.key]=a.value;}else{if(!a.value&&!a.operator){g[a.key]=true;}}}}if(e.classList&&g["class"]==null){g["class"]=e.classList.join(" ");
|
||||
}}return document.newElement(b,g);};if(Browser.Element){Element.prototype=Browser.Element.prototype;}new Type("Element",Element).mirror(function(a){if(Array.prototype[a]){return;
|
||||
}var b={};b[a]=function(){var h=[],e=arguments,j=true;for(var g=0,d=this.length;g<d;g++){var f=this[g],c=h[g]=f[a].apply(f,e);j=(j&&typeOf(c)=="element");
|
||||
}return(j)?new Elements(h):h;};Elements.implement(b);});if(!Browser.Element){Element.parent=Object;Element.Prototype={"$family":Function.from("element").hide()};
|
||||
Element.mirror(function(a,b){Element.Prototype[a]=b;});}Element.Constructors={};var IFrame=new Type("IFrame",function(){var e=Array.link(arguments,{properties:Type.isObject,iframe:function(f){return(f!=null);
|
||||
}});var c=e.properties||{},b;if(e.iframe){b=document.id(e.iframe);}var d=c.onload||function(){};delete c.onload;c.id=c.name=[c.id,c.name,b?(b.id||b.name):"IFrame_"+String.uniqueID()].pick();
|
||||
b=new Element(b||"iframe",c);var a=function(){d.call(b.contentWindow);};if(window.frames[c.id]){a();}else{b.addListener("load",a);}return b;});var Elements=this.Elements=function(a){if(a&&a.length){var e={},d;
|
||||
for(var c=0;d=a[c++];){var b=Slick.uidOf(d);if(!e[b]){e[b]=true;this.push(d);}}}};Elements.prototype={length:0};Elements.parent=Array;new Type("Elements",Elements).implement({filter:function(a,b){if(!a){return this;
|
||||
}return new Elements(Array.filter(this,(typeOf(a)=="string")?function(c){return c.match(a);}:a,b));}.protect(),push:function(){var d=this.length;for(var b=0,a=arguments.length;
|
||||
b<a;b++){var c=document.id(arguments[b]);if(c){this[d++]=c;}}return(this.length=d);}.protect(),unshift:function(){var b=[];for(var c=0,a=arguments.length;
|
||||
c<a;c++){var d=document.id(arguments[c]);if(d){b.push(d);}}return Array.prototype.unshift.apply(this,b);}.protect(),concat:function(){var b=new Elements(this);
|
||||
for(var c=0,a=arguments.length;c<a;c++){var d=arguments[c];if(Type.isEnumerable(d)){b.append(d);}else{b.push(d);}}return b;}.protect(),append:function(c){for(var b=0,a=c.length;
|
||||
b<a;b++){this.push(c[b]);}return this;}.protect(),empty:function(){while(this.length){delete this[--this.length];}return this;}.protect()});(function(){var g=Array.prototype.splice,b={"0":0,"1":1,length:2};
|
||||
g.call(b,1,1);if(b[1]==1){Elements.implement("splice",function(){var e=this.length;g.apply(this,arguments);while(e>=this.length){delete this[e--];}return this;
|
||||
}.protect());}Elements.implement(Array.prototype);Array.mirror(Elements);var f;try{var a=document.createElement("<input name=x>");f=(a.name=="x");}catch(c){}var d=function(e){return(""+e).replace(/&/g,"&").replace(/"/g,""");
|
||||
};Document.implement({newElement:function(e,h){if(h&&h.checked!=null){h.defaultChecked=h.checked;}if(f&&h){e="<"+e;if(h.name){e+=' name="'+d(h.name)+'"';
|
||||
}if(h.type){e+=' type="'+d(h.type)+'"';}e+=">";delete h.name;delete h.type;}return this.id(this.createElement(e)).set(h);}});})();Document.implement({newTextNode:function(a){return this.createTextNode(a);
|
||||
},getDocument:function(){return this;},getWindow:function(){return this.window;},id:(function(){var a={string:function(d,c,b){d=Slick.find(b,"#"+d.replace(/(\W)/g,"\\$1"));
|
||||
return(d)?a.element(d,c):null;},element:function(b,c){$uid(b);if(!c&&!b.$family&&!(/^(?:object|embed)$/i).test(b.tagName)){Object.append(b,Element.Prototype);
|
||||
}return b;},object:function(c,d,b){if(c.toElement){return a.element(c.toElement(b),d);}return null;}};a.textnode=a.whitespace=a.window=a.document=function(b){return b;
|
||||
};return function(c,e,d){if(c&&c.$family&&c.uid){return c;}var b=typeOf(c);return(a[b])?a[b](c,e,d||document):null;};})()});if(window.$==null){Window.implement("$",function(a,b){return document.id(a,b,this.document);
|
||||
});}Window.implement({getDocument:function(){return this.document;},getWindow:function(){return this;}});[Document,Element].invoke("implement",{getElements:function(a){return Slick.search(this,a,new Elements);
|
||||
},getElement:function(a){return document.id(Slick.find(this,a));}});if(window.$$==null){Window.implement("$$",function(a){if(arguments.length==1){if(typeof a=="string"){return Slick.search(this.document,a,new Elements);
|
||||
}else{if(Type.isEnumerable(a)){return new Elements(a);}}}return new Elements(arguments);});}(function(){var k={},i={};var n={input:"checked",option:"selected",textarea:"value"};
|
||||
var e=function(p){return(i[p]||(i[p]={}));};var j=function(q){var p=q.uid;if(q.removeEvents){q.removeEvents();}if(q.clearAttributes){q.clearAttributes();
|
||||
}if(p!=null){delete k[p];delete i[p];}return q;};var o=["defaultValue","accessKey","cellPadding","cellSpacing","colSpan","frameBorder","maxLength","readOnly","rowSpan","tabIndex","useMap"];
|
||||
var d=["compact","nowrap","ismap","declare","noshade","checked","disabled","readOnly","multiple","selected","noresize","defer","defaultChecked"];var g={html:"innerHTML","class":"className","for":"htmlFor",text:(function(){var p=document.createElement("div");
|
||||
return(p.textContent==null)?"innerText":"textContent";})()};var m=["type"];var h=["value","defaultValue"];var l=/^(?:href|src|usemap)$/i;d=d.associate(d);
|
||||
o=o.associate(o.map(String.toLowerCase));m=m.associate(m);Object.append(g,h.associate(h));var c={before:function(q,p){var r=p.parentNode;if(r){r.insertBefore(q,p);
|
||||
}},after:function(q,p){var r=p.parentNode;if(r){r.insertBefore(q,p.nextSibling);}},bottom:function(q,p){p.appendChild(q);},top:function(q,p){p.insertBefore(q,p.firstChild);
|
||||
}};c.inside=c.bottom;var b=function(s,r){if(!s){return r;}s=Object.clone(Slick.parse(s));var q=s.expressions;for(var p=q.length;p--;){q[p][0].combinator=r;
|
||||
}return s;};Element.implement({set:function(r,q){var p=Element.Properties[r];(p&&p.set)?p.set.call(this,q):this.setProperty(r,q);}.overloadSetter(),get:function(q){var p=Element.Properties[q];
|
||||
return(p&&p.get)?p.get.apply(this):this.getProperty(q);}.overloadGetter(),erase:function(q){var p=Element.Properties[q];(p&&p.erase)?p.erase.apply(this):this.removeProperty(q);
|
||||
return this;},setProperty:function(q,r){q=o[q]||q;if(r==null){return this.removeProperty(q);}var p=g[q];(p)?this[p]=r:(d[q])?this[q]=!!r:this.setAttribute(q,""+r);
|
||||
return this;},setProperties:function(p){for(var q in p){this.setProperty(q,p[q]);}return this;},getProperty:function(q){q=o[q]||q;var p=g[q]||m[q];return(p)?this[p]:(d[q])?!!this[q]:(l.test(q)?this.getAttribute(q,2):(p=this.getAttributeNode(q))?p.nodeValue:null)||null;
|
||||
},getProperties:function(){var p=Array.from(arguments);return p.map(this.getProperty,this).associate(p);},removeProperty:function(q){q=o[q]||q;var p=g[q];
|
||||
(p)?this[p]="":(d[q])?this[q]=false:this.removeAttribute(q);return this;},removeProperties:function(){Array.each(arguments,this.removeProperty,this);return this;
|
||||
},hasClass:function(p){return this.className.clean().contains(p," ");},addClass:function(p){if(!this.hasClass(p)){this.className=(this.className+" "+p).clean();
|
||||
}return this;},removeClass:function(p){this.className=this.className.replace(new RegExp("(^|\\s)"+p+"(?:\\s|$)"),"$1");return this;},toggleClass:function(p,q){if(q==null){q=!this.hasClass(p);
|
||||
}return(q)?this.addClass(p):this.removeClass(p);},adopt:function(){var s=this,p,u=Array.flatten(arguments),t=u.length;if(t>1){s=p=document.createDocumentFragment();
|
||||
}for(var r=0;r<t;r++){var q=document.id(u[r],true);if(q){s.appendChild(q);}}if(p){this.appendChild(p);}return this;},appendText:function(q,p){return this.grab(this.getDocument().newTextNode(q),p);
|
||||
},grab:function(q,p){c[p||"bottom"](document.id(q,true),this);return this;},inject:function(q,p){c[p||"bottom"](this,document.id(q,true));return this;},replaces:function(p){p=document.id(p,true);
|
||||
p.parentNode.replaceChild(this,p);return this;},wraps:function(q,p){q=document.id(q,true);return this.replaces(q).grab(q,p);},getPrevious:function(p){return document.id(Slick.find(this,b(p,"!~")));
|
||||
},getAllPrevious:function(p){return Slick.search(this,b(p,"!~"),new Elements);},getNext:function(p){return document.id(Slick.find(this,b(p,"~")));},getAllNext:function(p){return Slick.search(this,b(p,"~"),new Elements);
|
||||
},getFirst:function(p){return document.id(Slick.search(this,b(p,">"))[0]);},getLast:function(p){return document.id(Slick.search(this,b(p,">")).getLast());
|
||||
},getParent:function(p){return document.id(Slick.find(this,b(p,"!")));},getParents:function(p){return Slick.search(this,b(p,"!"),new Elements);},getSiblings:function(p){return Slick.search(this,b(p,"~~"),new Elements);
|
||||
},getChildren:function(p){return Slick.search(this,b(p,">"),new Elements);},getWindow:function(){return this.ownerDocument.window;},getDocument:function(){return this.ownerDocument;
|
||||
},getElementById:function(p){return document.id(Slick.find(this,"#"+(""+p).replace(/(\W)/g,"\\$1")));},getSelected:function(){this.selectedIndex;return new Elements(Array.from(this.options).filter(function(p){return p.selected;
|
||||
}));},toQueryString:function(){var p=[];this.getElements("input, select, textarea").each(function(r){var q=r.type;if(!r.name||r.disabled||q=="submit"||q=="reset"||q=="file"||q=="image"){return;
|
||||
}var s=(r.get("tag")=="select")?r.getSelected().map(function(t){return document.id(t).get("value");}):((q=="radio"||q=="checkbox")&&!r.checked)?null:r.get("value");
|
||||
Array.from(s).each(function(t){if(typeof t!="undefined"){p.push(encodeURIComponent(r.name)+"="+encodeURIComponent(t));}});});return p.join("&");},destroy:function(){var p=j(this).getElementsByTagName("*");
|
||||
Array.each(p,j);Element.dispose(this);return null;},empty:function(){Array.from(this.childNodes).each(Element.dispose);return this;},dispose:function(){return(this.parentNode)?this.parentNode.removeChild(this):this;
|
||||
},match:function(p){return !p||Slick.match(this,p);}});var a=function(t,s,q){if(!q){t.setAttributeNode(document.createAttribute("id"));}if(t.clearAttributes){t.clearAttributes();
|
||||
t.mergeAttributes(s);t.removeAttribute("uid");if(t.options){var u=t.options,p=s.options;for(var r=u.length;r--;){u[r].selected=p[r].selected;}}}var v=n[s.tagName.toLowerCase()];
|
||||
if(v&&s[v]){t[v]=s[v];}};Element.implement("clone",function(r,p){r=r!==false;var w=this.cloneNode(r),q;if(r){var s=w.getElementsByTagName("*"),u=this.getElementsByTagName("*");
|
||||
for(q=s.length;q--;){a(s[q],u[q],p);}}a(w,this,p);if(Browser.ie){var t=w.getElementsByTagName("object"),v=this.getElementsByTagName("object");for(q=t.length;
|
||||
q--;){t[q].outerHTML=v[q].outerHTML;}}return document.id(w);});var f={contains:function(p){return Slick.contains(this,p);}};if(!document.contains){Document.implement(f);
|
||||
}if(!document.createElement("div").contains){Element.implement(f);}[Element,Window,Document].invoke("implement",{addListener:function(s,r){if(s=="unload"){var p=r,q=this;
|
||||
r=function(){q.removeListener("unload",r);p();};}else{k[$uid(this)]=this;}if(this.addEventListener){this.addEventListener(s,r,!!arguments[2]);}else{this.attachEvent("on"+s,r);
|
||||
}return this;},removeListener:function(q,p){if(this.removeEventListener){this.removeEventListener(q,p,!!arguments[2]);}else{this.detachEvent("on"+q,p);
|
||||
}return this;},retrieve:function(q,p){var s=e($uid(this)),r=s[q];if(p!=null&&r==null){r=s[q]=p;}return r!=null?r:null;},store:function(q,p){var r=e($uid(this));
|
||||
r[q]=p;return this;},eliminate:function(p){var q=e($uid(this));delete q[p];return this;}});if(window.attachEvent&&!window.addEventListener){window.addListener("unload",function(){Object.each(k,j);
|
||||
if(window.CollectGarbage){CollectGarbage();}});}})();Element.Properties={};Element.Properties.style={set:function(a){this.style.cssText=a;},get:function(){return this.style.cssText;
|
||||
},erase:function(){this.style.cssText="";}};Element.Properties.tag={get:function(){return this.tagName.toLowerCase();}};(function(a){if(a!=null){Element.Properties.maxlength=Element.Properties.maxLength={get:function(){var b=this.getAttribute("maxLength");
|
||||
return b==a?null:b;}};}})(document.createElement("input").getAttribute("maxLength"));Element.Properties.html=(function(){var c=Function.attempt(function(){var e=document.createElement("table");
|
||||
e.innerHTML="<tr><td></td></tr>";});var d=document.createElement("div");var a={table:[1,"<table>","</table>"],select:[1,"<select>","</select>"],tbody:[2,"<table><tbody>","</tbody></table>"],tr:[3,"<table><tbody><tr>","</tr></tbody></table>"]};
|
||||
a.thead=a.tfoot=a.tbody;var b={set:function(){var f=Array.flatten(arguments).join("");var g=(!c&&a[this.get("tag")]);if(g){var h=d;h.innerHTML=g[1]+f+g[2];
|
||||
for(var e=g[0];e--;){h=h.firstChild;}this.empty().adopt(h.childNodes);}else{this.innerHTML=f;}}};b.erase=b.set;return b;})();(function(){var c=document.html;
|
||||
Element.Properties.styles={set:function(f){this.setStyles(f);}};var e=(c.style.opacity!=null);var d=/alpha\(opacity=([\d.]+)\)/i;var b=function(g,f){if(!g.currentStyle||!g.currentStyle.hasLayout){g.style.zoom=1;
|
||||
}if(e){g.style.opacity=f;}else{f=(f*100).limit(0,100).round();f=(f==100)?"":"alpha(opacity="+f+")";var h=g.style.filter||g.getComputedStyle("filter")||"";
|
||||
g.style.filter=d.test(h)?h.replace(d,f):h+f;}};Element.Properties.opacity={set:function(g){var f=this.style.visibility;if(g==0&&f!="hidden"){this.style.visibility="hidden";
|
||||
}else{if(g!=0&&f!="visible"){this.style.visibility="visible";}}b(this,g);},get:(e)?function(){var f=this.style.opacity||this.getComputedStyle("opacity");
|
||||
return(f=="")?1:f;}:function(){var f,g=(this.style.filter||this.getComputedStyle("filter"));if(g){f=g.match(d);}return(f==null||g==null)?1:(f[1]/100);}};
|
||||
var a=(c.style.cssFloat==null)?"styleFloat":"cssFloat";Element.implement({getComputedStyle:function(h){if(this.currentStyle){return this.currentStyle[h.camelCase()];
|
||||
}var g=Element.getDocument(this).defaultView,f=g?g.getComputedStyle(this,null):null;return(f)?f.getPropertyValue((h==a)?"float":h.hyphenate()):null;},setOpacity:function(f){b(this,f);
|
||||
return this;},getOpacity:function(){return this.get("opacity");},setStyle:function(g,f){switch(g){case"opacity":return this.set("opacity",parseFloat(f));
|
||||
case"float":g=a;}g=g.camelCase();if(typeOf(f)!="string"){var h=(Element.Styles[g]||"@").split(" ");f=Array.from(f).map(function(k,j){if(!h[j]){return"";
|
||||
}return(typeOf(k)=="number")?h[j].replace("@",Math.round(k)):k;}).join(" ");}else{if(f==String(Number(f))){f=Math.round(f);}}this.style[g]=f;return this;
|
||||
},getStyle:function(l){switch(l){case"opacity":return this.get("opacity");case"float":l=a;}l=l.camelCase();var f=this.style[l];if(!f||l=="zIndex"){f=[];
|
||||
for(var k in Element.ShortStyles){if(l!=k){continue;}for(var j in Element.ShortStyles[k]){f.push(this.getStyle(j));}return f.join(" ");}f=this.getComputedStyle(l);
|
||||
}if(f){f=String(f);var h=f.match(/rgba?\([\d\s,]+\)/);if(h){f=f.replace(h[0],h[0].rgbToHex());}}if(Browser.opera||(Browser.ie&&isNaN(parseFloat(f)))){if((/^(height|width)$/).test(l)){var g=(l=="width")?["left","right"]:["top","bottom"],i=0;
|
||||
g.each(function(m){i+=this.getStyle("border-"+m+"-width").toInt()+this.getStyle("padding-"+m).toInt();},this);return this["offset"+l.capitalize()]-i+"px";
|
||||
}if(Browser.opera&&String(f).indexOf("px")!=-1){return f;}if((/^border(.+)Width|margin|padding/).test(l)){return"0px";}}return f;},setStyles:function(g){for(var f in g){this.setStyle(f,g[f]);
|
||||
}return this;},getStyles:function(){var f={};Array.flatten(arguments).each(function(g){f[g]=this.getStyle(g);},this);return f;}});Element.Styles={left:"@px",top:"@px",bottom:"@px",right:"@px",width:"@px",height:"@px",maxWidth:"@px",maxHeight:"@px",minWidth:"@px",minHeight:"@px",backgroundColor:"rgb(@, @, @)",backgroundPosition:"@px @px",color:"rgb(@, @, @)",fontSize:"@px",letterSpacing:"@px",lineHeight:"@px",clip:"rect(@px @px @px @px)",margin:"@px @px @px @px",padding:"@px @px @px @px",border:"@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)",borderWidth:"@px @px @px @px",borderStyle:"@ @ @ @",borderColor:"rgb(@, @, @) rgb(@, @, @) rgb(@, @, @) rgb(@, @, @)",zIndex:"@",zoom:"@",fontWeight:"@",textIndent:"@px",opacity:"@"};
|
||||
Element.ShortStyles={margin:{},padding:{},border:{},borderWidth:{},borderStyle:{},borderColor:{}};["Top","Right","Bottom","Left"].each(function(l){var k=Element.ShortStyles;
|
||||
var g=Element.Styles;["margin","padding"].each(function(m){var n=m+l;k[m][n]=g[n]="@px";});var j="border"+l;k.border[j]=g[j]="@px @ rgb(@, @, @)";var i=j+"Width",f=j+"Style",h=j+"Color";
|
||||
k[j]={};k.borderWidth[i]=k[j][i]=g[i]="@px";k.borderStyle[f]=k[j][f]=g[f]="@";k.borderColor[h]=k[j][h]=g[h]="rgb(@, @, @)";});})();(function(){Element.Properties.events={set:function(b){this.addEvents(b);
|
||||
}};[Element,Window,Document].invoke("implement",{addEvent:function(f,h){var i=this.retrieve("events",{});if(!i[f]){i[f]={keys:[],values:[]};}if(i[f].keys.contains(h)){return this;
|
||||
}i[f].keys.push(h);var g=f,b=Element.Events[f],d=h,j=this;if(b){if(b.onAdd){b.onAdd.call(this,h);}if(b.condition){d=function(k){if(b.condition.call(this,k)){return h.call(this,k);
|
||||
}return true;};}g=b.base||g;}var e=function(){return h.call(j);};var c=Element.NativeEvents[g];if(c){if(c==2){e=function(k){k=new Event(k,j.getWindow());
|
||||
if(d.call(j,k)===false){k.stop();}};}this.addListener(g,e,arguments[2]);}i[f].values.push(e);return this;},removeEvent:function(e,d){var c=this.retrieve("events");
|
||||
if(!c||!c[e]){return this;}var h=c[e];var b=h.keys.indexOf(d);if(b==-1){return this;}var g=h.values[b];delete h.keys[b];delete h.values[b];var f=Element.Events[e];
|
||||
if(f){if(f.onRemove){f.onRemove.call(this,d);}e=f.base||e;}return(Element.NativeEvents[e])?this.removeListener(e,g,arguments[2]):this;},addEvents:function(b){for(var c in b){this.addEvent(c,b[c]);
|
||||
}return this;},removeEvents:function(b){var d;if(typeOf(b)=="object"){for(d in b){this.removeEvent(d,b[d]);}return this;}var c=this.retrieve("events");
|
||||
if(!c){return this;}if(!b){for(d in c){this.removeEvents(d);}this.eliminate("events");}else{if(c[b]){c[b].keys.each(function(e){this.removeEvent(b,e);},this);
|
||||
delete c[b];}}return this;},fireEvent:function(e,c,b){var d=this.retrieve("events");if(!d||!d[e]){return this;}c=Array.from(c);d[e].keys.each(function(f){if(b){f.delay(b,this,c);
|
||||
}else{f.apply(this,c);}},this);return this;},cloneEvents:function(e,d){e=document.id(e);var c=e.retrieve("events");if(!c){return this;}if(!d){for(var b in c){this.cloneEvents(e,b);
|
||||
}}else{if(c[d]){c[d].keys.each(function(f){this.addEvent(d,f);},this);}}return this;}});Element.NativeEvents={click:2,dblclick:2,mouseup:2,mousedown:2,contextmenu:2,mousewheel:2,DOMMouseScroll:2,mouseover:2,mouseout:2,mousemove:2,selectstart:2,selectend:2,keydown:2,keypress:2,keyup:2,orientationchange:2,touchstart:2,touchmove:2,touchend:2,touchcancel:2,gesturestart:2,gesturechange:2,gestureend:2,focus:2,blur:2,change:2,reset:2,select:2,submit:2,load:2,unload:1,beforeunload:2,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,error:1,abort:1,scroll:1};
|
||||
var a=function(b){var c=b.relatedTarget;if(c==null){return true;}if(!c){return false;}return(c!=this&&c.prefix!="xul"&&typeOf(this)!="document"&&!this.contains(c));
|
||||
};Element.Events={mouseenter:{base:"mouseover",condition:a},mouseleave:{base:"mouseout",condition:a},mousewheel:{base:(Browser.firefox)?"DOMMouseScroll":"mousewheel"}};
|
||||
})();(function(){var h=document.createElement("div"),e=document.createElement("div");h.style.height="0";h.appendChild(e);var d=(e.offsetParent===h);h=e=null;
|
||||
var l=function(m){return k(m,"position")!="static"||a(m);};var i=function(m){return l(m)||(/^(?:table|td|th)$/i).test(m.tagName);};Element.implement({scrollTo:function(m,n){if(a(this)){this.getWindow().scrollTo(m,n);
|
||||
}else{this.scrollLeft=m;this.scrollTop=n;}return this;},getSize:function(){if(a(this)){return this.getWindow().getSize();}return{x:this.offsetWidth,y:this.offsetHeight};
|
||||
},getScrollSize:function(){if(a(this)){return this.getWindow().getScrollSize();}return{x:this.scrollWidth,y:this.scrollHeight};},getScroll:function(){if(a(this)){return this.getWindow().getScroll();
|
||||
}return{x:this.scrollLeft,y:this.scrollTop};},getScrolls:function(){var n=this.parentNode,m={x:0,y:0};while(n&&!a(n)){m.x+=n.scrollLeft;m.y+=n.scrollTop;
|
||||
n=n.parentNode;}return m;},getOffsetParent:d?function(){var m=this;if(a(m)||k(m,"position")=="fixed"){return null;}var n=(k(m,"position")=="static")?i:l;
|
||||
while((m=m.parentNode)){if(n(m)){return m;}}return null;}:function(){var m=this;if(a(m)||k(m,"position")=="fixed"){return null;}try{return m.offsetParent;
|
||||
}catch(n){}return null;},getOffsets:function(){if(this.getBoundingClientRect&&!Browser.Platform.ios){var r=this.getBoundingClientRect(),o=document.id(this.getDocument().documentElement),q=o.getScroll(),t=this.getScrolls(),s=(k(this,"position")=="fixed");
|
||||
return{x:r.left.toInt()+t.x+((s)?0:q.x)-o.clientLeft,y:r.top.toInt()+t.y+((s)?0:q.y)-o.clientTop};}var n=this,m={x:0,y:0};if(a(this)){return m;}while(n&&!a(n)){m.x+=n.offsetLeft;
|
||||
m.y+=n.offsetTop;if(Browser.firefox){if(!c(n)){m.x+=b(n);m.y+=g(n);}var p=n.parentNode;if(p&&k(p,"overflow")!="visible"){m.x+=b(p);m.y+=g(p);}}else{if(n!=this&&Browser.safari){m.x+=b(n);
|
||||
m.y+=g(n);}}n=n.offsetParent;}if(Browser.firefox&&!c(this)){m.x-=b(this);m.y-=g(this);}return m;},getPosition:function(p){if(a(this)){return{x:0,y:0};}var q=this.getOffsets(),n=this.getScrolls();
|
||||
var m={x:q.x-n.x,y:q.y-n.y};if(p&&(p=document.id(p))){var o=p.getPosition();return{x:m.x-o.x-b(p),y:m.y-o.y-g(p)};}return m;},getCoordinates:function(o){if(a(this)){return this.getWindow().getCoordinates();
|
||||
}var m=this.getPosition(o),n=this.getSize();var p={left:m.x,top:m.y,width:n.x,height:n.y};p.right=p.left+p.width;p.bottom=p.top+p.height;return p;},computePosition:function(m){return{left:m.x-j(this,"margin-left"),top:m.y-j(this,"margin-top")};
|
||||
},setPosition:function(m){return this.setStyles(this.computePosition(m));}});[Document,Window].invoke("implement",{getSize:function(){var m=f(this);return{x:m.clientWidth,y:m.clientHeight};
|
||||
},getScroll:function(){var n=this.getWindow(),m=f(this);return{x:n.pageXOffset||m.scrollLeft,y:n.pageYOffset||m.scrollTop};},getScrollSize:function(){var o=f(this),n=this.getSize(),m=this.getDocument().body;
|
||||
return{x:Math.max(o.scrollWidth,m.scrollWidth,n.x),y:Math.max(o.scrollHeight,m.scrollHeight,n.y)};},getPosition:function(){return{x:0,y:0};},getCoordinates:function(){var m=this.getSize();
|
||||
return{top:0,left:0,bottom:m.y,right:m.x,height:m.y,width:m.x};}});var k=Element.getComputedStyle;function j(m,n){return k(m,n).toInt()||0;}function c(m){return k(m,"-moz-box-sizing")=="border-box";
|
||||
}function g(m){return j(m,"border-top-width");}function b(m){return j(m,"border-left-width");}function a(m){return(/^(?:body|html)$/i).test(m.tagName);
|
||||
}function f(m){var n=m.getDocument();return(!n.compatMode||n.compatMode=="CSS1Compat")?n.html:n.body;}})();Element.alias({position:"setPosition"});[Window,Document,Element].invoke("implement",{getHeight:function(){return this.getSize().y;
|
||||
},getWidth:function(){return this.getSize().x;},getScrollTop:function(){return this.getScroll().y;},getScrollLeft:function(){return this.getScroll().x;
|
||||
},getScrollHeight:function(){return this.getScrollSize().y;},getScrollWidth:function(){return this.getScrollSize().x;},getTop:function(){return this.getPosition().y;
|
||||
},getLeft:function(){return this.getPosition().x;}});(function(){var f=this.Fx=new Class({Implements:[Chain,Events,Options],options:{fps:60,unit:false,duration:500,frames:null,frameSkip:true,link:"ignore"},initialize:function(g){this.subject=this.subject||this;
|
||||
this.setOptions(g);},getTransition:function(){return function(g){return -(Math.cos(Math.PI*g)-1)/2;};},step:function(g){if(this.options.frameSkip){var h=(this.time!=null)?(g-this.time):0,i=h/this.frameInterval;
|
||||
this.time=g;this.frame+=i;}else{this.frame++;}if(this.frame<this.frames){var j=this.transition(this.frame/this.frames);this.set(this.compute(this.from,this.to,j));
|
||||
}else{this.frame=this.frames;this.set(this.compute(this.from,this.to,1));this.stop();}},set:function(g){return g;},compute:function(i,h,g){return f.compute(i,h,g);
|
||||
},check:function(){if(!this.isRunning()){return true;}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(this.caller.pass(arguments,this));
|
||||
return false;}return false;},start:function(k,j){if(!this.check(k,j)){return this;}this.from=k;this.to=j;this.frame=(this.options.frameSkip)?0:-1;this.time=null;
|
||||
this.transition=this.getTransition();var i=this.options.frames,h=this.options.fps,g=this.options.duration;this.duration=f.Durations[g]||g.toInt();this.frameInterval=1000/h;
|
||||
this.frames=i||Math.round(this.duration/this.frameInterval);this.fireEvent("start",this.subject);b.call(this,h);return this;},stop:function(){if(this.isRunning()){this.time=null;
|
||||
d.call(this,this.options.fps);if(this.frames==this.frame){this.fireEvent("complete",this.subject);if(!this.callChain()){this.fireEvent("chainComplete",this.subject);
|
||||
}}else{this.fireEvent("stop",this.subject);}}return this;},cancel:function(){if(this.isRunning()){this.time=null;d.call(this,this.options.fps);this.frame=this.frames;
|
||||
this.fireEvent("cancel",this.subject).clearChain();}return this;},pause:function(){if(this.isRunning()){this.time=null;d.call(this,this.options.fps);}return this;
|
||||
},resume:function(){if((this.frame<this.frames)&&!this.isRunning()){b.call(this,this.options.fps);}return this;},isRunning:function(){var g=e[this.options.fps];
|
||||
return g&&g.contains(this);}});f.compute=function(i,h,g){return(h-i)*g+i;};f.Durations={"short":250,normal:500,"long":1000};var e={},c={};var a=function(){var h=Date.now();
|
||||
for(var j=this.length;j--;){var g=this[j];if(g){g.step(h);}}};var b=function(h){var g=e[h]||(e[h]=[]);g.push(this);if(!c[h]){c[h]=a.periodical(Math.round(1000/h),g);
|
||||
}};var d=function(h){var g=e[h];if(g){g.erase(this);if(!g.length&&c[h]){delete e[h];c[h]=clearInterval(c[h]);}}};})();Fx.CSS=new Class({Extends:Fx,prepare:function(c,d,b){b=Array.from(b);
|
||||
if(b[1]==null){b[1]=b[0];b[0]=c.getStyle(d);}var a=b.map(this.parse);return{from:a[0],to:a[1]};},parse:function(a){a=Function.from(a)();a=(typeof a=="string")?a.split(" "):Array.from(a);
|
||||
return a.map(function(c){c=String(c);var b=false;Object.each(Fx.CSS.Parsers,function(f,e){if(b){return;}var d=f.parse(c);if(d||d===0){b={value:d,parser:f};
|
||||
}});b=b||{value:c,parser:Fx.CSS.Parsers.String};return b;});},compute:function(d,c,b){var a=[];(Math.min(d.length,c.length)).times(function(e){a.push({value:d[e].parser.compute(d[e].value,c[e].value,b),parser:d[e].parser});
|
||||
});a.$family=Function.from("fx:css:value");return a;},serve:function(c,b){if(typeOf(c)!="fx:css:value"){c=this.parse(c);}var a=[];c.each(function(d){a=a.concat(d.parser.serve(d.value,b));
|
||||
});return a;},render:function(a,d,c,b){a.setStyle(d,this.serve(c,b));},search:function(a){if(Fx.CSS.Cache[a]){return Fx.CSS.Cache[a];}var c={},b=new RegExp("^"+a.escapeRegExp()+"$");
|
||||
Array.each(document.styleSheets,function(f,e){var d=f.href;if(d&&d.contains("://")&&!d.contains(document.domain)){return;}var g=f.rules||f.cssRules;Array.each(g,function(k,h){if(!k.style){return;
|
||||
}var j=(k.selectorText)?k.selectorText.replace(/^\w+/,function(i){return i.toLowerCase();}):null;if(!j||!b.test(j)){return;}Object.each(Element.Styles,function(l,i){if(!k.style[i]||Element.ShortStyles[i]){return;
|
||||
}l=String(k.style[i]);c[i]=((/^rgb/).test(l))?l.rgbToHex():l;});});});return Fx.CSS.Cache[a]=c;}});Fx.CSS.Cache={};Fx.CSS.Parsers={Color:{parse:function(a){if(a.match(/^#[0-9a-f]{3,6}$/i)){return a.hexToRgb(true);
|
||||
}return((a=a.match(/(\d+),\s*(\d+),\s*(\d+)/)))?[a[1],a[2],a[3]]:false;},compute:function(c,b,a){return c.map(function(e,d){return Math.round(Fx.compute(c[d],b[d],a));
|
||||
});},serve:function(a){return a.map(Number);}},Number:{parse:parseFloat,compute:Fx.compute,serve:function(b,a){return(a)?b+a:b;}},String:{parse:Function.from(false),compute:function(b,a){return a;
|
||||
},serve:function(a){return a;}}};Fx.Tween=new Class({Extends:Fx.CSS,initialize:function(b,a){this.element=this.subject=document.id(b);this.parent(a);},set:function(b,a){if(arguments.length==1){a=b;
|
||||
b=this.property||this.options.property;}this.render(this.element,b,a,this.options.unit);return this;},start:function(c,e,d){if(!this.check(c,e,d)){return this;
|
||||
}var b=Array.flatten(arguments);this.property=this.options.property||b.shift();var a=this.prepare(this.element,this.property,b);return this.parent(a.from,a.to);
|
||||
}});Element.Properties.tween={set:function(a){this.get("tween").cancel().setOptions(a);return this;},get:function(){var a=this.retrieve("tween");if(!a){a=new Fx.Tween(this,{link:"cancel"});
|
||||
this.store("tween",a);}return a;}};Element.implement({tween:function(a,c,b){this.get("tween").start(arguments);return this;},fade:function(c){var e=this.get("tween"),d="opacity",a;
|
||||
c=[c,"toggle"].pick();switch(c){case"in":e.start(d,1);break;case"out":e.start(d,0);break;case"show":e.set(d,1);break;case"hide":e.set(d,0);break;case"toggle":var b=this.retrieve("fade:flag",this.get("opacity")==1);
|
||||
e.start(d,(b)?0:1);this.store("fade:flag",!b);a=true;break;default:e.start(d,arguments);}if(!a){this.eliminate("fade:flag");}return this;},highlight:function(c,a){if(!a){a=this.retrieve("highlight:original",this.getStyle("background-color"));
|
||||
a=(a=="transparent")?"#fff":a;}var b=this.get("tween");b.start("background-color",c||"#ffff88",a).chain(function(){this.setStyle("background-color",this.retrieve("highlight:original"));
|
||||
b.callChain();}.bind(this));return this;}});Fx.Morph=new Class({Extends:Fx.CSS,initialize:function(b,a){this.element=this.subject=document.id(b);this.parent(a);
|
||||
},set:function(a){if(typeof a=="string"){a=this.search(a);}for(var b in a){this.render(this.element,b,a[b],this.options.unit);}return this;},compute:function(e,d,c){var a={};
|
||||
for(var b in e){a[b]=this.parent(e[b],d[b],c);}return a;},start:function(b){if(!this.check(b)){return this;}if(typeof b=="string"){b=this.search(b);}var e={},d={};
|
||||
for(var c in b){var a=this.prepare(this.element,c,b[c]);e[c]=a.from;d[c]=a.to;}return this.parent(e,d);}});Element.Properties.morph={set:function(a){this.get("morph").cancel().setOptions(a);
|
||||
return this;},get:function(){var a=this.retrieve("morph");if(!a){a=new Fx.Morph(this,{link:"cancel"});this.store("morph",a);}return a;}};Element.implement({morph:function(a){this.get("morph").start(a);
|
||||
return this;}});Fx.implement({getTransition:function(){var a=this.options.transition||Fx.Transitions.Sine.easeInOut;if(typeof a=="string"){var b=a.split(":");
|
||||
a=Fx.Transitions;a=a[b[0]]||a[b[0].capitalize()];if(b[1]){a=a["ease"+b[1].capitalize()+(b[2]?b[2].capitalize():"")];}}return a;}});Fx.Transition=function(c,b){b=Array.from(b);
|
||||
var a=function(d){return c(d,b);};return Object.append(a,{easeIn:a,easeOut:function(d){return 1-c(1-d,b);},easeInOut:function(d){return(d<=0.5?c(2*d,b):(2-c(2*(1-d),b)))/2;
|
||||
}});};Fx.Transitions={linear:function(a){return a;}};Fx.Transitions.extend=function(a){for(var b in a){Fx.Transitions[b]=new Fx.Transition(a[b]);}};Fx.Transitions.extend({Pow:function(b,a){return Math.pow(b,a&&a[0]||6);
|
||||
},Expo:function(a){return Math.pow(2,8*(a-1));},Circ:function(a){return 1-Math.sin(Math.acos(a));},Sine:function(a){return 1-Math.cos(a*Math.PI/2);},Back:function(b,a){a=a&&a[0]||1.618;
|
||||
return Math.pow(b,2)*((a+1)*b-a);},Bounce:function(f){var e;for(var d=0,c=1;1;d+=c,c/=2){if(f>=(7-4*d)/11){e=c*c-Math.pow((11-6*d-11*f)/4,2);break;}}return e;
|
||||
},Elastic:function(b,a){return Math.pow(2,10*--b)*Math.cos(20*b*Math.PI*(a&&a[0]||1)/3);}});["Quad","Cubic","Quart","Quint"].each(function(b,a){Fx.Transitions[b]=new Fx.Transition(function(c){return Math.pow(c,a+2);
|
||||
});});(function(){var d=function(){},a=("onprogress" in new Browser.Request);var c=this.Request=new Class({Implements:[Chain,Events,Options],options:{url:"",data:"",headers:{"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*"},async:true,format:false,method:"post",link:"ignore",isSuccess:null,emulation:true,urlEncoded:true,encoding:"utf-8",evalScripts:false,evalResponse:false,timeout:0,noCache:false},initialize:function(e){this.xhr=new Browser.Request();
|
||||
this.setOptions(e);this.headers=this.options.headers;},onStateChange:function(){var e=this.xhr;if(e.readyState!=4||!this.running){return;}this.running=false;
|
||||
this.status=0;Function.attempt(function(){var f=e.status;this.status=(f==1223)?204:f;}.bind(this));e.onreadystatechange=d;if(a){e.onprogress=e.onloadstart=d;
|
||||
}clearTimeout(this.timer);this.response={text:this.xhr.responseText||"",xml:this.xhr.responseXML};if(this.options.isSuccess.call(this,this.status)){this.success(this.response.text,this.response.xml);
|
||||
}else{this.failure();}},isSuccess:function(){var e=this.status;return(e>=200&&e<300);},isRunning:function(){return !!this.running;},processScripts:function(e){if(this.options.evalResponse||(/(ecma|java)script/).test(this.getHeader("Content-type"))){return Browser.exec(e);
|
||||
}return e.stripScripts(this.options.evalScripts);},success:function(f,e){this.onSuccess(this.processScripts(f),e);},onSuccess:function(){this.fireEvent("complete",arguments).fireEvent("success",arguments).callChain();
|
||||
},failure:function(){this.onFailure();},onFailure:function(){this.fireEvent("complete").fireEvent("failure",this.xhr);},loadstart:function(e){this.fireEvent("loadstart",[e,this.xhr]);
|
||||
},progress:function(e){this.fireEvent("progress",[e,this.xhr]);},timeout:function(){this.fireEvent("timeout",this.xhr);},setHeader:function(e,f){this.headers[e]=f;
|
||||
return this;},getHeader:function(e){return Function.attempt(function(){return this.xhr.getResponseHeader(e);}.bind(this));},check:function(){if(!this.running){return true;
|
||||
}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(this.caller.pass(arguments,this));return false;}return false;},send:function(o){if(!this.check(o)){return this;
|
||||
}this.options.isSuccess=this.options.isSuccess||this.isSuccess;this.running=true;var l=typeOf(o);if(l=="string"||l=="element"){o={data:o};}var h=this.options;
|
||||
o=Object.append({data:h.data,url:h.url,method:h.method},o);var j=o.data,f=String(o.url),e=o.method.toLowerCase();switch(typeOf(j)){case"element":j=document.id(j).toQueryString();
|
||||
break;case"object":case"hash":j=Object.toQueryString(j);}if(this.options.format){var m="format="+this.options.format;j=(j)?m+"&"+j:m;}if(this.options.emulation&&!["get","post"].contains(e)){var k="_method="+e;
|
||||
j=(j)?k+"&"+j:k;e="post";}if(this.options.urlEncoded&&["post","put"].contains(e)){var g=(this.options.encoding)?"; charset="+this.options.encoding:"";this.headers["Content-type"]="application/x-www-form-urlencoded"+g;
|
||||
}if(!f){f=document.location.pathname;}var i=f.lastIndexOf("/");if(i>-1&&(i=f.indexOf("#"))>-1){f=f.substr(0,i);}if(this.options.noCache){f+=(f.contains("?")?"&":"?")+String.uniqueID();
|
||||
}if(j&&e=="get"){f+=(f.contains("?")?"&":"?")+j;j=null;}var n=this.xhr;if(a){n.onloadstart=this.loadstart.bind(this);n.onprogress=this.progress.bind(this);
|
||||
}n.open(e.toUpperCase(),f,this.options.async,this.options.user,this.options.password);if(this.options.user&&"withCredentials" in n){n.withCredentials=true;
|
||||
}n.onreadystatechange=this.onStateChange.bind(this);Object.each(this.headers,function(q,p){try{n.setRequestHeader(p,q);}catch(r){this.fireEvent("exception",[p,q]);
|
||||
}},this);this.fireEvent("request");n.send(j);if(!this.options.async){this.onStateChange();}if(this.options.timeout){this.timer=this.timeout.delay(this.options.timeout,this);
|
||||
}return this;},cancel:function(){if(!this.running){return this;}this.running=false;var e=this.xhr;e.abort();clearTimeout(this.timer);e.onreadystatechange=d;
|
||||
if(a){e.onprogress=e.onloadstart=d;}this.xhr=new Browser.Request();this.fireEvent("cancel");return this;}});var b={};["get","post","put","delete","GET","POST","PUT","DELETE"].each(function(e){b[e]=function(g){var f={method:e};
|
||||
if(g!=null){f.data=g;}return this.send(f);};});c.implement(b);Element.Properties.send={set:function(e){var f=this.get("send").cancel();f.setOptions(e);
|
||||
return this;},get:function(){var e=this.retrieve("send");if(!e){e=new c({data:this,link:"cancel",method:this.get("method")||"post",url:this.get("action")});
|
||||
this.store("send",e);}return e;}};Element.implement({send:function(e){var f=this.get("send");f.send({data:this,url:e||f.options.url});return this;}});})();
|
||||
Request.HTML=new Class({Extends:Request,options:{update:false,append:false,evalScripts:true,filter:false,headers:{Accept:"text/html, application/xml, text/xml, */*"}},success:function(e){var d=this.options,b=this.response;
|
||||
b.html=e.stripScripts(function(f){b.javascript=f;});var c=b.html.match(/<body[^>]*>([\s\S]*?)<\/body>/i);if(c){b.html=c[1];}var a=new Element("div").set("html",b.html);
|
||||
b.tree=a.childNodes;b.elements=a.getElements("*");if(d.filter){b.tree=b.elements.filter(d.filter);}if(d.update){document.id(d.update).empty().set("html",b.html);
|
||||
}else{if(d.append){document.id(d.append).adopt(a.getChildren());}}if(d.evalScripts){Browser.exec(b.javascript);}this.onSuccess(b.tree,b.elements,b.html,b.javascript);
|
||||
}});Element.Properties.load={set:function(a){var b=this.get("load").cancel();b.setOptions(a);return this;},get:function(){var a=this.retrieve("load");if(!a){a=new Request.HTML({data:this,link:"cancel",update:this,method:"get"});
|
||||
this.store("load",a);}return a;}};Element.implement({load:function(){this.get("load").send(Array.link(arguments,{data:Type.isObject,url:Type.isString}));
|
||||
return this;}});if(typeof JSON=="undefined"){this.JSON={};}(function(){var special={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};
|
||||
var escape=function(chr){return special[chr]||"\\u"+("0000"+chr.charCodeAt(0).toString(16)).slice(-4);};JSON.validate=function(string){string=string.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"");
|
||||
return(/^[\],:{}\s]*$/).test(string);};JSON.encode=JSON.stringify?function(obj){return JSON.stringify(obj);}:function(obj){if(obj&&obj.toJSON){obj=obj.toJSON();
|
||||
}switch(typeOf(obj)){case"string":return'"'+obj.replace(/[\x00-\x1f\\"]/g,escape)+'"';case"array":return"["+obj.map(JSON.encode).clean()+"]";case"object":case"hash":var string=[];
|
||||
Object.each(obj,function(value,key){var json=JSON.encode(value);if(json){string.push(JSON.encode(key)+":"+json);}});return"{"+string+"}";case"number":case"boolean":return""+obj;
|
||||
case"null":return"null";}return null;};JSON.decode=function(string,secure){if(!string||typeOf(string)!="string"){return null;}if(secure||JSON.secure){if(JSON.parse){return JSON.parse(string);
|
||||
}if(!JSON.validate(string)){throw new Error("JSON could not decode the input; security is enabled and the value is not secure.");}}return eval("("+string+")");
|
||||
};})();Request.JSON=new Class({Extends:Request,options:{secure:true},initialize:function(a){this.parent(a);Object.append(this.headers,{Accept:"application/json","X-Request":"JSON"});
|
||||
},success:function(c){var b;try{b=this.response.json=JSON.decode(c,this.options.secure);}catch(a){this.fireEvent("error",[c,a]);return;}if(b==null){this.onFailure();
|
||||
}else{this.onSuccess(b,c);}}});var Cookie=new Class({Implements:Options,options:{path:"/",domain:false,duration:false,secure:false,document:document,encode:true},initialize:function(b,a){this.key=b;
|
||||
this.setOptions(a);},write:function(b){if(this.options.encode){b=encodeURIComponent(b);}if(this.options.domain){b+="; domain="+this.options.domain;}if(this.options.path){b+="; path="+this.options.path;
|
||||
}if(this.options.duration){var a=new Date();a.setTime(a.getTime()+this.options.duration*24*60*60*1000);b+="; expires="+a.toGMTString();}if(this.options.secure){b+="; secure";
|
||||
}this.options.document.cookie=this.key+"="+b;return this;},read:function(){var a=this.options.document.cookie.match("(?:^|;)\\s*"+this.key.escapeRegExp()+"=([^;]*)");
|
||||
return(a)?decodeURIComponent(a[1]):null;},dispose:function(){new Cookie(this.key,Object.merge({},this.options,{duration:-1})).write("");return this;}});
|
||||
Cookie.write=function(b,c,a){return new Cookie(b,a).write(c);};Cookie.read=function(a){return new Cookie(a).read();};Cookie.dispose=function(b,a){return new Cookie(b,a).dispose();
|
||||
};(function(i,k){var l,f,e=[],c,b,d=k.createElement("div");var g=function(){clearTimeout(b);if(l){return;}Browser.loaded=l=true;k.removeListener("DOMContentLoaded",g).removeListener("readystatechange",a);
|
||||
k.fireEvent("domready");i.fireEvent("domready");};var a=function(){for(var m=e.length;m--;){if(e[m]()){g();return true;}}return false;};var j=function(){clearTimeout(b);
|
||||
if(!a()){b=setTimeout(j,10);}};k.addListener("DOMContentLoaded",g);var h=function(){try{d.doScroll();return true;}catch(m){}return false;};if(d.doScroll&&!h()){e.push(h);
|
||||
c=true;}if(k.readyState){e.push(function(){var m=k.readyState;return(m=="loaded"||m=="complete");});}if("onreadystatechange" in k){k.addListener("readystatechange",a);
|
||||
}else{c=true;}if(c){j();}Element.Events.domready={onAdd:function(m){if(l){m.call(this);}}};Element.Events.load={base:"load",onAdd:function(m){if(f&&this==i){m.call(this);
|
||||
}},condition:function(){if(this==i){g();delete Element.Events.load;}return true;}};i.addEvent("load",function(){f=true;});})(window,document);(function(){var Swiff=this.Swiff=new Class({Implements:Options,options:{id:null,height:1,width:1,container:null,properties:{},params:{quality:"high",allowScriptAccess:"always",wMode:"window",swLiveConnect:true},callBacks:{},vars:{}},toElement:function(){return this.object;
|
||||
},initialize:function(path,options){this.instance="Swiff_"+String.uniqueID();this.setOptions(options);options=this.options;var id=this.id=options.id||this.instance;
|
||||
var container=document.id(options.container);Swiff.CallBacks[this.instance]={};var params=options.params,vars=options.vars,callBacks=options.callBacks;
|
||||
var properties=Object.append({height:options.height,width:options.width},options.properties);var self=this;for(var callBack in callBacks){Swiff.CallBacks[this.instance][callBack]=(function(option){return function(){return option.apply(self.object,arguments);
|
||||
};})(callBacks[callBack]);vars[callBack]="Swiff.CallBacks."+this.instance+"."+callBack;}params.flashVars=Object.toQueryString(vars);if(Browser.ie){properties.classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";
|
||||
params.movie=path;}else{properties.type="application/x-shockwave-flash";}properties.data=path;var build='<object id="'+id+'"';for(var property in properties){build+=" "+property+'="'+properties[property]+'"';
|
||||
}build+=">";for(var param in params){if(params[param]){build+='<param name="'+param+'" value="'+params[param]+'" />';}}build+="</object>";this.object=((container)?container.empty():new Element("div")).set("html",build).firstChild;
|
||||
},replaces:function(element){element=document.id(element,true);element.parentNode.replaceChild(this.toElement(),element);return this;},inject:function(element){document.id(element,true).appendChild(this.toElement());
|
||||
return this;},remote:function(){return Swiff.remote.apply(Swiff,[this.toElement()].append(arguments));}});Swiff.CallBacks={};Swiff.remote=function(obj,fn){var rs=obj.CallFunction('<invoke name="'+fn+'" returntype="javascript">'+__flash__argumentsToXML(arguments,2)+"</invoke>");
|
||||
return eval(rs);};})();
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user