OpenShot Video Editor  2.0.0
app.js
Go to the documentation of this file.
1 /**
2  * @file
3  * @brief AngularJS App (initializes angular application)
4  * @author Jonathan Thomas <jonathan@openshot.org>
5  * @author Cody Parker <cody@yourcodepro.com>
6  *
7  * @section LICENSE
8  *
9  * Copyright (c) 2008-2014 OpenShot Studios, LLC
10  * <http://www.openshotstudios.com/>. This file is part of
11  * OpenShot Video Editor, an open-source project dedicated to
12  * delivering high quality video editing and animation solutions to the
13  * world. For more information visit <http://www.openshot.org/>.
14  *
15  * OpenShot Video Editor is free software: you can redistribute it
16  * and/or modify it under the terms of the GNU General Public License
17  * as published by the Free Software Foundation, either version 3 of the
18  * License, or (at your option) any later version.
19  *
20  * OpenShot Video Editor is distributed in the hope that it will be
21  * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23  * GNU General Public License for more details.
24  *
25  * You should have received a copy of the GNU General Public License
26  * along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
27  */
28 
29 
30 // Initialize Angular application
31 var App = angular.module('openshot-timeline', ['ui.bootstrap','ngAnimate']);
32 
33 
34 // Wait for document ready event
35  $( document ).ready(function() {
36 
37  /// Capture window resize event, and resize scrollable divs (i.e. track container)
38  $( window ).resize(function() {
39 
40  // Determine Y offset for track container div
41  var track_offset = $("#track_controls").offset().top;
42 
43  // Set the height of the scrollable divs. This resizes the tracks to fit the remaining
44  // height of the web page. As the user changes the size of the web page, this will continue
45  // to fire, and resize the child divs to fit.
46  var new_track_height = $(this).height() - track_offset;
47 
48  $("#track_controls").height(new_track_height);
49  $("#scrolling_tracks").height(new_track_height);
50  $('body').scope().playhead_height = $("#track-container").height();
51  $(".playhead-line").height($('body').scope().playhead_height);
52  });
53 
54  // Check for Qt Integration
55  if(typeof timeline != 'undefined') {
56  timeline.qt_log("Qt Found!");
57  $('body').scope().EnableQt()
58  } else {
59  console.log("Qt NOT Found!");
60  }
61 
62  // Manually trigger the window resize code (to verify it runs at least once)
63  $(window).trigger('resize');
64 
65  // Bind to keydown event (to detect SHIFT)
66  $( "body" ).keydown(function(event) {
67  if (event.which==16)
68  $('body').scope().shift_pressed = true;
69  });
70  $( "body" ).keyup(function(event) {
71  if ($('body').scope().shift_pressed)
72  $('body').scope().shift_pressed = false;
73  });
74 });
75 
function window
Definition: jquery.js:14
jQuery fn offset
Definition: jquery.js:9546
var App
Definition: app.js:31
document ready(function(){$(window).resize(function(){var track_offset=$("#track_controls").offset().top;var new_track_height=$(this).height()-track_offset;$("#track_controls").height(new_track_height);$("#scrolling_tracks").height(new_track_height);$('body').scope().playhead_height=$("#track-container").height();$(".playhead-line").height($('body').scope().playhead_height);});if(typeof timeline!= 'undefined'){timeline.qt_log("Qt Found!");$('body').scope().EnableQt()}else{console.log("Qt NOT Found!");}$(window).trigger('resize');$("body").keydown(function(event){if(event.which==16)$('body').scope().shift_pressed=true;});$("body").keyup(function(event){if($('body').scope().shift_pressed)$('body').scope().shift_pressed=false;});})