Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
ac63afbd
Commit
ac63afbd
authored
Jan 9, 2012
by
Thomas Tanghus
Browse files
Options
Downloads
Patches
Plain Diff
Insert new contacts alphabetically correct in the list.
Added some tipsys to the editor.
parent
978a08ab
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
apps/contacts/css/styles.css
+1
-1
1 addition, 1 deletion
apps/contacts/css/styles.css
apps/contacts/js/interface.js
+23
-4
23 additions, 4 deletions
apps/contacts/js/interface.js
apps/contacts/templates/part.details.php
+5
-0
5 additions, 0 deletions
apps/contacts/templates/part.details.php
with
29 additions
and
5 deletions
apps/contacts/css/styles.css
+
1
−
1
View file @
ac63afbd
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
#contacts_details_name
{
font-weight
:
bold
;
font-size
:
1.1em
;
margin-left
:
25%
;}
#contacts_details_name
{
font-weight
:
bold
;
font-size
:
1.1em
;
margin-left
:
25%
;}
#contacts_details_photo
{
margin
:
.5em
0em
.5em
25%
;
}
#contacts_details_photo
{
margin
:
.5em
0em
.5em
25%
;
}
#contacts_deletecard
{
position
:
absolute
;
top
:
15px
;
right
:
0
;}
#contacts_deletecard
{
position
:
absolute
;
top
:
15px
;
right
:
15px
;}
#contacts_details_list
{
list-style
:
none
;
}
#contacts_details_list
{
list-style
:
none
;
}
#contacts_details_list
li
{
overflow
:
visible
;
}
#contacts_details_list
li
{
overflow
:
visible
;
}
#contacts_details_list
li
p
.contacts_property_name
{
width
:
25%
;
float
:
left
;
text-align
:
right
;
padding-right
:
0.3em
;
color
:
#666
;
}
#contacts_details_list
li
p
.contacts_property_name
{
width
:
25%
;
float
:
left
;
text-align
:
right
;
padding-right
:
0.3em
;
color
:
#666
;
}
...
...
This diff is collapsed.
Click to expand it.
apps/contacts/js/interface.js
+
23
−
4
View file @
ac63afbd
...
@@ -237,6 +237,9 @@ $(document).ready(function(){
...
@@ -237,6 +237,9 @@ $(document).ready(function(){
return
false
;
return
false
;
});
});
/**
* Open blank form to add new contact.
*/
$
(
'
#contacts_newcontact
'
).
click
(
function
(){
$
(
'
#contacts_newcontact
'
).
click
(
function
(){
$
.
getJSON
(
'
ajax/showaddcard.php
'
,{},
function
(
jsondata
){
$
.
getJSON
(
'
ajax/showaddcard.php
'
,{},
function
(
jsondata
){
if
(
jsondata
.
status
==
'
success
'
){
if
(
jsondata
.
status
==
'
success
'
){
...
@@ -251,13 +254,27 @@ $(document).ready(function(){
...
@@ -251,13 +254,27 @@ $(document).ready(function(){
return
false
;
return
false
;
});
});
/**
* Add and insert a new contact into the list.
*/
$
(
'
#contacts_addcardform input[type="submit"]
'
).
live
(
'
click
'
,
function
(){
$
(
'
#contacts_addcardform input[type="submit"]
'
).
live
(
'
click
'
,
function
(){
$
.
post
(
'
ajax/addcard.php
'
,
$
(
'
#contacts_addcardform
'
).
serialize
(),
function
(
jsondata
){
$
.
post
(
'
ajax/addcard.php
'
,
$
(
'
#contacts_addcardform
'
).
serialize
(),
function
(
jsondata
){
if
(
jsondata
.
status
==
'
success
'
){
if
(
jsondata
.
status
==
'
success
'
){
$
(
'
#rightcontent
'
).
data
(
'
id
'
,
jsondata
.
data
.
id
);
$
(
'
#rightcontent
'
).
data
(
'
id
'
,
jsondata
.
data
.
id
);
$
(
'
#rightcontent
'
).
html
(
jsondata
.
data
.
page
);
$
(
'
#rightcontent
'
).
html
(
jsondata
.
data
.
page
);
$
(
'
#leftcontent .active
'
).
removeClass
(
'
active
'
);
$
(
'
#leftcontent .active
'
).
removeClass
(
'
active
'
);
$
(
'
#leftcontent ul
'
).
append
(
'
<li data-id="
'
+
jsondata
.
data
.
id
+
'
" class="active"><a href="index.php?id=
'
+
jsondata
.
data
.
id
+
'
">
'
+
jsondata
.
data
.
name
+
'
</a></li>
'
);
var
item
=
'
<li data-id="
'
+
jsondata
.
data
.
id
+
'
" class="active"><a href="index.php?id=
'
+
jsondata
.
data
.
id
+
'
" style="background: url(thumbnail.php?id=
'
+
jsondata
.
data
.
id
+
'
) no-repeat scroll 0% 0% transparent;">
'
+
jsondata
.
data
.
name
+
'
</a></li>
'
;
var
added
=
false
;
$
(
'
#leftcontent ul li
'
).
each
(
function
(){
if
(
$
(
this
).
text
().
toLowerCase
()
>
jsondata
.
data
.
name
.
toLowerCase
())
{
$
(
this
).
before
(
item
).
fadeIn
(
'
fast
'
);
added
=
true
;
return
false
;
}
});
if
(
!
added
)
{
$
(
'
#leftcontent ul
'
).
append
(
item
);
}
}
}
else
{
else
{
alert
(
jsondata
.
data
.
message
);
alert
(
jsondata
.
data
.
message
);
...
@@ -265,7 +282,6 @@ $(document).ready(function(){
...
@@ -265,7 +282,6 @@ $(document).ready(function(){
},
'
json
'
);
},
'
json
'
);
return
false
;
return
false
;
});
});
$
(
'
.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
(
'
.contacts_property
'
).
first
().
data
(
'
checksum
'
);
var
checksum
=
$
(
this
).
parents
(
'
.contacts_property
'
).
first
().
data
(
'
checksum
'
);
...
@@ -338,4 +354,7 @@ $(document).ready(function(){
...
@@ -338,4 +354,7 @@ $(document).ready(function(){
// element has gone out of viewport
// element has gone out of viewport
}
}
});
});
$
(
'
.action
'
).
tipsy
();
$
(
'
.button
'
).
tipsy
();
});
});
This diff is collapsed.
Click to expand it.
apps/contacts/templates/part.details.php
+
5
−
0
View file @
ac63afbd
...
@@ -86,3 +86,8 @@
...
@@ -86,3 +86,8 @@
</li>
</li>
</ul>
</ul>
<?php
endif
;
?>
<?php
endif
;
?>
<script
language=
"Javascript"
>
/* Re-tipsify ;-)*/
$
(
'
.action
'
).
tipsy
();
$
(
'
.button
'
).
tipsy
();
</script>
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