public static function clean($css) { $maximizer = new CSS3Maximizer(); // try { $maximized = $maximizer->clean(['css' => $css]); // } catch(Exception $e) { // Ajde_Exception_Log::logException($e); // return $css; // } return $maximized; }
<body> <form method="POST"> <input type="submit" value="Maximize CSS!" title="Create Cross-Browser Code!" style="margin-bottom: 7px"> <input type="checkbox" value="checked" <?php echo $_POST['compress'] ? "checked" : ""; ?> name="compress" id="compress"><label for="compress" title="Minify code!">Compress</label> <a href="http://dev.w3.org/csswg/" style="float: right;" title="CSS Working Group"><img src="html5-badge-h-css3.png" style="height: 35px"></a> <br> <textarea id="css" name="q" style="width: 97%; height: 1000px"> <?php if ($_POST['q']) { // maximize css require_once "./CSS3Maximizer.php"; require_once "./inc/ColorSpace.php"; $CSS3Maximizer = new CSS3Maximizer(); $compress = $_POST['compress'] ? true : false; $css = $CSS3Maximizer->clean($_POST['q'], $compress); echo <<<X {$css} </textarea> </form> </body> </html> X; } else { echo <<<X #example { \tbackground: #0d0d0d; \tbackground: -webkit-gradient(linear, center top, center bottom, from(#777), color-stop(10%,#333), to(#000000)); \tborder: 1px solid rgba(0,0,0,0.5);