mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-07 00:17:03 +03:00
Removed unused code from JavaScript files
This commit is contained in:
parent
dc233bfc90
commit
1b331aca32
12 changed files with 140 additions and 427 deletions
44
vendors/qr.js/qr.js
vendored
44
vendors/qr.js/qr.js
vendored
|
|
@ -7,7 +7,7 @@
|
|||
// For all details and documentation:
|
||||
// <http://neocotic.com/qr.js>
|
||||
|
||||
(function (root) {
|
||||
(root => {
|
||||
|
||||
'use strict';
|
||||
|
||||
|
|
@ -203,22 +203,6 @@
|
|||
return data || {};
|
||||
}
|
||||
|
||||
// Override the `qr` API methods that require HTML5 canvas support to throw a relevant error.
|
||||
function overrideAPI(qr) {
|
||||
var methods = [ 'canvas', 'image', 'save', 'saveSync', 'toDataURL' ];
|
||||
var i;
|
||||
|
||||
function overrideMethod(name) {
|
||||
qr[name] = function () {
|
||||
throw new Error(name + ' requires HTML5 canvas element support');
|
||||
};
|
||||
}
|
||||
|
||||
for (i = 0; i < methods.length; i++) {
|
||||
overrideMethod(methods[i]);
|
||||
}
|
||||
}
|
||||
|
||||
// Asynchronously write the data of the rendered canvas to a given file path.
|
||||
function writeFile(cvs, data, callback) {
|
||||
if (typeof data.path !== 'string') {
|
||||
|
|
@ -1188,30 +1172,6 @@
|
|||
// Support
|
||||
// -------
|
||||
|
||||
// Export `qr` for node.js and CommonJS.
|
||||
if (typeof exports !== 'undefined') {
|
||||
inNode = true;
|
||||
|
||||
if (typeof module !== 'undefined' && module.exports) {
|
||||
exports = module.exports = qr;
|
||||
}
|
||||
exports.qr = qr;
|
||||
|
||||
// Import required node.js modules.
|
||||
Canvas = require('canvas');
|
||||
Image = Canvas.Image;
|
||||
fs = require('fs');
|
||||
} else if (typeof define === 'function' && define.amd) {
|
||||
define(function () {
|
||||
return qr;
|
||||
});
|
||||
} else {
|
||||
// In non-HTML5 browser so strip base functionality.
|
||||
if (!root.HTMLCanvasElement) {
|
||||
overrideAPI(qr);
|
||||
}
|
||||
|
||||
root.qr = qr;
|
||||
}
|
||||
root.qr = qr;
|
||||
|
||||
})(this);
|
||||
|
|
|
|||
3
vendors/qr.js/qr.min.js
vendored
3
vendors/qr.js/qr.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue