Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3521)

Unified Diff: chrome/common/extensions/docs/examples/extensions/gmail/options.js

Issue 10836102: Spruce up gmail checker for event pages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: full to the brim of hate Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/docs/examples/extensions/gmail/options.js
diff --git a/chrome/common/extensions/docs/examples/extensions/gmail/options.js b/chrome/common/extensions/docs/examples/extensions/gmail/options.js
index c862c6b301cfd66061fcd305fddd16c3aa578591..0514b7e0048635869c4d2e4f2e3e1b1676dc8b6c 100644
--- a/chrome/common/extensions/docs/examples/extensions/gmail/options.js
+++ b/chrome/common/extensions/docs/examples/extensions/gmail/options.js
@@ -4,10 +4,12 @@
var customDomainsTextbox;
var saveButton;
+var cancelButton;
function init() {
customDomainsTextbox = document.getElementById("custom-domain");
saveButton = document.getElementById("save-button");
+ cancelButton = document.getElementById("cancel-button");
customDomainsTextbox.value = localStorage.customDomain || "";
markClean();
@@ -16,8 +18,12 @@ function init() {
function save() {
localStorage.customDomain = customDomainsTextbox.value;
not at google - send to devlin 2012/08/07 02:48:33 use storage.sync?
markClean();
-
- chrome.extension.getBackgroundPage().init();
+ chrome.runtime.getBackgroundPage(function(backgroundPage) {
+ backgroundPage.startRequest({
+ scheduleRequest:false,
+ showLoadingAnimation:true
+ });
+ });
}
function markDirty() {
@@ -30,8 +36,7 @@ function markClean() {
document.addEventListener('DOMContentLoaded', function () {
init();
- document.querySelector('#cancel-button').addEventListener('DOMContentLoaded',
- init);
- document.querySelector('#save-button').addEventListener('DOMContentLoaded',
- save);
+ saveButton.addEventListener('click', save);
+ cancelButton.addEventListener('click', init);
+ customDomainsTextbox.addEventListener('input', markDirty);
});

Powered by Google App Engine
This is Rietveld 408576698