Index: chrome/browser/resources/repost_form_warning.html |
diff --git a/chrome/browser/resources/repost_form_warning.html b/chrome/browser/resources/repost_form_warning.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ac54276317a30fbee9fc8b3564b6df4bac8d2898 |
--- /dev/null |
+++ b/chrome/browser/resources/repost_form_warning.html |
@@ -0,0 +1,73 @@ |
+<!DOCTYPE html> |
+<html i18n-values="dir:textdirection"> |
+<head> |
+ <link rel="stylesheet" href="dialog.css"> |
+ <style type="text/css"> |
arv (Not doing code reviews)
2011/09/07 20:58:20
Skip the type here. text/css is the default and it
Daniel Erat
2011/09/08 01:46:56
Done.
|
+ body { |
+ -webkit-user-select: none; |
+ margin: 10px 10px 0 10px; |
+ } |
+ |
+ form { |
+ margin: 0; |
+ } |
+ |
+ #explanation { |
+ cursor: default; |
+ } |
+ |
+ #buttons { |
+ padding: 10px 0; |
+ text-align: end; |
+ } |
+ |
+ </style> |
+ <script> |
+ function $(o) { |
+ return document.getElementById(o); |
+ } |
+ |
+ function disableControls() { |
+ $('cancel').disabled = true; |
+ $('resend').disabled = true; |
+ } |
+ |
+ function cancel() { |
+ disableControls(); |
+ chrome.send('DialogClose', [JSON.stringify([false])]); |
arv (Not doing code reviews)
2011/09/07 20:58:20
Can you just send false here? chrome.send should u
Daniel Erat
2011/09/08 01:46:56
HtmlDialogUI::OnDialogClosed() interprets the firs
|
+ } |
+ |
+ function handleSubmit(e) { |
+ disableControls(); |
+ e.preventDefault(); |
+ chrome.send('DialogClose', [JSON.stringify([true])]); |
+ } |
+ |
+ function handleKeyDown(e) { |
+ if (e.keyCode == 27) { // Escape |
+ e.preventDefault(); |
+ cancel(); |
+ } |
+ } |
+ |
+ function load() { |
+ document.addEventListener('keydown', handleKeyDown); |
+ $('explanation').textContent = chrome.dialogArguments; |
+ $('form').onsubmit = handleSubmit; |
+ $('cancel').onclick = cancel; |
+ $('cancel').focus(); |
arv (Not doing code reviews)
2011/09/07 20:58:20
Use autofocus instead?
<input ... autofocus>
Daniel Erat
2011/09/08 01:46:56
Done.
|
+ } |
+ |
+ document.addEventListener('DOMContentLoaded', load); |
+ </script> |
+</head> |
+<body i18n-values=".style.fontFamily:fontfamily;.style.fontSize:fontsize"> |
+ <div id="explanation"></div> |
arv (Not doing code reviews)
2011/09/07 20:58:20
<p> seems more correct
Daniel Erat
2011/09/08 01:46:56
How strongly do you feel about this? <p>'s extra
|
+ <form id="form"> |
+ <div id="buttons"> |
+ <input id="cancel" type="button" i18n-values="value:cancel"> |
arv (Not doing code reviews)
2011/09/07 20:58:20
type="reset" seems more logical
Daniel Erat
2011/09/08 01:46:56
Done.
|
+ <input id="resend" type="submit" i18n-values="value:resend"> |
+ </div> |
+ </form> |
+</body> |
+</html> |