diff --git a/chrome/content/zotero/hardConfirmationDialog.js b/chrome/content/zotero/hardConfirmationDialog.js
index 5b03998102..44809c77b6 100644
--- a/chrome/content/zotero/hardConfirmationDialog.js
+++ b/chrome/content/zotero/hardConfirmationDialog.js
@@ -25,16 +25,24 @@
Zotero.HardConfirmationDialog = {
init: function() {
- var label, content;
this.io = window.arguments[0];
+ Zotero.setFontSize(document.getElementById('zotero-hardConfirmationDialog'));
+
var vbox = document.getElementById('infoContainer');
var sep = vbox.firstChild;
- for (let text of this.io.text) {
- label = document.createElement('label');
- content = document.createTextNode(text);
- label.appendChild(content);
- vbox.insertBefore(label, sep);
+
+ document.getElementById('infoBody').textContent = this.io.text;
+
+ if (this.io.title) {
+ document.documentElement.setAttribute('title', this.io.title);
+
+ if (Zotero.isMac) {
+ let elem = document.getElementById('infoTitle');
+ elem.textContent = this.io.title;
+ elem.style.marginBottom = '12px';
+ elem.hidden = false;
+ }
}
if (this.io.checkboxLabel) {
var checkbox = document.getElementById('zotero-hardConfirmationDialog-checkbox');
@@ -47,14 +55,17 @@ Zotero.HardConfirmationDialog = {
this.onKeyUp();
}
+ if (this.io.acceptLabel) {
+ document.documentElement.getButton('accept').label = this.io.acceptLabel
+ }
if (this.io.extra1Label) {
document.documentElement.buttons = document.documentElement.buttons + ',extra1';
document.documentElement.getButton('extra1').label = this.io.extra1Label
- } if (this.io.acceptLabel) {
- document.documentElement.getButton('accept').label = this.io.acceptLabel
}
-
- document.documentElement.setAttribute('title', this.io.title);
+ if (this.io.extra2Label) {
+ document.documentElement.buttons = document.documentElement.buttons + ',extra2';
+ document.documentElement.getButton('extra2').label = this.io.extra2Label
+ }
},
onCheckbox: function(event) {
@@ -74,5 +85,10 @@ Zotero.HardConfirmationDialog = {
onExtra1: function() {
this.io.extra1 = true;
document.documentElement.cancelDialog();
+ },
+
+ onExtra2: function() {
+ this.io.extra2 = true;
+ document.documentElement.cancelDialog();
}
};
diff --git a/chrome/content/zotero/hardConfirmationDialog.xul b/chrome/content/zotero/hardConfirmationDialog.xul
index c3c6d5f6a0..771f1e64a6 100644
--- a/chrome/content/zotero/hardConfirmationDialog.xul
+++ b/chrome/content/zotero/hardConfirmationDialog.xul
@@ -28,6 +28,7 @@
+
%zoteroDTD; ]>
@@ -36,7 +37,8 @@
id="zotero-hardConfirmationDialog"
onload="Zotero.HardConfirmationDialog.init(); sizeToContent();"
ondialogaccept="Zotero.HardConfirmationDialog.onAccept();"
- ondialogextra1="Zotero.HardConfirmationDialog.onExtra1();">
+ ondialogextra1="Zotero.HardConfirmationDialog.onExtra1();"
+ ondialogextra2="Zotero.HardConfirmationDialog.onExtra2();">
@@ -50,6 +52,9 @@
+
+
+
diff --git a/chrome/content/zotero/xpcom/sync/syncLocal.js b/chrome/content/zotero/xpcom/sync/syncLocal.js
index fc47832ba4..adea783bff 100644
--- a/chrome/content/zotero/xpcom/sync/syncLocal.js
+++ b/chrome/content/zotero/xpcom/sync/syncLocal.js
@@ -126,13 +126,21 @@ Zotero.Sync.Data.Local = {
+ `last username '${lastUsername}', current username '${username}'`, 2);
var io = {
title: Zotero.getString('general.warning'),
- text: [Zotero.getString('account.lastSyncWithDifferentAccount', [ZOTERO_CONFIG.CLIENT_NAME, lastUsername, username])],
- checkboxLabel: Zotero.getString('account.confirmDelete'),
- acceptLabel: Zotero.getString('account.confirmDelete.button')
+ text: Zotero.getString(
+ 'account.lastSyncWithDifferentAccount',
+ [Zotero.appName, lastUsername, username]
+ ) + '\n\n'
+ + Zotero.getString(
+ 'account.lastSyncWithDifferentAccount.beforeContinuing',
+ [lastUsername, Zotero.appName]
+ ),
+ checkboxLabel: Zotero.getString('account.confirmDelete', lastUsername),
+ acceptLabel: Zotero.getString('account.confirmDelete.button'),
+ extra2Label: Zotero.getString('general.moreInformation')
};
win.openDialog("chrome://zotero/content/hardConfirmationDialog.xul", "",
- "chrome, dialog, modal, centerscreen", io);
-
+ "chrome,dialog,modal,centerscreen", io);
+
if (io.accept) {
var resetDataDirFile = OS.Path.join(Zotero.DataDirectory.dir, 'reset-data-directory');
yield Zotero.File.putContentsAsync(resetDataDirFile, '');
@@ -150,6 +158,9 @@ Zotero.Sync.Data.Local = {
return true;
}
+ else if (io.extra2) {
+ Zotero.launchURL("https://www.zotero.org/support/kb/switching_accounts");
+ }
return false;
}
diff --git a/chrome/locale/en-US/zotero/zotero.properties b/chrome/locale/en-US/zotero/zotero.properties
index 46438b5b41..a4682cd31f 100644
--- a/chrome/locale/en-US/zotero/zotero.properties
+++ b/chrome/locale/en-US/zotero/zotero.properties
@@ -984,8 +984,9 @@ account.unlinkWarning.removeData = Remove my %S data from this computer
account.unlinkWarning.button = Unlink Account
account.warning.emptyLibrary = You are about to sync the ‘%1$S’ account to an empty %2$S database. This could happen if you removed your previous database or if the location of your %2$S data directory changed.
account.warning.existingDataElsewhere = If your %S data exists elsewhere on this computer, you should move it to the current data directory or change the data directory location to point to your existing data.
-account.lastSyncWithDifferentAccount = This %1$S database was last synced with a different account (‘%2$S’) from the current one (‘%3$S’). If you continue, data associated with the ‘%2$S’ account will be removed from this computer.
-account.confirmDelete = Remove existing data
+account.lastSyncWithDifferentAccount = This %1$S database was last synced with a different account (“%2$S”) from the one you are attempting to sync with (“%3$S”). If you continue, all %1$S libraries associated with the “%2$S” account will be removed from this computer.
+account.lastSyncWithDifferentAccount.beforeContinuing = Before continuing, make sure all data and files you wish to keep have been synced with the “%S” account or you have a backup of your %S data directory.
+account.confirmDelete = Remove all data for “%S” from this computer
account.confirmDelete.button = Switch Accounts
sync.conflict.autoChange.alert = One or more locally deleted Zotero %S have been modified remotely since the last sync.
diff --git a/chrome/skin/default/zotero/hardConfirmationDialog.css b/chrome/skin/default/zotero/hardConfirmationDialog.css
new file mode 100644
index 0000000000..b47a1b2858
--- /dev/null
+++ b/chrome/skin/default/zotero/hardConfirmationDialog.css
@@ -0,0 +1,11 @@
+#zotero-hardConfirmationDialog {
+ max-width: 500px;
+}
+
+#zotero-hardConfirmationDialog-checkbox {
+ font: menu;
+}
+
+#infoContainer {
+ margin-bottom: 6px;
+}
\ No newline at end of file
diff --git a/test/tests/syncLocalTest.js b/test/tests/syncLocalTest.js
index f8d2bc0670..0c8a84d4e4 100644
--- a/test/tests/syncLocalTest.js
+++ b/test/tests/syncLocalTest.js
@@ -45,11 +45,12 @@ describe("Zotero.Sync.Data.Local", function() {
var handled = false;
waitForDialog(function (dialog) {
var text = dialog.document.documentElement.textContent;
- var matches = text.match(/‘[^’]*’/g);
- assert.equal(matches.length, 3);
- assert.equal(matches[0], "‘A’");
- assert.equal(matches[1], "‘B’");
- assert.equal(matches[2], "‘A’");
+ var matches = text.match(/“[^”]*”/g);
+ assert.equal(matches.length, 4);
+ assert.equal(matches[0], "“A”");
+ assert.equal(matches[1], "“B”");
+ assert.equal(matches[2], "“A”");
+ assert.equal(matches[3], "“A”");
dialog.document.getElementById('zotero-hardConfirmationDialog-checkbox').checked = true;
dialog.document.getElementById('zotero-hardConfirmationDialog-checkbox')