|
@@ -133,6 +133,13 @@ function _requestRecordingToken () {
|
133
|
133
|
});
|
134
|
134
|
}
|
135
|
135
|
|
|
136
|
+/**
|
|
137
|
+ * Shows a prompt dialog to the user when they have toggled off the recording.
|
|
138
|
+ *
|
|
139
|
+ * @param recordingType the recording type
|
|
140
|
+ * @returns {Promise}
|
|
141
|
+ * @private
|
|
142
|
+ */
|
136
|
143
|
function _showStopRecordingPrompt (recordingType) {
|
137
|
144
|
var title;
|
138
|
145
|
var message;
|
|
@@ -167,6 +174,12 @@ function _showStopRecordingPrompt (recordingType) {
|
167
|
174
|
});
|
168
|
175
|
}
|
169
|
176
|
|
|
177
|
+/**
|
|
178
|
+ * Moves the element given by {selector} to the top right corner of the screen.
|
|
179
|
+ * @param selector the selector for the element to move
|
|
180
|
+ * @param move {true} to move the element, {false} to move it back to its intial
|
|
181
|
+ * position
|
|
182
|
+ */
|
170
|
183
|
function moveToCorner(selector, move) {
|
171
|
184
|
let moveToCornerClass = "moveToCorner";
|
172
|
185
|
|
|
@@ -176,6 +189,12 @@ function moveToCorner(selector, move) {
|
176
|
189
|
selector.removeClass(moveToCornerClass);
|
177
|
190
|
}
|
178
|
191
|
|
|
192
|
+/**
|
|
193
|
+ * The status of the recorder.
|
|
194
|
+ * FIXME: Those constants should come from the library.
|
|
195
|
+ * @type {{ON: string, OFF: string, AVAILABLE: string,
|
|
196
|
+ * UNAVAILABLE: string, PENDING: string}}
|
|
197
|
+ */
|
179
|
198
|
var Status = {
|
180
|
199
|
ON: "on",
|
181
|
200
|
OFF: "off",
|
|
@@ -184,6 +203,11 @@ var Status = {
|
184
|
203
|
PENDING: "pending"
|
185
|
204
|
};
|
186
|
205
|
|
|
206
|
+/**
|
|
207
|
+ * Manages the recording user interface and user experience.
|
|
208
|
+ * @type {{init, initRecordingButton, showRecordingButton, updateRecordingState,
|
|
209
|
+ * setRecordingButtonState, checkAutoRecord}}
|
|
210
|
+ */
|
187
|
211
|
var Recording = {
|
188
|
212
|
/**
|
189
|
213
|
* Initializes the recording UI.
|
|
@@ -196,6 +220,9 @@ var Recording = {
|
196
|
220
|
this.initRecordingButton(recordingType);
|
197
|
221
|
},
|
198
|
222
|
|
|
223
|
+ /**
|
|
224
|
+ * Initialise the recording button.
|
|
225
|
+ */
|
199
|
226
|
initRecordingButton(recordingType) {
|
200
|
227
|
let selector = $('#toolbar_button_record');
|
201
|
228
|
|
|
@@ -261,7 +288,10 @@ var Recording = {
|
261
|
288
|
});
|
262
|
289
|
},
|
263
|
290
|
|
264
|
|
- // Shows or hides the 'recording' button.
|
|
291
|
+ /**
|
|
292
|
+ * Shows or hides the 'recording' button.
|
|
293
|
+ * @param show {true} to show the recording button, {false} to hide it
|
|
294
|
+ */
|
265
|
295
|
showRecordingButton (show) {
|
266
|
296
|
if (_isRecordingButtonEnabled() && show) {
|
267
|
297
|
$('#toolbar_button_record').css({display: "inline-block"});
|
|
@@ -270,6 +300,10 @@ var Recording = {
|
270
|
300
|
}
|
271
|
301
|
},
|
272
|
302
|
|
|
303
|
+ /**
|
|
304
|
+ * Updates the recording state UI.
|
|
305
|
+ * @param recordingState gives us the current recording state
|
|
306
|
+ */
|
273
|
307
|
updateRecordingState(recordingState) {
|
274
|
308
|
// I'm the recorder, so I don't want to see any UI related to states.
|
275
|
309
|
if (config.iAmRecorder)
|
|
@@ -282,7 +316,10 @@ var Recording = {
|
282
|
316
|
this.setRecordingButtonState(recordingState);
|
283
|
317
|
},
|
284
|
318
|
|
285
|
|
- // Sets the state of the recording button
|
|
319
|
+ /**
|
|
320
|
+ * Sets the state of the recording button.
|
|
321
|
+ * @param recordingState gives us the current recording state
|
|
322
|
+ */
|
286
|
323
|
setRecordingButtonState (recordingState) {
|
287
|
324
|
let buttonSelector = $('#toolbar_button_record');
|
288
|
325
|
let labelSelector = $('#recordingLabel');
|