- Add instructions line to CR window saying to click Next/Done

- Resize CR window better for smaller screens (which will hopefully keep the button in view)
This commit is contained in:
Dan Stillman 2010-09-05 07:18:06 +00:00
parent 937b583c9f
commit 6ba92efdbb
3 changed files with 44 additions and 16 deletions

View File

@ -46,9 +46,8 @@ var Zotero_Merge_Window = new function () {
_wizardPage = document.getElementsByTagName('wizardpage')[0]; _wizardPage = document.getElementsByTagName('wizardpage')[0];
_mergeGroup = document.getElementsByTagName('zoteromergegroup')[0]; _mergeGroup = document.getElementsByTagName('zoteromergegroup')[0];
if (screen.width > 1000) { _wizard.setAttribute('width', Math.min(980, screen.width - 20));
_wizard.setAttribute('zoterowidescreen', 'true'); _wizard.setAttribute('height', Math.min(718, screen.height - 30));
}
// Set font size from pref // Set font size from pref
Zotero.setFontSize(_wizardPage); Zotero.setFontSize(_wizardPage);
@ -109,8 +108,10 @@ var Zotero_Merge_Window = new function () {
_updateChangedCreators(); _updateChangedCreators();
} }
var nextButton = _wizard.getButton("next");
if (Zotero.isMac) { if (Zotero.isMac) {
_wizard.getButton("next").setAttribute("hidden", "false"); nextButton.setAttribute("hidden", "false");
_wizard.getButton("finish").setAttribute("hidden", "true"); _wizard.getButton("finish").setAttribute("hidden", "true");
} }
else { else {
@ -118,6 +119,8 @@ var Zotero_Merge_Window = new function () {
var deck = document.getAnonymousElementByAttribute(buttons, "anonid", "WizardButtonDeck"); var deck = document.getAnonymousElementByAttribute(buttons, "anonid", "WizardButtonDeck");
deck.selectedIndex = 1; deck.selectedIndex = 1;
} }
_setInstructionsString(nextButton.label);
} }
@ -163,8 +166,10 @@ var Zotero_Merge_Window = new function () {
// On Windows the buttons don't move when one is hidden // On Windows the buttons don't move when one is hidden
if ((_pos + 1) != _objects.length) { if ((_pos + 1) != _objects.length) {
var nextButton = _wizard.getButton("next");
if (Zotero.isMac) { if (Zotero.isMac) {
_wizard.getButton("next").setAttribute("hidden", "false"); nextButton.setAttribute("hidden", "false");
_wizard.getButton("finish").setAttribute("hidden", "true"); _wizard.getButton("finish").setAttribute("hidden", "true");
} }
else { else {
@ -172,12 +177,16 @@ var Zotero_Merge_Window = new function () {
var deck = document.getAnonymousElementByAttribute(buttons, "anonid", "WizardButtonDeck"); var deck = document.getAnonymousElementByAttribute(buttons, "anonid", "WizardButtonDeck");
deck.selectedIndex = 1; deck.selectedIndex = 1;
} }
_setInstructionsString(nextButton.label);
} }
// Last object // Last object
else { else {
var finishButton = _wizard.getButton("finish");
if (Zotero.isMac) { if (Zotero.isMac) {
_wizard.getButton("next").setAttribute("hidden", "true"); _wizard.getButton("next").setAttribute("hidden", "true");
_wizard.getButton("finish").setAttribute("hidden", "false"); finishButton.setAttribute("hidden", "false");
} }
// Windows uses a deck to switch between the Next and Finish buttons // Windows uses a deck to switch between the Next and Finish buttons
// TODO: check Linux // TODO: check Linux
@ -186,6 +195,8 @@ var Zotero_Merge_Window = new function () {
var deck = document.getAnonymousElementByAttribute(buttons, "anonid", "WizardButtonDeck"); var deck = document.getAnonymousElementByAttribute(buttons, "anonid", "WizardButtonDeck");
deck.selectedIndex = 0; deck.selectedIndex = 0;
} }
_setInstructionsString(finishButton.label);
} }
return false; return false;
@ -251,6 +262,24 @@ var Zotero_Merge_Window = new function () {
} }
// TEMP
function _setInstructionsString(buttonName) {
switch (_mergeGroup.type) {
case 'storagefile':
var msg = "The following file has been changed in multiple locations.";
break;
default:
// TODO: localize and maybe not always call it 'item'
var msg = "The following item has been changed in multiple locations.";
}
msg += " Choose the version you would like to keep, and then click " + buttonName + ".";
document.getElementById('zotero-merge-instructions').value = msg;
}
function _error(e) { function _error(e) {
Zotero.debug(e); Zotero.debug(e);
_io.error = e; _io.error = e;

View File

@ -45,6 +45,7 @@
onpagerewound="Zotero_Merge_Window.onBack(); return false" onpagerewound="Zotero_Merge_Window.onBack(); return false"
onpageadvanced="return Zotero_Merge_Window.onNext()" onpageadvanced="return Zotero_Merge_Window.onNext()"
label="Conflict Resolution"> label="Conflict Resolution">
<description id="zotero-merge-instructions"/>
<zoteromergegroup flex="1"/> <zoteromergegroup flex="1"/>
<separator class="thin"/> <separator class="thin"/>
<hbox id="zotero-step-count"> <hbox id="zotero-step-count">

View File

@ -4,20 +4,11 @@ wizard {
padding-right: 10px; padding-right: 10px;
} }
wizard {
height: 550px;
}
wizardpage { wizardpage {
min-width: 770px; min-width: 762px;
min-height: 300px; min-height: 300px;
} }
wizard[zoterowidescreen=true] {
height: 718px;
width: 974px;
}
wizard .wizard-header label.wizard-header-label { wizard .wizard-header label.wizard-header-label {
margin-left: 0; margin-left: 0;
} }
@ -36,6 +27,13 @@ wizard > hbox button:last-child {
margin-right: 0; margin-right: 0;
} }
wizardpage > description {
margin-left: 10px;
}
#zotero-merge-button-name {
margin: 0;
}
wizard > deck { wizard > deck {
margin: 0; margin: 0;