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

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

Issue 1265843005: Refactor feedback to use native JS object (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@js-mojo-combine
Patch Set: impl comments Created 5 years, 3 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
« no previous file with comments | « components/dom_distiller/content/renderer/distiller_native_javascript.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c44c6a87a534f2a9513ce4a74a73ab4b608a77f4..0f4aa2c0f2f62c570028e9d1716f5b42bf351374 100644
--- a/components/dom_distiller/core/javascript/dom_distiller_viewer.js
+++ b/components/dom_distiller/core/javascript/dom_distiller_viewer.js
@@ -152,21 +152,6 @@ function showFeedbackForm(questionText, yesText, noText) {
document.getElementById('feedbackContainer').classList.remove("hidden");
}
-/**
- * Send feedback about this distilled article.
- * @param good True if the feedback was positive, false if negative.
- */
-function sendFeedback(good) {
- var img = document.createElement('img');
- if (good) {
- img.src = '/feedbackgood';
- } else {
- img.src = '/feedbackbad';
- }
- img.style.display = "none";
- document.body.appendChild(img);
-}
-
// Add a listener to the "View Original" link to report opt-outs.
document.getElementById('closeReaderView').addEventListener('click',
function(e) {
@@ -177,12 +162,16 @@ document.getElementById('closeReaderView').addEventListener('click',
}, true);
document.getElementById('feedbackYes').addEventListener('click', function(e) {
- sendFeedback(true);
+ if (distiller) {
+ distiller.sendFeedback(true);
+ }
document.getElementById('feedbackContainer').className += " fadeOut";
}, true);
document.getElementById('feedbackNo').addEventListener('click', function(e) {
- sendFeedback(false);
+ if (distiller) {
+ distiller.sendFeedback(false);
+ }
document.getElementById('feedbackContainer').className += " fadeOut";
}, true);
« no previous file with comments | « components/dom_distiller/content/renderer/distiller_native_javascript.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698