11var urlForCurl = "./core/php/functions/sendCurl.php" ;
22
3- function toggleArchive ( currnetRow )
4- {
5- var archiveButton = document . getElementById ( "archiveButton" + currnetRow ) ;
6- if ( archiveButton . innerHTML === "Archive" )
7- {
8- //unarchive action (change to 1)
9- document . getElementById ( "archiveInput" + currnetRow ) . value = "true" ;
10- archiveButton . innerHTML = "Un-Archive" ;
11- }
12- else
13- {
14- //archive action (change to 0)
15- document . getElementById ( "archiveInput" + currnetRow ) . value = "false" ;
16- archiveButton . innerHTML = "Archive" ;
17- }
18- }
19-
203function addRowFunction ( )
214{
225 countOfWatchList ++ ;
@@ -44,8 +27,10 @@ function addRowFunction()
4427 else if ( arrayOfKeysNonEnc [ i ] === "Archive" )
4528 {
4629 documentUpdateText += " <br> <span class='leftSpacingserverNames' > " + arrayOfKeysNonEnc [ i ] + ": </span>" ;
47- documentUpdateText += " <a id=\"archiveButton" + countOfWatchList + "\" onclick=\"toggleArchive(" + countOfWatchList + ");\" class=\"mainLinkClass\" >Archive</a>" ;
48- documentUpdateText += "<input id=\"archiveInput" + countOfWatchList + "\" class='inputWidth300' type='hidden' name='watchListItem" + countOfWatchList + "-" + ( i + 1 ) + "' value='false'>" ;
30+ documentUpdateText += " <select class='inputWidth300' name='watchListItem" + countOfWatchList + "-" + ( i + 1 ) + "' >" ;
31+ documentUpdateText += " <option value=\"true\" >True</option>" ;
32+ documentUpdateText += " <option value=\"false\" selected >False</option>" ;
33+ documentUpdateText += " </select>" ;
4934 }
5035 else
5136 {
@@ -72,26 +57,7 @@ function deleteRowFunction(currentRow, decreaseCountWatchListNum)
7257 if ( currentRow < newValue )
7358 {
7459 //this wasn't the last folder deleted, update others
75- for ( var i = currentRow + 1 ; i <= newValue ; i ++ )
76- {
77- var updateItoIMinusOne = i - 1 ;
78- var elementToUpdate = "rowNumber" + i ;
79- var documentUpdateText = "<li class='watchFolderGroups' id='rowNumber" + updateItoIMinusOne + "' ><span class='leftSpacingserverNames' > Name: </span> " ;
80- var watchListKeyIdFind = "watchListKey" + i ;
81- var previousElementNumIdentifierForKey = document . getElementsByName ( watchListKeyIdFind ) ;
82-
83- documentUpdateText += "<input class='inputWidth300' type='text' name='watchListKey" + updateItoIMinusOne + "' value='" + previousElementNumIdentifierForKey [ 0 ] . value + "'> " ;
84- for ( var j = 0 ; j < numberOfSubRows ; j ++ )
85- {
86- var watchListItemIdFind = "watchListItem" + i + "-" + ( j + 1 ) ;
87- var previousElementNumIdentifierForItem = document . getElementsByName ( watchListItemIdFind ) ;
88- documentUpdateText += "<br> <span class='leftSpacingserverNames' > " + arrayOfKeysNonEnc [ j ] + ": </span> <input style='display: none;' type='text' name='watchListItem" + updateItoIMinusOne + "-" + ( j + 1 ) + "-Name' value=" + arrayOfKeysNonEnc [ j ] + "> <input class='inputWidth300' type='text' name='watchListItem" + updateItoIMinusOne + "-" + ( j + 1 ) + "' value='" + previousElementNumIdentifierForItem [ 0 ] . value + "'>" ;
89- }
90- documentUpdateText += '<br> <input style="display: none" type="text" name="watchListItem' + updateItoIMinusOne + '-0" value="' + numberOfSubRows + '"> ' ;
91- documentUpdateText += '<span class="leftSpacingserverNames" ></span> <a class="mainLinkClass" onclick="deleteRowFunction(' + updateItoIMinusOne + ', true)">Remove</a><span> | </span><a class="mainLinkClass" onclick="testConnection(dataForWatchFolder' + updateItoIMinusOne + ');" >Check Connection</a>' ;
92- documentUpdateText += '</li>' ;
93- document . getElementById ( elementToUpdate ) . outerHTML = documentUpdateText ;
94- }
60+ updateLaterFolders ( currentRow , newValue ) ;
9561 }
9662 newValue -- ;
9763 if ( countOfAddedFiles > 0 )
@@ -100,7 +66,31 @@ function deleteRowFunction(currentRow, decreaseCountWatchListNum)
10066 countOfWatchList -- ;
10167 }
10268 document . getElementById ( 'numberOfRows' ) . value = newValue ;
103- }
69+ }
70+
71+ function updateLaterFolders ( currentRow , newValue )
72+ {
73+ for ( var i = currentRow + 1 ; i <= newValue ; i ++ )
74+ {
75+ var updateItoIMinusOne = i - 1 ;
76+ var elementToUpdate = "rowNumber" + i ;
77+ var documentUpdateText = "<li class='watchFolderGroups' id='rowNumber" + updateItoIMinusOne + "' ><span class='leftSpacingserverNames' > Name: </span> " ;
78+ var watchListKeyIdFind = "watchListKey" + i ;
79+ var previousElementNumIdentifierForKey = document . getElementsByName ( watchListKeyIdFind ) ;
80+
81+ documentUpdateText += "<input class='inputWidth300' type='text' name='watchListKey" + updateItoIMinusOne + "' value='" + previousElementNumIdentifierForKey [ 0 ] . value + "'> " ;
82+ for ( var j = 0 ; j < numberOfSubRows ; j ++ )
83+ {
84+ var watchListItemIdFind = "watchListItem" + i + "-" + ( j + 1 ) ;
85+ var previousElementNumIdentifierForItem = document . getElementsByName ( watchListItemIdFind ) ;
86+ documentUpdateText += "<br> <span class='leftSpacingserverNames' > " + arrayOfKeysNonEnc [ j ] + ": </span> <input style='display: none;' type='text' name='watchListItem" + updateItoIMinusOne + "-" + ( j + 1 ) + "-Name' value=" + arrayOfKeysNonEnc [ j ] + "> <input class='inputWidth300' type='text' name='watchListItem" + updateItoIMinusOne + "-" + ( j + 1 ) + "' value='" + previousElementNumIdentifierForItem [ 0 ] . value + "'>" ;
87+ }
88+ documentUpdateText += '<br> <input style="display: none" type="text" name="watchListItem' + updateItoIMinusOne + '-0" value="' + numberOfSubRows + '"> ' ;
89+ documentUpdateText += '<span class="leftSpacingserverNames" ></span> <a class="mainLinkClass" onclick="deleteRowFunction(' + updateItoIMinusOne + ', true)">Remove</a><span> | </span><a class="mainLinkClass" onclick="testConnection(dataForWatchFolder' + updateItoIMinusOne + ');" >Check Connection</a>' ;
90+ documentUpdateText += '</li>' ;
91+ document . getElementById ( elementToUpdate ) . outerHTML = documentUpdateText ;
92+ }
93+ }
10494
10595function testConnection ( currentRowInformation )
10696{
@@ -117,8 +107,8 @@ function testConnection(currentRowInformation)
117107 popupHtml += "<div style=\"width:100%;text-align:center; line-height: 50px;\"> <img id=\"connectionCheckMainLoad\" src=\"core/img/loading.gif\" height=\"50\" width=\"50\"> <img style=\"display: none;\" id=\"connectionCheckMainGreen\" src=\"core/img/greenCheck.png\" height=\"50\" width=\"50\"> <img style=\"display: none;\" id=\"connectionCheckMainRed\" src=\"core/img/redWarning.png\" height=\"50\" width=\"50\">Website" ;
118108 popupHtml += "<img id=\"connectionCheckStatusLoad\" src=\"core/img/loading.gif\" height=\"50\" width=\"50\"> <img style=\"display: none;\" id=\"connectionCheckStatusGreen\" src=\"core/img/greenCheck.png\" height=\"50\" width=\"50\"> <img style=\"display: none;\" id=\"connectionCheckStatusRed\" src=\"core/img/redWarning.png\" height=\"50\" width=\"50\"> Status </div>" ;
119109 document . getElementById ( 'popupContentInnerHTMLDiv' ) . innerHTML = popupHtml ;
120-
121-
110+
111+
122112 //send check requests
123113 checkWebsiteInGeneral ( currentRowInformation [ 'WebsiteBase' ] ) ;
124114 checkWebsiteStatus ( sendUrlHere ) ;
0 commit comments