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 core/modal_copytoclipboard
|
|
|
19 |
|
|
|
20 |
This template renders a modal. The body contains a readonly input text field.
|
|
|
21 |
The Footer contains a button "Copy to clipboard" that copies the content
|
|
|
22 |
of the text field into the clipboard.
|
|
|
23 |
The purpose of the dialog element is to copy a permalink of a section into
|
|
|
24 |
the clipboard. Thus, the header of the modal dialog contains the label "Permalink".
|
|
|
25 |
|
|
|
26 |
Example context (json):
|
|
|
27 |
{
|
|
|
28 |
"text": "content for the input field that is being copied to the clipboard"
|
|
|
29 |
}
|
|
|
30 |
}}
|
|
|
31 |
{{< core/modal }}
|
|
|
32 |
{{$title}}{{#str}} copytoclipboard, core {{/str}}{{/title}}
|
|
|
33 |
{{$body}}
|
|
|
34 |
{{^useTextArea}}
|
|
|
35 |
<input type="text" id="directionlink-modal-{{uniqid}}" class="form-control bg-white" readonly {{!
|
|
|
36 |
}} value="{{{text}}}"{{!
|
|
|
37 |
}}/>
|
|
|
38 |
{{/useTextArea}}
|
|
|
39 |
{{#useTextArea}}
|
|
|
40 |
<textarea id="directionlink-modal-{{uniqid}}" class="form-control bg-white" readonly {{!
|
|
|
41 |
}}>{{{text}}}</textarea>
|
|
|
42 |
{{/useTextArea}}
|
|
|
43 |
{{/body}}
|
|
|
44 |
{{$footer}}
|
|
|
45 |
<a {{!
|
|
|
46 |
}} href="#" {{!
|
|
|
47 |
}} class="btn btn-primary" {{!
|
|
|
48 |
}} data-action="copytoclipboard" {{!
|
|
|
49 |
}} data-clipboard-target="#directionlink-modal-{{uniqid}}" {{!
|
|
|
50 |
}} data-clipboard-success-message="{{#quote}}{{#str}} textcopiedtoclipboard, core {{/str}}{{/quote}}" {{!
|
|
|
51 |
}}>
|
|
|
52 |
{{#pix}} t/copy, core, {{#str}} copytoclipboard, core {{/str}} {{/pix}}
|
|
|
53 |
{{#str}} copytoclipboard, core {{/str}}
|
|
|
54 |
</a>
|
|
|
55 |
{{/footer}}
|
|
|
56 |
{{/ core/modal }}
|