Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

Commit

Permalink
changed the filenames for app.js and app.enhance.js to reflect the ne…
Browse files Browse the repository at this point in the history
…w enhance name. Updated referencing files.
  • Loading branch information
scottjehl committed Apr 18, 2012
1 parent f2eda78 commit cd7ce97
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -112,14 +112,14 @@ Enhance has a few more methods that you might use.


While the Enhance core utility is very simple by itself; its real value is in the workflows it enables. While the Enhance core utility is very simple by itself; its real value is in the workflows it enables.


Typically, a site that uses Enhance will have at least two files driving the progressive enhancement process: `app.js`, and a custom file that uses the `ejs` API to configure and enhance the user experience: for example purposes, `app.enhance.js`. The role of `app.enhance.js` is to determine if – and with which files – a browser's experience should be enhanced. Within `app.enhance.js`, any of the following steps might be taken: Typically, a site that uses Enhance will have at least two files driving the progressive enhancement process: `enhance.js`, and a custom file that uses the `ejs` API to configure and enhance the user experience: for example purposes, `enhance.audit.js`. The role of `enhance.audit.js` is to determine if – and with which files – a browser's experience should be enhanced. Within `enhance.audit.js`, any of the following steps might be taken:


* Determine if a browser is generally qualified enhancements and if not, exit early (perhaps by testing `document.querySelectorAll` support, or CSS3 Media Queries, or otherwise) * Determine if a browser is generally qualified enhancements and if not, exit early (perhaps by testing `document.querySelectorAll` support, or CSS3 Media Queries, or otherwise)
* Establish the CSS and JS files available for loading. * Establish the CSS and JS files available for loading.
* Add certain CSS and JS files to the queue for loading based on various environmental conditions, browser capabilities, screen size, markup conditions, and more. * Add certain CSS and JS files to the queue for loading based on various environmental conditions, browser capabilities, screen size, markup conditions, and more.
* Enhance the page by loading those files via a single, concatenated request. * Enhance the page by loading those files via a single, concatenated request.


For an example of this process, see the `app.enhance.js` file in the `_demo` folder. For an example of this process, see the `enhance.audit.js` file in the `_demo` folder.


## Further notes. ## Further notes.


Expand Down
5 changes: 2 additions & 3 deletions _demo.html
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>Sample template</title> <title>Sample template</title>
<link href="_demo/sample-files/general.css" rel="stylesheet" /> <link href="_demo/sample-files/general.css" rel="stylesheet" />
<script src="app.js,_demo/app.enhance.js=concat"></script> <script src="enhance.js,_demo/enhance.audit.js=concat"></script>
</head> </head>
<body class="tmpl-home"> <body class="tmpl-home">
<h1>This is a sample template.</h1> <h1>This is a sample template.</h1>
<div class="explain"> <div class="explain">
<p>It includes app.js and an example file: app.enhance.js, which uses app.js to determine whether - and which - files should be added to enhance this browser's experience when JS is available.</p> <p>It includes enhance.js and an example file: enhance.audit.js, which uses enhance.js to determine whether - and which - files should be added to enhance this browser's experience when JS is available.</p>
<p>If this browser's experience is enhanced, you'll see some notes on what's been added below.</p> <p>If this browser's experience is enhanced, you'll see some notes on what's been added below.</p>
</div> </div>



</body> </body>
</html> </html>
2 changes: 1 addition & 1 deletion _demo/app.enhance.js → _demo/enhance.audit.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/ */
(function( win ){ (function( win ){


//re-reference ejs var locally // re-reference ejs var locally
var ejs = win.ejs, var ejs = win.ejs,
docElem = win.document.documentElement; docElem = win.document.documentElement;


Expand Down
File renamed without changes.

0 comments on commit cd7ce97

Please sign in to comment.