Fix minor loading issue.

This commit is contained in:
Paulo Veiga 2009-06-14 13:02:27 +00:00
parent 66d7986d54
commit 11ee13fb60
7 changed files with 80 additions and 92 deletions

View File

@ -68,10 +68,6 @@ core.assert = function(assert, message)
}; };
core.findElement = function(name)
{
return $(name);
}
Math.sign = function(value) Math.sign = function(value)
{ {

View File

@ -88,16 +88,4 @@ window.onerror = function(sMsg, sUrl, sLine)
wLogger.fatal(msg); wLogger.fatal(msg);
return true; return true;
}; };
window.__coreLoad = function()
{
if (window.afterCoreLoading)
{
window.afterCoreLoading();
} else
{
setTimeout("window.__coreLoad()", 2000);
}
}
window.__coreLoad();

View File

@ -1,22 +1,22 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. * this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0 * The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with * (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at * the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
* *
* $Id: file 64488 2006-03-10 17:32:09Z paulo $ * $Id: file 64488 2006-03-10 17:32:09Z paulo $
*/ */
mindplot.TextEditor = function(screenManager,actionRunner) mindplot.TextEditor = function(screenManager,actionRunner)
{ {
this._screenManager = screenManager; this._screenManager = screenManager;
@ -55,8 +55,8 @@ mindplot.TextEditor = function(screenManager,actionRunner)
break; break;
default: default:
var span =core.findElement('spanText'); var span =$('spanText');
var input = core.findElement('inputText'); var input = $('inputText');
span.innerHTML = input.value; span.innerHTML = input.value;
var size = input.value.length + 1; var size = input.value.length + 1;
input.size= size; input.size= size;
@ -90,7 +90,7 @@ mindplot.TextEditor = function(screenManager,actionRunner)
if (core.UserAgent.isSVGSupported()) if (core.UserAgent.isSVGSupported())
{ {
setTimeout("core.findElement('ffoxWorkarroundInput').focus();", 0); setTimeout("$('ffoxWorkarroundInput').focus();", 0);
} }
}; };
this.fx = new Fx.Style(this.inputText, 'opacity', { duration: 10}); this.fx = new Fx.Style(this.inputText, 'opacity', { duration: 10});
@ -262,8 +262,8 @@ mindplot.TextEditor.prototype.init = function (nodeGraph)
mindplot.TextEditor.prototype.setStyle = function (fontStyle) mindplot.TextEditor.prototype.setStyle = function (fontStyle)
{ {
var inputField = core.findElement("inputText"); var inputField = $("inputText");
var spanField = core.findElement("spanText"); var spanField = $("spanText");
if (!core.Utils.isDefined(fontStyle.font)) if (!core.Utils.isDefined(fontStyle.font))
{ {
fontStyle.font = "Arial"; fontStyle.font = "Arial";
@ -293,18 +293,18 @@ mindplot.TextEditor.prototype.setStyle = function (fontStyle)
mindplot.TextEditor.prototype.setText = function(text) mindplot.TextEditor.prototype.setText = function(text)
{ {
var inputField = core.findElement("inputText"); var inputField = $("inputText");
inputField.size = text.length + 1; inputField.size = text.length + 1;
//this._myOverlay.cfg.setProperty("width", (inputField.size * parseInt(inputField.style.fontSize) + 100) + "px"); //this._myOverlay.cfg.setProperty("width", (inputField.size * parseInt(inputField.style.fontSize) + 100) + "px");
this._myOverlay.style.width = (inputField.size * parseInt(inputField.style.fontSize) + 100) + "px"; this._myOverlay.style.width = (inputField.size * parseInt(inputField.style.fontSize) + 100) + "px";
var spanField = core.findElement("spanText"); var spanField = $("spanText");
spanField.innerHTML = text; spanField.innerHTML = text;
inputField.value = text; inputField.value = text;
}; };
mindplot.TextEditor.prototype.getText = function() mindplot.TextEditor.prototype.getText = function()
{ {
return core.findElement('inputText').value; return $('inputText').value;
}; };
@ -320,7 +320,7 @@ mindplot.TextEditor.prototype.setEditorSize = function (width, height, scale)
mindplot.TextEditor.prototype.getSize = function () mindplot.TextEditor.prototype.getSize = function ()
{ {
return {width:core.findElement("spanText").offsetWidth,height:core.findElement("spanText").offsetHeight}; return {width:$("spanText").offsetWidth,height:$("spanText").offsetHeight};
}; };
@ -343,12 +343,12 @@ mindplot.TextEditor.prototype.showTextEditor = function(selectText)
//elem._myOverlay.cfg.setProperty("xy", [0, 0]); //elem._myOverlay.cfg.setProperty("xy", [0, 0]);
//elem._myOverlay.cfg.setProperty("visible", true); //elem._myOverlay.cfg.setProperty("visible", true);
//select the text in the input //select the text in the input
core.findElement('inputText').disabled = false; $('inputText').disabled = false;
if (core.findElement('inputText').createTextRange) //ie if ($('inputText').createTextRange) //ie
{ {
var range = core.findElement('inputText').createTextRange(); var range = $('inputText').createTextRange();
var pos = core.findElement('inputText').value.length; var pos = $('inputText').value.length;
if(selectText) if(selectText)
{ {
range.select(); range.select();
@ -362,7 +362,7 @@ mindplot.TextEditor.prototype.showTextEditor = function(selectText)
} }
else if(selectText) else if(selectText)
{ {
core.findElement('inputText').setSelectionRange(0, core.findElement('inputText').value.length); $('inputText').setSelectionRange(0, $('inputText').value.length);
} }
var executor = function(editor) var executor = function(editor)
@ -370,7 +370,7 @@ mindplot.TextEditor.prototype.showTextEditor = function(selectText)
return function() return function()
{ {
try { try {
core.findElement('inputText').focus(); $('inputText').focus();
} }
catch (e) catch (e)
{ {
@ -389,7 +389,7 @@ mindplot.TextEditor.prototype.lostFocus = function(bothBrowsers)
if (this._isVisible()) if (this._isVisible())
{ {
//the editor is opened in another node. lets Finish it. //the editor is opened in another node. lets Finish it.
var fireOnThis = core.findElement('inputText'); var fireOnThis = $('inputText');
fireOnThis.fireEvent('blur'); fireOnThis.fireEvent('blur');
} }
}; };

View File

@ -17,7 +17,7 @@
* $Id: file 64488 2006-03-10 17:32:09Z paulo $ * $Id: file 64488 2006-03-10 17:32:09Z paulo $
*/ */
if(afterWisemapLoading) if(afterMindpotLibraryLoading)
{ {
afterWisemapLoading(); afterMindpotLibraryLoading();
} }

View File

@ -1,22 +1,22 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. * this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0 * The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with * (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at * the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
* *
* $Id: file 64488 2006-03-10 17:32:09Z paulo $ * $Id: file 64488 2006-03-10 17:32:09Z paulo $
*/ */
web2d.peer.ToolkitVML = web2d.peer.ToolkitVML =
{ {
init: function() init: function()
@ -24,7 +24,7 @@ web2d.peer.ToolkitVML =
var domDocument = window.document; var domDocument = window.document;
//ownerDocument; //ownerDocument;
// Add VML includes and namespace // Add VML includes and namespace
domDocument.namespaces.add("v", "urn:schemas-microsoft-com:vml"); domDocument.namespaces.add("v", "urn:schemas-microsoft-com:vml", "#default#VML");
var style = domDocument.createStyleSheet(); var style = domDocument.createStyleSheet();
style.addRule('v\\:*', "behavior: url(#default#VML);"); style.addRule('v\\:*', "behavior: url(#default#VML);");

View File

@ -17,6 +17,23 @@
* $Id: file 64488 2006-03-10 17:32:09Z paulo $ * $Id: file 64488 2006-03-10 17:32:09Z paulo $
*/ */
function afterCoreLoading()
{
if (core.UserAgent.isVMLSupported())
{
$import("../js/mindplot.vml.js");
} else
{
$import("../js/mindplot.svg.js");
}
};
afterCoreLoading();
/*Extend mootools known keys*/ /*Extend mootools known keys*/
ExtendedKeys = { ExtendedKeys = {
'insert': 45, 'insert': 45,
@ -163,23 +180,9 @@ Tabs.Init();
// Hide the content while waiting for the onload event to trigger. // Hide the content while waiting for the onload event to trigger.
var contentId = window.location.hash || "#Introduction"; var contentId = window.location.hash || "#Introduction";
function afterCoreLoading()
{
if (core.UserAgent.isVMLSupported())
{
$import("../js/mindplot.vml.js");
} else
{
$import("../js/mindplot.svg.js");
}
}
;
var iconPanel = null; var iconPanel = null;
function afterWisemapLoading() function afterMindpotLibraryLoading()
{ {
buildMindmapDesigner(); buildMindmapDesigner();

View File

@ -27,10 +27,11 @@ function afterCoreLoading()
$import("../js/mindplot.svg.js"); $import("../js/mindplot.svg.js");
} }
} };
;
function afterWisemapLoading() afterCoreLoading();
function afterMindpotLibraryLoading()
{ {
buildMindmapDesigner(); buildMindmapDesigner();