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 1a22d3b6..361e20f9 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 @@ -61,8 +61,8 @@ for(var b=0,a=this.length;b1?Array.slice(arguments,1):null,d=function(){};var c=function(){var g=e,h=arguments.length;if(this instanceof c){d.prototype=a.prototype;g=new d;}var f=(!b&&!h)?a.call(g):a.apply(g,b&&h?b.concat(Array.slice(arguments)):b||arguments); -return g==e?f:g;};return c;},pass:function(b,c){var a=this;if(b!=null){b=Array.from(b);}return function(){return a.apply(c,b||arguments);};},delay:function(b,c,a){return setTimeout(this.pass((a==null?[]:a),c),b);},periodical:function(c,b,a){return setInterval(this.pass((a==null?[]:a),b),c);}}); +}return(a[c]!=null)?a[c]:"";});}}); +Function.implement({bind:function(e){var a=this,b=arguments.length>1?Array.slice(arguments,1):null,d=function(){};var c=function(){var g=e,h=arguments.length;if(this instanceof c){d.prototype=a.prototype;g=new d;}var f=(!b&&!h)?a.call(g):a.apply(g,b&&h?b.concat(Array.slice(arguments)):b||arguments);return g==e?f:g;};return c;},pass:function(b,c){var a=this;if(b!=null){b=Array.from(b);}return function(){return a.apply(c,b||arguments);};},delay:function(b,c,a){return setTimeout(this.pass((a==null?[]:a),c),b);},}); Number.alias("each","times");(function(b){var a={};b.each(function(c){if(!Number[c]){a[c]=function(){return Math[c].apply(null,[this].concat(Array.from(arguments))); };}});Number.implement(a);})(["abs","acos","asin","atan","atan2","ceil","cos","exp","floor","log","max","min","pow","sin","sqrt","tan"]);(function(){var a=this.Class=new Type("Class",function(h){if(instanceOf(h,Function)){h={initialize:h}; }var g=function(){e(this);if(g.$prototyping){return this;}this.$caller=null;var i=(this.initialize)?this.initialize.apply(this,arguments):this;this.$caller=this.caller=null; @@ -73,5 +73,4 @@ break;}}return g;};var b=function(g,h,j){if(j.$origin){j=j.$origin;}var i=functi }var l=this.caller,m=this.$caller;this.caller=m;this.$caller=i;var k=j.apply(this,arguments);this.$caller=m;this.caller=l;return k;}.extend({$owner:g,$origin:j,$name:h}); 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);}};})(); \ No newline at end of file +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);}};})(); \ No newline at end of file diff --git a/mindplot/src/main/javascript/widget/Menu.js b/mindplot/src/main/javascript/widget/Menu.js index cceebe22..c6703e49 100644 --- a/mindplot/src/main/javascript/widget/Menu.js +++ b/mindplot/src/main/javascript/widget/Menu.js @@ -222,11 +222,13 @@ mindplot.widget.Menu = new Class({ }); this._registerTooltip('export', $msg('EXPORT')); + var me = this; + this._addButton('print', false, false, function () { - this.save(saveElem, designer, false); + me.save(saveElem, designer, false); var baseUrl = window.location.href.substring(0, window.location.href.lastIndexOf("c/maps/")); window.open(baseUrl + 'c/maps/' + mapId + '/print'); - }.bind(this)); + }); this._registerTooltip('print', $msg('PRINT')); @@ -271,7 +273,7 @@ mindplot.widget.Menu = new Class({ redoButton.disable(); } - }.bind(this)); + }); } this._addButton('addTopic', true, false, function () { @@ -315,12 +317,12 @@ mindplot.widget.Menu = new Class({ }); this._registerTooltip('fontItalic', $msg('FONT_ITALIC'), "meta+I"); - var saveElem = $('#save'); if (saveElem) { - this._addButton('save', false, false, function () { - this.save(saveElem, designer, true); - }.bind(this)); + this._addButton('save', false, false, + function () { + me.save(saveElem, designer, true); + }); this._registerTooltip('save', $msg('SAVE'), "meta+S"); @@ -328,26 +330,27 @@ mindplot.widget.Menu = new Class({ // To prevent the user from leaving the page with changes ... // Element.NativeEvents.unload = 1; $(window).bind('unload', function () { - if (this.isSaveRequired()) { - this.save(saveElem, designer, false, true); + if (me.isSaveRequired()) { + me.save(saveElem, designer, false, true); } - this.unlockMap(designer); - }.bind(this)); + me.unlockMap(designer); + }); // Autosave on a fixed period of time ... - (function () { - if (this.isSaveRequired()) { - this.save(saveElem, designer, false); - } - }.bind(this)).periodical(30000); + setInterval( + function() { + if (me.isSaveRequired()) { + me.save(saveElem, designer, false); + } + }, 30000); } } var discardElem = $('#discard'); if (discardElem) { this._addButton('discard', false, false, function () { - this.discardChanges(designer); - }.bind(this)); + me.discardChanges(designer); + }); this._registerTooltip('discard', $msg('DISCARD_CHANGES')); } @@ -450,19 +453,19 @@ mindplot.widget.Menu = new Class({ }, _registerEvents: function (designer) { - + var me = this; // Register on close events ... _.each(this._toolbarElems, function (elem) { elem.addEvent('show', function () { - this.clear() - }.bind(this)); - }.bind(this)); + me.clear() + }); + }); designer.addEvent('onblur', function () { var topics = designer.getModel().filterSelectedTopics(); var rels = designer.getModel().filterSelectedRelationships(); - _.each(this._toolbarElems, function (button) { + _.each(me._toolbarElems, function (button) { var isTopicAction = button.isTopicAction(); var isRelAction = button.isRelAction(); @@ -474,13 +477,13 @@ mindplot.widget.Menu = new Class({ } } }) - }.bind(this)); + }); designer.addEvent('onfocus', function () { var topics = designer.getModel().filterSelectedTopics(); var rels = designer.getModel().filterSelectedRelationships(); - _.each(this._toolbarElems, function (button) { + _.each(me._toolbarElems, function (button) { var isTopicAction = button.isTopicAction(); var isRelAction = button.isRelAction(); @@ -495,7 +498,7 @@ mindplot.widget.Menu = new Class({ } } }) - }.bind(this)); + }); }, _addButton: function (buttonId, topic, rel, fn) { @@ -505,8 +508,8 @@ mindplot.widget.Menu = new Class({ var button = new mindplot.widget.ToolbarItem(buttonId, function (event) { fn(event); - this.clear(); - }.bind(this), {topicAction: topic, relAction: rel}); + me.clear(); + }, {topicAction: topic, relAction: rel}); this._toolbarElems.push(button); result = button; diff --git a/web2d/src/test/javascript/mootools-core-1.4.5.js b/web2d/src/test/javascript/mootools-core-1.4.5.js index 1a22d3b6..9eb4e843 100644 --- a/web2d/src/test/javascript/mootools-core-1.4.5.js +++ b/web2d/src/test/javascript/mootools-core-1.4.5.js @@ -1,77 +1,76 @@ /* ---- -MooTools: the javascript framework + --- + MooTools: the javascript framework -web build: + web build: - http://mootools.net/core/b28139f033891d55fabb70ffafd6813b -packager build: + packager build: - packager build Core/Core Core/Array Core/Class Core/Class.Extras -copyrights: - - [MooTools](http://mootools.net) + copyrights: + - [MooTools](http://mootools.net) -licenses: - - [MIT License](http://mootools.net/license.txt) -... -*/ + licenses: + - [MIT License](http://mootools.net/license.txt) + ... + */ (function(){this.MooTools={version:"1.4.5",build:"ab8ea8824dc3b24b6666867a2c4ed58ebb762cf0"};var o=this.typeOf=function(i){if(i==null){return"null";}if(i.$family!=null){return i.$family(); }if(i.nodeName){if(i.nodeType==1){return"element";}if(i.nodeType==3){return(/\S/).test(i.nodeValue)?"textnode":"whitespace";}}else{if(typeof i.length=="number"){if(i.callee){return"arguments"; }if("item" in i){return"collection";}}}return typeof i;};var j=this.instanceOf=function(t,i){if(t==null){return false;}var s=t.$constructor||t.constructor; -while(s){if(s===i){return true;}s=s.parent;}if(!t.hasOwnProperty){return false;}return t instanceof i;};var f=this.Function;var p=true;for(var k in {toString:1}){p=null; + while(s){if(s===i){return true;}s=s.parent;}if(!t.hasOwnProperty){return false;}return t instanceof i;};var f=this.Function;var p=true;for(var k in {toString:1}){p=null; }if(p){p=["hasOwnProperty","valueOf","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","constructor"];}f.prototype.overloadSetter=function(s){var i=this; -return function(u,t){if(u==null){return this;}if(s||typeof u!="string"){for(var v in u){i.call(this,v,u[v]);}if(p){for(var w=p.length;w--;){v=p[w];if(u.hasOwnProperty(v)){i.call(this,v,u[v]); -}}}}else{i.call(this,u,t);}return this;};};f.prototype.overloadGetter=function(s){var i=this;return function(u){var v,t;if(typeof u!="string"){v=u;}else{if(arguments.length>1){v=arguments; + return function(u,t){if(u==null){return this;}if(s||typeof u!="string"){for(var v in u){i.call(this,v,u[v]);}if(p){for(var w=p.length;w--;){v=p[w];if(u.hasOwnProperty(v)){i.call(this,v,u[v]); + }}}}else{i.call(this,u,t);}return this;};};f.prototype.overloadGetter=function(s){var i=this;return function(u){var v,t;if(typeof u!="string"){v=u;}else{if(arguments.length>1){v=arguments; }else{if(s){v=[u];}}}if(v){t={};for(var w=0;w>>0; -b>>0;b>>0;for(var a=(d<0)?Math.max(0,b+d):d||0;a>>0; + b>>0;b>>0;for(var a=(d<0)?Math.max(0,b+d):d||0;a>>0,b=Array(d);for(var a=0;a>>0; -b-1:String(this).indexOf(a)>-1;},trim:function(){return String(this).replace(/^\s+|\s+$/g,""); },clean:function(){return String(this).replace(/\s+/g," ").trim();},camelCase:function(){return String(this).replace(/-\D/g,function(a){return a.charAt(1).toUpperCase(); });},hyphenate:function(){return String(this).replace(/[A-Z]/g,function(a){return("-"+a.charAt(0).toLowerCase());});},capitalize:function(){return String(this).replace(/\b[a-z]/g,function(a){return a.toUpperCase(); });},escapeRegExp:function(){return String(this).replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1");},rgbToHex:function(b){var a=String(this).match(/\d{1,3}/g); -return(a)?a.rgbToHex(b):null;},substitute:function(a,b){return String(this).replace(b||(/\\?\{([^{}]+)\}/g),function(d,c){if(d.charAt(0)=="\\"){return d.slice(1); -}return(a[c]!=null)?a[c]:"";});}});Function.implement({bind:function(e){var a=this,b=arguments.length>1?Array.slice(arguments,1):null,d=function(){};var c=function(){var g=e,h=arguments.length;if(this instanceof c){d.prototype=a.prototype;g=new d;}var f=(!b&&!h)?a.call(g):a.apply(g,b&&h?b.concat(Array.slice(arguments)):b||arguments); -return g==e?f:g;};return c;},pass:function(b,c){var a=this;if(b!=null){b=Array.from(b);}return function(){return a.apply(c,b||arguments);};},delay:function(b,c,a){return setTimeout(this.pass((a==null?[]:a),c),b);},periodical:function(c,b,a){return setInterval(this.pass((a==null?[]:a),b),c);}}); + return(a)?a.rgbToHex(b):null;},substitute:function(a,b){return String(this).replace(b||(/\\?\{([^{}]+)\}/g),function(d,c){if(d.charAt(0)=="\\"){return d.slice(1); +}return(a[c]!=null)?a[c]:"";});}}); +Function.implement({bind:function(e){var a=this,b=arguments.length>1?Array.slice(arguments,1):null,d=function(){};var c=function(){var g=e,h=arguments.length;if(this instanceof c){d.prototype=a.prototype;g=new d;}var f=(!b&&!h)?a.call(g):a.apply(g,b&&h?b.concat(Array.slice(arguments)):b||arguments);return g==e?f:g;};return c;},pass:function(b,c){var a=this;if(b!=null){b=Array.from(b);}return function(){return a.apply(c,b||arguments);};},delay:function(b,c,a){return setTimeout(this.pass((a==null?[]:a),c),b);},}); Number.alias("each","times");(function(b){var a={};b.each(function(c){if(!Number[c]){a[c]=function(){return Math[c].apply(null,[this].concat(Array.from(arguments))); };}});Number.implement(a);})(["abs","acos","asin","atan","atan2","ceil","cos","exp","floor","log","max","min","pow","sin","sqrt","tan"]);(function(){var a=this.Class=new Type("Class",function(h){if(instanceOf(h,Function)){h={initialize:h}; }var g=function(){e(this);if(g.$prototyping){return this;}this.$caller=null;var i=(this.initialize)?this.initialize.apply(this,arguments):this;this.$caller=this.caller=null; -return i;}.extend(this).implement(h);g.$constructor=a;g.prototype.$constructor=g;g.prototype.parent=c;return g;});var c=function(){if(!this.$caller){throw new Error('The method "parent" cannot be called.'); + return i;}.extend(this).implement(h);g.$constructor=a;g.prototype.$constructor=g;g.prototype.parent=c;return g;});var c=function(){if(!this.$caller){throw new Error('The method "parent" cannot be called.'); }var g=this.$caller.$name,h=this.$caller.$owner.parent,i=(h)?h.prototype[g]:null;if(!i){throw new Error('The method "'+g+'" has no parent.');}return i.apply(this,arguments); };var e=function(g){for(var h in g){var j=g[h];switch(typeOf(j)){case"object":var i=function(){};i.prototype=j;g[h]=e(new i);break;case"array":g[h]=j.clone(); -break;}}return g;};var b=function(g,h,j){if(j.$origin){j=j.$origin;}var i=function(){if(j.$protected&&this.$caller==null){throw new Error('The method "'+h+'" cannot be called.'); + break;}}return g;};var b=function(g,h,j){if(j.$origin){j=j.$origin;}var i=function(){if(j.$protected&&this.$caller==null){throw new Error('The method "'+h+'" cannot be called.'); }var l=this.caller,m=this.$caller;this.caller=m;this.$caller=i;var k=j.apply(this,arguments);this.$caller=m;this.caller=l;return k;}.extend({$owner:g,$origin:j,$name:h}); -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; + 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);}};})(); \ No newline at end of file + 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);}};})(); \ No newline at end of file