Rev 17070 | Blame | Compare with Previous | Last modification | View Log | RSS feed
$.fn.stars = function() {return $(this).each(function() {// Get the valuevar val = parseFloat($(this).html());// Make sure that the value is in 0 - 5 range, multiply to get widthval = Math.round(val * 2) / 2;var size = Math.max(0, (Math.min(5, val))) * 16;// Create stars holdervar $span = $('<span />').width(size);// Replace the numerical value with stars$(this).html($span);});}$(function() {$('span.stars').stars();$('.getapp').on('click',function(e){$('#loadingModal').modal('show');var that = $(this);var req = $.ajax({url: apihost+'appAffiliates/generateRedirectUrl/'+$(that).data('me')+'/'+$(that).data('id'),// Tell jQuery we're expecting JSONPdataType: "jsonp",// Tell YQL what we want and that we want JSONmethod: 'get',// timeout: 30000,// Work with the responsesuccess: function( response ) {//$('#loadingModal').modal('hide');if(response.message=='Success'){document.location = response.url;}}},'json');ga('send', 'event', 'app', 'click',$(that).data('name'));setTimeout(function(){$('#loadingModal').modal('hide');},10000);});});