From f1fa99a85e75be6d4397a4caa68281d946253792 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Tue, 4 Mar 2014 22:48:31 -0300 Subject: [PATCH] Keep migration to jQuery ... --- mindplot/src/main/javascript/Designer.js | 4 +- .../src/main/javascript/DesignerKeyboard.js | 3 +- .../main/javascript/MultilineTextEditor.js | 2 +- mindplot/src/main/javascript/TextEditor.js | 2 +- mindplot/src/main/javascript/footer.js | 6 +- .../main/javascript/layout/LayoutManager.js | 2 +- .../mootools-core-1.4.5-full-nocompat-yc.js | 84 ++----------- .../src/main/javascript/util/FadeEffect.js | 3 +- .../src/main/javascript/widget/LinkEditor.js | 81 ++++++------ mindplot/src/main/javascript/widget/Menu.js | 2 +- .../javascript/widget/ModalDialogNotifier.js | 116 +++++++++--------- .../src/main/javascript/widget/NoteEditor.js | 81 ++++++------ .../src/main/javascript/widget/ToolbarItem.js | 2 +- .../static/test/BalancedTestSuite.js | 2 +- .../javascript/static/test/FreeTestSuite.js | 2 +- .../static/test/SymmetricTestSuite.js | 2 +- .../test/javascript/static/test/TestSuite.js | 2 +- .../src/main/webapp/html/viewmode.html | 4 +- wise-editor/src/main/webapp/js/editor.js | 4 +- .../src/main/webapp/js/mindplot-min.js | 44 +++---- 20 files changed, 196 insertions(+), 252 deletions(-) diff --git a/mindplot/src/main/javascript/Designer.js b/mindplot/src/main/javascript/Designer.js index b5939313..180ed9f9 100644 --- a/mindplot/src/main/javascript/Designer.js +++ b/mindplot/src/main/javascript/Designer.js @@ -29,7 +29,7 @@ mindplot.Designer = new Class({ this._options = options; // Set full div elem render area ... - divElement.setStyles(options.size); + divElement.css(options.size); // Dispatcher manager ... var commandContext = new mindplot.CommandContext(this); @@ -83,7 +83,7 @@ mindplot.Designer = new Class({ var screenManager = workspace.getScreenManager(); // Zoom In and Zoom Out must active event - document.id(document).addEvent('mousewheel', function (event) { + $(document).bind('mousewheel', function (event) { // Change mousewheel handling so we let the default //event happen if we are outside the container. var coords = screenManager.getContainer().getCoordinates(); diff --git a/mindplot/src/main/javascript/DesignerKeyboard.js b/mindplot/src/main/javascript/DesignerKeyboard.js index 2ab79b6e..2c156286 100644 --- a/mindplot/src/main/javascript/DesignerKeyboard.js +++ b/mindplot/src/main/javascript/DesignerKeyboard.js @@ -17,7 +17,7 @@ */ mindplot.DesignerKeyboard = new Class({ - Extends:Keyboard, +// Extends:Keyboard, Static:{ register:function (designer) { this._instance = new mindplot.DesignerKeyboard(designer); @@ -30,6 +30,7 @@ mindplot.DesignerKeyboard = new Class({ }, initialize:function (designer) { + console.error("Re-impl required ...."); $assert(designer, "designer can not be null"); this.parent({defaultEventType:'keydown'}); this._registerEvents(designer); diff --git a/mindplot/src/main/javascript/MultilineTextEditor.js b/mindplot/src/main/javascript/MultilineTextEditor.js index 02efe31f..06fa546a 100644 --- a/mindplot/src/main/javascript/MultilineTextEditor.js +++ b/mindplot/src/main/javascript/MultilineTextEditor.js @@ -166,7 +166,7 @@ mindplot.MultilineTextEditor = new Class({ if (!this.isVisible()) { //Create editor ui var containerElem = this._buildEditor(); - containerElem.inject(document.id(document.body)); + containerElem.inject($(document.body)[0]); this._containerElem = containerElem; this._registerEvents(containerElem); diff --git a/mindplot/src/main/javascript/TextEditor.js b/mindplot/src/main/javascript/TextEditor.js index 97c6c316..2c4ef9e6 100644 --- a/mindplot/src/main/javascript/TextEditor.js +++ b/mindplot/src/main/javascript/TextEditor.js @@ -121,7 +121,7 @@ mindplot.TextEditor = new Class({ if (!this.isVisible()) { //Create editor ui var editorElem = this._buildEditor(); - editorElem.inject(document.id(document.body)); + editorElem.inject($(document.body)[0]); this._containerElem = editorElem; this._registerEvents(editorElem); diff --git a/mindplot/src/main/javascript/footer.js b/mindplot/src/main/javascript/footer.js index fed5a994..6858d261 100644 --- a/mindplot/src/main/javascript/footer.js +++ b/mindplot/src/main/javascript/footer.js @@ -1 +1,5 @@ -document.id(document).fireEvent('loadcomplete', 'mind'); +try { + $(document).trigger('loadcomplete', 'mind'); +} catch (e) { + console.error(e.stack); +} diff --git a/mindplot/src/main/javascript/layout/LayoutManager.js b/mindplot/src/main/javascript/layout/LayoutManager.js index b4a86e03..3b89ad5f 100644 --- a/mindplot/src/main/javascript/layout/LayoutManager.js +++ b/mindplot/src/main/javascript/layout/LayoutManager.js @@ -137,7 +137,7 @@ mindplot.layout.LayoutManager = new Class({ // Collect changes ... this._collectChanges(); - if (!document.id(fireEvents) || fireEvents) { + if ($(fireEvents).length>0 || fireEvents) { this._flushEvents(); } diff --git a/mindplot/src/main/javascript/libraries/mootools/mootools-core-1.4.5-full-nocompat-yc.js b/mindplot/src/main/javascript/libraries/mootools/mootools-core-1.4.5-full-nocompat-yc.js index 1c308c60..8745be1e 100644 --- a/mindplot/src/main/javascript/libraries/mootools/mootools-core-1.4.5-full-nocompat-yc.js +++ b/mindplot/src/main/javascript/libraries/mootools/mootools-core-1.4.5-full-nocompat-yc.js @@ -3,10 +3,10 @@ MooTools: the javascript framework web build: - - http://mootools.net/core/30dc994a4420f76eb0c11148d7715bbc + - http://mootools.net/core/2e62fb2661a9a95b8ceb9103e4681556 packager build: - - packager build Core/Core Core/Event Core/Class + - packager build Core/Core Core/Event Core/Class Core/Class.Extras copyrights: - [MooTools](http://mootools.net) @@ -114,76 +114,14 @@ return i;};var f=function(h,i,g){if(a.Mutators.hasOwnProperty(h)){i=a.Mutators[h].call(this,i);if(i==null){return this;}}if(typeOf(i)=="function"){if(i.$hidden){return this; }this.prototype[h]=(g)?i:b(this,h,i);}else{Object.merge(this.prototype,h,i);}return this;};var d=function(g){g.$prototyping=true;var h=new g;delete g.$prototyping; return h;};a.implement("implement",f.overloadSetter());a.Mutators={Extends:function(g){this.parent=g;this.prototype=d(g);},Implements:function(g){Array.from(g).each(function(j){var h=new j; - for(var i in h){f.call(this,i,h[i],true);}},this);}};})(); + for(var i in h){f.call(this,i,h[i],true);}},this);}};})();(function(){this.Chain=new Class({$chain:[],chain:function(){this.$chain.append(Array.flatten(arguments)); + return this;},callChain:function(){return(this.$chain.length)?this.$chain.shift().apply(this,arguments):false;},clearChain:function(){this.$chain.empty(); + return this;}});var a=function(b){return b.replace(/^on([A-Z])/,function(c,d){return d.toLowerCase();});};this.Events=new Class({$events:{},addEvent:function(d,c,b){d=a(d); + this.$events[d]=(this.$events[d]||[]).include(c);if(b){c.internal=true;}return this;},addEvents:function(b){for(var c in b){this.addEvent(c,b[c]);}return this; +},fireEvent:function(e,c,b){e=a(e);var d=this.$events[e];if(!d){return this;}c=Array.from(c);d.each(function(f){if(b){f.delay(b,this,c);}else{f.apply(this,c); +}},this);return this;},removeEvent:function(e,d){e=a(e);var c=this.$events[e];if(c&&!d.internal){var b=c.indexOf(d);if(b!=-1){delete c[b];}}return this; +},removeEvents:function(d){var e;if(typeOf(d)=="object"){for(e in d){this.removeEvent(e,d[e]);}return this;}if(d){d=a(d);}for(e in this.$events){if(d&&d!=e){continue; +}var c=this.$events[e];for(var b=c.length;b--;){if(b in c){this.removeEvent(e,c[b]);}}}return this;}});this.Options=new Class({setOptions:function(){var b=this.options=Object.merge.apply(null,[{},this.options].append(arguments)); + if(this.addEvent){for(var c in b){if(typeOf(b[c])!="function"||!(/^on[A-Z]/).test(c)){continue;}this.addEvent(c,b[c]);delete b[c];}}return this;}});})(); -/* ---- -MooTools: the javascript framework - -web build: - - http://mootools.net/more/f2525bc6fff0bd7c116ab195534ce396 - -packager build: - - packager build More/Assets More/Keyboard More/Keyboard.Extras - -copyrights: - - [MooTools](http://mootools.net) - -licenses: - - [MIT License](http://mootools.net/license.txt) -... -*/ - -MooTools.More={version:"1.4.0.1",build:"a4244edf2aa97ac8a196fc96082dd35af1abab87"};var Asset={javascript:function(d,b){if(!b){b={};}var a=new Element("script",{src:d,type:"text/javascript"}),e=b.document||document,c=b.onload||b.onLoad; -delete b.onload;delete b.onLoad;delete b.document;if(c){if(typeof a.onreadystatechange!="undefined"){a.addEvent("readystatechange",function(){if(["loaded","complete"].contains(this.readyState)){c.call(this); -}});}else{a.addEvent("load",c);}}return a.set(b).inject(e.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(){Events.Pseudos=function(h,e,f){var d="_monitorEvents:";var c=function(i){return{store:i.store?function(j,k){i.store(d+j,k);}:function(j,k){(i._monitorEvents||(i._monitorEvents={}))[j]=k; -},retrieve:i.retrieve?function(j,k){return i.retrieve(d+j,k);}:function(j,k){if(!i._monitorEvents){return k;}return i._monitorEvents[j]||k;}};};var g=function(k){if(k.indexOf(":")==-1||!h){return null; -}var j=Slick.parse(k).expressions[0][0],p=j.pseudos,i=p.length,o=[];while(i--){var n=p[i].key,m=h[n];if(m!=null){o.push({event:j.tag,value:p[i].value,pseudo:n,original:k,listener:m}); -}}return o.length?o:null;};return{addEvent:function(m,p,j){var n=g(m);if(!n){return e.call(this,m,p,j);}var k=c(this),r=k.retrieve(m,[]),i=n[0].event,l=Array.slice(arguments,2),o=p,q=this; -n.each(function(s){var t=s.listener,u=o;if(t==false){i+=":"+s.pseudo+"("+s.value+")";}else{o=function(){t.call(q,s,u,arguments,o);};}});r.include({type:i,event:p,monitor:o}); -k.store(m,r);if(m!=i){e.apply(this,[m,p].concat(l));}return e.apply(this,[i,o].concat(l));},removeEvent:function(m,l){var k=g(m);if(!k){return f.call(this,m,l); -}var n=c(this),j=n.retrieve(m);if(!j){return this;}var i=Array.slice(arguments,2);f.apply(this,[m,l].concat(i));j.each(function(o,p){if(!l||o.event==l){f.apply(this,[o.type,o.monitor].concat(i)); -}delete j[p];},this);n.store(m,j);return this;}};};var b={once:function(e,f,d,c){f.apply(this,d);this.removeEvent(e.event,c).removeEvent(e.original,f); -},throttle:function(d,e,c){if(!e._throttled){e.apply(this,c);e._throttled=setTimeout(function(){e._throttled=false;},d.value||250);}},pause:function(d,e,c){clearTimeout(e._pause); -e._pause=e.delay(d.value||250,this,c);}};Events.definePseudo=function(c,d){b[c]=d;return this;};Events.lookupPseudo=function(c){return b[c];};var a=Events.prototype; -Events.implement(Events.Pseudos(b,a.addEvent,a.removeEvent));["Request","Fx"].each(function(c){if(this[c]){this[c].implement(Events.prototype);}});})(); -(function(){var d={relay:false},c=["once","throttle","pause"],b=c.length;while(b--){d[c[b]]=Events.lookupPseudo(c[b]);}DOMEvent.definePseudo=function(e,f){d[e]=f; -return this;};var a=Element.prototype;[Element,Window,Document].invoke("implement",Events.Pseudos(d,a.addEvent,a.removeEvent));})();(function(){var a="$moo:keys-pressed",b="$moo:keys-keyup"; -DOMEvent.definePseudo("keys",function(d,e,c){var g=c[0],f=[],h=this.retrieve(a,[]);f.append(d.value.replace("++",function(){f.push("+");return"";}).split("+")); -h.include(g.key);if(f.every(function(j){return h.contains(j);})){e.apply(this,c);}this.store(a,h);if(!this.retrieve(b)){var i=function(j){(function(){h=this.retrieve(a,[]).erase(j.key); -this.store(a,h);}).delay(0,this);};this.store(b,i).addEvent("keyup",i);}});DOMEvent.defineKeys({"16":"shift","17":"control","18":"alt","20":"capslock","33":"pageup","34":"pagedown","35":"end","36":"home","144":"numlock","145":"scrolllock","186":";","187":"=","188":",","190":".","191":"/","192":"`","219":"[","220":"\\","221":"]","222":"'","107":"+"}).defineKey(Browser.firefox?109:189,"-"); -})();(function(){var a=this.Keyboard=new Class({Extends:Events,Implements:[Options],options:{defaultEventType:"keydown",active:false,manager:null,events:{},nonParsedEvents:["activate","deactivate","onactivate","ondeactivate","changed","onchanged"]},initialize:function(f){if(f&&f.manager){this._manager=f.manager; -delete f.manager;}this.setOptions(f);this._setup();},addEvent:function(h,g,f){return this.parent(a.parse(h,this.options.defaultEventType,this.options.nonParsedEvents),g,f); -},removeEvent:function(g,f){return this.parent(a.parse(g,this.options.defaultEventType,this.options.nonParsedEvents),f);},toggleActive:function(){return this[this.isActive()?"deactivate":"activate"](); -},activate:function(f){if(f){if(f.isActive()){return this;}if(this._activeKB&&f!=this._activeKB){this.previous=this._activeKB;this.previous.fireEvent("deactivate"); -}this._activeKB=f.fireEvent("activate");a.manager.fireEvent("changed");}else{if(this._manager){this._manager.activate(this);}}return this;},isActive:function(){return this._manager?(this._manager._activeKB==this):(a.manager==this); -},deactivate:function(f){if(f){if(f===this._activeKB){this._activeKB=null;f.fireEvent("deactivate");a.manager.fireEvent("changed");}}else{if(this._manager){this._manager.deactivate(this); -}}return this;},relinquish:function(){if(this.isActive()&&this._manager&&this._manager.previous){this._manager.activate(this._manager.previous);}else{this.deactivate(); -}return this;},manage:function(f){if(f._manager){f._manager.drop(f);}this._instances.push(f);f._manager=this;if(!this._activeKB){this.activate(f);}return this; -},drop:function(f){f.relinquish();this._instances.erase(f);if(this._activeKB==f){if(this.previous&&this._instances.contains(this.previous)){this.activate(this.previous); -}else{this._activeKB=this._instances[0];}}return this;},trace:function(){a.trace(this);},each:function(f){a.each(this,f);},_instances:[],_disable:function(f){if(this._activeKB==f){this._activeKB=null; -}},_setup:function(){this.addEvents(this.options.events);if(a.manager&&!this._manager){a.manager.manage(this);}if(this.options.active){this.activate(); -}else{this.relinquish();}},_handle:function(h,g){if(h.preventKeyboardPropagation){return;}var f=!!this._manager;if(f&&this._activeKB){this._activeKB._handle(h,g); -if(h.preventKeyboardPropagation){return;}}this.fireEvent(g,h);if(!f&&this._activeKB){this._activeKB._handle(h,g);}}});var b={};var c=["shift","control","alt","meta"]; -var e=/^(?:shift|control|ctrl|alt|meta)$/;a.parse=function(h,g,k){if(k&&k.contains(h.toLowerCase())){return h;}h=h.toLowerCase().replace(/^(keyup|keydown):/,function(m,l){g=l; -return"";});if(!b[h]){var f,j={};h.split("+").each(function(l){if(e.test(l)){j[l]=true;}else{f=l;}});j.control=j.control||j.ctrl;var i=[];c.each(function(l){if(j[l]){i.push(l); -}});if(f){i.push(f);}b[h]=i.join("+");}return g+":keys("+b[h]+")";};a.each=function(f,g){var h=f||a.manager;while(h){g.run(h);h=h._activeKB;}};a.stop=function(f){f.preventKeyboardPropagation=true; -};a.manager=new a({active:true});a.trace=function(f){f=f||a.manager;var g=window.console&&console.log;if(g){console.log("the following items have focus: "); -}a.each(f,function(h){if(g){console.log(document.id(h.widget)||h.wiget||h);}});};var d=function(g){var f=[];c.each(function(h){if(g[h]){f.push(h);}});if(!e.test(g.key)){f.push(g.key); -}a.manager._handle(g,g.type+":keys("+f.join("+")+")");};document.addEvents({keyup:d,keydown:d});})();Keyboard.prototype.options.nonParsedEvents.combine(["rebound","onrebound"]); -Keyboard.implement({addShortcut:function(b,a){this._shortcuts=this._shortcuts||[];this._shortcutIndex=this._shortcutIndex||{};a.getKeyboard=Function.from(this); -a.name=b;this._shortcutIndex[b]=a;this._shortcuts.push(a);if(a.keys){this.addEvent(a.keys,a.handler);}return this;},addShortcuts:function(b){for(var a in b){this.addShortcut(a,b[a]); -}return this;},removeShortcut:function(b){var a=this.getShortcut(b);if(a&&a.keys){this.removeEvent(a.keys,a.handler);delete this._shortcutIndex[b];this._shortcuts.erase(a); -}return this;},removeShortcuts:function(a){a.each(this.removeShortcut,this);return this;},getShortcuts:function(){return this._shortcuts||[];},getShortcut:function(a){return(this._shortcutIndex||{})[a]; -}});Keyboard.rebind=function(b,a){Array.from(a).each(function(c){c.getKeyboard().removeEvent(c.keys,c.handler);c.getKeyboard().addEvent(b,c.handler);c.keys=b; -c.getKeyboard().fireEvent("rebound");});};Keyboard.getActiveShortcuts=function(b){var a=[],c=[];Keyboard.each(b,[].push.bind(a));a.each(function(d){c.extend(d.getShortcuts()); -});return c;};Keyboard.getShortcut=function(c,b,d){d=d||{};var a=d.many?[]:null,e=d.many?function(g){var f=g.getShortcut(c);if(f){a.push(f);}}:function(f){if(!a){a=f.getShortcut(c); -}};Keyboard.each(b,e);return a;};Keyboard.getShortcuts=function(b,a){return Keyboard.getShortcut(b,a,{many:true});}; diff --git a/mindplot/src/main/javascript/util/FadeEffect.js b/mindplot/src/main/javascript/util/FadeEffect.js index 82a7fb0d..b6018bd1 100644 --- a/mindplot/src/main/javascript/util/FadeEffect.js +++ b/mindplot/src/main/javascript/util/FadeEffect.js @@ -17,8 +17,9 @@ */ mindplot.util.FadeEffect = new Class({ - Extends: Fx, +// Extends: Fx, initialize: function(elements, isVisible) { + console.error("Re-impl required ...."); this.parent({duration:3000,frames:15,transition:'linear'}); this._isVisible = isVisible; this._element = elements; diff --git a/mindplot/src/main/javascript/widget/LinkEditor.js b/mindplot/src/main/javascript/widget/LinkEditor.js index 28a22d54..07da4cf6 100644 --- a/mindplot/src/main/javascript/widget/LinkEditor.js +++ b/mindplot/src/main/javascript/widget/LinkEditor.js @@ -17,49 +17,50 @@ */ mindplot.widget.LinkEditor = new Class({ - Extends:MooDialog, +// Extends:MooDialog, initialize:function (model) { $assert(model, "model can not be null"); var panel = this._buildPanel(model); - this.parent({ - closeButton:true, - destroyOnClose:true, - title:$msg('LINK'), - onInitialize:function (wrapper) { - wrapper.setStyle('opacity', 0); - this.fx = new Fx.Morph(wrapper, { - duration:600, - transition:Fx.Transitions.Bounce.easeOut - }); - }, - - onBeforeOpen:function () { - this.overlay = new Overlay(this.options.inject, { - duration:this.options.duration - }); - if (this.options.closeOnOverlayClick) - this.overlay.addEvent('click', this.close.bind(this)); - - this.overlay.open(); - - this.fx.start({ - 'margin-top':[-200, -100], - opacity:[0, 1] - }).chain(function () { - this.fireEvent('show'); - }.bind(this)); - }, - - onBeforeClose:function () { - this.fx.start({ - 'margin-top':[-100, 0], - opacity:0 - }).chain(function () { - this.fireEvent('hide'); - }.bind(this)); - this.overlay.destroy(); - } - }); + console.error("Re-impl required ...."); +// this.parent({ +// closeButton:true, +// destroyOnClose:true, +// title:$msg('LINK'), +// onInitialize:function (wrapper) { +// wrapper.setStyle('opacity', 0); +// this.fx = new Fx.Morph(wrapper, { +// duration:600, +// transition:Fx.Transitions.Bounce.easeOut +// }); +// }, +// +// onBeforeOpen:function () { +// this.overlay = new Overlay(this.options.inject, { +// duration:this.options.duration +// }); +// if (this.options.closeOnOverlayClick) +// this.overlay.addEvent('click', this.close.bind(this)); +// +// this.overlay.open(); +// +// this.fx.start({ +// 'margin-top':[-200, -100], +// opacity:[0, 1] +// }).chain(function () { +// this.fireEvent('show'); +// }.bind(this)); +// }, +// +// onBeforeClose:function () { +// this.fx.start({ +// 'margin-top':[-100, 0], +// opacity:0 +// }).chain(function () { +// this.fireEvent('hide'); +// }.bind(this)); +// this.overlay.destroy(); +// } +// }); this.setContent(panel); }, diff --git a/mindplot/src/main/javascript/widget/Menu.js b/mindplot/src/main/javascript/widget/Menu.js index 88fea25d..2d814d5d 100644 --- a/mindplot/src/main/javascript/widget/Menu.js +++ b/mindplot/src/main/javascript/widget/Menu.js @@ -434,7 +434,7 @@ mindplot.widget.Menu = new Class({ } - var videoElem = document.id("tutorialVideo"); + var videoElem = $('#tutorialVideo'); if (videoElem) { var width = 900; var height = 500; diff --git a/mindplot/src/main/javascript/widget/ModalDialogNotifier.js b/mindplot/src/main/javascript/widget/ModalDialogNotifier.js index db151762..c7940f76 100644 --- a/mindplot/src/main/javascript/widget/ModalDialogNotifier.js +++ b/mindplot/src/main/javascript/widget/ModalDialogNotifier.js @@ -17,80 +17,82 @@ */ mindplot.widget.ModalDialogNotifier = new Class({ - Extends:MooDialog, - initialize:function () { - this.parent({ - closeButton:false, - destroyOnClose:false, - autoOpen:true, - useEscKey:false, - closeOnOverlayClick:false, - title:"", - onInitialize:function (wrapper) { - wrapper.setStyle('opacity', 0); - this.wrapper.setStyle('display', 'none'); - this.fx = new Fx.Morph(wrapper, { - duration:100, - transition:Fx.Transitions.Bounce.easeOut - }); - }, - - onBeforeOpen:function () { - var panel = this._buildPanel(); - this.setContent(panel); - - this.overlay = new Overlay(this.options.inject, { - duration:this.options.duration - }); - if (this.options.closeOnOverlayClick) - this.overlay.addEvent('click', this.close.bind(this)); - this.overlay.open(); - this.fx.start({ - 'margin-top':[-200, -100], - opacity:[0, 1] - }).chain(function () { - this.fireEvent('show'); - this.wrapper.setStyle('display', 'block'); - }.bind(this)); - }, - - onBeforeClose:function () { - this.fx.start({ - 'margin-top':[-100, 0], - opacity:0, - duration:200 - }).chain(function () { - this.wrapper.setStyle('display', 'none'); - this.fireEvent('hide'); - - }.bind(this)); - }} - ); - this.message = null; +// Extends:MooDialog, + initialize: function () { + console.error("Re-impl required ...."); +// this.parent( +// { +// closeButton:false, +// destroyOnClose:false, +// autoOpen:true, +// useEscKey:false, +// closeOnOverlayClick:false, +// title:"", +// onInitialize:function (wrapper) { +// wrapper.setStyle('opacity', 0); +// this.wrapper.setStyle('display', 'none'); +// this.fx = new Fx.Morph(wrapper, { +// duration:100, +// transition:Fx.Transitions.Bounce.easeOut +// }); +// }, +// +// onBeforeOpen:function () { +// var panel = this._buildPanel(); +// this.setContent(panel); +// +// this.overlay = new Overlay(this.options.inject, { +// duration:this.options.duration +// }); +// if (this.options.closeOnOverlayClick) +// this.overlay.addEvent('click', this.close.bind(this)); +// this.overlay.open(); +// this.fx.start({ +// 'margin-top':[-200, -100], +// opacity:[0, 1] +// }).chain(function () { +// this.fireEvent('show'); +// this.wrapper.setStyle('display', 'block'); +// }.bind(this)); +// }, +// +// onBeforeClose:function () { +// this.fx.start({ +// 'margin-top':[-100, 0], +// opacity:0, +// duration:200 +// }).chain(function () { +// this.wrapper.setStyle('display', 'none'); +// this.fireEvent('hide'); +// +// }.bind(this)); +// }} +// ); +// this.message = null; }, - show:function (message, title) { + show: function (message, title) { $assert(message, "message can not be null"); this._messsage = message; this.options.title = $defined(title) ? title : "Outch!!. An unexpected error has occurred"; this.open(); }, - destroy:function () { + destroy: function () { this.parent(); this.overlay.destroy(); }, - _buildPanel:function () { + _buildPanel: function () { var result = new Element('div'); result.setStyles({ - 'text-align':'center', - width:'400px' + 'text-align': 'center', + width: '400px' }); - var p = new Element('p', {'text':this._messsage}); + var p = new Element('p', {'text': this._messsage}); p.inject(result); - var img = new Element('img', {'src':'images/alert-sign.png'}); + var img = new Element('img', {'src': 'images/alert-sign.png'}); img.inject(result); return result; diff --git a/mindplot/src/main/javascript/widget/NoteEditor.js b/mindplot/src/main/javascript/widget/NoteEditor.js index f1906751..811ced9e 100644 --- a/mindplot/src/main/javascript/widget/NoteEditor.js +++ b/mindplot/src/main/javascript/widget/NoteEditor.js @@ -17,49 +17,50 @@ */ mindplot.widget.NoteEditor = new Class({ - Extends:MooDialog, +// Extends:MooDialog, initialize:function (model) { + console.log("Re-impl required ...."); $assert(model, "model can not be null"); var panel = this._buildPanel(model); - this.parent({ - closeButton:true, - destroyOnClose:true, - title:$msg('NOTE'), - onInitialize:function (wrapper) { - wrapper.setStyle('opacity', 0); - this.fx = new Fx.Morph(wrapper, { - duration:600, - transition:Fx.Transitions.Bounce.easeOut - }); - }, - - onBeforeOpen:function () { - this.overlay = new Overlay(this.options.inject, { - duration:this.options.duration - }); - if (this.options.closeOnOverlayClick) - this.overlay.addEvent('click', this.close.bind(this)); - this.overlay.open(); - - this.fx.start({ - 'margin-top':[-200, -100], - opacity:[0, 1] - }).chain(function () { - this.fireEvent('show'); - }.bind(this)); - }, - - onBeforeClose:function () { - this.fx.start({ - 'margin-top':[-100, 0], - opacity:0 - }).chain(function () { - this.fireEvent('hide'); - }.bind(this)); - this.overlay.destroy(); - } - }); - this.setContent(panel); +// this.parent({ +// closeButton:true, +// destroyOnClose:true, +// title:$msg('NOTE'), +// onInitialize:function (wrapper) { +// wrapper.setStyle('opacity', 0); +// this.fx = new Fx.Morph(wrapper, { +// duration:600, +// transition:Fx.Transitions.Bounce.easeOut +// }); +// }, +// +// onBeforeOpen:function () { +// this.overlay = new Overlay(this.options.inject, { +// duration:this.options.duration +// }); +// if (this.options.closeOnOverlayClick) +// this.overlay.addEvent('click', this.close.bind(this)); +// this.overlay.open(); +// +// this.fx.start({ +// 'margin-top':[-200, -100], +// opacity:[0, 1] +// }).chain(function () { +// this.fireEvent('show'); +// }.bind(this)); +// }, +// +// onBeforeClose:function () { +// this.fx.start({ +// 'margin-top':[-100, 0], +// opacity:0 +// }).chain(function () { +// this.fireEvent('hide'); +// }.bind(this)); +// this.overlay.destroy(); +// } +// }); +// this.setContent(panel); }, _buildPanel:function (model) { diff --git a/mindplot/src/main/javascript/widget/ToolbarItem.js b/mindplot/src/main/javascript/widget/ToolbarItem.js index eec58a66..de1db4e8 100644 --- a/mindplot/src/main/javascript/widget/ToolbarItem.js +++ b/mindplot/src/main/javascript/widget/ToolbarItem.js @@ -32,7 +32,7 @@ mindplot.widget.ToolbarItem = new Class({ _registerTip: function() { - return new mindplot.widget.FloatingTip(document.id(this._buttonId), { + return new mindplot.widget.FloatingTip($("#"+this._buttonId), { html: false, position: 'bottom', arrowOffset : 5, diff --git a/mindplot/src/test/javascript/static/test/BalancedTestSuite.js b/mindplot/src/test/javascript/static/test/BalancedTestSuite.js index 3bb0ef92..470b7bc5 100644 --- a/mindplot/src/test/javascript/static/test/BalancedTestSuite.js +++ b/mindplot/src/test/javascript/static/test/BalancedTestSuite.js @@ -19,7 +19,7 @@ mindplot.layout.BalancedTestSuite = new Class({ Extends: mindplot.layout.TestSuite, initialize:function() { - document.id("balancedTest").setStyle("display","block"); + $('#balancedTest').setStyle("display","block"); this.testBalanced(); this.testBalancedPredict(); diff --git a/mindplot/src/test/javascript/static/test/FreeTestSuite.js b/mindplot/src/test/javascript/static/test/FreeTestSuite.js index 642872a6..17101e13 100644 --- a/mindplot/src/test/javascript/static/test/FreeTestSuite.js +++ b/mindplot/src/test/javascript/static/test/FreeTestSuite.js @@ -19,7 +19,7 @@ mindplot.layout.FreeTestSuite = new Class({ Extends: mindplot.layout.TestSuite, initialize:function() { - document.id("freeTest").setStyle("display","block"); + $('#freeTest').setStyle("display","block"); this.testFreePosition(); this.testFreePredict(); diff --git a/mindplot/src/test/javascript/static/test/SymmetricTestSuite.js b/mindplot/src/test/javascript/static/test/SymmetricTestSuite.js index 713bffe9..15578d24 100644 --- a/mindplot/src/test/javascript/static/test/SymmetricTestSuite.js +++ b/mindplot/src/test/javascript/static/test/SymmetricTestSuite.js @@ -19,7 +19,7 @@ mindplot.layout.SymmetricTestSuite = new Class({ Extends: mindplot.layout.TestSuite, initialize:function() { - document.id("symmetricTest").setStyle("display","block"); + $('#symmetricTest').setStyle("display","block"); this.testSymmetry(); this.testSymmetricPredict(); diff --git a/mindplot/src/test/javascript/static/test/TestSuite.js b/mindplot/src/test/javascript/static/test/TestSuite.js index a3bcfbee..7fc53d40 100644 --- a/mindplot/src/test/javascript/static/test/TestSuite.js +++ b/mindplot/src/test/javascript/static/test/TestSuite.js @@ -19,7 +19,7 @@ mindplot.layout.TestSuite = new Class({ Extends: mindplot.layout.ChildrenSorterStrategy, initialize:function() { - document.id("basicTest").setStyle("display","block"); + $('#basicTest').setStyle("display","block"); // this.testAligned(); this.testBaselineAligned1(); diff --git a/wise-editor/src/main/webapp/html/viewmode.html b/wise-editor/src/main/webapp/html/viewmode.html index 883fbaab..d8bcfe28 100644 --- a/wise-editor/src/main/webapp/html/viewmode.html +++ b/wise-editor/src/main/webapp/html/viewmode.html @@ -22,7 +22,7 @@