Permalink
Browse files

minor fixes from home

  • Loading branch information...
1 parent b47c5e9 commit 5ff8b5572f1df8ee9bb5355111b36e71a21e120d @mrclay mrclay committed with Oct 14, 2011
Showing with 56 additions and 59 deletions.
  1. +43 −44 min/builder/index.php
  2. +4 −0 min/builder/jquery-1.6.3.min.js
  3. +9 −15 min/lib/Minify.php
View
@@ -53,7 +53,7 @@
ob_start();
?>
-<!DOCTYPE HTML>
+<!DOCTYPE html>
<title>Minify URI Builder</title>
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
<style>
@@ -176,52 +176,51 @@
list</a>.</p>
<p><small>Powered by Minify <?php echo Minify::VERSION; ?></small></p>
-<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
+<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js"></script>
+<script>window.jQuery || document.write('<script src="jquery-1.6.3.min.js"><\/script>')</script>
<script>
-$(function () {
- // give Minify a few seconds to serve _index.js before showing scary red warning
- setTimeout(function () {
- if (! window.MUB) {
- // Minify didn't load
- $('#jsDidntLoad').css({display:'block'});
- }
- }, 3000);
-
- // detection of double output encoding
- var msg = '<\p class=topWarning><\strong>Warning:<\/strong> ';
- var url = 'ocCheck.php?' + (new Date()).getTime();
- $.get(url, function (ocStatus) {
- $.get(url + '&hello=1', function (ocHello) {
- if (ocHello != 'World!') {
- msg += 'It appears output is being automatically compressed, interfering '
- + ' with Minify\'s own compression. ';
- if (ocStatus == '1')
- msg += 'The option "zlib.output_compression" is enabled in your PHP configuration. '
- + 'Minify set this to "0", but it had no effect. This option must be disabled '
- + 'in php.ini or .htaccess.';
- else
- msg += 'The option "zlib.output_compression" is disabled in your PHP configuration '
- + 'so this behavior is likely due to a server option.';
- $(document.body).prepend(msg + '<\/p>');
- } else
- if (ocStatus == '1')
- $(document.body).prepend('<\p class=topNote><\strong>Note:</\strong> The option '
- + '"zlib.output_compression" is enabled in your PHP configuration, but has been '
- + 'successfully disabled via ini_set(). If you experience mangled output you '
- + 'may want to consider disabling this option in your PHP configuration.<\/p>'
- );
+(function () {
+ // workaround required to test when /min isn't child of web root
+ var src = "../?f=" + location.pathname.replace(/\/[^\/]*$/, '/_index.js').substr(1);
+ // load script immediately
+ document.write('<\script src="' + src + '"><\/script>');
+ $(function () {
+ $('#builderScriptSrc')[0].href = src;
+ // give Minify a few seconds to serve _index.js before showing scary red warning
+ setTimeout(function () {
+ if (! window.MUB) {
+ // Minify didn't load
+ $('#jsDidntLoad').css({display:'block'});
+ }
+ }, 3000);
+
+ // detection of double output encoding
+ var msg = '<\p class=topWarning><\strong>Warning:<\/strong> ';
+ var url = 'ocCheck.php?' + (new Date()).getTime();
+ $.get(url, function (ocStatus) {
+ $.get(url + '&hello=1', function (ocHello) {
+ if (ocHello != 'World!') {
+ msg += 'It appears output is being automatically compressed, interfering '
+ + ' with Minify\'s own compression. ';
+ if (ocStatus == '1')
+ msg += 'The option "zlib.output_compression" is enabled in your PHP configuration. '
+ + 'Minify set this to "0", but it had no effect. This option must be disabled '
+ + 'in php.ini or .htaccess.';
+ else
+ msg += 'The option "zlib.output_compression" is disabled in your PHP configuration '
+ + 'so this behavior is likely due to a server option.';
+ $(document.body).prepend(msg + '<\/p>');
+ } else
+ if (ocStatus == '1')
+ $(document.body).prepend('<\p class=topNote><\strong>Note:</\strong> The option '
+ + '"zlib.output_compression" is enabled in your PHP configuration, but has been '
+ + 'successfully disabled via ini_set(). If you experience mangled output you '
+ + 'may want to consider disabling this option in your PHP configuration.<\/p>'
+ );
+ });
});
});
-});
-</script>
-<script>
-// workaround required to test when /min isn't child of web root
-var src = location.pathname.replace(/\/[^\/]*$/, '/_index.js').substr(1);
-src = "../?f=" + src;
-document.write('<\script type="text/javascript" src="' + src + '"><\/script>');
-$(function () {
- $('#builderScriptSrc')[0].href = src;
-});
+})();
</script>
</body>
<?php
Oops, something went wrong.

0 comments on commit 5ff8b55

Please sign in to comment.