Your IP : 192.168.165.1


Current Path : C:/xampp/htdocs/moodle/mod/assign/amd/build/
Upload File :
Current File : C:/xampp/htdocs/moodle/mod/assign/amd/build/grading_actions.min.js.map

{"version":3,"sources":["../src/grading_actions.js"],"names":["define","$","GradingEvents","GradingActions","selector","_regionSelector","_region","registerEventListeners","prototype","_lastUserId","_showActionsForm","event","userid","form","find","removeClass","addClass","_trigger","action","document","trigger","getReviewPanelElement","hasReviewPanelElement","length","getCollapseGradePanelButton","getCollapseReviewPanelButton","getExpandAllPanelsButton","resetLayoutButtons","collapseReviewPanel","COLLAPSE_REVIEW_PANEL","EXPAND_GRADE_PANEL","collapseGradePanel","COLLAPSE_GRADE_PANEL","EXPAND_REVIEW_PANEL","expandAllPanels","collapseReviewPanelButton","click","e","preventDefault","bind","keydown","metaKey","shiftKey","altKey","ctrlKey","keyCode","collapseGradePanelButton","expandAllPanelsButton","on"],"mappings":"AAyBAA,OAAM,8BAAC,CAAC,QAAD,CAAW,2BAAX,CAAD,CAA0C,SAASC,CAAT,CAAYC,CAAZ,CAA2B,CAQvE,GAAIC,CAAAA,CAAc,CAAG,SAASC,CAAT,CAAmB,CACpC,KAAKC,eAAL,CAAuBD,CAAvB,CACA,KAAKE,OAAL,CAAeL,CAAC,CAACG,CAAD,CAAhB,CAEA,KAAKG,sBAAL,EACH,CALD,CAQAJ,CAAc,CAACK,SAAf,CAAyBH,eAAzB,CAA2C,IAA3C,CAGAF,CAAc,CAACK,SAAf,CAAyBC,WAAzB,CAAuC,CAAvC,CAGAN,CAAc,CAACK,SAAf,CAAyBF,OAAzB,CAAmC,IAAnC,CAUAH,CAAc,CAACK,SAAf,CAAyBE,gBAAzB,CAA4C,SAASC,CAAT,CAAgBC,CAAhB,CAAwB,CAChE,GAAIC,CAAAA,CAAI,CAAG,KAAKP,OAAL,CAAaQ,IAAb,CAAkB,oCAAlB,CAAX,CAEA,GAAIF,CAAM,EAAI,KAAKH,WAAf,EAAuC,CAAT,CAAAG,CAAlC,CAA8C,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,OAAF,EAAkC,EAAd,GAAAR,CAAC,CAACQ,OAA1B,CAA0C,CACtC,KAAKX,eAAL,GACAG,CAAC,CAACC,cAAF,EACH,CACJ,CACJ,CAP6B,CAO5BC,IAP4B,CAOvB,IAPuB,CAA9B,CAQH,CAEDtC,CAAC,CAACkB,QAAD,CAAD,CAAY6B,EAAZ,CAAe,cAAf,CAA+B,KAAKtC,gBAAL,CAAsB6B,IAAtB,CAA2B,IAA3B,CAA/B,EAEA,KAAKjC,OAAL,CAAaQ,IAAb,CAAkB,wBAAlB,EAA0CkC,EAA1C,CAA6C,OAA7C,CAAsD,KAAK/B,QAAL,CAAcsB,IAAd,CAAmB,IAAnB,CAAyB,cAAzB,CAAtD,EACA,KAAKjC,OAAL,CAAaQ,IAAb,CAAkB,4BAAlB,EAA8CkC,EAA9C,CAAiD,OAAjD,CAA0D,KAAK/B,QAAL,CAAcsB,IAAd,CAAmB,IAAnB,CAAyB,oBAAzB,CAA1D,EACA,KAAKjC,OAAL,CAAaQ,IAAb,CAAkB,wBAAlB,EAA0CkC,EAA1C,CAA6C,OAA7C,CAAsD,KAAK/B,QAAL,CAAcsB,IAAd,CAAmB,IAAnB,CAAyB,OAAzB,CAAtD,EACA,KAAKjC,OAAL,CAAaQ,IAAb,CAAkB,MAAlB,EAA0BkC,EAA1B,CAA6B,QAA7B,CAAuC,SAASX,CAAT,CAAY,CAC/CA,CAAC,CAACC,cAAF,EACH,CAFD,CAGH,CAzDD,CA2DA,MAAOnC,CAAAA,CACV,CA3NK,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 \"Actions\" panel at the bottom of the page.\n *\n * @module     mod_assign/grading_actions\n * @package    mod_assign\n * @class      GradingActions\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     * GradingActions class.\n     *\n     * @class GradingActions\n     * @param {String} selector The selector for the page region containing the actions panel.\n     */\n    var GradingActions = function(selector) {\n        this._regionSelector = selector;\n        this._region = $(selector);\n\n        this.registerEventListeners();\n    };\n\n    /** @type {String} Selector for the page region containing the user navigation. */\n    GradingActions.prototype._regionSelector = null;\n\n    /** @type {Integer} Remember the last user id to prevent unnessecary reloads. */\n    GradingActions.prototype._lastUserId = 0;\n\n    /** @type {JQuery} JQuery node for the page region containing the user navigation. */\n    GradingActions.prototype._region = null;\n\n    /**\n     * Show the actions if there is valid user.\n     *\n     * @method _showActionsForm\n     * @private\n     * @param {Event} event\n     * @param {Integer} userid\n     */\n    GradingActions.prototype._showActionsForm = function(event, userid) {\n        var form = this._region.find('[data-region=grading-actions-form]');\n\n        if (userid != this._lastUserId && userid > 0) {\n            this._lastUserId = userid;\n        }\n        if (userid > 0) {\n            form.removeClass('hide');\n        } else {\n            form.addClass('hide');\n        }\n\n    };\n\n    /**\n     * Trigger the named action.\n     *\n     * @method _trigger\n     * @private\n     * @param {String} action\n     */\n    GradingActions.prototype._trigger = function(action) {\n        $(document).trigger(action);\n    };\n\n    /**\n     * Get the review panel element.\n     *\n     * @method getReviewPanelElement\n     * @return {jQuery}\n     */\n    GradingActions.prototype.getReviewPanelElement = function() {\n        return $('[data-region=\"review-panel\"]');\n    };\n\n    /**\n     * Check if the page has a review panel.\n     *\n     * @method hasReviewPanelElement\n     * @return {bool}\n     */\n    GradingActions.prototype.hasReviewPanelElement = function() {\n        return this.getReviewPanelElement().length > 0;\n    };\n\n    /**\n     * Get the collapse grade panel button.\n     *\n     * @method getCollapseGradePanelButton\n     * @return {jQuery}\n     */\n    GradingActions.prototype.getCollapseGradePanelButton = function() {\n        return $('[data-region=\"grade-actions\"] .collapse-grade-panel');\n    };\n\n    /**\n     * Get the collapse review panel button.\n     *\n     * @method getCollapseReviewPanelButton\n     * @return {jQuery}\n     */\n    GradingActions.prototype.getCollapseReviewPanelButton = function() {\n        return $('[data-region=\"grade-actions\"] .collapse-review-panel');\n    };\n\n    /**\n     * Get the expand all panels button.\n     *\n     * @method getExpandAllPanelsButton\n     * @return {jQuery}\n     */\n    GradingActions.prototype.getExpandAllPanelsButton = function() {\n        return $('[data-region=\"grade-actions\"] .collapse-none');\n    };\n\n    /**\n     * Remove the active state from all layout buttons.\n     *\n     * @method resetLayoutButtons\n     */\n    GradingActions.prototype.resetLayoutButtons = function() {\n        this.getCollapseGradePanelButton().removeClass('active');\n        this.getCollapseReviewPanelButton().removeClass('active');\n        this.getExpandAllPanelsButton().removeClass('active');\n    };\n\n    /**\n     * Hide the review panel.\n     *\n     * @method collapseReviewPanel\n     */\n    GradingActions.prototype.collapseReviewPanel = function() {\n        $(document).trigger(GradingEvents.COLLAPSE_REVIEW_PANEL);\n        $(document).trigger(GradingEvents.EXPAND_GRADE_PANEL);\n        this.resetLayoutButtons();\n        this.getCollapseReviewPanelButton().addClass('active');\n    };\n\n    /**\n     * Show/Hide the grade panel.\n     *\n     * @method collapseGradePanel\n     */\n    GradingActions.prototype.collapseGradePanel = function() {\n        $(document).trigger(GradingEvents.COLLAPSE_GRADE_PANEL);\n        $(document).trigger(GradingEvents.EXPAND_REVIEW_PANEL);\n        this.resetLayoutButtons();\n        this.getCollapseGradePanelButton().addClass('active');\n    };\n\n    /**\n     * Return the layout to default.\n     *\n     * @method expandAllPanels\n     */\n    GradingActions.prototype.expandAllPanels = function() {\n        $(document).trigger(GradingEvents.EXPAND_GRADE_PANEL);\n        $(document).trigger(GradingEvents.EXPAND_REVIEW_PANEL);\n        this.resetLayoutButtons();\n        this.getExpandAllPanelsButton().addClass('active');\n    };\n\n    /**\n     * Register event listeners for the grade panel.\n     *\n     * @method registerEventListeners\n     */\n    GradingActions.prototype.registerEventListeners = function() {\n        // Don't need layout controls if there is no review panel.\n        if (this.hasReviewPanelElement()) {\n            var collapseReviewPanelButton = this.getCollapseReviewPanelButton();\n            collapseReviewPanelButton.click(function(e) {\n                this.collapseReviewPanel();\n                e.preventDefault();\n            }.bind(this));\n\n            collapseReviewPanelButton.keydown(function(e) {\n                if (!e.metaKey && !e.shiftKey && !e.altKey && !e.ctrlKey) {\n                    if (e.keyCode === 13 || e.keyCode === 32) {\n                        this.collapseReviewPanel();\n                        e.preventDefault();\n                    }\n                }\n            }.bind(this));\n\n            var collapseGradePanelButton = this.getCollapseGradePanelButton();\n            collapseGradePanelButton.click(function(e) {\n                this.collapseGradePanel();\n                e.preventDefault();\n            }.bind(this));\n\n            collapseGradePanelButton.keydown(function(e) {\n                if (!e.metaKey && !e.shiftKey && !e.altKey && !e.ctrlKey) {\n                    if (e.keyCode === 13 || e.keyCode === 32) {\n                        this.collapseGradePanel();\n                        e.preventDefault();\n                    }\n                }\n            }.bind(this));\n\n            var expandAllPanelsButton = this.getExpandAllPanelsButton();\n            expandAllPanelsButton.click(function(e) {\n                this.expandAllPanels();\n                e.preventDefault();\n            }.bind(this));\n\n            expandAllPanelsButton.keydown(function(e) {\n                if (!e.metaKey && !e.shiftKey && !e.altKey && !e.ctrlKey) {\n                    if (e.keyCode === 13 || e.keyCode === 32) {\n                        this.expandAllPanels();\n                        e.preventDefault();\n                    }\n                }\n            }.bind(this));\n        }\n\n        $(document).on('user-changed', this._showActionsForm.bind(this));\n\n        this._region.find('[name=\"savechanges\"]').on('click', this._trigger.bind(this, 'save-changes'));\n        this._region.find('[name=\"saveandshownext\"]').on('click', this._trigger.bind(this, 'save-and-show-next'));\n        this._region.find('[name=\"resetbutton\"]').on('click', this._trigger.bind(this, 'reset'));\n        this._region.find('form').on('submit', function(e) {\n            e.preventDefault();\n        });\n    };\n\n    return GradingActions;\n});\n"],"file":"grading_actions.min.js"}