Commit 541dcd12e382d0f95c15c04d6f1f31bf1a1e5e4a

Add Plugin type in the editor
  
99 'click .pagename .disp': 'showPage',
1010 'click #addPage': 'addPage',
1111 'click .pagename .remove': 'removePage',
12 'click #menu-config': 'showMenu'
12 'click #menu-config': 'showMenu',
13 'click #footer-config': 'footerConfig'
1314 },
1415 initialize: function() {
1516 _.bindAll(this);
2525 //console.log(menu);
2626 this.menuconfig = new M.types.model.menu(menu);
2727 this.menuconfigview = new MenuConfigView({model: this.menuconfig});
28 this.footerconfigview = new FooterConfigView();
2829 },
2930 render: function() {
3031 // append the page list
6969 },
7070 showMenu: function(event) {
7171 this.menuconfigview.render();
72 },
73 footerConfig: function(event) {
74 this.footerconfigview.render();
7275 }
7376 });
7477
263263 // init the wysiwig editor
264264 M.editor.wysiwig('#edit');
265265 }
266 else if(type === 'image' || type === 'video' || type === 'audio') {
266 else if(type === 'image' || type === 'video' ||
267 type === 'audio' || type === 'plugin') {
267268 var template = _.template($('#media-template').html());
269
268270 $('#specific-content').html(template({
269271 src: this.model.get('src')
270272 }));
313313 done: function() {
314314 this.update();
315315 this.cleanUp();
316 }
317 });
318
319 /* view to configure footer */
320 var FooterConfigView = Backbone.View.extend({
321 tagName: 'div',
322 id: 'page',
323 events: {
324 'click #saveFooter': 'saveFooter'
325 },
326 initialize: function() {
327 _.bindAll(this);
328 this.template = _.template($('#footer-config-template').html());
329 },
330 render: function() {
331 $('#page').remove();
332 $('#content-container').append(this.$el);
333 this.$el.html(this.template());
334 M.editor.wysiwig('#footer-input');
335 },
336 saveFooter: function() {
337 tinymce.triggerSave(false, true);
338 var data = $('#footer-input').html();
339 console.log(data);
316340 }
317341 });
318342