Permalink
Browse files

putting some dummy data in, and adding the beginning of the email module

  • Loading branch information...
1 parent 326869a commit 1c2296404335fb58df6e67f603ef7c19a1c93728 @boazsender boazsender committed Feb 22, 2012
Showing with 72 additions and 0 deletions.
  1. +43 −0 www/app/modules/email.js
  2. +29 −0 www/assets/data/email.json
View
@@ -0,0 +1,43 @@
+define([
+ "namespace",
+
+ // Libs
+ "use!backbone"
+
+ // Modules
+
+ // Plugins
+],
+
+function(epp, Backbone) {
+
+ // Create a new module
+ var Email = epp.module();
+
+ // Example extendings
+ Example.Model = Backbone.Model.extend({});
+ Example.Collection = Backbone.Collection.extend({
+ url: '/assets/data/email.json'
+ });
+ Example.Router = Backbone.Router.extend({ /* ... */ });
+
+ // This will fetch the tutorial template and render it.
+ Example.Views.Tutorial = Backbone.View.extend({
+ template: "app/templates/example.html",
+
+ render: function(done) {
+ var view = this;
+
+ // Fetch the template, render it to the View element and call done.
+ namespace.fetchTemplate(this.template, function(tmpl) {
+ view.el.innerHTML = tmpl();
+
+ done(view.el);
+ });
+ }
+ });
+
+ // Required, return the module for AMD compliance
+ return Example;
+
+});
View
@@ -0,0 +1,29 @@
+[
+ {
+ "from": "eric@awesome.com",
+ "cc": [
+ "boaz@bocoup,com",
+ "tim@bocoup.com"
+ ],
+ "subject": "Mai email",
+ "body": "a bunch of HTML eric"
+ },
+ {
+ "from": "boaz@awesome.com",
+ "cc": [
+ "eirc@bocoup,com",
+ "tim@bocoup.com"
+ ],
+ "subject": "Mai email",
+ "body": "a bunch of HTML from boaz"
+ },
+ {
+ "from": "tim@awesome.com",
+ "cc": [
+ "eric@bocoup,com",
+ "tim@bocoup.com"
+ ],
+ "subject": "Mai email",
+ "body": "a bunch of HTML from tim"
+ }
+]

0 comments on commit 1c22964

Please sign in to comment.