1
|
#IF !PAYLOAD_CREATE_LOADED
|
2
|
#DEFINE PAYLOAD_CREATE_LOADED
|
3
|
<!--
|
4
|
SPDX-License-Identifier: GPL-3.0-or-later OR CC-BY-SA-4.0
|
5
|
|
6
|
Simple site payload creation form.
|
7
|
|
8
|
This file is part of Haketilo.
|
9
|
|
10
|
Copyright (C) 2022 Wojtek Kosior <koszko@koszko.org>
|
11
|
|
12
|
File is dual-licensed. You can choose either GPLv3+, CC BY-SA or both.
|
13
|
|
14
|
This program is free software: you can redistribute it and/or modify
|
15
|
it under the terms of the GNU General Public License as published by
|
16
|
the Free Software Foundation, either version 3 of the License, or
|
17
|
(at your option) any later version.
|
18
|
|
19
|
This program is distributed in the hope that it will be useful,
|
20
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
21
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
22
|
GNU General Public License for more details.
|
23
|
|
24
|
You should have received a copy of the GNU General Public License
|
25
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
26
|
|
27
|
I, Wojtek Kosior, thereby promise not to sue for violation of this file's
|
28
|
licenses. Although I request that you do not make use of this code in a
|
29
|
proprietary program, I am not going to enforce this in court.
|
30
|
-->
|
31
|
|
32
|
<!--
|
33
|
This is not a standalone page. This file is meant to be imported into other
|
34
|
HTML code.
|
35
|
-->
|
36
|
|
37
|
#INCLUDE html/dialog.html
|
38
|
|
39
|
#LOADCSS html/reset.css
|
40
|
#LOADCSS html/base.css
|
41
|
#LOADCSS html/grid.css
|
42
|
<style>
|
43
|
.payload_create_main_view {
|
44
|
overflow-y:auto;
|
45
|
height: var(--content-height);
|
46
|
}
|
47
|
.payload_create_form {
|
48
|
margin: 0 0.6em;
|
49
|
padding-top: 1em;
|
50
|
}
|
51
|
.payload_create_form>* {
|
52
|
margin: 0.3em 0;
|
53
|
}
|
54
|
.payload_create_form>textarea {
|
55
|
resize: vertical;
|
56
|
height: 5em;
|
57
|
}
|
58
|
.payload_create_form>textarea.payload_create_script {
|
59
|
height: 18em;
|
60
|
font-family: monospace;
|
61
|
}
|
62
|
.payload_create_buts {
|
63
|
text-align: center;
|
64
|
margin: 0.5em 0;
|
65
|
}
|
66
|
</style>
|
67
|
<template>
|
68
|
<div id="payload_create" data-template="main_div"
|
69
|
class="payload_create_main_view">
|
70
|
<div data-template="form_container">
|
71
|
<div class="grid_1 payload_create_form">
|
72
|
<span>
|
73
|
<label>identifier*</label>
|
74
|
(may only contain digits 0-9, lowercase letters a-z and hyphens '-';
|
75
|
will have 'local-' prepended):
|
76
|
</span>
|
77
|
<input data-template="identifier">
|
78
|
<span>
|
79
|
<label>long name</label> (defaults to the same as identifier):
|
80
|
</span>
|
81
|
<input data-template="long_name">
|
82
|
<span><label>description</label>:</span>
|
83
|
<textarea data-template="description"></textarea>
|
84
|
<span>
|
85
|
<label><a data-template="patterns_link">URL patterns</a>*</label>
|
86
|
(put each on its own line):
|
87
|
</span>
|
88
|
<textarea data-template="patterns">https://example.com/***</textarea>
|
89
|
<span><label>script to inject*</label>:</span>
|
90
|
<textarea data-template="script" class="payload_create_script"
|
91
|
>console.log("Hello, World!");</textarea>
|
92
|
<div class="payload_create_buts">
|
93
|
<button data-template="create_but">Create</button>
|
94
|
</div>
|
95
|
</div>
|
96
|
</div>
|
97
|
<div data-template="dialog_container" class="hide">
|
98
|
<!-- dialog div will be dynamically inserted here -->
|
99
|
</div>
|
100
|
</div>
|
101
|
</template>
|
102
|
#ENDIF
|