Skip to content

Commit d80f6e3

Browse files
bleathemcdcabrera
authored andcommitted
chore(API docs): Use the window.imagePath global for the base image path in examples if present. (#637)
1 parent 7648876 commit d80f6e3

5 files changed

Lines changed: 21 additions & 17 deletions

File tree

src/canvas-view/examples/canvas.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,16 @@
106106
</file>
107107
108108
<file name="script.js">
109-
angular.module( 'patternfly.canvas.demo' ).controller( 'CanvasDemoCtrl', function( $scope ) {
109+
angular.module( 'patternfly.canvas.demo' ).controller( 'CanvasDemoCtrl', function( $scope, $window ) {
110+
var imagePath = $window.IMAGE_PATH || "img";
110111
$scope.chartDataModel = {
111112
"nodes": [
112113
{
113114
"name": "Nuage",
114115
"x": 345,
115116
"y": 67,
116117
"id": 1,
117-
"image": "/img/OpenShift-logo.svg",
118+
"image": imagePath + "/OpenShift-logo.svg",
118119
"width": 150,
119120
"bundle": true,
120121
"backgroundColor": "#fff",
@@ -139,7 +140,7 @@
139140
"x": 100,
140141
"y": 290,
141142
"id": 2,
142-
"image": "/img/kubernetes.svg",
143+
"image": imagePath + "/kubernetes.svg",
143144
"width": 150,
144145
"backgroundColor": "#fff",
145146
"validConnectionTypes": ["storage"],

src/canvas-view/examples/canvasEditor.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,16 @@
7474
</file>
7575
7676
<file name="script.js">
77-
angular.module( 'patternfly.canvaseditor.demo' ).controller( 'CanvasEditorDemoCtrl', function( $scope, $filter ) {
77+
angular.module( 'patternfly.canvaseditor.demo' ).controller( 'CanvasEditorDemoCtrl', function( $scope, $filter, $window ) {
78+
var imagePath = $window.IMAGE_PATH || "img";
7879
$scope.chartDataModel = {
7980
"nodes": [
8081
{
8182
"name": "Nuage",
8283
"x": 345,
8384
"y": 67,
8485
"id": 1,
85-
"image": "/img/OpenShift-logo.svg",
86+
"image": imagePath + "/OpenShift-logo.svg",
8687
"width": 150,
8788
"bundle": true,
8889
"backgroundColor": "#fff",
@@ -107,7 +108,7 @@
107108
"x": 100,
108109
"y": 290,
109110
"id": 2,
110-
"image": "/img/kubernetes.svg",
111+
"image": imagePath + "/kubernetes.svg",
111112
"width": 150,
112113
"backgroundColor": "#fff",
113114
"validConnectionTypes": ["storage"],
@@ -236,12 +237,12 @@
236237
{
237238
"name": "Nuage",
238239
"id": 10000000000004,
239-
"image": "/img/OpenShift-logo.svg"
240+
"image": imagePath + "/OpenShift-logo.svg"
240241
},
241242
{
242243
"name": "Vmware",
243244
"id": 10000000000010,
244-
"image": "/img/kubernetes.svg"
245+
"image": imagePath + "/kubernetes.svg"
245246
}
246247
]
247248
},

src/card/aggregate-status/aggregate-status-card.component.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@
6868
</file>
6969
7070
<file name="script.js">
71-
angular.module( 'patternfly.card' ).controller( 'CardDemoCtrl', function( $scope ) {
71+
angular.module( 'patternfly.card' ).controller( 'CardDemoCtrl', function( $scope, $window ) {
72+
var imagePath = $window.IMAGE_PATH || "img";
7273
$scope.status = {
7374
"title":"Nodes",
7475
"count":793,
@@ -92,12 +93,12 @@
9293
"count":3,
9394
"notifications":[
9495
{
95-
"iconImage":"img/kubernetes.svg",
96+
"iconImage": imagePath + "/kubernetes.svg",
9697
"count":1,
9798
"href":"#"
9899
},
99100
{
100-
"iconImage":"img/OpenShift-logo.svg",
101+
"iconImage": imagePath + "/OpenShift-logo.svg",
101102
"count":2,
102103
"href":"#"
103104
}

src/card/info-status/info-status-card.component.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
</file>
3737
3838
<file name="script.js">
39-
angular.module( 'patternfly.card' ).controller( 'CardDemoCtrl', function( $scope ) {
39+
angular.module( 'patternfly.card' ).controller( 'CardDemoCtrl', function( $scope, $window ) {
40+
var imagePath = $window.IMAGE_PATH || "img";
4041
$scope.infoStatus = {
4142
"title":"TinyCore-local",
4243
"href":"#",
@@ -50,7 +51,7 @@
5051
};
5152
5253
$scope.infoStatusTitless = {
53-
"iconImage":"img/OpenShift-logo.svg",
54+
"iconImage": imagePath + "/OpenShift-logo.svg",
5455
"info":[
5556
"Infastructure: VMware",
5657
"Vmware: 1 CPU (1 socket x 1 core), 1024 MB",

src/navigation/application-launcher.component.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<nav class="navbar navbar-default navbar-pf" role="navigation">
2828
<div class="navbar-header">
2929
<a class="navbar-brand" href="/">
30-
<img src="img/brand.svg" alt="PatternFly Enterprise Application">
30+
<img src="{{imagePath}}/brand.svg" alt="PatternFly Enterprise Application">
3131
</a>
3232
</div>
3333
<div class="collapse navbar-collapse navbar-collapse-1">
@@ -77,8 +77,9 @@
7777
</div>
7878
</file>
7979
<file name="script.js">
80-
angular.module('patternfly.navigation').controller('applicationLauncherController', ['$scope',
81-
function ($scope) {
80+
angular.module('patternfly.navigation').controller('applicationLauncherController', ['$scope', '$window',
81+
function ($scope, $window) {
82+
$scope.imagePath = $window.IMAGE_PATH || "img";
8283
$scope.navigationItems = [
8384
{
8485
title: "Recteque",
@@ -130,4 +131,3 @@ angular.module('patternfly.navigation').component('pfApplicationLauncher', {
130131
ctrl.$id = $scope.$id;
131132
}
132133
});
133-

0 commit comments

Comments
 (0)