From 1f5dbfb5d2474a34e9f73831fc5eb7f55e2694f9 Mon Sep 17 00:00:00 2001 From: Paulo Veiga Date: Tue, 23 Aug 2011 20:56:01 -0300 Subject: [PATCH] TextEditor is positioned based on mootools functions. --- core-js/src/main/javascript/Functions.js | 1 + mindplot/src/main/javascript/Board.js | 6 +++--- mindplot/src/main/javascript/MainTopicBoard.js | 2 +- mindplot/src/main/javascript/TextEditor.js | 12 ++++++------ mindplot/src/main/javascript/util/Shape.js | 2 +- wise-doc/src/main/webapp/js/jsapi.nocache.js | 16 ---------------- 6 files changed, 12 insertions(+), 27 deletions(-) delete mode 100644 wise-doc/src/main/webapp/js/jsapi.nocache.js diff --git a/core-js/src/main/javascript/Functions.js b/core-js/src/main/javascript/Functions.js index e7a5a4e2..a6057ec6 100644 --- a/core-js/src/main/javascript/Functions.js +++ b/core-js/src/main/javascript/Functions.js @@ -20,6 +20,7 @@ $assert = function(assert, message) { stack = e; } console.log(message + "," + stack); + throw message; // wLogger.error(message + "," + stack); // core.Logger.logError(message + "," + stack); diff --git a/mindplot/src/main/javascript/Board.js b/mindplot/src/main/javascript/Board.js index 8d86507f..8423252e 100644 --- a/mindplot/src/main/javascript/Board.js +++ b/mindplot/src/main/javascript/Board.js @@ -66,7 +66,7 @@ mindplot.BidirectionalArray = new Class({ }, get :function(index, sign) { - $assert(index, 'Illegal argument, index must be passed.'); + $assert($defined(index), 'Illegal argument, index must be passed.'); if ($defined(sign)) { $assert(index >= 0, 'Illegal absIndex value'); index = index * sign; @@ -82,14 +82,14 @@ mindplot.BidirectionalArray = new Class({ }, set : function(index, elem) { - $assert(index, 'Illegal index value'); + $assert($defined(index), 'Illegal index value'); var array = (index >= 0) ? this._rightElem : this._leftElem; array[Math.abs(index)] = elem; }, length : function(index) { - $assert(index, 'Illegal index value'); + $assert($defined(index), 'Illegal index value'); return (index >= 0) ? this._rightElem.length : this._leftElem.length; }, diff --git a/mindplot/src/main/javascript/MainTopicBoard.js b/mindplot/src/main/javascript/MainTopicBoard.js index e30feaf4..16268849 100644 --- a/mindplot/src/main/javascript/MainTopicBoard.js +++ b/mindplot/src/main/javascript/MainTopicBoard.js @@ -89,7 +89,7 @@ mindplot.MainTopicBoard = new Class({ addBranch : function(topic) { var order = topic.getOrder(); - $assert(order, "Order must be defined"); + $assert($defined(order), "Order must be defined"); // If the entry is not available, I must swap the the entries... var board = this._getBoard(); diff --git a/mindplot/src/main/javascript/TextEditor.js b/mindplot/src/main/javascript/TextEditor.js index a939dc24..eaa08993 100644 --- a/mindplot/src/main/javascript/TextEditor.js +++ b/mindplot/src/main/javascript/TextEditor.js @@ -41,7 +41,11 @@ mindplot.TextEditor = new Class({ }); inputContainer.inject(result); - var inputText = new Element('input', {type:"text",tabindex:'-1', value:""}); + var inputText = new Element('input', + {type:"text", + tabindex:'-1', + value:""} + ); inputText.setStyles({ border:"none", background:"transparent" @@ -146,7 +150,7 @@ mindplot.TextEditor = new Class({ // Set editor's initial size var displayFunc = function() { // Position the editor and set the size... - var textShape = this._topic.getTextShape(); + var textShape = this._topic.getTextShape(); textShape.positionRelativeTo(this._divElem, { position: {x: 'left',y:'top'}, edge: {x: 'left', y: 'top'} @@ -221,10 +225,6 @@ mindplot.TextEditor = new Class({ this._divElem.style.height = this._size.height + "px"; }, - _setPosition : function (x, y) { - $(this._divElem).setStyles({top : y + "px", left: x + "px"}); - }, - _changeCursor : function(inputElem, selectText) { // Select text if it's required ... if (inputElem.createTextRange) //ie diff --git a/mindplot/src/main/javascript/util/Shape.js b/mindplot/src/main/javascript/util/Shape.js index 3bedc416..ecb4ac36 100644 --- a/mindplot/src/main/javascript/util/Shape.js +++ b/mindplot/src/main/javascript/util/Shape.js @@ -27,7 +27,7 @@ mindplot.util.Shape = calculateRectConnectionPoint: function(rectCenterPoint, rectSize, isAtRight) { $assert(rectCenterPoint, 'rectCenterPoint can not be null'); $assert(rectSize, 'rectSize can not be null'); - $assert(isAtRight, 'isRight can not be null'); + $assert($defined(isAtRight), 'isRight can not be null'); // Node is placed at the right ? var result = new core.Point(); diff --git a/wise-doc/src/main/webapp/js/jsapi.nocache.js b/wise-doc/src/main/webapp/js/jsapi.nocache.js deleted file mode 100644 index a0c9e911..00000000 --- a/wise-doc/src/main/webapp/js/jsapi.nocache.js +++ /dev/null @@ -1,16 +0,0 @@ -function jsapi(){var L='',ec='\n-',sb='" for "gwt:onLoadErrorFn"',qb='" for "gwt:onPropertyErrorFn"',Tb='"