From 7affeedd3bd8f7d06da08ae8cfb4d7e8c4126b08 Mon Sep 17 00:00:00 2001 From: Jeremy Schomery Date: Wed, 19 Jul 2017 17:08:27 +0430 Subject: [PATCH] removing tE() --- edit/edit.js | 6 +++--- js/localization.js | 11 ----------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/edit/edit.js b/edit/edit.js index bc34ee73..7d1e382e 100644 --- a/edit/edit.js +++ b/edit/edit.js @@ -1234,7 +1234,7 @@ function init() { const params = getParams(); if (!params.id) { // match should be 2 - one for the whole thing, one for the parentheses // This is an add - tE('heading', 'addStyleTitle'); + $('#heading').textContent = t('addStyleTitle'); const section = {code: ''}; for (const i in CssToProperty) { if (params[i]) { @@ -1252,7 +1252,7 @@ function init() { return; } // This is an edit - tE('heading', 'editStyleHeading', null, false); + $('#heading').textContent = t('editStyleHeading'); getStylesSafe({id: params.id}).then(styles => { let style = styles[0]; if (!style) { @@ -1505,7 +1505,7 @@ function saveComplete(style) { // Go from new style URL to edit style URL if (location.href.indexOf('id=') === -1) { history.replaceState({}, document.title, 'edit.html?id=' + style.id); - tE('heading', 'editStyleHeading', null, false); + $('#heading').textContent = t('editStyleHeading'); } updateTitle(); } diff --git a/js/localization.js b/js/localization.js index d976ab62..f7f572cf 100644 --- a/js/localization.js +++ b/js/localization.js @@ -17,17 +17,6 @@ function t(key, params) { } -function tE(id, key, attr, esc) { - if (attr) { - document.getElementById(id).setAttribute(attr, t(key)); - } else if (typeof esc === 'undefined' || esc) { - document.getElementById(id).appendChild(document.createTextNode(t(key))); - } else { - document.getElementById(id).innerHTML = t(key); - } -} - - function tHTML(html, tag) { // body is a text node without HTML tags if (typeof html === 'string' && !tag && /<\w+/.test(html) === false) {