This commit is contained in:
Brittany Storoz 2015-07-06 16:06:48 -04:00
Родитель cc94469d06
Коммит b80eb737e8
11 изменённых файлов: 110 добавлений и 2 удалений

25
app/models/episode.js Normal file
Просмотреть файл

@ -0,0 +1,25 @@
import DS from 'ember-data';
export default DS.Model.extend({
podcast: DS.belongsTo('podcast', {async: true}),
name: DS.attr('string'),
audioURL: DS.attr('string'),
audioLength: DS.attr('number'),
playbackPosition: DS.attr('number'),
playCount: DS.attr('number'),
// audioFile: DS.attr('object'),
guid: DS.attr('string'),
// Episode metadata from RSS.
datePublished: DS.attr('number'),
// Episode download data; unavailable in hosted version for the time being.
isDownloaded: DS.attr('boolean'),
_chunkCount: DS.attr('number'),
_chunkCountSaved: DS.attr('number'),
_loadComplete: false,
isDownloading: false,
isPlaying: false
});

14
app/models/podcast.js Normal file
Просмотреть файл

@ -0,0 +1,14 @@
import DS from 'ember-data';
export default DS.Model.extend({
episodes: DS.hasMany('episode', {async: true}),
title: DS.attr('string'),
description: DS.attr('string'),
rssURL: DS.attr('string'),
lastUpdated: DS.attr('number'),
lastPlayed: DS.attr('number'),
coverImageBlob: DS.attr('string'),
coverImageURL: DS.attr('string'),
});

Просмотреть файл

@ -6,6 +6,14 @@ var Router = Ember.Router.extend({
});
Router.map(function() {
this.route('search');
this.resource('podcasts', function() {
this.route('new');
});
this.resource('podcast', { path: '/podcast/:podcase_id'});
this.resource('episode', { path: '/episode/:episode_id' });
});
export default Router;

4
app/routes/podcasts.js Normal file
Просмотреть файл

@ -0,0 +1,4 @@
import Ember from 'ember';
export default Ember.Route.extend({
});

Просмотреть файл

@ -1,3 +1 @@
<h2 id="title">Welcome to Ember.js</h2>
{{outlet}}

Просмотреть файл

@ -0,0 +1 @@
{{outlet}}

Просмотреть файл

@ -25,6 +25,7 @@
"ember-cli-babel": "^5.0.0",
"ember-cli-content-security-policy": "0.4.0",
"ember-cli-dependency-checker": "^1.0.0",
"ember-cli-fxos": "0.1.1",
"ember-cli-htmlbars": "0.7.6",
"ember-cli-ic-ajax": "0.1.1",
"ember-cli-inject-live-reload": "^1.3.0",

22
public/manifest.webapp Normal file
Просмотреть файл

@ -0,0 +1,22 @@
{
"version": "@@versionNumber",
"name": "@@appName",
"description": "@@appDescription",
"icons": {
"32": "/assets/images/icons/icon-32.png",
"60": "/assets/images/icons/icon-60.png",
"64": "/assets/images/icons/icon-64.png",
"90": "/assets/images/icons/icon-90.png",
"120": "/assets/images/icons/icon-120.png",
"128": "/assets/images/icons/icon-128.png",
"256": "/assets/images/icons/icon-256.png"
},
"developer": {
"name": "@@developerName",
"url": "@@developerUrl"
},
"launch_path": "/index.html",
"installs_allowed_from": ["https://marketplace.firefox.com", "*"],
"permissions": {
}
}

Просмотреть файл

@ -0,0 +1,12 @@
import { moduleForModel, test } from 'ember-qunit';
moduleForModel('episode', 'Unit | Model | episode', {
// Specify the other units that are required for this test.
needs: []
});
test('it exists', function(assert) {
var model = this.subject();
// var store = this.store();
assert.ok(!!model);
});

Просмотреть файл

@ -0,0 +1,12 @@
import { moduleForModel, test } from 'ember-qunit';
moduleForModel('podcast', 'Unit | Model | podcast', {
// Specify the other units that are required for this test.
needs: []
});
test('it exists', function(assert) {
var model = this.subject();
// var store = this.store();
assert.ok(!!model);
});

Просмотреть файл

@ -0,0 +1,11 @@
import { moduleFor, test } from 'ember-qunit';
moduleFor('route:podcasts', 'Unit | Route | podcasts', {
// Specify the other units that are required for this test.
// needs: ['controller:foo']
});
test('it exists', function(assert) {
var route = this.subject();
assert.ok(route);
});