diff --git a/res/app/app.js b/res/app/app.js index 21029ed1..9950982d 100644 --- a/res/app/app.js +++ b/res/app/app.js @@ -16,7 +16,8 @@ require.ensure([], function (require) { require('./settings').name, require('./help').name, require('./docs').name, - require('./../common/lang').name + require('./../common/lang').name, + require('stf/standalone').name ]) .config(function ($routeProvider, $locationProvider) { $locationProvider.hashPrefix('!'); diff --git a/res/app/components/stf/standalone/index.js b/res/app/components/stf/standalone/index.js index dc038f14..93bde645 100644 --- a/res/app/components/stf/standalone/index.js +++ b/res/app/components/stf/standalone/index.js @@ -13,3 +13,4 @@ module.exports = angular.module('device-control.standalone', [ }]) .controller('StandaloneCtrl', require('./standalone-controller')) .factory('StandaloneService', require('./standalone-service')) + .directive('standalone', require('./standalone-directive')) diff --git a/res/app/components/stf/standalone/standalone-directive.js b/res/app/components/stf/standalone/standalone-directive.js new file mode 100644 index 00000000..996ccfd5 --- /dev/null +++ b/res/app/components/stf/standalone/standalone-directive.js @@ -0,0 +1,9 @@ +module.exports = function standaloneDirective($rootScope, $window) { + return { + restrict: 'AE', + link: function () { + $rootScope.standalone = $window.history.length < 2 + //$rootScope.standalone = true + } + } +} diff --git a/res/app/control-panes/control-panes-controller.js b/res/app/control-panes/control-panes-controller.js index 16177152..e03f569a 100644 --- a/res/app/control-panes/control-panes-controller.js +++ b/res/app/control-panes/control-panes-controller.js @@ -1,9 +1,7 @@ module.exports = function ControlPanesController($scope, $http, gettext, $routeParams, $timeout, $location, DeviceService, GroupService, ControlService, - StorageService, FatalMessageService, SettingsService, $window, $rootScope) { - - $rootScope.standalone = $window.history.length < 2 + StorageService, FatalMessageService, SettingsService) { var sharedTabs = [ { diff --git a/res/app/control-panes/control-panes.jade b/res/app/control-panes/control-panes.jade index 4aba2cb7..ae95b9c4 100644 --- a/res/app/control-panes/control-panes.jade +++ b/res/app/control-panes/control-panes.jade @@ -1,18 +1,19 @@ -div(ng-if='$root.basicMode || $root.standalone').fill-height - div.fill-height.basic-remote-control - .remote-control.fill-height - div(ng-include='"control-panes/device-control/device-control.jade"').fill-height +div(ng-controller='ControlPanesHotKeysCtrl').fill-height + div(ng-if='$root.basicMode || $root.standalone').fill-height + div.fill-height.basic-remote-control + .remote-control + div(ng-include='"control-panes/device-control/device-control-standalone.jade"').fill-height -div(ng-if='!$root.basicMode && !$root.standalone', ng-controller='ControlPanesHotKeysCtrl') - div(fa-pane, pane-id='control-device', pane-anchor='west', pane-size='{{remotePaneSize}}', pane-min='200px', pane-max='100% + 2px', pane-handle='4', pane-no-toggle='false') + div(ng-if='!$root.basicMode && !$root.standalone') + div(fa-pane, pane-id='control-device', pane-anchor='west', pane-size='{{remotePaneSize}}', pane-min='200px', pane-max='100% + 2px', pane-handle='4', pane-no-toggle='false') - .remote-control - //include control-screen - div(ng-include='"control-panes/device-control/device-control.jade"').fill-height + .remote-control + //include control-screen + div(ng-include='"control-panes/device-control/device-control.jade"').fill-height - div(fa-pane, pane-id='control-bottom-tabs', pane-anchor='south', pane-size='30% + 2px', pane-handle='4').pane-bottom-p - .widget-container.fluid-height - nice-tabs(key='ControlBottomTabs', direction='below', tabs='belowTabs', filter='$root.platform') - div(fa-pane, pane-id='control-top-tabs', pane-anchor='') - .widget-container.fluid-height - nice-tabs(key='ControlBottomTabs', tabs='topTabs', filter='$root.platform') + div(fa-pane, pane-id='control-bottom-tabs', pane-anchor='south', pane-size='30% + 2px', pane-handle='4').pane-bottom-p + .widget-container.fluid-height + nice-tabs(key='ControlBottomTabs', direction='below', tabs='belowTabs', filter='$root.platform') + div(fa-pane, pane-id='control-top-tabs', pane-anchor='') + .widget-container.fluid-height + nice-tabs(key='ControlBottomTabs', tabs='topTabs', filter='$root.platform') diff --git a/res/app/control-panes/device-control/device-control-standalone.jade b/res/app/control-panes/device-control/device-control-standalone.jade new file mode 100644 index 00000000..5ee02731 --- /dev/null +++ b/res/app/control-panes/device-control/device-control-standalone.jade @@ -0,0 +1,3 @@ +.interact-control.fill-height.stf-device-control(ng-controller='DeviceControlCtrl').fill-height.fill-width + div(ng-controller='DeviceScreenCtrl', ng-if='device', ng-file-drop='installFile($files)', ng-file-drag-over-class='dragover').fill-height.fill-width + device-screen(device='device', control='control').fill-height.fill-width diff --git a/res/app/control-panes/device-control/index.js b/res/app/control-panes/device-control/index.js index 40ad0c17..f34a5f98 100644 --- a/res/app/control-panes/device-control/index.js +++ b/res/app/control-panes/device-control/index.js @@ -9,6 +9,9 @@ module.exports = angular.module('device-control', [ $templateCache.put('control-panes/device-control/device-control.jade', require('./device-control.jade') ) + $templateCache.put('control-panes/device-control/device-control-standalone.jade', + require('./device-control-standalone.jade') + ) }]) .controller('DeviceControlCtrl', require('./device-control-controller')) .directive('deviceControlKey', require('./device-control-key-directive')) diff --git a/res/app/layout/stf-styles.css b/res/app/layout/stf-styles.css index 59046f0c..87fc487e 100644 --- a/res/app/layout/stf-styles.css +++ b/res/app/layout/stf-styles.css @@ -251,6 +251,10 @@ svg { height: 100%; } +.fill-width { + width: 100%; +} + .fill-auto { height: auto; } diff --git a/res/app/views/index.jade b/res/app/views/index.jade index c94c3a21..6cc91a9f 100644 --- a/res/app/views/index.jade +++ b/res/app/views/index.jade @@ -13,10 +13,12 @@ html(ng-app='app') title(ng-bind='pageTitle ? "STF - " + pageTitle : "STF"') STF body(ng-cloak).bg-1.fill-height.unselectable - div(ng-controller='LayoutCtrl', basic-mode, admin-mode, landscape).fill-height - .pane-top(fa-pane).fill-height - .pane-top-bar(fa-pane, pane-id='menu', pane-anchor='north', pane-size='44px', - pane-min='44px', pane-max='44px', pane-handle='') + div(ng-controller='LayoutCtrl', basic-mode, admin-mode, standalone, landscape).fill-height + .pane-top.fill-height(fa-pane) + .pane-top-bar(fa-pane, pane-id='menu', pane-anchor='north', + pane-size='{{!$root.basicMode && !$root.standalone ? 44 : 0 }}px', + + pane-handle='') div(ng-include='"menu.jade"') .pane-center(fa-pane, pane-id='main', pane-anchor='center').fill-height