Roomedit - Sharing: remove lines unneeded
authorWilfried Goesgens <dothebart@citadel.org>
Sun, 1 Jul 2012 09:03:07 +0000 (11:03 +0200)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 1 Jul 2012 09:03:07 +0000 (11:03 +0200)
  - add portable function to find & remove a section
  - call that function instead of doing it in place.
  - there is no input=input, its input=text

webcit/static/t/room/edit/shared_room_add.html
webcit/static/t/room/edit/shared_room_removal.html
webcit/static/wclib.js

index 1d5a6d6ba706126d7eb3a0a2fb5376c5645b6fd3..c0905947e5a5275524905967b845032110a4662b 100644 (file)
@@ -2,7 +2,7 @@
        <input type="hidden" name="nonce" value="<?NONCE>" />
        <tr id="ignet_share_node_add__<?CFG:IGNET:NODE("U")>">
                <td><?CFG:IGNET:NODE("X")></td>
-               <td><input type="input" name="suffix" maxlength="128" /></td>
+               <td><input type="text" name="suffix" maxlength="128" /></td>
                <td>
                        <input type="hidden" name="line" value="ignet_push_share|<?CFG:IGNET:NODE("U")>|" /> 
                        <input type="hidden" name="tab" value="sharing" />
@@ -11,4 +11,3 @@
                </td>
        </tr>
 </form>
-
index 2be39295bf97ea4e0216cdc85e2b78e4251f7afc..4b660263597f7c04736d1e5bc861b416ca91874c 100644 (file)
@@ -1,6 +1,8 @@
 <script type="text/javascript">
-document.getElementById("ignet_share_node_add__<?CONTEXTSTRARR(#"GNET_IGNET_NODE", "U")>").style.display  = "none";
+<?#("if we already have this room, you can't add it anymore.")>
+remove_something('ignet_share_node_add__<?CONTEXTSTRARR(#"GNET_IGNET_NODE", "U")>', "hidden");
 </script>
+
 <form method="post" action="netedit">
        <input type="hidden" name="nonce" value="<?NONCE>" />
        <tr>
@@ -17,4 +19,3 @@ document.getElementById("ignet_share_node_add__<?CONTEXTSTRARR(#"GNET_IGNET_NODE
                </td>
        </tr>
 </form>
-
index 956dd67b53d40de30b298a6dd8c2086805b7d28b..1594632f06bf3c6d312c901e74aa8f073be420d5 100644 (file)
@@ -188,6 +188,18 @@ function hide_imsg_popup() {
 
        document.poppedLayer.style.visibility = "hidden";
 }
+function remove_something(what_to_search, new_visibility) {
+       if (browserType == "gecko") {
+               document.poppedLayer = eval('document.getElementById(\'' + what_to_search + '\')');
+       }
+       else if (browserType == "ie") {
+               document.poppedLayer = eval('document.all[\'' + what_to_search + '\']');
+       }
+       else {
+               document.poppedLayer = eval('document.layers[\'`' + what_to_search + '\']');
+       }
+    document.poppedLayer.innerHTML = "";
+}
 
 function unhide_imsg_popup() {
        if (browserType == "gecko") {