From d747eaa6c22eb6811dd9bba87ed2ae2ffee1d309 Mon Sep 17 00:00:00 2001 From: Philippe Houdoin Date: Wed, 23 May 2018 18:51:28 +0200 Subject: [PATCH 1/2] Use sync icons from Material to reduce toolbox clutter --- plugins/sync.user.js | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/plugins/sync.user.js b/plugins/sync.user.js index cd55757a8..4327888c3 100644 --- a/plugins/sync.user.js +++ b/plugins/sync.user.js @@ -2,7 +2,7 @@ // @id iitc-plugin-sync@xelio // @name IITC plugin: Sync // @category Misc -// @version 0.2.3.@@DATETIMEVERSION@@ +// @version 0.2.4.@@DATETIMEVERSION@@ // @namespace https://github.com/jonatkins/ingress-intel-total-conversion // @updateURL @@UPDATEURL@@ // @downloadURL @@DOWNLOADURL@@ @@ -702,7 +702,13 @@ window.plugin.sync.toggleDialogLink = function() { authed = plugin.sync.authorizer.isAuthed(); anyFail = plugin.sync.registeredPluginsFields.anyFail; - $('#sync-show-dialog').toggleClass('sync-show-dialog-error', !authed || anyFail); + if (anyFail) { + $('#plugin-sync-icon').css('color', '#FF2222').text('sync_problem'); + } else if (!authed) { + $('#plugin-sync-icon').css('color', 'gray').text('sync_disabled'); + } else { + $('#plugin-sync-icon').css('color', COLORS[TEAM_ENL]).text('sync'); + } } window.plugin.sync.showDialog = function() { @@ -719,7 +725,11 @@ window.plugin.sync.setupDialog = function() { + 'disabled="disabled">Authorize' + '
' + ''; - $('#toolbox').append('Sync '); + $('#toolbox').append( + '' + + 'sync' + + '' + ); } window.plugin.sync.setupCSS = function() { @@ -740,6 +750,11 @@ window.plugin.sync.setupCSS = function() { overflow-y: auto;\ }") .appendTo("head"); + // add Google Material icons. + $("head").append( + '' + ); + } var setup = function() { From e9c176a454c249b1b9fa88f8611cd1f29e256ebb Mon Sep 17 00:00:00 2001 From: phoudoin Date: Sat, 1 Aug 2020 05:05:20 +0200 Subject: [PATCH 2/2] Avoid multiple Material Icons stylesheet loading --- plugins/sync.user.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/sync.user.js b/plugins/sync.user.js index 4327888c3..86223853e 100644 --- a/plugins/sync.user.js +++ b/plugins/sync.user.js @@ -750,11 +750,12 @@ window.plugin.sync.setupCSS = function() { overflow-y: auto;\ }") .appendTo("head"); - // add Google Material icons. - $("head").append( - '' - ); - + // add Google Material icons if nobody did yet + if ( $( "#material-icons-stylesheet" ).length == 0 ) { + $("head").append( + '' + ); + } } var setup = function() {