Quellcode durchsuchen

Upload files to 'Video'

Yeung Alan vor 6 Jahren
Ursprung
Commit
9b2703a683
1 geänderte Dateien mit 49 neuen und 44 gelöschten Zeilen
  1. 49 44
      Video/manager.php

+ 49 - 44
Video/manager.php

@@ -110,6 +110,7 @@ if(isset($_GET["bkend"])){
 		<option>Select</option>
 	</select>
 	<button name="batchfolderbutton" class="ts button"><i class="move icon"></i>Move</button>
+	<button onclick="ts('#AddPlaylistModal').modal('show')" class="ts right floated button"><i class="add icon"></i>New folder</button>
 	</p>
 </div>
 
@@ -209,52 +210,56 @@ function step3(){
 
 function step4(){
 	$( "button[name='batchfolderbutton']" ).click(function() {
-		var Arr = $("select[name='batchfolderdropdown']").attr("file").split(",");
-		var DOM = $("select[name='batchfolderdropdown']");
-		
-		var length = Arr.length;
-		var success = 0;
-		var failed = 0;
-		
-		$.each(Arr, function( index, value ) {
-			if(value!== ""){
-				$(DOM).parent().parent().parent().append('<div class="ts active inverted dimmer"><div class="ts text loader">Processing...</div></div>');
-				$.get( "../SystemAOB/functions/file_system/fsexec.php?opr=move&from=" + value + "&target=" + $(DOM).val() + value.replace(/^.*[\\\/]/, ''), function(UUID) {
-					//Return an UUID, can call fsexec.php?listen={uuid} to see the file moving progress
-					if(!UUID.includes("ERROR")){
-						var timer = setInterval(function(){ 
-							$.get( '../SystemAOB/functions/file_system/fsexec.php?listen=["' + UUID + '"]', function(data) {
-								if(data[0][1] == "done"){
-									success += 1;
-									if(success == length){
-										$("#unsortlist").html('<div class="ts slate accordion item"><i class="notice circle icon"></i><span class="header">No file unsorted</span><span class="description">Upload some files to here :)</span></div>');
-										$(DOM).parent().parent().parent().find(".ts.active.inverted.dimmer").remove();
-									}
-									if((success + failed) == length){
-										location.reload();
-									}
-									msgbox("Moved " + value.replace(/^.*[\\\/]/, ''));
-									clearInterval(timer);
-								}else if(data[0][1] == "error"){
-									failed += 1;
-									if((success + failed) == length){
-										location.reload();
+		if($("select[name='batchfolderdropdown']").val()!==""){
+			var Arr = $("select[name='batchfolderdropdown']").attr("file").split(",");
+			var DOM = $("select[name='batchfolderdropdown']");
+			
+			var length = Arr.length;
+			var success = 0;
+			var failed = 0;
+			
+			$.each(Arr, function( index, value ) {
+				if(value!== ""){
+					$(DOM).parent().parent().parent().append('<div class="ts active inverted dimmer"><div class="ts text loader" id="processingtext">Processing...</div></div>');
+					$.get( "../SystemAOB/functions/file_system/fsexec.php?opr=move&from=" + value + "&target=" + $(DOM).val() + value.replace(/^.*[\\\/]/, ''), function(UUID) {
+						//Return an UUID, can call fsexec.php?listen={uuid} to see the file moving progress
+						if(!UUID.includes("ERROR")){
+							var timer = setInterval(function(){ 
+								$.get( '../SystemAOB/functions/file_system/fsexec.php?listen=["' + UUID + '"]', function(data) {
+									if(data[0][1] == "done"){
+										success += 1;
+										if(success == length){
+											$("#unsortlist").html('<div class="ts slate accordion item"><i class="notice circle icon"></i><span class="header">No file unsorted</span><span class="description">Upload some files to here :)</span></div>');
+											$(DOM).parent().parent().parent().find(".ts.active.inverted.dimmer").remove();
+										}
+										if((success + failed) == length){
+											location.reload();
+										}
+										msgbox("Moved " + value.replace(/^.*[\\\/]/, ''));
+										clearInterval(timer);
+									}else if(data[0][1] == "error"){
+										failed += 1;
+										if((success + failed) == length){
+											location.reload();
+										}
+										msgbox("Error moving " + value.replace(/^.*[\\\/]/, ''));
+										clearInterval(timer);
 									}
-									msgbox("Error moving " + value.replace(/^.*[\\\/]/, ''));
-									clearInterval(timer);
-								}
-							});
-						}, 3000);
-					}else{
-						failed += 1;
-						if((success + failed) == length){
-							location.reload();
+								});
+							}, 3000);
+						}else{
+							failed += 1;
+							if((success + failed) == length){
+								location.reload();
+							}
+							msgbox(UUID);
 						}
-						msgbox(UUID);
-					}
-				});
-			}
-		});
+					});
+				}
+			});
+		}else{
+			msgbox("Nothing selected");
+		}
 	});
 	
 	$( "select[name='folderdropdown']" ).change(function() {