2016-01-14 15:59:50 +08:00
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>֯<EFBFBD><D6AF>Ա<EFBFBD><D4B1><EFBFBD>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>
|
2016-08-31 17:09:02 +08:00
|
|
|
|
// 组织:新增成员
|
2016-01-14 15:59:50 +08:00
|
|
|
|
function submit_add_org_members(){
|
|
|
|
|
$("#org_member_add_form").submit();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function observeSearchfield(fieldId, targetId, url) {
|
|
|
|
|
$('#'+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: {q: $this.val()},
|
|
|
|
|
success: function(data){ if(targetId) $('#'+targetId).html(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);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-09 09:02:12 +08:00
|
|
|
|
//显示更多子栏目
|
|
|
|
|
function show_more_org_submain(url){
|
|
|
|
|
$.get(
|
|
|
|
|
url,
|
|
|
|
|
{ page: $("#org_submains_page_num").val() },
|
|
|
|
|
function (data) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2016-01-14 15:59:50 +08:00
|
|
|
|
//显示更多的项目
|
|
|
|
|
function show_more_org_project(url){
|
|
|
|
|
$.get(
|
|
|
|
|
url,
|
|
|
|
|
{ page: $("#org_project_page_num").val() },
|
|
|
|
|
function (data) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function show_more_org_course(url){
|
|
|
|
|
$.get(
|
|
|
|
|
url,
|
|
|
|
|
{page: $("#org_course_page_num").val()},
|
|
|
|
|
function (data){}
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function search_tag_attachment(url,tag_name,q,course_id,sort)
|
|
|
|
|
{
|
|
|
|
|
//alert("111");
|
|
|
|
|
//clearTimeout(clickFunction);
|
|
|
|
|
clickFunction = setTimeout(function() {
|
|
|
|
|
search_func()
|
|
|
|
|
}, 500);
|
|
|
|
|
function search_func(){
|
|
|
|
|
if(isdb!= false ) return;
|
|
|
|
|
$.get(
|
|
|
|
|
url,
|
|
|
|
|
{
|
|
|
|
|
tag_name: tag_name,
|
|
|
|
|
q: q,
|
|
|
|
|
org_subfield_id:course_id
|
|
|
|
|
},
|
|
|
|
|
function (data) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2016-05-12 15:02:23 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 教师选项
|
|
|
|
|
var sendType = '1';
|
|
|
|
|
var lastSendType ;//初始为发送到我的课程
|
|
|
|
|
function chooseTeacherType(org_id){
|
|
|
|
|
sendType = $("#teacher_type_select").val();
|
|
|
|
|
if (sendType === lastSendType) {
|
|
|
|
|
alert("666");
|
|
|
|
|
return;
|
|
|
|
|
} else if(lastSendType != null) { //不是第一次点击的时候
|
|
|
|
|
if (sendType == '1') {
|
|
|
|
|
alert("te");
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: 'get',
|
|
|
|
|
url: '/organizations/' + org_id + '/teachers',
|
|
|
|
|
data:{type:"teachers"}
|
|
|
|
|
});
|
|
|
|
|
} else if(sendType == '2') {
|
|
|
|
|
alert(org_id);
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: 'get',
|
|
|
|
|
url: '/organizations/' + org_id + '/teachers',
|
|
|
|
|
data:{type:"students"}
|
|
|
|
|
});
|
|
|
|
|
}else if(sendType == '3'){
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: 'get',
|
|
|
|
|
url: '/organizations/' + org_id + '/teachers',
|
|
|
|
|
data:{type:"resources"}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
lastSendType = sendType;
|
2016-06-01 17:38:41 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//修改状态
|
|
|
|
|
function admin_hide_org(content, id){
|
2016-06-02 09:52:06 +08:00
|
|
|
|
if (content.text() == '设为热门'){
|
2016-06-01 17:38:41 +08:00
|
|
|
|
$.ajax({
|
2016-06-02 09:52:06 +08:00
|
|
|
|
url: "/organizations/update_field_by_admin?container=" + id + "&type=project",
|
2016-06-01 17:38:41 +08:00
|
|
|
|
type: "post"
|
|
|
|
|
});
|
2016-06-02 09:52:06 +08:00
|
|
|
|
}
|
|
|
|
|
else if (content.text() == '设为精品'){
|
2016-06-01 17:38:41 +08:00
|
|
|
|
$.ajax({
|
2016-06-02 09:52:06 +08:00
|
|
|
|
url: "/organizations/update_field_by_admin?container=" + id + "&type=course",
|
2016-06-01 17:38:41 +08:00
|
|
|
|
type: "post"
|
|
|
|
|
});
|
2016-06-02 09:52:06 +08:00
|
|
|
|
}
|
|
|
|
|
else if (content.text() == '取消热门'){
|
2016-06-01 17:38:41 +08:00
|
|
|
|
$.ajax({
|
2016-06-02 09:52:06 +08:00
|
|
|
|
url: "/organizations/update_field_by_admin?container=" + id + "&type=project" + "&status=reset",
|
2016-06-01 17:38:41 +08:00
|
|
|
|
type: "post"
|
|
|
|
|
});
|
2016-06-02 09:52:06 +08:00
|
|
|
|
}
|
|
|
|
|
else if (content.text() == '取消精品'){
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "/organizations/update_field_by_admin?container=" + id + "&type=course" + "&status=reset",
|
|
|
|
|
type: "post"
|
|
|
|
|
});
|
|
|
|
|
}
|
2015-11-05 17:57:07 +08:00
|
|
|
|
}
|