Skip to content

Commit d635523

Browse files
committed
(JS) update findbarMods.uc.js to 1.3.3.
update pre-proton star button script to 1.3.1. update toolbox button script to preload animations. (CSS) fix an issue with star button animation. fix app menu banner items not having a focused style.
1 parent 78e5295 commit d635523

7 files changed

+568
-557
lines changed

JS/atoolboxButton.uc.js

+11-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ==UserScript==
22
// @name Toolbox Button
3-
// @version 1.2.9
3+
// @version 1.3.0
44
// @author aminomancer
55
// @homepage https://github.com/aminomancer/uc.css.js
66
// @description Adds a new toolbar button that 1) opens the content toolbox on left click;
@@ -539,22 +539,25 @@
539539
let styleSvc = Cc["@mozilla.org/content/style-sheet-service;1"].getService(
540540
Ci.nsIStyleSheetService
541541
);
542-
let toolboxCSS = /* css */ `.toolbarbutton-1#toolbox-button {
542+
let toolboxCSS = /* css */ `
543+
.toolbarbutton-1#toolbox-button {
544+
--uc-toolbox-button: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="context-fill" fill-opacity="context-fill-opacity" width="16" height="16" viewBox="0 0 16 16"><path d="M16,8V6c0-1.105-.895-2-2-2H2C0.895,4,0,4.895,0,6v2h4v1.333H0v5.333c0,.368,.298,.667,.667,.667h14.667 c0.368,0,.667-.298,.667-.667V9.333h-4V8H16z M11.333,10.667H10.6c-.058,.233-.148,.457-.267,.667l0.533,.533L9.933,12.8 L9.4,12.267l-.667,.267v0.8h-1.4V12.6l-.667-.267l-.533,.533l-.933-1l0.533-.533c-.119-.209-.208-.433-.267-.667h-.8 V9.333H5.4C5.458,9.1,5.548,8.876,5.667,8.667L5.133,8.133L6.067,7.2L6.6,7.733l0.667-.267v-.8H8.6V7.4l0.667,.267L9.8,7.133 l0.933,.933L10.2,8.6c0.119,.209,.208,.433,.267,.667h0.867L11.333,10.667L11.333,10.667z"/><circle cx="8" cy="10" r="1.333"/><path d="M6,2h4v1.333h1.333v-2c0-.368-.298-.667-.667-.667H5.333c-.368,0-.667,.298-.667,.667v2H6V2z"/></svg>');
545+
--uc-autohide-button: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="context-fill" fill-opacity="context-fill-opacity" viewBox="0 0 16 16"><path d="M5.293.293a1 1 0 011.414 0L8.414 2H13a3 3 0 013 3v8a3 3 0 01-3 3H3a3 3 0 01-3-3V5a3 3 0 013-3h.586L5.293.293zM6 2.414L4.707 3.707A1 1 0 014 4H3c-.545 0-1 .455-1 1v8c0 .545.455 1 1 1h10c.545 0 1-.455 1-1V5c0-.545-.455-1-1-1H8a1 1 0 01-.707-.293L6 2.414z"/></svg>');
546+
list-style-image: var(--uc-toolbox-button);
543547
-moz-box-align: center;
544548
}
549+
.toolbarbutton-1#toolbox-button[icon="autohide"] {
550+
list-style-image: var(--uc-autohide-button);
551+
}
545552
.toolbarbutton-1#toolbox-button .toolbarbutton-badge-stack {
546553
-moz-box-pack: center;
547554
}
548555
.toolbarbutton-1#toolbox-button .toolbarbutton-icon {
549556
height: 16px;
550557
width: 16px;
551558
transition: fill 50ms ease-in-out 0s;
552-
}
553-
.toolbarbutton-1#toolbox-button {
554-
list-style-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="context-fill" fill-opacity="context-fill-opacity" width="16" height="16" viewBox="0 0 16 16"><path d="M16,8V6c0-1.105-.895-2-2-2H2C0.895,4,0,4.895,0,6v2h4v1.333H0v5.333c0,.368,.298,.667,.667,.667h14.667 c0.368,0,.667-.298,.667-.667V9.333h-4V8H16z M11.333,10.667H10.6c-.058,.233-.148,.457-.267,.667l0.533,.533L9.933,12.8 L9.4,12.267l-.667,.267v0.8h-1.4V12.6l-.667-.267l-.533,.533l-.933-1l0.533-.533c-.119-.209-.208-.433-.267-.667h-.8 V9.333H5.4C5.458,9.1,5.548,8.876,5.667,8.667L5.133,8.133L6.067,7.2L6.6,7.733l0.667-.267v-.8H8.6V7.4l0.667,.267L9.8,7.133 l0.933,.933L10.2,8.6c0.119,.209,.208,.433,.267,.667h0.867L11.333,10.667L11.333,10.667z"/><circle cx="8" cy="10" r="1.333"/><path d="M6,2h4v1.333h1.333v-2c0-.368-.298-.667-.667-.667H5.333c-.368,0-.667,.298-.667,.667v2H6V2z"/></svg>');
555-
}
556-
.toolbarbutton-1#toolbox-button[icon="autohide"] {
557-
list-style-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="context-fill" fill-opacity="context-fill-opacity" viewBox="0 0 16 16"><path d="M5.293.293a1 1 0 011.414 0L8.414 2H13a3 3 0 013 3v8a3 3 0 01-3 3H3a3 3 0 01-3-3V5a3 3 0 013-3h.586L5.293.293zM6 2.414L4.707 3.707A1 1 0 014 4H3c-.545 0-1 .455-1 1v8c0 .545.455 1 1 1h10c.545 0 1-.455 1-1V5c0-.545-.455-1-1-1H8a1 1 0 01-.707-.293L6 2.414z"/></svg>');
559+
background-image: var(--uc-toolbox-button), var(--uc-autohide-button);
560+
background-size: 0, 0;
558561
}
559562
@media (prefers-reduced-motion: no-preference) {
560563
.toolbarbutton-1#toolbox-button[animate] .toolbarbutton-icon {

JS/findbarMods.uc.js

+26-27
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ==UserScript==
22
// @name Findbar Mods
3-
// @version 1.3.2
3+
// @version 1.3.3
44
// @author aminomancer
55
// @homepage https://github.com/aminomancer
66
// @description 1) Make a custom context menu for the findbar that lets you
@@ -318,45 +318,44 @@ class FindbarMods {
318318
this._updateDiacriticMatching();
319319
this._setEntireWord();
320320
this._setHighlightAll();
321+
let l10nId;
321322
switch (this.findMode) {
322323
case this.FIND_TYPEAHEAD:
323-
this._findField.placeholder = this._fastFindStr;
324+
l10nId = "findbar-fast-find";
324325
break;
325326
case this.FIND_LINKS:
326-
this._findField.placeholder = this._fastFindLinksStr;
327+
l10nId = "findbar-fast-find-links";
327328
break;
328329
default:
329-
this._findField.placeholder = this._normalFindStr;
330+
l10nId = "findbar-normal-find";
330331
}
332+
document.l10n.setAttributes(this._findField, l10nId);
331333
};
332334
// override the native on-results function so it updates both labels.
333335
findbarClass.onMatchesCountResult = function(result) {
334-
if (result.total !== 0) {
335-
if (result.total == -1) {
336-
this._foundMatches.value = PluralForm.get(
337-
result.limit,
338-
this.strBundle.GetStringFromName("FoundMatchesCountLimit")
339-
).replace("#1", result.limit);
336+
let l10nId;
337+
switch (result.total) {
338+
case 0:
339+
l10nId = "";
340+
this._foundMatches.hidden = true;
341+
this._tinyIndicator.textContent = " ";
342+
// hide the indicator background with CSS if it's blank.
343+
this._tinyIndicator.setAttribute("empty", "true");
344+
break;
345+
case -1:
346+
l10nId = "findbar-found-matches-count-limit";
347+
this._foundMatches.hidden = false;
340348
this._tinyIndicator.textContent = `${result.limit}+`;
341-
} else {
342-
this._foundMatches.value = PluralForm.get(
343-
result.total,
344-
this.strBundle.GetStringFromName("FoundMatches")
345-
)
346-
.replace("#1", result.current)
347-
.replace("#2", result.total);
349+
// bring it back if it's not blank.
350+
this._tinyIndicator.removeAttribute("empty");
351+
break;
352+
default:
353+
l10nId = "findbar-found-matches";
354+
this._foundMatches.hidden = false;
348355
this._tinyIndicator.textContent = `${result.current}/${result.total}`;
349-
}
350-
this._foundMatches.hidden = false;
351-
// bring it back if it's not blank.
352-
this._tinyIndicator.removeAttribute("empty");
353-
} else {
354-
this._foundMatches.hidden = true;
355-
this._foundMatches.value = "";
356-
this._tinyIndicator.textContent = " ";
357-
// hide the indicator background with CSS if it's blank.
358-
this._tinyIndicator.setAttribute("empty", "true");
356+
this._tinyIndicator.removeAttribute("empty");
359357
}
358+
document.l10n.setAttributes(this._foundMatches, l10nId, result);
360359
};
361360
}
362361
// when the context menu opens, ensure the menuitems are checked/unchecked appropriately.

JS/restorePreProtonStarButton-standalone.uc.js

+4-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

JS/restorePreProtonStarButton.uc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ==UserScript==
22
// @name Restore pre-Proton Star Button
3-
// @version 1.3
3+
// @version 1.3.1
44
// @author aminomancer
55
// @homepage https://github.com/aminomancer/uc.css.js
66
// @description The bookmark page action button used to have a pretty cool

resources/layout/uc-nsRules.au.css

+2
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,9 @@ from the style editor in the browser toolbox. */
234234
animation-duration: 317ms;
235235
width: 660px;
236236
-moz-context-properties: fill, stroke;
237+
fill: currentColor;
237238
stroke: var(--toolbarbutton-icon-fill-attention);
239+
color: inherit;
238240
}
239241

240242
#star-button[starred][animate]:-moz-locale-dir(rtl)

0 commit comments

Comments
 (0)