|
|
|
@ -40,8 +40,23 @@ var h = holmes({
@@ -40,8 +40,23 @@ var h = holmes({
|
|
|
|
|
}); |
|
|
|
|
//鼠标移动到链接修改为原始URL
|
|
|
|
|
|
|
|
|
|
//js获取协议和域名部分
|
|
|
|
|
function get_domain(){ |
|
|
|
|
//获取协议
|
|
|
|
|
var protocol = window.location.protocol; |
|
|
|
|
protocol = protocol + '//'; |
|
|
|
|
//获取端口号
|
|
|
|
|
var port = window.location.port; |
|
|
|
|
if( (port == 80) || (port == 443) ){ |
|
|
|
|
port = ''; |
|
|
|
|
} |
|
|
|
|
var hostname = window.location.hostname; |
|
|
|
|
domain = protocol + port + hostname; |
|
|
|
|
return domain; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$(document).ready(function(){ |
|
|
|
|
function admin_menu() { |
|
|
|
|
// 加载管理员右键菜单
|
|
|
|
|
//初始化菜单
|
|
|
|
|
$.contextMenu({ |
|
|
|
|
selector: '.link-space', |
|
|
|
@ -64,11 +79,83 @@ $(document).ready(function(){
@@ -64,11 +79,83 @@ $(document).ready(function(){
|
|
|
|
|
tempwindow.location='index.php?c=admin&page=edit_link&id='+link_id; |
|
|
|
|
}}, |
|
|
|
|
"delete": {name: "删除", icon: "delete",callback:function(){ |
|
|
|
|
|
|
|
|
|
var link_id = $(this).attr('id'); |
|
|
|
|
link_id = link_id.replace('id_',''); |
|
|
|
|
mdui.confirm('确认删除?', |
|
|
|
|
function(){ |
|
|
|
|
$.post("index.php?c=api&method=del_link",{id:link_id},function(data,status){ |
|
|
|
|
//如果删除成功,则移除元素
|
|
|
|
|
if(data.code == 0) { |
|
|
|
|
$("#id_" + link_id).remove(); |
|
|
|
|
} |
|
|
|
|
else{ |
|
|
|
|
//删除失败
|
|
|
|
|
mdui.alert(data.err_msg); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
function(){ |
|
|
|
|
//点击取消按钮,不做操作
|
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
}}, |
|
|
|
|
"sep1": "---------", |
|
|
|
|
"qrcode": {name: "二维码", icon:"fa-qrcode"} |
|
|
|
|
"qrcode": {name: "二维码", icon:"fa-qrcode",callback:function(data,status){ |
|
|
|
|
var link_title = $(this).attr('link-title'); |
|
|
|
|
|
|
|
|
|
link_title = link_title.substr(0,8); |
|
|
|
|
// link_title = link_title + '...';
|
|
|
|
|
var link_id = $(this).attr('id'); |
|
|
|
|
link_id = link_id.replace('id_',''); |
|
|
|
|
var domain = get_domain(); |
|
|
|
|
var url = domain + '/index.php?c=click&id=' + link_id; |
|
|
|
|
mdui.dialog({ |
|
|
|
|
'title':link_title, |
|
|
|
|
'cssClass':'show_qrcode', |
|
|
|
|
'content':'<img src = "https://qr.png.pub/v1/?text=' + url + '" />' |
|
|
|
|
}); |
|
|
|
|
}} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
// 加载右键菜单END
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function user_menu() { |
|
|
|
|
// 加载游客右键菜单
|
|
|
|
|
//初始化菜单
|
|
|
|
|
$.contextMenu({ |
|
|
|
|
selector: '.link-space', |
|
|
|
|
callback: function(key, options) { |
|
|
|
|
link_id = $(this).attr('id'); |
|
|
|
|
link_id = link_id.replace('id_',''); |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
items: { |
|
|
|
|
"open":{name: "打开",icon:"fa-external-link",callback:function(key,opt){ |
|
|
|
|
var link_id = $(this).attr('id'); |
|
|
|
|
link_id = link_id.replace('id_',''); |
|
|
|
|
var tempwindow=window.open('_blank'); |
|
|
|
|
tempwindow.location='index.php?c=click&id='+link_id; |
|
|
|
|
}}, |
|
|
|
|
"sep1": "---------", |
|
|
|
|
"qrcode": {name: "二维码", icon:"fa-qrcode",callback:function(data,status){ |
|
|
|
|
var link_title = $(this).attr('link-title'); |
|
|
|
|
|
|
|
|
|
link_title = link_title.substr(0,8); |
|
|
|
|
link_title = link_title + '...'; |
|
|
|
|
var link_id = $(this).attr('id'); |
|
|
|
|
link_id = link_id.replace('id_',''); |
|
|
|
|
var domain = get_domain(); |
|
|
|
|
var url = domain + '/index.php?c=click&id=' + link_id; |
|
|
|
|
mdui.dialog({ |
|
|
|
|
'title':link_title, |
|
|
|
|
'cssClass':'show_qrcode', |
|
|
|
|
'content':'<img src = "https://qr.png.pub/v1/?text=' + url + '" />' |
|
|
|
|
}); |
|
|
|
|
}} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
// 加载游客右键菜单END
|
|
|
|
|
}; |