| 1 | efrain | 1 | {{!
 | 
        
           |  |  | 2 |     This file is part of Moodle - http://moodle.org/
 | 
        
           |  |  | 3 |   | 
        
           |  |  | 4 |     Moodle is free software: you can redistribute it and/or modify
 | 
        
           |  |  | 5 |     it under the terms of the GNU General Public License as published by
 | 
        
           |  |  | 6 |     the Free Software Foundation, either version 3 of the License, or
 | 
        
           |  |  | 7 |     (at your option) any later version.
 | 
        
           |  |  | 8 |   | 
        
           |  |  | 9 |     Moodle is distributed in the hope that it will be useful,
 | 
        
           |  |  | 10 |     but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
        
           |  |  | 11 |     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
        
           |  |  | 12 |     GNU General Public License for more details.
 | 
        
           |  |  | 13 |   | 
        
           |  |  | 14 |     You should have received a copy of the GNU General Public License
 | 
        
           |  |  | 15 |     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 | 
        
           |  |  | 16 | }}
 | 
        
           |  |  | 17 | {{!
 | 
        
           |  |  | 18 |     @template tiny_equation/modal
 | 
        
           |  |  | 19 |   | 
        
           |  |  | 20 |     Modal to manage an Equation within the Tiny Editor.
 | 
        
           |  |  | 21 |   | 
        
           |  |  | 22 |     Classes required for JS:
 | 
        
           |  |  | 23 |     * none
 | 
        
           |  |  | 24 |   | 
        
           |  |  | 25 |     Data attributes required for JS:
 | 
        
           |  |  | 26 |     * none
 | 
        
           |  |  | 27 |   | 
        
           |  |  | 28 |     Context variables required for this template:
 | 
        
           |  |  | 29 |   | 
        
           |  |  | 30 |     Example context (json):
 | 
        
           |  |  | 31 |     {
 | 
        
           |  |  | 32 |         "elementid": "exampleId:1",
 | 
        
           |  |  | 33 |         "elementidescaped": "exampleId\\:1",
 | 
        
           |  |  | 34 |         "texdocsurl": "http://abc.com",
 | 
        
           |  |  | 35 |         "equation": "\\Downarrow ",
 | 
        
           |  |  | 36 |         "delimiters": {
 | 
        
           |  |  | 37 |             "start": "",
 | 
        
           |  |  | 38 |             "end": ""
 | 
        
           |  |  | 39 |         },
 | 
        
           |  |  | 40 |         "libraries": {
 | 
        
           |  |  | 41 |             "group1": [
 | 
        
           |  |  | 42 |                 "\\Downarrow "
 | 
        
           |  |  | 43 |             ]
 | 
        
           |  |  | 44 |         }
 | 
        
           |  |  | 45 |     }
 | 
        
           |  |  | 46 | }}
 | 
        
           |  |  | 47 | {{< core/modal }}
 | 
        
           |  |  | 48 |   | 
        
           |  |  | 49 |     {{$title}}
 | 
        
           |  |  | 50 |         {{#str}} modaltitle, tiny_equation {{/str}}
 | 
        
           |  |  | 51 |     {{/title}}
 | 
        
           |  |  | 52 |   | 
        
           |  |  | 53 |     {{$body}}
 | 
        
           |  |  | 54 |         <form class="mform" id="{{uniqid}}">
 | 
        
           |  |  | 55 |             {{> tiny_equation/modal_library }}
 | 
        
           |  |  | 56 |             <label for="{{elementid}}_tiny_equation_equation">{{#str}} editequation, tiny_equation, {{texdocsurl}} {{/str}}</label>
 | 
        
           |  |  | 57 |             <textarea class="fullwidth text-ltr tiny_equation_equation w-100" id="{{elementid}}_tiny_equation_equation" rows="8">{{equation}}</textarea>
 | 
        
           |  |  | 58 |             <label for="{{elementid}}_tiny_equation_preview">{{#str}} preview, tiny_equation {{/str}}</label>
 | 
        
           |  |  | 59 |             <div aria-describedby="{{elementid}}_cursorinfo" class="border rounded bg-light p-1 fullwidth tiny_equation_preview" id="{{elementid}}__tiny_equation_preview"></div>
 | 
        
           |  |  | 60 |             <div id="{{elementid}}_cursorinfo">{{#str}} cursorinfo, tiny_equation {{/str}}</div>
 | 
        
           |  |  | 61 |         </form>
 | 
        
           |  |  | 62 |     {{/body}}
 | 
        
           |  |  | 63 |   | 
        
           |  |  | 64 |     {{$footer}}
 | 
        
           |  |  | 65 |         <button type="button" class="btn btn-primary" data-action="save">{{#str}} saveequation, tiny_equation{{/str}}</button>
 | 
        
           |  |  | 66 |     {{/footer}}
 | 
        
           |  |  | 67 |   | 
        
           |  |  | 68 | {{/ core/modal }}
 |