Commit f4147dfad51ecacca61467564f6b4790114abd10

Few editor changes

  - Site Menu configuration now has a HTML code editor, instead of a dummy
    textbox like before.
  - Page list overflowing is fixed by adding a scroll to it.
  
3333}
3434#pagelist {
3535 padding: 10px;
36 height: 300px;
37 overflow-y: auto;
3638}
3739#content {
3840 padding: 10px;
8181 top: 0;
8282 left: 0;
8383 width: 100%;
84 height: 500px;
84 height: 300px;
85}
86#updateMenu {
87 margin-top: 10px;
8588}
8689#editor-overlay {
8790 position: absolute;
  
1010 'click #addPage': 'addPage',
1111 'click .pagename .remove': 'removePage',
1212 'click #menu-config': 'showMenu',
13 'click #footer-config': 'showFooterConfig'
1314 },
1415 initialize: function() {
1516 _.bindAll.apply(_, [this].concat(_.functions(this)));
8383 M.editor.showOverlay();
8484 },
8585 showMenu: function(event) {
86 event.preventDefault();
8687 this.menuconfigview.render();
88 return false;
8789 },
90 showFooterConfig: function(event) {
91 event.preventDefault();
92 //this.footerconfigview.render();
93 return false;
94 },
8895 // validate the page list with menu order list
8996 validate: function() {
9097 //TODO: validate if the menu order list matches with the list of pages
493493 this.$menuOrder.hide();
494494 $('#custom-menu').attr('checked', true);
495495 this.$menuOptions.show({complete: function() {
496 //M.editor.wysiwig('#menu');
496 M.editor.code.init('menu', 'html');
497497 }});
498498 }
499499 },
501501 if(bool === true) {
502502 this.$menuOrder.hide();
503503 this.$menuOptions.show({complete: function() {
504 //M.editor.wysiwig('#menu');
504 M.editor.code.init('menu', 'html');
505505 }});
506506 }
507507 else {
522522 saveMenu: function() {
523523 //console.log('saving menu..');
524524 if($('#custom-menu').is(':checked')) {
525 var html = $('#menu').val().trim() || '';
525 //var html = $('#menu').val().trim() || '';
526 var html = M.editor.code.save('menu');
526527 this.model.set({'customMenu': true, 'html': html});
527528 }
528529 else {
547547 //alert('end of save menu');
548548 M.editor.showOverlay();
549549 }
550 });
551
552 /* Footer Config View */
553 var FooterConfigView = Backbone.View.extend({
550554 });
551555
552556 /* Notification view */
  
9393 </div>
9494 <div class="row">
9595 <label><strong> HTML for menu: </strong></label>
96 <textarea class="form-control" cols="25" rows="8" id="menu"><%= menu %></textarea>
96 <div class="ace-mouchak" id="menu"><%= M.escapeHtml(menu) %></div>
9797 </div>
9898 </div>
9999
112112 <div id="pagelist"></div>
113113 <button class="btn btn-primary" id="addPage">Add Page</button>
114114 <hr>
115 <p> <a href="javascript:void(0);" id="menu-config"> Site Menu </a> </p>
115 <p> <a href="#" id="menu-config"> Site Menu </a> </p>
116 <p> <a href="#" id="footer-config"> Footer Config </a> </p>
116117 <p><a href="{{ url_for('index') }}"> Go to site </a></p>
117118 </div>
118119 </script>