changeset 428:7683101418ec

Moar.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 05 Dec 2013 21:29:25 +0200
parents 707213312891
children 2e4f20bd3b82
files admin.php
diffstat 1 files changed, 27 insertions(+), 44 deletions(-) [+]
line wrap: on
line diff
--- a/admin.php	Thu Dec 05 21:19:41 2013 +0200
+++ b/admin.php	Thu Dec 05 21:29:25 2013 +0200
@@ -109,6 +109,28 @@
 var activeTabs = Object();
 
 
+function jsCloseAdminPopup()
+{
+  var nitem = document.getElementById("adminPopup");
+  if (nitem)
+  {
+    nitem.innerHTML = "";
+    nitem.style.display = "none";
+  }
+}
+
+
+function jsOpenAdminPopup(txt)
+{
+  var nitem = document.getElementById("adminPopup");
+  if (nitem)
+  {
+    nitem.innerHTML = txt;
+    nitem.style.display = "block";
+  }
+}
+
+
 function jsRefreshItems(id,name,extra)
 {
   var msuccess = function(txt)
@@ -575,33 +597,11 @@
 }
 
 
-function closeAdminPopup()
-{
-  var nitem = document.getElementById("adminPopup");
-  if (nitem)
-  {
-    nitem.innerHTML = "";
-    nitem.style.display = "none";
-  }
-}
-
-
-function openAdminPopup(txt)
-{
-  var nitem = document.getElementById("adminPopup");
-  if (nitem)
-  {
-    nitem.innerHTML = txt;
-    nitem.style.display = "block";
-  }
-}
-
-
 function editRotationList()
 {
   var id = jsGetValue("ctrlRotationListsSel", 4);
   if (id > 0)
-    jsSendPOSTRequest("action=get&type=infoRotationListEdit&id="+id, openAdminPopup);
+    jsSendPOSTRequest("action=get&type=infoRotationListEdit&id="+id, jsOpenAdminPopup);
   else
     jsMessageBox("No rotation list selected?");
 }
@@ -612,7 +612,7 @@
   var msuccess = function(txt)
   {
     jsRefreshItems("ctrlRotationListsSel", "infoRotationLists", "");
-    openAdminPopup(txt);
+    jsOpenAdminPopup(txt);
   }
 
   jsSendPOSTRequest("action=ctrl&type=newRotationList", msuccess);
@@ -634,33 +634,16 @@
 }
 
 
-function cancelEditDisplaySlide()
-{
-  var nitem = document.getElementById("ctrlEditDisplaySlide");
-  if (nitem)
-    nitem.style.display = "none";
-}
-
-
 function saveEditDisplaySlide()
 {
-  cancelEditDisplaySlide();
+  
+  jsCloseAdminPopup();
 }
 
 
 function editDisplaySlide()
 {
-  var msuccess = function (txt)
-  {
-    var nitem = document.getElementById("ctrlEditDisplaySlide");
-    if (nitem)
-    {
-      nitem.innerHTML = txt;
-      nitem.style.display = "block";
-    }
-  }
-  
-  jsSendPOSTRequest("action=ctrl&type=...", msuccess);
+  jsSendPOSTRequest("action=ctrl&type=...", jsOpenAdminPopup);
 }