1
-
2
- var schemaForm = angular . module ( 'schemaForm' , [ 'ngSanitize' ] ) ;
3
-
4
1
( function ( root , factory ) {
5
2
if ( typeof define === 'function' && define . amd ) {
6
3
define ( [ 'angular' , 'objectpath' , 'tv4' ] , factory ) ;
@@ -10,6 +7,30 @@ var schemaForm = angular.module('schemaForm', ['ngSanitize']);
10
7
root . schemaForm = factory ( root . angular , root . objectpath , root . tv4 ) ;
11
8
}
12
9
} ( this , function ( angular , objectpath , tv4 ) {
10
+ // Deps is sort of a problem for us, maybe in the future we will ask the user to depend
11
+ // on modules for add-ons
12
+
13
+ var deps = [ ] ;
14
+ try {
15
+ //This throws an expection if module does not exist.
16
+ angular . module ( 'ngSanitize' ) ;
17
+ deps . push ( 'ngSanitize' ) ;
18
+ } catch ( e ) { }
19
+
20
+ try {
21
+ //This throws an expection if module does not exist.
22
+ angular . module ( 'ui.sortable' ) ;
23
+ deps . push ( 'ui.sortable' ) ;
24
+ } catch ( e ) { }
25
+
26
+ try {
27
+ //This throws an expection if module does not exist.
28
+ angular . module ( 'angularSpectrumColorpicker' ) ;
29
+ deps . push ( 'angularSpectrumColorpicker' ) ;
30
+ } catch ( e ) { }
31
+
32
+ var schemaForm = angular . module ( 'schemaForm' , deps ) ;
33
+
13
34
angular . module ( 'schemaForm' ) . provider ( 'sfPath' ,
14
35
[ function ( ) {
15
36
@@ -44,18 +65,6 @@ angular.module('schemaForm').provider('sfPath',
44
65
} ;
45
66
} ] ) ;
46
67
47
- return schemaForm ;
48
- } ) ) ;
49
-
50
- ( function ( root , factory ) {
51
- if ( typeof define === 'function' && define . amd ) {
52
- define ( [ 'angular' , 'objectpath' , 'tv4' ] , factory ) ;
53
- } else if ( typeof exports === 'object' ) {
54
- module . exports = factory ( require ( 'angular' ) , require ( 'objectpath' ) , require ( 'tv4' ) ) ;
55
- } else {
56
- root . schemaForm = factory ( root . angular , root . objectpath , root . tv4 ) ;
57
- }
58
- } ( this , function ( angular , objectpath , tv4 ) {
59
68
/**
60
69
* @ngdoc service
61
70
* @name sfSelect
@@ -131,18 +140,6 @@ angular.module('schemaForm').factory('sfSelect', ['sfPath', function(sfPath) {
131
140
} ;
132
141
} ] ) ;
133
142
134
- return schemaForm ;
135
- } ) ) ;
136
-
137
- ( function ( root , factory ) {
138
- if ( typeof define === 'function' && define . amd ) {
139
- define ( [ 'angular' , 'objectpath' , 'tv4' ] , factory ) ;
140
- } else if ( typeof exports === 'object' ) {
141
- module . exports = factory ( require ( 'angular' ) , require ( 'objectpath' ) , require ( 'tv4' ) ) ;
142
- } else {
143
- root . schemaForm = factory ( root . angular , root . objectpath , root . tv4 ) ;
144
- }
145
- } ( this , function ( angular , objectpath , tv4 ) {
146
143
147
144
// FIXME: type template (using custom builder)
148
145
angular . module ( 'schemaForm' ) . provider ( 'sfBuilder' , [ 'sfPathProvider' , function ( sfPathProvider ) {
@@ -342,18 +339,6 @@ angular.module('schemaForm').provider('sfBuilder', ['sfPathProvider', function(s
342
339
343
340
} ] ) ;
344
341
345
- return schemaForm ;
346
- } ) ) ;
347
-
348
- ( function ( root , factory ) {
349
- if ( typeof define === 'function' && define . amd ) {
350
- define ( [ 'angular' , 'objectpath' , 'tv4' ] , factory ) ;
351
- } else if ( typeof exports === 'object' ) {
352
- module . exports = factory ( require ( 'angular' ) , require ( 'objectpath' ) , require ( 'tv4' ) ) ;
353
- } else {
354
- root . schemaForm = factory ( root . angular , root . objectpath , root . tv4 ) ;
355
- }
356
- } ( this , function ( angular , objectpath , tv4 ) {
357
342
angular . module ( 'schemaForm' ) . provider ( 'schemaFormDecorators' ,
358
343
[ '$compileProvider' , 'sfPathProvider' , function ( $compileProvider , sfPathProvider ) {
359
344
var defaultDecorator = '' ;
@@ -840,18 +825,6 @@ angular.module('schemaForm').provider('schemaFormDecorators',
840
825
841
826
} ] ) ;
842
827
843
- return schemaForm ;
844
- } ) ) ;
845
-
846
- ( function ( root , factory ) {
847
- if ( typeof define === 'function' && define . amd ) {
848
- define ( [ 'angular' , 'objectpath' , 'tv4' ] , factory ) ;
849
- } else if ( typeof exports === 'object' ) {
850
- module . exports = factory ( require ( 'angular' ) , require ( 'objectpath' ) , require ( 'tv4' ) ) ;
851
- } else {
852
- root . schemaForm = factory ( root . angular , root . objectpath , root . tv4 ) ;
853
- }
854
- } ( this , function ( angular , objectpath , tv4 ) {
855
828
angular . module ( 'schemaForm' ) . provider ( 'sfErrorMessage' , function ( ) {
856
829
857
830
// The codes are tv4 error codes.
@@ -980,18 +953,6 @@ angular.module('schemaForm').provider('sfErrorMessage', function() {
980
953
981
954
} ) ;
982
955
983
- return schemaForm ;
984
- } ) ) ;
985
-
986
- ( function ( root , factory ) {
987
- if ( typeof define === 'function' && define . amd ) {
988
- define ( [ 'angular' , 'objectpath' , 'tv4' ] , factory ) ;
989
- } else if ( typeof exports === 'object' ) {
990
- module . exports = factory ( require ( 'angular' ) , require ( 'objectpath' ) , require ( 'tv4' ) ) ;
991
- } else {
992
- root . schemaForm = factory ( root . angular , root . objectpath , root . tv4 ) ;
993
- }
994
- } ( this , function ( angular , objectpath , tv4 ) {
995
956
/**
996
957
* Schema form service.
997
958
* This service is not that useful outside of schema form directive
@@ -1465,18 +1426,6 @@ angular.module('schemaForm').provider('schemaForm',
1465
1426
1466
1427
} ] ) ;
1467
1428
1468
- return schemaForm ;
1469
- } ) ) ;
1470
-
1471
- ( function ( root , factory ) {
1472
- if ( typeof define === 'function' && define . amd ) {
1473
- define ( [ 'angular' , 'objectpath' , 'tv4' ] , factory ) ;
1474
- } else if ( typeof exports === 'object' ) {
1475
- module . exports = factory ( require ( 'angular' ) , require ( 'objectpath' ) , require ( 'tv4' ) ) ;
1476
- } else {
1477
- root . schemaForm = factory ( root . angular , root . objectpath , root . tv4 ) ;
1478
- }
1479
- } ( this , function ( angular , objectpath , tv4 ) {
1480
1429
/* Common code for validating a value against its form and schema definition */
1481
1430
/* global tv4 */
1482
1431
angular . module ( 'schemaForm' ) . factory ( 'sfValidator' , [ function ( ) {
@@ -1536,18 +1485,6 @@ angular.module('schemaForm').factory('sfValidator', [function() {
1536
1485
return validator ;
1537
1486
} ] ) ;
1538
1487
1539
- return schemaForm ;
1540
- } ) ) ;
1541
-
1542
- ( function ( root , factory ) {
1543
- if ( typeof define === 'function' && define . amd ) {
1544
- define ( [ 'angular' , 'objectpath' , 'tv4' ] , factory ) ;
1545
- } else if ( typeof exports === 'object' ) {
1546
- module . exports = factory ( require ( 'angular' ) , require ( 'objectpath' ) , require ( 'tv4' ) ) ;
1547
- } else {
1548
- root . schemaForm = factory ( root . angular , root . objectpath , root . tv4 ) ;
1549
- }
1550
- } ( this , function ( angular , objectpath , tv4 ) {
1551
1488
/**
1552
1489
* Directive that handles the model arrays
1553
1490
*/
@@ -1809,18 +1746,6 @@ angular.module('schemaForm').directive('sfArray', ['sfSelect', 'schemaForm', 'sf
1809
1746
}
1810
1747
] ) ;
1811
1748
1812
- return schemaForm ;
1813
- } ) ) ;
1814
-
1815
- ( function ( root , factory ) {
1816
- if ( typeof define === 'function' && define . amd ) {
1817
- define ( [ 'angular' , 'objectpath' , 'tv4' ] , factory ) ;
1818
- } else if ( typeof exports === 'object' ) {
1819
- module . exports = factory ( require ( 'angular' ) , require ( 'objectpath' ) , require ( 'tv4' ) ) ;
1820
- } else {
1821
- root . schemaForm = factory ( root . angular , root . objectpath , root . tv4 ) ;
1822
- }
1823
- } ( this , function ( angular , objectpath , tv4 ) {
1824
1749
/**
1825
1750
* A version of ng-changed that only listens if
1826
1751
* there is actually a onChange defined on the form
@@ -1850,18 +1775,6 @@ angular.module('schemaForm').directive('sfChanged', function() {
1850
1775
} ;
1851
1776
} ) ;
1852
1777
1853
- return schemaForm ;
1854
- } ) ) ;
1855
-
1856
- ( function ( root , factory ) {
1857
- if ( typeof define === 'function' && define . amd ) {
1858
- define ( [ 'angular' , 'objectpath' , 'tv4' ] , factory ) ;
1859
- } else if ( typeof exports === 'object' ) {
1860
- module . exports = factory ( require ( 'angular' ) , require ( 'objectpath' ) , require ( 'tv4' ) ) ;
1861
- } else {
1862
- root . schemaForm = factory ( root . angular , root . objectpath , root . tv4 ) ;
1863
- }
1864
- } ( this , function ( angular , objectpath , tv4 ) {
1865
1778
angular . module ( 'schemaForm' ) . directive ( 'sfField' ,
1866
1779
[ '$parse' , '$compile' , '$http' , '$templateCache' , '$interpolate' , '$q' , 'sfErrorMessage' ,
1867
1780
'sfPath' , 'sfSelect' ,
@@ -2104,18 +2017,6 @@ angular.module('schemaForm').directive('sfField',
2104
2017
}
2105
2018
] ) ;
2106
2019
2107
- return schemaForm ;
2108
- } ) ) ;
2109
-
2110
- ( function ( root , factory ) {
2111
- if ( typeof define === 'function' && define . amd ) {
2112
- define ( [ 'angular' , 'objectpath' , 'tv4' ] , factory ) ;
2113
- } else if ( typeof exports === 'object' ) {
2114
- module . exports = factory ( require ( 'angular' ) , require ( 'objectpath' ) , require ( 'tv4' ) ) ;
2115
- } else {
2116
- root . schemaForm = factory ( root . angular , root . objectpath , root . tv4 ) ;
2117
- }
2118
- } ( this , function ( angular , objectpath , tv4 ) {
2119
2020
angular . module ( 'schemaForm' ) . directive ( 'sfMessage' ,
2120
2021
[ '$injector' , 'sfErrorMessage' , function ( $injector , sfErrorMessage ) {
2121
2022
return {
@@ -2199,18 +2100,6 @@ angular.module('schemaForm').directive('sfMessage',
2199
2100
} ;
2200
2101
} ] ) ;
2201
2102
2202
- return schemaForm ;
2203
- } ) ) ;
2204
-
2205
- ( function ( root , factory ) {
2206
- if ( typeof define === 'function' && define . amd ) {
2207
- define ( [ 'angular' , 'objectpath' , 'tv4' ] , factory ) ;
2208
- } else if ( typeof exports === 'object' ) {
2209
- module . exports = factory ( require ( 'angular' ) , require ( 'objectpath' ) , require ( 'tv4' ) ) ;
2210
- } else {
2211
- root . schemaForm = factory ( root . angular , root . objectpath , root . tv4 ) ;
2212
- }
2213
- } ( this , function ( angular , objectpath , tv4 ) {
2214
2103
/*
2215
2104
FIXME: real documentation
2216
2105
<form sf-form="form" sf-schema="schema" sf-decorator="foobar"></form>
@@ -2363,18 +2252,6 @@ angular.module('schemaForm')
2363
2252
}
2364
2253
] ) ;
2365
2254
2366
- return schemaForm ;
2367
- } ) ) ;
2368
-
2369
- ( function ( root , factory ) {
2370
- if ( typeof define === 'function' && define . amd ) {
2371
- define ( [ 'angular' , 'objectpath' , 'tv4' ] , factory ) ;
2372
- } else if ( typeof exports === 'object' ) {
2373
- module . exports = factory ( require ( 'angular' ) , require ( 'objectpath' ) , require ( 'tv4' ) ) ;
2374
- } else {
2375
- root . schemaForm = factory ( root . angular , root . objectpath , root . tv4 ) ;
2376
- }
2377
- } ( this , function ( angular , objectpath , tv4 ) {
2378
2255
angular . module ( 'schemaForm' ) . directive ( 'schemaValidate' , [ 'sfValidator' , '$parse' , 'sfSelect' ,
2379
2256
function ( sfValidator , $parse , sfSelect ) {
2380
2257
0 commit comments