mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-22 06:07:57 +01:00
Mindplot don't need to be compiled.
This commit is contained in:
parent
361892e004
commit
51be944cca
@ -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);
|
||||
|
@ -67,7 +67,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"/>
|
||||
@ -154,8 +153,6 @@
|
||||
files="layout/FreeMindLayoutManager.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/"
|
||||
files="layout/LayoutManagerFactory.js"/>
|
||||
|
||||
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="footer.js"/>
|
||||
</concat>
|
||||
|
||||
|
@ -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() {
|
||||
|
@ -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() {
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
|
@ -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)
|
||||
|
@ -221,7 +221,6 @@ mindplot.TextEditor = new Class({
|
||||
};
|
||||
|
||||
setTimeout(executor(this), 10);
|
||||
//console.log('init done');
|
||||
},
|
||||
|
||||
setStyle : function (fontStyle) {
|
||||
|
@ -1013,7 +1013,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,7 +1176,7 @@ mindplot.Topic = new Class({
|
||||
},
|
||||
|
||||
createDragNode : function() {
|
||||
var dragNode = mindplot.NodeGraph.prototype.createDragNode.call(this);
|
||||
this.parent();
|
||||
|
||||
// Is the node already connected ?
|
||||
var targetTopic = this.getOutgoingConnectedTopic();
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
@ -15,8 +15,3 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
if($defined(afterMindpotLibraryLoading))
|
||||
{
|
||||
afterMindpotLibraryLoading();
|
||||
}
|
||||
|
@ -23,8 +23,6 @@
|
||||
<script type='text/javascript' src='../../../../../wise-webapp/src/main/webapp/js/IconPanel.js'></script>
|
||||
<script type='text/javascript' src='../../../../../wise-webapp/src/main/webapp/js/mooRainbow.js'></script>
|
||||
|
||||
|
||||
|
||||
<script type='text/javascript' src='../../../../../core-js/target/classes/core.js'></script>
|
||||
|
||||
<link rel="icon" href="../images/favicon.ico" type="image/x-icon">
|
||||
@ -68,11 +66,11 @@
|
||||
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() {
|
||||
|
@ -16,9 +16,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
$import("../../../../../mindplot/target/classes/mindplot.svg.js");
|
||||
|
||||
var designer = null;
|
||||
|
||||
// CSS helper functions
|
||||
@ -370,7 +367,6 @@ function buildIconChooser() {
|
||||
}
|
||||
|
||||
|
||||
|
||||
function setCurrentColorPicker(colorPicker) {
|
||||
this.currentColorPicker = colorPicker;
|
||||
}
|
||||
@ -530,3 +526,71 @@ function buildPanel(buttonElemId, elemLinksContainer, elemLinkIds, updateFunctio
|
||||
$(elementId).addEvent('click', fontOnClick.bind($(elementId)));
|
||||
}
|
||||
}
|
||||
|
||||
//######################### 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) {
|
||||
|
||||
// Collect JS Urls ...
|
||||
var concatRoot = responseXML.getElementsByTagName('concat');
|
||||
var fileSetArray = Array.filter(concatRoot[0].childNodes, function(elem) {
|
||||
return elem.nodeType == Node.ELEMENT_NODE
|
||||
});
|
||||
|
||||
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('/'))));
|
||||
}
|
||||
);
|
||||
|
||||
// Load all JS dynamically ....
|
||||
jsUrls = jsUrls.reverse();
|
||||
|
||||
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)
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
jsRecLoad(jsUrls);
|
||||
},
|
||||
onFailure: function() {
|
||||
console.log('Sorry, your request failed :(');
|
||||
}
|
||||
});
|
||||
request.send();
|
||||
|
||||
}
|
||||
|
||||
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,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,8 +177,7 @@ 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)
|
||||
@ -209,19 +206,15 @@ function afterMindpotLibraryLoading()
|
||||
designer.redo();
|
||||
});
|
||||
designer.addEventListener("change", function(event) {
|
||||
if (event.undoSteps > 0)
|
||||
{
|
||||
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)");
|
||||
}
|
||||
|
||||
@ -308,101 +301,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,10 +389,8 @@ 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 confirmExit() {
|
||||
if (designer.needsSave()) {
|
||||
designer.save(null, false)
|
||||
}
|
||||
}
|
||||
@ -424,10 +401,9 @@ function afterMindpotLibraryLoading()
|
||||
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);
|
||||
@ -436,15 +412,12 @@ function afterMindpotLibraryLoading()
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
for (var j = 0; j < familyIcons.length; j = j + 1) {
|
||||
// Separate icons by line ...
|
||||
var familyContent;
|
||||
if ((count % 12) == 0)
|
||||
{
|
||||
if ((count % 12) == 0) {
|
||||
familyContent = new Element('div').inject(content);
|
||||
}
|
||||
|
||||
@ -466,18 +439,15 @@ function buildIconChooser() {
|
||||
;
|
||||
|
||||
|
||||
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,8 +476,7 @@ function buildMindmapDesigner()
|
||||
|
||||
|
||||
// Save map on load ....
|
||||
if (editorProperties.saveOnLoad)
|
||||
{
|
||||
if (editorProperties.saveOnLoad) {
|
||||
var saveOnLoad = function() {
|
||||
designer.save(function() {
|
||||
}, false);
|
||||
@ -517,8 +486,7 @@ function buildMindmapDesigner()
|
||||
}
|
||||
;
|
||||
|
||||
function createColorPalette(container, onSelectFunction, event)
|
||||
{
|
||||
function createColorPalette(container, onSelectFunction, event) {
|
||||
cleanScreenEvent();
|
||||
_colorPalette = new core.ColorPicker();
|
||||
_colorPalette.onSelect = function(color) {
|
||||
@ -534,10 +502,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 +512,53 @@ function cleanScreenEvent()
|
||||
iconPanel.close();
|
||||
}
|
||||
|
||||
function fontFamilyPanel()
|
||||
{
|
||||
function fontFamilyPanel() {
|
||||
var supportedFonts = ['times','arial','tahoma','verdana'];
|
||||
var updateFunction = function(value)
|
||||
{
|
||||
var updateFunction = function(value) {
|
||||
value = value.charAt(0).toUpperCase() + value.substring(1, value.length);
|
||||
designer.setFont2SelectedNode(value);
|
||||
};
|
||||
|
||||
var onFocusValue = function(selectedNode)
|
||||
{
|
||||
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 +566,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 +582,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 +593,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');
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user