byteoss 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +109 -0
- package/index.js +147 -0
- package/oss/059e300c-9447-401a-9160-bc09b94a5bd4.css +516 -0
- package/oss/0fb02e11-31af-4551-a92e-b4457ad4ab0d.svg +3 -0
- package/oss/139daa0c-24fd-4be3-b9c6-8e51f96f6b96.svg +3 -0
- package/oss/1600dbb0-15a5-483d-bdbc-84971697ad90.svg +15 -0
- package/oss/177f61e2-3422-4c87-8110-ff1615758f91.css +153 -0
- package/oss/18cab5b9-4981-4274-8c5f-1978588297b0.png +0 -0
- package/oss/1c9abd94-340f-4c18-92a3-d28c61a16bbb.js +936 -0
- package/oss/258f066d-7574-491d-ba06-0f2e67db0773.js +1 -0
- package/oss/28225623-cdb8-4d7b-afe7-a25b9cdf4c79.svg +4 -0
- package/oss/2b103172-c38e-4c9c-b67c-753ede400c6b.js +1 -0
- package/oss/2cd0609f-d7a7-4c53-a277-79e8dec5dfc6.svg +4 -0
- package/oss/332d0e76-3c05-4285-af16-13e9f9bbcbed.css +431 -0
- package/oss/36a32028-256f-465d-be90-a65d1df04a90.js +1 -0
- package/oss/370921ea-2b94-4c18-9d1a-785aa58bef86.js +770 -0
- package/oss/3e98311d-bbf6-40d6-82b7-52b710aca34a.css +198 -0
- package/oss/40117c3a-1925-4250-90bf-f3ef878ee97d.svg +3 -0
- package/oss/469b8af5-1826-4f55-826f-56d57a896563.js +1 -0
- package/oss/49f08903-6594-475c-aab6-4c15b41ebc3a.svg +28 -0
- package/oss/4a5a9153-2bd7-443c-b628-aee3d4d55fd6.js +300 -0
- package/oss/4f100f7b-f956-431f-93f9-1e9e3a103574.css +197 -0
- package/oss/4f14fb89-2a43-49d4-89fe-c245508b451f.js +1 -0
- package/oss/50863606-18e8-4eaa-b738-6e98b7ff791f.css +513 -0
- package/oss/54a1eff8-ecd1-4604-956e-91e461d0f704.js +705 -0
- package/oss/554a3dbe-14c7-4349-956a-236b08a149f6.css +124 -0
- package/oss/5cb13f6f-423d-41e9-a081-ce544bf322f1.css +513 -0
- package/oss/5fd8e893-8b05-452f-b914-26965c19fd31.svg +1 -0
- package/oss/6016b5f9-4473-44d9-9373-c761278cc244.js +2909 -0
- package/oss/630ebd92-9296-4c85-a18c-954545b9716b.mp4 +0 -0
- package/oss/66127685-903b-4261-bc3a-887459229b79.js +90 -0
- package/oss/6bf3a690-882e-47b2-a3bf-07600e1067d9.svg +1 -0
- package/oss/6d15d999-42a6-48f8-85dc-d6dd2547d33c.svg +10 -0
- package/oss/72ca2a33-968f-4bc4-ba39-417aca989e2a.svg +40 -0
- package/oss/74a7f15c-cf9e-41e5-a649-bc7a9960b89d.js +936 -0
- package/oss/754fca20-6995-4b15-bf56-2202c2107f41.svg +1 -0
- package/oss/7dbeba7d-92dc-4f24-981f-6ee5988326a3.js +90 -0
- package/oss/7ec89667-7160-44da-8c5d-8cb2e5b6ed51.css +144 -0
- package/oss/80254c08-1b12-4f32-bec9-b56251fb7b6e.svg +14 -0
- package/oss/80c9635a-2d99-483a-b46a-eec29d831dbc.svg +1 -0
- package/oss/83982b15-f2af-4c7d-98d1-9885c934adee.css +153 -0
- package/oss/842d27d8-4c7d-4655-bd81-d19376b9c779.ttf +0 -0
- package/oss/86e16498-0990-4f5f-9c78-919d6e901b3e.png +0 -0
- package/oss/871ce06b-adf2-4d23-893e-c929ed0dc660.css +1079 -0
- package/oss/875441a7-46aa-4510-b395-59d32129b643.js +84 -0
- package/oss/886aaec0-d95a-44c0-a809-b611c3a385bc.svg +1 -0
- package/oss/8870cb0a-075f-4296-8855-cf708905377f.js +51 -0
- package/oss/88a1fdfb-b313-4021-8c2e-97db3dddd4af.svg +26 -0
- package/oss/8bd1a260-f002-42d3-a288-9ec0270490ea.svg +14 -0
- package/oss/8d1ac209-5712-43a7-9d86-c4a1b4d6734a.json +1 -0
- package/oss/917711d3-9f92-4b63-804c-a17050b72502.svg +1 -0
- package/oss/92122f36-32a3-44ad-81f9-96427ad7d999.svg +4 -0
- package/oss/945aebff-92e3-4f5a-b3e1-9d891c525d95.js +19 -0
- package/oss/945aebff-92e3-4f5a-b3e1-9d891c525d95_bak.js +19 -0
- package/oss/94b77c89-093d-48ae-b363-9f6648f91ab6.css +2435 -0
- package/oss/9697873a-4c40-401e-addd-3736815acf10.svg +3 -0
- package/oss/9bd56993-3d11-4a5c-a682-a95e527da09e.svg +1 -0
- package/oss/9fa42c0c-617c-44a2-9bb9-aec8994af673.svg +1 -0
- package/oss/a25bc2e8-28e3-4bd2-b0cf-c4f577934119.svg +3 -0
- package/oss/a2e59c39-138a-4d1e-84c8-bc058454133f.js +434 -0
- package/oss/a5535c26-8363-4625-afa2-8fbbee4dab40.css +124 -0
- package/oss/a6a7c636-670b-4f99-aa6b-e5cb6f029327.ico +0 -0
- package/oss/a6f63612-b3d1-4aba-bf5f-0cd3055a7251.svg +1 -0
- package/oss/a85345e2-b625-4917-8c47-d85503226015.svg +12 -0
- package/oss/ab70067a-ed3f-4d8c-8776-cd1a7b67097d.svg +8 -0
- package/oss/abe3279f-b713-403f-b0d1-7efa24502c11.css +2251 -0
- package/oss/b10e7a02-f948-4c79-98a1-504ef025d37a.ttf +0 -0
- package/oss/b43dabdf-cf3d-4e74-aaec-46b451089b4b.svg +4 -0
- package/oss/b4e5962d-0b64-4667-89aa-bdbfc967f9d5.svg +12 -0
- package/oss/b7633fb4-4845-45b1-b516-b76bc0b31692.svg +10 -0
- package/oss/bd64bd8e-ad36-4b30-bc3f-047f0b5472af.eot +0 -0
- package/oss/be75e4b2-9d84-41a1-b2ad-941100c6eb9f.svg +1 -0
- package/oss/bf600662-21bc-427a-a3ff-c7148bfb7a37.css +516 -0
- package/oss/bktjgd.js +0 -0
- package/oss/bktjwb.js +0 -0
- package/oss/c1c43d05-3fe7-4f66-92c3-a4e673de15d2.css +126 -0
- package/oss/c40e78e1-28a9-403f-9bb6-6a61bb759f3c.svg +9 -0
- package/oss/c5e67efa-03ef-4285-9eb2-979d24b97b0a.js +505 -0
- package/oss/ca88122c-71f0-4bdb-801b-845c3e2416c0.js +57 -0
- package/oss/ce7d2a57-04d3-4320-95de-a1acb29c2299.svg +1 -0
- package/oss/cf261a0a-f683-4e12-92c1-98c42038da76.js +301 -0
- package/oss/d13ba061-af1c-420f-a700-4a8c175a6d90.js +51 -0
- package/oss/d820804f-af30-4364-b882-9d7b23e98353.js +1 -0
- package/oss/dae77962-f0f3-487f-bfff-1251e44b3d98.js +313 -0
- package/oss/db0b6693-9a13-4a89-9c67-82a5c2208ed9.svg +1 -0
- package/oss/dd3a7016-cf8c-493c-ba87-c7da470f9307.svg +1 -0
- package/oss/dd4c56f1-700e-49b8-a40f-530ed2e06934.svg +1 -0
- package/oss/de85749c-9ab2-4798-a080-1dafbd2bb89a.css +393 -0
- package/oss/dfd0db36-8259-4d6e-a426-7c1167c7657d.svg +18 -0
- package/oss/e082736c-726c-4029-b3ce-6c89d83ad9ce.css +3177 -0
- package/oss/e0efdb0b-2cf8-41fe-b862-7560a8d957e3.js +193 -0
- package/oss/e1d3a1a8-c200-47de-bba9-b92aa112010b.svg +1 -0
- package/oss/e937b5e0-2285-474e-84e7-5c478f305280.js +775 -0
- package/oss/ed850ceb-a7a3-47f4-9d2e-d6fd2666a8c9.js +936 -0
- package/oss/ee0c80ad-d7cb-464f-aa4a-a7f439d76ae8.js +665 -0
- package/oss/ef62fbf5-a876-4112-8062-c97b5341f1b9.css +653 -0
- package/oss/f343adb3-110f-445e-80b4-abca81ff558a.js +787 -0
- package/oss/f4d90992-79bf-4a51-a2d7-7d556fac63d3.js +1 -0
- package/oss/f59f0ec0-974b-496d-a518-dfb79e0ecec0.js +51 -0
- package/oss/f68472c9-1d02-451a-be1f-6d5f0fa2c6fd.css +145 -0
- package/oss/f7b46b4d-6311-4416-95b0-e18ad577c166.css +1 -0
- package/oss/home.css +459 -0
- package/oss/mjandjlbgd.js +0 -0
- package/oss/mjandjlbwb.js +0 -0
- package/package.json +17 -0
|
@@ -0,0 +1,775 @@
|
|
|
1
|
+
|
|
2
|
+
String.prototype.replaceAll = function(s1,s2){ return this.replace(new RegExp(s1,"gm"),s2); }
|
|
3
|
+
String.prototype.trim=function(){ return this.replace(/(^\s*)|(\s*$)/g, ""); }
|
|
4
|
+
var base64EncodeChars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var base64DecodeChars=new Array(-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1);function base64encode(str){var out,i,len;var c1,c2,c3;len=str.length;i=0;out="";while(i<len){c1=str.charCodeAt(i++)&0xff;if(i==len){out+=base64EncodeChars.charAt(c1>>2);out+=base64EncodeChars.charAt((c1&0x3)<<4);out+="==";break}c2=str.charCodeAt(i++);if(i==len){out+=base64EncodeChars.charAt(c1>>2);out+=base64EncodeChars.charAt(((c1&0x3)<<4)|((c2&0xF0)>>4));out+=base64EncodeChars.charAt((c2&0xF)<<2);out+="=";break}c3=str.charCodeAt(i++);out+=base64EncodeChars.charAt(c1>>2);out+=base64EncodeChars.charAt(((c1&0x3)<<4)|((c2&0xF0)>>4));out+=base64EncodeChars.charAt(((c2&0xF)<<2)|((c3&0xC0)>>6));out+=base64EncodeChars.charAt(c3&0x3F)}return out}function base64decode(str){var c1,c2,c3,c4;var i,len,out;len=str.length;i=0;out="";while(i<len){do{c1=base64DecodeChars[str.charCodeAt(i++)&0xff]}while(i<len&&c1==-1);if(c1==-1)break;do{c2=base64DecodeChars[str.charCodeAt(i++)&0xff]}while(i<len&&c2==-1);if(c2==-1)break;out+=String.fromCharCode((c1<<2)|((c2&0x30)>>4));do{c3=str.charCodeAt(i++)&0xff;if(c3==61)return out;c3=base64DecodeChars[c3]}while(i<len&&c3==-1);if(c3==-1)break;out+=String.fromCharCode(((c2&0XF)<<4)|((c3&0x3C)>>2));do{c4=str.charCodeAt(i++)&0xff;if(c4==61)return out;c4=base64DecodeChars[c4]}while(i<len&&c4==-1);if(c4==-1)break;out+=String.fromCharCode(((c3&0x03)<<6)|c4)}return out}function utf16to8(str){var out,i,len,c;out="";len=str.length;for(i=0;i<len;i++){c=str.charCodeAt(i);if((c>=0x0001)&&(c<=0x007F)){out+=str.charAt(i)}else if(c>0x07FF){out+=String.fromCharCode(0xE0|((c>>12)&0x0F));out+=String.fromCharCode(0x80|((c>>6)&0x3F));out+=String.fromCharCode(0x80|((c>>0)&0x3F))}else{out+=String.fromCharCode(0xC0|((c>>6)&0x1F));out+=String.fromCharCode(0x80|((c>>0)&0x3F))}}return out}function utf8to16(str){var out,i,len,c;var char2,char3;out="";len=str.length;i=0;while(i<len){c=str.charCodeAt(i++);switch(c>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:out+=str.charAt(i-1);break;case 12:case 13:char2=str.charCodeAt(i++);out+=String.fromCharCode(((c&0x1F)<<6)|(char2&0x3F));break;case 14:char2=str.charCodeAt(i++);char3=str.charCodeAt(i++);out+=String.fromCharCode(((c&0x0F)<<12)|((char2&0x3F)<<6)|((char3&0x3F)<<0));break}}return out}
|
|
5
|
+
|
|
6
|
+
var MAC={
|
|
7
|
+
'Url': document.URL,
|
|
8
|
+
'Title': document.title,
|
|
9
|
+
'UserAgent' : function(){
|
|
10
|
+
var ua = navigator.userAgent;//navigator.appVersion
|
|
11
|
+
return {
|
|
12
|
+
'mobile': !!ua.match(/AppleWebKit.*Mobile.*/), //是否为移动终端
|
|
13
|
+
'ios': !!ua.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
|
|
14
|
+
'android': ua.indexOf('Android') > -1 || ua.indexOf('Linux') > -1, //android终端或者uc浏览器
|
|
15
|
+
'iPhone': ua.indexOf('iPhone') > -1 || ua.indexOf('Mac') > -1, //是否为iPhone或者QQHD浏览器
|
|
16
|
+
'iPad': ua.indexOf('iPad') > -1, //是否iPad
|
|
17
|
+
'trident': ua.indexOf('Trident') > -1, //IE内核
|
|
18
|
+
'presto': ua.indexOf('Presto') > -1, //opera内核
|
|
19
|
+
'webKit': ua.indexOf('AppleWebKit') > -1, //苹果、谷歌内核
|
|
20
|
+
'gecko': ua.indexOf('Gecko') > -1 && ua.indexOf('KHTML') == -1, //火狐内核
|
|
21
|
+
'weixin': ua.indexOf('MicroMessenger') > -1 //是否微信 ua.match(/MicroMessenger/i) == "micromessenger",
|
|
22
|
+
};
|
|
23
|
+
}(),
|
|
24
|
+
'Copy': function(s){
|
|
25
|
+
if (window.clipboardData){ window.clipboardData.setData("Text",s); }
|
|
26
|
+
else{
|
|
27
|
+
if( $("#mac_flash_copy").get(0) ==undefined ){ $('<div id="mac_flash_copy"></div>'); } else {$('#mac_flash_copy').html(''); }
|
|
28
|
+
$('#mac_flash_copy').html('<embed src='+SitePath+'"images/_clipboard.swf" FlashVars="clipboard='+escape(s)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>');
|
|
29
|
+
}
|
|
30
|
+
alert("复制成功")
|
|
31
|
+
},
|
|
32
|
+
'Home': function(o,u){
|
|
33
|
+
try{
|
|
34
|
+
o.style.behavior='url(#default#homepage)'; o.setHomePage(u);
|
|
35
|
+
}
|
|
36
|
+
catch(e){
|
|
37
|
+
if(window.netscape){
|
|
38
|
+
try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");}
|
|
39
|
+
catch(e){ alert("此操作被浏览器拒绝!请手动设置");}
|
|
40
|
+
var moz = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
|
|
41
|
+
moz.setCharPref('browser.startup.homepage',u);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
'Fav': function(u,s){
|
|
46
|
+
try{ window.external.addFavorite(u, s);}
|
|
47
|
+
catch (e){
|
|
48
|
+
try{window.sidebar.addPanel(s, u, "");}catch (e){ alert("加入收藏出错,请使用键盘Ctrl+D进行添加"); }
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
'Open': function(u,w,h){
|
|
52
|
+
window.open(u,'macopen1','toolbars=0, scrollbars=0, location=0, statusbars=0,menubars=0,resizable=yes,width='+w+',height='+h+'');
|
|
53
|
+
},
|
|
54
|
+
'Cookie': {
|
|
55
|
+
'Set': function(name,value,days){
|
|
56
|
+
var exp = new Date();
|
|
57
|
+
exp.setTime(exp.getTime() + days*24*60*60*1000);
|
|
58
|
+
var arr=document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
|
|
59
|
+
document.cookie=name+"="+encodeURIComponent(value)+";path=/;expires="+exp.toUTCString();
|
|
60
|
+
},
|
|
61
|
+
'Get': function(name){
|
|
62
|
+
var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
|
|
63
|
+
if(arr != null){ return decodeURIComponent(arr[2]); return null; }
|
|
64
|
+
},
|
|
65
|
+
'Del': function(name){
|
|
66
|
+
var exp = new Date();
|
|
67
|
+
exp.setTime(exp.getTime()-1);
|
|
68
|
+
var cval = this.Get(name);
|
|
69
|
+
if(cval != null){ document.cookie = name+"="+encodeURIComponent(cval)+";path=/;expires="+exp.toUTCString(); }
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
'GoBack':function(){
|
|
73
|
+
var ldghost=document.domain;
|
|
74
|
+
if(document.referrer.indexOf(ldghost)>0) {
|
|
75
|
+
history.back();
|
|
76
|
+
}
|
|
77
|
+
else{
|
|
78
|
+
window.location ="http://"+ldghost;
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
'Adaptive':function(){
|
|
82
|
+
if(maccms.mob_status=='1'&& maccms.url != maccms.wapurl){
|
|
83
|
+
if(document.domain ==maccms.url && MAC.UserAgent.mobile){
|
|
84
|
+
location.href = location.href.replace(maccms.url,maccms.wapurl);
|
|
85
|
+
}
|
|
86
|
+
else if(document.domain ==maccms.wapurl && !MAC.UserAgent.mobile){
|
|
87
|
+
location.href = location.href.replace(maccms.wapurl,maccms.url);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
'CheckBox':{
|
|
92
|
+
'All':function(n){
|
|
93
|
+
$("input[name='"+n+"']").each(function() {
|
|
94
|
+
this.checked = true;
|
|
95
|
+
});
|
|
96
|
+
},
|
|
97
|
+
'Other':function(n){
|
|
98
|
+
$("input[name='"+n+"']").each(function() {
|
|
99
|
+
this.checked = !this.checked;
|
|
100
|
+
});
|
|
101
|
+
},
|
|
102
|
+
'Count':function(n){
|
|
103
|
+
var res=0;
|
|
104
|
+
$("input[name='"+n+"']").each(function() {
|
|
105
|
+
if(this.checked){ res++; }
|
|
106
|
+
});
|
|
107
|
+
return res;
|
|
108
|
+
},
|
|
109
|
+
'Ids':function(n){
|
|
110
|
+
var res=[];
|
|
111
|
+
$("input[name='"+n+"']").each(function() {
|
|
112
|
+
if(this.checked){ res.push(this.value); }
|
|
113
|
+
});
|
|
114
|
+
return res.join(",");
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
'Qrcode':function(){
|
|
118
|
+
$('.mac_qrcode').attr('src','//api.maccms.com/qrcode/?w=150&h=150&url=' + MAC.Url);
|
|
119
|
+
},
|
|
120
|
+
'Image':{
|
|
121
|
+
'Lazyload':{
|
|
122
|
+
'Show': function(){
|
|
123
|
+
try { $("img.lazy").lazyload(); }catch(e){};
|
|
124
|
+
},
|
|
125
|
+
'Box': function($id){
|
|
126
|
+
$("img.lazy").lazyload({
|
|
127
|
+
container: $("#"+$id)
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
'Verify': {
|
|
133
|
+
'Init': function(){
|
|
134
|
+
MAC.Verify.Focus();
|
|
135
|
+
MAC.Verify.Click();
|
|
136
|
+
},
|
|
137
|
+
'Focus': function(){//验证码框焦点
|
|
138
|
+
$('body').on("focus", ".mac_verify", function(){
|
|
139
|
+
$(this).removeClass('mac_verify').after(MAC.Verify.Show());
|
|
140
|
+
$(this).unbind();
|
|
141
|
+
});
|
|
142
|
+
},
|
|
143
|
+
'Click': function(){//点击刷新
|
|
144
|
+
$('body').on('click', 'img.mac_verify_img', function(){
|
|
145
|
+
$(this).attr('src', maccms.path +'/index.php/verify/index.html?');
|
|
146
|
+
});
|
|
147
|
+
},
|
|
148
|
+
'Refresh':function(){
|
|
149
|
+
$('.mac_verify_img').attr('src', maccms.path +'/index.php/verify/index.html?');
|
|
150
|
+
},
|
|
151
|
+
'Show':function(){
|
|
152
|
+
return '<img class="mac_verify_img" src="'+ maccms.path +'/index.php/verify/index.html?" title="看不清楚? 换一张!">';
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
'PageGo':{
|
|
156
|
+
'Init':function() {
|
|
157
|
+
$('.mac_page_go').click(function () {
|
|
158
|
+
var that =$(this);
|
|
159
|
+
var url = that.attr('data-url');
|
|
160
|
+
var total = that.attr('data-total');
|
|
161
|
+
var sp = that.attr('data-sp');
|
|
162
|
+
var page= $('#page').val();
|
|
163
|
+
|
|
164
|
+
if(page>0&&(page<=total)){
|
|
165
|
+
url=url.replace(sp + 'PAGELINK',page).replace('PAGELINK',page);
|
|
166
|
+
location.href=url;
|
|
167
|
+
}
|
|
168
|
+
return false;
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
'Hits': {
|
|
173
|
+
'Init':function() {
|
|
174
|
+
if($('.mac_hits').length==0){
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
var $that = $(".mac_hits");
|
|
178
|
+
$.ajax({
|
|
179
|
+
type: 'get',
|
|
180
|
+
url: maccms.path + '/index.php/ajax/hits?mid='+$that.attr("data-mid")+'&id='+$that.attr("data-id")+'&type=update',
|
|
181
|
+
timeout: 5000,
|
|
182
|
+
dataType: 'json',
|
|
183
|
+
error: function () {
|
|
184
|
+
|
|
185
|
+
},
|
|
186
|
+
success: function (json) {
|
|
187
|
+
if (json.code == 1) {
|
|
188
|
+
$(".mac_hits").each(function(i){
|
|
189
|
+
$type = $(".mac_hits").eq(i).attr('data-type');
|
|
190
|
+
if($type != 'insert'){
|
|
191
|
+
$('.'+$type).html(eval('(json.data.' + $type + ')'));
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
'Score': {
|
|
201
|
+
'Init':function(){
|
|
202
|
+
if($('.mac_score').length==0){
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
$('body').on('click', '.score_btn', function(e){
|
|
206
|
+
MAC.Score.Submit();
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
$.ajax({
|
|
210
|
+
type: 'post',
|
|
211
|
+
url: maccms.path+'/index.php/ajax/score?mid='+ $('.mac_score').attr('data-mid') +'&id=' +$('.mac_score').attr('data-id'),
|
|
212
|
+
timeout: 5000,
|
|
213
|
+
error: function(){
|
|
214
|
+
$(".mac_score").html('评分加载失败');
|
|
215
|
+
},
|
|
216
|
+
success: function($r){
|
|
217
|
+
MAC.Score.View($r);
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
},
|
|
221
|
+
'Submit':function(){
|
|
222
|
+
var $s = $('.mac_score').find("input[name='score']").val();
|
|
223
|
+
$.ajax({
|
|
224
|
+
type: 'post',
|
|
225
|
+
url: maccms.path+'/index.php/ajax/score?mid='+$('.mac_score').attr('data-mid')+'&id='+$('.mac_score').attr('data-id') + '&score='+ $s,
|
|
226
|
+
timeout: 5000,
|
|
227
|
+
error: function(){
|
|
228
|
+
|
|
229
|
+
},
|
|
230
|
+
success: function($r){
|
|
231
|
+
alert($r.msg)
|
|
232
|
+
if($r.code==1){
|
|
233
|
+
MAC.Score.View($r);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
},
|
|
238
|
+
'View':function($r){
|
|
239
|
+
$(".rating"+Math.floor($r.data.score)).attr('checked',true);
|
|
240
|
+
$(".score_num").text( $r.data.score_num );
|
|
241
|
+
$(".score_all").text( $r.data.score_all );
|
|
242
|
+
$(".score_pjf").text( $r.data.score );
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
'Star': {
|
|
246
|
+
'Init':function(){
|
|
247
|
+
if($('.mac_star').length==0){
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
$('.mac_star').raty({
|
|
252
|
+
starType: 'i',
|
|
253
|
+
number: 5,
|
|
254
|
+
numberMax : 5,
|
|
255
|
+
half: true,
|
|
256
|
+
score : function(){
|
|
257
|
+
return $(this).attr('data-score');
|
|
258
|
+
},
|
|
259
|
+
click: function(score, evt) {
|
|
260
|
+
$.ajax({
|
|
261
|
+
type: 'get',
|
|
262
|
+
url: maccms.path+'/index.php/ajax/score?mid='+$('.mac_star').attr('data-mid')+'&id='+$('.mac_star').attr('data-id')+'&score='+(score*2),
|
|
263
|
+
timeout: 5000,
|
|
264
|
+
dataType:'json',
|
|
265
|
+
error: function(){
|
|
266
|
+
$('.star_box').attr('title', '网络异常!');
|
|
267
|
+
},
|
|
268
|
+
success: function(json){
|
|
269
|
+
if(json.status == 1){
|
|
270
|
+
$('.star_tips').html(json.data.score);
|
|
271
|
+
}else{
|
|
272
|
+
$('.star_box').attr('title', json.msg);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
'Digg': {
|
|
281
|
+
'Init':function(){
|
|
282
|
+
$('body').on('click', '.digg_link', function(e){
|
|
283
|
+
var $that = $(this);
|
|
284
|
+
if($that.attr("data-id")){
|
|
285
|
+
$.ajax({
|
|
286
|
+
url: maccms.path + '/index.php/ajax/digg.html?mid='+$that.attr("data-mid")+'&id='+$that.attr("data-id")+'&type='+$that.attr("data-type"),
|
|
287
|
+
cache: false,
|
|
288
|
+
dataType: 'json',
|
|
289
|
+
success: function($r){
|
|
290
|
+
$that.addClass('disabled');
|
|
291
|
+
if($r.code == 1){
|
|
292
|
+
if($that.attr("data-type")=='up'){
|
|
293
|
+
$that.find('.digg_num').html($r.data.up);
|
|
294
|
+
}
|
|
295
|
+
else{
|
|
296
|
+
$that.find('.digg_num').html($r.data.down);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
else{
|
|
300
|
+
alert($r.msg);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
'Gbook':{
|
|
309
|
+
'Login':0,
|
|
310
|
+
'Verify':0,
|
|
311
|
+
'Init':function(){
|
|
312
|
+
$('body').on('keyup', '.gbook_content', function(e){
|
|
313
|
+
MAC.Remaining($(this),200,'.gbook_remaining')
|
|
314
|
+
});
|
|
315
|
+
$('body').on('focus', '.gbook_content', function(e){
|
|
316
|
+
if(MAC.Gbook.Login==1 && MAC.User.IsLogin!=1){
|
|
317
|
+
MAC.User.Login();
|
|
318
|
+
}
|
|
319
|
+
});
|
|
320
|
+
$('body').on('click', '.gbook_submit', function(e){
|
|
321
|
+
MAC.Gbook.Submit();
|
|
322
|
+
});
|
|
323
|
+
},
|
|
324
|
+
'Show':function($page){
|
|
325
|
+
$.ajax({
|
|
326
|
+
type: 'post',
|
|
327
|
+
url: maccms.path+'/index.php/gbook/index?page='+$page,
|
|
328
|
+
timeout: 3000,
|
|
329
|
+
error: function(){
|
|
330
|
+
$(".mac_gbook_box").html('留言加载失败,请刷新...');
|
|
331
|
+
},
|
|
332
|
+
success:function($html){
|
|
333
|
+
$(".mac_gbook_box").html($html);
|
|
334
|
+
}
|
|
335
|
+
});
|
|
336
|
+
},
|
|
337
|
+
'Submit':function(){
|
|
338
|
+
if($(".gbook_content").val() == ''){
|
|
339
|
+
alert("请输入留言内容");
|
|
340
|
+
return false;
|
|
341
|
+
}
|
|
342
|
+
$.ajax({
|
|
343
|
+
type: 'post',
|
|
344
|
+
url: maccms.path + '/index.php/gbook/saveData',
|
|
345
|
+
data: $('.gbook_form').serialize(),
|
|
346
|
+
success:function($r){
|
|
347
|
+
alert($r.msg);
|
|
348
|
+
if($r.code == 1){
|
|
349
|
+
location.reload();
|
|
350
|
+
}
|
|
351
|
+
else{
|
|
352
|
+
if(MAC.Gbook.Verify==1){
|
|
353
|
+
MAC.Verify.Refresh();
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
});
|
|
358
|
+
},
|
|
359
|
+
'Report':function(name){
|
|
360
|
+
MAC.Pop.Show('#modal-seport',maccms.path+'/index.php/gbook/report?name=' + encodeURIComponent(name),function($r){
|
|
361
|
+
$('body').on('click', '#gbook_submit', function(e){
|
|
362
|
+
MAC.Gbook.Submit();
|
|
363
|
+
});
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
},
|
|
367
|
+
'Search':{
|
|
368
|
+
'Init':function(){
|
|
369
|
+
$('.mac_search').click(function(){
|
|
370
|
+
var that=$(this);
|
|
371
|
+
var url = that.attr('data-href') ? that.attr('data-href') : maccms.path + '/index.php/vod/search.html';
|
|
372
|
+
location.href = url + '?wd='+ encodeURIComponent($("#wd").val());
|
|
373
|
+
});
|
|
374
|
+
},
|
|
375
|
+
'Submit':function(){
|
|
376
|
+
|
|
377
|
+
return false;
|
|
378
|
+
}
|
|
379
|
+
},
|
|
380
|
+
'Suggest':{
|
|
381
|
+
'Init':function($obj,$mid,$jumpurl){
|
|
382
|
+
try {
|
|
383
|
+
$($obj).autocomplete(maccms.path + '/index.php/ajax/suggest?mid=' + $mid, {
|
|
384
|
+
inputClass: "mac_input",
|
|
385
|
+
resultsClass: "mac_results",
|
|
386
|
+
loadingClass: "mac_loading",
|
|
387
|
+
width: 175, scrollHeight: 300, minChars: 1, matchSubset: 1,
|
|
388
|
+
cacheLength: 10, multiple: false, matchContains: true, autoFill: false,
|
|
389
|
+
dataType: "json",
|
|
390
|
+
parse: function ($r) {
|
|
391
|
+
if ($r.code == 1) {
|
|
392
|
+
var parsed = [];
|
|
393
|
+
$.each($r['list'], function (index, row) {
|
|
394
|
+
row.url = $r.url;
|
|
395
|
+
parsed[index] = {
|
|
396
|
+
data: row
|
|
397
|
+
};
|
|
398
|
+
});
|
|
399
|
+
return parsed;
|
|
400
|
+
} else {
|
|
401
|
+
return {data: ''};
|
|
402
|
+
}
|
|
403
|
+
},
|
|
404
|
+
formatItem: function (row, i, max) {
|
|
405
|
+
return row.name;
|
|
406
|
+
},
|
|
407
|
+
formatResult: function (row, i, max) {
|
|
408
|
+
return row.text;
|
|
409
|
+
}
|
|
410
|
+
}).result(function (event, data, formatted) {
|
|
411
|
+
$($obj).val(data.name);
|
|
412
|
+
location.href = data.url.replace('mac_wd', encodeURIComponent(data.name));
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
catch(e){}
|
|
416
|
+
}
|
|
417
|
+
},
|
|
418
|
+
'Ulog':{
|
|
419
|
+
'Init':function(){
|
|
420
|
+
MAC.Ulog.Set();
|
|
421
|
+
MAC.Ulog.Click();
|
|
422
|
+
|
|
423
|
+
},
|
|
424
|
+
'Get':function(){
|
|
425
|
+
$.ajax({
|
|
426
|
+
url: maccms.path+'/index.php/user/ajax_ulog/?ac=list',
|
|
427
|
+
type:'GET',
|
|
428
|
+
cache: false,
|
|
429
|
+
dataType: 'json',
|
|
430
|
+
success: function($r){
|
|
431
|
+
if($r.code == 1){
|
|
432
|
+
$.each($r['list'],function(index,row){
|
|
433
|
+
alert(row.ulog_id);
|
|
434
|
+
});
|
|
435
|
+
}else{
|
|
436
|
+
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
});
|
|
440
|
+
},
|
|
441
|
+
'Set':function(){
|
|
442
|
+
if($(".mac_ulog_set").attr('data-mid')){
|
|
443
|
+
var $that = $(".mac_ulog_set");
|
|
444
|
+
$.get(maccms.path+'/index.php/user/ajax_ulog/?ac=set&mid='+$that.attr("data-mid")+'&id='+$that.attr("data-id")+'&sid='+$that.attr("data-sid")+'&nid='+$that.attr("data-nid")+'&type='+$that.attr("data-type"));
|
|
445
|
+
}
|
|
446
|
+
},
|
|
447
|
+
'Click':function(){
|
|
448
|
+
$('body').on('click', 'a.mac_ulog', function(e){
|
|
449
|
+
//是否需要验证登录
|
|
450
|
+
if(MAC.User.IsLogin == 0){
|
|
451
|
+
MAC.User.Login();
|
|
452
|
+
return;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
var $that = $(this);
|
|
456
|
+
if($that.attr("data-id")){
|
|
457
|
+
$.ajax({
|
|
458
|
+
url: maccms.path+'/index.php/user/ajax_ulog/?ac=set&mid='+$that.attr("data-mid")+'&id='+$that.attr("data-id")+'&type='+$that.attr("data-type"),
|
|
459
|
+
cache: false,
|
|
460
|
+
dataType: 'json',
|
|
461
|
+
success: function($r){
|
|
462
|
+
alert($r.msg);
|
|
463
|
+
if($r.code == 1){
|
|
464
|
+
$that.addClass('disabled');
|
|
465
|
+
}else{
|
|
466
|
+
$that.attr('title', $r.msg);
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
});
|
|
470
|
+
}
|
|
471
|
+
});
|
|
472
|
+
}
|
|
473
|
+
},
|
|
474
|
+
'User':{
|
|
475
|
+
'BoxShow':0,
|
|
476
|
+
'IsLogin':0,
|
|
477
|
+
'UserId':'',
|
|
478
|
+
'UserName':'',
|
|
479
|
+
'GroupId':'',
|
|
480
|
+
'GroupName':'',
|
|
481
|
+
'Portrait':'',
|
|
482
|
+
'Init':function(){
|
|
483
|
+
if($('.mac_user').length >0){
|
|
484
|
+
$('body').on('click', '.mac_user', function(e){
|
|
485
|
+
MAC.User.Login();
|
|
486
|
+
});
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
if(MAC.Cookie.Get('user_id') !=undefined && MAC.Cookie.Get('user_id')!=''){
|
|
490
|
+
var url = maccms.path + '/index.php/user';
|
|
491
|
+
MAC.User.UserId = MAC.Cookie.Get('user_id');
|
|
492
|
+
MAC.User.UserName = MAC.Cookie.Get('user_name');
|
|
493
|
+
MAC.User.GroupId = MAC.Cookie.Get('group_id');
|
|
494
|
+
MAC.User.GroupName = MAC.Cookie.Get('group_name');
|
|
495
|
+
MAC.User.Portrait = MAC.Cookie.Get('user_portrait');
|
|
496
|
+
MAC.User.IsLogin = 1;
|
|
497
|
+
|
|
498
|
+
$('.mac_user').removeClass('mac_user').attr('href',url);
|
|
499
|
+
|
|
500
|
+
$('.user_name').show().find('.name').text(MAC.User.UserName);
|
|
501
|
+
|
|
502
|
+
$('.user_url').show().attr('href',url);
|
|
503
|
+
|
|
504
|
+
$('.user_img').show().attr('src',MAC.User.Portrait);
|
|
505
|
+
}
|
|
506
|
+
else{
|
|
507
|
+
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
},
|
|
511
|
+
'CheckLogin':function(){
|
|
512
|
+
if(MAC.User.IsLogin == 0){
|
|
513
|
+
MAC.User.Login();
|
|
514
|
+
}
|
|
515
|
+
},
|
|
516
|
+
'Login':function(){
|
|
517
|
+
var ac='ajax_login';
|
|
518
|
+
if(MAC.Cookie.Get('user_id') !=undefined && MAC.Cookie.Get('user_id')!=''){
|
|
519
|
+
ac= 'ajax_info';
|
|
520
|
+
}
|
|
521
|
+
MAC.Pop.Show('#modal-login',maccms.path+'/index.php/user/'+ac,function($r){
|
|
522
|
+
$('body').on('click', '#login_form_submit', function(e){
|
|
523
|
+
$.ajax({
|
|
524
|
+
type: 'POST',
|
|
525
|
+
url: maccms.path + '/index.php/user/login',
|
|
526
|
+
data: $('.mac_login_form').serialize(),
|
|
527
|
+
success:function($r){
|
|
528
|
+
alert($r.msg)
|
|
529
|
+
if($r.code == 1){
|
|
530
|
+
location.reload();
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
});
|
|
534
|
+
});
|
|
535
|
+
});
|
|
536
|
+
},
|
|
537
|
+
'Logout':function(){
|
|
538
|
+
$.ajax({
|
|
539
|
+
type: 'post',
|
|
540
|
+
url: maccms.path + '/index.php/user/logout',
|
|
541
|
+
success:function($r){
|
|
542
|
+
alert($r.msg)
|
|
543
|
+
if($r.code == 1){
|
|
544
|
+
location.reload();
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
});
|
|
548
|
+
},
|
|
549
|
+
'PopedomCallBack':function(trysee,h) {
|
|
550
|
+
window.setTimeout(function(){
|
|
551
|
+
$(window.frames["player_if"].document).find(".MacPlayer").html(h);
|
|
552
|
+
},1000*60*trysee);
|
|
553
|
+
},
|
|
554
|
+
'BuyPopedom':function(o){
|
|
555
|
+
var $that = $(o);
|
|
556
|
+
if($that.attr("data-id")){
|
|
557
|
+
if (confirm('您确认购买此条数据播放权限吗?')) {
|
|
558
|
+
$.ajax({
|
|
559
|
+
url: maccms.path + '/index.php/user/ajax_buy_popedom.html?id=' + $that.attr("data-id") + '&mid=' + $that.attr("data-mid") + '&sid=' + $that.attr("data-sid") + '&nid=' + $that.attr("data-nid") + '&type=' + $that.attr("data-type"),
|
|
560
|
+
cache: false,
|
|
561
|
+
dataType: 'json',
|
|
562
|
+
success: function ($r) {
|
|
563
|
+
$that.addClass('disabled');
|
|
564
|
+
alert($r.msg)
|
|
565
|
+
if ($r.code == 1) {
|
|
566
|
+
top.location.reload();
|
|
567
|
+
}
|
|
568
|
+
},
|
|
569
|
+
complete: function () {
|
|
570
|
+
$that.removeClass('disabled');
|
|
571
|
+
}
|
|
572
|
+
});
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
},
|
|
577
|
+
'Pop':{
|
|
578
|
+
'Show':function($modalid,$url,$callback) {
|
|
579
|
+
$.ajax({
|
|
580
|
+
type: 'post',
|
|
581
|
+
url: $url,
|
|
582
|
+
timeout: 3000,
|
|
583
|
+
error: function(){
|
|
584
|
+
$('body').append(alert("加载失败,请刷新"));
|
|
585
|
+
},
|
|
586
|
+
success:function($r){
|
|
587
|
+
$('body').append($r);
|
|
588
|
+
$($modalid).modal('show');
|
|
589
|
+
$('.MacPlayer').hide();
|
|
590
|
+
$($modalid).on('hide.bs.modal', function () {
|
|
591
|
+
$('.MacPlayer').show();
|
|
592
|
+
})
|
|
593
|
+
$callback($r);
|
|
594
|
+
}
|
|
595
|
+
});
|
|
596
|
+
}
|
|
597
|
+
},
|
|
598
|
+
'AdsWrap':function(w,h,n){
|
|
599
|
+
document.writeln('<img width="'+w+'" height="'+h+'" alt="'+n+'" style="background-color: #CCCCCC" />');
|
|
600
|
+
},
|
|
601
|
+
'Css':function($url){
|
|
602
|
+
$("<link>").attr({ rel: "stylesheet",type: "text/css",href: $url}).appendTo("head");
|
|
603
|
+
},
|
|
604
|
+
'Js':function($url){
|
|
605
|
+
$.getScript($url, function(response, status) {
|
|
606
|
+
|
|
607
|
+
});
|
|
608
|
+
},
|
|
609
|
+
'Desktop':function(s){
|
|
610
|
+
location.href= maccms.path + '/index.php/ajax/desktop?name='+encodeURI(s)+'&url=' + encodeURI(location.href);
|
|
611
|
+
},
|
|
612
|
+
'Timming':function(){
|
|
613
|
+
|
|
614
|
+
},
|
|
615
|
+
'Error':function(tab,id,name){
|
|
616
|
+
|
|
617
|
+
},
|
|
618
|
+
'AddEm':function(obj,i){
|
|
619
|
+
var oldtext = $(obj).val();
|
|
620
|
+
$(obj).val( oldtext + '[em:' + i +']' );
|
|
621
|
+
},
|
|
622
|
+
'Remaining':function(obj,len,show){
|
|
623
|
+
var count = len - $(obj).val().length;
|
|
624
|
+
if(count < 0){
|
|
625
|
+
count = 0;
|
|
626
|
+
$(obj).val($(obj).val().substr(0,200));
|
|
627
|
+
}
|
|
628
|
+
$(show).text(count);
|
|
629
|
+
},
|
|
630
|
+
'Comment':{
|
|
631
|
+
'Login':0,
|
|
632
|
+
'Verify':0,
|
|
633
|
+
'Init':function(){
|
|
634
|
+
|
|
635
|
+
$('body').on('click', '.comment_face_box img', function(e){
|
|
636
|
+
var obj = $(this).parent().parent().parent().find('.comment_content');
|
|
637
|
+
MAC.AddEm(obj,$(this).attr('data-id'));
|
|
638
|
+
});
|
|
639
|
+
$('body').on('click', '.comment_face_panel', function(e){
|
|
640
|
+
// $('.comment_face_box').toggle();
|
|
641
|
+
$(this).parent().find('.comment_face_box').toggle();
|
|
642
|
+
});
|
|
643
|
+
$('body').on('keyup', '.comment_content', function(e){
|
|
644
|
+
var obj = $(this).parent().parent().parent().parent().find('.comment_remaining');
|
|
645
|
+
MAC.Remaining($(this),200,obj)
|
|
646
|
+
});
|
|
647
|
+
$('body').on('focus', '.comment_content', function(e){
|
|
648
|
+
if(MAC.Comment.Login==1 && MAC.User.IsLogin!=1){
|
|
649
|
+
MAC.User.Login();
|
|
650
|
+
}
|
|
651
|
+
});
|
|
652
|
+
|
|
653
|
+
$('body').on('click', '.comment_report', function(e){
|
|
654
|
+
var $that = $(this);
|
|
655
|
+
if($(this).attr("data-id")){
|
|
656
|
+
$.ajax({
|
|
657
|
+
url: maccms.path + '/index.php/comment/report.html?id='+$that.attr("data-id"),
|
|
658
|
+
cache: false,
|
|
659
|
+
dataType: 'json',
|
|
660
|
+
success: function($r){
|
|
661
|
+
$that.addClass('disabled');
|
|
662
|
+
alert($r.msg)
|
|
663
|
+
if($r.code == 1){
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
});
|
|
667
|
+
}
|
|
668
|
+
});
|
|
669
|
+
|
|
670
|
+
$('body').on('click', '.comment_reply', function(e){
|
|
671
|
+
var $that = $(this);
|
|
672
|
+
if($that.attr("data-id")){
|
|
673
|
+
var str = $that.html();
|
|
674
|
+
$('.comment_reply_form').remove();
|
|
675
|
+
if (str == '取消回复') {
|
|
676
|
+
$that.html('回复');
|
|
677
|
+
return false;
|
|
678
|
+
}
|
|
679
|
+
if (str == '回复') {
|
|
680
|
+
$('.comment_reply').html('回复');
|
|
681
|
+
}
|
|
682
|
+
var html = $('.comment_form').prop("outerHTML");
|
|
683
|
+
|
|
684
|
+
var oo = $(html);
|
|
685
|
+
oo.addClass('comment_reply_form');
|
|
686
|
+
oo.find('input[name="comment_pid"]').val( $that.attr("data-id") );
|
|
687
|
+
|
|
688
|
+
$that.parent().after(oo);
|
|
689
|
+
$that.html('取消回复');
|
|
690
|
+
}
|
|
691
|
+
});
|
|
692
|
+
|
|
693
|
+
$('body').on('click', '.comment_submit', function(e){
|
|
694
|
+
var $that = $(this);
|
|
695
|
+
MAC.Comment.Submit($that);
|
|
696
|
+
});
|
|
697
|
+
|
|
698
|
+
},
|
|
699
|
+
'Show':function($page){
|
|
700
|
+
if($(".mac_comment").length>0){
|
|
701
|
+
$.ajax({
|
|
702
|
+
type: 'get',
|
|
703
|
+
url: maccms.path + '/index.php/comment/ajax.html?rid='+$('.mac_comment').attr('data-id')+'&mid='+ $('.mac_comment').attr('data-mid') +'&page='+$page,
|
|
704
|
+
timeout: 5000,
|
|
705
|
+
error: function(){
|
|
706
|
+
$(".mac_comment").html('评论加载失败,请刷新...');
|
|
707
|
+
},
|
|
708
|
+
success:function($r){
|
|
709
|
+
$(".mac_comment").html($r);
|
|
710
|
+
}
|
|
711
|
+
});
|
|
712
|
+
}
|
|
713
|
+
},
|
|
714
|
+
'Reply':function($o){
|
|
715
|
+
|
|
716
|
+
},
|
|
717
|
+
'Submit':function($o){
|
|
718
|
+
var form = $o.parents('form');
|
|
719
|
+
if($(form).find(".comment_content").val() == ''){
|
|
720
|
+
alert("请输入您的评论!")
|
|
721
|
+
return false;
|
|
722
|
+
}
|
|
723
|
+
if($('.mac_comment').attr('data-mid') == ''){
|
|
724
|
+
alert("模块mid错误!")
|
|
725
|
+
return false;
|
|
726
|
+
}
|
|
727
|
+
if($('.mac_comment').attr('data-id') == ''){
|
|
728
|
+
alert("关联id错误!")
|
|
729
|
+
return false;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
$.ajax({
|
|
733
|
+
type: 'post',
|
|
734
|
+
url: maccms.path + '/index.php/comment/saveData',
|
|
735
|
+
data: $(form).serialize() + '&comment_mid='+ $('.mac_comment').attr('data-mid') + '&comment_rid=' + $('.mac_comment').attr('data-id'),
|
|
736
|
+
success:function($r){
|
|
737
|
+
alert($r.msg)
|
|
738
|
+
if($r.code == 1){
|
|
739
|
+
MAC.Comment.Show(1);
|
|
740
|
+
}
|
|
741
|
+
else{
|
|
742
|
+
if(MAC.Comment.Verify==1){
|
|
743
|
+
MAC.Verify.Refresh();
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
});
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
$(function(){
|
|
753
|
+
//自动跳转手机和pc网页地址
|
|
754
|
+
MAC.Adaptive();
|
|
755
|
+
//验证码初始化
|
|
756
|
+
MAC.Verify.Init();
|
|
757
|
+
//分页跳转初始化
|
|
758
|
+
MAC.PageGo.Init();
|
|
759
|
+
//用户部分初始化
|
|
760
|
+
MAC.User.Init();
|
|
761
|
+
//顶和踩初始化
|
|
762
|
+
MAC.Digg.Init();
|
|
763
|
+
//评分初始化
|
|
764
|
+
MAC.Score.Init();
|
|
765
|
+
//星星评分初始化
|
|
766
|
+
MAC.Star.Init();
|
|
767
|
+
//点击数量
|
|
768
|
+
MAC.Hits.Init();
|
|
769
|
+
//历史记录初始化
|
|
770
|
+
MAC.Ulog.Init();
|
|
771
|
+
//联想搜索初始化
|
|
772
|
+
MAC.Suggest.Init('.mac_wd',1,'');
|
|
773
|
+
//定时任务初始化
|
|
774
|
+
MAC.Timming();
|
|
775
|
+
});
|