|
|
|
@ -1035,3 +1035,120 @@ function showNormalImage(id) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//文件、帖子、通知分享
|
|
|
|
|
function org_id_click(){
|
|
|
|
|
var sendText = $("input[name='org_id']:checked").next().text();
|
|
|
|
|
var orgDirection = "目标地址:";
|
|
|
|
|
$(".orgDirection").text(orgDirection + sendText);
|
|
|
|
|
}
|
|
|
|
|
function subfield_click(){
|
|
|
|
|
var sendText = $("input[name='org_id']:checked").next().text();
|
|
|
|
|
var orgDirection = "目标地址:";
|
|
|
|
|
var sendColumn = $("input[name='subfield']:checked").next().text();
|
|
|
|
|
$(".orgDirection").text(orgDirection + sendText + " / " + sendColumn);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function observeSearchfieldOnInput(fieldId, url,send_id,send_ids, send_type) {
|
|
|
|
|
$('#'+fieldId).each(function() {
|
|
|
|
|
var $this = $(this);
|
|
|
|
|
$this.addClass('autocomplete');
|
|
|
|
|
$this.attr('data-value-was', $this.val());
|
|
|
|
|
var check = function() {
|
|
|
|
|
var val = $this.val();
|
|
|
|
|
if ($this.attr('data-value-was') != val){
|
|
|
|
|
$this.attr('data-value-was', val);
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: url,
|
|
|
|
|
type: 'get',
|
|
|
|
|
data: {search: $this.val(),send_id:send_id,send_ids:send_ids, send_type:send_type},
|
|
|
|
|
success: function(data){ },
|
|
|
|
|
beforeSend: function(){ $this.addClass('ajax-loading'); },
|
|
|
|
|
complete: function(){ $this.removeClass('ajax-loading'); }
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
var reset = function() {
|
|
|
|
|
if (timer) {
|
|
|
|
|
clearInterval(timer);
|
|
|
|
|
timer = setInterval(check, 300);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
var timer = setInterval(check, 300);
|
|
|
|
|
$this.bind('keyup click mousemove', reset);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
function check_des(event){
|
|
|
|
|
if($(".sectionContent").find('input[type="radio"]:checked').length <= 0){
|
|
|
|
|
event.preventDefault();
|
|
|
|
|
$(".orgDirection").text('目标地址组织不能为空');
|
|
|
|
|
return false;
|
|
|
|
|
}else if($(".columnContent").find('input[type="radio"]:checked').length <= 0){
|
|
|
|
|
event.preventDefault();
|
|
|
|
|
$(".orgDirection").text('目标地址栏目不能为空');
|
|
|
|
|
return false;
|
|
|
|
|
}else{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var sendType = '1';
|
|
|
|
|
var lastSendType ;//初始为发送到我的课程
|
|
|
|
|
function show_send(id, user_id, send_type){
|
|
|
|
|
if (lastSendType === '2'){ //如果已经发送过一次了,那么就应该沿用上次发送的类型。
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: 'get',
|
|
|
|
|
url: '/users/' + user_id + '/search_user_project',
|
|
|
|
|
data:{send_id:id, send_type:send_type}
|
|
|
|
|
});
|
|
|
|
|
}else if(lastSendType == '1'){
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: 'get',
|
|
|
|
|
url: '/users/' + user_id + '/search_user_course',
|
|
|
|
|
data:{send_id:id, send_type:send_type}
|
|
|
|
|
});
|
|
|
|
|
}else if( lastSendType == '3'){//组织
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: 'get',
|
|
|
|
|
url: '/users/' + user_id + '/search_user_org',
|
|
|
|
|
data:{send_id:id, send_type:send_type}
|
|
|
|
|
});
|
|
|
|
|
}else{
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: 'get',
|
|
|
|
|
url: '/users/' + user_id + '/search_user_course',
|
|
|
|
|
data:{send_id:id, send_type:send_type}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//id 发送的id
|
|
|
|
|
//发送的id数组
|
|
|
|
|
function chooseSendType(res_id,res_ids, user_id, send_type){
|
|
|
|
|
|
|
|
|
|
sendType = $(".resourcesSendType").val();
|
|
|
|
|
if (sendType === lastSendType) {
|
|
|
|
|
return;
|
|
|
|
|
} else if(lastSendType != null) { //不是第一次点击的时候
|
|
|
|
|
if (sendType == '1') {
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: 'get',
|
|
|
|
|
url: '/users/' + user_id + '/search_user_course',
|
|
|
|
|
data:{send_id:res_id, send_type:send_type}
|
|
|
|
|
});
|
|
|
|
|
} else if(sendType == '2') {
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: 'get',
|
|
|
|
|
url: '/users/' + user_id + '/search_user_project',
|
|
|
|
|
data:{send_id:res_id, send_type:send_type}
|
|
|
|
|
});
|
|
|
|
|
}else if(sendType == '3'){
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: 'get',
|
|
|
|
|
url: '/users/' + user_id + '/search_user_org',
|
|
|
|
|
data:{send_id:res_id, send_type:send_type}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
lastSendType = sendType;
|
|
|
|
|
}
|
|
|
|
|