Skip to content

Commit 779209e

Browse files
committed
fix!: apply lint fixes
1 parent 2ad8ed6 commit 779209e

2 files changed

Lines changed: 31 additions & 31 deletions

File tree

tests/tests.js

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -64,24 +64,24 @@ exports.defineAutoTests = function () {
6464
/******************************************************************************/
6565

6666
exports.defineManualTests = function (contentEl, createActionButton) {
67-
var logMessage = function (message) {
68-
var log = document.getElementById('info');
69-
var logLine = document.createElement('div');
67+
const logMessage = function (message) {
68+
const log = document.getElementById('info');
69+
const logLine = document.createElement('div');
7070
logLine.innerHTML = message;
7171
log.appendChild(logLine);
7272
};
7373

74-
var clearLog = function () {
75-
var log = document.getElementById('info');
74+
const clearLog = function () {
75+
const log = document.getElementById('info');
7676
log.innerHTML = '';
7777
};
7878

79-
var beep = function () {
79+
const beep = function () {
8080
console.log('beep()');
8181
navigator.notification.beep(3);
8282
};
8383

84-
var alertDialog = function (message, title, button) {
84+
const alertDialog = function (message, title, button) {
8585
console.log('alertDialog()');
8686
navigator.notification.alert(
8787
message,
@@ -94,7 +94,7 @@ exports.defineManualTests = function (contentEl, createActionButton) {
9494
console.log('After alert');
9595
};
9696

97-
var confirmDialogA = function (message, title, buttons) {
97+
const confirmDialogA = function (message, title, buttons) {
9898
clearLog();
9999
navigator.notification.confirm(
100100
message,
@@ -112,7 +112,7 @@ exports.defineManualTests = function (contentEl, createActionButton) {
112112
);
113113
};
114114

115-
var confirmDialogB = function (message, title, buttons) {
115+
const confirmDialogB = function (message, title, buttons) {
116116
clearLog();
117117
navigator.notification.confirm(
118118
message,
@@ -130,13 +130,13 @@ exports.defineManualTests = function (contentEl, createActionButton) {
130130
);
131131
};
132132

133-
var promptDialog = function (message, title, buttons, defaultText) {
133+
const promptDialog = function (message, title, buttons, defaultText) {
134134
clearLog();
135135
navigator.notification.prompt(
136136
message,
137137
function (r) {
138138
if (r && r.buttonIndex === 0) {
139-
var msg = 'Dismissed dialog';
139+
let msg = 'Dismissed dialog';
140140
if (r.input1) {
141141
msg += ' with input: ' + r.input1;
142142
}
@@ -153,21 +153,21 @@ exports.defineManualTests = function (contentEl, createActionButton) {
153153
);
154154
};
155155

156-
var dismissPrevious = function (successCallback, errorCallback) {
156+
const dismissPrevious = function (successCallback, errorCallback) {
157157
console.log('dismissPrevious()');
158158
navigator.notification.dismissPrevious(successCallback, errorCallback);
159159
};
160160

161-
var dismissAll = function (successCallback, errorCallback) {
161+
const dismissAll = function (successCallback, errorCallback) {
162162
console.log('dismissAll()');
163163
navigator.notification.dismissAll(successCallback, errorCallback);
164164
};
165165

166166
/******************************************************************************/
167-
var isRunningOnAndroid = cordova.platformId === 'android';
168-
var isRunningOniOS = cordova.platformId === 'ios';
167+
const isRunningOnAndroid = cordova.platformId === 'android';
168+
const isRunningOniOS = cordova.platformId === 'ios';
169169

170-
var dialogs_tests =
170+
let dialogs_tests =
171171
'<div id="beep"></div>' +
172172
'Expected result: Device will beep (unless device is on silent). Nothing will get updated in status box.' +
173173
'<h2>Dialog Tests</h2>' +
@@ -218,7 +218,7 @@ exports.defineManualTests = function (contentEl, createActionButton) {
218218
createActionButton(
219219
'Confirm Dialog - Deprecated',
220220
function () {
221-
var buttons = 'Yes,No,Maybe';
221+
const buttons = 'Yes,No,Maybe';
222222
confirmDialogA('You pressed confirm.', 'Confirm Dialog', buttons);
223223
},
224224
'confirm_deprecated'
@@ -227,7 +227,7 @@ exports.defineManualTests = function (contentEl, createActionButton) {
227227
createActionButton(
228228
'Confirm Dialog',
229229
function () {
230-
var buttons = ['Yes', 'No', 'Maybe, Not Sure'];
230+
const buttons = ['Yes', 'No', 'Maybe, Not Sure'];
231231
confirmDialogB('You pressed confirm.', 'Confirm Dialog', buttons);
232232
},
233233
'confirm'
@@ -283,7 +283,7 @@ exports.defineManualTests = function (contentEl, createActionButton) {
283283
createActionButton(
284284
'Alert Dialog with Number',
285285
function () {
286-
var callback = function () {
286+
const callback = function () {
287287
clearLog();
288288
console.log('Test passed');
289289
};
@@ -296,8 +296,8 @@ exports.defineManualTests = function (contentEl, createActionButton) {
296296
createActionButton(
297297
'Alert Dialog with Object',
298298
function () {
299-
var object = { number: 42, message: "Make sure an object doesn't crash iOS", issue: 'CB-8947' };
300-
var callback = function () {
299+
const object = { number: 42, message: "Make sure an object doesn't crash iOS", issue: 'CB-8947' };
300+
const callback = function () {
301301
clearLog();
302302
console.log('Test passed');
303303
};
@@ -310,8 +310,8 @@ exports.defineManualTests = function (contentEl, createActionButton) {
310310
createActionButton(
311311
'Confirm Dialog with Object',
312312
function () {
313-
var object = { number: 42, message: "Make sure an object doesn't crash iOS", issue: 'CB-8947' };
314-
var callback = function () {
313+
const object = { number: 42, message: "Make sure an object doesn't crash iOS", issue: 'CB-8947' };
314+
const callback = function () {
315315
clearLog();
316316
console.log('Test passed');
317317
};
@@ -324,8 +324,8 @@ exports.defineManualTests = function (contentEl, createActionButton) {
324324
createActionButton(
325325
'Prompt Dialog with Object',
326326
function () {
327-
var object = { number: 42, message: "Make sure an object doesn't crash iOS", issue: 'CB-8947' };
328-
var callback = function () {
327+
const object = { number: 42, message: "Make sure an object doesn't crash iOS", issue: 'CB-8947' };
328+
const callback = function () {
329329
clearLog();
330330
console.log('Test passed');
331331
};
@@ -336,8 +336,8 @@ exports.defineManualTests = function (contentEl, createActionButton) {
336336

337337
// Dismissable dialogs (supported on Android & iOS only)
338338
if (isRunningOnAndroid || isRunningOniOS) {
339-
var open2Dialogs = function () {
340-
var openDialogs = function () {
339+
const open2Dialogs = function () {
340+
const openDialogs = function () {
341341
alertDialog('Alert Dialog 1 pressed', 'Alert Dialog 1', 'Continue');
342342
alertDialog('Alert Dialog 2 pressed', 'Alert Dialog 2', 'Continue');
343343
};

www/browser/notification.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ module.exports.confirm = window.navigator.notification.confirm = function (messa
3838
var result = window.confirm(message);
3939
if (callback) {
4040
if (result) {
41-
// eslint-disable-next-line standard/no-callback-literal
41+
// eslint-disable-next-line n/no-callback-literal
4242
callback(1); // OK
4343
} else {
44-
// eslint-disable-next-line standard/no-callback-literal
44+
// eslint-disable-next-line n/no-callback-literal
4545
callback(2); // Cancel
4646
}
4747
}
@@ -54,10 +54,10 @@ module.exports.prompt = window.navigator.notification.prompt = function (message
5454
var result = window.prompt(message, defaultText || '');
5555
if (callback) {
5656
if (result === null) {
57-
// eslint-disable-next-line standard/no-callback-literal
57+
// eslint-disable-next-line n/no-callback-literal
5858
callback({ buttonIndex: 2, input1: '' }); // Cancel
5959
} else {
60-
// eslint-disable-next-line standard/no-callback-literal
60+
// eslint-disable-next-line n/no-callback-literal
6161
callback({ buttonIndex: 1, input1: result }); // OK
6262
}
6363
}

0 commit comments

Comments
 (0)