Advertisement
Guest User

Untitled

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