| | |
| | | $('#newTextFile').on('click', fm_menu_neue_textdatei); |
| | | $('#newDoc').on('click', fm_menu_neues_dokument); |
| | | $('#newFolder').on('click', fm_get_new_folder); |
| | | $('#viewFile').on('click', fm_view_file); |
| | | $('#editTextFile').on('click', function() { |
| | | fm_get_file_content('text'); |
| | | }); |
| | |
| | | $('#modal_ok').attr('onclick','').unbind('click'); |
| | | }); |
| | | $('#logout').click(fm_logout); |
| | | fm_get_login(); |
| | | fm_get_login(dokEditorInit); // nach Ermittlung der Benutzerkennung wird TinyMCE initialisert |
| | | fm_get_list(''); |
| | | fm_init_uploader(); |
| | | |
| | | window.onresize = function() { |
| | | fm_resizeEditor(); |
| | | }; |
| | | } |
| | | |
| | | function fm_resizeEditor() { |
| | | if (ed) { |
| | | try { |
| | | var myHeight = $('.zentrum').height() - $('.nord').height() - 4; |
| | | ed.theme.resizeTo('100%', myHeight); // sets the dimensions of the editable area |
| | | } catch (err) { |
| | | } |
| | | } |
| | | } |
| | | |
| | | /* |
| | | * 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 {type} userid die userid die auf das Basisverzeichnis verweist |
| | | * @returns {undefined} |
| | | */ |
| | | function dokEditorInit(userid) { |
| | | |
| | | var base = "/data/" + userid + "/"; |
| | | |
| | | /* |
| | | * Konfiguration TinyMCE |
| | |
| | | /*resize: 'both',*/ |
| | | width: "100%", |
| | | height: '100%', |
| | | document_base_url : base, |
| | | /*autoresize_bottom_margin : 1,*/ |
| | | setup: function (editor) { |
| | | ed = editor; |
| | | } |
| | | }); |
| | | window.onresize = function() { |
| | | fm_resizeEditor(); |
| | | }; |
| | | } |
| | | function fm_resizeEditor() { |
| | | if (ed) { |
| | | try { |
| | | var myHeight = $('.zentrum').height() - $('.nord').height() - 4; |
| | | ed.theme.resizeTo('100%', myHeight); // sets the dimensions of the editable area |
| | | } catch (err) { |
| | | } |
| | | } |
| | | } |
| | | |
| | | /* ----- Uploader Anfang ----------*/ |
| | |
| | | } |
| | | /* ----- API Calls ------------- */ |
| | | |
| | | function fm_get_login() { |
| | | function fm_get_login(callback) { |
| | | var m = '?c=de.uhilger.filecms.pub.SessionManager&m=getSessionUser'; |
| | | var u = '../pub' + m; |
| | | fm_get(u, "text", function(resp) { |
| | | $('#userMenu').text(resp); |
| | | callback(resp); |
| | | }); |
| | | } |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | function fm_view_file() { |
| | | // http://localhost:8080/file-cms/ui/# |
| | | // http://localhost:8080/file-cms/data/admin/usw. |
| | | |
| | | var userid = $('#userMenu').text(); |
| | | var gewaehlte = $('.datei-gewaehlt'); |
| | | var fname = $(gewaehlte[0]).text(); |
| | | window.open("/data/" + userid + '/' + fname, '_blank'); |
| | | } |
| | | |
| | | function fm_del_files() { |
| | | var gewaehlte = $('.datei-gewaehlt'); |
| | | //console.log('anzahl: ' + gewaehlte.length); |