Skip to content

Commit 280901b

Browse files
author
Sebi Nemeth
committed
remove timelog
1 parent b729aee commit 280901b

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

dist/index.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,6 @@ class LiveTranslatorManager {
221221
console.log(`%c Live Translator ${this._enabled ? 'ON' : 'OFF'} `, 'background: #222; color: #bada55');
222222
}
223223
render() {
224-
if (this._enabled) {
225-
console.time();
226-
}
227224
this._box.style.display = 'none';
228225
document.
229226
querySelectorAll('.live-translator-badge-container').
@@ -239,7 +236,6 @@ class LiveTranslatorManager {
239236
while (queue.length > 0) {
240237
const node = queue.pop();
241238
const badges = [];
242-
const parent = node.parentElement;
243239
if (node instanceof Text) {
244240
const matches = node.textContent.match(re);
245241
for (const match of matches ?? []) {
@@ -290,7 +286,6 @@ class LiveTranslatorManager {
290286
queue.push(child);
291287
}
292288
}
293-
console.timeEnd();
294289
}
295290
showBox(node, attribute = false) {
296291
const rect = !attribute ? getBoundingClientRect(node) : node.getClientRects()[0];
@@ -326,6 +321,7 @@ const createBadge = (meta, options, node, attribute) => {
326321
badge.href = options.translationLink(meta);
327322
badge.target = 'popup';
328323
badge.addEventListener('click', (e) => {
324+
console.log('clicked', badge.href);
329325
window.open(badge.href, 'popup', 'width=600,height=600,scrollbars=no,resizable=no');
330326
e.preventDefault();
331327
return false;

src/index.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -259,9 +259,6 @@ class LiveTranslatorManager {
259259
}
260260

261261
render () {
262-
if (this._enabled) {
263-
console.time()
264-
}
265262
this._box.style.display = 'none'
266263
document.
267264
querySelectorAll('.live-translator-badge-container').
@@ -282,7 +279,6 @@ class LiveTranslatorManager {
282279
const node = queue.pop() as HTMLElement
283280

284281
const badges = [] as HTMLElement[]
285-
const parent = node.parentElement as HTMLElement
286282

287283
if (node instanceof Text) {
288284
const matches = (node.textContent as string).match(re)
@@ -336,7 +332,6 @@ class LiveTranslatorManager {
336332
queue.push(child)
337333
}
338334
}
339-
console.timeEnd()
340335
}
341336

342337
showBox(node: Node, attribute = false) {
@@ -372,6 +367,8 @@ const createBadge = (meta: TranslationMeta, options: LiveTranslatorPluginOptions
372367
badge.href = options.translationLink(meta)
373368
badge.target = 'popup'
374369
badge.addEventListener('click', (e: Event) => {
370+
console.log('clicked', badge.href);
371+
375372
window.open(badge.href, 'popup', 'width=600,height=600,scrollbars=no,resizable=no')
376373
e.preventDefault()
377374
return false

0 commit comments

Comments
 (0)