Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Adnan Ahmad
/
Assignments
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
0d08b06d
...
0d08b06ddcc4fb81098fa19ba78d2800e3cef689
authored
2018-05-14 12:32:48 +0200
by
Adnan Ahmad
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Update jquery.js
1 parent
61b78aa1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
1 deletions
script/jquery.js
script/jquery.js
View file @
0d08b06
...
...
@@ -101,7 +101,7 @@ $(document).ready(function(){
SubItem
=
""
;
item
+=
"</div>"
;
}
$
(
"#mainRightDiv"
).
append
(
item
);
$
(
"#mainRightDiv"
).
html
(
item
);
}
//DisplayItems();
...
...
@@ -120,6 +120,29 @@ $(document).ready(function(){
DisplayItems
(
items
);
});
// Sort By Albums
// Ascending
$
(
'body'
).
on
(
'click'
,
'.AssItem'
,
function
()
{
$
(
this
).
click
(
function
(){
items
.
sort
(
function
(
a
,
b
)
{
return
(
a
.
song
>
b
.
song
)
?
1
:
((
b
.
song
>
a
.
song
)
?
-
1
:
0
);}
);
$
(
"#mainRightDiv"
).
empty
();
DisplayItems
(
items
);
});
});
// Descending
$
(
'body'
).
on
(
'click'
,
'.DessItem'
,
function
()
{
$
(
this
).
click
(
function
(){
items
.
sort
(
function
(
a
,
b
)
{
return
(
a
.
song
>
b
.
song
)
?
-
1
:
((
b
.
song
>
a
.
song
)
?
1
:
0
);}
);
$
(
"#mainRightDiv"
).
empty
();
DisplayItems
(
items
);
});
});
// Search By Singer Name
$
(
"#SearchByArtistName"
).
keyup
(
function
(){
SearchValue
=
$
(
this
).
val
();
...
...
@@ -180,9 +203,20 @@ $('#item_form').on('submit', function (e) {
contentType
:
false
,
success
:
function
(
info
)
{
document
.
getElementById
(
"item_form"
).
reset
();
$
.
ajax
({
type
:
'GET'
,
url
:
'/Assignments/get.php'
,
success
:
function
(
data
){
items
=
JSON
.
parse
(
data
);
console
.
log
(
'Second ajax'
);
DisplayItems
(
items
);
}
});
alert
(
info
);
}
});
});
// update items
...
...
@@ -216,9 +250,19 @@ $('#item_form').on('submit', function (e) {
url
:
'/Assignments/database.php'
,
data
:{
'id'
:
id
,
'action'
:
action
},
success
:
function
(
info
){
$
.
ajax
({
type
:
'GET'
,
url
:
'/Assignments/get.php'
,
success
:
function
(
data
){
items
=
JSON
.
parse
(
data
);
console
.
log
(
'second ajax'
);
DisplayItems
(
items
);
}
});
alert
(
info
);
}
});
}
...
...
Please
register
or
sign in
to post a comment