var workingFolderType; var workingFolderValue; tempExcludedFullPathArray = []; tempExcludedFullPathTypeArray = []; /* Adding partial name - Start */ jQuery("div.wrapper section#content").die('click').on('click','#partial_name_submit',function (event) { var fileName = jQuery('#fileName'); var fileNameVal = fileName.val(); var tempFileName = ''; var hasSlash = false; jQuery.each(fileNameVal, function(index, value) { if ('/' == value){ if(!hasSlash){ tempFileName += value; hasSlash = true; } } else{ tempFileName += value; hasSlash = false; } }); fileNameVal = tempFileName; if ('' == jQuery.trim(fileNameVal.replace(/\//g, ''))) { showErrorMessages('.head_search .error_msg','Invalid partial name.'); } else if ("/" == jQuery.trim(fileNameVal)) { showErrorMessages('.head_search .error_msg','Invalid partial name.'); } else if(fileNameVal.length>=1){ jQuery('#noPartialName').hide().siblings('.excludefiles').show(); jQuery('#maincheckPartial').parent().parent().show(); fileNameVal = htmlEntities(fileNameVal); var checkDuplicate = jQuery('#selectedPartialName input[type="hidden"][value="'+fileNameVal+'"]').attr('name'); if(checkDuplicate==undefined){ var splitChar = fileNameVal.split('\\'); var charCount = (splitChar.length-1); var partialNameField = '\ \ \ \ \ '+fileNameVal.replace(/[\s]/g,' ')+'\ \ '; jQuery('#selectedPartialName').append(partialNameField); fileName.val(''); } else { showErrorMessages('.head_search .error_msg',PARTIAL_NAME_ALREADY_ADDED); } } else { fileName.focus(); } startTimeoutForAutoPost('preferences'); //Auto POST }); /* Adding partial name - End */ /* Remove selected partial names - Start */ jQuery("div.wrapper section#content").die('click').on('click', '#removeSelectedPartialName span',function(){ jQuery('#selectedPartialName tr.chk').remove(); jQuery(this).hide(); jQuery('#maincheckPartial').next().attr('class','mainchek'); var remaining = jQuery('#selectedPartialName input').length; if(remaining==0){ jQuery('#maincheckPartial').parent().parent().hide(); jQuery('#noPartialName').show().siblings('.excludefiles').hide();; } startTimeoutForAutoPost('preferences'); //Auto POST }); /* Remove selected partial names - End */ /* Add selected full path - Start */ jQuery("div.wrapper section#content").die('click').on('click','input#add_full_path',function(event){ var checkedPath,imgType; var html=''; //Assigning Temp array values excludedFullPathArray = tempExcludedFullPathArray; excludedFullPathTypeArray = tempExcludedFullPathTypeArray; excludedFullPathMissingArray = tempExcludedFullPathMissingArray; var pathCount = excludedFullPathArray.length; //Added on May17 var checkedCount = jQuery('table#excludeFilesPath input:checked').length; if(pathCount > 0 || checkedCount>0){ var tempValue = excludedFullPathArray[0]; var tempType = excludedFullPathTypeArray[0]; var disable= ""; var disabled_row = ""; if(machine!='netgear' && machine!='twotier' && machine!='synology'){ if(workingFolderValue!='' && typeof workingFolderValue != "undefined"){ var workingFolderValueIndex = $.inArray(workingFolderValue, excludedFullPathArray); if(workingFolderValueIndex == -1 ) { excludedFullPathArray[0] = workingFolderValue; excludedFullPathTypeArray[0] = workingFolderType; excludedFullPathArray[pathCount] = tempValue; excludedFullPathTypeArray[pathCount] = tempType; pathCount++; } else if( workingFolderValueIndex > 0 ) { excludedFullPathArray[0] = excludedFullPathArray[workingFolderValueIndex]; excludedFullPathTypeArray[0] = excludedFullPathTypeArray[workingFolderValueIndex]; excludedFullPathArray[workingFolderValueIndex] = tempValue; excludedFullPathTypeArray[workingFolderValueIndex] = tempType; } } disable = 'class ="deny" style="pointer-events:none;"'; disabled_row = "style='background-color:#dae4ea'"; } for(var i=0; i < pathCount;i++){ var checkedPath = excludedFullPathArray[i]; var cssSpanClassName = ''; var cssClassName = ''; var fileMissingEle = ''; var displaySelected = checkedPath; if(machine=='twotier'){ displaySelected = checkedPath.substring(sharedFolderPathLength); } imgType = excludedFullPathTypeArray[i]; if (jQuery.inArray(checkedPath, excludedFullPathMissingArray) != -1) { cssSpanClassName = 'class="file_missing_filename"'; cssClassName = 'class="file_missing"'; fileMissingEle = ''; fileMissingEle += (imgType + ' is missing'); fileMissingEle += ''; } var splitChar = checkedPath.split('\\'); var charCount = (splitChar.length-1); html += ''; html += ' '; html += ''+htmlEntities(displaySelected).replace(/[\s]/g,' ')+'' + fileMissingEle + ''; html += ''; disable= ""; disabled_row = ""; } jQuery('#excludeFullPath').html(html); jQuery('#maincheckFull').parent().parent().show(); jQuery('#noFullPath').hide().siblings('.excludefiles').show(); $.popContainerHide(); } else { event.preventDefault(); showErrorMessages('#excludeFullError',SELECT_FILE_FOLDER); return false; } startTimeoutForAutoPost('preferences'); //Auto POST }); /* Add selected full path - End */ /* Remove selected full paths - Start */ jQuery("div.wrapper section#content").die('click').on('click','#removeSelectedFullPath span',function(){ jQuery('#excludeFullPath tr.chk').remove(); jQuery('#maincheckFull').next().attr('class','mainchek'); jQuery(this).hide(); var remaining = jQuery('#excludeFullPath input').length; if(remaining==0){ jQuery('#maincheckFull').parent().parent().hide(); jQuery('#noFullPath').show().siblings('.excludefiles').hide(); } storeAddedFullPath(); startTimeoutForAutoPost('preferences'); //Auto POST }); /* Remove selected full paths - End */ function hideShowNoFiles(){ var remainingFullPath = jQuery('#excludeFullPath input').length; if(remainingFullPath==0){ jQuery('#maincheckFull').closest('tr').hide(); jQuery('#noFullPath').show().siblings('.excludefiles').hide(); } else { jQuery('#maincheckFull').closest('tr').show(); jQuery('#noFullPath').hide().siblings('.excludefiles').show(); } var remainingPartialName = jQuery('#selectedPartialName input').length; if(remainingPartialName==0){ jQuery('#maincheckPartial').closest('tr').hide(); jQuery('#noPartialName').show().siblings('.excludefiles').hide(); } else { jQuery('#maincheckPartial').closest('tr').show(); jQuery('#noPartialName').hide().siblings('.excludefiles').show(); } } /* Load Files/Folders - Start */ jQuery("div.wrapper section#content").die('click').on('click','.preferences a.getDirList',function(){ var getDir = jQuery(this).attr('alt'); currDirPath = getDir; loadPathForExclude(getDir); }); jQuery("div.wrapper section#content").die('click').on('click','#addFullExclude',function(){ jQuery('.common_msg').hide(); currDirPath = '/'; storeAddedFullPath(); loadPathForExclude('/'); }); jQuery("div.wrapper section#content").die('click').on('click','#cancel_full_path',function(){ excludedFullPathArray = []; tempExcludedFullPathArray = []; $.popContainerHide(); }); function loadPathForExclude(getDir, pagination, page_no){ pagination = pagination || false; page_no = page_no || 1; //sajana Added for Hiding Exclude Option var exclude_option="no"; var url = "fullPathSelection.php?fullPath="+encodeURIComponent(getDir)+"&exclude_option="+exclude_option; var dirListVal = dynamicArray[getDir]; var dirListType = dynamicType[getDir]; var toPlace = 'loadFullPath'; var breadcrum = 'fullPathBreadCrumb'; var maincheck ='excludeBackupFilePath'; jQuery('#maincheck').siblings('label').css('visibility','visible'); var container = '
'; container += ''; container += ''; container += '
'; if (!pagination) jQuery('#loadFullPath').html(container); jQuery('#' + toPlace + '>.excludefiles').unbind('scroll'); // AJAX Call for new if((dirListVal === "" || typeof dirListVal == "undefined" || pagination)){ jQuery('#'+toPlace).siblings('.ajax_loader').show(); jQuery('#' + toPlace + '>.excludefiles').unbind('scroll'); var loadList = function() { jQuery.ajax({ url: (url + '&page_no=' + page_no), success: function(locationData){ if(locationData.indexOf('')>0){ window.location.href='../index.php'; } locationDataRes=$.parseJSON(locationData); jQuery('#'+toPlace).siblings('.ajax_loader').hide(); if(locationDataRes[0]==true){ jQuery('#'+toPlace).show().prev('.nfiles').hide(); if ( !pagination ) { jQuery('#'+toPlace).find('tbody').html(locationDataRes[1]); } else { jQuery('#'+toPlace).find('tbody').append(locationDataRes[1]); } } else if ( typeof locationDataRes['retry'] != 'undefined' ) { jQuery('#'+toPlace).siblings('.ajax_loader').show(); if (locationDataRes['retry']) { loadList(); } else { jQuery('#'+toPlace).siblings('.ajax_loader').hide(); } } else { jQuery('#loadFullPath').hide().prev('.nfiles').show(); jQuery('#maincheck').siblings('label').css('visibility','hidden'); } //Keeping file/folder list to avoid AJAX call var dirURL = decodeURIComponent(locationDataRes[2]['url']); var dirList = locationDataRes[2]['dir']; var dirType = locationDataRes[2]['type']; if (!pagination) { dynamicArray[dirURL]=dirList; dynamicType[dirURL] =dirType; IDrive.LocalDirList[dirURL] = locationDataRes[2]['dir_list']; } else { var tempDirList = dirList; var tempDirType = dirType; var tempDataRes = locationDataRes[2]['dir_list']; tempDirList = dynamicArray[dirURL].concat(tempDirList); tempDirType = dynamicType[dirURL].concat(tempDirType); tempDataRes = $.extend(IDrive.LocalDirList[dirURL], tempDataRes); dynamicArray[dirURL] = tempDirList; dynamicType[dirURL] = tempDirType; dynamicRequestInfo[dirURL] = {'page_no': page_no, 'success': false}; IDrive.LocalDirList[dirURL] = tempDataRes; } localExcludeFileBreadcrumb(getDir,toPlace,breadcrum,maincheck); //Call BreadCrumb markSelectedExcludeItems(getDir,toPlace); //Call function to "Mark" the selected Items jQuery('#'+toPlace+' .excludefiles').css('overflow','auto'); if ((dirList !== null) && ((dirList.length * page_no) >= (998 * page_no))) { dynamicRequestInfo[dirURL] = {'page_no': page_no, 'success': false}; jQuery('#' + toPlace + '>.excludefiles').unbind('scroll').scroll(function() { var scrollHeight = jQuery('#' + toPlace + '>.excludefiles')[0].scrollHeight; var scrollTop = jQuery('#' + toPlace + '>.excludefiles').scrollTop(); var outerHeight = jQuery('#' + toPlace + '>.excludefiles').outerHeight(); if ((scrollHeight - scrollTop) == outerHeight) { loadPathForExclude(getDir, true, (++dynamicRequestInfo[dirURL]['page_no'])); $(this).unbind('scroll'); } }); } } }); } loadList(); } else if(dirListVal === null){ jQuery('#'+toPlace).hide().prev('.nfiles').show(); localExcludeFileBreadcrumb(getDir,toPlace,breadcrum,maincheck); //Call breadCrumb function jQuery('#maincheck').siblings('label').css('visibility','hidden'); } else { //Loading files/folders from array intead of making AJAX call again var dirHTML = ''; jQuery('#'+toPlace).siblings('.ajax_loader').show(); /* Condition added for synology market place */ if(getDir=='/'){ for(var j=0; j0))){ var tr_style='class="hideData"'; continue; } else{ var tr_style=''; } var splitDir = dirFullPath.split("/"); var dir = splitDir.pop(); if(machine=='QNAP'){ var drivePath = splitDir[1]+"/"+splitDir[2]; } else { var drivePath = splitDir[1]; } dirName1 = dirName.replace('"','"'); dirFullPath = htmlEntities(dirFullPath); dirName = htmlEntities(dirName); dir = htmlEntities(dir); drivePath = htmlEntities(drivePath); if(machine=='twotier'){ var title = dir; } else { var title = dir; if(typeof rootLevelEnabled == "undefined" || rootLevelEnabled == false || rootLevelEnabled == "") { title = title + ' @ ' + drivePath; } } if(dirType=='folder'){ if(machine == ASUSTOR){ if(dirFullPath.indexOf('/home/'+dir.replace(/[\s]/g,' ')) != -1){ dir = "Home"; title = "Home"; } } dirHTML += ''; dirHTML += ' '; dirHTML += ''; dirHTML += ''; dirHTML += ''; dirHTML += dir.replace(/[\s]/g,' '); dirHTML += ''; dirHTML += ' -- '+IDrive.LocalDirList[getDir][dirName1].datetime+' '; dirHTML += ''; } else { dirHTML += ''; dirHTML += ' '; dirHTML += ''; dirHTML += dir.replace(/[\s]/g,' '); dirHTML += ''; dirHTML += ' '+IDrive.LocalDirList[getDir][dirName1].size+' '+IDrive.LocalDirList[getDir][dirName1].datetime+' '; dirHTML += ''; } } } else { for(var j=0; j'; dirHTML += ' '; dirHTML += ''; dirHTML += ''; dirHTML += dirName.replace(/[\s]/g,' '); dirHTML += ''; dirHTML += ' -- '+IDrive.LocalDirList[getDir][dirName1].datetime+' '; dirHTML += ''; } else { dirHTML += ''; dirHTML += ' '; dirHTML += ''; dirHTML += dirName.replace(/[\s]/g,' '); dirHTML += ''; dirHTML += ''+IDrive.LocalDirList[getDir][dirName1].size+' '+IDrive.LocalDirList[getDir][dirName1].datetime+' '; dirHTML += ''; } } } jQuery('#'+toPlace).siblings('.nfiles,.ajax_loader').hide(); jQuery('#'+toPlace).show().find('tbody').html(dirHTML); localExcludeFileBreadcrumb(getDir,toPlace,breadcrum,maincheck); //Call breadCrumb function markSelectedExcludeItems(getDir,toPlace); //Call function to "Mark" the selected Items jQuery('#'+toPlace+' .excludefiles').css('overflow','auto'); if ((typeof dynamicRequestInfo[getDir] != "undefined") && !dynamicRequestInfo[getDir]['success']) { jQuery('#' + toPlace + '>.excludefiles').unbind('scroll').scroll(function() { var scrollHeight = jQuery('#' + toPlace + '>.excludefiles')[0].scrollHeight; var scrollTop = jQuery('#' + toPlace + '>.excludefiles').scrollTop(); var outerHeight = jQuery('#' + toPlace + '>.excludefiles').outerHeight(); if ((scrollHeight - scrollTop) == outerHeight) { loadPathForExclude(getDir, true, (++dynamicRequestInfo[getDir]['page_no'])); $(this).unbind('scroll'); } }); } } } /* Load Files/Folders - End */ //Function to update BreadCrumb & keep the child file/folders as Selected if parent got selected function localExcludeFileBreadcrumb(getDir,toPlace,breadcrum,maincheck){ var splitDir = getDir.split('/'); var breadCrumb = '/'; var currDir = ""; splitDir = splitDir.filter(function(val) { if(!(val === "" || typeof val == "undefined" || val === null)){ currDir += "/"+htmlEntities(val); var title = currDir; if(machine=='twotier'){ title = currDir.substring(sharedFolderPathLength); } breadCrumb += ''+val+''; } }); jQuery('#'+breadcrum).html(breadCrumb); if(maincheck !=''){ jQuery('.'+maincheck+' .header_part .file_check label').removeAttr('class'); } responsiveBreadcrumb('#'+breadcrum,'getDirList'); } //Function to "Mark" the selected Items function markSelectedExcludeItems(getDir,toPlace){ var split_path = getDir.split('/'); var split_path_count = split_path.length; var selected_path = ''; var selected_path_found = 0; var current_directory = getDir; jQuery('.excludeBackupFilePath #maincheck').siblings('label').removeAttr('class'); for(var i=1; i= 0) { if(dynamicArray.indexOf(current_directory) != "" && dynamicArray[current_directory] != null) { var id_of_element = dynamicArray[current_directory].indexOf(val); if(id_of_element>=0){ if(sh=='Hide') { var hiddenCount = countHiddenFilesAboveSelectedFile(current_directory, val); id_of_element = id_of_element - hiddenCount; } var selected_dir_id = jQuery('#loadFullPath input[type="checkbox"]').eq(id_of_element); selected_dir_id.attr('checked',true).next().addClass('label_checked').closest('tr').addClass('chk'); if(selected_dir_id.attr('checked')=='checked'){ jQuery('.excludeBackupFilePath #maincheck').next().addClass('label_semi_checked'); } } } } } }); } //Mark "Partial check" if its child has been selected var curPathDirList = dynamicArray[getDir]; if(curPathDirList != null){ if(curPathDirList.length>0){ for(var i=0; i/'; var currDir = ""; splitDir = splitDir.filter(function(val) { if(!(val === "" || typeof val == "undefined" || val === null)){ currDir += '/'+val; var title = currDir; if(machine=='twotier'){ title = currDir.substring(sharedFolderPathLength); } breadCrumb += ''+val+''; } }); jQuery('.preferenceBreadCrumb').html(breadCrumb); responsiveBreadcrumb('.preferenceBreadCrumb','getBackupDirList'); /* To highlight the selected backup location */ var markSelected = jQuery('input#backupLocation').val(); if(markSelected.charAt(0)!='/'){ markSelected = '/'+markSelected; } markSelected = markSelected.replace('"','"'); jQuery('#maincheck').siblings('label').css('visibility','visible'); loadRemoteFiles(getDir, 'loadBackupLocation', 'backupLocationBreadCrumb'); /* To highlight the selected backup location */ jQuery('#loadBackupLocation input[value*= "'+markSelected+'/"]').closest('tr').addClass('selected_row').css("background-color","#CDDAE1"); }); /* Load Backup Locations - End */ /* Select Backup Location - Start */ jQuery("div.wrapper section#content").die('click').on('click','.preferences #loadBackupLocation tr:not("a")',function(){ var className = jQuery(this).attr('class'); if(className!=undefined){ jQuery(this).removeAttr('class').removeAttr('style'); } else { jQuery('#excludeFilesPath tr').removeAttr('class').removeAttr('style'); jQuery(this).addClass('selected_row').css("background-color","#CDDAE1"); jQuery('#permissionError').hide(); startTimeoutForAutoPost('preferences'); //Auto POST } }); jQuery("div.wrapper section#content").die('click').on('click','#addLocation',function(){ var location = jQuery('.selected_row').find("a").attr('alt'); var location1 = jQuery('#backupLocationBreadCrumb a:last').attr('alt'); if(location!='' && location!=undefined && location!=null ){ jQuery('#backupLocation').val(location).focus().attr('title', location); actionRequired=2; backupLocationValue = location; } else if(location1=='/'){ showErrorMessages('#permissionError',SELECT_BACKUP_LOCATION); return false; } else if(location1!='' && location1!=undefined && location1!=null){ jQuery('#backupLocation').val(location1).focus().attr('title', location1); backupLocationValue = location1; actionRequired=2; } $.popContainerHide(); }); /* Select Backup Location - End */ /* Keeping the added Exclude Full Paths*/ function storeAddedFullPath(){ var addedFullPath = jQuery('#fullPathForm input[type="checkbox"]').length; excludedFullPathArray = []; excludedFullPathTypeArray=[]; tempExcludedFullPathArray = []; tempExcludedFullPathTypeArray=[]; tempExcludedFullPathMissingArray=[]; if(addedFullPath>0){ jQuery('#fullPathForm tr').each(function(){ var path = jQuery(this).find('input[type="hidden"]').eq(0).val(); var imgType = jQuery(this).find('input[type="hidden"]').eq(1).val(); excludedFullPathArray.push(path); tempExcludedFullPathArray.push(path); tempExcludedFullPathTypeArray.push(imgType); if (jQuery(this).hasClass('file_missing')) tempExcludedFullPathMissingArray.push(path); }); } jQuery('#loadFullPath tr').removeAttr('class').find('input').removeAttr('checked').siblings('label').removeAttr('class'); } jQuery("div.wrapper section#content").die('click').on('click','input#enablePath',function(){ var checked = jQuery(this).attr('checked'); if(checked=='checked' || checked==true){ jQuery('select.path_selected').attr('disabled',false); } else { jQuery('select.path_selected').attr('disabled',true); } }); //Function to select/unselect items jQuery(document).on('click','.preferences #excludeFilesPath td.file_check, .preferences .excludeBackupFilePath .header_part .file_check',function(e){ //Checking whether clicked on Checkbox or TD var clickedLabel = e.target.nodeName; if(clickedLabel != 'LABEL'){ return false; } //To load Full path freshly var checkElement = jQuery(this); if(checkElement.find('label').hasClass('label_checked')){ if(checkElement.find('label').html()=="All"){ addExcludeFilesList("All"); } else { addExcludeFilesList(checkElement); } } else { if(checkElement.find('label').html()=="All"){ removeExcludeFilesList("All"); } else { removeExcludeFilesList(checkElement); } } }); //Function to add exclude list to array function addExcludeFilesList(args) { /* Add selected files/folders - Start */ if(args!="All"){ var fileCheckLabel = jQuery('.excludeBackupFilePath .header_part .file_check label'); if(fileCheckLabel.hasClass('label_checked')){ args=='All'; } } if(args=="All" && currDirPath=='/'){ tempExcludedFullPathArray = []; tempExcludedFullPathTypeArray = []; tempExcludedFullPathMissingArray = []; jQuery('#loadFullPath input').each(function(){ var selected = jQuery(this).val(); var imgSrc = jQuery(this).closest('td').next().find('img').attr('src'); var imgSubstr = imgSrc.substring(23); var itemType = imgSubstr.replace('.png',''); //To skip if the file/folder is hidden if((sh=='Hide' && selected.indexOf('/.')>=1)){ return true; } if(tempExcludedFullPathArray.length>0){ var check_parent = array_search(tempExcludedFullPathArray,selected+'/'); if(check_parent.length>0){ removeExcludeSubDirecories(check_parent); } } tempExcludedFullPathArray.push(selected); tempExcludedFullPathTypeArray.push(itemType); }); } else { var breadcrumCall = false; if(args=='All'){ breadcrumCall = true; args = currDirPath.replace(/\/$/, ''); var selected = args; var itemType = 'folder'; } else if(typeof args != 'string'){ var selected = args.find('input').val(); var imgSrc = args.closest('td').next().find('img').attr('src'); var imgSubstr = imgSrc.substring(23); var itemType = imgSubstr.replace('.png',''); } if(breadcrumCall == true){ var checkParent = array_search_reverse(tempExcludedFullPathArray, selected + '/'); if(checkParent.length > 0) { return false; } } if(tempExcludedFullPathArray.indexOf(selected)==-1){ if(tempExcludedFullPathArray.length>0){ var check_parent = array_search(tempExcludedFullPathArray,selected+'/'); if(check_parent.length>0){ removeExcludeSubDirecories(check_parent); } } tempExcludedFullPathArray.push(selected); tempExcludedFullPathTypeArray.push(itemType); markMaincheckAfterRemove('loadFullPath'); } } /* Add selected files/folders - End */ } //Function to remove exclude list from array function removeExcludeFilesList(args){ /* remove selected files/folders - Start */ if(args=="All" && currDirPath =='/'){ tempExcludedFullPathArray=[]; tempExcludedFullPathTypeArray=[]; } else { var checkedElement = jQuery('#loadFullPath tr.chk input:checked'); if(args=="All") selected = currDirPath; else selected = args.find('input').val(); var index = tempExcludedFullPathArray.indexOf(selected); if(index>=0){ tempExcludedFullPathArray.splice(index, 1); tempExcludedFullPathTypeArray.splice(index, 1); } else { var index = tempExcludedFullPathArray.indexOf(currDirPath.substring(0, currDirPath.length-1)); if(index>=0){ tempExcludedFullPathArray.splice(index, 1); tempExcludedFullPathTypeArray.splice(index, 1); //addSelectedShareItemExceptUnchecked(checkedElement,clickedDirPath); // Call function to add other items } else { if(args=="All"){ var allClickedDirPath = currDirPath.split('/'); allClickedDirPath.pop(); var parentPath = allClickedDirPath.join("/"); } else{ var parentPath = currDirPath; } var index = tempExcludedFullPathArray.indexOf(parentPath); if(index>=0 && args!="All"){ tempExcludedFullPathArray.splice(index, 1); tempExcludedFullPathTypeArray.splice(index, 1); addItemsExceptUnchecked(checkedElement,parentPath); // Call function to add other items } else { var clickedDirPathSplit = parentPath.split('/'); //if(args!="All") clickedDirPathSplit.pop(); var clickedDirPathSplitCount = clickedDirPathSplit.length; var pathAppend = ''; var pathSearch = new Array(); for(var i=1; i=0; j--){ var index = tempExcludedFullPathArray.indexOf(pathSearch[j]); addItemsExceptUnchecked('',pathSearch[j]); //Call function to add other items if(index>=0){ tempExcludedFullPathArray.splice(index, 1); tempExcludedFullPathTypeArray.splice(index, 1); break; } } } //End }} } /* remove selected files/folders - End */ } //Function add remaining items after unchecking child element function addItemsExceptUnchecked(checkedElement,currDirPath1){ var selected=''; var backupArray1 = tempExcludedFullPathArray; var backupArray3 = tempExcludedFullPathTypeArray; if(checkedElement!=''){ checkedElement.each(function(){ selected = jQuery(this).val(); var imgSrc = jQuery(this).parent().next().find('img').attr('src'); var imgSubstr = imgSrc.substring(23); var itemType = imgSubstr.replace('.png',''); if(backupArray1.indexOf(selected)==-1){ var selected_dir = selected+"/"; backupArray1.push(selected); backupArray3.push(itemType); } }); } else { var dirListVal = dynamicArray[currDirPath1]; var dirTypeVal = dynamicType[currDirPath1]; for(var j=0; j< dirListVal.length; j++){ var dirFullPath = dirListVal[j]; var itemType = dirTypeVal[j]; var splitPath = dirFullPath.split('/'); var dirName = splitPath[splitPath.length-1]; selected = dirFullPath; var isInString = currDirPath.indexOf(selected+'/'); if(backupArray1.indexOf(selected)==-1 && isInString==-1 && currDirPath!=selected){ var selected_dir = selected+"/"; backupArray1.push(selected); backupArray3.push(itemType); } } } //Exclude List tempExcludedFullPathArray = backupArray1; tempExcludedFullPathTypeArray = backupArray3; } /* Function to remove already selected sub-directories while selecting its parent */ function removeExcludeSubDirecories(args){ arr_length = args.length; for(var i=0;i 57)) && (e.keyCode < 96 || e.keyCode > 105)&& (e.keyCode < 37 || e.keyCode > 40)) { e.preventDefault(); } }); //Function to check the IP address or domain name value. jQuery("div.wrapper section#content").die('keydown').on('keydown','input[name="ipAddress"]',function(e){ if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 110, 190]) !== -1){ return; } // need to update alphabet keys to allow domain names here. // Ensure that it is a number and stop the keypress if ((e.shiftKey || (e.keyCode < 48 || e.keyCode > 57)) && (e.keyCode < 96 || e.keyCode > 105) && ((e.keyCode < 65 || e.keyCode > 90)) && (e.keyCode < 37 || e.keyCode > 40)) { e.preventDefault(); } }); //Funtion to observe user's activity jQuery("div.wrapper section#content").die('click').on('click','.preference form input,.preference form select',function(){ startTimeoutForAutoPost('preferences'); //Auto POST }); jQuery("div.wrapper section#content").die('click').on('click','#showHide',function(){ var isChecked = $(this).prop('checked');//hidden_status $("#displayRoot").val((($("#displayRootChk").prop("checked") == true)? 1 : 0)); preferenceChanged=1; showHiddenClicked = true; if(isChecked==true || isChecked=='checked'){ jQuery("#hiddenStatus").val('1'); sh="Show"; }else{ sh="Hide"; jQuery("#hiddenStatus").val('2'); } preferenceSettings(); }); jQuery("div.wrapper section#content").die('click').on('click','#multipleEngineEnable',function(){ var isChecked = $(this).prop('checked');//hidden_status $("#displayRoot").val((($("#displayRootChk").prop("checked") == true)? 1 : 0)); preferenceChanged=1; if(isChecked==true || isChecked=='checked'){ jQuery("#hiddenEngineStatus").val('4'); }else{ jQuery("#hiddenEngineStatus").val('2'); } //preferenceSettings(); }); // var rootDisplayChanged = false; jQuery(document).on('click', '#displayRootChk', function() { $("#displayRoot").val((($(this).prop("checked") == true)? 1 : 0)); preferenceChanged = 1; //showHiddenClicked = true; rootDisplayChanged = true; preferenceSettings(); }); //calling send error report popup.. (function($) { var logWarning = ''; $(document).on('click', '#sendErrLink', function() { SendErrorReport(); }); function SendErrorReport() { $.popContainerHide(); $.popContainer(); var url = "action.php?action=readErrorInfo"; $.ajax({ type: "POST", url: url, dataType : 'json', success: function(data) { $("#errusername").val(data.username); if(typeof data.username == "undefined" || data.username == "" || data.username == null) { $("#errusername").prop('readonly', false); } $("#email_error_report").val(data.email); $("#contact_number").val(data.number); //checking username and email are equal if(data.username == data.email) { $("#email_error_report").val(data.username); } else { $("#email_error_report").val(data.email); } if(typeof data.logSendWarning != "undefined" && data.logSendWarning != '') { logWarning = data.logSendWarning; } } }); if($('div.send_error_report').length > 0) { $('div.send_error_report').remove(); } var parentEle = $('.sec_pos_container'); parentEle.append($('
', {'class': 'popup_container send_error_report'}) .append($('
', {'class': 'popup_header'}) .append($('

').text('Send Error Report')) .append($('', {'class': 'popup_close_btn hide_popup'}))) .append($('
', {'class': 'popup_body'}) .append($('
', {'id':'resultDiv','class': 'common_msg error_msg', 'style': 'display:none'}) .append($('

',{'id':'errorDiv'}).text('')) .append($('', {'href':'#', 'class': 'close_info'}) .append($('', {'width': "16", 'height': "16", 'title': "Close", 'alt': "close", 'src': "include/images/close.png"})))) .append($('

') .append($('
    ', {'class': "ser_ul"}) .append($('
  • ') .append($('
    ', {'class': "form_box"}) .append($('
  • ') .append($('
    ', {'class': "form_box"}) .append($('
  • ') .append($('
    ', {'class': "form_box"}) .append($('
  • ') .append($('
    ', {'class': "form_box"}) .append($('
  • ') .append($('
    ', {'class': "form_box"}) .append($('