Skip to content

Commit

Permalink
Revert "Jeton's interpolation provider"
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlgj committed Oct 14, 2014
1 parent 2b9d7b5 commit cf44b6e
Show file tree
Hide file tree
Showing 21 changed files with 39 additions and 84 deletions.
1 change: 0 additions & 1 deletion .gitignore
@@ -1,4 +1,3 @@
node_modules node_modules
coverage coverage
bower_components bower_components
.idea
2 changes: 1 addition & 1 deletion dist/bootstrap-decorator.min.js

Large diffs are not rendered by default.

21 changes: 0 additions & 21 deletions dist/schema-form.js
Expand Up @@ -1177,27 +1177,6 @@ angular.module('schemaForm').directive('sfChanged', function() {
}; };
}); });


/**
* Sets attributes 'type' and 'placeholder' to input elements
*/
angular.module('schemaForm').directive('sfDefaultInput', [function () {

return {
restrict: 'A',
scope: {
sfType: '=',
sfPlaceholder: '='
},
link: function (scope, element) {

element.attr('type', scope.sfType);
element.attr('placeholder', scope.sfPlaceholder);

}

};

}]);
/* /*
FIXME: real documentation FIXME: real documentation
<form sf-form="form" sf-schema="schema" sf-decorator="foobar"></form> <form sf-form="form" sf-schema="schema" sf-decorator="foobar"></form>
Expand Down
2 changes: 1 addition & 1 deletion dist/schema-form.min.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/directives/decorators/bootstrap/actions.html
@@ -1,11 +1,11 @@
<div class="btn-group"> <div class="btn-group">
<input ng-repeat-start="item in form.items" <input ng-repeat-start="item in form.items"
type="submit" type="submit"
class="btn" ng-class="item.style || 'btn-primary'" class="btn {{ item.style || 'btn-primary' }}"
ng-value="item.title" value="{{item.title}}"
ng-if="item.type === 'submit'"> ng-if="item.type === 'submit'">
<button ng-repeat-end class="btn" ng-class="item.style || 'btn-default'" <button ng-repeat-end class="btn {{ item.style || 'btn-default' }}"
type="button" type="button"
ng-if="item.type !== 'submit'" ng-if="item.type !== 'submit'"
ng-click="buttonClick($event,item)" ng-bind="item.title"></button> ng-click="buttonClick($event,item)">{{item.title}}</button>
</div> </div>
6 changes: 3 additions & 3 deletions src/directives/decorators/bootstrap/array.html
@@ -1,5 +1,5 @@
<div sf-array="form" ng-model="$$value$$" ng-model-options="form.ngModelOptions"> <div sf-array="form" ng-model="$$value$$" ng-model-options="form.ngModelOptions">
<h3 ng-show="form.title && form.notitle !== true" ng-bind="form.title"></h3> <h3 ng-show="form.title && form.notitle !== true">{{ form.title }}</h3>
<ol class="list-group" ng-model="modelArray" ui-sortable> <ol class="list-group" ng-model="modelArray" ui-sortable>
<li class="list-group-item" ng-repeat="item in modelArray track by $index"> <li class="list-group-item" ng-repeat="item in modelArray track by $index">
<button ng-click="deleteFromArray($index)" <button ng-click="deleteFromArray($index)"
Expand All @@ -13,9 +13,9 @@ <h3 ng-show="form.title && form.notitle !== true" ng-bind="form.title"></h3>
<div class="clearfix" style="padding: 15px;"> <div class="clearfix" style="padding: 15px;">
<button ng-click="appendToArray()" <button ng-click="appendToArray()"
type="button" type="button"
class="btn pull-right" ng-class="form.style.add || 'btn-default'"> class="btn {{ form.style.add || 'btn-default' }} pull-right">
<i class="glyphicon glyphicon-plus"></i> <i class="glyphicon glyphicon-plus"></i>
<span ng-bind="form.add || 'Add'"></span> {{ form.add || 'Add'}}
</button> </button>
</div> </div>
<div class="help-block" <div class="help-block"
Expand Down
2 changes: 1 addition & 1 deletion src/directives/decorators/bootstrap/bootstrap-decorator.js
Expand Up @@ -46,7 +46,7 @@ angular.module('schemaForm').config(['schemaFormDecoratorsProvider', function(de
input: base + 'default.html', input: base + 'default.html',
radios: base + 'radios.html', radios: base + 'radios.html',
'radios-inline': base + 'radios-inline.html', 'radios-inline': base + 'radios-inline.html',
radiobuttons: base + 'radio-buttons.html' radiobuttons: base + 'radio-buttons.html',
}); });


}]).directive('sfFieldset', function() { }]).directive('sfFieldset', function() {
Expand Down
2 changes: 1 addition & 1 deletion src/directives/decorators/bootstrap/checkboxes.html
@@ -1,5 +1,5 @@
<div sf-array="form" ng-model="$$value$$" class="form-group" ng-class="{'has-error': hasError(), 'has-success': hasSuccess()}"> <div sf-array="form" ng-model="$$value$$" class="form-group" ng-class="{'has-error': hasError(), 'has-success': hasSuccess()}">
<label class="control-label" ng-show="showTitle()" ng-bind="form.title"></label> <label class="control-label" ng-show="showTitle()">{{form.title}}</label>
<div class="checkbox" ng-repeat="val in titleMapValues track by $index" > <div class="checkbox" ng-repeat="val in titleMapValues track by $index" >
<label> <label>
<input type="checkbox" <input type="checkbox"
Expand Down
7 changes: 3 additions & 4 deletions src/directives/decorators/bootstrap/default.html
@@ -1,11 +1,10 @@
<div class="form-group" ng-class="{'has-error': hasError(), 'has-success': hasSuccess(), 'has-feedback': form.feedback !== false }"> <div class="form-group" ng-class="{'has-error': hasError(), 'has-success': hasSuccess(), 'has-feedback': form.feedback !== false }">
<label class="control-label" ng-show="showTitle()" ng-bind="form.title"></label> <label class="control-label" ng-show="showTitle()">{{form.title}}</label>


<input ng-show="form.key" <input ng-show="form.key"
sf-default-input type="{{form.type}}"
sf-type="form.type"
sf-placeholder="form.placeholder"
sf-changed="form" sf-changed="form"
placeholder="{{form.placeholder}}"
class="form-control" class="form-control"
ng-model-options="form.ngModelOptions" ng-model-options="form.ngModelOptions"
ng-model="$$value$$" ng-model="$$value$$"
Expand Down
2 changes: 1 addition & 1 deletion src/directives/decorators/bootstrap/fieldset-trcl.html
@@ -1,5 +1,5 @@
<fieldset ng-disabled="form.readonly"> <fieldset ng-disabled="form.readonly">
<legend ng-show="form.title" ng-bind="form.title"></legend> <legend ng-show="form.title">{{ form.title }}</legend>
<div class="help-block" ng-show="form.description" ng-bind-html="form.description"></div> <div class="help-block" ng-show="form.description" ng-bind-html="form.description"></div>
<div ng-transclude></div> <div ng-transclude></div>
</fieldset> </fieldset>
2 changes: 1 addition & 1 deletion src/directives/decorators/bootstrap/fieldset.html
@@ -1,5 +1,5 @@
<fieldset ng-disabled="form.readonly"> <fieldset ng-disabled="form.readonly">
<legend ng-show="form.title" ng-bind="form.title"></legend> <legend ng-show="form.title">{{ form.title }}</legend>
<div class="help-block" ng-show="form.description" ng-bind-html="form.description"></div> <div class="help-block" ng-show="form.description" ng-bind-html="form.description"></div>
<sf-decorator ng-repeat="item in form.items" form="item"></sf-decorator> <sf-decorator ng-repeat="item in form.items" form="item"></sf-decorator>
</fieldset> </fieldset>
4 changes: 2 additions & 2 deletions src/directives/decorators/bootstrap/radio-buttons.html
@@ -1,9 +1,9 @@
<div class="form-group" ng-class="{'has-error': hasError(), 'has-success': hasSuccess()}"> <div class="form-group" ng-class="{'has-error': hasError(), 'has-success': hasSuccess()}">
<div> <div>
<label class="control-label" ng-show="showTitle()" ng-bind="form.title"></label> <label class="control-label" ng-show="showTitle()">{{form.title}}</label>
</div> </div>
<div class="btn-group"> <div class="btn-group">
<label class="btn" ng-class="(item.value === $$value$$) ? form.style.selected || 'btn-primary' : form.style.unselected || 'btn-primary'" <label class="btn {{ (item.value === $$value$$) ? form.style.selected || 'btn-primary' : form.style.unselected || 'btn-primary'; }}"
ng-class="{ active: item.value === $$value$$ }" ng-class="{ active: item.value === $$value$$ }"
ng-repeat="item in form.titleMap"> ng-repeat="item in form.titleMap">
<input type="radio" <input type="radio"
Expand Down
2 changes: 1 addition & 1 deletion src/directives/decorators/bootstrap/radios-inline.html
@@ -1,5 +1,5 @@
<div class="form-group" ng-class="{'has-error': hasError(), 'has-success': hasSuccess()}"> <div class="form-group" ng-class="{'has-error': hasError(), 'has-success': hasSuccess()}">
<label class="control-label" ng-show="showTitle()" ng-bind="form.title"></label> <label class="control-label" ng-show="showTitle()">{{form.title}}</label>
<div> <div>
<label class="radio-inline" ng-repeat="item in form.titleMap" > <label class="radio-inline" ng-repeat="item in form.titleMap" >
<input type="radio" <input type="radio"
Expand Down
2 changes: 1 addition & 1 deletion src/directives/decorators/bootstrap/radios.html
@@ -1,5 +1,5 @@
<div class="form-group" ng-class="{'has-error': hasError(), 'has-success': hasSuccess()}"> <div class="form-group" ng-class="{'has-error': hasError(), 'has-success': hasSuccess()}">
<label class="control-label" ng-show="showTitle()" ng-bind="form.title"></label> <label class="control-label" ng-show="showTitle()">{{form.title}}</label>
<div class="radio" ng-repeat="item in form.titleMap" > <div class="radio" ng-repeat="item in form.titleMap" >
<label> <label>
<input type="radio" <input type="radio"
Expand Down
6 changes: 3 additions & 3 deletions src/directives/decorators/bootstrap/readonly.html
@@ -1,6 +1,6 @@
<div class="form-group"> <div class="form-group">
<label ng-show="showTitle()" ng-bind="form.title"></label> <label ng-show="showTitle()">{{form.title}}</label>
<input ng-if="form.type !== 'textarea'" type="text" disabled class="form-control" ng-value="$$value$$"> <input ng-if="form.type !== 'textarea'" type="text" disabled class="form-control" value="{{$$value$$}}">
<textarea ng-if="form.type === 'textarea'" disabled class="form-control" ng-bind="$$value$$"></textarea> <textarea ng-if="form.type === 'textarea'" disabled class="form-control">{{$$value$$}}</textarea>
<div class="help-block" ng-show="form.description" ng-bind-html="form.description"></div> <div class="help-block" ng-show="form.description" ng-bind-html="form.description"></div>
</div> </div>
4 changes: 3 additions & 1 deletion src/directives/decorators/bootstrap/select.html
@@ -1,5 +1,7 @@
<div class="form-group" ng-class="{'has-error': hasError(), 'has-success': hasSuccess(), 'has-feedback': form.feedback !== false}"> <div class="form-group" ng-class="{'has-error': hasError(), 'has-success': hasSuccess(), 'has-feedback': form.feedback !== false}">
<label class="control-label" ng-show="showTitle()" ng-bind="form.title"></label> <label class="control-label" ng-show="showTitle()">
{{form.title}}
</label>
<select ng-model="$$value$$" <select ng-model="$$value$$"
ng-model-options="form.ngModelOptions" ng-model-options="form.ngModelOptions"
sf-changed="form" sf-changed="form"
Expand Down
10 changes: 4 additions & 6 deletions src/directives/decorators/bootstrap/submit.html
@@ -1,12 +1,10 @@
<div class="form-group"> <div class="form-group">
<input type="submit" <input type="submit"
class="btn" class="btn {{ form.style || 'btn-primary' }}"
ng-class="form.style || 'btn-primary'" value="{{form.title}}"
ng-value="form.title"
ng-if="form.type === 'submit'"> ng-if="form.type === 'submit'">
<button class="btn" <button class="btn {{ form.style || 'btn-default' }}"
ng-class="form.style || 'btn-default'"
type="button" type="button"
ng-click="buttonClick($event,form)" ng-click="buttonClick($event,form)"
ng-if="form.type !== 'submit'" ng-bind="form.title"></button> ng-if="form.type !== 'submit'">{{form.title}}</button>
</div> </div>
13 changes: 6 additions & 7 deletions src/directives/decorators/bootstrap/tabarray.html
Expand Up @@ -8,12 +8,12 @@
<li ng-repeat="item in modelArray track by $index" <li ng-repeat="item in modelArray track by $index"
ng-click="$event.preventDefault() || (selected.tab = $index)" ng-click="$event.preventDefault() || (selected.tab = $index)"
ng-class="{active: selected.tab === $index}"> ng-class="{active: selected.tab === $index}">
<a href="#" ng-bind="evalExpr(form.title,{'$index':$index, value: item}) || $index"></a> <a href="#">{{evalExpr(form.title,{'$index':$index, value: item}) || $index}}</a>
</li> </li>
<li ng-click="$event.preventDefault() || (selected.tab = appendToArray().length - 1)"> <li ng-click="$event.preventDefault() || (selected.tab = appendToArray().length - 1)">
<a href="#"> <a href="#">
<i class="glyphicon glyphicon-plus"></i> <i class="glyphicon glyphicon-plus"></i>
<span ng-bind="form.add || 'Add'"></span> {{ form.add || 'Add'}}
</a> </a>
</li> </li>
</ul> </ul>
Expand All @@ -30,10 +30,9 @@


<button ng-click="selected.tab = deleteFromArray($index).length - 1" <button ng-click="selected.tab = deleteFromArray($index).length - 1"
type="button" type="button"
class="btn pull-right" class="btn {{ form.style.remove || 'btn-default' }} pull-right">
ng-class="form.style.remove || 'btn-default'">
<i class="glyphicon glyphicon-trash"></i> <i class="glyphicon glyphicon-trash"></i>
<span ng-bind="form.remove || 'Remove'"></span> {{ form.remove || 'Remove'}}
</button> </button>
</div> </div>
</div> </div>
Expand All @@ -45,12 +44,12 @@
<li ng-repeat="item in modelArray track by $index" <li ng-repeat="item in modelArray track by $index"
ng-click="$event.preventDefault() || (selected.tab = $index)" ng-click="$event.preventDefault() || (selected.tab = $index)"
ng-class="{active: selected.tab === $index}"> ng-class="{active: selected.tab === $index}">
<a href="#" ng-bind="evalExpr(form.title,{'$index':$index, value: item}) || $index"></a> <a href="#">{{evalExpr(form.title,{'$index':$index, value: item}) || $index}}</a>
</li> </li>
<li ng-click="$event.preventDefault() || appendToArray()"> <li ng-click="$event.preventDefault() || appendToArray()">
<a href="#"> <a href="#">
<i class="glyphicon glyphicon-plus"></i> <i class="glyphicon glyphicon-plus"></i>
<span ng-bind="form.add || 'Add'"></span> {{ form.add || 'Add'}}
</a> </a>
</li> </li>
</ul> </ul>
Expand Down
2 changes: 1 addition & 1 deletion src/directives/decorators/bootstrap/tabs.html
Expand Up @@ -3,7 +3,7 @@
<li ng-repeat="tab in form.tabs" <li ng-repeat="tab in form.tabs"
ng-click="$event.preventDefault() || (selected.tab = $index)" ng-click="$event.preventDefault() || (selected.tab = $index)"
ng-class="{active: selected.tab === $index}"> ng-class="{active: selected.tab === $index}">
<a href="#" ng-bind="tab.title"></a> <a href="#">{{ tab.title }}</a>
</li> </li>
</ul> </ul>


Expand Down
4 changes: 2 additions & 2 deletions src/directives/decorators/bootstrap/textarea.html
@@ -1,5 +1,5 @@
<div class="form-group has-feedback" ng-class="{'has-error': hasError(), 'has-success': hasSuccess()}"> <div class="form-group has-feedback" ng-class="{'has-error': hasError(), 'has-success': hasSuccess()}">
<label ng-show="showTitle()" ng-bind="form.title"></label> <label ng-show="showTitle()">{{form.title}}</label>
<textarea class="form-control" <textarea class="form-control"
sf-changed="form" sf-changed="form"
ng-model="$$value$$" ng-model="$$value$$"
Expand All @@ -10,5 +10,5 @@
class="form-control-feedback" class="form-control-feedback"
ng-class="evalInScope(form.feedback) || { 'glyphicon': true, 'glyphicon-ok': hasSuccess(), 'glyphicon-remove': hasError() }"></span> ng-class="evalInScope(form.feedback) || { 'glyphicon': true, 'glyphicon-ok': hasSuccess(), 'glyphicon-remove': hasError() }"></span>
--> -->
<span class="help-block" ng-bind="(hasError() && errorMessage(schemaError())) || form.description"></span> <span class="help-block">{{ (hasError() && errorMessage(schemaError())) || form.description}}</span>
</div> </div>
21 changes: 0 additions & 21 deletions src/directives/default-input.js

This file was deleted.

0 comments on commit cf44b6e

Please sign in to comment.