|
@@ -1,4 +1,4 @@
|
1
|
|
-/* global $, interfaceConfig */
|
|
1
|
+/* global $, config, interfaceConfig */
|
2
|
2
|
|
3
|
3
|
/*
|
4
|
4
|
* Created by Yana Stamcheva on 2/10/15.
|
|
@@ -73,6 +73,30 @@ var Feedback = {
|
73
|
73
|
* The feedback score. -1 indicates no score has been given for now.
|
74
|
74
|
*/
|
75
|
75
|
feedbackScore: -1,
|
|
76
|
+ /**
|
|
77
|
+ * Initialise the Feedback functionality.
|
|
78
|
+ */
|
|
79
|
+ init: function () {
|
|
80
|
+ // CallStats is the way we send feedback, so we don't have to initialise
|
|
81
|
+ // if callstats isn't enabled.
|
|
82
|
+ if (!config.callStatsID || !config.callStatsSecret)
|
|
83
|
+ return;
|
|
84
|
+
|
|
85
|
+ $("div.feedbackButton").css("display", "block");
|
|
86
|
+ $("#feedbackButton").click(function (event) {
|
|
87
|
+ Feedback.openFeedbackWindow();
|
|
88
|
+ });
|
|
89
|
+ },
|
|
90
|
+ /**
|
|
91
|
+ * Indicates if the feedback functionality is enabled.
|
|
92
|
+ *
|
|
93
|
+ * @return true if the feedback functionality is enabled, false otherwise.
|
|
94
|
+ */
|
|
95
|
+ isEnabled: function() {
|
|
96
|
+ var isCallStatsEnabled = (config.callStatsID && config.callStatsSecret);
|
|
97
|
+
|
|
98
|
+ return isCallStatsEnabled;
|
|
99
|
+ },
|
76
|
100
|
/**
|
77
|
101
|
* Opens the feedback window.
|
78
|
102
|
*/
|
|
@@ -120,7 +144,7 @@ var Feedback = {
|
120
|
144
|
var states = {
|
121
|
145
|
overall_feedback: {
|
122
|
146
|
html: constructOverallFeedbackHtml(),
|
123
|
|
- persistent: true,
|
|
147
|
+ persistent: false,
|
124
|
148
|
buttons: {},
|
125
|
149
|
closeText: '',
|
126
|
150
|
focus: "div[id='stars']",
|
|
@@ -161,7 +185,7 @@ var Feedback = {
|
161
|
185
|
var feedbackDialog
|
162
|
186
|
= APP.UI.messageHandler.openDialogWithStates(
|
163
|
187
|
states,
|
164
|
|
- { persistent: true,
|
|
188
|
+ { persistent: false,
|
165
|
189
|
buttons: {},
|
166
|
190
|
closeText: '',
|
167
|
191
|
loaded: onLoadFunction,
|