fx-compat: Start to fix tag color chooser dialog
Among other things, need to recreate XBL <customcolorpicker> as a Custom Element and need to change `ondialogaccept`/etc. to event listeners: https://searchfox.org/mozilla-central/rev/b72e9d7d63bf499d1d8168291b93d4ec7fde236e/browser/components/places/content/bookmarkProperties.js#232-237
This commit is contained in:
parent
63634eed02
commit
bc68b6e9fe
4 changed files with 14 additions and 9 deletions
|
@ -620,7 +620,7 @@ Zotero.TagSelector = class TagSelectorContainer extends React.PureComponent {
|
|||
io.tagColors = tagColors;
|
||||
|
||||
window.openDialog(
|
||||
'chrome://zotero/content/tagColorChooser.xul',
|
||||
'chrome://zotero/content/tagColorChooser.xhtml',
|
||||
'zotero-tagSelector-colorChooser',
|
||||
'chrome,modal,centerscreen', io
|
||||
);
|
||||
|
|
|
@ -29,7 +29,7 @@ var Zotero_Tag_Color_Chooser = new function() {
|
|||
var _io;
|
||||
|
||||
this.init = function () {
|
||||
var dialog = document.getElementById('tag-color-chooser');
|
||||
var dialog = document.querySelector('dialog');
|
||||
|
||||
try {
|
||||
// Set font size from pref
|
||||
|
|
|
@ -28,17 +28,21 @@
|
|||
<?xml-stylesheet href="chrome://zotero/skin/tagColorChooser.css" type="text/css"?>
|
||||
<!DOCTYPE window SYSTEM "chrome://zotero/locale/zotero.dtd">
|
||||
|
||||
<dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
title="&zotero.tagColorChooser.title;" buttons="cancel,accept"
|
||||
id="tag-color-chooser"
|
||||
<window
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
title="&zotero.tagColorChooser.title;"
|
||||
onload="Zotero_Tag_Color_Chooser.init()"
|
||||
width="350"
|
||||
height="140">
|
||||
<dialog
|
||||
buttons="cancel,accept"
|
||||
buttonlabelaccept="&zotero.tagColorChooser.setColor;"
|
||||
buttonlabelextra1="&zotero.tagColorChooser.removeColor;"
|
||||
ondialogaccept="Zotero_Tag_Color_Chooser.onDialogAccept()"
|
||||
ondialogcancel="Zotero_Tag_Color_Chooser.onDialogCancel()"
|
||||
ondialogextra1="Zotero_Tag_Color_Chooser.onDialogRemoveColor()"
|
||||
onload="Zotero_Tag_Color_Chooser.init()"
|
||||
width="350"
|
||||
height="140">
|
||||
>
|
||||
|
||||
<script src="include.js"/>
|
||||
<script src="tagColorChooser.js"/>
|
||||
|
@ -61,3 +65,4 @@
|
|||
<separator class="thin"/>
|
||||
</vbox>
|
||||
</dialog>
|
||||
</window>
|
|
@ -714,7 +714,7 @@ describe("Tag Selector", function () {
|
|||
|
||||
assert.include(getRegularTags(), "a");
|
||||
|
||||
var dialogPromise = waitForDialog(false, undefined, 'chrome://zotero/content/tagColorChooser.xul');
|
||||
var dialogPromise = waitForDialog(false, undefined, 'chrome://zotero/content/tagColorChooser.xhtml');
|
||||
var tagSelectorPromise = waitForTagSelector(win);
|
||||
tagSelector.contextTag = {name: tag};
|
||||
yield tagSelector.openColorPickerWindow();
|
||||
|
|
Loading…
Reference in a new issue