LocalCDN-Firefox-Chrome-Brave/pages/welcome/welcome.js

53 lines
1.0 KiB
JavaScript
Raw Normal View History

2020-06-03 16:31:25 +02:00
/**
* Welcome Page
2020-06-30 18:41:58 +02:00
* Belongs to LocalCDN (since 2020-02-26)
* (Origin: Decentraleyes)
2020-06-03 16:31:25 +02:00
*
2020-06-30 18:41:58 +02:00
* @author nobody
2020-06-03 16:31:25 +02:00
* @since 2020-02-27
2020-06-30 18:41:58 +02:00
*
2020-06-03 16:31:25 +02:00
* @license MPL 2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
'use strict';
/**
* Welcome
*/
var welcome = {};
/**
* Event Handlers
*/
welcome._onDonationElementClicked = function () {
if (event.button === 0 || event.button === 1) {
chrome.tabs.create({
'url': chrome.extension.getURL('pages/donate/donate.html'),
'active': (event.button === 0)
});
}
if (event.button === 0) {
window.close();
}
};
welcome._onDocumentLoaded = function () {
2020-07-05 09:42:04 +02:00
let donationElement = document.getElementById('donate');
2020-06-03 16:31:25 +02:00
donationElement.addEventListener('mouseup', welcome._onDonationElementClicked);
};
document.addEventListener('DOMContentLoaded', welcome._onDocumentLoaded);