From 9a68ba6358ff246a9019e5df544c6c43b14bcf15 Mon Sep 17 00:00:00 2001 From: JFH <20402845+jfhenon@users.noreply.github.com> Date: Sat, 15 May 2021 16:20:13 +0200 Subject: [PATCH] fix some useless console.log --- cypress/integration/unit/draw.js | 1 - cypress/integration/unit/test1.js | 2 - docs/jsdoc-config.js | 53 +------------------ src/editor/Editor.js | 2 +- src/editor/EditorStartup.js | 1 - src/editor/contextmenu.js | 1 - .../extensions/ext-imagelib/openclipart.js | 3 -- .../extensions/ext-markers/ext-markers.js | 3 -- .../extensions/ext-mathjax/ext-mathjax.js | 5 +- .../extensions/ext-placemark/ext-placemark.js | 1 - .../ext-webappfind/ext-webappfind.js | 1 - src/editor/locale.js | 2 +- src/svgcanvas/path-actions.js | 4 +- 13 files changed, 6 insertions(+), 73 deletions(-) diff --git a/cypress/integration/unit/draw.js b/cypress/integration/unit/draw.js index f18338e5..8164f80d 100644 --- a/cypress/integration/unit/draw.js +++ b/cypress/integration/unit/draw.js @@ -727,7 +727,6 @@ describe('draw.Drawing', function () { drawing.setLayerOpacity(LAYER3, -1.4); assert.strictEqual(drawing.getLayerOpacity(LAYER1), 0.4); - // console.log('layer2 opacity ' + drawing.getLayerOpacity(LAYER2)); assert.strictEqual(drawing.getLayerOpacity(LAYER2), 1.0); assert.strictEqual(drawing.getLayerOpacity(LAYER3), 1.0); diff --git a/cypress/integration/unit/test1.js b/cypress/integration/unit/test1.js index 64f2ee83..185964e3 100644 --- a/cypress/integration/unit/test1.js +++ b/cypress/integration/unit/test1.js @@ -159,8 +159,6 @@ describe('Basic Module', function () { assert.strictEqual(attrVal, 'bar', true, 'Preserved namespaced attribute on import'); const output = svgCanvas.getSvgString(); - // } catch(e) {console.log(e)} - // console.log('output',output); const hasXlink = output.includes('xmlns:xlink="http://www.w3.org/1999/xlink"'); const hasSe = output.includes('xmlns:se='); const hasFoo = output.includes('xmlns:foo='); diff --git a/docs/jsdoc-config.js b/docs/jsdoc-config.js index 5461f541..88c78af1 100644 --- a/docs/jsdoc-config.js +++ b/docs/jsdoc-config.js @@ -3,58 +3,7 @@ module.exports = { plugins: [ 'plugins/markdown' ], - markdown: { - // tags: ['examples'] - /* - // "The highlighter function should escape the code block's contents and wrap them in
tags"
- highlight (code, language) {
- function ret () {
- // Default:
- return '' + code + ' in this language: ' + language + '
';
- }
- if (language !== 'js') { // E.g., we have one URL in some tutorial Markdown
- // Seems to be only for full triple-backticked fences
- // console.log('lll', code);
- return ret();
- }
-
- // Programmatic ESLint API: https://eslint.org/docs/developer-guide/nodejs-api
- const {CLIEngine} = require('eslint');
- const cli = new CLIEngine({
- useEslintrc: true,
- rules: {
- 'no-undef': 0, // Many variables in examples will be undefined
- 'padded-blocks': 0 // Can look nicer
- }
- });
-
- // Undo escaping done by node_modules/jsdoc/lib/jsdoc/util/markdown.js
- code = code
- .replace(/\s+$/, '')
- .replace(/'/g, "'")
- .replace(/(https?):\\\/\\\//g, '$1://')
- .replace(/\{@[^}\r\n]+\}/g, function (wholeMatch) {
- return wholeMatch.replace(/"/g, '"');
- });
-
- // lint the supplied text and optionally set
- // a filename that is displayed in the report
- const report = cli.executeOnText(code + '\n');
- if (!report.errorCount && !report.warningCount) {
- return ret();
- }
-
- // Although we don't get the file, at least we can report the source code
- const {messages} = report.results[0];
- messages.forEach(({message, line, column, severity, ruleId}) => {
- console.log(`${ruleId}: ${message} (Severity: ${severity}; ${line}:${column})`);
- });
- console.log('\n' + code);
-
- return ret();
- }
- */
- },
+ markdown: {},
recurseDepth: 10,
source: {
exclude: [
diff --git a/src/editor/Editor.js b/src/editor/Editor.js
index d8442f8b..1ad1a808 100644
--- a/src/editor/Editor.js
+++ b/src/editor/Editor.js
@@ -775,7 +775,7 @@ class Editor extends EditorStartup {
const icon = (typeof iconId === 'string') ? img : iconId.cloneNode(true);
if (!icon) {
// Todo: Investigate why this still occurs in some cases
- console.log('NOTE: Icon image missing: ' + iconId);
+ console.warn('NOTE: Icon image missing: ' + iconId);
return;
}
// empty()
diff --git a/src/editor/EditorStartup.js b/src/editor/EditorStartup.js
index 891f749a..7042b873 100644
--- a/src/editor/EditorStartup.js
+++ b/src/editor/EditorStartup.js
@@ -789,7 +789,6 @@ class EditorStartup {
* @returns {void}
*/
messageListener ({ data, origin }) {
- // console.log('data, origin, extensionsAdded', data, origin, extensionsAdded);
const messageObj = { data, origin };
if (!this.extensionsAdded) {
this.messageQueue.push(messageObj);
diff --git a/src/editor/contextmenu.js b/src/editor/contextmenu.js
index 145ee5b9..3322e080 100644
--- a/src/editor/contextmenu.js
+++ b/src/editor/contextmenu.js
@@ -48,7 +48,6 @@ export const add = function (menuItem) {
throw new Error('Cannot add extension "' + menuItem.id + '", an extension by that name already exists"');
}
// Register menuItem action, see below for deferred menu dom injection
- console.log('Registered contextmenu item: {id:' + menuItem.id + ', label:' + menuItem.label + '}');
contextMenuExtensions[menuItem.id] = menuItem;
// TODO: Need to consider how to handle custom enable/disable behavior
};
diff --git a/src/editor/extensions/ext-imagelib/openclipart.js b/src/editor/extensions/ext-imagelib/openclipart.js
index 0cd810b4..56563ffa 100644
--- a/src/editor/extensions/ext-imagelib/openclipart.js
+++ b/src/editor/extensions/ext-imagelib/openclipart.js
@@ -34,7 +34,6 @@ async function processResults (url) {
const r = await fetch(url);
const json = await r.json();
- // console.log('json', json);
if (!json || json.msg !== 'success') {
// Todo: This could use a generic alert library instead
@@ -87,7 +86,6 @@ async function processResults (url) {
async click (e) {
e.preventDefault();
const { value: svgurl } = this.dataset;
- // console.log('this', id, svgurl);
const post = (message) => {
// Todo: Make origin customizable as set by opening window
// Todo: If dropping IE9, avoid stringifying
@@ -103,7 +101,6 @@ async function processResults (url) {
});
const result = await fetch(svgurl);
const svg = await result.text();
- // console.log('url and svg', svgurl, svg);
post({
href: svgurl,
data: svg
diff --git a/src/editor/extensions/ext-markers/ext-markers.js b/src/editor/extensions/ext-markers/ext-markers.js
index c4148a7f..d1defea3 100644
--- a/src/editor/extensions/ext-markers/ext-markers.js
+++ b/src/editor/extensions/ext-markers/ext-markers.js
@@ -123,8 +123,6 @@ export default {
function setIcon (pos, id) {
if (id.substr(0, 1) !== '\\') { id = '\\textmarker'; }
const ci = idPrefix + pos + '_' + id.substr(1);
- console.log(ci);
- console.log('cur_' + pos + '_marker_list');
svgEditor.setIcon('cur_' + pos + '_marker_list', $id(ci).children);
$id(ci).classList.add('current');
const siblings = Array.prototype.filter.call($id(ci).parentNode.children, function(child){
@@ -585,7 +583,6 @@ export default {
},
selectedChanged (opts) {
// Use this to update the current selected elements
- // console.log('selectChanged',opts);
selElems = opts.elems;
const markerElems = [ 'line', 'path', 'polyline', 'polygon' ];
diff --git a/src/editor/extensions/ext-mathjax/ext-mathjax.js b/src/editor/extensions/ext-mathjax/ext-mathjax.js
index f5f891a3..dc65204d 100644
--- a/src/editor/extensions/ext-mathjax/ext-mathjax.js
+++ b/src/editor/extensions/ext-mathjax/ext-mathjax.js
@@ -191,12 +191,11 @@ export default {
// When MathJax is loaded get the div where the math will be rendered.
MathJax.Hub.queue.Push(function () {
math = MathJax.Hub.getAllJax('#mathjax_creator')[0];
- console.log(math);
mathjaxLoaded = true;
- console.log('MathJax Loaded');
+ console.info('MathJax Loaded');
});
} catch (e) {
- console.log('Failed loading MathJax.');
+ console.warn('Failed loading MathJax.');
// eslint-disable-next-line no-alert
alert('Failed loading MathJax. You will not be able to change the mathematics.');
}
diff --git a/src/editor/extensions/ext-placemark/ext-placemark.js b/src/editor/extensions/ext-placemark/ext-placemark.js
index 1be71c58..d2553640 100644
--- a/src/editor/extensions/ext-placemark/ext-placemark.js
+++ b/src/editor/extensions/ext-placemark/ext-placemark.js
@@ -223,7 +223,6 @@ export default {
function colorChanged (el) {
const color = el.getAttribute('stroke');
const marker = getLinked(el, 'marker-start');
- // console.log(marker);
if (!marker) { return; }
if (!marker.attributes.class) { return; } // not created by this extension
const ch = marker.lastElementChild;
diff --git a/src/editor/extensions/ext-webappfind/ext-webappfind.js b/src/editor/extensions/ext-webappfind/ext-webappfind.js
index a4c52a98..57ebc2cc 100644
--- a/src/editor/extensions/ext-webappfind/ext-webappfind.js
+++ b/src/editor/extensions/ext-webappfind/ext-webappfind.js
@@ -41,7 +41,6 @@ export default {
* @returns {void}
*/
(win, { data, origin }) => {
- // console.log('data, origin', data, origin);
let type, content;
try {
({ type, pathID, content } = data.webappfind); // May throw if data is not an object
diff --git a/src/editor/locale.js b/src/editor/locale.js
index b7a12d6f..f1cc897b 100644
--- a/src/editor/locale.js
+++ b/src/editor/locale.js
@@ -83,7 +83,7 @@ export const putLocale = async function (givenParam, goodLangs) {
}
}
});
- console.log(`Lang: ${i18next.t('lang')}`);
+ console.info(`Lang: ${i18next.t('lang')}`);
return { langParam, i18next };
};
diff --git a/src/svgcanvas/path-actions.js b/src/svgcanvas/path-actions.js
index 2feff101..a4b69975 100644
--- a/src/svgcanvas/path-actions.js
+++ b/src/svgcanvas/path-actions.js
@@ -318,8 +318,7 @@ export const pathActionsMethod = (function () {
}
return element;
};
- // console.log(pathActionsContext_);
- // const convertPath = pathActionsContext_.getConvertPath();
+
return (/** @lends module:path.pathActions */ {
/**
* @param {MouseEvent} evt
@@ -464,7 +463,6 @@ export const pathActionsMethod = (function () {
editorContext_.getMouseTarget(evt)
)) {
// Clicked outside canvas, so don't make point
- // console.log('Clicked outside canvas');
return false;
}