| | |
| | | $('#closeFile').on('click', fm_menu_datei_schliessen); |
| | | $('#myModal').on('hidden.bs.modal', function (e) { |
| | | $('#modal_ok').attr('onclick','').unbind('click'); |
| | | }) |
| | | }); |
| | | $('#logout').click(fm_logout); |
| | | fm_get_login(); |
| | | } |
| | | |
| | |
| | | $('#dateiansicht').show(); |
| | | } |
| | | |
| | | /* ----- API Calls ------------- */ |
| | | |
| | | function fm_get_login() { |
| | | var m = '?c=de.uhilger.um.pub.SessionManager&m=getSessionUser'; |
| | | var u = '../../um/pub' + m; |
| | | fm_get(u, function(resp) { |
| | | fm_get(u, "json", function(resp) { |
| | | $('#userMenu').text(resp.UserData.firstName); |
| | | }); |
| | | } |
| | |
| | | */ |
| | | } |
| | | |
| | | function fm_logout() { |
| | | var m = '?c=de.uhilger.filecms.pub.SessionManager&m=expireSession'; |
| | | var u = '../pub' + m; |
| | | |
| | | fm_get(u, "text", function(resp) { |
| | | $('#userMenu').text('nicht angemeldet'); |
| | | window.location.href = '../logout.html'; |
| | | }); |
| | | } |
| | | |
| | | |
| | | /* ---- codemirror editor handling -------- */ |
| | | |
| | | function fm_code_edit(content) { |
| | |
| | | |
| | | /* -------- helper functions ----------- */ |
| | | |
| | | function fm_get(u, scallback) { |
| | | function fm_get(u, dtype, scallback) { |
| | | $.ajax({ |
| | | url: u, |
| | | type: "GET", |
| | | dataType: "json", |
| | | dataType: dtype, |
| | | success: scallback, |
| | | error: function (xhr, status, errorThrown) { |
| | | alert("Error: " + errorThrown + " Status: " + status + " URL: " + u); |