fix Get Satisfaction (bug 690363)

This commit is contained in:
Chris Van 2011-09-29 15:58:38 -07:00
Родитель 1375318e1b
Коммит ca291a4370
4 изменённых файлов: 31 добавлений и 32 удалений

Просмотреть файл

@ -164,7 +164,7 @@
{% endif %}
{% if addon.has_satisfaction %}
{# get satisfaction only supports en-US so no L10n here #}
<li><a href="#" id="feedback_btn" class="support-gs"
<li><a href="#" id="feedback-btn" class="support-gs"
data-company="{{ addon.get_satisfaction_company }}"
data-product="{{ addon.get_satisfaction_product }}">Get Satisfaction</a>
</li>

Просмотреть файл

@ -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 <body>.
// Otherwise its 100% width overlay isn't across the whole page.
$('#fdbk_overlay').prependTo('body');
btn.click(_pd(function() {
feedback_widget.show();
}));
}
});

Просмотреть файл

@ -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 <body>.
// 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();
});
});

Просмотреть файл

@ -210,10 +210,11 @@
</div> {# section #}
</div> {# footer #}
{% endblock %}
<div id="get-satisfaction"></div>
{# Webtrends Stats Tracking #}
<script defer src="{{ media('js/webtrends/webtrends-v0.1.js') }}"></script>
<noscript class="hidden">
<img id="DCSIMG" width="1" height="1"
<noscript>
<img class="hidden" id="DCSIMG" width="1" height="1"
src="https://statse.webtrendslive.com/dcso6de4r0000082npfcmh4rf_4b1e/njs.gif?dcsuri=/nojavascript&amp;WT.js=No&amp;WT.tv=8.6.2" />
</noscript>
{# End Webtrends #}