| | |
| | | $('#modal_ok').attr('onclick','').unbind('click'); |
| | | }); |
| | | $('#logout').click(fm_logout); |
| | | fm_get_login(); // nach Ermittlung der Benutzerkennung wird TinyMCE initialisert |
| | | fm_get_login(); |
| | | fm_get_list(''); |
| | | fm_init_uploader(); |
| | | //fm_dok_editor_init(''); |
| | | /*window.onresize = function() { |
| | | fm_resize_editor(); |
| | | };*/ |
| | | } |
| | | |
| | | function fm_resize_editor() { |
| | | |
| | | window.clearTimeout(tmo); |
| | | tmo = window.setTimeout(function () { |
| | | //$('.mce-edit-area').height(ht - 100); |
| | | |
| | | try { |
| | | var myHeight = $('.zentrum').height() - $('.nord').height() - 4; |
| | | ed.theme.resizeTo('100%', myHeight); // sets the dimensions of the editable area |
| | | } catch (err) { |
| | | } |
| | | |
| | | |
| | | }, 200); |
| | | |
| | | |
| | | /* |
| | | if (ed) { |
| | | try { |
| | | var myHeight = $('.zentrum').height() - $('.nord').height() - 4; |
| | | ed.theme.resizeTo('100%', myHeight); // sets the dimensions of the editable area |
| | | } catch (err) { |
| | | } |
| | | } |
| | | */ |
| | | } |
| | | |
| | | function fm_get_path(uid) { |
| | |
| | | //console.log('base: ' + pdir + uid); |
| | | return pdir + uid; |
| | | } |
| | | /* |
| | | * Initialisierung von TinyMCE als separate Funktion, damit |
| | | * die Benutzerkennung nach deren Ermittlung als Teil des |
| | | * Basisverzeichnisses dienen kann |
| | | * |
| | | * Pruefen: Kann man das vor jedem Editor-Aufruf machen oder aber |
| | | * Teile wie z.B. das Basisverzeichnis spaeter wieder aendern? |
| | | * |
| | | * @param {String} uid die userid die auf das Basisverzeichnis verweist |
| | | * @returns {undefined} |
| | | */ |
| | | |
| | | function fm_dok_editor_init(uid) { |
| | | var base = fm_get_path(uid); |
| | | //console.log("calling tinymce.init with base: " + base + "/"); |
| | |
| | | width: "100%", |
| | | height: '100%', |
| | | document_base_url : base + "/", |
| | | /*autoresize_bottom_margin : 1,*/ |
| | | setup: function (editor) { |
| | | ed = editor; |
| | | } |
| | |
| | | } |
| | | }; |
| | | fd.append('dateiauswahlfeld', datei); |
| | | fd.append('pfad', pfad); |
| | | xhr.send(fd); |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | function fm_text_edit(content) { |
| | | function fm_text_edit(content, mode) { |
| | | fm_filectls_hide(); |
| | | $('.codeeditor-space').show(); |
| | | $('.code-editor-container').show(); |
| | | fm_code_edit(content); |
| | | fm_code_edit(content, mode); |
| | | openEditor = 'text'; |
| | | } |
| | | |
| | |
| | | var u = '../svc' + m; |
| | | fm_get(u, "text", function(resp) { |
| | | if(typ == 'text') { |
| | | fm_text_edit(resp); |
| | | var mode = "text/x-java"; |
| | | if(fname.endsWith('js')) { |
| | | mode = 'javascript'; |
| | | } else if(fname.endsWith('xml')) { |
| | | mode = 'xml'; |
| | | } else if(fname.endsWith('properties')) { |
| | | mode = 'xml'; |
| | | } |
| | | fm_text_edit(resp, mode); |
| | | } else { |
| | | fm_dok_edit(resp); |
| | | } |
| | |
| | | }); |
| | | } |
| | | |
| | | /* |
| | | function fm_bcr_step2(dirs, dirList) { |
| | | if(dirs.length > 0) { |
| | | dirList.push(new BcrFile(rp + '/' + dirs[dirs.length-1], dirs[dirs.length-1])); |
| | | $.get('tpl-bcr2.txt', function(template) { |
| | | $('#bcnav').append(Mustache.render(template, dirList[dirList.length-1])); |
| | | $('#bcnav').append($('#tpl-bcr3').html()); |
| | | fm_bcr_end(); |
| | | }); |
| | | //template = $('#tpl-bcr2').html(); |
| | | //Mustache.parse(template); // optional, speeds up future uses |
| | | //$('#bcnav').append(Mustache.render(template, dirList[dirList.length-1])); |
| | | } else { |
| | | $.get('tpl-bcr2.txt', function(template) { |
| | | $('#bcnav').append(Mustache.render(template, dirList[0])); |
| | | $('#bcnav').append($('#tpl-bcr3').html()); |
| | | fm_bcr_end(); |
| | | }); |
| | | //template = $('#tpl-bcr2').html(); |
| | | //Mustache.parse(template); // optional, speeds up future uses |
| | | //$('#bcnav').append(Mustache.render(template, dirList[0])); |
| | | } |
| | | } |
| | | */ |
| | | |
| | | function fm_bcr_3() { |
| | | $.get('tpl-bcr3.txt', function(template) { |
| | | $('#bcnav').append(template); |
| | | }); |
| | | } |
| | | |
| | | function fm_bcr_end() { |
| | | $('.breadcrumb-item').click(fm_bc_click); |
| | | $('#ansicht').click(fm_ansicht_umschalten); |
| | | fm_set_modus(); |
| | | } |
| | | |
| | | function fm_menu_datei_speichern() { |
| | | //var fname = $('.datei-gewaehlt').text(); |
| | | var fname = openFileName; |
| | |
| | | |
| | | /* ---- codemirror editor handling -------- */ |
| | | |
| | | function fm_code_edit(content) { |
| | | function fm_code_edit(content, m) { |
| | | cm = CodeMirror.fromTextArea(document.getElementById("editspace"), { |
| | | lineNumbers: true, |
| | | mode: "xml", |
| | | mode: m, |
| | | viewportMargin : Infinity, |
| | | extraKeys: { |
| | | "F9": function(cm) { |