<body>
<div>
<div id="wrapper">
- <h1>HTML Minifier <span style="font-size:0.6em">(ver. 0.2)</span></h1>
+ <h1>HTML Minifier <span style="font-size:0.6em">(ver. 0.3)</span></h1>
<textarea rows="8" cols="40" id="input"></textarea>
- <div id="options">
- <ul>
- <li>
- <input type="checkbox" id="remove-comments" checked>
- <label for="remove-comments">Remove comments (</label>
- <input type="checkbox" id="remove-comments-from-cdata" checked>
- <label for="remove-comments-from-cdata">also from scripts and styles )</label>
- <span class="quiet short" style="margin-left:1.5em">
- Conditional comments are left intact.
+ <p style="width:65%">
+ <button type="button" id="convert-btn">Convert</button>
+ </p>
+ <textarea rows="8" cols="40" id="output" readonly></textarea>
+ </div>
+ <div id="options">
+ <ul>
+ <li>
+ <input type="checkbox" id="remove-comments" checked>
+ <label for="remove-comments">Remove comments (</label>
+ <input type="checkbox" id="remove-comments-from-cdata" checked>
+ <label for="remove-comments-from-cdata">also from scripts and styles )</label>
+ <span class="quiet short" style="margin-left:1.5em">
+ Conditional comments are left intact.
+ </span>
+ </li>
+ <li>
+ <input type="checkbox" id="remove-cdata-sections-from-cdata" checked>
+ <label for="remove-cdata-sections-from-cdata">Remove CDATA sections from scripts and styles</label>
+ </li>
+ <li>
+ <input type="checkbox" id="collapse-whitespace" checked>
+ <label for="collapse-whitespace">Collapse whitespace</label>
+ </li>
+ <li>
+ <input type="checkbox" id="collapse-boolean-attributes" checked>
+ <label for="collapse-boolean-attributes">
+ Collapse boolean attributes
+ <br>
+ <span class="quiet short">
+ (e.g. <code><... disabled="disabled"> → <... disabled></code>)
+ </span>
+ </label>
+ </li>
+ <li>
+ <input type="checkbox" id="remove-attribute-quotes" checked>
+ <label for="remove-attribute-quotes">
+ Remove attribute quotes
+ <br>
+ <span class="quiet">
+ (e.g. <code><p class="foo"> → <p class=foo></code>)
+ </span>
+ </label>
+ </li>
+ <li>
+ <input type="checkbox" id="remove-redundant-attributes" checked>
+ <label for="remove-redundant-attributes">Remove redundant attributes/values</label>
+ <div class="quiet">
+ <code><script language="Javascript" ...></code><br>
+ <code><form method="get" ...></code><br>
+ <code><input type="text" ...></code><br>
+ <code><script src="..." charset="..."></code><br>
+ <code><a id="..." name="..."></code><br>
+ <code><... onclick="javascript:..." ...></code>
+ </div>
+ </li>
+ <li>
+ <input type="checkbox" id="use-short-doctype" checked>
+ <label for="use-short-doctype" title="i.e. <!DOCTYPE html>">
+ Use short doctype
+ </label>
+ </li>
+ <li>
+ <input type="checkbox" id="remove-empty-attributes" checked>
+ <label for="remove-empty-attributes">
+ Remove empty (or blank) attributes
+ <br>
+ <span class="quiet short">
+ Valid attributes are: class, id, style, title, lang, dir, event attributes
</span>
- </li>
- <li>
- <input type="checkbox" id="remove-cdata-sections-from-cdata" checked>
- <label for="remove-cdata-sections-from-cdata">Remove CDATA sections from scripts and styles</label>
- </li>
- <li>
- <input type="checkbox" id="collapse-whitespace" checked>
- <label for="collapse-whitespace">Collapse whitespace</label>
- </li>
- <li>
- <input type="checkbox" id="collapse-boolean-attributes" checked>
- <label for="collapse-boolean-attributes">
- Collapse boolean attributes
- <br>
- <span class="quiet short">
- (e.g. <code><... disabled="disabled"> → <... disabled></code>)
- </span>
- </label>
- </li>
- <li>
- <input type="checkbox" id="remove-attribute-quotes" checked>
- <label for="remove-attribute-quotes">
- Remove attribute quotes
- <br>
- <span class="quiet">
- (e.g. <code><p class="foo"> → <p class=foo></code>)
- </span>
- </label>
- </li>
- <li>
- <input type="checkbox" id="remove-redundant-attributes" checked>
- <label for="remove-redundant-attributes">Remove redundant attributes/values</label>
- <div class="quiet">
- <code><script language="Javascript" ...></code><br>
- <code><form method="get" ...></code><br>
- <code><input type="text" ...></code><br>
- <code><script src="..." charset="..."></code><br>
- <code><a id="..." name="..."></code><br>
- <code><... onclick="javascript:..." ...></code>
- </div>
- </li>
- <li>
- <input type="checkbox" id="use-short-doctype" checked>
- <label for="use-short-doctype" title="i.e. <!DOCTYPE html>">
- Use short doctype
- </label>
- </li>
- <li>
- <input type="checkbox" id="remove-empty-attributes" checked>
- <label for="remove-empty-attributes">
- Remove empty (or blank) attributes
- <br>
- <span class="quiet short">
- Valid attributes are: class, id, style, title, lang, dir, event attributes
- </span>
- </label>
- </li>
- <li>
- <input type="checkbox" id="remove-empty-elements">
- <label for="remove-empty-elements">
- Remove empty elements
- <br>
- <span class="quiet short">
- All except <code>textarea</code>
- </span>
- </label>
- </li>
- </ul>
- </div>
+ </label>
+ </li>
+ <li>
+ <input type="checkbox" id="remove-optional-tags" checked>
+ <label for="remove-optional-tags">
+ Remove optional tags
+ <br>
+ <span class="quiet short">
+ Currently, only <code></html></code> and <code></body></code>
+ </span>
+ </label>
+ </li>
+ <li>
+ <input type="checkbox" id="remove-empty-elements">
+ <label for="remove-empty-elements">
+ Remove empty elements
+ <br>
+ <span class="quiet short">
+ All except <code>textarea</code>
+ </span>
+ </label>
+ </li>
+ </ul>
</div>
- <p><button type="button" id="convert-btn">Convert</button></p>
- <textarea rows="8" cols="40" id="output" readonly></textarea>
+
<p id="stats"></p>
<p id="warning">
Minifier is <strong>very draft</strong> and is <strong>not yet thoroughly tested</strong>. Use at your own risk.
h1 { margin-top: 0.5em; font-size: 1.25em; }
button { font-weight: bold; width: 100px; }
-#wrapper { overflow: hidden; min-width: 900px; }
-#input { width: 65%; }
-#output { width: 100%; height: 18em; margin-bottom: 2em; }
-#options { float: right; width: 33%; padding-left: 1em; }
+#wrapper { overflow: hidden; width: 65%; float: left; }
+#input { width: 99%; height: 18em; }
+#output { width: 99%; height: 18em; margin-bottom: 2em; }
+#options { float: right; width: 33%; padding-left: 1em; margin-top: 2.5em; min-height: 50em; }
#options ul { list-style: none; padding: 0.5em; overflow: hidden; background: #ffe; margin-top: 0; }
#options ul li { float: left; clear: both; padding-bottom: 0.5em; }
#options ul li div { margin-left: 1.75em; }
#options label, #options input { float: left; }
#options input { margin-right: 0.5em; }
#stats { margin-bottom: 2em; }
-#todo { font-family: monospace; }
+#todo { font-family: monospace; margin-bottom: 2em; }
#warning { background: #fcc; padding: 0.25em; display: inline-block; }
.success { color: green; }