diff --git a/api/phpminif/builder/.htaccess b/api/phpminif/builder/.htaccess
new file mode 100644
index 0000000..53cac3b
--- /dev/null
+++ b/api/phpminif/builder/.htaccess
@@ -0,0 +1,4 @@
+
Found by bookmarklet: /
'); + var $p = $('#bmUris p'); + for (; i < l; i++) { + $p.append($('').text(found[i])[0]); + if (i < (l - 1)) { + $p.append(', /'); + } + } + $('#bmUris a').click(function () { + MUB.addButtonClick(); + $('#sources li:last input').val(this.innerHTML); + MUB.liUpdateTestLink.call($('#sources li:last')[0]); + $('#results').hide(); + return false; + }).attr({title:'Add file +'}); + } else { + // setup bookmarklet 1 + $.ajax({ + url : '../?f=' + location.pathname.replace(/\/[^\/]*$/, '/bm.js').substr(1), + success : function (code) { + $('#bm')[0].href = code + .replace('%BUILDER_URL%', location.href) + .replace(/\n/g, ' '); + }, + dataType : 'text' + }); + if ($.browser.msie) { + $('#getBm p:last').append(' Sorry, not supported in MSIE!'); + } + MUB.addButtonClick(); + } + // setup bookmarklet 2 + $.ajax({ + url : '../?f=' + location.pathname.replace(/\/[^\/]*$/, '/bm2.js').substr(1), + success : function (code) { + $('#bm2')[0].href = code.replace(/\n/g, ' '); + }, + dataType : 'text' + }); + MUB.checkRewrite(); + } +}; +$(MUB.init); diff --git a/api/phpminif/builder/bm.js b/api/phpminif/builder/bm.js new file mode 100644 index 0000000..10d1943 --- /dev/null +++ b/api/phpminif/builder/bm.js @@ -0,0 +1,36 @@ +javascript:(function() { + var d = document + ,uris = [] + ,i = 0 + ,o + ,home = (location + '').split('/').splice(0, 3).join('/') + '/'; + function add(uri) { + return (0 === uri.indexOf(home)) + && (!/[\?&]/.test(uri)) + && uris.push(escape(uri.substr(home.length))); + }; + function sheet(ss) { + // we must check the domain with add() before accessing ss.cssRules + // otherwise a security exception will be thrown + if (ss.href && add(ss.href) && ss.cssRules) { + var i = 0, r; + while (r = ss.cssRules[i++]) + r.styleSheet && sheet(r.styleSheet); + } + }; + while (o = d.getElementsByTagName('script')[i++]) + o.src && !(o.type && /vbs/i.test(o.type)) && add(o.src); + i = 0; + while (o = d.styleSheets[i++]) + /* http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-DocumentStyle-styleSheets + document.styleSheet is a list property where [0] accesses the 1st element and + [outOfRange] returns null. In IE, styleSheets is a function, and also throws an + exception when you check the out of bounds index. (sigh) */ + sheet(o); + if (uris.length) + window.open('%BUILDER_URL%#' + uris.join(',')); + else + alert('No js/css files found with URLs within "' + + home.split('/')[2] + + '".\n(This tool is limited to URLs with the same domain.)'); +})(); \ No newline at end of file diff --git a/api/phpminif/builder/bm2.js b/api/phpminif/builder/bm2.js new file mode 100644 index 0000000..6b558ce --- /dev/null +++ b/api/phpminif/builder/bm2.js @@ -0,0 +1,15 @@ +javascript:(function(){ + var d = document + ,c = d.cookie + ,m = c.match(/\bminifyDebug=([^; ]+)/) + ,v = m ? decodeURIComponent(m[1]) : '' + ,p = prompt('Debug Minify URIs on ' + location.hostname + ' which contain:' + + '\n(empty for none, space = OR, * = any string, ? = any char)', v) + ; + if (p === null) return; + p = p.replace(/^\s+|\s+$/, ''); + v = (p === '') + ? 'minifyDebug=; expires=Fri, 27 Jul 2001 02:47:11 UTC; path=/' + : 'minifyDebug=' + encodeURIComponent(p) + '; path=/'; + d.cookie = v; +})(); \ No newline at end of file diff --git a/api/phpminif/builder/index.php b/api/phpminif/builder/index.php new file mode 100644 index 0000000..7f3fc74 --- /dev/null +++ b/api/phpminif/builder/index.php @@ -0,0 +1,240 @@ + $min_builderPassword)); +} + +$cachePathCode = ''; +if (! isset($min_cachePath) && ! function_exists('sys_get_temp_dir')) { + $detectedTmp = Minify_Cache_File::tmp(); + $cachePathCode = "\$min_cachePath = " . var_export($detectedTmp, 1) . ';'; +} + +ob_start(); +?> + +Uh Oh. Minify was unable to + serve Javascript for this app. To troubleshoot this, + enable FirePHP debugging + and request the Minify URL directly. Hopefully the + FirePHP console will report the cause of the error. +
+ + +Note: was discovered as a usable temp directory.
To
+ slightly improve performance you can hardcode this in /min/config.php:
+
Note: Your webserver does not seem to + support mod_rewrite (used in /min/.htaccess). Your Minify URIs will contain "?", which +may reduce the benefit of proxy cache servers.
+ +Create a list of Javascript or CSS files (or 1 is fine) you'd like to combine +and click [Update].
+ +Place this URI in your HTML to serve the files above combined, minified, compressed and +with cache headers.
+URI | /min (opens in new window) |
---|---|
HTML |
For the best performance you can serve these files as a pre-defined group with a URI
+like: /min/?g=keyName
To do this, add a line like this to /min/groupsConfig.php:
+ +return array(
+ ... your existing groups here ...
+
+);
+
+Make sure to replace keyName
with a unique key for this group.
You can use the bookmarklet below to fetch all CSS & Javascript URIs from a page +on your site. When you active it, this page will open in a new window with a list of +available URIs to add.
+ +Create Minify URIs (right-click, add to bookmarks)
+@import
If your CSS files contain @import
declarations, Minify will not
+remove them. Therefore, you will want to remove those that point to files already
+in your list, and move any others to the top of the first file in your list
+(imports below any styles will be ignored by browsers as invalid).
If you desire, you can use Minify URIs in imports and they will not be touched
+by Minify. E.g. @import "/min/?g=css2";
When /min/config.php has $min_allowDebugFlag = true;
+ you can get debug output by appending &debug
to a Minify URL, or
+ by sending the cookie minDebug=<match>
, where <match>
+ should be a string in the Minify URIs you'd like to debug. This bookmarklet will allow you to
+ set this cookie.
Minify Debug (right-click, add to bookmarks)
+ +Need help? Check the wiki, + or post to the discussion + list.
+Powered by Minify
+ + + + + + $content + ,'id' => __FILE__ + ,'lastModifiedTime' => max( + // regenerate cache if any of these change + filemtime(__FILE__) + ,filemtime(dirname(__FILE__) . '/../config.php') + ,filemtime(dirname(__FILE__) . '/../lib/Minify.php') + ) + ,'minifyAll' => true + ,'encodeOutput' => $encodeOutput +)); diff --git a/api/phpminif/builder/jquery-1.6.3.min.js b/api/phpminif/builder/jquery-1.6.3.min.js new file mode 100644 index 0000000..89b1521 --- /dev/null +++ b/api/phpminif/builder/jquery-1.6.3.min.js @@ -0,0 +1,4 @@ +/*! jQuery v1.6.3 http://jquery.com/ | http://jquery.org/license */ +(function(a,b){function cu(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cr(a){if(!cg[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ch||(ch=c.createElement("iframe"),ch.frameBorder=ch.width=ch.height=0),b.appendChild(ch);if(!ci||!ch.createElement)ci=(ch.contentWindow||ch.contentDocument).document,ci.write((c.compatMode==="CSS1Compat"?"":"")+""),ci.close();d=ci.createElement(a),ci.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ch)}cg[a]=e}return cg[a]}function cq(a,b){var c={};f.each(cm.concat.apply([],cm.slice(0,b)),function(){c[this]=a});return c}function cp(){cn=b}function co(){setTimeout(cp,0);return cn=f.now()}function cf(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ce(){try{return new a.XMLHttpRequest}catch(b){}}function b$(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){c!=="border"&&f.each(e,function(){c||(d-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?d+=parseFloat(f.css(a,c+this))||0:d-=parseFloat(f.css(a,"border"+this+"Width"))||0});return d+"px"}d=bv(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0,c&&f.each(e,function(){d+=parseFloat(f.css(a,"padding"+this))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+this+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+this))||0)});return d+"px"}function bl(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bd,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bk(a){f.nodeName(a,"input")?bj(a):"getElementsByTagName"in a&&f.grep(a.getElementsByTagName("input"),bj)}function bj(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bi(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function bh(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bg(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c=f.expando,d=f.data(a),e=f.data(b,d);if(d=d[c]){var g=d.events;e=e[c]=f.extend({},d);if(g){delete e.handle,e.events={};for(var h in g)for(var i=0,j=g[h].length;it |