@ardimedia/angular-portal-azure 0.2.7 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apn.d.ts +4 -1
- package/apn.js +60 -22
- package/directives/blade/blade.ts +20 -13
- package/package.json +1 -1
package/apn.d.ts
CHANGED
|
@@ -47,6 +47,7 @@ declare namespace angularportalazure {
|
|
|
47
47
|
constructor(portalService: angularportalazure.PortalService, path: string, title: string, subtitle?: string, width?: number);
|
|
48
48
|
listener1: Function;
|
|
49
49
|
path: string;
|
|
50
|
+
private _path;
|
|
50
51
|
title: string;
|
|
51
52
|
subTitle: string;
|
|
52
53
|
width: {
|
|
@@ -123,6 +124,7 @@ declare namespace angularportalazure {
|
|
|
123
124
|
onActivate(): void;
|
|
124
125
|
navigateTo(arg: any): void;
|
|
125
126
|
onNavigateTo(arg: any): void;
|
|
127
|
+
comparePaths(path1: string, path2: string): boolean;
|
|
126
128
|
/** close blade. */
|
|
127
129
|
close(): void;
|
|
128
130
|
onCommandBrowse(): void;
|
|
@@ -203,17 +205,18 @@ declare namespace angularportalazure {
|
|
|
203
205
|
}
|
|
204
206
|
declare namespace angularportalazure {
|
|
205
207
|
class Tile {
|
|
208
|
+
constructor(title: string, bladePath: string, portalService: angularportalazure.PortalService);
|
|
206
209
|
portalService: angularportalazure.PortalService;
|
|
207
210
|
title: string;
|
|
208
211
|
subTitle: string;
|
|
209
212
|
bladePath: string;
|
|
213
|
+
private _bladePath;
|
|
210
214
|
tileSize: angularportalazure.TileSizes;
|
|
211
215
|
size: string;
|
|
212
216
|
left: string;
|
|
213
217
|
top: string;
|
|
214
218
|
leftN: string;
|
|
215
219
|
topN: string;
|
|
216
|
-
constructor(title: string, bladePath: string, portalService: angularportalazure.PortalService);
|
|
217
220
|
clicked(): void;
|
|
218
221
|
}
|
|
219
222
|
}
|
package/apn.js
CHANGED
|
@@ -170,6 +170,7 @@ var angularportalazure;
|
|
|
170
170
|
if (subtitle === void 0) { subtitle = ''; }
|
|
171
171
|
if (width === void 0) { width = 200; }
|
|
172
172
|
_super.call(this, portalService);
|
|
173
|
+
//#endregion
|
|
173
174
|
this.title = '';
|
|
174
175
|
this.subTitle = '';
|
|
175
176
|
this.width = { 'width': '0' };
|
|
@@ -239,7 +240,7 @@ var angularportalazure;
|
|
|
239
240
|
angularportalazure.Debug.write('[angularportalazure-debug] \'Blade\' constructor called.', [this, portalService, path, title, subtitle, width]);
|
|
240
241
|
var that = this;
|
|
241
242
|
this.blade = this;
|
|
242
|
-
this.path = path
|
|
243
|
+
this.path = path;
|
|
243
244
|
this.title = title;
|
|
244
245
|
this.subTitle = subtitle;
|
|
245
246
|
this.width.width = width + 'px';
|
|
@@ -272,13 +273,24 @@ var angularportalazure;
|
|
|
272
273
|
// Register listener1
|
|
273
274
|
this.listener1 = that.portalService.$rootScope.$on('BladeArea.AddBlade', function (event, args) {
|
|
274
275
|
angularportalazure.Debug.write('[angularportalazure-debug] \'Blade\' BladeArea.AddBlade event processing.', [this, event, args]);
|
|
275
|
-
|
|
276
|
-
if (args.path.toLowerCase() === that.blade.path) {
|
|
276
|
+
if (that.blade.comparePaths(args.path, that.blade.path)) {
|
|
277
277
|
that.activate();
|
|
278
278
|
}
|
|
279
279
|
});
|
|
280
280
|
//#endregion
|
|
281
281
|
}
|
|
282
|
+
Object.defineProperty(Blade.prototype, "path", {
|
|
283
|
+
//#region path
|
|
284
|
+
get: function () {
|
|
285
|
+
return this._path;
|
|
286
|
+
},
|
|
287
|
+
// For the moment we do not distinguish between lower and upper case path name
|
|
288
|
+
set: function (newPath) {
|
|
289
|
+
this._path = newPath.toLowerCase();
|
|
290
|
+
},
|
|
291
|
+
enumerable: true,
|
|
292
|
+
configurable: true
|
|
293
|
+
});
|
|
282
294
|
//#endregion
|
|
283
295
|
//#endregion
|
|
284
296
|
//#region Methods
|
|
@@ -297,6 +309,15 @@ var angularportalazure;
|
|
|
297
309
|
Blade.prototype.onNavigateTo = function (arg) {
|
|
298
310
|
throw new Error('[angularportalazure.Blade] \'onNavigateTo\' is an abstract function. Define one in the derived class.');
|
|
299
311
|
};
|
|
312
|
+
// At the moment we do not distinguish between lower and upper case path name
|
|
313
|
+
Blade.prototype.comparePaths = function (path1, path2) {
|
|
314
|
+
if (path1.toLowerCase() === path2.toLowerCase()) {
|
|
315
|
+
return true;
|
|
316
|
+
}
|
|
317
|
+
else {
|
|
318
|
+
return false;
|
|
319
|
+
}
|
|
320
|
+
};
|
|
300
321
|
/** close blade. */
|
|
301
322
|
Blade.prototype.close = function () {
|
|
302
323
|
angularportalazure.Debug.write('[angularportalazure-debug] \'Blade.close\' called.', [this]);
|
|
@@ -465,7 +486,7 @@ var angularportalazure;
|
|
|
465
486
|
//#region Make sure the blade is not yet show
|
|
466
487
|
this.blades.forEach(function (blade) {
|
|
467
488
|
// we do not distinguish between lower and upper case path name
|
|
468
|
-
if (blade.path
|
|
489
|
+
if (blade.comparePaths(blade.path, path)) {
|
|
469
490
|
throw new Error('[angularportalazure.BladeArea] path: \'' + path + '\' will not be added. It is already added.');
|
|
470
491
|
}
|
|
471
492
|
;
|
|
@@ -502,7 +523,7 @@ var angularportalazure;
|
|
|
502
523
|
// we do not distinguish between lower and upper case path name
|
|
503
524
|
path = path.toLowerCase();
|
|
504
525
|
var isremoved = that.blades.some(function (blade, index) {
|
|
505
|
-
if (blade.path
|
|
526
|
+
if (blade.comparePaths(blade.path, path)) {
|
|
506
527
|
angularportalazure.Debug.write('[angularportalazure-debug] \'BladeArea.clearPath\' set bladeUrls.length to: ' + index);
|
|
507
528
|
that.blades.length = index;
|
|
508
529
|
return true;
|
|
@@ -539,7 +560,7 @@ var angularportalazure;
|
|
|
539
560
|
}
|
|
540
561
|
var isremoved = that.blades.some(function (blade, index) {
|
|
541
562
|
// we do not distinguish between lower and upper case path name
|
|
542
|
-
if (blade.path
|
|
563
|
+
if (blade.comparePaths(blade.path, path)) {
|
|
543
564
|
angularportalazure.Debug.write('[angularportalazure-debug] \'BladeArea.clearChild\' set bladeUrls.length to: ' + (index + 1));
|
|
544
565
|
that.blades.length = index + 1;
|
|
545
566
|
return true;
|
|
@@ -670,7 +691,6 @@ var angularportalazure;
|
|
|
670
691
|
var angularportalazure;
|
|
671
692
|
(function (angularportalazure) {
|
|
672
693
|
var Tile = (function () {
|
|
673
|
-
//#endregion
|
|
674
694
|
//#region Constructors
|
|
675
695
|
function Tile(title, bladePath, portalService) {
|
|
676
696
|
angularportalazure.Debug.write('[angularportalazure-debug] \'Tile\' constructor called.', [this, title, bladePath, portalService]);
|
|
@@ -679,6 +699,18 @@ var angularportalazure;
|
|
|
679
699
|
this.bladePath = bladePath;
|
|
680
700
|
this.tileSize = angularportalazure.TileSizes.normal;
|
|
681
701
|
}
|
|
702
|
+
Object.defineProperty(Tile.prototype, "bladePath", {
|
|
703
|
+
//#region bladePath
|
|
704
|
+
get: function () {
|
|
705
|
+
return this._bladePath;
|
|
706
|
+
},
|
|
707
|
+
// For the moment we do not distinguish between lower and upper case path name
|
|
708
|
+
set: function (newBladePath) {
|
|
709
|
+
this._bladePath = newBladePath.toLowerCase();
|
|
710
|
+
},
|
|
711
|
+
enumerable: true,
|
|
712
|
+
configurable: true
|
|
713
|
+
});
|
|
682
714
|
//#endregion
|
|
683
715
|
//#region Methods
|
|
684
716
|
Tile.prototype.clicked = function () {
|
|
@@ -866,23 +898,29 @@ var angularportalazure;
|
|
|
866
898
|
(function (angularportalazure) {
|
|
867
899
|
function azurePortalBlade($window, portalService) {
|
|
868
900
|
return {
|
|
869
|
-
transclude: true,
|
|
870
|
-
scope: { vm: '=vm' },
|
|
871
901
|
restrict: 'E',
|
|
902
|
+
transclude: true,
|
|
903
|
+
scope: {},
|
|
904
|
+
bindToController: { vm: '=' },
|
|
872
905
|
templateUrl: '/node_modules/@ardimedia/angular-portal-azure/directives/blade/blade.html',
|
|
873
|
-
link: function (scope, element, attrs, controller) {
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
906
|
+
//link: function (scope, element, attrs, controller) {
|
|
907
|
+
// angularportalazure.Debug.write('[angularportalazure-debug] \'directive:azurePortalBlade.link\' called.', [this, portalService]);
|
|
908
|
+
// //#region the following code makes sure, that a function scope.vm.close is available
|
|
909
|
+
// if (scope.vm === undefined) { scope.vm = {}; }
|
|
910
|
+
// if (scope.vm.close === undefined) {
|
|
911
|
+
// scope.vm.close = function () {
|
|
912
|
+
// angularportalazure.Debug.write('[angularportalazure-debug] \'directive:azurePortalBlade.close\' called.', [this, portalService]);
|
|
913
|
+
// portalService.bladeArea.clearLastLevel();
|
|
914
|
+
// }
|
|
915
|
+
// }
|
|
916
|
+
// //#endregion
|
|
917
|
+
//},
|
|
918
|
+
controller: function () {
|
|
919
|
+
var _this = this;
|
|
920
|
+
this.vm.close = function () {
|
|
921
|
+
angularportalazure.Debug.write('[angularportalazure-debug] \'directive:azurePortalBlade.close\' called.', [_this, portalService]);
|
|
922
|
+
portalService.bladeArea.clearLastLevel();
|
|
923
|
+
};
|
|
886
924
|
}
|
|
887
925
|
};
|
|
888
926
|
}
|
|
@@ -5,24 +5,31 @@
|
|
|
5
5
|
namespace angularportalazure {
|
|
6
6
|
function azurePortalBlade($window: ng.IWindowService, portalService: angularportalazure.PortalService) {
|
|
7
7
|
return {
|
|
8
|
-
transclude: true,
|
|
9
|
-
scope: { vm: '=vm' },
|
|
10
8
|
restrict: 'E',
|
|
9
|
+
transclude: true,
|
|
10
|
+
scope: {}, //scope: { vm: '=vm' },
|
|
11
|
+
bindToController: { vm: '=' },
|
|
11
12
|
templateUrl: '/node_modules/@ardimedia/angular-portal-azure/directives/blade/blade.html',
|
|
12
|
-
link: function (scope, element, attrs, controller) {
|
|
13
|
-
|
|
13
|
+
//link: function (scope, element, attrs, controller) {
|
|
14
|
+
// angularportalazure.Debug.write('[angularportalazure-debug] \'directive:azurePortalBlade.link\' called.', [this, portalService]);
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
// //#region the following code makes sure, that a function scope.vm.close is available
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
// if (scope.vm === undefined) { scope.vm = {}; }
|
|
19
|
+
// if (scope.vm.close === undefined) {
|
|
20
|
+
// scope.vm.close = function () {
|
|
21
|
+
// angularportalazure.Debug.write('[angularportalazure-debug] \'directive:azurePortalBlade.close\' called.', [this, portalService]);
|
|
22
|
+
// portalService.bladeArea.clearLastLevel();
|
|
23
|
+
// }
|
|
24
|
+
// }
|
|
24
25
|
|
|
25
|
-
|
|
26
|
+
// //#endregion
|
|
27
|
+
//},
|
|
28
|
+
controller: function () {
|
|
29
|
+
this.vm.close = () => {
|
|
30
|
+
angularportalazure.Debug.write('[angularportalazure-debug] \'directive:azurePortalBlade.close\' called.', [this, portalService]);
|
|
31
|
+
portalService.bladeArea.clearLastLevel();
|
|
32
|
+
};
|
|
26
33
|
}
|
|
27
34
|
};
|
|
28
35
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@ardimedia/angular-portal-azure",
|
|
3
3
|
"description": "Angular Portal Azure - GUI Framework.",
|
|
4
4
|
"author": "Ardimedia Anstalt <info@ardimedia.com> (http://www.ardimedia.com)",
|
|
5
|
-
"version": "0.2.
|
|
5
|
+
"version": "0.2.9",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"typings": "apn.d.ts",
|
|
8
8
|
"dependencies": {
|