+
+ $('.pagination')
+ .ajaxLinksMaker({
+ linkSelectors: [
+ '.pg-first',
+ '.pg-prev',
+ '.pg-next',
+ '.pg-last',
+ '.pg-num'
+ ],
+ target: '#video-comments'
+ });
+
+ $('.link-vote-video-comment')
+ .click(function(event) {
+ var user_id = "<?php echo $user_id ?>";
+ var action, idOutput, commentId;
+ commentId = $(this).data('commentid');
+ if ($(this).data('action') == 'like')
+ {
+ var action = 'like';
+ var idOutput = '#video-comment-' + commentId + '-likes';
+ }
+ else
+ {
+ var action = 'dislike';
+ var idOutput = '#video-comment-' + commentId + '-dislikes';
+ }
+ //alert(action + " " + user_id);
+
+ event.preventDefault();
+
+ if (user_id.length != 0)
+ {
+ $.ajax({
+ type: "GET",
+ url: "<?php echo site_url("video/ajax_vote_comment") ?>/"
+ + action
+ + "/" + commentId,
+ data: {t: ""+Math.random()},
+ dataType: "text",
+ success: function(text) {
+ if (text)
+ $(idOutput).html(text);
+ else
+ alert('<?php echo $this->lang->line('ui_msg_repeated_action_restriction') ?>');
+ }
+ });
+ }
+ else
+ alert('<?php echo $this->lang->line('ui_msg_login_restriction') ?>');
+ });
+
+ $('#comment')
+ .bind('keyup paste drop change', function(event) {
+ $textarea = $(this);
+
+ if ($textarea.val().length >= 513)
+ $textarea.val($textarea.val().substring(0, 512));