| | |
| | | $('#m-paste').on('click', fm_menu_paste); |
| | | $('#m-shrink').on('click', fm_menu_shrink); |
| | | $('#m-test').on('click', fm_menu_test); |
| | | $('#m-test-2').on('click', fm_menu_test_2); |
| | | $('#saveModal').on('hidden.bs.modal', function (e) { |
| | | $('#modal_ok').attr('onclick','').unbind('click'); |
| | | }); |
| | |
| | | */ |
| | | tinymce.init({ |
| | | content_css : "/file-cms/ui/mce.css", |
| | | //content_css: "/jslib/bootstrap/css/bootstrap.min.css", |
| | | selector: "textarea.text-editor", |
| | | statusbar: false, |
| | | menubar: false, |
| | |
| | | } |
| | | } |
| | | |
| | | function fm_menu_test_2() { |
| | | var liste = fm_gewaehlte_dateien(); |
| | | var m = '?c=de.uhilger.filecms.api.CompileService&m=compile&p=' + pfad + '&p=' + encodeURIComponent(liste); |
| | | var u = '../svc' + m; |
| | | fm_get(u, "text", function(resp) { |
| | | console.log('compile gab folgendes zurueck: '); |
| | | console.log(resp); |
| | | }); |
| | | } |
| | | |
| | | function fm_ansicht_umschalten() { |
| | | if($('#ansicht').children(0).hasClass('fa-th-list')) { |
| | | $('#ansicht').children(0).addClass('fa-th-large'); |
| | |
| | | } |
| | | |
| | | function fm_menu_datei_schliessen() { |
| | | if(tinymce.activeEditor.undoManager.hasUndo()) { |
| | | // hier Abfrage ob gespeichert werden soll |
| | | $('#confirmOk').click(function() { |
| | | $('#confirmOk').attr('onclick','').unbind('click'); |
| | | fm_menu_datei_speichern(function() { |
| | | fm_do_close(); |
| | | }); |
| | | }); |
| | | $('#confirmCancel').click(function() { |
| | | $('#confirmCancel').attr('onclick','').unbind('click'); |
| | | }); |
| | | $('#confirmClose').show(); |
| | | $('#confirmClose').click(function() { |
| | | $('#confirmClose').attr('onclick','').unbind('click'); |
| | | if(openEditor === 'text') { |
| | | if(!cm.getDoc().isClean()) { |
| | | fm_ask_for_save(); |
| | | } else { |
| | | fm_do_close(); |
| | | } |
| | | } else { |
| | | if(tinymce.activeEditor.undoManager.hasUndo()) { |
| | | fm_ask_for_save(); |
| | | } else { |
| | | fm_do_close(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | function fm_ask_for_save() { |
| | | // hier Abfrage ob gespeichert werden soll |
| | | $('#confirmOk').click(function() { |
| | | $('#confirmOk').attr('onclick','').unbind('click'); |
| | | fm_menu_datei_speichern(function() { |
| | | fm_do_close(); |
| | | }); |
| | | $('#confirmOk').text("Speichern"); |
| | | $('#confirmOk').addClass('btn-primary'); |
| | | $('#confirmOk').removeClass('btn-danger'); |
| | | $('#confirmModalTitle').text("Schliessen"); |
| | | $('#confirmModalBody').text("Speichern vor dem Schliessen?"); |
| | | $('#confirmModal').modal({ |
| | | keyboard: false, |
| | | show: true |
| | | }); |
| | | } else { |
| | | }); |
| | | $('#confirmCancel').click(function() { |
| | | $('#confirmCancel').attr('onclick','').unbind('click'); |
| | | }); |
| | | $('#confirmClose').show(); |
| | | $('#confirmClose').click(function() { |
| | | $('#confirmClose').attr('onclick','').unbind('click'); |
| | | fm_do_close(); |
| | | } |
| | | }); |
| | | $('#confirmOk').text("Speichern"); |
| | | $('#confirmOk').addClass('btn-primary'); |
| | | $('#confirmOk').removeClass('btn-danger'); |
| | | $('#confirmModalTitle').text("Schliessen"); |
| | | $('#confirmModalBody').text("Speichern vor dem Schliessen?"); |
| | | $('#confirmModal').modal({ |
| | | keyboard: false, |
| | | show: true |
| | | }); |
| | | } |
| | | |
| | | function fm_do_close() { |
| | |
| | | var content; |
| | | if(openEditor === 'text') { |
| | | content = cm.getValue(); |
| | | cm.getDoc().markClean(); |
| | | } else { |
| | | content = ed.getContent(); |
| | | tinymce.activeEditor.undoManager.clear(); |
| | | } |
| | | var m = '?c=de.uhilger.filecms.api.FileMgr&m=' + method; |
| | | var u = '../svc' + m; |
| | | fm_post(u, {p1: pfad, p2: saveFileName, p3: content}, function(resp) { |
| | | // hier scheint nichts zurueckzukommen.. |
| | | }); |
| | | tinymce.activeEditor.undoManager.clear(); |
| | | openFileName = saveFileName; |
| | | if(callback !== undefined) { |
| | | if(typeof (callback) !== 'function') { |
| | | |
| | | } else { |
| | | callback(); |
| | | } |
| | | } |
| | |
| | | lineNumbers: true, |
| | | mode: m, |
| | | viewportMargin : Infinity, |
| | | tabSize: 2, |
| | | extraKeys: { |
| | | "F9": function(cm) { |
| | | cm.setOption("fullScreen", !cm.getOption("fullScreen")); |
| | |
| | | //cm.setValue(htmlDecode(content)); |
| | | //cm.setValue(content); |
| | | cm.setValue(unescapeHtml(content)); |
| | | cm.getDoc().markClean(); |
| | | } |
| | | |
| | | |