From 4df887b069b57f35e8d2124a3410a30ea899496b Mon Sep 17 00:00:00 2001
From: ulrich <not disclosed>
Date: Sat, 17 Dec 2016 14:50:39 +0000
Subject: [PATCH] user list hinzugefuegt, ui.js aufgeraeumt

---
 web/ui/user.jsp |   11 +++++++++--
 web/ui/ui.js    |   45 +++++++++++++++++++++++++++++++++++++++------
 2 files changed, 48 insertions(+), 8 deletions(-)

diff --git a/web/ui/ui.js b/web/ui/ui.js
index cb2f979..10a90dd 100644
--- a/web/ui/ui.js
+++ b/web/ui/ui.js
@@ -1,7 +1,14 @@
 
 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();
@@ -13,6 +20,35 @@
     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';
@@ -37,17 +73,14 @@
   });      
 }
 
-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;
diff --git a/web/ui/user.jsp b/web/ui/user.jsp
index 8952c94..d7b6683 100644
--- a/web/ui/user.jsp
+++ b/web/ui/user.jsp
@@ -10,12 +10,19 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
     <title>Benutzer</title>
-    <link rel="stylesheet" href="/jslib/skeleton-2.0.4/css/normalize.css">
-    <link rel="stylesheet" href="/jslib/skeleton-2.0.4/css/skeleton.css">
+    <!-- <link rel="stylesheet" href="/jslib/skeleton-2.0.4/css/normalize.css"> -->
+    <!-- <link rel="stylesheet" href="/jslib/skeleton-2.0.4/css/skeleton.css"> -->
     <link rel="stylesheet" type="text/css" href="stile.css">
   </head>
   <body>
     <h1>Benutzer</h1>
+    <div id="user-list-form">
+      <select size="10" name="nutzerliste" id="nutzerliste">
+      </select><br>
+      <input type="button" name="nutzerLoeschen" id="nutzerLoeschen" value="L&ouml;schen">
+      &nbsp;
+      <input type="button" name="nutzerNeu" id="nutzerNeu" value="Neu">      
+    </div>
     <div id="user-form">
       <input type="text" size="20" maxlength="20" placeholder="Anmeldename" name="anmeldename" id="anmeldename">
       <input type="password" size="20" maxlength="20" placeholder="Kennwort" name="kennwort" id="kennwort">

--
Gitblit v1.9.3