Skip to content

Commit 2b9d7b5

Browse files
committed
Merge pull request #116 from jeton/jeton_interpolation_provider
Jeton's interpolation provider
2 parents 764599d + 71fa49d commit 2b9d7b5

21 files changed

+84
-39
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules
22
coverage
33
bower_components
4+
.idea

dist/bootstrap-decorator.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.

dist/schema-form.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,6 +1177,27 @@ angular.module('schemaForm').directive('sfChanged', function() {
11771177
};
11781178
});
11791179

1180+
/**
1181+
* Sets attributes 'type' and 'placeholder' to input elements
1182+
*/
1183+
angular.module('schemaForm').directive('sfDefaultInput', [function () {
1184+
1185+
return {
1186+
restrict: 'A',
1187+
scope: {
1188+
sfType: '=',
1189+
sfPlaceholder: '='
1190+
},
1191+
link: function (scope, element) {
1192+
1193+
element.attr('type', scope.sfType);
1194+
element.attr('placeholder', scope.sfPlaceholder);
1195+
1196+
}
1197+
1198+
};
1199+
1200+
}]);
11801201
/*
11811202
FIXME: real documentation
11821203
<form sf-form="form" sf-schema="schema" sf-decorator="foobar"></form>

dist/schema-form.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.
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<div class="btn-group">
22
<input ng-repeat-start="item in form.items"
33
type="submit"
4-
class="btn {{ item.style || 'btn-primary' }}"
5-
value="{{item.title}}"
4+
class="btn" ng-class="item.style || 'btn-primary'"
5+
ng-value="item.title"
66
ng-if="item.type === 'submit'">
7-
<button ng-repeat-end class="btn {{ item.style || 'btn-default' }}"
7+
<button ng-repeat-end class="btn" ng-class="item.style || 'btn-default'"
88
type="button"
99
ng-if="item.type !== 'submit'"
10-
ng-click="buttonClick($event,item)">{{item.title}}</button>
10+
ng-click="buttonClick($event,item)" ng-bind="item.title"></button>
1111
</div>

src/directives/decorators/bootstrap/array.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div sf-array="form" ng-model="$$value$$" ng-model-options="form.ngModelOptions">
2-
<h3 ng-show="form.title && form.notitle !== true">{{ form.title }}</h3>
2+
<h3 ng-show="form.title && form.notitle !== true" ng-bind="form.title"></h3>
33
<ol class="list-group" ng-model="modelArray" ui-sortable>
44
<li class="list-group-item" ng-repeat="item in modelArray track by $index">
55
<button ng-click="deleteFromArray($index)"
@@ -13,9 +13,9 @@ <h3 ng-show="form.title && form.notitle !== true">{{ form.title }}</h3>
1313
<div class="clearfix" style="padding: 15px;">
1414
<button ng-click="appendToArray()"
1515
type="button"
16-
class="btn {{ form.style.add || 'btn-default' }} pull-right">
16+
class="btn pull-right" ng-class="form.style.add || 'btn-default'">
1717
<i class="glyphicon glyphicon-plus"></i>
18-
{{ form.add || 'Add'}}
18+
<span ng-bind="form.add || 'Add'"></span>
1919
</button>
2020
</div>
2121
<div class="help-block"

src/directives/decorators/bootstrap/bootstrap-decorator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ angular.module('schemaForm').config(['schemaFormDecoratorsProvider', function(de
4646
input: base + 'default.html',
4747
radios: base + 'radios.html',
4848
'radios-inline': base + 'radios-inline.html',
49-
radiobuttons: base + 'radio-buttons.html',
49+
radiobuttons: base + 'radio-buttons.html'
5050
});
5151

5252
}]).directive('sfFieldset', function() {

src/directives/decorators/bootstrap/checkboxes.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div sf-array="form" ng-model="$$value$$" class="form-group" ng-class="{'has-error': hasError(), 'has-success': hasSuccess()}">
2-
<label class="control-label" ng-show="showTitle()">{{form.title}}</label>
2+
<label class="control-label" ng-show="showTitle()" ng-bind="form.title"></label>
33
<div class="checkbox" ng-repeat="val in titleMapValues track by $index" >
44
<label>
55
<input type="checkbox"

src/directives/decorators/bootstrap/default.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<div class="form-group" ng-class="{'has-error': hasError(), 'has-success': hasSuccess(), 'has-feedback': form.feedback !== false }">
2-
<label class="control-label" ng-show="showTitle()">{{form.title}}</label>
2+
<label class="control-label" ng-show="showTitle()" ng-bind="form.title"></label>
33

44
<input ng-show="form.key"
5-
type="{{form.type}}"
5+
sf-default-input
6+
sf-type="form.type"
7+
sf-placeholder="form.placeholder"
68
sf-changed="form"
7-
placeholder="{{form.placeholder}}"
89
class="form-control"
910
ng-model-options="form.ngModelOptions"
1011
ng-model="$$value$$"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<fieldset ng-disabled="form.readonly">
2-
<legend ng-show="form.title">{{ form.title }}</legend>
2+
<legend ng-show="form.title" ng-bind="form.title"></legend>
33
<div class="help-block" ng-show="form.description" ng-bind-html="form.description"></div>
44
<div ng-transclude></div>
55
</fieldset>

0 commit comments

Comments
 (0)