1 2String.prototype.replaceAll = function(s1,s2){ return this.replace(new RegExp(s1,"gm"),s2); } 3String.prototype.trim=function(){ return this.replace(/(^\s*)|(\s*$)/g, ""); } 4var 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 6var 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 $that.attr('title', $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 if($r.code == 1){ 529 location.reload(); 530 } 531 } 532 }); 533 }); 534 }); 535 }, 536 'Logout':function(){ 537 $.ajax({ 538 type: 'post', 539 url: maccms.path + '/index.php/user/logout', 540 success:function($r){ 541 alert($r.msg) 542 if($r.code == 1){ 543 location.reload(); 544 } 545 } 546 }); 547 }, 548 'PopedomCallBack':function(trysee,h) { 549 window.setTimeout(function(){ 550 $(window.frames["player_if"].document).find(".MacPlayer").html(h); 551 },1000*60*trysee); 552 }, 553 'BuyPopedom':function(o){ 554 var $that = $(o); 555 if($that.attr("data-id")){ 556 if (confirm('æ¨ç¡®è®¤è´ä¹°æ¤æ¡æ°æ®ææ¾æéåï¼')) { 557 $.ajax({ 558 url: maccms.path + '/index.php/user/ajax_buy_popedom.html?id=' + $that.attr("data-id") + '&sid=' + $that.attr("data-sid") + '&nid=' + $that.attr("data-nid") + '&type=' + $that.attr("data-type"), 559 cache: false, 560 dataType: 'json', 561 success: function ($r) { 562 $that.addClass('disabled'); 563 alert($r.msg) 564 if ($r.code == 1) { 565 top.location.reload(); 566 } 567 }, 568 complete: function () { 569 $that.removeClass('disabled'); 570 } 571 }); 572 } 573 } 574 } 575 }, 576 'Pop':{ 577 'Show':function($modalid,$url,$callback) { 578 $.ajax({ 579 type: 'post', 580 url: $url, 581 timeout: 3000, 582 error: function(){ 583 $('body').append(alert("å 载失败ï¼è¯·å·æ°")); 584 }, 585 success:function($r){ 586 $('body').append($r); 587 $($modalid).modal('show'); 588 $('.MacPlayer').hide(); 589 $($modalid).on('hide.bs.modal', function () { 590 $('.MacPlayer').show(); 591 }) 592 $callback($r); 593 } 594 }); 595 } 596 }, 597 'AdsWrap':function(w,h,n){ 598 document.writeln('<img width="'+w+'" height="'+h+'" alt="'+n+'" style="background-color: #CCCCCC" />'); 599 }, 600 'Css':function($url){ 601 $("<link>").attr({ rel: "stylesheet",type: "text/css",href: $url}).appendTo("head"); 602 }, 603 'Js':function($url){ 604 $.getScript($url, function(response, status) { 605 606 }); 607 }, 608 'Desktop':function(s){ 609 location.href= maccms.path + '/index.php/ajax/desktop?name='+encodeURI(s)+'&url=' + encodeURI(location.href); 610 }, 611 'Timming':function(){ 612 613 }, 614 'Error':function(tab,id,name){ 615 616 }, 617 'AddEm':function(obj,i){ 618 var oldtext = $(obj).val(); 619 $(obj).val( oldtext + '[em:' + i +']' ); 620 }, 621 'Remaining':function(obj,len,show){ 622 var count = len - $(obj).val().length; 623 if(count < 0){ 624 count = 0; 625 $(obj).val($(obj).val().substr(0,200)); 626 } 627 $(show).text(count); 628 }, 629 'Comment':{ 630 'Login':0, 631 'Verify':0, 632 'Init':function(){ 633 634 $('body').on('click', '.comment_face_box img', function(e){ 635 var obj = $(this).parent().parent().parent().find('.comment_content'); 636 MAC.AddEm(obj,$(this).attr('data-id')); 637 }); 638 $('body').on('click', '.comment_face_panel', function(e){ 639 // $('.comment_face_box').toggle(); 640 $(this).parent().find('.comment_face_box').toggle(); 641 }); 642 $('body').on('keyup', '.comment_content', function(e){ 643 var obj = $(this).parent().parent().parent().parent().find('.comment_remaining'); 644 MAC.Remaining($(this),200,obj) 645 }); 646 $('body').on('focus', '.comment_content', function(e){ 647 if(MAC.Comment.Login==1 && MAC.User.IsLogin!=1){ 648 MAC.User.Login(); 649 } 650 }); 651 652 $('body').on('click', '.comment_report', function(e){ 653 var $that = $(this); 654 if($(this).attr("data-id")){ 655 $.ajax({ 656 url: maccms.path + '/index.php/comment/report.html?id='+$that.attr("data-id"), 657 cache: false, 658 dataType: 'json', 659 success: function($r){ 660 $that.addClass('disabled'); 661 alert($r.msg) 662 if($r.code == 1){ 663 } 664 } 665 }); 666 } 667 }); 668 669 $('body').on('click', '.comment_reply', function(e){ 670 var $that = $(this); 671 if($that.attr("data-id")){ 672 var str = $that.html(); 673 $('.comment_reply_form').remove(); 674 if (str == 'åæ¶åå¤') { 675 $that.html('åå¤'); 676 return false;
677 } 678 if (str == 'åå¤') { 679 $('.comment_reply').html('åå¤'); 680 } 681 var html = $('.comment_form').prop("outerHTML"); 682 683 var oo = $(html); 684 oo.addClass('comment_reply_form'); 685 oo.find('input[name="comment_pid"]').val( $that.attr("data-id") ); 686 687 $that.parent().after(oo); 688 $that.html('åæ¶åå¤'); 689 } 690 }); 691 692 $('body').on('click', '.comment_submit', function(e){ 693 var $that = $(this); 694 MAC.Comment.Submit($that); 695 }); 696 697 }, 698 'Show':function($page){ 699 if($(".mac_comment").length>0){ 700 $.ajax({ 701 type: 'get', 702 url: maccms.path + '/index.php/comment/ajax.html?rid='+$('.mac_comment').attr('data-id')+'&mid='+ $('.mac_comment').attr('data-mid') +'&page='+$page, 703 timeout: 5000, 704 error: function(){ 705 $(".mac_comment").html('è¯è®ºå 载失败ï¼è¯·å·æ°...'); 706 }, 707 success:function($r){ 708 $(".mac_comment").html($r); 709 } 710 }); 711 } 712 }, 713 'Reply':function($o){ 714 715 }, 716 'Submit':function($o){ 717 var form = $o.parents('form'); 718 if($(form).find(".comment_content").val() == ''){ 719 alert("请è¾å ¥æ¨çè¯è®ºï¼") 720 return false; 721 } 722 if($('.mac_comment').attr('data-mid') == ''){ 723 alert("模åmidé误ï¼") 724 return false; 725 } 726 if($('.mac_comment').attr('data-id') == ''){ 727 alert("å ³èidé误ï¼") 728 return false; 729 } 730 731 $.ajax({ 732 type: 'post', 733 url: maccms.path + '/index.php/comment/saveData', 734 data: $(form).serialize() + '&comment_mid='+ $('.mac_comment').attr('data-mid') + '&comment_rid=' + $('.mac_comment').attr('data-id'), 735 success:function($r){ 736 alert($r.msg) 737 if($r.code == 1){ 738 MAC.Comment.Show(1); 739 } 740 else{ 741 if(MAC.Comment.Verify==1){ 742 MAC.Verify.Refresh(); 743 } 744 } 745 } 746 }); 747 } 748 } 749} 750 751$(function(){ 752 //èªå¨è·³è½¬ææºåpcç½é¡µå°å 753 MAC.Adaptive(); 754 //éªè¯ç åå§å 755 MAC.Verify.Init(); 756 //å页跳转åå§å 757 MAC.PageGo.Init(); 758 //ç¨æ·é¨ååå§å 759 MAC.User.Init(); 760 //é¡¶å踩åå§å 761 MAC.Digg.Init(); 762 //è¯ååå§å 763 MAC.Score.Init(); 764 //ææè¯ååå§å 765 MAC.Star.Init(); 766 //ç¹å»æ°é 767 MAC.Hits.Init(); 768 //åå²è®°å½åå§å 769 MAC.Ulog.Init(); 770 //èæ³æç´¢åå§å 771 MAC.Suggest.Init('.mac_wd',1,''); 772 //宿¶ä»»å¡åå§å 773 MAC.Timming(); 774});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.