mirror of
https://github.com/danbee/tube-status-server
synced 2025-03-04 08:39:12 +00:00
New JS build process.
This commit is contained in:
parent
e4d0b8dbf5
commit
5d21de346d
7
Makefile
Normal file
7
Makefile
Normal file
@ -0,0 +1,7 @@
|
||||
build:
|
||||
r.js -o public/javascripts/build.js
|
||||
release:
|
||||
make build
|
||||
git add public/javascripts/main_compiled.js
|
||||
git commit -m "Compiled JS for release."
|
||||
git push heroku
|
||||
@ -1,12 +1,12 @@
|
||||
CACHE MANIFEST
|
||||
# rev 3
|
||||
# rev 4
|
||||
|
||||
NETWORK:
|
||||
/
|
||||
/now.json
|
||||
/weekend.json
|
||||
|
||||
CACHE:
|
||||
index.html
|
||||
images/loader.gif
|
||||
|
||||
fonts/fontawesome.eot
|
||||
@ -16,25 +16,6 @@ fonts/fontawesome.woff
|
||||
|
||||
stylesheets/main.css
|
||||
|
||||
javascripts/app.js
|
||||
javascripts/main.js
|
||||
javascripts/build.js
|
||||
|
||||
javascripts/libs/backbone.js
|
||||
javascripts/libs/mustache.js
|
||||
javascripts/libs/zepto.min.js
|
||||
javascripts/libs/json.js
|
||||
javascripts/libs/require.js
|
||||
javascripts/libs/text.js
|
||||
javascripts/libs/underscore.js
|
||||
|
||||
javascripts/models/line.js
|
||||
javascripts/collections/lines.js
|
||||
|
||||
javascripts/templates/header.html
|
||||
javascripts/templates/footer.html
|
||||
javascripts/templates/line.mustache
|
||||
javascripts/templates/message.mustache
|
||||
|
||||
javascripts/views/main.js
|
||||
javascripts/views/chrome.js
|
||||
javascripts/views/line_list.js
|
||||
|
||||
20
public/javascripts/build.js
Normal file
20
public/javascripts/build.js
Normal file
@ -0,0 +1,20 @@
|
||||
({
|
||||
name: 'main',
|
||||
out: 'main_compiled.js',
|
||||
paths: {
|
||||
zepto: 'libs/zepto.min',
|
||||
underscore: 'libs/underscore',
|
||||
backbone: 'libs/backbone',
|
||||
mustache: 'libs/mustache',
|
||||
text: 'libs/text'
|
||||
},
|
||||
shim: {
|
||||
underscore: {
|
||||
exports: '_'
|
||||
},
|
||||
backbone: {
|
||||
deps: ["underscore", "zepto"],
|
||||
exports: "Backbone"
|
||||
}
|
||||
}
|
||||
})
|
||||
19
public/javascripts/main_compiled.js
Normal file
19
public/javascripts/main_compiled.js
Normal file
File diff suppressed because one or more lines are too long
@ -16,7 +16,7 @@ class Tubestatus < Sinatra::Base
|
||||
end
|
||||
|
||||
get '/' do
|
||||
send_file File.join(settings.public_folder, 'index.html')
|
||||
erb :index
|
||||
end
|
||||
|
||||
get '/now.json' do
|
||||
|
||||
@ -1,11 +1,16 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" charset="utf-8" manifest="cache.manifest">
|
||||
<html lang="en" charset="utf-8"<%= ENV["RACK_ENV"] == 'production' ? 'manifest="cache.manifest"' : '' %>>
|
||||
<head>
|
||||
<title>Tube Status</title>
|
||||
<meta name="viewport" content="initial-scale=1">
|
||||
<meta content="yes" name="apple-mobile-web-app-capable">
|
||||
<link rel="stylesheet" href="stylesheets/main.css" />
|
||||
<script src="javascripts/libs/require.js" data-main="javascripts/main"></script>
|
||||
<% if ENV["RACK_ENV"] == 'production' %>
|
||||
<script src="javascripts/libs/require.js"></script>
|
||||
<script src="javascripts/main_compiled.js"></script>
|
||||
<% else %>
|
||||
<script src="javascripts/libs/require.js" data-main="javascripts/main"></script>
|
||||
<% end %>
|
||||
|
||||
<!-- iPhone -->
|
||||
<link href="/images/apple-touch-icon-57x57.png"
|
||||
Loading…
Reference in New Issue
Block a user