Merge branch 'wise-doc' of ssh://wisemapping.com/var/git-repos/wise-source into wise-doc

This commit is contained in:
Pablol 2011-08-10 23:12:19 -03:00
commit 37734ea95c
11 changed files with 67 additions and 253 deletions

View File

@ -49,12 +49,10 @@
<output>${basedir}/target/classes/core.js</output> <output>${basedir}/target/classes/core.js</output>
<includes> <includes>
<include>${basedir}/target/tmp/header-min.js</include> <include>${basedir}/target/tmp/header-min.js</include>
<include>${basedir}/target/tmp/ColorPicker-min.js</include>
<include>${basedir}/target/tmp/Functions-min.js</include> <include>${basedir}/target/tmp/Functions-min.js</include>
<include>${basedir}/target/tmp/log4js-min.js</include> <include>${basedir}/target/tmp/log4js-min.js</include>
<include>${basedir}/target/tmp/Monitor-min.js</include> <include>${basedir}/target/tmp/Monitor-min.js</include>
<include>${basedir}/target/tmp/Point-min.js</include> <include>${basedir}/target/tmp/Point-min.js</include>
<include>${basedir}/target/tmp/UserAgent-min.js</include>
<include>${basedir}/target/tmp/Utils-min.js</include> <include>${basedir}/target/tmp/Utils-min.js</include>
<include>${basedir}/target/tmp/WaitDialog-min.js</include> <include>${basedir}/target/tmp/WaitDialog-min.js</include>
<include>${basedir}/target/tmp/footer-min.js</include> <include>${basedir}/target/tmp/footer-min.js</include>

View File

@ -1,94 +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.ColorPicker = function()
{
this.palette = "7x10";
this._palettes = {"7x10": [["fff", "fcc", "fc9", "ff9", "ffc", "9f9", "9ff", "cff", "ccf", "fcf"],
["ccc", "f66", "f96", "ff6", "ff3", "6f9", "3ff", "6ff", "99f", "f9f"],
["c0c0c0", "f00", "f90", "fc6", "ff0", "3f3", "6cc", "3cf", "66c", "c6c"],
["999", "c00", "f60", "fc3", "fc0", "3c0", "0cc", "36f", "63f", "c3c"],
["666", "900", "c60", "c93", "990", "090", "399", "33f", "60c", "939"],
["333", "600", "930", "963", "660", "060", "366", "009", "339", "636"],
["000", "300", "630", "633", "330", "030", "033", "006", "309", "303"]],
"3x4": [["ffffff"/*white*/, "00ff00"/*lime*/, "008000"/*green*/, "0000ff"/*blue*/],
["c0c0c0"/*silver*/, "ffff00"/*yellow*/, "ff00ff"/*fuchsia*/, "000080"/*navy*/],
["808080"/*gray*/, "ff0000"/*red*/, "800080"/*purple*/, "000000"/*black*/]]
//["00ffff"/*aqua*/, "808000"/*olive*/, "800000"/*maroon*/, "008080"/*teal*/]];
};
};
core.ColorPicker.buildRendering = function ()
{
this.domNode = document.createElement("table");
// dojo.html.disableSelection(this.domNode);
// dojo.event.connect(this.domNode, "onmousedown", function (e) {
// e.preventDefault();
// });
with (this.domNode) { // set the table's properties
cellPadding = "0";
cellSpacing = "1";
border = "1";
style.backgroundColor = "white";
}
var colors = this._palettes[this.palette];
for (var i = 0; i < colors.length; i++) {
var tr = this.domNode.insertRow(-1);
for (var j = 0; j < colors[i].length; j++) {
if (colors[i][j].length == 3) {
colors[i][j] = colors[i][j].replace(/(.)(.)(.)/, "$1$1$2$2$3$3");
}
var td = tr.insertCell(-1);
with (td.style) {
backgroundColor = "#" + colors[i][j];
border = "1px solid gray";
width = height = "15px";
fontSize = "1px";
}
td.color = "#" + colors[i][j];
td.onmouseover = function (e) {
this.style.borderColor = "white";
};
td.onmouseout = function (e) {
this.style.borderColor = "gray";
};
// dojo.event.connect(td, "onmousedown", this, "onClick");
td.innerHTML = "&nbsp;";
}
}
};
core.ColorPicker.onClick = function(/*Event*/ e)
{
this.onColorSelect(e.currentTarget.color);
e.currentTarget.style.borderColor = "gray";
};
core.ColorPicker.onColorSelect = function(color)
{
// summary:
// Callback when a color is selected.
// color: String
// Hex value corresponding to color.
};

View File

@ -1,135 +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.UserAgent = {
isMozillaFamily: function()
{
return this.browser == "Netscape" || this.browser == "Firefox";
},
isIE: function()
{
return this.browser == "Explorer";
},
init: function () {
this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
this.version = this.searchVersion(navigator.userAgent)
|| this.searchVersion(navigator.appVersion)
|| "an unknown version";
this.OS = this.searchString(this.dataOS) || "an unknown OS";
},
searchString: function (data) {
for (var i = 0; i < data.length; i++) {
var dataString = data[i].string;
var dataProp = data[i].prop;
this.versionSearchString = data[i].versionSearch || data[i].identity;
if (dataString) {
if (dataString.indexOf(data[i].subString) != -1)
return data[i].identity;
}
else if (dataProp)
return data[i].identity;
}
},
searchVersion: function (dataString) {
var index = dataString.indexOf(this.versionSearchString);
if (index == -1) return;
return parseFloat(dataString.substring(index + this.versionSearchString.length + 1));
},
dataBrowser: [
{ string: navigator.userAgent,
subString: "OmniWeb",
versionSearch: "OmniWeb/",
identity: "OmniWeb"
},
{
string: navigator.vendor,
subString: "Apple",
identity: "Safari"
},
{
string: navigator.vendor,
subString: "Google Inc.",
identity: "Chrome"
},
{
prop: window.opera,
identity: "Opera"
},
{
string: navigator.vendor,
subString: "iCab",
identity: "iCab"
},
{
string: navigator.vendor,
subString: "KDE",
identity: "Konqueror"
},
{
string: navigator.userAgent,
subString: "Firefox",
identity: "Firefox"
},
{
string: navigator.vendor,
subString: "Camino",
identity: "Camino"
},
{ // for newer Netscapes (6+)
string: navigator.userAgent,
subString: "Netscape",
identity: "Netscape"
},
{
string: navigator.userAgent,
subString: "MSIE",
identity: "Explorer",
versionSearch: "MSIE"
},
{
string: navigator.userAgent,
subString: "Gecko",
identity: "Mozilla",
versionSearch: "rv"
},
{ // for older Netscapes (4-)
string: navigator.userAgent,
subString: "Mozilla",
identity: "Netscape",
versionSearch: "Mozilla"
}
],
dataOS : [
{
string: navigator.platform,
subString: "Win",
identity: "Windows"
},
{
string: navigator.platform,
subString: "Mac",
identity: "Mac"
},
{
string: navigator.platform,
subString: "Linux",
identity: "Linux"
}
]
};
core.UserAgent.init();

View File

@ -159,7 +159,7 @@ mindplot.MindmapDesigner = new Class({
var selectableObjects = this.getSelectedObjects(); var selectableObjects = this.getSelectedObjects();
// Disable all nodes on focus but not the current if Ctrl key isn't being pressed // Disable all nodes on focus but not the current if Ctrl key isn't being pressed
if (!$defined(event) || event.ctrlKey == false) { if (!$defined(event) || (event.ctrlKey == false && event.metaKey == false)) {
selectableObjects.forEach(function(selectableObject) { selectableObjects.forEach(function(selectableObject) {
if (selectableObject.isOnFocus() && selectableObject != currentObject) { if (selectableObject.isOnFocus() && selectableObject != currentObject) {
selectableObject.setOnFocus(false); selectableObject.setOnFocus(false);
@ -333,7 +333,7 @@ mindplot.MindmapDesigner = new Class({
this._actionRunner.markAsChangeBase(); this._actionRunner.markAsChangeBase();
}, },
loadFromCollaborativeModel: function(collaborationManager){ loadFromCollaborativeModel: function(collaborationManager) {
var mindmap = collaborationManager.buildWiseModel(); var mindmap = collaborationManager.buildWiseModel();
this._loadMap(1, mindmap); this._loadMap(1, mindmap);
@ -745,7 +745,7 @@ mindplot.MindmapDesigner = new Class({
dialog.adopt(msg).show(); dialog.adopt(msg).show();
// IE doesn't like too much this focus action... // IE doesn't like too much this focus action...
if (!core.UserAgent.isIE()) { if (!Browser.ie) {
urlInput.focus(); urlInput.focus();
} }
} }

View File

@ -171,7 +171,7 @@ mindplot.Workspace = new Class({
workspace.setCoordOrigin(coordOriginX, coordOriginY); workspace.setCoordOrigin(coordOriginX, coordOriginY);
// Change cursor. // Change cursor.
if (core.UserAgent.isMozillaFamily()) { if (Browser.firefox) {
window.document.body.style.cursor = "-moz-grabbing"; window.document.body.style.cursor = "-moz-grabbing";
} else { } else {
window.document.body.style.cursor = "move"; window.document.body.style.cursor = "move";

View File

@ -115,9 +115,10 @@ mindplot.widget.ColorPalettePanel = new Class({
// Mark the cell as selected ... // Mark the cell as selected ...
var colorCells = panelElem.getElements('div[class=palette-colorswatch]'); var colorCells = panelElem.getElements('div[class=palette-colorswatch]');
var model = this.getModel(); var model = this.getModel();
var modelValue = model.getValue();
colorCells.forEach(function(elem) { colorCells.forEach(function(elem) {
var color = elem.getStyle("background-color"); var color = elem.getStyle("background-color");
if (model.getValue() == color) { if (modelValue == color) {
elem.parentNode.className = 'palette-cell palette-cell-selected'; elem.parentNode.className = 'palette-cell palette-cell-selected';
} }
}); });

View File

@ -43,9 +43,16 @@ mindplot.widget.Menu = new Class({
var fontFamilyModel = { var fontFamilyModel = {
getValue: function() { getValue: function() {
var nodes = designer.getSelectedNodes(); var nodes = designer.getSelectedNodes();
if (nodes.length == 1) { var result = null;
return nodes[0].getFontFamily(); for (var i=0; i < nodes.length; i++) {
var fontFamily = nodes[i].getFontFamily();
if (result != null && result != fontFamily) {
result = null;
break;
} }
result = fontFamily;
}
return result;
}, },
setValue: function(value) { setValue: function(value) {
@ -58,9 +65,16 @@ mindplot.widget.Menu = new Class({
var fontSizeModel = { var fontSizeModel = {
getValue: function() { getValue: function() {
var nodes = designer.getSelectedNodes(); var nodes = designer.getSelectedNodes();
if (nodes.length == 1) { var result = null;
return nodes[0].getFontSize(); for (var i=0; i < nodes.length; i++) {
var fontSize = nodes[i].getFontSize();
if (result != null && result != fontSize) {
result = null;
break;
} }
result = fontSize;
}
return result;
}, },
setValue: function(value) { setValue: function(value) {
designer.setFontSize2SelectedNode(value); designer.setFontSize2SelectedNode(value);
@ -71,9 +85,16 @@ mindplot.widget.Menu = new Class({
var topicShapeModel = { var topicShapeModel = {
getValue: function() { getValue: function() {
var nodes = designer.getSelectedNodes(); var nodes = designer.getSelectedNodes();
if (nodes.length == 1) { var result = null;
return nodes[0].getShapeType(); for (var i=0; i < nodes.length; i++) {
var shapeType = nodes[i].getShapeType();
if (result != null && result != shapeType) {
result = null;
break;
} }
result = shapeType;
}
return result;
}, },
setValue: function(value) { setValue: function(value) {
designer.setShape2SelectedNode(value); designer.setShape2SelectedNode(value);
@ -97,10 +118,16 @@ mindplot.widget.Menu = new Class({
{ {
getValue : function() { getValue : function() {
var nodes = designer.getSelectedNodes(); var nodes = designer.getSelectedNodes();
if (nodes.length == 1) { var result = null;
return nodes[0].getBackgroundColor(); for (var i=0; i < nodes.length; i++) {
var color = nodes[i].getBackgroundColor();
if (result != null && result != color) {
result = null;
break;
} }
return null; result = color;
}
return result;
}, },
setValue : function (hex) { setValue : function (hex) {
designer.setBackColor2SelectedNode(hex); designer.setBackColor2SelectedNode(hex);
@ -113,9 +140,16 @@ mindplot.widget.Menu = new Class({
{ {
getValue : function() { getValue : function() {
var nodes = designer.getSelectedNodes(); var nodes = designer.getSelectedNodes();
if (nodes.length == 1) { var result = null;
return nodes[0].getBorderColor(); for (var i=0; i < nodes.length; i++) {
var color = nodes[i].getBorderColor();
if (result != null && result != color) {
result = null;
break;
} }
result = color;
}
return result;
}, },
setValue : function (hex) { setValue : function (hex) {
designer.setBorderColor2SelectedNode(hex); designer.setBorderColor2SelectedNode(hex);
@ -127,10 +161,17 @@ mindplot.widget.Menu = new Class({
var fontColorModel = var fontColorModel =
{ {
getValue : function() { getValue : function() {
var result = null;
var nodes = designer.getSelectedNodes(); var nodes = designer.getSelectedNodes();
if (nodes.length == 1) { for (var i=0; i < nodes.length; i++) {
return nodes[0].getFontColor(); var color = nodes[i].getFontColor();
if (result != null && result != color) {
result = null;
break;
} }
result = color;
}
return result;
}, },
setValue : function (hex) { setValue : function (hex) {
designer.setFontColor2SelectedNode(hex); designer.setFontColor2SelectedNode(hex);

View File

@ -98,7 +98,7 @@ TestCase("Mindplot test",{
var fireNativeEvent = function(type, target, position){ var fireNativeEvent = function(type, target, position){
var event; var event;
if(core.UserAgent.isIE()){ if(Browser.ie){
event = document.createEventObject(); event = document.createEventObject();
event.screenX = position.x; event.screenX = position.x;
event.screenY = position.y; event.screenY = position.y;

View File

@ -24,7 +24,7 @@
console.log("value:" + value); console.log("value:" + value);
} }
}; };
var palette = new mindplot.widget.ColorPalette('myButton', model,"/mindplot/src/main/javascript/widget"); var palette = new mindplot.widget.ColorPalettePanel('myButton', model,"/mindplot/src/main/javascript/widget");
}); });
</script> </script>

4
wise-doc/bugs.txt Normal file
View File

@ -0,0 +1,4 @@
- Select and unselect de un nodo.
- metaKey for mac
- Si todos los nodos tienen las mismas propiedades, las opciones deberian aparecer marcadas.
- Ver de que algunos de los colores de las paleta sean los utilizados.

View File

@ -20,7 +20,6 @@
<!--<script type='text/javascript' src='../js/windoo.js'></script>--> <!--<script type='text/javascript' src='../js/windoo.js'></script>-->
<!--<script type='text/javascript' src='../js/wiseEditorLibrary.js'></script>--> <!--<script type='text/javascript' src='../js/wiseEditorLibrary.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' src='../js/core.js'></script>
<script type="text/javascript"> <script type="text/javascript">