Advertisement
Guest User

Untitled

a guest
Jan 18th, 2020
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 38.61 KB | None | 0 0
  1. /*
  2. |Thanks to: Kuer, Xaekai[xaemae], ss7(supersaw7) and kenblu24
  3. |Theme by BILL(2) , You can find me on my discord channel discord.gg/fwadWd9
  4. |You are free to use (and edit) this theme but leave the credits in place for everyone involved.
  5. */
  6.  
  7. //force https for videos from googs
  8. if (window.location.protocol != "https:")
  9. window.location.href = "https:" + window.location.href.substring(window.location.protocol.length);
  10. $('head').append("<link rel='stylesheet' href='//maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css' />");
  11.  
  12. console.log("sup yall");
  13.  
  14. /*! nanoScrollerJS - v0.8.7 - (c) 2015 James Florentino; Licensed MIT */
  15.  
  16. !function(a){return"function"==typeof define&&define.amd?define(["jquery"],function(b){return a(b,window,document)}):"object"==typeof exports?module.exports=a(require("jquery"),window,document):a(jQuery,window,document)}(function(a,b,c){"use strict";var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H;z={paneClass:"nano-pane",sliderClass:"nano-slider",contentClass:"nano-content",enabledClass:"has-scrollbar",flashedClass:"flashed",activeClass:"active",iOSNativeScrolling:!1,preventPageScrolling:!1,disableResize:!1,alwaysVisible:!1,flashDelay:1500,sliderMinHeight:20,sliderMaxHeight:null,documentContext:null,windowContext:null},u="scrollbar",t="scroll",l="mousedown",m="mouseenter",n="mousemove",p="mousewheel",o="mouseup",s="resize",h="drag",i="enter",w="up",r="panedown",f="DOMMouseScroll",g="down",x="wheel",j="keydown",k="keyup",v="touchmove",d="Microsoft Internet Explorer"===b.navigator.appName&&/msie 7./i.test(b.navigator.appVersion)&&b.ActiveXObject,e=null,D=b.requestAnimationFrame,y=b.cancelAnimationFrame,F=c.createElement("div").style,H=function(){var a,b,c,d,e,f;for(d=["t","webkitT","MozT","msT","OT"],a=e=0,f=d.length;f>e;a=++e)if(c=d[a],b=d[a]+"ransform",b in F)return d[a].substr(0,d[a].length-1);return!1}(),G=function(a){return H===!1?!1:""===H?a:H+a.charAt(0).toUpperCase()+a.substr(1)},E=G("transform"),B=E!==!1,A=function(){var a,b,d;return a=c.createElement("div"),b=a.style,b.position="absolute",b.width="100px",b.height="100px",b.overflow=t,b.top="-9999px",c.body.appendChild(a),d=a.offsetWidth-a.clientWidth,c.body.removeChild(a),d},C=function(){var a,c,d;return c=b.navigator.userAgent,(a=/(?=.+Mac OS X)(?=.+Firefox)/.test(c))?(d=/Firefox\/\d{2}\./.exec(c),d&&(d=d[0].replace(/\D+/g,"")),a&&+d>23):!1},q=function(){function j(d,f){this.el=d,this.options=f,e||(e=A()),this.$el=a(this.el),this.doc=a(this.options.documentContext||c),this.win=a(this.options.windowContext||b),this.body=this.doc.find("body"),this.$content=this.$el.children("."+this.options.contentClass),this.$content.attr("tabindex",this.options.tabIndex||0),this.content=this.$content[0],this.previousPosition=0,this.options.iOSNativeScrolling&&null!=this.el.style.WebkitOverflowScrolling?this.nativeScrolling():this.generate(),this.createEvents(),this.addEvents(),this.reset()}return j.prototype.preventScrolling=function(a,b){if(this.isActive)if(a.type===f)(b===g&&a.originalEvent.detail>0||b===w&&a.originalEvent.detail<0)&&a.preventDefault();else if(a.type===p){if(!a.originalEvent||!a.originalEvent.wheelDelta)return;(b===g&&a.originalEvent.wheelDelta<0||b===w&&a.originalEvent.wheelDelta>0)&&a.preventDefault()}},j.prototype.nativeScrolling=function(){this.$content.css({WebkitOverflowScrolling:"touch"}),this.iOSNativeScrolling=!0,this.isActive=!0},j.prototype.updateScrollValues=function(){var a,b;a=this.content,this.maxScrollTop=a.scrollHeight-a.clientHeight,this.prevScrollTop=this.contentScrollTop||0,this.contentScrollTop=a.scrollTop,b=this.contentScrollTop>this.previousPosition?"down":this.contentScrollTop<this.previousPosition?"up":"same",this.previousPosition=this.contentScrollTop,"same"!==b&&this.$el.trigger("update",{position:this.contentScrollTop,maximum:this.maxScrollTop,direction:b}),this.iOSNativeScrolling||(this.maxSliderTop=this.paneHeight-this.sliderHeight,this.sliderTop=0===this.maxScrollTop?0:this.contentScrollTop*this.maxSliderTop/this.maxScrollTop)},j.prototype.setOnScrollStyles=function(){var a;B?(a={},a[E]="translate(0, "+this.sliderTop+"px)"):a={top:this.sliderTop},D?(y&&this.scrollRAF&&y(this.scrollRAF),this.scrollRAF=D(function(b){return function(){return b.scrollRAF=null,b.slider.css(a)}}(this))):this.slider.css(a)},j.prototype.createEvents=function(){this.events={down:function(a){return function(b){return a.isBeingDragged=!0,a.offsetY=b.pageY-a.slider.offset().top,a.slider.is(b.target)||(a.offsetY=0),a.pane.addClass(a.options.activeClass),a.doc.bind(n,a.events[h]).bind(o,a.events[w]),a.body.bind(m,a.events[i]),!1}}(this),drag:function(a){return function(b){return a.sliderY=b.pageY-a.$el.offset().top-a.paneTop-(a.offsetY||.5*a.sliderHeight),a.scroll(),a.contentScrollTop>=a.maxScrollTop&&a.prevScrollTop!==a.maxScrollTop?a.$el.trigger("scrollend"):0===a.contentScrollTop&&0!==a.prevScrollTop&&a.$el.trigger("scrolltop"),!1}}(this),up:function(a){return function(b){return a.isBeingDragged=!1,a.pane.removeClass(a.options.activeClass),a.doc.unbind(n,a.events[h]).unbind(o,a.events[w]),a.body.unbind(m,a.events[i]),!1}}(this),resize:function(a){return function(b){a.reset()}}(this),panedown:function(a){return function(b){return a.sliderY=(b.offsetY||b.originalEvent.layerY)-.5*a.sliderHeight,a.scroll(),a.events.down(b),!1}}(this),scroll:function(a){return function(b){a.updateScrollValues(),a.isBeingDragged||(a.iOSNativeScrolling||(a.sliderY=a.sliderTop,a.setOnScrollStyles()),null!=b&&(a.contentScrollTop>=a.maxScrollTop?(a.options.preventPageScrolling&&a.preventScrolling(b,g),a.prevScrollTop!==a.maxScrollTop&&a.$el.trigger("scrollend")):0===a.contentScrollTop&&(a.options.preventPageScrolling&&a.preventScrolling(b,w),0!==a.prevScrollTop&&a.$el.trigger("scrolltop"))))}}(this),wheel:function(a){return function(b){var c;if(null!=b)return c=b.delta||b.wheelDelta||b.originalEvent&&b.originalEvent.wheelDelta||-b.detail||b.originalEvent&&-b.originalEvent.detail,c&&(a.sliderY+=-c/3),a.scroll(),!1}}(this),enter:function(a){return function(b){var c;if(a.isBeingDragged)return 1!==(b.buttons||b.which)?(c=a.events)[w].apply(c,arguments):void 0}}(this)}},j.prototype.addEvents=function(){var a;this.removeEvents(),a=this.events,this.options.disableResize||this.win.bind(s,a[s]),this.iOSNativeScrolling||(this.slider.bind(l,a[g]),this.pane.bind(l,a[r]).bind(""+p+" "+f,a[x])),this.$content.bind(""+t+" "+p+" "+f+" "+v,a[t])},j.prototype.removeEvents=function(){var a;a=this.events,this.win.unbind(s,a[s]),this.iOSNativeScrolling||(this.slider.unbind(),this.pane.unbind()),this.$content.unbind(""+t+" "+p+" "+f+" "+v,a[t])},j.prototype.generate=function(){var a,c,d,f,g,h,i;return f=this.options,h=f.paneClass,i=f.sliderClass,a=f.contentClass,(g=this.$el.children("."+h)).length||g.children("."+i).length||this.$el.append('<div class="'+h+'"><div class="'+i+'" /></div>'),this.pane=this.$el.children("."+h),this.slider=this.pane.find("."+i),0===e&&C()?(d=b.getComputedStyle(this.content,null).getPropertyValue("padding-right").replace(/[^0-9.]+/g,""),c={right:-14,paddingRight:+d+14}):e&&(c={right:-e},this.$el.addClass(f.enabledClass)),null!=c&&this.$content.css(c),this},j.prototype.restore=function(){this.stopped=!1,this.iOSNativeScrolling||this.pane.show(),this.addEvents()},j.prototype.reset=function(){var a,b,c,f,g,h,i,j,k,l,m,n;return this.iOSNativeScrolling?void(this.contentHeight=this.content.scrollHeight):(this.$el.find("."+this.options.paneClass).length||this.generate().stop(),this.stopped&&this.restore(),a=this.content,f=a.style,g=f.overflowY,d&&this.$content.css({height:this.$content.height()}),b=a.scrollHeight+e,l=parseInt(this.$el.css("max-height"),10),l>0&&(this.$el.height(""),this.$el.height(a.scrollHeight>l?l:a.scrollHeight)),i=this.pane.outerHeight(!1),k=parseInt(this.pane.css("top"),10),h=parseInt(this.pane.css("bottom"),10),j=i+k+h,n=Math.round(j/b*i),n<this.options.sliderMinHeight?n=this.options.sliderMinHeight:null!=this.options.sliderMaxHeight&&n>this.options.sliderMaxHeight&&(n=this.options.sliderMaxHeight),g===t&&f.overflowX!==t&&(n+=e),this.maxSliderTop=j-n,this.contentHeight=b,this.paneHeight=i,this.paneOuterHeight=j,this.sliderHeight=n,this.paneTop=k,this.slider.height(n),this.events.scroll(),this.pane.show(),this.isActive=!0,a.scrollHeight===a.clientHeight||this.pane.outerHeight(!0)>=a.scrollHeight&&g!==t?(this.pane.hide(),this.isActive=!1):this.el.clientHeight===a.scrollHeight&&g===t?this.slider.hide():this.slider.show(),this.pane.css({opacity:this.options.alwaysVisible?1:"",visibility:this.options.alwaysVisible?"visible":""}),c=this.$content.css("position"),("static"===c||"relative"===c)&&(m=parseInt(this.$content.css("right"),10),m&&this.$content.css({right:"",marginRight:m})),this)},j.prototype.scroll=function(){return this.isActive?(this.sliderY=Math.max(0,this.sliderY),this.sliderY=Math.min(this.maxSliderTop,this.sliderY),this.$content.scrollTop(this.maxScrollTop*this.sliderY/this.maxSliderTop),this.iOSNativeScrolling||(this.updateScrollValues(),this.setOnScrollStyles()),this):void 0},j.prototype.scrollBottom=function(a){return this.isActive?(this.$content.scrollTop(this.contentHeight-this.$content.height()-a).trigger(p),this.stop().restore(),this):void 0},j.prototype.scrollTop=function(a){return this.isActive?(this.$content.scrollTop(+a).trigger(p),this.stop().restore(),this):void 0},j.prototype.scrollTo=function(a){return this.isActive?(this.scrollTop(this.$el.find(a).get(0).offsetTop),this):void 0},j.prototype.stop=function(){return y&&this.scrollRAF&&(y(this.scrollRAF),this.scrollRAF=null),this.stopped=!0,this.removeEvents(),this.iOSNativeScrolling||this.pane.hide(),this},j.prototype.destroy=function(){return this.stopped||this.stop(),!this.iOSNativeScrolling&&this.pane.length&&this.pane.remove(),d&&this.$content.height(""),this.$content.removeAttr("tabindex"),this.$el.hasClass(this.options.enabledClass)&&(this.$el.removeClass(this.options.enabledClass),this.$content.css({right:""})),this},j.prototype.flash=function(){return!this.iOSNativeScrolling&&this.isActive?(this.reset(),this.pane.addClass(this.options.flashedClass),setTimeout(function(a){return function(){a.pane.removeClass(a.options.flashedClass)}}(this),this.options.flashDelay),this):void 0},j}(),a.fn.nanoScroller=function(b){return this.each(function(){var c,d;if((d=this.nanoscroller)||(c=a.extend({},z,b),this.nanoscroller=d=new q(this,c)),b&&"object"==typeof b){if(a.extend(d.options,b),null!=b.scrollBottom)return d.scrollBottom(b.scrollBottom);if(null!=b.scrollTop)return d.scrollTop(b.scrollTop);if(b.scrollTo)return d.scrollTo(b.scrollTo);if("bottom"===b.scroll)return d.scrollBottom(0);if("top"===b.scroll)return d.scrollTop(0);if(b.scroll&&b.scroll instanceof a)return d.scrollTo(b.scroll);if(b.stop)return d.stop();if(b.destroy)return d.destroy();if(b.flash)return d.flash()}return d.reset()})},a.fn.nanoScroller.Constructor=q});
  17. //# sourceMappingURL=jquery.nanoscroller.min.js.map
  18.  
  19. /**
  20. * Copyright Marc J. Schmidt. See the LICENSE file at the top-level
  21. * directory of this distribution and at
  22. * https://github.com/marcj/css-element-queries/blob/master/LICENSE.
  23. */
  24. !function(){this.ResizeSensor=function(e,t){function s(){this.q=[],this.add=function(e){this.q.push(e)};var e,t;this.call=function(){for(e=0,t=this.q.length;t>e;e++)this.q[e].call()}}function i(e,t){return e.currentStyle?e.currentStyle[t]:window.getComputedStyle?window.getComputedStyle(e,null).getPropertyValue(t):e.style[t]}function o(e,t){if(e.resizedAttached){if(e.resizedAttached)return void e.resizedAttached.add(t)}else e.resizedAttached=new s,e.resizedAttached.add(t);e.resizeSensor=document.createElement("div"),e.resizeSensor.className="resize-sensor";var o="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: scroll; z-index: -1; visibility: hidden;",n="position: absolute; left: 0; top: 0;";e.resizeSensor.style.cssText=o,e.resizeSensor.innerHTML='<div class="resize-sensor-expand" style="'+o+'"><div style="'+n+'"></div></div><div class="resize-sensor-shrink" style="'+o+'"><div style="'+n+' width: 200%; height: 200%"></div></div>',e.appendChild(e.resizeSensor),{fixed:1,absolute:1}[i(e,"position")]||(e.style.position="relative");var r,l,d=e.resizeSensor.childNodes[0],c=d.childNodes[0],h=e.resizeSensor.childNodes[1],a=(h.childNodes[0],function(){c.style.width=d.offsetWidth+10+"px",c.style.height=d.offsetHeight+10+"px",d.scrollLeft=d.scrollWidth,d.scrollTop=d.scrollHeight,h.scrollLeft=h.scrollWidth,h.scrollTop=h.scrollHeight,r=e.offsetWidth,l=e.offsetHeight});a();var f=function(){e.resizedAttached&&e.resizedAttached.call()},u=function(e,t,s){e.attachEvent?e.attachEvent("on"+t,s):e.addEventListener(t,s)},z=function(){(e.offsetWidth!=r||e.offsetHeight!=l)&&f(),a()};u(d,"scroll",z),u(h,"scroll",z)}var n=Object.prototype.toString.call(e),r="[object Array]"===n||"[object NodeList]"===n||"[object HTMLCollection]"===n||"undefined"!=typeof jQuery&&e instanceof jQuery||"undefined"!=typeof Elements&&e instanceof Elements;if(r)for(var l=0,d=e.length;d>l;l++)o(e[l],t);else o(e,t);this.detach=function(){if(r)for(var t=0,s=e.length;s>t;t++)ResizeSensor.detach(e[t]);else ResizeSensor.detach(e)}},this.ResizeSensor.detach=function(e){e.resizeSensor&&(e.removeChild(e.resizeSensor),delete e.resizeSensor,delete e.resizedAttached)}}();
  25. /*player skin*/
  26.  
  27. $.getScript("//lpdstream.neocities.org/overlay.js");
  28. $('head').append("<link rel='stylesheet' href='//lpdstream.neocities.org/base.css' />");
  29. $('head').append("<link rel='stylesheet' href='//lpdstream.neocities.org/polyzor.css' />");
  30. $("#videowrap").addClass("vjs-polyzor-skin");
  31. $(".server-msg-reconnect").addClass("fa fa-plug");
  32. $(".server-msg-reconnect").text("");
  33. $("body").addClass("darktheme");
  34. $("#userlisttoggle").removeClass("glyphicon glyphicon-chevron-down pull-left pointer");
  35. $("#userlisttoggle").addClass("btn-default fa fa-users ch");
  36. $("#userlisttoggle").text("");
  37. $("#showchansettings").text("Admin Settings");
  38. $("#controlsrow").after($("#motdrow"));//move channel description (motd) below controls
  39. $("#controlsrow").after($("#announcements"));//move cytube announcements below controls
  40. $(".container-fluid").append($("#footer"));//move footer into mainpage element
  41. $('#footer').children('.container').append('<p class="text-muted credit">Theme By Bill (<a href="https://github.com/BillTube/theme">Now on github!</a>)</p>');
  42. $("#mainpage").prepend($("#chatwrap"));//move chat element outside left container
  43. //$("#userlist").prepend("<div id='connected'></div>");//create div to contain user count
  44. //$("#connected").append($("#usercount"));//move user count into previously created div
  45. //$("#connected").append( "<span id='connectedText'>&nbsp Logged in users</span>" );//add "Connected" after user count
  46. $("#userlisttoggle").after($("#emotelistbtn"));
  47. $("#main").after("<div id='videoinfo' class='section'></div>");//create box to contain video title, description, and playlist options.
  48. $("#main").after($("#drinkbarwrap"));
  49. $("#videoinfo").append("<div class='textheader'></div><div id='videoinfohead'><span id='addedbyTEXT'>Ajout par <span id='addedby'></span></span><div id='headbottom'><div id='headright'><div id='ss7time' title='--:--'>0:00</div><div id='videolength'></div><div id='progbar'></div></div></div></div><div id='videoopts'></div>");
  50. $(".navbar-header").after($("#currenttitle")); //move video title below video player
  51. $("#headbottom").append("<button id='addmedia' title='Ajouter un média' class='headbtn headbtnleft'></button>");
  52. $("#headbottom").append($("#newpollbtn"));
  53. $("#headbottom").append("<button id='morebtn' title='More Actions' data-toggle='dropdown' class='headbtn headbtnleft hide'></button>");
  54. $("#newpollbtn").addClass("headbtn headbtnleft");
  55. $("#emotelistbtn").text("");
  56. $("#emotelistbtn").removeClass("btn btn-sm");
  57. $("#emotelistbtn").addClass("fa fa-picture-o");
  58. $("#emotelistbtn").addClass("ch");
  59. $("#fullscreenbtn").text("");
  60. $("#fullscreenbtn").addClass("fa fa-arrows-alt");
  61. $("#fullscreenbtn").removeClass("btn btn-sm");
  62. $("#fullscreenbtn").addClass("ch");
  63. $("#emotelistbtn").after($("#fullscreenbtn"));
  64. $("#morebtn").after($("#videocontrols"));
  65. $("#videocontrols").removeClass("pull-right");
  66. //$("#drinkbarwrap").after($("#main"));
  67. $("#chatline").attr("placeholder","Message");
  68. $("#main").after($("#motdrow"));
  69. $("#motdwrap").append($(".visible-lg"));
  70. $("#addedbyTEXT").after($("#usercount"));
  71. $("#morebtn").after("<ul class='dropdown-menu'><li id='mediarefreshli'></li><li><button></button></li><li id='modli'></li><li><button></button></li></ul>");
  72. $("#modli").append($("#modflair"));
  73. $("#headbottom").append($("#mediarefresh"));
  74. $("#mediarefresh").text("Reload Video Player");
  75. $("#videoinfo").after($("#rightpane"));
  76. $("#rightpane-inner").prepend("<div id='mediabuttons'></div>");
  77. $("#rightpane-inner").addClass("section");
  78. $("#mediarefresh").addClass("btn btn-sm btn-default OLB");
  79. $("#voteskip").addClass("btn btn-sm btn-default OLB");
  80. $("#mediabuttons").append($("#showmediaurl"), $("#showcustomembed"), $("#showsearch"), $("#showplaylistmanager"));
  81. $("#rightpane").after("<div id='queuecontainer' class='section'><button id='pldropdown' data-toggle='dropdown' title='Playlist Options'></button><div class='textheader'><p id='upnext' class='sectionheader'>Playlist</p></div></div>");
  82. $("#queuecontainer").append($("#queue"));
  83. $("#upnext").append($("#plmeta"));
  84. $("#pldropdown").after("<ul id='ploptions' class='dropdown-menu' role='menu'></ul>");
  85. $("#ploptions").append($("#shuffleplaylist"), $("#clearplaylist"), $("#getplaylist"));
  86. $("#pldropdown").before($("#qlockbtn"));
  87. $("#main").after($("#scroll-feature"));
  88. $("<div class='indicator'><svg width='0px' height='0px'><polyline id='back' points='1 6 4 6 6 11 10 1 12 6 15 6'></polyline><polyline id='front' points='1 6 4 6 6 11 10 1 12 6 15 6'></polyline></svg></div>").appendTo('.navbar-header');
  89. $('#queuecontainer').hover(function(){
  90. $('#pllength').css({
  91. 'opacity':'0.9',
  92. });
  93. },function(){
  94. $('#pllength').css({
  95. 'opacity':'0',
  96. });
  97. });
  98. $("#wrap").prepend("<div id='bg-wrapper'><div id='backg'></div></div>");
  99. $("body").addClass("fluid");
  100. $("#videowrap").addClass("col-lg-7 col-md-7 vjs-polyzor-skin");
  101. $("#videowrap").removeClass("col-md-8 col-md-offset-2");
  102. $("body").removeClass("synchtube");
  103. $("#usertheme").attr("href", "/css/themes/slate.css");
  104. $("#main").append($("#videowrap"));
  105. $("#maincontain .nano-content").append($("#mainpage > .container"));
  106. $("#videowrap").after($("#pollwrap"));
  107. //make it work with nanoscroll.js
  108. $("#mainpage").append("<div class='nano' id='maincontain'></div>");
  109. $("#maincontain").append("<div class='nano-content'></div>");
  110. $("#maincontain .nano-content").append($("#mainpage > .container-fluid"));
  111. $("body").addClass("fluid");
  112. $("#usertheme").attr("href", "/css/themes/slate.css");
  113. $("#maincontain .nano-content").append($("#mainpage > .container"));
  114. $("#messagebuffer").addClass("nano-content");
  115. $("#messagebuffer").after("<div class='nano'></div>");
  116. $("#chatwrap .nano").append($("#messagebuffer"));
  117. $(".nano").nanoScroller();
  118. //middle draggable handle
  119. $("#mainpage").append("<div id='mHandle-left' class='mHandle'></div> <div id='mHandle-right' class='mHandle'></div><div id='mHandle-mid' class='mHandle'></div>");
  120. $("body").prepend("<div id='dragoverlay'><div class='l'></div><div class='r'></div><div id='handleWidget'></div></div>");
  121. $("#mainpage").append("<style id='splitRatio' split='77'>@media (min-width: 992px) {#mainpage > .nano {width: 77%;} #chatwrap {width: 22.9%;}}</style>");
  122. _timeVIDEBLU = {raw: 0, ofs: 0, paused: false};//Define time object for ss7's video time display plugin
  123. currentmedia = {istemp: false, location: 0, uid: 0, id: 0, seconds: 0, length: 0};
  124. playlistinfo = {length: 0};
  125. issplit = false;
  126. var trnsdelay = 200;//Defines trnsdelay, transition time (in ms)
  127.  
  128. if (typeof(_changeMediaVIDEBLU) == 'undefined') { _changeMediaVIDEBLU = Callbacks.changeMedia; }//Creates global variable _changeMediaVIDEBLU and sets it equal to old changeMedia() in Callbacks.js
  129. if (typeof(_playlistVIDEBLU) == 'undefined') { _playlistVIDEBLU = Callbacks.playlist; }
  130. if (typeof(_queueVIDEBLU) == 'undefined') { _queueVIDEBLU = Callbacks.queue; }
  131. if (typeof(_mediaupdateVIDEBLU) == 'undefined') { _mediaUpdateVIDEBLU = Callbacks.mediaUpdate; }
  132.  
  133. Callbacks.queue = function(data) {//currently for debugging purposes only. Doesn't do anything.
  134. _queueVIDEBLU(data);
  135. console.log("Called Callbacks.queue");
  136. console.log(data);
  137. }
  138.  
  139. Callbacks.playlist = function(data) {//currently for debugging purposes only. Doesn't do anything.
  140. console.log("Called Callbacks.playlist");
  141. console.log(data);
  142. _playlistVIDEBLU(data);
  143. requeue(data);
  144. globaLplaylistdata = data;
  145. playlistinfo.length = data.length;
  146. }
  147.  
  148. function requeue (data) {
  149. /*for (var i = 0; i <= data.length - 1; i++) {//find information of current video in playlist
  150. var e = data[i];
  151. if (e.media.id == currentmedia.id) {
  152. currentmedia.uid = e.uid;
  153. currentmedia.ispermanent = e.temp;
  154. currentmedia.location = i;
  155. }
  156. }*/
  157. var _playlist=[];
  158. $("#queue > .queue_entry").each(function(){
  159. var data = $(this).data();
  160. //var addedby = $(this).attr("title").match(/: (\w+)$/)[1];
  161. _playlist.push({ uid: data.uid, media: data.media, temp: data.temp });
  162. });
  163. }
  164.  
  165. //function changeMedia2(){
  166. Callbacks.changeMedia = function(data) {//Adds to the old changeMedia() in Callbacks.js, which is called when the media changes.
  167. _changeMediaVIDEBLU(data);//call the old changeMedia() function stored.
  168. $("#currenttitle").text(data.title);//change the text of #currenttitle to data.title (gets rid of "Currently Playing: " in video title)
  169. $("#ss7time").attr("title", data.duration);//gets time of current video
  170. currentmedia.length = data.duration;
  171. currentmedia.id = data.id;
  172. currentmedia.seconds = data.seconds;
  173. var title = $("#queue .queue_active").attr("title");
  174. $("#addedby").text(title.match(/(?:Added by: ){1}(.*)/)[1]);
  175. }
  176. //}
  177. //changeMedia2()
  178.  
  179. //function mediaUpdate2() {
  180. Callbacks.mediaUpdate = function(data) {//Adds to the old mediaUpdate() in Callbacks.js, which is called every couple seconds.
  181. _mediaUpdateVIDEBLU(data);//call the old mediaUpdate function stored.
  182. _timeVIDEBLU.paused = data.paused;//stores data.paused in another variable. (Is video paused?)
  183. _timeVIDEBLU.raw = Math.max(data.currentTime, 0);//stores the current video time position as _timeVIDEBLU.raw, to be used in setvideotime()
  184. _timeVIDEBLU.ofs = _timeVIDEBLU.raw - (new Date()).getTime()/1000;//stores time offset, to keep the timer going between media updates
  185. }
  186. //}
  187. //mediaUpdate2();
  188.  
  189. //Massive thanks to ss7 for Video Time Display code.
  190. setvideotime = function() {
  191. var t = _timeVIDEBLU.paused ? _timeVIDEBLU.raw : (new Date()).getTime()/1000 + _timeVIDEBLU.ofs; //
  192. var percenttime = Math.round(t * 100 / currentmedia.seconds);
  193. if (percenttime > 100) {percenttime = 0}
  194. $("#progbar").css("width", percenttime + "%");
  195. setTimeout(setvideotime, 1000*(Math.round(t)+1 - t)); //Update time every second
  196. t = Math.round(t);
  197. var s = t % 60; t = Math.floor(t/60);
  198. var m = t % 60;
  199. var h = Math.floor(t/60);
  200. if (s < 10) { s = '0'+s; }//9:9:9 -> 9:9:09
  201. if (m < 10) { m = '0'+m; }//9:9:09 -> 9:09:09
  202. if (h < 10) { h = '0'+h; }//9:09:09 -> 09:09:09
  203. if (currentmedia.seconds > 3598) {$('#ss7time').text(h+':'+m+':'+s);}//if media is longer than an hour
  204. else if (h == 0) {$('#ss7time').text(m+':'+s);}//if less than an hour do not display hour metric
  205. else if (currentmedia.length == "--:--") {$('#ss7time').text("Live")}// if "--:--" is length, set duration to "Live"
  206. }
  207. setvideotime();
  208.  
  209. $("#addmedia").click(function(){ //Add Media button action
  210. if ($("#rightpane").css('display') == 'none'){//if add media is hidden
  211. $("#mediabuttons button").each(function() {
  212. if ($(this).css("display") != "none") {
  213. if ($(this).hasClass("collapsed")){
  214. $(this).trigger("click");
  215. }
  216. return false;
  217. }//if button is clickable
  218. })
  219. $("#rightpane").slideDown(trnsdelay);
  220. }
  221. else {
  222. $("#rightpane").slideUp(trnsdelay);
  223. }
  224.  
  225. });
  226.  
  227. $("#morebtn").click(function(event){$("#headbottom .dropdown-menu").css("left", event.clientX - 50 + "px");});
  228.  
  229.  
  230. var updateScrollHandles = function() {
  231. var scrollbar = $("#mainpage > .nano .nano-slider");
  232. var scrollbarOffset = scrollbar.height()/2 + Number(scrollbar.attr("style").match(/\d+(?:.\d+)*(?=px\))/));
  233. $("#mHandle-left").attr("style", "transform: translate(" + (0 - $("#mHandle-left").width() - scrollbar.width() - 1) + "px, " + (scrollbarOffset + $("#mHandle-left").height()/2) + "px);");
  234. $("#mHandle-right").attr("style", "transform: translate(-1px, "+ (scrollbarOffset + $("#mHandle-right").height()/2) + "px);");
  235. $("#mHandle-mid").attr("style", "transform: translate(" + (0 - scrollbar.width() - 1) + "px, " + (scrollbarOffset + $("#mHandle-mid").height()/2) + "px);");
  236. $(".mHandle").css("left", $("#splitRatio").attr("split") + "%");
  237. }
  238.  
  239. $("#mainpage > .nano .nano-pane").hover(function(eventData) {
  240. updateScrollHandles();
  241. $("#mainpage").addClass("scrollHover").addClass("scrolling");
  242. $(window).off("mousemove");
  243. }, function(eventData) {
  244. if(eventData.buttons == 0) {
  245. $("#mainpage").removeClass("scrollHover").removeClass("scrolling");
  246. }
  247. else {
  248. $(window).one("mousemove", function(eventData2){
  249. if(eventData2.buttons == 0)
  250. $("#mainpage").removeClass("scrollHover").removeClass("scrolling");
  251. });
  252. }
  253. })
  254. $(".vjs-error-display").append("<div>The Video stopped working, refresh the player</div>");
  255.  
  256. $("#mainpage > .nano .nano-content").scroll(function() {
  257. updateScrollHandles();
  258. });
  259.  
  260. $(".mHandle").mouseenter(function() {
  261. $("#mainpage").addClass("mHover");
  262. });
  263. $(".mHandle").mouseleave(function() {
  264. $("#mainpage").removeClass("mHover");
  265. });
  266.  
  267. var updateSplitRatio = function(ratio) {
  268. ratio = Math.floor(ratio * 10)/10;
  269. var rightRatio = 100 - ratio - 0.1;
  270. $("#splitRatio").text("@media (min-width: 992px) {#mainpage > .nano {width: " + ratio + "%;} #chatwrap {width: " + rightRatio + "%;}}");
  271. $("#splitRatio").attr("split", ratio + "");
  272. };
  273. $(".mHandle").mousedown(function() {
  274. var initialX = 'undefined';
  275. var initialF = 'undefined';
  276. var handleOffset = $("#mHandle-left").width() + $("#mHandle-mid").width() + 1; //offset from positioning anchor
  277. var bodyWidth = $("body").width();
  278. var minX = 430;
  279. var maxX = bodyWidth * .80;
  280.  
  281. $("#handleWidget").prop("style", ""); //reset css so that transforms don't affect measurements
  282. $("#handleWidget").css("left", $("#splitRatio").attr("split")+"%").css("top", $("#mHandle-left").offset().top);
  283. initialF = $("#handleWidget").offset().left;
  284. $("#handleWidget").css("transform", "translatex(-" + handleOffset + "px)");
  285. $("#dragoverlay").addClass("dragging");
  286. $("body").mousemove(function(eventData) {
  287. if (initialX == 'undefined') {
  288. initialX = eventData.pageX;
  289. }
  290. if (eventData.buttons == 0) {
  291. $("body").off("mousemove");
  292. $("#dragoverlay").removeClass("dragging");
  293. }
  294. else {
  295. var newx = eventData.pageX - initialX + initialF;
  296. if(newx > minX && newx < maxX) {
  297. $("#handleWidget").css("left", newx + "px");
  298. updateSplitRatio(($("#handleWidget").offset().left + handleOffset) / bodyWidth * 100);
  299. }
  300. else if (newx < minX) {
  301. $("#handleWidget").css("left", "430px");
  302. }
  303. else {
  304. $("#handleWidget").css("left", "80%");
  305. }
  306. }
  307. });
  308.  
  309. });
  310.  
  311.  
  312. //update scrollbar when chat changes
  313. var observer = new MutationObserver(function(mutations) {
  314. mutations.forEach(function(mutation) {
  315. $("#chatwrap .nano").nanoScroller();
  316. });
  317. }); //create a new observer
  318. var config = { attributes: true, childList: true, characterData: true };
  319. observer.observe(document.querySelector('#messagebuffer'), config);
  320.  
  321. //update scrollbars when window is resized
  322. $(window).resize(function() {$(".nano").nanoScroller();});
  323. new ResizeSensor($("#maincontain .container-fluid"),function() {
  324. $("#mainpage > .nano").nanoScroller();
  325. });
  326.  
  327. //fix for scrolling when hovering over new YT embed
  328. $("#maincontain .nano-slider").mousedown(function() {
  329. $("#main").addClass("disablehover");
  330. $("#main").mouseenter(function(eventData) {
  331. if(eventData.buttons == 0) {
  332. $("#main").removeClass("disablehover");
  333. $(this).off("mouseenter");
  334. }
  335. });
  336. });
  337. //$(window).mouseup(function(eventData) {mouseupped = true; console.log(eventData)});
  338.  
  339.  
  340. var stringToColour = function(str) {
  341.  
  342. for (var i = 0, hash = 0; i < str.length; hash = str.charCodeAt(i++) + ((hash << 5) - hash));
  343.  
  344. for (var i = 0, colour = "#"; i < 3; colour += ("00" + ((hash >> i++ * 8) & 0xFF).toString(16)).slice(-2));
  345.  
  346. return colour;
  347. }
  348.  
  349. function formatChatMessage(data, last) {
  350. if (!data.meta || data.msgclass) {
  351. data.meta = {
  352. addClass: data.msgclass,
  353. addClassToNameAndTimestamp: data.msgclass
  354. };
  355. }
  356. var skip = data.username === last.name;
  357. if(data.meta.addClass === "server-whisper")
  358. skip = true;
  359. if(data.msg.match(/^\s*<strong>\w+\s*:\s*<\/strong>\s*/))
  360. skip = false;
  361. if (data.meta.forceShowName)
  362. skip = false;
  363.  
  364. data.msg = execEmotes(data.msg);
  365.  
  366. last.name = data.username;
  367. var div = $("<div/>");
  368. if (data.meta.addClass === "drink") {
  369. div.addClass("drink");
  370. data.meta.addClass = "";
  371. }
  372.  
  373. if (USEROPTS.show_timestamps) {
  374. var time = $("<span/>").addClass("timestamp").appendTo(div);
  375. var timestamp = new Date(data.time).toTimeString().split(" ")[0];
  376. time.text("["+timestamp+"] ");
  377. if (data.meta.addClass && data.meta.addClassToNameAndTimestamp) {
  378. time.addClass(data.meta.addClass);
  379. }
  380. }
  381.  
  382. var name = $("<span/>");
  383. if (!skip) {
  384. name.appendTo(div);
  385. }
  386. $("<strong/>").addClass("username clr_" + data.username).text(data.username + ": ").css("color", stringToColour(data.username)).appendTo(name);
  387.  
  388.  
  389. if (data.meta.modflair)
  390. {
  391. name.addClass(getNameColor(data.meta.modflair));
  392. }
  393.  
  394. if (data.meta.addClass && data.meta.addClassToNameAndTimestamp) {
  395. name.addClass(data.meta.addClass);
  396. }
  397. if (data.meta.superadminflair) {
  398. name.addClass("label")
  399. .addClass(data.meta.superadminflair.labelclass);
  400. $("<span/>").addClass(data.meta.superadminflair.icon)
  401. .addClass("glyphicon")
  402. .css("margin-right", "3px")
  403. .prependTo(name);
  404. }
  405.  
  406. var message = $("<span/>").appendTo(div);
  407. message[0].innerHTML = data.msg;
  408.  
  409. if (data.meta.action) {
  410. name.remove();
  411. message[0].innerHTML = data.username + " " + data.msg;
  412. }
  413. if (data.meta.addClass) {
  414. message.addClass(data.meta.addClass);
  415. }
  416. if (data.meta.shadow) {
  417. div.addClass("chat-shadow");
  418. }
  419. div.find("img").load(function () {
  420. if (SCROLLCHAT) {
  421. scrollChat();
  422. }
  423. });
  424. return div;
  425.  
  426. }
  427.  
  428. $(document).ready(function() {
  429. $('<link id="chanfavicon" href="https://files.catbox.moe/pwhsvi.png" type="image/x-icon" rel="shortcut icon" />')
  430. .appendTo("head");});
  431.  
  432. // The HorizontalScroller Class accepts a jQuery object as its only argument
  433. // The argument is the parent container of the scrolling element
  434. // The element requires an ID to differentiate HorizontalScroller instances
  435.  
  436. function HorizontalScroller(elem) {
  437. this.scrollbox = elem; // The scrollers viewable area
  438. this.scrollImages = this.scrollbox.find("img");
  439. this.leftScrollControl = this.scrollbox.siblings(".left-scroll");
  440. this.rightScrollControl = this.scrollbox.siblings(".right-scroll");
  441.  
  442. // Listener to change visibility of left and right controls
  443. // when at scroll extremes
  444. this.scrollbox.on("scroll", this.evaluateControlVisibility.bind(this));
  445. };
  446.  
  447. HorizontalScroller.prototype = {
  448.  
  449. scrollboxWidth: function() {
  450. return this.scrollbox.outerWidth(true);
  451. },
  452.  
  453. currentScrollPosition: function() {
  454. return this.scrollbox.scrollLeft();
  455. },
  456.  
  457. currentRightPosition: function() {
  458. return this.currentScrollPosition() + this.scrollboxWidth() - this.totalWidths();
  459. },
  460.  
  461. // Maps the image width of each image in the scroller
  462. imageWidths: function() {
  463. return $.map(this.scrollImages, function(img) {
  464. return $(img).outerWidth(true);
  465. })
  466. },
  467.  
  468. // Returns the total width of all the images, that is,
  469. // the total of the visible and overflow content.
  470. totalWidths: function() {
  471. return this.imageWidths().reduce(function(a,b) { return a+b});
  472. },
  473.  
  474. // Returns the average width of all the images
  475. avgWidth: function() {
  476. return this.totalWidths() / this.imageWidths().length;
  477. },
  478.  
  479. // Determines the number of images in view area.
  480. // Number of images changes with responsive CSS
  481. imagesAcross: function() {
  482. return Math.round( this.scrollboxWidth() / this.avgWidth() );
  483. },
  484.  
  485. // maps the offset x-distance of each image
  486. // from the left edge of the view area
  487. imageOffsets: function() {
  488. return $.map(this.scrollImages, function(img) {
  489. return Math.round($(img).position().left);
  490. });
  491. },
  492.  
  493. // Returns the index of the first number in the given array
  494. // greater than the given value, or, returns the index of
  495. // the first positive number in the array
  496. indexOfFirst: function(array, value) {
  497. value = value || 0;
  498. var firstIndex;
  499. var i = 0;
  500. while (firstIndex === undefined && array.length > i) {
  501. if (array[i] >= value)
  502. firstIndex = i;
  503. i += 1;
  504. }
  505. return firstIndex;
  506. },
  507.  
  508. // Returns the index of first image that is completely in view
  509. // within the scrollbox
  510. firstVisibleImageIndex: function() {
  511. return this.indexOfFirst(this.imageOffsets());
  512. },
  513.  
  514. // Returns the first image that is completely in view
  515. // within the scrollbox
  516. firstVisibleImage: function() {
  517. return this.scrollImages[this.firstVisibleImageIndex()];
  518. },
  519.  
  520. // Returns the index of the last image with its left edge in view
  521. // within the scrollbox
  522. lastVisibleImageIndex: function() {
  523. return this.firstVisibleImageIndex() + this.imagesAcross();
  524. },
  525.  
  526. // Returns the last image with its left edge in view
  527. // within the scrollbox
  528. lastVisibleImage: function() {
  529. return this.scrollImages[this.lastVisibleImageIndex()];
  530. },
  531.  
  532. // Returns the difference between the scrollboxes left edge
  533. // and the left edge of the first fully visible image, that is,
  534. // how far in the first fully visible image is
  535. offset: function() {
  536. var offset = $(this.firstVisibleImage()).position().left;
  537. return Math.round(offset);
  538. },
  539.  
  540. // Returns the combined scroll amount that the images have to travel
  541. // in order to land evenly within the scroll window. The resulting
  542. nextScrollPosition: function(direction) {
  543. var nextScrollPosition = this.currentScrollPosition() + this.offset();
  544.  
  545. switch(direction) {
  546. case "left":
  547. nextScrollPosition -= this.scrollboxWidth();
  548. if (($(this.firstVisibleImage()).outerWidth(true) - this.offset()) < 0) {
  549. nextScrollPosition -= $(this.firstVisibleImage()).outerWidth(true);
  550. }
  551. break;
  552. case "right":
  553. nextScrollPosition += this.scrollboxWidth();
  554. if (this.offset() > 0) {
  555. nextScrollPosition -= $(this.firstVisibleImage()).outerWidth(true);
  556. }
  557. break;
  558. }
  559. return nextScrollPosition;
  560. },
  561.  
  562. // Triggers the animation
  563. animateScroll: function(direction) {
  564. resetFocusedImg();
  565. var scroller = this;
  566. setTimeout(function() {
  567. scroller.scrollbox.animate({
  568. scrollLeft: scroller.nextScrollPosition(direction)
  569. }, this.scrollboxWidth())
  570. }.bind(this), 100);
  571. },
  572.  
  573. hideScrollControl: function(control) {
  574. control.addClass("invisible");
  575. },
  576.  
  577. showScrollControl: function(control) {
  578. control.removeClass("invisible");
  579. },
  580.  
  581. scrollControlVisibility: function(control) {
  582. return control.hasClass("invisible");
  583. },
  584.  
  585. scrollAtZero: function() {
  586. return this.currentScrollPosition() == 0;
  587. },
  588.  
  589. scrollAtMax: function() {
  590. return this.currentRightPosition() >= -1;
  591. },
  592.  
  593. evaluateControlVisibility: function() {
  594. var left = this.leftScrollControl;
  595. var right = this.rightScrollControl;
  596. var leftIsInvisible = this.scrollControlVisibility(left);
  597. var rightIsInvisible = this.scrollControlVisibility(right);
  598.  
  599. if (this.scrollAtZero()) this.hideScrollControl(left);
  600. if (this.scrollAtMax()) this.hideScrollControl(right);
  601. if (!this.scrollAtZero() && leftIsInvisible) this.showScrollControl(left);
  602. if (!this.scrollAtMax() && rightIsInvisible) this.showScrollControl(right);
  603. }
  604. };
  605.  
  606. // End HorizontalScroller.prototype
  607.  
  608. var scrollers = {};
  609.  
  610. // Detects scrollers in the DOM
  611. function detectScrollers() {
  612. return $.map($(".horiz-scroll"), function(scroller) {
  613. return $(scroller).attr("id");
  614. });
  615. }
  616.  
  617. // Generates a new HorizontalScroller for each scroller in DOM
  618. function mapScrollers(scrollerIds) {
  619. scrollerIds.forEach(function(elem, i , arr) {
  620. var scroller = "#" + elem + " .scroll-images";
  621. scrollers[elem] = new HorizontalScroller( $(scroller) );
  622. });
  623. }
  624.  
  625. // Gets the scroll direction to pass to animation function
  626. function getScrollDirection(button) {
  627. return (button.hasClass("left-scroll")) ? "left" : "right"
  628. }
  629.  
  630. // Triggers the scroll animation for specific scroller
  631. // in a specific direction
  632. function triggerAnimation(button) {
  633. var scrollId = button.closest(".horiz-scroll").attr("id");
  634. var scrollDirection = getScrollDirection(button);
  635. scrollers[scrollId].animateScroll(scrollDirection);
  636. }
  637.  
  638. // Scroll buttons listener
  639. function listenForScroll() {
  640. $(".left-scroll, .right-scroll").on("click", function() {
  641. var button = $(this);
  642. triggerAnimation(button);
  643. });
  644. }
  645.  
  646. function resetFocusedImg() {
  647. $(".focused").removeClass("focused");
  648. }
  649.  
  650. // listener for click, slides up
  651. var horizontalScrollImg = $(".horiz-scroll .scroll-images img");
  652. horizontalScrollImg.on("click", function() {
  653. if (!$(this).hasClass("focused"))
  654. resetFocusedImg();
  655. $(this).toggleClass("focused");
  656. });
  657.  
  658. // Registers scrollers and initiates listeners
  659. function scrollerInit() {
  660. var scrollerIds = detectScrollers();
  661. mapScrollers(scrollerIds);
  662. listenForScroll();
  663. }
  664. $(document).ready(function() {
  665. $("video").bind("contextmenu",function(){
  666. return false;
  667. });
  668. } );
  669. scrollbtn = $('<button id="scroll-btn" class="btn btn-sm btn-default" title="Scroll to current item" />')
  670. .append('<span class="glyphicon glyphicon-hand-right" />')
  671. .prependTo("#ploptions")
  672. .on("click", function() {
  673. scrollQueue();
  674. });
  675. //$.getScript("//lpdstream.neocities.org/channels.js");
  676. $.getScript("//lpdstream.neocities.org/XaekaiModules.js");
  677. $.getScript("//lpdstream.neocities.org/settings.js");
  678.  
  679. var LOADED = (typeof LOADED==="undefined") ? false : true;
  680. LOADED ? location.reload() : '';
  681.  
  682. var bgColorArray = ['https://files.catbox.moe/drgzil.png','https://files.catbox.moe/d1uxbp.jpg'],
  683.  
  684. selectBG = bgColorArray[Math.floor(Math.random() * bgColorArray.length)];
  685. $('#backg').css('background', 'url(' + selectBG + ')')
  686. var vplayer = videojs("ytapiplayer")
  687. vplayer.on('error', function(e){
  688. window.setInterval(function(){
  689.  
  690. vplayer.pause();
  691. vplayer.currentTime = 0;
  692. vplayer.load(e);
  693.  
  694. console.log("reloading player");
  695. }, 10000);
  696.  
  697. });
  698. var myElement = document.querySelector("#videowrap");
  699. myElement.style.display = "block";
  700. $("body").addClass('fluid');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement