Skip to content

Commit 5b1bd4a

Browse files
authored
Merge pull request #86 from McGiverGim/bf-new_window
From CF: Add a button to create a new blackbox log viewer window
2 parents a05bea3 + 798db76 commit 5b1bd4a

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ <h1>Welcome to the Enhanced Blackbox Explorer!</h1>
163163
<div id="navbar" class="navbar-collapse collapse">
164164
<div class="navbar-form navbar-right" role="form">
165165
<div class="btn-group">
166-
<a class="btn btn-default btn-video-export" data-toggle="tooltip" title="Export your vide and chart setup to file"> Export video...</a>
166+
<a class="btn btn-default btn-new-window" data-toggle="tooltip" title="Open a new Blackbox Log Viewer window"> New Window </a>
167+
<a class="btn btn-primary btn-video-export" data-toggle="tooltip" title="Export your vide and chart setup to file"> Export video...</a>
167168
<a class="btn btn-primary btn-workspaces-export" data-toggle="tooltip" title="Export your workspace configurations to file"> Export Workspaces...</a>
168169
<span class="btn btn-primary btn-file" data-toggle="tooltip" title="Open another log file, video file, exported workspace file or configuration dump file"> Open log file/video <input type="file" class="file-open" multiple></span>
169170
<button type="button" class="btn btn-default view-zoom-in" data-toggle="tooltip" title="Zoom In Window" style="display: none;">

js/main.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ var userSettings = {};
55

66
var VIEWER_VERSION = '2.5.13'; // Current version
77

8+
var INNER_BOUNDS_WIDTH = 1340,
9+
INNER_BOUNDS_HEIGHT = 900;
10+
811
function BlackboxLogViewer() {
912
function supportsRequiredAPIs() {
1013
return window.File && window.FileReader && window.FileList && Modernizr.canvas;
@@ -863,6 +866,15 @@ function BlackboxLogViewer() {
863866
hasAnalyser = false;
864867
html.toggleClass("has-analyser", hasAnalyser);
865868

869+
$(".btn-new-window").click(function(e) {
870+
chrome.app.window.create('index.html', {
871+
'innerBounds' : {
872+
'width' : INNER_BOUNDS_WIDTH,
873+
'height' : INNER_BOUNDS_HEIGHT
874+
}
875+
});
876+
});
877+
866878
$(".file-open").change(function(e) {
867879
var
868880
files = e.target.files,

0 commit comments

Comments
 (0)