Commit 525ffb83d34b86bb4da29fe8c1f54c6b7df0c426

  • avatar
  • arvind
  • Wed Jun 18 18:09:46 IST 2014
Fix: Adding support for audio tags.
  
3232 }
3333 });
3434
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
3544 var Image = BaseType.extend({
3645 defaults: _.extend({
3746 src: ""
184184 'base': BaseType,
185185 'text': Text,
186186 'image': Image,
187 'audio': Audio,
187188 'video': Video,
188189 'menu': Menu,
189190 'rss': RSS,
196196 };
197197
198198 //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'];
200200
201201})(M);
  
122122 else {
123123 $('#navigation').show();
124124 }
125 M.appView.navView.trigger('navclicked');
125 M.appView.navView.trigger('navclicked');
126126 },
127127 render404: function() {
128128 $('.pageview').hide();
132132 }
133133});
134134
135// hashmap to maintain one-to-one lookup among page ids and
135// hashmap to maintain one-to-one lookup among page ids and
136136// their names
137137var nameIdMap = {};
138138
206206 _.each(model.get('attr'), function(val, key) {
207207 $(el).attr(key, val);
208208 });
209}
209};
210210
211211// create the list of tags and associate the objects with related tags
212212M.createTagList = function(content, model) {
  
5151 }
5252 });
5353
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
5465 var ImageView = Backbone.View.extend({
5566 tagName: 'img',
5667 className: '',
187187 M.types.view = {
188188 'text': TextView,
189189 'image': ImageView,
190 'audio/ogg': AudioView,
190191 'video': VideoView,
191192 'rss': RSSView,
192193 'table': TableView,
  
107107 </div>
108108 </script>
109109
110 <script type="text/template" id="audio-template">
111 <audio src="<%= src%>" controls="controls"></audio>
112 </script>
110113 <script type="text/template" id="image-view-template">
111114 <div class="img-wrapper">
112115 <img src="<%= src %>">