mirror of
https://github.com/moparisthebest/mail
synced 2025-02-16 15:10:10 -05:00
tested mobile.html... works
This commit is contained in:
parent
1368672c1d
commit
2007fbcc0f
@ -2,7 +2,7 @@ require(['require-config'], function() {
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
// Start the main app logic.
|
// Start the main app logic.
|
||||||
require(['jquery', 'js/app-controller', 'js/app-config'], function($, controller) {
|
require(['jquery', 'js/app-controller', 'js/app-config'], function($, controller, app) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load templates and start the application
|
* Load templates and start the application
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
(function() {
|
define([], function() {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -6,9 +6,6 @@
|
|||||||
*/
|
*/
|
||||||
var app = {
|
var app = {
|
||||||
model: {},
|
model: {},
|
||||||
view: {},
|
|
||||||
dao: {},
|
|
||||||
crypto: {},
|
|
||||||
util: {}
|
util: {}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -31,28 +28,8 @@
|
|||||||
|
|
||||||
get: function(name) {
|
get: function(name) {
|
||||||
return this.templates[name];
|
return this.templates[name];
|
||||||
},
|
|
||||||
|
|
||||||
loadTemplates: function(names, callback) {
|
|
||||||
var that = this;
|
|
||||||
|
|
||||||
var loadTemplate = function(index) {
|
|
||||||
var name = names[index];
|
|
||||||
console.log('Loading template: ' + name);
|
|
||||||
$.get('tpl/' + name + '.html', function(data) {
|
|
||||||
that.templates[name] = data;
|
|
||||||
index++;
|
|
||||||
if (index < names.length) {
|
|
||||||
loadTemplate(index);
|
|
||||||
} else {
|
|
||||||
callback();
|
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return app;
|
||||||
});
|
});
|
||||||
};
|
|
||||||
loadTemplate(0);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
window.app = app;
|
|
||||||
|
|
||||||
}());
|
|
@ -1,21 +1,21 @@
|
|||||||
/**
|
/**
|
||||||
* The main application controller
|
* The main application controller
|
||||||
*/
|
*/
|
||||||
define(['js/dao/email-dao'], function(emailDao) {
|
define(['jquery', 'js/dao/email-dao', 'js/dao/keychain-dao', 'js/dao/cloudstorage-dao',
|
||||||
|
'js/app-config', 'cordova'
|
||||||
|
], function($, EmailDAO, KeychainDAO, cloudstorage, app) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var self = {};
|
var self = {};
|
||||||
|
|
||||||
|
var emailDao;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes modules through dependecy injection
|
* Initializes modules through dependecy injection
|
||||||
*/
|
*/
|
||||||
self.init = function(callback) {
|
self.init = function(callback) {
|
||||||
// var crypto = new app.crypto.Crypto(window, util);
|
var keychain = new KeychainDAO(cloudstorage);
|
||||||
// var cloudstorage = new app.dao.CloudStorage(window, $);
|
emailDao = new EmailDAO(cloudstorage, keychain);
|
||||||
// var jsonDao = new app.dao.LawnchairDAO(Lawnchair);
|
|
||||||
// var devicestorage = new app.dao.DeviceStorage(util, crypto, jsonDao, null);
|
|
||||||
// var keychain = new app.dao.KeychainDAO(jsonDao, cloudstorage);
|
|
||||||
// emailDao = new app.dao.EmailDAO(jsonDao, crypto, devicestorage, cloudstorage, util, keychain);
|
|
||||||
callback();
|
callback();
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ define(['js/dao/email-dao'], function(emailDao) {
|
|||||||
|
|
||||||
function onDeviceReady() {
|
function onDeviceReady() {
|
||||||
console.log('Starting app.');
|
console.log('Starting app.');
|
||||||
app.util.tpl.loadTemplates(views, callback);
|
loadTemplates(views, callback);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -112,5 +112,22 @@ define(['js/dao/email-dao'], function(emailDao) {
|
|||||||
emailDao.init(account, password, callback);
|
emailDao.init(account, password, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function loadTemplates(names, callback) {
|
||||||
|
var loadTemplate = function(index) {
|
||||||
|
var name = names[index];
|
||||||
|
console.log('Loading template: ' + name);
|
||||||
|
$.get('tpl/' + name + '.html', function(data) {
|
||||||
|
app.util.tpl.templates[name] = data;
|
||||||
|
index++;
|
||||||
|
if (index < names.length) {
|
||||||
|
loadTemplate(index);
|
||||||
|
} else {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
loadTemplate(0);
|
||||||
|
}
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
});
|
});
|
@ -1,7 +1,10 @@
|
|||||||
(function() {
|
define(['jquery', 'backbone', 'js/view/login-view', 'js/view/compose-view',
|
||||||
|
'js/view/folderlist-view', 'js/view/messagelist-view', 'js/view/read-view',
|
||||||
|
'jquerymobile'
|
||||||
|
], function($, Backbone, LoginView, ComposeView, FolderListView, MessageListView, ReadView) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
app.Router = Backbone.Router.extend({
|
var Router = Backbone.Router.extend({
|
||||||
|
|
||||||
routes: {
|
routes: {
|
||||||
'': 'login',
|
'': 'login',
|
||||||
@ -16,7 +19,7 @@
|
|||||||
initialize: function() {},
|
initialize: function() {},
|
||||||
|
|
||||||
login: function() {
|
login: function() {
|
||||||
var loginView = new app.view.LoginView();
|
var loginView = new LoginView();
|
||||||
this.changePage(loginView);
|
this.changePage(loginView);
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -24,7 +27,7 @@
|
|||||||
var self = this,
|
var self = this,
|
||||||
composeView;
|
composeView;
|
||||||
|
|
||||||
composeView = new app.view.ComposeView({
|
composeView = new ComposeView({
|
||||||
account: userId,
|
account: userId,
|
||||||
folder: folder,
|
folder: folder,
|
||||||
messageId: (messageId) ? decodeURIComponent(messageId) : null,
|
messageId: (messageId) ? decodeURIComponent(messageId) : null,
|
||||||
@ -35,7 +38,7 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
folders: function(userId) {
|
folders: function(userId) {
|
||||||
var folderListView = new app.view.FolderListView({
|
var folderListView = new FolderListView({
|
||||||
account: userId
|
account: userId
|
||||||
});
|
});
|
||||||
this.changePage(folderListView);
|
this.changePage(folderListView);
|
||||||
@ -43,7 +46,7 @@
|
|||||||
|
|
||||||
messagelist: function(userId, folder) {
|
messagelist: function(userId, folder) {
|
||||||
var self = this;
|
var self = this;
|
||||||
var messageListView = new app.view.MessageListView({
|
var messageListView = new MessageListView({
|
||||||
account: userId,
|
account: userId,
|
||||||
folder: folder
|
folder: folder
|
||||||
});
|
});
|
||||||
@ -55,7 +58,7 @@
|
|||||||
var self = this,
|
var self = this,
|
||||||
readView;
|
readView;
|
||||||
|
|
||||||
readView = new app.view.ReadView({
|
readView = new ReadView({
|
||||||
account: userId,
|
account: userId,
|
||||||
folder: folder,
|
folder: folder,
|
||||||
messageId: decodeURIComponent(messageId),
|
messageId: decodeURIComponent(messageId),
|
||||||
@ -88,4 +91,5 @@
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}());
|
return Router;
|
||||||
|
});
|
@ -3,8 +3,8 @@
|
|||||||
* gracefully degrades to JS crypto (if unavailable)
|
* gracefully degrades to JS crypto (if unavailable)
|
||||||
*/
|
*/
|
||||||
define(['cryptoLib/util', 'cryptoLib/aes-cbc', 'cryptoLib/rsa', 'cryptoLib/crypto-batch',
|
define(['cryptoLib/util', 'cryptoLib/aes-cbc', 'cryptoLib/rsa', 'cryptoLib/crypto-batch',
|
||||||
'js/crypto/pbkdf2'
|
'js/crypto/pbkdf2', 'js/app-config'
|
||||||
], function(util, aes, rsa, cryptoBatch, pbkdf2) {
|
], function(util, aes, rsa, cryptoBatch, pbkdf2, app) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var self = {};
|
var self = {};
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
/**
|
/**
|
||||||
* A Wrapper for Forge's RSA encryption
|
* A Wrapper for Forge's RSA encryption
|
||||||
*/
|
*/
|
||||||
var RSA = function(forge, util) {
|
var RSA = function(forge, util, app) {
|
||||||
|
|
||||||
var utl = forge.util;
|
var utl = forge.util;
|
||||||
|
|
||||||
@ -129,8 +129,8 @@
|
|||||||
|
|
||||||
if (typeof define !== 'undefined' && define.amd) {
|
if (typeof define !== 'undefined' && define.amd) {
|
||||||
// AMD
|
// AMD
|
||||||
define(['forge', 'cryptoLib/util'], function(forge, util) {
|
define(['forge', 'cryptoLib/util', 'js/app-config'], function(forge, util, app) {
|
||||||
return new RSA(forge, util);
|
return new RSA(forge, util, app);
|
||||||
});
|
});
|
||||||
} else if (typeof module !== 'undefined' && module.exports) {
|
} else if (typeof module !== 'undefined' && module.exports) {
|
||||||
// node.js
|
// node.js
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* High level storage api for handling syncing of data to
|
* High level storage api for handling syncing of data to
|
||||||
* and from the cloud.
|
* and from the cloud.
|
||||||
*/
|
*/
|
||||||
define(['jquery'], function($) {
|
define(['jquery', 'js/app-config'], function($, app) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var self = {};
|
var self = {};
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* between the cloud service and the device's local storage
|
* between the cloud service and the device's local storage
|
||||||
*/
|
*/
|
||||||
define(['underscore', 'cryptoLib/util', 'js/crypto/crypto', 'js/dao/lawnchair-dao',
|
define(['underscore', 'cryptoLib/util', 'js/crypto/crypto', 'js/dao/lawnchair-dao',
|
||||||
'js/dao/devicestorage-dao', 'js/model/account-model'
|
'js/dao/devicestorage-dao', 'js/app-config', 'js/model/account-model'
|
||||||
], function(_, util, crypto, jsonDB, devicestorage) {
|
], function(_, util, crypto, jsonDB, devicestorage, app) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var EmailDAO = function(cloudstorage, keychain) {
|
var EmailDAO = function(cloudstorage, keychain) {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
(function() {
|
define(['jquery'], function($) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
$(document).on('mobileinit', function() {
|
$(document).on('mobileinit', function() {
|
||||||
@ -10,9 +10,9 @@
|
|||||||
$.mobile.defaultPageTransition = 'none';
|
$.mobile.defaultPageTransition = 'none';
|
||||||
|
|
||||||
// Remove page from DOM when it's being replaced
|
// Remove page from DOM when it's being replaced
|
||||||
$(document).on('pagehide', 'div[data-role="page"]', function(event, ui) {
|
$(document).on('pagehide', 'div[data-role="page"]', function(event) {
|
||||||
$(event.currentTarget).remove();
|
$(event.currentTarget).remove();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
}());
|
});
|
@ -1,4 +1,4 @@
|
|||||||
define(['backbone', 'js/model/folder-model'], function(Backbone) {
|
define(['backbone', 'js/app-config', 'js/model/folder-model'], function(Backbone, app) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
app.model.Account = Backbone.Model.extend({
|
app.model.Account = Backbone.Model.extend({
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
define(['backbone'], function(Backbone) {
|
define(['backbone', 'js/app-config'], function(Backbone, app) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
app.model.Email = Backbone.Model.extend({
|
app.model.Email = Backbone.Model.extend({
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
define(['backbone'], function(Backbone) {
|
define(['backbone', 'js/app-config'], function(Backbone, app) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
app.model.Folder = Backbone.Model.extend({
|
app.model.Folder = Backbone.Model.extend({
|
||||||
|
@ -1,16 +1,17 @@
|
|||||||
(function() {
|
define(['jquery', 'underscore', 'backbone', 'js/app-config'], function($, _, Backbone, app) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
app.view.AccountsView = Backbone.View.extend({
|
var AccountsView = Backbone.View.extend({
|
||||||
|
|
||||||
initialize: function() {
|
initialize: function() {
|
||||||
this.template = _.template(app.util.tpl.get('accounts'));
|
this.template = _.template(app.util.tpl.get('accounts'));
|
||||||
},
|
},
|
||||||
|
|
||||||
render: function(eventName) {
|
render: function() {
|
||||||
$(this.el).html(this.template());
|
$(this.el).html(this.template());
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}());
|
return AccountsView;
|
||||||
|
});
|
@ -1,7 +1,7 @@
|
|||||||
(function() {
|
define(['jquery', 'underscore', 'backbone', 'js/app-config'], function($, _, Backbone, app) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
app.view.ComposeView = Backbone.View.extend({
|
var ComposeView = Backbone.View.extend({
|
||||||
|
|
||||||
initialize: function(args) {
|
initialize: function(args) {
|
||||||
var self = this;
|
var self = this;
|
||||||
@ -140,4 +140,5 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}());
|
return ComposeView;
|
||||||
|
});
|
@ -1,13 +1,13 @@
|
|||||||
(function() {
|
define(['jquery', 'underscore', 'backbone', 'js/app-config'], function($, _, Backbone, app) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
app.view.FolderListView = Backbone.View.extend({
|
var FolderListView = Backbone.View.extend({
|
||||||
|
|
||||||
initialize: function() {
|
initialize: function() {
|
||||||
this.template = _.template(app.util.tpl.get('folderlist'));
|
this.template = _.template(app.util.tpl.get('folderlist'));
|
||||||
},
|
},
|
||||||
|
|
||||||
render: function(eventName) {
|
render: function() {
|
||||||
var page = $(this.el);
|
var page = $(this.el);
|
||||||
|
|
||||||
page.html(this.template(this.options));
|
page.html(this.template(this.options));
|
||||||
@ -23,4 +23,5 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}());
|
return FolderListView;
|
||||||
|
});
|
@ -1,7 +1,7 @@
|
|||||||
(function() {
|
define(['jquery', 'underscore', 'backbone', 'js/app-config'], function($, _, Backbone, app) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
app.view.LoginView = Backbone.View.extend({
|
var LoginView = Backbone.View.extend({
|
||||||
|
|
||||||
initialize: function() {
|
initialize: function() {
|
||||||
this.template = _.template(app.util.tpl.get('login'));
|
this.template = _.template(app.util.tpl.get('login'));
|
||||||
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
login: function() {
|
login: function() {
|
||||||
var page = $(this.el),
|
var page = $(this.el),
|
||||||
userId = page.find('#userId').val(),
|
userId = page.find('#userId').val() + '@mail.whiteout.io',
|
||||||
password = page.find('#password').val();
|
password = page.find('#password').val();
|
||||||
|
|
||||||
// show loading msg during init
|
// show loading msg during init
|
||||||
@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
// post message to main window
|
// post message to main window
|
||||||
app.util.postMessage('login', {
|
app.util.postMessage('login', {
|
||||||
userId: userId + '@mail.whiteout.io',
|
userId: userId,
|
||||||
password: password
|
password: password
|
||||||
}, function(resArgs) {
|
}, function(resArgs) {
|
||||||
var err = resArgs.err;
|
var err = resArgs.err;
|
||||||
@ -51,4 +51,5 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}());
|
return LoginView;
|
||||||
|
});
|
@ -1,7 +1,9 @@
|
|||||||
(function() {
|
define(['jquery', 'underscore', 'backbone', 'js/app-config',
|
||||||
|
'js/view/messagelistitem-view'
|
||||||
|
], function($, _, Backbone, app, MessageListItemView) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
app.view.MessageListView = Backbone.View.extend({
|
var MessageListView = Backbone.View.extend({
|
||||||
|
|
||||||
initialize: function(args) {
|
initialize: function(args) {
|
||||||
this.template = _.template(app.util.tpl.get('messagelist'));
|
this.template = _.template(app.util.tpl.get('messagelist'));
|
||||||
@ -92,7 +94,7 @@
|
|||||||
folder: self.folder,
|
folder: self.folder,
|
||||||
model: email
|
model: email
|
||||||
};
|
};
|
||||||
list.append(new app.view.MessageListItemView(listItemArgs).render().el);
|
list.append(new MessageListItemView(listItemArgs).render().el);
|
||||||
}
|
}
|
||||||
|
|
||||||
// refresh list view
|
// refresh list view
|
||||||
@ -103,4 +105,5 @@
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}());
|
return MessageListView;
|
||||||
|
});
|
@ -1,7 +1,7 @@
|
|||||||
(function() {
|
define(['jquery', 'underscore', 'backbone', 'js/app-config'], function($, _, Backbone, app) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
app.view.MessageListItemView = Backbone.View.extend({
|
var MessageListItemView = Backbone.View.extend({
|
||||||
|
|
||||||
tagName: "li",
|
tagName: "li",
|
||||||
|
|
||||||
@ -25,4 +25,5 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}());
|
return MessageListItemView;
|
||||||
|
});
|
@ -1,7 +1,7 @@
|
|||||||
(function() {
|
define(['jquery', 'underscore', 'backbone', 'js/app-config'], function($, _, Backbone, app) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
app.view.ReadView = Backbone.View.extend({
|
var ReadView = Backbone.View.extend({
|
||||||
|
|
||||||
initialize: function(args) {
|
initialize: function(args) {
|
||||||
var self = this;
|
var self = this;
|
||||||
@ -67,4 +67,5 @@
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}());
|
return ReadView;
|
||||||
|
});
|
@ -8,47 +8,7 @@
|
|||||||
<link rel="stylesheet" href="css/styles.css"/>
|
<link rel="stylesheet" href="css/styles.css"/>
|
||||||
|
|
||||||
<!-- The Scripts -->
|
<!-- The Scripts -->
|
||||||
<script src="lib/cordova-2.5.0.js"></script>
|
<script data-main="mobile.js" src="lib/require.js"></script>
|
||||||
<script src="lib/jquery-1.8.2.min.js"></script>
|
|
||||||
<script src="lib/underscore-1.4.4.min.js"></script>
|
|
||||||
<script src="lib/backbone-1.0.0.min.js"></script>
|
|
||||||
<script src="js/jqm-config.js"></script>
|
|
||||||
<script src="lib/jquery.mobile-1.2.0.min.js"></script>
|
|
||||||
<script src="lib/lawnchair/lawnchair-git.js"></script>
|
|
||||||
<script src="lib/lawnchair/lawnchair-adapter-webkit-sqlite-git.js"></script>
|
|
||||||
<script src="lib/lawnchair/lawnchair-adapter-indexed-db-git.js"></script>
|
|
||||||
|
|
||||||
<script src="lib/forge/forge.rsa.bundle.js"></script>
|
|
||||||
<script src="lib/uuid.js"></script>
|
|
||||||
|
|
||||||
<script src="js/app-config.js"></script>
|
|
||||||
|
|
||||||
<script src="js/model/folder-model.js"></script>
|
|
||||||
<script src="js/model/account-model.js"></script>
|
|
||||||
|
|
||||||
<script src="js/crypto/util.js"></script>
|
|
||||||
<script src="js/crypto/pbkdf2.js"></script>
|
|
||||||
<script src="js/crypto/aes-cbc.js"></script>
|
|
||||||
<script src="js/crypto/rsa.js"></script>
|
|
||||||
<script src="js/crypto/crypto-batch.js"></script>
|
|
||||||
<script src="js/crypto/crypto.js"></script>
|
|
||||||
|
|
||||||
<script src="js/dao/lawnchair-dao.js"></script>
|
|
||||||
<script src="js/dao/devicestorage.js"></script>
|
|
||||||
<script src="js/dao/cloudstorage-dao.js"></script>
|
|
||||||
<script src="js/dao/keychain-dao.js"></script>
|
|
||||||
<script src="js/dao/email-dao.js"></script>
|
|
||||||
|
|
||||||
<script src="js/view/login-view.js"></script>
|
|
||||||
<script src="js/view/compose-view.js"></script>
|
|
||||||
<script src="js/view/messagelist-view.js"></script>
|
|
||||||
<script src="js/view/messagelistitem-view.js"></script>
|
|
||||||
<script src="js/view/folderlist-view.js"></script>
|
|
||||||
<script src="js/view/read-view.js"></script>
|
|
||||||
|
|
||||||
<script src="js/app-router.js"></script>
|
|
||||||
<script src="js/app-controller.js"></script>
|
|
||||||
<script src="mobile.js"></script>
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body></body>
|
<body></body>
|
||||||
|
@ -1,14 +1,17 @@
|
|||||||
(function() {
|
require(['require-config'], function() {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var controller,
|
// Start the main app logic.
|
||||||
router;
|
require(['jquery', 'backbone', 'js/app-controller', 'js/app-router',
|
||||||
|
'js/app-config'
|
||||||
|
], function($, Backbone, controller, Router, app) {
|
||||||
|
|
||||||
|
var router;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load templates and start the application
|
* Load templates and start the application
|
||||||
*/
|
*/
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
controller = new app.Controller();
|
|
||||||
controller.init(function() {
|
controller.init(function() {
|
||||||
controller.start(startApp);
|
controller.start(startApp);
|
||||||
});
|
});
|
||||||
@ -16,7 +19,7 @@
|
|||||||
|
|
||||||
function startApp() {
|
function startApp() {
|
||||||
// start backone.js router
|
// start backone.js router
|
||||||
router = new app.Router();
|
router = new Router();
|
||||||
Backbone.history.start();
|
Backbone.history.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -28,4 +31,5 @@
|
|||||||
controller.execute(cmd, args, callback);
|
controller.execute(cmd, args, callback);
|
||||||
};
|
};
|
||||||
|
|
||||||
}());
|
});
|
||||||
|
});
|
@ -8,6 +8,7 @@
|
|||||||
test: '../../test',
|
test: '../../test',
|
||||||
cryptoLib: '../js/crypto',
|
cryptoLib: '../js/crypto',
|
||||||
jquery: 'jquery-1.8.2.min',
|
jquery: 'jquery-1.8.2.min',
|
||||||
|
jquerymobile: 'jquery.mobile-1.2.0.min',
|
||||||
underscore: 'underscore-1.4.4.min',
|
underscore: 'underscore-1.4.4.min',
|
||||||
backbone: 'backbone-1.0.0.min',
|
backbone: 'backbone-1.0.0.min',
|
||||||
lawnchair: 'lawnchair/lawnchair-git',
|
lawnchair: 'lawnchair/lawnchair-git',
|
||||||
@ -31,6 +32,9 @@
|
|||||||
},
|
},
|
||||||
underscore: {
|
underscore: {
|
||||||
exports: '_'
|
exports: '_'
|
||||||
|
},
|
||||||
|
jquerymobile: {
|
||||||
|
deps: ['jquery', 'js/jqm-config']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
define(['js/dao/email-dao', 'js/dao/keychain-dao', 'js/dao/lawnchair-dao',
|
define(['js/dao/email-dao', 'js/dao/keychain-dao', 'js/dao/lawnchair-dao',
|
||||||
'js/dao/cloudstorage-dao'
|
'js/dao/cloudstorage-dao', 'js/app-config'
|
||||||
], function(EmailDAO, KeychainDAO, jsonDao, cloudstorage) {
|
], function(EmailDAO, KeychainDAO, jsonDao, cloudstorage, app) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
module("CloudStorage DAO");
|
module("CloudStorage DAO");
|
||||||
|
@ -7,7 +7,7 @@ require(['../../src/require-config'], function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Start the main app logic.
|
// Start the main app logic.
|
||||||
require(['cordova', 'js/app-config'], function() {
|
require(['js/app-config', 'cordova'], function(app) {
|
||||||
// clear session storage of failed tests, so async order is correct after fail & refresh
|
// clear session storage of failed tests, so async order is correct after fail & refresh
|
||||||
window.sessionStorage.clear();
|
window.sessionStorage.clear();
|
||||||
window.Worker = undefined;
|
window.Worker = undefined;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
define(['cryptoLib/util', 'js/model/email-model'], function(util) {
|
define(['cryptoLib/util', 'js/app-config', 'js/model/email-model'], function(util, app) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var self = {};
|
var self = {};
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
define(['js/dao/email-dao', 'js/dao/keychain-dao', 'js/dao/lawnchair-dao',
|
define(['js/dao/email-dao', 'js/dao/keychain-dao', 'js/dao/lawnchair-dao',
|
||||||
'js/crypto/crypto', 'js/dao/devicestorage-dao', 'test/test-data'
|
'js/crypto/crypto', 'js/dao/devicestorage-dao', 'test/test-data', 'js/app-config'
|
||||||
], function(EmailDAO, KeychainDAO, jsonDao, crypto, storage, testData) {
|
], function(EmailDAO, KeychainDAO, jsonDao, crypto, storage, testData, app) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
module("Email DAO");
|
module("Email DAO");
|
||||||
|
@ -7,7 +7,7 @@ require(['../../src/require-config'], function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Start the main app logic.
|
// Start the main app logic.
|
||||||
require(['cordova', 'js/app-config'], function() {
|
require(['js/app-config', 'cordova'], function(app) {
|
||||||
// clear session storage of failed tests, so async order is correct after fail & refresh
|
// clear session storage of failed tests, so async order is correct after fail & refresh
|
||||||
window.sessionStorage.clear();
|
window.sessionStorage.clear();
|
||||||
window.Worker = undefined;
|
window.Worker = undefined;
|
||||||
|
Loading…
Reference in New Issue
Block a user