From bd44f831218561575545cff7c5d9507269664b9a Mon Sep 17 00:00:00 2001 From: Rob Garrison Date: Thu, 29 Nov 2018 05:54:35 -0600 Subject: [PATCH] Cleanup --- install-usercss.html | 6 ++++-- install-usercss/install-usercss.css | 11 +++++++++++ install-usercss/install-usercss.js | 5 ----- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/install-usercss.html b/install-usercss.html index 00e71cb8..177431cc 100644 --- a/install-usercss.html +++ b/install-usercss.html @@ -60,13 +60,15 @@

diff --git a/install-usercss/install-usercss.css b/install-usercss/install-usercss.css index f9381981..71b6ebf5 100644 --- a/install-usercss/install-usercss.css +++ b/install-usercss/install-usercss.css @@ -246,6 +246,17 @@ h2.installed.active { min-width: 0; } +.unavailable-message, +.unavailable .available-message, +.live-reload.unavailable input, +.set-update-url.unavailable input { + display: none; +} + +.unavailable .unavailable-message { + display: block; +} + .set-update-url { flex-wrap: wrap; } diff --git a/install-usercss/install-usercss.js b/install-usercss/install-usercss.js index 1304c372..8eeefbe9 100644 --- a/install-usercss/install-usercss.js +++ b/install-usercss/install-usercss.js @@ -16,8 +16,6 @@ let port; if (params.has('direct')) { - $('.live-reload input').classList.add('hidden'); - $('.live-reload span').textContent = t('liveReloadUnavailable'); $('.live-reload').classList.add('unavailable'); getCodeDirectly(); } else { @@ -311,15 +309,12 @@ // prefer the installation URL unless drag'n'dropped on the manage page const installationUrl = (params.get('updateUrl') || '').replace(/^blob.+/, ''); const updateUrl = new URL(installationUrl || style.updateUrl || DUMMY_URL); - $('.set-update-url > span').textContent = t('installUpdateFromLabel'); if (dup && dup.updateUrl === updateUrl.href) { checker.checked = true; // there is no way to "unset" updateUrl, you can only overwrite it. checker.disabled = true; } else if (updateUrl.href === DUMMY_URL) { // drag'n'dropped on the manage page and the style doesn't have @updateURL - $('.set-update-url input').classList.add('hidden') - $('.set-update-url span').textContent = t('installUpdateUnavailable'); $('.set-update-url').classList.add('unavailable'); return; } else if (updateUrl.protocol !== 'file:') {