Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // JavaScript Document
- /******************************* Rate ajax-qjuery ***************************/
- var newwindow;
- var myWindowFlag;
- $(document).ready(function(){
- $('.action').live("click", function(){
- var actionUrl=$(this).data('action-url');
- var id = $(this).data('id');
- var elem = $(this);
- $.ajax({
- type: "POST",
- url: actionUrl,
- data: "id="+$(this).data('id'),
- dataType: "json",
- success: function(response){
- if (response.msg) {
- $(".message" + id).after("<span class=fade>"+response.msg+"</span>");
- $(".fade").fadeOut(5000);
- //$(".lcount" + id).after(response.count);
- elem.parent().parent().find('.selected').removeClass('selected');
- elem.addClass('selected');
- }
- else {
- console.log(response);
- }
- }
- });
- return false;
- });
- })
- /******************************* video play ajax-qjuery ***************************/
- $(document).ready(function(){
- $('#yp').load(function(){
- alert('haha');
- var actionUrl=$(this).data('action-url');
- var id = $(this).data('id');
- $.ajax({
- type: "POST",
- url: actionUrl,
- data: "id="+$(this).data('id'),
- dataType: "json",
- success: function(response){
- if (response.msg) {
- console.log(response);
- }
- else {
- console.log(response);
- }
- }
- });
- return false;
- });
- })
- /******************************* Report ajax-qjuery ***************************/
- $(document).ready(function(){
- $('.report').click(function(){
- var actionUrl=$(this).data('action-url');
- var controller=$(this).data('controller');
- var id = $(this).data('id');
- $.ajax({
- type: "POST",
- url: actionUrl,
- data: "id="+$(this).data('id')+"&controller="+$(this).data('controller'),
- dataType: "json",
- success: function(response){
- if (response.msg) {
- $(".reportmgs").after("<span class=fade>"+response.msg+"</span>");
- $(".fade").fadeOut(5000);
- }
- else {
- console.log(response);
- }
- }
- });
- return false;
- });
- });
- /************************* play tracks add to table plays*****************************/
- $(document).ready(function(){
- $('.play').live("click", function(){
- var actionUrl=$(this).data('action-url');
- var id = $(this).data('id');
- newwindow = window.open($(this).attr('href'), 'playerwindow', 'height=200,width=550');
- $.ajax({
- type: "POST",
- url: actionUrl,
- data: "id="+$(this).data('id'),
- dataType: "json",
- success: function(response){
- // refresh playlist
- if(!newwindow) {
- newwindow = window.open('','playerwindow');
- }
- return true;
- }
- });
- newwindow.focus();
- return false;
- });
- });
- /************************* share show icons *****************************/
- $(document).ready(function(){
- $("#share").hide();
- $('.styled-select').click(function(){
- $("#share").show();
- });
- });
- /********* add to playlisyt session NController action addplaylist ***********/
- $(document).ready(function(){
- $('.add').click(function(){
- var actionUrl=$(this).data('action-url');
- var id = $(this).data('id');
- $.ajax({
- type: "POST",
- url: actionUrl,
- data: "id="+$(this).data('id'),
- dataType: "json",
- success: function(response){
- // refresh playlist
- if(!newwindow){
- newwindow = window.open('','playerwindow');
- }
- newwindow.urabialist.add(response);
- return true;
- }
- });
- return false;
- });
- });
- /************************* PLaceHolder IE ************************************/
- function setPlaceholderText() {
- var PLACEHOLDER_SUPPORTED = 'placeholder' in document.createElement('input');
- if (PLACEHOLDER_SUPPORTED || !$(':input[placeholder]').length) {
- return;
- }
- $(':input[placeholder]').each(function() {
- var el = $(this);
- var text = el.attr('placeholder');
- function add_placeholder() {
- if (!el.val() || el.val() === text) {
- el.val(text).addClass('placeholder_text');
- }
- }
- add_placeholder();
- el.focus(function() {
- if (el.val() === text) {
- el.val('').removeClass('placeholder_text');;
- }
- }).blur(function() {
- if (!el.val()) {
- el.val(text).addClass('placeholder_text');;
- }
- });
- el.closest('form').submit(function() {
- if (el.val() === text) {
- el.val('');
- }
- }).bind('reset', function() {
- setTimeout(add_placeholder, 50);
- });
- });
- }
Add Comment
Please, Sign In to add comment