PageSourceSearch

https://cdn.meia.me/public/js/meia.js?t=20221125

js meia.me collected 2026-10-04 10:24:11 UTC 33,353 bytes, 871 lines download raw bytes

1var isLogin, login, appShare, share, shareWithType, pushVideoDetail, refreshHeight;
2var umsDomain = "u.meia.me";
3var eduDomain = "meia.me";
4if (window.webkit && window.webkit.messageHandlers) {
5    var iosBridge = window.webkit.messageHandlers;
6    if (iosBridge.log) {
7        console.log = function (a) {
8            iosBridge.log.postMessage(a);
9        }
10    }
11    console.log("开始增加函数");
12    var count = 0;
13    if (iosBridge.isLogin) {
14        count++;
15        isLogin = function () {
16            console.log("call isLogin");
17            iosBridge.log.postMessage();
18        }
19    }
20    if (iosBridge.login) {
21        count++;
22        login = function () {
23            console.log("call login");
24            iosBridge.login.postMessage();
25        }
26    }
27    if (iosBridge.appShare) {
28        count++;
29        appShare = function (type, title, desc, img, url) {
30            var param = {
31                type: type,
32                title: title,
33                desc: desc,
34                img: img,
35                url: url
36            }
37            console.log("call appShare, param->" + JSON.stringify(param));
38            iosBridge.appShare.postMessage(JSON.stringify(param));
39        }
40    }
41    if (iosBridge.share) {
42        count++;
43        share = function () {
44            console.log("call share");
45            iosBridge.share.postMessage();
46        }
47    }
48    if (iosBridge.shareWithType) {
49        count++;
50        shareWithType = function (a) {
51            console.log("call shareWithType, param->" + a);
52            iosBridge.shareWithType.postMessage(a);
53        }
54    }
55    if (iosBridge.pushVideoDetail) {
56        count++;
57        pushVideoDetail = function (a) {
58            console.log("call pushVideoDetail, param->" + a);
59            iosBridge.pushVideoDetail.postMessage(a);
60        }
61    }
62    if (iosBridge.refreshHeight) {
63        count++;
64        refreshHeight = function () {
65            console.log("call refreshHeight");
66            iosBridge.refreshHeight.postMessage();
67        }
68    }
69    console.log(count + "个函数已增加")
70}
71$(function () {
72    //获取用户中心地址
73    umsDomain = $("#umsDomain").data("domain") || umsDomain;
74    eduDomain = $("#eduDomain").data("domain") || eduDomain;
75    $("body").delegate(".video_box a,.act_box a", "click", function (e) {
76        e.stopPropagation();
77    });
78    $("body").delegate(".video_lecturer a,.act_logos a", "mouseover",
79        function (e) {
80            e.stopPropagation();
81        });
82    $("body").delegate(".video_layout .video_box,.gridlay .video_box", "click",
83        function () {
84            $(this).find(".video_bg a")[0].click();
85        });
86    $("body").delegate(".act_box", "click", function (e) {
87        $(this).find(".act_bg a")[0].click();
88    });
89
90    //绑定回复字数限制事件
91    $("body").delegate(".js_limitCont", "input", function () {
92        var wordLength = $(this).val().length;
93        if (wordLength > 200) {
94            $(this).val($(this).val().substr(0, 200))
95        } else {
96            $(this).siblings(".js_wordLimit").text("还可输入" + (200 - wordLength) + "字");
97        }
98    });
99
100    if (!isMobile()) {
101        // 课程的事件处理
102        $("body").delegate(".video_layout .video_box,.gridlay .video_box",
103            "mouseover", function () {
104                $(this).css("cursor", "pointer");
105                $(this).find(".video_txt h5 a").addClass("hover");
106                $(this).find("a[class^=icon]").addClass("hover");
107            });
108        $("body").delegate(".video_layout .video_box,.gridlay .video_box",
109            "mouseout", function () {
110                $(this).css("cursor", "");
111                $(this).find(".video_txt h5 a").removeClass("hover");
112                $(this).find("a[class^=icon]").removeClass("hover");
113            });
114
115        // 活动的列表事件处理
116        $("body").delegate(".act_box", "mouseover", function (e) {
117            $(this).css("cursor", "pointer")
118            $(this).find(".act_caption h5 a").addClass("hover");
119        });
120        $("body").delegate(".act_box", "mouseout", function (e) {
121            $(this).css("cursor", "");
122            $(this).find(".act_caption h5 a").removeClass("hover");
123        });
124    }
125    //open native
126    if (typeof pushVideoDetail == 'function') {
127        $("a").click(function (e) {
128            var url = $(this).attr("href");
129            var courseid = 0;
130            var courseReg = /(meia.me\/)?course\/(\d+)\/?.*?/ig;
131            var match = courseReg.exec(url);
132            if (match && match.length == 3) {
133                courseid = match[2];
134                if (courseid > 0) {
135                    e.preventDefault();
136                    pushVideoDetail(courseid);
137                }
138            }
139        });
140    }
141
142    //编辑器内图片控制
143    if ($(window).width() < 767) {
144        $("._js_editorImg img").parent().css({
145            "display": "block",
146            "margin-left": "-25px",
147            "margin-right": "-25px",
148            "text-align": "center"
149        });
150    }
151});
152
153function hideHeader() {
154    $(".nav_navbar").hide();
155    $(".main-container").css("top", 0);
156    $(".bottom_banner").css("top", 0);
157    $(".footbar").css("top", 0);
158}
159
160function escapeHTML(a) {
161    a = "" + a;
162    return a.replace("<", "&lt;").replace(">", "&gt;").replace("&", "&amp;")
163        .replace('"', "&quot;").replace("'", "&apos;").replace("'", "&#39;").replace("\\", "&#92;");
164}
165
166function unescapeHTML(a) {
167    a = "" + a;
168    return a.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&")
169        .replace(/&quot;/g, '"').replace(/&apos;/g, "'").replace(/&#39;/g, "'").replace(/&#92;/g, "\\");
170}
171
172function isWechat() {
173    var ua = navigator.userAgent.toLowerCase();
174    return /micromessenger/i.test(ua) || /windows phone/i.test(ua);
175}
176
177function isMobile() {
178    return navigator.userAgent.indexOf("iPad") == -1
179        && (/AppleWebKit.*Mobile/i.test(navigator.userAgent) || (/MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE/
180            .test(navigator.userAgent)));
181}
182
183function isPhone(number) {
184    return /^(0|86|17951)?(13|14|15|16|17|18|19)[0-9]{9}$/.test(number);
185}
186
187function isEmail(str) {
188    return /^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/.test(str);
189}
190
191function formatePrice(price) {
192    price = parseFloat(price) || 0;
193    if (price == 0)
194        return "0";
195    else
196        return price.toFixed(2);
197}
198
199function getQuery(name) {
200    return location.href.match(new RegExp('[?#&]' + name + '=([^?#&]+)', 'i')) ? RegExp.$1 : '';
201}
202
203function getShareImg() {
204    var share_img = "";
205    $("img").each(function () {
206        var imgSrc = getImgSrc($(this).attr("src"));
207        if ($(this).height() >= 100 && imgSrc.indexOf("/u/") != -1) {
208            share_img = imgSrc;
209            return false;
210        }
211    })
212    return share_img;
213}
214
215function getImgSrc(imgSrc) {
216    var protocol = window.location.protocol;
217    var host = window.location.host;
218    var paths = window.location.pathname;
219    var path = paths.split("/");
220    var realPath = "";
221    for (var i = 0; i < path.length - 1; i++) {
222        realPath += path[i] + "/";
223    }
224    if (imgSrc.indexOf("http://") == 0 || imgSrc.indexOf("https://") == 0) {
225        imgSrc = imgSrc;
226    } else if (imgSrc.indexOf("//") == 0) {
227        imgSrc = protocol + imgSrc;
228    } else if (imgSrc.indexOf("/") == 0) {
229        imgSrc = protocol + "//" + host + imgSrc;
230    } else {
231        if (imgSrc != '') {
232            imgSrc = protocol + "//" + host + realPath + imgSrc;
233        }
234    }
235    return imgSrc;
236}
237
238function getDate(n) {
239    var today = new Date();
240    today.setHours(0);
241    today.setMinutes(0);
242    today.setSeconds(0);
243    today.setMilliseconds(0);
244    var oneday = 24 * 60 * 60 * 1000;
245    return new Date(today.getTime() + n * oneday);
246}
247
248//返回时间的星期几和日期
249function humanDate(dateStr) {
250    var weeks = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
251    var d = new Date(dateStr);
252    var week = weeks[d.getDay()];
253
254    var beforeTomorrow = getDate(1).getTime() - d.getTime();
255    var duration = d.getTime() - new Date().getTime();
256
257    var oneday = 24 * 60 * 60 * 1000;
258    if (duration > beforeTomorrow && duration < beforeTomorrow + oneday) {
259        return "明天 " + week + " " + dateStr.substring(10, 16);
260    } else if (duration < beforeTomorrow) {
261        return "今天 " + week + " " + dateStr.substring(10, 16);
262    } else {
263        return (d.getMonth() + 1) + "月" + d.getDate() + "日 " + week + " " + dateStr.substring(10, 16);
264    }
265}
266
267//返回时间相差的几分几秒
268function timeDiff(time1, time2) {
269    var t1 = new Date(time1);
270    var t2 = new Date(time2);
271    var duration = t1.getTime() - t2.getTime();
272    var hour = parseInt((duration * 1.0 / 1000 / 60 / 60));
273    var minute = parseInt((duration * 1.0 / 1000 / 60) % 60);
274    var second = parseInt((duration * 1.0 / 1000) % 60);
275    if (hour >= 24) {
276        return Math.floor(hour / 24) + "天" + (hour % 24) + "小时" + (minute >= 10 ? minute : "0" + minute) + "分";
277    } else if (second > 0) {
278        return hour + "小时" + (minute >= 10 ? minute : "0" + minute) + "分" + (second >= 10 ? second : "0" + second) + "秒";
279    } else {
280        hour = hour * -1;
281        minute = minute * -1;
282        second = second * -1;
283        if (hour >= 24) {
284            return Math.floor(hour / 24) + "天" + (hour % 24) + "小时" + (minute >= 10 ? minute : "0" + minute) + "分前";
285        } else {
286            return hour + "小时" + (minute >= 10 ? minute : "0" + minute) + "分" + (second >= 10 ? second : "0" + second) + "秒前";
287        }
288    }
289}
290
291function paging(pageID, p, size, sum, fn, param1) {
292    var total = (sum % size == 0) ? (sum / size) : (Math.floor(sum / size) + 1);
293    var options = {
294        currentPage: p,
295        totalPages: total,
296        bootstrapMajorVersion: 3,
297        shouldShowPage: function (type, page, current) {
298            switch (type) {
299                case "first":
300                case "last":
301                    return false;
302                default:
303                    return true;
304            }
305        },
306        itemTexts: function (type, page, current) {
307            switch (type) {
308                case "first":
309                    return "首页";
310                case "prev":
311                    return "<";
312                case "next":
313                    return ">";
314                case "last":
315                    return "末页";
316                case "page":
317                    return page;
318            }
319        },
320        tooltipTitles: function (type, page, current) {
321            switch (type) {
322                case "first":
323                    return "首页";
324                case "prev":
325                    return "上一页";
326                case "next":
327                    return "下一页";
328                case "last":
329                    return "末页";
330                case "page":
331                    return "第" + page + "页";
332            }
333        },
334        itemContainerClass: function (type, page, current) {
335            if (type == 'next' || type == 'prev' || type == 'first'
336                || type == 'last') {
337                return "";
338            } else {
339                return (page === current) ? "active" : "";
340            }
341        },
342        onPageClicked: function (e, originalEvent, type, page) {
343            console.log("page click" + page);
344            if (typeof fn == 'function') {
345                if (param1)
346                    fn.call(this, param1, page, size, sum);
347                else
348                    fn.call(this, page, size, sum);
349            } else {
350                var search = window.location.search;
351                var url = window.location.href;
352                if (typeof urlChange == 'function') {
353                    var data = urlChange();
354                    url = data.url;
355                    search = data.search;
356                }
357                var pRegex = /[\?|&]p=\d+/g
358                var sumRegex = /[\?|&]sum=\d+/g
359                if (search) {
360                    if (pRegex.test(search) && sumRegex.test(search)) {
361                        url = url.replace(/p=\d+/, 'p=' + page)
362                            .replace(/sum=\d+/, 'sum=' + sum);
363                    } else if (pRegex.test(search)) {
364                        url = url.replace(/p=\d+/, 'p=' + page)
365                            + "&sum=" + sum;
366                    } else if (sumRegex.test(search)) {
367                        url = url.replace(/sum=\d+/, 'sum=' + sum)
368                            + "&p=" + page;
369                    } else {
370                        url = url + "&p=" + page + "&sum=" + sum;
371                    }
372                } else {
373                    url = url + "?p=" + page + "&sum=" + sum;
374                }
375                window.location.href = url.replace(/\?+/, "?").replace(/\?&/, "?").replace(/&+/, "&");
376            }
377        }
378    }
379    if (total > 1)
380        $('#' + pageID).bootstrapPaginator(options);
381}
382
383var Cookie = {
384    get: function (k) {
385        return ((new RegExp(["(?:; )?", k, "=([^;]*);?"].join(""))).test(document.cookie) && RegExp["$1"]) || "";
386    },
387    set: function (k, v, e, d) {
388        var date = new Date();
389        var expiresDays = parseInt(e) || 1;
390        date.setTime(date.getTime() + expiresDays * 60 * 60 * 24 * 1000);
391        document.cookie = k + "=" + v + "; expires=" + (e != '' ? date.toGMTString() : "GMT_String") + ";path=/;domain=" + (d || "");
392    },
393    del: function (k) {
394        this.set(k, "", -1);
395    }
396};
397//数则增加contains方法
398Array.prototype.contains = function (item) {
399    return this.indexOf(item) != -1;
400}
401
402function _clearmsg() {
403    $("#loginbox span[id^=msgdiv_]").hide();
404    $("#loginbox input").removeClass("border-red");
405}
406
407function _getLoginHtml(returnURL) {
408    var loginBox = '<div class="loginpup" id="loginbox" style="display:none;">\
409                        <a href="javascript:;" class="icon icon-close"></a>\
410                        <div class="login_center">\
411                            <p class="login_tit">登录 <a class="reg" href="//' + umsDomain + '/account/reg?returnURL=' + returnURL + '">注册&gt;</a></p>\
412                            <form name="loginForm" id="loginForm" class="form-horizontal" method="POST" action="//' + umsDomain + '/account/login"  onsubmit="return _chkLogin();">\
413                                <div class="form-group">\
414                                    <label for="email1">手机号或邮箱</label>\
415                                    <input type="text" class="form-control impt_set1" name="username" value="" placeholder="请输入手机号或邮箱" >\
416                                    <span id="msgdiv_username" class="color-red"></span>\
417                                </div>\
418                                <div class="form-group">\
419                                    <label for="password1">密码</label>\
420                                    <input type="password" class="form-control impt_set1" name="password" placeholder="请输入密码">\
421                                    <span id="msgdiv_password" class="color-red"></span>\
422                                </div>\
423                                <div class="login">\
424                                    <input type="hidden" name="returnURL" value="' + returnURL + '">\
425                                    <span id="msgdiv_error" class="color-red"></span>\
426                                    <button type="submit" class="btn-block btn_set btn_green" onclick="_clearmsg();">登&nbsp;录</button>\
427                                    <div class="thirdparty">\
428                                        <div style="float:left;margin-right:12px;">快捷登录</div>\
429                                        <div class="share">\
430                                            <div class="bdsharebuttonbox bdshare-button-style0-16">\
431                                                <a class="icon icon-weixin-o" href="//' + umsDomain + '/account/wxlogin?returnURL=' + returnURL + '" title="微信登录"></a>\
432                                                <a class="icon icon-qq-o" href="////' + umsDomain + '/account/qqlogin?returnURL=' + returnURL + '" title="qq登录"></a>\
433                                                <a class="icon icon-sina-o" href="////' + umsDomain + '/account/wblogin?returnURL=' + returnURL + '" title="微博登录"></a>\
434                                            </div>\
435                                        </div>\
436                                        <span class="pull-right"><a class="link_blue" href="//' + umsDomain + '/account/forgot?returnURL=' + returnURL + '">忘记密码?</a></span>\
437                                    </div>\
438                                </div>\
439                            </form>\
440                        </div>\
441                    </div>';
442    return loginBox;
443}
444
445function _chkLogin() {
446    if ($("#loginbox input[name=username]").val() == "") {
447        $("#loginbox input[name=username]").addClass("border-red");
448        $("#msgdiv_username").html("手机号或邮箱不能为空").show();
449    } else if ($("#loginbox input[name=password]").val() == "") {
450        $("#loginbox input[name=password]").addClass("border-red");
451        $("#msgdiv_password").html("密码不能为空").show();
452    } else {
453        $.getJSON("//" + umsDomain + "/account/ajaxlogin?callback=?", {
454            "username": $("#loginbox input[name=username]").val(),
455            "password": $("#loginbox input[name=password]").val()
456        }, function (data) {
457            if (data && data["code"] == 0) {
458                $.getScript("//" + umsDomain + "/accountNavbarJs");
459                if (typeof afterlogin == 'function') {
460                    afterlogin.call(this, data);
461                    $("#loginbox").hide();
462                } else {
463                    location.reload();
464                }
465            } else {
466                $("#msgdiv_error").html("账号或密码错误").show();
467            }
468        });
469    }
470    return false;
471}
472
473function _toLogin() {
474    var returnURL = window.location.href;
475    if (isMobile()) {
476        window.location.href = "//" + umsDomain + "/account/login?returnURL=" + returnURL;
477    } else {
478        var loginBox = $("#loginbox");
479        if (!loginBox || loginBox.length == 0) {
480            $("body").append(_getLoginHtml(returnURL));
481            loginBox = $("#loginbox");
482        }
483        $("#loginbox .icon-close").click(function () {
484            $(this).parents("#loginbox").hide();
485        });
486        loginBox.show();
487    }
488}
489
490function _showTip(title, content, delay, buttonName, fn) {
491    var tip = $("._js_tip");
492    var html = [];
493    html.push('<div class="popups _js_tip" style="z-index:99999">');
494    html.push('     <div class="popups_wrap popups_xs">');
495    html.push('         <i class="icon icon-close"></i>');
496    html.push('         <div class="popups_header">');
497    html.push('             <h4>' + title + '</h4>');
498    html.push('         </div>');
499    html.push('         <div class="popups_body">');
500    html.push('             <p class="graycolor">' + content + '</p>');
501    html.push('         </div>');
502    html.push('         <div class="popups_footer text-right">');
503    html.push('             <button type="button" class="btn m_gnbtn js_close">' + (buttonName ? buttonName : "确定") + '</button>');
504    html.push('         </div>');
505    html.push('     </div>');
506    html.push('</div>');
507    if (!tip || tip.length == 0) {
508        $("body").append(html.join(''));
509        tip = $("._js_tip");
510    } else {
511        tip.remove();
512        $("body").append(html.join(''));
513    }
514    $("._js_tip .icon-close").click(function () {
515        $(this).parents("._js_tip").hide();
516    });
517    $("._js_tip .js_close").click(function () {
518        $(this).parents("._js_tip").hide();
519        if (typeof fn == 'function') {
520            fn.call(this);
521        }
522    });
523    if (delay && delay > 0) {
524        setTimeout(function () {
525            $("._js_tip").hide();
526        }, delay);
527    }
528}
529
530function _showToast(content, point, unit) {
531    if (!content) return;
532    var t = new Date().getTime();
533
534    if ($("#toast_container").length == 0) {
535        $("body").append('<div id="toast_container" class="toast_container"></div>');
536    }
537    var selecter = "#toast_" + t;
538
539    // var scrollTop = $(window).scrollTop();
540    // $("#toast_container").css("top", scrollTop + 60);
541
542    if (document.body.clientWidth <= 1200) {
543        $("#toast_container").css("right", 0);
544    } else {
545        var right = (document.body.clientWidth - 1200) / 2;
546        $("#toast_container").css("right", right.toFixed(0));
547    }
548
549    var toast = [];
550    toast.push('<div id="toast_' + t + '" class="toast toast_success">');
551    toast.push('<i class="icon icon-close"></i>');
552    toast.push(content);
553    if (point) {
554        toast.push('<small>+</small><span>' + point + '</span>');
555        if (unit) {
556            toast.push(unit);
557        }
558    }
559    toast.push('</div>');
560
561    $("#toast_container").prepend(toast.join(''));
562
563    $(selecter).fadeIn(600).delay(3600).fadeOut('slow', function () {
564        $(this).remove();
565    });
566
567    $(selecter).find(".icon-close").click(function () {
568        $(selecter).remove();
569    });
570};
571
572//小窗口
573function minPlayer(id, right, top, width) {
574    if (!isMobile()) {
575        var hasMin = false;
576        var selector = "#" + id;
577        $(window).scroll(function () {
578            var originWidth = $(selector).width();
579            var originHeight = $(selector).height();
580            var height = width * originHeight / originWidth;
581            var video = $(selector + " object");
582            if (video.length == 0) {
583                video = $(selector + " .pv-video-wrap");
584            }
585            if ($(this).scrollTop() >= originHeight) {
586                if (!hasMin) {
587                    hasMin = true;
588                    $(selector).css({
589                        "width": originWidth,
590                        "height": originHeight
591                    });
592                    video.css({
593                        "position": "fixed",
594                        "z-index": "10000",
595                        "right": right,
596                        "top": top,
597                        "width": width - 2,
598                        "border": "1px solid #ccc",
599                        "box-shadow": "0 0 14px 5px rgba(153, 153, 153, .45)",
600                        "height": height
601                    });
602                }
603            } else {
604                if (hasMin) {
605                    hasMin = false;
606                    video.attr("style", "");
607                    video.css({
608                        "width": originWidth,
609                        "height": originHeight
610                    });
611                }
612            }
613        });
614    }
615}
616
617(function (window, undefined) {
618    var meiaShare = {
619        config: {},
620
621        init: function (cfg) {
622            this.config.target = cfg ? cfg.target : "";//selector
623            this.config.event = cfg ? cfg.event : "click";
624            this.config.shareImg = "";
625            this.config.shareText = "";
626            this.config.shareDesc = "";
627            this.config.shareUrl = "";
628
629            this._bindConfigEvent();
630        },
631
632        setShareInfo: function (img, text, desc, url) {
633            this.config.shareImg = img;
634            this.config.shareText = text;
635            this.config.shareDesc = desc;
636            this.config.shareUrl = url;
637        },
638
639        _bindShareEvent: function () {
640            if (isWechat()) {
641                $(".bdsharebuttonbox a").each(function () {
642                    var _this = $(this);
643                    _this.click(function () {
644                        var cmd = _this.data("cmd");
645                        switch (cmd) {
646                            case 'weixin':
647                                meiaShare._wechatShare();
648                                break;
649                            case 'tsina':
650                                break;
651                            case 'sqq':
652                                break;
653                            case 'qzone':
654                                break;
655                            default:
656                                break;
657                        }
658                        $.ajax({url: "/sharecallback"})
659                    });
660                });
661            } else {
662                //baidu share
663                window._bd_share_config = {
664                    common: {
665                        onBeforeClick: setShareUrl,
666                        bdText: this.config.shareText,
667                        bdDesc: this.config.shareDesc,
668                        bdPic: this.config.shareImg,
669                        bdUrl: this.config.shareUrl
670                    }, share: [{
671                        onBeforeClick: setShareUrl,
672                        "tag": "share_baidu",
673                        bdText: this.config.shareText,
674                        bdDesc: this.config.shareDesc,
675                        bdPic: this.config.shareImg,
676                        bdUrl: this.config.shareUrl
677                    }]
678                };
679                with (document) 0[(getElementsByTagName('head')[0] || body).appendChild(createElement('script')).src = 'http://bdimg.share.baidu.com/static/api/js/share.js?cdnversion=' + ~(-new Date() / 36e5)];
680                //baidu share
681                var setShareUrl = function (cmd, config) {
682                    $.ajax({url: "/sharecallback"})
683                    config.bdText = this.config.shareText;
684                    config.bdDesc = this.config.shareDesc;
685                    config.bdPic = this.config.shareImg;
686                    config.bdUrl = this.config.shareUrl;
687                    return config;
688                }
689            }
690            if (typeof ZeroClipboard == 'undefined') {
691                $.getScript("//cdn.meia.me/public/js/zeroclipboard/ZeroClipboard.min.js", function () {
692                    var client = new ZeroClipboard($(".js_zeroclipboard"));
693                    client.on("ready", function (readyEvent) {
694                        client.on('copy', function (event) {
695                            event.clipboardData.setData('text/plain', meiaShare.config.shareUrl);
696                        });
697                        client.on("aftercopy", function (event) {
698                            _showTip("美啊提示", "已复制 <a target='_blank' href='" + event.data["text/plain"] + "'>" + event.data["text/plain"] + "</a> 到剪切板");
699                        });
700                    });
701                });
702            }
703        },
704
705        _bindConfigEvent: function () {
706            if (!this.config.event || this.config.event == '') return;
707            if (this.config.event == 'hover') {
708                $(this.config.target).each(function () {
709                    var _this = $(this);
710                    _this.hover(function () {
711                        meiaShare.setShareInfo(_this.data("img"), _this.data("text"), _this.data("desc"), _this.data("url"));
712                        if ($(".js_hover_share").length > 0) {
713                            $(".js_hover_share").appendTo(_this);
714                        } else {
715                            _this.append(meiaShare._buildHoverBox());
716                            meiaShare._bindShareEvent();
717                        }
718                        $(".js_hover_share").show();
719                    }, function (e) {
720                        $(".js_hover_share").hide();
721                    });
722                })
723            }
724        },
725
726        _buildHoverBox: function () {
727            var html = [];
728            html.push('<div class="js_hover_share share">');
729            html.push('    <div class="bdsharebuttonbox" data-tag="share_baidu">');
730            html.push('        <a class="icon icon-weixin-o" data-cmd="weixin" href="javascript:void(0);" title="分享到微信"></a>');
731            html.push('        <a class="icon icon-sina-o" data-cmd="tsina" href="javascript:void(0);" title="分享到新浪微博"></a>');
732            html.push('        <a class="icon icon-qq-o" data-cmd="sqq" href="javascript:void(0);" title="分享到QQ"></a>');
733            html.push('        <a class="icon icon-qzone-o" data-cmd="qzone" href="javascript:void(0);" title="分享到QQ空间"></a>');
734            html.push('        <a class="icon icon-copy-o js_zeroclipboard" href="javascript:void(0);" title="复制链接"></a>');
735            html.push('   </div>');
736            html.push('</div>');
737            return html.join("");
738        },
739
740        _wechatShare: function () {
741            if ($(".wechat_mask").length == 0) {
742                var wechat_mask = '<div class="wechat_mask" style="display:none;">\
743            <div class="share">\
744            <img src="//cdn.meia.me/public/images/wechat-share.png" alt="">\
745            </div>\
746            </div>';
747                $("body").append(wechat_mask);
748                $(".wechat_mask").click(function () {
749                    $(this).hide();
750                })
751            }
752            $(".wechat_mask").show();
753        }
754    }
755    window.meiaShare = meiaShare;
756})(window);
757
758function isSupportHTML5() {
759    return typeof(Worker) !== "undefined";
760}
761
762//公共方法
763function getTitle() {
764    var title = $("title").html() || "美啊-见证设计的力量";
765    if (typeof sharename != 'undefined' && sharename.trim() != '') {
766        title = sharename;
767    }
768    if (typeof shareText != 'undefined' && shareText.trim() != '') {
769        title = shareText;
770    }
771    return title;
772}
773
774function getDescription() {
775    var desc = $("meta[name=description]").attr("content") || "meia.me是中国首个创意设计与时尚美学在线教育平台。聚集全球精彩的体验设计、设计思维、艺术、美学类的技能教学、知识结构、专家观点、人物访谈、大师讲座等系列视频,为您提供一个在线学习、专家指导、实践练习、互动交流的平台!";
776    if (typeof shareDesc != 'undefined' && shareDesc.trim() != '') {
777        desc = shareDesc;
778    }
779    return desc;
780}
781
782function getImage() {
783    var imgUrl = "";
784    if (typeof courseImg != 'undefined') {
785        imgUrl = courseImg;
786    } else {
787        imgUrl = getShareImg();
788    }
789    return imgUrl;
790}
791
792function showGift(jinqian) {
793    if (!jinqian) {
794        return;
795    }
796    if ($(".js_gift").length > 0) {
797        $(".js_gift .js_gift_jinqian ").html(jinqian + '元');
798    } else {
799        var html = '<div class="js_gift popups_act">\
800                    <div class="popups_wrap">\
801                    <div class="popups_slot">\
802                    <span class="js_gift_jinqian">' + jinqian + '元</span>\
803                </div>\
804                <a href="//' + umsDomain + '/ucenter/myticket" class="popups_invite">查看我的优惠券></a>\
805                    <p class="popups_tip">完成积分任务,还能赠送10倍积分哦!</p>\
806                </div>\
807                </div>';
808        $('body').append(html);
809    }
810    $(".js_gift").show();
811
812    $(".js_gift").click(function (e) {
813        var _con = jQuery(".js_gift .popups_view");
814        var _con1 = jQuery(".js_gift .popups_invite");
815        if (!_con.is(e.target) && !_con.has(e.target).length > 0
816            && !_con1.is(e.target) && !_con1.has(e.target).length > 0) {
817            $(this).hide();
818        }
819    })
820}
821
822function openApp(courseid) {
823    var useragent = navigator.userAgent;
824    var isAndroid = (useragent.match(/(Android);?[\s\/]+([\d.]+)?/)) ? true : false;
825    var isIpad = (useragent.match(/(iPad).*OS\s([\d_]+)/)) ? true : false;
826    var isIphone = (!isIpad && useragent.match(/(iPhone\sOS)\s([\d_]+)/)) ? true : false;
827    var isSafari = (isIpad || isIphone) && useragent.match(/Safari/);
828
829    var url = "";
830
831    if (isAndroid) {
832        //url = "intent://$util.eduDomain()/#Intent;scheme=openmeia/index;package=me.meia.app.meia;end";
833        if (courseid) {
834            url = "meia://$util.eduDomain()?courseid=" + courseid;
835        } else {
836            url = "meia://$util.eduDomain()";
837        }
838    } else if (isIpad || isIphone || isSafari) {
839        if (courseid) {
840            url = "usermeia://courseid=" + courseid;
841        } else {
842            url = "usermeia://meia=home";
843        }
844    }
845
846    if (url != '') {
847        var t = 1000, isInstall = true;
848        setTimeout(function () {
849            if (isInstall) {
850                window.location = url;
851            } else {
852                window.location = "//a.app.qq.com/o/simple.jsp?pkgname=me.meia.app.meia";
853            }
854            document.body.removeChild(ifr);
855        }, 2000)
856
857        var t1 = Date.now();
858        var ifr = document.createElement("iframe");
859        ifr.setAttribute('src', url);
860        ifr.setAttribute('style', 'display:none');
861        document.body.appendChild(ifr);
862        setTimeout(function () {
863            var t2 = Date.now();
864            if (!t1 || t2 - t1 < t + 100) {
865                isInstall = false;
866            }
867        }, t);
868    } else {
869        window.location = "//a.app.qq.com/o/simple.jsp?pkgname=me.meia.app.meia";
870    }
871}

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.