PageSourceSearch

https://hk.on.cc/module/player/important_live/lib/live/dragpopup.js

js on.cc collected 2026-10-01 09:13:33 UTC 2,811 bytes, 110 lines download raw bytes

1$LiveDOM.prototype.YtMini = {
2    
3  init: function() {
4
5      if (this.config.disableYtMini || this.mobile) return;
6
7      var _this      = this,
8          ctn        = this.ytcontainer[0],
9          YtMini     = this.YtMini,
10          div        = this.$fn.createElement("div","YtMini"),
11          dragDiv    = this.$fn.createElement("div","YtDraggable"),
12          check      = YtMini.check.bind(_this);
13
14      // wrapAll
15      while (ctn.firstChild) {
16          div.appendChild(ctn.firstChild);
17      }
18
19      dragDiv
20          .append(div)
21          .prepend('<div class="YtCloseMini">&#x2715;</div>' +
22                   '<div class="YtpDragCtrl"></div>');
23
24      ctn.appendChild(dragDiv);
25
26      YtMini.check.call(_this);
27      YtMini.drag(dragDiv.find(".YtpDragCtrl"));
28      YtMini.disable = function(){
29          window.removeEventListener("scroll", check);
30          ctn.removeClass("YtMiniOn").css("height","");
31          _this.config.disableYtMini = true;
32      };
33
34      dragDiv.find($(".YtCloseMini")[0]).onclick = YtMini.disable;
35
36      window.addEventListener("scroll", check);
37
38  },
39
40  check: function() {
41
42      if ( this.mobile
43        || this.config.disableYtMini
44        || !document.querySelector(".YtMini")
45        || document.querySelector(".YtPopUpCtn .h5PlayerCtn") === this.ytcontainer
46        ){
47          return;
48      }
49
50      var ctn     = this.$fn.addDomElem(this.ytcontainer[0]),
51          video   = this.ytPlayer,
52          scrollY = window.pageYOffset;
53
54      if ((scrollY >= ctn.offsetTop + ctn.offsetHeight) && scrollY > 0 && document.body.clientWidth > 768 ) {
55
56          if( !ctn.hasClass("YtMiniOn") ){
57
58              // height should set before addClass "YtMiniOn"
59              ctn.css("height",video.clientHeight + "px").addClass("YtMiniOn");
60                // this.videoAd.resize.call(this);
61          }
62
63
64      }
65      else if (ctn.hasClass("YtMiniOn")){
66          ctn.removeClass("YtMiniOn").css("height","");
67        //   this.videoAd.resize.call(this);
68      }
69
70  },
71
72  drag: function(el) {
73
74    //   el = this.$fn.addDomElem(el);
75
76      var x, y;
77      var move = function(e) {
78
79          e.preventDefault();
80
81          el.parent().css({
82              left: e.clientX - x + "px",
83              top: e.clientY - y + "px",
84          });
85
86
87      };
88
89      el.addEventListener("mousedown", function(e) {
90
91          e.preventDefault();
92
93          x = e.offsetX;
94          y = e.offsetY;
95
96          window.addEventListener("mousemove", move);
97
98          domElem.once.call(window,"mouseup",function(){
99              window.removeEventListener("mousemove", move);
100          });
101
102      });
103
104  },
105
106  disable : function(){
107      // defined in YtMini.init
108  }
109
110};

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.