Skip to content

Commit

Permalink
Merge pull request #107 from owncloud/further-field-adjustments-2
Browse files Browse the repository at this point in the history
adding types selects to email, impp and tel
  • Loading branch information
DeepDiver1975 committed Mar 3, 2016
2 parents 45b4eb6 + da0ef06 commit ad89f0a
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 5 deletions.
26 changes: 24 additions & 2 deletions js/public/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -1154,17 +1154,39 @@ app.service('vCardPropertiesService', [function() {
email: {
multiple: true,
readableName: t('contacts', 'Email'),
template: 'text'
template: 'text',
defaultValue: {
value:[''],
meta:{type:['HOME']}
},
options: [
{id: 'HOME', name: t('contacts', 'Home')},
{id: 'WORK', name: t('contacts', 'Work')},
{id: 'OTHER', name: t('contacts', 'Other')}
]
},
impp: {
multiple: true,
readableName: t('contacts', 'Instant messaging'),
template: 'text'
template: 'text',
defaultValue: {
value:[''],
meta:{type:['HOME']}
},
options: [
{id: 'HOME', name: t('contacts', 'Home')},
{id: 'WORK', name: t('contacts', 'Work')},
{id: 'OTHER', name: t('contacts', 'Other')}
]
},
tel: {
multiple: true,
readableName: t('contacts', 'Phone'),
template: 'tel',
defaultValue: {
value:[''],
meta:{type:['HOME,VOICE']}
},
options: [
{id: 'HOME,VOICE', name: t('contacts', 'Home')},
{id: 'WORK,VOICE', name: t('contacts', 'Work')},
Expand Down
26 changes: 24 additions & 2 deletions js/services/vCardProperties.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,39 @@ app.service('vCardPropertiesService', [function() {
email: {
multiple: true,
readableName: t('contacts', 'Email'),
template: 'text'
template: 'text',
defaultValue: {
value:[''],
meta:{type:['HOME']}
},
options: [
{id: 'HOME', name: t('contacts', 'Home')},
{id: 'WORK', name: t('contacts', 'Work')},
{id: 'OTHER', name: t('contacts', 'Other')}
]
},
impp: {
multiple: true,
readableName: t('contacts', 'Instant messaging'),
template: 'text'
template: 'text',
defaultValue: {
value:[''],
meta:{type:['HOME']}
},
options: [
{id: 'HOME', name: t('contacts', 'Home')},
{id: 'WORK', name: t('contacts', 'Work')},
{id: 'OTHER', name: t('contacts', 'Other')}
]
},
tel: {
multiple: true,
readableName: t('contacts', 'Phone'),
template: 'tel',
defaultValue: {
value:[''],
meta:{type:['HOME,VOICE']}
},
options: [
{id: 'HOME,VOICE', name: t('contacts', 'Home')},
{id: 'WORK,VOICE', name: t('contacts', 'Work')},
Expand Down
6 changes: 5 additions & 1 deletion templates/detailItems/text.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<label for="details-{{ctrl.name}}">{{ctrl.meta.readableName}}</label>
<select ng-if="ctrl.availableOptions.length > 0" ng-model="ctrl.type" ng-model-options="{ debounce: 500 }" ng-change="ctrl.changeType(ctrl.type)">
<option ng-repeat="option in ctrl.availableOptions" value="{{option.id}}">{{option.name}}</option>
</select>
<label ng-if="ctrl.availableOptions.length === 0" for="details-{{ctrl.name}}">{{ctrl.meta.readableName}}</label>
<input type="text" id="details-{{ctrl.name}}" name="{{ctrl.name}}"
ng-model="ctrl.data.value" ng-model-options="{ debounce: 500 }"
ng-change="ctrl.model.updateContact()" value=""
placeholder="{{ctrl.meta.readableName}}"
focus-expression="$parent.ctrl.focus === ctrl.name"
/>
<button ng-click="ctrl.deleteField()" class="icon-delete" title="Delete"></button>

0 comments on commit ad89f0a

Please sign in to comment.