1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 17:59:55 +02:00

Improving the get restream credentials

This commit is contained in:
DanieL 2022-05-20 16:22:54 -03:00
parent 654dda115a
commit 56cb1fd5cb
6058 changed files with 1166166 additions and 1430809 deletions

View file

@ -1,81 +1,81 @@
// button
( function( window, factory ) {
// universal module definition
if ( typeof module == 'object' && module.exports ) {
// CommonJS
module.exports = factory(
window,
require('./core'),
require('fizzy-ui-utils'),
);
} else {
// browser global
factory(
window,
window.InfiniteScroll,
window.fizzyUIUtils,
);
}
}( window, function factory( window, InfiniteScroll, utils ) {
// -------------------------- InfiniteScrollButton -------------------------- //
class InfiniteScrollButton {
constructor( element, infScroll ) {
this.element = element;
this.infScroll = infScroll;
// events
this.clickHandler = this.onClick.bind( this );
this.element.addEventListener( 'click', this.clickHandler );
infScroll.on( 'request', this.disable.bind( this ) );
infScroll.on( 'load', this.enable.bind( this ) );
infScroll.on( 'error', this.hide.bind( this ) );
infScroll.on( 'last', this.hide.bind( this ) );
}
onClick( event ) {
event.preventDefault();
this.infScroll.loadNextPage();
}
enable() {
this.element.removeAttribute('disabled');
}
disable() {
this.element.disabled = 'disabled';
}
hide() {
this.element.style.display = 'none';
}
destroy() {
this.element.removeEventListener( 'click', this.clickHandler );
}
}
// -------------------------- InfiniteScroll methods -------------------------- //
// InfiniteScroll.defaults.button = null;
InfiniteScroll.create.button = function() {
let buttonElem = utils.getQueryElement( this.options.button );
if ( buttonElem ) {
this.button = new InfiniteScrollButton( buttonElem, this );
}
};
InfiniteScroll.destroy.button = function() {
if ( this.button ) this.button.destroy();
};
// -------------------------- -------------------------- //
InfiniteScroll.Button = InfiniteScrollButton;
return InfiniteScroll;
} ) );
// button
( function( window, factory ) {
// universal module definition
if ( typeof module == 'object' && module.exports ) {
// CommonJS
module.exports = factory(
window,
require('./core'),
require('fizzy-ui-utils'),
);
} else {
// browser global
factory(
window,
window.InfiniteScroll,
window.fizzyUIUtils,
);
}
}( window, function factory( window, InfiniteScroll, utils ) {
// -------------------------- InfiniteScrollButton -------------------------- //
class InfiniteScrollButton {
constructor( element, infScroll ) {
this.element = element;
this.infScroll = infScroll;
// events
this.clickHandler = this.onClick.bind( this );
this.element.addEventListener( 'click', this.clickHandler );
infScroll.on( 'request', this.disable.bind( this ) );
infScroll.on( 'load', this.enable.bind( this ) );
infScroll.on( 'error', this.hide.bind( this ) );
infScroll.on( 'last', this.hide.bind( this ) );
}
onClick( event ) {
event.preventDefault();
this.infScroll.loadNextPage();
}
enable() {
this.element.removeAttribute('disabled');
}
disable() {
this.element.disabled = 'disabled';
}
hide() {
this.element.style.display = 'none';
}
destroy() {
this.element.removeEventListener( 'click', this.clickHandler );
}
}
// -------------------------- InfiniteScroll methods -------------------------- //
// InfiniteScroll.defaults.button = null;
InfiniteScroll.create.button = function() {
let buttonElem = utils.getQueryElement( this.options.button );
if ( buttonElem ) {
this.button = new InfiniteScrollButton( buttonElem, this );
}
};
InfiniteScroll.destroy.button = function() {
if ( this.button ) this.button.destroy();
};
// -------------------------- -------------------------- //
InfiniteScroll.Button = InfiniteScrollButton;
return InfiniteScroll;
} ) );