Skip to content

Commit cbe3427

Browse files
committed
Added docs etc for colorpicker add-on
1 parent 21f6d3a commit cbe3427

File tree

5 files changed

+33
-9
lines changed

5 files changed

+33
-9
lines changed

README.md

+8-7
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,12 @@ sure you got the angular version you actually want.
110110

111111
#### Additional dependecies
112112

113-
1. If you want to use the date picker, you'll also need [jQuery](https://github.com/jquery/jquery)
114-
and [pickadate.js](http://amsul.ca/pickadate.js/), see [angular-schema-form-datepicker](https://github.com/Textalk/angular-schema-form-datepicker)
115-
2. If you'd like to use drag-and-drop reordering of arrays, you'll also need [ui-sortable](https://github.com/angular-ui/ui-sortable) and its [jQueryUI](http://jqueryui.com/) dependencies. See the *ui-sortable* documentation for details about which parts of jQueryUI are needed. You can safely ignore these if you don't need reordering.
116-
3. Schema Form provides tabbed arrays through the form type `tabarray`. Tab arrays default to tabs on the left side. For these to work, you'll need to include the CSS from [bootstrap-vertical-tabs](https://github.com/dbtek/bootstrap-vertical-tabs). However, you won't need Bootstrap Vertical Tabs for horizontal tabs (the `tabType: "top"` option).
113+
1. If you'd like to use drag-and-drop reordering of arrays, you'll also need [ui-sortable](https://github.com/angular-ui/ui-sortable) and its [jQueryUI](http://jqueryui.com/) dependencies. See the *ui-sortable* documentation for details about which parts of jQueryUI are needed. You can safely ignore these if you don't need reordering.
114+
2. Schema Form provides tabbed arrays through the form type `tabarray`. Tab arrays default to tabs on the left side. For these to work, you'll need to include the CSS from [bootstrap-vertical-tabs](https://github.com/dbtek/bootstrap-vertical-tabs). However, you won't need Bootstrap Vertical Tabs for horizontal tabs (the `tabType: "top"` option).
117115

118116
The minified files include templates - no need to load additional HTML files.
119117

118+
120119
### Script Loading
121120

122121
Schema form is split into two main files, `dist/schema-form.min.js` and
@@ -137,9 +136,11 @@ also needs to be loaded *before* Schema Form.
137136

138137
Add-ons
139138
------
140-
There is currently only one add-on, a date picker using the excellent
141-
[pickadate.js](http://amsul.ca/pickadate.js/). It has it's own repo and you can find it here:
142-
[https://github.com/Textalk/angular-schema-form-datepicker](https://github.com/Textalk/angular-schema-form-datepicker)
139+
There is currently two add-ons, a date picker and a colorpicker. They have their own repos and you
140+
can find them here with usage instructions:
141+
142+
* [https://github.com/Textalk/angular-schema-form-datepicker](https://github.com/Textalk/angular-schema-form-datepicker)
143+
* [https://github.com/Textalk/angular-schema-form-colorpicker](https://github.com/Textalk/angular-schema-form-colorpicker)
143144

144145
Building
145146
--------

bower.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"angular-ui-ace": "bower",
4040
"angular-schema-form-datepicker": ">= 0.1.0",
4141
"jquery": "~2.1.1",
42-
"angular-mocks": ">= 1.2"
42+
"angular-mocks": ">= 1.2",
43+
"angular-schema-form-colorpicker": "~0.1.0"
4344
}
4445
}

examples/bootstrap-example.html

+11
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
<link rel="stylesheet" href="../bower_components/pickadate/lib/themes/classic.css">
99
<link rel="stylesheet" href="../bower_components/pickadate/lib/themes/classic.date.css">
1010
<link rel="stylesheet" href="../bower_components/bootstrap-vertical-tabs/bootstrap.vertical-tabs.min.css">
11+
<link rel="stylesheet" href="../bower_components/spectrum/spectrum.css">
12+
1113
<style type="text/css">
1214

1315
body,html {
@@ -65,16 +67,25 @@ <h3>Schema</h3>
6567
<!-- <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.21/angular.min.js"></script> -->
6668
<!-- <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.21/angular-sanitize.min.js"></script> -->
6769

70+
6871
<script type="text/javascript" src="../bower_components/angular-ui-sortable/sortable.js"></script>
6972
<script type="text/javascript" src="../bower_components/angular-ui-ace/ui-ace.js"></script>
7073
<script type="text/javascript" src="../bower_components/objectpath/lib/ObjectPath.js"></script>
7174
<script type="text/javascript" src="../bower_components/pickadate/lib/picker.js"></script>
7275
<script type="text/javascript" src="../bower_components/pickadate/lib/picker.date.js"></script>
7376
<script type="text/javascript" src="../bower_components/pickadate/lib/translations/sv_SE.js"></script>
7477

78+
<script type="text/javascript" src="../bower_components/spectrum/spectrum.js"></script>
79+
<script type="text/javascript" src="../bower_components/spectrum/i18n/jquery.spectrum-sv.js"></script>
80+
<script type="text/javascript" src="../bower_components/angular-spectrum-colorpicker/dist/angular-spectrum-colorpicker.min.js"></script>
81+
82+
7583
<script type="text/javascript" src="../dist/schema-form.min.js"></script>
7684
<script type="text/javascript" src="../dist/bootstrap-decorator.min.js"></script>
7785
<script type="text/javascript" src="../dist/bootstrap-datepicker.min.js"></script>
86+
87+
<script type="text/javascript" src="../bower_components/angular-schema-form-colorpicker/bootstrap-colorpicker.min.js"></script>
88+
7889
<script type="text/javascript">
7990

8091
angular.module('test',['schemaForm','ui.ace']).controller('TestCtrl', function($scope,$http){

examples/data/sink.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@
3636
"properties": {
3737
"eyecolor": {
3838
"type": "string",
39-
"title": "Eye color"
39+
"format": "color",
40+
"title": "Eye color",
41+
"default": "pink"
4042
},
4143
"haircolor": {
4244
"type": "string",

src/module.js

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Deps is sort of a problem for us, maybe in the future we will ask the user to depend
2+
// on modules for add-ons
3+
14
var deps = ['ObjectPath'];
25
try {
36
//This throws an expection if module does not exist.
@@ -11,4 +14,10 @@ try {
1114
deps.push('ui.sortable');
1215
} catch (e) {}
1316

17+
try {
18+
//This throws an expection if module does not exist.
19+
angular.module('angularSpectrumColorpicker');
20+
deps.push('angularSpectrumColorpicker');
21+
} catch (e) {}
22+
1423
angular.module('schemaForm', deps);

0 commit comments

Comments
 (0)