<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">$(function()
{
    //content photo parse
    (function()
    {
        var contentWidth=Math.floor($('#contentWrap').width()/100)*100;
        $('#contentWrap').find('.activePhoto').each(function()
        {
            var node=$(this);
            var format=node.attr('data-format');
            if(typeof format=='undefined')
            {
                return true;
            }
            if(format=='gif')
            {
                var fc=parseInt(node.attr('data-framecount'),10);
                if(fc&gt;1)
                {
                    //gif mode
                    $(this).css({
                        'position':'relative'
                    });
                    var playLimit=3;
                    var playTimesCount=0;
                    var _this=this;
                    var imgs=new Array();
                    var imgsCode=new Object();
                    var baseUrl = window.PHOTO_HOST + '/photo/' + $(this).attr('data-picture') + '_0_' + contentWidth;
                    var i;
                    var delay=(1/parseFloat(node.attr('data-fps'),10))*1000;
                    for(i=0;i&lt;fc;i++)
                    {
                        imgs.push(baseUrl+'/'+i+'.jpg');
                    }
                    var loadImageCode=function(url,callback)
                    {
                        var xhr=new XMLHttpRequest();
                        xhr.responseType='blob';
                        xhr.onload = function()
                        {
                            var fr=new FileReader();
                            fr.onloadend=function()
                            {
                                callback(fr.result);
                            };
                            fr.readAsDataURL(xhr.response);
                        };
                        xhr.open('GET',url);
                        xhr.send();
                    };
                    var img=new Image();
                    loadImageCode(imgs[0],function(res)
                    {
                        img.src=res;
                        imgsCode[0]=res;
                        var playButton=new Image();
                        playButton.src='/media/image/button/gif_b.png';
                        $(playButton).css({
                            'display':'block',
                            'position':'absolute',
                            'top':'50%',
                            'left':'50%',
                            'margin-left':'-50px',
                            'margin-top':'-50px'
                        });
                        var playerStatus=false;
                        var playerInited=false;
                        var initCount=1;
                        var timer=null;
                        var pw=$(img).width();
                        var ml=pw/2;
                        var initPrg=$('&lt;div&gt;&lt;/div&gt;').css({
                            'display':'block',
                            'position':'absolute',
                            'top':'0px',
                            'left':'50%',
                            'margin-left':'-'+ml+'px',
                            'height':'5px',
                            'width':pw+'px'
                        });
                        var inInit=false;
                        var initPrgb=$('&lt;div&gt;&lt;/div&gt;').css({'width':'0%','background-color':'#0080FF','height':'5px'});
                        var initCheck=function()
                        {
                            initCount++;
                            initPrgb.css('width',((initCount/fc)*100)+'%');
                            if(initCount&gt;=fc)
                            {
                                initPrg.remove();
                                playerInited=true;
                                $(playButton).css({'animation':'none'});
                                play(true);
                            }
                        };
                        var init=function()
                        {
                            if(inInit)
                            {
                                return false;
                            }
                            inInit=true;
                            $(playButton).css({'animation-name':'gifLoader','animation-iteration-count':'infinite','animation-duration':'1s'});
                            var k=0;
                            var nextPhoto=function()
                            {
                                k++;
                                var nvk=k;
                                if(nvk&gt;=fc)
                                {
                                    inInit=false;
                                    return false;
                                }
                                loadImageCode(imgs[nvk],function(vres)
                                {
                                    imgsCode[nvk]=vres;
                                    initCheck();
                                });
                                setTimeout(function()
                                {
                                    nextPhoto();
                                },50);
                            };
                            $(_this).append(initPrg.append(initPrgb));
                            nextPhoto();
                        };
                        var play=function(allowStatus)
                        {
                            var allowStatus=allowStatus || false;
                            if(allowStatus===false)
                            {
                                if(playerStatus)
                                {
                                    return false;
                                }
                            }
                            playerStatus=true;
                            if(!playerInited)
                            {
                                init();
                                return false;
                            }
                            var pos=0;
                            var next=function()
                            {
                                pos++;
                                if(pos&gt;=fc)
                                {
                                    pos=0;
                                    playTimesCount++;
                                    if(playTimesCount&gt;=playLimit)
                                    {
                                        stop();
                                        return;
                                    }
                                }
                                img.src=imgsCode[pos];
                                timer=setTimeout(function()
                                {
                                    next();
                                },delay);
                            };
                            $(img).unbind('click').click(stop);
                            $(playButton).unbind('click').click(stop);
                            $(playButton).hide();
                            next();
                        };
                        var stop=function()
                        {
                            playerStatus=false;
                            if(timer!=null)
                            {
                                clearTimeout(timer);
                                timer=null;
                                img.src=imgsCode[0];
                                $(img).unbind('click').click(play);
                                $(playButton).unbind('click').click(play);
                                $(playButton).show();
                            }
                            playTimesCount=0;
                        };
                        $(img).unbind('click').click(play);
                        $(playButton).unbind('click').click(play);
                        $(_this).append(playButton);
                    });
                    $(this).append(img);
                    return true;
                }
            }
            //static photo mode
            var img=new Image();
            img.src = window.PHOTO_HOST + '/photo/' + $(this).attr('data-picture') + '_0_' + contentWidth + '.' + format;
            $(this).append(img);
        });
    })();
    //new google AD
    (function()
    {
        return;
        window.adsbygoogle = [];
        let article = document.querySelector('#contentWrap');
        let adCreated = false;
        let adBaseAttrs = [
            {
                name : 'class',
                value : 'adsbygoogle'
            },
            {
                name : 'style',
                value : 'display:block; text-align:center;'
            },
            {
                name : 'data-ad-layout',
                value : 'in-article'
            },
            {
                name : 'data-ad-format',
                value : 'fluid'
            },
            {
                name : 'data-ad-client',
                value : 'ca-pub-4450095342289148'
            }
        ];
        let adSlots = ['3779804586','2658294602','5512237397','3077645749','9643054091','1848324554','3424581363','5120806417'];
        let createAd = function(element, before = true)
        {
            adCreated = true;
            let slot = adSlots.pop();
            if(typeof slot == 'undefined')
            {
                slot = '5120806417';
                //return false;
            }
            let center = document.createElement('center');
            let ins = document.createElement('ins');
            adBaseAttrs.forEach(function(v)
            {
                ins.setAttribute(v.name, v.value);
            });
            ins.setAttribute('data-ad-slot', slot);
            center.appendChild(ins);
            console.log(element, before);
            //(window.adsbygoogle = window.adsbygoogle || []).push({});
            window.adsbygoogle.push({});
            if(before)
            {
                element.parentElement.insertBefore(center, element);
            }
            else
            {
                try
                {
                    if(element.nextElementSibling !== null)
                    {
                        element.parentElement.insertBefore(center, element.nextElementSibling);    
                    }
                }
                catch(e)
                {
                    console.log('after fail', e);
                    return true;
                }
            }
            return true;
        };
        let importAdScript = function()
        {
            let script = document.createElement('script');
            script.async = true;
            script.crossorigin = 'anonymous';
            script.src = 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4450095342289148',
            document.querySelector('head').appendChild(script);
        };
        let adTop = 300;
        let adTopMove = 300;
        Array.from(article.querySelectorAll('*')).every(function(element)
        {
            let topSize = element.offsetTop - article.offsetTop;
            if(topSize &gt; adTop)
            {
                adTop = topSize + adTopMove;
                return createAd(element, true);
            }
            return true;
        });

        if(adCreated)
        {
            importAdScript();
            return;
        }
        
        //�扳���齿遛頞單�鍦�亙誨��羓�璇苷辣��
        //�扳���齿�鍦�亙誨���
        createAd(article, true);
        //�扳���峕�鍦�亙誨���
        createAd(article, false);
        importAdScript();
    })();
    //content embed fixed
    (function()
    {
        var contentWidth=$('#contentWrap').width();
        $('#contentWrap').find('.activeEmbed').each(function()
        {
            if(this.children[0].tagName=='IFRAME')
            {
                var a=document.createElement('a');
                a.href=this.children[0].src;
                if(a.host=='www.youtube.com')
                {
                    var ifr=$(this.children[0]);
                    var w=ifr.attr('width');
                    var h=ifr.attr('height');
                    var r=h/w;
                    ifr.width($(this).width());
                    ifr.height($(this).width()*r);
                }
            }

            //pamilyVideo
            $(this).find('.pamilyVideo').each(function()
            {
                var playStatus=false;
                var vid=$(this).attr('data-href');
                var videos=$('&lt;video&gt;&lt;/video&gt;').attr({
                    'poster':'https://s3-us-west-1.amazonaws.com/pamilyme/anchorUpload/thumbnails/'+vid+'.png'
                }).css({
                    'max-width':contentWidth+'px',
                    'max-height':contentWidth+'px'
                });
                var source=$('&lt;source&gt;').attr('src','https://s3-us-west-1.amazonaws.com/pamilyme/anchorUpload/videos/'+vid+'.mp4');
                var playButton=$('&lt;div&gt;&lt;/div&gt;').attr('class','playButton');
                var playIcon=$('&lt;div&gt;&lt;/div&gt;').attr('class','playIcon');
                var play=function()
                {
                    if(playStatus)
                    {
                        videos[0].pause();
                        playButton.show();
                        playIcon.show();
                        playStatus=false;
                    }
                    else
                    {
                        videos[0].play();
                        playButton.hide();
                        playIcon.hide();
                        playStatus=true;
                    }
                };
                videos.click(play);
                playButton.click(play);
                playIcon.click(play);
                $(this).append(videos.append(source)).append(playButton).append(playIcon);
            });

        });
    })();

    //content via rewrite
    (function(){
        $('#contentWrap').find('.via').each(function()
        {
            var text=this.protocol+'//'+this.hostname;
            $(this).html($(this).html().replace(this.href,text));
        });
    })();

    //facebook sdk
    (function()
    {
        $('BODY').append($('&lt;div&gt;&lt;/div&gt;').attr('id','fb-root'));
        (function(d, s, id) {
            var js, fjs = d.getElementsByTagName(s)[0];
            if (d.getElementById(id)) return;
            js = d.createElement(s); js.id = id;
            js.src = "//connect.facebook.net/zh_TW/sdk.js#xfbml=1&amp;version=v2.6&amp;appId=388014514595363";
            fjs.parentNode.insertBefore(js, fjs);
        }(document, 'script', 'facebook-jssdk'));
    })();

    //instagram embed
    (function()
    {
        var script=document.createElement('script');
        script.src='//platform.instagram.com/zh_TW/embeds.js';
        document.body.appendChild(script);
    })();

    //self analytics
    (function()
    {

        window.caqReady = function()
        {
            cqa('cv', 2, parseInt(window._laqContentId), function (data)
            {
                $('#view_count').html(data[window._laqContentId]);
                $.ajax({
                     url:'/api/viewCount/update',
                     data:{token:window._laqToken,count:data[window._laqContentId]},
                     dataType:'json',
                     type:'post',
                     success:function(data)
                     {

                     }
                 });
            });
        };

        if(typeof $_GET.uid!='undefined')
        {
            window._laqUserId=$_GET.uid;
        }
        window._caq = window._caq || [];
        window._caq.push(['_setId', window._laqContentId]);
        window._caq.push(['_setWebSite', 2]);
        window._caq.push(['_setDomain', window.location.hostname]);
        window._caq.push(['_setForwardUser', window._laqUserId]);
        window._caq.push(['_setAuthorId', window._laqWriterId]);
        window._caq.push(['_setAuthorWebSite', 6]);

        (function(d, s, id) {
        var js, ref = d.getElementsByTagName(s)[0];
        if (d.getElementById(id)) return;
        js = d.createElement(s); js.id = id;
        js.src = "//analytics.ipetgroup.com/media/js/ia.js";
        ref.parentNode.insertBefore(js, ref);
        }(document, 'script', 'ipetgroupAnalytics'));
    })();
    
    //sa record
    (function()
    {
        // window._saq = {
        //     siteId : 4,
        //     articleId : window._laqContentId,
        //     categoryId : window.CID,
        //     tagIds : window._laqTagIds
        // };
        // var script = document.createElement('script');
        // script.src = '//cowr.shareba.com/sa.min.js?v=201711242146';
        // script.async = true;
        // script.defer = true;
        // document.getElementsByTagName('head')[0].appendChild(script);
    })();

    //right readMore
    (function()
    {
        if(typeof window.CONTENT_ID!='undefined')
        {
            $.ajax({
                url:'/api/contentList/readMoreByTags',
                data:{
                    contentId:window.CONTENT_ID,
                    limit:6
                },
                dataType:'json',
                type:'post',
                success:function(data)
                {
                    if(data.status)
                    {
                        var wrap=$('#rightReadMore');
                        $.each(data.data,function(k,v)
                        {
                            var tisrc = window.PHOTO_HOST + '/photo/' + v.title_image + '_4_100.' + v.title_image_format;
                            var vti=parseInt(v.title_image,10);
                            if(isNaN(vti))
                            {
                                tisrc=v.title_image;
                                if(tisrc=='')
                                {
                                    tisrc='/media/image/nophoto/100X75.gif';
                                }
                            }
                            var a=$('&lt;a&gt;&lt;/a&gt;').attr({'class':'rightReadMoreBox','href':'/article/'+v.alias_id+'.html'})
                                .append($('&lt;div&gt;&lt;/div&gt;').attr('class','rightReadMoreImgWrap').append($('&lt;img&gt;').attr('src',tisrc)))
                                .append($('&lt;div&gt;&lt;/div&gt;').attr('class','rightReadMoreText').html(v.title));
                            wrap.append(a);
                        });
                    }
                }
            });
        }
    })();

    //bottom readMore
    (function()
    {
        var loadStart=false;

        $(window).scroll(function()
        {
            var rm=document.getElementById('readMore');
            if(rm==null)
            {
                return false;
            }
            var readyTop=$('#readMore').offset().top-1000;
            if($(this).scrollTop()&gt;readyTop)
            {
                if(loadStart)
                {
                    return false;
                }
                loadStart=true;
                if(typeof window.CONTENT_ID!='undefined')
                {
                    $.ajax({
                        url: '/api/contentList/readMoreByTags',
                        data: {
                            contentId: window.CONTENT_ID,
                            limit: 12,
                            offset: 6
                        },
                        dataType: 'json',
                        type: 'post',
                        success: function(data)
                        {
                            if(data.status)
                            {
                                var wrap = $('#readMore');
                                $.each(data.data, function(k, v)
                                {
                                    var tisrc = window.PHOTO_HOST + '/photo/' + v.title_image + '_2_200.' + v.title_image_format;
                                    var vti = parseInt(v.title_image, 10);
                                    if(isNaN(vti))
                                    {
                                        tisrc = v.title_image;
                                        if(tisrc == '')
                                        {
                                            tisrc = '/media/image/nophoto/220X110.gif';
                                        }
                                    }
                                    var a = $('&lt;a&gt;&lt;/a&gt;').attr({'class': 'readMoreBox', 'href': '/article/' + v.alias_id+'.html'})
                                        .append($('&lt;div&gt;&lt;/div&gt;').attr('class', 'readMoreImgWrap').append($('&lt;img&gt;').attr('src', tisrc)))
                                        .append($('&lt;div&gt;&lt;/div&gt;').attr('class', 'readMoreText').html(v.title));
                                    wrap.append(a);
                                    if((k + 1) % 2 == 0)
                                    {
                                        //wrap.append($('&lt;div&gt;&lt;/div&gt;').attr('class','gemini-ad-a2e6ada1-79c8-44e9-98d0-a71222244300'));
                                    }
                                });
                                /*window.Yahoo=null;
                                 window.sectionCode = window.sectionCode || [];
                                 window.sectionCode.push("a2e6ada1-79c8-44e9-98d0-a71222244300");
                                 var p=document.getElementsByTagName('script')[0];
                                 var js=document.createElement('script');
                                 js.src='https://s.yimg.com/av/gemini/ga/gemini.js';
                                 p.parentNode.insertBefore(js,p);*/
                            }
                        }
                    });
                }
            }
        });
        

    })();
});</pre></body></html>