Commit 525ffb83d34b86bb4da29fe8c1f54c6b7df0c426
- Diff rendering mode:
- inline
- side by side
mouchak/static/js/models.js
(11 / 1)
  | |||
32 | 32 | } | |
33 | 33 | }); | |
34 | 34 | ||
35 | var Audio = BaseType.extend({ | ||
36 | defaults: _.extend({ | ||
37 | src: "" | ||
38 | }, BaseType.prototype.defaults), | ||
39 | initialize:function() { | ||
40 | BaseType.prototype.initialize.call(this, arguments); | ||
41 | } | ||
42 | }); | ||
43 | |||
35 | 44 | var Image = BaseType.extend({ | |
36 | 45 | defaults: _.extend({ | |
37 | 46 | src: "" | |
… | … | ||
184 | 184 | 'base': BaseType, | |
185 | 185 | 'text': Text, | |
186 | 186 | 'image': Image, | |
187 | 'audio': Audio, | ||
187 | 188 | 'video': Video, | |
188 | 189 | 'menu': Menu, | |
189 | 190 | 'rss': RSS, | |
… | … | ||
196 | 196 | }; | |
197 | 197 | ||
198 | 198 | //content types to render in content menu | |
199 | M.contentTypes = ['text', 'image', 'video', 'table', 'plugin', 'map']; | ||
199 | M.contentTypes = ['text', 'image', 'video', 'audio/ogg', 'table', 'plugin', 'map']; | ||
200 | 200 | ||
201 | 201 | })(M); |
mouchak/static/js/mouchak.js
(3 / 3)
  | |||
122 | 122 | else { | |
123 | 123 | $('#navigation').show(); | |
124 | 124 | } | |
125 | M.appView.navView.trigger('navclicked'); | ||
125 | M.appView.navView.trigger('navclicked'); | ||
126 | 126 | }, | |
127 | 127 | render404: function() { | |
128 | 128 | $('.pageview').hide(); | |
… | … | ||
132 | 132 | } | |
133 | 133 | }); | |
134 | 134 | ||
135 | // hashmap to maintain one-to-one lookup among page ids and | ||
135 | // hashmap to maintain one-to-one lookup among page ids and | ||
136 | 136 | // their names | |
137 | 137 | var nameIdMap = {}; | |
138 | 138 | ||
… | … | ||
206 | 206 | _.each(model.get('attr'), function(val, key) { | |
207 | 207 | $(el).attr(key, val); | |
208 | 208 | }); | |
209 | } | ||
209 | }; | ||
210 | 210 | ||
211 | 211 | // create the list of tags and associate the objects with related tags | |
212 | 212 | M.createTagList = function(content, model) { |
mouchak/static/js/views.js
(12 / 0)
  | |||
51 | 51 | } | |
52 | 52 | }); | |
53 | 53 | ||
54 | var AudioView = Backbone.View.extend({ | ||
55 | template: _.template($("#audio-template").html()), | ||
56 | initialize: function() { | ||
57 | _.bindAll.apply(_, [this].concat(_.functions(this))); | ||
58 | _.bind(this.render, this); | ||
59 | }, | ||
60 | render: function(el) { | ||
61 | $(el).append(this.template(src=this.model.get('src'))); | ||
62 | } | ||
63 | }); | ||
64 | |||
54 | 65 | var ImageView = Backbone.View.extend({ | |
55 | 66 | tagName: 'img', | |
56 | 67 | className: '', | |
… | … | ||
187 | 187 | M.types.view = { | |
188 | 188 | 'text': TextView, | |
189 | 189 | 'image': ImageView, | |
190 | 'audio/ogg': AudioView, | ||
190 | 191 | 'video': VideoView, | |
191 | 192 | 'rss': RSSView, | |
192 | 193 | 'table': TableView, |
mouchak/templates/index.html
(3 / 0)
  | |||
107 | 107 | </div> | |
108 | 108 | </script> | |
109 | 109 | ||
110 | <script type="text/template" id="audio-template"> | ||
111 | <audio src="<%= src%>" controls="controls"></audio> | ||
112 | </script> | ||
110 | 113 | <script type="text/template" id="image-view-template"> | |
111 | 114 | <div class="img-wrapper"> | |
112 | 115 | <img src="<%= src %>"> |