diff options
author | Thomas Tanghus <thomas@tanghus.net> | 2012-05-06 13:03:15 +0200 |
---|---|---|
committer | Thomas Tanghus <thomas@tanghus.net> | 2012-05-06 13:51:16 +0200 |
commit | 400ade063cb5045d6c64008fee30417a29e5da53 (patch) | |
tree | d9855564e52e7d3333c92288b053aa52c9b7a936 | |
parent | f2ec68d40c20c571d3f864e31fd9ed555b7d21c1 (diff) | |
download | nextcloud-server-400ade063cb5045d6c64008fee30417a29e5da53.tar.gz nextcloud-server-400ade063cb5045d6c64008fee30417a29e5da53.zip |
Revert Android positioning 'fix'.
This reverts commit 20f1c1e6ca40c09b67c404729a4bf986b4732051 and 93ae945414a9511dfe5c396205cfccac1c40a153.
-rw-r--r-- | apps/contacts/js/loader.js | 162 |
1 files changed, 81 insertions, 81 deletions
diff --git a/apps/contacts/js/loader.js b/apps/contacts/js/loader.js index 9efb1030f23..95fd7dc94ea 100644 --- a/apps/contacts/js/loader.js +++ b/apps/contacts/js/loader.js @@ -1,83 +1,83 @@ -/**
- * Copyright (c) 2012 Georg Ehrke <ownclouddev at georgswebsite dot de>
- * This file is licensed under the Affero General Public License version 3 or
- * later.
- * See the COPYING-README file.
- */
-Contacts_Import={
- importdialog: function(filename){
- var path = $('#dir').val();
- $('body').append('<div id="contacts_import"></div>');
- $('#contacts_import').load(OC.filePath('contacts', 'ajax', 'importdialog.php'), {filename:filename, path:path}, function(){Contacts_Import.initdialog(filename);});
- },
- initdialog: function(filename){
- $('#contacts_import_dialog').dialog({
- width : 500,
- close : function() {
- $(this).dialog('destroy').remove();
- $('#contacts_import').remove();
- }
- });
- $('#import_done_button').click(function(){
- $('#contacts_import_dialog').dialog('destroy').remove();
- $('#contacts_import').remove();
- });
- $('#progressbar').progressbar({value: 0});
- $('#startimport').click(function(){
- var filename = $('#filename').val();
- var path = $('#path').val();
- var addressbookid = $('#leftcontent option:selected').val();
- if($('#leftcontent option:selected').val() == 'newaddressbook'){
- var method = 'new';
- var addressbookname = $('#newaddressbook').val();
- var addressbookname = $.trim(addressbookname);
- if(newaddressbook == ''){
- $('#newaddressbook').css('background-color', '#FF2626');
- $('#newaddressbook').focus(function(){
- $('#newaddressbook').css('background-color', '#F8F8F8');
- });
- return false;
- }
- }else{
- var method = 'old';
- }
- $('#newaddressbook').attr('readonly', 'readonly');
- $('#leftcontent').attr('disabled', 'disabled');
- var progressfile = $('#progressfile').val();
- $.post(OC.filePath('contacts', '', 'import.php'), {method: String (method), addressbookname: String (addressbookname), path: String (path), file: String (filename), id: String (addressbookid)}, function(data){
- if(data.status == 'success'){
- $('#progressbar').progressbar('option', 'value', 100);
- $('#import_done').css('display', 'block');
- }
- });
- $('#form_container').css('display', 'none');
- $('#progressbar_container').css('display', 'block');
- window.setTimeout('Contacts_Import.getimportstatus(\'' + progressfile + '\')', 500);
- });
- $('#leftcontent').change(function(){
- if($('#leftcontent option:selected').val() == 'newaddressbook'){
- $('#newaddressbookform').slideDown('slow');
- }else{
- $('#newaddressbookform').slideUp('slow');
- }
- });
- },
- getimportstatus: function(progressfile){
- $.get(OC.filePath('contacts', 'import_tmp', progressfile), function(percent){
- $('#progressbar').progressbar('option', 'value', parseInt(percent));
- if(percent < 100){
- window.setTimeout('Contacts_Import.getimportstatus(\'' + progressfile + '\')', 500);
- }else{
+/** + * Copyright (c) 2012 Georg Ehrke <ownclouddev at georgswebsite dot de> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ +Contacts_Import={ + importdialog: function(filename){ + var path = $('#dir').val(); + $('body').append('<div id="contacts_import"></div>'); + $('#contacts_import').load(OC.filePath('contacts', 'ajax', 'importdialog.php'), {filename:filename, path:path}, function(){Contacts_Import.initdialog(filename);}); + }, + initdialog: function(filename){ + $('#contacts_import_dialog').dialog({ + width : 500, + close : function() { + $(this).dialog('destroy').remove(); + $('#contacts_import').remove(); + } + }); + $('#import_done_button').click(function(){ + $('#contacts_import_dialog').dialog('destroy').remove(); + $('#contacts_import').remove(); + }); + $('#progressbar').progressbar({value: 0}); + $('#startimport').click(function(){ + var filename = $('#filename').val(); + var path = $('#path').val(); + var addressbookid = $('#contacts option:selected').val(); + if($('#contacts option:selected').val() == 'newaddressbook'){ + var method = 'new'; + var addressbookname = $('#newaddressbook').val(); + var addressbookname = $.trim(addressbookname); + if(newaddressbook == ''){ + $('#newaddressbook').css('background-color', '#FF2626'); + $('#newaddressbook').focus(function(){ + $('#newaddressbook').css('background-color', '#F8F8F8'); + }); + return false; + } + }else{ + var method = 'old'; + } + $('#newaddressbook').attr('readonly', 'readonly'); + $('#contacts').attr('disabled', 'disabled'); + var progressfile = $('#progressfile').val(); + $.post(OC.filePath('contacts', '', 'import.php'), {method: String (method), addressbookname: String (addressbookname), path: String (path), file: String (filename), id: String (addressbookid)}, function(data){ + if(data.status == 'success'){ + $('#progressbar').progressbar('option', 'value', 100); + $('#import_done').css('display', 'block'); + } + }); + $('#form_container').css('display', 'none'); + $('#progressbar_container').css('display', 'block'); + window.setTimeout('Contacts_Import.getimportstatus(\'' + progressfile + '\')', 500); + }); + $('#contacts').change(function(){ + if($('#contacts option:selected').val() == 'newaddressbook'){ + $('#newaddressbookform').slideDown('slow'); + }else{ + $('#newaddressbookform').slideUp('slow'); + } + }); + }, + getimportstatus: function(progressfile){ + $.get(OC.filePath('contacts', 'import_tmp', progressfile), function(percent){ + $('#progressbar').progressbar('option', 'value', parseInt(percent)); + if(percent < 100){ + window.setTimeout('Contacts_Import.getimportstatus(\'' + progressfile + '\')', 500); + }else{ $('#import_done').css('display', 'block');
- }
- });
- }
-}
-$(document).ready(function(){
- if(typeof FileActions !== 'undefined'){
- FileActions.register('text/vcard','importaddressbook', '', Contacts_Import.importdialog);
- FileActions.setDefault('text/vcard','importaddressbook');
- FileActions.register('text/x-vcard','importaddressbook', '', Contacts_Import.importdialog);
- FileActions.setDefault('text/x-vcard','importaddressbook');
- };
+ } + }); + } +} +$(document).ready(function(){ + if(typeof FileActions !== 'undefined'){ + FileActions.register('text/vcard','importaddressbook', '', Contacts_Import.importdialog); + FileActions.setDefault('text/vcard','importaddressbook'); + FileActions.register('text/x-vcard','importaddressbook', '', Contacts_Import.importdialog); + FileActions.setDefault('text/x-vcard','importaddressbook'); + }; });
\ No newline at end of file |