Skip to content

Commit 836e21d

Browse files
committed
Major reformatting of timeline's JS files (removing unused variables, consistent indents, brackets around logic sections, etc...)
1 parent ce7efd5 commit 836e21d

File tree

9 files changed

+2561
-2693
lines changed

9 files changed

+2561
-2693
lines changed

src/timeline/app.js

+19-15
Original file line numberDiff line numberDiff line change
@@ -32,46 +32,50 @@ var App = angular.module("openshot-timeline", ["ui.bootstrap", "ngAnimate"]);
3232

3333

3434
// Wait for document ready event
35-
$( document ).ready(function() {
35+
$(document).ready(function () {
36+
37+
var body_object = $("body");
3638

3739
/// Capture window resize event, and resize scrollable divs (i.e. track container)
38-
$( window ).resize(function() {
40+
$(window).resize(function () {
3941

4042
// Determine Y offset for track container div
41-
var track_offset = $("#track_controls").offset().top;
43+
var track_controls = $("#track_controls");
44+
var track_offset = track_controls.offset().top;
4245

4346
// Set the height of the scrollable divs. This resizes the tracks to fit the remaining
4447
// height of the web page. As the user changes the size of the web page, this will continue
4548
// to fire, and resize the child divs to fit.
4649
var new_track_height = $(this).height() - track_offset;
4750

48-
$("#track_controls").height(new_track_height);
51+
track_controls.height(new_track_height);
4952
$("#scrolling_tracks").height(new_track_height);
50-
$("body").scope().playhead_height = $("#track-container").height();
51-
$(".playhead-line").height($("body").scope().playhead_height);
53+
body_object.scope().playhead_height = $("#track-container").height();
54+
$(".playhead-line").height(body_object.scope().playhead_height);
5255
});
5356

5457
// Check for Qt Integration
55-
if(typeof timeline !== "undefined") {
58+
if (typeof timeline !== "undefined") {
5659
timeline.qt_log("Qt Found!");
57-
$("body").scope().EnableQt();
60+
body_object.scope().EnableQt();
5861
timeline.page_ready();
59-
$("body").scope().SetThumbAddress(timeline.get_thumb_address());
62+
body_object.scope().SetThumbAddress(timeline.get_thumb_address());
6063
}
6164

6265
// Manually trigger the window resize code (to verify it runs at least once)
6366
$(window).trigger("resize");
6467

6568
// Bind to keydown event (to detect SHIFT)
66-
$( "body" ).keydown(function(event) {
69+
body_object.keydown(function (event) {
6770
if (event.which === 16) {
68-
$("body").scope().shift_pressed = true;
71+
body_object.scope().shift_pressed = true;
6972
}
7073
});
71-
$( "body" ).keyup(function(event) {
72-
if ($("body").scope().shift_pressed) {
73-
$("body").scope().shift_pressed = false;
74+
75+
body_object.keyup(function () {
76+
if (body_object.scope().shift_pressed) {
77+
body_object.scope().shift_pressed = false;
7478
}
7579
});
76-
});
7780

81+
});

0 commit comments

Comments
 (0)