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

Unified Diff: components/dom_distiller/core/javascript/dom_distiller_viewer.js

Issue 1160113004: HTML exit reader view button (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clean up Created 5 years, 6 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: components/dom_distiller/core/javascript/dom_distiller_viewer.js
diff --git a/components/dom_distiller/core/javascript/dom_distiller_viewer.js b/components/dom_distiller/core/javascript/dom_distiller_viewer.js
index 75292a270961ead9a40f27cec80579aade7819fb..bf114cf6c9ad14639da53c4fef3a71e2e56ad27c 100644
--- a/components/dom_distiller/core/javascript/dom_distiller_viewer.js
+++ b/components/dom_distiller/core/javascript/dom_distiller_viewer.js
@@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+// This variable will be changed by iOS scripts.
+var distiller_on_ios = false;
+
function addToPage(html) {
var div = document.createElement('div');
div.innerHTML = html;
@@ -120,10 +123,15 @@ var updateLoadingIndicator = function() {
* @param noText The i18n text for the feedback answer 'NO'.
*/
function showFeedbackForm(questionText, yesText, noText) {
+ // If the distiller is running on iOS, do not show the feedback form. This
+ // variable is set in distiller_viewer.cc before this function is run.
+ if (distiller_on_ios) return;
+
document.getElementById('feedbackYes').innerText = yesText;
document.getElementById('feedbackNo').innerText = noText;
document.getElementById('feedbackQuestion').innerText = questionText;
+ document.getElementById('contentWrap').style.paddingBottom = '120px';
document.getElementById('feedbackContainer').style.display = 'block';
}
@@ -143,12 +151,13 @@ function sendFeedback(good) {
}
// Add a listener to the "View Original" link to report opt-outs.
-document.getElementById('showOriginal').addEventListener('click', function(e) {
- var img = document.createElement('img');
- img.src = "/vieworiginal";
- img.style.display = "none";
- document.body.appendChild(img);
-}, true);
+document.getElementById('closeReaderView').addEventListener('click',
+ function(e) {
+ var img = document.createElement('img');
+ img.src = "/vieworiginal";
+ img.style.display = "none";
+ document.body.appendChild(img);
+ }, true);
document.getElementById('feedbackYes').addEventListener('click', function(e) {
sendFeedback(true);
« no previous file with comments | « components/dom_distiller/core/html/dom_distiller_viewer.html ('k') | components/dom_distiller/core/viewer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698