Current Path : C:/xampp/htdocs/moodle/mod/assign/amd/build/ |
Current File : C:/xampp/htdocs/moodle/mod/assign/amd/build/grading_review_panel.min.js.map |
{"version":3,"sources":["../src/grading_review_panel.js"],"names":["define","$","GradingEvents","GradingReviewPanel","_region","registerEventListeners","prototype","getReviewPanel","pluginname","owner","data","getTogglePanelButton","getPanelElement","find","getPanelContentElement","togglePanel","hasClass","document","trigger","EXPAND_REVIEW_PANEL","COLLAPSE_REVIEW_PANEL","collapsePanel","addClass","removeClass","attr","expandPanel","removeAttr","toggleReviewPanelButton","click","e","preventDefault","bind","keydown","metaKey","shiftKey","altKey","ctrlKey","keyCode","docElement","on","COLLAPSE_GRADE_PANEL","EXPAND_GRADE_PANEL"],"mappings":"AAyBAA,OAAM,mCAAC,CAAC,QAAD,CAAW,2BAAX,CAAD,CAA0C,SAASC,CAAT,CAAYC,CAAZ,CAA2B,CAQvE,GAAIC,CAAAA,CAAkB,CAAG,UAAW,CAChC,KAAKC,OAAL,CAAeH,CAAC,CAAC,wCAAD,CAAhB,CACA,KAAKI,sBAAL,EACH,CAHD,CAMAF,CAAkB,CAACG,SAAnB,CAA6BF,OAA7B,CAAuC,IAAvC,CAWAD,CAAkB,CAACG,SAAnB,CAA6BC,cAA7B,CAA8C,SAASC,CAAT,CAAqB,CAC/D,GAAIC,CAAAA,CAAK,CAAG,KAAKL,OAAL,CAAaM,IAAb,CAAkB,aAAlB,CAAZ,CACA,GAAoB,WAAhB,QAAOD,CAAAA,CAAX,CAAiC,CAC7B,KAAKL,OAAL,CAAaM,IAAb,CAAkB,qBAAlB,CAAyCF,CAAzC,CACH,CACD,GAAI,KAAKJ,OAAL,CAAaM,IAAb,CAAkB,qBAAlB,GAA4CF,CAAhD,CAA4D,CACxD,MAAO,MAAKJ,OAAL,CAAa,CAAb,CACV,CACD,QACH,CATD,CAiBAD,CAAkB,CAACG,SAAnB,CAA6BK,oBAA7B,CAAoD,UAAW,CAC3D,MAAO,MAAKC,eAAL,GAAuBC,IAA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ASH,CAAT,CAAY,CACxC,GAAI,CAACA,CAAC,CAACI,OAAH,EAAc,CAACJ,CAAC,CAACK,QAAjB,EAA6B,CAACL,CAAC,CAACM,MAAhC,EAA0C,CAACN,CAAC,CAACO,OAAjD,CAA0D,CACtD,GAAkB,EAAd,GAAAP,CAAC,CAACQ,OAAF,EAAkC,EAAd,GAAAR,CAAC,CAACQ,OAA1B,CAA0C,CACtC,KAAKtB,WAAL,GACAc,CAAC,CAACC,cAAF,EACH,CACJ,CACJ,CAP+B,CAO9BC,IAP8B,CAOzB,IAPyB,CAAhC,EASA,GAAIO,CAAAA,CAAU,CAAGrC,CAAC,CAACgB,QAAD,CAAlB,CACAqB,CAAU,CAACC,EAAX,CAAcrC,CAAa,CAACkB,qBAA5B,CAAmD,UAAW,CAC1D,KAAKC,aAAL,EACH,CAFkD,CAEjDU,IAFiD,CAE5C,IAF4C,CAAnD,EAKAO,CAAU,CAACC,EAAX,CAAcrC,CAAa,CAACsC,oBAA5B,CAAkD,UAAW,CACzD,KAAKf,WAAL,GACA,KAAKb,eAAL,GAAuBU,QAAvB,CAAgC,uBAAhC,CACH,CAHiD,CAGhDS,IAHgD,CAG3C,IAH2C,CAAlD,EAKAO,CAAU,CAACC,EAAX,CAAcrC,CAAa,CAACiB,mBAA5B,CAAiD,UAAW,CACxD,KAAKM,WAAL,EACH,CAFgD,CAE/CM,IAF+C,CAE1C,IAF0C,CAAjD,EAIAO,CAAU,CAACC,EAAX,CAAcrC,CAAa,CAACuC,kBAA5B,CAAgD,UAAW,CACvD,KAAK7B,eAAL,GAAuBW,WAAvB,CAAmC,uBAAnC,CACH,CAF+C,CAE9CQ,IAF8C,CAEzC,IAFyC,CAAhD,CAGH,CAlCD,CAoCA,MAAO5B,CAAAA,CACV,CA7IK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Javascript controller for the \"Review\" panel at the left of the page.\n *\n * @module mod_assign/grading_review_panel\n * @package mod_assign\n * @class GradingReviewPanel\n * @copyright 2016 Damyon Wiese <damyon@moodle.com>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.1\n */\ndefine(['jquery', 'mod_assign/grading_events'], function($, GradingEvents) {\n\n /**\n * GradingReviewPanel class.\n *\n * @class GradingReviewPanel\n * @param {String} selector The selector for the page region containing the user navigation.\n */\n var GradingReviewPanel = function() {\n this._region = $('[data-region=\"review-panel-content\"]');\n this.registerEventListeners();\n };\n\n /** @type {JQuery} JQuery node for the page region containing the user navigation. */\n GradingReviewPanel.prototype._region = null;\n\n /**\n * It is first come first served to get ownership of the grading review panel.\n * There can be only one.\n *\n * @public\n * @method getReviewPanel\n * @param {String} pluginname - the first plugin to ask for the panel gets it.\n * @return {DOMNode} or false\n */\n GradingReviewPanel.prototype.getReviewPanel = function(pluginname) {\n var owner = this._region.data('panel-owner');\n if (typeof owner == \"undefined\") {\n this._region.data('review-panel-plugin', pluginname);\n }\n if (this._region.data('review-panel-plugin') == pluginname) {\n return this._region[0];\n }\n return false;\n };\n\n /**\n * Get the toggle review panel button.\n *\n * @method getTogglePanelButton\n * @return {jQuery}\n */\n GradingReviewPanel.prototype.getTogglePanelButton = function() {\n return this.getPanelElement().find('[data-region=\"review-panel-toggle\"]');\n };\n\n /**\n * Get the review panel element.\n *\n * @method getPanelElement\n * @return {jQuery}\n */\n GradingReviewPanel.prototype.getPanelElement = function() {\n return $('[data-region=\"review-panel\"]');\n };\n\n /**\n * Get the review panel content element.\n *\n * @method getPanelContentElement\n * @return {jQuery}\n */\n GradingReviewPanel.prototype.getPanelContentElement = function() {\n return $('[data-region=\"review-panel-content\"]');\n };\n\n /**\n * Show/Hide the review panel.\n *\n * @method togglePanel\n */\n GradingReviewPanel.prototype.togglePanel = function() {\n if (this.getPanelElement().hasClass('collapsed')) {\n $(document).trigger(GradingEvents.EXPAND_REVIEW_PANEL);\n } else {\n $(document).trigger(GradingEvents.COLLAPSE_REVIEW_PANEL);\n }\n };\n\n /**\n * Hide the review panel.\n *\n * @method collapsePanel\n */\n GradingReviewPanel.prototype.collapsePanel = function() {\n this.getPanelElement().addClass('collapsed').removeClass('grade-panel-collapsed');\n this.getPanelContentElement().attr('aria-hidden', true);\n };\n\n /**\n * Show the review panel.\n *\n * @method expandPanel\n */\n GradingReviewPanel.prototype.expandPanel = function() {\n this.getPanelElement().removeClass('collapsed');\n this.getPanelContentElement().removeAttr('aria-hidden');\n };\n\n /**\n * Register event listeners for the review panel.\n *\n * @method registerEventListeners\n */\n GradingReviewPanel.prototype.registerEventListeners = function() {\n var toggleReviewPanelButton = this.getTogglePanelButton();\n toggleReviewPanelButton.click(function(e) {\n this.togglePanel();\n e.preventDefault();\n }.bind(this));\n\n toggleReviewPanelButton.keydown(function(e) {\n if (!e.metaKey && !e.shiftKey && !e.altKey && !e.ctrlKey) {\n if (e.keyCode === 13 || e.keyCode === 32) {\n this.togglePanel();\n e.preventDefault();\n }\n }\n }.bind(this));\n\n var docElement = $(document);\n docElement.on(GradingEvents.COLLAPSE_REVIEW_PANEL, function() {\n this.collapsePanel();\n }.bind(this));\n\n // Need special styling when grade panel is collapsed.\n docElement.on(GradingEvents.COLLAPSE_GRADE_PANEL, function() {\n this.expandPanel();\n this.getPanelElement().addClass('grade-panel-collapsed');\n }.bind(this));\n\n docElement.on(GradingEvents.EXPAND_REVIEW_PANEL, function() {\n this.expandPanel();\n }.bind(this));\n\n docElement.on(GradingEvents.EXPAND_GRADE_PANEL, function() {\n this.getPanelElement().removeClass('grade-panel-collapsed');\n }.bind(this));\n };\n\n return GradingReviewPanel;\n});\n"],"file":"grading_review_panel.min.js"}