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

Side by Side Diff: chrome/browser/resources/feedback.js

Issue 12737006: Allow feedback form to be shown in an App Launcher feedback mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use else instead of continue Created 7 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Constants. 5 // Constants.
6 /** @const */ var FEEDBACK_LANDING_PAGE = 6 /** @const */ var FEEDBACK_LANDING_PAGE =
7 'https://www.google.com/support/chrome/go/feedback_confirmation'; 7 'https://www.google.com/support/chrome/go/feedback_confirmation';
8 /** @const */ var MAX_ATTACH_FILE_SIZE = 3 * 1024 * 1024; 8 /** @const */ var MAX_ATTACH_FILE_SIZE = 3 * 1024 * 1024;
9 9
10 var selectedThumbnailDivId = ''; 10 var selectedThumbnailDivId = '';
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 innerDiv.appendChild(thumbnail); 88 innerDiv.appendChild(thumbnail);
89 89
90 thumbnailDiv.appendChild(innerDiv); 90 thumbnailDiv.appendChild(innerDiv);
91 $(divId).appendChild(thumbnailDiv); 91 $(divId).appendChild(thumbnailDiv);
92 92
93 if (!selectedThumbnailId) 93 if (!selectedThumbnailId)
94 selectImage(divId, thumbnailDiv.id); 94 selectImage(divId, thumbnailDiv.id);
95 } 95 }
96 96
97 /** 97 /**
98 * Disables screenshots completely. 98 * Shows the app launcher version of the feedback form.
99 */
100 function showLauncherFeedback() {
101 document.body.classList.remove('normal-layout');
Dan Beam 2013/03/19 04:43:53 ^ I don't think you need this
benwells 2013/03/20 07:49:32 Done.
102 document.body.classList.add('launcher-layout');
Dan Beam 2013/03/19 04:43:53 it's arguable that you should be using `document.d
benwells 2013/03/20 07:49:32 I was using body as I didn't know how to add a sty
103 }
104
105 /**
106 * Enables screenshots.
99 */ 107 */
100 function enableScreenshots() { 108 function enableScreenshots() {
101 if (forceDisableScreenshots) 109 if (forceDisableScreenshots)
102 return; 110 return;
103 $('screenshot-row').hidden = false; 111 $('screenshot-row').hidden = false;
104 } 112 }
105 113
106 /** 114 /**
107 * Reads the selected file when the user selects a file. 115 * Reads the selected file when the user selects a file.
108 * @param {event} evtFileSelected The on changed event for the file input box. 116 * @param {event} evtFileSelected The on changed event for the file input box.
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 function setupDialogDefaults(defaults) { 399 function setupDialogDefaults(defaults) {
392 // Current url. 400 // Current url.
393 if ($('page-url-text').value == '') 401 if ($('page-url-text').value == '')
394 $('page-url-text').value = defaults.currentUrl; 402 $('page-url-text').value = defaults.currentUrl;
395 if (defaults.currentUrl == '') 403 if (defaults.currentUrl == '')
396 $('page-url-checkbox').checked = false; 404 $('page-url-checkbox').checked = false;
397 // User e-mail. 405 // User e-mail.
398 $('user-email-text').value = defaults.userEmail; 406 $('user-email-text').value = defaults.userEmail;
399 $('user-email-checkbox').checked = defaults.emailCheckboxDefault; 407 $('user-email-checkbox').checked = defaults.emailCheckboxDefault;
400 408
401 // Are screenshots disabled? 409 if (defaults.launcherFeedback)
410 showLauncherFeedback();
Dan Beam 2013/03/19 04:43:53 this could be reduced to document.documentEleme
benwells 2013/03/20 07:49:32 That didn't seem to work. Do we have our own toggl
Dan Beam 2013/03/21 01:09:11 sorry, meant document.documentElement.classList.to
411
402 if (!defaults.disableScreenshots) 412 if (!defaults.disableScreenshots)
403 enableScreenshots(); 413 enableScreenshots();
404 414
405 if (defaults.useSaved) { 415 if (defaults.useSaved) {
406 $('screenshot-link-tosaved').hidden = false; 416 $('screenshot-link-tosaved').hidden = false;
407 } 417 }
408 } 418 }
409 419
410 window.addEventListener('DOMContentLoaded', load); 420 window.addEventListener('DOMContentLoaded', load);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698