Skip to content

Commit e7f274a

Browse files
author
Ludovic Marcotte
committed
(fix) remove all use of ondialogaccept/ondialogcancel
1 parent 606792f commit e7f274a

File tree

6 files changed

+12
-19
lines changed

6 files changed

+12
-19
lines changed

TODO

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
see: https://developer.thunderbird.net/add-ons/updates/tb68
22

33
- document startup.js
4-
- review all usage of ondialogaccept
54
- review common-card-overlay.js for menulist's editable
65
- remove progressmeter and statusbar/statusbarpanel

chrome/content/sogo-connector/addressbook/preferences.addressbook.groupdav.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,6 @@ function onShowRestart() {
207207

208208
//TODO:catch the directory delete and delete preferences
209209

210-
function onCancel() {
211-
window.close();
212-
}
213-
214210
// From SOGo Integrator
215211
var folderURL = "";
216212
var originalName = "";
@@ -277,3 +273,6 @@ renameTarget.prototype = {
277273
}
278274
};
279275

276+
document.addEventListener("dialogaccept", function(event) {
277+
onOverlayAccept();
278+
});

chrome/content/sogo-connector/addressbook/preferences.addressbook.groupdav.xul

+1-3
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,7 @@ Modifications by
6969
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
7070
title="&newDirectoryTitle.label;"
7171
onload="onLoad();"
72-
buttons="accept,cancel"
73-
ondialogaccept="return onOverlayAccept();"
74-
ondialogcancel="return onCancel();">
72+
buttons="accept,cancel">
7573

7674
<script type="application/x-javascript" src="chrome://sogo-connector/content/addressbook/preferences.addressbook.groupdav.js"/>
7775
<!-- <script type="application/x-javascript" src="chrome://sogo-connector/content/addressbook/preference.service.addressbook.groupdav.js"/>

chrome/content/sogo-connector/calendar/properties-overlay.xul

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919
<stringbundle id="propertiesMessages" src="chrome://sogo-connector/locale/calendar/properties-overlay.properties"/>
2020
<script type="application/x-javascript" src="chrome://sogo-connector/content/calendar/properties-overlay.js"/>
2121

22-
<dialog id="calendar-properties-dialog-2"
23-
ondialogaccept="return onOverlayAccept();">
22+
<dialog id="calendar-properties-dialog-2">
2423

2524
<vbox id="sogo-calendar-properties" collapsed="true">
2625
<checkbox id="sogo-notify-on-personal-modifications"

chrome/content/sogo-connector/messenger/update-dialog.js

+6-7
Original file line numberDiff line numberDiff line change
@@ -115,17 +115,12 @@ function restartIfPossible() {
115115
}
116116
}
117117

118-
function onAcceptClick() {
118+
function onAcceptClick(event) {
119119
var appStartup = iCc["@mozilla.org/toolkit/app-startup;1"]
120120
.getService(iCi.nsIAppStartup);
121121
appStartup.quit(iCi.nsIAppStartup.eRestart
122122
| iCi.nsIAppStartup.eAttemptQuit);
123-
124-
return false;
125-
}
126-
127-
function onCancelClick() {
128-
return false;
123+
event.preventDefault();
129124
}
130125

131126
function updateDialogOnReload() {
@@ -156,6 +151,10 @@ function updateDialogOnLoad () {
156151
window.opener.deferredCheckFolders();
157152
window.close();
158153
}
154+
155+
document.addEventListener("dialogaccept", function(event) {
156+
onAcceptClick(event);
157+
});
159158
}
160159

161160
window.addEventListener("load", updateDialogOnLoad, false);

chrome/content/sogo-connector/messenger/update-dialog.xul

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
]>
1818

1919
<dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
20-
id="inverseMessengerUpdateDlg" ondialogaccept="return onAcceptClick();"
21-
ondialogcancel="return onCancelClick();"
20+
id="inverseMessengerUpdateDlg"
2221
width="380px" height="130px" buttons="accept"
2322
title="&sogo-connector.title;">
2423
<script type="application/x-javascript"

0 commit comments

Comments
 (0)