| 1 | 
           efrain | 
           1 | 
           // This file is part of Moodle - http://moodle.org/
  | 
        
        
            | 
            | 
           2 | 
           //
  | 
        
        
            | 
            | 
           3 | 
           // Moodle is free software: you can redistribute it and/or modify
  | 
        
        
            | 
            | 
           4 | 
           // it under the terms of the GNU General Public License as published by
  | 
        
        
            | 
            | 
           5 | 
           // the Free Software Foundation, either version 3 of the License, or
  | 
        
        
            | 
            | 
           6 | 
           // (at your option) any later version.
  | 
        
        
            | 
            | 
           7 | 
           //
  | 
        
        
            | 
            | 
           8 | 
           // Moodle is distributed in the hope that it will be useful,
  | 
        
        
            | 
            | 
           9 | 
           // but WITHOUT ANY WARRANTY; without even the implied warranty of
  | 
        
        
            | 
            | 
           10 | 
           // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  | 
        
        
            | 
            | 
           11 | 
           // GNU General Public License for more details.
  | 
        
        
            | 
            | 
           12 | 
           //
  | 
        
        
            | 
            | 
           13 | 
           // You should have received a copy of the GNU General Public License
  | 
        
        
            | 
            | 
           14 | 
           // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
  | 
        
        
            | 
            | 
           15 | 
           /* eslint-disable no-unused-vars */
  | 
        
        
            | 
            | 
           16 | 
              | 
        
        
            | 
            | 
           17 | 
           /**
  | 
        
        
            | 
            | 
           18 | 
            * A list of globals used by this module.
  | 
        
        
            | 
            | 
           19 | 
            *
  | 
        
        
            | 
            | 
           20 | 
            * @module moodle-assignfeedback_editpdf-editor
  | 
        
        
            | 
            | 
           21 | 
            */
  | 
        
        
            | 
            | 
           22 | 
           var AJAXBASE = M.cfg.wwwroot + '/mod/assign/feedback/editpdf/ajax.php',
  | 
        
        
            | 
            | 
           23 | 
               AJAXBASEPROGRESS = M.cfg.wwwroot + '/mod/assign/feedback/editpdf/ajax_progress.php',
  | 
        
        
            | 
            | 
           24 | 
               CSS = {
  | 
        
        
            | 
            | 
           25 | 
                   DIALOGUE: 'assignfeedback_editpdf_widget'
  | 
        
        
            | 
            | 
           26 | 
               },
  | 
        
        
            | 
            | 
           27 | 
               SELECTOR = {
  | 
        
        
            | 
            | 
           28 | 
                   PREVIOUSBUTTON:  '.navigate-previous-button',
  | 
        
        
            | 
            | 
           29 | 
                   NEXTBUTTON:  ' .navigate-next-button',
  | 
        
        
            | 
            | 
           30 | 
                   SEARCHCOMMENTSBUTTON: '.searchcommentsbutton',
  | 
        
        
            | 
            | 
           31 | 
                   EXPCOLCOMMENTSBUTTON: '.expcolcommentsbutton',
  | 
        
        
            | 
            | 
           32 | 
                   SEARCHFILTER: '.assignfeedback_editpdf_commentsearch input',
  | 
        
        
            | 
            | 
           33 | 
                   SEARCHCOMMENTSLIST: '.assignfeedback_editpdf_commentsearch ul',
  | 
        
        
            | 
            | 
           34 | 
                   PAGESELECT: '.navigate-page-select',
  | 
        
        
            | 
            | 
           35 | 
                   LOADINGICON: '.loading',
  | 
        
        
            | 
            | 
           36 | 
                   PROGRESSBARCONTAINER: '.progress-info.progress-striped',
  | 
        
        
            | 
            | 
           37 | 
                   DRAWINGREGION: '.drawingregion',
  | 
        
        
            | 
            | 
           38 | 
                   DRAWINGCANVAS: '.drawingcanvas',
  | 
        
        
            | 
            | 
           39 | 
                   SAVE: '.savebutton',
  | 
        
        
            | 
            | 
           40 | 
                   COMMENTCOLOURBUTTON: '.commentcolourbutton',
  | 
        
        
            | 
            | 
           41 | 
                   COMMENTMENU: '.commentdrawable a',
  | 
        
        
            | 
            | 
           42 | 
                   ANNOTATIONCOLOURBUTTON:  '.annotationcolourbutton',
  | 
        
        
            | 
            | 
           43 | 
                   DELETEANNOTATIONBUTTON: '.deleteannotationbutton',
  | 
        
        
            | 
            | 
           44 | 
                   WARNINGMESSAGECONTAINER: '.warningmessages',
  | 
        
        
            | 
            | 
           45 | 
                   ICONMESSAGECONTAINER: '.infoicon',
  | 
        
        
            | 
            | 
           46 | 
                   UNSAVEDCHANGESDIV: '.assignfeedback_editpdf_warningmessages',
  | 
        
        
            | 
            | 
           47 | 
                   UNSAVEDCHANGESINPUT: 'input[name="assignfeedback_editpdf_haschanges"]',
  | 
        
        
            | 
            | 
           48 | 
                   STAMPSBUTTON: '.currentstampbutton',
  | 
        
        
            | 
            | 
           49 | 
                   USERINFOREGION: '[data-region="user-info"]',
  | 
        
        
            | 
            | 
           50 | 
                   ROTATELEFTBUTTON: '.rotateleftbutton',
  | 
        
        
            | 
            | 
           51 | 
                   ROTATERIGHTBUTTON: '.rotaterightbutton',
  | 
        
        
            | 
            | 
           52 | 
                   DIALOGUE: '.' + CSS.DIALOGUE
  | 
        
        
            | 
            | 
           53 | 
               },
  | 
        
        
            | 
            | 
           54 | 
               SELECTEDBORDERCOLOUR = 'rgba(200, 200, 255, 0.9)',
  | 
        
        
            | 
            | 
           55 | 
               SELECTEDFILLCOLOUR = 'rgba(200, 200, 255, 0.5)',
  | 
        
        
            | 
            | 
           56 | 
               COMMENTTEXTCOLOUR = 'rgb(51, 51, 51)',
  | 
        
        
            | 
            | 
           57 | 
               COMMENTCOLOUR = {
  | 
        
        
            | 
            | 
           58 | 
                   'white': 'rgb(255,255,255)',
  | 
        
        
            | 
            | 
           59 | 
                   'yellow': 'rgb(255,236,174)',
  | 
        
        
            | 
            | 
           60 | 
                   'red': 'rgb(249,181,179)',
  | 
        
        
            | 
            | 
           61 | 
                   'green': 'rgb(214,234,178)',
  | 
        
        
            | 
            | 
           62 | 
                   'blue': 'rgb(203,217,237)',
  | 
        
        
            | 
            | 
           63 | 
                   'clear': 'rgba(255,255,255, 0)'
  | 
        
        
            | 
            | 
           64 | 
               },
  | 
        
        
            | 
            | 
           65 | 
               ANNOTATIONCOLOUR = {
  | 
        
        
            | 
            | 
           66 | 
                   'white': 'rgb(255,255,255)',
  | 
        
        
            | 
            | 
           67 | 
                   'yellow': 'rgb(255,207,53)',
  | 
        
        
            | 
            | 
           68 | 
                   'red': 'rgb(239,69,64)',
  | 
        
        
            | 
            | 
           69 | 
                   'green': 'rgb(152,202,62)',
  | 
        
        
            | 
            | 
           70 | 
                   'blue': 'rgb(125,159,211)',
  | 
        
        
            | 
            | 
           71 | 
                   'black': 'rgb(51,51,51)'
  | 
        
        
            | 
            | 
           72 | 
               },
  | 
        
        
            | 
            | 
           73 | 
               CLICKTIMEOUT = 300,
  | 
        
        
            | 
            | 
           74 | 
               TOOLSELECTOR = {
  | 
        
        
            | 
            | 
           75 | 
                   'comment': '.commentbutton',
  | 
        
        
            | 
            | 
           76 | 
                   'pen': '.penbutton',
  | 
        
        
            | 
            | 
           77 | 
                   'line': '.linebutton',
  | 
        
        
            | 
            | 
           78 | 
                   'rectangle': '.rectanglebutton',
  | 
        
        
            | 
            | 
           79 | 
                   'oval': '.ovalbutton',
  | 
        
        
            | 
            | 
           80 | 
                   'stamp': '.stampbutton',
  | 
        
        
            | 
            | 
           81 | 
                   'select': '.selectbutton',
  | 
        
        
            | 
            | 
           82 | 
                   'drag': '.dragbutton',
  | 
        
        
            | 
            | 
           83 | 
                   'highlight': '.highlightbutton'
  | 
        
        
            | 
            | 
           84 | 
               },
  | 
        
        
            | 
            | 
           85 | 
               STROKEWEIGHT = 4;
  |