Files
gallery3/modules/comment/views/comment_form.html.php

36 lines
991 B
PHP
Raw Normal View History

2008-11-11 20:54:12 +00:00
<? defined("SYSPATH") or die("No direct script access."); ?>
2008-11-15 16:52:23 +00:00
<script type="text/javascript">
// <![CDATA[
function show_comment_add_form(url) {
$("#gCommentAddLink").hide();
$.get(url, function(data) {
$("#gCommentAddFormContainer").html(data);
2008-11-15 16:52:23 +00:00
ajaxify_comment_add_form();
});
}
function ajaxify_comment_add_form() {
$("form#gComment").ajaxForm({
dataType: 'json',
success: function(response_data, status_text) {
if (response_data['valid']) {
$("#gCommentThread").html(response_data["html"]);
$("#gCommentAddFormContainer").html("");
2008-11-15 16:52:23 +00:00
$("#gCommentAddLink").show();
} else {
$("#gCommentAddFormContainer").html(response_data["html"]);
2008-11-15 16:52:23 +00:00
ajaxify_comment_add_form();
}
},
});
}
// ]]>
</script>
<span id="gCommentAddLink">
<a href="javascript:show_comment_add_form('<?= url::site("photo/{$item_id}/comments/add") ?>')">
<?= _("Add Comment") ?>
</a>
</span>
<div id="gCommentAddFormContainer"></div>
2008-11-11 20:54:12 +00:00