1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2024-11-29 11:24:11 +01:00

Merge branch 'master' of github.com:owncloud/apps into contacts_rework

This commit is contained in:
Thomas Tanghus 2012-10-05 03:52:25 +02:00
commit 9bfe53bbb9
4 changed files with 39 additions and 33 deletions

View File

@ -311,7 +311,7 @@ OC.Contacts={
update:function(params) { // params {cid:int, aid:int}
if(!params) { params = {}; }
$('#contacts li,#contacts h3').removeClass('active');
console.log('Card, cid: ' + params.cid + ' aid: ' + params.aid);
//console.log('Card, cid: ' + params.cid + ' aid: ' + params.aid);
var newid, bookid, firstitem;
if(!parseInt(params.cid) && !parseInt(params.aid)) {
firstitem = $('#contacts ul').find('li:first-child');
@ -328,7 +328,7 @@ OC.Contacts={
} else if(parseInt(params.cid) && !parseInt(params.aid)) {
newid = parseInt(params.cid);
var listitem = OC.Contacts.Contacts.getContact(newid); //$('#contacts li[data-id="'+newid+'"]');
console.log('Is contact in list? ' + listitem.length);
//console.log('Is contact in list? ' + listitem.length);
if(listitem.length) {
//bookid = parseInt($('#contacts li[data-id="'+newid+'"]').data('bookid'));
bookid = parseInt(OC.Contacts.Contacts.getContact(newid).data('bookid'));
@ -343,7 +343,7 @@ OC.Contacts={
bookid = parseInt($('#contacts h3.addressbook').first().data('id'));
newid = parseInt($('#contacts').find('li[data-bookid="'+bookid+'"]').first().data('id'));
}
console.log('newid: ' + newid + ' bookid: ' +bookid);
//console.log('newid: ' + newid + ' bookid: ' +bookid);
var localLoadContact = function(newid, bookid) {
if($('.contacts li').length > 0) {
$.getJSON(OC.filePath('contacts', 'ajax', 'contact/details.php'),{'id':newid},function(jsondata){
@ -368,12 +368,12 @@ OC.Contacts={
// Make sure proper DOM is loaded.
if(newid) {
console.log('Loading card DOM');
//console.log('Loading card DOM');
localLoadContact(newid, bookid);
$('#firstrun').hide();
$('#card').show();
} else if(!newid) {
console.log('Loading intro');
//console.log('Loading intro');
// show intro page
$('#firstrun').show();
$('#card').hide();
@ -381,7 +381,7 @@ OC.Contacts={
$('#contacts h3.addressbook[data-id="'+bookid+'"]').addClass('active');
},
setEnabled:function(enabled) {
console.log('setEnabled', enabled);
//console.log('setEnabled', enabled);
$('.contacts_property,.action').each(function () {
$(this).prop('disabled', !enabled);
OC.Contacts.Card.enabled = enabled;
@ -409,7 +409,7 @@ OC.Contacts={
return false;
},
add:function(n, fn, aid, isnew) { // add a new contact
console.log('Adding ' + fn);
//console.log('Adding ' + fn);
$('#firstrun').hide();
$('#card').show();
aid = aid?aid:$('#contacts h3.addressbook.active').first().data('id');
@ -481,7 +481,7 @@ OC.Contacts={
message:t('contacts','Click to undo deletion of "') + curlistitem.find('a').text() + '"',
//timeout:5,
timeouthandler:function(contact) {
console.log('timeout');
//console.log('timeout');
OC.Contacts.Card.doDelete(contact.data('id'), true, function(res) {
if(!res) {
OC.Contacts.Contacts.insertContact({contact:contact});
@ -508,7 +508,7 @@ OC.Contacts={
}
if(OC.Contacts.Contacts.deletionQueue.indexOf(parseInt(id)) == -1 && removeFromQueue) {
console.log('returning');
//console.log('returning');
updateQueue(id, removeFromQueue);
if(typeof cb == 'function') {
cb(true);
@ -560,7 +560,7 @@ OC.Contacts={
$('#contacts_propertymenu_dropdown a[data-type="NOTE"]').parent().show();
}
var permissions = OC.Contacts.Card.permissions = parseInt(this.data.permissions);
console.log('permissions', permissions);
//console.log('permissions', permissions);
this.setEnabled(permissions == 0
|| permissions & OC.PERMISSION_UPDATE
|| permissions & OC.PERMISSION_DELETE);
@ -755,7 +755,7 @@ OC.Contacts={
q = q + '&id=' + this.id + '&name=' + name;
if(checksum != undefined && checksum != '') { // save
q = q + '&checksum=' + checksum;
console.log('Saving: ' + q);
//console.log('Saving: ' + q);
$(obj).attr('disabled', 'disabled');
$.post(OC.filePath('contacts', 'ajax', 'contact/saveproperty.php'),q,function(jsondata){
if(!jsondata) {
@ -781,7 +781,7 @@ OC.Contacts={
}
},'json');
} else { // add
console.log('Adding: ' + q);
//console.log('Adding: ' + q);
$(obj).attr('disabled', 'disabled');
$.post(OC.filePath('contacts', 'ajax', 'contact/addproperty.php'),q,function(jsondata){
if(jsondata.status == 'success'){
@ -848,7 +848,7 @@ OC.Contacts={
}
},
deleteProperty:function(obj, type) {
console.log('deleteProperty');
//console.log('deleteProperty');
if(!this.enabled) {
return;
}
@ -1716,7 +1716,7 @@ OC.Contacts={
this.next(true);
},
nextAddressbook:function(reverse) {
console.log('nextAddressbook', reverse);
//console.log('nextAddressbook', reverse);
var curlistitem = this.getContact(OC.Contacts.Card.id);
var parent = curlistitem.parent('ul');
var newparent = reverse
@ -1736,7 +1736,7 @@ OC.Contacts={
}
},
previousAddressbook:function() {
console.log('previousAddressbook');
//console.log('previousAddressbook');
this.nextAddressbook(true);
},
// Reload the contacts list.
@ -1750,7 +1750,7 @@ OC.Contacts={
}
}
self = this;
console.log('update: ' + params.cid + ' ' + params.aid + ' ' + params.start);
//console.log('update: ' + params.cid + ' ' + params.aid + ' ' + params.start);
var firstrun = false;
var opts = {};
opts['startat'] = (params.start?params.start:0);
@ -1814,7 +1814,7 @@ OC.Contacts={
var bookid = $(this).data('bookid');
var numsiblings = $('.contacts li[data-bookid="'+bookid+'"]').length;
if (isInView && numsiblings >= self.batchnum) {
console.log('This would be a good time to load more contacts.');
//console.log('This would be a good time to load more contacts.');
OC.Contacts.Contacts.update({cid:params.cid, aid:bookid, start:$('#contacts li[data-bookid="'+bookid+'"]').length});
}
});
@ -1918,7 +1918,7 @@ OC.Contacts={
scrollTo:function(id){
var item = $('#contacts li[data-id="'+id+'"]');
if(item && $.isNumeric(item.offset().top)) {
console.log('scrollTo ' + parseInt(item.offset().top));
//console.log('scrollTo ' + parseInt(item.offset().top));
$('#contacts').animate({
scrollTop: parseInt(item.offset()).top-40}, 'slow','swing');
}
@ -2175,7 +2175,7 @@ $(document).ready(function(){
return false;
})
.error(function(jqXHR, textStatus, errorThrown) {
console.log(textStatus);
//console.log(textStatus);
OC.Contacts.notify({message:errorThrown + ': ' + textStatus,});
});
uploadingFiles[fileName] = jqXHR;
@ -2200,7 +2200,7 @@ $(document).ready(function(){
}
},
fail: function(e, data) {
console.log('fail');
//console.log('fail');
OC.Contacts.notify({message:data.errorThrown + ': ' + data.textStatus});
// TODO: Remove file from upload queue.
},
@ -2285,13 +2285,13 @@ $(document).ready(function(){
setTimeout(function() {
importFiles(aid, uploadingFiles);
}, 500);
console.log('aid ' + aid);
//console.log('aid ' + aid);
});
} else {
setTimeout(function() {
importFiles(aid, uploadingFiles);
}, 500);
console.log('aid ' + aid);
//console.log('aid ' + aid);
$(this).dialog('close');
}
},

View File

@ -3,7 +3,7 @@ OC.Contacts.Settings = OC.Contacts.Settings || {
init:function() {
this.Addressbook.adrsettings = $('.addressbooks-settings').first();
this.Addressbook.adractions = $('#contacts-settings').find('div.actions');
console.log('actions: ' + this.Addressbook.adractions.length);
//console.log('actions: ' + this.Addressbook.adractions.length);
OC.Share.loadIcons('addressbook');
},
Addressbook:{
@ -13,7 +13,7 @@ OC.Contacts.Settings = OC.Contacts.Settings || {
},
doActivate:function(id, tgt) {
var active = tgt.is(':checked');
console.log('doActivate: ', id, active);
//console.log('doActivate: ', id, active);
$.post(OC.filePath('contacts', 'ajax', 'addressbook/activate.php'), {id: id, active: Number(active)}, function(jsondata) {
if (jsondata.status == 'success'){
if(!active) {
@ -22,14 +22,14 @@ OC.Contacts.Settings = OC.Contacts.Settings || {
OC.Contacts.update();
}
} else {
console.log('Error:', jsondata.data.message);
//console.log('Error:', jsondata.data.message);
OC.Contacts.notify(t('contacts', 'Error') + ': ' + jsondata.data.message);
tgt.checked = !active;
}
});
},
doDelete:function(id) {
console.log('doDelete: ', id);
//console.log('doDelete: ', id);
var check = confirm('Do you really want to delete this address book?');
if(check == false){
return false;
@ -49,7 +49,7 @@ OC.Contacts.Settings = OC.Contacts.Settings || {
}
},
doEdit:function(id) {
console.log('doEdit: ', id);
//console.log('doEdit: ', id);
var owner = this.adrsettings.find('[data-id="'+id+'"]').data('owner');
var actions = ['description', 'save', 'cancel'];
if(owner == OC.currentUser || id === 'new') {
@ -59,7 +59,7 @@ OC.Contacts.Settings = OC.Contacts.Settings || {
var name = this.adrsettings.find('[data-id="'+id+'"]').find('.name').text();
var description = this.adrsettings.find('[data-id="'+id+'"]').find('.description').text();
var active = this.adrsettings.find('[data-id="'+id+'"]').find(':checkbox').is(':checked');
console.log('name, desc', name, description);
//console.log('name, desc', name, description);
this.adractions.find('.active').prop('checked', active);
this.adractions.find('.name').val(name);
this.adractions.find('.description').val(description);
@ -70,7 +70,7 @@ OC.Contacts.Settings = OC.Contacts.Settings || {
var description = this.adractions.find('.description').val();
var active = this.adractions.find('.active').is(':checked');
var id = this.adractions.data('id');
console.log('doSave:', id, name, description, active);
//console.log('doSave:', id, name, description, active);
if(name.length == 0) {
OC.dialogs.alert(t('contacts', 'Displayname cannot be empty.'), t('contacts', 'Error'));
@ -115,7 +115,7 @@ OC.Contacts.Settings = OC.Contacts.Settings || {
});
},
showLink:function(id, row, link) {
console.log('row:', row.length);
//console.log('row:', row.length);
row.next('tr.link').remove();
var linkrow = $('<tr class="link"><td colspan="5"><input style="width: 95%;" type="text" value="'+link+'" /></td>'
+ '<td colspan="3"><button>'+t('contacts', 'Cancel')+'</button></td></tr>').insertAfter(row);
@ -125,19 +125,19 @@ OC.Contacts.Settings = OC.Contacts.Settings || {
});
},
showCardDAV:function(id) {
console.log('showCardDAV: ', id);
//console.log('showCardDAV: ', id);
var row = this.adrsettings.find('tr[data-id="'+id+'"]');
var owner = row.data('owner');
var uri = (owner === oc_current_user ) ? row.data('uri') : row.data('uri') + '_shared_by_' + owner;
this.showLink(id, row, totalurl+'/'+encodeURIComponent(oc_current_user)+'/'+encodeURIComponent(uri));
},
showVCF:function(id) {
console.log('showVCF: ', id);
//console.log('showVCF: ', id);
var row = this.adrsettings.find('tr[data-id="'+id+'"]');
var owner = row.data('owner');
var uri = (owner === oc_current_user ) ? row.data('uri') : row.data('uri') + '_shared_by_' + owner;
var link = totalurl+'/'+encodeURIComponent(oc_current_user)+'/'+encodeURIComponent(uri)+'?export';
console.log(link);
//console.log(link);
this.showLink(id, row, link);
}
}

View File

@ -58,6 +58,7 @@
"You do not have permission to add contacts to " => "Nie masz uprawnień dodawania kontaktów do",
"Please select one of your own address books." => "Wybierz własną książkę adresową.",
"Permission error" => "Błąd uprawnień",
"Click to undo deletion of \"" => "Kliknij aby cofnąć usunięcie \"",
"This property has to be non-empty." => "Ta właściwość nie może być pusta.",
"Couldn't serialize elements." => "Nie można serializować elementów.",
"'deleteProperty' called without type argument. Please report at bugs.owncloud.org" => "\"deleteProperty' wywołana bez argumentu typu. Proszę raportuj na bugs.owncloud.org",
@ -67,7 +68,9 @@
"Error loading profile picture." => "Błąd wczytywania zdjęcia profilu.",
"Some contacts are marked for deletion, but not deleted yet. Please wait for them to be deleted." => "Niektóre kontakty są zaznaczone do usunięcia, ale nie są usunięte jeszcze. Proszę czekać na ich usunięcie.",
"Do you want to merge these address books?" => "Czy chcesz scalić te książki adresowe?",
"Shared by " => "Udostępniane przez",
"Upload too large" => "Załadunek za duży",
"Only image files can be used as profile picture." => "Tylko obrazki mogą być użyte jako zdjęcie profilowe.",
"Wrong file type" => "Zły typ pliku",
"Unable to upload your file as it is a directory or has 0 bytes" => "Nie można przesłać pliku, ponieważ to jest katalog lub ma 0 bajtów",
"Upload Error" => "Błąd ładowania",
@ -88,6 +91,7 @@
"Delete" => "Usuwa książkę adresową",
"Cancel" => "Anuluj",
"More..." => "Więcej...",
"Less..." => "Mniej...",
"You do not have the permissions to read this addressbook." => "Nie masz uprawnień do przeglądania tej ksiązki adresowej.",
"You do not have the permissions to update this addressbook." => "Nie masz uprawnień do aktualizacji tej książki adresowej.",
"There was an error updating the addressbook." => "Wystąpił błąd podczas aktualizowania książki adresowej.",

View File

@ -689,6 +689,8 @@ class OC_Contacts_VCard {
return null; // Badly malformed :-(
}
}
} elseif($property->name == 'PHOTO') {
$property->value = true;
}
elseif($property->name == 'IMPP') {
if(strpos($value, ':') !== false) {