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:
Pablol
2011-08-07 19:51:03 -03:00
64 changed files with 2099 additions and 9840 deletions

View File

@@ -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;
}

View 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>

View File

@@ -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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 476 B

View File

@@ -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();
}
});
}

View 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();

View File

@@ -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);}});})();