Added changes to the webpage to reflect the changes done to the endpoints and return data of the endponits.
This commit is contained in:
		@@ -30,6 +30,7 @@ $("#searchForm").submit(function(e) {
 | 
			
		||||
	  		Materialize.toast('Verification successfully sent!', 4000);
 | 
			
		||||
	  },
 | 
			
		||||
	  error: function(data) {
 | 
			
		||||
	  	Materialize.toast(data.responseJSON.error, 4000);
 | 
			
		||||
	  	console.log(data.responseJSON.error);
 | 
			
		||||
    	e.preventDefault(); // avoid to execute the actual submit of the form.
 | 
			
		||||
	  }
 | 
			
		||||
@@ -39,16 +40,14 @@ $("#searchForm").submit(function(e) {
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
function foo(id) {
 | 
			
		||||
	var el = $(id);
 | 
			
		||||
	if (el.attr('contenteditable') == 'true'){
 | 
			
		||||
		el.attr('contenteditable', 'false');
 | 
			
		||||
	} else {
 | 
			
		||||
		el.attr('contenteditable', 'true')
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var toType = function(obj) {
 | 
			
		||||
  return ({}).toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase()
 | 
			
		||||
	console.log(id[0]);
 | 
			
		||||
	var el = $(id[0]);
 | 
			
		||||
	// if (el.attr('contenteditable') == 'true'){
 | 
			
		||||
	// 	el.attr('contenteditable', 'false');
 | 
			
		||||
	// } else {
 | 
			
		||||
	// 	el.attr('contenteditable', 'true')
 | 
			
		||||
	// }
 | 
			
		||||
	el.attr('contenteditable', 'true');
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function getShow() {
 | 
			
		||||
@@ -57,20 +56,20 @@ function getShow() {
 | 
			
		||||
	  url: url,
 | 
			
		||||
	  dataType: "json",
 | 
			
		||||
	  success: function (data) {
 | 
			
		||||
	  		$('#parent').val(data['parent']);
 | 
			
		||||
	  		$('#name').val(data['name']);
 | 
			
		||||
	  		$('#season').val(data['season']);
 | 
			
		||||
	  		$('#episode').val(data['episode']);
 | 
			
		||||
	  		$('#parent').append('<p>' + data['parent'] + '</p>');
 | 
			
		||||
	  		$('#name').append('<p>' + data['name'] + '</p>');
 | 
			
		||||
	  		$('#season').append('<p>' + data['season'] + '</p>');
 | 
			
		||||
	  		$('#episode').append('<p>' + data['episode'] + '</p>');
 | 
			
		||||
	  		var itemList= JSON.parse(data['video_files']);
 | 
			
		||||
	  		for (item in itemList) {
 | 
			
		||||
	  			$('#video_files').append('<p>' + itemList[item][0] + '</p>');
 | 
			
		||||
	  			$('#video_files').append('<p>' + itemList[item][1] + '</p>');
 | 
			
		||||
	  			$('#video_files').append('<p onclick="foo($(this));">' + itemList[item][1] + '</p>');
 | 
			
		||||
	  		}
 | 
			
		||||
 | 
			
		||||
	  		var itemList= JSON.parse(data['subtitles']);
 | 
			
		||||
	  		for (item in itemList) {
 | 
			
		||||
	  			$('#subtitles').append('<p>' + itemList[item][0] + '</p>');
 | 
			
		||||
	  			$('#subtitles').append('<p>' + itemList[item][1] + '</p>');
 | 
			
		||||
	  			$('#subtitles').append('<p onclick="foo($(this));">' + itemList[item][1] + '</p>');
 | 
			
		||||
	  		}
 | 
			
		||||
 | 
			
		||||
	  		var itemList= JSON.parse(data['trash']);
 | 
			
		||||
 
 | 
			
		||||
@@ -20,21 +20,25 @@
 | 
			
		||||
	  <form action="/" id="searchForm" class="col s12">
 | 
			
		||||
	   <div class="row">
 | 
			
		||||
	     <div class="input-field col s12">
 | 
			
		||||
	       <input placeholder="Parent" id="parent" type="text">
 | 
			
		||||
	       <label for="parent">Parent</label>
 | 
			
		||||
	     	 <span id='parent'>
 | 
			
		||||
	       	<label for="parent">Parent</label><br>
 | 
			
		||||
	       </span>
 | 
			
		||||
	     </div>
 | 
			
		||||
	     <div class="col s12"></div>
 | 
			
		||||
	     <div class="input-field col s4">
 | 
			
		||||
	       <input placeholder="" id="name" type="text">
 | 
			
		||||
	       <label for="name">Name</label>
 | 
			
		||||
	     		<span id='name'>
 | 
			
		||||
	       		<label for="name">Name</label><br>
 | 
			
		||||
	       	</span>
 | 
			
		||||
	     </div>
 | 
			
		||||
	     <div class="input-field col s4">
 | 
			
		||||
	       <input placeholder="" id="season" type="text" class="validate">
 | 
			
		||||
	       <label for="season">Season</label>
 | 
			
		||||
	       <span id='season'>
 | 
			
		||||
	       	<label for="season">Season</label><br>
 | 
			
		||||
	       </span>
 | 
			
		||||
	     </div>
 | 
			
		||||
	     <div class="input-field col s4">
 | 
			
		||||
	       <input placeholder="" id="episode" type="text" class="validate">
 | 
			
		||||
	       <label for="episode">Episode</label>
 | 
			
		||||
	     	 <span id='episode'>
 | 
			
		||||
	       	<label for="episode">Episode</label><br>
 | 
			
		||||
	       </span>
 | 
			
		||||
	     </div>
 | 
			
		||||
	     <div class="col s12"></div>
 | 
			
		||||
	     <div class="input-field col s12">
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user