diff options
author | Thomas Tanghus <thomas@tanghus.net> | 2012-04-29 22:10:16 +0200 |
---|---|---|
committer | Thomas Tanghus <thomas@tanghus.net> | 2012-04-29 22:12:27 +0200 |
commit | f6fefe9a36b83466bf551065296d8ff56e7ecbb2 (patch) | |
tree | 335facdc1b71e18628c86cf8059a56f9ba5d40c8 /apps/contacts/js | |
parent | 023479b1e2a8f33e7d540bd77dc7d1070f9554f8 (diff) | |
download | nextcloud-server-f6fefe9a36b83466bf551065296d8ff56e7ecbb2.tar.gz nextcloud-server-f6fefe9a36b83466bf551065296d8ff56e7ecbb2.zip |
Contacts: Ensure TYPE parameters on email aren't deleted on edit. They are still not shown in the UI.
Remove an obsolute file and did some cleanup.
Diffstat (limited to 'apps/contacts/js')
-rw-r--r-- | apps/contacts/js/contacts.js | 38 |
1 files changed, 11 insertions, 27 deletions
diff --git a/apps/contacts/js/contacts.js b/apps/contacts/js/contacts.js index edb7da70407..7333b0e8d42 100644 --- a/apps/contacts/js/contacts.js +++ b/apps/contacts/js/contacts.js @@ -535,36 +535,9 @@ Contacts={ } }); }, - /*loadCategories:function(){ // On loading contact. - var categories = $('#categories_value').find('select'); - if(this.data.CATEGORIES) { - $('#categories_value').data('checksum', this.data.CATEGORIES[0]['checksum']); - } else { - $('#categories_value').data('checksum', ''); - } - categories.find('option').each(function(){ - if(Contacts.UI.Card.hasCategory($(this).val())) { - $(this).attr('selected', 'selected'); - } else { - $(this).removeAttr('selected'); - } - }); - categories.multiselect('refresh'); - },*/ editNew:function(){ // add a new contact this.id = ''; this.fn = ''; this.fullname = ''; this.givname = ''; this.famname = ''; this.addname = ''; this.honpre = ''; this.honsuf = ''; Contacts.UI.Card.add(t('contacts', 'Contact')+';'+t('contacts', 'New')+';;;', t('contacts', 'New Contact'), '', true); - /*$.getJSON(OC.filePath('contacts', 'ajax', 'newcontact.php'),{},function(jsondata){ - if(jsondata.status == 'success'){ - id = ''; - $('#rightcontent').data('id',''); - $('#rightcontent').html(jsondata.data.page); - //Contacts.UI.Card.editName(); - } else { - OC.dialogs.alert(jsondata.data.message, t('contacts', 'Error')); - //alert(jsondata.data.message); - } - });*/ }, savePropertyInternal:function(name, fields, oldchecksum, checksum){ // TODO: Add functionality for new fields. @@ -1212,6 +1185,7 @@ Contacts={ addMail:function() { //alert('addMail'); $('#emaillist li.template:first-child').clone().appendTo($('#emaillist')).show(); + $('#emaillist li.template:last-child').find('select').addClass('contacts_property'); $('#emaillist li.template:last-child').removeClass('template').addClass('propertycontainer'); $('#emaillist li:last-child').find('input[type="email"]').focus(); Contacts.UI.loadListHandlers(); @@ -1229,6 +1203,16 @@ Contacts={ if(param.toUpperCase() == 'PREF') { $('#emaillist li:last-child').find('input[type="checkbox"]').attr('checked', 'checked') } + else if(param.toUpperCase() == 'TYPE') { + for(etype in this.data.EMAIL[mail]['parameters'][param]) { + var et = this.data.EMAIL[mail]['parameters'][param][etype]; + $('#emaillist li:last-child').find('select option').each(function(){ + if($.inArray($(this).val().toUpperCase(), et.toUpperCase().split(',')) > -1) { + $(this).attr('selected', 'selected'); + } + }); + } + } } } if($('#emaillist li').length > 1) { |