YaWK
24.1
Yet another WebKit
comments.js
Go to the documentation of this file.
1
$(document).
ready
(
function
(){
2
3
// auto-open blog comments accordeon
4
$(
"#comments"
).collapse(
'show'
);
5
// hide open/close comments button
6
// $("#commentsBtn").hide();
7
8
$(
'#submit_post'
).click(
function
(){
9
var
name
= $(
'#name'
).val();
10
var email = $(
'#email'
).val();
11
var comment = $(
'#comment'
).val();
12
var
blogid
= $(
'#blogid'
).val();
13
var
itemid
= $(
'#itemid'
).val();
14
var uid = $(
'#uid'
).val();
15
var
gid
= $(
'#gid'
).val();
16
17
if
(!comment.trim()) {
18
alert(
'Please enter comment'
);
19
return
false
;
20
}
21
22
$.ajax({
23
url:
'system/plugins/blog/js/add-comment.php'
,
24
type
:
'post'
,
25
data:
'name='
+
name
+
'&email='
+email+
'&comment='
+comment+
'&blogid='
+
blogid
+
'&itemid='
+
itemid
+
'&uid='
+uid+
'&gid='
+
gid
,
26
success:
function
(data){
27
if
(! data ){
28
alert(
'Something went wrong!'
);
29
return
false
;
30
}
31
$(data).hide().prependTo($(
"#comment_thread"
)).fadeIn(820);
32
//reset input boxes
33
$(
'#name'
).val(
''
);
34
$(
'#email'
).val(
''
);
35
$(
'#comment'
).val(
''
);
36
$(
'#comments_btn'
).val(
''
);
37
},
38
error
:
function
()
39
{
40
alert(
'there was an error!'
);
41
}
42
});
43
});
44
});
blogid
print $blog blogid
Definition:
blog-edit.php:376
itemid
print $blog itemid
Definition:
blog-edit.php:376
gid
$blog gid
Definition:
blog-setup.php:139
ready
document ready(function(){ $("#comments").collapse('show');$('#submit_post').click(function(){ var name=$('#name').val();var email=$('#email').val();var comment=$('#comment').val();var blogid=$('#blogid').val();var itemid=$('#itemid').val();var uid=$('#uid').val();var gid=$('#gid').val();if(!comment.trim()) { alert('Please enter comment');return false;} $.ajax({ url:'system/plugins/blog/js/add-comment.php', type:'post', data:'name='+name+'&email='+email+'&comment='+comment+'&blogid='+blogid+'&itemid='+itemid+'&uid='+uid+'&gid='+gid, success:function(data){ if(! data){ alert('Something went wrong!');return false;} $(data).hide().prependTo($("#comment_thread")).fadeIn(820);$('#name').val('');$('#email').val('');$('#comment').val('');$('#comments_btn').val('');}, error:function() { alert('there was an error!');} });});})
error
c jPlayer error
Definition:
jquery.jplayer.min.js:74
type
type
Definition:
menu-new.php:35
name
$template name
Definition:
template-assets.php:26
yawk.io
system
plugins
blog
js
comments.js
Generated on Tue Jan 16 2024 21:59:01 for YaWK by
doxygen 1.9.1