fml.define("component/cursorPostion", ["jquery"], function (a, b) { var c = a("jquery"); return { getCursortPosition : function (a) { a = c(a)[0]; var b = 0; if (document.selection) { a.focus(); var d = document.selection.createRange(); d.moveStart("character", -a.value.length), b = d.text.length } else if (a.selectionStart || a.selectionStart == "0") return b = a.selectionStart, b }, setCaretPosition : function (a, b) { a = c(a)[0]; if (a.setSelectionRange) a.focus(), a.setSelectionRange(b, b); else if (a.createTextRange) { var d = a.createTextRange(); d.collapse(!0), d.moveEnd("character", b), d.moveStart("character", b), d.select() } } } }); fml.define("component/page", ["jquery"], function (a, b) { //var c = a("jquery"); return function ($) { $.fn.paginate = function(options) { var opts = $.extend({}, $.fn.paginate.defaults, options); return this.each(function() { $this = $(this); var o = $.meta ? $.extend({}, opts, $this.data()) : opts; var selectedpage = o.selectedpage; $.fn.draw(o,$this,selectedpage); }); }; var outsidewidth_tmp = 0; var insidewidth = 0; var bName = navigator.appName; var bVer = navigator.appVersion; if(bVer.indexOf('MSIE 7.0') > 0) var ver = "ie7"; $.fn.paginate.defaults = { count : 0, selectedpage : 1, display : 10, word_name :'', view : 1, price : '51~100', page :0, type :1, url :Meilishuo.config.main_action+'index.php' }; $.fn.draw = function(o,obj,selectedpage){ if (o.count == 0 ) return ; if(o.display > o.count) o.display = o.count; $this.empty(); var listbegin = (selectedpage - Math.ceil(o.display / 2)); //从第几页开始显示分页信息 if (listbegin < 1) { //当前页-(总显示的页列表数/2) listbegin = 1; } var listend =selectedpage*1+Math.ceil(o.display / 2);//分页信息显示到第几页//当前页+(总显示的页列表数/2) if (listend > o.count) { listend = o.count ; } if (selectedpage > 1) { var _prev = $(document.createElement('a')).html('上一页').attr('href',o.url+'?page=0&price='+o.price+'&view='+o.view+'&type='+o.type+'&word_name='+o.word_name); obj.append(_prev); } //第一页总是显示的 var _first if (selectedpage==1){ //如果是当前页是第一页 _first = $(document.createElement('a')).addClass('currentpage').html('1').attr('href',o.url+'?page=1&price='+o.price+'&view='+o.view+'&type='+o.type+'&word_name='+o.word_name); }else { _first = $(document.createElement('a')).html('1').attr('href',o.url+'?page=1&price='+o.price+'&view='+o.view+'&type='+o.type+'&word_name='+o.word_name); } obj.append(_first); //beginpage不是最后一页都要显示... if (listbegin>1){ var _ibegin = $(document.createElement('i')).html('...'); obj.append(_ibegin); } for ( i = listbegin; i < listend; i++) { var _for; if( (i!=1)&&(i!=o.count)){ if (i != selectedpage) {//如果i不等于当前页 _for = $(document.createElement('a')).html(i).attr('href',o.url+'?page='+i+'&price='+o.price+'&view='+o.view+'&type='+o.type+'&word_name='+o.word_name); } else { _for = $(document.createElement('a')).addClass('currentpage').html(i).attr('href',o.url+'?page='+i+'&price='+o.price+'&view='+o.view+'&type='+o.type+'&word_name='+o.word_name); } } obj.append(_for); }//显示分页码> //endpage总是最后一页都要显示... if (listend'), arr.push('
' + a.find("option:selected").text() + '
'), arr.push('
'), arr.push(""), arr.push("
"), arr.push(""); var e = c(arr.join("")); a.before(e); var f = a.find("option"), g = f.size(), h = []; for (var i = 0; i < g; i++) { var j = d.escapeString(f.eq(i).val()); h.push('
  • ' + j + "
  • ") } c(e).find(".options ul").html(h.join("")), b && b(e), c(".createPanel").bind("click", function (a) { c(".options").show() }), c(e).find(".select").bind("click", function (a) { c(this).attr("isSelect") != "true" ? (c(this).css({ visibility : "hidden" }), c(e).find(".options").show(), c(this).attr("isSelect", "true")) : (c(this).css({ visibility : "visible" }), c(e).find(".options").hide(), c(this).removeAttr("isSelect")) }), c(e).delegate(".options ul li", "mouseover", function () { c(this).css({ background : "#ffeef4" }) }), c(e).delegate(".options ul li", "mouseout", function () { c(this).css({ background : "#fff" }) }), c(e).delegate(".options ul li", "click", function () { c(e).find(".selectText").text(c(this).text()), c(e).find(".selectText").attr("val", c(this).attr("id")), a.attr("value", c(this).text()), c(e).find(".options").hide(), c(e).find(".select").css("visibility", "visible").removeAttr("isSelect") }), c(e).find(".select").hover(function () { c(this).addClass("selectbg") }, function () { c(this).removeClass("selectbg") }) } a = c(a); var e = a.size(); a.css("display") == "none" && a.prev().remove(), a.hide(); for (var f = 0; f < e; f++) g(a.eq(f)) } } }); fml.define("app/closeWindow", [], function (a, b) { return function () { var a = navigator.appName; a == "Netscape" ? (window.open("", "_self", ""), window.close()) : a == "Microsoft Internet Explorer" && (window.opener = null, window.open("", "_top"), window.close()) } }); fml.define("app/closeFrame", [], function (a, b) { return function () { if (!document.referrer) return; var a = window.postMessage; a ? parent.postMessage("close", document.referrer) : (window.name = "close", window.location = document.referrer) } }); fml.define("app/magazine", ["jquery", "app/smile", "app/checkStatusCode", "component/storage", "app/insertAtCaret", "component/shareTmp", "component/select", "component/focus", "component/cursorPostion", "component/regString"], function (a, b) { var c = a("jquery"), d = a("component/shareTmp"), e = a("component/focus"), f = a("component/select"), g = a("app/smile"), h = a("app/insertAtCaret"), i = !0, j = a("component/storage"), k = a("component/cursorPostion"), l = "", m = a("app/checkStatusCode"), n = a("component/regString"), o = function () { function f(b, c, e) { c.attr("s_type", b); var f = d[e]; switch (b) { case 0: c.attr("title", a[e].not_auth), c.removeClass("i_" + f).addClass("g_" + f); break; case 1: c.attr("title", a[e].syn), c.removeClass("g_" + f).addClass("i_" + f); break; case 2: c.attr("title", a[e].not_syn), c.removeClass("i_" + f).addClass("g_" + f) } } function g(a, d, e) { switch (a) { case 0: f(1, d, e), fml.vars[e] = 1, window.open(b[e].not_auth, "mb", ["toolbar=0,status=0,resizable=1,width=620,height=450,left=", (screen.width - 620) / 2, ",top=", (screen.height - 450) / 2].join("")); break; case 1: f(2, d, e), c.get("/settings/ajax_remove_sync", { type : e }), fml.vars[e] = 2; break; case 2: f(1, d, e), c.get("/settings/ajax_add_sync", { type : e }), fml.vars[e] = 1 } } var a = { weibo : { not_auth : "你还没有绑定新浪微博,点击去绑定", not_syn : "未同步到新浪微博", syn : "取消同步到新浪微博" }, qzone : { not_auth : "你还没有绑定QQ空间,点击去绑定", not_syn : "未同步到QQ空间", syn : "取消同步到QQ空间" } }, b = { weibo : { not_auth : "/settings/bind/weibo" }, qzone : { not_auth : "/settings/bind/qzone" } }, d = { weibo : "sina", qzone : "qzone" }, e = c(".share_published"); e.children("span").each(function () { var a = c(this), b = a.attr("s_type"), d = a.attr("s_name"); b = b == "undefined" ? 0 : parseInt(b), typeof fml.vars[d] != "undefined" && (b = fml.vars[d]), f(b, a, d), a.unbind("click").click(function () { b = parseInt(c(this).attr("s_type")), g(b, a, d) }) }) }; return function () { var a = j.get("magazineName"), b = j.get("magazineId"); if (c(".forwardMagazin").size() == 0) { var h = d("shareGoodsUploadPanelTpl"); c(".add_share_goods").append(h), o(); var k = c("#createPanel").show(); c(".selectList").html(l), f.createSelect(".selectList", function (d) { d.find(".options ul").after(k), d.find(".options ul").children("[role=1]:last").addClass("border_bc"), e.inputFocus("#createMagaValue"), e.inputFocus("#forwardContent"), a && (c(".selectText").text(a), c(".selectText").attr("val", b), c(".selectList").val(a), c(".selectList").attr("id", b)) }) } l == "" && c.post(Meilishuo.config.server_url + "group/ajax_getUserGroups", {}, function (d) { for (var g = 0, h = d.length; g < h; g++) { var i = d[g]; l += '"; if (a && n.escapeString(a) == i.name) var m = !0 } c(".selectList").html(l), c(".selectText").text("读取中..."), f.createSelect(".selectList", function (d) { d.find(".options ul").after(k), d.find(".options ul").children("[role=1]:last").addClass("border_bc"), e.inputFocus("#createMagaValue"), e.inputFocus("#forwardContent"), j.set("magazineName", c(".selectText").text()), j.set("magazineId", c(".selectText").attr("val")), a && m && (c(".selectText").text(a), c(".selectText").attr("val", b), c(".selectList").val(a), c(".selectList").attr("id", b)) }) }, "json"), c("#forwardContent")[0].focus(), c(".forwardMagazin").on("click", ".options ul li", function () { j.set("magazineName", c(this).text()), j.set("magazineId", c(this).attr("id")) }), c(".createMaga").live("click", function () { var a = c(this).parent().find("#ForwardMsg"), b = c(this).parent().find("#createMagaValue").val(); a.hide(); if (b == "" || b == "创建一个杂志") return a.show().html("杂志名称不能为空哦!"), !1; var d = /[\$|&|#|\|"| |]/.test(b); if (d) return a.show().html("杂志名称含有非法字符!"), !1; a.show().html("正在创建..."); var e = c(this), f = Meilishuo.config.server_url + "group/ajax_creategroup", g = { name : b }, h = function (d) { if (d == 0) a.show().html("哎呀,这个名称已经有人使用了,请换个名称吧!"); else if (d == 2) a.show().html("您输入的字符不对哦~请换个名称吧!"); else if (!m(d)) { var f = e.parent().prev().children(":first"), g = c('
  • ' + n.escapeString(b) + "
  • "); f.after(g); var h = e.parent().parent().parent().next(), j = '"; h.prepend(j), c("#createMagaValue").val("创建一个杂志"), g.trigger("click"), l = "", a.hide() } i = !0 }; i && (c.post(f, g, h, "json"), i = !1) }), g.showSmile(".forwardMagazin", ".share_smileys", "share") } }); fml.define("app/dialogSuccess", ["jquery", "app/closeFrame", "component/regString", "component/shareTmp", "component/dialog", "app/closeWindow"], function (a, b) { var c = a("jquery"), d = a("component/shareTmp"), e = a("component/dialog"), f = a("app/closeFrame"), g = a("app/closeWindow"), h = a("component/regString"), i = function (a, b, i, j) { var k = {}; k.magaName = h.cutstr(h.escapeString(a), 20), k.magaId = b, k.magaTitle = i; var l = j == "分享按钮" ? d("shareMagaSucTpl") : d("magaSucTpl", k), m = j == "分享按钮" ? 520 : 370; j == "分享按钮" && (i = "提示"); var n = e.meiliDialog({ dialogTitle : i, dialogContent : c(l), dialogWidth : m, onStart : function () { c(".smileysbox").hide() }, onClose : function () { j && (j == "分享按钮" ? g() : f()) } }); j == "分享按钮" && (c("#maskLayer").remove(), c("#dialogLayer").css({ top : "60px", "margin-left" : "auto", "margin-right" : "auto", position : "static" }).find("#closeDialog").hide()), window.setTimeout(n, 2e3) }; b.shareSuccess = i }); fml.define("app/insertAtCaret", ["jquery"], function (a, b) { var c = a("jquery"); return function (a, b) { typeof a[0].name != "undefined" && (a = a[0]); if (c.browser.msie) a.focus(), sel = document.selection.createRange(), sel.text = b, a.focus(); else if (c.browser.mozilla || c.browser.webkit) { var d = a.selectionStart, e = a.selectionEnd, f = a.scrollTop; a.value = a.value.substring(0, d) + b + a.value.substring(e, a.value.length), a.focus(), a.selectionStart = d + b.length, a.selectionEnd = d + b.length, a.scrollTop = f } else a.value += b, a.focus() } }); fml.define("app/smile", ["jquery", "component/shareTmp", "app/insertAtCaret"], function (a, b) { var c = a("jquery"), d = a("component/shareTmp"), e = a("app/insertAtCaret"), f = function (a) { var b = { smileys : { 1 : { title : "笑" }, 24 : { title : "色色" }, 9 : { title : "酷" }, 6 : { title : "流泪" }, 8 : { title : "抓狂" }, 11 : { title : "坏笑" }, 4 : { title : "害羞" }, 19 : { title : "财迷" }, 13 : { title : "猪头" }, 25 : { title : "调皮" }, 16 : { title : "转眼珠" }, 3 : { title : "泪汪汪" }, 20 : { title : "星星眼" }, 23 : { title : "飞吻" }, 18 : { title : "长草" }, 2 : { title : "晕死" }, 5 : { title : "问号" }, 17 : { title : "刚巴德" }, 26 : { title : "拒绝" }, 7 : { title : "得意" }, 22 : { title : "鄙视" }, 14 : { title : "猥琐" }, 15 : { title : "囧" }, 10 : { title : "怒" }, 12 : { title : "心碎" }, 21 : { title : "白菜" }, 27 : { title : "骷髅" }, 28 : { title : "泪" }, 29 : { title : "汗" }, 30 : { title : "么么" }, 31 : { title : "如花" }, 32 : { title : "思考" } } }, e = c(".smileysbox"), f = e.size() == 0; if (f) { var h = d("loginSmile", b); c("body").append(h), e = c(".smileysbox"), e.on("click", ".smiley img", function () { g.call(this) }) } a(e) }, g = function () {}, h = function (a, b, d) { c(document).bind("click", function () { c(".share_smileys").removeClass("smileys_active"), c(".share_smileys").removeData("isAddClass"), c(".smileysbox").hide() }), objs = c(a), objs.on("click", b, function (a) { a.stopPropagation(), c(b).removeClass("smileys_active"); var h = c(this), i = h.offset(); f(function (a) { g = function () { if (d == "share") c("#forwardContent").val() == "写点什么,评论一下" ? (c("#forwardContent").val(""), e(c("#forwardContent"), c(this).attr("emotion"))) : e(c("#forwardContent"), c(this).attr("emotion")); else if (d == "comment") { var a = h.closest(".poster_wall").find(".poster_textarea"); e(a, c(this).attr("emotion")) } h.removeClass("smileys_active"), h.removeData("isAddClass"), c(".smileysbox").hide() } }), d == "share" ? c(".smileysbox").css("zIndex", 815) : d == "comment" && (c(".smileysbox").css("zIndex", 380), c(".share_smileys").css("zIndex", 390)); if (!h.data("isAddClass")) { h.addClass("smileys_active"), h.data("isAddClass", "true"), c(".smileysbox").show(); var j = i.left - 264; j < 0 ? (j = 0, c(".line").css({ left : "177px" })) : c(".line").css({ left : "264px" }), c(".smileysbox").css({ top : i.top + h.height() + 4, left : j }) } else h.removeClass("smileys_active"), h.removeData("isAddClass"), c(".smileysbox").hide() }) }; b.showSmile = h }); fml.define("app/checkStatusCode", [], function (a, b) { return function (a, b) { var c = { 99 : "您发布的链接不符合规范,请修改后重新发送", 98 : "您发布的时间间隔太短了,休息一下再发布吧", 97 : "您发布的时间间隔太短了,休息一下再发布吧", 96 : "您创建杂志过多,休息一会吧", 95 : "你@的人太多了,请修改后再发送" }; return c[a] ? (b ? b() : alert(c[a]), !0) : !1 } }); fml.define("component/tips", ["jquery", "component/shareTmp"], function (a, b) { var c = a("jquery"), d = a("component/shareTmp"), e = null; return function (a, b, f, g) { c(a).on("mouseenter", b, function (a) { window.clearTimeout(e), c(f).remove(); var b = d(f.replace(".", "").replace("#", "")); c("body").append(b); var h = c(this).offset().left, i = c(this).offset().top; h = h < 0 ? 0 : h, a.clientY + c(this).height() > c(window).height() - a.clientY ? (g(c(this), "_b"), i -= c(f).height() + 8) : (g(c(this), "_t"), i += c(this).height() + 8), c(f).css({ position : "absolute", top : i, left : h }).show() }), c(document).on("mouseenter", f, function (a) { window.clearTimeout(e) }).on("mouseleave", f, function () { c(this).remove() }), c(a).on("mouseleave", b, function (a) { e = window.setTimeout(function () { c(f).remove() }, 200) }) } }); fml.define("app/userFollow", ["jquery", "app/checkLogin"], function (a, b) { var c = a("jquery"), d = a("app/checkLogin"), e = function (a, b, e) { if (!d()) return !1; if (a == "add") var f = "/twitter/ajax_addfollower"; else var f = "/twitter/ajax_movefollower"; return c.get(f, b, e), !0 }; return function (a, b, d, f, g, h) { f || (f = ""), g || (g = ""), c(a).live("click", function () { var a = { fuid : c(this).attr("fuid") }, d = c(this).attr("following"), f = c(this).attr("followed"); e("add", a, c.proxy(function () { this.className = b.replace(".", "") + " " + g; var a = f == 2 || d == 1 ? "互相关注" : "已关注"; c(this).html(a) }, this)), h && h.call(this) }), c(b).live("click", function () { var b = { fuid : c(this).attr("fuid") }; e("remove", b, c.proxy(function () { this.className = a.replace(".", "") + " " + f; var b = "+ 加关注"; c(this).html(b) }, this)), h && h.call(this) }), c(d).live({ mouseenter : function () { c(this).html("取消关注") }, mouseleave : function () { var a = c(this).attr("followed"), b = c(this).attr("following"), d = a == 2 || b == 1 ? "互相关注" : "已关注"; c(this).html(d) } }) } }); fml.define("app/forward", ["jquery", "component/dialog", "component/storage", "app/dialogSuccess", "app/magazine", "app/checkLogin", "component/regString", "app/checkStatusCode"], function (a, b) { var c = a("jquery"), d = a("app/magazine"), e = a("component/dialog"), f = a("app/checkLogin"), g = a("component/regString"), h = a("app/dialogSuccess"), i = !0, j = a("app/checkStatusCode"), k = a("component/storage"); return function () { c(".goods_wall").on("click", ".poster_forward", function () { if (!f()) return !1; var b = c(this).closest(".poster_grid"); if (b.attr("twitter_show_type") == 9) var g = b.attr("twitter_source_tid"); else var g = b.attr("twitter_id"); var h = '
    '; e.meiliDialog({ dialogTitle : "收进杂志", dialogContent : h, onStart : function () { c(".smileysbox").hide() }, onClose : function () { c(".smileysbox").hide() } }), d(); var i = b.find(".goods_pic").attr("src"); c(".magaImgage").attr("src", i); var j = b.find(".posterContent").text(); j && c("#forwardContent").val(j), a(g) }); var a = function (a) { c("#forwardMaga").unbind("click").bind("click", function () { if (!g.WidthCheck(c("#forwardContent").val(), 140)) return c(".show_message_tips").html("您输入的字数超过140字").show(), !1; c(".show_message_tips").html("正在提交...").show(); var b = c(".selectList").val(), d = c(".selectText").attr("val"), e = ""; c("#forwardContent").val() != "写点什么,评论一下" && (e = c("#forwardContent").val()); var f = Meilishuo.config.server_url + "twitter/ajax_newForwardTwitter", l = { type : 7, stid : a, fws : e, name : b, group_id : d, syncToQzone : c(this).parents(".maga_zf").find("[s_name=qzone]").attr("s_type") == 1 ? "true" : "false", syncToWeibo : c(this).parents(".maga_zf").find("[s_name=weibo]").attr("s_type") == 1 ? "true" : "false" }, m = function (a) { if (j(a)) return i = !0, c(".show_message_tips").hide(), !1; i = !0, c(".show_message_tips").hide(); if (d == 0) { var e = a; c(".selectText").attr("val", a), k.set("magazineId", a) } else var e = d; h.shareSuccess(b, e, "收进杂志") }; i && (i = !1, c.post(f, l, m, "json")) }) } } }); fml.define("component/autoTextarea", ["component/pin"], function (a, b) { var c = a("component/pin"); return function (a, b, d, e) { var f = 0, g = 200; $wall = c(".goods_wall"), $wallSize = $wall.size(), c(a).on("keyup focus", b, function () { var a, b = this.style, c = parseInt(b.height); isNaN(c) && (c = d); var e = b.height; b.height = d + "px", this.scrollHeight > f && (g && this.scrollHeight > g ? (a = g, b.overflowY = "scroll", b.height = a + "px") : (a = this.scrollHeight, b.overflowY = "hidden", b.height = a + "px", e != a + "px" && $wallSize && $wall.masonry("reload"))) }) } }); fml.define("app/eventHover", ["jquery"], function (a, b) { var c = a("jquery"); b.hoverShow = function (a, b) { c(a).live("mouseenter", function () { c(this).find(b).css("display", "block") }).live("mouseleave", function () { c(this).find(b).hide() }) }, b.hoverHide = function (a, b) { c(a).live("mouseenter", function () { c(this).find(b).hide() }).live("mouseleave", function () { c(this).find(b).show() }) } }); fml.define("app/comment", ["app/checkStatusCode", "component/shareTmp", "component/pin", "app/smile", "app/checkLogin"], function (a, b) { var c = a("component/pin"), d = a("app/smile"), e = a("app/checkLogin"), f = a("component/shareTmp"), g = a("app/checkStatusCode"); (function () { c(".goods_wall").on("click", ".poster_comment", function () { if (!e()) return; var a = c(this).closest(".poster_grid"), b = a.find(".poster_cmt"); c(this).data("isCmt") ? (a.find(".poster_cmt").hide(), c(this).removeData("isCmt")) : (b.show(), c(this).data("isCmt", "true"), b.find("textarea").focus(), a.height() > c(window).height() ? c("body,html").stop(!0, !0).animate({ scrollTop : a.offset().top - c("#navbar").height() + a.height() / 2 }, 300) : c("body,html").stop(!0, !0).animate({ scrollTop : a.offset().top - c("#navbar").height() }, 300)), c(".goods_wall").masonry("reload") }), d.showSmile(".goods_wall", ".share_smileys", "comment"), c(".goods_wall").on("click", ".poster_comment_btn", function () { var a = c(this).closest(".poster_grid"), b = c(this).closest(".poster_cmt"), d = a.find(".np_share"), e = a.attr("twitter_author_uid"), h = a.attr("twitter_id"), i = b.find("textarea").val(); if (i == "") return alert("留言不能为空"), !1; var j = Meilishuo.config.server_url + "twitter/ajax_newNoteTwitter/", k = { suid : e, stid : h, type : 4, tContent : i, showIndex : 0, pid : 0 }, l = function (a) { if (g(a)) return !1; var e = { tContent : i }, h = f("comment_content", e); d.after(c(h)), c(".goods_wall").masonry("reload"), b.find("textarea").val("") }; c.get(j, k, l, "json") }) })() }); fml.define("app/like", ["jquery", "app/checkLogin"], function (a, b) { var c = a("jquery"), d = a("app/checkLogin"); return function () { c(".goods_wall").on("click", ".poster_like", function () { if (!d()) return; var isliked ; c(this).is(".liked") ?isliked = "1" : isliked = "0"; var a = c(this).closest(".poster_grid"), b = a.attr("twitter_id"), e = Meilishuo.config.main_action + "tinfoStore.php", f = { tvd : isliked, stid : b, fws : "[小红心]" }, g = function () {}; c.post(e, f, g, "json"), c(this).is(".liked") ? (c(this).html(' 收藏'), c(this).removeClass("liked")) : (c(this).addClass("liked"), c(this).html('已收藏')) }) } }); fml.define("app/userInfoTips", ["jquery", "app/userFollow", "component/shareTmp", "component/tips"], function (a, b) { var c = a("jquery"), d = a("component/tips"), e = a("component/shareTmp"), f = a("app/userFollow"), g = {}; return function () { d(".goods_wall", ".avatar32_f", ".pop_loading", function (a, b) { var d = a.attr("user_id"), f = "/aj/getUser/", h = { user_id : d, ajax : 1 }, i = function (d) { var f = e("facePop", d); c(".pop_loading").html(f), a.data({ userInfo : d }), g[d.user_id] = d, c(".corner_t,.corner_b").hide(), c(".corner" + b).show() }; if (d != Meilishuo.config.user_id) if (!g[d]) c.get(f, h, i, "json"); else { var j = e("facePop", g[d]); c(".pop_loading").html(j), c(".corner_t,.corner_b").hide(), c(".corner" + b).show() } }), f(".addFollow", ".removeFollow", ".removeFollow", "btn", "followed", function () { delete g[c(this).attr("fuid")] }) } }); fml.define("component/menu", ["jquery", "component/shareTmp"], function (a, b) { var c = a("jquery"), d = a("component/shareTmp"), e = null; return function (a, b, f) { c(document).on("mouseenter", a, function () { var e = d(b); c("body").append(e); if (f) var g = f(a).top, h = f(a).left; else var g = c(a).offset().top + c(a).height(), h = c(a).offset().left - c(a).width() / 2; c("." + b).css({ top : g + 10, left : h, position : "absolute" }) }), c(document).on("mouseenter", "." + b, function () { window.clearTimeout(e) }).on("mouseleave", "." + b, function () { c("." + b).remove() }), c(document).on("mouseleave", a, function () { e = window.setTimeout(function () { c("." + b).remove() }, 300) }) } }); fml.define("ui/confirm", ["component/position", "component/overlay", "component/window", "jquery"], function (a, b) { function g(a) { return this.opts = a || {}, this.overlay = new e(this.opts), this.window = new f(this.opts), this.opts.auto || this.sync(), this } function h() { return this.opts.discover ? c('
    ' + this.opts.content + '

    确定取消

    ') : c('
    ' + this.opts.content + '

    确定取消

    ') } var c = a("jquery"), d = a("component/position"), e = a("component/overlay"), f = a("component/window"); return g.prototype.sync = function () { this.overlay.sync(), this.window.sync(), this.window.toCenter(), this.window.onClose(c.proxy(function () { this.overlay.destroy(), this.window.destroy() }, this)); var a = h.call(this); this.window.content.html(a), c(document).bind("keyup", c.proxy(function (a) { a.keyCode == 27 && (this.overlay.destroy(), this.window.destroy()) }, this)), c("." + this.window.opts.windowId).on("click", ".sureBtn", c.proxy(function () { this.callBackOnSure && this.callBackOnSure(), this.overlay.destroy(), this.window.destroy() }, this)).on("click", ".cancelBtn", c.proxy(function () { this.callBackOnCancel && this.callBackOnCancel(), this.overlay.destroy(), this.window.destroy() }, this)), this.onCancel() }, g.prototype.onSure = function (a) { this.callBackOnSure = a }, g.prototype.onCancel = function (a) { this.callBackOnCancel = a }, g }); fml.define("component/animate", ["jquery"], function (a, b) { var c = a("jquery"); b.twinkle = function (a, b, d, e) { b || (b = 500), d || (d = 0), e || (e = !0), d = -d, a = c(a); if (!a.length) return; var f = a.get(0), g = 0, h = null, i = !1; clearTimeout(h), h = window.setTimeout(function () { i || (i = !0, a.show()); var c = f.style.visibility; f.style.visibility = c == "hidden" ? "visible" : "hidden", g--; if (g <= d) return window.clearTimeout(h), e ? a.show() : (a.hide(), i = !1), g = 0, !1; h = window.setTimeout(arguments.callee, b) }, b) } }); fml.define("component/iStorage", [], function (a, b) { var c = !1, d = !1, e = { cookieArr : {}, options : { domain : ".meilishuo.com", path : "/" }, setCookie : function (a, b, c) { c = c || {}; var d = a + "=" + encodeURIComponent(b); c.domain || (c.domain = this.options.domain), c.path || (c.path = this.options.path), d += "; domain=" + c.domain, c.path && (d += "; path=" + c.path); if (c.duration) { var e = new Date; e.setTime(e.getTime() + c.duration * 1e3), d += "; expires=" + e.toGMTString() } return c.secure && (d += "; secure"), document.cookie = d + ";" }, getCookie : function (a) { return this.cookieArr[a] = this.cookieArr[a] || function () { var b = window.document.cookie.match("(?:^|;)\\s*" + a.replace(/([-.*+?^${}()|[\]\/\\])/g, "\\$1") + "=([^;]*)"); return b ? decodeURIComponent(b[1]) : undefined } (), this.cookieArr[a] }, removeCookie : function (a) { return this.setCookie(a, "", { duration : -1 }) } }, f = { set : function (a, b, c, d) { c ? sessionStorage.setItem(a, b) : localStorage.setItem(a, b), typeof d == "function" && d() }, get : function (a, b, c) { b ? c(sessionStorage.getItem(a)) : c(localStorage.getItem(a)) }, remove : function (a, b) { b ? sessionStorage.removeItem(a) : localStorage.removeItem(a) } }, g = { flash : document.getElementById("storage"), sessionId : "", callback : [], init : function (a) { a && (this.sessionId = this.sessionId || e.getCookie("PHPSESSID")); if (c || d) return; d = !0; var b = new Date, f = document.createElement("div"), g = '', g += '', g += '', g += "", f.innerHTML = g, document.body.appendChild(f), this.flash = document.getElementById("storage") }, detectIE : function () { var a = navigator.userAgent.toLowerCase(); if (window.ActiveXObject) { var b = a.match(/msie ([\d.]+)/)[1]; if (b >= 5.5 && b < 8) return !0 } return !1 }, set : function (a, b, d, e) { function g(a, b, c) { if (c) { var d = new Date; d = parseInt(d.getTime() / 36e5), f.flash.setSessionTime(d), f.flash.setSessionVal(f.sessionId + a, d), f.flash.set(f.sessionId + a, b) } else f.flash.set(a, b) } var f = this; f.init(d), c ? (g(a, b, d), typeof e == "function" && e()) : f.callback.push(function () { g(a, b, d), typeof e == "function" && e() }) }, get : function (a, b, d) { function f(a, b) { return b ? (e.flash.removeAllSession(), e.flash.get(e.sessionId + a)) : e.flash.get(a) } var e = this; e.init(b), c ? d(f(a, b)) : e.callback.push(function () { d(f(a, b)) }) }, remove : function (a, b) { var d = this; d.init(b); if (!c) { var d = this; window.setTimeout(function () { d.remove(a, b) }, 100); return } b ? d.flash.remove(d.sessionId + a) : d.flash.remove(a) } }, h = g.detectIE() ? g : f; return { isJSReady : function () { return !0 }, getAllowDomain : function () { var a = a || ["www.meilishuo.com", "newlab.meilishuo.com", "newtest.meilishuo.com", "wwwtest.meilishuo.com", "cdjtrunk.meilishuo.com"]; return a }, flashReadyHandler : function () { c = !0; for (var a = 0, b = g.callback.length; a < b; a++) g.callback[a]() }, setCookie : function (a, b, c) { return e.setCookie(a, b, c) }, getCookie : function (a) { return e.getCookie(a) }, removeCookie : function (a) { return e.removeCookie(a) }, setSession : function (a, b, c) { return h.set(a, b, !0, c) }, getSession : function (a, b) { return h.get(a, !0, b) }, removeSession : function (a) { return h.remove(a, !0) }, set : function (a, b, c) { return h.set(a, b, !1, c) }, get : function (a, b) { return h.get(a, !1, b) }, remove : function (a) { return h.remove(a, !1) } } }); fml.define("app/cleanMsg", ["jquery", "component/iStorage", "component/userstate", "component/animate"], function (a, b) { function s() { var b = a("component/iStorage"); b.get(n, function (a) { a || h.show(), b.set(n, !0) }) } function u(a) { return a > 99 ? "99+" : a } function v(a) { var b = { fans_num : ["有%d个新关注", "关注", "/ur/fans/" + c], atme_num : ["有%d个新@我的", "@我的", "/atme"], pmsg_num : ["有%d条新私信", "私信", "/msg/main/user"], sysmesg : ["有%d条新系统消息", "系统消息", "/msg/main/syser"], recommend_num : ["有%d个喜欢我的", "喜欢我的", "/atme/recommend/" + c] }, e = [], f = [], g = 0; for (var h in b) { var i = a === !0 ? 0 : l[h] | 0; i ? e.push([h, i]) : f.push(h), g += i } var j = e.length, k = "", m = ""; if (j) { for (var n = 0; n < j; n++) { var o = e[n], h = o[0]; k += '
  • ' + b[h][0].replace("%d", '' + u(o[1]) + "") + "
  • " } k += '
  • 知道了
  • ', m = k } j = f.length; for (var n = 0; n < j; n++) { var h = f[n]; k += '
  • 查看' + b[h][1] + "
  • " } d("#moreMessageBox").html(k), d("#message .mgsTotalNum").html(g ? "(" + g + ")" : ""), m != "" ? r.html(m).show() : r.html("").hide() } function w() { var a = d(this).attr("dk"); "all" != a ? x(a) : (y(!0), v(!0)) } function x(a) { l[a] = 0, v(), y(a) } function y(a) { var b = a === !0, c = Meilishuo.config.server_url + (b ? "msg/ajax_setAllMsgZero" : "msg/ajax_setMsgZero"); 1 == a && (a = ["fans_num", "atme_num", "pmsg_num", "sysmesg", "recommend_num"]); var e = b ? { msgParams : a } : { msgParm : a }; d.post(c, e) } function z(a, b) { a && (k *= 1.2), b && (k *= 1.2), !a && !b && (k = 1), k > 5 && (k = 5) } function A() { if (!c) return; o && window.clearTimeout(o); if (e.activity()) { var a = Meilishuo.config.controller === "home" ? "/aj/getMsg/msg" : "/aj/getMsg/"; d.get(a, function (a) { l = a.msg || a; var b = a.newshare ? a.newshare.num | 0 : 0; t(b), v(), z(b, l.total_num | 0) }, "json") } o = window.setTimeout(A, j * k) } var c = Meilishuo.config.user_id, d = a("jquery"), e = a("component/userstate"), f = a("component/animate"), g = d("#navbar .shining"), h = d("#navbar .h_ico"), i = d(".h_update"), j = 2e4, k = 1, l = {}, m = !1, n = "app/cleanMsg_icotip", o, p, q = 0, r = d("#messageTipBox"); h.hover(function () { if (i.length > 0) return; p && window.clearTimeout(p) }, function () { h.hide() }), g.parent().hover(function () { if (i.length > 0) return; q && h.show() }, function () { q && (p = window.setTimeout(function () { h.hide() }, 200)) }); var t = function (a) { q = a; if (i.length > 0) return; a ? (g.html(u(a)), h.find("span.red_f").html(u(a)), d(".home").attr("href", "/?frm=on_yellow_show"), m || (m = !0, f.twinkle(g, 500, 6, !0), s())) : (g.hide(), h.hide(), d(".home").attr("href", "/"), m = !1) }; d("#moreMessageBox").on("click", "li.cleanOnce", w), r.on("click", "li.cleanOnce", w), b.msgFunc = function () { o = window.setTimeout(A, j / 10) }, b.msgImmedialy = function () { A() }, b.msgTipbox = function (a) { a ? r.html() && r.show() : r.hide() } }); fml.define("component/userstate", ["jquery"], function (a, b) { var c = a("jquery"), d = new Date, e = c.browser, f = {}; c(document).bind("mousemove", function () { d = new Date }), b.browser = function (a, b) { a = { ie : "msie" } [a] || a; var c = f[a + b]; return undefined !== c ? c : e[a] ? b && b != e.version ? c = !1 : c = !0 : c = !1 }, b.activity = function (a) { return a || (a = 30), new Date - d < a * 1e3 } }); fml.define("component/windowResize", ["component/userstate"], function (a, b) { function f() { e && clearTimeout(e), e = window.setTimeout(function () { var a = d.length; for (var b = 0; b < a; b++) d[b]() }, 240) } var c = a("component/userstate"), d = [], e; if (c.browser("msie")) { var g = document.createElement("div"); g.style.cssText = "width:100%;height:0px;position:absolute;bottom:0px;left:0px;overflow:hidden", document.body.appendChild(g), g.onresize = f } else window.onresize = f; b.bind = function (a) { d.push(a) } }); fml.define("component/pin", ["jquery"], function (a, b) { var c = a("jquery"); return function (a, b, c) { "use strict"; var d = b.event, e; d.special.smartresize = { setup : function () { b(this).bind("resize", d.special.smartresize.handler) }, teardown : function () { b(this).unbind("resize", d.special.smartresize.handler) }, handler : function (a, b) { var c = this, d = arguments; a.type = "smartresize", e && clearTimeout(e), e = setTimeout(function () { jQuery.event.handle.apply(c, d) }, b === "execAsap" ? 0 : 100) } }, b.fn.smartresize = function (a) { return a ? this.bind("smartresize", a) : this.trigger("smartresize", ["execAsap"]) }, b.Mason = function (a, c) { this.element = b(c), this._create(a), this._init() }, b.Mason.settings = { isResizable : !0, isAnimated : !1, animationOptions : { queue : !1, duration : 500 }, gutterWidth : 0, isRTL : !1, isFitWidth : !1, containerStyle : { position : "relative" } }, b.Mason.prototype = { _filterFindBricks : function (a) { var b = this.options.itemSelector; return b ? a.filter(b).add(a.find(b)) : a }, _getBricks : function (a) { var b = this._filterFindBricks(a).css({ position : "absolute" }).addClass("pins"); return b }, _create : function (c) { this.options = b.extend(!0, {}, b.Mason.settings, c), this.styleQueue = []; var d = this.element[0].style; this.originalStyle = { height : d.height || "" }; var e = this.options.containerStyle; for (var f in e) this.originalStyle[f] = d[f] || ""; this.element.css(e), this.horizontalDirection = this.options.isRTL ? "right" : "left", this.offset = { x : parseInt(this.element.css("padding-" + this.horizontalDirection), 10), y : parseInt(this.element.css("padding-top"), 10) }, this.isFluid = this.options.columnWidth && typeof this.options.columnWidth == "function"; var g = this; setTimeout(function () { g.element.addClass("mlsWall") }, 0), this.options.isResizable && b(a).bind("smartresize.masonry", function () { g.resize() }), this.reloadItems() }, _init : function (a) { this._getColumns(), this._reLayout(a) }, option : function (a, c) { b.isPlainObject(a) && (this.options = b.extend(!0, this.options, a)) }, layout : function (a, b) { for (var c = 0, d = a.length; c < d; c++) this._placeBrick(a[c]); var e = {}; e.height = Math.max.apply(Math, this.colYs); if (this.options.isFitWidth) { var f = 0; c = this.cols; while (--c) { if (this.colYs[c] !== 0) break; f++ } e.width = (this.cols - f) * this.columnWidth - this.options.gutterWidth } this.styleQueue.push({ $el : this.element, style : e }); var g = this.isLaidOut ? this.options.isAnimated ? "animate" : "css" : "css", h = this.options.animationOptions, i; for (c = 0, d = this.styleQueue.length; c < d; c++) i = this.styleQueue[c], i.$el[g](i.style, h); this.styleQueue = [], b && b.call(a), this.isLaidOut = !0 }, _getColumns : function () { var a = this.options.isFitWidth ? this.element.parent() : this.element, b = a.width(); this.columnWidth = this.isFluid ? this.options.columnWidth(b) : this.options.columnWidth || this.$bricks.outerWidth(!0) || b, this.columnWidth += this.options.gutterWidth, this.cols = Math.floor((b + this.options.gutterWidth) / this.columnWidth), this.cols = Math.max(this.cols, 1) }, _placeBrick : function (a) { var c = b(a), d, e, f, g, h; d = Math.ceil(c.outerWidth(!0) / (this.columnWidth + this.options.gutterWidth)), d = Math.min(d, this.cols); if (d === 1) f = this.colYs; else { e = this.cols + 1 - d, f = []; for (h = 0; h < e; h++) g = this.colYs.slice(h, h + d), f[h] = Math.max.apply(Math, g) } var i = Math.min.apply(Math, f), j = 0; for (var k = 0, l = f.length; k < l; k++) if (f[k] === i) { j = k; break } var m = { top : i + this.offset.y }; m[this.horizontalDirection] = this.columnWidth * j + this.offset.x, this.styleQueue.push({ $el : c, style : m }); var n = i + c.outerHeight(!0), o = this.cols + 1 - l; for (k = 0; k < o; k++) this.colYs[j + k] = n }, getHeight : function (a) { return Math.min.apply(Math, this.colYs) }, resize : function () { var a = this.cols; this._getColumns(), (this.isFluid || this.cols !== a) && this._reLayout() }, _reLayout : function (a) { var b = this.cols; this.colYs = []; while (b--) this.colYs.push(0); this.layout(this.$bricks, a) }, reloadItems : function () { this.$bricks = this._getBricks(this.element.children()) }, reload : function (a) { this.reloadItems(), this._init(a) }, appended : function (a, b, c) { if (b) { this._filterFindBricks(a).css({ top : this.element.height() }); var d = this; setTimeout(function () { d._appended(a, c) }, 1) } else this._appended(a, c) }, _appended : function (a, b) { var c = this._getBricks(a); this.$bricks = this.$bricks.add(c), this.layout(c, b) }, remove : function (a) { this.$bricks = this.$bricks.not(a), a.remove() }, destroy : function () { this.$bricks.removeClass("pins").each(function () { this.style.position = "", this.style.top = "", this.style.left = "" }); var c = this.element[0].style; for (var d in this.originalStyle) c[d] = this.originalStyle[d]; this.element.unbind(".masonry").removeClass("masonry").removeData("masonry"), b(a).unbind(".masonry") } }, b.fn.imagesLoaded = function (a) { function h() { a.call(c, d) } function i(a) { var c = a.target; c.src !== f && b.inArray(c, g) === -1 && (g.push(c), --e <= 0 && (setTimeout(h), d.unbind(".imagesLoaded", i))) } var c = this, d = c.find("img").add(c.filter("img")), e = d.length, f = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==", g = []; return e || h(), d.bind("load.imagesLoaded error.imagesLoaded", i).each(function () { var a = this.src; this.src = f, this.src = a }), c }; var f = function (b) { a.console && a.console.error(b) }; b.fn.masonry = function (a) { if (typeof a == "string") { var c = Array.prototype.slice.call(arguments, 1); this.each(function () { var d = b.data(this, "masonry"); if (!d) { f("cannot call methods on masonry prior to initialization; attempted to call method '" + a + "'"); return } if (!b.isFunction(d[a]) || a.charAt(0) === "_") { f("no such method '" + a + "' for masonry instance"); return } d[a].apply(d, c) }) } else this.each(function () { var c = b.data(this, "masonry"); c ? (c.option(a || {}), c._init()) : b.data(this, "masonry", new b.Mason(a, this)) }); return this } } (window, jQuery), c }); fml.define("app/setPage", ["jquery"], function (a, b) { function d(p) { c("#demo1").paginate({ count : Meilishuo.config.totalpage, start : p.page, display : 10, word_name : p.word_name, view : p.view, type : p.type, price : p.price }); } var c = a("jquery"); b.adPage = d }); fml.define("app/adPoster", ["jquery"], function (a, b) { function d(a, b) { var d = { top : "/xym/info-getBanner.action", bottom : "/ads/getBottomBanner/" }, f = d[a] , g = ".ads_" + a; if (c(g).length == 0) return; c.get(f, function (a) { if (a.length == 0) return; e(g, a, { width : 2e3 }) }, "json") } function e(a, b, d) { var e = { width : 200, height : 100, gap : 3e3, type : 1, numType : 1 }; if (!(b instanceof Array)) return !1; var g = c(a).show(), i = b.length, j = c.extend({}, e, d); if (i === 0) return; g.html('
    '); var k = g.find("._img"), l = g.find("._num"); f(k, l, b, i, j), h(0, i, k, l, j) } function f(a, b, c, d, e) { if (d === 1) a.append(g(c[0], e)); else { for (var f = 0; f < d; f++) a.append(g(c[f], e)), b.append('' + (f + 1) + ""); b.addClass("adType" + e.numType); switch (e.type) { case 1: a.css({ width : "100%", position : "absolute" }).find("li").css({ "float" : "left", display : "block", width : "100%" }); break; case 2: a.css({ width : e.width * d, display : "inline-block" }); break; case 3: b.hide() } } } function g(a, b) { var c = '
  • ' + '
  • '; return c } function h(a, b, d, e, f) { var g = null, h = function (a) { d.stop(!0, !0), a == b && f.type != 2 && (a = 0); switch (f.type) { case 1: d.animate({ top : -f.height * a + "px" }, 300); break; case 2: d.animate({ left : -f.width * a + "px" }, 300); break; case 3: e.hide(), d.children("li").fadeOut(), setTimeout(function () { d.children("li").eq(a).fadeIn() }, 400) } a == b && f.type == 2 && (d.children("li").eq(0).css({ left : f.width * a + "px", position : "relative" }), setTimeout(function () { d.css("left", 0), d.children("li").eq(0).css({ position : "" }) }, 400), a = 0), e.find(".current").removeClass("current"), e.children("a").eq(a).addClass("current") }, i = function () { a++, h(a), a == b && (a = 0), g = setTimeout(i, f.gap) }, j = function () { h(a), g = setTimeout(i, f.gap), e.find("a").hover(function () { clearTimeout(g), a = c(this).children("span").text() - 1, h(a) }, function () { g = setTimeout(i, f.gap) }), d.hover(function () { clearTimeout(g) }, function () { g = setTimeout(i, f.gap) }) }; j() } var c = a("jquery"); b.adBanner = d, b.carousel = h }); fml.define("app/deletePoster", ["component/pin", "ui/confirm"], function (a, b) { function g(a, b) { var e = "

    确定删除该内容?

    ", f = new d({ width : 370, transparent : !0, content : e, isOverflow : !0 }); f.onSure(c.proxy(function () { var d = "/twitter/ajax_removeTwitter/", e = { tid : b }, f = function () {}; c.get(d, e, f, "json"), a.remove(), c(".goods_wall").masonry("reload") }, this)) } var c = a("component/pin"), d = a("ui/confirm"), e = function (a) { var b = c(a).closest(".poster_grid"), d = b.attr("twitter_author_uid"), e = b.attr("twitter_id"); g(b, e) }, f = function () { c(".goods_wall").on("click", ".poster_del", function () { e(this) }) }; b.deletePoster = e, b.deleteTrigger = f }); fml.define("app/follow", ["jquery", "app/checkLogin", "app/cleanMsg"], function (a, b) { var c = a("jquery"), d = a("app/checkLogin"), e = a("app/cleanMsg"), f = function (a, b, e) { if (!d()) return !1; if (a == "add") var f = "/group/" + b.groupid + "/follow"; else var f = "/group/" + b.groupid + "/quit"; return c.post(f, b, e), !0 }; return function (a, b, d, e, g, h) { e || (e = ""), g || (g = ""), c(a).live("click", function () { var a = { groupid : c(this).attr("groupid"), ajax : 1 }, d = c(this).attr("followed"); f("add", a, c.proxy(function () { this.className = b.replace(".", "") + " " + g; var a = "已关注"; c(this).html(a) }, this)), h && h.call(this) }), c(b).live("click", function () { var b = { groupid : c(this).attr("groupid"), ajax : 1 }; f("remove", b, c.proxy(function () { this.className = a.replace(".", "") + " " + e; var b = "+ 加关注"; c(this).html(b) }, this)), h && h.call(this) }), c(d).live({ mouseenter : function () { c(this).html("取消关注") }, mouseleave : function () { c(this).html("已关注") } }) } }); fml.define("component/poster", ["component/pin", "component/windowResize"], function (a, b) { var c = a("component/pin"), d = a("component/windowResize"), e = function (a) { var b = { containerId : ".goods_wall", contentWidth : 240, contentFluid : ".content_fluid", cornerStampId : "", cornerNoticId : "", cornerNavId : "", masonryId : ".poster_wall", defaultColumn : 4, lessColumn : 1, isFixed : !0 }, e = c.extend({}, b, a), f = function () { h(), j(), g() }, g = function () { c(e.containerId).masonry({ itemSelector : e.masonryId, columnWidth : e.contentWidth, cornerStampSelector : e.cornerStampId, cornerNoticSelector : e.cornerNoticId, cornerNavSelector : e.cornerNavId }) }, h = function () { var a = c(document).height() > c(window).height() ? c(window).width() : c(window).width() - 20, b = Math.floor(a / e.contentWidth), d = c(e.contentFluid + ", .header_top"), f = c(e.cornerNavId); if (b >= e.defaultColumn && e.isFixed) var g = e.contentWidth * b; else var g = e.contentWidth * e.defaultColumn; f.size() > 0 && f.css("width", g - e.contentWidth), d.css({ width : g }) }, i = function () { e.isFixed && d.bind(function () { c("body").css("overflow") != "hidden" && c("html").css("overflow") != "hidden" && h() }) }, j = function () { c.Mason.prototype.resize = function () { c("body").css("overflow") != "hidden" && c("html").css("overflow") != "hidden" && h(), this._getColumns("mlsWall"), this._reLayout() }, c.Mason.prototype._reLayout = function (a) { var b = this.cols, d = this.cols, f = 1; if (this.options.cornerStampSelector && c(this.options.cornerStampSelector).size() > 0) { var g = this.element.find(this.options.cornerStampSelector), h = g.offset().left - (this.element.offset().left + this.offset.x + parseInt(g.css("marginLeft"))); b = Math.floor(h / this.columnWidth) } if (this.options.cornerNavSelector && c(this.options.cornerNavSelector).size() > 0) var i = this.element.find(this.options.cornerNavSelector), d = e.lessColumn; if (this.options.cornerNoticSelector && c(this.options.cornerNoticSelector).size() > 0) { var j = this.element.find(this.options.cornerNoticSelector); f = 0 } var k = this.cols; this.colYs = []; while (k--) this.colYs.push(this.offset.y); for (k = d; k < this.cols; k++) this.colYs[k] = this.offset.y + i.outerHeight(!0); for (k = b; k < this.cols; k++) this.colYs[k] = this.offset.y + g.outerHeight(!0); for (k = f; k < 1; k++) this.colYs[k] = this.offset.y + j.outerHeight(!0); this.layout(this.$bricks, a) } }; f() }; b.posterWall = e }); fml.define("app/posterWall", ["app/referrer", "app/checkLogin", "component/windowScroll", "component/pin", "component/shareTmp", "component/storage"], function (a, b) { var c = a("component/pin"), d = a("component/shareTmp"), e = a("component/windowScroll"), f = a("app/checkLogin"), g = a("component/storage"), h = a("app/referrer"), i = !1, j = 0, k = !1; return function (a, b) { var g = function (e) { e = e || {}, k && c(".botSpinner").show(); var g = function (b) { c(".content_fluid").removeClass("v_hidden"), k = !0, c(".botSpinner").show(), c(".topSpinner").hide(); if (b.tInfo == 0) return c(".paging_panel").removeClass("none_f"), c(".botSpinner").hide(), !1; if (b) { var e = d("posterWall", b); c(".goods_wall").append(c(e)), window.setTimeout(function () { fml.fireProxy("logPoster", b) }, 25) } c(".goods_wall").masonry("reload"); var g = c.data(c(".goods_wall").get(0), "masonry"); j = g.getHeight(); if (a.frame >= 5) { c(".paging_panel").removeClass("none_f"), c(".botSpinner").hide(), i = !1; if (h != "gdt.qq" && h != "weibo") return; if (Meilishuo.config.user_id > 0) return; f(); return } b.tInfo && b.totalNum > 20 && Math.floor(b.totalNum / 20) > a.frame ? i = !0 : c(".botSpinner").hide(), a.frame++ }; c.get(b, e, g, "json") }, l = c(window), m = function () { e.bind(function (b, c) { if (!c) return; var d = l.height(), e = b + d; e >= j && i && (i = !1, g(a)) }) }; g(a), m() } }); fml.define("component/urlHandle", [], function (a, b) { function d(a) { if (a == "") return ""; var b = {}, c, d, e, f = a.indexOf("?"), g = a.substr(f + 1), h = g.split("&"); for (e = 0, len = h.length; e < len; e++) { var i = h[e].indexOf("="); if (i > 0) { c = h[e].substring(0, i), d = h[e].substr(i + 1); try { b[c] = decodeURIComponent(d) } catch (j) {} } } return delete b.frm, b } var c = function (a) { if (a == "") return ""; var b = {}; b = d(a); var c = document.createElement("A"); c.href = a, b.hostDomain = c.host; var e = b.hostDomain.replace(/\.(com|cn|net|org)/g, ""); return e = e.substr(e.lastIndexOf(".") + 1), b.rootDomain = b.hostDomain.substr(b.hostDomain.indexOf(e)), b }; b.redirect = function (a) { var b = /MSIE (\d+\.\d+);/.test(navigator.userAgent); if (!a) return; if (b) { var c = document.createElement("a"); c.href = a, document.body.appendChild(c), c.click() } else location.href = a }, b.getUrl = c, b.getParams = d }); fml.define("component/regString", ["jquery"], function (b, c) { var d = b("jquery"), e = null; return { isUrl : function (a) { this.trim(a); var b = "((^http)|(^https)|(^ftp))://[-\\w]+\\.(\\w)+", c = new RegExp(b); return c.test(a) ? !0 : !1 }, trim : function (a) { return a.replace(/^\s+/, "").replace(/\s+$/, "") }, GetStringLength : function (a) { var b = 0; for (var c = 0; c < a.length; c++) { var d = a.charCodeAt(c); d >= 1 && d <= 126 || 65376 <= d && d <= 65439 ? b += .5 : b += 1 } return b }, getStringLength : function (a) { return a.replace(/[^\x00-\xff]/g, "**").length }, WidthCheck : function (a, b) { return this.GetStringLength(a) > b ? !1 : !0 }, cutstr : function (b, c) { var d = 0, e = 0; str_cut = "", e = b.length; for (var f = 0; f < e; f++) { a = b.charAt(f), d++, escape(a).length > 4 && d++, str_cut += a; if (d >= c) return str_cut += "...", str_cut } if (d < c) return b }, escapeString : function (a) { return !a || a == "" ? "" : a.replace(//g, ">") } } }); fml.define("app/logstatics", ["jquery"], function (a, b) { var c = a("jquery"); b.clicklog = function (a) { var b = new Image; b.src = a }, b.clickgetlog = function (a) { c.get(a) } }); fml.define("component/iframeShim", ["jquery"], function (a, b) { function d(a) { this.target = c(a).length == 0 ? c(document.getElementById(a)) : c(a).eq(0), this.iframe = e(), this.iframe.appendTo(document.body) } function e() { return c("