X-Git-Url: http://p2p-next.cs.pub.ro/gitweb/?a=blobdiff_plain;f=application%2Fviews%2Fvideo%2Fwatch_view.php;h=a775419df921288bfe614054f4a02d3f759f2bd1;hb=6db375a0706b5328fbd53be4dd2e517c96560ea6;hp=36ae1e0097b2511ecdebb9159b99b2db2d44de1e;hpb=d4b234f611d405b8a7935a86f50ec071779c2729;p=living-lab-site.git diff --git a/application/views/video/watch_view.php b/application/views/video/watch_view.php index 36ae1e0..a775419 100644 --- a/application/views/video/watch_view.php +++ b/application/views/video/watch_view.php @@ -3,7 +3,7 @@ siteUrl = ''; -
+
-

+

    @@ -37,7 +37,7 @@
    lang->line('ui_uploaded_by') ?> - + "> lang->line('ui_on_date') ?>
    @@ -51,19 +51,15 @@ ?>
    -
    - lang->line('ui_like') : - $this->lang->line('ui_likes') ); - ?>, - - lang->line('ui_dislike') : - $this->lang->line('ui_dislikes') ); - ?> -
    +
    + lang->line('video_like') ?> + lang->line('video_dislike') ?> + lang->line('ui_likes') ?>, + lang->line('ui_dislikes'); ?> +
@@ -124,8 +120,9 @@ .nsvideo({ type: "", src: , - //width: videoWidth, - //height: videoHeight + + showState: false, + minWidth: 640, maxWidth: 1024, initialDuration: "", @@ -135,5 +132,86 @@ .css('width', $('#video-widget').css('width')); } }); + + $('.link-vote') + .click(function() { + var 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: "/" + + action + + "", + data: {t: ""+Math.random()}, + dataType: "text", + success: function(text) { + if (text) + $(idOutput).html(text); + else + alert('lang->line('ui_msg_repeated_action_restriction') ?>'); + } + }); + } + else + alert('lang->line('ui_msg_login_restriction') ?>'); + }) + .button(); + + $('#link-like') + .click(function() { + user_id = ""; + + if (user_id) + { + $.ajax({ + type: "GET", + url: "", + dataType: "text", + success: function(text) { + if (text) + $('#video-likes').html(text); + else + alert('lang->line('ui_msg_repeated_action_restriction') ?>'); + } + }); + } + else + alert('lang->line('ui_msg_login_restriction') ?>'); + }) + .button(); + $('#link-dislike') + .click(function() { + user_id = ""; + + if (user_id) + { + $.ajax({ + type: "GET", + url: "", + data: {t: ""+Math.random()}, + dataType: "text", + success: function(text) { + $('#video-dislikes').html(text); + } + }); + } + else + alert('lang->line('ui_msg_login_restriction') ?>'); + }) + .button(); }); \ No newline at end of file