View file home/templates/home/includes/embed-video.html

File size: 2.88Kb
<div class="content post-editing-form">
	<div class="valign user-heading">
		<img src="{{ME avatar}}" class="img-circle">
		<div>
			<span>{{ME username}}</span>
			<span class="pp_area">{{LANG embed_video}}</span>
		</div>
	</div>
  	<form class="form" id="embed-post-video" action="{{CONFIG site_url}}/aj/posts/embed-post-video" autocomplete="true">
      	<div class="form-group fetch-url">
      		<div class="video-url">
      			<input name="url" placeholder="YouTube, Dailymotion, Vimeo URL" id="video_url_" />
				<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="currentColor" d="M18.364 15.536L16.95 14.12l1.414-1.414a5 5 0 1 0-7.071-7.071L9.879 7.05 8.464 5.636 9.88 4.222a7 7 0 0 1 9.9 9.9l-1.415 1.414zm-2.828 2.828l-1.415 1.414a7 7 0 0 1-9.9-9.9l1.415-1.414L7.05 9.88l-1.414 1.414a5 5 0 1 0 7.071 7.071l1.414-1.414 1.415 1.414zm-.708-10.607l1.415 1.415-7.071 7.07-1.415-1.414 7.071-7.07z"/></svg>
      		</div>
      	</div>
      	<div class="fluid iframe-renderer">
      		<div class="form-group" id="embed-iframe"></div>
      	</div>
		<div class="form-group">
	      	<textarea class="form-control" name="caption" rows="3" placeholder="{{LANG add_post_caption}}"></textarea>
		</div>
      	<div class="form-group publish">
			<div class="loading_cont hidden"></div>
			<button type="reset" class="btn btn-default btn-mat" id="close-anim-modal">{{LANG close}}</button>
      		<button type="submit" class="btn btn-main btn-mat">{{LANG publish}}</button>
      	</div>
      	<input type="hidden" id="video_id" name="video_id">
      	<input type="hidden" id="embed" name="embed">
        <input type="hidden" name="hash" value="<?php echo($context['csrf_token']) ?>" id="hash_">
  	</form>
</div>
<script type="text/javascript">
  var playtube_support = <?php echo($context['playtube_support']) ?>;
  var playtube_link = "<?php echo($context['playtube_link']) ?>";
  var extracted_images;
  var img_arr_pos;
  var mp4_links = "{{CONFIG mp4_links}}";
  var playtube_links = "{{CONFIG playtube_links}}";

  $("body").on("click","#thumb_prev", function(e){    
    if(img_arr_pos>0) 
    {
      img_arr_pos--; 
      
      $("#img_url").attr('src', extracted_images[img_arr_pos]);
      $("#thumb_url").attr('value', extracted_images[img_arr_pos]);
    }
  });
  
  $("body").on("click","#thumb_next", function(e){    
    if(img_arr_pos<total_images)
    {
      img_arr_pos++;
      
      $("#img_url").attr('src', extracted_images[img_arr_pos]);

      $("#thumb_url").attr('value', extracted_images[img_arr_pos]);
    }
  });

  function get_image_(self) {
    var file = $(self).prop('files')[0];
    $('#image_name_').text(file.name);
  }
  function open_file_() {
    $('#post_image_thumb').click();
  }
</script>

<?php 
include $context['dirname_theme'].'/home/templates/home/js/script.embed.video.html';
 ?>