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

Silenced console logging.

This commit is contained in:
Thomas Tanghus 2012-10-05 03:50:45 +02:00
parent b8d6b7bcfb
commit 0f419bf436
2 changed files with 33 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').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[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.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});
}
});
@ -1850,7 +1850,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');
}
@ -2107,7 +2107,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;
@ -2132,7 +2132,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.
},
@ -2217,13 +2217,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.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);
}
}