Merge branch 'master' of gitorious.org:owncloud/owncloud into ace-editor

This commit is contained in:
Tom Needham 2011-12-06 23:11:36 +00:00
commit afa93c1f28
7 changed files with 28 additions and 11 deletions

View File

@ -107,7 +107,12 @@ OC_Contacts_VCard::edit($id,$vcard->serialize());
$adr_types = OC_Contacts_VCard::getTypesOfProperty($l10n, 'ADR'); $adr_types = OC_Contacts_VCard::getTypesOfProperty($l10n, 'ADR');
$phone_types = OC_Contacts_VCard::getTypesOfProperty($l10n, 'TEL'); $phone_types = OC_Contacts_VCard::getTypesOfProperty($l10n, 'TEL');
$tmpl = new OC_Template('contacts','part.property'); if ($vcard->children[$line]->name == 'FN'){
$tmpl = new OC_Template('contacts','part.property.FN');
}
else{
$tmpl = new OC_Template('contacts','part.property');
}
$tmpl->assign('adr_types',$adr_types); $tmpl->assign('adr_types',$adr_types);
$tmpl->assign('phone_types',$phone_types); $tmpl->assign('phone_types',$phone_types);
$tmpl->assign('property',OC_Contacts_VCard::structureProperty($vcard->children[$line],$line)); $tmpl->assign('property',OC_Contacts_VCard::structureProperty($vcard->children[$line],$line));

View File

@ -110,7 +110,7 @@ $(document).ready(function(){
$('.contacts_property [data-use="edit"]').live('click',function(){ $('.contacts_property [data-use="edit"]').live('click',function(){
var id = $('#rightcontent').data('id'); var id = $('#rightcontent').data('id');
var checksum = $(this).parents('li').first().data('checksum'); var checksum = $(this).parents('.contacts_property').first().data('checksum');
$.getJSON('ajax/showsetproperty.php',{'id': id, 'checksum': checksum },function(jsondata){ $.getJSON('ajax/showsetproperty.php',{'id': id, 'checksum': checksum },function(jsondata){
if(jsondata.status == 'success'){ if(jsondata.status == 'success'){
$('.contacts_property[data-checksum="'+checksum+'"]').html(jsondata.data.page) $('.contacts_property[data-checksum="'+checksum+'"]').html(jsondata.data.page)

View File

@ -1,5 +1,5 @@
<?php if(array_key_exists('FN',$_['details'])): ?> <?php if(array_key_exists('FN',$_['details'])): ?>
<p id="contacts_details_name"><?php echo $_['details']['FN'][0]['value']; ?></p> <?php echo $this->inc('part.property.FN', array('property' => $_['details']['FN'][0])); ?>
<img class="svg action" id="contacts_deletecard" src="<?php echo image_path('', 'actions/delete.svg'); ?>" title="<?php echo $l->t('Delete contact');?>" /> <img class="svg action" id="contacts_deletecard" src="<?php echo image_path('', 'actions/delete.svg'); ?>" title="<?php echo $l->t('Delete contact');?>" />
<?php if(isset($_['details']['PHOTO'])): // Emails first ?> <?php if(isset($_['details']['PHOTO'])): // Emails first ?>

View File

@ -0,0 +1,9 @@
<p id="contacts_details_name" class="contacts_property" data-checksum="<?php echo $_['property']['checksum']; ?>">
<?php echo $_['property']['value']; ?>
<span style="display:none;" data-use="edit"><img class="svg action" src="<?php echo image_path('', 'actions/rename.svg'); ?>" /></span>
</p>
<?php if (!isset($_['details'])): ?>
<script>
$('#leftcontent li.active a').text('<?php echo $_['property']['value']; ?>');
</script>
<?php endif ?>

View File

@ -1,7 +1,9 @@
<form id="contacts_setpropertyform"> <form id="contacts_setpropertyform">
<input type="hidden" name="checksum" value="<?php echo $_['property']['checksum']; ?>"> <input type="hidden" name="checksum" value="<?php echo $_['property']['checksum']; ?>">
<input type="hidden" name="id" value="<?php echo $_['id']; ?>"> <input type="hidden" name="id" value="<?php echo $_['id']; ?>">
<?php if($_['property']['name']=='ADR'): ?> <?php if($_['property']['name']=='FN'): ?>
<p class="contacts_property_data"><input id="fn" type="text" name="value" value="<?php echo $_['property']['value']; ?>"></p>
<?php elseif($_['property']['name']=='ADR'): ?>
<p class="contacts_property_name"><label for="adr_pobox"><?php echo $l->t('Address'); ?></label></p> <p class="contacts_property_name"><label for="adr_pobox"><?php echo $l->t('Address'); ?></label></p>
<ol class="contacts_property_data" id="contacts_addresspart"> <ol class="contacts_property_data" id="contacts_addresspart">
<li class="input"> <li class="input">

View File

@ -125,7 +125,7 @@ FileList={
tr.data('renaming',true); tr.data('renaming',true);
var td=tr.children('td.filename'); var td=tr.children('td.filename');
var input=$('<input class="filename"></input>').val(name); var input=$('<input class="filename"></input>').val(name);
var form=$('<form action="#"></form>') var form=$('<form></form>')
form.append(input); form.append(input);
td.children('a.name').text(''); td.children('a.name').text('');
td.children('a.name').append(form) td.children('a.name').append(form)
@ -134,7 +134,6 @@ FileList={
event.stopPropagation(); event.stopPropagation();
event.preventDefault(); event.preventDefault();
var newname=input.val(); var newname=input.val();
tr.data('renaming',false);
tr.attr('data-file',newname); tr.attr('data-file',newname);
td.children('a.name').empty(); td.children('a.name').empty();
if(newname.indexOf('.')>0){ if(newname.indexOf('.')>0){
@ -148,12 +147,12 @@ FileList={
if(newname.indexOf('.')>0){ if(newname.indexOf('.')>0){
span.append($('<span class="extention">'+newname.substr(newname.lastIndexOf('.'))+'</span>')); span.append($('<span class="extention">'+newname.substr(newname.lastIndexOf('.'))+'</span>'));
} }
$.ajax({ $.get(OC.filePath('files','ajax','rename.php'), { dir : $('#dir').val(), newname: newname, file: name },function(){
url: 'ajax/rename.php', tr.data('renaming',false);
data: { dir : $('#dir').val(), newname: newname, file: name }
}); });
return false;
}); });
form.click(function(event){ input.click(function(event){
event.stopPropagation(); event.stopPropagation();
event.preventDefault(); event.preventDefault();
}); });

View File

@ -70,7 +70,9 @@ $(document).ready(function() {
procesSelection(); procesSelection();
} else { } else {
var filename=$(this).parent().parent().attr('data-file'); var filename=$(this).parent().parent().attr('data-file');
if(!FileList.isLoading(filename)){ var tr=$('tr').filterAttr('data-file',filename);
var renaming=tr.data('renaming')
if(!renaming && !FileList.isLoading(filename)){
var mime=$(this).parent().parent().data('mime'); var mime=$(this).parent().parent().data('mime');
var type=$(this).parent().parent().data('type'); var type=$(this).parent().parent().data('type');
var action=FileActions.getDefault(mime,type); var action=FileActions.getDefault(mime,type);