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:
parent
d51d0333eb
commit
e4d0b8dbf5
@ -1,5 +1,11 @@
|
||||
CACHE MANIFEST
|
||||
# rev 3
|
||||
|
||||
NETWORK:
|
||||
/now.json
|
||||
/weekend.json
|
||||
|
||||
CACHE:
|
||||
index.html
|
||||
images/loader.gif
|
||||
|
||||
@ -14,7 +20,8 @@ javascripts/app.js
|
||||
javascripts/main.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/require.js
|
||||
javascripts/libs/text.js
|
||||
@ -26,7 +33,7 @@ javascripts/collections/lines.js
|
||||
javascripts/templates/header.html
|
||||
javascripts/templates/footer.html
|
||||
javascripts/templates/line.mustache
|
||||
javascripts/templates/messages.mustache
|
||||
javascripts/templates/message.mustache
|
||||
|
||||
javascripts/views/main.js
|
||||
javascripts/views/chrome.js
|
||||
|
||||
@ -48,8 +48,5 @@
|
||||
|
||||
</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>
|
||||
</html>
|
||||
|
||||
@ -8,11 +8,6 @@ function(Backbone, Mustache, LinesCollection, Chrome, Main, LineList) {
|
||||
return {
|
||||
initialize: function() {
|
||||
|
||||
window.phonegap = (document.URL.indexOf("http://") == -1);
|
||||
if (window.phonegap) {
|
||||
$.getScript("/javascripts/libs/cordova-2.2.0.js");
|
||||
}
|
||||
|
||||
lines = new LinesCollection;
|
||||
|
||||
// initialise chrome. this will render appropriate navbar and tabbar for the platform.
|
||||
|
||||
2
public/javascripts/libs/zepto.min.js
vendored
Normal file
2
public/javascripts/libs/zepto.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
||||
require.config({
|
||||
paths: {
|
||||
jquery: 'libs/jquery.min',
|
||||
zepto: 'libs/zepto.min',
|
||||
underscore: 'libs/underscore',
|
||||
backbone: 'libs/backbone',
|
||||
mustache: 'libs/mustache',
|
||||
@ -11,7 +11,7 @@ require.config({
|
||||
exports: '_'
|
||||
},
|
||||
backbone: {
|
||||
deps: ["underscore", "jquery"],
|
||||
deps: ["underscore", "zepto"],
|
||||
exports: "Backbone"
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,23 +1,15 @@
|
||||
define(['views/ios',
|
||||
define(['backbone',
|
||||
'text!templates/header.html',
|
||||
'text!templates/footer.html'],
|
||||
function(iOS, header, footer) {
|
||||
function(Backbone, header, footer) {
|
||||
|
||||
var Chrome = Backbone.View.extend({
|
||||
initialize: function() {
|
||||
if (phonegap && device.platform.match(/(iPhone|iPad)( Simulator)?/)) {
|
||||
new iOS({ collection: lines });
|
||||
}
|
||||
else if (phonegap && device.platform == "Android") {
|
||||
new Android();
|
||||
}
|
||||
else {
|
||||
// html5 app
|
||||
$('#page').prepend(header);
|
||||
$('#page').append(footer);
|
||||
$('body').addClass('html5');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return Chrome;
|
||||
|
||||
@ -12,9 +12,9 @@ function(Backbone) {
|
||||
|
||||
initialize: function() {
|
||||
this.collection.on("request", function() {
|
||||
$('#loader').fadeIn(100);
|
||||
$('#loader').show();
|
||||
}).on("reset", function() {
|
||||
$('#loader').fadeOut(100);
|
||||
$('#loader').hide();
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user