From 25e3a0c94551b0faac3f16e0598e6f4bdffcf7d8 Mon Sep 17 00:00:00 2001 From: Struan Donald Date: Fri, 12 Jul 2013 09:47:56 +0100 Subject: instead of using js to inject the correct cordova js file in to index.html restructure things so that the common files are a level down and the platofrm specific ones are directly placed in the relevant project. This both makes for less fuss and also avoids the error with Android < v3 instantiating cordova twice. Note that the iOS common assets are included by a build script rather than a symlink as symlinking doesn't seem to agree with Xcode --- www/js/models/draft.js | 58 -------------------------------------------------- 1 file changed, 58 deletions(-) delete mode 100644 www/js/models/draft.js (limited to 'www/js/models/draft.js') diff --git a/www/js/models/draft.js b/www/js/models/draft.js deleted file mode 100644 index ec6cff6..0000000 --- a/www/js/models/draft.js +++ /dev/null @@ -1,58 +0,0 @@ -(function(FMS, Backbone, _, $, moment) { - _.extend( FMS, { - Draft: Backbone.Model.extend({ - localStorage: new Backbone.LocalStorage(CONFIG.NAMESPACE + '-drafts'), - - defaults: { - lat: 0, - lon: 0, - title: '', - details: '', - may_show_name: '', - category: '', - phone: '', - pc: '', - file: '', - created: moment.utc() - }, - - description: function() { - var desc = ''; - if ( this.get('title') ) { - desc += this.get('title'); - } else { - desc += 'Untitled draft'; - } - desc += '
' + moment.utc( this.get('created') ).fromNow() + ''; - - return desc; - }, - - isPartial: function() { - if ( - this.get('title') || - this.get('details') || - this.get('category') || - this.get('file') - ) { - return true; - } - - return false; - }, - - createdDate: function() { - return moment.utc( this.get('created') ).format( 'H:mm Do MMM' ); - } - }) - }); -})(FMS, Backbone, _, $, moment); - -(function(FMS, Backbone, _, $) { - _.extend( FMS, { - Drafts: Backbone.Collection.extend({ - model: FMS.Draft, - localStorage: new Backbone.LocalStorage(CONFIG.NAMESPACE + '-drafts') - }) - }); -})(FMS, Backbone, _, $); -- cgit v1.2.3