Guest User

Untitled

a guest
Dec 12th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // JavaScript Document
  2.  
  3. /******************************* Rate ajax-qjuery ***************************/
  4.  
  5. var newwindow;
  6. var myWindowFlag;
  7.  
  8. $(document).ready(function(){
  9.    
  10.     $('.action').live("click", function(){
  11.         var actionUrl=$(this).data('action-url');
  12.         var id = $(this).data('id');
  13.         var elem = $(this);
  14.            
  15.         $.ajax({
  16.             type: "POST",
  17.             url: actionUrl,
  18.             data: "id="+$(this).data('id'),
  19.             dataType: "json",
  20.  
  21.             success: function(response){
  22.                 if (response.msg) {
  23.                     $(".message" + id).after("<span class=fade>"+response.msg+"</span>");
  24.                     $(".fade").fadeOut(5000);
  25.                     //$(".lcount" + id).after(response.count);
  26.                     elem.parent().parent().find('.selected').removeClass('selected');
  27.                     elem.addClass('selected');
  28.                 }
  29.                 else {
  30.                     console.log(response);
  31.                 }
  32.             }
  33.  
  34.         });
  35.          return false;
  36.     });                
  37. })
  38.  
  39.  
  40. /******************************* video play ajax-qjuery ***************************/
  41.  
  42. $(document).ready(function(){
  43.    
  44.     $('#yp').load(function(){
  45.         alert('haha');
  46.         var actionUrl=$(this).data('action-url');
  47.         var id = $(this).data('id');
  48.            
  49.         $.ajax({
  50.             type: "POST",
  51.             url: actionUrl,
  52.             data: "id="+$(this).data('id'),
  53.             dataType: "json",
  54.  
  55.             success: function(response){
  56.                 if (response.msg) {
  57.                 console.log(response);
  58.                 }
  59.                 else {
  60.                     console.log(response);
  61.                 }
  62.             }
  63.         });
  64.          return false;
  65.     });                
  66. })
  67.  
  68.  
  69. /******************************* Report ajax-qjuery ***************************/
  70.  
  71. $(document).ready(function(){
  72.    
  73.     $('.report').click(function(){
  74.         var actionUrl=$(this).data('action-url');
  75.         var controller=$(this).data('controller');
  76.         var id = $(this).data('id');
  77.            
  78.         $.ajax({
  79.             type: "POST",
  80.             url: actionUrl,
  81.             data: "id="+$(this).data('id')+"&controller="+$(this).data('controller'),
  82.             dataType: "json",
  83.  
  84.             success: function(response){
  85.                 if (response.msg) {
  86.                     $(".reportmgs").after("<span class=fade>"+response.msg+"</span>");
  87.                     $(".fade").fadeOut(5000);
  88.                 }
  89.                 else {
  90.                     console.log(response);
  91.                 }
  92.             }
  93.  
  94.         });
  95.          return false;
  96.     });                
  97.  
  98. });
  99.  
  100. /*************************  play tracks add to table plays*****************************/
  101.  $(document).ready(function(){
  102.     $('.play').live("click", function(){
  103.         var actionUrl=$(this).data('action-url');
  104.         var id = $(this).data('id');
  105.         newwindow = window.open($(this).attr('href'), 'playerwindow', 'height=200,width=550');
  106.         $.ajax({
  107.             type: "POST",
  108.             url: actionUrl,
  109.             data: "id="+$(this).data('id'),
  110.             dataType: "json",
  111.             success: function(response){
  112.                 // refresh playlist
  113.                 if(!newwindow) {
  114.                     newwindow = window.open('','playerwindow');
  115.                 }
  116.                 return true;
  117.             }
  118.         });
  119.         newwindow.focus();
  120.         return false;
  121.     });
  122. });
  123.  
  124.    
  125. /************************* share show icons *****************************/  
  126.  $(document).ready(function(){
  127.       $("#share").hide();
  128.       $('.styled-select').click(function(){
  129.           $("#share").show();  
  130.           });
  131.  });
  132.  
  133. /********* add to playlisyt session NController action addplaylist ***********/
  134.  $(document).ready(function(){
  135.       $('.add').click(function(){
  136.         var actionUrl=$(this).data('action-url');
  137.         var id = $(this).data('id');
  138.  
  139.            
  140.             $.ajax({
  141.                 type: "POST",
  142.                 url: actionUrl,
  143.                 data: "id="+$(this).data('id'),
  144.                 dataType: "json",
  145.    
  146.                 success: function(response){
  147.  
  148.                     // refresh playlist
  149.                     if(!newwindow){
  150.                         newwindow = window.open('','playerwindow');
  151.                     }
  152.                     newwindow.urabialist.add(response);
  153.                     return true;
  154.  
  155.                 }
  156.             });
  157.              return false;
  158.     });
  159.  
  160. });
  161.  
  162.  
  163. /************************* PLaceHolder IE ************************************/
  164.  
  165. function setPlaceholderText() {
  166.     var PLACEHOLDER_SUPPORTED = 'placeholder' in document.createElement('input');
  167.         if (PLACEHOLDER_SUPPORTED || !$(':input[placeholder]').length) {
  168.         return;
  169.         }
  170.        
  171.         $(':input[placeholder]').each(function() {
  172.         var el = $(this);
  173.         var text = el.attr('placeholder');
  174.        
  175.         function add_placeholder() {
  176.         if (!el.val() || el.val() === text) {
  177.         el.val(text).addClass('placeholder_text');
  178.         }
  179.         }
  180.        
  181.         add_placeholder();
  182.        
  183.         el.focus(function() {
  184.         if (el.val() === text) {
  185.         el.val('').removeClass('placeholder_text');;
  186.         }
  187.         }).blur(function() {
  188.         if (!el.val()) {
  189.         el.val(text).addClass('placeholder_text');;
  190.         }
  191.         });
  192.        
  193.         el.closest('form').submit(function() {
  194.         if (el.val() === text) {
  195.         el.val('');
  196.         }
  197.         }).bind('reset', function() {
  198.         setTimeout(add_placeholder, 50);
  199.         });
  200.     });
  201. }
Add Comment
Please, Sign In to add comment