aboutsummaryrefslogtreecommitdiffstats
path: root/docs/src/gen-docs.js
diff options
context:
space:
mode:
authorIgor Minar2011-06-07 12:53:40 -0700
committerIgor Minar2011-06-07 14:56:01 -0700
commit25b3438fd78184cbbc420e2e051888f4f192a68a (patch)
tree8b63995fe08546348661f3704ded38305fd7ab9c /docs/src/gen-docs.js
parentf21b9214e657d41e20fb761948b05fc2c7c7f5a3 (diff)
downloadangular.js-25b3438fd78184cbbc420e2e051888f4f192a68a.tar.bz2
add appcache for docs site - caches only css/js/img resources
Diffstat (limited to 'docs/src/gen-docs.js')
-rw-r--r--docs/src/gen-docs.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/docs/src/gen-docs.js b/docs/src/gen-docs.js
index 1e5a09c4..ead01c32 100644
--- a/docs/src/gen-docs.js
+++ b/docs/src/gen-docs.js
@@ -27,6 +27,10 @@ var writes = callback.chain(function(){
writer.copyDir('img', writes.waitFor());
writer.copyDir('examples', writes.waitFor());
writer.copyTpl('index.html', writes.waitFor());
+ writer.copyTpl('offline.html', writes.waitFor());
+ writer.output('app-cache.manifest',
+ appCacheTemplate().replace(/%TIMESTAMP%/, (new Date()).toISOString()),
+ writes.waitFor());
writer.merge(['docs.js',
'doc_widgets.js'],
'docs-combined.js',
@@ -59,3 +63,28 @@ writer.makeDir('build/docs/syntaxhighlighter', work);
///////////////////////////////////
function now(){ return new Date().getTime(); }
+
+
+function appCacheTemplate() {
+ return ["CACHE MANIFEST",
+ "# %TIMESTAMP%",
+ "",
+ "# cache all of these",
+ "CACHE:",
+ "jquery.min.js",
+ "syntaxhighlighter/syntaxhighlighter-combined.js",
+ "../angular.min.js",
+ "docs-combined.js",
+ "docs-keywords.js",
+ "docs-combined.css",
+ "syntaxhighlighter/syntaxhighlighter-combined.css",
+ "img/texture_1.png",
+ "img/yellow_bkgnd.jpg",
+ "",
+ "FALLBACK:",
+ "/ offline.html",
+ "",
+ "# allow access to google analytics and twitter when we are online",
+ "NETWORK:",
+ "*"].join('\n');
+}