| | |
| | | |
| | | function um_init() { |
| | | $('.user-save-btn').click(um_user_save); |
| | | $('#nutzerliste').click(um_user_list_click); |
| | | $('#nutzerLoeschen').click(um_del_user); |
| | | $('#nutzerNeu').click(um_new_user); |
| | | $('#nutzerLoeschen').prop( "disabled", true ); |
| | | |
| | | } |
| | | |
| | | /* ----- user functions ------ */ |
| | | |
| | | function um_user_save() { |
| | | var user = um_user_form_lesen(); |
| | |
| | | um_apicall(self.serialisieren(user)); |
| | | } |
| | | } |
| | | |
| | | function um_del_user(user_name) { |
| | | alert('delete user ' + user_name); |
| | | } |
| | | |
| | | function um_new_user() { |
| | | alert('show form to enter new user'); |
| | | } |
| | | |
| | | /* ----------- ui interaction ------------ */ |
| | | |
| | | function um_user_list_click() { |
| | | var user_name = 'noch aus liste ermitteln..'; |
| | | alert('user list click, user: ' + user_name); |
| | | } |
| | | |
| | | |
| | | /* ------- ui i/o ------ */ |
| | | |
| | | function um_user_form_lesen() { |
| | | var userId = $('#anmeldename').val(); |
| | | var kw = $('#kennwort').val(); |
| | | var user = new User(userId, kw, '-', '-', '-'); |
| | | return user; |
| | | } |
| | | |
| | | |
| | | |
| | | /* ---- api calls ----- */ |
| | | |
| | | function um_apicall(obj) { |
| | | var c = 'de.uhilger.um.api.UserMgr'; |
| | |
| | | }); |
| | | } |
| | | |
| | | function um_user_form_lesen() { |
| | | var userId = $('#anmeldename').val(); |
| | | var kw = $('#kennwort').val(); |
| | | var user = new User(userId, kw, '-', '-', '-'); |
| | | return user; |
| | | } |
| | | /* ----- Hilfsfunktionen ----- */ |
| | | |
| | | function serialisieren(obj) { |
| | | return '{"' + obj.constructor.name + '":' + JSON.stringify(obj) + '}'; |
| | | }; |
| | | |
| | | /* ----- Objekte ----- */ |
| | | |
| | | function User(i, p, fn, ln, em) { |
| | | this.id = i; |
| | | this.pw = p; |