1(function($) { 2$(document).ready(function() { 3 4 function check_pro_version_by_class() { 5 if($(".tooltip_inner.powered_by").is(":visible")) 6 return true; 7 return false; 8 } 9 10 $('.greeting_block').each(function(i){ 11 if(i > 1) { 12 $(this).next('.sound_container_pro').remove(); 13 $(this).prev('.gspeech_selection').remove(); 14 } 15 }); 16 17 function navigate_tooltip($tooltip) { 18 19 20 var center_offset_x = parseFloat($tooltip.parent('span').find('.sound_container_pro ').width() / 2); 21 var tooltip_width = parseFloat($tooltip.find('.tooltip_inner').width()); 22 23 if($tooltip.find('.the-tooltip').hasClass('center')) { 24 var final_offset = -1 * ((tooltip_width / 2) * 1 + 14 * 1 - center_offset_x * 1); 25 $tooltip.css({'left': final_offset, opacity: 0,display: 'block'}); 26 } 27 else if($tooltip.find('.the-tooltip').hasClass('left')) { 28 var final_offset = -32 * 1 + center_offset_x * 1; 29 $tooltip.css({'left': final_offset, opacity: 0,display: 'block'}); 30 } 31 else if($tooltip.find('.the-tooltip').hasClass('right')) { 32 var final_offset = 32 * 1 + center_offset_x * 1; 33 $tooltip.css({'left': final_offset, opacity: 0,display: 'block'}); 34 } 35 36 37 if($tooltip.find('.the-tooltip').hasClass('top')) { 38 $tooltip.css({'top': -200}); 39 var new_opacity = 0.95; 40 $tooltip.stop(false,false).animate( { 41 top: 1, 42 opacity: new_opacity 43 },300,'easeOutBack'); 44 } 45 else if($tooltip.find('.the-tooltip').hasClass('bottom')) { 46 if($tooltip.find('.tooltip_inner').hasClass('powered_by')) 47 var new_opacity = 0.95; 48 else 49 var new_opacity = 0.95; 50 51 var h = -1 * parseFloat($tooltip.parent('span').find('.sound_container_pro ').height()); 52 $tooltip.css({'bottom': -200}); 53 $tooltip.stop(false,false).animate( { 54 bottom: h, 55 opacity: new_opacity 56 },300,'easeOutBack'); 57 } 58 } 59 function hide_tooltip($tooltip) { 60 if($tooltip.find('.the-tooltip').hasClass('top')) { 61 $tooltip.stop(true,true).delay(200).animate( { 62 top: -200, 63 opacity: 0 64 },300,'easeInBack',function() { 65 $(this).hide(); 66 }); 67 } 68 else if($tooltip.find('.the-tooltip').hasClass('bottom')) { 69 $tooltip.stop(true,true).delay(200).animate( { 70 bottom: -200, 71 opacity: 0 72 },300,'easeInBack',function() { 73 $(this).hide(); 74 }); 75 } 76 } 77 78 //show backlinks 79 function show_backlinks() { 80 $('.sound_container_pro').each(function() { 81 $tooltip = $(this).next('.sexy_tooltip'); 82 setTimeout(function() { 83 navigate_tooltip($tooltip); 84 },1500); 85 }) 86 }; 87 show_backlinks(); 88 89 $('.sound_container_pro').each(function(i) { 90 $elem = $(this); 91 var autoplay = $(this).attr("autoplaypro"); 92 var speechtimeout =$(this).attr("speechtimeout"); 93 if(isNaN(speechtimeout)) 94 speechtimeout = 0; 95 speechtimeout = parseFloat(speechtimeout); 96 var selector =$(this).attr("selector"); 97 var event =$(this).attr("eventpro"); 98 99 if(selector != '' && event != '' && createtriggerspeechcount < 1) { 100 createtriggerspeech($elem,speechtimeout,selector,event); 101 createtriggerspeechcount ++; 102 } 103 else if(autoplay == 1) { 104 triggerspeech($elem,speechtimeout); 105 }; 106 107 }); 108 109 function triggerspeech($elem,speechtimeout) { 110 speechtimeoutfinal = speechtimeoutfinal + speechtimeout*1 + 200*1; 111 setTimeout(function() { 112 stop_all_speakers_pro($('.sound_container_pro')); 113 clearAllPlayers(); 114 setTimeout(function() { 115 make_speeching($elem); 116 },10); 117 },speechtimeoutfinal); 118 }; 119 120 function createtriggerspeech($elem,speechtimeout,selector,event) { 121 $("" + selector + "").bind(event, function() { 122 var $active_elem = $(this); 123 var new_htm = $active_elem.html().replace(/<\/?[^>]+>/gi, ''); 124 var new_val = $active_elem.val().replace(/<\/?[^>]+>/gi, ''); 125 stop_all_speakers_pro($('.sound_container_pro')); 126 clearAllPlayers(); 127 128 var htm = $elem.children('.sound_text_pro').html(); 129 if(htm == 'gspeech_html' || $elem.children('.sound_text_pro').attr("htm") == 'gspeech_html') { 130 $elem.children('.sound_text_pro').attr("htm","gspeech_html"); 131 $elem.children('.sound_text_pro').html(new_htm); 132 } 133 else if(htm == 'gspeech_value' || $elem.children('.sound_text_pro').attr("htm") == 'gspeech_value') { 134 $elem.children('.sound_text_pro').attr("htm","gspeech_value"); 135 $elem.children('.sound_text_pro').html(new_val); 136 } 137 setTimeout(function() { 138 make_speeching($elem); 139 },speechtimeout); 140 }); 141 }; 142 143 var speech_enable_count = 1; 144 $('.sound_container_pro').each(function(i) {
145 $this = $(this); 146 if($(this).hasClass("greeting_block")) 147 ++speech_enable_count; 148 if(i < speech_enable_count) { 149 var h1 = $(this).parent('span').height(); 150 var h2 = $(this).height(); 151 var w = $(this).width(); 152 var delta_w = w - 8; 153 var delta = (h1 - h2)/2; 154 $(this).parent('span').css({top: delta + 'px'}); 155 var delta_htm = '<label style="width: ' + delta_w + 'px;display: inline-block"> </label>'; 156 $(this).parent('span').after(delta_htm); 157 158 } else { 159 $(this).remove(); 160 } 161 }); 162 163 $('.sound_container_pro').hover(function() { 164 var $selection = $(this).parent('span').prev('.gspeech_selection'); 165 var roll = $selection.attr("roll"); 166 roll = roll == '' ? 1 : roll; 167 --roll; 168 169 var an_time = parseFloat(gspeech_animation_time[roll]); 170 var speaker_op = parseFloat(gspeech_spoa[roll] / 100); 171 172 $(this).stop().animate({ 173 opacity: speaker_op 174 },an_time); 175 176 $selection.stop().animate({ 177 backgroundColor: gspeech_bca[roll], 178 color: gspeech_ca[roll] 179 },an_time); 180 181 navigate_tooltip($(this).prev('.sexy_tooltip')); 182 183 },function() { 184 var $selection = $(this).parent('span').prev('.gspeech_selection'); 185 var roll = $selection.attr("roll"); 186 roll = roll == '' ? 1 : roll; 187 --roll; 188 189 190 191 //onmouseleave, fade back 192 if(! $(this).hasClass('active')) { 193 var an_time = parseFloat(gspeech_animation_time[roll]); 194 var speaker_op = parseFloat(gspeech_spop[roll] / 100); 195 $(this).stop().animate({ 196 opacity: speaker_op 197 },an_time); 198 }; 199 200 if(! $selection.hasClass('active')) { 201 $selection.stop().animate({ 202 backgroundColor: gspeech_bcp[roll], 203 color: gspeech_cp[roll] 204 },an_time); 205 }; 206 207 //hide_tooltip 208 hide_tooltip($(this).prev('.sexy_tooltip')); 209 }); 210 211 $('.sound_container_pro').mousedown(function() { 212 pro_container_clicked = true; 213 basic_plg_enable = false; 214 }); 215 216 $("body").mousedown(function() { 217 if($('.sound_container_pro.active').length > 0 && !pro_container_clicked) 218 basic_plg_enable = true; 219 220 stop_all_speakers_pro($('.sound_container_pro')); 221 clearAllPlayers(); 222 reset_opacities(); 223 $('.sound_container_pro').removeClass('active'); 224 $('.gspeech_selection').removeClass('active'); 225 }); 226 227 $('.sound_container_pro').click(function() { 228 if(false) { 229 // if(!check_pro_version_by_class()) { 230 alert('To hide a backlink please purchase a GSpeech PRO version'); 231 return false; 232 } 233 make_speeching($(this)); 234 }); 235 236 function reset_opacities() { 237 $('.sound_container_pro').each(function() { 238 var $selection = $(this).parent('span').prev('.gspeech_selection'); 239 var roll = $selection.attr("roll"); 240 roll = roll == '' ? 1 : roll; 241 --roll; 242 var an_time = parseFloat(gspeech_animation_time[roll]); 243 var speaker_op = parseFloat(gspeech_spop[roll] / 100); 244 $(this).animate({opacity: speaker_op},an_time) 245 }) 246 } 247 248 function make_speeching($elem) { 249 250 var sel_txt = $elem.children('.sound_text_pro').html(); 251 if(speechtxt != sel_txt) { 252 var $selection = $elem.parent('span').prev('.gspeech_selection'); 253 $selection.stop().removeAttr("style").addClass('active'); 254 $elem.addClass('active'); 255 256 var lang = $elem.attr("language"); 257 lang = lang == '' ? lang_identifier : lang; 258 259 blinking_enable_pro = true; 260 blink_start_enable_pro = true; 261 262 //animate to active opacity 263 var roll = $elem.attr("roll"); 264 roll = roll == '' ? 1 : roll; 265 --roll; 266 var speaker_op = parseFloat(gspeech_spoa[roll] / 100); 267 $elem.stop().fadeTo(400,speaker_op); 268 269 //rotate me 270 rotate_speaker_pro($elem); 271 272 clearAllPlayers(); 273 make_audio_pro($elem.children('.sound_text_pro'),$elem,lang); 274 } 275 speechtxt = sel_txt; 276 setTimeout(function() { 277 speechtxt = ''; 278 },100); 279 }; 280 281 function stop_speaker_pro($elem) { 282 basic_plg_enable = true; 283 clearAllPlayers(); 284 $elem.rotate({animateTo:360}); 285 286 var roll = $elem.attr("roll"); 287 roll = roll == '' ? 1 : roll; 288 --roll; 289 var speaker_op = parseFloat(gspeech_spop[roll] / 100); 290 $elem.stop().fadeTo(400,speaker_op).removeClass('active'); 291 292 for(f in blink_timer) { 293 clearTimeout(blink_timer[f]); 294 } 295 for(f in rotate_timer) { 296 clearInterval(rotate_timer[f]); 297 } 298 }; 299 300 function stop_all_speakers_pro($elem) { 301 clearAllPlayers(); 302 $('.sound_container_pro.active').rotate({animateTo:360}); 303 304 var roll = $elem.attr("roll"); 305 roll = roll == '' ? 1 : roll; 306 --roll; 307 308 var speaker_op = parseFloat(gspeech_spop[roll] / 100); 309 $elem.stop().removeClass('active'); 310 311 for(f in blink_timer) { 312 clearTimeout(blink_timer[f]); 313 } 314 for(f in rotate_timer) { 315 clearInterval(rotate_timer[f]); 316 } 317 }; 318 319 function rotate_speaker_pro($elem) { 320 var angle = 0; 321 rotate_timer_element = setInterval(function(){ 322 angle+=3; 323 $elem.rotate(angle); 324 },15); 325 rotate_timer.push(rotate_timer_element); 326 }; 327 328 function blink_speaker_pro($elem) { 329 if(blink_start_enable_pro) { 330 $elem.fadeTo(200,0.2); 331 blink_start_enable_pro = false; 332 } 333 else { 334 $elem.fadeTo(200,1); 335 blink_start_enable_pro = true; 336 } 337 var t = setTimeout(function() { 338 blink_speaker_pro($elem); 339 },800); 340 blink_timer.push(t); 341 }; 342 343 function change_speaker_animation_pro($elem) { 344 if(blinking_enable_pro) { 345 for(f in rotate_timer) { 346 clearInterval(rotate_timer[f]); 347 } 348 $elem.rotate({animateTo:0}); 349 blink_speaker_pro($elem); 350 } 351 blinking_enable_pro = false; 352 }; 353 354 //main function which creates audio 355 function make_audio_pro($txt_element,$elem,lang) { 356 selected_txt = $txt_element.html(); 357 var 358 words_array = new Array(), 359 sent_array = new Array(), 360 sent_index = 0; 361 362 words_array = selected_txt.split(/[^\S]+/); 363 364 for(var i = 0; i < words_array.length; i++) { 365 if(sent_array[sent_index] == undefined) { 366 sent_array[sent_index] = ''; 367 } 368 369 var total_l = sent_array[sent_index].length + words_array[i].length; 370 if(sent_array[sent_index].length < speech_text_length && total_l < speech_text_length) { 371 sent_array[sent_index] += words_array[i] + ' '; 372 } 373 else {
374 ++sent_index; 375 sent_array[sent_index] = words_array[i] + ' '; 376 } 377 }; 378 379 var players_count = sent_array.length; 380 381 var htm_cont = ''; 382 for(var i = 0; i < players_count; i++) { 383 htm_cont += '<audio id="player' + i + '" src="' + streamerphp_folder + 'gspeech.mpeg" type="' + translation_audio_type + '" controls="controls"></audio>'; 384 }; 385 $("#sound_audio").html(htm_cont); 386 387 for(var i = 0; i < players_count; i++) { 388 create_htm(i,players_count); 389 }; 390 391 // new version addings 392 393 function gs_get_token(encoded_text) { 394 var query = encoded_text; 395 var cM = function(a) { 396 return function() { 397 return a 398 } 399 }; 400 var of = "="; 401 var dM = function(a, b) { 402 for (var c = 0; c < b.length - 2; c += 3) { 403 var d = b.charAt(c + 2), 404 d = d >= t ? d.charCodeAt(0) - 87 : Number(d), 405 d = b.charAt(c + 1) == Tb ? a >>> d : a << d; 406 a = b.charAt(c) == Tb ? a + d & 4294967295 : a ^ d 407 } 408 return a 409 }; 410 411 var eM = null; 412 var cb = 0; 413 var k = ""; 414 var Vb = "+-a^+6"; 415 var Ub = "+-3^+b+-f"; 416 var t = "a"; 417 var Tb = "+"; 418 var dd = "."; 419 var hoursBetween = Math.floor(Date.now() / 3600000); 420 window.TKK = hoursBetween.toString(); 421 422 fM = function(a) { 423 var b; 424 if (null === eM) { 425 var c = cM(String.fromCharCode(84)); // char 84 is T 426 b = cM(String.fromCharCode(75)); // char 75 is K 427 c = [c(), c()]; 428 c[1] = b(); 429 // So basically we're getting window.TKK 430 eM = Number(window[c.join(b())]) || 0 431 } 432 b = eM; 433 434 // This piece of code is used to convert d into the utf-8 encoding of a 435 var d = cM(String.fromCharCode(116)), 436 c = cM(String.fromCharCode(107)), 437 d = [d(), d()]; 438 d[1] = c(); 439 for (var c = cb + d.join(k) + 440 of, d = [], e = 0, f = 0; f < a.length; f++) { 441 var g = a.charCodeAt(f); 442 443 128 > g ? d[e++] = g : (2048 > g ? d[e++] = g >> 6 | 192 : (55296 == (g & 64512) && f + 1 < a.length && 56320 == (a.charCodeAt(f + 1) & 64512) ? (g = 65536 + ((g & 1023) << 10) + (a.charCodeAt(++f) & 1023), d[e++] = g >>
443 18 | 240, d[e++] = g >> 12 & 63 | 128) : d[e++] = g >> 12 | 224, d[e++] = g >> 6 & 63 | 128), d[e++] = g & 63 | 128) 444 } 445 446 447 a = b || 0; 448 for (e = 0; e < d.length; e++) a += d[e], a = dM(a, Vb); 449 a = dM(a, Ub); 450 0 > a && (a = (a & 2147483647) + 2147483648); 451 a %= 1E6; 452 return a.toString() + dd + (a ^ b) 453 }; 454 455 var token = fM(query); 456 457 return token; 458 } 459 460 function gs_replace_ch(str) { 461 var str = str.replace("'", ""); 462 str = str.replace('"', ''); 463 str = str.replace('', ''); 464 str = str.replace('/', ''); 465 str = str.replace(' ', ''); 466 // str = str.replace('&', ''); 467 468 return str; 469 } 470 471 function create_htm(i,players_count) { 472 $('#player' + i).mediaelementplayer({ 473 success: function (mediaElement, domObject) { 474 //detect media end 475 players[i] = mediaElement; 476 477 478 // sets src 479 var encoded_text = gs_replace_ch(sent_array[i]); 480 var token = gs_get_token(encoded_text); 481 encoded_text = encodeURIComponent(encoded_text); 482 var embed_url = streamerphp_folder + 'streamer.php?q=' + encoded_text + '&l=' + lang_identifier + '&tr_tool=' +translation_tool + '&token=' + token; 483 mediaElement.setSrc(embed_url); 484 485 //play next audio, when current ends 486 mediaElement.addEventListener('pause', function(e) { 487 try { 488 players[i + 1].play() 489 } catch(e){} 490 }, false); 491 492 players[0].addEventListener('progress', function(e) { 493 change_speaker_animation_pro($elem); 494 }, false); 495 496 if(i == players_count - 1) { 497 players[players_count - 1].addEventListener('pause', function(e) { 498 stop_speaker_pro($elem); 499 }, false); 500 } 501 502 mediaElement.load(); 503 504 if(i == 0) { 505 mediaElement.play(); 506 } 507 } 508 }); 509 } 510 511 }; 512 513 function clearAllPlayers() { 514 for(var c in players) { 515 players[c] = ''; 516 } 517 $('#sound_audio').html(''); 518 }; 519 520 521}); 522})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.