byteoss 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- 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,936 @@
|
|
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='+maccms.path+'"images/_clipboard.swf" FlashVars="clipboard='+escape(s)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>');
|
29
|
+
}
|
30
|
+
MAC.Pop.Msg(100,20,'复制成功',1000);
|
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){ MAC.Pop.Msg(150,40,'此操作被浏览器拒绝!请手动设置',1000); }
|
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){ MAC.Pop.Msg(150,40,'加入收藏出错,请使用键盘Ctrl+D进行添加',1000); }
|
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 ="//"+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
|
+
'Ajax':function(url,type,dataType,data,sfun,efun,cfun){
|
118
|
+
type=type||'get';
|
119
|
+
dataType=dataType||'json';
|
120
|
+
data=data||'';
|
121
|
+
efun=efun||'';
|
122
|
+
cfun=cfun||'';
|
123
|
+
|
124
|
+
$.ajax({
|
125
|
+
url:url,
|
126
|
+
type:type,
|
127
|
+
dataType:dataType,
|
128
|
+
data:data,
|
129
|
+
timeout: 5000,
|
130
|
+
beforeSend:function(XHR){
|
131
|
+
|
132
|
+
},
|
133
|
+
error:function(XHR,textStatus,errorThrown){
|
134
|
+
if(efun) efun(XHR,textStatus,errorThrown);
|
135
|
+
},
|
136
|
+
success:function(data){
|
137
|
+
sfun(data);
|
138
|
+
},
|
139
|
+
complete:function(XHR, TS){
|
140
|
+
if(cfun) cfun(XHR, TS);
|
141
|
+
}
|
142
|
+
})
|
143
|
+
},
|
144
|
+
'Qrcode':{
|
145
|
+
'Init':function(){
|
146
|
+
$('.mac_qrcode').attr('src', maccms.path +'/index.php/qrcode/index.html?url='+ MAC.Url);
|
147
|
+
}
|
148
|
+
},
|
149
|
+
'Shorten': {
|
150
|
+
'Init':function(){
|
151
|
+
if($('.mac_shorten').length==0){
|
152
|
+
return;
|
153
|
+
}
|
154
|
+
MAC.Shorten.Get();
|
155
|
+
},
|
156
|
+
'Get':function(url,call){
|
157
|
+
url=url||location.href;
|
158
|
+
MAC.Ajax('//api.maccms.la/shorten/index/url/'+ encodeURIComponent(url),'get','jsonp','',function(r){
|
159
|
+
if (r.code == 1) {
|
160
|
+
if($('.mac_shorten').length>0) {
|
161
|
+
$('.mac_shorten').val(r.data.url_short);
|
162
|
+
$('.mac_shorten').html(r.data.url_short);
|
163
|
+
}
|
164
|
+
if(call){
|
165
|
+
call(r);
|
166
|
+
}
|
167
|
+
|
168
|
+
}
|
169
|
+
});
|
170
|
+
}
|
171
|
+
},
|
172
|
+
'Image':{
|
173
|
+
'Lazyload':{
|
174
|
+
'Show': function(){
|
175
|
+
try { $("img.lazy").lazyload(); }catch(e){};
|
176
|
+
},
|
177
|
+
'Box': function($id){
|
178
|
+
$("img.lazy").lazyload({
|
179
|
+
container: $("#"+$id)
|
180
|
+
});
|
181
|
+
}
|
182
|
+
}
|
183
|
+
},
|
184
|
+
'Verify': {
|
185
|
+
'Init': function(){
|
186
|
+
MAC.Verify.Focus();
|
187
|
+
MAC.Verify.Click();
|
188
|
+
},
|
189
|
+
'Focus': function(){//验证码框焦点
|
190
|
+
$('body').on("focus", ".mac_verify", function(){
|
191
|
+
$(this).removeClass('mac_verify').after(MAC.Verify.Show());
|
192
|
+
$(this).unbind();
|
193
|
+
});
|
194
|
+
},
|
195
|
+
'Click': function(){//点击刷新
|
196
|
+
$('body').on('click', 'img.mac_verify_img', function(){
|
197
|
+
$(this).attr('src', maccms.path +'/index.php/verify/index.html?r='+Math.random());
|
198
|
+
});
|
199
|
+
},
|
200
|
+
'Refresh':function(){
|
201
|
+
$('.mac_verify_img').attr('src', maccms.path +'/index.php/verify/index.html?r='+Math.random());
|
202
|
+
},
|
203
|
+
'Show':function(){
|
204
|
+
return '<img class="mac_verify_img" src="'+ maccms.path +'/index.php/verify/index.html?" title="看不清楚? 换一张!">';
|
205
|
+
}
|
206
|
+
},
|
207
|
+
'PageGo':{
|
208
|
+
'Init':function() {
|
209
|
+
$('.mac_page_go').click(function () {
|
210
|
+
var that =$(this);
|
211
|
+
var url = that.attr('data-url');
|
212
|
+
var total = parseInt(that.attr('data-total'));
|
213
|
+
var sp = that.attr('data-sp');
|
214
|
+
var page= parseInt($('#page').val());
|
215
|
+
|
216
|
+
if(page>0&&(page<=total)){
|
217
|
+
url=url.replace(sp + 'PAGELINK',sp + page).replace('PAGELINK',page);
|
218
|
+
location.href=url;
|
219
|
+
}
|
220
|
+
return false;
|
221
|
+
});
|
222
|
+
}
|
223
|
+
},
|
224
|
+
'Hits': {
|
225
|
+
'Init':function() {
|
226
|
+
if($('.mac_hits').length==0){
|
227
|
+
return;
|
228
|
+
}
|
229
|
+
var $that = $(".mac_hits");
|
230
|
+
|
231
|
+
MAC.Ajax(maccms.path + '/index.php/ajax/hits?mid='+$that.attr("data-mid")+'&id='+$that.attr("data-id")+'&type=update','get','json','',function(r){
|
232
|
+
if (r.code == 1) {
|
233
|
+
$(".mac_hits").each(function(i){
|
234
|
+
$type = $(".mac_hits").eq(i).attr('data-type');
|
235
|
+
if($type != 'insert'){
|
236
|
+
$('.'+$type).html(eval('(r.data.' + $type + ')'));
|
237
|
+
}
|
238
|
+
});
|
239
|
+
}
|
240
|
+
});
|
241
|
+
|
242
|
+
}
|
243
|
+
},
|
244
|
+
'Score': {
|
245
|
+
'Init':function(){
|
246
|
+
if($('.mac_score').length==0){
|
247
|
+
return;
|
248
|
+
}
|
249
|
+
$('body').on('click', '.score_btn', function(e){
|
250
|
+
MAC.Score.Submit();
|
251
|
+
});
|
252
|
+
|
253
|
+
MAC.Ajax(maccms.path+'/index.php/ajax/score?mid='+ $('.mac_score').attr('data-mid') +'&id=' +$('.mac_score').attr('data-id'),'post','json','',function(r){
|
254
|
+
MAC.Score.View(r);
|
255
|
+
},function(){
|
256
|
+
$(".mac_score").html('评分加载失败');
|
257
|
+
});
|
258
|
+
|
259
|
+
},
|
260
|
+
'Submit':function(){
|
261
|
+
var $s = $('.mac_score').find("input[name='score']").val();
|
262
|
+
MAC.Ajax(maccms.path+'/index.php/ajax/score?mid='+$('.mac_score').attr('data-mid')+'&id='+$('.mac_score').attr('data-id') + '&score='+ $s,'get','json','',function(r){
|
263
|
+
MAC.Pop.Msg(100,20,r.msg,1000);
|
264
|
+
if(r.code==1){
|
265
|
+
MAC.Score.View(r);
|
266
|
+
}
|
267
|
+
});
|
268
|
+
},
|
269
|
+
'View':function(r){
|
270
|
+
$(".rating"+Math.floor(r.data.score)).attr('checked',true);
|
271
|
+
$(".score_num").text(r.data.score_num);
|
272
|
+
$(".score_all").text(r.data.score_all);
|
273
|
+
$(".score_pjf").text(r.data.score);
|
274
|
+
}
|
275
|
+
},
|
276
|
+
'Star': {
|
277
|
+
'Init':function(){
|
278
|
+
if($('.mac_star').length==0){
|
279
|
+
return;
|
280
|
+
}
|
281
|
+
|
282
|
+
$('.mac_star').raty({
|
283
|
+
starType: 'i',
|
284
|
+
number: 5,
|
285
|
+
numberMax : 5,
|
286
|
+
half: true,
|
287
|
+
score : function(){
|
288
|
+
return $(this).attr('data-score');
|
289
|
+
},
|
290
|
+
click: function(score, evt) {
|
291
|
+
|
292
|
+
MAC.Ajax(maccms.path+'/index.php/ajax/score?mid='+$('.mac_star').attr('data-mid')+'&id='+$('.mac_star').attr('data-id')+'&score='+(score*2),'get','json','',function(r){
|
293
|
+
if(json.status == 1){
|
294
|
+
$('.star_tips').html(r.data.score);
|
295
|
+
}else{
|
296
|
+
$('.star_box').attr('title', r.msg);
|
297
|
+
}
|
298
|
+
},function(){
|
299
|
+
$('.star_box').attr('title', '网络异常!');
|
300
|
+
});
|
301
|
+
|
302
|
+
}
|
303
|
+
});
|
304
|
+
}
|
305
|
+
},
|
306
|
+
'Digg': {
|
307
|
+
'Init':function(){
|
308
|
+
$('body').on('click', '.digg_link', function(e){
|
309
|
+
var $that = $(this);
|
310
|
+
if($that.attr("data-id")){
|
311
|
+
|
312
|
+
MAC.Ajax(maccms.path + '/index.php/ajax/digg.html?mid='+$that.attr("data-mid")+'&id='+$that.attr("data-id")+'&type='+$that.attr("data-type"),'get','json','',function(r){
|
313
|
+
$that.addClass('disabled');
|
314
|
+
if(r.code == 1){
|
315
|
+
if($that.attr("data-type")=='up'){
|
316
|
+
$that.find('.digg_num').html(r.data.up);
|
317
|
+
}
|
318
|
+
else{
|
319
|
+
$that.find('.digg_num').html(r.data.down);
|
320
|
+
}
|
321
|
+
}
|
322
|
+
else{
|
323
|
+
$that.attr('title', r.msg);
|
324
|
+
}
|
325
|
+
});
|
326
|
+
|
327
|
+
}
|
328
|
+
});
|
329
|
+
}
|
330
|
+
},
|
331
|
+
'Gbook':{
|
332
|
+
'Login':0,
|
333
|
+
'Verify':0,
|
334
|
+
'Init':function(){
|
335
|
+
$('body').on('keyup', '.gbook_content', function(e){
|
336
|
+
MAC.Remaining($(this),200,'.gbook_remaining')
|
337
|
+
});
|
338
|
+
$('body').on('focus', '.gbook_content', function(e){
|
339
|
+
if(MAC.Gbook.Login==1 && MAC.User.IsLogin!=1){
|
340
|
+
MAC.User.Login();
|
341
|
+
}
|
342
|
+
});
|
343
|
+
$('body').on('click', '.gbook_submit', function(e){
|
344
|
+
MAC.Gbook.Submit();
|
345
|
+
});
|
346
|
+
},
|
347
|
+
'Show':function($page){
|
348
|
+
MAC.Ajax(maccms.path+'/index.php/gbook/index?page='+$page,'post','json','',function(r){
|
349
|
+
$(".mac_gbook_box").html(r);
|
350
|
+
},function(){
|
351
|
+
$(".mac_gbook_box").html('留言加载失败,请刷新...');
|
352
|
+
});
|
353
|
+
},
|
354
|
+
'Submit':function(){
|
355
|
+
if($(".gbook_content").val() == ''){
|
356
|
+
MAC.Pop.Msg(100,20,'请输入您的留言!',1000);
|
357
|
+
return false;
|
358
|
+
}
|
359
|
+
MAC.Ajax(maccms.path + '/index.php/gbook/saveData','post','json',$('.gbook_form').serialize(),function(r){
|
360
|
+
MAC.Pop.Msg(100,20,r.msg,1000);
|
361
|
+
if(r.code == 1){
|
362
|
+
location.reload();
|
363
|
+
}
|
364
|
+
else{
|
365
|
+
if(MAC.Gbook.Verify==1){
|
366
|
+
MAC.Verify.Refresh();
|
367
|
+
}
|
368
|
+
}
|
369
|
+
});
|
370
|
+
},
|
371
|
+
'Report':function(name,id){
|
372
|
+
MAC.Pop.Show(400,300,'数据报错',maccms.path+'/index.php/gbook/report.html?id='+id+'&name='+ encodeURIComponent(name),function(r){
|
373
|
+
|
374
|
+
});
|
375
|
+
}
|
376
|
+
},
|
377
|
+
'Search':{
|
378
|
+
'Init':function(){
|
379
|
+
$('.mac_search').click(function(){
|
380
|
+
var that=$(this);
|
381
|
+
var url = that.attr('data-href') ? that.attr('data-href') : maccms.path + '/index.php/vod/search.html';
|
382
|
+
location.href = url + '?wd='+ encodeURIComponent($("#wd").val());
|
383
|
+
});
|
384
|
+
},
|
385
|
+
'Submit':function(){
|
386
|
+
|
387
|
+
return false;
|
388
|
+
}
|
389
|
+
},
|
390
|
+
'Suggest':{
|
391
|
+
'Init':function($obj,$mid,$jumpurl){
|
392
|
+
try {
|
393
|
+
$($obj).autocomplete(maccms.path + '/index.php/ajax/suggest?mid=' + $mid, {
|
394
|
+
inputClass: "mac_input",
|
395
|
+
resultsClass: "mac_results",
|
396
|
+
loadingClass: "mac_loading",
|
397
|
+
width: 175, scrollHeight: 300, minChars: 1, matchSubset: 0,
|
398
|
+
cacheLength: 10, multiple: false, matchContains: true, autoFill: false,
|
399
|
+
dataType: "json",
|
400
|
+
parse: function (r) {
|
401
|
+
if (r.code == 1) {
|
402
|
+
var parsed = [];
|
403
|
+
$.each(r['list'], function (index, row) {
|
404
|
+
row.url = r.url;
|
405
|
+
parsed[index] = {
|
406
|
+
data: row
|
407
|
+
};
|
408
|
+
});
|
409
|
+
return parsed;
|
410
|
+
} else {
|
411
|
+
return {data: ''};
|
412
|
+
}
|
413
|
+
},
|
414
|
+
formatItem: function (row, i, max) {
|
415
|
+
return row.name;
|
416
|
+
},
|
417
|
+
formatResult: function (row, i, max) {
|
418
|
+
return row.text;
|
419
|
+
}
|
420
|
+
}).result(function (event, data, formatted) {
|
421
|
+
$($obj).val(data.name);
|
422
|
+
location.href = data.url.replace('mac_wd', encodeURIComponent(data.name));
|
423
|
+
});
|
424
|
+
}
|
425
|
+
catch(e){}
|
426
|
+
}
|
427
|
+
},
|
428
|
+
'History': {
|
429
|
+
'BoxShow':0,
|
430
|
+
'Limit':10,
|
431
|
+
'Days':7,
|
432
|
+
'Json':'',
|
433
|
+
'Init':function(){
|
434
|
+
if($('.mac_history').length ==0){
|
435
|
+
return;
|
436
|
+
}
|
437
|
+
|
438
|
+
$('.mac_history').hover(function(e){
|
439
|
+
$('.mac_history_box').show();
|
440
|
+
}, function(){
|
441
|
+
$('.mac_history_box').hover(function(){
|
442
|
+
MAC.History.BoxShow=1;
|
443
|
+
}, function(){
|
444
|
+
MAC.History.BoxShow=0;
|
445
|
+
$('.mac_history_box').hide();
|
446
|
+
});
|
447
|
+
});
|
448
|
+
|
449
|
+
var jsondata = [];
|
450
|
+
if(this.Json){
|
451
|
+
jsondata = this.Json;
|
452
|
+
}else{
|
453
|
+
var jsonstr = MAC.Cookie.Get('mac_history');
|
454
|
+
if(jsonstr != undefined){
|
455
|
+
jsondata = eval(jsonstr);
|
456
|
+
}
|
457
|
+
}
|
458
|
+
|
459
|
+
html = '<dl class="mac_drop_box mac_history_box" style="display:none;">';
|
460
|
+
html +='<dt><a target="_self" href="javascript:void(0)" onclick="MAC.History.Clear();">清空</a></dt>';
|
461
|
+
|
462
|
+
if(jsondata.length > 0){
|
463
|
+
for($i=0; $i<jsondata.length; $i++){
|
464
|
+
if($i%2==1){
|
465
|
+
html +='<dd class="odd">';
|
466
|
+
}else{
|
467
|
+
html +='<dd class="even">';
|
468
|
+
}
|
469
|
+
html +='<a href="'+jsondata[$i].link+'" class="hx_title">'+jsondata[$i].name+'</a></dd>';
|
470
|
+
}
|
471
|
+
}else{
|
472
|
+
html +='<dd class="hide">暂无浏览记录</dd>';
|
473
|
+
}
|
474
|
+
html += '</dl>';
|
475
|
+
|
476
|
+
$('.mac_history').after(html);
|
477
|
+
var h = $('.mac_history').height();
|
478
|
+
var position = $('.mac_history').position();
|
479
|
+
$('.mac_history_box').css({'left':position.left,'top':(position.top+h)});
|
480
|
+
|
481
|
+
|
482
|
+
if($(".mac_history_set").attr('data-name')){
|
483
|
+
var $that = $(".mac_history_set");
|
484
|
+
MAC.History.Set($that.attr('data-name'),$that.attr('data-link'),$that.attr('data-pic'));
|
485
|
+
}
|
486
|
+
},
|
487
|
+
'Set':function(name,link,pic){
|
488
|
+
if(!link){ link = document.URL; }
|
489
|
+
var jsondata = MAC.Cookie.Get('mac_history');
|
490
|
+
|
491
|
+
if(jsondata != undefined){
|
492
|
+
this.Json = eval(jsondata);
|
493
|
+
|
494
|
+
for($i=0;$i<this.Json.length;$i++){
|
495
|
+
if(this.Json[$i].link == link){
|
496
|
+
return false;
|
497
|
+
}
|
498
|
+
}
|
499
|
+
|
500
|
+
jsonstr = '{log:[{"name":"'+name+'","link":"'+link+'","pic":"'+pic+'"},';
|
501
|
+
for($i=0; $i<this.Json.length; $i++){
|
502
|
+
if($i<= this.Limit && this.Json[$i]){
|
503
|
+
jsonstr += '{"name":"'+this.Json[$i].name+'","link":"'+this.Json[$i].link+'","pic":"'+this.Json[$i].pic+'"},';
|
504
|
+
}else{
|
505
|
+
break;
|
506
|
+
}
|
507
|
+
}
|
508
|
+
jsonstr = jsonstr.substring(0,jsonstr.lastIndexOf(','));
|
509
|
+
jsonstr += "]}";
|
510
|
+
}else{
|
511
|
+
jsonstr = '{log:[{"name":"'+name+'","link":"'+link+'","pic":"'+pic+'"}]}';
|
512
|
+
}
|
513
|
+
this.Json = eval(jsonstr);
|
514
|
+
MAC.Cookie.Set('mac_history',jsonstr,this.Days);
|
515
|
+
},
|
516
|
+
'Clear': function(){
|
517
|
+
MAC.Cookie.Del('mac_history');
|
518
|
+
$('.mac_history_box').html('<li class="hx_clear">已清空观看记录。</li>');
|
519
|
+
},
|
520
|
+
},
|
521
|
+
'Ulog':{
|
522
|
+
'Init':function(){
|
523
|
+
MAC.Ulog.Set();
|
524
|
+
MAC.Ulog.Click();
|
525
|
+
|
526
|
+
},
|
527
|
+
'Get':function(mid,id,type,page,limit,call){
|
528
|
+
MAC.Ajax(maccms.path+'/index.php/user/ajax_ulog/?ac=list&mid='+mid+'&id='+id+'&type='+type+'&page='+page+'&limit='+limit,'get','json','',call);
|
529
|
+
},
|
530
|
+
'Set':function(){
|
531
|
+
if($(".mac_ulog_set").attr('data-mid')){
|
532
|
+
var $that = $(".mac_ulog_set");
|
533
|
+
$.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"));
|
534
|
+
}
|
535
|
+
},
|
536
|
+
'Click':function(){
|
537
|
+
$('body').on('click', 'a.mac_ulog', function(e){
|
538
|
+
|
539
|
+
//是否需要验证登录
|
540
|
+
if(MAC.User.IsLogin == 0){
|
541
|
+
MAC.User.Login();
|
542
|
+
return;
|
543
|
+
}
|
544
|
+
|
545
|
+
var $that = $(this);
|
546
|
+
if($that.attr("data-id")){
|
547
|
+
MAC.Ajax(maccms.path+'/index.php/user/ajax_ulog/?ac=set&mid='+$that.attr("data-mid")+'&id='+$that.attr("data-id")+'&type='+$that.attr("data-type"),'get','json','',function(r){
|
548
|
+
MAC.Pop.Msg(100,20,r.msg,1000);
|
549
|
+
if(r.code == 1){
|
550
|
+
$that.addClass('disabled');
|
551
|
+
}else{
|
552
|
+
$that.attr('title', r.msg);
|
553
|
+
}
|
554
|
+
});
|
555
|
+
}
|
556
|
+
});
|
557
|
+
}
|
558
|
+
},
|
559
|
+
'Website':{
|
560
|
+
'Referer':function() {
|
561
|
+
if($('.mac_referer').length==0){
|
562
|
+
return;
|
563
|
+
}
|
564
|
+
|
565
|
+
var url = document.referrer
|
566
|
+
,domain=''
|
567
|
+
,host = window.location.host
|
568
|
+
,reg = /^http(s)?:\/\/(.*?)\//i
|
569
|
+
,mc = url.match(reg);
|
570
|
+
|
571
|
+
if(url=='' || url.indexOf(host)!=-1 || mc ==null){
|
572
|
+
return;
|
573
|
+
}
|
574
|
+
domain = mc[2];
|
575
|
+
MAC.Ajax(maccms.path + '/index.php/ajax/referer?domain='+encodeURIComponent(domain)+'&url='+encodeURIComponent(url)+'&type=update','get','json','',function(r){
|
576
|
+
if (r.code == 1) {
|
577
|
+
}
|
578
|
+
console.log(r);
|
579
|
+
});
|
580
|
+
}
|
581
|
+
},
|
582
|
+
'User':{
|
583
|
+
'BoxShow':0,
|
584
|
+
'IsLogin':0,
|
585
|
+
'UserId':'',
|
586
|
+
'UserName':'',
|
587
|
+
'GroupId':'',
|
588
|
+
'GroupName':'',
|
589
|
+
'Portrait':'',
|
590
|
+
'Init':function(){
|
591
|
+
if($('.mac_user').length >0){
|
592
|
+
$('body').on('click', '.mac_user', function(e){
|
593
|
+
MAC.User.Login();
|
594
|
+
});
|
595
|
+
|
596
|
+
$('.mac_user').hover(function(e){
|
597
|
+
$('.mac_user_box').show();
|
598
|
+
}, function(){
|
599
|
+
$('.mac_user_box').hover(function(){
|
600
|
+
MAC.User.BoxShow = 1;
|
601
|
+
}, function(){
|
602
|
+
MAC.User.BoxShow = 0;
|
603
|
+
$('.mac_user_box').hide();
|
604
|
+
});
|
605
|
+
});
|
606
|
+
}
|
607
|
+
|
608
|
+
if(MAC.Cookie.Get('user_id') !=undefined && MAC.Cookie.Get('user_id')!=''){
|
609
|
+
var url = maccms.path + '/index.php/user';
|
610
|
+
MAC.User.UserId = MAC.Cookie.Get('user_id');
|
611
|
+
MAC.User.UserName = MAC.Cookie.Get('user_name');
|
612
|
+
MAC.User.GroupId = MAC.Cookie.Get('group_id');
|
613
|
+
MAC.User.GroupName = MAC.Cookie.Get('group_name');
|
614
|
+
MAC.User.Portrait = MAC.Cookie.Get('user_portrait');
|
615
|
+
MAC.User.IsLogin = 1;
|
616
|
+
|
617
|
+
if($('.mac_user').length >0) {
|
618
|
+
if ($('.mac_user').prop("outerHTML").substr(0, 2) == '<a') {
|
619
|
+
$('.mac_user').attr('href', url);
|
620
|
+
$('.mac_user').text(MAC.User.UserName);
|
621
|
+
}
|
622
|
+
else {
|
623
|
+
//$('.mac_user').html('<a class="mac_text" href="'+ url +'">'+ name +'</a>');
|
624
|
+
}
|
625
|
+
|
626
|
+
var html = '<div class="mac_drop_box mac_user_box" style="display: none;">';
|
627
|
+
html += '<ul class="logged"><li><a target="_blank" href="' + url + '">用户中心</a></li><li class="logout"><a class="logoutbt" href="javascript:;" onclick="MAC.User.Logout();" target="_self"><i class="user-logout"></i>退出</a></li></ul>'
|
628
|
+
|
629
|
+
$('.mac_user').after(html);
|
630
|
+
var h = $('.mac_user').height();
|
631
|
+
var position = $('.mac_user').position();
|
632
|
+
$('.mac_user_box').css({'left': position.left, 'top': (position.top + h)});
|
633
|
+
}
|
634
|
+
|
635
|
+
}
|
636
|
+
else{
|
637
|
+
|
638
|
+
}
|
639
|
+
|
640
|
+
},
|
641
|
+
'CheckLogin':function(){
|
642
|
+
if(MAC.User.IsLogin == 0){
|
643
|
+
MAC.User.Login();
|
644
|
+
}
|
645
|
+
},
|
646
|
+
'Login':function(){
|
647
|
+
var ac='ajax_login';
|
648
|
+
if(MAC.Cookie.Get('user_id') !=undefined && MAC.Cookie.Get('user_id')!=''){
|
649
|
+
ac= 'ajax_info';
|
650
|
+
}
|
651
|
+
MAC.Pop.Show(400,380,'用户登录',maccms.path+'/index.php/user/'+ac,function(r){
|
652
|
+
$('body').off('click', '.login_form_submit');
|
653
|
+
$('body').on('click', '.login_form_submit', function(e){
|
654
|
+
$(this).unbind('click');
|
655
|
+
|
656
|
+
MAC.Ajax(maccms.path + '/index.php/user/login','post','json',$('.mac_login_form').serialize(),function(r){
|
657
|
+
alert(r.msg);
|
658
|
+
if(r.code == 1){
|
659
|
+
location.reload();
|
660
|
+
}
|
661
|
+
});
|
662
|
+
});
|
663
|
+
});
|
664
|
+
},
|
665
|
+
'Logout':function(){
|
666
|
+
MAC.Ajax(maccms.path + '/index.php/user/logout','post','json','',function(r){
|
667
|
+
MAC.Pop.Msg(100,20,r.msg,1000);
|
668
|
+
if(r.code == 1){
|
669
|
+
location.reload();
|
670
|
+
}
|
671
|
+
});
|
672
|
+
},
|
673
|
+
'PopedomCallBack':function(trysee,h) {
|
674
|
+
window.setTimeout(function(){
|
675
|
+
$(window.frames["player_if"].document).find(".MacPlayer").html(h);
|
676
|
+
},1000*10*trysee);
|
677
|
+
},
|
678
|
+
'BuyPopedom':function(o){
|
679
|
+
var $that = $(o);
|
680
|
+
if($that.attr("data-id")){
|
681
|
+
if (confirm('您确认购买此条数据访问权限吗?')) {
|
682
|
+
MAC.Ajax(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"),'get','json','',function(r){
|
683
|
+
$that.addClass('disabled');
|
684
|
+
MAC.Pop.Msg(300, 50, r.msg, 2000);
|
685
|
+
if (r.code == 1) {
|
686
|
+
top.location.reload();
|
687
|
+
}
|
688
|
+
$that.removeClass('disabled');
|
689
|
+
});
|
690
|
+
}
|
691
|
+
}
|
692
|
+
}
|
693
|
+
},
|
694
|
+
'Pop':{
|
695
|
+
'Remove':function(){
|
696
|
+
$('.mac_pop_bg').remove();
|
697
|
+
$('.mac_pop').remove();
|
698
|
+
},
|
699
|
+
'RemoveMsg':function(){
|
700
|
+
$('.mac_pop_msg_bg').remove();
|
701
|
+
$('.mac_pop_msg').remove();
|
702
|
+
},
|
703
|
+
'Msg':function($w,$h,$msg,$timeout){
|
704
|
+
if($('.mac_pop_bg').length !=1) {
|
705
|
+
MAC.Pop.Remove();
|
706
|
+
}
|
707
|
+
$('body').append('<div class="mac_pop_msg_bg"></div><div class="mac_pop_msg"><div class="pop-msg"></div></div>');
|
708
|
+
$('.mac_pop_msg .pop_close').click(function(){
|
709
|
+
$('.mac_pop_msg').remove();
|
710
|
+
});
|
711
|
+
|
712
|
+
$('.mac_pop_msg').width($w);
|
713
|
+
$('.mac_pop_msg').height($h);
|
714
|
+
$('.mac_pop_msg .pop-msg').html($msg);
|
715
|
+
$('.mac_pop_msg_bg,.mac_pop_msg').show();
|
716
|
+
setTimeout(MAC.Pop.RemoveMsg,$timeout);
|
717
|
+
},
|
718
|
+
'Show':function($w,$h,$title,$url,$callback) {
|
719
|
+
if($('.mac_pop_bg').length !=1) {
|
720
|
+
MAC.Pop.Remove();
|
721
|
+
}
|
722
|
+
|
723
|
+
$('body').append('<div class="mac_pop_bg"></div><div class="mac_pop"><div class="pop_top"><h2></h2><span class="pop_close">X</span></div><div class="pop_content"></div></div>');
|
724
|
+
$('.mac_pop .pop_close').click(function(){
|
725
|
+
$('.mac_pop_bg,.mac_pop').remove();
|
726
|
+
});
|
727
|
+
|
728
|
+
$('.mac_pop').width($w);
|
729
|
+
$('.mac_pop').height($h);
|
730
|
+
$('.pop_content').html('');
|
731
|
+
$('.pop_top').find('h2').html($title);
|
732
|
+
|
733
|
+
MAC.Ajax($url,'post','json','',function(r){
|
734
|
+
$(".pop_content").html(r);
|
735
|
+
$callback(r);
|
736
|
+
},function(){
|
737
|
+
$(".pop_content").html('加载失败,请刷新...');
|
738
|
+
});
|
739
|
+
|
740
|
+
$('.mac_pop_bg,.mac_pop').show();
|
741
|
+
}
|
742
|
+
},
|
743
|
+
'Pwd':{
|
744
|
+
'Check':function(o){
|
745
|
+
var $that = $(o);
|
746
|
+
if($that.attr("data-id")){
|
747
|
+
MAC.Ajax(maccms.path + '/index.php/ajax/pwd.html?id=' + $that.attr("data-id") + '&mid=' + $that.attr("data-mid") + '&type=' + $that.attr("data-type") + '&pwd='+ $that.parents('form').find('input[name="pwd"]').val() ,'get','json','',function(r){
|
748
|
+
$that.addClass('disabled');
|
749
|
+
MAC.Pop.Msg(300, 50, r.msg, 2000);
|
750
|
+
if (r.code == 1) {
|
751
|
+
location.reload();
|
752
|
+
}
|
753
|
+
$that.removeClass('disabled');
|
754
|
+
});
|
755
|
+
|
756
|
+
}
|
757
|
+
}
|
758
|
+
},
|
759
|
+
'AdsWrap':function(w,h,n){
|
760
|
+
document.writeln('<img width="'+w+'" height="'+h+'" alt="'+n+'" style="background-color: #CCCCCC" />');
|
761
|
+
},
|
762
|
+
'Css':function($url){
|
763
|
+
$("<link>").attr({ rel: "stylesheet",type: "text/css",href: $url}).appendTo("head");
|
764
|
+
},
|
765
|
+
'Js':function($url){
|
766
|
+
$.getScript($url, function(response, status) {
|
767
|
+
|
768
|
+
});
|
769
|
+
},
|
770
|
+
'Desktop':function(s){
|
771
|
+
location.href= maccms.path + '/index.php/ajax/desktop?name='+encodeURI(s)+'&url=' + encodeURI(location.href);
|
772
|
+
},
|
773
|
+
'Timming':function(){
|
774
|
+
if($('.mac_timming').length==0){
|
775
|
+
return;
|
776
|
+
}
|
777
|
+
var infile = $('.mac_timming').attr("data-file");
|
778
|
+
if(infile==undefined || infile == ''){
|
779
|
+
infile = 'api.php';
|
780
|
+
}
|
781
|
+
var t=(new Image());t.src=maccms.path + '/'+infile+'/timming/index?t='+Math.random();
|
782
|
+
},
|
783
|
+
'Error':function(tab,id,name){
|
784
|
+
|
785
|
+
},
|
786
|
+
'AddEm':function(obj,i){
|
787
|
+
var oldtext = $(obj).val();
|
788
|
+
$(obj).val( oldtext + '[em:' + i +']' );
|
789
|
+
},
|
790
|
+
'Remaining':function(obj,len,show){
|
791
|
+
var count = len - $(obj).val().length;
|
792
|
+
if(count < 0){
|
793
|
+
count = 0;
|
794
|
+
$(obj).val($(obj).val().substr(0,200));
|
795
|
+
}
|
796
|
+
$(show).text(count);
|
797
|
+
},
|
798
|
+
'Comment':{
|
799
|
+
'Login':0,
|
800
|
+
'Verify':0,
|
801
|
+
'Init':function(){
|
802
|
+
|
803
|
+
$('body').on('click', '.comment_face_box img', function(e){
|
804
|
+
var obj = $(this).parent().parent().parent().find('.comment_content');
|
805
|
+
MAC.AddEm(obj,$(this).attr('data-id'));
|
806
|
+
});
|
807
|
+
$('body').on('click', '.comment_face_panel', function(e){
|
808
|
+
// $('.comment_face_box').toggle();
|
809
|
+
$(this).parent().find('.comment_face_box').toggle();
|
810
|
+
});
|
811
|
+
$('body').on('keyup', '.comment_content', function(e){
|
812
|
+
var obj = $(this).parent().parent().parent().parent().find('.comment_remaining');
|
813
|
+
MAC.Remaining($(this),200,obj)
|
814
|
+
});
|
815
|
+
$('body').on('focus', '.comment_content', function(e){
|
816
|
+
if(MAC.Comment.Login==1 && MAC.User.IsLogin!=1){
|
817
|
+
MAC.User.Login();
|
818
|
+
}
|
819
|
+
});
|
820
|
+
|
821
|
+
$('body').on('click', '.comment_report', function(e){
|
822
|
+
var $that = $(this);
|
823
|
+
if($(this).attr("data-id")){
|
824
|
+
MAC.Ajax(maccms.path + '/index.php/comment/report.html?id='+$that.attr("data-id"),'get','json','',function(r){
|
825
|
+
$that.addClass('disabled');
|
826
|
+
MAC.Pop.Msg(100,20,r.msg,1000);
|
827
|
+
if(r.code == 1){
|
828
|
+
}
|
829
|
+
});
|
830
|
+
}
|
831
|
+
});
|
832
|
+
|
833
|
+
$('body').on('click', '.comment_reply', function(e){
|
834
|
+
var $that = $(this);
|
835
|
+
if($that.attr("data-id")){
|
836
|
+
var str = $that.html();
|
837
|
+
$('.comment_reply_form').remove();
|
838
|
+
if (str == '取消回复') {
|
839
|
+
$that.html('回复');
|
840
|
+
return false;
|
841
|
+
}
|
842
|
+
if (str == '回复') {
|
843
|
+
$('.comment_reply').html('回复');
|
844
|
+
}
|
845
|
+
var html = $('.comment_form').prop("outerHTML");
|
846
|
+
|
847
|
+
var oo = $(html);
|
848
|
+
oo.addClass('comment_reply_form');
|
849
|
+
oo.find('input[name="comment_pid"]').val( $that.attr("data-id") );
|
850
|
+
|
851
|
+
$that.parent().after(oo);
|
852
|
+
$that.html('取消回复');
|
853
|
+
}
|
854
|
+
});
|
855
|
+
|
856
|
+
$('body').on('click', '.comment_submit', function(e){
|
857
|
+
var $that = $(this);
|
858
|
+
MAC.Comment.Submit($that);
|
859
|
+
});
|
860
|
+
|
861
|
+
},
|
862
|
+
'Show':function($page){
|
863
|
+
if($(".mac_comment").length>0){
|
864
|
+
MAC.Ajax(maccms.path + '/index.php/comment/ajax.html?rid='+$('.mac_comment').attr('data-id')+'&mid='+ $('.mac_comment').attr('data-mid') +'&page='+$page,'get','json','',function(r){
|
865
|
+
$(".mac_comment").html(r);
|
866
|
+
},function(){
|
867
|
+
$(".mac_comment").html('<a href="javascript:void(0)" onclick="MAC.Comment.Show('+$page+')">评论加载失败,点击我刷新...</a>');
|
868
|
+
});
|
869
|
+
}
|
870
|
+
},
|
871
|
+
'Reply':function($o){
|
872
|
+
|
873
|
+
},
|
874
|
+
'Submit':function($o){
|
875
|
+
var form = $o.parents('form');
|
876
|
+
if($(form).find(".comment_content").val() == ''){
|
877
|
+
MAC.Pop.Msg(100,20,'请输入您的评论!',1000);
|
878
|
+
return false;
|
879
|
+
}
|
880
|
+
if($('.mac_comment').attr('data-mid') == ''){
|
881
|
+
MAC.Pop.Msg(100,20,'模块mid错误!',1000);
|
882
|
+
return false;
|
883
|
+
}
|
884
|
+
if($('.mac_comment').attr('data-id') == ''){
|
885
|
+
MAC.Pop.Msg(100,20,'关联id错误!',1000);
|
886
|
+
return false;
|
887
|
+
}
|
888
|
+
MAC.Ajax(maccms.path + '/index.php/comment/saveData','post','json',$(form).serialize() + '&comment_mid='+ $('.mac_comment').attr('data-mid') + '&comment_rid=' + $('.mac_comment').attr('data-id'),function(r){
|
889
|
+
MAC.Pop.Msg(100,20,r.msg,1000);
|
890
|
+
if(r.code == 1){
|
891
|
+
MAC.Comment.Show(1);
|
892
|
+
}
|
893
|
+
else{
|
894
|
+
if(MAC.Comment.Verify==1){
|
895
|
+
MAC.Verify.Refresh();
|
896
|
+
}
|
897
|
+
}
|
898
|
+
});
|
899
|
+
}
|
900
|
+
}
|
901
|
+
}
|
902
|
+
|
903
|
+
$(function(){
|
904
|
+
//异步加载图片初始化
|
905
|
+
MAC.Image.Lazyload.Show();
|
906
|
+
//自动跳转手机和pc网页地址
|
907
|
+
MAC.Adaptive();
|
908
|
+
//验证码初始化
|
909
|
+
MAC.Verify.Init();
|
910
|
+
//分页跳转初始化
|
911
|
+
MAC.PageGo.Init();
|
912
|
+
//用户部分初始化
|
913
|
+
MAC.User.Init();
|
914
|
+
//二维码初始化
|
915
|
+
MAC.Qrcode.Init();
|
916
|
+
//顶和踩初始化
|
917
|
+
MAC.Digg.Init();
|
918
|
+
//评分初始化
|
919
|
+
MAC.Score.Init();
|
920
|
+
//星星评分初始化
|
921
|
+
MAC.Star.Init();
|
922
|
+
//点击数量
|
923
|
+
MAC.Hits.Init();
|
924
|
+
//短网址
|
925
|
+
MAC.Shorten.Init();
|
926
|
+
//历史记录初始化
|
927
|
+
MAC.History.Init();
|
928
|
+
//用户访问记录初始化
|
929
|
+
MAC.Ulog.Init();
|
930
|
+
//联想搜索初始化
|
931
|
+
MAC.Suggest.Init('.mac_wd',1,'');
|
932
|
+
//网址导航来路统计
|
933
|
+
MAC.Website.Referer();
|
934
|
+
//定时任务初始化
|
935
|
+
MAC.Timming();
|
936
|
+
});
|