1/*! 2 * çæ¬ï¼MYUI Copyright © 2019 3 * ä½è ï¼QQ726662013çæææ 4 * å®ç½ï¼https://www.mytheme.cn 5 */ 6 7var Myui = { 8 'Comment': { 9 'Init':function(){ 10 $('body').on('click', '.my_comment_submit', function(e){ 11 if($(this).parent().parent().parent().find(".comment_data").val() == ''){ 12 layer.msg("请è¾å ¥è¯è®ºå 容"); 13 return false; 14 } 15 Myui.Comment.Submit(); 16 }); 17 $('body').on('click', '.my_comment_report', function(e){ 18 var $that = $(this); 19 if($(this).attr("data-id")){ 20 MyTheme.Ajax(maccms.path + '/index.php/comment/report.html?id='+$that.attr("data-id"),'get','json','',function(r){ 21 $that.addClass('disabled'); 22 layer.msg(r.msg); 23 }); 24 } 25 }); 26 $('body').on('click', '.my_comment_reply', function(e){ 27 var $that = $(this); 28 if($that.attr("data-id")){ 29 var str = $that.html(); 30 $('.comment_reply_form').remove(); 31 if (str == 'åæ¶åå¤') { 32 $that.html('åå¤'); 33 return false; 34 } 35 if (str == 'åå¤') { 36 $('.my_comment_reply').html('åå¤'); 37 } 38 var html = $('.comment_form').prop("outerHTML"); 39 40 var oo = $(html); 41 oo.addClass('comment_reply_form'); 42 oo.find('input[name="comment_pid"]').val( $that.attr("data-id") ); 43 44 $that.parent().after(oo); 45 $that.html('åæ¶åå¤'); 46 } 47 }); 48 $('body').on('click', '.my_comment_report', function(e){ 49 var $that = $(this); 50 if($(this).attr("data-id")){ 51 MyTheme.Ajax(maccms.path + '/index.php/comment/report.html?id='+$that.attr("data-id"),'get','json','',function(r){ 52 $that.addClass('disabled'); 53 layer.msg(r.msg); 54 }); 55 } 56 }); 57 }, 58 'Show':function($page){ 59 MyTheme.Ajax(maccms.path + '/index.php/comment/ajax.html?rid='+$('.myui_comment').attr('data-id')+'&mid='+ $('.myui_comment').attr('data-mid') +'&page='+$page,'get','json','',function(r){ 60 $(".myui_comment").html(r); 61 },function(){ 62 $(".myui_comment").html('<p class="text-center"><a href="javascript:void(0)" onclick="Myui.Comment.Show('+$page+');">è¯è®ºå 载失败ï¼ç¹å»æå·æ°...</a></p>'); 63 }); 64 }, 65 'Submit':function(){ 66 MyTheme.Ajax(maccms.path + '/index.php/comment/saveData','post','json',$(".comment_form").serialize() + '&comment_mid='+ $('.myui_comment').attr('data-mid') + '&comment_rid=' + $('.myui_comment').attr('data-id'),function(r){ 67 if(r.code==1){ 68 layer.msg(r.msg,{anim:5},function(){ 69 Myui.Comment.Show(1); 70 }); 71 } else { 72 if(MAC.Gbook.Verify==1){ 73 $('#verify_img').click(); 74 } 75 layer.msg(r.msg); 76 } 77 }); 78 } 79 }, 80 'Gbook': { 81 'Init':function(){ 82 $('body').on('click', '.gbook_submit', function(e){ 83 if($(".gbook_data").val() == ''){ 84 layer.msg("请è¾å ¥çè¨å 容"); 85 return false; 86 } 87 Myui.Gbook.Submit(); 88 }); 89 }, 90 'Submit':function(){ 91 MyTheme.Ajax(maccms.path + '/index.php/gbook/saveData','post','json',$("#myform").serialize(),function(r){ 92 if(r.code==1){ 93 layer.msg(r.msg,{anim:5},function(){ 94 location.reload(); 95 }); 96 } else { 97 if(MAC.Gbook.Verify==1){ 98 $('#verify_img').click(); 99 } 100 layer.msg(r.msg); 101 } 102 }); 103 } 104 }, 105 'Score':function(){ 106 var hadpingfen = 0; 107 $("ul.rating li").each(function(i) { 108 var $title = $(this).attr("title"); 109 var $lis = $("ul.rating li"); 110 var num = $(this).index(); 111 var n = num + 1; 112 $(this).click(function () { 113 if (hadpingfen > 0) { 114 layer.msg('å·²ç»è¯å,请å¡éå¤è¯å'); 115 } 116 else { 117 $lis.removeClass("active"); 118 $("ul.rating li:lt(" + n + ")").find(".fa").addClass("fa-star").removeClass("fa-star-o"); 119 $("#ratewords").html($title); 120 $.getJSON(maccms.path+'/index.php/ajax/score?mid='+$('#rating').attr('data-mid')+'&id='+$('#rating').attr('data-id')+'&score='+($(this).attr('val')*2), function (r) { 121 if (parseInt(r.code) == 1) { 122 layer.msg(r.msg); 123 hadpingfen = 1; 124 } 125 else { 126 hadpingfen = 1; 127 layer.msg(r.msg); 128 } 129 });
130 } 131 } 132 ).hover(function () { 133 this.myTitle = this.title; 134 this.title = ""; 135 $(this).nextAll().find(".fa").addClass("fa-star-o").removeClass("fa-star"); 136 $(this).prevAll().find(".fa").addClass("fa-star").removeClass("fa-star-o"); 137 $(this).find(".fa").addClass("fa-star").removeClass("fa-star-o"); 138 $("#ratewords").html($title); 139 }, function () { 140 this.title = this.myTitle; 141 $("ul.rating li:lt(" + n + ")").removeClass("hover"); 142 }); 143 }); 144 }, 145 'Autocomplete': function() { 146 var searchWidth= $('#search').width(); 147 try { 148 $('.search_wd').autocomplete(maccms.path + '/index.php/ajax/suggest?mid=1', { 149 resultsClass: "autocomplete-suggestions", 150 width: searchWidth, scrollHeight: 410, minChars: 1, matchSubset: 0, cacheLength: 10, multiple: false, matchContains: true, autoFill: false, 151 dataType: "json", 152 parse: function (r) { 153 if (r.code == 1) { 154 $(".head-dropdown").hide(); 155 var parsed = []; 156 $.each(r['list'], function (index, row) { 157 row.url = r.url; 158 parsed[index] = { 159 data: row 160 }; 161 }); 162 return parsed; 163 } else { 164 return {data: ''}; 165 } 166 }, 167 formatItem: function (row, i, max) { 168 return row.name; 169 }, 170 formatResult: function (row, i, max) { 171 return row.text; 172 } 173 }).result(function (event, data, formatted) { 174 $(this).val(data.name); 175 location.href = data.url.replace('mac_wd', encodeURIComponent(data.name)); 176 }); 177 } 178 catch(e){} 179 }, 180 'Favorite': function() { 181 if($('.favorite').length>0){ 182 $('body').on('click', 'a.favorite', function(e){ 183 var $that = $(this); 184 if($that.attr("data-id")){ 185 $.ajax({
186 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"), 187 cache: false, 188 dataType: 'json', 189 success: function($r){ 190 layer.msg($r.msg); 191 } 192 }); 193 } 194 }); 195 } 196 }, 197 'User': { 198 'BuyPopedom':function(o){ 199 var $that = $(o); 200 if($that.attr("data-id")){ 201 if (confirm('æ¨ç¡®è®¤è´ä¹°æ¤æ¡æ°æ®è®¿é®æéåï¼')) { 202 MyTheme.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){ 203 $that.addClass('disabled'); 204 layer.msg($r.msg); 205 if (r.code == 1) { 206 top.location.reload(); 207 } 208 $that.removeClass('disabled'); 209 }); 210 } 211 } 212 }, 213 'Login':function(){ 214 MyTheme.Layer.Div('.ajax_login'); 215 $('body').on('click', '.login_form_submit', function(e){ 216 $(this).unbind('click'); 217 MyTheme.Ajax(maccms.path + '/index.php/user/login','post','json',$('.mac_login_form').serialize(),function(r){ 218 layer.msg(r.msg); 219 if(r.code == 1){ 220 layer.msg(r.msg,{anim:5},function(){ 221 location.reload(); 222 }); 223 } 224 }); 225 }); 226 } 227 } 228}; 229 230$(function(){ 231 Myui.Comment.Init(); 232 Myui.Gbook.Init(); 233 Myui.Autocomplete(); 234 Myui.Favorite(); 235});
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.