+ showState: false,
+
+ minWidth: 640,
+ maxWidth: 1024,
+ initialDuration: "<?php echo $video['duration'] ?>",
+
+ resize: function() {
+ $('#video-widget-tabs')
+ .css('width', $('#video-widget').css('width'));
+ }
+ });
+
+ $('.link-vote')
+ .click(function() {
+ var user_id = "<?php echo $user_id ?>";
+ var action, idOutput;
+ if ($(this).data('action') == 'like')
+ {
+ var action = 'like';
+ var idOutput = '#video-likes';
+ }
+ else
+ {
+ var action = 'dislike';
+ var idOutput = '#video-dislikes';
+ }
+ //alert(action + " " + user_id);
+
+ if (user_id.length != 0)
+ {
+ $.ajax({
+ type: "GET",
+ url: "<?php echo site_url("video/ajax_vote") ?>/"
+ + action
+ + "<?php echo "/{$video['id']}/$user_id" ?>",
+ 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') ?>');
+ })
+ .button();
+
+ $('#link-like')
+ .click(function() {
+ user_id = "<?php echo $user_id ?>";
+
+ if (user_id)
+ {
+ $.ajax({
+ type: "GET",
+ url: "<?php echo site_url("video/ajax_vote/like/{$video['id']}/$user_id") ?>",
+ dataType: "text",
+ success: function(text) {
+ if (text)
+ $('#video-likes').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') ?>');
+ })
+ .button();
+ $('#link-dislike')
+ .click(function() {
+ user_id = "<?php echo $user_id ?>";
+
+ if (user_id)
+ {
+ $.ajax({
+ type: "GET",
+ url: "<?php echo site_url("video/ajax_vote/dislike/{$video['id']}/$user_id") ?>",
+ data: {t: ""+Math.random()},
+ dataType: "text",
+ success: function(text) {
+ $('#video-dislikes').html(text);
+ }
+ });
+ }
+ else
+ alert('<?php echo $this->lang->line('ui_msg_login_restriction') ?>');
+ })
+ .button();
+ });
+</script>
\ No newline at end of file