From 1f777e5c6cd5dc3bf4fde9f8a0b91b488fdb6736 Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Mon, 10 Mar 2014 11:40:44 +0800 Subject: [PATCH] MDL-41987 Javascript: Tidy up YUI documentation --- .../moodle-tool_capability-search-debug.js | 11 +- .../moodle-tool_capability-search.js | 11 +- .../capability/yui/src/search/js/search.js | 11 +- .../backupselectall/js/backupselectall.json | 10 - ...oodle-block_navigation-navigation-debug.js | 19 +- .../moodle-block_navigation-navigation.js | 19 +- .../yui/src/navigation/js/navigation.js | 19 +- .../moodle-course-coursebase-debug.js | 12 +- .../moodle-course-coursebase.js | 12 +- .../moodle-course-management-debug.js | 56 ++--- .../moodle-course-management.js | 56 ++--- .../moodle-course-modchooser-debug.js | 62 +++++- .../moodle-course-modchooser.js | 62 +++++- .../moodle-course-toolboxes-debug.js | 4 +- .../moodle-course-toolboxes.js | 4 +- course/yui/src/coursebase/js/coursebase.js | 12 +- course/yui/src/management/js/category.js | 12 +- course/yui/src/management/js/console.js | 14 +- course/yui/src/management/js/course.js | 8 +- course/yui/src/management/js/dd.js | 4 +- course/yui/src/management/js/item.js | 15 +- course/yui/src/modchooser/js/modchooser.js | 62 +++++- course/yui/src/toolboxes/js/resource.js | 4 +- .../moodle-core-actionmenu-debug.js | 35 ++- .../moodle-core-actionmenu.js | 35 ++- .../moodle-core-blocks-debug.js | 35 +-- .../moodle-core-blocks/moodle-core-blocks.js | 35 +-- .../moodle-core-chooserdialogue-debug.js | 66 +++++- .../moodle-core-chooserdialogue.js | 66 +++++- .../moodle-core-dock-loader-debug.js | 17 +- .../moodle-core-dock-loader.js | 17 +- .../moodle-core-dock-debug.js | 31 +-- .../moodle-core-dock/moodle-core-dock.js | 31 +-- .../moodle-core-formautosubmit-debug.js | 18 +- .../moodle-core-formautosubmit.js | 18 +- .../moodle-core-formchangechecker-debug.js | 64 ++++-- .../moodle-core-formchangechecker.js | 64 ++++-- .../moodle-core-maintenancemodetimer-debug.js | 3 + .../moodle-core-maintenancemodetimer.js | 3 + ...moodle-core-notification-dialogue-debug.js | 38 ++-- .../moodle-core-notification-dialogue.js | 38 ++-- .../moodle-core-popuphelp-debug.js | 33 ++- .../moodle-core-popuphelp.js | 33 ++- lib/yui/src/actionmenu/js/actionmenu.js | 35 ++- lib/yui/src/blocks/js/blockregion.js | 2 +- lib/yui/src/blocks/js/blocks.js | 20 +- lib/yui/src/blocks/js/manager.js | 13 +- .../src/chooserdialogue/js/chooserdialogue.js | 66 +++++- lib/yui/src/dock/js/block.js | 2 +- lib/yui/src/dock/js/dock.js | 19 +- lib/yui/src/dock/js/dockeditem.js | 4 +- lib/yui/src/dock/js/loader.js | 17 +- lib/yui/src/dock/js/panel.js | 4 +- lib/yui/src/dock/js/tabheightmanager.js | 2 +- .../src/formautosubmit/js/formautosubmit.js | 18 +- .../formchangechecker/js/formchangechecker.js | 64 ++++-- .../js/maintenancemodetimer.js | 3 + lib/yui/src/notification/js/dialogue.js | 38 ++-- lib/yui/src/popuphelp/js/popuphelp.js | 33 ++- ...dle-assignfeedback_editpdf-editor-debug.js | 202 ++++++++++++------ .../moodle-assignfeedback_editpdf-editor.js | 202 ++++++++++++------ .../editpdf/yui/src/editor/js/annotation.js | 10 +- .../yui/src/editor/js/annotationhighlight.js | 8 +- .../yui/src/editor/js/annotationline.js | 9 +- .../yui/src/editor/js/annotationoval.js | 9 +- .../yui/src/editor/js/annotationpen.js | 9 +- .../yui/src/editor/js/annotationrectangle.js | 9 +- .../yui/src/editor/js/annotationstamp.js | 9 +- .../editpdf/yui/src/editor/js/colourpicker.js | 12 +- .../editpdf/yui/src/editor/js/comment.js | 4 +- .../editpdf/yui/src/editor/js/commentmenu.js | 10 +- .../yui/src/editor/js/commentsearch.js | 11 +- .../editpdf/yui/src/editor/js/drawable.js | 5 +- .../editpdf/yui/src/editor/js/dropdown.js | 11 +- .../editpdf/yui/src/editor/js/edit.js | 2 +- .../editpdf/yui/src/editor/js/editor.js | 51 +++-- .../editpdf/yui/src/editor/js/point.js | 8 +- .../editpdf/yui/src/editor/js/quickcomment.js | 4 +- .../yui/src/editor/js/quickcommentlist.js | 4 +- .../editpdf/yui/src/editor/js/rect.js | 4 +- .../editpdf/yui/src/editor/js/stamppicker.js | 13 +- .../moodle-mod_quiz-autosave-debug.js | 169 +++++++++++++-- .../moodle-mod_quiz-autosave.js | 169 +++++++++++++-- mod/quiz/yui/src/autosave/js/autosave.js | 169 +++++++++++++-- .../moodle-question-preview-debug.js | 9 +- .../moodle-question-preview.js | 9 +- question/yui/src/preview/js/preview.js | 9 +- 87 files changed, 1748 insertions(+), 911 deletions(-) delete mode 100644 backup/util/ui/yui/src/backupselectall/js/backupselectall.json diff --git a/admin/tool/capability/yui/build/moodle-tool_capability-search/moodle-tool_capability-search-debug.js b/admin/tool/capability/yui/build/moodle-tool_capability-search/moodle-tool_capability-search-debug.js index 7a225764d90..3beb4f77fe8 100644 --- a/admin/tool/capability/yui/build/moodle-tool_capability-search/moodle-tool_capability-search-debug.js +++ b/admin/tool/capability/yui/build/moodle-tool_capability-search/moodle-tool_capability-search-debug.js @@ -9,10 +9,10 @@ YUI.add('moodle-tool_capability-search', function (Y, NAME) { /** * Constructs a new capability search manager. * - * @namespace M.tool_capability.search + * @namespace M.tool_capability * @class Search * @constructor - * @extends Y.Base + * @extends Base */ var SEARCH = function() { SEARCH.superclass.constructor.apply(this, arguments); @@ -144,17 +144,12 @@ Y.extend(SEARCH, Y.Base, SEARCH.prototype, { } }); -/** - * Core namespace. - * @static - * @class tool_capability - */ M.tool_capability = M.tool_capability || {}; /** * Initialises capability search functionality. * @static - * @method init_capability_search + * @method M.tool_capability.init_capability_search * @param {Object} options */ M.tool_capability.init_capability_search = function(options) { diff --git a/admin/tool/capability/yui/build/moodle-tool_capability-search/moodle-tool_capability-search.js b/admin/tool/capability/yui/build/moodle-tool_capability-search/moodle-tool_capability-search.js index 7a225764d90..3beb4f77fe8 100644 --- a/admin/tool/capability/yui/build/moodle-tool_capability-search/moodle-tool_capability-search.js +++ b/admin/tool/capability/yui/build/moodle-tool_capability-search/moodle-tool_capability-search.js @@ -9,10 +9,10 @@ YUI.add('moodle-tool_capability-search', function (Y, NAME) { /** * Constructs a new capability search manager. * - * @namespace M.tool_capability.search + * @namespace M.tool_capability * @class Search * @constructor - * @extends Y.Base + * @extends Base */ var SEARCH = function() { SEARCH.superclass.constructor.apply(this, arguments); @@ -144,17 +144,12 @@ Y.extend(SEARCH, Y.Base, SEARCH.prototype, { } }); -/** - * Core namespace. - * @static - * @class tool_capability - */ M.tool_capability = M.tool_capability || {}; /** * Initialises capability search functionality. * @static - * @method init_capability_search + * @method M.tool_capability.init_capability_search * @param {Object} options */ M.tool_capability.init_capability_search = function(options) { diff --git a/admin/tool/capability/yui/src/search/js/search.js b/admin/tool/capability/yui/src/search/js/search.js index 53949416e90..6fbaf67e91b 100644 --- a/admin/tool/capability/yui/src/search/js/search.js +++ b/admin/tool/capability/yui/src/search/js/search.js @@ -7,10 +7,10 @@ /** * Constructs a new capability search manager. * - * @namespace M.tool_capability.search + * @namespace M.tool_capability * @class Search * @constructor - * @extends Y.Base + * @extends Base */ var SEARCH = function() { SEARCH.superclass.constructor.apply(this, arguments); @@ -142,17 +142,12 @@ Y.extend(SEARCH, Y.Base, SEARCH.prototype, { } }); -/** - * Core namespace. - * @static - * @class tool_capability - */ M.tool_capability = M.tool_capability || {}; /** * Initialises capability search functionality. * @static - * @method init_capability_search + * @method M.tool_capability.init_capability_search * @param {Object} options */ M.tool_capability.init_capability_search = function(options) { diff --git a/backup/util/ui/yui/src/backupselectall/js/backupselectall.json b/backup/util/ui/yui/src/backupselectall/js/backupselectall.json deleted file mode 100644 index 81f6ce7cfa8..00000000000 --- a/backup/util/ui/yui/src/backupselectall/js/backupselectall.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "moodle-backup-backupselectall": { - "requires": [ - "node", - "event", - "node-event-simulate", - "anim" - ] - } -} diff --git a/blocks/navigation/yui/build/moodle-block_navigation-navigation/moodle-block_navigation-navigation-debug.js b/blocks/navigation/yui/build/moodle-block_navigation-navigation/moodle-block_navigation-navigation-debug.js index cb86259b52f..2d5728726f9 100644 --- a/blocks/navigation/yui/build/moodle-block_navigation-navigation/moodle-block_navigation-navigation-debug.js +++ b/blocks/navigation/yui/build/moodle-block_navigation-navigation/moodle-block_navigation-navigation-debug.js @@ -11,8 +11,7 @@ YUI.add('moodle-block_navigation-navigation', function (Y, NAME) { /** * This namespace will contain all of the contents of the navigation blocks * global navigation and settings. - * @namespace M - * @class block_navigation + * @class M.block_navigation * @static */ M.block_navigation = M.block_navigation || {}; @@ -22,6 +21,7 @@ M.block_navigation = M.block_navigation || {}; * @property expandablebranchcount * @protected * @static + * @type Number */ M.block_navigation.expandablebranchcount = 1; /** @@ -30,6 +30,7 @@ M.block_navigation.expandablebranchcount = 1; * @property courselimit * @protected * @static + * @type Number */ M.block_navigation.courselimit = 20; /** @@ -199,7 +200,7 @@ var NODETYPE = { * @namespace M.block_navigation * @class Tree * @constructor - * @extends Y.Base + * @extends Base */ var TREE = function() { TREE.superclass.constructor.apply(this, arguments); @@ -208,7 +209,7 @@ TREE.prototype = { /** * The tree's ID, normally its block instance id. * @property id - * @type Int + * @type Number * @protected */ id : null, @@ -390,7 +391,7 @@ Y.extend(TREE, Y.Base, TREE.prototype, { /** * The nodes that get shown. * @attribute expansionlimit - * @type Integer + * @type Number */ expansionlimit : { value : 0, @@ -407,6 +408,10 @@ Y.extend(TREE, Y.Base, TREE.prototype, { }, /** * The navigation tree block instance. + * + * @attribute instance + * @default false + * @type Number */ instance : { value : false, @@ -426,7 +431,7 @@ Y.extend(TREE, Y.Base, TREE.prototype, { * @namespace M.block_navigation * @class Branch * @constructor - * @extends Y.Base + * @extends Base */ BRANCH = function() { BRANCH.superclass.constructor.apply(this, arguments); @@ -814,7 +819,7 @@ Y.extend(BRANCH, Y.Base, BRANCH.prototype, { /** * The type of this branch. * @attribute type - * @type Int + * @type Number */ type : { value : null, diff --git a/blocks/navigation/yui/build/moodle-block_navigation-navigation/moodle-block_navigation-navigation.js b/blocks/navigation/yui/build/moodle-block_navigation-navigation/moodle-block_navigation-navigation.js index 7e484e0f96c..0d6f0e35b5f 100644 --- a/blocks/navigation/yui/build/moodle-block_navigation-navigation/moodle-block_navigation-navigation.js +++ b/blocks/navigation/yui/build/moodle-block_navigation-navigation/moodle-block_navigation-navigation.js @@ -11,8 +11,7 @@ YUI.add('moodle-block_navigation-navigation', function (Y, NAME) { /** * This namespace will contain all of the contents of the navigation blocks * global navigation and settings. - * @namespace M - * @class block_navigation + * @class M.block_navigation * @static */ M.block_navigation = M.block_navigation || {}; @@ -22,6 +21,7 @@ M.block_navigation = M.block_navigation || {}; * @property expandablebranchcount * @protected * @static + * @type Number */ M.block_navigation.expandablebranchcount = 1; /** @@ -30,6 +30,7 @@ M.block_navigation.expandablebranchcount = 1; * @property courselimit * @protected * @static + * @type Number */ M.block_navigation.courselimit = 20; /** @@ -199,7 +200,7 @@ var NODETYPE = { * @namespace M.block_navigation * @class Tree * @constructor - * @extends Y.Base + * @extends Base */ var TREE = function() { TREE.superclass.constructor.apply(this, arguments); @@ -208,7 +209,7 @@ TREE.prototype = { /** * The tree's ID, normally its block instance id. * @property id - * @type Int + * @type Number * @protected */ id : null, @@ -389,7 +390,7 @@ Y.extend(TREE, Y.Base, TREE.prototype, { /** * The nodes that get shown. * @attribute expansionlimit - * @type Integer + * @type Number */ expansionlimit : { value : 0, @@ -406,6 +407,10 @@ Y.extend(TREE, Y.Base, TREE.prototype, { }, /** * The navigation tree block instance. + * + * @attribute instance + * @default false + * @type Number */ instance : { value : false, @@ -425,7 +430,7 @@ Y.extend(TREE, Y.Base, TREE.prototype, { * @namespace M.block_navigation * @class Branch * @constructor - * @extends Y.Base + * @extends Base */ BRANCH = function() { BRANCH.superclass.constructor.apply(this, arguments); @@ -809,7 +814,7 @@ Y.extend(BRANCH, Y.Base, BRANCH.prototype, { /** * The type of this branch. * @attribute type - * @type Int + * @type Number */ type : { value : null, diff --git a/blocks/navigation/yui/src/navigation/js/navigation.js b/blocks/navigation/yui/src/navigation/js/navigation.js index 1ff285dd210..b13e2f72298 100644 --- a/blocks/navigation/yui/src/navigation/js/navigation.js +++ b/blocks/navigation/yui/src/navigation/js/navigation.js @@ -9,8 +9,7 @@ /** * This namespace will contain all of the contents of the navigation blocks * global navigation and settings. - * @namespace M - * @class block_navigation + * @class M.block_navigation * @static */ M.block_navigation = M.block_navigation || {}; @@ -20,6 +19,7 @@ M.block_navigation = M.block_navigation || {}; * @property expandablebranchcount * @protected * @static + * @type Number */ M.block_navigation.expandablebranchcount = 1; /** @@ -28,6 +28,7 @@ M.block_navigation.expandablebranchcount = 1; * @property courselimit * @protected * @static + * @type Number */ M.block_navigation.courselimit = 20; /** @@ -197,7 +198,7 @@ var NODETYPE = { * @namespace M.block_navigation * @class Tree * @constructor - * @extends Y.Base + * @extends Base */ var TREE = function() { TREE.superclass.constructor.apply(this, arguments); @@ -206,7 +207,7 @@ TREE.prototype = { /** * The tree's ID, normally its block instance id. * @property id - * @type Int + * @type Number * @protected */ id : null, @@ -388,7 +389,7 @@ Y.extend(TREE, Y.Base, TREE.prototype, { /** * The nodes that get shown. * @attribute expansionlimit - * @type Integer + * @type Number */ expansionlimit : { value : 0, @@ -405,6 +406,10 @@ Y.extend(TREE, Y.Base, TREE.prototype, { }, /** * The navigation tree block instance. + * + * @attribute instance + * @default false + * @type Number */ instance : { value : false, @@ -424,7 +429,7 @@ Y.extend(TREE, Y.Base, TREE.prototype, { * @namespace M.block_navigation * @class Branch * @constructor - * @extends Y.Base + * @extends Base */ BRANCH = function() { BRANCH.superclass.constructor.apply(this, arguments); @@ -812,7 +817,7 @@ Y.extend(BRANCH, Y.Base, BRANCH.prototype, { /** * The type of this branch. * @attribute type - * @type Int + * @type Number */ type : { value : null, diff --git a/course/yui/build/moodle-course-coursebase/moodle-course-coursebase-debug.js b/course/yui/build/moodle-course-coursebase/moodle-course-coursebase-debug.js index bd6b074daa6..b3e54ff7e98 100644 --- a/course/yui/build/moodle-course-coursebase/moodle-course-coursebase-debug.js +++ b/course/yui/build/moodle-course-coursebase/moodle-course-coursebase-debug.js @@ -69,6 +69,7 @@ M.course.format = M.course.format || {}; /** * Swap section (should be defined in format.js if requred) * + * @method M.course.format.swap_sections * @param {YUI} Y YUI3 instance * @param {string} node1 node to swap to * @param {string} node2 node to swap with @@ -83,12 +84,12 @@ M.course.format.swap_sections = M.course.format.swap_sections || function() { * If some response is expected, we pass it over to format, as it knows better * hot to process it. * + * @method M.course.format.process_sections * @param {YUI} Y YUI3 instance * @param {NodeList} list of sections * @param {array} response ajax response * @param {string} sectionfrom first affected section * @param {string} sectionto last affected section - * @return void */ M.course.format.process_sections = M.course.format.process_sections || function() { return null; @@ -98,6 +99,7 @@ M.course.format.process_sections = M.course.format.process_sections || function( * Get sections config for this format, for examples see function definition * in the formats. * +* @method M.course.format.get_config * @return {object} section list configuration */ M.course.format.get_config = M.course.format.get_config || function() { @@ -114,6 +116,7 @@ M.course.format.get_config = M.course.format.get_config || function() { /** * Get section list for this format (usually items inside container_node.container_class selector) * + * @method M.course.format.get_section_selector * @param {YUI} Y YUI3 instance * @return {string} section selector */ @@ -130,6 +133,7 @@ M.course.format.get_section_selector = M.course.format.get_section_selector || f * Get section wraper for this format (only used in case when each * container_node.container_class node is wrapped in some other element). * + * @method M.course.format.get_section_wrapper * @param {YUI} Y YUI3 instance * @return {string} section wrapper selector or M.course.format.get_section_selector * if section_wrapper_node and section_wrapper_class are not defined in the format config. @@ -145,6 +149,7 @@ M.course.format.get_section_wrapper = M.course.format.get_section_wrapper || fun /** * Get the tag of container node * + * @method M.course.format.get_containernode * @return {string} tag of container node. */ M.course.format.get_containernode = M.course.format.get_containernode || function() { @@ -159,6 +164,7 @@ M.course.format.get_containernode = M.course.format.get_containernode || functio /** * Get the class of container node * + * @method M.course.format.get_containerclass * @return {string} class of the container node. */ M.course.format.get_containerclass = M.course.format.get_containerclass || function() { @@ -173,6 +179,7 @@ M.course.format.get_containerclass = M.course.format.get_containerclass || funct /** * Get the tag of draggable node (section wrapper if exists, otherwise section) * + * @method M.course.format.get_sectionwrappernode * @return {string} tag of the draggable node. */ M.course.format.get_sectionwrappernode = M.course.format.get_sectionwrappernode || function() { @@ -187,6 +194,7 @@ M.course.format.get_sectionwrappernode = M.course.format.get_sectionwrappernode /** * Get the class of draggable node (section wrapper if exists, otherwise section) * + * @method M.course.format.get_sectionwrapperclass * @return {string} class of the draggable node. */ M.course.format.get_sectionwrapperclass = M.course.format.get_sectionwrapperclass || function() { @@ -201,6 +209,7 @@ M.course.format.get_sectionwrapperclass = M.course.format.get_sectionwrapperclas /** * Get the tag of section node * + * @method M.course.format.get_sectionnode * @return {string} tag of section node. */ M.course.format.get_sectionnode = M.course.format.get_sectionnode || function() { @@ -215,6 +224,7 @@ M.course.format.get_sectionnode = M.course.format.get_sectionnode || function() /** * Get the class of section node * + * @method M.course.format.get_sectionclass * @return {string} class of the section node. */ M.course.format.get_sectionclass = M.course.format.get_sectionclass || function() { diff --git a/course/yui/build/moodle-course-coursebase/moodle-course-coursebase.js b/course/yui/build/moodle-course-coursebase/moodle-course-coursebase.js index e9bea2d402c..bcd0efab7a3 100644 --- a/course/yui/build/moodle-course-coursebase/moodle-course-coursebase.js +++ b/course/yui/build/moodle-course-coursebase/moodle-course-coursebase.js @@ -69,6 +69,7 @@ M.course.format = M.course.format || {}; /** * Swap section (should be defined in format.js if requred) * + * @method M.course.format.swap_sections * @param {YUI} Y YUI3 instance * @param {string} node1 node to swap to * @param {string} node2 node to swap with @@ -83,12 +84,12 @@ M.course.format.swap_sections = M.course.format.swap_sections || function() { * If some response is expected, we pass it over to format, as it knows better * hot to process it. * + * @method M.course.format.process_sections * @param {YUI} Y YUI3 instance * @param {NodeList} list of sections * @param {array} response ajax response * @param {string} sectionfrom first affected section * @param {string} sectionto last affected section - * @return void */ M.course.format.process_sections = M.course.format.process_sections || function() { return null; @@ -98,6 +99,7 @@ M.course.format.process_sections = M.course.format.process_sections || function( * Get sections config for this format, for examples see function definition * in the formats. * +* @method M.course.format.get_config * @return {object} section list configuration */ M.course.format.get_config = M.course.format.get_config || function() { @@ -114,6 +116,7 @@ M.course.format.get_config = M.course.format.get_config || function() { /** * Get section list for this format (usually items inside container_node.container_class selector) * + * @method M.course.format.get_section_selector * @param {YUI} Y YUI3 instance * @return {string} section selector */ @@ -129,6 +132,7 @@ M.course.format.get_section_selector = M.course.format.get_section_selector || f * Get section wraper for this format (only used in case when each * container_node.container_class node is wrapped in some other element). * + * @method M.course.format.get_section_wrapper * @param {YUI} Y YUI3 instance * @return {string} section wrapper selector or M.course.format.get_section_selector * if section_wrapper_node and section_wrapper_class are not defined in the format config. @@ -144,6 +148,7 @@ M.course.format.get_section_wrapper = M.course.format.get_section_wrapper || fun /** * Get the tag of container node * + * @method M.course.format.get_containernode * @return {string} tag of container node. */ M.course.format.get_containernode = M.course.format.get_containernode || function() { @@ -157,6 +162,7 @@ M.course.format.get_containernode = M.course.format.get_containernode || functio /** * Get the class of container node * + * @method M.course.format.get_containerclass * @return {string} class of the container node. */ M.course.format.get_containerclass = M.course.format.get_containerclass || function() { @@ -170,6 +176,7 @@ M.course.format.get_containerclass = M.course.format.get_containerclass || funct /** * Get the tag of draggable node (section wrapper if exists, otherwise section) * + * @method M.course.format.get_sectionwrappernode * @return {string} tag of the draggable node. */ M.course.format.get_sectionwrappernode = M.course.format.get_sectionwrappernode || function() { @@ -184,6 +191,7 @@ M.course.format.get_sectionwrappernode = M.course.format.get_sectionwrappernode /** * Get the class of draggable node (section wrapper if exists, otherwise section) * + * @method M.course.format.get_sectionwrapperclass * @return {string} class of the draggable node. */ M.course.format.get_sectionwrapperclass = M.course.format.get_sectionwrapperclass || function() { @@ -198,6 +206,7 @@ M.course.format.get_sectionwrapperclass = M.course.format.get_sectionwrapperclas /** * Get the tag of section node * + * @method M.course.format.get_sectionnode * @return {string} tag of section node. */ M.course.format.get_sectionnode = M.course.format.get_sectionnode || function() { @@ -211,6 +220,7 @@ M.course.format.get_sectionnode = M.course.format.get_sectionnode || function() /** * Get the class of section node * + * @method M.course.format.get_sectionclass * @return {string} class of the section node. */ M.course.format.get_sectionclass = M.course.format.get_sectionclass || function() { diff --git a/course/yui/build/moodle-course-management/moodle-course-management-debug.js b/course/yui/build/moodle-course-management/moodle-course-management-debug.js index d1ce9ef7973..04c1e9d9212 100644 --- a/course/yui/build/moodle-course-management/moodle-course-management-debug.js +++ b/course/yui/build/moodle-course-management/moodle-course-management-debug.js @@ -14,7 +14,7 @@ YUI.add('moodle-course-management', function (Y, NAME) { * @namespace M.course.management * @class Console * @constructor - * @extends Y.Base + * @extends Base */ function Console() { Console.superclass.constructor.apply(this, arguments); @@ -245,7 +245,7 @@ Console.prototype = { * Initialises all the categories being shown. * @method initialiseCategories * @private - * @returns {boolean} + * @return {boolean} */ initialiseCategories : function(listing) { var count = 0; @@ -289,7 +289,7 @@ Console.prototype = { * Initialises all the categories being shown. * @method initialiseCourses * @private - * @returns {boolean} + * @return {boolean} */ initialiseCourses : function() { var category = this.getCategoryById(this.get('activecategoryid')), @@ -483,7 +483,7 @@ Console.prototype = { * Returns the category with the given ID. * @method getCategoryById * @param {Number} id - * @returns {Category|Boolean} The category or false if it can't be found. + * @return {Category|Boolean} The category or false if it can't be found. */ getCategoryById : function(id) { var i, @@ -505,7 +505,7 @@ Console.prototype = { * Returns the course with the given id. * @method getCourseById * @param {Number} id - * @returns {Course|Boolean} The course or false if not found/ + * @return {Course|Boolean} The course or false if not found/ */ getCourseById : function(id) { var i, @@ -580,18 +580,21 @@ M.course.management.console = null; /** * Initalises the course management console. + * + * @method M.course.management.init * @static * @param {Object} config */ M.course.management.init = function(config) { M.course.management.console = new Console(config); -};/** +}; +/** * Drag and Drop handler * * @namespace M.course.management * @class DragDrop * @constructor - * @extends Y.Base + * @extends Base */ function DragDrop(config) { Console.superclass.constructor.apply(this, [config]); @@ -853,14 +856,14 @@ DragDrop.prototype = { } } }; -Y.extend(DragDrop, Y.Base, DragDrop.prototype);/** +Y.extend(DragDrop, Y.Base, DragDrop.prototype); +/** * A managed course. * * @namespace M.course.management * @class Item * @constructor - * @extends Y.Base - * @abstract + * @extends Base */ function Item() { Item.superclass.constructor.apply(this, arguments); @@ -910,7 +913,7 @@ Item.prototype = { * @param {Number} transactionid The transaction ID of the AJAX request (unique) * @param {Object} response The response from the AJAX request. * @param {Object} args The arguments given to the request. - * @returns {Object|Boolean} + * @return {Object|Boolean} */ checkAjaxResponse : function(transactionid, response, args) { if (response.status !== 200) { @@ -938,7 +941,7 @@ Item.prototype = { * @param {Number} transactionid The transaction ID of the AJAX request (unique) * @param {Object} response The response from the AJAX request. * @param {Object} args The arguments given to the request. - * @returns {Boolean} + * @return {Boolean} */ moveup : function(transactionid, response, args) { var node, @@ -1006,7 +1009,7 @@ Item.prototype = { * @param {Number} transactionid The transaction ID of the AJAX request (unique) * @param {Object} response The response from the AJAX request. * @param {Object} args The arguments given to the request. - * @returns {Boolean} + * @return {Boolean} */ movedown : function(transactionid, response, args) { var node, @@ -1074,7 +1077,7 @@ Item.prototype = { * @param {Number} transactionid The transaction ID of the AJAX request (unique) * @param {Object} response The response from the AJAX request. * @param {Object} args The arguments given to the request. - * @returns {Boolean} + * @return {Boolean} */ show : function(transactionid, response, args) { var outcome = this.checkAjaxResponse(transactionid, response, args), @@ -1110,7 +1113,7 @@ Item.prototype = { * @param {Number} transactionid The transaction ID of the AJAX request (unique) * @param {Object} response The response from the AJAX request. * @param {Object} args The arguments given to the request. - * @returns {Boolean} + * @return {Boolean} */ hide : function(transactionid, response, args) { var outcome = this.checkAjaxResponse(transactionid, response, args), @@ -1167,7 +1170,8 @@ Item.prototype = { }, 2500); } }; -Y.extend(Item, Y.Base, Item.prototype);/** +Y.extend(Item, Y.Base, Item.prototype); +/** * A managed category. * * @namespace M.course.management @@ -1245,7 +1249,7 @@ Category.prototype = { /** * Returns the name of the category. * @method getName - * @returns {String} + * @return {String} */ getName : function() { return this.get('node').one('a.categoryname').get('innerHTML'); @@ -1268,7 +1272,7 @@ Category.prototype = { * @method handle * @param {String} action * @param {EventFacade} e - * @returns {Boolean} + * @return {Boolean} */ handle : function(action, e) { var catarg = {categoryid : this.get('categoryid')}, @@ -1438,7 +1442,7 @@ Category.prototype = { * @param {Number} transactionid The transaction ID of the AJAX request (unique) * @param {Object} response The response from the AJAX request. * @param {Object} args The arguments given to the request. - * @returns {Boolean} + * @return {Boolean} */ completeMoveCourse : function(transactionid, response, args) { var outcome = this.checkAjaxResponse(transactionid, response, args), @@ -1492,7 +1496,7 @@ Category.prototype = { * @param {Number} transactionid The transaction ID of the AJAX request (unique) * @param {Object} response The response from the AJAX request. * @param {Object} args The arguments given to the request. - * @returns {Boolean} + * @return {Boolean} */ show : function(transactionid, response, args) { var outcome = this.checkAjaxResponse(transactionid, response, args), @@ -1524,7 +1528,7 @@ Category.prototype = { * @param {Number} transactionid The transaction ID of the AJAX request (unique) * @param {Object} response The response from the AJAX request. * @param {Object} args The arguments given to the request. - * @returns {Boolean} + * @return {Boolean} */ hide : function(transactionid, response, args) { var outcome = this.checkAjaxResponse(transactionid, response, args), @@ -1608,7 +1612,8 @@ Category.prototype = { return this; } }; -Y.extend(Category, Item, Category.prototype);/** +Y.extend(Category, Item, Category.prototype); +/** * A managed course. * * @namespace M.course.management @@ -1687,7 +1692,7 @@ Course.prototype = { /** * Returns the name of the course. * @method getName - * @returns {String} + * @return {String} */ getName : function() { return this.get('node').one('a.coursename').get('innerHTML'); @@ -1698,7 +1703,7 @@ Course.prototype = { * @method handle * @param {String} action * @param {EventFacade} e - * @returns {Boolean} + * @return {Boolean} */ handle : function(action, e) { var managementconsole = this.get('console'), @@ -1771,7 +1776,7 @@ Course.prototype = { * @param {Number} transactionid The transaction ID for the request. * @param {Object} response The response to the request. * @param {Objects} args The arguments that were given with the request. - * @returns {Boolean} + * @return {Boolean} */ moveAfterResponse : function(transactionid, response, args) { var outcome = this.checkAjaxResponse(transactionid, response, args), @@ -1795,6 +1800,7 @@ Course.prototype = { }; Y.extend(Course, Item, Course.prototype); + }, '@VERSION@', { "requires": [ "base", diff --git a/course/yui/build/moodle-course-management/moodle-course-management.js b/course/yui/build/moodle-course-management/moodle-course-management.js index 9b29145c33b..9a002f9290f 100644 --- a/course/yui/build/moodle-course-management/moodle-course-management.js +++ b/course/yui/build/moodle-course-management/moodle-course-management.js @@ -14,7 +14,7 @@ YUI.add('moodle-course-management', function (Y, NAME) { * @namespace M.course.management * @class Console * @constructor - * @extends Y.Base + * @extends Base */ function Console() { Console.superclass.constructor.apply(this, arguments); @@ -244,7 +244,7 @@ Console.prototype = { * Initialises all the categories being shown. * @method initialiseCategories * @private - * @returns {boolean} + * @return {boolean} */ initialiseCategories : function(listing) { var count = 0; @@ -286,7 +286,7 @@ Console.prototype = { * Initialises all the categories being shown. * @method initialiseCourses * @private - * @returns {boolean} + * @return {boolean} */ initialiseCourses : function() { var category = this.getCategoryById(this.get('activecategoryid')), @@ -477,7 +477,7 @@ Console.prototype = { * Returns the category with the given ID. * @method getCategoryById * @param {Number} id - * @returns {Category|Boolean} The category or false if it can't be found. + * @return {Category|Boolean} The category or false if it can't be found. */ getCategoryById : function(id) { var i, @@ -499,7 +499,7 @@ Console.prototype = { * Returns the course with the given id. * @method getCourseById * @param {Number} id - * @returns {Course|Boolean} The course or false if not found/ + * @return {Course|Boolean} The course or false if not found/ */ getCourseById : function(id) { var i, @@ -573,18 +573,21 @@ M.course.management.console = null; /** * Initalises the course management console. + * + * @method M.course.management.init * @static * @param {Object} config */ M.course.management.init = function(config) { M.course.management.console = new Console(config); -};/** +}; +/** * Drag and Drop handler * * @namespace M.course.management * @class DragDrop * @constructor - * @extends Y.Base + * @extends Base */ function DragDrop(config) { Console.superclass.constructor.apply(this, [config]); @@ -843,14 +846,14 @@ DragDrop.prototype = { } } }; -Y.extend(DragDrop, Y.Base, DragDrop.prototype);/** +Y.extend(DragDrop, Y.Base, DragDrop.prototype); +/** * A managed course. * * @namespace M.course.management * @class Item * @constructor - * @extends Y.Base - * @abstract + * @extends Base */ function Item() { Item.superclass.constructor.apply(this, arguments); @@ -900,7 +903,7 @@ Item.prototype = { * @param {Number} transactionid The transaction ID of the AJAX request (unique) * @param {Object} response The response from the AJAX request. * @param {Object} args The arguments given to the request. - * @returns {Object|Boolean} + * @return {Object|Boolean} */ checkAjaxResponse : function(transactionid, response, args) { if (response.status !== 200) { @@ -926,7 +929,7 @@ Item.prototype = { * @param {Number} transactionid The transaction ID of the AJAX request (unique) * @param {Object} response The response from the AJAX request. * @param {Object} args The arguments given to the request. - * @returns {Boolean} + * @return {Boolean} */ moveup : function(transactionid, response, args) { var node, @@ -991,7 +994,7 @@ Item.prototype = { * @param {Number} transactionid The transaction ID of the AJAX request (unique) * @param {Object} response The response from the AJAX request. * @param {Object} args The arguments given to the request. - * @returns {Boolean} + * @return {Boolean} */ movedown : function(transactionid, response, args) { var node, @@ -1056,7 +1059,7 @@ Item.prototype = { * @param {Number} transactionid The transaction ID of the AJAX request (unique) * @param {Object} response The response from the AJAX request. * @param {Object} args The arguments given to the request. - * @returns {Boolean} + * @return {Boolean} */ show : function(transactionid, response, args) { var outcome = this.checkAjaxResponse(transactionid, response, args), @@ -1089,7 +1092,7 @@ Item.prototype = { * @param {Number} transactionid The transaction ID of the AJAX request (unique) * @param {Object} response The response from the AJAX request. * @param {Object} args The arguments given to the request. - * @returns {Boolean} + * @return {Boolean} */ hide : function(transactionid, response, args) { var outcome = this.checkAjaxResponse(transactionid, response, args), @@ -1143,7 +1146,8 @@ Item.prototype = { }, 2500); } }; -Y.extend(Item, Y.Base, Item.prototype);/** +Y.extend(Item, Y.Base, Item.prototype); +/** * A managed category. * * @namespace M.course.management @@ -1221,7 +1225,7 @@ Category.prototype = { /** * Returns the name of the category. * @method getName - * @returns {String} + * @return {String} */ getName : function() { return this.get('node').one('a.categoryname').get('innerHTML'); @@ -1244,7 +1248,7 @@ Category.prototype = { * @method handle * @param {String} action * @param {EventFacade} e - * @returns {Boolean} + * @return {Boolean} */ handle : function(action, e) { var catarg = {categoryid : this.get('categoryid')}, @@ -1411,7 +1415,7 @@ Category.prototype = { * @param {Number} transactionid The transaction ID of the AJAX request (unique) * @param {Object} response The response from the AJAX request. * @param {Object} args The arguments given to the request. - * @returns {Boolean} + * @return {Boolean} */ completeMoveCourse : function(transactionid, response, args) { var outcome = this.checkAjaxResponse(transactionid, response, args), @@ -1462,7 +1466,7 @@ Category.prototype = { * @param {Number} transactionid The transaction ID of the AJAX request (unique) * @param {Object} response The response from the AJAX request. * @param {Object} args The arguments given to the request. - * @returns {Boolean} + * @return {Boolean} */ show : function(transactionid, response, args) { var outcome = this.checkAjaxResponse(transactionid, response, args), @@ -1492,7 +1496,7 @@ Category.prototype = { * @param {Number} transactionid The transaction ID of the AJAX request (unique) * @param {Object} response The response from the AJAX request. * @param {Object} args The arguments given to the request. - * @returns {Boolean} + * @return {Boolean} */ hide : function(transactionid, response, args) { var outcome = this.checkAjaxResponse(transactionid, response, args), @@ -1570,7 +1574,8 @@ Category.prototype = { return this; } }; -Y.extend(Category, Item, Category.prototype);/** +Y.extend(Category, Item, Category.prototype); +/** * A managed course. * * @namespace M.course.management @@ -1649,7 +1654,7 @@ Course.prototype = { /** * Returns the name of the course. * @method getName - * @returns {String} + * @return {String} */ getName : function() { return this.get('node').one('a.coursename').get('innerHTML'); @@ -1660,7 +1665,7 @@ Course.prototype = { * @method handle * @param {String} action * @param {EventFacade} e - * @returns {Boolean} + * @return {Boolean} */ handle : function(action, e) { var managementconsole = this.get('console'), @@ -1732,7 +1737,7 @@ Course.prototype = { * @param {Number} transactionid The transaction ID for the request. * @param {Object} response The response to the request. * @param {Objects} args The arguments that were given with the request. - * @returns {Boolean} + * @return {Boolean} */ moveAfterResponse : function(transactionid, response, args) { var outcome = this.checkAjaxResponse(transactionid, response, args), @@ -1754,6 +1759,7 @@ Course.prototype = { }; Y.extend(Course, Item, Course.prototype); + }, '@VERSION@', { "requires": [ "base", diff --git a/course/yui/build/moodle-course-modchooser/moodle-course-modchooser-debug.js b/course/yui/build/moodle-course-modchooser/moodle-course-modchooser-debug.js index 183420cca15..54312b42917 100644 --- a/course/yui/build/moodle-course-modchooser/moodle-course-modchooser-debug.js +++ b/course/yui/build/moodle-course-modchooser/moodle-course-modchooser-debug.js @@ -3,7 +3,7 @@ YUI.add('moodle-course-modchooser', function (Y, NAME) { /** * The activity chooser dialogue for courses. * - * @moodle-course-modchooser + * @module moodle-course-modchooser */ var CSS = { @@ -28,9 +28,21 @@ var MODCHOOSER = function() { }; Y.extend(MODCHOOSER, M.core.chooserdialogue, { - // The current section ID + /** + * The current section ID. + * + * @property sectionid + * @private + * @type Number + * @default null + */ sectionid : null, + /** + * Set up the activity chooser. + * + * @method initializer + */ initializer : function() { var dialogue = Y.one('.chooserdialoguebody'); var header = Y.one('.choosertitle'); @@ -44,12 +56,13 @@ Y.extend(MODCHOOSER, M.core.chooserdialogue, { // Catch the page toggle Y.all('.block_settings #settingsnav .type_course .modchoosertoggle a').on('click', this.toggle_mod_chooser, this); }, + /** * Update any section areas within the scope of the specified * selector with AJAX equivalents * + * @method setup_for_section * @param baseselector The selector to limit scope to - * @return void */ setup_for_section : function(baseselector) { if (!baseselector) { @@ -71,6 +84,15 @@ Y.extend(MODCHOOSER, M.core.chooserdialogue, { this._setup_for_section(section); }, this); }, + + /** + * Update any section areas within the scope of the specified + * selector with AJAX equivalents + * + * @method _setup_for_section + * @private + * @param baseselector The selector to limit scope to + */ _setup_for_section : function(section) { var chooserspan = section.one(CSS.SECTIONMODCHOOSER); if (!chooserspan) { @@ -84,12 +106,11 @@ Y.extend(MODCHOOSER, M.core.chooserdialogue, { chooserlink.on('click', this.display_mod_chooser, this); }, /** - * Display the module chooser - * - * @param e Event Triggering Event - * @param secitonid integer The ID of the section triggering the dialogue - * @return void - */ + * Display the module chooser + * + * @method display_mod_chooser + * @param {EventFacade} e Triggering Event + */ display_mod_chooser : function (e) { // Set the section for this version of the dialogue if (e.target.ancestor(CSS.SITETOPIC)) { @@ -104,6 +125,13 @@ Y.extend(MODCHOOSER, M.core.chooserdialogue, { } this.display_chooser(e); }, + + /** + * Toggle availability of the activity chooser. + * + * @method toggle_mod_chooser + * @param {EventFacade} e + */ toggle_mod_chooser : function(e) { // Get the add section link var modchooserlinks = Y.all('div.addresourcemodchooser'); @@ -153,6 +181,15 @@ Y.extend(MODCHOOSER, M.core.chooserdialogue, { // Prevent the page from reloading e.preventDefault(); }, + + /** + * Helper function to set the value of a hidden radio button when a + * selection is made. + * + * @method option_selected + * @param {String} thisoption The selected option value + * @private + */ option_selected : function(thisoption) { // Add the sectionid to the URL. this.hiddenRadioValue.setAttrs({ @@ -164,6 +201,13 @@ Y.extend(MODCHOOSER, M.core.chooserdialogue, { { NAME : MODCHOOSERNAME, ATTRS : { + /** + * The maximum height (in pixels) of the activity chooser. + * + * @attribute maxheight + * @type Number + * @default 800 + */ maxheight : { value : 800 } diff --git a/course/yui/build/moodle-course-modchooser/moodle-course-modchooser.js b/course/yui/build/moodle-course-modchooser/moodle-course-modchooser.js index 183420cca15..54312b42917 100644 --- a/course/yui/build/moodle-course-modchooser/moodle-course-modchooser.js +++ b/course/yui/build/moodle-course-modchooser/moodle-course-modchooser.js @@ -3,7 +3,7 @@ YUI.add('moodle-course-modchooser', function (Y, NAME) { /** * The activity chooser dialogue for courses. * - * @moodle-course-modchooser + * @module moodle-course-modchooser */ var CSS = { @@ -28,9 +28,21 @@ var MODCHOOSER = function() { }; Y.extend(MODCHOOSER, M.core.chooserdialogue, { - // The current section ID + /** + * The current section ID. + * + * @property sectionid + * @private + * @type Number + * @default null + */ sectionid : null, + /** + * Set up the activity chooser. + * + * @method initializer + */ initializer : function() { var dialogue = Y.one('.chooserdialoguebody'); var header = Y.one('.choosertitle'); @@ -44,12 +56,13 @@ Y.extend(MODCHOOSER, M.core.chooserdialogue, { // Catch the page toggle Y.all('.block_settings #settingsnav .type_course .modchoosertoggle a').on('click', this.toggle_mod_chooser, this); }, + /** * Update any section areas within the scope of the specified * selector with AJAX equivalents * + * @method setup_for_section * @param baseselector The selector to limit scope to - * @return void */ setup_for_section : function(baseselector) { if (!baseselector) { @@ -71,6 +84,15 @@ Y.extend(MODCHOOSER, M.core.chooserdialogue, { this._setup_for_section(section); }, this); }, + + /** + * Update any section areas within the scope of the specified + * selector with AJAX equivalents + * + * @method _setup_for_section + * @private + * @param baseselector The selector to limit scope to + */ _setup_for_section : function(section) { var chooserspan = section.one(CSS.SECTIONMODCHOOSER); if (!chooserspan) { @@ -84,12 +106,11 @@ Y.extend(MODCHOOSER, M.core.chooserdialogue, { chooserlink.on('click', this.display_mod_chooser, this); }, /** - * Display the module chooser - * - * @param e Event Triggering Event - * @param secitonid integer The ID of the section triggering the dialogue - * @return void - */ + * Display the module chooser + * + * @method display_mod_chooser + * @param {EventFacade} e Triggering Event + */ display_mod_chooser : function (e) { // Set the section for this version of the dialogue if (e.target.ancestor(CSS.SITETOPIC)) { @@ -104,6 +125,13 @@ Y.extend(MODCHOOSER, M.core.chooserdialogue, { } this.display_chooser(e); }, + + /** + * Toggle availability of the activity chooser. + * + * @method toggle_mod_chooser + * @param {EventFacade} e + */ toggle_mod_chooser : function(e) { // Get the add section link var modchooserlinks = Y.all('div.addresourcemodchooser'); @@ -153,6 +181,15 @@ Y.extend(MODCHOOSER, M.core.chooserdialogue, { // Prevent the page from reloading e.preventDefault(); }, + + /** + * Helper function to set the value of a hidden radio button when a + * selection is made. + * + * @method option_selected + * @param {String} thisoption The selected option value + * @private + */ option_selected : function(thisoption) { // Add the sectionid to the URL. this.hiddenRadioValue.setAttrs({ @@ -164,6 +201,13 @@ Y.extend(MODCHOOSER, M.core.chooserdialogue, { { NAME : MODCHOOSERNAME, ATTRS : { + /** + * The maximum height (in pixels) of the activity chooser. + * + * @attribute maxheight + * @type Number + * @default 800 + */ maxheight : { value : 800 } diff --git a/course/yui/build/moodle-course-toolboxes/moodle-course-toolboxes-debug.js b/course/yui/build/moodle-course-toolboxes/moodle-course-toolboxes-debug.js index 7839c1cc482..6eebc6810c6 100644 --- a/course/yui/build/moodle-course-toolboxes/moodle-course-toolboxes-debug.js +++ b/course/yui/build/moodle-course-toolboxes/moodle-course-toolboxes-debug.js @@ -296,7 +296,7 @@ Y.extend(RESOURCETOOLBOX, TOOLBOX, { * @protected * @method handle_data_action * @param {EventFacade} ev The event that was triggered. - * @returns {boolean} + * @return {boolean} */ handle_data_action: function(ev) { // We need to get the anchor element that triggered this event. @@ -587,7 +587,7 @@ Y.extend(RESOURCETOOLBOX, TOOLBOX, { * @param {Node} button The button that triggered the action. * @param {Node} activity The activity node that this action will be performed on. * @param {String} action 'show' or 'hide'. - * @returns {Number} 1 if we changed to visible, 0 if we were hiding. + * @return {Number} 1 if we changed to visible, 0 if we were hiding. */ handle_resource_dim: function(button, activity, action) { var toggleclass = CSS.DIMCLASS, diff --git a/course/yui/build/moodle-course-toolboxes/moodle-course-toolboxes.js b/course/yui/build/moodle-course-toolboxes/moodle-course-toolboxes.js index 7839c1cc482..6eebc6810c6 100644 --- a/course/yui/build/moodle-course-toolboxes/moodle-course-toolboxes.js +++ b/course/yui/build/moodle-course-toolboxes/moodle-course-toolboxes.js @@ -296,7 +296,7 @@ Y.extend(RESOURCETOOLBOX, TOOLBOX, { * @protected * @method handle_data_action * @param {EventFacade} ev The event that was triggered. - * @returns {boolean} + * @return {boolean} */ handle_data_action: function(ev) { // We need to get the anchor element that triggered this event. @@ -587,7 +587,7 @@ Y.extend(RESOURCETOOLBOX, TOOLBOX, { * @param {Node} button The button that triggered the action. * @param {Node} activity The activity node that this action will be performed on. * @param {String} action 'show' or 'hide'. - * @returns {Number} 1 if we changed to visible, 0 if we were hiding. + * @return {Number} 1 if we changed to visible, 0 if we were hiding. */ handle_resource_dim: function(button, activity, action) { var toggleclass = CSS.DIMCLASS, diff --git a/course/yui/src/coursebase/js/coursebase.js b/course/yui/src/coursebase/js/coursebase.js index 4edc91436a2..604fdae7599 100644 --- a/course/yui/src/coursebase/js/coursebase.js +++ b/course/yui/src/coursebase/js/coursebase.js @@ -67,6 +67,7 @@ M.course.format = M.course.format || {}; /** * Swap section (should be defined in format.js if requred) * + * @method M.course.format.swap_sections * @param {YUI} Y YUI3 instance * @param {string} node1 node to swap to * @param {string} node2 node to swap with @@ -81,12 +82,12 @@ M.course.format.swap_sections = M.course.format.swap_sections || function() { * If some response is expected, we pass it over to format, as it knows better * hot to process it. * + * @method M.course.format.process_sections * @param {YUI} Y YUI3 instance * @param {NodeList} list of sections * @param {array} response ajax response * @param {string} sectionfrom first affected section * @param {string} sectionto last affected section - * @return void */ M.course.format.process_sections = M.course.format.process_sections || function() { return null; @@ -96,6 +97,7 @@ M.course.format.process_sections = M.course.format.process_sections || function( * Get sections config for this format, for examples see function definition * in the formats. * +* @method M.course.format.get_config * @return {object} section list configuration */ M.course.format.get_config = M.course.format.get_config || function() { @@ -112,6 +114,7 @@ M.course.format.get_config = M.course.format.get_config || function() { /** * Get section list for this format (usually items inside container_node.container_class selector) * + * @method M.course.format.get_section_selector * @param {YUI} Y YUI3 instance * @return {string} section selector */ @@ -128,6 +131,7 @@ M.course.format.get_section_selector = M.course.format.get_section_selector || f * Get section wraper for this format (only used in case when each * container_node.container_class node is wrapped in some other element). * + * @method M.course.format.get_section_wrapper * @param {YUI} Y YUI3 instance * @return {string} section wrapper selector or M.course.format.get_section_selector * if section_wrapper_node and section_wrapper_class are not defined in the format config. @@ -143,6 +147,7 @@ M.course.format.get_section_wrapper = M.course.format.get_section_wrapper || fun /** * Get the tag of container node * + * @method M.course.format.get_containernode * @return {string} tag of container node. */ M.course.format.get_containernode = M.course.format.get_containernode || function() { @@ -157,6 +162,7 @@ M.course.format.get_containernode = M.course.format.get_containernode || functio /** * Get the class of container node * + * @method M.course.format.get_containerclass * @return {string} class of the container node. */ M.course.format.get_containerclass = M.course.format.get_containerclass || function() { @@ -171,6 +177,7 @@ M.course.format.get_containerclass = M.course.format.get_containerclass || funct /** * Get the tag of draggable node (section wrapper if exists, otherwise section) * + * @method M.course.format.get_sectionwrappernode * @return {string} tag of the draggable node. */ M.course.format.get_sectionwrappernode = M.course.format.get_sectionwrappernode || function() { @@ -185,6 +192,7 @@ M.course.format.get_sectionwrappernode = M.course.format.get_sectionwrappernode /** * Get the class of draggable node (section wrapper if exists, otherwise section) * + * @method M.course.format.get_sectionwrapperclass * @return {string} class of the draggable node. */ M.course.format.get_sectionwrapperclass = M.course.format.get_sectionwrapperclass || function() { @@ -199,6 +207,7 @@ M.course.format.get_sectionwrapperclass = M.course.format.get_sectionwrapperclas /** * Get the tag of section node * + * @method M.course.format.get_sectionnode * @return {string} tag of section node. */ M.course.format.get_sectionnode = M.course.format.get_sectionnode || function() { @@ -213,6 +222,7 @@ M.course.format.get_sectionnode = M.course.format.get_sectionnode || function() /** * Get the class of section node * + * @method M.course.format.get_sectionclass * @return {string} class of the section node. */ M.course.format.get_sectionclass = M.course.format.get_sectionclass || function() { diff --git a/course/yui/src/management/js/category.js b/course/yui/src/management/js/category.js index 7d564935070..21a33bb8f26 100644 --- a/course/yui/src/management/js/category.js +++ b/course/yui/src/management/js/category.js @@ -76,7 +76,7 @@ Category.prototype = { /** * Returns the name of the category. * @method getName - * @returns {String} + * @return {String} */ getName : function() { return this.get('node').one('a.categoryname').get('innerHTML'); @@ -99,7 +99,7 @@ Category.prototype = { * @method handle * @param {String} action * @param {EventFacade} e - * @returns {Boolean} + * @return {Boolean} */ handle : function(action, e) { var catarg = {categoryid : this.get('categoryid')}, @@ -269,7 +269,7 @@ Category.prototype = { * @param {Number} transactionid The transaction ID of the AJAX request (unique) * @param {Object} response The response from the AJAX request. * @param {Object} args The arguments given to the request. - * @returns {Boolean} + * @return {Boolean} */ completeMoveCourse : function(transactionid, response, args) { var outcome = this.checkAjaxResponse(transactionid, response, args), @@ -323,7 +323,7 @@ Category.prototype = { * @param {Number} transactionid The transaction ID of the AJAX request (unique) * @param {Object} response The response from the AJAX request. * @param {Object} args The arguments given to the request. - * @returns {Boolean} + * @return {Boolean} */ show : function(transactionid, response, args) { var outcome = this.checkAjaxResponse(transactionid, response, args), @@ -355,7 +355,7 @@ Category.prototype = { * @param {Number} transactionid The transaction ID of the AJAX request (unique) * @param {Object} response The response from the AJAX request. * @param {Object} args The arguments given to the request. - * @returns {Boolean} + * @return {Boolean} */ hide : function(transactionid, response, args) { var outcome = this.checkAjaxResponse(transactionid, response, args), @@ -439,4 +439,4 @@ Category.prototype = { return this; } }; -Y.extend(Category, Item, Category.prototype); \ No newline at end of file +Y.extend(Category, Item, Category.prototype); diff --git a/course/yui/src/management/js/console.js b/course/yui/src/management/js/console.js index b0ff8725272..8f195f8f248 100644 --- a/course/yui/src/management/js/console.js +++ b/course/yui/src/management/js/console.js @@ -12,7 +12,7 @@ * @namespace M.course.management * @class Console * @constructor - * @extends Y.Base + * @extends Base */ function Console() { Console.superclass.constructor.apply(this, arguments); @@ -243,7 +243,7 @@ Console.prototype = { * Initialises all the categories being shown. * @method initialiseCategories * @private - * @returns {boolean} + * @return {boolean} */ initialiseCategories : function(listing) { var count = 0; @@ -287,7 +287,7 @@ Console.prototype = { * Initialises all the categories being shown. * @method initialiseCourses * @private - * @returns {boolean} + * @return {boolean} */ initialiseCourses : function() { var category = this.getCategoryById(this.get('activecategoryid')), @@ -481,7 +481,7 @@ Console.prototype = { * Returns the category with the given ID. * @method getCategoryById * @param {Number} id - * @returns {Category|Boolean} The category or false if it can't be found. + * @return {Category|Boolean} The category or false if it can't be found. */ getCategoryById : function(id) { var i, @@ -503,7 +503,7 @@ Console.prototype = { * Returns the course with the given id. * @method getCourseById * @param {Number} id - * @returns {Course|Boolean} The course or false if not found/ + * @return {Course|Boolean} The course or false if not found/ */ getCourseById : function(id) { var i, @@ -578,9 +578,11 @@ M.course.management.console = null; /** * Initalises the course management console. + * + * @method M.course.management.init * @static * @param {Object} config */ M.course.management.init = function(config) { M.course.management.console = new Console(config); -}; \ No newline at end of file +}; diff --git a/course/yui/src/management/js/course.js b/course/yui/src/management/js/course.js index 3e646c64fb7..474180a30a6 100644 --- a/course/yui/src/management/js/course.js +++ b/course/yui/src/management/js/course.js @@ -77,7 +77,7 @@ Course.prototype = { /** * Returns the name of the course. * @method getName - * @returns {String} + * @return {String} */ getName : function() { return this.get('node').one('a.coursename').get('innerHTML'); @@ -88,7 +88,7 @@ Course.prototype = { * @method handle * @param {String} action * @param {EventFacade} e - * @returns {Boolean} + * @return {Boolean} */ handle : function(action, e) { var managementconsole = this.get('console'), @@ -161,7 +161,7 @@ Course.prototype = { * @param {Number} transactionid The transaction ID for the request. * @param {Object} response The response to the request. * @param {Objects} args The arguments that were given with the request. - * @returns {Boolean} + * @return {Boolean} */ moveAfterResponse : function(transactionid, response, args) { var outcome = this.checkAjaxResponse(transactionid, response, args), @@ -183,4 +183,4 @@ Course.prototype = { this.highlight(); } }; -Y.extend(Course, Item, Course.prototype); \ No newline at end of file +Y.extend(Course, Item, Course.prototype); diff --git a/course/yui/src/management/js/dd.js b/course/yui/src/management/js/dd.js index a3ad17ea4df..3ad3e0f9f37 100644 --- a/course/yui/src/management/js/dd.js +++ b/course/yui/src/management/js/dd.js @@ -4,7 +4,7 @@ * @namespace M.course.management * @class DragDrop * @constructor - * @extends Y.Base + * @extends Base */ function DragDrop(config) { Console.superclass.constructor.apply(this, [config]); @@ -266,4 +266,4 @@ DragDrop.prototype = { } } }; -Y.extend(DragDrop, Y.Base, DragDrop.prototype); \ No newline at end of file +Y.extend(DragDrop, Y.Base, DragDrop.prototype); diff --git a/course/yui/src/management/js/item.js b/course/yui/src/management/js/item.js index 5987f7a5eb8..97b75f2fa78 100644 --- a/course/yui/src/management/js/item.js +++ b/course/yui/src/management/js/item.js @@ -4,8 +4,7 @@ * @namespace M.course.management * @class Item * @constructor - * @extends Y.Base - * @abstract + * @extends Base */ function Item() { Item.superclass.constructor.apply(this, arguments); @@ -55,7 +54,7 @@ Item.prototype = { * @param {Number} transactionid The transaction ID of the AJAX request (unique) * @param {Object} response The response from the AJAX request. * @param {Object} args The arguments given to the request. - * @returns {Object|Boolean} + * @return {Object|Boolean} */ checkAjaxResponse : function(transactionid, response, args) { if (response.status !== 200) { @@ -83,7 +82,7 @@ Item.prototype = { * @param {Number} transactionid The transaction ID of the AJAX request (unique) * @param {Object} response The response from the AJAX request. * @param {Object} args The arguments given to the request. - * @returns {Boolean} + * @return {Boolean} */ moveup : function(transactionid, response, args) { var node, @@ -151,7 +150,7 @@ Item.prototype = { * @param {Number} transactionid The transaction ID of the AJAX request (unique) * @param {Object} response The response from the AJAX request. * @param {Object} args The arguments given to the request. - * @returns {Boolean} + * @return {Boolean} */ movedown : function(transactionid, response, args) { var node, @@ -219,7 +218,7 @@ Item.prototype = { * @param {Number} transactionid The transaction ID of the AJAX request (unique) * @param {Object} response The response from the AJAX request. * @param {Object} args The arguments given to the request. - * @returns {Boolean} + * @return {Boolean} */ show : function(transactionid, response, args) { var outcome = this.checkAjaxResponse(transactionid, response, args), @@ -255,7 +254,7 @@ Item.prototype = { * @param {Number} transactionid The transaction ID of the AJAX request (unique) * @param {Object} response The response from the AJAX request. * @param {Object} args The arguments given to the request. - * @returns {Boolean} + * @return {Boolean} */ hide : function(transactionid, response, args) { var outcome = this.checkAjaxResponse(transactionid, response, args), @@ -312,4 +311,4 @@ Item.prototype = { }, 2500); } }; -Y.extend(Item, Y.Base, Item.prototype); \ No newline at end of file +Y.extend(Item, Y.Base, Item.prototype); diff --git a/course/yui/src/modchooser/js/modchooser.js b/course/yui/src/modchooser/js/modchooser.js index f9627d2be99..da70ad84813 100644 --- a/course/yui/src/modchooser/js/modchooser.js +++ b/course/yui/src/modchooser/js/modchooser.js @@ -1,7 +1,7 @@ /** * The activity chooser dialogue for courses. * - * @moodle-course-modchooser + * @module moodle-course-modchooser */ var CSS = { @@ -26,9 +26,21 @@ var MODCHOOSER = function() { }; Y.extend(MODCHOOSER, M.core.chooserdialogue, { - // The current section ID + /** + * The current section ID. + * + * @property sectionid + * @private + * @type Number + * @default null + */ sectionid : null, + /** + * Set up the activity chooser. + * + * @method initializer + */ initializer : function() { var dialogue = Y.one('.chooserdialoguebody'); var header = Y.one('.choosertitle'); @@ -42,12 +54,13 @@ Y.extend(MODCHOOSER, M.core.chooserdialogue, { // Catch the page toggle Y.all('.block_settings #settingsnav .type_course .modchoosertoggle a').on('click', this.toggle_mod_chooser, this); }, + /** * Update any section areas within the scope of the specified * selector with AJAX equivalents * + * @method setup_for_section * @param baseselector The selector to limit scope to - * @return void */ setup_for_section : function(baseselector) { if (!baseselector) { @@ -69,6 +82,15 @@ Y.extend(MODCHOOSER, M.core.chooserdialogue, { this._setup_for_section(section); }, this); }, + + /** + * Update any section areas within the scope of the specified + * selector with AJAX equivalents + * + * @method _setup_for_section + * @private + * @param baseselector The selector to limit scope to + */ _setup_for_section : function(section) { var chooserspan = section.one(CSS.SECTIONMODCHOOSER); if (!chooserspan) { @@ -82,12 +104,11 @@ Y.extend(MODCHOOSER, M.core.chooserdialogue, { chooserlink.on('click', this.display_mod_chooser, this); }, /** - * Display the module chooser - * - * @param e Event Triggering Event - * @param secitonid integer The ID of the section triggering the dialogue - * @return void - */ + * Display the module chooser + * + * @method display_mod_chooser + * @param {EventFacade} e Triggering Event + */ display_mod_chooser : function (e) { // Set the section for this version of the dialogue if (e.target.ancestor(CSS.SITETOPIC)) { @@ -102,6 +123,13 @@ Y.extend(MODCHOOSER, M.core.chooserdialogue, { } this.display_chooser(e); }, + + /** + * Toggle availability of the activity chooser. + * + * @method toggle_mod_chooser + * @param {EventFacade} e + */ toggle_mod_chooser : function(e) { // Get the add section link var modchooserlinks = Y.all('div.addresourcemodchooser'); @@ -151,6 +179,15 @@ Y.extend(MODCHOOSER, M.core.chooserdialogue, { // Prevent the page from reloading e.preventDefault(); }, + + /** + * Helper function to set the value of a hidden radio button when a + * selection is made. + * + * @method option_selected + * @param {String} thisoption The selected option value + * @private + */ option_selected : function(thisoption) { // Add the sectionid to the URL. this.hiddenRadioValue.setAttrs({ @@ -162,6 +199,13 @@ Y.extend(MODCHOOSER, M.core.chooserdialogue, { { NAME : MODCHOOSERNAME, ATTRS : { + /** + * The maximum height (in pixels) of the activity chooser. + * + * @attribute maxheight + * @type Number + * @default 800 + */ maxheight : { value : 800 } diff --git a/course/yui/src/toolboxes/js/resource.js b/course/yui/src/toolboxes/js/resource.js index 30b18efe51d..83139a3c366 100644 --- a/course/yui/src/toolboxes/js/resource.js +++ b/course/yui/src/toolboxes/js/resource.js @@ -92,7 +92,7 @@ Y.extend(RESOURCETOOLBOX, TOOLBOX, { * @protected * @method handle_data_action * @param {EventFacade} ev The event that was triggered. - * @returns {boolean} + * @return {boolean} */ handle_data_action: function(ev) { // We need to get the anchor element that triggered this event. @@ -383,7 +383,7 @@ Y.extend(RESOURCETOOLBOX, TOOLBOX, { * @param {Node} button The button that triggered the action. * @param {Node} activity The activity node that this action will be performed on. * @param {String} action 'show' or 'hide'. - * @returns {Number} 1 if we changed to visible, 0 if we were hiding. + * @return {Number} 1 if we changed to visible, 0 if we were hiding. */ handle_resource_dim: function(button, activity, action) { var toggleclass = CSS.DIMCLASS, diff --git a/lib/yui/build/moodle-core-actionmenu/moodle-core-actionmenu-debug.js b/lib/yui/build/moodle-core-actionmenu/moodle-core-actionmenu-debug.js index 9b0f72079dc..3627925630a 100644 --- a/lib/yui/build/moodle-core-actionmenu/moodle-core-actionmenu-debug.js +++ b/lib/yui/build/moodle-core-actionmenu/moodle-core-actionmenu-debug.js @@ -45,7 +45,7 @@ var BODY = Y.one(Y.config.doc.body), * @namespace M.core.actionmenu * @class ActionMenu * @constructor - * @extends Y.Base + * @extends Base */ ACTIONMENU = function() { ACTIONMENU.superclass.constructor.apply(this, arguments); @@ -70,6 +70,10 @@ ACTIONMENU.prototype = { /** * The node that owns the currently displayed menu. + * + * @property owner + * @type Node + * @default null */ owner : null, @@ -111,6 +115,7 @@ ACTIONMENU.prototype = { /** * Called during the initialisation process of the object. + * * @method initializer */ initializer : function() { @@ -131,8 +136,9 @@ ACTIONMENU.prototype = { /** * Enhances a menu adding aria attributes and flagging it as functional. * + * @method enhance * @param {Node} menu - * @returns {boolean} + * @return boolean */ enhance : function(menu) { var menucontent = menu.one(SELECTOR.MENUCONTENT), @@ -412,9 +418,11 @@ ACTIONMENU.prototype = { /** * Displays the menu with the given content and alignment. + * + * @method showMenu * @param {EventFacade} e * @param {Node} menu - * @returns {M.core.dialogue|dialogue} + * @return M.core.dialogue */ showMenu : function(e, menu) { Y.log('Displaying an action menu', 'debug', ACTIONMENU.NAME); @@ -565,32 +573,21 @@ Y.extend(ACTIONMENU, Y.Base, ACTIONMENU.prototype, { } }); -/** - * Core namespace. - * @static - * @class core - */ M.core = M.core || {}; - -/** - * Actionmenu namespace. - * @namespace M.core - * @class actionmenu - * @static - */ M.core.actionmenu = M.core.actionmenu || {}; /** * * @static - * @property instance + * @property M.core.actionmenu.instance * @type {ACTIONMENU} */ M.core.actionmenu.instance = null; /** * Init function - will only ever create one instance of the actionmenu class. - * @method init + * + * @method M.core.actionmenu.init * @static * @param {Object} params */ @@ -600,8 +597,10 @@ M.core.actionmenu.init = M.core.actionmenu.init || function(params) { /** * Registers a new DOM node with the action menu causing it to be enhanced if required. + * + * @method M.core.actionmenu.newDOMNode * @param node - * @returns {boolean} + * @return {boolean} */ M.core.actionmenu.newDOMNode = function(node) { if (M.core.actionmenu.instance === null) { diff --git a/lib/yui/build/moodle-core-actionmenu/moodle-core-actionmenu.js b/lib/yui/build/moodle-core-actionmenu/moodle-core-actionmenu.js index f08c612b3e0..ebfa02f2edb 100644 --- a/lib/yui/build/moodle-core-actionmenu/moodle-core-actionmenu.js +++ b/lib/yui/build/moodle-core-actionmenu/moodle-core-actionmenu.js @@ -45,7 +45,7 @@ var BODY = Y.one(Y.config.doc.body), * @namespace M.core.actionmenu * @class ActionMenu * @constructor - * @extends Y.Base + * @extends Base */ ACTIONMENU = function() { ACTIONMENU.superclass.constructor.apply(this, arguments); @@ -70,6 +70,10 @@ ACTIONMENU.prototype = { /** * The node that owns the currently displayed menu. + * + * @property owner + * @type Node + * @default null */ owner : null, @@ -111,6 +115,7 @@ ACTIONMENU.prototype = { /** * Called during the initialisation process of the object. + * * @method initializer */ initializer : function() { @@ -130,8 +135,9 @@ ACTIONMENU.prototype = { /** * Enhances a menu adding aria attributes and flagging it as functional. * + * @method enhance * @param {Node} menu - * @returns {boolean} + * @return boolean */ enhance : function(menu) { var menucontent = menu.one(SELECTOR.MENUCONTENT), @@ -409,9 +415,11 @@ ACTIONMENU.prototype = { /** * Displays the menu with the given content and alignment. + * + * @method showMenu * @param {EventFacade} e * @param {Node} menu - * @returns {M.core.dialogue|dialogue} + * @return M.core.dialogue */ showMenu : function(e, menu) { var ownerselector = menu.getData('owner'), @@ -560,32 +568,21 @@ Y.extend(ACTIONMENU, Y.Base, ACTIONMENU.prototype, { } }); -/** - * Core namespace. - * @static - * @class core - */ M.core = M.core || {}; - -/** - * Actionmenu namespace. - * @namespace M.core - * @class actionmenu - * @static - */ M.core.actionmenu = M.core.actionmenu || {}; /** * * @static - * @property instance + * @property M.core.actionmenu.instance * @type {ACTIONMENU} */ M.core.actionmenu.instance = null; /** * Init function - will only ever create one instance of the actionmenu class. - * @method init + * + * @method M.core.actionmenu.init * @static * @param {Object} params */ @@ -595,8 +592,10 @@ M.core.actionmenu.init = M.core.actionmenu.init || function(params) { /** * Registers a new DOM node with the action menu causing it to be enhanced if required. + * + * @method M.core.actionmenu.newDOMNode * @param node - * @returns {boolean} + * @return {boolean} */ M.core.actionmenu.newDOMNode = function(node) { if (M.core.actionmenu.instance === null) { diff --git a/lib/yui/build/moodle-core-blocks/moodle-core-blocks-debug.js b/lib/yui/build/moodle-core-blocks/moodle-core-blocks-debug.js index ca9300cf838..e8828e27613 100644 --- a/lib/yui/build/moodle-core-blocks/moodle-core-blocks-debug.js +++ b/lib/yui/build/moodle-core-blocks/moodle-core-blocks-debug.js @@ -321,26 +321,14 @@ Y.extend(DRAGBLOCK, M.core.dragdrop, { } }); -/** - * Core namespace. - * @static - * @class core - */ M.core = M.core || {}; - -/** - * Block drag and drop static class. - * @namespace M.core - * @class blockdraganddrop - * @static - */ M.core.blockdraganddrop = M.core.blockdraganddrop || {}; /** * True if the page is using the new blocks methods. * @private * @static - * @property _isusingnewblocksmethod + * @property M.core.blockdraganddrop._isusingnewblocksmethod * @type Boolean * @default null */ @@ -349,7 +337,7 @@ M.core.blockdraganddrop._isusingnewblocksmethod = null; /** * Returns true if the page is using the new blocks methods. * @static - * @method is_using_blocks_render_method + * @method M.core.blockdraganddrop.is_using_blocks_render_method * @return Boolean */ M.core.blockdraganddrop.is_using_blocks_render_method = function() { @@ -365,7 +353,7 @@ M.core.blockdraganddrop.is_using_blocks_render_method = function() { * Initialises a drag and drop manager. * This should only ever be called once for a page. * @static - * @method init + * @method M.core.blockdraganddrop.init * @param {Object} params * @return Manager */ @@ -377,7 +365,7 @@ M.core.blockdraganddrop.init = function(params) { } }; -/** +/* * Legacy code to keep things working. */ M.core_blocks = M.core_blocks || {}; @@ -506,7 +494,7 @@ MANAGER.prototype = { * Returns the ID of the block the given node represents. * @method get_block_id * @param {Node} node - * @returns {int} The blocks ID in the database. + * @return {int} The blocks ID in the database. */ get_block_id : function(node) { return Number(node.get('id').replace(/inst/i, '')); @@ -516,7 +504,7 @@ MANAGER.prototype = { * Returns the block region that the node is part of or belonging to. * @method get_block_region * @param {Y.Node} node - * @returns {string} The region name. + * @return {string} The region name. */ get_block_region : function(node) { if (!node.test('[data-blockregion]')) { @@ -529,7 +517,7 @@ MANAGER.prototype = { * Returns the BLOCKREGION instance that represents the block region the given node is part of. * @method get_region_object * @param {Y.Node} node - * @returns {BLOCKREGION} + * @return {BLOCKREGION} */ get_region_object : function(node) { return this.regionobjects[this.get_block_region(node)]; @@ -538,7 +526,6 @@ MANAGER.prototype = { /** * Enables all fo the regions so that they are all visible while dragging is occuring. * @method enable_all_regions - * @returns {undefined} */ enable_all_regions : function() { var i = 0; @@ -550,7 +537,6 @@ MANAGER.prototype = { /** * Disables enabled regions if they contain no blocks. * @method disable_regions_if_required - * @returns {undefined} */ disable_regions_if_required : function() { var i = 0; @@ -563,7 +549,6 @@ MANAGER.prototype = { * Called by M.core.dragdrop.global_drag_start when dragging starts. * @method drag_start * @param {Event} e - * @returns {undefined} */ drag_start : function(e) { // Get our drag object @@ -585,7 +570,6 @@ MANAGER.prototype = { * Called by M.core.dragdrop.global_drop_over when something is dragged over a drop target. * @method drop_over * @param {Event} e - * @returns {undefined} */ drop_over : function(e) { // Get a reference to our drag and drop nodes @@ -602,7 +586,6 @@ MANAGER.prototype = { /** * Called by M.core.dragdrop.global_drop_end when a drop has been completed. * @method drop_end - * @returns {undefined} */ drop_end : function() { // Clear variables. @@ -615,7 +598,6 @@ MANAGER.prototype = { * Called by M.core.dragdrop.global_drag_dropmiss when something has been dropped on a node that isn't contained by a drop target. * @method drag_dropmiss * @param {Event} e - * @returns {undefined} */ drag_dropmiss : function(e) { // Missed the target, but we assume the user intended to drop it @@ -628,7 +610,6 @@ MANAGER.prototype = { * Called by M.core.dragdrop.global_drag_hit when something has been dropped on a drop target. * @method drop_hit * @param {Event} e - * @returns {undefined} */ drop_hit : function(e) { // Get a reference to our drag node @@ -791,7 +772,7 @@ Y.extend(MANAGER, M.core.dragdrop, MANAGER.prototype, { * @namespace M.core.blockdraganddrop * @class BlockRegion * @constructor - * @extends Y.Base + * @extends Base */ var BLOCKREGION = function() { BLOCKREGION.superclass.constructor.apply(this, arguments); diff --git a/lib/yui/build/moodle-core-blocks/moodle-core-blocks.js b/lib/yui/build/moodle-core-blocks/moodle-core-blocks.js index 9f78d99667c..605161ab07a 100644 --- a/lib/yui/build/moodle-core-blocks/moodle-core-blocks.js +++ b/lib/yui/build/moodle-core-blocks/moodle-core-blocks.js @@ -321,26 +321,14 @@ Y.extend(DRAGBLOCK, M.core.dragdrop, { } }); -/** - * Core namespace. - * @static - * @class core - */ M.core = M.core || {}; - -/** - * Block drag and drop static class. - * @namespace M.core - * @class blockdraganddrop - * @static - */ M.core.blockdraganddrop = M.core.blockdraganddrop || {}; /** * True if the page is using the new blocks methods. * @private * @static - * @property _isusingnewblocksmethod + * @property M.core.blockdraganddrop._isusingnewblocksmethod * @type Boolean * @default null */ @@ -349,7 +337,7 @@ M.core.blockdraganddrop._isusingnewblocksmethod = null; /** * Returns true if the page is using the new blocks methods. * @static - * @method is_using_blocks_render_method + * @method M.core.blockdraganddrop.is_using_blocks_render_method * @return Boolean */ M.core.blockdraganddrop.is_using_blocks_render_method = function() { @@ -365,7 +353,7 @@ M.core.blockdraganddrop.is_using_blocks_render_method = function() { * Initialises a drag and drop manager. * This should only ever be called once for a page. * @static - * @method init + * @method M.core.blockdraganddrop.init * @param {Object} params * @return Manager */ @@ -377,7 +365,7 @@ M.core.blockdraganddrop.init = function(params) { } }; -/** +/* * Legacy code to keep things working. */ M.core_blocks = M.core_blocks || {}; @@ -504,7 +492,7 @@ MANAGER.prototype = { * Returns the ID of the block the given node represents. * @method get_block_id * @param {Node} node - * @returns {int} The blocks ID in the database. + * @return {int} The blocks ID in the database. */ get_block_id : function(node) { return Number(node.get('id').replace(/inst/i, '')); @@ -514,7 +502,7 @@ MANAGER.prototype = { * Returns the block region that the node is part of or belonging to. * @method get_block_region * @param {Y.Node} node - * @returns {string} The region name. + * @return {string} The region name. */ get_block_region : function(node) { if (!node.test('[data-blockregion]')) { @@ -527,7 +515,7 @@ MANAGER.prototype = { * Returns the BLOCKREGION instance that represents the block region the given node is part of. * @method get_region_object * @param {Y.Node} node - * @returns {BLOCKREGION} + * @return {BLOCKREGION} */ get_region_object : function(node) { return this.regionobjects[this.get_block_region(node)]; @@ -536,7 +524,6 @@ MANAGER.prototype = { /** * Enables all fo the regions so that they are all visible while dragging is occuring. * @method enable_all_regions - * @returns {undefined} */ enable_all_regions : function() { var i = 0; @@ -548,7 +535,6 @@ MANAGER.prototype = { /** * Disables enabled regions if they contain no blocks. * @method disable_regions_if_required - * @returns {undefined} */ disable_regions_if_required : function() { var i = 0; @@ -561,7 +547,6 @@ MANAGER.prototype = { * Called by M.core.dragdrop.global_drag_start when dragging starts. * @method drag_start * @param {Event} e - * @returns {undefined} */ drag_start : function(e) { // Get our drag object @@ -583,7 +568,6 @@ MANAGER.prototype = { * Called by M.core.dragdrop.global_drop_over when something is dragged over a drop target. * @method drop_over * @param {Event} e - * @returns {undefined} */ drop_over : function(e) { // Get a reference to our drag and drop nodes @@ -600,7 +584,6 @@ MANAGER.prototype = { /** * Called by M.core.dragdrop.global_drop_end when a drop has been completed. * @method drop_end - * @returns {undefined} */ drop_end : function() { // Clear variables. @@ -613,7 +596,6 @@ MANAGER.prototype = { * Called by M.core.dragdrop.global_drag_dropmiss when something has been dropped on a node that isn't contained by a drop target. * @method drag_dropmiss * @param {Event} e - * @returns {undefined} */ drag_dropmiss : function(e) { // Missed the target, but we assume the user intended to drop it @@ -626,7 +608,6 @@ MANAGER.prototype = { * Called by M.core.dragdrop.global_drag_hit when something has been dropped on a drop target. * @method drop_hit * @param {Event} e - * @returns {undefined} */ drop_hit : function(e) { // Get a reference to our drag node @@ -789,7 +770,7 @@ Y.extend(MANAGER, M.core.dragdrop, MANAGER.prototype, { * @namespace M.core.blockdraganddrop * @class BlockRegion * @constructor - * @extends Y.Base + * @extends Base */ var BLOCKREGION = function() { BLOCKREGION.superclass.constructor.apply(this, arguments); diff --git a/lib/yui/build/moodle-core-chooserdialogue/moodle-core-chooserdialogue-debug.js b/lib/yui/build/moodle-core-chooserdialogue/moodle-core-chooserdialogue-debug.js index 9413f1e2698..c88ac91556c 100644 --- a/lib/yui/build/moodle-core-chooserdialogue/moodle-core-chooserdialogue-debug.js +++ b/lib/yui/build/moodle-core-chooserdialogue/moodle-core-chooserdialogue-debug.js @@ -1,5 +1,17 @@ YUI.add('moodle-core-chooserdialogue', function (Y, NAME) { +/** + * A type of dialogue used as for choosing options. + * + * @module moodle-core-chooserdialogue + */ + +/** + * A type of dialogue used as for choosing options. + * + * @constructor + * @class M.core.chooserdialogue + */ var CHOOSERDIALOGUE = function() { CHOOSERDIALOGUE.superclass.constructor.apply(this, arguments); }; @@ -83,8 +95,8 @@ Y.extend(CHOOSERDIALOGUE, Y.Base, { /** * Display the module chooser * - * @param e Event Triggering Event - * @return void + * @method display_chooser + * @param {EventFacade} e Triggering Event */ display_chooser : function (e) { var bb, dialogue, thisevent; @@ -169,13 +181,13 @@ Y.extend(CHOOSERDIALOGUE, Y.Base, { }, /** - * Cancel any listen events in the listenevents queue - * - * Several locations add event handlers which should only be called before the form is submitted. This provides - * a way of cancelling those events. - * - * @return void - */ + * Cancel any listen events in the listenevents queue + * + * Several locations add event handlers which should only be called before the form is submitted. This provides + * a way of cancelling those events. + * + * @method cancel_listenevents + */ cancel_listenevents : function () { // Detach all listen events to prevent duplicate triggers var thisevent; @@ -191,8 +203,8 @@ Y.extend(CHOOSERDIALOGUE, Y.Base, { * This tries to set a sensible maximum and minimum to ensure that some options are always shown, and preferably * all, whilst fitting the box within the current viewport. * - * @param dialogue Y.Node The dialogue - * @return void + * @method center_dialogue + * @param Node {dialogue} Y.Node The dialogue */ center_dialogue : function(dialogue) { var bb = this.panel.get('boundingBox'), @@ -306,15 +318,47 @@ Y.extend(CHOOSERDIALOGUE, Y.Base, { { NAME : 'moodle-core-chooserdialogue', ATTRS : { + /** + * The minimum height (in pixels) before resizing is prevented and scroll + * locking disabled. + * + * @attribute minheight + * @type Number + * @default 300 + */ minheight : { value : 300 }, + + /** + * The base height?? + * + * @attribute baseheight + * @type Number + * @default 400 + */ baseheight: { value : 400 }, + + /** + * The maximum height (in pixels) at which we stop resizing. + * + * @attribute maxheight + * @type Number + * @default 300 + */ maxheight : { value : 660 }, + + /** + * The title of the close button. + * + * @attribute closeButtonTitle + * @type String + * @default 'Close' + */ closeButtonTitle : { validator : Y.Lang.isString, value : 'Close' diff --git a/lib/yui/build/moodle-core-chooserdialogue/moodle-core-chooserdialogue.js b/lib/yui/build/moodle-core-chooserdialogue/moodle-core-chooserdialogue.js index 9413f1e2698..c88ac91556c 100644 --- a/lib/yui/build/moodle-core-chooserdialogue/moodle-core-chooserdialogue.js +++ b/lib/yui/build/moodle-core-chooserdialogue/moodle-core-chooserdialogue.js @@ -1,5 +1,17 @@ YUI.add('moodle-core-chooserdialogue', function (Y, NAME) { +/** + * A type of dialogue used as for choosing options. + * + * @module moodle-core-chooserdialogue + */ + +/** + * A type of dialogue used as for choosing options. + * + * @constructor + * @class M.core.chooserdialogue + */ var CHOOSERDIALOGUE = function() { CHOOSERDIALOGUE.superclass.constructor.apply(this, arguments); }; @@ -83,8 +95,8 @@ Y.extend(CHOOSERDIALOGUE, Y.Base, { /** * Display the module chooser * - * @param e Event Triggering Event - * @return void + * @method display_chooser + * @param {EventFacade} e Triggering Event */ display_chooser : function (e) { var bb, dialogue, thisevent; @@ -169,13 +181,13 @@ Y.extend(CHOOSERDIALOGUE, Y.Base, { }, /** - * Cancel any listen events in the listenevents queue - * - * Several locations add event handlers which should only be called before the form is submitted. This provides - * a way of cancelling those events. - * - * @return void - */ + * Cancel any listen events in the listenevents queue + * + * Several locations add event handlers which should only be called before the form is submitted. This provides + * a way of cancelling those events. + * + * @method cancel_listenevents + */ cancel_listenevents : function () { // Detach all listen events to prevent duplicate triggers var thisevent; @@ -191,8 +203,8 @@ Y.extend(CHOOSERDIALOGUE, Y.Base, { * This tries to set a sensible maximum and minimum to ensure that some options are always shown, and preferably * all, whilst fitting the box within the current viewport. * - * @param dialogue Y.Node The dialogue - * @return void + * @method center_dialogue + * @param Node {dialogue} Y.Node The dialogue */ center_dialogue : function(dialogue) { var bb = this.panel.get('boundingBox'), @@ -306,15 +318,47 @@ Y.extend(CHOOSERDIALOGUE, Y.Base, { { NAME : 'moodle-core-chooserdialogue', ATTRS : { + /** + * The minimum height (in pixels) before resizing is prevented and scroll + * locking disabled. + * + * @attribute minheight + * @type Number + * @default 300 + */ minheight : { value : 300 }, + + /** + * The base height?? + * + * @attribute baseheight + * @type Number + * @default 400 + */ baseheight: { value : 400 }, + + /** + * The maximum height (in pixels) at which we stop resizing. + * + * @attribute maxheight + * @type Number + * @default 300 + */ maxheight : { value : 660 }, + + /** + * The title of the close button. + * + * @attribute closeButtonTitle + * @type String + * @default 'Close' + */ closeButtonTitle : { validator : Y.Lang.isString, value : 'Close' 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 2b7d519af5a..e9ddb0276a0 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 @@ -2,29 +2,14 @@ YUI.add('moodle-core-dock-loader', function (Y, NAME) { var LOADERNAME = 'moodle-core-dock-loader'; -/** - * Core namespace. - * - * @static - * @namespace M - * @class core - */ M.core = M.core || {}; - -/** - * Dock namespace. - * - * @static - * @namespace M.core - * @class dock - */ M.core.dock = M.core.dock || {}; /** * Creates the move to dock icon for dockable blocks if it doesn't already exist. * * @static - * @method ensureMoveToIconExists + * @method M.core.dock.ensureMoveToIconExists * @param {Node} blocknode The Blocks node (.block[data-instanceid]) */ M.core.dock.ensureMoveToIconExists = function(blocknode) { 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 dcd9684eced..e4de830e4d3 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 @@ -2,29 +2,14 @@ YUI.add('moodle-core-dock-loader', function (Y, NAME) { var LOADERNAME = 'moodle-core-dock-loader'; -/** - * Core namespace. - * - * @static - * @namespace M - * @class core - */ M.core = M.core || {}; - -/** - * Dock namespace. - * - * @static - * @namespace M.core - * @class dock - */ M.core.dock = M.core.dock || {}; /** * Creates the move to dock icon for dockable blocks if it doesn't already exist. * * @static - * @method ensureMoveToIconExists + * @method M.core.dock.ensureMoveToIconExists * @param {Node} blocknode The Blocks node (.block[data-instanceid]) */ M.core.dock.ensureMoveToIconExists = function(blocknode) { 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 a6d6a55efeb..8ba11cc612a 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 @@ -37,22 +37,7 @@ var LOGNS = 'moodle-core-dock', BLOCK, DOCKEDITEM; -/** - * Core namespace. - * - * @static - * @namespace M - * @class core - */ M.core = M.core || {}; - -/** - * Dock namespace. - * - * @static - * @namespace M.core - * @class dock - */ M.core.dock = M.core.dock || {}; /** @@ -261,8 +246,8 @@ M.core.dock.notifyBlockChange = function(instanceid) { * @namespace M.core.dock * @class Dock * @constructor - * @extends Y.Base - * @uses Y.EventTarget + * @extends Base + * @uses EventTarget */ DOCK = function() { DOCK.superclass.constructor.apply(this, arguments); @@ -1132,8 +1117,8 @@ Y.augment(DOCK, Y.EventTarget); * @namespace M.core.dock * @class Panel * @constructor - * @extends Y.Base - * @uses Y.EventTarget + * @extends Base + * @uses EventTarget */ DOCKPANEL = function() { DOCKPANEL.superclass.constructor.apply(this, arguments); @@ -1369,7 +1354,7 @@ Y.augment(DOCKPANEL, Y.EventTarget); * @namespace M.core.dock * @class TabHeightManager * @constructor - * @extends Y.Base + * @extends Base */ TABHEIGHTMANAGER = function() { TABHEIGHTMANAGER.superclass.constructor.apply(this, arguments); @@ -1608,7 +1593,7 @@ Y.Event.define("dock:actionkey", { * @namespace M.core.dock * @class Block * @constructor - * @extends Y.Base + * @extends Base */ BLOCK = function() { BLOCK.superclass.constructor.apply(this, arguments); @@ -1864,8 +1849,8 @@ Y.extend(BLOCK, Y.Base, BLOCK.prototype, { * @namespace M.core.dock * @class DockedItem * @constructor - * @extends Y.Base - * @uses Y.EventTarget + * @extends Base + * @uses EventTarget */ DOCKEDITEM = function() { DOCKEDITEM.superclass.constructor.apply(this, arguments); 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 57588b7301f..674039ff3b9 100644 --- a/lib/yui/build/moodle-core-dock/moodle-core-dock.js +++ b/lib/yui/build/moodle-core-dock/moodle-core-dock.js @@ -37,22 +37,7 @@ var LOGNS = 'moodle-core-dock', BLOCK, DOCKEDITEM; -/** - * Core namespace. - * - * @static - * @namespace M - * @class core - */ M.core = M.core || {}; - -/** - * Dock namespace. - * - * @static - * @namespace M.core - * @class dock - */ M.core.dock = M.core.dock || {}; /** @@ -260,8 +245,8 @@ M.core.dock.notifyBlockChange = function(instanceid) { * @namespace M.core.dock * @class Dock * @constructor - * @extends Y.Base - * @uses Y.EventTarget + * @extends Base + * @uses EventTarget */ DOCK = function() { DOCK.superclass.constructor.apply(this, arguments); @@ -1122,8 +1107,8 @@ Y.augment(DOCK, Y.EventTarget); * @namespace M.core.dock * @class Panel * @constructor - * @extends Y.Base - * @uses Y.EventTarget + * @extends Base + * @uses EventTarget */ DOCKPANEL = function() { DOCKPANEL.superclass.constructor.apply(this, arguments); @@ -1358,7 +1343,7 @@ Y.augment(DOCKPANEL, Y.EventTarget); * @namespace M.core.dock * @class TabHeightManager * @constructor - * @extends Y.Base + * @extends Base */ TABHEIGHTMANAGER = function() { TABHEIGHTMANAGER.superclass.constructor.apply(this, arguments); @@ -1596,7 +1581,7 @@ Y.Event.define("dock:actionkey", { * @namespace M.core.dock * @class Block * @constructor - * @extends Y.Base + * @extends Base */ BLOCK = function() { BLOCK.superclass.constructor.apply(this, arguments); @@ -1849,8 +1834,8 @@ Y.extend(BLOCK, Y.Base, BLOCK.prototype, { * @namespace M.core.dock * @class DockedItem * @constructor - * @extends Y.Base - * @uses Y.EventTarget + * @extends Base + * @uses EventTarget */ DOCKEDITEM = function() { DOCKEDITEM.superclass.constructor.apply(this, arguments); diff --git a/lib/yui/build/moodle-core-formautosubmit/moodle-core-formautosubmit-debug.js b/lib/yui/build/moodle-core-formautosubmit/moodle-core-formautosubmit-debug.js index b62338a1181..31b829acb98 100644 --- a/lib/yui/build/moodle-core-formautosubmit/moodle-core-formautosubmit-debug.js +++ b/lib/yui/build/moodle-core-formautosubmit/moodle-core-formautosubmit-debug.js @@ -16,9 +16,9 @@ FORMAUTOSUBMIT = function() { Y.extend(FORMAUTOSUBMIT, Y.Base, { - /** - * Initialize the module - */ + /* + * Initialize the module + */ initializer : function() { // Set up local variables var applyto, @@ -56,9 +56,9 @@ Y.extend(FORMAUTOSUBMIT, Y.Base, { } }, - /** - * Check whether the select element was changed - */ + /* + * Check whether the select element was changed + */ check_changed : function(e) { var select, nothing, @@ -88,9 +88,9 @@ Y.extend(FORMAUTOSUBMIT, Y.Base, { return false; }, - /** - * Process any changes - */ + /* + * Process any changes + */ process_changes : function(e) { var select = this.check_changed(e), form; diff --git a/lib/yui/build/moodle-core-formautosubmit/moodle-core-formautosubmit.js b/lib/yui/build/moodle-core-formautosubmit/moodle-core-formautosubmit.js index 5caab5b9192..1c75883614d 100644 --- a/lib/yui/build/moodle-core-formautosubmit/moodle-core-formautosubmit.js +++ b/lib/yui/build/moodle-core-formautosubmit/moodle-core-formautosubmit.js @@ -16,9 +16,9 @@ FORMAUTOSUBMIT = function() { Y.extend(FORMAUTOSUBMIT, Y.Base, { - /** - * Initialize the module - */ + /* + * Initialize the module + */ initializer : function() { // Set up local variables var applyto, @@ -55,9 +55,9 @@ Y.extend(FORMAUTOSUBMIT, Y.Base, { } }, - /** - * Check whether the select element was changed - */ + /* + * Check whether the select element was changed + */ check_changed : function(e) { var select, nothing, @@ -87,9 +87,9 @@ Y.extend(FORMAUTOSUBMIT, Y.Base, { return false; }, - /** - * Process any changes - */ + /* + * Process any changes + */ process_changes : function(e) { var select = this.check_changed(e), form; diff --git a/lib/yui/build/moodle-core-formchangechecker/moodle-core-formchangechecker-debug.js b/lib/yui/build/moodle-core-formchangechecker/moodle-core-formchangechecker-debug.js index e9763ded56e..07db204da12 100644 --- a/lib/yui/build/moodle-core-formchangechecker/moodle-core-formchangechecker-debug.js +++ b/lib/yui/build/moodle-core-formchangechecker/moodle-core-formchangechecker-debug.js @@ -1,5 +1,18 @@ YUI.add('moodle-core-formchangechecker', function (Y, NAME) { +/** + * A utility to check for form changes before navigating away from a page. + * + * @module moodle-core-formchangechecker + */ + +/** + * A utility to check for form changes before navigating away from a page. + * + * @class M.core.formchangechecker + * @constructor + */ + var FORMCHANGECHECKERNAME = 'core-formchangechecker', FORMCHANGECHECKER = function() { @@ -12,8 +25,10 @@ Y.extend(FORMCHANGECHECKER, Y.Base, { initialvaluelisteners : [], /** - * Initialize the module - */ + * Initialize the module + * + * @method initializer + */ initializer : function() { var formid = 'form#' + this.get('formid'), currentform = Y.one(formid); @@ -42,12 +57,15 @@ Y.extend(FORMCHANGECHECKER, Y.Base, { }, /** - * Store the initial value of the currently focussed element - * - * If an element has been focussed and changed but not yet blurred, the on change - * event won't be fired. We need to store it's initial value to compare it in the - * get_form_dirty_state function later. - */ + * Store the initial value of the currently focussed element + * + * If an element has been focussed and changed but not yet blurred, the on change + * event won't be fired. We need to store it's initial value to compare it in the + * get_form_dirty_state function later. + * + * @method store_initial_value + * @param {EventFacade} e + */ store_initial_value : function(e) { var thisevent; if (e.target.hasClass('ignoredirty')) { @@ -95,9 +113,9 @@ M.core_formchangechecker.init = function(config) { // Store state information M.core_formchangechecker.stateinformation = []; -/** - * Set the form changed state to true - */ +/* + * Set the form changed state to true + */ M.core_formchangechecker.set_form_changed = function(e) { if (e && e.target && e.target.hasClass('ignoredirty')) { // Don't warn on elements with the ignoredirty class @@ -110,19 +128,19 @@ M.core_formchangechecker.set_form_changed = function(e) { delete M.core_formchangechecker.stateinformation.focused_element; }; -/** - * Set the form submitted state to true - */ +/* + * Set the form submitted state to true + */ M.core_formchangechecker.set_form_submitted = function() { M.core_formchangechecker.stateinformation.formsubmitted = 1; }; -/** - * Attempt to determine whether the form has been modified in any way and - * is thus 'dirty' - * - * @return Integer 1 is the form is dirty; 0 if not - */ +/* + * Attempt to determine whether the form has been modified in any way and + * is thus 'dirty' + * + * @return Integer 1 is the form is dirty; 0 if not + */ M.core_formchangechecker.get_form_dirty_state = function() { var state = M.core_formchangechecker.stateinformation, editor; @@ -160,9 +178,9 @@ M.core_formchangechecker.get_form_dirty_state = function() { return 0; }; -/** - * Return a suitable message if changes have been made to a form - */ +/* + * Return a suitable message if changes have been made to a form + */ M.core_formchangechecker.report_form_dirty_state = function(e) { if (!M.core_formchangechecker.get_form_dirty_state()) { // the form is not dirty, so don't display any message diff --git a/lib/yui/build/moodle-core-formchangechecker/moodle-core-formchangechecker.js b/lib/yui/build/moodle-core-formchangechecker/moodle-core-formchangechecker.js index e9763ded56e..07db204da12 100644 --- a/lib/yui/build/moodle-core-formchangechecker/moodle-core-formchangechecker.js +++ b/lib/yui/build/moodle-core-formchangechecker/moodle-core-formchangechecker.js @@ -1,5 +1,18 @@ YUI.add('moodle-core-formchangechecker', function (Y, NAME) { +/** + * A utility to check for form changes before navigating away from a page. + * + * @module moodle-core-formchangechecker + */ + +/** + * A utility to check for form changes before navigating away from a page. + * + * @class M.core.formchangechecker + * @constructor + */ + var FORMCHANGECHECKERNAME = 'core-formchangechecker', FORMCHANGECHECKER = function() { @@ -12,8 +25,10 @@ Y.extend(FORMCHANGECHECKER, Y.Base, { initialvaluelisteners : [], /** - * Initialize the module - */ + * Initialize the module + * + * @method initializer + */ initializer : function() { var formid = 'form#' + this.get('formid'), currentform = Y.one(formid); @@ -42,12 +57,15 @@ Y.extend(FORMCHANGECHECKER, Y.Base, { }, /** - * Store the initial value of the currently focussed element - * - * If an element has been focussed and changed but not yet blurred, the on change - * event won't be fired. We need to store it's initial value to compare it in the - * get_form_dirty_state function later. - */ + * Store the initial value of the currently focussed element + * + * If an element has been focussed and changed but not yet blurred, the on change + * event won't be fired. We need to store it's initial value to compare it in the + * get_form_dirty_state function later. + * + * @method store_initial_value + * @param {EventFacade} e + */ store_initial_value : function(e) { var thisevent; if (e.target.hasClass('ignoredirty')) { @@ -95,9 +113,9 @@ M.core_formchangechecker.init = function(config) { // Store state information M.core_formchangechecker.stateinformation = []; -/** - * Set the form changed state to true - */ +/* + * Set the form changed state to true + */ M.core_formchangechecker.set_form_changed = function(e) { if (e && e.target && e.target.hasClass('ignoredirty')) { // Don't warn on elements with the ignoredirty class @@ -110,19 +128,19 @@ M.core_formchangechecker.set_form_changed = function(e) { delete M.core_formchangechecker.stateinformation.focused_element; }; -/** - * Set the form submitted state to true - */ +/* + * Set the form submitted state to true + */ M.core_formchangechecker.set_form_submitted = function() { M.core_formchangechecker.stateinformation.formsubmitted = 1; }; -/** - * Attempt to determine whether the form has been modified in any way and - * is thus 'dirty' - * - * @return Integer 1 is the form is dirty; 0 if not - */ +/* + * Attempt to determine whether the form has been modified in any way and + * is thus 'dirty' + * + * @return Integer 1 is the form is dirty; 0 if not + */ M.core_formchangechecker.get_form_dirty_state = function() { var state = M.core_formchangechecker.stateinformation, editor; @@ -160,9 +178,9 @@ M.core_formchangechecker.get_form_dirty_state = function() { return 0; }; -/** - * Return a suitable message if changes have been made to a form - */ +/* + * Return a suitable message if changes have been made to a form + */ M.core_formchangechecker.report_form_dirty_state = function(e) { if (!M.core_formchangechecker.get_form_dirty_state()) { // the form is not dirty, so don't display any message diff --git a/lib/yui/build/moodle-core-maintenancemodetimer/moodle-core-maintenancemodetimer-debug.js b/lib/yui/build/moodle-core-maintenancemodetimer/moodle-core-maintenancemodetimer-debug.js index 3f968b266d8..a5367fadf4e 100644 --- a/lib/yui/build/moodle-core-maintenancemodetimer/moodle-core-maintenancemodetimer-debug.js +++ b/lib/yui/build/moodle-core-maintenancemodetimer/moodle-core-maintenancemodetimer-debug.js @@ -16,6 +16,7 @@ Y.extend(MAINTENANCEMODETIMER, Y.Base, { /** * Initialise timer if maintenancemode set. * + * @method initializer * @param config {Array} array with timeleftinsec set. */ initializer: function(config) { @@ -28,6 +29,8 @@ Y.extend(MAINTENANCEMODETIMER, Y.Base, { /** * Decrement time left and update display text. + * + * @method updatetimer */ updatetimer: function() { this.timeleftinsec -= 1; diff --git a/lib/yui/build/moodle-core-maintenancemodetimer/moodle-core-maintenancemodetimer.js b/lib/yui/build/moodle-core-maintenancemodetimer/moodle-core-maintenancemodetimer.js index 3f968b266d8..a5367fadf4e 100644 --- a/lib/yui/build/moodle-core-maintenancemodetimer/moodle-core-maintenancemodetimer.js +++ b/lib/yui/build/moodle-core-maintenancemodetimer/moodle-core-maintenancemodetimer.js @@ -16,6 +16,7 @@ Y.extend(MAINTENANCEMODETIMER, Y.Base, { /** * Initialise timer if maintenancemode set. * + * @method initializer * @param config {Array} array with timeleftinsec set. */ initializer: function(config) { @@ -28,6 +29,8 @@ Y.extend(MAINTENANCEMODETIMER, Y.Base, { /** * Decrement time left and update display text. + * + * @method updatetimer */ updatetimer: function() { this.timeleftinsec -= 1; diff --git a/lib/yui/build/moodle-core-notification-dialogue/moodle-core-notification-dialogue-debug.js b/lib/yui/build/moodle-core-notification-dialogue/moodle-core-notification-dialogue-debug.js index 94b88284cff..06a70d4fca8 100644 --- a/lib/yui/build/moodle-core-notification-dialogue/moodle-core-notification-dialogue-debug.js +++ b/lib/yui/build/moodle-core-notification-dialogue/moodle-core-notification-dialogue-debug.js @@ -49,7 +49,7 @@ var DIALOGUE_NAME = 'Moodle dialogue', * @param {Object} c Object literal specifying the dialogue configuration properties. * @constructor * @class M.core.dialogue - * @extends Y.Panel + * @extends Panel */ DIALOGUE = function(c) { var config = Y.clone(c); @@ -96,11 +96,11 @@ Y.extend(DIALOGUE, Y.Panel, { // Orientation change event listener. _orientationevent : null, _calculatedzindex : false, + /** * Initialise the dialogue. * * @method initializer - * @return void */ initializer : function() { var bb; @@ -149,8 +149,7 @@ Y.extend(DIALOGUE, Y.Panel, { * Either set the zindex to the supplied value, or set it to one more than the highest existing * dialog in the page. * - * @method visibilityChanged - * @return void + * @method applyZIndex */ applyZIndex : function() { var highestzindex = 1, @@ -182,8 +181,8 @@ Y.extend(DIALOGUE, Y.Panel, { * Finds the zIndex of the given node or its parent. * * @method findZIndex - * @param Node node - * @returns int Return either the zIndex of 0 if one was not found. + * @param {Node} node The Node to apply the zIndex to. + * @return {Number} Either the zIndex, or 0 if one was not found. */ findZIndex : function(node) { // In most cases the zindex is set on the parent of the dialog. @@ -198,7 +197,7 @@ Y.extend(DIALOGUE, Y.Panel, { * Event listener for the visibility changed event. * * @method visibilityChanged - * @return void + * @param {EventFacade} e */ visibilityChanged : function(e) { var titlebar, bb; @@ -240,7 +239,6 @@ Y.extend(DIALOGUE, Y.Panel, { * smaller than the responsive width - make the dialog fullscreen. * * @method makeResponsive - * @return void */ makeResponsive : function() { var bb = this.get('boundingBox'), @@ -275,7 +273,6 @@ Y.extend(DIALOGUE, Y.Panel, { * Center the dialog on the screen. * * @method centerDialogue - * @return void */ centerDialogue : function() { var bb = this.get('boundingBox'), @@ -299,24 +296,19 @@ Y.extend(DIALOGUE, Y.Panel, { } }, /** - * Return if this dialogue should be fullscreen or not. + * Return whether this dialogue should be fullscreen or not. + * * Responsive attribute must be true and we should not be in an iframe and the screen width should * be less than the responsive width. * * @method shouldResizeFullscreen - * @return Boolean + * @return {Boolean} */ shouldResizeFullscreen : function() { return (window === window.parent) && this.get('responsive') && Math.floor(Y.one(document.body).get('winWidth')) < this.get('responsiveWidth'); }, - /** - * Override the show method to set keyboard focus on the dialogue. - * - * @method show - * @return void - */ show : function() { var result = null, header = this.headerNode, @@ -373,12 +365,14 @@ Y.extend(DIALOGUE, Y.Panel, { } }, 'down:9', CAN_RECEIVE_FOCUS_SELECTOR, this); }, + /** * Trap the tab focus within the open modal. * - * @param string target the element target - * @param string direction tab key for forward and tab+shift for backward - * @returns bool + * @method trapFocus + * @param {string} target the element target + * @param {string} direction tab key for forward and tab+shift for backward + * @return {Boolean} The result of the focus action. */ trapFocus : function(target, direction) { var bb = this.get('boundingBox'), @@ -495,7 +489,7 @@ Y.extend(DIALOGUE, Y.Panel, { * The width that this dialogue should be resized to fullscreen. * * @attribute responsiveWidth - * @type Integer + * @type Number * @default 768 */ responsiveWidth : { @@ -579,7 +573,7 @@ Y.Base.modifyAttrs(DIALOGUE, { /** * Any additional classes to add to the boundingBox. * - * @attributes extraClasses + * @attribute extraClasses * @type Array * @default [] */ diff --git a/lib/yui/build/moodle-core-notification-dialogue/moodle-core-notification-dialogue.js b/lib/yui/build/moodle-core-notification-dialogue/moodle-core-notification-dialogue.js index a1329f049f1..929d091b3ee 100644 --- a/lib/yui/build/moodle-core-notification-dialogue/moodle-core-notification-dialogue.js +++ b/lib/yui/build/moodle-core-notification-dialogue/moodle-core-notification-dialogue.js @@ -49,7 +49,7 @@ var DIALOGUE_NAME = 'Moodle dialogue', * @param {Object} c Object literal specifying the dialogue configuration properties. * @constructor * @class M.core.dialogue - * @extends Y.Panel + * @extends Panel */ DIALOGUE = function(c) { var config = Y.clone(c); @@ -96,11 +96,11 @@ Y.extend(DIALOGUE, Y.Panel, { // Orientation change event listener. _orientationevent : null, _calculatedzindex : false, + /** * Initialise the dialogue. * * @method initializer - * @return void */ initializer : function() { var bb; @@ -149,8 +149,7 @@ Y.extend(DIALOGUE, Y.Panel, { * Either set the zindex to the supplied value, or set it to one more than the highest existing * dialog in the page. * - * @method visibilityChanged - * @return void + * @method applyZIndex */ applyZIndex : function() { var highestzindex = 1, @@ -182,8 +181,8 @@ Y.extend(DIALOGUE, Y.Panel, { * Finds the zIndex of the given node or its parent. * * @method findZIndex - * @param Node node - * @returns int Return either the zIndex of 0 if one was not found. + * @param {Node} node The Node to apply the zIndex to. + * @return {Number} Either the zIndex, or 0 if one was not found. */ findZIndex : function(node) { // In most cases the zindex is set on the parent of the dialog. @@ -198,7 +197,7 @@ Y.extend(DIALOGUE, Y.Panel, { * Event listener for the visibility changed event. * * @method visibilityChanged - * @return void + * @param {EventFacade} e */ visibilityChanged : function(e) { var titlebar, bb; @@ -240,7 +239,6 @@ Y.extend(DIALOGUE, Y.Panel, { * smaller than the responsive width - make the dialog fullscreen. * * @method makeResponsive - * @return void */ makeResponsive : function() { var bb = this.get('boundingBox'), @@ -275,7 +273,6 @@ Y.extend(DIALOGUE, Y.Panel, { * Center the dialog on the screen. * * @method centerDialogue - * @return void */ centerDialogue : function() { var bb = this.get('boundingBox'), @@ -299,24 +296,19 @@ Y.extend(DIALOGUE, Y.Panel, { } }, /** - * Return if this dialogue should be fullscreen or not. + * Return whether this dialogue should be fullscreen or not. + * * Responsive attribute must be true and we should not be in an iframe and the screen width should * be less than the responsive width. * * @method shouldResizeFullscreen - * @return Boolean + * @return {Boolean} */ shouldResizeFullscreen : function() { return (window === window.parent) && this.get('responsive') && Math.floor(Y.one(document.body).get('winWidth')) < this.get('responsiveWidth'); }, - /** - * Override the show method to set keyboard focus on the dialogue. - * - * @method show - * @return void - */ show : function() { var result = null, header = this.headerNode, @@ -373,12 +365,14 @@ Y.extend(DIALOGUE, Y.Panel, { } }, 'down:9', CAN_RECEIVE_FOCUS_SELECTOR, this); }, + /** * Trap the tab focus within the open modal. * - * @param string target the element target - * @param string direction tab key for forward and tab+shift for backward - * @returns bool + * @method trapFocus + * @param {string} target the element target + * @param {string} direction tab key for forward and tab+shift for backward + * @return {Boolean} The result of the focus action. */ trapFocus : function(target, direction) { var bb = this.get('boundingBox'), @@ -493,7 +487,7 @@ Y.extend(DIALOGUE, Y.Panel, { * The width that this dialogue should be resized to fullscreen. * * @attribute responsiveWidth - * @type Integer + * @type Number * @default 768 */ responsiveWidth : { @@ -577,7 +571,7 @@ Y.Base.modifyAttrs(DIALOGUE, { /** * Any additional classes to add to the boundingBox. * - * @attributes extraClasses + * @attribute extraClasses * @type Array * @default [] */ diff --git a/lib/yui/build/moodle-core-popuphelp/moodle-core-popuphelp-debug.js b/lib/yui/build/moodle-core-popuphelp/moodle-core-popuphelp-debug.js index acefacb1522..53688902437 100644 --- a/lib/yui/build/moodle-core-popuphelp/moodle-core-popuphelp-debug.js +++ b/lib/yui/build/moodle-core-popuphelp/moodle-core-popuphelp-debug.js @@ -1,5 +1,18 @@ YUI.add('moodle-core-popuphelp', function (Y, NAME) { +/** + * A popup help dialogue for Moodle. + * + * @module moodle-core-popuphelp + */ + +/** + * A popup help dialogue for Moodle. + * + * @class M.core.popuphelp + * @constructor + */ + function POPUPHELP() { POPUPHELP.superclass.constructor.apply(this, arguments); } @@ -22,10 +35,21 @@ POPUPHELP.ATTRS = ATTRS; Y.extend(POPUPHELP, Y.Base, { panel: null, + /** + * Setup the popuphelp. + * + * @method initializer + */ initializer: function() { Y.one('body').delegate('click', this.display_panel, SELECTORS.CLICKABLELINKS, this); }, + /** + * Display the help tooltip. + * + * @method display_panel + * @param {EventFacade} e + */ display_panel: function(e) { if (!this.panel) { this.panel = new M.core.tooltip({ @@ -41,10 +65,11 @@ Y.extend(POPUPHELP, Y.Base, { }, /** - * Override the footer handler to add a 'More help' link where relevant. - * - * @param {Object} helpobject The object returned from the AJAX call. - */ + * Override the footer handler to add a 'More help' link where relevant. + * + * @method set_footer + * @param {Object} helpobject The object returned from the AJAX call. + */ set_footer: function(helpobject) { // Check for an optional link to documentation on moodle.org. if (helpobject.doclink) { diff --git a/lib/yui/build/moodle-core-popuphelp/moodle-core-popuphelp.js b/lib/yui/build/moodle-core-popuphelp/moodle-core-popuphelp.js index acefacb1522..53688902437 100644 --- a/lib/yui/build/moodle-core-popuphelp/moodle-core-popuphelp.js +++ b/lib/yui/build/moodle-core-popuphelp/moodle-core-popuphelp.js @@ -1,5 +1,18 @@ YUI.add('moodle-core-popuphelp', function (Y, NAME) { +/** + * A popup help dialogue for Moodle. + * + * @module moodle-core-popuphelp + */ + +/** + * A popup help dialogue for Moodle. + * + * @class M.core.popuphelp + * @constructor + */ + function POPUPHELP() { POPUPHELP.superclass.constructor.apply(this, arguments); } @@ -22,10 +35,21 @@ POPUPHELP.ATTRS = ATTRS; Y.extend(POPUPHELP, Y.Base, { panel: null, + /** + * Setup the popuphelp. + * + * @method initializer + */ initializer: function() { Y.one('body').delegate('click', this.display_panel, SELECTORS.CLICKABLELINKS, this); }, + /** + * Display the help tooltip. + * + * @method display_panel + * @param {EventFacade} e + */ display_panel: function(e) { if (!this.panel) { this.panel = new M.core.tooltip({ @@ -41,10 +65,11 @@ Y.extend(POPUPHELP, Y.Base, { }, /** - * Override the footer handler to add a 'More help' link where relevant. - * - * @param {Object} helpobject The object returned from the AJAX call. - */ + * Override the footer handler to add a 'More help' link where relevant. + * + * @method set_footer + * @param {Object} helpobject The object returned from the AJAX call. + */ set_footer: function(helpobject) { // Check for an optional link to documentation on moodle.org. if (helpobject.doclink) { diff --git a/lib/yui/src/actionmenu/js/actionmenu.js b/lib/yui/src/actionmenu/js/actionmenu.js index 9e84085d7f3..d11ee862295 100644 --- a/lib/yui/src/actionmenu/js/actionmenu.js +++ b/lib/yui/src/actionmenu/js/actionmenu.js @@ -43,7 +43,7 @@ var BODY = Y.one(Y.config.doc.body), * @namespace M.core.actionmenu * @class ActionMenu * @constructor - * @extends Y.Base + * @extends Base */ ACTIONMENU = function() { ACTIONMENU.superclass.constructor.apply(this, arguments); @@ -68,6 +68,10 @@ ACTIONMENU.prototype = { /** * The node that owns the currently displayed menu. + * + * @property owner + * @type Node + * @default null */ owner : null, @@ -109,6 +113,7 @@ ACTIONMENU.prototype = { /** * Called during the initialisation process of the object. + * * @method initializer */ initializer : function() { @@ -129,8 +134,9 @@ ACTIONMENU.prototype = { /** * Enhances a menu adding aria attributes and flagging it as functional. * + * @method enhance * @param {Node} menu - * @returns {boolean} + * @return boolean */ enhance : function(menu) { var menucontent = menu.one(SELECTOR.MENUCONTENT), @@ -410,9 +416,11 @@ ACTIONMENU.prototype = { /** * Displays the menu with the given content and alignment. + * + * @method showMenu * @param {EventFacade} e * @param {Node} menu - * @returns {M.core.dialogue|dialogue} + * @return M.core.dialogue */ showMenu : function(e, menu) { Y.log('Displaying an action menu', 'debug', ACTIONMENU.NAME); @@ -563,32 +571,21 @@ Y.extend(ACTIONMENU, Y.Base, ACTIONMENU.prototype, { } }); -/** - * Core namespace. - * @static - * @class core - */ M.core = M.core || {}; - -/** - * Actionmenu namespace. - * @namespace M.core - * @class actionmenu - * @static - */ M.core.actionmenu = M.core.actionmenu || {}; /** * * @static - * @property instance + * @property M.core.actionmenu.instance * @type {ACTIONMENU} */ M.core.actionmenu.instance = null; /** * Init function - will only ever create one instance of the actionmenu class. - * @method init + * + * @method M.core.actionmenu.init * @static * @param {Object} params */ @@ -598,8 +595,10 @@ M.core.actionmenu.init = M.core.actionmenu.init || function(params) { /** * Registers a new DOM node with the action menu causing it to be enhanced if required. + * + * @method M.core.actionmenu.newDOMNode * @param node - * @returns {boolean} + * @return {boolean} */ M.core.actionmenu.newDOMNode = function(node) { if (M.core.actionmenu.instance === null) { diff --git a/lib/yui/src/blocks/js/blockregion.js b/lib/yui/src/blocks/js/blockregion.js index 07416e2aa33..cf981d2a276 100644 --- a/lib/yui/src/blocks/js/blockregion.js +++ b/lib/yui/src/blocks/js/blockregion.js @@ -12,7 +12,7 @@ * @namespace M.core.blockdraganddrop * @class BlockRegion * @constructor - * @extends Y.Base + * @extends Base */ var BLOCKREGION = function() { BLOCKREGION.superclass.constructor.apply(this, arguments); diff --git a/lib/yui/src/blocks/js/blocks.js b/lib/yui/src/blocks/js/blocks.js index d49f77e6083..da6e26d68e5 100644 --- a/lib/yui/src/blocks/js/blocks.js +++ b/lib/yui/src/blocks/js/blocks.js @@ -319,26 +319,14 @@ Y.extend(DRAGBLOCK, M.core.dragdrop, { } }); -/** - * Core namespace. - * @static - * @class core - */ M.core = M.core || {}; - -/** - * Block drag and drop static class. - * @namespace M.core - * @class blockdraganddrop - * @static - */ M.core.blockdraganddrop = M.core.blockdraganddrop || {}; /** * True if the page is using the new blocks methods. * @private * @static - * @property _isusingnewblocksmethod + * @property M.core.blockdraganddrop._isusingnewblocksmethod * @type Boolean * @default null */ @@ -347,7 +335,7 @@ M.core.blockdraganddrop._isusingnewblocksmethod = null; /** * Returns true if the page is using the new blocks methods. * @static - * @method is_using_blocks_render_method + * @method M.core.blockdraganddrop.is_using_blocks_render_method * @return Boolean */ M.core.blockdraganddrop.is_using_blocks_render_method = function() { @@ -363,7 +351,7 @@ M.core.blockdraganddrop.is_using_blocks_render_method = function() { * Initialises a drag and drop manager. * This should only ever be called once for a page. * @static - * @method init + * @method M.core.blockdraganddrop.init * @param {Object} params * @return Manager */ @@ -375,7 +363,7 @@ M.core.blockdraganddrop.init = function(params) { } }; -/** +/* * Legacy code to keep things working. */ M.core_blocks = M.core_blocks || {}; diff --git a/lib/yui/src/blocks/js/manager.js b/lib/yui/src/blocks/js/manager.js index 3179060be4a..50e02dadeaf 100644 --- a/lib/yui/src/blocks/js/manager.js +++ b/lib/yui/src/blocks/js/manager.js @@ -120,7 +120,7 @@ MANAGER.prototype = { * Returns the ID of the block the given node represents. * @method get_block_id * @param {Node} node - * @returns {int} The blocks ID in the database. + * @return {int} The blocks ID in the database. */ get_block_id : function(node) { return Number(node.get('id').replace(/inst/i, '')); @@ -130,7 +130,7 @@ MANAGER.prototype = { * Returns the block region that the node is part of or belonging to. * @method get_block_region * @param {Y.Node} node - * @returns {string} The region name. + * @return {string} The region name. */ get_block_region : function(node) { if (!node.test('[data-blockregion]')) { @@ -143,7 +143,7 @@ MANAGER.prototype = { * Returns the BLOCKREGION instance that represents the block region the given node is part of. * @method get_region_object * @param {Y.Node} node - * @returns {BLOCKREGION} + * @return {BLOCKREGION} */ get_region_object : function(node) { return this.regionobjects[this.get_block_region(node)]; @@ -152,7 +152,6 @@ MANAGER.prototype = { /** * Enables all fo the regions so that they are all visible while dragging is occuring. * @method enable_all_regions - * @returns {undefined} */ enable_all_regions : function() { var i = 0; @@ -164,7 +163,6 @@ MANAGER.prototype = { /** * Disables enabled regions if they contain no blocks. * @method disable_regions_if_required - * @returns {undefined} */ disable_regions_if_required : function() { var i = 0; @@ -177,7 +175,6 @@ MANAGER.prototype = { * Called by M.core.dragdrop.global_drag_start when dragging starts. * @method drag_start * @param {Event} e - * @returns {undefined} */ drag_start : function(e) { // Get our drag object @@ -199,7 +196,6 @@ MANAGER.prototype = { * Called by M.core.dragdrop.global_drop_over when something is dragged over a drop target. * @method drop_over * @param {Event} e - * @returns {undefined} */ drop_over : function(e) { // Get a reference to our drag and drop nodes @@ -216,7 +212,6 @@ MANAGER.prototype = { /** * Called by M.core.dragdrop.global_drop_end when a drop has been completed. * @method drop_end - * @returns {undefined} */ drop_end : function() { // Clear variables. @@ -229,7 +224,6 @@ MANAGER.prototype = { * Called by M.core.dragdrop.global_drag_dropmiss when something has been dropped on a node that isn't contained by a drop target. * @method drag_dropmiss * @param {Event} e - * @returns {undefined} */ drag_dropmiss : function(e) { // Missed the target, but we assume the user intended to drop it @@ -242,7 +236,6 @@ MANAGER.prototype = { * Called by M.core.dragdrop.global_drag_hit when something has been dropped on a drop target. * @method drop_hit * @param {Event} e - * @returns {undefined} */ drop_hit : function(e) { // Get a reference to our drag node diff --git a/lib/yui/src/chooserdialogue/js/chooserdialogue.js b/lib/yui/src/chooserdialogue/js/chooserdialogue.js index af2c1fd7eb1..700e140f1da 100644 --- a/lib/yui/src/chooserdialogue/js/chooserdialogue.js +++ b/lib/yui/src/chooserdialogue/js/chooserdialogue.js @@ -1,3 +1,15 @@ +/** + * A type of dialogue used as for choosing options. + * + * @module moodle-core-chooserdialogue + */ + +/** + * A type of dialogue used as for choosing options. + * + * @constructor + * @class M.core.chooserdialogue + */ var CHOOSERDIALOGUE = function() { CHOOSERDIALOGUE.superclass.constructor.apply(this, arguments); }; @@ -81,8 +93,8 @@ Y.extend(CHOOSERDIALOGUE, Y.Base, { /** * Display the module chooser * - * @param e Event Triggering Event - * @return void + * @method display_chooser + * @param {EventFacade} e Triggering Event */ display_chooser : function (e) { var bb, dialogue, thisevent; @@ -167,13 +179,13 @@ Y.extend(CHOOSERDIALOGUE, Y.Base, { }, /** - * Cancel any listen events in the listenevents queue - * - * Several locations add event handlers which should only be called before the form is submitted. This provides - * a way of cancelling those events. - * - * @return void - */ + * Cancel any listen events in the listenevents queue + * + * Several locations add event handlers which should only be called before the form is submitted. This provides + * a way of cancelling those events. + * + * @method cancel_listenevents + */ cancel_listenevents : function () { // Detach all listen events to prevent duplicate triggers var thisevent; @@ -189,8 +201,8 @@ Y.extend(CHOOSERDIALOGUE, Y.Base, { * This tries to set a sensible maximum and minimum to ensure that some options are always shown, and preferably * all, whilst fitting the box within the current viewport. * - * @param dialogue Y.Node The dialogue - * @return void + * @method center_dialogue + * @param Node {dialogue} Y.Node The dialogue */ center_dialogue : function(dialogue) { var bb = this.panel.get('boundingBox'), @@ -304,15 +316,47 @@ Y.extend(CHOOSERDIALOGUE, Y.Base, { { NAME : 'moodle-core-chooserdialogue', ATTRS : { + /** + * The minimum height (in pixels) before resizing is prevented and scroll + * locking disabled. + * + * @attribute minheight + * @type Number + * @default 300 + */ minheight : { value : 300 }, + + /** + * The base height?? + * + * @attribute baseheight + * @type Number + * @default 400 + */ baseheight: { value : 400 }, + + /** + * The maximum height (in pixels) at which we stop resizing. + * + * @attribute maxheight + * @type Number + * @default 300 + */ maxheight : { value : 660 }, + + /** + * The title of the close button. + * + * @attribute closeButtonTitle + * @type String + * @default 'Close' + */ closeButtonTitle : { validator : Y.Lang.isString, value : 'Close' diff --git a/lib/yui/src/dock/js/block.js b/lib/yui/src/dock/js/block.js index c70839aa320..c1acc0a768e 100644 --- a/lib/yui/src/dock/js/block.js +++ b/lib/yui/src/dock/js/block.js @@ -12,7 +12,7 @@ * @namespace M.core.dock * @class Block * @constructor - * @extends Y.Base + * @extends Base */ BLOCK = function() { BLOCK.superclass.constructor.apply(this, arguments); diff --git a/lib/yui/src/dock/js/dock.js b/lib/yui/src/dock/js/dock.js index 1b785363235..e76152c989e 100644 --- a/lib/yui/src/dock/js/dock.js +++ b/lib/yui/src/dock/js/dock.js @@ -35,22 +35,7 @@ var LOGNS = 'moodle-core-dock', BLOCK, DOCKEDITEM; -/** - * Core namespace. - * - * @static - * @namespace M - * @class core - */ M.core = M.core || {}; - -/** - * Dock namespace. - * - * @static - * @namespace M.core - * @class dock - */ M.core.dock = M.core.dock || {}; /** @@ -259,8 +244,8 @@ M.core.dock.notifyBlockChange = function(instanceid) { * @namespace M.core.dock * @class Dock * @constructor - * @extends Y.Base - * @uses Y.EventTarget + * @extends Base + * @uses EventTarget */ DOCK = function() { DOCK.superclass.constructor.apply(this, arguments); diff --git a/lib/yui/src/dock/js/dockeditem.js b/lib/yui/src/dock/js/dockeditem.js index 406f4e00333..dfa72115879 100644 --- a/lib/yui/src/dock/js/dockeditem.js +++ b/lib/yui/src/dock/js/dockeditem.js @@ -12,8 +12,8 @@ * @namespace M.core.dock * @class DockedItem * @constructor - * @extends Y.Base - * @uses Y.EventTarget + * @extends Base + * @uses EventTarget */ DOCKEDITEM = function() { DOCKEDITEM.superclass.constructor.apply(this, arguments); diff --git a/lib/yui/src/dock/js/loader.js b/lib/yui/src/dock/js/loader.js index 25b04bc2908..d967ace1a1e 100644 --- a/lib/yui/src/dock/js/loader.js +++ b/lib/yui/src/dock/js/loader.js @@ -1,28 +1,13 @@ var LOADERNAME = 'moodle-core-dock-loader'; -/** - * Core namespace. - * - * @static - * @namespace M - * @class core - */ M.core = M.core || {}; - -/** - * Dock namespace. - * - * @static - * @namespace M.core - * @class dock - */ M.core.dock = M.core.dock || {}; /** * Creates the move to dock icon for dockable blocks if it doesn't already exist. * * @static - * @method ensureMoveToIconExists + * @method M.core.dock.ensureMoveToIconExists * @param {Node} blocknode The Blocks node (.block[data-instanceid]) */ M.core.dock.ensureMoveToIconExists = function(blocknode) { diff --git a/lib/yui/src/dock/js/panel.js b/lib/yui/src/dock/js/panel.js index 1ccc6776b8e..fd50c44f18f 100644 --- a/lib/yui/src/dock/js/panel.js +++ b/lib/yui/src/dock/js/panel.js @@ -12,8 +12,8 @@ * @namespace M.core.dock * @class Panel * @constructor - * @extends Y.Base - * @uses Y.EventTarget + * @extends Base + * @uses EventTarget */ DOCKPANEL = function() { DOCKPANEL.superclass.constructor.apply(this, arguments); diff --git a/lib/yui/src/dock/js/tabheightmanager.js b/lib/yui/src/dock/js/tabheightmanager.js index 4fd5899f625..28aaff489eb 100644 --- a/lib/yui/src/dock/js/tabheightmanager.js +++ b/lib/yui/src/dock/js/tabheightmanager.js @@ -13,7 +13,7 @@ * @namespace M.core.dock * @class TabHeightManager * @constructor - * @extends Y.Base + * @extends Base */ TABHEIGHTMANAGER = function() { TABHEIGHTMANAGER.superclass.constructor.apply(this, arguments); diff --git a/lib/yui/src/formautosubmit/js/formautosubmit.js b/lib/yui/src/formautosubmit/js/formautosubmit.js index a7f1e27ffc0..3d362ae4f3d 100644 --- a/lib/yui/src/formautosubmit/js/formautosubmit.js +++ b/lib/yui/src/formautosubmit/js/formautosubmit.js @@ -14,9 +14,9 @@ FORMAUTOSUBMIT = function() { Y.extend(FORMAUTOSUBMIT, Y.Base, { - /** - * Initialize the module - */ + /* + * Initialize the module + */ initializer : function() { // Set up local variables var applyto, @@ -54,9 +54,9 @@ Y.extend(FORMAUTOSUBMIT, Y.Base, { } }, - /** - * Check whether the select element was changed - */ + /* + * Check whether the select element was changed + */ check_changed : function(e) { var select, nothing, @@ -86,9 +86,9 @@ Y.extend(FORMAUTOSUBMIT, Y.Base, { return false; }, - /** - * Process any changes - */ + /* + * Process any changes + */ process_changes : function(e) { var select = this.check_changed(e), form; diff --git a/lib/yui/src/formchangechecker/js/formchangechecker.js b/lib/yui/src/formchangechecker/js/formchangechecker.js index 0d2bd6393c6..4cf55a5d0ab 100644 --- a/lib/yui/src/formchangechecker/js/formchangechecker.js +++ b/lib/yui/src/formchangechecker/js/formchangechecker.js @@ -1,3 +1,16 @@ +/** + * A utility to check for form changes before navigating away from a page. + * + * @module moodle-core-formchangechecker + */ + +/** + * A utility to check for form changes before navigating away from a page. + * + * @class M.core.formchangechecker + * @constructor + */ + var FORMCHANGECHECKERNAME = 'core-formchangechecker', FORMCHANGECHECKER = function() { @@ -10,8 +23,10 @@ Y.extend(FORMCHANGECHECKER, Y.Base, { initialvaluelisteners : [], /** - * Initialize the module - */ + * Initialize the module + * + * @method initializer + */ initializer : function() { var formid = 'form#' + this.get('formid'), currentform = Y.one(formid); @@ -40,12 +55,15 @@ Y.extend(FORMCHANGECHECKER, Y.Base, { }, /** - * Store the initial value of the currently focussed element - * - * If an element has been focussed and changed but not yet blurred, the on change - * event won't be fired. We need to store it's initial value to compare it in the - * get_form_dirty_state function later. - */ + * Store the initial value of the currently focussed element + * + * If an element has been focussed and changed but not yet blurred, the on change + * event won't be fired. We need to store it's initial value to compare it in the + * get_form_dirty_state function later. + * + * @method store_initial_value + * @param {EventFacade} e + */ store_initial_value : function(e) { var thisevent; if (e.target.hasClass('ignoredirty')) { @@ -93,9 +111,9 @@ M.core_formchangechecker.init = function(config) { // Store state information M.core_formchangechecker.stateinformation = []; -/** - * Set the form changed state to true - */ +/* + * Set the form changed state to true + */ M.core_formchangechecker.set_form_changed = function(e) { if (e && e.target && e.target.hasClass('ignoredirty')) { // Don't warn on elements with the ignoredirty class @@ -108,19 +126,19 @@ M.core_formchangechecker.set_form_changed = function(e) { delete M.core_formchangechecker.stateinformation.focused_element; }; -/** - * Set the form submitted state to true - */ +/* + * Set the form submitted state to true + */ M.core_formchangechecker.set_form_submitted = function() { M.core_formchangechecker.stateinformation.formsubmitted = 1; }; -/** - * Attempt to determine whether the form has been modified in any way and - * is thus 'dirty' - * - * @return Integer 1 is the form is dirty; 0 if not - */ +/* + * Attempt to determine whether the form has been modified in any way and + * is thus 'dirty' + * + * @return Integer 1 is the form is dirty; 0 if not + */ M.core_formchangechecker.get_form_dirty_state = function() { var state = M.core_formchangechecker.stateinformation, editor; @@ -158,9 +176,9 @@ M.core_formchangechecker.get_form_dirty_state = function() { return 0; }; -/** - * Return a suitable message if changes have been made to a form - */ +/* + * Return a suitable message if changes have been made to a form + */ M.core_formchangechecker.report_form_dirty_state = function(e) { if (!M.core_formchangechecker.get_form_dirty_state()) { // the form is not dirty, so don't display any message diff --git a/lib/yui/src/maintenancemodetimer/js/maintenancemodetimer.js b/lib/yui/src/maintenancemodetimer/js/maintenancemodetimer.js index 7275d40ecb7..e8149c33ba9 100644 --- a/lib/yui/src/maintenancemodetimer/js/maintenancemodetimer.js +++ b/lib/yui/src/maintenancemodetimer/js/maintenancemodetimer.js @@ -14,6 +14,7 @@ Y.extend(MAINTENANCEMODETIMER, Y.Base, { /** * Initialise timer if maintenancemode set. * + * @method initializer * @param config {Array} array with timeleftinsec set. */ initializer: function(config) { @@ -26,6 +27,8 @@ Y.extend(MAINTENANCEMODETIMER, Y.Base, { /** * Decrement time left and update display text. + * + * @method updatetimer */ updatetimer: function() { this.timeleftinsec -= 1; diff --git a/lib/yui/src/notification/js/dialogue.js b/lib/yui/src/notification/js/dialogue.js index 22083c8cc60..1c29b4dd9da 100644 --- a/lib/yui/src/notification/js/dialogue.js +++ b/lib/yui/src/notification/js/dialogue.js @@ -20,7 +20,7 @@ var DIALOGUE_NAME = 'Moodle dialogue', * @param {Object} c Object literal specifying the dialogue configuration properties. * @constructor * @class M.core.dialogue - * @extends Y.Panel + * @extends Panel */ DIALOGUE = function(c) { var config = Y.clone(c); @@ -67,11 +67,11 @@ Y.extend(DIALOGUE, Y.Panel, { // Orientation change event listener. _orientationevent : null, _calculatedzindex : false, + /** * Initialise the dialogue. * * @method initializer - * @return void */ initializer : function() { var bb; @@ -120,8 +120,7 @@ Y.extend(DIALOGUE, Y.Panel, { * Either set the zindex to the supplied value, or set it to one more than the highest existing * dialog in the page. * - * @method visibilityChanged - * @return void + * @method applyZIndex */ applyZIndex : function() { var highestzindex = 1, @@ -153,8 +152,8 @@ Y.extend(DIALOGUE, Y.Panel, { * Finds the zIndex of the given node or its parent. * * @method findZIndex - * @param Node node - * @returns int Return either the zIndex of 0 if one was not found. + * @param {Node} node The Node to apply the zIndex to. + * @return {Number} Either the zIndex, or 0 if one was not found. */ findZIndex : function(node) { // In most cases the zindex is set on the parent of the dialog. @@ -169,7 +168,7 @@ Y.extend(DIALOGUE, Y.Panel, { * Event listener for the visibility changed event. * * @method visibilityChanged - * @return void + * @param {EventFacade} e */ visibilityChanged : function(e) { var titlebar, bb; @@ -211,7 +210,6 @@ Y.extend(DIALOGUE, Y.Panel, { * smaller than the responsive width - make the dialog fullscreen. * * @method makeResponsive - * @return void */ makeResponsive : function() { var bb = this.get('boundingBox'), @@ -246,7 +244,6 @@ Y.extend(DIALOGUE, Y.Panel, { * Center the dialog on the screen. * * @method centerDialogue - * @return void */ centerDialogue : function() { var bb = this.get('boundingBox'), @@ -270,24 +267,19 @@ Y.extend(DIALOGUE, Y.Panel, { } }, /** - * Return if this dialogue should be fullscreen or not. + * Return whether this dialogue should be fullscreen or not. + * * Responsive attribute must be true and we should not be in an iframe and the screen width should * be less than the responsive width. * * @method shouldResizeFullscreen - * @return Boolean + * @return {Boolean} */ shouldResizeFullscreen : function() { return (window === window.parent) && this.get('responsive') && Math.floor(Y.one(document.body).get('winWidth')) < this.get('responsiveWidth'); }, - /** - * Override the show method to set keyboard focus on the dialogue. - * - * @method show - * @return void - */ show : function() { var result = null, header = this.headerNode, @@ -344,12 +336,14 @@ Y.extend(DIALOGUE, Y.Panel, { } }, 'down:9', CAN_RECEIVE_FOCUS_SELECTOR, this); }, + /** * Trap the tab focus within the open modal. * - * @param string target the element target - * @param string direction tab key for forward and tab+shift for backward - * @returns bool + * @method trapFocus + * @param {string} target the element target + * @param {string} direction tab key for forward and tab+shift for backward + * @return {Boolean} The result of the focus action. */ trapFocus : function(target, direction) { var bb = this.get('boundingBox'), @@ -466,7 +460,7 @@ Y.extend(DIALOGUE, Y.Panel, { * The width that this dialogue should be resized to fullscreen. * * @attribute responsiveWidth - * @type Integer + * @type Number * @default 768 */ responsiveWidth : { @@ -550,7 +544,7 @@ Y.Base.modifyAttrs(DIALOGUE, { /** * Any additional classes to add to the boundingBox. * - * @attributes extraClasses + * @attribute extraClasses * @type Array * @default [] */ diff --git a/lib/yui/src/popuphelp/js/popuphelp.js b/lib/yui/src/popuphelp/js/popuphelp.js index 0be3efe3e7c..9247198c611 100644 --- a/lib/yui/src/popuphelp/js/popuphelp.js +++ b/lib/yui/src/popuphelp/js/popuphelp.js @@ -1,3 +1,16 @@ +/** + * A popup help dialogue for Moodle. + * + * @module moodle-core-popuphelp + */ + +/** + * A popup help dialogue for Moodle. + * + * @class M.core.popuphelp + * @constructor + */ + function POPUPHELP() { POPUPHELP.superclass.constructor.apply(this, arguments); } @@ -20,10 +33,21 @@ POPUPHELP.ATTRS = ATTRS; Y.extend(POPUPHELP, Y.Base, { panel: null, + /** + * Setup the popuphelp. + * + * @method initializer + */ initializer: function() { Y.one('body').delegate('click', this.display_panel, SELECTORS.CLICKABLELINKS, this); }, + /** + * Display the help tooltip. + * + * @method display_panel + * @param {EventFacade} e + */ display_panel: function(e) { if (!this.panel) { this.panel = new M.core.tooltip({ @@ -39,10 +63,11 @@ Y.extend(POPUPHELP, Y.Base, { }, /** - * Override the footer handler to add a 'More help' link where relevant. - * - * @param {Object} helpobject The object returned from the AJAX call. - */ + * Override the footer handler to add a 'More help' link where relevant. + * + * @method set_footer + * @param {Object} helpobject The object returned from the AJAX call. + */ set_footer: function(helpobject) { // Check for an optional link to documentation on moodle.org. if (helpobject.doclink) { diff --git a/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-debug.js b/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-debug.js index 7b06b6f34cf..fdfcc1093f8 100644 --- a/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-debug.js +++ b/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-debug.js @@ -92,17 +92,17 @@ var AJAXBASE = M.cfg.wwwroot + '/mod/assign/feedback/editpdf/ajax.php', // along with Moodle. If not, see . /** - * Class representing a 2d point. + * Provides an in browser PDF editor. * * @module moodle-assignfeedback_editpdf-editor */ /** - * POINT + * Class representing a 2d point. * * @namespace M.assignfeedback_editpdf - * @param int x - * @param int y + * @param Number x + * @param Number y * @class point */ POINT = function(x, y) { @@ -165,13 +165,13 @@ M.assignfeedback_editpdf.point = POINT; // along with Moodle. If not, see . /** - * Class representing a 2d rect. + * Provides an in browser PDF editor. * * @module moodle-assignfeedback_editpdf-editor */ /** - * RECT + * Class representing a 2d rect. * * @namespace M.assignfeedback_editpdf * @param int x @@ -308,7 +308,7 @@ M.assignfeedback_editpdf.rect = RECT; // along with Moodle. If not, see . /** - * Class representing a partially completed edit operation. + * Provides an in browser PDF editor. * * @module moodle-assignfeedback_editpdf-editor */ @@ -412,14 +412,13 @@ M.assignfeedback_editpdf.edit = EDIT; // along with Moodle. If not, see . /** - * Class representing a drawable thing which contains both - * Y.Nodes, and Y.Shapes. + * Provides an in browser PDF editor. * * @module moodle-assignfeedback_editpdf-editor */ /** - * DRAWABLE + * Class representing a drawable thing which contains both Y.Nodes, and Y.Shapes. * * @namespace M.assignfeedback_editpdf * @param M.assignfeedback_editpdf.editor editor @@ -489,10 +488,18 @@ M.assignfeedback_editpdf.drawable = DRAWABLE; // along with Moodle. If not, see . /** - * Class representing a list of annotations. + * Provides an in browser PDF editor. * * @module moodle-assignfeedback_editpdf-editor */ + +/** + * Class representing a highlight. + * + * @namespace M.assignfeedback_editpdf + * @class annotation + * @constructor + */ ANNOTATION = function(config) { ANNOTATION.superclass.constructor.apply(this, [config]); }; @@ -819,13 +826,18 @@ M.assignfeedback_editpdf.annotation = ANNOTATION; // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . +/** + * Provides an in browser PDF editor. + * + * @module moodle-assignfeedback_editpdf-editor + */ + /** * Class representing a line. * * @namespace M.assignfeedback_editpdf * @class annotationline - * @extends annotation - * @module moodle-assignfeedback_editpdf-editor + * @extends M.assignfeedback_editpdf.annotation */ ANNOTATIONLINE = function(config) { ANNOTATIONLINE.superclass.constructor.apply(this, [config]); @@ -934,13 +946,18 @@ M.assignfeedback_editpdf.annotationline = ANNOTATIONLINE; // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . +/** + * Provides an in browser PDF editor. + * + * @module moodle-assignfeedback_editpdf-editor + */ + /** * Class representing a rectangle. * * @namespace M.assignfeedback_editpdf * @class annotationrectangle - * @extends annotation - * @module moodle-assignfeedback_editpdf-editor + * @extends M.assignfeedback_editpdf.annotation */ ANNOTATIONRECTANGLE = function(config) { ANNOTATIONRECTANGLE.superclass.constructor.apply(this, [config]); @@ -1042,13 +1059,18 @@ M.assignfeedback_editpdf.annotationrectangle = ANNOTATIONRECTANGLE; // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . +/** + * Provides an in browser PDF editor. + * + * @module moodle-assignfeedback_editpdf-editor + */ + /** * Class representing a oval. * * @namespace M.assignfeedback_editpdf * @class annotationoval - * @extends annotation - * @module moodle-assignfeedback_editpdf-editor + * @extends M.assignfeedback_editpdf.annotation */ ANNOTATIONOVAL = function(config) { ANNOTATIONOVAL.superclass.constructor.apply(this, [config]); @@ -1150,13 +1172,18 @@ M.assignfeedback_editpdf.annotationoval = ANNOTATIONOVAL; // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . +/** + * Provides an in browser PDF editor. + * + * @module moodle-assignfeedback_editpdf-editor + */ + /** * Class representing a pen. * * @namespace M.assignfeedback_editpdf * @class annotationpen - * @extends annotation - * @module moodle-assignfeedback_editpdf-editor + * @extends M.assignfeedback_editpdf.annotation */ ANNOTATIONPEN = function(config) { ANNOTATIONPEN.superclass.constructor.apply(this, [config]); @@ -1305,12 +1332,18 @@ M.assignfeedback_editpdf.annotationpen = ANNOTATIONPEN; // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . +/** + * Provides an in browser PDF editor. + * + * @module moodle-assignfeedback_editpdf-editor + */ + /** * Class representing a highlight. * * @namespace M.assignfeedback_editpdf * @class annotationhighlight - * @extends annotation + * @extends M.assignfeedback_editpdf.annotation * @module moodle-assignfeedback_editpdf-editor */ ANNOTATIONHIGHLIGHT = function(config) { @@ -1452,13 +1485,18 @@ M.assignfeedback_editpdf.annotationhighlight = ANNOTATIONHIGHLIGHT; // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . +/** + * Provides an in browser PDF editor. + * + * @module moodle-assignfeedback_editpdf-editor + */ + /** * Class representing a stamp. * * @namespace M.assignfeedback_editpdf * @class annotationstamp - * @extends annotation - * @module moodle-assignfeedback_editpdf-editor + * @extends M.assignfeedback_editpdf.annotation */ ANNOTATIONSTAMP = function(config) { ANNOTATIONSTAMP.superclass.constructor.apply(this, [config]); @@ -1605,13 +1643,18 @@ var DROPDOWN_NAME = "Dropdown menu", DROPDOWN; /** - * DROPDOWN + * Provides an in browser PDF editor. + * + * @module moodle-assignfeedback_editpdf-editor + */ + +/** * This is a drop down list of buttons triggered (and aligned to) a button. * - * @namespace M.assignfeedback_editpdf.widget.dropdown + * @namespace M.assignfeedback_editpdf * @class dropdown * @constructor - * @extends Y.Base + * @extends M.core.dialogue */ DROPDOWN = function(config) { config.draggable = false; @@ -1722,14 +1765,20 @@ M.assignfeedback_editpdf.dropdown = DROPDOWN; var COLOURPICKER_NAME = "Colourpicker", COLOURPICKER; +/** + * Provides an in browser PDF editor. + * + * @module moodle-assignfeedback_editpdf-editor + */ + /** * COLOURPICKER * This is a drop down list of colours. * - * @namespace M.assignfeedback_editpdf.colourpicker - * @class dropdown + * @namespace M.assignfeedback_editpdf + * @class colourpicker * @constructor - * @extends Y.Base + * @extends M.assignfeedback_editpdf.dropdown */ COLOURPICKER = function(config) { COLOURPICKER.superclass.constructor.apply(this, [config]); @@ -1847,13 +1896,18 @@ var STAMPPICKER_NAME = "Colourpicker", STAMPPICKER; /** - * STAMPPICKER + * Provides an in browser PDF editor. + * + * @module moodle-assignfeedback_editpdf-editor + */ + +/** * This is a drop down list of stamps. * - * @namespace M.assignfeedback_editpdf.stamppicker - * @class dropdown + * @namespace M.assignfeedback_editpdf + * @class stamppicker * @constructor - * @extends Y.Base + * @extends M.assignfeedback_editpdf.dropdown */ STAMPPICKER = function(config) { STAMPPICKER.superclass.constructor.apply(this, [config]); @@ -1952,14 +2006,20 @@ M.assignfeedback_editpdf.stamppicker = STAMPPICKER; var COMMENTMENUNAME = "Commentmenu", COMMENTMENU; +/** + * Provides an in browser PDF editor. + * + * @module moodle-assignfeedback_editpdf-editor + */ + /** * COMMENTMENU * This is a drop down list of comment context functions. * - * @namespace M.assignfeedback_editpdf.editor + * @namespace M.assignfeedback_editpdf * @class commentmenu * @constructor - * @extends Y.Base + * @extends M.assignfeedback_editpdf.dropdown */ COMMENTMENU = function(config) { COMMENTMENU.superclass.constructor.apply(this, [config]); @@ -2068,13 +2128,18 @@ var COMMENTSEARCHNAME = "commentsearch", COMMENTSEARCH; /** - * COMMENTSEARCH + * Provides an in browser PDF editor. + * + * @module moodle-assignfeedback_editpdf-editor + */ + +/** * This is a searchable dialogue of comments. * - * @namespace M.assignfeedback_editpdf.editor + * @namespace M.assignfeedback_editpdf * @class commentsearch * @constructor - * @extends Y.Base + * @extends M.core.dialogue */ COMMENTSEARCH = function(config) { config.draggable = false; @@ -2249,13 +2314,13 @@ M.assignfeedback_editpdf.commentsearch = COMMENTSEARCH; // along with Moodle. If not, see . /** - * Class representing a list of comments. + * Provides an in browser PDF editor. * * @module moodle-assignfeedback_editpdf-editor */ /** - * COMMENT + * Class representing a list of comments. * * @namespace M.assignfeedback_editpdf * @class comment @@ -2690,13 +2755,13 @@ M.assignfeedback_editpdf.comment = COMMENT; // along with Moodle. If not, see . /** - * Class representing a users quick comment. + * Provides an in browser PDF editor. * * @module moodle-assignfeedback_editpdf-editor */ /** - * QUICKCOMMENT + * Class representing a users quick comment. * * @namespace M.assignfeedback_editpdf * @class quickcomment @@ -2754,13 +2819,13 @@ M.assignfeedback_editpdf.quickcomment = QUICKCOMMENT; // along with Moodle. If not, see . /** - * Class representing a users list of quick comments. + * Provides an in browser PDF editor. * * @module moodle-assignfeedback_editpdf-editor */ /** - * QUICKLIST + * Class representing a users list of quick comments. * * @namespace M.assignfeedback_editpdf * @class quickcommentlist @@ -2963,8 +3028,8 @@ M.assignfeedback_editpdf.quickcommentlist = QUICKCOMMENTLIST; * EDITOR * This is an in browser PDF editor. * - * @namespace M.assignfeedback_editpdf.editor - * @class Editor + * @namespace M.assignfeedback_editpdf + * @class editor * @constructor * @extends Y.Base */ @@ -2973,9 +3038,9 @@ EDITOR = function() { }; EDITOR.prototype = { - // Instance variables. /** * The dialogue used for all action menu displays. + * * @property type * @type M.core.dialogue * @protected @@ -2984,23 +3049,26 @@ EDITOR.prototype = { /** * The number of pages in the pdf. - * @property type - * @type int + * + * @property pagecount + * @type Number * @protected */ pagecount : 0, /** * The active page in the editor. - * @property type - * @type int + * + * @property currentpage + * @type Number * @protected */ currentpage : 0, /** * A list of page objects. Each page has a list of comments and annotations. - * @property type + * + * @property pages * @type array * @protected */ @@ -3008,15 +3076,17 @@ EDITOR.prototype = { /** * The yui node for the loading icon. - * @property type - * @type Y.Node + * + * @property loadingicon + * @type Node * @protected */ loadingicon : null, /** * Image object of the current page image. - * @property type + * + * @property pageimage * @type Image * @protected */ @@ -3024,14 +3094,16 @@ EDITOR.prototype = { /** * YUI Graphic class for drawing shapes. - * @property type - * @type Y.Graphic + * + * @property graphic + * @type Graphic * @protected */ graphic : null, /** * Info about the current edit operation. + * * @property currentedit * @type M.assignfeedback_editpdf.edit * @protected @@ -3040,14 +3112,16 @@ EDITOR.prototype = { /** * Current drawable. + * * @property currentdrawable - * @type M.assignfeedback_editpdf.drawable (or false) + * @type M.assignfeedback_editpdf.drawable|false * @protected */ currentdrawable : false, /** * Current drawables. + * * @property drawables * @type array(M.assignfeedback_editpdf.drawable) * @protected @@ -4020,24 +4094,12 @@ Y.extend(EDITOR, Y.Base, EDITOR.prototype, { } }); -/** - * Assignfeedback edit pdf namespace. - * @static - * @class assignfeedback_editpdf - */ M.assignfeedback_editpdf = M.assignfeedback_editpdf || {}; - -/** - * Editor namespace - * @namespace M.assignfeedback_editpdf.editor - * @class editor - * @static - */ M.assignfeedback_editpdf.editor = M.assignfeedback_editpdf.editor || {}; /** * Init function - will create a new instance every time. - * @method init + * @method editor.init * @static * @param {Object} params */ diff --git a/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor.js b/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor.js index 7b06b6f34cf..fdfcc1093f8 100644 --- a/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor.js +++ b/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor.js @@ -92,17 +92,17 @@ var AJAXBASE = M.cfg.wwwroot + '/mod/assign/feedback/editpdf/ajax.php', // along with Moodle. If not, see . /** - * Class representing a 2d point. + * Provides an in browser PDF editor. * * @module moodle-assignfeedback_editpdf-editor */ /** - * POINT + * Class representing a 2d point. * * @namespace M.assignfeedback_editpdf - * @param int x - * @param int y + * @param Number x + * @param Number y * @class point */ POINT = function(x, y) { @@ -165,13 +165,13 @@ M.assignfeedback_editpdf.point = POINT; // along with Moodle. If not, see . /** - * Class representing a 2d rect. + * Provides an in browser PDF editor. * * @module moodle-assignfeedback_editpdf-editor */ /** - * RECT + * Class representing a 2d rect. * * @namespace M.assignfeedback_editpdf * @param int x @@ -308,7 +308,7 @@ M.assignfeedback_editpdf.rect = RECT; // along with Moodle. If not, see . /** - * Class representing a partially completed edit operation. + * Provides an in browser PDF editor. * * @module moodle-assignfeedback_editpdf-editor */ @@ -412,14 +412,13 @@ M.assignfeedback_editpdf.edit = EDIT; // along with Moodle. If not, see . /** - * Class representing a drawable thing which contains both - * Y.Nodes, and Y.Shapes. + * Provides an in browser PDF editor. * * @module moodle-assignfeedback_editpdf-editor */ /** - * DRAWABLE + * Class representing a drawable thing which contains both Y.Nodes, and Y.Shapes. * * @namespace M.assignfeedback_editpdf * @param M.assignfeedback_editpdf.editor editor @@ -489,10 +488,18 @@ M.assignfeedback_editpdf.drawable = DRAWABLE; // along with Moodle. If not, see . /** - * Class representing a list of annotations. + * Provides an in browser PDF editor. * * @module moodle-assignfeedback_editpdf-editor */ + +/** + * Class representing a highlight. + * + * @namespace M.assignfeedback_editpdf + * @class annotation + * @constructor + */ ANNOTATION = function(config) { ANNOTATION.superclass.constructor.apply(this, [config]); }; @@ -819,13 +826,18 @@ M.assignfeedback_editpdf.annotation = ANNOTATION; // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . +/** + * Provides an in browser PDF editor. + * + * @module moodle-assignfeedback_editpdf-editor + */ + /** * Class representing a line. * * @namespace M.assignfeedback_editpdf * @class annotationline - * @extends annotation - * @module moodle-assignfeedback_editpdf-editor + * @extends M.assignfeedback_editpdf.annotation */ ANNOTATIONLINE = function(config) { ANNOTATIONLINE.superclass.constructor.apply(this, [config]); @@ -934,13 +946,18 @@ M.assignfeedback_editpdf.annotationline = ANNOTATIONLINE; // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . +/** + * Provides an in browser PDF editor. + * + * @module moodle-assignfeedback_editpdf-editor + */ + /** * Class representing a rectangle. * * @namespace M.assignfeedback_editpdf * @class annotationrectangle - * @extends annotation - * @module moodle-assignfeedback_editpdf-editor + * @extends M.assignfeedback_editpdf.annotation */ ANNOTATIONRECTANGLE = function(config) { ANNOTATIONRECTANGLE.superclass.constructor.apply(this, [config]); @@ -1042,13 +1059,18 @@ M.assignfeedback_editpdf.annotationrectangle = ANNOTATIONRECTANGLE; // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . +/** + * Provides an in browser PDF editor. + * + * @module moodle-assignfeedback_editpdf-editor + */ + /** * Class representing a oval. * * @namespace M.assignfeedback_editpdf * @class annotationoval - * @extends annotation - * @module moodle-assignfeedback_editpdf-editor + * @extends M.assignfeedback_editpdf.annotation */ ANNOTATIONOVAL = function(config) { ANNOTATIONOVAL.superclass.constructor.apply(this, [config]); @@ -1150,13 +1172,18 @@ M.assignfeedback_editpdf.annotationoval = ANNOTATIONOVAL; // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . +/** + * Provides an in browser PDF editor. + * + * @module moodle-assignfeedback_editpdf-editor + */ + /** * Class representing a pen. * * @namespace M.assignfeedback_editpdf * @class annotationpen - * @extends annotation - * @module moodle-assignfeedback_editpdf-editor + * @extends M.assignfeedback_editpdf.annotation */ ANNOTATIONPEN = function(config) { ANNOTATIONPEN.superclass.constructor.apply(this, [config]); @@ -1305,12 +1332,18 @@ M.assignfeedback_editpdf.annotationpen = ANNOTATIONPEN; // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . +/** + * Provides an in browser PDF editor. + * + * @module moodle-assignfeedback_editpdf-editor + */ + /** * Class representing a highlight. * * @namespace M.assignfeedback_editpdf * @class annotationhighlight - * @extends annotation + * @extends M.assignfeedback_editpdf.annotation * @module moodle-assignfeedback_editpdf-editor */ ANNOTATIONHIGHLIGHT = function(config) { @@ -1452,13 +1485,18 @@ M.assignfeedback_editpdf.annotationhighlight = ANNOTATIONHIGHLIGHT; // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . +/** + * Provides an in browser PDF editor. + * + * @module moodle-assignfeedback_editpdf-editor + */ + /** * Class representing a stamp. * * @namespace M.assignfeedback_editpdf * @class annotationstamp - * @extends annotation - * @module moodle-assignfeedback_editpdf-editor + * @extends M.assignfeedback_editpdf.annotation */ ANNOTATIONSTAMP = function(config) { ANNOTATIONSTAMP.superclass.constructor.apply(this, [config]); @@ -1605,13 +1643,18 @@ var DROPDOWN_NAME = "Dropdown menu", DROPDOWN; /** - * DROPDOWN + * Provides an in browser PDF editor. + * + * @module moodle-assignfeedback_editpdf-editor + */ + +/** * This is a drop down list of buttons triggered (and aligned to) a button. * - * @namespace M.assignfeedback_editpdf.widget.dropdown + * @namespace M.assignfeedback_editpdf * @class dropdown * @constructor - * @extends Y.Base + * @extends M.core.dialogue */ DROPDOWN = function(config) { config.draggable = false; @@ -1722,14 +1765,20 @@ M.assignfeedback_editpdf.dropdown = DROPDOWN; var COLOURPICKER_NAME = "Colourpicker", COLOURPICKER; +/** + * Provides an in browser PDF editor. + * + * @module moodle-assignfeedback_editpdf-editor + */ + /** * COLOURPICKER * This is a drop down list of colours. * - * @namespace M.assignfeedback_editpdf.colourpicker - * @class dropdown + * @namespace M.assignfeedback_editpdf + * @class colourpicker * @constructor - * @extends Y.Base + * @extends M.assignfeedback_editpdf.dropdown */ COLOURPICKER = function(config) { COLOURPICKER.superclass.constructor.apply(this, [config]); @@ -1847,13 +1896,18 @@ var STAMPPICKER_NAME = "Colourpicker", STAMPPICKER; /** - * STAMPPICKER + * Provides an in browser PDF editor. + * + * @module moodle-assignfeedback_editpdf-editor + */ + +/** * This is a drop down list of stamps. * - * @namespace M.assignfeedback_editpdf.stamppicker - * @class dropdown + * @namespace M.assignfeedback_editpdf + * @class stamppicker * @constructor - * @extends Y.Base + * @extends M.assignfeedback_editpdf.dropdown */ STAMPPICKER = function(config) { STAMPPICKER.superclass.constructor.apply(this, [config]); @@ -1952,14 +2006,20 @@ M.assignfeedback_editpdf.stamppicker = STAMPPICKER; var COMMENTMENUNAME = "Commentmenu", COMMENTMENU; +/** + * Provides an in browser PDF editor. + * + * @module moodle-assignfeedback_editpdf-editor + */ + /** * COMMENTMENU * This is a drop down list of comment context functions. * - * @namespace M.assignfeedback_editpdf.editor + * @namespace M.assignfeedback_editpdf * @class commentmenu * @constructor - * @extends Y.Base + * @extends M.assignfeedback_editpdf.dropdown */ COMMENTMENU = function(config) { COMMENTMENU.superclass.constructor.apply(this, [config]); @@ -2068,13 +2128,18 @@ var COMMENTSEARCHNAME = "commentsearch", COMMENTSEARCH; /** - * COMMENTSEARCH + * Provides an in browser PDF editor. + * + * @module moodle-assignfeedback_editpdf-editor + */ + +/** * This is a searchable dialogue of comments. * - * @namespace M.assignfeedback_editpdf.editor + * @namespace M.assignfeedback_editpdf * @class commentsearch * @constructor - * @extends Y.Base + * @extends M.core.dialogue */ COMMENTSEARCH = function(config) { config.draggable = false; @@ -2249,13 +2314,13 @@ M.assignfeedback_editpdf.commentsearch = COMMENTSEARCH; // along with Moodle. If not, see . /** - * Class representing a list of comments. + * Provides an in browser PDF editor. * * @module moodle-assignfeedback_editpdf-editor */ /** - * COMMENT + * Class representing a list of comments. * * @namespace M.assignfeedback_editpdf * @class comment @@ -2690,13 +2755,13 @@ M.assignfeedback_editpdf.comment = COMMENT; // along with Moodle. If not, see . /** - * Class representing a users quick comment. + * Provides an in browser PDF editor. * * @module moodle-assignfeedback_editpdf-editor */ /** - * QUICKCOMMENT + * Class representing a users quick comment. * * @namespace M.assignfeedback_editpdf * @class quickcomment @@ -2754,13 +2819,13 @@ M.assignfeedback_editpdf.quickcomment = QUICKCOMMENT; // along with Moodle. If not, see . /** - * Class representing a users list of quick comments. + * Provides an in browser PDF editor. * * @module moodle-assignfeedback_editpdf-editor */ /** - * QUICKLIST + * Class representing a users list of quick comments. * * @namespace M.assignfeedback_editpdf * @class quickcommentlist @@ -2963,8 +3028,8 @@ M.assignfeedback_editpdf.quickcommentlist = QUICKCOMMENTLIST; * EDITOR * This is an in browser PDF editor. * - * @namespace M.assignfeedback_editpdf.editor - * @class Editor + * @namespace M.assignfeedback_editpdf + * @class editor * @constructor * @extends Y.Base */ @@ -2973,9 +3038,9 @@ EDITOR = function() { }; EDITOR.prototype = { - // Instance variables. /** * The dialogue used for all action menu displays. + * * @property type * @type M.core.dialogue * @protected @@ -2984,23 +3049,26 @@ EDITOR.prototype = { /** * The number of pages in the pdf. - * @property type - * @type int + * + * @property pagecount + * @type Number * @protected */ pagecount : 0, /** * The active page in the editor. - * @property type - * @type int + * + * @property currentpage + * @type Number * @protected */ currentpage : 0, /** * A list of page objects. Each page has a list of comments and annotations. - * @property type + * + * @property pages * @type array * @protected */ @@ -3008,15 +3076,17 @@ EDITOR.prototype = { /** * The yui node for the loading icon. - * @property type - * @type Y.Node + * + * @property loadingicon + * @type Node * @protected */ loadingicon : null, /** * Image object of the current page image. - * @property type + * + * @property pageimage * @type Image * @protected */ @@ -3024,14 +3094,16 @@ EDITOR.prototype = { /** * YUI Graphic class for drawing shapes. - * @property type - * @type Y.Graphic + * + * @property graphic + * @type Graphic * @protected */ graphic : null, /** * Info about the current edit operation. + * * @property currentedit * @type M.assignfeedback_editpdf.edit * @protected @@ -3040,14 +3112,16 @@ EDITOR.prototype = { /** * Current drawable. + * * @property currentdrawable - * @type M.assignfeedback_editpdf.drawable (or false) + * @type M.assignfeedback_editpdf.drawable|false * @protected */ currentdrawable : false, /** * Current drawables. + * * @property drawables * @type array(M.assignfeedback_editpdf.drawable) * @protected @@ -4020,24 +4094,12 @@ Y.extend(EDITOR, Y.Base, EDITOR.prototype, { } }); -/** - * Assignfeedback edit pdf namespace. - * @static - * @class assignfeedback_editpdf - */ M.assignfeedback_editpdf = M.assignfeedback_editpdf || {}; - -/** - * Editor namespace - * @namespace M.assignfeedback_editpdf.editor - * @class editor - * @static - */ M.assignfeedback_editpdf.editor = M.assignfeedback_editpdf.editor || {}; /** * Init function - will create a new instance every time. - * @method init + * @method editor.init * @static * @param {Object} params */ diff --git a/mod/assign/feedback/editpdf/yui/src/editor/js/annotation.js b/mod/assign/feedback/editpdf/yui/src/editor/js/annotation.js index 1cf3ea87514..ed05e281173 100644 --- a/mod/assign/feedback/editpdf/yui/src/editor/js/annotation.js +++ b/mod/assign/feedback/editpdf/yui/src/editor/js/annotation.js @@ -14,10 +14,18 @@ // along with Moodle. If not, see . /** - * Class representing a list of annotations. + * Provides an in browser PDF editor. * * @module moodle-assignfeedback_editpdf-editor */ + +/** + * Class representing a highlight. + * + * @namespace M.assignfeedback_editpdf + * @class annotation + * @constructor + */ ANNOTATION = function(config) { ANNOTATION.superclass.constructor.apply(this, [config]); }; diff --git a/mod/assign/feedback/editpdf/yui/src/editor/js/annotationhighlight.js b/mod/assign/feedback/editpdf/yui/src/editor/js/annotationhighlight.js index 3a1ff60062f..136d8cbbc45 100644 --- a/mod/assign/feedback/editpdf/yui/src/editor/js/annotationhighlight.js +++ b/mod/assign/feedback/editpdf/yui/src/editor/js/annotationhighlight.js @@ -13,12 +13,18 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . +/** + * Provides an in browser PDF editor. + * + * @module moodle-assignfeedback_editpdf-editor + */ + /** * Class representing a highlight. * * @namespace M.assignfeedback_editpdf * @class annotationhighlight - * @extends annotation + * @extends M.assignfeedback_editpdf.annotation * @module moodle-assignfeedback_editpdf-editor */ ANNOTATIONHIGHLIGHT = function(config) { diff --git a/mod/assign/feedback/editpdf/yui/src/editor/js/annotationline.js b/mod/assign/feedback/editpdf/yui/src/editor/js/annotationline.js index fee2edfd2d2..653904062a1 100644 --- a/mod/assign/feedback/editpdf/yui/src/editor/js/annotationline.js +++ b/mod/assign/feedback/editpdf/yui/src/editor/js/annotationline.js @@ -13,13 +13,18 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . +/** + * Provides an in browser PDF editor. + * + * @module moodle-assignfeedback_editpdf-editor + */ + /** * Class representing a line. * * @namespace M.assignfeedback_editpdf * @class annotationline - * @extends annotation - * @module moodle-assignfeedback_editpdf-editor + * @extends M.assignfeedback_editpdf.annotation */ ANNOTATIONLINE = function(config) { ANNOTATIONLINE.superclass.constructor.apply(this, [config]); diff --git a/mod/assign/feedback/editpdf/yui/src/editor/js/annotationoval.js b/mod/assign/feedback/editpdf/yui/src/editor/js/annotationoval.js index d92ecf5ac80..8c394096a21 100644 --- a/mod/assign/feedback/editpdf/yui/src/editor/js/annotationoval.js +++ b/mod/assign/feedback/editpdf/yui/src/editor/js/annotationoval.js @@ -13,13 +13,18 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . +/** + * Provides an in browser PDF editor. + * + * @module moodle-assignfeedback_editpdf-editor + */ + /** * Class representing a oval. * * @namespace M.assignfeedback_editpdf * @class annotationoval - * @extends annotation - * @module moodle-assignfeedback_editpdf-editor + * @extends M.assignfeedback_editpdf.annotation */ ANNOTATIONOVAL = function(config) { ANNOTATIONOVAL.superclass.constructor.apply(this, [config]); diff --git a/mod/assign/feedback/editpdf/yui/src/editor/js/annotationpen.js b/mod/assign/feedback/editpdf/yui/src/editor/js/annotationpen.js index 9ff9afca454..96aa832ad1a 100644 --- a/mod/assign/feedback/editpdf/yui/src/editor/js/annotationpen.js +++ b/mod/assign/feedback/editpdf/yui/src/editor/js/annotationpen.js @@ -13,13 +13,18 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . +/** + * Provides an in browser PDF editor. + * + * @module moodle-assignfeedback_editpdf-editor + */ + /** * Class representing a pen. * * @namespace M.assignfeedback_editpdf * @class annotationpen - * @extends annotation - * @module moodle-assignfeedback_editpdf-editor + * @extends M.assignfeedback_editpdf.annotation */ ANNOTATIONPEN = function(config) { ANNOTATIONPEN.superclass.constructor.apply(this, [config]); diff --git a/mod/assign/feedback/editpdf/yui/src/editor/js/annotationrectangle.js b/mod/assign/feedback/editpdf/yui/src/editor/js/annotationrectangle.js index 66ecc43a719..c73201419ca 100644 --- a/mod/assign/feedback/editpdf/yui/src/editor/js/annotationrectangle.js +++ b/mod/assign/feedback/editpdf/yui/src/editor/js/annotationrectangle.js @@ -13,13 +13,18 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . +/** + * Provides an in browser PDF editor. + * + * @module moodle-assignfeedback_editpdf-editor + */ + /** * Class representing a rectangle. * * @namespace M.assignfeedback_editpdf * @class annotationrectangle - * @extends annotation - * @module moodle-assignfeedback_editpdf-editor + * @extends M.assignfeedback_editpdf.annotation */ ANNOTATIONRECTANGLE = function(config) { ANNOTATIONRECTANGLE.superclass.constructor.apply(this, [config]); diff --git a/mod/assign/feedback/editpdf/yui/src/editor/js/annotationstamp.js b/mod/assign/feedback/editpdf/yui/src/editor/js/annotationstamp.js index 45a6ff050d0..71db2f6b3c8 100644 --- a/mod/assign/feedback/editpdf/yui/src/editor/js/annotationstamp.js +++ b/mod/assign/feedback/editpdf/yui/src/editor/js/annotationstamp.js @@ -13,13 +13,18 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . +/** + * Provides an in browser PDF editor. + * + * @module moodle-assignfeedback_editpdf-editor + */ + /** * Class representing a stamp. * * @namespace M.assignfeedback_editpdf * @class annotationstamp - * @extends annotation - * @module moodle-assignfeedback_editpdf-editor + * @extends M.assignfeedback_editpdf.annotation */ ANNOTATIONSTAMP = function(config) { ANNOTATIONSTAMP.superclass.constructor.apply(this, [config]); diff --git a/mod/assign/feedback/editpdf/yui/src/editor/js/colourpicker.js b/mod/assign/feedback/editpdf/yui/src/editor/js/colourpicker.js index fcdaf7a2d38..919ac88e616 100644 --- a/mod/assign/feedback/editpdf/yui/src/editor/js/colourpicker.js +++ b/mod/assign/feedback/editpdf/yui/src/editor/js/colourpicker.js @@ -1,14 +1,20 @@ var COLOURPICKER_NAME = "Colourpicker", COLOURPICKER; +/** + * Provides an in browser PDF editor. + * + * @module moodle-assignfeedback_editpdf-editor + */ + /** * COLOURPICKER * This is a drop down list of colours. * - * @namespace M.assignfeedback_editpdf.colourpicker - * @class dropdown + * @namespace M.assignfeedback_editpdf + * @class colourpicker * @constructor - * @extends Y.Base + * @extends M.assignfeedback_editpdf.dropdown */ COLOURPICKER = function(config) { COLOURPICKER.superclass.constructor.apply(this, [config]); diff --git a/mod/assign/feedback/editpdf/yui/src/editor/js/comment.js b/mod/assign/feedback/editpdf/yui/src/editor/js/comment.js index fbe26eddc37..62bb2136eb6 100644 --- a/mod/assign/feedback/editpdf/yui/src/editor/js/comment.js +++ b/mod/assign/feedback/editpdf/yui/src/editor/js/comment.js @@ -14,13 +14,13 @@ // along with Moodle. If not, see . /** - * Class representing a list of comments. + * Provides an in browser PDF editor. * * @module moodle-assignfeedback_editpdf-editor */ /** - * COMMENT + * Class representing a list of comments. * * @namespace M.assignfeedback_editpdf * @class comment diff --git a/mod/assign/feedback/editpdf/yui/src/editor/js/commentmenu.js b/mod/assign/feedback/editpdf/yui/src/editor/js/commentmenu.js index 7d5e6f163a0..a07591c9171 100644 --- a/mod/assign/feedback/editpdf/yui/src/editor/js/commentmenu.js +++ b/mod/assign/feedback/editpdf/yui/src/editor/js/commentmenu.js @@ -1,14 +1,20 @@ var COMMENTMENUNAME = "Commentmenu", COMMENTMENU; +/** + * Provides an in browser PDF editor. + * + * @module moodle-assignfeedback_editpdf-editor + */ + /** * COMMENTMENU * This is a drop down list of comment context functions. * - * @namespace M.assignfeedback_editpdf.editor + * @namespace M.assignfeedback_editpdf * @class commentmenu * @constructor - * @extends Y.Base + * @extends M.assignfeedback_editpdf.dropdown */ COMMENTMENU = function(config) { COMMENTMENU.superclass.constructor.apply(this, [config]); diff --git a/mod/assign/feedback/editpdf/yui/src/editor/js/commentsearch.js b/mod/assign/feedback/editpdf/yui/src/editor/js/commentsearch.js index e72fa22dc99..0dece815cf4 100644 --- a/mod/assign/feedback/editpdf/yui/src/editor/js/commentsearch.js +++ b/mod/assign/feedback/editpdf/yui/src/editor/js/commentsearch.js @@ -2,13 +2,18 @@ var COMMENTSEARCHNAME = "commentsearch", COMMENTSEARCH; /** - * COMMENTSEARCH + * Provides an in browser PDF editor. + * + * @module moodle-assignfeedback_editpdf-editor + */ + +/** * This is a searchable dialogue of comments. * - * @namespace M.assignfeedback_editpdf.editor + * @namespace M.assignfeedback_editpdf * @class commentsearch * @constructor - * @extends Y.Base + * @extends M.core.dialogue */ COMMENTSEARCH = function(config) { config.draggable = false; diff --git a/mod/assign/feedback/editpdf/yui/src/editor/js/drawable.js b/mod/assign/feedback/editpdf/yui/src/editor/js/drawable.js index 81a3140c5df..9f627f8c8f7 100644 --- a/mod/assign/feedback/editpdf/yui/src/editor/js/drawable.js +++ b/mod/assign/feedback/editpdf/yui/src/editor/js/drawable.js @@ -14,14 +14,13 @@ // along with Moodle. If not, see . /** - * Class representing a drawable thing which contains both - * Y.Nodes, and Y.Shapes. + * Provides an in browser PDF editor. * * @module moodle-assignfeedback_editpdf-editor */ /** - * DRAWABLE + * Class representing a drawable thing which contains both Y.Nodes, and Y.Shapes. * * @namespace M.assignfeedback_editpdf * @param M.assignfeedback_editpdf.editor editor diff --git a/mod/assign/feedback/editpdf/yui/src/editor/js/dropdown.js b/mod/assign/feedback/editpdf/yui/src/editor/js/dropdown.js index dc941ccad28..d566c8cd142 100644 --- a/mod/assign/feedback/editpdf/yui/src/editor/js/dropdown.js +++ b/mod/assign/feedback/editpdf/yui/src/editor/js/dropdown.js @@ -2,13 +2,18 @@ var DROPDOWN_NAME = "Dropdown menu", DROPDOWN; /** - * DROPDOWN + * Provides an in browser PDF editor. + * + * @module moodle-assignfeedback_editpdf-editor + */ + +/** * This is a drop down list of buttons triggered (and aligned to) a button. * - * @namespace M.assignfeedback_editpdf.widget.dropdown + * @namespace M.assignfeedback_editpdf * @class dropdown * @constructor - * @extends Y.Base + * @extends M.core.dialogue */ DROPDOWN = function(config) { config.draggable = false; diff --git a/mod/assign/feedback/editpdf/yui/src/editor/js/edit.js b/mod/assign/feedback/editpdf/yui/src/editor/js/edit.js index 8b97c506854..2e4f88e11a5 100644 --- a/mod/assign/feedback/editpdf/yui/src/editor/js/edit.js +++ b/mod/assign/feedback/editpdf/yui/src/editor/js/edit.js @@ -14,7 +14,7 @@ // along with Moodle. If not, see . /** - * Class representing a partially completed edit operation. + * Provides an in browser PDF editor. * * @module moodle-assignfeedback_editpdf-editor */ diff --git a/mod/assign/feedback/editpdf/yui/src/editor/js/editor.js b/mod/assign/feedback/editpdf/yui/src/editor/js/editor.js index 5d1070151b1..67f7af2ebb3 100644 --- a/mod/assign/feedback/editpdf/yui/src/editor/js/editor.js +++ b/mod/assign/feedback/editpdf/yui/src/editor/js/editor.js @@ -23,8 +23,8 @@ * EDITOR * This is an in browser PDF editor. * - * @namespace M.assignfeedback_editpdf.editor - * @class Editor + * @namespace M.assignfeedback_editpdf + * @class editor * @constructor * @extends Y.Base */ @@ -33,9 +33,9 @@ EDITOR = function() { }; EDITOR.prototype = { - // Instance variables. /** * The dialogue used for all action menu displays. + * * @property type * @type M.core.dialogue * @protected @@ -44,23 +44,26 @@ EDITOR.prototype = { /** * The number of pages in the pdf. - * @property type - * @type int + * + * @property pagecount + * @type Number * @protected */ pagecount : 0, /** * The active page in the editor. - * @property type - * @type int + * + * @property currentpage + * @type Number * @protected */ currentpage : 0, /** * A list of page objects. Each page has a list of comments and annotations. - * @property type + * + * @property pages * @type array * @protected */ @@ -68,15 +71,17 @@ EDITOR.prototype = { /** * The yui node for the loading icon. - * @property type - * @type Y.Node + * + * @property loadingicon + * @type Node * @protected */ loadingicon : null, /** * Image object of the current page image. - * @property type + * + * @property pageimage * @type Image * @protected */ @@ -84,14 +89,16 @@ EDITOR.prototype = { /** * YUI Graphic class for drawing shapes. - * @property type - * @type Y.Graphic + * + * @property graphic + * @type Graphic * @protected */ graphic : null, /** * Info about the current edit operation. + * * @property currentedit * @type M.assignfeedback_editpdf.edit * @protected @@ -100,14 +107,16 @@ EDITOR.prototype = { /** * Current drawable. + * * @property currentdrawable - * @type M.assignfeedback_editpdf.drawable (or false) + * @type M.assignfeedback_editpdf.drawable|false * @protected */ currentdrawable : false, /** * Current drawables. + * * @property drawables * @type array(M.assignfeedback_editpdf.drawable) * @protected @@ -1080,24 +1089,12 @@ Y.extend(EDITOR, Y.Base, EDITOR.prototype, { } }); -/** - * Assignfeedback edit pdf namespace. - * @static - * @class assignfeedback_editpdf - */ M.assignfeedback_editpdf = M.assignfeedback_editpdf || {}; - -/** - * Editor namespace - * @namespace M.assignfeedback_editpdf.editor - * @class editor - * @static - */ M.assignfeedback_editpdf.editor = M.assignfeedback_editpdf.editor || {}; /** * Init function - will create a new instance every time. - * @method init + * @method editor.init * @static * @param {Object} params */ diff --git a/mod/assign/feedback/editpdf/yui/src/editor/js/point.js b/mod/assign/feedback/editpdf/yui/src/editor/js/point.js index 2c2be8e49d8..ce4cd403b37 100644 --- a/mod/assign/feedback/editpdf/yui/src/editor/js/point.js +++ b/mod/assign/feedback/editpdf/yui/src/editor/js/point.js @@ -14,17 +14,17 @@ // along with Moodle. If not, see . /** - * Class representing a 2d point. + * Provides an in browser PDF editor. * * @module moodle-assignfeedback_editpdf-editor */ /** - * POINT + * Class representing a 2d point. * * @namespace M.assignfeedback_editpdf - * @param int x - * @param int y + * @param Number x + * @param Number y * @class point */ POINT = function(x, y) { diff --git a/mod/assign/feedback/editpdf/yui/src/editor/js/quickcomment.js b/mod/assign/feedback/editpdf/yui/src/editor/js/quickcomment.js index a59f813af46..74951419fb7 100644 --- a/mod/assign/feedback/editpdf/yui/src/editor/js/quickcomment.js +++ b/mod/assign/feedback/editpdf/yui/src/editor/js/quickcomment.js @@ -14,13 +14,13 @@ // along with Moodle. If not, see . /** - * Class representing a users quick comment. + * Provides an in browser PDF editor. * * @module moodle-assignfeedback_editpdf-editor */ /** - * QUICKCOMMENT + * Class representing a users quick comment. * * @namespace M.assignfeedback_editpdf * @class quickcomment diff --git a/mod/assign/feedback/editpdf/yui/src/editor/js/quickcommentlist.js b/mod/assign/feedback/editpdf/yui/src/editor/js/quickcommentlist.js index 8cd88f5faa8..548f67bb519 100644 --- a/mod/assign/feedback/editpdf/yui/src/editor/js/quickcommentlist.js +++ b/mod/assign/feedback/editpdf/yui/src/editor/js/quickcommentlist.js @@ -14,13 +14,13 @@ // along with Moodle. If not, see . /** - * Class representing a users list of quick comments. + * Provides an in browser PDF editor. * * @module moodle-assignfeedback_editpdf-editor */ /** - * QUICKLIST + * Class representing a users list of quick comments. * * @namespace M.assignfeedback_editpdf * @class quickcommentlist diff --git a/mod/assign/feedback/editpdf/yui/src/editor/js/rect.js b/mod/assign/feedback/editpdf/yui/src/editor/js/rect.js index 81e3a14a970..01ec89b11c1 100644 --- a/mod/assign/feedback/editpdf/yui/src/editor/js/rect.js +++ b/mod/assign/feedback/editpdf/yui/src/editor/js/rect.js @@ -14,13 +14,13 @@ // along with Moodle. If not, see . /** - * Class representing a 2d rect. + * Provides an in browser PDF editor. * * @module moodle-assignfeedback_editpdf-editor */ /** - * RECT + * Class representing a 2d rect. * * @namespace M.assignfeedback_editpdf * @param int x diff --git a/mod/assign/feedback/editpdf/yui/src/editor/js/stamppicker.js b/mod/assign/feedback/editpdf/yui/src/editor/js/stamppicker.js index 63c1c18e896..efc76d12062 100644 --- a/mod/assign/feedback/editpdf/yui/src/editor/js/stamppicker.js +++ b/mod/assign/feedback/editpdf/yui/src/editor/js/stamppicker.js @@ -2,13 +2,18 @@ var STAMPPICKER_NAME = "Colourpicker", STAMPPICKER; /** - * STAMPPICKER + * Provides an in browser PDF editor. + * + * @module moodle-assignfeedback_editpdf-editor + */ + +/** * This is a drop down list of stamps. * - * @namespace M.assignfeedback_editpdf.stamppicker - * @class dropdown + * @namespace M.assignfeedback_editpdf + * @class stamppicker * @constructor - * @extends Y.Base + * @extends M.assignfeedback_editpdf.dropdown */ STAMPPICKER = function(config) { STAMPPICKER.superclass.constructor.apply(this, [config]); diff --git a/mod/quiz/yui/build/moodle-mod_quiz-autosave/moodle-mod_quiz-autosave-debug.js b/mod/quiz/yui/build/moodle-mod_quiz-autosave/moodle-mod_quiz-autosave-debug.js index 30353d3b31a..eb8240da7ee 100644 --- a/mod/quiz/yui/build/moodle-mod_quiz-autosave/moodle-mod_quiz-autosave-debug.js +++ b/mod/quiz/yui/build/moodle-mod_quiz-autosave/moodle-mod_quiz-autosave-debug.js @@ -19,21 +19,76 @@ YUI.add('moodle-mod_quiz-autosave', function (Y, NAME) { /** * Auto-save functionality for during quiz attempts. * - * @package mod_quiz - * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com} - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @module moodle-mod_quiz-autosave + */ + +/** + * Auto-save functionality for during quiz attempts. + * + * @class M.mod_quiz.autosave */ M.mod_quiz = M.mod_quiz || {}; M.mod_quiz.autosave = { - /** Delays and repeat counts. */ + /** + * The amount of time (in milliseconds) to wait between TinyMCE detections. + * + * @property TINYMCE_DETECTION_DELAY + * @type Number + * @default 500 + * @private + */ TINYMCE_DETECTION_DELAY: 500, + + /** + * The number of times to try redetecting TinyMCE. + * + * @property TINYMCE_DETECTION_REPEATS + * @type Number + * @default 20 + * @private + */ TINYMCE_DETECTION_REPEATS: 20, + + /** + * The delay (in milliseconds) between checking hidden input fields. + * + * @property WATCH_HIDDEN_DELAY + * @type Number + * @default 1000 + * @private + */ WATCH_HIDDEN_DELAY: 1000, + + /** + * The number of failures to ignore before notifying the user. + * + * @property FAILURES_BEFORE_NOTIFY + * @type Number + * @default 1 + * @private + */ FAILURES_BEFORE_NOTIFY: 1, + + /** + * The value to use when resetting the successful save counter. + * + * @property FIRST_SUCCESSFUL_SAVE + * @static + * @type Number + * @default -1 + * @private + */ FIRST_SUCCESSFUL_SAVE: -1, - /** Selectors. */ + /** + * The selectors used throughout this class. + * + * @property SELECTORS + * @private + * @type Object + * @static + */ SELECTORS: { QUIZ_FORM: '#responseform', VALUE_CHANGE_ELEMENTS: 'input, textarea', @@ -43,36 +98,97 @@ M.mod_quiz.autosave = { CONNECTION_OK: '#connection-ok' }, - /** Script that handles the auto-saves. */ + /** + * The script which handles the autosaves. + * + * @property AUTOSAVE_HANDLER + * @type String + * @default M.cfg.wwwroot + '/mod/quiz/autosave.ajax.php' + * @private + */ AUTOSAVE_HANDLER: M.cfg.wwwroot + '/mod/quiz/autosave.ajax.php', - /** The delay between a change being made, and it being auto-saved. */ + /** + * The delay (in milliseconds) between a change being made, and it being auto-saved. + * + * @property delay + * @type Number + * @default 120000 + * @private + */ delay: 120000, - /** The form we are monitoring. */ + /** + * A Node reference to the form we are monitoring. + * + * @property form + * @type Node + * @default null + */ form: null, - /** Whether the form has been modified since the last save started. */ + /** + * Whether the form has been modified since the last save started. + * + * @property dirty + * @type boolean + * @default false + */ dirty: false, - /** Timer object for the delay between form modifaction and the save starting. */ + /** + * Timer object for the delay between form modifaction and the save starting. + * + * @property delay_timer + * @type Object + * @default null + * @private + */ delay_timer: null, - /** Y.io transaction for the save ajax request. */ + /** + * Y.io transaction for the save ajax request. + * + * @property save_transaction + * @type object + * @default null + */ save_transaction: null, - /** @property Failed saves count. */ + /** + * Failed saves count. + * + * @property savefailures + * @type Number + * @default 0 + * @private + */ savefailures: 0, - /** Properly bound key change handler. */ + /** + * Properly bound key change handler. + * + * @property editor_change_handler + * @type EventHandle + * @default null + * @private + */ editor_change_handler: null, - /** Record of the value of all the hidden fields, last time they were checked. */ + /** + * Record of the value of all the hidden fields, last time they were checked. + * + * @property hidden_field_values + * @type Object + * @default {} + */ hidden_field_values: {}, /** * Initialise the autosave code. - * @param delay the delay, in seconds, between a change being detected, and + * + * @method init + * @param {Number} delay the delay, in seconds, between a change being detected, and * a save happening. */ init: function(delay) { @@ -124,9 +240,16 @@ M.mod_quiz.autosave = { }, /** - * @param repeatcount Because TinyMCE might load slowly, after us, we need - * to keep trying every 10 seconds or so, until we detect TinyMCE is there, - * or enough time has passed. + * Initialise watching of TinyMCE specifically. + * + * Because TinyMCE might load slowly, and after us, we need to keep + * trying, until we detect TinyMCE is there, or enough time has passed. + * This is based on the TINYMCE_DETECTION_DELAY and + * TINYMCE_DETECTION_REPEATS properties. + * + * + * @method init_tinymce + * @param {Number} repeatcount The number of attempts made so far. */ init_tinymce: function(repeatcount) { if (typeof tinyMCE === 'undefined') { @@ -144,11 +267,13 @@ M.mod_quiz.autosave = { }, /** - * @param repeatcount Because TinyMCE might load slowly, after us, we need - * to keep trying every 10 seconds or so, until we detect TinyMCE is there, - * or enough time has passed. + * Initialise watching of a specific TinyMCE editor. + * + * @method init_tinymce_editor + * @param {EventFacade} e + * @param {Object} editor The TinyMCE editor object */ - init_tinymce_editor: function(notused, editor) { + init_tinymce_editor: function(e, editor) { Y.log('Found TinyMCE editor ' + editor.id + '.'); editor.onChange.add(this.editor_change_handler); editor.onRedo.add(this.editor_change_handler); diff --git a/mod/quiz/yui/build/moodle-mod_quiz-autosave/moodle-mod_quiz-autosave.js b/mod/quiz/yui/build/moodle-mod_quiz-autosave/moodle-mod_quiz-autosave.js index 55e11e9ce0b..75a3a4fadce 100644 --- a/mod/quiz/yui/build/moodle-mod_quiz-autosave/moodle-mod_quiz-autosave.js +++ b/mod/quiz/yui/build/moodle-mod_quiz-autosave/moodle-mod_quiz-autosave.js @@ -19,21 +19,76 @@ YUI.add('moodle-mod_quiz-autosave', function (Y, NAME) { /** * Auto-save functionality for during quiz attempts. * - * @package mod_quiz - * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com} - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @module moodle-mod_quiz-autosave + */ + +/** + * Auto-save functionality for during quiz attempts. + * + * @class M.mod_quiz.autosave */ M.mod_quiz = M.mod_quiz || {}; M.mod_quiz.autosave = { - /** Delays and repeat counts. */ + /** + * The amount of time (in milliseconds) to wait between TinyMCE detections. + * + * @property TINYMCE_DETECTION_DELAY + * @type Number + * @default 500 + * @private + */ TINYMCE_DETECTION_DELAY: 500, + + /** + * The number of times to try redetecting TinyMCE. + * + * @property TINYMCE_DETECTION_REPEATS + * @type Number + * @default 20 + * @private + */ TINYMCE_DETECTION_REPEATS: 20, + + /** + * The delay (in milliseconds) between checking hidden input fields. + * + * @property WATCH_HIDDEN_DELAY + * @type Number + * @default 1000 + * @private + */ WATCH_HIDDEN_DELAY: 1000, + + /** + * The number of failures to ignore before notifying the user. + * + * @property FAILURES_BEFORE_NOTIFY + * @type Number + * @default 1 + * @private + */ FAILURES_BEFORE_NOTIFY: 1, + + /** + * The value to use when resetting the successful save counter. + * + * @property FIRST_SUCCESSFUL_SAVE + * @static + * @type Number + * @default -1 + * @private + */ FIRST_SUCCESSFUL_SAVE: -1, - /** Selectors. */ + /** + * The selectors used throughout this class. + * + * @property SELECTORS + * @private + * @type Object + * @static + */ SELECTORS: { QUIZ_FORM: '#responseform', VALUE_CHANGE_ELEMENTS: 'input, textarea', @@ -43,36 +98,97 @@ M.mod_quiz.autosave = { CONNECTION_OK: '#connection-ok' }, - /** Script that handles the auto-saves. */ + /** + * The script which handles the autosaves. + * + * @property AUTOSAVE_HANDLER + * @type String + * @default M.cfg.wwwroot + '/mod/quiz/autosave.ajax.php' + * @private + */ AUTOSAVE_HANDLER: M.cfg.wwwroot + '/mod/quiz/autosave.ajax.php', - /** The delay between a change being made, and it being auto-saved. */ + /** + * The delay (in milliseconds) between a change being made, and it being auto-saved. + * + * @property delay + * @type Number + * @default 120000 + * @private + */ delay: 120000, - /** The form we are monitoring. */ + /** + * A Node reference to the form we are monitoring. + * + * @property form + * @type Node + * @default null + */ form: null, - /** Whether the form has been modified since the last save started. */ + /** + * Whether the form has been modified since the last save started. + * + * @property dirty + * @type boolean + * @default false + */ dirty: false, - /** Timer object for the delay between form modifaction and the save starting. */ + /** + * Timer object for the delay between form modifaction and the save starting. + * + * @property delay_timer + * @type Object + * @default null + * @private + */ delay_timer: null, - /** Y.io transaction for the save ajax request. */ + /** + * Y.io transaction for the save ajax request. + * + * @property save_transaction + * @type object + * @default null + */ save_transaction: null, - /** @property Failed saves count. */ + /** + * Failed saves count. + * + * @property savefailures + * @type Number + * @default 0 + * @private + */ savefailures: 0, - /** Properly bound key change handler. */ + /** + * Properly bound key change handler. + * + * @property editor_change_handler + * @type EventHandle + * @default null + * @private + */ editor_change_handler: null, - /** Record of the value of all the hidden fields, last time they were checked. */ + /** + * Record of the value of all the hidden fields, last time they were checked. + * + * @property hidden_field_values + * @type Object + * @default {} + */ hidden_field_values: {}, /** * Initialise the autosave code. - * @param delay the delay, in seconds, between a change being detected, and + * + * @method init + * @param {Number} delay the delay, in seconds, between a change being detected, and * a save happening. */ init: function(delay) { @@ -123,9 +239,16 @@ M.mod_quiz.autosave = { }, /** - * @param repeatcount Because TinyMCE might load slowly, after us, we need - * to keep trying every 10 seconds or so, until we detect TinyMCE is there, - * or enough time has passed. + * Initialise watching of TinyMCE specifically. + * + * Because TinyMCE might load slowly, and after us, we need to keep + * trying, until we detect TinyMCE is there, or enough time has passed. + * This is based on the TINYMCE_DETECTION_DELAY and + * TINYMCE_DETECTION_REPEATS properties. + * + * + * @method init_tinymce + * @param {Number} repeatcount The number of attempts made so far. */ init_tinymce: function(repeatcount) { if (typeof tinyMCE === 'undefined') { @@ -141,11 +264,13 @@ M.mod_quiz.autosave = { }, /** - * @param repeatcount Because TinyMCE might load slowly, after us, we need - * to keep trying every 10 seconds or so, until we detect TinyMCE is there, - * or enough time has passed. + * Initialise watching of a specific TinyMCE editor. + * + * @method init_tinymce_editor + * @param {EventFacade} e + * @param {Object} editor The TinyMCE editor object */ - init_tinymce_editor: function(notused, editor) { + init_tinymce_editor: function(e, editor) { editor.onChange.add(this.editor_change_handler); editor.onRedo.add(this.editor_change_handler); editor.onUndo.add(this.editor_change_handler); diff --git a/mod/quiz/yui/src/autosave/js/autosave.js b/mod/quiz/yui/src/autosave/js/autosave.js index a3ac4719fe9..3a51aef4b04 100644 --- a/mod/quiz/yui/src/autosave/js/autosave.js +++ b/mod/quiz/yui/src/autosave/js/autosave.js @@ -17,21 +17,76 @@ /** * Auto-save functionality for during quiz attempts. * - * @package mod_quiz - * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com} - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @module moodle-mod_quiz-autosave + */ + +/** + * Auto-save functionality for during quiz attempts. + * + * @class M.mod_quiz.autosave */ M.mod_quiz = M.mod_quiz || {}; M.mod_quiz.autosave = { - /** Delays and repeat counts. */ + /** + * The amount of time (in milliseconds) to wait between TinyMCE detections. + * + * @property TINYMCE_DETECTION_DELAY + * @type Number + * @default 500 + * @private + */ TINYMCE_DETECTION_DELAY: 500, + + /** + * The number of times to try redetecting TinyMCE. + * + * @property TINYMCE_DETECTION_REPEATS + * @type Number + * @default 20 + * @private + */ TINYMCE_DETECTION_REPEATS: 20, + + /** + * The delay (in milliseconds) between checking hidden input fields. + * + * @property WATCH_HIDDEN_DELAY + * @type Number + * @default 1000 + * @private + */ WATCH_HIDDEN_DELAY: 1000, + + /** + * The number of failures to ignore before notifying the user. + * + * @property FAILURES_BEFORE_NOTIFY + * @type Number + * @default 1 + * @private + */ FAILURES_BEFORE_NOTIFY: 1, + + /** + * The value to use when resetting the successful save counter. + * + * @property FIRST_SUCCESSFUL_SAVE + * @static + * @type Number + * @default -1 + * @private + */ FIRST_SUCCESSFUL_SAVE: -1, - /** Selectors. */ + /** + * The selectors used throughout this class. + * + * @property SELECTORS + * @private + * @type Object + * @static + */ SELECTORS: { QUIZ_FORM: '#responseform', VALUE_CHANGE_ELEMENTS: 'input, textarea', @@ -41,36 +96,97 @@ M.mod_quiz.autosave = { CONNECTION_OK: '#connection-ok' }, - /** Script that handles the auto-saves. */ + /** + * The script which handles the autosaves. + * + * @property AUTOSAVE_HANDLER + * @type String + * @default M.cfg.wwwroot + '/mod/quiz/autosave.ajax.php' + * @private + */ AUTOSAVE_HANDLER: M.cfg.wwwroot + '/mod/quiz/autosave.ajax.php', - /** The delay between a change being made, and it being auto-saved. */ + /** + * The delay (in milliseconds) between a change being made, and it being auto-saved. + * + * @property delay + * @type Number + * @default 120000 + * @private + */ delay: 120000, - /** The form we are monitoring. */ + /** + * A Node reference to the form we are monitoring. + * + * @property form + * @type Node + * @default null + */ form: null, - /** Whether the form has been modified since the last save started. */ + /** + * Whether the form has been modified since the last save started. + * + * @property dirty + * @type boolean + * @default false + */ dirty: false, - /** Timer object for the delay between form modifaction and the save starting. */ + /** + * Timer object for the delay between form modifaction and the save starting. + * + * @property delay_timer + * @type Object + * @default null + * @private + */ delay_timer: null, - /** Y.io transaction for the save ajax request. */ + /** + * Y.io transaction for the save ajax request. + * + * @property save_transaction + * @type object + * @default null + */ save_transaction: null, - /** @property Failed saves count. */ + /** + * Failed saves count. + * + * @property savefailures + * @type Number + * @default 0 + * @private + */ savefailures: 0, - /** Properly bound key change handler. */ + /** + * Properly bound key change handler. + * + * @property editor_change_handler + * @type EventHandle + * @default null + * @private + */ editor_change_handler: null, - /** Record of the value of all the hidden fields, last time they were checked. */ + /** + * Record of the value of all the hidden fields, last time they were checked. + * + * @property hidden_field_values + * @type Object + * @default {} + */ hidden_field_values: {}, /** * Initialise the autosave code. - * @param delay the delay, in seconds, between a change being detected, and + * + * @method init + * @param {Number} delay the delay, in seconds, between a change being detected, and * a save happening. */ init: function(delay) { @@ -122,9 +238,16 @@ M.mod_quiz.autosave = { }, /** - * @param repeatcount Because TinyMCE might load slowly, after us, we need - * to keep trying every 10 seconds or so, until we detect TinyMCE is there, - * or enough time has passed. + * Initialise watching of TinyMCE specifically. + * + * Because TinyMCE might load slowly, and after us, we need to keep + * trying, until we detect TinyMCE is there, or enough time has passed. + * This is based on the TINYMCE_DETECTION_DELAY and + * TINYMCE_DETECTION_REPEATS properties. + * + * + * @method init_tinymce + * @param {Number} repeatcount The number of attempts made so far. */ init_tinymce: function(repeatcount) { if (typeof tinyMCE === 'undefined') { @@ -142,11 +265,13 @@ M.mod_quiz.autosave = { }, /** - * @param repeatcount Because TinyMCE might load slowly, after us, we need - * to keep trying every 10 seconds or so, until we detect TinyMCE is there, - * or enough time has passed. + * Initialise watching of a specific TinyMCE editor. + * + * @method init_tinymce_editor + * @param {EventFacade} e + * @param {Object} editor The TinyMCE editor object */ - init_tinymce_editor: function(notused, editor) { + init_tinymce_editor: function(e, editor) { Y.log('Found TinyMCE editor ' + editor.id + '.'); editor.onChange.add(this.editor_change_handler); editor.onRedo.add(this.editor_change_handler); diff --git a/question/yui/build/moodle-question-preview/moodle-question-preview-debug.js b/question/yui/build/moodle-question-preview/moodle-question-preview-debug.js index 408dc554e11..d7f4466cce6 100644 --- a/question/yui/build/moodle-question-preview/moodle-question-preview-debug.js +++ b/question/yui/build/moodle-question-preview/moodle-question-preview-debug.js @@ -15,18 +15,21 @@ YUI.add('moodle-question-preview', function (Y, NAME) { // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . +/* + * @copyright 2014 The Open University + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + /** * JavaScript required by the question preview pop-up. * * @module moodle-question-preview - * @copyright 2014 The Open University - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ M.question = M.question || {}; M.question.preview = M.question.preview || {}; -/** +/* * Initialise JavaScript-specific parts of the question preview popup. */ M.question.preview.init = function() { diff --git a/question/yui/build/moodle-question-preview/moodle-question-preview.js b/question/yui/build/moodle-question-preview/moodle-question-preview.js index 408dc554e11..d7f4466cce6 100644 --- a/question/yui/build/moodle-question-preview/moodle-question-preview.js +++ b/question/yui/build/moodle-question-preview/moodle-question-preview.js @@ -15,18 +15,21 @@ YUI.add('moodle-question-preview', function (Y, NAME) { // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . +/* + * @copyright 2014 The Open University + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + /** * JavaScript required by the question preview pop-up. * * @module moodle-question-preview - * @copyright 2014 The Open University - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ M.question = M.question || {}; M.question.preview = M.question.preview || {}; -/** +/* * Initialise JavaScript-specific parts of the question preview popup. */ M.question.preview.init = function() { diff --git a/question/yui/src/preview/js/preview.js b/question/yui/src/preview/js/preview.js index a366a4eba9f..21de48f8b39 100644 --- a/question/yui/src/preview/js/preview.js +++ b/question/yui/src/preview/js/preview.js @@ -13,18 +13,21 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . +/* + * @copyright 2014 The Open University + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + /** * JavaScript required by the question preview pop-up. * * @module moodle-question-preview - * @copyright 2014 The Open University - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ M.question = M.question || {}; M.question.preview = M.question.preview || {}; -/** +/* * Initialise JavaScript-specific parts of the question preview popup. */ M.question.preview.init = function() {