Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adding support for NETWORK entry in HTML5 manifest

  • Loading branch information...
commit b6f7d83473828fb8fce36ec52eb5c658aec2537d 1 parent e1b3304
Onar Vikingstad authored Charles Jolley committed
View
1  lib/sproutcore/builders/html.rb
@@ -114,6 +114,7 @@ def render
def build(dst_path)
if CONFIG.html5_manifest
$to_html5_manifest << dst_path
+ $to_html5_manifest_networks = CONFIG.html5_manifest_networks
@content_for_html5_manifest = true
end
writelines dst_path, [self.render]
View
21 lib/sproutcore/builders/html5_manifest.rb
@@ -10,10 +10,7 @@
module SC
- # This builder combines several javascript files into a single file. It is
- # used to prepare a single javascript file for production use. This build
- # tool expects the javascript files to have already been processed for any
- # build directives such sc_static().
+ # This builder create an HTML5 manifest file for application caching
#
class Builder::HTML5Manifest < Builder::Base
@@ -26,17 +23,17 @@ def build(dst_path)
inspect_files(path[0] + '/tmp/build', path[1])
#puts CONFIG.html5_manifest
- #networks = CONFIG.html5_manifest_networks
- #if networks
- # @files << "\n\nNETWORK:"
- # networks.each do |network|
- # @files << network
- # end
- #end
+ networks = $to_html5_manifest_networks
+ if networks
+ @files << "\n\nNETWORK:"
+ networks.each do |network|
+ @files << network
+ end
+ end
manifest_path = dst_path.sub('index.html', '') + 'app.manifest'
- puts manifest_path
writelines manifest_path, @files
+ puts manifest_path
end
def joinlines(lines)
View
2  lib/sproutcore/tools/build.rb
@@ -10,6 +10,7 @@
$to_minify = []
$to_html5_manifest = []
+$to_html5_manifest_networks = []
module SC
class Tools
@@ -81,7 +82,6 @@ def build(*targets)
end
if $to_html5_manifest.length > 0
- #@content_for_html5_manifest = true
$to_html5_manifest.each do |entry|
SC::Builder::HTML5Manifest.build('', entry)
end
Please sign in to comment.
Something went wrong with that request. Please try again.