Skip to content

Commit

Permalink
Merge pull request #611 from ScottLogic/dev
Browse files Browse the repository at this point in the history
Release 10.0.0-rc.0
  • Loading branch information
WPFerg committed Mar 14, 2016
2 parents 5a8bc4f + d730a64 commit 4e42077
Show file tree
Hide file tree
Showing 43 changed files with 623 additions and 153 deletions.
15 changes: 7 additions & 8 deletions gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ module.exports = function(grunt) {
parent: {
src: ['src/parentApp.js', 'src/parent-controller.js', 'src/store-service.js',
'src/window-service.js', 'src/sidebars/favourites/geometry-service.js',
'src/config-service.js'],
'src/config-service.js', 'src/version-value.js'],
dest: 'public/app-parent.js'
}
},
Expand All @@ -203,14 +203,13 @@ module.exports = function(grunt) {
},
bump: {
options: {
files: ['package.json', 'src/main/version/version-controller.js'],
files: ['package.json', 'src/version-value.js'],
commit: true,
commitMessage: 'Release v%VERSION%',
commitFiles: ['package.json', 'src/main/version/version-controller.js'],
createTag: true,
tagName: 'v%VERSION%',
tagMessage: 'Version %VERSION%',
push: false
commitMessage: 'Release %VERSION%',
commitFiles: ['package.json', 'src/version-value.js'],
createTag: false,
push: false,
prereleaseName: 'rc'
}
},

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bitflux-openfin",
"version": "9.2.0",
"version": "10.0.0-rc.0",
"scripts": {
"test": "grunt ci",
"postinstall": "cd node_modules/BitFlux && npm i"
Expand Down
Binary file modified src/assets/png/closed_tabs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/assets/png/closed_tabs_active.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/assets/png/drag_handle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 7 additions & 4 deletions src/assets/styles/custom-scroll.less
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
.side-scroll {
top: 52px;
bottom: 0;
.compact .side-scroll {
position: fixed;
}

.side-scroll {
padding-bottom: 30px;
padding-bottom: 0px;

Expand All @@ -12,7 +13,9 @@
}

&#favourite-scroll {
bottom: 40px;
top: @toolbar-height;
bottom: @bottom-tab-height;
position: absolute;
}
}

Expand Down
18 changes: 17 additions & 1 deletion src/assets/styles/mixins.less
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@
top: (7px + @additional-offset);
}

.transition(@duration: 0.2s, @delay: 0.1s) {
transition: all @duration linear @delay;
}

.drag {
-webkit-app-region: drag;
}

.no-drag {
-webkit-app-region: no-drag;
}

// 400 is 'normal'
.font(@size, @weight: 400, @line-height: 1.5) {
font-size: @size;
Expand Down Expand Up @@ -41,8 +53,12 @@
right: @right;
}

.box-shadow(@shadow-position, @colour) {
box-shadow: @shadow-position 2px 0px @colour;
}

.closed-window(@shadow-position, @top: auto, @bottom: auto, @left: auto, @right: auto) {
box-shadow: @shadow-position 2px 0px @dark-background;
.box-shadow(@shadow-position, @dark-background);
background: @light-background;
position: fixed;
width: 180px;
Expand Down
13 changes: 13 additions & 0 deletions src/assets/styles/style.less
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
// Compact styles
@import "../../main/main-compact.less";
@import "../../toolbar/toolbar-compact.less";
@import "../../sidebars/favourites/favourite-compact.less";
@import "../../sidebars/sidebar-compact.less";
@import "../../sidebars/search/search-compact.less";
@import "../../closedWindows/closedWindowList/closedWindowList-compact.less";
Expand All @@ -45,6 +46,18 @@ body {
right: -2px;
}

.disable-transitions {
* {
transition: none !important;
}
}

.disable-pointer {
* {
pointer-events: none;
}
}

#showcase-title {
color: @chart-teal;
position: absolute;
Expand Down
3 changes: 0 additions & 3 deletions src/assets/styles/variables.less
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
@search-background: @light-background;
@favourites-background: @middle-background;

// Transition
@transition: all 0.2s linear 0.1s;

// Dimensions
@sidebar-width: 280px;
@expanded-width: 230px;
Expand Down
49 changes: 47 additions & 2 deletions src/closedWindows/closedWindowList/closedWindowList-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,66 @@
'use strict';

class ClosedWindowListCtrl {
constructor() {
constructor($scope, $timeout) {
this.$scope = $scope;
this.$timeout = $timeout;
this.closedWindows = [];
this.closedTabsShow = false;
this.overriddenIcon = '';

this._watch();
}

override() {
return this.overriddenIcon;
}

refreshClosedWindows() {
this.closedWindows = window.storeService.getPreviousClosedWindows();
this.updateSeen();
}

updateSeen() {
var seen = window.windowService.getClosedWindowSeen();
this.overriddenIcon = seen ? '' : (this.$scope.icon + '_active');

if (!seen && this.closedTabsShow && document.hasFocus()) {
window.windowService.seenClosedWindows();
}
}

click() {
this.overriddenIcon = '';
this.refreshClosedWindows();
this.closedTabsShow = this.closedWindows.length > 0;

if (window.windowService) {
window.windowService.seenClosedWindows();
}
}

_watch() {
var listener = () => this.$timeout(() => this.refreshClosedWindows());
var addListener = () => {
window.windowService.addClosedWindowListener(listener);
this.refreshClosedWindows();
};

// Can't guarantee that windowService exists, so if it doesn't, watch.
if (window.windowService) {
addListener();
} else {
this.$scope.$watch(() => window.windowService, () => {
addListener();
});
}

this.$scope.$on('$destroy', () => {
window.windowService.removeClosedWindowListener(listener);
});
}
}
ClosedWindowListCtrl.$inject = [];
ClosedWindowListCtrl.$inject = ['$scope', '$timeout'];

angular.module('stockflux.closedWindows')
.controller('ClosedWindowListCtrl', ClosedWindowListCtrl);
Expand Down
12 changes: 12 additions & 0 deletions src/closedWindows/closedWindowList/closedWindowList-directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@
controllerAs: 'closedWindowListCtrl',
scope: {
icon: '='
},
link: (scope, element) => {
let onFocus = () => {
if (scope.closedWindowListCtrl.closedTabsShow) {
window.windowService.seenClosedWindows();
}
};
window.addEventListener('focus', onFocus);

scope.$on('$destroy', () => {
window.removeEventListener('focus', onFocus);
});
}
};
}]);
Expand Down
20 changes: 11 additions & 9 deletions src/closedWindows/closedWindowList/closedWindowList.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<div class="favourite-closed">
<icon name="{{icon}}" icon-click="closedWindowListCtrl.click(); $event.stopPropagation();" tooltip="Last Closed Windows"></icon>
</div>
<div ng-show="closedWindowListCtrl.closedTabsShow" class="favourite-closed-cover" ng-click="closedWindowListCtrl.closedTabsShow = false">
<div class="bubble-head"></div>
<div class="closed-selection">
<div class="closed-card-container"
ng-repeat="closedWindow in closedWindowListCtrl.closedWindows | orderBy:'-closed'">
<closed-card card-window="closedWindow"></closed-card>
<div ng-if="closedWindowListCtrl.closedWindows.length !== 0">
<div class="favourite-closed">
<icon name="{{icon}}" override="{{closedWindowListCtrl.override()}}" icon-click="closedWindowListCtrl.click(); $event.stopPropagation();" tooltip="Last Closed Windows"></icon>
</div>
<div ng-show="closedWindowListCtrl.closedTabsShow" class="favourite-closed-cover" ng-click="closedWindowListCtrl.closedTabsShow = false">
<div class="bubble-head"></div>
<div class="closed-selection">
<div class="closed-card-container"
ng-repeat="closedWindow in closedWindowListCtrl.closedWindows | orderBy:'-closed'">
<closed-card card-window="closedWindow"></closed-card>
</div>
</div>
</div>
</div>
7 changes: 6 additions & 1 deletion src/icon/icon-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@
}

url() {
return this.active ? this.urls.active : this.urls.inactive;
var override = this.$scope.override;
if (override) {
return override;
} else {
return this.active ? this.urls.active : this.urls.inactive;
}
}

click(e) {
Expand Down
3 changes: 2 additions & 1 deletion src/icon/icon-directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
scope: {
name: '@',
iconClick: '&',
tooltip: '@'
tooltip: '@',
override: '@'
},
controller: 'IconCtrl',
controllerAs: 'iconCtrl'
Expand Down
26 changes: 24 additions & 2 deletions src/main/main-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,30 @@
'use strict';

class MainCtrl {
constructor() {
constructor($scope, $timeout) {
this.store = null;
this.$scope = $scope;
this.$timeout = $timeout;

this.tearingOut = false;
this.watch();
}

watch() {
this.$scope.$on('tearoutStart', () => {
this.$timeout(() => {
this.tearingOut = true;
});
});
this.$scope.$on('tearoutEnd', () => {
this.$timeout(() => {
this.tearingOut = false;
});
});
}

disablePointer() {
return this.tearingOut;
}

isCompact() {
Expand All @@ -14,7 +36,7 @@
return this.store && this.store.isCompact();
}
}
MainCtrl.$inject = [];
MainCtrl.$inject = ['$scope', '$timeout'];

angular.module('stockflux.main')
.controller('MainCtrl', MainCtrl);
Expand Down
13 changes: 11 additions & 2 deletions src/main/main-directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,21 @@
'use strict';

angular.module('stockflux.main')
.directive('main', [() => {
.directive('main', ['$timeout', ($timeout) => {
return {
restrict: 'E',
templateUrl: 'main/main.html',
controller: 'MainCtrl',
controllerAs: 'mainCtrl'
controllerAs: 'mainCtrl',
link: (scope, element) => {
scope.$on('compactChanging', () => {
element.addClass('disable-transitions');

$timeout(() => {
element.removeClass('disable-transitions');
}, 100);
});
}
};
}]);
}());
2 changes: 1 addition & 1 deletion src/main/main.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="main" ng-class="{compact: mainCtrl.isCompact()}">
<div class="main" ng-class="{compact: mainCtrl.isCompact(), 'disable-pointer': mainCtrl.disablePointer()}">
<toolbar></toolbar>
<side-bar></side-bar>
<div class="right-content">
Expand Down
11 changes: 3 additions & 8 deletions src/main/version/version-controller.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
(function() {
'use strict';

const VERSION = { version: '9.2.0' };

class VersionCtrl {
constructor(currentWindowService) {
constructor(currentWindowService, version) {
this.currentWindowService = currentWindowService;
}

version() {
return VERSION.version;
this.version = version;
}

openGithub() {
this.currentWindowService.openUrlWithBrowser('https://github.com/ScottLogic/stockflux');
}
}
VersionCtrl.$inject = ['currentWindowService'];
VersionCtrl.$inject = ['currentWindowService', 'Version'];

angular.module('stockflux.version')
.controller('VersionCtrl', VersionCtrl);
Expand Down
2 changes: 1 addition & 1 deletion src/main/version/version.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<a class="version" ng-mouseenter="hoverText = 'GitHub '" ng-mouseleave="hoverText = ''" ng-click="versionCtrl.openGithub()">{{hoverText}}{{versionCtrl.version()}}</a>
<a class="version" ng-click="versionCtrl.openGithub()">GitHub {{versionCtrl.version}}</a>
7 changes: 7 additions & 0 deletions src/parent-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
*/
class ParentCtrl {
constructor($scope, storeService, windowCreationService) {

if (storeService.shouldUpgrade()) {
storeService.upgrade();
// .. Can put other upgrade code here ..
storeService.saveVersion();
}

windowCreationService.ready(() => {
var previousWindows = storeService.getPreviousOpenWindowNames(),
length = previousWindows.length,
Expand Down
3 changes: 2 additions & 1 deletion src/parentApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
]);

angular.module('stockflux.parent', ['stockflux.store', 'stockflux.window']);
angular.module('stockflux.store', []);
angular.module('stockflux.store', ['stockflux.version']);
angular.module('stockflux.version', []);
angular.module('stockflux.currentWindow', []);
angular.module('stockflux.window', ['stockflux.store', 'stockflux.geometry', 'stockflux.config']);
angular.module('stockflux.config', []);
Expand Down
Loading

0 comments on commit 4e42077

Please sign in to comment.