From ca291a43706c138ec6a3bf4371616b62bf86eec4 Mon Sep 17 00:00:00 2001 From: Chris Van Date: Thu, 29 Sep 2011 15:58:38 -0700 Subject: [PATCH] fix Get Satisfaction (bug 690363) --- .../templates/addons/impala/details.html | 2 +- media/js/impala/addon_details.js | 24 ++++++++++++++ media/js/zamboni/addon_details.js | 32 ++----------------- templates/impala/base.html | 5 +-- 4 files changed, 31 insertions(+), 32 deletions(-) diff --git a/apps/addons/templates/addons/impala/details.html b/apps/addons/templates/addons/impala/details.html index 2e266cd383..6d666cb1f6 100644 --- a/apps/addons/templates/addons/impala/details.html +++ b/apps/addons/templates/addons/impala/details.html @@ -164,7 +164,7 @@ {% endif %} {% if addon.has_satisfaction %} {# get satisfaction only supports en-US so no L10n here #} -
  • Get Satisfaction
  • diff --git a/media/js/impala/addon_details.js b/media/js/impala/addon_details.js index 0ae377792d..dd360a868f 100644 --- a/media/js/impala/addon_details.js +++ b/media/js/impala/addon_details.js @@ -134,4 +134,28 @@ $(function () { } $('#abuse-modal').modal('#report-abuse', {delegate: '#page'}); + + // I Get Satisfaction. + var btn = $('#feedback-btn'); + if (btn.length) { + var widget_options = { + 'company': btn.attr('data-company'), + 'placement': 'hidden', + 'style': 'question', + 'container': 'get-satisfaction' + }; + if (btn.attr('data-product')) { + widget_options.product = btn.attr('data-product'); + } + var feedback_widget = new GSFN.feedback_widget(widget_options); + + // The feedback widget expects to be right before the end of . + // Otherwise its 100% width overlay isn't across the whole page. + $('#fdbk_overlay').prependTo('body'); + + btn.click(_pd(function() { + feedback_widget.show(); + })); + } + }); diff --git a/media/js/zamboni/addon_details.js b/media/js/zamboni/addon_details.js index a13e803cd4..1fc7b7d1ba 100644 --- a/media/js/zamboni/addon_details.js +++ b/media/js/zamboni/addon_details.js @@ -2,11 +2,11 @@ /* general initialization */ $(document).ready(function() { - //performance warnings - if ($("#addon[data-id], #persona[data-id]").length) { + // Personas are not impalacized yet! + if ($("#persona[data-id]").length) { $(".addon .icon").click(function() { - window.location.hash = "id=" + $("#addon, #persona").attr("data-id"); + window.location.hash = "id=" + $("#persona").attr("data-id"); }) } @@ -43,29 +43,3 @@ $(document).ready(function() { no_restart.show(); } }); - -/* get satisfaction initialization */ -$(document).ready(function () { - var btn = $('#feedback_btn'); - if (!btn.length) return; // no button, no satisfaction ;) - - var widget_options = {}; - widget_options.display = "overlay"; - widget_options.company = btn.attr('data-company'); - widget_options.placement = "hidden"; - widget_options.color = "#222"; - widget_options.style = "question"; - widget_options.container = 'get_satisfaction_container'; - if (btn.attr('data-product')) - widget_options.product = btn.attr('data-product'); - var feedback_widget = new GSFN.feedback_widget(widget_options); - - // The feedback widget expects to be right before the end of . - // Otherwise it's 100% width overlay isn't across the whole page. - $('#fdbk_overlay').prependTo('body'); - - btn.click(function(e) { - e.preventDefault(); - feedback_widget.show(); - }); -}); diff --git a/templates/impala/base.html b/templates/impala/base.html index 99abad4825..1edc038e83 100644 --- a/templates/impala/base.html +++ b/templates/impala/base.html @@ -210,10 +210,11 @@ {# section #} {# footer #} {% endblock %} +
    {# Webtrends Stats Tracking #} - {# End Webtrends #}