Skip to content

Commit

Permalink
Merge branch 'drivesoftware-framework-upgrade-fixes'
Browse files Browse the repository at this point in the history
  • Loading branch information
plwalters committed Aug 24, 2015
2 parents 018f4dd + ad6ad07 commit d94c22b
Show file tree
Hide file tree
Showing 32 changed files with 347 additions and 340 deletions.
3 changes: 3 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "./node_modules/aurelia-tools/.eslintrc"
}
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aurelia-dialog",
"version": "0.1.0",
"version": "0.1.1",
"description": "A dialog plugin for Aurelia.",
"keywords": [
"aurelia",
Expand Down
8 changes: 4 additions & 4 deletions build/tasks/lint.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
var gulp = require('gulp');
var paths = require('../paths');
var jshint = require('gulp-jshint');
var stylish = require('jshint-stylish');
var eslint = require('gulp-eslint');

gulp.task('lint', function() {
return gulp.src(paths.source)
.pipe(jshint())
.pipe(jshint.reporter(stylish));
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failOnError());
});
100 changes: 51 additions & 49 deletions config.js
Original file line number Diff line number Diff line change
@@ -1,84 +1,86 @@
System.config({
"baseURL": "/",
"transpiler": "babel",
"babelOptions": {
baseURL: "/",
defaultJSExtensions: true,
transpiler: "babel",
babelOptions: {
"optional": [
"es7.classProperties",
"es7.decorators",
"runtime"
]
},
"paths": {
"*": "*.js",
"github:*": "jspm_packages/github/*.js",
"npm:*": "jspm_packages/npm/*.js",
"dialog/*": "dist/commonjs/*.js"
}
});
paths: {
"github:*": "jspm_packages/github/*",
"npm:*": "jspm_packages/npm/*",
"dialog/*": "dist/commonjs/*"
},

System.config({
"map": {
"aurelia-dependency-injection": "github:aurelia/[email protected]",
"aurelia-framework": "github:aurelia/[email protected]",
"aurelia-metadata": "github:aurelia/[email protected]",
"aurelia-templating": "github:aurelia/[email protected]",
"babel": "npm:[email protected]",
"babel-runtime": "npm:[email protected]",
"core-js": "npm:[email protected]",
"github:aurelia/[email protected]": {
"aurelia-dependency-injection": "github:aurelia/[email protected]",
"aurelia-metadata": "github:aurelia/[email protected]",
"aurelia-task-queue": "github:aurelia/[email protected]",
map: {
"aurelia-dependency-injection": "github:aurelia/[email protected]",
"aurelia-framework": "github:aurelia/[email protected]",
"aurelia-metadata": "github:aurelia/[email protected]",
"aurelia-templating": "github:aurelia/[email protected]",
"babel": "npm:[email protected]",
"babel-runtime": "npm:[email protected]",
"core-js": "npm:[email protected]",
"github:aurelia/[email protected]": {
"aurelia-dependency-injection": "github:aurelia/[email protected]",
"aurelia-metadata": "github:aurelia/[email protected]",
"aurelia-task-queue": "github:aurelia/[email protected]",
"core-js": "npm:[email protected]"
},
"github:aurelia/[email protected].0": {
"aurelia-logging": "github:aurelia/[email protected].1",
"aurelia-metadata": "github:aurelia/[email protected].0",
"github:aurelia/[email protected].2": {
"aurelia-logging": "github:aurelia/[email protected].4",
"aurelia-metadata": "github:aurelia/[email protected].3",
"core-js": "npm:[email protected]"
},
"github:aurelia/framework@0.13.3": {
"aurelia-binding": "github:aurelia/[email protected].2",
"aurelia-dependency-injection": "github:aurelia/[email protected].0",
"aurelia-loader": "github:aurelia/[email protected].2",
"aurelia-logging": "github:aurelia/[email protected].1",
"aurelia-metadata": "github:aurelia/[email protected].0",
"aurelia-path": "github:aurelia/[email protected].0",
"aurelia-task-queue": "github:aurelia/[email protected].0",
"aurelia-templating": "github:aurelia/templating@0.13.11",
"github:aurelia/framework@0.15.0": {
"aurelia-binding": "github:aurelia/[email protected].6",
"aurelia-dependency-injection": "github:aurelia/[email protected].2",
"aurelia-loader": "github:aurelia/[email protected].7",
"aurelia-logging": "github:aurelia/[email protected].4",
"aurelia-metadata": "github:aurelia/[email protected].3",
"aurelia-path": "github:aurelia/[email protected].1",
"aurelia-task-queue": "github:aurelia/[email protected].2",
"aurelia-templating": "github:aurelia/templating@0.14.4",
"core-js": "npm:[email protected]"
},
"github:aurelia/[email protected].2": {
"github:aurelia/[email protected].7": {
"aurelia-html-template-element": "github:aurelia/[email protected]",
"aurelia-metadata": "github:aurelia/[email protected].0",
"aurelia-path": "github:aurelia/[email protected].0",
"aurelia-metadata": "github:aurelia/[email protected].3",
"aurelia-path": "github:aurelia/[email protected].1",
"core-js": "npm:[email protected]",
"webcomponentsjs": "github:webcomponents/[email protected]"
},
"github:aurelia/[email protected].0": {
"github:aurelia/[email protected].3": {
"core-js": "npm:[email protected]"
},
"github:aurelia/templating@0.13.11": {
"aurelia-binding": "github:aurelia/[email protected].2",
"aurelia-dependency-injection": "github:aurelia/[email protected].0",
"github:aurelia/templating@0.14.4": {
"aurelia-binding": "github:aurelia/[email protected].6",
"aurelia-dependency-injection": "github:aurelia/[email protected].2",
"aurelia-html-template-element": "github:aurelia/[email protected]",
"aurelia-loader": "github:aurelia/[email protected].2",
"aurelia-logging": "github:aurelia/[email protected].1",
"aurelia-metadata": "github:aurelia/[email protected].0",
"aurelia-path": "github:aurelia/[email protected].0",
"aurelia-task-queue": "github:aurelia/[email protected].0",
"aurelia-loader": "github:aurelia/[email protected].7",
"aurelia-logging": "github:aurelia/[email protected].4",
"aurelia-metadata": "github:aurelia/[email protected].3",
"aurelia-path": "github:aurelia/[email protected].1",
"aurelia-task-queue": "github:aurelia/[email protected].2",
"core-js": "npm:[email protected]"
},
"github:jspm/[email protected]": {
"process": "npm:[email protected]"
},
"npm:babel-runtime@5.7.0": {
"npm:babel-runtime@5.8.20": {
"process": "github:jspm/[email protected]"
},
"npm:[email protected]": {
"fs": "github:jspm/[email protected]",
"process": "github:jspm/[email protected]",
"systemjs-json": "github:systemjs/[email protected]"
},
"npm:[email protected]": {
"fs": "github:jspm/[email protected]",
"process": "github:jspm/[email protected]",
"systemjs-json": "github:systemjs/[email protected]"
}
}
});

43 changes: 21 additions & 22 deletions dist/amd/dialog-renderer.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
define(["exports", "aurelia-templating"], function (exports, _aureliaTemplating) {
"use strict";
define(['exports', 'aurelia-templating'], function (exports, _aureliaTemplating) {
'use strict';

exports.__esModule = true;

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }

var currentZIndex = 1000;
var transitionEvent = (function () {
var t,
el = document.createElement("fakeelement");
var t = undefined;
var el = document.createElement('fakeelement');

var transitions = {
"transition": "transitionend",
"OTransition": "oTransitionEnd",
"MozTransition": "transitionend",
"WebkitTransition": "webkitTransitionEnd"
'transition': 'transitionend',
'OTransition': 'oTransitionEnd',
'MozTransition': 'transitionend',
'WebkitTransition': 'webkitTransitionEnd'
};

for (t in transitions) {
Expand Down Expand Up @@ -43,9 +43,9 @@ define(["exports", "aurelia-templating"], function (exports, _aureliaTemplating)

document.addEventListener('keyup', function (e) {
if (e.keyCode === 27) {
var top = _this.dialogControllers[_this.dialogControllers.length - 1];
if (top && top.settings.lock !== true) {
top.cancel();
var _top = _this.dialogControllers[_this.dialogControllers.length - 1];
if (_top && _top.settings.lock !== true) {
_top.cancel();
}
}
});
Expand All @@ -54,10 +54,9 @@ define(["exports", "aurelia-templating"], function (exports, _aureliaTemplating)
DialogRenderer.prototype.createDialogHost = function createDialogHost(controller) {
var _this2 = this;

var settings = controller.settings,
emptyParameters = {},
modalOverlay = document.createElement('dialog-overlay'),
modalContainer = document.createElement('dialog-container');
var settings = controller.settings;
var modalOverlay = document.createElement('dialog-overlay');
var modalContainer = document.createElement('dialog-container');

modalOverlay.style.zIndex = getNextZIndex();
modalContainer.style.zIndex = getNextZIndex();
Expand All @@ -82,13 +81,13 @@ define(["exports", "aurelia-templating"], function (exports, _aureliaTemplating)
}
};

return new Promise(function (resolve, reject) {
return new Promise(function (resolve) {
modalContainer.addEventListener(transitionEvent, onTransitionEnd);

function onTransitionEnd(event) {
function onTransitionEnd() {
modalContainer.removeEventListener(transitionEvent, onTransitionEnd);
resolve();
};
}

modalOverlay.classList.add('active');
modalContainer.classList.add('active');
Expand All @@ -101,13 +100,13 @@ define(["exports", "aurelia-templating"], function (exports, _aureliaTemplating)
_this2.dialogControllers.splice(i, 1);
}

return new Promise(function (resolve, reject) {
return new Promise(function (resolve) {
modalContainer.addEventListener(transitionEvent, onTransitionEnd);

function onTransitionEnd(event) {
function onTransitionEnd() {
modalContainer.removeEventListener(transitionEvent, onTransitionEnd);
resolve();
};
}

modalOverlay.classList.remove('active');
modalContainer.classList.remove('active');
Expand Down
24 changes: 12 additions & 12 deletions dist/amd/dialog-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,34 +29,34 @@ define(['exports', 'aurelia-metadata', 'aurelia-dependency-injection', 'aurelia-

if (typeof instruction.viewModel === 'string') {
return this.compositionEngine.createViewModel(instruction);
} else {
return Promise.resolve(instruction);
}

return Promise.resolve(instruction);
};

DialogService.prototype.open = function open(settings) {
var _this = this;

settings = Object.assign({}, this.renderer.defaultSettings, settings);
var _settings = Object.assign({}, this.renderer.defaultSettings, settings);

return new Promise(function (resolve, reject) {
var childContainer = _this.container.createChild(),
controller = new _dialogController.DialogController(_this.renderer, settings, resolve, reject),
instruction = {
viewModel: settings.viewModel,
var childContainer = _this.container.createChild();
var controller = new _dialogController.DialogController(_this.renderer, _settings, resolve, reject);
var instruction = {
viewModel: _settings.viewModel,
container: _this.container,
childContainer: childContainer,
model: settings.model
model: _settings.model
};

childContainer.registerInstance(_dialogController.DialogController, controller);

return _this._getViewModel(instruction).then(function (instruction) {
controller.viewModel = instruction.viewModel;
return _this._getViewModel(instruction).then(function (returnedInstruction) {
controller.viewModel = returnedInstruction.viewModel;

return _lifecycle.invokeLifecycle(instruction.viewModel, 'canActivate', settings.model).then(function (canActivate) {
return _lifecycle.invokeLifecycle(returnedInstruction.viewModel, 'canActivate', _settings.model).then(function (canActivate) {
if (canActivate) {
return _this.compositionEngine.createBehavior(instruction).then(function (behavior) {
return _this.compositionEngine.createBehavior(returnedInstruction).then(function (behavior) {
controller.behavior = behavior;
controller.view = behavior.view;
behavior.view.bind(behavior.executionContext);
Expand Down
41 changes: 20 additions & 21 deletions dist/commonjs/dialog-renderer.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
"use strict";
'use strict';

exports.__esModule = true;

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }

var _aureliaTemplating = require('aurelia-templating');

var currentZIndex = 1000;
var transitionEvent = (function () {
var t,
el = document.createElement("fakeelement");
var t = undefined;
var el = document.createElement('fakeelement');

var transitions = {
"transition": "transitionend",
"OTransition": "oTransitionEnd",
"MozTransition": "transitionend",
"WebkitTransition": "webkitTransitionEnd"
'transition': 'transitionend',
'OTransition': 'oTransitionEnd',
'MozTransition': 'transitionend',
'WebkitTransition': 'webkitTransitionEnd'
};

for (t in transitions) {
Expand Down Expand Up @@ -44,9 +44,9 @@ var DialogRenderer = (function () {

document.addEventListener('keyup', function (e) {
if (e.keyCode === 27) {
var top = _this.dialogControllers[_this.dialogControllers.length - 1];
if (top && top.settings.lock !== true) {
top.cancel();
var _top = _this.dialogControllers[_this.dialogControllers.length - 1];
if (_top && _top.settings.lock !== true) {
_top.cancel();
}
}
});
Expand All @@ -55,10 +55,9 @@ var DialogRenderer = (function () {
DialogRenderer.prototype.createDialogHost = function createDialogHost(controller) {
var _this2 = this;

var settings = controller.settings,
emptyParameters = {},
modalOverlay = document.createElement('dialog-overlay'),
modalContainer = document.createElement('dialog-container');
var settings = controller.settings;
var modalOverlay = document.createElement('dialog-overlay');
var modalContainer = document.createElement('dialog-container');

modalOverlay.style.zIndex = getNextZIndex();
modalContainer.style.zIndex = getNextZIndex();
Expand All @@ -83,13 +82,13 @@ var DialogRenderer = (function () {
}
};

return new Promise(function (resolve, reject) {
return new Promise(function (resolve) {
modalContainer.addEventListener(transitionEvent, onTransitionEnd);

function onTransitionEnd(event) {
function onTransitionEnd() {
modalContainer.removeEventListener(transitionEvent, onTransitionEnd);
resolve();
};
}

modalOverlay.classList.add('active');
modalContainer.classList.add('active');
Expand All @@ -102,13 +101,13 @@ var DialogRenderer = (function () {
_this2.dialogControllers.splice(i, 1);
}

return new Promise(function (resolve, reject) {
return new Promise(function (resolve) {
modalContainer.addEventListener(transitionEvent, onTransitionEnd);

function onTransitionEnd(event) {
function onTransitionEnd() {
modalContainer.removeEventListener(transitionEvent, onTransitionEnd);
resolve();
};
}

modalOverlay.classList.remove('active');
modalContainer.classList.remove('active');
Expand Down
Loading

0 comments on commit d94c22b

Please sign in to comment.