Replace $ by document.id for avoid colitions.

This commit is contained in:
Paulo Gustavo Veiga 2014-02-17 10:16:43 -03:00
parent 8ae2ab8fbf
commit 8e1a4e73be
16 changed files with 47 additions and 47 deletions

View File

@ -83,7 +83,7 @@ mindplot.Designer = new Class({
var screenManager = workspace.getScreenManager(); var screenManager = workspace.getScreenManager();
// Zoom In and Zoom Out must active event // Zoom In and Zoom Out must active event
$(document).addEvent('mousewheel', function (event) { document.id(document).addEvent('mousewheel', function (event) {
// Change mousewheel handling so we let the default // Change mousewheel handling so we let the default
//event happen if we are outside the container. //event happen if we are outside the container.
var coords = screenManager.getContainer().getCoordinates(); var coords = screenManager.getContainer().getCoordinates();

View File

@ -193,14 +193,14 @@ mindplot.DesignerKeyboard = new Class({
'ctrl+s':function (event) { 'ctrl+s':function (event) {
event.preventDefault(); event.preventDefault();
event.stopPropagation(); event.stopPropagation();
$('save').fireEvent('click'); document.id('save').fireEvent('click');
}, },
'meta+s':function (event) { 'meta+s':function (event) {
event.preventDefault(); event.preventDefault();
event.stopPropagation(); event.stopPropagation();
$('save').fireEvent('click'); document.id('save').fireEvent('click');
}, },
'ctrl+i':function (event) { 'ctrl+i':function (event) {
@ -350,7 +350,7 @@ mindplot.DesignerKeyboard = new Class({
excludes.push("alt"); excludes.push("alt");
} }
$(document).addEvent('keydown', function (event) { document.id(document).addEvent('keydown', function (event) {
// Convert key to mootools keyboard event format... // Convert key to mootools keyboard event format...
var keys = []; var keys = [];

View File

@ -166,7 +166,7 @@ mindplot.MultilineTextEditor = new Class({
if (!this.isVisible()) { if (!this.isVisible()) {
//Create editor ui //Create editor ui
var containerElem = this._buildEditor(); var containerElem = this._buildEditor();
containerElem.inject($(document.body)); containerElem.inject(document.id(document.body));
this._containerElem = containerElem; this._containerElem = containerElem;
this._registerEvents(containerElem); this._registerEvents(containerElem);

View File

@ -121,7 +121,7 @@ mindplot.TextEditor = new Class({
if (!this.isVisible()) { if (!this.isVisible()) {
//Create editor ui //Create editor ui
var editorElem = this._buildEditor(); var editorElem = this._buildEditor();
editorElem.inject($(document.body)); editorElem.inject(document.id(document.body));
this._containerElem = editorElem; this._containerElem = editorElem;
this._registerEvents(editorElem); this._registerEvents(editorElem);

View File

@ -1 +1 @@
$(document).fireEvent('loadcomplete', 'mind'); document.id(document).fireEvent('loadcomplete', 'mind');

View File

@ -137,7 +137,7 @@ mindplot.layout.LayoutManager = new Class({
// Collect changes ... // Collect changes ...
this._collectChanges(); this._collectChanges();
if (!$(fireEvents) || fireEvents) { if (!document.id(fireEvents) || fireEvents) {
this._flushEvents(); this._flushEvents();
} }

View File

@ -50,12 +50,12 @@ var b=0;for(h=0;h<d.length&&h<c.length&&d[h]==c[h];h++){}for(b=0;b<d.length-h-1;
};var a=Object.prototype.hasOwnProperty;Object.extend({getFromPath:function(e,f){if(typeof f=="string"){f=f.split(".");}for(var d=0,c=f.length;d<c;d++){if(a.call(e,f[d])){e=e[f[d]]; };var a=Object.prototype.hasOwnProperty;Object.extend({getFromPath:function(e,f){if(typeof f=="string"){f=f.split(".");}for(var d=0,c=f.length;d<c;d++){if(a.call(e,f[d])){e=e[f[d]];
}else{return null;}}return e;},cleanValues:function(c,e){e=e||b;for(var d in c){if(!e(c[d])){delete c[d];}}return c;},erase:function(c,d){if(a.call(c,d)){delete c[d]; }else{return null;}}return e;},cleanValues:function(c,e){e=e||b;for(var d in c){if(!e(c[d])){delete c[d];}}return c;},erase:function(c,d){if(a.call(c,d)){delete c[d];
}return c;},run:function(d){var c=Array.slice(arguments,1);for(var e in d){if(d[e].apply){d[e].apply(d,c);}}return d;}});})();Hash.implement({getFromPath:function(a){return Object.getFromPath(this,a); }return c;},run:function(d){var c=Array.slice(arguments,1);for(var e in d){if(d[e].apply){d[e].apply(d,c);}}return d;}});})();Hash.implement({getFromPath:function(a){return Object.getFromPath(this,a);
},cleanValues:function(a){return new Hash(Object.cleanValues(this,a));},run:function(){Object.run(arguments);}});Fx.Elements=new Class({Extends:Fx.CSS,initialize:function(b,a){this.elements=this.subject=$$(b); },cleanValues:function(a){return new Hash(Object.cleanValues(this,a));},run:function(){Object.run(arguments);}});Fx.Elements=new Class({Extends:Fx.CSS,initialize:function(b,a){this.elements=this.subject=$document.id(b);
this.parent(a);},compute:function(g,h,j){var c={};for(var d in g){var a=g[d],e=h[d],f=c[d]={};for(var b in a){f[b]=this.parent(a[b],e[b],j);}}return c; this.parent(a);},compute:function(g,h,j){var c={};for(var d in g){var a=g[d],e=h[d],f=c[d]={};for(var b in a){f[b]=this.parent(a[b],e[b],j);}}return c;
},set:function(b){for(var c in b){if(!this.elements[c]){continue;}var a=b[c];for(var d in a){this.render(this.elements[c],d,a[d],this.options.unit);}}return this; },set:function(b){for(var c in b){if(!this.elements[c]){continue;}var a=b[c];for(var d in a){this.render(this.elements[c],d,a[d],this.options.unit);}}return this;
},start:function(c){if(!this.check(c)){return this;}var h={},j={};for(var d in c){if(!this.elements[d]){continue;}var f=c[d],a=h[d]={},g=j[d]={};for(var b in f){var e=this.prepare(this.elements[d],b,f[b]); },start:function(c){if(!this.check(c)){return this;}var h={},j={};for(var d in c){if(!this.elements[d]){continue;}var f=c[d],a=h[d]={},g=j[d]={};for(var b in f){var e=this.prepare(this.elements[d],b,f[b]);
a[b]=e.from;g[b]=e.to;}}return this.parent(h,j);}});Fx.Accordion=new Class({Extends:Fx.Elements,options:{fixedHeight:false,fixedWidth:false,display:0,show:false,height:true,width:false,opacity:true,alwaysHide:false,trigger:"click",initialDisplayFx:true,resetHeight:true},initialize:function(){var g=function(h){return h!=null; a[b]=e.from;g[b]=e.to;}}return this.parent(h,j);}});Fx.Accordion=new Class({Extends:Fx.Elements,options:{fixedHeight:false,fixedWidth:false,display:0,show:false,height:true,width:false,opacity:true,alwaysHide:false,trigger:"click",initialDisplayFx:true,resetHeight:true},initialize:function(){var g=function(h){return h!=null;
};var f=Array.link(arguments,{container:Type.isElement,options:Type.isObject,togglers:g,elements:g});this.parent(f.elements,f.options);var b=this.options,e=this.togglers=$$(f.togglers); };var f=Array.link(arguments,{container:Type.isElement,options:Type.isObject,togglers:g,elements:g});this.parent(f.elements,f.options);var b=this.options,e=this.togglers=$document.id(f.togglers);
this.previous=-1;this.internalChain=new Chain();if(b.alwaysHide){this.options.link="chain";}if(b.show||this.options.show===0){b.display=false;this.previous=b.show; this.previous=-1;this.internalChain=new Chain();if(b.alwaysHide){this.options.link="chain";}if(b.show||this.options.show===0){b.display=false;this.previous=b.show;
}if(b.start){b.display=false;b.show=false;}var d=this.effects={};if(b.opacity){d.opacity="fullOpacity";}if(b.width){d.width=b.fixedWidth?"fullWidth":"offsetWidth"; }if(b.start){b.display=false;b.show=false;}var d=this.effects={};if(b.opacity){d.opacity="fullOpacity";}if(b.width){d.width=b.fixedWidth?"fullWidth":"offsetWidth";
}if(b.height){d.height=b.fixedHeight?"fullHeight":"scrollHeight";}for(var c=0,a=e.length;c<a;c++){this.addSection(e[c],this.elements[c]);}this.elements.each(function(j,h){if(b.show===h){this.fireEvent("active",[e[h],j]); }if(b.height){d.height=b.fixedHeight?"fullHeight":"scrollHeight";}for(var c=0,a=e.length;c<a;c++){this.addSection(e[c],this.elements[c]);}this.elements.each(function(j,h){if(b.show===h){this.fireEvent("active",[e[h],j]);
@ -160,7 +160,7 @@ this.open=true;return this.set([0,this.offset]);},toggle:function(a){return this
return this;},get:function(){var a=this.retrieve("slide");if(!a){a=new Fx.Slide(this,{link:"cancel"});this.store("slide",a);}return a;}};Element.implement({slide:function(d,e){d=d||"toggle"; return this;},get:function(){var a=this.retrieve("slide");if(!a){a=new Fx.Slide(this,{link:"cancel"});this.store("slide",a);}return a;}};Element.implement({slide:function(d,e){d=d||"toggle";
var b=this.get("slide"),a;switch(d){case"hide":b.hide(e);break;case"show":b.show(e);break;case"toggle":var c=this.retrieve("slide:flag",b.open);b[c?"slideOut":"slideIn"](e); var b=this.get("slide"),a;switch(d){case"hide":b.hide(e);break;case"show":b.show(e);break;case"toggle":var c=this.retrieve("slide:flag",b.open);b[c?"slideOut":"slideIn"](e);
this.store("slide:flag",!c);a=true;break;default:b.start(d,e);}if(!a){this.eliminate("slide:flag");}return this;}});Fx.SmoothScroll=new Class({Extends:Fx.Scroll,options:{axes:["x","y"]},initialize:function(c,d){d=d||document; this.store("slide:flag",!c);a=true;break;default:b.start(d,e);}if(!a){this.eliminate("slide:flag");}return this;}});Fx.SmoothScroll=new Class({Extends:Fx.Scroll,options:{axes:["x","y"]},initialize:function(c,d){d=d||document;
this.doc=d.getDocument();this.parent(this.doc,c);var e=d.getWindow(),a=e.location.href.match(/^[^#]*/)[0]+"#",b=$$(this.options.links||this.doc.links); this.doc=d.getDocument();this.parent(this.doc,c);var e=d.getWindow(),a=e.location.href.match(/^[^#]*/)[0]+"#",b=$document.id(this.options.links||this.doc.links);
b.each(function(g){if(g.href.indexOf(a)!=0){return;}var f=g.href.substr(a.length);if(f){this.useLink(g,f);}},this);this.addEvent("complete",function(){e.location.hash=this.anchor; b.each(function(g){if(g.href.indexOf(a)!=0){return;}var f=g.href.substr(a.length);if(f){this.useLink(g,f);}},this);this.addEvent("complete",function(){e.location.hash=this.anchor;
this.element.scrollTo(this.to[0],this.to[1]);},true);},useLink:function(b,a){b.addEvent("click",function(d){var c=document.id(a)||this.doc.getElement("a[name="+a+"]"); this.element.scrollTo(this.to[0],this.to[1]);},true);},useLink:function(b,a){b.addEvent("click",function(d){var c=document.id(a)||this.doc.getElement("a[name="+a+"]");
if(!c){return;}d.preventDefault();this.toElement(c,this.options.axes).chain(function(){this.fireEvent("scrolledTo",[b,c]);}.bind(this));this.anchor=a;}.bind(this)); if(!c){return;}d.preventDefault();this.toElement(c,this.options.axes).chain(function(){this.fireEvent("scrolledTo",[b,c]);}.bind(this));this.anchor=a;}.bind(this));
@ -173,12 +173,12 @@ if(e.length!=this.elements.length){this.currentOrder.each(function(j){if(!e.cont
}}var b=0;i=a=0;e.each(function(k){var j={};if(d){j.top=i-f[k].top-b;i+=f[k].height;}else{j.left=a-f[k].left;a+=f[k].width;}b=b+f[k].margin;c[k]=j;},this); }}var b=0;i=a=0;e.each(function(k){var j={};if(d){j.top=i-f[k].top-b;i+=f[k].height;}else{j.left=a-f[k].left;a+=f[k].width;}b=b+f[k].margin;c[k]=j;},this);
var g={};Array.clone(e).sort().each(function(j){g[j]=c[j];});this.start(g);this.currentOrder=e;return this;},rearrangeDOM:function(a){a=a||this.currentOrder; var g={};Array.clone(e).sort().each(function(j){g[j]=c[j];});this.start(g);this.currentOrder=e;return this;},rearrangeDOM:function(a){a=a||this.currentOrder;
var b=this.elements[0].getParent();var c=[];this.elements.setStyle("opacity",0);a.each(function(d){c.push(this.elements[d].inject(b).setStyles({top:0,left:0})); var b=this.elements[0].getParent();var c=[];this.elements.setStyle("opacity",0);a.each(function(d){c.push(this.elements[d].inject(b).setStyles({top:0,left:0}));
},this);this.elements.setStyle("opacity",1);this.elements=$$(c);this.setDefaultOrder();return this;},getDefaultOrder:function(){return this.elements.map(function(b,a){return a; },this);this.elements.setStyle("opacity",1);this.elements=$document.id(c);this.setDefaultOrder();return this;},getDefaultOrder:function(){return this.elements.map(function(b,a){return a;
});},getCurrentOrder:function(){return this.currentOrder;},forward:function(){return this.sort(this.getDefaultOrder());},backward:function(){return this.sort(this.getDefaultOrder().reverse()); });},getCurrentOrder:function(){return this.currentOrder;},forward:function(){return this.sort(this.getDefaultOrder());},backward:function(){return this.sort(this.getDefaultOrder().reverse());
},reverse:function(){return this.sort(this.currentOrder.reverse());},sortByElements:function(a){return this.sort(a.map(function(b){return this.elements.indexOf(b); },reverse:function(){return this.sort(this.currentOrder.reverse());},sortByElements:function(a){return this.sort(a.map(function(b){return this.elements.indexOf(b);
},this));},swap:function(c,b){if(typeOf(c)=="element"){c=this.elements.indexOf(c);}if(typeOf(b)=="element"){b=this.elements.indexOf(b);}var a=Array.clone(this.currentOrder); },this));},swap:function(c,b){if(typeOf(c)=="element"){c=this.elements.indexOf(c);}if(typeOf(b)=="element"){b=this.elements.indexOf(b);}var a=Array.clone(this.currentOrder);
a[this.currentOrder.indexOf(c)]=b;a[this.currentOrder.indexOf(b)]=c;return this.sort(a);}});var Drag=new Class({Implements:[Events,Options],options:{snap:6,unit:"px",grid:false,style:true,limit:false,handle:false,invert:false,preventDefault:false,stopPropagation:false,modifiers:{x:"left",y:"top"}},initialize:function(){var b=Array.link(arguments,{options:Type.isObject,element:function(c){return c!=null; a[this.currentOrder.indexOf(c)]=b;a[this.currentOrder.indexOf(b)]=c;return this.sort(a);}});var Drag=new Class({Implements:[Events,Options],options:{snap:6,unit:"px",grid:false,style:true,limit:false,handle:false,invert:false,preventDefault:false,stopPropagation:false,modifiers:{x:"left",y:"top"}},initialize:function(){var b=Array.link(arguments,{options:Type.isObject,element:function(c){return c!=null;
}});this.element=document.id(b.element);this.document=this.element.getDocument();this.setOptions(b.options||{});var a=typeOf(this.options.handle);this.handles=((a=="array"||a=="collection")?$$(this.options.handle):document.id(this.options.handle))||this.element; }});this.element=document.id(b.element);this.document=this.element.getDocument();this.setOptions(b.options||{});var a=typeOf(this.options.handle);this.handles=((a=="array"||a=="collection")?$document.id(this.options.handle):document.id(this.options.handle))||this.element;
this.mouse={now:{},pos:{}};this.value={start:{},now:{}};this.selection=(Browser.ie)?"selectstart":"mousedown";if(Browser.ie&&!Drag.ondragstartFixed){document.ondragstart=Function.from(false); this.mouse={now:{},pos:{}};this.value={start:{},now:{}};this.selection=(Browser.ie)?"selectstart":"mousedown";if(Browser.ie&&!Drag.ondragstartFixed){document.ondragstart=Function.from(false);
Drag.ondragstartFixed=true;}this.bound={start:this.start.bind(this),check:this.check.bind(this),drag:this.drag.bind(this),stop:this.stop.bind(this),cancel:this.cancel.bind(this),eventStop:Function.from(false)}; Drag.ondragstartFixed=true;}this.bound={start:this.start.bind(this),check:this.check.bind(this),drag:this.drag.bind(this),stop:this.stop.bind(this),cancel:this.cancel.bind(this),eventStop:Function.from(false)};
this.attach();},attach:function(){this.handles.addEvent("mousedown",this.bound.start);return this;},detach:function(){this.handles.removeEvent("mousedown",this.bound.start); this.attach();},attach:function(){this.handles.addEvent("mousedown",this.bound.start);return this;},detach:function(){this.handles.removeEvent("mousedown",this.bound.start);
@ -197,7 +197,7 @@ this.fireEvent("start",[this.element,a]).fireEvent("snap",this.element);}},drag:
if(a){this.document.removeEvent(this.selection,this.bound.eventStop);this.fireEvent("cancel",this.element);}},stop:function(b){var a={mousemove:this.bound.drag,mouseup:this.bound.stop}; if(a){this.document.removeEvent(this.selection,this.bound.eventStop);this.fireEvent("cancel",this.element);}},stop:function(b){var a={mousemove:this.bound.drag,mouseup:this.bound.stop};
a[this.selection]=this.bound.eventStop;this.document.removeEvents(a);if(b){this.fireEvent("complete",[this.element,b]);}}});Element.implement({makeResizable:function(a){var b=new Drag(this,Object.merge({modifiers:{x:"width",y:"height"}},a)); a[this.selection]=this.bound.eventStop;this.document.removeEvents(a);if(b){this.fireEvent("complete",[this.element,b]);}}});Element.implement({makeResizable:function(a){var b=new Drag(this,Object.merge({modifiers:{x:"width",y:"height"}},a));
this.store("resizer",b);return b.addEvent("drag",function(){this.fireEvent("resize",b);}.bind(this));}});Drag.Move=new Class({Extends:Drag,options:{droppables:[],container:false,precalculate:false,includeMargins:true,checkDroppables:true},initialize:function(b,a){this.parent(b,a); this.store("resizer",b);return b.addEvent("drag",function(){this.fireEvent("resize",b);}.bind(this));}});Drag.Move=new Class({Extends:Drag,options:{droppables:[],container:false,precalculate:false,includeMargins:true,checkDroppables:true},initialize:function(b,a){this.parent(b,a);
b=this.element;this.droppables=$$(this.options.droppables);this.container=document.id(this.options.container);if(this.container&&typeOf(this.container)!="element"){this.container=document.id(this.container.getDocument().body); b=this.element;this.droppables=$document.id(this.options.droppables);this.container=document.id(this.options.container);if(this.container&&typeOf(this.container)!="element"){this.container=document.id(this.container.getDocument().body);
}if(this.options.style){if(this.options.modifiers.x=="left"&&this.options.modifiers.y=="top"){var c=b.getOffsetParent(),d=b.getStyles("left","top");if(c&&(d.left=="auto"||d.top=="auto")){b.setPosition(b.getPosition(c)); }if(this.options.style){if(this.options.modifiers.x=="left"&&this.options.modifiers.y=="top"){var c=b.getOffsetParent(),d=b.getStyles("left","top");if(c&&(d.left=="auto"||d.top=="auto")){b.setPosition(b.getPosition(c));
}}if(b.getStyle("position")=="static"){b.setStyle("position","absolute");}}this.addEvent("start",this.checkDroppables,true);this.overed=null;},start:function(a){if(this.container){this.options.limit=this.calculateLimit(); }}if(b.getStyle("position")=="static"){b.setStyle("position","absolute");}}this.addEvent("start",this.checkDroppables,true);this.overed=null;},start:function(a){if(this.container){this.options.limit=this.calculateLimit();
}if(this.options.precalculate){this.positions=this.droppables.map(function(b){return b.getCoordinates();});}this.parent(a);},calculateLimit:function(){var j=this.element,e=this.container,d=document.id(j.getOffsetParent())||document.body,h=e.getCoordinates(d),c={},b={},k={},g={},m={}; }if(this.options.precalculate){this.positions=this.droppables.map(function(b){return b.getCoordinates();});}this.parent(a);},calculateLimit:function(){var j=this.element,e=this.container,d=document.id(j.getOffsetParent())||document.body,h=e.getCoordinates(d),c={},b={},k={},g={},m={};

View File

@ -66,7 +66,7 @@ mindplot.widget.FloatingTip = new Class({
}, },
show:function (element) { show:function (element) {
var old = $(element).retrieve('floatingtip'); var old = document.id(element).retrieve('floatingtip');
if (old){ if (old){
if (old.getStyle('opacity') == 1) { if (old.getStyle('opacity') == 1) {
clearTimeout(old.retrieve('timeout')); clearTimeout(old.retrieve('timeout'));

View File

@ -26,12 +26,12 @@ mindplot.widget.Menu = new Class({
var widgetsBaseUrl = baseUrl + "css/widget"; var widgetsBaseUrl = baseUrl + "css/widget";
// Stop event propagation ... // Stop event propagation ...
$(this._containerId).addEvent('click', function (event) { document.id(this._containerId).addEvent('click', function (event) {
event.stopPropagation(); event.stopPropagation();
return false; return false;
}); });
$(this._containerId).addEvent('dblclick', function (event) { document.id(this._containerId).addEvent('dblclick', function (event) {
event.stopPropagation(); event.stopPropagation();
return false; return false;
}); });
@ -39,7 +39,7 @@ mindplot.widget.Menu = new Class({
// Create panels ... // Create panels ...
var designerModel = designer.getModel(); var designerModel = designer.getModel();
var fontFamilyBtn = $('fontFamily'); var fontFamilyBtn = document.id('fontFamily');
if (fontFamilyBtn) { if (fontFamilyBtn) {
var fontFamilyModel = { var fontFamilyModel = {
getValue:function () { getValue:function () {
@ -65,7 +65,7 @@ mindplot.widget.Menu = new Class({
this._registerTooltip('fontFamily', $msg('FONT_FAMILY')); this._registerTooltip('fontFamily', $msg('FONT_FAMILY'));
} }
var fontSizeBtn = $('fontSize'); var fontSizeBtn = document.id('fontSize');
if (fontSizeBtn) { if (fontSizeBtn) {
var fontSizeModel = { var fontSizeModel = {
getValue:function () { getValue:function () {
@ -89,7 +89,7 @@ mindplot.widget.Menu = new Class({
this._registerTooltip('fontSize', $msg('FONT_SIZE')); this._registerTooltip('fontSize', $msg('FONT_SIZE'));
} }
var topicShapeBtn = $('topicShape'); var topicShapeBtn = document.id('topicShape');
if (topicShapeBtn) { if (topicShapeBtn) {
var topicShapeModel = { var topicShapeModel = {
getValue:function () { getValue:function () {
@ -113,7 +113,7 @@ mindplot.widget.Menu = new Class({
this._registerTooltip('topicShape', $msg('TOPIC_SHAPE')); this._registerTooltip('topicShape', $msg('TOPIC_SHAPE'));
} }
var topicIconBtn = $('topicIcon'); var topicIconBtn = document.id('topicIcon');
if (topicIconBtn) { if (topicIconBtn) {
// Create icon panel dialog ... // Create icon panel dialog ...
var topicIconModel = { var topicIconModel = {
@ -129,7 +129,7 @@ mindplot.widget.Menu = new Class({
} }
// Topic color item ... // Topic color item ...
var topicColorBtn = $('topicColor'); var topicColorBtn = document.id('topicColor');
if (topicColorBtn) { if (topicColorBtn) {
var topicColorModel = { var topicColorModel = {
@ -155,7 +155,7 @@ mindplot.widget.Menu = new Class({
} }
// Border color item ... // Border color item ...
var topicBorderBtn = $('topicBorder'); var topicBorderBtn = document.id('topicBorder');
if (topicBorderBtn) { if (topicBorderBtn) {
var borderColorModel = var borderColorModel =
{ {
@ -181,7 +181,7 @@ mindplot.widget.Menu = new Class({
} }
// Font color item ... // Font color item ...
var fontColorBtn = $('fontColor'); var fontColorBtn = document.id('fontColor');
if (fontColorBtn) { if (fontColorBtn) {
var fontColorModel = var fontColorModel =
{ {
@ -316,7 +316,7 @@ mindplot.widget.Menu = new Class({
this._registerTooltip('fontItalic', $msg('FONT_ITALIC'), "meta+I"); this._registerTooltip('fontItalic', $msg('FONT_ITALIC'), "meta+I");
var saveElem = $('save'); var saveElem = document.id('save');
if (saveElem) { if (saveElem) {
this._addButton('save', false, false, function () { this._addButton('save', false, false, function () {
this.save(saveElem, designer, true); this.save(saveElem, designer, true);
@ -327,7 +327,7 @@ mindplot.widget.Menu = new Class({
if (!readOnly) { if (!readOnly) {
// To prevent the user from leaving the page with changes ... // To prevent the user from leaving the page with changes ...
Element.NativeEvents.unload = 1; Element.NativeEvents.unload = 1;
$(window).addEvent('unload', function () { document.id(window).addEvent('unload', function () {
if (this.isSaveRequired()) { if (this.isSaveRequired()) {
this.save(saveElem, designer, false, true); this.save(saveElem, designer, false, true);
} }
@ -343,7 +343,7 @@ mindplot.widget.Menu = new Class({
} }
} }
var discardElem = $('discard'); var discardElem = document.id('discard');
if (discardElem) { if (discardElem) {
this._addButton('discard', false, false, function () { this._addButton('discard', false, false, function () {
this.discardChanges(designer); this.discardChanges(designer);
@ -351,7 +351,7 @@ mindplot.widget.Menu = new Class({
this._registerTooltip('discard', $msg('DISCARD_CHANGES')); this._registerTooltip('discard', $msg('DISCARD_CHANGES'));
} }
var shareElem = $('shareIt'); var shareElem = document.id('shareIt');
if (shareElem) { if (shareElem) {
this._addButton('shareIt', false, false, function () { this._addButton('shareIt', false, false, function () {
var reqDialog = new MooDialog.Request('c/iframeWrapper?url=c/maps/' + mapId + "/sharef", null, var reqDialog = new MooDialog.Request('c/iframeWrapper?url=c/maps/' + mapId + "/sharef", null,
@ -371,7 +371,7 @@ mindplot.widget.Menu = new Class({
} }
var publishElem = $('publishIt'); var publishElem = document.id('publishIt');
if (publishElem) { if (publishElem) {
this._addButton('publishIt', false, false, function () { this._addButton('publishIt', false, false, function () {
var reqDialog = new MooDialog.Request('c/iframeWrapper?url=c/maps/' + mapId + "/publishf", null, var reqDialog = new MooDialog.Request('c/iframeWrapper?url=c/maps/' + mapId + "/publishf", null,
@ -391,7 +391,7 @@ mindplot.widget.Menu = new Class({
this._registerTooltip('publishIt', $msg('PUBLISH')); this._registerTooltip('publishIt', $msg('PUBLISH'));
} }
var historyElem = $('history'); var historyElem = document.id('history');
if (historyElem) { if (historyElem) {
this._addButton('history', false, false, function () { this._addButton('history', false, false, function () {
@ -413,7 +413,7 @@ mindplot.widget.Menu = new Class({
this._registerEvents(designer); this._registerEvents(designer);
// Keyboard Shortcuts Action ... // Keyboard Shortcuts Action ...
var keyboardShortcut = $('keyboardShortcuts'); var keyboardShortcut = document.id('keyboardShortcuts');
if (keyboardShortcut) { if (keyboardShortcut) {
keyboardShortcut.addEvent('click', function (event) { keyboardShortcut.addEvent('click', function (event) {
@ -434,7 +434,7 @@ mindplot.widget.Menu = new Class({
} }
var videoElem = $("tutorialVideo"); var videoElem = document.id("tutorialVideo");
if (videoElem) { if (videoElem) {
var width = 900; var width = 900;
var height = 500; var height = 500;
@ -501,7 +501,7 @@ mindplot.widget.Menu = new Class({
_addButton:function (buttonId, topic, rel, fn) { _addButton:function (buttonId, topic, rel, fn) {
// Register Events ... // Register Events ...
var result = null; var result = null;
if ($(buttonId)) { if (document.id(buttonId)) {
var button = new mindplot.widget.ToolbarItem(buttonId, function (event) { var button = new mindplot.widget.ToolbarItem(buttonId, function (event) {
fn(event); fn(event);
@ -515,13 +515,13 @@ mindplot.widget.Menu = new Class({
}, },
_registerTooltip:function (buttonId, text, shortcut) { _registerTooltip:function (buttonId, text, shortcut) {
if ($(buttonId)) { if (document.id(buttonId)) {
var tooltip = text; var tooltip = text;
if (shortcut) { if (shortcut) {
shortcut = Browser.Platform.mac ? shortcut.replace("meta+", "⌘") : shortcut.replace("meta+", "ctrl+"); shortcut = Browser.Platform.mac ? shortcut.replace("meta+", "⌘") : shortcut.replace("meta+", "ctrl+");
tooltip = tooltip + " (" + shortcut + ")"; tooltip = tooltip + " (" + shortcut + ")";
} }
new mindplot.widget.KeyboardShortcutTooltip($(buttonId), tooltip); new mindplot.widget.KeyboardShortcutTooltip(document.id(buttonId), tooltip);
} }
} }
}); });

View File

@ -32,7 +32,7 @@ mindplot.widget.ToolbarItem = new Class({
_registerTip: function() { _registerTip: function() {
return new mindplot.widget.FloatingTip($(this._buttonId), { return new mindplot.widget.FloatingTip(document.id(this._buttonId), {
html: false, html: false,
position: 'bottom', position: 'bottom',
arrowOffset : 5, arrowOffset : 5,
@ -50,7 +50,7 @@ mindplot.widget.ToolbarItem = new Class({
}, },
getButtonElem : function() { getButtonElem : function() {
var elem = $(this._buttonId); var elem = document.id(this._buttonId);
$assert(elem, "Could not find element for " + this._buttonId); $assert(elem, "Could not find element for " + this._buttonId);
return elem; return elem;
}.protect(), }.protect(),

View File

@ -19,7 +19,7 @@
mindplot.widget.ToolbarNotifier = new Class({ mindplot.widget.ToolbarNotifier = new Class({
initialize:function () { initialize:function () {
var container = $('headerNotifier'); var container = document.id('headerNotifier');
// In case of print,embedded no message is displayed .... // In case of print,embedded no message is displayed ....
if (container) { if (container) {
this._effect = new Fx.Elements(container, { this._effect = new Fx.Elements(container, {
@ -44,14 +44,14 @@ mindplot.widget.ToolbarNotifier = new Class({
logMessage:function (msg, fade) { logMessage:function (msg, fade) {
$assert(msg, 'msg can not be null'); $assert(msg, 'msg can not be null');
var container = $('headerNotifier'); var container = document.id('headerNotifier');
// In case of print,embedded no message is displayed .... // In case of print,embedded no message is displayed ....
if (container) { if (container) {
container.set('text', msg); container.set('text', msg);
container.setStyle('display', 'block'); container.setStyle('display', 'block');
container.position({ container.position({
relativeTo:$('header'), relativeTo:document.id('header'),
position:'upperCenter', position:'upperCenter',
edge:'centerTop' edge:'centerTop'
}); });

View File

@ -11,7 +11,7 @@ TestCase("Mindplot test",{
buildMindmapDesigner(); buildMindmapDesigner();
// Register Events ... // Register Events ...
// $(document).addEvent('keydown', designer.keyEventHandler.bindWithEvent(designer)); // document.id(document).addEvent('keydown', designer.keyEventHandler.bindWithEvent(designer));
/*// Autosave ... /*// Autosave ...
if (!isTryMode) if (!isTryMode)
@ -44,7 +44,7 @@ TestCase("Mindplot test",{
{ {
// Initialize message logger ... // Initialize message logger ...
var container = $('mindplot'); var container = document.id('mindplot');
// Initialize Editor ... // Initialize Editor ...
@ -76,7 +76,7 @@ TestCase("Mindplot test",{
afterMindpotLibraryLoading(); afterMindpotLibraryLoading();
}, },
testWorkspaceBuild:function(){ testWorkspaceBuild:function(){
assertNotNull($('workspace')); assertNotNull(document.id('workspace'));
}, },
testCentralTopicPresent:function(){ testCentralTopicPresent:function(){
var centralTopic = designer.getCentralTopic(); var centralTopic = designer.getCentralTopic();

View File

@ -19,7 +19,7 @@ mindplot.layout.BalancedTestSuite = new Class({
Extends: mindplot.layout.TestSuite, Extends: mindplot.layout.TestSuite,
initialize:function() { initialize:function() {
$("balancedTest").setStyle("display","block"); document.id("balancedTest").setStyle("display","block");
this.testBalanced(); this.testBalanced();
this.testBalancedPredict(); this.testBalancedPredict();

View File

@ -19,7 +19,7 @@ mindplot.layout.FreeTestSuite = new Class({
Extends: mindplot.layout.TestSuite, Extends: mindplot.layout.TestSuite,
initialize:function() { initialize:function() {
$("freeTest").setStyle("display","block"); document.id("freeTest").setStyle("display","block");
this.testFreePosition(); this.testFreePosition();
this.testFreePredict(); this.testFreePredict();

View File

@ -19,7 +19,7 @@ mindplot.layout.SymmetricTestSuite = new Class({
Extends: mindplot.layout.TestSuite, Extends: mindplot.layout.TestSuite,
initialize:function() { initialize:function() {
$("symmetricTest").setStyle("display","block"); document.id("symmetricTest").setStyle("display","block");
this.testSymmetry(); this.testSymmetry();
this.testSymmetricPredict(); this.testSymmetricPredict();

View File

@ -19,7 +19,7 @@ mindplot.layout.TestSuite = new Class({
Extends: mindplot.layout.ChildrenSorterStrategy, Extends: mindplot.layout.ChildrenSorterStrategy,
initialize:function() { initialize:function() {
$("basicTest").setStyle("display","block"); document.id("basicTest").setStyle("display","block");
// this.testAligned(); // this.testAligned();
this.testBaselineAligned1(); this.testBaselineAligned1();