diff --git a/angular-electron.js b/angular-electron.js index fad7081..e05685b 100644 --- a/angular-electron.js +++ b/angular-electron.js @@ -25,7 +25,7 @@ var nodeModules = ['buffer', 'child_process', 'cluster', 'crypto', 'dns', 'event 'string_decoder', 'tls', 'dgram', 'url', 'util', 'v8', 'vm', 'zlib']; angular.module('angular-electron').provider('remote', ['$provide', function($provide) { - var _remote = 'remote' + var _remote = 'remote'; var remote = require(_remote); function register(name, _require) { @@ -70,13 +70,13 @@ angular.module('angular-electron').service('safeShutdown', ['$q', 'currentWindow var actions = []; function register(fn) { - this.actions.push(fn); + actions.push(fn); } function exec() { var promises = []; - angular.forEach(this.actions, function (action) { + angular.forEach(actions, function (action) { var res = action(); if (res !== undefined && res.then !== undefined) { diff --git a/angular-electron.min.js b/angular-electron.min.js index 11dc4c7..432a7b3 100644 --- a/angular-electron.min.js +++ b/angular-electron.min.js @@ -1 +1 @@ -!function(e,n,r){"use strict";e.module("angular-electron",[]),e.module("angular-electron").directive("externalLink",["shell",function(e){return{restrict:"A",link:function(n,r,t){r.on("click",function(n){n.preventDefault(),e.openExternal(t.href||t.externalLink)})}}}]),e.module("angular-electron").constant("process",process);var t=["app","auto-updater","browser-window","content-tracing","dialog","global-shortcut","menu","menu-item","power-save-blocker","protocol","web-contents","tray"],o=["buffer","child_process","cluster","crypto","dns","events","fs","http","https","net","os","path","punycode","querystring","readline","stream","string_decoder","tls","dgram","url","util","v8","vm","zlib"];e.module("angular-electron").provider("remote",["$provide",function(r){function i(e,n){n=n||e,r.service(e,function(){var e=u.require(n);return e})}var c="remote",u=n(c);this.register=i,this.$get=[function(){return u}],r.constant("remoteProcess",u.process),r.constant("currentWindow",u.getCurrentWindow()),e.forEach(t,function(e){i(e.name||e,e.require)}),e.forEach(o,function(e){i(e.name||e,e.require)})}]);var i=["ipc","web-frame","clipboard","crash-reporter","native-image","screen","shell"];e.forEach(i,function(r){e.module("angular-electron").service(r.name||r,[function(){var e=n(r.require||r);return e}])}),e.module("angular-electron").service("safeShutdown",["$q","currentWindow","app",function(n,t,o){function i(e){this.actions.push(e)}function c(){var t=[];return e.forEach(this.actions,function(e){var n=e();n!==r&&n.then!==r&&t.push(n)}),n.all(t)}return t.safeReload=function(){c().then(function(){t.reload()})},o.safeQuit=function(){c().then(function(){o.quit()})},{register:i}}])}(window.angular,window.require); \ No newline at end of file +!function(e,r,n){"use strict";e.module("angular-electron",[]),e.module("angular-electron").directive("externalLink",["shell",function(e){return{restrict:"A",link:function(r,n,t){n.on("click",function(r){r.preventDefault(),e.openExternal(t.href||t.externalLink)})}}}]),e.module("angular-electron").constant("process",process);var t=["app","auto-updater","browser-window","content-tracing","dialog","global-shortcut","menu","menu-item","power-save-blocker","protocol","web-contents","tray"],o=["buffer","child_process","cluster","crypto","dns","events","fs","http","https","net","os","path","punycode","querystring","readline","stream","string_decoder","tls","dgram","url","util","v8","vm","zlib"];e.module("angular-electron").provider("remote",["$provide",function(n){function u(e,r){r=r||e,n.service(e,function(){var e=i.require(r);return e})}var c="remote",i=r(c);this.register=u,this.$get=[function(){return i}],n.constant("remoteProcess",i.process),n.constant("currentWindow",i.getCurrentWindow()),e.forEach(t,function(e){u(e.name||e,e.require)}),e.forEach(o,function(e){u(e.name||e,e.require)})}]);var u=["ipc","web-frame","clipboard","crash-reporter","native-image","screen","shell"];e.forEach(u,function(n){e.module("angular-electron").service(n.name||n,[function(){var e=r(n.require||n);return e}])}),e.module("angular-electron").service("safeShutdown",["$q","currentWindow","app",function(r,t,o){function u(e){i.push(e)}function c(){var t=[];return e.forEach(i,function(e){var r=e();r!==n&&r.then!==n&&t.push(r)}),r.all(t)}var i=[];return t.safeReload=function(){c().then(function(){t.reload()})},o.safeQuit=function(){c().then(function(){o.quit()})},{register:u}}])}(window.angular,window.require); \ No newline at end of file diff --git a/package.json b/package.json index f1a04e3..009a0db 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "angular-electron", - "version": "0.1.7", + "version": "0.1.8", "description": "angularjs helpers for electron apps", "repository": { "type": "git", diff --git a/src/remote.js b/src/remote.js index febb2a0..864d11e 100644 --- a/src/remote.js +++ b/src/remote.js @@ -6,7 +6,7 @@ var nodeModules = ['buffer', 'child_process', 'cluster', 'crypto', 'dns', 'event 'string_decoder', 'tls', 'dgram', 'url', 'util', 'v8', 'vm', 'zlib']; angular.module('angular-electron').provider('remote', ['$provide', function($provide) { - var _remote = 'remote' + var _remote = 'remote'; var remote = require(_remote); function register(name, _require) { diff --git a/src/safeShutdown.js b/src/safeShutdown.js index 15855d4..e054e20 100644 --- a/src/safeShutdown.js +++ b/src/safeShutdown.js @@ -2,13 +2,13 @@ angular.module('angular-electron').service('safeShutdown', ['$q', 'currentWindow var actions = []; function register(fn) { - this.actions.push(fn); + actions.push(fn); } function exec() { var promises = []; - angular.forEach(this.actions, function (action) { + angular.forEach(actions, function (action) { var res = action(); if (res !== undefined && res.then !== undefined) {