- Refactoring: Avoid unnecessary addEventListener false; change internal

jPicker function to class (used with `new`)
- Linting (ESLint): Add `valid-jsdoc` rule and make fixes; but turn off for
  now due to <https://github.com/eslint/eslint/issues/11036> and
  <https://github.com/eslint/eslint/issues/11037>
- Docs (JSDoc): Add some Markdown for variables, line breaks; tighten checks
  for overly generic types (though allow for `.Function` as in
  `jQuery.Function`) and avoid one previously missed instance
This commit is contained in:
Brett Zamir
2018-10-30 23:25:20 +08:00
parent 9b9c900ede
commit aef7b095ef
47 changed files with 1664 additions and 1441 deletions

12
dist/canvg.js vendored
View File

@@ -397,7 +397,7 @@ var canvg = (function (exports) {
}
}];
/**
* A class to parse color values
* A class to parse color values.
*/
var RGBColor =
@@ -489,7 +489,7 @@ var canvg = (function (exports) {
return '#' + r + g + b;
}
/**
* help
* Offers a bulleted list of help.
* @returns {HTMLUListElement}
*/
@@ -516,7 +516,7 @@ var canvg = (function (exports) {
var listItem = document.createElement('li');
var listColor = new RGBColor(examples[_i]);
var exampleDiv = document.createElement('div');
exampleDiv.style.cssText = "margin: 3px;\nborder: 1px solid black;\nbackground: ".concat(listColor.toHex(), ";\ncolor: ").concat(listColor.toHex(), ";");
exampleDiv.style.cssText = "\nmargin: 3px;\nborder: 1px solid black;\nbackground: ".concat(listColor.toHex(), ";\ncolor: ").concat(listColor.toHex(), ";");
exampleDiv.append('test');
var listItemValue = " ".concat(examples[_i], " -> ").concat(listColor.toRGB(), " -> ").concat(listColor.toHex());
listItem.append(exampleDiv, listItemValue);
@@ -862,6 +862,7 @@ var canvg = (function (exports) {
/**
* @function module:canvg.setStackBlurCanvasRGBA
* @param {module:canvg.StackBlurCanvasRGBA} cb Will be passed the canvas ID, x, y, width, height, blurRadius
* @returns {undefined}
*/
var setStackBlurCanvasRGBA = function setStackBlurCanvasRGBA(cb) {
@@ -883,7 +884,8 @@ var canvg = (function (exports) {
*/
/**
* If called with no arguments, it will replace all `<svg>` elements on the page with `<canvas>` elements
* If called with no arguments, it will replace all `<svg>` elements on the page
* with `<canvas>` elements.
* @function module:canvg.canvg
* @param {HTMLCanvasElement|string} target canvas element or the id of a canvas element
* @param {string|XMLDocument} s: svg string, url to svg file, or xml document
@@ -936,7 +938,7 @@ var canvg = (function (exports) {
};
/**
* @param {module:canvg.CanvgOptions} opts
* @returns {object}
* @returns {Object}
* @todo Flesh out exactly what object is returned here (after updating to latest and reincluding our changes here and those of StackBlur)
*/

View File

@@ -397,7 +397,7 @@ var svgEditorExtension_server_moinsave = (function () {
}
}];
/**
* A class to parse color values
* A class to parse color values.
*/
var RGBColor =
@@ -489,7 +489,7 @@ var svgEditorExtension_server_moinsave = (function () {
return '#' + r + g + b;
}
/**
* help
* Offers a bulleted list of help.
* @returns {HTMLUListElement}
*/
@@ -516,7 +516,7 @@ var svgEditorExtension_server_moinsave = (function () {
var listItem = document.createElement('li');
var listColor = new RGBColor(examples[_i]);
var exampleDiv = document.createElement('div');
exampleDiv.style.cssText = "margin: 3px;\nborder: 1px solid black;\nbackground: ".concat(listColor.toHex(), ";\ncolor: ").concat(listColor.toHex(), ";");
exampleDiv.style.cssText = "\nmargin: 3px;\nborder: 1px solid black;\nbackground: ".concat(listColor.toHex(), ";\ncolor: ").concat(listColor.toHex(), ";");
exampleDiv.append('test');
var listItemValue = " ".concat(examples[_i], " -> ").concat(listColor.toRGB(), " -> ").concat(listColor.toHex());
listItem.append(exampleDiv, listItemValue);
@@ -860,7 +860,8 @@ var svgEditorExtension_server_moinsave = (function () {
*/
/**
* If called with no arguments, it will replace all `<svg>` elements on the page with `<canvas>` elements
* If called with no arguments, it will replace all `<svg>` elements on the page
* with `<canvas>` elements.
* @function module:canvg.canvg
* @param {HTMLCanvasElement|string} target canvas element or the id of a canvas element
* @param {string|XMLDocument} s: svg string, url to svg file, or xml document
@@ -913,7 +914,7 @@ var svgEditorExtension_server_moinsave = (function () {
};
/**
* @param {module:canvg.CanvgOptions} opts
* @returns {object}
* @returns {Object}
* @todo Flesh out exactly what object is returned here (after updating to latest and reincluding our changes here and those of StackBlur)
*/

View File

@@ -397,7 +397,7 @@ var svgEditorExtension_server_opensave = (function () {
}
}];
/**
* A class to parse color values
* A class to parse color values.
*/
var RGBColor =
@@ -489,7 +489,7 @@ var svgEditorExtension_server_opensave = (function () {
return '#' + r + g + b;
}
/**
* help
* Offers a bulleted list of help.
* @returns {HTMLUListElement}
*/
@@ -516,7 +516,7 @@ var svgEditorExtension_server_opensave = (function () {
var listItem = document.createElement('li');
var listColor = new RGBColor(examples[_i]);
var exampleDiv = document.createElement('div');
exampleDiv.style.cssText = "margin: 3px;\nborder: 1px solid black;\nbackground: ".concat(listColor.toHex(), ";\ncolor: ").concat(listColor.toHex(), ";");
exampleDiv.style.cssText = "\nmargin: 3px;\nborder: 1px solid black;\nbackground: ".concat(listColor.toHex(), ";\ncolor: ").concat(listColor.toHex(), ";");
exampleDiv.append('test');
var listItemValue = " ".concat(examples[_i], " -> ").concat(listColor.toRGB(), " -> ").concat(listColor.toHex());
listItem.append(exampleDiv, listItemValue);
@@ -860,7 +860,8 @@ var svgEditorExtension_server_opensave = (function () {
*/
/**
* If called with no arguments, it will replace all `<svg>` elements on the page with `<canvas>` elements
* If called with no arguments, it will replace all `<svg>` elements on the page
* with `<canvas>` elements.
* @function module:canvg.canvg
* @param {HTMLCanvasElement|string} target canvas element or the id of a canvas element
* @param {string|XMLDocument} s: svg string, url to svg file, or xml document
@@ -913,7 +914,7 @@ var svgEditorExtension_server_opensave = (function () {
};
/**
* @param {module:canvg.CanvgOptions} opts
* @returns {object}
* @returns {Object}
* @todo Flesh out exactly what object is returned here (after updating to latest and reincluding our changes here and those of StackBlur)
*/

View File

@@ -135,6 +135,7 @@ var svgEditorExtension_storage = (function () {
* content into storage)
* 2. Use localStorage to set SVG contents (potentially too large to allow in cookies)
* 3. Use localStorage (where available) or cookies to set preferences.
* @returns {undefined}
*/
@@ -177,7 +178,7 @@ var svgEditorExtension_storage = (function () {
}
}
}
}, false);
});
}
var loaded = false;

View File

@@ -86,7 +86,7 @@ var svgEditorExtension_xdomain_messaging = (function () {
}
e.source.postMessage(JSON.stringify(message), '*');
}, false);
});
} catch (err) {
console.log('Error with xdomain message listener: ' + err);
}

498
dist/index-es.js vendored

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

498
dist/index-umd.js vendored

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -254,7 +254,7 @@
}
}];
/**
* A class to parse color values
* A class to parse color values.
*/
var RGBColor =
@@ -346,7 +346,7 @@
return '#' + r + g + b;
}
/**
* help
* Offers a bulleted list of help.
* @returns {HTMLUListElement}
*/
@@ -373,7 +373,7 @@
var listItem = document.createElement('li');
var listColor = new RGBColor(examples[_i]);
var exampleDiv = document.createElement('div');
exampleDiv.style.cssText = "margin: 3px;\nborder: 1px solid black;\nbackground: ".concat(listColor.toHex(), ";\ncolor: ").concat(listColor.toHex(), ";");
exampleDiv.style.cssText = "\nmargin: 3px;\nborder: 1px solid black;\nbackground: ".concat(listColor.toHex(), ";\ncolor: ").concat(listColor.toHex(), ";");
exampleDiv.append('test');
var listItemValue = " ".concat(examples[_i], " -> ").concat(listColor.toRGB(), " -> ").concat(listColor.toHex());
listItem.append(exampleDiv, listItemValue);