-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAutoTab_test.html
143 lines (127 loc) · 4.96 KB
/
AutoTab_test.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sample Web Page with All Input Types</title>
<style>
body {
font-family: 'Arial', sans-serif;
background-color: #f4f4f9;
color: #333;
margin: 0;
padding: 20px;
}
h1 {
color: #4a90e2;
text-align: center;
}
.editable {
border: 1px solid #ccc;
padding: 10px;
margin-bottom: 10px;
background-color: #fff;
border-radius: 5px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
textarea, input[type="text"], input[type="password"], input[type="email"],
input[type="tel"], input[type="url"], input[type="search"], input[type="number"],
input[type="range"], input[type="date"], input[type="time"], input[type="datetime-local"],
input[type="month"], input[type="week"], input[type="color"], input[type="file"] {
width: 100%;
padding: 10px;
border: 1px solid #ccc;
margin-bottom: 10px;
box-sizing: border-box;
border-radius: 5px;
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}
input[type="checkbox"], input[type="radio"] {
margin-right: 5px;
}
button {
background-color: #4a90e2;
color: white;
border: none;
padding: 10px 20px;
margin: 5px;
border-radius: 5px;
cursor: pointer;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
button:hover {
background-color: #357ab8;
}
#editor {
height: 300px;
}
#parentContainer {
margin-top: 20px;
}
</style>
<link href="https://cdn.quilljs.com/1.3.6/quill.snow.css" rel="stylesheet">
</head>
<body>
<h1>AutoTab Test</h1>
<div id="parentContainer"></div>
<button id="addTextInput">Add Text Input</button>
<button id="addTextarea">Add Textarea</button>
<button id="addContentEditable">Add Content Editable Div</button>
<br/><br/>
<label for="name">Input (text):</label>
<input type="text" id="input-text-field" name="input-text-field" placeholder="This is an input text field."><br><br>
<label for="name">Input (search):</label>
<input type="search" id="input-search-field" name="input-search-field" placeholder="This is an input search field."><br><br>
<label for="message">Textarea:</label>
<textarea id="textarea-field" name="textarea-field" placeholder="This is a textarea."></textarea><br>
<p>Editable DIV:</p>
<div class="editable" contenteditable="true">This div does not contain any paragraph tags.</div><br>
<div id="quill-editor"></div>
<p>Editable DIV with Single paragraph:</p>
<div class="editable" contenteditable="true" style="color: blue"><p>Paragraph 1</p></div><br><br>
<p>Editable DIV with MULTIPLE paragraphs:</p>
<div class="editable" contenteditable="true">
<p>Paragraph 1</p>
<p>Paragraph 2</p>
<p>Paragraph 3</p>
</div><br><br>
<script src="https://cdn.quilljs.com/1.3.6/quill.min.js"></script>
<script>
const parentContainer = document.getElementById('parentContainer');
const addTextInputButton = document.getElementById('addTextInput');
const addTextareaButton = document.getElementById('addTextarea');
const addContentEditableButton = document.getElementById('addContentEditable');
// Initialize Quill Editor
var quill = new Quill('#quill-editor', {
theme: 'snow', // Options: 'snow' or 'bubble'
placeholder: 'Start typing in the Quill editor...',
modules: {
toolbar: [
[{ 'header': [1, 2, false] }],
['bold', 'italic', 'underline'],
[{ 'list': 'ordered' }, { 'list': 'bullet' }],
['link', 'image']
]
}
});
addTextInputButton.addEventListener('click', () => {
const input = document.createElement('input');
input.type = 'text';
input.placeholder = 'Dynamic <input>.';
parentContainer.appendChild(input);
});
addTextareaButton.addEventListener('click', () => {
const textarea = document.createElement('textarea');
textarea.placeholder = 'Dynamic <textarea>.';
parentContainer.appendChild(textarea);
});
addContentEditableButton.addEventListener('click', () => {
const div = document.createElement('div');
div.contentEditable = true;
div.classList.add('editable');
div.textContent = "Edit me! I'm dynamic.";
parentContainer.appendChild(div);
});
</script>
</body>
</html>