Skip to content

Commit 2277dc8

Browse files
Merge pull request #43 from erundle/angular
Upgrade to Angular 1.3 Only
2 parents a91b294 + ee9500a commit 2277dc8

17 files changed

+105
-92
lines changed

Gruntfile.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ module.exports = function (grunt) {
114114
'lib/patternfly/components/bootstrap-treeview/src/js/bootstrap-treeview.js',
115115
'lib/patternfly/components/c3/c3.js',
116116
'lib/patternfly/components/d3/d3.js',
117-
'angular.js',
117+
'lib/angular/angular.js',
118+
'lib/angular-animate/angular-animate.js',
118119
'dist/angular-patternfly.js',
119120
'lib/patternfly/dist/js/patternfly.js'],
120121
html5Mode: false,

bower.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@
3232
"url": "git://github.com/patternfly/angular-patternfly.git"
3333
},
3434
"dependencies": {
35-
"angular": "1.2.25 - 1.3.*"
35+
"angular": "1.3.*"
3636
},
3737
"devDependencies": {
38-
"angular-animate": "1.2.25 - 1.3.*",
39-
"angular-mocks": "1.2.25 - 1.3.*",
40-
"angular-sanitize": "1.2.25 - 1.3.*",
41-
"angular-touch": "1.2.25 - 1.3.*",
42-
"angular-route": "1.2.25 - 1.3.*",
38+
"angular-animate": "1.3.*",
39+
"angular-mocks": "1.3.*",
40+
"angular-sanitize": "1.3.*",
41+
"angular-touch": "1.3.*",
42+
"angular-route": "1.3.*",
4343
"patternfly": "~2.0.0"
4444
}
4545
}

dist/angular-patternfly.js

Lines changed: 45 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ angular.module('patternfly.card').directive('pfCard', function () {
252252
* @param {expression} config the c3 configuration options for the chart
253253
*
254254
* @example
255-
<example module="patternfly.charts">
255+
<example module="patternfly.charts">
256256
<file name="index.html">
257257
<div ng-controller="ChartCtrl">
258258
<div pf-c3-chart id="chartId" config="chartConfig"></div>
@@ -269,7 +269,9 @@ angular.module('patternfly.card').directive('pfCard', function () {
269269
</file>
270270
271271
<file name="script.js">
272-
function ChartCtrl($scope) {
272+
273+
angular.module( 'patternfly.charts' )
274+
.controller( 'ChartCtrl', ['$scope', function( $scope ) {
273275
$scope.used = 950;
274276
$scope.total = 1000;
275277
$scope.available = $scope.total - $scope.used;
@@ -302,7 +304,7 @@ angular.module('patternfly.card').directive('pfCard', function () {
302304
$scope.updateAvailable();
303305
$scope.chartConfig.data.columns = [["Used",$scope.used],["Available",$scope.available]];
304306
};
305-
}
307+
}]);
306308
</file>
307309
</example>
308310
*/
@@ -458,8 +460,8 @@ angular.module('patternfly.card').directive('pfCard', function () {
458460
</file>
459461
460462
<file name="script.js">
461-
function ChartCtrl($scope) {
462-
463+
angular.module( 'patternfly.charts' )
464+
.controller( 'ChartCtrl', ['$scope', function( $scope ) {
463465
$scope.config = {
464466
'chartId': 'chartA',
465467
'units': 'GB',
@@ -541,8 +543,7 @@ angular.module('patternfly.card').directive('pfCard', function () {
541543
'used': '670',
542544
'total': '1000'
543545
};
544-
545-
};
546+
}]);
546547
</file>
547548
</example>
548549
*/
@@ -811,7 +812,8 @@ angular.module('patternfly.charts').directive('pfDonutPctChart', ['c3ChartDefaul
811812
</file>
812813
813814
<file name="script.js">
814-
function ChartCtrl($scope) {
815+
angular.module( 'patternfly.charts' )
816+
.controller( 'ChartCtrl', ['$scope', function( $scope ) {
815817
816818
$scope.config = {
817819
'chartId': 'exampleSparkline',
@@ -838,7 +840,7 @@ angular.module('patternfly.charts').directive('pfDonutPctChart', ['c3ChartDefaul
838840
$scope.data.xData.push(new Date($scope.data.xData[$scope.data.xData.length - 1].getTime() + (24 * 60 * 60 * 1000)));
839841
$scope.data.yData.push(Math.round(Math.random() * 100));
840842
};
841-
};
843+
}]);
842844
</file>
843845
</example>
844846
*/
@@ -1161,7 +1163,8 @@ angular.module('patternfly.charts').directive('pfSparklineChart', ['c3ChartDefau
11611163
</file>
11621164
11631165
<file name="script.js">
1164-
function ChartCtrl($scope) {
1166+
angular.module( 'patternfly.charts' )
1167+
.controller( 'ChartCtrl', ['$scope', function( $scope ) {
11651168
11661169
$scope.config = {
11671170
title: 'Memory',
@@ -1203,7 +1206,7 @@ angular.module('patternfly.charts').directive('pfSparklineChart', ['c3ChartDefau
12031206
$scope.data.xData.push(newDate);
12041207
$scope.data.yData.push(newData);
12051208
};
1206-
};
1209+
}]);
12071210
</file>
12081211
</example>
12091212
*/
@@ -1280,7 +1283,9 @@ angular.module('patternfly.charts').directive('pfUtilizationChart',
12801283
</file>
12811284
12821285
<file name="script.js">
1283-
function FormDemoCtrl ($scope) {
1286+
1287+
angular.module( 'patternfly.form' )
1288+
.controller( 'FormDemoCtrl', ['$scope', function( $scope ) {
12841289
$scope.setToday = function () {
12851290
$scope.date = new Date();
12861291
}
@@ -1290,7 +1295,7 @@ angular.module('patternfly.charts').directive('pfUtilizationChart',
12901295
todayBtn: 'linked',
12911296
todayHighlight: true
12921297
};
1293-
}
1298+
}]);
12941299
</file>
12951300
</example>
12961301
*/
@@ -1363,7 +1368,8 @@ angular.module('patternfly.form').directive('pfDatepicker', function () {
13631368
</file>
13641369
13651370
<file name="script.js">
1366-
function FormButtonCtrl ($scope, $timeout) {
1371+
angular.module( 'patternfly.form' )
1372+
.controller( 'FormButtonCtrl', ['$scope', '$timeout', function( $scope, $timeout ) {
13671373
$scope.status = 'Not yet Saved'
13681374
$scope.working = false;
13691375
@@ -1380,7 +1386,7 @@ angular.module('patternfly.form').directive('pfDatepicker', function () {
13801386
$scope.status = 'cancelled';
13811387
$scope.input = null;
13821388
};
1383-
}
1389+
}]);
13841390
</file>
13851391
</example>
13861392
*/
@@ -1455,12 +1461,13 @@ angular.module('patternfly.form').directive('pfFormButtons', function () {
14551461
</file>
14561462
14571463
<file name="script.js">
1458-
function FormDemoCtrl ($scope) {
1464+
angular.module( 'patternfly.form' )
1465+
.controller( 'FormDemoCtrl', ['$scope', function( $scope ) {
14591466
$scope.item = {
14601467
name: 'Homer Simpson',
14611468
description: 'I like donuts and Duff. Doh!'
14621469
};
1463-
}
1470+
}]);
14641471
</file>
14651472
</example>
14661473
*/
@@ -1593,7 +1600,8 @@ angular.module('patternfly.form').directive('pfFormGroup', function () {
15931600
</file>
15941601
15951602
<file name="script.js">
1596-
function NotificationDemoCtrl($scope, Notifications) {
1603+
angular.module( 'patternfly.notification' )
1604+
.controller( 'NotificationDemoCtrl', ['$scope', 'Notifications', function( $scope, Notifications ) {
15971605
15981606
var typeMap = { 'Info': Notifications.info,
15991607
'Success': Notifications.success,
@@ -1608,7 +1616,7 @@ angular.module('patternfly.form').directive('pfFormGroup', function () {
16081616
$scope.notify = function () {
16091617
typeMap[$scope.type]($scope.message);
16101618
}
1611-
}
1619+
}]);
16121620
</file>
16131621
16141622
</example>
@@ -1709,7 +1717,7 @@ angular.module('patternfly.notification', []).provider('Notifications', function
17091717
return notifications;
17101718
}];
17111719

1712-
})
1720+
});
17131721

17141722
/**
17151723
* @ngdoc directive
@@ -1767,19 +1775,21 @@ angular.module('patternfly.notification', []).provider('Notifications', function
17671775
</file>
17681776
17691777
<file name="script.js">
1770-
function NotificationDemoCtrl($scope) {
1778+
1779+
angular.module( 'patternfly.notification' )
1780+
.controller( 'NotificationDemoCtrl', ['$scope', 'Notifications', function( $scope, Notifications ) {
17711781
$scope.types = ['success','info','danger', 'warning'];
17721782
$scope.type = $scope.types[0];
17731783
$scope.isPersistent = false;
17741784
17751785
$scope.header = 'Default Header.';
17761786
$scope.message = 'Default Message.';
1777-
}
1787+
}]);
17781788
</file>
17791789
17801790
</example>
17811791
*/
1782-
.directive('pfNotification', function () {
1792+
angular.module( 'patternfly.notification' ).directive('pfNotification', function () {
17831793
'use strict';
17841794

17851795
return {
@@ -1793,7 +1803,7 @@ angular.module('patternfly.notification', []).provider('Notifications', function
17931803
restrict: 'E',
17941804
templateUrl: 'notification/notification.html'
17951805
};
1796-
})
1806+
});
17971807
/**
17981808
* @ngdoc directive
17991809
* @name patternfly.notification:pfNotificationList
@@ -1833,8 +1843,8 @@ angular.module('patternfly.notification', []).provider('Notifications', function
18331843
</file>
18341844
18351845
<file name="script.js">
1836-
function NotificationDemoCtrl($scope, Notifications) {
1837-
1846+
angular.module( 'patternfly.notification' )
1847+
.controller( 'NotificationDemoCtrl', ['$scope', 'Notifications', function( $scope, Notifications ) {
18381848
$scope.message = 'Default Message.';
18391849
18401850
var typeMap = { 'Info': Notifications.info,
@@ -1850,12 +1860,12 @@ angular.module('patternfly.notification', []).provider('Notifications', function
18501860
$scope.notify = function () {
18511861
typeMap[$scope.type]($scope.message);
18521862
}
1853-
}
1863+
}]);
18541864
</file>
18551865
18561866
</example>
18571867
*/
1858-
.directive('pfNotificationList', function () {
1868+
angular.module( 'patternfly.notification' ).directive('pfNotificationList', function () {
18591869
'use strict';
18601870

18611871
return {
@@ -1918,11 +1928,12 @@ angular.module('patternfly.notification', []).provider('Notifications', function
19181928
</file>
19191929
19201930
<file name="script.js">
1921-
function SelectDemoCtrl($scope) {
1931+
angular.module( 'patternfly.select' )
1932+
.controller( 'SelectDemoCtrl', ['$scope', function( $scope ) {
19221933
$scope.drinks = ['tea', 'coffee', 'water'];
19231934
$scope.pets = ['Dog', 'Cat', 'Chicken'];
19241935
$scope.pet = $scope.pets[0];
1925-
}
1936+
}]);
19261937
</file>
19271938
19281939
</example>
@@ -2017,7 +2028,8 @@ angular.module('patternfly.select', []).directive('pfSelect', function ($timeout
20172028
</file>
20182029
20192030
<file name="script.js">
2020-
function ValidationDemoCtrl($scope) {
2031+
angular.module( 'patternfly.validation' )
2032+
.controller( 'ValidationDemoCtrl', ['$scope', function( $scope ) {
20212033
$scope.myValue = "Change this value to be a number";
20222034
$scope.myValueValid = 42;
20232035
$scope.isValidationDisabled = false;
@@ -2029,7 +2041,7 @@ angular.module('patternfly.select', []).directive('pfSelect', function ($timeout
20292041
20302042
return true;
20312043
}
2032-
}
2044+
}]);
20332045
</file>
20342046
20352047
</example>
@@ -2183,7 +2195,7 @@ angular.module('patternfly.validation', []).directive('pfValidation', function (
21832195

21842196

21852197
$templateCache.put('notification/notification.html',
2186-
"<div class=\"alert alert-{{pfNotificationType}}\"><button ng-show=pfNotificationPersistent type=button class=close ng-click=$parent.notifications.remove($index)><span aria-hidden=true>&times;</span><span class=sr-only>Close</span></button> <span class=\"pficon pficon-ok\" ng-show=\"pfNotificationType == 'success'\"></span> <span class=\"pficon pficon-info\" ng-show=\"pfNotificationType == 'info'\"></span> <span class=pficon-layered ng-show=\"pfNotificationType == 'danger'\"><span class=\"pficon pficon-error-octagon\"></span> <span class=\"pficon pficon-error-exclamation\"></span></span> <span class=pficon-layered ng-show=\"pfNotificationType == 'warning'\"><span class=\"pficon pficon-warning-triangle\"></span> <span class=\"pficon pficon-warning-exclamation\"></span></span> <strong>{{pfNotificationHeader}}</strong> {{pfNotificationMessage}}</div>"
2198+
"<div class=\"alert alert-{{pfNotificationType}}\"><button ng-show=pfNotificationPersistent type=button class=close ng-click=$parent.notifications.remove($index)><span aria-hidden=true>&times;</span><span class=sr-only>Close</span></button> <span class=\"pficon pficon-ok\" ng-show=\"pfNotificationType === 'success'\"></span> <span class=\"pficon pficon-info\" ng-show=\"pfNotificationType === 'info'\"></span> <span class=\"pficon pficon-error-circle-o\" ng-show=\"pfNotificationType === 'danger'\"></span> <span class=\"pficon pficon-warning-triangle-o\" ng-show=\"pfNotificationType === 'warning'\"></span> <strong>{{pfNotificationHeader}}</strong> {{pfNotificationMessage}}</div>"
21872199
);
21882200

21892201
}]);

dist/angular-patternfly.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"grunt-eslint": "^17.1.0",
2222
"grunt-htmlhint": "0.4.1",
2323
"grunt-karma": "0.8.3",
24-
"grunt-ngdocs": "0.2.5",
24+
"grunt-ngdocs": "0.2.9",
2525
"karma": "0.12.23",
2626
"karma-chrome-launcher": "0.1.4",
2727
"karma-firefox-launcher": "0.1.3",

src/charts/c3/c3-chart.directive.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* @param {expression} config the c3 configuration options for the chart
1414
*
1515
* @example
16-
<example module="patternfly.charts">
16+
<example module="patternfly.charts">
1717
<file name="index.html">
1818
<div ng-controller="ChartCtrl">
1919
<div pf-c3-chart id="chartId" config="chartConfig"></div>
@@ -30,7 +30,9 @@
3030
</file>
3131
3232
<file name="script.js">
33-
function ChartCtrl($scope) {
33+
34+
angular.module( 'patternfly.charts' )
35+
.controller( 'ChartCtrl', ['$scope', function( $scope ) {
3436
$scope.used = 950;
3537
$scope.total = 1000;
3638
$scope.available = $scope.total - $scope.used;
@@ -63,7 +65,7 @@
6365
$scope.updateAvailable();
6466
$scope.chartConfig.data.columns = [["Used",$scope.used],["Available",$scope.available]];
6567
};
66-
}
68+
}]);
6769
</file>
6870
</example>
6971
*/

src/charts/donut/donut-pct-chart-directive.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@
124124
</file>
125125
126126
<file name="script.js">
127-
function ChartCtrl($scope) {
128-
127+
angular.module( 'patternfly.charts' )
128+
.controller( 'ChartCtrl', ['$scope', function( $scope ) {
129129
$scope.config = {
130130
'chartId': 'chartA',
131131
'units': 'GB',
@@ -207,8 +207,7 @@
207207
'used': '670',
208208
'total': '1000'
209209
};
210-
211-
};
210+
}]);
212211
</file>
213212
</example>
214213
*/

src/charts/sparkline/sparkline-chart.directive.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@
108108
</file>
109109
110110
<file name="script.js">
111-
function ChartCtrl($scope) {
111+
angular.module( 'patternfly.charts' )
112+
.controller( 'ChartCtrl', ['$scope', function( $scope ) {
112113
113114
$scope.config = {
114115
'chartId': 'exampleSparkline',
@@ -135,7 +136,7 @@
135136
$scope.data.xData.push(new Date($scope.data.xData[$scope.data.xData.length - 1].getTime() + (24 * 60 * 60 * 1000)));
136137
$scope.data.yData.push(Math.round(Math.random() * 100));
137138
};
138-
};
139+
}]);
139140
</file>
140141
</example>
141142
*/

0 commit comments

Comments
 (0)