From 0061876d579ac6baed97fb424ca336f982ac8b84 Mon Sep 17 00:00:00 2001 From: Frederic Massart Date: Wed, 4 Feb 2015 10:19:38 +0800 Subject: [PATCH] MDL-48933 core_message: Clean up for a better coding style --- message/ajax.php | 2 +- .../moodle-core_message-messenger-debug.js | 47 +++++++++++++------ .../moodle-core_message-messenger-min.js | 2 +- .../moodle-core_message-messenger.js | 47 +++++++++++++------ message/yui/src/messenger/js/constants.js | 18 ++++++- message/yui/src/messenger/js/sendmessage.js | 29 +++++++----- 6 files changed, 98 insertions(+), 47 deletions(-) diff --git a/message/ajax.php b/message/ajax.php index f1befd0d186..a4dd12fbfb9 100644 --- a/message/ajax.php +++ b/message/ajax.php @@ -15,7 +15,7 @@ // along with Moodle. If not, see . /** - * Message ajax. + * Ajax point of entry for messaging API. * * @package core_message * @copyright 2015 Frédéric Massart - FMCorz.net diff --git a/message/yui/build/moodle-core_message-messenger/moodle-core_message-messenger-debug.js b/message/yui/build/moodle-core_message-messenger/moodle-core_message-messenger-debug.js index e5327d0cf57..20c85f10287 100644 --- a/message/yui/build/moodle-core_message-messenger/moodle-core_message-messenger-debug.js +++ b/message/yui/build/moodle-core_message-messenger/moodle-core_message-messenger-debug.js @@ -24,8 +24,22 @@ YUI.add('moodle-core_message-messenger', function (Y, NAME) { * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -var CSS = {}, - SELECTORS = {}; + +/** + * Cascading Style Sheet References. + * + * Using the name "CSS" would redefine the existing JS object CSS. + * + * @type {Object} + */ +var CSSR = {}; + +/** + * Object containing a reference to the selectors. + * + * @type {Object} + */ +var SELECTORS = {}; // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify @@ -173,7 +187,7 @@ Y.namespace('M.core_message.messenger').init = function(config) { * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -CSS.SENDMSGDIALOG = { +CSSR.SENDMSGDIALOG = { ACCESSHIDE: 'accesshide', ACTIONS: 'message-actions', FOOTER: 'message-footer', @@ -218,28 +232,31 @@ Y.namespace('M.core_message.messenger').sendMessage = Y.extend(SENDMSGDIALOG, M. * @method initializer */ initializer: function() { + var tpl, + content; + this._bb = this.get('boundingBox'); // Prepare the content area. tpl = Y.Handlebars.compile( '
' + - '
' + - '' + - '' + - '