Your IP : 216.73.216.95


Current Path : /var/www/ljmtc/cbt/admin/tool/dataprivacy/amd/build/
Upload File :
Current File : /var/www/ljmtc/cbt/admin/tool/dataprivacy/amd/build/effective_retention_period.min.js.map

{"version":3,"sources":["../src/effective_retention_period.js"],"names":["define","$","SELECTORS","PURPOSE_SELECT","RETENTION_FIELD","EffectiveRetentionPeriod","purposeRetentionPeriods","registerEventListeners","removeListeners","off","prototype","on","ev","selected","currentTarget","val","selectedPurpose","text","bind","init"],"mappings":"AAuBAA,OAAM,+CAAC,CAAC,QAAD,CAAD,CACF,SAASC,CAAT,CAAY,IAEJC,CAAAA,CAAS,CAAG,CACZC,cAAc,CAAE,eADJ,CAEZC,eAAe,CAAE,qDAFL,CAFR,CAYJC,CAAwB,CAAG,SAASC,CAAT,CAAkC,CAC7D,KAAKA,uBAAL,CAA+BA,CAA/B,CACA,KAAKC,sBAAL,EACH,CAfO,CAsBJC,CAAe,CAAG,UAAW,CAC7BP,CAAC,CAACC,CAAS,CAACC,cAAX,CAAD,CAA4BM,GAA5B,CAAgC,QAAhC,CACH,CAxBO,CA8BRJ,CAAwB,CAACK,SAAzB,CAAmCJ,uBAAnC,CAA6D,EAA7D,CAOAD,CAAwB,CAACK,SAAzB,CAAmCH,sBAAnC,CAA4D,UAAW,CAEnEN,CAAC,CAACC,CAAS,CAACC,cAAX,CAAD,CAA4BQ,EAA5B,CAA+B,QAA/B,CAAyC,SAASC,CAAT,CAAa,IAC9CC,CAAAA,CAAQ,CAAGZ,CAAC,CAACW,CAAE,CAACE,aAAJ,CAAD,CAAoBC,GAApB,EADmC,CAE9CC,CAAe,CAAG,KAAKV,uBAAL,CAA6BO,CAA7B,CAF4B,CAGlDZ,CAAC,CAACC,CAAS,CAACE,eAAX,CAAD,CAA6Ba,IAA7B,CAAkCD,CAAlC,CACH,CAJwC,CAIvCE,IAJuC,CAIlC,IAJkC,CAAzC,CAKH,CAPD,CASA,MAAwE,CACpEC,IAAI,CAAE,cAASb,CAAT,CAAkC,CAEpCE,CAAe,GACf,MAAO,IAAIH,CAAAA,CAAJ,CAA6BC,CAA7B,CACV,CALmE,CAO3E,CAtDC,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 * Module to update the displayed retention period.\n *\n * @module     tool_dataprivacy/effective_retention_period\n * @package    tool_dataprivacy\n * @copyright  2018 David Monllao\n * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery'],\n    function($) {\n\n        var SELECTORS = {\n            PURPOSE_SELECT: '#id_purposeid',\n            RETENTION_FIELD: '#fitem_id_retention_current [data-fieldtype=static]',\n        };\n\n        /**\n         * Constructor for the retention period display.\n         *\n         * @param {Array} purposeRetentionPeriods Associative array of purposeids with effective retention period at this context\n         */\n        var EffectiveRetentionPeriod = function(purposeRetentionPeriods) {\n            this.purposeRetentionPeriods = purposeRetentionPeriods;\n            this.registerEventListeners();\n        };\n\n        /**\n         * Removes the current 'change' listeners.\n         *\n         * Useful when a new form is loaded.\n         */\n        var removeListeners = function() {\n            $(SELECTORS.PURPOSE_SELECT).off('change');\n        };\n\n        /**\n         * @var {Array} purposeRetentionPeriods\n         * @private\n         */\n        EffectiveRetentionPeriod.prototype.purposeRetentionPeriods = [];\n\n        /**\n         * Add purpose change listeners.\n         *\n         * @method registerEventListeners\n         */\n        EffectiveRetentionPeriod.prototype.registerEventListeners = function() {\n\n            $(SELECTORS.PURPOSE_SELECT).on('change', function(ev) {\n                var selected = $(ev.currentTarget).val();\n                var selectedPurpose = this.purposeRetentionPeriods[selected];\n                $(SELECTORS.RETENTION_FIELD).text(selectedPurpose);\n            }.bind(this));\n        };\n\n        return /** @alias module:tool_dataprivacy/effective_retention_period */ {\n            init: function(purposeRetentionPeriods) {\n                // Remove previously attached listeners.\n                removeListeners();\n                return new EffectiveRetentionPeriod(purposeRetentionPeriods);\n            }\n        };\n    }\n);\n\n"],"file":"effective_retention_period.min.js"}