diff --git a/example/.htaccess b/example/.htaccess deleted file mode 100644 index f8e3330..0000000 --- a/example/.htaccess +++ /dev/null @@ -1,10 +0,0 @@ -# Cleaner URLs for quickconcat.php -# this allows for urls like this: "/path/to/file.html,path/to/fileb.html=concat" -# or wrapped, "/path/to/file.html,path/to/fileb.html=concat&wrap" -RewriteEngine On -RewriteRule ^([^\?]+)=concat(&wrap)?$ quickconcat.php?files=$1$2 - -# compress transfer - -AddOutputFilterByType DEFLATE text/html text/css text/javascript - \ No newline at end of file diff --git a/example/css/critical.css b/example/_includes/critical.css similarity index 100% rename from example/css/critical.css rename to example/_includes/critical.css diff --git a/example/js/enhance.js b/example/_includes/enhance.js similarity index 100% rename from example/js/enhance.js rename to example/_includes/enhance.js diff --git a/example/css/general.css b/example/css/general.css deleted file mode 100644 index b85f3f4..0000000 --- a/example/css/general.css +++ /dev/null @@ -1,9 +0,0 @@ -body { - font-family: sans-serif; - margin: 50px 30%; - line-height: 1.3; -} -.explain { - border-bottom: 1px dotted #333; - padding-bottom: 2em; -} \ No newline at end of file diff --git a/example/css/sample1.css b/example/css/sample1.css deleted file mode 100644 index 3e32e5c..0000000 --- a/example/css/sample1.css +++ /dev/null @@ -1,7 +0,0 @@ - - -p.general:after { - display:block; - content: "sample1.css was loaded because it is meant for all enhanced browsers."; - margin-top: 1em; -} \ No newline at end of file diff --git a/example/index.html b/example/index.html index d13f2ca..565c180 100644 --- a/example/index.html +++ b/example/index.html @@ -1,7 +1,7 @@ --- --- - + @@ -9,14 +9,14 @@ diff --git a/example/js/enhance.config.js b/example/js/enhance.config.js deleted file mode 100644 index 94cd0bb..0000000 --- a/example/js/enhance.config.js +++ /dev/null @@ -1,75 +0,0 @@ -/* - enhance.config: this example file uses the enhance.js api to: - * determine whether a browser is qualified for enhancements - * define available CSS and JS assets - * test features and device conditions and environment to determine which files to load - * load those files via a single concatenated call -*/ -(function( win ){ - - // re-reference ejs var locally - var ejs = win.ejs, - docElem = win.document.documentElement; - - // Add your qualifications for major browser experience divisions here. - // For example, you might choose to only enhance browsers that support document.querySelectorAll (IE8+, etc). - // Use case will vary, but basic browsers: last stop here! - if( !( "querySelectorAll" in win.document ) ){ - return; - } - - // Add "enhanced" class to HTML element - docElem.className += " enhanced"; - - // Configure css and js paths, if desirable. - ejs.basepath.js = "_js/"; - ejs.basepath.css = "_css/"; - - // Define potential JS files for dynamic loading - ejs.files.js = { - domlib : "_lib/wrap.custom.js", - ajaxinc : "_lib/ajaxinclude.wrap.js", - general : "generalenhancements.js", - touch : "touch.js", - widescreen : "widescreen.js" - }; - - // Define potential CSS files for dynamic loading - ejs.files.css = { - sample : "sample1.css" - }; - - // Start queueing files for load. - // Pass js or css paths one at a time to ejs.addFile - - // Add general js enhancements to all qualified browsers - ejs.addFile( ejs.files.js.domlib ); - ejs.addFile( ejs.files.js.ajaxinc ); - ejs.addFile( ejs.files.js.general ); - - // if touch events are supported, add touch file - if( "ontouchend" in win.document ){ - ejs.addFile( ejs.files.js.touch ); - } - - // if screen is wider than 500px, add widescreen file - if( screen.width > 500 ){ - ejs.addFile( ejs.files.js.widescreen ); - } - - // add a CSS file if the body has a class of "tmpl-home" - // (beware: don't rely on loading CSS this way for styles that need to ejsly at page load or you'll get a FOUC) - - // Note: since we're using hasClass to check if the body element has a class or not, we need to wrap all remaining logic in a call to ejs.isDefined - ejs.bodyReady( function(){ - - if( ejs.hasClass( win.document.body, "tmpl-home" ) ){ - ejs.addFile( ejs.files.css.sample ); - } - - // Load the files, enhance page - ejs.enhance(); - - }); - -}( window )); \ No newline at end of file diff --git a/example/js/generalenhancements.js b/example/js/generalenhancements.js deleted file mode 100644 index 1e37d77..0000000 --- a/example/js/generalenhancements.js +++ /dev/null @@ -1,11 +0,0 @@ -// NOTE: the real contents of this file would actually do something useful. -// for demo purposes, it logs a message to the page. -(function( $ ){ - // when dom is ready... - $(function(){ - $( "

generalenhancements.js was loaded because it is meant for all enhanced browsers.

" ).appendTo( "body" ); - - // trigger ajaxIncludes - $( "[data-append],[data-replace],[data-after],[data-before]" ).ajaxInclude( "quickconcat.php?wrap&files=" ); - }); -})( wrap ); \ No newline at end of file diff --git a/example/js/lib/ajaxinclude.wrap.js b/example/js/lib/ajaxinclude.wrap.js deleted file mode 100644 index 3a71948..0000000 --- a/example/js/lib/ajaxinclude.wrap.js +++ /dev/null @@ -1,79 +0,0 @@ -/*! Ajax-include pattern. Copyright 2012, Scott Jehl, Filament Group, Inc. Dual licensed under MIT and GPLv2 */ -/* - * Original idea by Scott Gonzalez :) - * To use, place attributes on content, pointing to a URL - * that should either replace, or insert before or after that anchor - * after the page has loaded - * Replace: Latest Articles - * Before: Latest Articles - * After: Latest Articles - * Also, the data-threshold attr allows a min width for this to apply. - * After domready, you can use it like this: - $("[data-append],[data-replace],[data-after],[data-before]").ajaxInclude(); -*/ -(function( $ ){ - $.fn.ajaxInclude = function( proxy ) { - - var filelist = [], - els = this; - - return this.each(function( k ) { - var el = $( this ), - target = el.data( "target" ), - targetEl = target && $( target ) || el, - threshold = screen.width > parseFloat( el.data( "threshold" ) || 0 ), - methods = [ "append", "replace", "before", "after" ], - method, - url; - - if ( threshold ) { - - for( var ml = methods.length, i=0; i < ml; i++ ){ - if( el.is( "[data-" + methods[ i ] + "]" ) ){ - method = methods[ i ]; - url = el.attr( "data-" + method ); - } - } - - if( method === "replace" ){ - method += "With"; - } - - if( url && method ){ - - el - .data( "method", method ) - .data( "url", url ) - .bind( "ajaxInclude", function(e, data){ - var content = $(data); - - if( $(this).data( "proxy" ) ){ - content = content.filter( "entry[url=\"" + $(this).data( "url" ) + "\"]" ).html(); - } - $( this )[ $(this).data( "method" ) ]( content ); - }); - - if( proxy ){ - - el.data( "proxy", proxy ); - - if( $.inArray( url, filelist ) === -1 ){ - filelist.push( url ); - } - - if( k === els.length - 1 ){ - url = proxy + filelist.join(); - } - } - - if( !proxy || k === els.length-1 ){ - $.get( url, function( data ) { - ( proxy ? els : el ).trigger( "ajaxInclude", [data] ); - }); - } - } - - } - }); - }; -})( wrap ); diff --git a/example/js/lib/enhance.js b/example/js/lib/enhance.js deleted file mode 100644 index 96a0a2c..0000000 --- a/example/js/lib/enhance.js +++ /dev/null @@ -1,130 +0,0 @@ -/*! EnhanceJS: a progressive enhancement bootstrejser. Copyright 2012 @scottjehl, Filament Group, Inc. Licensed MIT/GPLv2 */ -(function( w, undefined ) { - - // Enable JS strict mode - "use strict"; - - var doc = w.document, - docElem = doc.documentElement, - head = doc.head || doc.getElementsByTagName( "head" )[ 0 ]; - - //ejs object for ejs-specific functions - w.ejs = {}; - - // hasClass function - check if element has a class - ejs.hasClass = function( elem, cls ){ - return elem.className.indexOf( cls ) > -1 - } - - // Callback for running logic dependent on a property being defined - // You can use isDefined to run code as soon as the document.body is defined, for example, for body-dependent scripts - // or, for a script that's loaded asynchronously that depends on other scripts, such as jQuery. - // First argument is the property that must be defined, second is the callback function - ejs.onDefine = function( prop, callback ){ - var callbackStack = []; - - if( callback ){ - callbackStack.push( callback ); - } - - function checkRun(){ - if( eval( prop ) ){ - while( callbackStack[0] && typeof( callbackStack[0] ) === "function" ){ - callbackStack.shift().call( w ); - } - } - else{ - setTimeout(checkRun, 15); - } - }; - - checkRun(); - }; - - // shortcut of isDefine body-specific - ejs.bodyReady = function( callback ){ - ejs.onDefine( "document.body", callback ); - }; - - - //private style load function - ejs.loadCSS = function( href, media ){ - var lk = doc.createElement( "link" ), - links = head.getElementsByTagName( "link" ), - lastlink = links[ links.length-1 ]; - - lk.type = "text/css"; - lk.href = href; - lk.rel = "stylesheet"; - - if( media ){ - lk.media = media; - } - if( lastlink && lastlink.nextSibling ){ - head.insertBefore(lk, lastlink.nextSibling ); - } - else { - head.appendChild( lk ); - } - }; - - // Private script load function - ejs.loadJS = function( src ){ - var script = doc.createElement( "script" ), - fc = head.firstChild; - script.src = src; - - if( fc ){ - head.insertBefore(script, fc ); - } else { - head.appendChild( script ); - } - }; - - // Define base directory paths for referencing js, css, img files. Optional. - ejs.basepath = { - js : "", - css : "" - }; - - // Define arrays to contain JS and CSS files that are available - ejs.files = { - js: {}, - css: {} - }; - - // Define arrays to contain JS and CSS files that will be loaded - ejs.jsToLoad = []; - ejs.cssToLoad = []; - - // Function for adding files to the queue for loading. - // CSS or JS is discovered by file path. - // Files should not include base paths, if already defined in ejs.basepath. - ejs.addFile = function( file ){ - var js = file.indexOf( ".js" ) > -1; - ejs[ js ? "jsToLoad" : "cssToLoad" ].push( ejs.basepath[ js ? "js" : "css" ] + file ); - }; - - // CSS and JS loading functions: load CSS or JS via single ejs.load method - ejs.load = function ( url ){ - return ( url.indexOf( ".js" ) > -1 ? ejs.loadJS : ejs.loadCSS )( url ); - }; - - // concatSyntax is a function that decorates a URL in whatever way necessary for a concatenator API. - // To configure, just define it as a function with a url argument, and return that url decorated any way your concatenator expects. - // by default, Enhance uses the url pattern suggested in the QuickConcat project: https://github.com/filamentgroup/quickconcat - ejs.concatSyntax = function( url ){ - return url + "=concat"; - }; - - // Function for triggering the CSS and JS requests - ejs.enhance = function(){ - if( ejs.jsToLoad.length ){ - ejs.load( ejs.concatSyntax( ejs.jsToLoad.join(",") ) ); - } - if( ejs.cssToLoad.length ){ - ejs.load( ejs.concatSyntax( ejs.cssToLoad.join(",") ) ); - } - }; - -}( this )); diff --git a/example/js/lib/wrap.custom.js b/example/js/lib/wrap.custom.js deleted file mode 100644 index 0665890..0000000 --- a/example/js/lib/wrap.custom.js +++ /dev/null @@ -1,714 +0,0 @@ -/*! wrap - a simple framework for DOM utilities, targeting modern browsers without failing the rest. Copyright 2012 @scottjehl, Filament Group, Inc. Licensed MIT/GPLv2 */ -(function( w, undefined ){ - - "use strict"; - - var doc = w.document, - wrap = function( prim, sec ){ - - var pType = typeof( prim ), - ret = []; - - if( prim ){ - // if string starting with <, make html - if( pType === "string" && prim.indexOf( "<" ) === 0 ){ - var dfrag = document.createElement( "div" ); - dfrag.innerHTML = prim; - return wrap( dfrag ).children().each(function(){ - dfrag.removeChild( this ); - }); - } - else if( pType === "function" ){ - return wrap.ready( prim ); - } - // if string, it's a selector, use qsa - else if( pType === "string" ){ - if( sec ){ - return wrap( sec ).find( prim ); - } - for( var i = 0, sel = doc.querySelectorAll( prim ), il = sel.length; i < il; i++ ){ - ret[ i ] = sel[ i ]; - } - } - // object? passthrough - else { - ret = ret.concat( prim ); - } - } - // if no prim, return a wrapped doc - else{ - ret.push( doc ); - } - - ret = wrap.extend( ret, wrap.fn ); - - return ret; - }; - - // For adding element set methods - wrap.fn = {}; - - // Public each method - // For iteration on sets - wrap.fn.each = function( fn ){ - for( var i = 0, il = this.length; i < il; i++ ){ - fn.call( this[ i ], i ); - } - return this; - }; - - // For contextual lookups - wrap.fn.find = function( sel ){ - var ret = [], - finds; - this.each(function(){ - finds = this.querySelectorAll( sel ); - for( var i = 0, il = finds.length; i < il; i++ ){ - ret = ret.concat( finds[i] ); - } - }); - return wrap( ret ); - }; - - // Children - get element child nodes. - // This is needed for HTML string creation - wrap.fn.children = function(){ - var ret = [], - childs, - j; - this.each(function(){ - childs = this.children, - j = -1; - - while( j++ < childs.length-1 ){ - if( wrap.inArray( childs[ j ], ret ) === -1 ){ - ret.push( childs[ j ] ); - } - } - }); - return wrap(ret); - }; - - // Public non-dom utilities - - // browser support qualifier - wrap any usage of wrap in a qualify callback - wrap.qualified = "querySelectorAll" in doc; - - wrap.qualify = function( callback ){ - if( callback && wrap.qualified ){ - return callback(); - } - // return support bool if there's no callback - else if( !callback ){ - return wrap.qualified; - } - }; - - // For extending objects - wrap.extend = function( first, second ){ - for( var i in second ){ - if( second.hasOwnProperty( i ) ){ - first[ i ] = second[ i ]; - } - } - return first; - }; - - // check if an item exists in an array - wrap.inArray = function( needle, haystack ){ - var isin = -1; - for( var i = 0, il = haystack.length; i < il; i++ ){ - if( haystack.hasOwnProperty( i ) && haystack[ i ] === needle ){ - isin = i; - } - } - return isin; - }; - - // For DOM ready execution - wrap.ready = function( fn ){ - if( ready && fn && wrap.qualified ){ - fn.call( document ); - } - else if( fn && wrap.qualified ){ - readyQueue.push( fn ); - } - else { - runReady(); - } - - return [doc]; - }; - - // non-shortcut ready - wrap.fn.ready = function( fn ){ - wrap.ready( fn ); - return this; - }; - - // Empty and exec the ready queue - var ready = false, - readyQueue = [], - runReady = function(){ - if( !ready ){ - while( readyQueue.length ){ - readyQueue.shift().call( document ); - } - ready = true; - } - }; - - // Quick IE8 shiv - if( !w.addEventListener ){ - w.addEventListener = function( evt, cb ){ - return w.attachEvent( "on" + evt, cb ); - }; - } - - // DOM ready - w.addEventListener( "DOMContentLoaded", runReady, false ); - w.addEventListener( "readystatechange", runReady, false ); - w.addEventListener( "load", runReady, false ); - // If DOM is already ready at exec time - if( doc.readyState === "complete" ){ - runReady(); - } - - // expose - w.wrap = wrap; - -})( this );// Extensions - -// keep this wrapper around the ones you use! -(function( undefined ){ - window.$ = wrap; -})();// Extensions - -// keep this wrapper around the ones you use! -(function( undefined ){ - - var xmlHttp = (function() { - var xmlhttpmethod = false; - try { - xmlhttpmethod = new XMLHttpRequest(); - } - catch( e ){ - xmlhttpmethod = new ActiveXObject( "Microsoft.XMLHTTP" ); - } - return function(){ - return xmlhttpmethod; - }; - })(); - - wrap.ajax = function( url, options ) { - var req = xmlHttp(), - settings = wrap.ajax.settings; - - if( options ){ - wrap.extend( settings, options ); - } - if( !url ){ - url = settings.url; - } - - if( !req || !url ){ - return; - } - - req.open( settings.method, url, settings.async ); - - req.onreadystatechange = function () { - if ( req.readyState !== 4 || req.status !== 200 && req.status !== 304 ){ - return settings.error( req.responseText, req.status, req ); - } - settings.success( req.responseText, req.status, req ); - } - if( req.readyState === 4 ){ - return; - } - - req.send( null ); - }; - - wrap.ajax.settings = { - success: function(){}, - error: function(){}, - method: "GET", - async: true, - data: null - }; -})();// Extensions -(function( undefined ){ - wrap.get = function( url, callback ){ - return wrap.ajax( url, { success: callback } ); - }; -})();// Extensions -(function( undefined ){ - wrap.fn.load = function( url, callback ){ - var self = this, - args = arguments, - intCB = function( data ){ - self.each(function(){ - wrap( this ).html( data ); - }); - if( callback ){ - callback.apply( self, args ); - } - }; - wrap.ajax( url, { success: intCB } ); - return this; - }; -})();// Extensions -(function( undefined ){ - wrap.post = function( url, data, callback ){ - return wrap.ajax( url, { data: data, method: "POST", success: callback } ); - }; -})();// Extensions - -// keep this wrapper around the ones you use! -(function( undefined ){ - wrap.fn.data = function( name, val ){ - if( name !== undefined ){ - if( val !== undefined ){ - return this.each(function(){ - if( !this.wrapData ){ - this.wrapData = {}; - } - this.wrapData[ name ] = val; - }); - } - else { - return this[ 0 ].wrapData && this[ 0 ].wrapData[ name ]; - } - } - else { - return this[ 0 ].wrapData; - } - }; -})();// Extensions - -// keep this wrapper around the ones you use! -(function( undefined ){ - wrap.fn.removeData = function( name ){ - return this.each(function(){ - if( name !== undefined && this.wrapData ){ - this.wrapData[ name ] = undefined; - delete this.wrapData[ name ]; - } - else { - this[ 0 ].wrapData = {}; - } - }); - }; -})();// Extensions -(function( undefined ){ - wrap.fn.addClass = function( cname ){ - return this.each(function(){ - this.className += " " + cname; - }); - }; -})();// Extensions -(function( undefined ){ - wrap.fn.after = function( frag ){ - if( typeof( frag ) === "string" || frag.nodeType !== undefined ){ - frag = wrap( frag ); - } - return this.each(function( i ){ - for( var j = 0, jl = frag.length; j < jl; j++ ){ - var insertEl = i > 0 ? frag[ j ].cloneNode( true ) : frag[ j ]; - this.parentNode.insertBefore( insertEl, this ); - this.parentNode.insertBefore( this, insertEl ); - } - }); - }; - - wrap.fn.insertAfter = function( sel ){ - return this.each(function(){ - wrap( sel ).after( this ); - }); - }; -})();// Extensions -(function( undefined ){ - wrap.fn.append = function( frag ){ - if( typeof( frag ) === "string" || frag.nodeType !== undefined ){ - frag = wrap( frag ); - } - return this.each(function( i ){ - for( var j = 0, jl = frag.length; j < jl; j++ ){ - this.appendChild( i > 0 ? frag[ j ].cloneNode( true ) : frag[ j ] ); - } - }); - }; - - wrap.fn.appendTo = function( sel ){ - return this.each(function(){ - wrap( sel ).append( this ); - }); - }; - -})();// Extensions -(function( undefined ){ - wrap.fn.attr = function( name, val ){ - var nameStr = typeof( name ) === "string"; - if( val !== undefined || !nameStr ){ - return this.each(function(){ - if( nameStr ){ - this.setAttribute( name, val ); - } - else { - for( var i in name ){ - if( name.hasOwnProperty( i ) ){ - this.setAttribute( i, name[ i ] ); - } - } - } - }); - } - else { - return this[ 0 ].getAttribute( name ); - } - }; -})();// Extensions -(function( undefined ){ - wrap.fn.before = function( frag ){ - if( typeof( frag ) === "string" || frag.nodeType !== undefined ){ - frag = wrap( frag ); - } - return this.each(function( i ){ - for( var j = 0, jl = frag.length; j < jl; j++ ){ - this.parentNode.insertBefore( i > 0 ? frag[ j ].cloneNode( true ) : frag[ j ], this ); - } - }); - }; - - wrap.fn.insertBefore = function( sel ){ - return this.each(function(){ - wrap( sel ).before( this ); - }); - }; -})();// Extensions - -// keep this wrapper around the ones you use! -(function( undefined ){ - wrap.fn.eq = function( num ){ - return wrap( this[ num ] ); - }; -})();// Extensions -(function( undefined ){ - wrap.fn.filter = function( sel ){ - var ret = [], - wsel = wrap( sel ); - - this.each(function(){ - - if( !this.parentNode ){ - var context = wrap( document.createDocumentFragment() ); - context[ 0 ].appendChild( this ); - wsel = wrap( sel, context ); - } - - if( wrap.inArray( this, wsel ) > -1 ){ - ret.push( this ); - } - }); - - return wrap( ret ); - }; -})();// Extensions - -// keep this wrapper around the ones you use! -(function( undefined ){ - wrap.fn.get = function( num ){ - return this[ num ]; - }; -})();// Extensions -(function( undefined ){ - wrap.fn.html = function( html ){ - if( html ){ - return this.each(function(){ - this.innerHTML = html; - }); - } - else{ - var pile = ""; - return this.each(function(){ - pile += this.innerHTML; - }); - return pile; - } - }; -})();// Extensions -(function( undefined ){ - wrap.fn.is = function( sel ){ - var ret = false, - sel = wrap( sel ); - this.each(function( i ){ - if( wrap.inArray( this, sel ) > -1 ){ - ret = true; - } - }); - return ret; - }; -})();// Extensions -(function( undefined ){ - wrap.fn.next = function(){ - var ret = [], - next; - this.each(function( i ){ - next = this.nextElementSibling; - if( next ){ - ret = ret.concat( next ); - } - }); - return wrap(ret); - }; -})();// Extensions -(function( undefined ){ - wrap.fn.not = function( sel ){ - var ret = [], - sel = wrap( sel ); - this.each(function( i ){ - if( wrap.inArray( this, sel ) === -1 ){ - ret.push( this ); - } - }); - return wrap( ret ); - }; -})();// Extensions -(function( undefined ){ - wrap.fn.parent = function(){ - var ret = [], - parent; - this.each(function(){ - parent = this.parentElement; - if( parent ){ - ret.push( parent ); - } - }); - return wrap(ret); - }; -})();// Extensions -(function( undefined ){ - wrap.fn.parents = function( sel ){ - var ret = []; - - this.each(function(){ - var curr = this, - match; - while( curr.parentElement && !match ){ - curr = curr.parentElement; - if( sel ){ - if( curr === wrap( sel )[0] ){ - match = true; - if( wrap.inArray( curr, ret ) === -1 ){ - ret.push( curr ); - } - } - } - else { - if( wrap.inArray( curr, ret ) === -1 ){ - ret.push( curr ); - } - } - } - }); - return wrap(ret); - }; -})();// Extensions -(function( undefined ){ - wrap.fn.closest = function( sel ){ - var ret = []; - if( !sel ){ - return wrap( ret ); - } - - this.each(function(){ - var self = this, - generations = 0; - - wrap( sel ).each(function(){ - if( self === this ){ - ret[ 0 ] = self; - } - else { - var i = 0; - while( self.parentElement && ( !generations || i < generations ) ){ - i++; - if( self.parentElement === this ){ - ret[ 0 ] = self.parentElement; - generations = i; - } - else{ - self = self.parentElement; - } - } - } - }); - }); - return wrap( ret ); - }; -})();// Extensions -(function( undefined ){ - wrap.fn.prepend = function( frag ){ - if( typeof( frag ) === "string" || frag.nodeType !== undefined ){ - frag = wrap( frag ); - } - return this.each(function( i ){ - - for( var j = 0, jl = frag.length; j < jl; j++ ){ - var insertEl = i > 0 ? frag[ j ].cloneNode( true ) : frag[ j ]; - if ( this.firstChild ){ - this.insertBefore( insertEl, this.firstChild ); - } - else { - this.appendChild( insertEl ); - } - } - }); - }; - - wrap.fn.prependTo = function( sel ){ - return this.each(function(){ - wrap( sel ).prepend( this ); - }); - }; -})();// Extensions -(function( undefined ){ - wrap.fn.prev = function(){ - var ret = [], - next; - this.each(function( i ){ - next = this.previousElementSibling; - if( next ){ - ret = ret.concat( next ); - } - }); - return wrap(ret); - }; -})();// Extensions -(function( undefined ){ - wrap.fn.prop = function( name, val ){ - var name = wrap.propFix[ name ] || name; - if( val !== undefined ){ - return this.each(function(){ - this[ name ] = val; - }); - } - else { - return this[ 0 ][ name ]; - } - }; - - // Property normalization, a subset taken from jQuery src - wrap.propFix = { - "class": "className", - contenteditable: "contentEditable", - "for": "htmlFor", - readonly: "readOnly", - tabindex: "tabIndex" - } -})();// Extensions -(function( undefined ){ - wrap.fn.removeProp = function( prop ){ - var name = wrap.propFix && wrap.propFix[ name ] || name; - return this.each(function(){ - this[ prop ] = undefined; - delete this[ prop ]; - }); - }; -})();// Extensions -(function( undefined ){ - wrap.fn.remove = function( sel ){ - return this.each(function(){ - this.parentNode.removeChild( this ); - }); - }; -})();// Extensions -(function( undefined ){ - wrap.fn.removeAttr = function( attr ){ - return this.each(function(){ - this.removeAttribute( attr ); - }); - }; -})();// Extensions -(function( undefined ){ - wrap.fn.removeClass = function( cname ){ - return this.each(function(){ - this.className = this.className.replace( new RegExp( cname, "gmi" ), "" ); - }); - }; -})();// Extensions -(function( undefined ){ - wrap.fn.replaceWith = function( frag ){ - if( typeof( frag ) === "string" ){ - frag = wrap( frag ); - } - var ret = []; - this.each(function( i ){ - for( var j = 0, jl = frag.length; j < jl; j++ ){ - var insertEl = i > 0 ? frag[ j ].cloneNode( true ) : frag[ j ]; - this.parentNode.insertBefore( insertEl, this ); - insertEl.parentNode.removeChild( this ); - ret.push( insertEl ); - } - }); - return wrap( ret ); - }; -})();// Extensions - -// keep this wrapper around the ones you use! -(function( undefined ){ - wrap.fn.bind = function( evt, callback ){ - return this.each(function(){ - - var cb = function( e ){ - callback.apply( this, [ e ].concat( e.args || [] ) ); - }; - - if( "addEventListener" in this ){ - this.addEventListener( evt, cb, false ); - } - else if( this.attachEvent ){ - this.attachEvent( "on" + evt, cb ); - } - }); - }; -})();// Extensions - -// keep this wrapper around the ones you use! -(function( undefined ){ - wrap.fn.live = function( evt, callback ){ - return this.each(function(){ - - var self = this; - - function newCB( event ){ - if( event.target === self ){ - callback.apply( self, [ e ].concat( event.args || [] ) ); - } - } - - if( "addEventListener" in document ){ - document.addEventListener( evt, newCB, false ); - } - else if( document.attachEvent ){ - document.attachEvent( "on" + evt, newCB ); - } - }); - }; -})();// Extensions - -// keep this wrapper around the ones you use! -(function( undefined ){ - wrap.fn.trigger = function( evt, args ){ - return this.each(function(){ - // TODO needs IE8 support - if( document.createEvent ){ - var event = document.createEvent( "Event" ); - event.initEvent( evt, true, true ); - event.args = args; - this.dispatchEvent( event ); - } - }); - }; -})(); \ No newline at end of file diff --git a/example/js/touch.js b/example/js/touch.js deleted file mode 100644 index 80a8988..0000000 --- a/example/js/touch.js +++ /dev/null @@ -1,8 +0,0 @@ -// NOTE: the real contents of this file would actually do something useful. -// for demo purposes, it logs a message to the page. -(function( $ ){ - // when dom is ready... - $(function(){ - $( "

generalenhancements.js was loaded because touch events are supported.

" ).appendTo( "body" ); - }); -})( wrap ); \ No newline at end of file diff --git a/example/js/widescreen.js b/example/js/widescreen.js deleted file mode 100644 index 54dfc10..0000000 --- a/example/js/widescreen.js +++ /dev/null @@ -1,8 +0,0 @@ -// NOTE: the real contents of this file would actually do something useful. -// for demo purposes, it logs a message to the page. -(function( $ ){ - // when dom is ready... - $(function(){ - $( "

widescreen.js was loaded because the screen width is greater than 500px.

" ).appendTo( "body" ); - }); -})( wrap ); \ No newline at end of file diff --git a/example/quickconcat.php b/example/quickconcat.php deleted file mode 100644 index dc31fcf..0000000 --- a/example/quickconcat.php +++ /dev/null @@ -1,58 +0,0 @@ -" : ""; - $close = $wrap ? "\n" : ""; - $newcontents = $open . file_get_contents($relativeroot . $file). $close; - //prefix relative CSS paths (TODO: HTML as well) - if( $ftype === "css" ){ - $prefix = $pubroot . dirname($file) . "/"; - $newcontents = preg_replace( '/(url\("?)([^\/])([^\:\)]+"?\))/', "$1" . $prefix . "$2$3", $newcontents ); - //temp cleanup - $newcontents = preg_replace( '/(url\()([^"]+)(")/', "$1$3", $newcontents ); - } - $contents .= $newcontents; - } -} - -// Set the content type and filesize headers -header('Content-Type: ' . $type); -header('Content-Length: ' . strlen($contents)); - -// Deliver the file -echo $contents;