From 82955480381e4e7e15ea6c230966ee73a8acfdfc Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Thu, 26 Sep 2013 00:11:54 +0100 Subject: [PATCH] MDL-41986 JavaScript/Dock: Correct log level in Y.log statements --- .../moodle-core-dock-loader-debug.js | 9 +++--- .../moodle-core-dock-loader.js | 1 + .../moodle-core-dock-debug.js | 29 ++++++++++--------- .../moodle-core-dock/moodle-core-dock.js | 1 + lib/yui/src/dock/js/block.js | 6 ++-- lib/yui/src/dock/js/dock.js | 12 ++++---- lib/yui/src/dock/js/dockeditem.js | 8 ++--- lib/yui/src/dock/js/loader.js | 10 +++---- lib/yui/src/dock/js/panel.js | 2 +- lib/yui/src/dock/js/tabheightmanager.js | 2 +- 10 files changed, 42 insertions(+), 38 deletions(-) diff --git a/lib/yui/build/moodle-core-dock-loader/moodle-core-dock-loader-debug.js b/lib/yui/build/moodle-core-dock-loader/moodle-core-dock-loader-debug.js index dac8f387d8c..2d954cacc32 100644 --- a/lib/yui/build/moodle-core-dock-loader/moodle-core-dock-loader-debug.js +++ b/lib/yui/build/moodle-core-dock-loader/moodle-core-dock-loader-debug.js @@ -89,17 +89,17 @@ M.core.dock.loader.delegationEvents = []; * @method initLoader */ M.core.dock.loader.initLoader = function() { - Y.log('Dock loader initialising', 'note', LOADERNAME); + Y.log('Dock loader initialising', 'debug', LOADERNAME); var dockedblocks = Y.all('.block[data-instanceid][data-dockable]'), body = Y.one(document.body), callback; dockedblocks.each(function() { var id = parseInt(this.getData('instanceid'), 10); - Y.log('Dock loader watching block with instance id: '+id, 'note', LOADERNAME); + Y.log('Dock loader watching block with instance id: '+id, 'debug', LOADERNAME); M.core.dock.ensureMoveToIconExists(this); }); if (dockedblocks.some(function(node){return node.hasClass('dock_on_load');})) { - Y.log('Loading dock module', 'note', LOADERNAME); + Y.log('Loading dock module', 'debug', LOADERNAME); Y.use('moodle-core-dock', function() { M.core.dock.init(); }); @@ -115,7 +115,7 @@ M.core.dock.loader.initLoader = function() { } } block.addClass('dock_on_load'); - Y.log('Loading dock module', 'note', LOADERNAME); + Y.log('Loading dock module', 'debug', LOADERNAME); Y.use('moodle-core-dock', function(){ M.util.set_user_preference('docked_block_instance_'+instanceid, 1); M.core.dock.init(); @@ -126,4 +126,5 @@ M.core.dock.loader.initLoader = function() { } }; + }, '@VERSION@', {"requires": ["escape"]}); diff --git a/lib/yui/build/moodle-core-dock-loader/moodle-core-dock-loader.js b/lib/yui/build/moodle-core-dock-loader/moodle-core-dock-loader.js index a84e12347c2..e5606947724 100644 --- a/lib/yui/build/moodle-core-dock-loader/moodle-core-dock-loader.js +++ b/lib/yui/build/moodle-core-dock-loader/moodle-core-dock-loader.js @@ -122,4 +122,5 @@ M.core.dock.loader.initLoader = function() { } }; + }, '@VERSION@', {"requires": ["escape"]}); diff --git a/lib/yui/build/moodle-core-dock/moodle-core-dock-debug.js b/lib/yui/build/moodle-core-dock/moodle-core-dock-debug.js index 632f1bd192d..525c389ac1d 100644 --- a/lib/yui/build/moodle-core-dock/moodle-core-dock-debug.js +++ b/lib/yui/build/moodle-core-dock/moodle-core-dock-debug.js @@ -331,7 +331,7 @@ DOCK.prototype = { * @method initializer */ initializer : function() { - Y.log('Dock initialising', 'note', LOGNS); + Y.log('Dock initialising', 'debug', LOGNS); // Publish the events the dock has /** @@ -533,7 +533,7 @@ DOCK.prototype = { warned = true; } // Damn, the've set something. - Y.log('Note for customise_dock_for_theme code: M.core_dock.cfg.'+key+' is now dock.set(\''+key+'\', value)', 'info', LOGNS); + Y.log('Note for customise_dock_for_theme code: M.core_dock.cfg.'+key+' is now dock.set(\''+key+'\', value)', 'debug', LOGNS); this.set(cfgmap[key], value); } } @@ -549,7 +549,7 @@ DOCK.prototype = { warned = true; } // Damn, they've set something. - Y.log('Note for customise_dock_for_theme code: M.core_dock.css.'+key+' is now CSS.'+key+' = value', 'info', LOGNS); + Y.log('Note for customise_dock_for_theme code: M.core_dock.css.'+key+' is now CSS.'+key+' = value', 'debug', LOGNS); CSS[key] = value; } } @@ -831,7 +831,7 @@ DOCK.prototype = { add : function(item) { // Set the dockitem id to the total count and then increment it. item.set('id', this.totalcount); - Y.log('Adding block '+item._getLogDescription()+' to the dock.', 'info', LOGNS); + Y.log('Adding block '+item._getLogDescription()+' to the dock.', 'debug', LOGNS); this.count++; this.totalcount++; this.dockeditems[item.get('id')] = item; @@ -866,7 +866,7 @@ DOCK.prototype = { if (!this.dockeditems[id]) { return false; } - Y.log('Removing block '+this.dockeditems[id]._getLogDescription()+' from the dock.', 'info', LOGNS); + Y.log('Removing block '+this.dockeditems[id]._getLogDescription()+' from the dock.', 'debug', LOGNS); this.dockeditems[id].remove(); delete this.dockeditems[id]; this.count--; @@ -890,7 +890,7 @@ DOCK.prototype = { * @return {Boolean} */ removeAll : function() { - Y.log('Undocking all '+this.dockeditems.length+' blocks', 'note', LOGNS); + Y.log('Undocking all '+this.dockeditems.length+' blocks', 'debug', LOGNS); var i; for (i in this.dockeditems) { if (Y.Lang.isNumber(i) || Y.Lang.isString(i)) { @@ -1151,7 +1151,7 @@ DOCKPANEL.prototype = { * @method initializer */ initializer : function() { - Y.log('Panel initialising', 'note', LOGNS); + Y.log('Panel initialising', 'debug', LOGNS); /** * Fired before the panel is shown. * @event dockpane::beforeshow @@ -1425,7 +1425,7 @@ TABHEIGHTMANAGER.prototype = { runningcount = 0, usedheight = 0, id, itemtitle, itemheight, offsetheight; - Y.log('Enabling the dock tab sizer.', 'note', LOGNS); + Y.log('Enabling the dock tab sizer.', 'debug', LOGNS); this.set('enabled', true); for (id in items) { if (Y.Lang.isNumber(id) || Y.Lang.isString(id)) { @@ -1656,7 +1656,7 @@ BLOCK.prototype = { return false; } - Y.log('Initialised block with instance id:'+this.get('id'), 'note', LOGNS); + Y.log('Initialised block with instance id:'+this.get('id'), 'debug', LOGNS); M.core.dock.ensureMoveToIconExists(node); @@ -1721,7 +1721,7 @@ BLOCK.prototype = { return; } - Y.log('Moving block to the dock:'+this.get('id'), 'note', LOGNS); + Y.log('Moving block to the dock:'+this.get('id'), 'debug', LOGNS); this.recordBlockState(); @@ -1792,7 +1792,7 @@ BLOCK.prototype = { var id = this.get('id'), commands; - Y.log('Moving block out of the dock:'+this.get('id'), 'note', LOGNS); + Y.log('Moving block out of the dock:'+this.get('id'), 'debug', LOGNS); // Enable the skip anchor when going back to block mode if (this.contentskipanchor) { @@ -1926,7 +1926,7 @@ DOCKEDITEM.prototype = { this.set('title', title); this.set('titlestring', titlestring); } - Y.log('Initialised dockeditem for block with title "'+this._getLogDescription(), 'note', LOGNS); + Y.log('Initialised dockeditem for block with title "'+this._getLogDescription(), 'debug', LOGNS); }, /** * This function draws the item on the dock. @@ -1979,7 +1979,7 @@ DOCKEDITEM.prototype = { dock.hideActive(); this.fire('dockeditem:showstart'); - Y.log('Showing '+this._getLogDescription(), 'info', LOGNS); + Y.log('Showing '+this._getLogDescription(), 'debug', LOGNS); panel.setHeader(this.get('titlestring'), this.get('commands')); panel.setBody(Y.Node.create('
').append(this.get('contents'))); panel.show(); @@ -2000,7 +2000,7 @@ DOCKEDITEM.prototype = { */ hide : function() { this.fire('dockeditem:hidestart'); - Y.log('Hiding "'+this._getLogDescription(), 'info', LOGNS); + Y.log('Hiding "'+this._getLogDescription(), 'debug', LOGNS); if (this.active) { // No longer active this.active = false; @@ -2164,6 +2164,7 @@ Y.extend(DOCKEDITEM, Y.Base, DOCKEDITEM.prototype, { }); Y.augment(DOCKEDITEM, Y.EventTarget); + }, '@VERSION@', { "requires": [ "base", diff --git a/lib/yui/build/moodle-core-dock/moodle-core-dock.js b/lib/yui/build/moodle-core-dock/moodle-core-dock.js index 25c83d7835b..bef5e34de38 100644 --- a/lib/yui/build/moodle-core-dock/moodle-core-dock.js +++ b/lib/yui/build/moodle-core-dock/moodle-core-dock.js @@ -2146,6 +2146,7 @@ Y.extend(DOCKEDITEM, Y.Base, DOCKEDITEM.prototype, { }); Y.augment(DOCKEDITEM, Y.EventTarget); + }, '@VERSION@', { "requires": [ "base", diff --git a/lib/yui/src/dock/js/block.js b/lib/yui/src/dock/js/block.js index ffb8e6a7104..e203f77366f 100644 --- a/lib/yui/src/dock/js/block.js +++ b/lib/yui/src/dock/js/block.js @@ -64,7 +64,7 @@ BLOCK.prototype = { return false; } - Y.log('Initialised block with instance id:'+this.get('id'), 'note', LOGNS); + Y.log('Initialised block with instance id:'+this.get('id'), 'debug', LOGNS); M.core.dock.ensureMoveToIconExists(node); @@ -129,7 +129,7 @@ BLOCK.prototype = { return; } - Y.log('Moving block to the dock:'+this.get('id'), 'note', LOGNS); + Y.log('Moving block to the dock:'+this.get('id'), 'debug', LOGNS); this.recordBlockState(); @@ -200,7 +200,7 @@ BLOCK.prototype = { var id = this.get('id'), commands; - Y.log('Moving block out of the dock:'+this.get('id'), 'note', LOGNS); + Y.log('Moving block out of the dock:'+this.get('id'), 'debug', LOGNS); // Enable the skip anchor when going back to block mode if (this.contentskipanchor) { diff --git a/lib/yui/src/dock/js/dock.js b/lib/yui/src/dock/js/dock.js index fa193a30870..f73ddeae5c0 100644 --- a/lib/yui/src/dock/js/dock.js +++ b/lib/yui/src/dock/js/dock.js @@ -329,7 +329,7 @@ DOCK.prototype = { * @method initializer */ initializer : function() { - Y.log('Dock initialising', 'note', LOGNS); + Y.log('Dock initialising', 'debug', LOGNS); // Publish the events the dock has /** @@ -531,7 +531,7 @@ DOCK.prototype = { warned = true; } // Damn, the've set something. - Y.log('Note for customise_dock_for_theme code: M.core_dock.cfg.'+key+' is now dock.set(\''+key+'\', value)', 'info', LOGNS); + Y.log('Note for customise_dock_for_theme code: M.core_dock.cfg.'+key+' is now dock.set(\''+key+'\', value)', 'debug', LOGNS); this.set(cfgmap[key], value); } } @@ -547,7 +547,7 @@ DOCK.prototype = { warned = true; } // Damn, they've set something. - Y.log('Note for customise_dock_for_theme code: M.core_dock.css.'+key+' is now CSS.'+key+' = value', 'info', LOGNS); + Y.log('Note for customise_dock_for_theme code: M.core_dock.css.'+key+' is now CSS.'+key+' = value', 'debug', LOGNS); CSS[key] = value; } } @@ -829,7 +829,7 @@ DOCK.prototype = { add : function(item) { // Set the dockitem id to the total count and then increment it. item.set('id', this.totalcount); - Y.log('Adding block '+item._getLogDescription()+' to the dock.', 'info', LOGNS); + Y.log('Adding block '+item._getLogDescription()+' to the dock.', 'debug', LOGNS); this.count++; this.totalcount++; this.dockeditems[item.get('id')] = item; @@ -864,7 +864,7 @@ DOCK.prototype = { if (!this.dockeditems[id]) { return false; } - Y.log('Removing block '+this.dockeditems[id]._getLogDescription()+' from the dock.', 'info', LOGNS); + Y.log('Removing block '+this.dockeditems[id]._getLogDescription()+' from the dock.', 'debug', LOGNS); this.dockeditems[id].remove(); delete this.dockeditems[id]; this.count--; @@ -888,7 +888,7 @@ DOCK.prototype = { * @return {Boolean} */ removeAll : function() { - Y.log('Undocking all '+this.dockeditems.length+' blocks', 'note', LOGNS); + Y.log('Undocking all '+this.dockeditems.length+' blocks', 'debug', LOGNS); var i; for (i in this.dockeditems) { if (Y.Lang.isNumber(i) || Y.Lang.isString(i)) { diff --git a/lib/yui/src/dock/js/dockeditem.js b/lib/yui/src/dock/js/dockeditem.js index 62f49a40619..406f4e00333 100644 --- a/lib/yui/src/dock/js/dockeditem.js +++ b/lib/yui/src/dock/js/dockeditem.js @@ -77,7 +77,7 @@ DOCKEDITEM.prototype = { this.set('title', title); this.set('titlestring', titlestring); } - Y.log('Initialised dockeditem for block with title "'+this._getLogDescription(), 'note', LOGNS); + Y.log('Initialised dockeditem for block with title "'+this._getLogDescription(), 'debug', LOGNS); }, /** * This function draws the item on the dock. @@ -130,7 +130,7 @@ DOCKEDITEM.prototype = { dock.hideActive(); this.fire('dockeditem:showstart'); - Y.log('Showing '+this._getLogDescription(), 'info', LOGNS); + Y.log('Showing '+this._getLogDescription(), 'debug', LOGNS); panel.setHeader(this.get('titlestring'), this.get('commands')); panel.setBody(Y.Node.create('
').append(this.get('contents'))); panel.show(); @@ -151,7 +151,7 @@ DOCKEDITEM.prototype = { */ hide : function() { this.fire('dockeditem:hidestart'); - Y.log('Hiding "'+this._getLogDescription(), 'info', LOGNS); + Y.log('Hiding "'+this._getLogDescription(), 'debug', LOGNS); if (this.active) { // No longer active this.active = false; @@ -313,4 +313,4 @@ Y.extend(DOCKEDITEM, Y.Base, DOCKEDITEM.prototype, { } } }); -Y.augment(DOCKEDITEM, Y.EventTarget); \ No newline at end of file +Y.augment(DOCKEDITEM, Y.EventTarget); diff --git a/lib/yui/src/dock/js/loader.js b/lib/yui/src/dock/js/loader.js index c574f02c3f1..a3dbb82eb85 100644 --- a/lib/yui/src/dock/js/loader.js +++ b/lib/yui/src/dock/js/loader.js @@ -87,17 +87,17 @@ M.core.dock.loader.delegationEvents = []; * @method initLoader */ M.core.dock.loader.initLoader = function() { - Y.log('Dock loader initialising', 'note', LOADERNAME); + Y.log('Dock loader initialising', 'debug', LOADERNAME); var dockedblocks = Y.all('.block[data-instanceid][data-dockable]'), body = Y.one(document.body), callback; dockedblocks.each(function() { var id = parseInt(this.getData('instanceid'), 10); - Y.log('Dock loader watching block with instance id: '+id, 'note', LOADERNAME); + Y.log('Dock loader watching block with instance id: '+id, 'debug', LOADERNAME); M.core.dock.ensureMoveToIconExists(this); }); if (dockedblocks.some(function(node){return node.hasClass('dock_on_load');})) { - Y.log('Loading dock module', 'note', LOADERNAME); + Y.log('Loading dock module', 'debug', LOADERNAME); Y.use('moodle-core-dock', function() { M.core.dock.init(); }); @@ -113,7 +113,7 @@ M.core.dock.loader.initLoader = function() { } } block.addClass('dock_on_load'); - Y.log('Loading dock module', 'note', LOADERNAME); + Y.log('Loading dock module', 'debug', LOADERNAME); Y.use('moodle-core-dock', function(){ M.util.set_user_preference('docked_block_instance_'+instanceid, 1); M.core.dock.init(); @@ -122,4 +122,4 @@ M.core.dock.loader.initLoader = function() { M.core.dock.loader.delegationEvents.push(body.delegate('click', callback, '.moveto')); M.core.dock.loader.delegationEvents.push(body.delegate('key', callback, '.moveto', 'enter')); } -}; \ No newline at end of file +}; diff --git a/lib/yui/src/dock/js/panel.js b/lib/yui/src/dock/js/panel.js index 6d874275795..1ccc6776b8e 100644 --- a/lib/yui/src/dock/js/panel.js +++ b/lib/yui/src/dock/js/panel.js @@ -31,7 +31,7 @@ DOCKPANEL.prototype = { * @method initializer */ initializer : function() { - Y.log('Panel initialising', 'note', LOGNS); + Y.log('Panel initialising', 'debug', LOGNS); /** * Fired before the panel is shown. * @event dockpane::beforeshow diff --git a/lib/yui/src/dock/js/tabheightmanager.js b/lib/yui/src/dock/js/tabheightmanager.js index 3e18b317831..4fc58956c44 100644 --- a/lib/yui/src/dock/js/tabheightmanager.js +++ b/lib/yui/src/dock/js/tabheightmanager.js @@ -69,7 +69,7 @@ TABHEIGHTMANAGER.prototype = { runningcount = 0, usedheight = 0, id, itemtitle, itemheight, offsetheight; - Y.log('Enabling the dock tab sizer.', 'note', LOGNS); + Y.log('Enabling the dock tab sizer.', 'debug', LOGNS); this.set('enabled', true); for (id in items) { if (Y.Lang.isNumber(id) || Y.Lang.isString(id)) {