浏览代码

Add jsdocs to the recording view manager

j8
yanas 9 年前
父节点
当前提交
351775a1c0
共有 1 个文件被更改,包括 39 次插入2 次删除
  1. 39
    2
      modules/UI/recording/Recording.js

+ 39
- 2
modules/UI/recording/Recording.js 查看文件

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
 function _showStopRecordingPrompt (recordingType) {
143
 function _showStopRecordingPrompt (recordingType) {
137
     var title;
144
     var title;
138
     var message;
145
     var message;
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
 function moveToCorner(selector, move) {
183
 function moveToCorner(selector, move) {
171
     let moveToCornerClass = "moveToCorner";
184
     let moveToCornerClass = "moveToCorner";
172
 
185
 
176
         selector.removeClass(moveToCornerClass);
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
 var Status = {
198
 var Status = {
180
     ON: "on",
199
     ON: "on",
181
     OFF: "off",
200
     OFF: "off",
184
     PENDING: "pending"
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
 var Recording = {
211
 var Recording = {
188
     /**
212
     /**
189
      * Initializes the recording UI.
213
      * Initializes the recording UI.
196
         this.initRecordingButton(recordingType);
220
         this.initRecordingButton(recordingType);
197
     },
221
     },
198
 
222
 
223
+    /**
224
+     * Initialise the recording button.
225
+     */
199
     initRecordingButton(recordingType) {
226
     initRecordingButton(recordingType) {
200
         let selector = $('#toolbar_button_record');
227
         let selector = $('#toolbar_button_record');
201
 
228
 
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
     showRecordingButton (show) {
295
     showRecordingButton (show) {
266
         if (_isRecordingButtonEnabled() && show) {
296
         if (_isRecordingButtonEnabled() && show) {
267
             $('#toolbar_button_record').css({display: "inline-block"});
297
             $('#toolbar_button_record').css({display: "inline-block"});
270
         }
300
         }
271
     },
301
     },
272
 
302
 
303
+    /**
304
+     * Updates the recording state UI.
305
+     * @param recordingState gives us the current recording state
306
+     */
273
     updateRecordingState(recordingState) {
307
     updateRecordingState(recordingState) {
274
         // I'm the recorder, so I don't want to see any UI related to states.
308
         // I'm the recorder, so I don't want to see any UI related to states.
275
         if (config.iAmRecorder)
309
         if (config.iAmRecorder)
282
         this.setRecordingButtonState(recordingState);
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
     setRecordingButtonState (recordingState) {
323
     setRecordingButtonState (recordingState) {
287
         let buttonSelector = $('#toolbar_button_record');
324
         let buttonSelector = $('#toolbar_button_record');
288
         let labelSelector = $('#recordingLabel');
325
         let labelSelector = $('#recordingLabel');

正在加载...
取消
保存