Commit 9fff9f311ab6c5e51d053dd3a8b16c3721b63445
- Diff rendering mode:
- inline
- side by side
static/js/editor.js
(25 / 25)
  | |||
266 | 266 | ||
267 | 267 | //provide the users a preview | |
268 | 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 | 273 | typeChanged: function(event) { | |
… | … | ||
339 | 339 | } | |
340 | 340 | }, | |
341 | 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 | 344 | //M.editor.wysiwig('#menu'); | |
345 | 345 | }}); | |
346 | 346 | } | |
… | … | ||
360 | 360 | }, | |
361 | 361 | saveMenu: function() { | |
362 | 362 | console.log('saving menu..'); | |
363 | // var menuHTML = $('#menu').val().trim(); | ||
363 | // var menuHTML = $('#menu').val().trim(); | ||
364 | 364 | //this.model.set({'html': menuHTML}); | |
365 | 365 | //console.log(this.model.toJSON()); | |
366 | 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 | 375 | success: function(model, response) { | |
376 | 376 | console.log(model, response); | |
377 | 377 | }, | |
… | … | ||
394 | 394 | }, | |
395 | 395 | wysiwig: function($selector) { | |
396 | 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 | 409 | "print preview media fullpage | forecolor backcolor emoticons" | |
410 | 410 | }); | |
411 | 411 | } |