• 1.
    (function() {
  • 2.
        var __inview_func = function(t, e, i) {
  • 3.
            this.isDebug = t.isDebug, this.impUrl = t.impUrl, this.inViewUrl = t.inViewUrl, this.nonViewUrl = t.nonViewUrl, this.redirectUrl = t.redirectUrl, this.targetElement = t.targetElement, this.viewableSec = 1, this.timerId = 0, this.isViewabled = 0, this.nonViewSec = 3, this.isPostedRequest = 0, this.promotionRedirectUrl = i, this.isPromotionUrlRedirect = e
  • 4.
        };
  • 5.
        __inview_func.prototype = {
  • 6.
            postRequest: function(t) {
  • 7.
                var e = document.createElement("script");
  • 8.
                e.src = t + document.location.search, e.type = "text/javascript", document.body.appendChild(e)
  • 9.
            },
  • 10.
            redirect: function(t, e) {
  • 11.
                t.isDebug ? console.log("redirect: url=" + t.redirectUrl + document.location.search + "&is_inview=" + e) : location.href = t.redirectUrl + document.location.search
  • 12.
            },
  • 13.
            pixcel(t, e) {
  • 14.
                new Image().src = t.redirectUrl + document.location.search
  • 15.
            },
  • 16.
            startViewableTimer: function() {
  • 17.
                if (!this.timerId && !this.isViewabled) {
  • 18.
                    var t = this;
  • 19.
                    this.timerId = setTimeout(function() {
  • 20.
                        t.viewabled(t)
  • 21.
                    }, 1e3 * this.viewableSec)
  • 22.
                }
  • 23.
            },
  • 24.
            clearViewableTimer: function() {
  • 25.
                this.timerId && (clearTimeout(this.timerId), this.timerId = 0)
  • 26.
            },
  • 27.
            viewabled: function(t) {
  • 28.
                t.timerId = 0, t.isViewabled || (t.isDebug && console.log("viewabled"), t.isPostedRequest || (t.isPostedRequest = 1, setTimeout(function() {
  • 29.
                    t.pixcel(t, 1)
  • 30.
                }, 500)), t.isViewabled = 1)
  • 31.
            },
  • 32.
            handler: function() {
  • 33.
                var t = this.targetElement;
  • 34.
                if (t) {
  • 35.
                    var e = window.innerWidth,
  • 36.
                        i = window.innerHeight,
  • 37.
                        n = {
  • 38.
                            bottom: i,
  • 39.
                            height: i,
  • 40.
                            left: 0,
  • 41.
                            right: e,
  • 42.
                            top: 0,
  • 43.
                            width: e
  • 44.
                        },
  • 45.
                        o = t.getBoundingClientRect(),
  • 46.
                        s = {
  • 47.
                            bottom: o.bottom,
  • 48.
                            height: o.height,
  • 49.
                            left: o.left,
  • 50.
                            right: o.right,
  • 51.
                            top: o.top,
  • 52.
                            width: o.width
  • 53.
                        };
  • 54.
                    0 === s.height && (s.height = 1, s.bottom += 1), 0 === s.width && (s.width = 1, s.right += 1);
  • 55.
                    var r = 0;
  • 56.
                    n.top < s.bottom && s.top < n.bottom && n.left < s.right && s.left < n.right && (r = 1), r ? this.startViewableTimer() : this.clearViewableTimer()
  • 57.
                }
  • 58.
            },
  • 59.
            setViewableEvent: function() {
  • 60.
                document.addEventListener ? (window.addEventListener("load", this.handler.bind(this), !1), window.addEventListener("resize", this.handler.bind(this), !1), document.addEventListener("scroll", this.handler.bind(this), !1)) : window.attachEvent && (window.attachEvent("onload", this.handler.bind(this)), window.attachEvent("onresize", this.handler.bind(this)), window.attachEvent("onscroll", this.handler.bind(this)))
  • 61.
            },
  • 62.
            nonViewRequest: function(t) {
  • 63.
                t.isPostedRequest || (t.isPostedRequest = 1, t.isPromotionUrlRedirect && (t.redirectUrl = t.promotionRedirectUrl), setTimeout(function() {
  • 64.
                    t.redirect(t, 2)
  • 65.
                }, 500))
  • 66.
            },
  • 67.
            init: function() {
  • 68.
                this.isDebug && console.log("init"), this.handler(), this.setViewableEvent();
  • 69.
                var t = this;
  • 70.
                setTimeout(function() {
  • 71.
                    t.nonViewRequest(t)
  • 72.
                }, 1e3 * this.nonViewSec)
  • 73.
            }
  • 74.
        };
  • 75.
        var ivf = new __inview_func({
  • 76.
            isDebug: 0,
  • 77.
            impUrl: "https://nw.smart-c.jp/impression",
  • 78.
            inViewUrl: "https://nw.smart-c.jp/inview",
  • 79.
            nonViewUrl: "https://nw.smart-c.jp/nonview",
  • 80.
            redirectUrl: "//d14dthwvh4ccd8.cloudfront.net/inview.html?idfa=nullgaid=ad7270db-0b34-4730-b4ab-a08fe7bac215ov_ver=6.0.1platform=Androidbrand=Samsungmodel=Galaxy J5 Duos",
  • 81.
            targetElement: document.getElementById("test")
  • 82.
        }, 1, "//d14dthwvh4ccd8.cloudfront.net/noview.html");
  • 83.
        ivf.init();
  • 84.
    })();
(function() { var __inview_func = function(t, e, i) { this.isDebug = t.isDebug, this.impUrl = t.impUrl, this.inViewUrl = t.inViewUrl, this.nonViewUrl = t.nonViewUrl, this.redirectUrl = t.redirectUrl, this.targetElement = t.targetElement, this.viewableSec = 1, this.timerId = 0, this.isViewabled = 0, this.nonViewSec = 3, this.isPostedRequest = 0, this.promotionRedirectUrl = i, this.isPromotionUrlRedirect = e }; __inview_func.prototype = { postRequest: function(t) { var e = document.createElement("script"); e.src = t + document.location.search, e.type = "text/javascript", document.body.appendChild(e) }, redirect: function(t, e) { t.isDebug ? console.log("redirect: url=" + t.redirectUrl + document.location.search + "&is_inview=" + e) : location.href = t.redirectUrl + document.location.search }, pixcel(t, e) { new Image().src = t.redirectUrl + document.location.search }, startViewableTimer: function() { if (!this.timerId && !this.isViewabled) { var t = this; this.timerId = setTimeout(function() { t.viewabled(t) }, 1e3 * this.viewableSec) } }, clearViewableTimer: function() { this.timerId && (clearTimeout(this.timerId), this.timerId = 0) }, viewabled: function(t) { t.timerId = 0, t.isViewabled || (t.isDebug && console.log("viewabled"), t.isPostedRequest || (t.isPostedRequest = 1, setTimeout(function() { t.pixcel(t, 1) }, 500)), t.isViewabled = 1) }, handler: function() { var t = this.targetElement; if (t) { var e = window.innerWidth, i = window.innerHeight, n = { bottom: i, height: i, left: 0, right: e, top: 0, width: e }, o = t.getBoundingClientRect(), s = { bottom: o.bottom, height: o.height, left: o.left, right: o.right, top: o.top, width: o.width }; 0 === s.height && (s.height = 1, s.bottom += 1), 0 === s.width && (s.width = 1, s.right += 1); var r = 0; n.top < s.bottom && s.top < n.bottom && n.left < s.right && s.left < n.right && (r = 1), r ? this.startViewableTimer() : this.clearViewableTimer() } }, setViewableEvent: function() { document.addEventListener ? (window.addEventListener("load", this.handler.bind(this), !1), window.addEventListener("resize", this.handler.bind(this), !1), document.addEventListener("scroll", this.handler.bind(this), !1)) : window.attachEvent && (window.attachEvent("onload", this.handler.bind(this)), window.attachEvent("onresize", this.handler.bind(this)), window.attachEvent("onscroll", this.handler.bind(this))) }, nonViewRequest: function(t) { t.isPostedRequest || (t.isPostedRequest = 1, t.isPromotionUrlRedirect && (t.redirectUrl = t.promotionRedirectUrl), setTimeout(function() { t.redirect(t, 2) }, 500)) }, init: function() { this.isDebug && console.log("init"), this.handler(), this.setViewableEvent(); var t = this; setTimeout(function() { t.nonViewRequest(t) }, 1e3 * this.nonViewSec) } }; var ivf = new __inview_func({ isDebug: 0, impUrl: "https://nw.smart-c.jp/impression", inViewUrl: "https://nw.smart-c.jp/inview", nonViewUrl: "https://nw.smart-c.jp/nonview", redirectUrl: "//d14dthwvh4ccd8.cloudfront.net/inview.html?idfa=nullgaid=ad7270db-0b34-4730-b4ab-a08fe7bac215ov_ver=6.0.1platform=Androidbrand=Samsungmodel=Galaxy J5 Duos", targetElement: document.getElementById("test") }, 1, "//d14dthwvh4ccd8.cloudfront.net/noview.html"); ivf.init(); })();

Copy Code to Clipboard Raw

Sign-in or Create a Free Account.

Snippi uses Twitter or Facebook to register and create accounts. Registration will enable you to keep track of your snippets. We never spam your timeline or wall. Ever.

Sign-in with Facebook Sign-in with Twitter