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

Unified Diff: chrome/browser/resources/shared/js/cr/ui/alert_overlay.js

Issue 11962043: Move webui resources from chrome\browser\resources\shared to ui\webui\resources. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 11 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/browser/resources/shared/js/cr/ui/alert_overlay.js
===================================================================
--- chrome/browser/resources/shared/js/cr/ui/alert_overlay.js (revision 177292)
+++ chrome/browser/resources/shared/js/cr/ui/alert_overlay.js (working copy)
@@ -1,82 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-cr.define('alertOverlay', function() {
- /**
- * The confirm <button>.
- * @type {HTMLButtonElement}
- */
- var okButton;
-
- /**
- * The cancel <button>.
- * @type {HTMLButtonElement}
- */
- var cancelButton;
-
- function initialize(e) {
- okButton = $('alertOverlayOk');
- cancelButton = $('alertOverlayCancel');
-
- // The callbacks are set to the callbacks provided in show(). Clear them
- // out when either is clicked.
- okButton.addEventListener('click', function(e) {
- assert(okButton.clickCallback);
-
- okButton.clickCallback(e);
- okButton.clickCallback = null;
- cancelButton.clickCallback = null;
- });
- cancelButton.addEventListener('click', function(e) {
- assert(cancelButton.clickCallback);
-
- cancelButton.clickCallback(e);
- okButton.clickCallback = null;
- cancelButton.clickCallback = null;
- });
- };
-
- /**
- * Updates the alert overlay with the given message, button titles, and
- * callbacks.
- * @param {string} title The alert title to display to the user.
- * @param {string} message The alert message to display to the user.
- * @param {string=} okTitle The title of the OK button. If undefined or empty,
- * no button is shown.
- * @param {string=} cancelTitle The title of the cancel button. If undefined
- * or empty, no button is shown.
- * @param {function=} okCallback A function to be called when the user presses
- * the ok button. Can be undefined if |okTitle| is falsey.
- * @param {function=} cancelCallback A function to be called when the user
- * presses the cancel button. Can be undefined if |cancelTitle| is falsey.
- */
- function setValues(
- title, message, okTitle, cancelTitle, okCallback, cancelCallback) {
- if (typeof title != 'undefined')
- $('alertOverlayTitle').textContent = title;
- $('alertOverlayTitle').hidden = typeof title == 'undefined';
-
- if (typeof message != 'undefined')
- $('alertOverlayMessage').textContent = message;
- $('alertOverlayMessage').hidden = typeof message == 'undefined';
-
- if (okTitle)
- okButton.textContent = okTitle;
- okButton.hidden = !okTitle;
- okButton.clickCallback = okCallback;
-
- if (cancelTitle)
- cancelButton.textContent = cancelTitle;
- cancelButton.hidden = !cancelTitle;
- cancelButton.clickCallback = cancelCallback;
- };
-
- // Export
- return {
- initialize: initialize,
- setValues: setValues
- };
-});
-
-document.addEventListener('DOMContentLoaded', alertOverlay.initialize);
« no previous file with comments | « chrome/browser/resources/shared/js/cr/ui.js ('k') | chrome/browser/resources/shared/js/cr/ui/array_data_model.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698