www.gusucode.com > 黑色通用织梦博客模板源码程序 > 黑色通用织梦博客模板/dede58/css/article.js

     /* 2014-07-03 15:57:29 */
function favoNotes(t,e){$.ajax({type:"POST",url:"/interface/collectFavorites.htm?fid="+t+"&favoNotes="+e,data:"",dataType:"json",success:function(t){if(100==t.code){var e=$("#collection-box");Q_Collection(".Q_Collection"),e.remove(),alertMsg({type:"success",bg:!1})}else alertMsg({type:"error",msg:"\u7cfb\u7edf\u6b63\u5fd9\uff0c\u8bf7\u7a0d\u540e\u518d\u8bd5"})},error:function(){alertMsg({type:"error",msg:"\u7cfb\u7edf\u6b63\u5fd9\uff0c\u8bf7\u7a0d\u540e\u518d\u8bd5"})}})}function Q_Collection(t){return $(t).each(function(){var t=$(this),e=parseInt(t.attr("data-id"));t.click(function(){maijia.getUserInfo(function(o){if(o)t.unbind(),$.ajax({type:"POST",url:"/interface/collectFavorites.htm?aid="+e,data:"",dataType:"json",success:function(e){if(100==e.code){t.after('<div id="collection-box" class="Q_CollectionMark"><i></i><div class="collection-tit">\u6536\u85cf\u7ed3\u679c</div><div class="collection-cont"><span class="collection-success">\u6536\u85cf\u6210\u529f\uff01</span><textarea class="Q_CollectionTip collection-mark">\u8f93\u5165\u6536\u85cf\u7b14\u8bb0...</textarea><div class="collection-info">\u60a8\u53ef\u4ee5\u5728 <a class="blue" href="/u/myFavorites.htm" target="_blank">\u6211\u7684\u6536\u85cf</a> \u91cc\u67e5\u770b\u4fe1\u606f<span class="collection-wordsnum"><span class=" Q_num red">0</span>/140</span></div><div class="collection-button"><input class="submit collection-button-blue" type="button" value="\u63d0&nbsp;&nbsp;\u4ea4" /><input class="closeButton collection-button-orange" type="button" value="\u5173&nbsp;&nbsp;\u95ed" /><div class="clear"></div></div></div></div>');var o,n,i,a=$(".closeButton"),c=$(".submit"),l=$("#collection-box"),s=$(".Q_CollectionTip"),r=e.fid;s.keyup(function(){o=s.val(),n=o.replace(/[^\x00-\xff]/gi,"xx"),i=Math.floor(n.length/2)}),c.click(function(){140>=i?(c.unbind(),favoNotes(r,o)):i?alertMsg({type:"error",msg:"\u6536\u85cf\u7b14\u8bb0\u8bf7\u52ff\u8d85\u8fc7140\u4e2a\u5b57\u7b26\uff01",button:!0}):alertMsg({type:"error",msg:"\u8bf7\u586b\u5199\u6536\u85cf\u7b14\u8bb0\uff01",button:!0})}),a.click(function(){l.remove(),Q_Collection(".Q_Collection")}),Q_CollectionTip(".Q_CollectionTip"),Q_CollectionMark(".Q_CollectionMark")}else alertMsg({type:"error",msg:"\u5931\u8d25\u539f\u56e0:"+e.msg,tit:"\u6536\u85cf\u5931\u8d25",button:!0}),Q_Collection(".Q_Collection")},error:function(){alertMsg({type:"\u63d0\u4ea4\u5931\u8d25",msg:"\u7cfb\u7edf\u6b63\u5fd9\uff0c\u8bf7\u7a0d\u540e\u518d\u8bd5",tit:"\u6536\u85cf\u5931\u8d25"})}});else{var n=maijia.URL.applogin+encodeURIComponent(location.href);window.location.href=n}})})})}function Q_CollectionTip(t){return $(t).each(function(){var t=$(this),e=t.text();t.focus(function(){t.css("color","#000");var o=t.text();o==e&&t.text("");var n=$(this).val();n==e&&t.val("")}),t.blur(function(){t.css("color","#999");var o=$(this).val();""==o&&t.val(e)})})}function Q_CollectionMark(t){return $(t).each(function(){var t=$(this),e=t.find("textarea"),o=t.find(".Q_num");e.keyup(function(){var t=e.val().replace(/[^\x00-\xff]/gi,"xx"),n=Math.floor(t.length/2);o.text(n),n>140&&e.css("outline-color","#ff0000"),140>=n&&e.css("outline-color","#009edd")})})}function Q_Hitnum(t){return $(t).each(function(){var t=$(this),e=t.text();t.click(function(){$.ajax({type:"POST",url:"/interface/updateKeywordHit.htm?keyword="+e,data:"",dataType:"json",success:function(){},error:function(){}})})})}$(function(){var t=$("#wrap .article-detail-main");t.nextAll(".mj-comment-layout").length&&maijia.commentBox({id:t.data("id"),target:t.nextAll(".mj-comment-layout")}),maijia.fixed({target:"#wrap .article-main-right",range:[function(){var t=this.target.parent().offset().top;return t},function(){var t=this.target.parent(),e=t.offset().top+t.outerHeight(!0)-this.target.height();return e}],processAbsolute:function(t,e,o,n){e>n?this.target.css({position:"absolute",top:0}):n>=o&&this.target.css({position:"absolute",top:o-this.target.parent().offset().top})}}),$("#wrap .article-detail-fontsize").each(function(){var t=$("#wrap .article-detail-cont");$(".article-detail-font-big",this).click(function(){var e=parseInt(t.css("font-size"));e=isNaN(e)?12:e,e+=2,e=e>18?18:e,t.css("font-size",e+"px")}),$(".article-detail-font-small",this).click(function(){var e=parseInt(t.css("font-size"));e=isNaN(e)?12:e,e-=2,e=12>e?12:e,t.css("font-size",e+"px")})}),Q_Collection(".Q_Collection"),Q_Hitnum(".Q_Hitnum")});