summaryrefslogtreecommitdiffstats
path: root/apps/contacts
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2012-07-15 12:20:26 +0200
committerThomas Tanghus <thomas@tanghus.net>2012-07-15 12:28:29 +0200
commit8b49e304e0729b464975add486f527484cbfa7fb (patch)
tree731a73054890d694863774b8f5b9246c72251bd2 /apps/contacts
parent48521fcfaa6d6b36f5e55ac5de936b82a8f60c19 (diff)
downloadnextcloud-server-8b49e304e0729b464975add486f527484cbfa7fb.tar.gz
nextcloud-server-8b49e304e0729b464975add486f527484cbfa7fb.zip
Hide file form field behind image so it will maybe work with IE...
Diffstat (limited to 'apps/contacts')
-rw-r--r--apps/contacts/css/contacts.css4
-rw-r--r--apps/contacts/js/contacts.js6
-rw-r--r--apps/contacts/templates/index.php10
3 files changed, 9 insertions, 11 deletions
diff --git a/apps/contacts/css/contacts.css b/apps/contacts/css/contacts.css
index ad97b21104d..de7950ecc61 100644
--- a/apps/contacts/css/contacts.css
+++ b/apps/contacts/css/contacts.css
@@ -14,7 +14,7 @@
#bottomcontrols { padding: 0; bottom:0px; height:2.8em; width: 20em; margin:0; background:#eee; border-top:1px solid #ccc; position:fixed; -moz-box-shadow: 0 -3px 3px -3px #000; -webkit-box-shadow: 0 -3px 3px -3px #000; box-shadow: 0 -3px 3px -3px #000;}
#bottomcontrols img { margin-top: 0.35em; }
#uploadprogressbar { display: none; padding: 0; bottom: 3em; height:2em; width: 20em; margin:0; background:#eee; border:1px solid #ccc; position:fixed; }
-#contacts_newcontact { float: left; margin: 0.2em 0 0 1em; }
+#contacts_newcontact, #contacts_import, #chooseaddressbook { float: left; margin: 0.2em 0 0 1em; border: 0 none; border-radius: 0; -moz-box-shadow: none; box-shadow: none; outline: 0 none; }
#chooseaddressbook { float: right; margin: 0.2em 1em 0 0; }
#actionbar { position: relative; clear: both; height: 30px;}
#contacts_deletecard {position:relative; float:left; background:url('%webroot%/core/img/actions/delete.svg') no-repeat center; }
@@ -111,7 +111,7 @@ dl.addresscard .action { float: right; }
#file_upload_form { width: 0; height: 0; }
#file_upload_target, #import_upload_target, #crop_target { display:none; }
#file_upload_start, #import_upload_start { -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; filter:alpha(opacity=0); opacity:0; z-index:1001; width:0; height:0;}
-#import_upload_start { width: 16px; height: 16px; margin: 0 0 0 0; }
+#import_upload_start { width: 20px; height: 20px; margin: 0 0 -24px 0; padding: 0;}
input[type="checkbox"] { width: 20px; height: 20px; vertical-align: bottom; }
.big { font-weight:bold; font-size:1.2em; }
.huge { font-weight:bold; font-size:1.5em; }
diff --git a/apps/contacts/js/contacts.js b/apps/contacts/js/contacts.js
index ffbc1d009e6..2ebec4c2423 100644
--- a/apps/contacts/js/contacts.js
+++ b/apps/contacts/js/contacts.js
@@ -1704,12 +1704,9 @@ $(document).ready(function(){
var uploadingFiles = {}, numfiles = 0, uploadedfiles = 0, retries = 0;
var aid;
- $('#contacts_import').click(function() { // TODO: Trick IE by hiding fileupload behind button.
- $('#import_upload_start').click();
- return false;
- });
$('#import_upload_start').fileupload({
dropZone: $('#contacts'), // restrict dropZone to contacts list.
+ acceptFileTypes: /^text\/(directory|vcard|x-vcard)$/i,
add: function(e, data) {
var files = data.files;
var totalSize=0;
@@ -1759,6 +1756,7 @@ $(document).ready(function(){
return false;
})
.error(function(jqXHR, textStatus, errorThrown) {
+ console.log(textStatus);
Contacts.UI.notify({message:errorThrown + ': ' + textStatus,});
});
uploadingFiles[fileName] = jqXHR;
diff --git a/apps/contacts/templates/index.php b/apps/contacts/templates/index.php
index e13748ddde7..98cb67a26e7 100644
--- a/apps/contacts/templates/index.php
+++ b/apps/contacts/templates/index.php
@@ -11,13 +11,13 @@
</div>
<div id="uploadprogressbar"></div>
<div id="bottomcontrols">
- <form>
+ <form id="import_upload_form" action="<?php echo OCP\Util::linkTo('contacts', 'ajax/uploadimport.php'); ?>" method="post" enctype="multipart/form-data" target="import_upload_target">
<button class="svg" id="contacts_newcontact" title="<?php echo $l->t('Add Contact'); ?>"><img class="svg" src="<?php echo OCP\Util::imagePath('contacts', 'contact-new.svg'); ?>" alt="<?php echo $l->t('Add Contact'); ?>" /></button>
- <button class="svg" id="contacts_import" title="<?php echo $l->t('Import'); ?>"><img class="svg" src="core/img/actions/upload.svg" alt="<?php echo $l->t('Import'); ?>" /></button>
+ <span class="svg" id="contacts_import" title="<?php echo $l->t('Import'); ?>">
+ <input class="float" id="import_upload_start" type="file" accept="text/directory,text/vcard,text/x-vcard" name="importfile" />
+ <img class="svg" src="core/img/actions/upload.svg" alt="<?php echo $l->t('Import'); ?>" />
+ </span>
<button class="svg" id="chooseaddressbook" title="<?php echo $l->t('Addressbooks'); ?>"><img class="svg" src="core/img/actions/settings.svg" alt="<?php echo $l->t('Addressbooks'); ?>" /></button>
- </form>
- <form id="import_upload_form" action="<?php echo OCP\Util::linkTo('contacts', 'ajax/uploadimport.php'); ?>" method="post" enctype="multipart/form-data" target="import_upload_target">
- <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">
</form>
<iframe name="import_upload_target" id='import_upload_target' src=""></iframe>