-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathindex.html
124 lines (119 loc) · 4.9 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="google-site-verification" content="3tgjKRYCVRWTziuUgYny5vY4eU7Vddvat0pLnoCuPBs">
<title>HTML Minifier Terser</title>
<link rel="stylesheet" href="./main.css">
<style>
[x-cloak] {
display: none !important;
}
</style>
</head>
<body>
<div class="wrapper">
<h1 class="header">HTML Minifier <span id='minifer-version'></span></h1>
<div class="main" x-data="minifier" x-cloak>
<div class="workspace">
<textarea rows="8" cols="40" class="input-content" x-model="input"></textarea>
<div class="mr-1">
<button type="button" @click="minifyInput()">Minify</button>
<template x-if="support.fileReader">
<input type="file" x-ref="file" multiple @change="selectFile">
</template>
<template x-if="selectedVariant">
<a :href="dataUrl()" :download="selectedVariant.name">
Download
</a>
</template>
</div>
<textarea rows="8" cols="40" class="output-content" readonly x-model="output"></textarea>
<template x-if="stats.variants.length != 0">
<table width="100%" cellpadding="5" border="1">
<thead>
<tr>
<th>Title</th>
<th colspan="2">Size (bytes / percentage)</th>
<th colspan="2">Elapsed (ms / percentage)</th>
</tr>
</thead>
<tbody>
<template x-for="variant in stats.variants">
<tr @click="selectVariant(variant)"
:style="variant.title == selectedVariant.title ? 'border-bottom: 1px solid black' : ''">
<td x-text="variant.title"></td>
<td align="right">
<span x-text="variant.compression.size"></span>
</td>
<td align="right">
<span x-text="variant.ratio.size"></span>%
</td>
<td align="right">
<span x-text="variant.compression.elapsed"></span>
</td>
<td align="right">
<span x-text="variant.ratio.elapsed"></span>%
</td>
</tr>
</template>
</tbody>
</table>
</template>
<p x-text="stats.text" :class="stats.result"></p>
</div>
<div class="options">
<form class="mr-1">
<template x-for="option in options">
<div>
<template x-if="option.type === 'checkbox'">
<div class="form-group">
<input type="checkbox" :id="option.id" x-model="option.checked">
<label :for="option.id" x-text="option.label" :class="option.unsafe ? 'unsafe' : ''"></label>
<template x-if="option.helpText">
<span class="quiet short" x-html="option.helpText"></span>
</template>
</div>
</template>
<template x-if="option.type === 'text'">
<div class="form-group">
<label :for="option.id" x-text="option.label" :class="option.unsafe ? 'unsafe' : ''"></label>
<input type="text" :id="option.id" x-model="option.value">
<template x-if="option.helpText">
<span class="quiet short" x-html="option.helpText"></span>
</template>
</div>
</template>
<template x-if="option.type === 'number'">
<div class="form-group">
<label :for="option.id" x-text="option.label" :class="option.unsafe ? 'unsafe' : ''"></label>
<input type="number" :id="option.id" x-model="option.value">
<template x-if="option.helpText">
<span class="quiet short" x-html="option.helpText"></span>
</template>
</div>
</template>
</div>
</template>
</form>
<div>
<span>Select:</span>
<a href="#" @click.prevent="selectAllOptions(true)">All</a>,
<a href="#" @click.prevent="selectAllOptions(false)">None</a>,
<a href="#" @click.prevent="resetOptions()">Reset</a>
</div>
</div>
</div>
<div class="footer">
<p class="quiet">
HTMLMinifier is made by <a href="http://perfectionkills.com/">kangax</a>,
using tweaked version of HTML parser by <a href="http://ejohn.org/">John Resig</a>
(which, in its turn, is based on work of <a href="http://erik.eae.net/">Erik Arvidsson</a>).
Source and bugtracker are <a href="https://github.com/terser/html-minifier-terser">hosted on GitHub</a>.
</p>
</div>
</div>
<script src="./main.js" type="module"></script>
</body>
</html>