[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/question/yui/build/moodle-question-preview/ -> moodle-question-preview-debug.js (source)

   1  YUI.add('moodle-question-preview', function (Y, NAME) {
   2  
   3  // This file is part of Moodle - http://moodle.org/
   4  //
   5  // Moodle is free software: you can redistribute it and/or modify
   6  // it under the terms of the GNU General Public License as published by
   7  // the Free Software Foundation, either version 3 of the License, or
   8  // (at your option) any later version.
   9  //
  10  // Moodle is distributed in the hope that it will be useful,
  11  // but WITHOUT ANY WARRANTY; without even the implied warranty of
  12  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13  // GNU General Public License for more details.
  14  //
  15  // You should have received a copy of the GNU General Public License
  16  // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
  17  
  18  /*
  19   * @copyright 2014 The Open University
  20   * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  21   */
  22  
  23  /**
  24   * JavaScript required by the question preview pop-up.
  25   *
  26   * @module moodle-question-preview
  27   */
  28  
  29  M.question = M.question || {};
  30  M.question.preview = M.question.preview || {};
  31  
  32  /*
  33   * Initialise JavaScript-specific parts of the question preview popup.
  34   */
  35  M.question.preview.init = function() {
  36      M.core_question_engine.init_form(Y, '#responseform');
  37  
  38      // Add a close button to the window.
  39      var closebutton = Y.Node.create('<input type="button" />')
  40              .set('value', M.util.get_string('closepreview', 'question'));
  41  
  42      closebutton.on('click', function() {
  43          window.close();
  44      });
  45      Y.one('#previewcontrols').append(closebutton);
  46  
  47      // Stop a question form being submitted more than once.
  48      Y.on('submit', M.core_question_engine.prevent_repeat_submission, '#mform1', null, Y);
  49  };
  50  
  51  
  52  }, '@VERSION@', {"requires": ["base", "dom", "event-delegate", "event-key", "core_question_engine"]});


Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1