lint: Run eslint --fix on bin/ and tests/

This commit is contained in:
Richard Hansen 2020-11-23 13:21:51 -05:00 committed by John McLear
parent 0625739cb8
commit b8d07a42eb
78 changed files with 4319 additions and 4599 deletions

View file

@ -3,9 +3,9 @@
*
* @returns {HTMLElement} contentWindow
*/
helper.contentWindow = function(){
helper.contentWindow = function () {
return $('#iframe-container iframe')[0].contentWindow;
}
};
/**
* Opens the chat unless it is already open via an
@ -13,117 +13,118 @@ helper.contentWindow = function(){
*
* @returns {Promise}
*/
helper.showChat = function(){
var chaticon = helper.chatIcon();
if(chaticon.hasClass('visible')) {
chaticon.click()
return helper.waitForPromise(function(){return !chaticon.hasClass('visible'); },2000)
helper.showChat = function () {
const chaticon = helper.chatIcon();
if (chaticon.hasClass('visible')) {
chaticon.click();
return helper.waitForPromise(() => !chaticon.hasClass('visible'), 2000);
}
}
};
/**
* Closes the chat window if it is shown and not sticky
*
* @returns {Promise}
*/
helper.hideChat = function(){
if(helper.isChatboxShown() && !helper.isChatboxSticky()) {
helper.titlecross().click()
return helper.waitForPromise(function(){return !helper.isChatboxShown(); },2000);
helper.hideChat = function () {
if (helper.isChatboxShown() && !helper.isChatboxSticky()) {
helper.titlecross().click();
return helper.waitForPromise(() => !helper.isChatboxShown(), 2000);
}
}
};
/**
* Gets the chat icon from the bottom right of the page
*
* @returns {HTMLElement} the chat icon
*/
helper.chatIcon = function(){return helper.padChrome$('#chaticon')}
helper.chatIcon = function () { return helper.padChrome$('#chaticon'); };
/**
* The chat messages from the UI
*
* @returns {Array.<HTMLElement>}
*/
helper.chatTextParagraphs = function(){return helper.padChrome$('#chattext').children("p")}
helper.chatTextParagraphs = function () { return helper.padChrome$('#chattext').children('p'); };
/**
* Returns true if the chat box is sticky
*
* @returns {boolean} stickyness of the chat box
*/
helper.isChatboxSticky = function() {
helper.isChatboxSticky = function () {
return helper.padChrome$('#chatbox').hasClass('stickyChat');
}
};
/**
* Returns true if the chat box is shown
*
* @returns {boolean} visibility of the chat box
*/
helper.isChatboxShown = function() {
helper.isChatboxShown = function () {
return helper.padChrome$('#chatbox').hasClass('visible');
}
};
/**
* Gets the settings menu
*
* @returns {HTMLElement} the settings menu
*/
helper.settingsMenu = function(){return helper.padChrome$('#settings') };
helper.settingsMenu = function () { return helper.padChrome$('#settings'); };
/**
* Gets the settings button
*
* @returns {HTMLElement} the settings button
*/
helper.settingsButton = function(){return helper.padChrome$("button[data-l10n-id='pad.toolbar.settings.title']") }
helper.settingsButton = function () { return helper.padChrome$("button[data-l10n-id='pad.toolbar.settings.title']"); };
/**
* Gets the titlecross icon
*
* @returns {HTMLElement} the titlecross icon
*/
helper.titlecross = function(){return helper.padChrome$('#titlecross')}
helper.titlecross = function () { return helper.padChrome$('#titlecross'); };
/**
* Returns true if the settings menu is visible
*
* @returns {boolean} is the settings menu shown?
*/
helper.isSettingsShown = function() {
helper.isSettingsShown = function () {
return helper.padChrome$('#settings').hasClass('popup-show');
}
};
/**
* Gets the timer div of a timeslider that has the datetime of the revision
*
* @returns {HTMLElement} timer
*/
helper.timesliderTimer = function(){
if(typeof helper.contentWindow().$ == 'function'){
return helper.contentWindow().$('#timer') }
helper.timesliderTimer = function () {
if (typeof helper.contentWindow().$ === 'function') {
return helper.contentWindow().$('#timer');
}
};
/**
* Gets the time of the revision on a timeslider
*
* @returns {HTMLElement} timer
*/
helper.timesliderTimerTime = function(){
if(helper.timesliderTimer()){
return helper.timesliderTimer().text()
helper.timesliderTimerTime = function () {
if (helper.timesliderTimer()) {
return helper.timesliderTimer().text();
}
}
};
/**
* The ui-slidar-bar element in the timeslider
*
* @returns {HTMLElement}
*/
helper.sliderBar = function(){
return helper.contentWindow().$('#ui-slider-bar')
}
helper.sliderBar = function () {
return helper.contentWindow().$('#ui-slider-bar');
};
/**
* revision_date element
@ -131,9 +132,9 @@ helper.sliderBar = function(){
*
* @returns {HTMLElement}
*/
helper.revisionDateElem = function(){
helper.revisionDateElem = function () {
return helper.contentWindow().$('#revision_date').text();
}
};
/**
* revision_label element
@ -141,6 +142,6 @@ helper.revisionDateElem = function(){
*
* @returns {HTMLElement}
*/
helper.revisionLabelElem = function(){
return helper.contentWindow().$('#revision_label')
}
helper.revisionLabelElem = function () {
return helper.contentWindow().$('#revision_label');
};