Commit 9fff9f311ab6c5e51d053dd3a8b16c3721b63445

  • avatar
  • arvind
  • Wed Jul 31 16:42:26 IST 2013
Whitespace and indentation changes.
  • Diff rendering mode:
  • inline
  • side by side

static/js/editor.js

266266
267 //provide the users a preview267 //provide the users a preview
268 /*var view = new M.types.view[type]({model: this.model});268 /*var view = new M.types.view[type]({model: this.model});
269 //$('#specific-content.preview').html();
270 view.render('.preview');*/
269 //$('#specific-content.preview').html();
270 view.render('.preview');*/
271 }271 }
272 },272 },
273 typeChanged: function(event) {273 typeChanged: function(event) {
339 }339 }
340 },340 },
341 showMenuOptions: function(bool) {341 showMenuOptions: function(bool) {
342 if(bool === true) {
343 this.$menuOptions.show({complete: function() {
342 if(bool === true) {
343 this.$menuOptions.show({complete: function() {
344 //M.editor.wysiwig('#menu');344 //M.editor.wysiwig('#menu');
345 }});345 }});
346 }346 }
360 },360 },
361 saveMenu: function() {361 saveMenu: function() {
362 console.log('saving menu..');362 console.log('saving menu..');
363 // var menuHTML = $('#menu').val().trim();
363 // var menuHTML = $('#menu').val().trim();
364 //this.model.set({'html': menuHTML});364 //this.model.set({'html': menuHTML});
365 //console.log(this.model.toJSON());365 //console.log(this.model.toJSON());
366 //alert('saveMenu called');366 //alert('saveMenu called');
367 var bool;
368 if($("custom-menu").is(":checked")){
369 bool = true;
370 }
371 else{
372 bool = false;
373 }
374 this.model.save({customMenu: bool}, {
367 var bool;
368 if($("custom-menu").is(":checked")) {
369 bool = true;
370 }
371 else {
372 bool = false;
373 }
374 this.model.save({customMenu: bool}, {
375 success: function(model, response) {375 success: function(model, response) {
376 console.log(model, response);376 console.log(model, response);
377 },377 },
394 },394 },
395 wysiwig: function($selector) {395 wysiwig: function($selector) {
396 tinymce.init({396 tinymce.init({
397 selector: $selector,
398 theme: 'modern',
399 height: 300,
400 plugins: ["advlist autolink link image lists charmap print preview hr",
401 "anchor pagebreak spellchecker searchreplace wordcount",
402 "visualblocks visualchars code fullscreen insertdatetime",
403 "media nonbreaking save table contextmenu directionality",
404 "emoticons template paste textcolor"
405 ],
406 toolbar: "undo redo | styleselect | bold italic | " +
407 "alignleft aligncenter alignright alignjustify | " +
408 "bullist numlist outdent indent | link image | " +
397 selector: $selector,
398 theme: 'modern',
399 height: 300,
400 plugins: ["advlist autolink link image lists charmap print preview hr",
401 "anchor pagebreak spellchecker searchreplace wordcount",
402 "visualblocks visualchars code fullscreen insertdatetime",
403 "media nonbreaking save table contextmenu directionality",
404 "emoticons template paste textcolor"
405 ],
406 toolbar: "undo redo | styleselect | bold italic | " +
407 "alignleft aligncenter alignright alignjustify | " +
408 "bullist numlist outdent indent | link image | " +
409 "print preview media fullpage | forecolor backcolor emoticons"409 "print preview media fullpage | forecolor backcolor emoticons"
410 });410 });
411 }411 }