1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2025-01-30 19:52:17 +01:00

Merge branch 'master' into multi_app_dir

This commit is contained in:
Brice Maron 2012-06-07 19:11:55 +00:00
commit 7009e70bf5
5 changed files with 49 additions and 35 deletions

View File

@ -31,8 +31,9 @@ dl.form { width: 100%; float: left; clear: right; margin: 0; padding: 0; }
.form dt { display: table-cell; clear: left; float: left; width: 7em; margin: 0; padding: 0.8em 0.5em 0 0; text-align:right; text-overflow:ellipsis; o-text-overflow: ellipsis; vertical-align: text-bottom; color: #bbb;/* white-space: pre-wrap; white-space: -moz-pre-wrap !important; white-space: -pre-wrap; white-space: -o-pre-wrap;*/ } .form dt { display: table-cell; clear: left; float: left; width: 7em; margin: 0; padding: 0.8em 0.5em 0 0; text-align:right; text-overflow:ellipsis; o-text-overflow: ellipsis; vertical-align: text-bottom; color: #bbb;/* white-space: pre-wrap; white-space: -moz-pre-wrap !important; white-space: -pre-wrap; white-space: -o-pre-wrap;*/ }
.form dd { display: table-cell; clear: right; float: left; margin: 0; padding: 0px; white-space: nowrap; vertical-align: text-bottom; } .form dd { display: table-cell; clear: right; float: left; margin: 0; padding: 0px; white-space: nowrap; vertical-align: text-bottom; }
label:hover, dt:hover { color: #333; } label:hover, dt:hover { color: #333; }
#address.form dt { min-width: 5em; } /*::-webkit-input-placeholder { color: #bbb; }
#address.form dl { min-width: 10em; } :-moz-placeholder { color: #bbb; }
:-ms-input-placeholder { color: #bbb; }*/
.droptarget { margin: 0.5em; padding: 0.5em; border: thin solid #ccc; -moz-border-radius:.3em; -webkit-border-radius:.3em; border-radius:.3em; } .droptarget { margin: 0.5em; padding: 0.5em; border: thin solid #ccc; -moz-border-radius:.3em; -webkit-border-radius:.3em; border-radius:.3em; }
.droppable { margin: 0.5em; padding: 0.5em; border: thin dashed #333; -moz-border-radius:.3em; -webkit-border-radius:.3em; border-radius:.3em; } .droppable { margin: 0.5em; padding: 0.5em; border: thin dashed #333; -moz-border-radius:.3em; -webkit-border-radius:.3em; border-radius:.3em; }
.loading { background: url('%webroot%/core/img/loading.gif') no-repeat center !important; /*cursor: progress; */ cursor: wait; } .loading { background: url('%webroot%/core/img/loading.gif') no-repeat center !important; /*cursor: progress; */ cursor: wait; }
@ -79,10 +80,17 @@ label:hover, dt:hover { color: #333; }
#addressdisplay { padding: 0.5em; } #addressdisplay { padding: 0.5em; }
dl.addresscard { background-color: #fff; float: left; width: auto; margin: 0 0.3em 0.3em 0.3em; padding: 0; border: 0; } dl.addresscard { background-color: #fff; float: left; width: auto; margin: 0 0.3em 0.3em 0.3em; padding: 0; border: 0; }
dl.addresscard dd {} dl.addresscard dd {}
dl.addresscard dt { padding: 0.3em; font-weight: bold; clear: both; color: #bbb;} dl.addresscard dt { padding: 0.3em; font-weight: bold; clear: both; color: #aaa; }
dl.addresscard dt:hover { color:#777; } dl.addresscard dt:hover { color:#777; }
dl.addresscard dd > ul { margin: 0.3em; padding: 0.3em; } dl.addresscard dd > ul { margin: 0.3em; padding: 0.3em; }
dl.addresscard .action { float: right; } dl.addresscard .action { float: right; }
#address dt { width: 30%; white-space:nowrap; }
#address dd { width: 66%; }
#address input { width: 12em; padding: 0.6em 0.5em 0.4em; }
#address input:-moz-placeholder { color: #aaa; }
#address input::-webkit-input-placeholder { color: #aaa; }
#address input:-ms-input-placeholder { color: #aaa; }
#address input:placeholder { color: #aaa; }
#adr_type {} /* Select */ #adr_type {} /* Select */
#adr_pobox {} #adr_pobox {}
#adr_extended {} #adr_extended {}

View File

@ -1281,7 +1281,7 @@ Contacts={
}, },
Addressbooks:{ Addressbooks:{
droptarget:undefined, droptarget:undefined,
droptext:t('contacts', 'Drop a VCF file to import contacts.'), droptext:t('contacts', 'Drop a VCF file<br />to import contacts.'),
overview:function(){ overview:function(){
if($('#chooseaddressbook_dialog').dialog('isOpen') == true){ if($('#chooseaddressbook_dialog').dialog('isOpen') == true){
$('#chooseaddressbook_dialog').dialog('moveToTop'); $('#chooseaddressbook_dialog').dialog('moveToTop');
@ -1290,7 +1290,7 @@ Contacts={
$.getJSON(OC.filePath('contacts', 'ajax', 'chooseaddressbook.php'), function(jsondata){ $.getJSON(OC.filePath('contacts', 'ajax', 'chooseaddressbook.php'), function(jsondata){
if(jsondata.status == 'success'){ if(jsondata.status == 'success'){
$('#addressbook_dialog').html(jsondata.data.page).find('#chooseaddressbook_dialog').dialog({ $('#addressbook_dialog').html(jsondata.data.page).find('#chooseaddressbook_dialog').dialog({
width : 600, minWidth : 600,
close : function(event, ui) { close : function(event, ui) {
$(this).dialog('destroy').remove(); $(this).dialog('destroy').remove();
$('#addressbook_dialog').remove(); $('#addressbook_dialog').remove();

View File

@ -23,16 +23,16 @@
minLength: 0, minLength: 0,
source: function( request, response ) { source: function( request, response ) {
var matcher = new RegExp( $.ui.autocomplete.escapeRegex(request.term), "i" ); var matcher = new RegExp( $.ui.autocomplete.escapeRegex(request.term), "i" );
response( select.children( "option" ).map(function() { response( select.children('option').map(function() {
var text = $( this ).text(); var text = $( this ).text();
if ( this.value && ( !request.term || matcher.test(text) ) ) if ( this.value && ( !request.term || matcher.test(text) ) )
return { return {
label: text.replace( label: text.replace(
new RegExp( new RegExp(
"(?![^&;]+;)(?!<[^<>]*)(" + '(?![^&;]+;)(?!<[^<>]*)(' +
$.ui.autocomplete.escapeRegex(request.term) + $.ui.autocomplete.escapeRegex(request.term) +
")(?![^<>]*>)(?![^&;]+;)", "gi" ')(?![^<>]*>)(?![^&;]+;)', 'gi'
), "<strong>$1</strong>" ), ), '<strong>$1</strong>'),
value: text, value: text,
option: this option: this
}; };
@ -42,17 +42,17 @@
self.input.val($(ui.item.option).text()); self.input.val($(ui.item.option).text());
self.input.trigger('change'); self.input.trigger('change');
ui.item.option.selected = true; ui.item.option.selected = true;
self._trigger( "selected", event, { self._trigger('selected', event, {
item: ui.item.option item: ui.item.option
}); });
}, },
change: function( event, ui ) { change: function( event, ui ) {
if ( !ui.item ) { if ( !ui.item ) {
var matcher = new RegExp( "^" + $.ui.autocomplete.escapeRegex( $(this).val() ) + "$", "i" ), var matcher = new RegExp( '^' + $.ui.autocomplete.escapeRegex( $(this).val() ) + '$', 'i' ),
valid = false; valid = false;
self.input.val($(this).val()); self.input.val($(this).val());
//self.input.trigger('change'); //self.input.trigger('change');
select.children( "option" ).each(function() { select.children('option').each(function() {
if ( $( this ).text().match( matcher ) ) { if ( $( this ).text().match( matcher ) ) {
this.selected = valid = true; this.selected = valid = true;
return false; return false;
@ -62,36 +62,41 @@
// remove invalid value, as it didn't match anything // remove invalid value, as it didn't match anything
$( this ).val( "" ); $( this ).val( "" );
select.val( "" ); select.val( "" );
input.data( "autocomplete" ).term = ""; input.data('autocomplete').term = '';
return false; return false;
} }
} }
} }
}) })
.addClass( "ui-widget ui-widget-content ui-corner-left" ); .addClass('ui-widget ui-widget-content ui-corner-left');
input.data( "autocomplete" )._renderItem = function( ul, item ) { input.data('autocomplete')._renderItem = function( ul, item ) {
return $( "<li></li>" ) return $('<li></li>')
.data( "item.autocomplete", item ) .data('item.autocomplete', item )
.append( "<a>" + item.label + "</a>" ) .append('<a>' + item.label + '</a>')
.appendTo( ul ); .appendTo( ul );
}; };
$.each(this.options, function(key, value) { $.each(this.options, function(key, value) {
self._setOption(key, value); self._setOption(key, value);
}); });
input.dblclick(function() {
// pass empty string as value to search for, displaying all results
input.autocomplete('search', '');
});
if(this.options['showButton']) { if(this.options['showButton']) {
this.button = $( "<button type='button'>&nbsp;</button>" ) this.button = $('<button type="button">&nbsp;</button>')
.attr( "tabIndex", -1 ) .attr('tabIndex', -1 )
.attr( "title", "Show All Items" ) .attr('title', 'Show All Items')
.insertAfter( input ) .insertAfter( input )
.addClass('svg') .addClass('svg')
.addClass('action') .addClass('action')
.addClass('combo-button') .addClass('combo-button')
.click(function() { .click(function() {
// close if already visible // close if already visible
if ( input.autocomplete( "widget" ).is( ":visible" ) ) { if ( input.autocomplete('widget').is(':visible') ) {
input.autocomplete( "close" ); input.autocomplete('close');
return; return;
} }
@ -99,7 +104,7 @@
$( this ).blur(); $( this ).blur();
// pass empty string as value to search for, displaying all results // pass empty string as value to search for, displaying all results
input.autocomplete( "search", "" ); input.autocomplete('search', '');
input.focus(); input.focus();
}); });
} }

View File

@ -24,18 +24,17 @@ foreach(isset($adr['parameters']['TYPE'])?array($adr['parameters']['TYPE']):arra
<dd> <dd>
<input type="text" id="adr_pobox" name="value[ADR][0]" placeholder="<?php echo $l->t('PO Box'); ?>" value="<?php echo isset($adr['value'][0])?$adr['value'][0]:''; ?>"> <input type="text" id="adr_pobox" name="value[ADR][0]" placeholder="<?php echo $l->t('PO Box'); ?>" value="<?php echo isset($adr['value'][0])?$adr['value'][0]:''; ?>">
</dd> </dd>
<dt>
<label class="label" for="adr_street"><?php echo $l->t('Street address'); ?></label>
</dt>
<dd> <dd>
<input type="text" id="adr_street" name="value[ADR][2]" placeholder="<?php echo $l->t('Street and number'); ?>" value="<?php echo isset($adr['value'][2])?$adr['value'][2]:''; ?>">
</dd>
<dt> <dt>
<label class="label" for="adr_extended"><?php echo $l->t('Extended'); ?></label> <label class="label" for="adr_extended"><?php echo $l->t('Extended'); ?></label>
</dt> </dt>
<dd> <dd>
<input type="text" id="adr_extended" name="value[ADR][1]" placeholder="<?php echo $l->t('Extended'); ?>" value="<?php echo isset($adr['value'][1])?$adr['value'][1]:''; ?>"> <input type="text" id="adr_extended" name="value[ADR][1]" placeholder="<?php echo $l->t('Apartment number etc.'); ?>" value="<?php echo isset($adr['value'][1])?$adr['value'][1]:''; ?>">
</dd>
<dt>
<label class="label" for="adr_street"><?php echo $l->t('Street'); ?></label>
</dt>
<dd>
<input type="text" id="adr_street" name="value[ADR][2]" placeholder="<?php echo $l->t('Street'); ?>" value="<?php echo isset($adr['value'][2])?$adr['value'][2]:''; ?>">
</dd> </dd>
<dt> <dt>
<label class="label" for="adr_city"><?php echo $l->t('City'); ?></label> <label class="label" for="adr_city"><?php echo $l->t('City'); ?></label>
@ -47,13 +46,13 @@ foreach(isset($adr['parameters']['TYPE'])?array($adr['parameters']['TYPE']):arra
<label class="label" for="adr_region"><?php echo $l->t('Region'); ?></label> <label class="label" for="adr_region"><?php echo $l->t('Region'); ?></label>
</dt> </dt>
<dd> <dd>
<input type="text" id="adr_region" name="value[ADR][4]" placeholder="<?php echo $l->t('Region'); ?>" value="<?php echo isset($adr['value'][4])?$adr['value'][4]:''; ?>"> <input type="text" id="adr_region" name="value[ADR][4]" placeholder="<?php echo $l->t('E.g. state or province'); ?>" value="<?php echo isset($adr['value'][4])?$adr['value'][4]:''; ?>">
</dd> </dd>
<dt> <dt>
<label class="label" for="adr_zipcode"><?php echo $l->t('Zipcode'); ?></label> <label class="label" for="adr_zipcode"><?php echo $l->t('Zipcode'); ?></label>
</dt> </dt>
<dd> <dd>
<input type="text" id="adr_zipcode" name="value[ADR][5]" placeholder="<?php echo $l->t('Zipcode'); ?>" value="<?php echo isset($adr['value'][5])?$adr['value'][5]:''; ?>"> <input type="text" id="adr_zipcode" name="value[ADR][5]" placeholder="<?php echo $l->t('Postal code'); ?>" value="<?php echo isset($adr['value'][5])?$adr['value'][5]:''; ?>">
</dd> </dd>
<dt> <dt>
<label class="label" for="adr_country"><?php echo $l->t('Country'); ?></label> <label class="label" for="adr_country"><?php echo $l->t('Country'); ?></label>

View File

@ -22,7 +22,7 @@ if(OCP\App::isEnabled('files_encryption')) {
echo OCP\html_select_options($contacts_options, $contacts_options[0]['id'], array('value'=>'id', 'label'=>'displayname')); echo OCP\html_select_options($contacts_options, $contacts_options[0]['id'], array('value'=>'id', 'label'=>'displayname'));
?> ?>
</select> </select>
<span id="import_drop_target" class="droptarget float"><?php echo $l->t("Drop a VCF file to import contacts."); ?> (Max. <?php echo $_['uploadMaxHumanFilesize']; ?>)</span> <span id="import_drop_target" class="droptarget float"><?php echo $l->t("Drop a VCF file<br />to import contacts."); ?> (Max. <?php echo $_['uploadMaxHumanFilesize']; ?>)</span>
<a class="svg upload float" title="<?php echo $l->t('Select from HD'); ?>"> <a class="svg upload float" title="<?php echo $l->t('Select from HD'); ?>">
<input class="float" id="import_upload_start" type="file" accept="text/*" name="importfile" /></a> <input class="float" id="import_upload_start" type="file" accept="text/*" name="importfile" /></a>
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $_['uploadMaxFilesize'] ?>" id="max_upload"> <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $_['uploadMaxFilesize'] ?>" id="max_upload">
@ -36,5 +36,7 @@ if(OCP\App::isEnabled('files_encryption')) {
<?php } ?> <?php } ?>
</td> </td>
<script type="text/javascript"> <script type="text/javascript">
Contacts.UI.Addressbooks.loadImportHandlers(); $(document).ready(function(){
Contacts.UI.Addressbooks.loadImportHandlers();
});
</script> </script>