chore: add precommit hook for testing code style (#1448)

* chore: add precommit hook for testing code style

* chore: use prettier + eslint for js code
This commit is contained in:
Charles Kerr
2020-09-13 21:41:32 -05:00
committed by GitHub
parent a4dd67ae45
commit be219ddee0
26 changed files with 5368 additions and 4999 deletions

View File

@@ -6,46 +6,48 @@
*/
function main() {
// IE specific fixes here
if (jQuery.browser.msie) {
try {
document.execCommand("BackgroundImageCache", false, true);
} catch (err) {};
// IE specific fixes here
if (jQuery.browser.msie) {
try {
document.execCommand('BackgroundImageCache', false, true);
} catch (err) {
// no-op
}
}
if (jQuery.browser.safari) {
// Move search field's margin down for the styled input
document.getElementById('torrent_search').style['margin-top'] = 3;
}
if (isMobileDevice) {
window.onload = function () {
setTimeout(function () {
window.scrollTo(0, 1);
}, 500);
};
if (jQuery.browser.safari) {
// Move search field's margin down for the styled input
document.getElementById("torrent_search").style["margin-top"] = 3;
window.onorientationchange = function () {
setTimeout(function () {
window.scrollTo(0, 1);
}, 100);
};
if (window.navigator.standalone) {
// Fix min height for isMobileDevice when run in full screen mode from home screen
// so the footer appears in the right place
document.getElementById('torrent_container').style['min-height'] = '338px';
}
} else {
// Fix for non-Safari-3 browsers: dark borders to replace shadows.
Array.from(document.getElementsByClassName('dialog_window')).forEach(function (e) {
e.style['border'] = '1px solid #777';
});
}
if (isMobileDevice) {
window.onload = function () {
setTimeout(function () {
window.scrollTo(0, 1);
}, 500);
};
window.onorientationchange = function () {
setTimeout(function () {
window.scrollTo(0, 1);
}, 100);
};
if (window.navigator.standalone) {
// Fix min height for isMobileDevice when run in full screen mode from home screen
// so the footer appears in the right place
document.getElementById("torrent_container").style["min-height"] = "338px";
};
} else {
// Fix for non-Safari-3 browsers: dark borders to replace shadows.
Array.from(document.getElementsByClassName("dialog_window")).forEach(function (e) {
e.style["border"] = "1px solid #777";
});
};
// Initialise the dialog controller
dialog = new Dialog();
// Initialise the dialog controller
dialog = new Dialog();
// Initialise the main Transmission controller
transmission = new Transmission();
}
// Initialise the main Transmission controller
transmission = new Transmission();
};
document.addEventListener("DOMContentLoaded", main);
document.addEventListener('DOMContentLoaded', main);