@@ -159,7 +159,7 @@ App.controller("TimelineCtrl", function ($scope) {
159
159
continue ;
160
160
}
161
161
// Determine if this property is a Keyframe
162
- if ( typeof object [ child ] == "object" && "Points" in object [ child ] ) {
162
+ if ( typeof object [ child ] === "object" && "Points" in object [ child ] ) {
163
163
for ( var point = 0 ; point < object [ child ] . Points . length ; point ++ ) {
164
164
var co = object [ child ] . Points [ point ] . co ;
165
165
if ( co . X >= clip_start_x && co . X <= clip_end_x ) {
@@ -169,7 +169,7 @@ App.controller("TimelineCtrl", function ($scope) {
169
169
}
170
170
}
171
171
// Determine if this property is a Color Keyframe
172
- if ( typeof object [ child ] == "object" && "red" in object [ child ] ) {
172
+ if ( typeof object [ child ] === "object" && "red" in object [ child ] ) {
173
173
for ( var point = 0 ; point < object [ child ] [ "red" ] . Points . length ; point ++ ) {
174
174
var co = object [ child ] [ "red" ] . Points [ point ] . co ;
175
175
if ( co . X >= clip_start_x && co . X <= clip_end_x ) {
@@ -189,7 +189,7 @@ App.controller("TimelineCtrl", function ($scope) {
189
189
continue ;
190
190
}
191
191
// Determine if this property is a Keyframe
192
- if ( typeof object [ "effects" ] [ effect ] [ child ] == "object" && "Points" in object [ "effects" ] [ effect ] [ child ] ) {
192
+ if ( typeof object [ "effects" ] [ effect ] [ child ] === "object" && "Points" in object [ "effects" ] [ effect ] [ child ] ) {
193
193
for ( var point = 0 ; point < object [ "effects" ] [ effect ] [ child ] . Points . length ; point ++ ) {
194
194
var co = object [ "effects" ] [ effect ] [ child ] . Points [ point ] . co ;
195
195
if ( co . X >= clip_start_x && co . X <= clip_end_x ) {
@@ -199,7 +199,7 @@ App.controller("TimelineCtrl", function ($scope) {
199
199
}
200
200
}
201
201
// Determine if this property is a Color Keyframe
202
- if ( typeof object [ "effects" ] [ effect ] [ child ] == "object" && "red" in object [ "effects" ] [ effect ] [ child ] ) {
202
+ if ( typeof object [ "effects" ] [ effect ] [ child ] === "object" && "red" in object [ "effects" ] [ effect ] [ child ] ) {
203
203
for ( var point = 0 ; point < object [ "effects" ] [ effect ] [ child ] [ "red" ] . Points . length ; point ++ ) {
204
204
var co = object [ "effects" ] [ effect ] [ child ] [ "red" ] . Points [ point ] . co ;
205
205
if ( co . X >= clip_start_x && co . X <= clip_end_x ) {
@@ -315,7 +315,7 @@ App.controller("TimelineCtrl", function ($scope) {
315
315
$scope . setAudioData = function ( clip_id , audio_data ) {
316
316
// Find matching clip
317
317
for ( var clip_index = 0 ; clip_index < $scope . project . clips . length ; clip_index ++ ) {
318
- if ( $scope . project . clips [ clip_index ] . id == clip_id ) {
318
+ if ( $scope . project . clips [ clip_index ] . id === clip_id ) {
319
319
// Set audio data
320
320
$scope . $apply ( function ( ) {
321
321
$scope . project . clips [ clip_index ] . audio_data = audio_data ;
@@ -334,7 +334,7 @@ App.controller("TimelineCtrl", function ($scope) {
334
334
$scope . hideAudioData = function ( clip_id ) {
335
335
// Find matching clip
336
336
for ( var clip_index = 0 ; clip_index < $scope . project . clips . length ; clip_index ++ ) {
337
- if ( $scope . project . clips [ clip_index ] . id == clip_id ) {
337
+ if ( $scope . project . clips [ clip_index ] . id === clip_id ) {
338
338
// Set audio data
339
339
$scope . $apply ( function ( ) {
340
340
$scope . project . clips [ clip_index ] . show_audio = false ;
@@ -360,7 +360,7 @@ App.controller("TimelineCtrl", function ($scope) {
360
360
$scope . hasAudioData = function ( clip_id ) {
361
361
// Find matching clip
362
362
for ( var clip_index = 0 ; clip_index < $scope . project . clips . length ; clip_index ++ ) {
363
- if ( $scope . project . clips [ clip_index ] . id == clip_id && "audio_data" in $scope . project . clips [ clip_index ] && $scope . project . clips [ clip_index ] . audio_data . length > 0 ) {
363
+ if ( $scope . project . clips [ clip_index ] . id === clip_id && "audio_data" in $scope . project . clips [ clip_index ] && $scope . project . clips [ clip_index ] . audio_data . length > 0 ) {
364
364
return true ;
365
365
}
366
366
}
@@ -507,12 +507,12 @@ App.controller("TimelineCtrl", function ($scope) {
507
507
var id = clip_id . replace ( "clip_" , "" ) ;
508
508
509
509
// Clear transitions also (if needed)
510
- if ( id != "" && clear_selections ) {
510
+ if ( id !== "" && clear_selections ) {
511
511
$scope . selectTransition ( "" , clear_selections ) ;
512
512
$scope . selectEffect ( "" , clear_selections ) ;
513
513
}
514
514
// Call slice method and exit (don't actually select the clip)
515
- if ( id != "" && $scope . enable_razor ) {
515
+ if ( id !== "" && $scope . enable_razor ) {
516
516
if ( $scope . Qt ) {
517
517
var cursor_seconds = $scope . getJavaScriptPosition ( event . clientX ) ;
518
518
timeline . RazorSliceAtCursor ( id , "" , cursor_seconds ) ;
@@ -528,7 +528,7 @@ App.controller("TimelineCtrl", function ($scope) {
528
528
529
529
// Unselect all clips
530
530
for ( var clip_index = 0 ; clip_index < $scope . project . clips . length ; clip_index ++ ) {
531
- if ( $scope . project . clips [ clip_index ] . id == id ) {
531
+ if ( $scope . project . clips [ clip_index ] . id === id ) {
532
532
$scope . project . clips [ clip_index ] . selected = true ;
533
533
if ( $scope . Qt ) {
534
534
timeline . addSelection ( id , "clip" , clear_selections ) ;
@@ -549,12 +549,12 @@ App.controller("TimelineCtrl", function ($scope) {
549
549
var id = tran_id . replace ( "transition_" , "" ) ;
550
550
551
551
// Clear clips also (if needed)
552
- if ( id != "" && clear_selections ) {
552
+ if ( id !== "" && clear_selections ) {
553
553
$scope . selectClip ( "" , true ) ;
554
554
$scope . selectEffect ( "" , true ) ;
555
555
}
556
556
// Call slice method and exit (don't actually select the transition)
557
- if ( id != "" && $scope . enable_razor ) {
557
+ if ( id !== "" && $scope . enable_razor ) {
558
558
if ( $scope . Qt ) {
559
559
var cursor_seconds = $scope . getJavaScriptPosition ( event . clientX ) ;
560
560
timeline . RazorSliceAtCursor ( "" , id , cursor_seconds ) ;
@@ -571,7 +571,7 @@ App.controller("TimelineCtrl", function ($scope) {
571
571
572
572
// Unselect all transitions
573
573
for ( var tran_index = 0 ; tran_index < $scope . project . effects . length ; tran_index ++ ) {
574
- if ( $scope . project . effects [ tran_index ] . id == id ) {
574
+ if ( $scope . project . effects [ tran_index ] . id === id ) {
575
575
$scope . project . effects [ tran_index ] . selected = true ;
576
576
if ( $scope . Qt ) {
577
577
timeline . addSelection ( id , "transition" , clear_selections ) ;
@@ -750,10 +750,10 @@ App.controller("TimelineCtrl", function ($scope) {
750
750
751
751
// Find item in JSON
752
752
var item_object = null ;
753
- if ( item_type == "clip" ) {
753
+ if ( item_type === "clip" ) {
754
754
item_object = findElement ( $scope . project . clips , "id" , item_id ) ;
755
755
}
756
- else if ( item_type == "transition" ) {
756
+ else if ( item_type === "transition" ) {
757
757
item_object = findElement ( $scope . project . effects , "id" , item_id ) ;
758
758
}
759
759
else {
@@ -773,10 +773,10 @@ App.controller("TimelineCtrl", function ($scope) {
773
773
} ) ;
774
774
775
775
// update clip in Qt (very important =)
776
- if ( item_type == "clip" ) {
776
+ if ( item_type === "clip" ) {
777
777
timeline . update_clip_data ( JSON . stringify ( item_object ) , true , true , false ) ;
778
778
}
779
- else if ( item_type == "transition" ) {
779
+ else if ( item_type === "transition" ) {
780
780
timeline . update_transition_data ( JSON . stringify ( item_object ) , true , false ) ;
781
781
}
782
782
@@ -788,7 +788,7 @@ App.controller("TimelineCtrl", function ($scope) {
788
788
789
789
// Check again for missing transitions
790
790
var missing_transition_details = $scope . getMissingTransitions ( item_object ) ;
791
- if ( $scope . Qt && missing_transition_details != null ) {
791
+ if ( $scope . Qt && missing_transition_details !== null ) {
792
792
timeline . add_missing_transition ( JSON . stringify ( missing_transition_details ) ) ;
793
793
}
794
794
// Remove manual move stylesheet
@@ -802,10 +802,10 @@ App.controller("TimelineCtrl", function ($scope) {
802
802
$scope . startManualMove = function ( item_type , item_id ) {
803
803
// Select the item
804
804
$scope . $apply ( function ( ) {
805
- if ( item_type == "clip" ) {
805
+ if ( item_type === "clip" ) {
806
806
$scope . selectClip ( item_id , true ) ;
807
807
}
808
- else if ( item_type == "transition" ) {
808
+ else if ( item_type === "transition" ) {
809
809
$scope . selectTransition ( item_id , true ) ;
810
810
}
811
811
} ) ;
@@ -814,12 +814,12 @@ App.controller("TimelineCtrl", function ($scope) {
814
814
// This needs to be done inline due to async issues with the
815
815
// above calls to selectClip/selectTransition
816
816
for ( var clip_index = 0 ; clip_index < $scope . project . clips . length ; clip_index ++ ) {
817
- $scope . project . clips [ clip_index ] . selected = $scope . project . clips [ clip_index ] . id == item_id ;
817
+ $scope . project . clips [ clip_index ] . selected = $scope . project . clips [ clip_index ] . id === item_id ;
818
818
}
819
819
820
820
// Select new transition object (and unselect others)
821
821
for ( var tran_index = 0 ; tran_index < $scope . project . effects . length ; tran_index ++ ) {
822
- $scope . project . effects [ tran_index ] . selected = $scope . project . effects [ tran_index ] . id == item_id ;
822
+ $scope . project . effects [ tran_index ] . selected = $scope . project . effects [ tran_index ] . id === item_id ;
823
823
}
824
824
825
825
// JQuery selector for element (clip or transition)
@@ -838,7 +838,7 @@ App.controller("TimelineCtrl", function ($scope) {
838
838
bounding_box . track_position = 0 ;
839
839
840
840
// Set z-order to be above other clips/transitions
841
- if ( item_type != "os_drop" ) {
841
+ if ( item_type !== "os_drop" ) {
842
842
bounding_box . element . addClass ( "manual-move" ) ;
843
843
}
844
844
} ;
@@ -973,7 +973,7 @@ App.controller("TimelineCtrl", function ($scope) {
973
973
var clip = $scope . project . clips [ index ] ;
974
974
975
975
// skip clips that are not on the same layer
976
- if ( original_clip . layer != clip . layer ) {
976
+ if ( original_clip . layer !== clip . layer ) {
977
977
continue ;
978
978
}
979
979
@@ -993,22 +993,22 @@ App.controller("TimelineCtrl", function ($scope) {
993
993
transition_size = { "position" : clip_left , "layer" : clip . layer , "start" : 0 , "end" : ( original_right - clip_left ) } ;
994
994
}
995
995
996
- if ( transition_size != null && transition_size . end >= 0.5 ) {
996
+ if ( transition_size !== null && transition_size . end >= 0.5 ) {
997
997
// Found a possible missing transition
998
998
break ;
999
999
}
1000
- else if ( transition_size != null && transition_size . end < 0.5 ) {
1000
+ else if ( transition_size !== null && transition_size . end < 0.5 ) {
1001
1001
// Too small to be a missing transitions, clear and continue looking
1002
1002
transition_size = null ;
1003
1003
}
1004
1004
}
1005
1005
// Search through all existing transitions, and don't overlap an existing one
1006
- if ( transition_size != null ) {
1006
+ if ( transition_size !== null ) {
1007
1007
for ( var tran_index = 0 ; tran_index < $scope . project . effects . length ; tran_index ++ ) {
1008
1008
var tran = $scope . project . effects [ tran_index ] ;
1009
1009
1010
1010
// skip transitions that are not on the same layer
1011
- if ( tran . layer != transition_size . layer ) {
1011
+ if ( tran . layer !== transition_size . layer ) {
1012
1012
continue ;
1013
1013
}
1014
1014
@@ -1114,7 +1114,7 @@ App.controller("TimelineCtrl", function ($scope) {
1114
1114
1115
1115
// Show the nearby snapping line
1116
1116
$scope . showSnapline = function ( position ) {
1117
- if ( position != $scope . snapline_position || ! $scope . snapline ) {
1117
+ if ( position !== $scope . snapline_position || ! $scope . snapline ) {
1118
1118
// Only update if value has changed
1119
1119
$scope . $apply ( function ( ) {
1120
1120
$scope . snapline_position = position ;
@@ -1216,7 +1216,7 @@ App.controller("TimelineCtrl", function ($scope) {
1216
1216
var key_value = action . key [ key_index ] ;
1217
1217
1218
1218
// Check the key type
1219
- if ( key_value . constructor == String ) {
1219
+ if ( key_value . constructor === String ) {
1220
1220
// Does the key value exist in scope?, No match, bail out
1221
1221
if ( ! current_object . hasOwnProperty ( key_value ) ) {
1222
1222
return false ;
@@ -1227,21 +1227,21 @@ App.controller("TimelineCtrl", function ($scope) {
1227
1227
current_key = key_value ;
1228
1228
1229
1229
}
1230
- else if ( key_value . constructor == Object ) {
1230
+ else if ( key_value . constructor === Object ) {
1231
1231
// Get the id from the object (if any)
1232
1232
var id = null ;
1233
1233
if ( "id" in key_value ) {
1234
1234
id = key_value [ "id" ] ;
1235
1235
}
1236
1236
// Be sure the current_object is an Array
1237
- if ( current_object . constructor == Array ) {
1237
+ if ( current_object . constructor === Array ) {
1238
1238
// Filter the current_object for a specific id
1239
1239
current_position = 0 ;
1240
1240
for ( var child_index = 0 ; child_index < current_object . length ; child_index ++ ) {
1241
1241
var child_object = current_object [ child_index ] ;
1242
1242
1243
1243
// Find matching child
1244
- if ( child_object . hasOwnProperty ( "id" ) && child_object . id == id ) {
1244
+ if ( child_object . hasOwnProperty ( "id" ) && child_object . id === id ) {
1245
1245
// set current level and previous level
1246
1246
previous_object = current_object ;
1247
1247
current_object = child_object ;
@@ -1257,28 +1257,28 @@ App.controller("TimelineCtrl", function ($scope) {
1257
1257
// Now that we have a matching object in the $scope.project...
1258
1258
if ( current_object ) {
1259
1259
// INSERT OBJECT
1260
- if ( action . type == "insert" ) {
1260
+ if ( action . type === "insert" ) {
1261
1261
// Insert action's value into current_object
1262
- if ( current_object . constructor == Array ) {
1262
+ if ( current_object . constructor === Array ) {
1263
1263
// push new element into array
1264
1264
current_object . push ( action . value ) ;
1265
1265
}
1266
1266
else {
1267
1267
// replace the entire value
1268
- if ( previous_object . constructor == Array ) {
1268
+ if ( previous_object . constructor === Array ) {
1269
1269
// replace entire value in OBJECT
1270
1270
previous_object [ current_position ] = action . value ;
1271
1271
}
1272
- else if ( previous_object . constructor == Object ) {
1272
+ else if ( previous_object . constructor === Object ) {
1273
1273
// replace entire value in OBJECT
1274
1274
previous_object [ current_key ] = action . value ;
1275
1275
}
1276
1276
}
1277
1277
}
1278
- else if ( action . type == "update" ) {
1278
+ else if ( action . type === "update" ) {
1279
1279
// UPDATE OBJECT
1280
1280
// Update: If action and current object are Objects
1281
- if ( current_object . constructor == Object && action . value . constructor == Object ) {
1281
+ if ( current_object . constructor === Object && action . value . constructor = == Object ) {
1282
1282
for ( var update_key in action . value ) {
1283
1283
if ( update_key in current_object ) {
1284
1284
// Only copy over keys that exist in both action and current_object
@@ -1288,17 +1288,17 @@ App.controller("TimelineCtrl", function ($scope) {
1288
1288
}
1289
1289
else {
1290
1290
// replace the entire value
1291
- if ( previous_object . constructor == Array ) {
1291
+ if ( previous_object . constructor === Array ) {
1292
1292
// replace entire value in OBJECT
1293
1293
previous_object [ current_position ] = action . value ;
1294
1294
}
1295
- else if ( previous_object . constructor == Object ) {
1295
+ else if ( previous_object . constructor === Object ) {
1296
1296
// replace entire value in OBJECT
1297
1297
previous_object [ current_key ] = action . value ;
1298
1298
}
1299
1299
}
1300
1300
}
1301
- else if ( action . type == "delete" ) {
1301
+ else if ( action . type === "delete" ) {
1302
1302
// DELETE OBJECT
1303
1303
// delete current object from it's parent (previous object)
1304
1304
previous_object . splice ( current_position , 1 ) ;
0 commit comments