Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nextcloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Nextcloud
Commits
20f1c1e6
Commit
20f1c1e6
authored
12 years ago
by
Thomas Tanghus
Browse files
Options
Downloads
Patches
Plain Diff
Forgot to fix one file...
parent
6c554d0f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
apps/contacts/js/loader.js
+81
-81
81 additions, 81 deletions
apps/contacts/js/loader.js
with
81 additions
and
81 deletions
apps/contacts/js/loader.js
+
81
−
81
View file @
20f1c1e6
/**
* 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
{
/**
* 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
{
$
(
'
#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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment