1
0
mirror of https://github.com/danbee/tube-status-server synced 2025-03-04 08:39:12 +00:00

Replace jQuery with Zepto.

This commit is contained in:
Dan Barber 2013-01-31 11:39:12 +00:00
parent d51d0333eb
commit e4d0b8dbf5
7 changed files with 21 additions and 28 deletions

View File

@ -1,5 +1,11 @@
CACHE MANIFEST CACHE MANIFEST
# rev 3
NETWORK:
/now.json
/weekend.json
CACHE:
index.html index.html
images/loader.gif images/loader.gif
@ -14,7 +20,8 @@ javascripts/app.js
javascripts/main.js javascripts/main.js
javascripts/libs/backbone.js javascripts/libs/backbone.js
javascripts/libs/jquery.min.js javascripts/libs/mustache.js
javascripts/libs/zepto.min.js
javascripts/libs/json.js javascripts/libs/json.js
javascripts/libs/require.js javascripts/libs/require.js
javascripts/libs/text.js javascripts/libs/text.js
@ -26,7 +33,7 @@ javascripts/collections/lines.js
javascripts/templates/header.html javascripts/templates/header.html
javascripts/templates/footer.html javascripts/templates/footer.html
javascripts/templates/line.mustache javascripts/templates/line.mustache
javascripts/templates/messages.mustache javascripts/templates/message.mustache
javascripts/views/main.js javascripts/views/main.js
javascripts/views/chrome.js javascripts/views/chrome.js

View File

@ -48,8 +48,5 @@
   
</div> </div>
<script type="text/javascript" charset="utf-8" src="javascripts/libs/cordova-2.2.0.js"></script>
<script src="javascripts/libs/TabBar.js" type="text/javascript" charset="utf-8"></script>
<script src="javascripts/libs/NavigationBar.js" type="text/javascript" charset="utf-8"></script>
</body> </body>
</html> </html>

View File

@ -8,11 +8,6 @@ function(Backbone, Mustache, LinesCollection, Chrome, Main, LineList) {
return { return {
initialize: function() { initialize: function() {
window.phonegap = (document.URL.indexOf("http://") == -1);
if (window.phonegap) {
$.getScript("/javascripts/libs/cordova-2.2.0.js");
}
lines = new LinesCollection; lines = new LinesCollection;
// initialise chrome. this will render appropriate navbar and tabbar for the platform. // initialise chrome. this will render appropriate navbar and tabbar for the platform.

2
public/javascripts/libs/zepto.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
require.config({ require.config({
paths: { paths: {
jquery: 'libs/jquery.min', zepto: 'libs/zepto.min',
underscore: 'libs/underscore', underscore: 'libs/underscore',
backbone: 'libs/backbone', backbone: 'libs/backbone',
mustache: 'libs/mustache', mustache: 'libs/mustache',
@ -11,7 +11,7 @@ require.config({
exports: '_' exports: '_'
}, },
backbone: { backbone: {
deps: ["underscore", "jquery"], deps: ["underscore", "zepto"],
exports: "Backbone" exports: "Backbone"
} }
} }

View File

@ -1,22 +1,14 @@
define(['views/ios', define(['backbone',
'text!templates/header.html', 'text!templates/header.html',
'text!templates/footer.html'], 'text!templates/footer.html'],
function(iOS, header, footer) { function(Backbone, header, footer) {
var Chrome = Backbone.View.extend({ var Chrome = Backbone.View.extend({
initialize: function() { initialize: function() {
if (phonegap && device.platform.match(/(iPhone|iPad)( Simulator)?/)) { // html5 app
new iOS({ collection: lines }); $('#page').prepend(header);
} $('#page').append(footer);
else if (phonegap && device.platform == "Android") { $('body').addClass('html5');
new Android();
}
else {
// html5 app
$('#page').prepend(header);
$('#page').append(footer);
$('body').addClass('html5');
}
} }
}); });

View File

@ -12,9 +12,9 @@ function(Backbone) {
initialize: function() { initialize: function() {
this.collection.on("request", function() { this.collection.on("request", function() {
$('#loader').fadeIn(100); $('#loader').show();
}).on("reset", function() { }).on("reset", function() {
$('#loader').fadeOut(100); $('#loader').hide();
}); });
}, },