media_upload.js 1.33 KB
$(document).ready(function () {
  var post_max_str = document.media_upload.post_max.value;
  var post_max = parseInt(post_max_str.substr(0, post_max_str.length - 1));
  var upload_max_str = document.media_upload.upload_max.value;
  var upload_max = parseInt(upload_max_str.substr(0, upload_max_str.length - 1));
  $('#file_max_size').html((post_max > upload_max?upload_max:post_max));
})

function popAddTag(){
  var html_data = '<div style="padding-left:20px;">';
  html_data += '<p>视频标签名</p>';
  html_data += '<div class="input_200 el-input">';
  html_data += '<input type="text" autocomplete="off" id="media_tag" class="el-input__inner"></div><br/>';
  html_data += '<button type="button" class="el-button height_30 el-button--primary" onClick="addTag()" >确定</button>';
  html_data += '<br/><br/></div>';
  doSelectPopup(html_data);
}

function addTag(){
  requestUrl = "ajax_add_media_tag.php?tag=" + document.getElementById("media_tag").value;
  $.getJSON(requestUrl, function(json){
   
    if(json.status == 'NG'){
      v.$message({
        type: 'error',
        message: json.error_message
      });
    }else{
      closeSelectPopup();
      v.$message({
        type: 'success',
        message: '添加成功!'
      });
    }
  });
}

function popAddCourse(){
  window.open('collection_media_edit_input.php?action_type=new','_self')
}