Skip to content
This repository was archived by the owner on May 28, 2022. It is now read-only.

Commit 09d5371

Browse files
committed
Use ES6 syntax.
1 parent f6bc441 commit 09d5371

30 files changed

+508
-656
lines changed

.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
bedrock
2+
bedrock.json

bedrock/.eslintrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"mocha": true,
5+
"protractor": true
6+
}
7+
}

bedrock/components/main.js

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
define([
2-
'angular',
3-
'./test-form-controller',
4-
'./test-form-library-service'
5-
], function(angular, brTestFormController, brTestFormLibraryService) {
6-
7-
'use strict';
1+
/*!
2+
* Copyright (c) 2014-2017 Digital Bazaar, Inc. All rights reserved.
3+
*
4+
* @author Dave Longley
5+
*/
6+
import angular from 'angular';
7+
import BrTestFormController from './test-form-controller.js';
8+
import BrTestFormLibraryService from './test-form-library-service.js';
89

910
var module = angular.module(
1011
'bedrock-angular-form-test', ['bedrock.alert', 'bedrock.form']);
1112

12-
module.controller(brTestFormController);
13-
module.service(brTestFormLibraryService);
14-
15-
return module.name;
16-
17-
});
13+
module.controller('brTestFormController', BrTestFormController);
14+
module.service('brTestFormLibraryService', BrTestFormLibraryService);
Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
define([], function() {
2-
3-
'use strict';
4-
1+
/*!
2+
* Copyright (c) 2014-2017 Digital Bazaar, Inc. All rights reserved.
3+
*
4+
* @author Dave Longley
5+
*/
56
/* @ngInject */
6-
function factory($scope, brTestFormLibraryService) {
7+
export default function factory($scope, brTestFormLibraryService) {
78
var self = this;
89

910
self.doc = {
@@ -19,7 +20,3 @@ function factory($scope, brTestFormLibraryService) {
1920
$scope.$apply();
2021
});
2122
}
22-
23-
return {brTestFormController: factory};
24-
25-
});
Lines changed: 122 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
define([], function() {
2-
3-
'use strict';
4-
1+
/*!
2+
* Copyright (c) 2014-2017 Digital Bazaar, Inc. All rights reserved.
3+
*
4+
* @author Dave Longley
5+
*/
56
/* @ngInject */
6-
function factory(brFormLibraryService) {
7+
export default function factory(brFormLibraryService) {
78
var service = {};
89

910
service.CONTEXT = brFormLibraryService._CONTEXT;
@@ -14,137 +15,133 @@ function factory(brFormLibraryService) {
1415
],
1516
"id": "t2:library-v1",
1617
"label": "Test #2 Property Library V1",
17-
"@graph": [
18-
{
19-
"id": "t2:test",
20-
"type": "owl:Ontology",
21-
"dc:abstract": "This document describes a number of classes and properties for use in testing the Bedrock vocab features.",
22-
"label": "Bedrock Test Vocabulary",
23-
"comment": "This document describes a number of classes and properties for use in testing the Bedrock vocab features."
24-
},
25-
{
26-
"id": "PropertyGroup",
27-
"type": "owl:Class",
28-
"label": "Property Group",
29-
"comment": "A group of related properties."
30-
},
31-
{
32-
"id": "br:layout",
33-
"type": "Property",
34-
"label": "PropertyGroup Layout",
35-
"comment": "An ordered list of Properties and PropertyGroups.",
36-
"domain": "PropertyGroup"
37-
},
18+
"@graph": [{
19+
"id": "t2:test",
20+
"type": "owl:Ontology",
21+
"dc:abstract": "This document describes a number of classes and properties for use in testing the Bedrock vocab features.",
22+
"label": "Bedrock Test Vocabulary",
23+
"comment": "This document describes a number of classes and properties for use in testing the Bedrock vocab features."
24+
},
25+
{
26+
"id": "PropertyGroup",
27+
"type": "owl:Class",
28+
"label": "Property Group",
29+
"comment": "A group of related properties."
30+
},
31+
{
32+
"id": "br:layout",
33+
"type": "Property",
34+
"label": "PropertyGroup Layout",
35+
"comment": "An ordered list of Properties and PropertyGroups.",
36+
"domain": "PropertyGroup"
37+
},
3838

39-
{
40-
"id": "t2:resource",
41-
"type": "Property",
42-
"label": "Test Resource URL",
43-
"comment": "A resource URL.",
44-
"domain": "schema:Thing",
45-
"range": "URL",
46-
"vs:term_status": "unstable"
39+
{
40+
"id": "t2:resource",
41+
"type": "Property",
42+
"label": "Test Resource URL",
43+
"comment": "A resource URL.",
44+
"domain": "schema:Thing",
45+
"range": "URL",
46+
"vs:term_status": "unstable"
47+
},
48+
{
49+
"id": "t2:resource2",
50+
"type": "Property",
51+
"label": "2nd Test Resource URL",
52+
"comment": "A resource URL.",
53+
"domain": "schema:Thing",
54+
"range": "URL",
55+
"vs:term_status": "unstable"
56+
},
57+
{
58+
"id": "t2:string",
59+
"type": "Property",
60+
"label": "Test String",
61+
"comment": "A string.",
62+
"domain": "schema:Thing",
63+
"range": "String",
64+
"vs:term_status": "unstable"
65+
},
66+
{
67+
"id": "t2:string2",
68+
"type": "Property",
69+
"label": "2nd Test String (w/ default)",
70+
"comment": "A string.",
71+
"domain": "schema:Thing",
72+
"range": "String",
73+
"vs:term_status": "unstable",
74+
"br:default": "default string2"
75+
},
76+
{
77+
"id": "t2:string3",
78+
"type": "Property",
79+
"label": "3nd Test String (w/o default)",
80+
"comment": "A string.",
81+
"domain": "schema:Thing",
82+
"range": "String",
83+
"vs:term_status": "unstable"
84+
},
85+
{
86+
"id": "t2:string4",
87+
"type": "Property",
88+
"label": "4th Test String (w/ default)",
89+
"comment": "A string.",
90+
"domain": "schema:Thing",
91+
"range": "String",
92+
"vs:term_status": "unstable",
93+
"br:default": "default string4"
94+
},
95+
{
96+
"id": "t2:date",
97+
"type": "Property",
98+
"label": "Test Date",
99+
"comment": "A date and time. The value MUST be expressed using an ISO-8601 date/time string.",
100+
"domain": "schema:Thing",
101+
"range": "Date",
102+
"vs:term_status": "unstable"
103+
},
104+
{
105+
"id": "t2:image",
106+
"type": "Property",
107+
"owl:sameAs": "schema:image",
108+
"label": "Test Image",
109+
"comment": "A image URL.",
110+
"domain": "schema:Thing",
111+
"range": "URL",
112+
"vs:term_status": "unstable"
113+
},
114+
{
115+
"id": "t2:kitchen-sink",
116+
"type": "PropertyGroup",
117+
"label": "Test #2 Kitchen Sink Properties",
118+
"comment": "A test of various properties.",
119+
"layout": [{
120+
"property": "t2:resource",
121+
"value": null
47122
},
48123
{
49-
"id": "t2:resource2",
50-
"type": "Property",
51-
"label": "2nd Test Resource URL",
52-
"comment": "A resource URL.",
53-
"domain": "schema:Thing",
54-
"range": "URL",
55-
"vs:term_status": "unstable"
124+
"property": "t2:string",
125+
"value": "string default"
56126
},
57127
{
58-
"id": "t2:string",
59-
"type": "Property",
60-
"label": "Test String",
61-
"comment": "A string.",
62-
"domain": "schema:Thing",
63-
"range": "String",
64-
"vs:term_status": "unstable"
128+
"property": "t2:string2"
65129
},
66130
{
67-
"id": "t2:string2",
68-
"type": "Property",
69-
"label": "2nd Test String (w/ default)",
70-
"comment": "A string.",
71-
"domain": "schema:Thing",
72-
"range": "String",
73-
"vs:term_status": "unstable",
74-
"br:default": "default string2"
131+
"property": "t2:string4",
132+
"value": "override of string4 default"
75133
},
76134
{
77-
"id": "t2:string3",
78-
"type": "Property",
79-
"label": "3nd Test String (w/o default)",
80-
"comment": "A string.",
81-
"domain": "schema:Thing",
82-
"range": "String",
83-
"vs:term_status": "unstable"
135+
"property": "t2:image"
84136
},
85137
{
86-
"id": "t2:string4",
87-
"type": "Property",
88-
"label": "4th Test String (w/ default)",
89-
"comment": "A string.",
90-
"domain": "schema:Thing",
91-
"range": "String",
92-
"vs:term_status": "unstable",
93-
"br:default": "default string4"
94-
},
95-
{
96-
"id": "t2:date",
97-
"type": "Property",
98-
"label": "Test Date",
99-
"comment": "A date and time. The value MUST be expressed using an ISO-8601 date/time string.",
100-
"domain": "schema:Thing",
101-
"range": "Date",
102-
"vs:term_status": "unstable"
103-
},
104-
{
105-
"id": "t2:image",
106-
"type": "Property",
107-
"owl:sameAs": "schema:image",
108-
"label": "Test Image",
109-
"comment": "A image URL.",
110-
"domain": "schema:Thing",
111-
"range": "URL",
112-
"vs:term_status": "unstable"
113-
},
114-
{
115-
"id": "t2:kitchen-sink",
116-
"type": "PropertyGroup",
117-
"label": "Test #2 Kitchen Sink Properties",
118-
"comment": "A test of various properties.",
119-
"layout": [
120-
{
121-
"property": "t2:resource",
122-
"value": null
123-
},
124-
{
125-
"property": "t2:string",
126-
"value": "string default"
127-
},
128-
{
129-
"property": "t2:string2"
130-
},
131-
{
132-
"property": "t2:string4",
133-
"value": "override of string4 default"
134-
},
135-
{
136-
"property": "t2:image"
137-
},
138-
{
139-
"property": "t2:date",
140-
"value": {
141-
"type": "Date",
142-
"@value": "2014-10-29T12:00:00-04:00"
143-
}
144-
}
145-
]
146-
}
147-
]
138+
"property": "t2:date",
139+
"value": {
140+
"type": "Date",
141+
"@value": "2014-10-29T12:00:00-04:00"
142+
}
143+
}]
144+
}]
148145
};
149146

150147
service.getLibrary = function() {
@@ -156,7 +153,3 @@ function factory(brFormLibraryService) {
156153

157154
return service;
158155
}
159-
160-
return {brTestFormLibraryService: factory};
161-
162-
});

bedrock/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* Bedrock Configuration.
33
*
4-
* Copyright (c) 2012-2015 Digital Bazaar, Inc. All rights reserved.
4+
* Copyright (c) 2012-2017 Digital Bazaar, Inc. All rights reserved.
55
*/
66
var fs = require('fs');
77
var path = require('path');

bedrock/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015 Digital Bazaar, Inc. All rights reserved.
2+
* Copyright (c) 2015-2017 Digital Bazaar, Inc. All rights reserved.
33
*/
44
var bedrock = require('bedrock');
55
var fs = require('fs');

0 commit comments

Comments
 (0)