Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use sync icons from Material to reduce toolbox clutter #1265

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions plugins/sync.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -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@@
Expand Down Expand Up @@ -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() {
Expand All @@ -719,7 +725,11 @@ window.plugin.sync.setupDialog = function() {
+ 'disabled="disabled">Authorize</button>'
+ '<div id="sync-log"></div>'
+ '</div>';
$('#toolbox').append('<a id="sync-show-dialog" onclick="window.plugin.sync.showDialog();">Sync</a> ');
$('#toolbox').append(
'<a id="sync-show-dialog" onclick="window.plugin.sync.showDialog();" title="Open Sync plugin settings dialog">' +
'<span id="plugin-sync-icon" class="material-icons" style="font-size:18px;vertical-align:middle;">sync</span>' +
'</a>'
);
}

window.plugin.sync.setupCSS = function() {
Expand All @@ -740,6 +750,12 @@ window.plugin.sync.setupCSS = function() {
overflow-y: auto;\
}")
.appendTo("head");
// add Google Material icons if nobody did yet
if ( $( "#material-icons-stylesheet" ).length == 0 ) {
$("head").append(
'<link id="material-icons-stylesheet" rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">'
);
}
}

var setup = function() {
Expand Down