var ps_time=0,is_modal=0;function close_modal(){$(".modal_default3").modal("hide").remove()}function setCookie(e,t,a){var n=new Date;n.setDate(n.getDate()+a),document.cookie=e+"="+escape(t)+"; path=/;expires="+n.toGMTString()+";"}function getCookie(e){for(var t=e+"=",a=0;a<=document.cookie.length;){var n=a+t.length;if(document.cookie.substring(a,n)==t)return-1==(endOfCookie=document.cookie.indexOf(";",n))&&(endOfCookie=document.cookie.length),unescape(document.cookie.substring(n,endOfCookie));if(0==(a=document.cookie.indexOf(" ",a)+1))break}return""}function popupquit(e,t){var a=1;setCookie(e,"no",a=parseInt(a,10)),"close"==t&&window.close(),"modal"==t&&$(".modal").modal("hide")}function check_width(){$(".modal_default3").css("width",window.outerWidth+"px"),$(".modal_default3>iframe").css("width","100%")}function iOS(){var e=["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"];if(navigator.platform)for(;e.length;)if(navigator.platform===e.pop())return!0;return!1}window.history&&window.history.pushState&&window.history.replaceState&&(window.onpopstate=function(e){e&&e.state&&e.state.url?ps_time>0&&(e.state.url.toLowerCase().indexOf("/card"),$("#modal_default3").modal("show")):ps_time>0&&(close_modal(),ps_time=0)}),$(document).on("click",".modal-backdrop",function(e){return e.preventDefault(),close_modal(),!1}),$(document).ready(function(){$(window).load(function(){$(".sticky").sticky({topSpacing:0})})}),$(document).ready(function(){new WOW({boxClass:"wow",animateClass:"animated",offset:100,mobile:!1}).init()}),$(document).ready(function(){$(window).stellar({horizontalScrolling:!1,responsive:!0})}),$(document).ready(function(){$("#main-top-issue-1").owlCarousel({items:3,itemsCustom:!1,itemsDesktop:[1199,2],itemsDesktopSmall:[980,2],itemsTablet:[768,3],itemsTabletSmall:!1,itemsMobile:[479,2],singleItem:!1,startDragging:!0,autoPlay:7e3}),$("#main-top-issue-2").owlCarousel({items:6,itemsCustom:!1,itemsDesktop:[1199,3],itemsDesktopSmall:[980,3],itemsTablet:[768,3],itemsTabletSmall:!1,itemsMobile:[479,1],singleItem:!1,startDragging:!0,autoPlay:7e3}),$("#main-carousel-3").owlCarousel({items:1,loop:!0,margin:10,responsive:{479:{items:1},768:{items:2},980:{items:3}}}),$("#collection_mv1").owlCarousel({items:2,itemsCustom:!1,itemsDesktop:[1199,2],itemsDesktopSmall:[980,2],itemsTablet:[768,2],itemsTabletSmall:!1,itemsMobile:[479,1],autoHeight:!0,startDragging:!0,autoPlay:7e3}),$("#collection-section-2").owlCarousel({items:3,itemsCustom:!1,itemsTablet:[768,1],itemsTabletSmall:!1,itemsMobile:[479,1],singleItem:!1,startDragging:!0,autoPlay:5e3})}),jQuery(document).ready(function(e){e(".counter").counterUp({delay:100,time:800})}),$(document).ready(function(){$(".show-image").magnificPopup({type:"image"})}),$(document).ready(function(){$(".main-flex-slider,.testi-slide").flexslider({slideshowSpeed:5e3,directionNav:!1,animation:"fade"})}),$(document).ready(function(){$("#clients-slider").owlCarousel({autoPlay:3e3,pagination:!1,items:4,itemsDesktop:[1199,3],itemsDesktopSmall:[991,2]})}),$(document).ready(function(){$("[data-toggle=popover]").popover(),$("[data-toggle=tooltip]").tooltip()}),$(document).ready(function(){jQuery(function(){jQuery(".player").mb_YTPlayer()})}),$(document).ready(function(){$(window).scroll(function(){$(this).scrollTop()>100?$(".transparent-header").css("background","#252525"):$(".transparent-header").css("background","transparent")}),$(".owl_box .btn_next").click(function(){$(this).parent().children(".owl-carousel").trigger("next.owl.carousel")}),$(".owl_box .btn_prev").click(function(){$(this).parent().children(".owl-carousel").trigger("prev.owl.carousel")})}),$(document).on("click",".keep_layer",function(e){e.stopPropagation()}),$(document).on("click",".index_login",function(e){$(".box_signup").addClass("hide"),$(".box_login").removeClass("hide")}),$(document).on("click",".btn_show_signup",function(){$(".dropdown_login .dropdown-menu").addClass("hide"),$(".box_signup").removeClass("hide")}),$(document).on("click",".btn_show_login",function(){$(".dropdown_login .dropdown-menu").addClass("hide"),$(".box_login").removeClass("hide")}),$(document).on("click",".btn_show_mypage",function(){$(".dropdown_login .dropdown-menu").addClass("hide"),$(".box_mypage").removeClass("hide")}),$(document).on("click",".tag_recommend",function(){return $("#tagWidget").tagit({tags:{0:$(this).attr("data-tag")}}),!1}),$(document).on("change",".tag_select",function(){var e=$(this).val(),t=$(this).attr("data-target");return e&&$("#"+t).tagit({tags:{0:e}}),!1}),$(document).on("change",".select_go",function(){var e=$(this).val();return e&&"#"!=e&&(self.location.href=e),!1}),$(document).on("click",".clickpic",function(){var e=$(this).attr("src");return window.open(e,"_blank"," status=yes,menubar=yes,scrollbars=yes,resizable=yes "),!1}),$(document).on("click",".windowopen",function(){var e=$(this).attr("href");return window.open(e,"_blank"," status=yes,menubar=yes,scrollbars=yes,resizable=yes "),!1}),$(document).on("click",".windowopen2",function(){var e=$(this).attr("href");return window.open(e,"_blank"," status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=780,height=600"),!1}),$(document).on("click",".modal_image",function(e){e.preventDefault();var t=$(this).attr("data-target"),a=$(this).attr("href");return $("#"+t).html()?$("#"+t).modal("show"):jQuery.ajax({type:"POST",dataType:"html",url:a,success:function(e){return $("body").append(e),$("#"+t).modal("show"),!1},error:function(e){return!1}}),!1}),$(document).on("click",".btn_work_in_progress_right",function(e){e.preventDefault();var t=$(this).parent().children(".inner").children(".work_in_progress"),a=$(t).scrollLeft()+270;return a-=a%270,$(t).animate({scrollLeft:a},600),!1}),$(document).on("click",".btn_work_in_progress_left",function(e){e.preventDefault();var t=$(this).parent().children(".inner").children(".work_in_progress"),a=$(t).scrollLeft()-270;return a-=a%90,$(t).animate({scrollLeft:a},600),!1}),$(document).on("click",".btn_check_use_image",function(e){e.preventDefault();var t=$(this).parent().parent().parent();$(t).children(".check_use").children(".btn_check_use").click()}),$(document).on("click",".btn_get_image_url",function(e){e.preventDefault();var t=$(".get_image_url").val();if(!t)return $(".get_image_url").focus(),!1;var a=$(this).attr("href");a=a+"?url="+encodeURIComponent(t);var n="modal_getimage";return $("#"+n).html()&&$("#"+n).remove(),$(".get_image_loading").show(),jQuery.ajax({type:"GET",dataType:"html",url:a,success:function(e){return $("body").append(e),$("#"+n).modal("show"),$(".get_image_loading").hide(),GetImageFromUrl(),!1},error:function(e){return $(".get_image_loading").hide(),!1}}),!1}),$(document).on("click",".btn_check_use",function(e){return e.preventDefault(),!1}),$(document).on("change",".select_collection_type",function(){var e=$(this).val(),t=$(this).attr("data-target");return $("#"+t+" .area_option").hide(),$("#"+t+" .area_option_"+e).show(),!1}),$(document).on("change",".select_collection_size",function(){var e=$(this).val(),t=$(this).parent().parent().parent().children(".area_select_collection_size");return"none"==e?$(t).hide():$(t).show(),!1}),$(document).ready(function(){$(".check_area_option").each(function(){var e=$(this).attr("id"),t=$("#"+e+"_type").val();$("#"+e+" .area_option").hide(),$("#"+e+" .area_option_"+t).show(),$("#"+e+" .area_option_hide_"+t).hide()})}),$(document).on("click",".btn_check_main",function(e){return e.preventDefault(),"Y"==$(this).attr("data-check")?($(this).attr("data-check","N"),$(this).children("i").removeClass("fa-square-o").addClass("fa-check-square-o")):($(this).attr("data-check","Y"),$(this).children("i").removeClass("fa-check-square-o").addClass("fa-square-o")),!1}),$(document).on("click",".btn_like",function(e){e.preventDefault();var t=$(this).attr("href"),a=$(this).children(".count"),n=$(this).children("i");return jQuery.ajax({type:"POST",dataType:"json",url:t,success:function(e){"OK"==e.response?($(a).html(1*$(a).html()+1),$(n).removeClass("fa-heart-o"),$(n).addClass("fa-heart")):"CANCEL"==e.response&&($(a).html(1*$(a).html()-1),$(n).removeClass("fa-heart"),$(n).addClass("fa-heart-o"))},error:function(e){return alert(e.responseText),477==e.status&&(top.location.href="/user/login?returnUrl="+self.location.href),!1}}),!1}),$(document).on("click",".btn_share",function(){var e=$(this).attr("href");window.open(e,"_blank"," status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=800,height=600");var t=$(this).attr("data-href");return jQuery.ajax({type:"POST",dataType:"json",url:t,success:function(e){e&&e.response},error:function(e){alert(e.responseText)}}),!1}),$(document).on("click",".btn_share_email",function(){$(this).attr("href");var e=$(this).attr("data-href");return jQuery.ajax({type:"POST",dataType:"json",url:e,success:function(e){e&&e.response},error:function(e){alert(e.responseText)}}),!1}),$(document).on("click",".btn_share_kakaostory",function(){$(this).attr("href");var e=$(this).attr("data-href");return shareStory(),jQuery.ajax({type:"POST",dataType:"json",url:e,success:function(e){e&&e.response},error:function(e){alert(e.responseText)}}),!1}),$(document).on("click",".btn_request",function(){$(this).attr("href");return!1}),$(document).on("click",".btn_join",function(){var e=$(this).attr("href");return window.open(e,"_blank"," status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=1000,height=700"),!1}),$(document).on("click",".btn_new_window",function(){var e=$(this).attr("href");return window.open(e,"_blank"),!1}),$(document).on("click",".btn_follow",function(e){e.preventDefault();var t=$(this).attr("href"),a=$(this).children("img");return jQuery.ajax({type:"POST",dataType:"json",url:t,success:function(e){"OK"==e.response?$(a).attr("src",$(a).attr("src").replace("icon_plus.png","icon_check.png")):"OK_UNFOLLOW"==e.response&&($(a).attr("src",$(a).attr("src").replace("icon_check.png","icon_plus.png")),alert(e.responseText))},error:function(e){return alert(e.responseText),!1}}),!1}),$(document).on("click",".btn_unfollow",function(e){e.preventDefault();var t=$(this).attr("href");return jQuery.ajax({type:"POST",dataType:"json",url:t,success:function(e){"OK"==e.response&&(alert(e.responseText),self.location.href=self.location.href)},error:function(e){return alert(e.responseText),!1}}),!1}),$(document).on("click",".btn_delete",function(e){e.preventDefault();var t=$(this).attr("href"),a=$(this).attr("data-message");return confirm(a)&&jQuery.ajax({type:"POST",dataType:"json",url:t,success:function(e){if("OK"==e.response)return self.location.href=e.returnUrl,!1},error:function(e){return alert(e.responseText),!1}}),!1}),$(document).on("click",".btn_cancel_online",function(e){e.preventDefault();var t=$(this).attr("href"),a=$(this).attr("data-message");return confirm(a)&&jQuery.ajax({type:"POST",dataType:"json",url:t,success:function(e){if("OK"==e.response)return self.location.href=e.returnUrl,!1},error:function(e){return alert(e.responseText),!1}}),!1}),$(document).on("click",".btn_join_online",function(e){e.preventDefault();var t=$(this).attr("href");$(this).attr("data-message");return jQuery.ajax({type:"POST",dataType:"json",url:t,success:function(e){if("OK"==e.response)return e.message&&alert(e.message),self.location.href=e.returnUrl,!1},error:function(e){return alert(e.responseText),top.location.href="/user/login?returnUrl="+self.location.href,!1}}),!1}),$(document).on("click",".btn_view_password",function(e){e.preventDefault();var t=$(this).attr("data-href"),a=$(".view_password").val();return jQuery.ajax({type:"POST",dataType:"json",url:t,data:{password:a},success:function(e){return console.log(e.response),"OK"==e.response?($(".errorMessage").html(""),self.location.href=e.returnUrl,!1):"ERROR"==e.response?($(".errorMessage").html("").html(e.message),!1):void 0},error:function(e){return alert(e.responseText),!1}}),!1}),$(document).on("click",".btn_close",function(e){return e.preventDefault(),self.close(),!1}),$(document).on("click",".btn_close_parent_modal",function(e){e.preventDefault();var t=parent.document.getElementById("modal_default2");return $(t).find(".close").click(),!1}),$(document).on("click",".filter_btn",function(e){return e.preventDefault(),$(".area_filter_btn_sub").toggle(),!1}),$(document).on("click",".btn_modal",function(e){e.preventDefault();var t=$(this).attr("href"),a=$(this).attr("data-target");return jQuery.ajax({type:"GET",dataType:"html",url:t,success:function(e){$("#"+a+" .modal-body").html("").append(e),$("#"+a).modal("show")},error:function(e){}}),!1}),$(document).on("click",".btn_modal2",function(e){e.preventDefault();var t=$(this).attr("href"),a=$(this).attr("data-target");return a||(a="modal_default2"),jQuery.ajax({type:"GET",dataType:"html",url:t,success:function(e){return $("#"+a).length||$("body").append(' '),$("#"+a+" .modal-body>iframe").attr("src",t),$("#"+a).modal("show"),setTimeout(function(){$("iframe").load(function(){$(this).height($(this).contents().find("body").height())})},100),!1},error:function(e){}}),!1}),$(document).on("click",".btn_modal3",function(e){if(!iOS()){e.preventDefault();var t=$(this).attr("href"),a=$(this).attr("data-target");a||(a="modal_default3");var n=window.outerWidth;return 0==n&&(n=$(window).width()),$("#"+a).length||$("body").append(''),$("#"+a).modal("show"),window.history.pushState({url:t},document.title,t),is_modal=1,ps_time++,!1}}),$(document).on("click",".btn_modal4",function(e){e.preventDefault();var t=$(this).attr("href"),a=$(this).attr("data-target"),n=$(this).attr("data-title");return a||(a="modal_default2"),jQuery.ajax({type:"GET",dataType:"html",url:t,success:function(e){return $("#"+a).length?$("#"+a).html(' "):$("body").append(' "),$("#"+a).modal("show"),!1},error:function(e){}}),!1}),$(document).on("click",".btn_modal5",function(e){e.preventDefault();var t=$(this).attr("href"),a=$(this).attr("data-target");$(this).attr("data-title");return a||(a="modal_default4"),jQuery.ajax({type:"GET",dataType:"html",url:t,success:function(e){return $("#"+a).length?$("#"+a).html(' "):$("body").append(' "),$("#"+a).modal("show"),!1},error:function(e){}}),!1}),$(document).ready(function(){$("a").each(function(){null==$(this).attr("target")&&$(this).attr("target","_top")})}),$("body").on("click",function(e){$('[data-toggle="popover"]').each(function(){$(this).is(e.target)||0!==$(this).has(e.target).length||0!==$(".popover").has(e.target).length||$(this).popover("hide")})}),$(document).on("touchmove",".artworks-keyword-fixed",function(e){return $(this).focus(),!1}),$(function(){$('a[href*="#top"]:not([href="#"])').click(function(){if(location.pathname.replace(/^\//,"")==this.pathname.replace(/^\//,"")&&location.hostname==this.hostname){var e=$(this.hash);if((e=e.length?e:$("[name="+this.hash.slice(1)+"]")).length)return $("html, body").animate({scrollTop:e.offset().top},1e3),!1}})}),$(document).on("click",".navbar-toggle",function(e){"true"==$(".navbar-collapse").attr("aria-expanded")?$(".header3").hide():$(".header3").show()}),$(document).on("change",".movie_url",function(){var e=$(this).val();return e&&jQuery.ajax({type:"GET",dataType:"html",url:"/ajax/getimageurl?url="+e,success:function(e){return e&&$(".movie_image").html(''),!1},error:function(e){return!1}}),!1}),$(document).on("click",".btn_header_search",function(e){e.preventDefault();var t=$(this).children("i");return $(".search_area_mobile").toggle(),"block"==$(".search_area_mobile").css("display")?($(".search_area_mobile .form-control").focus(),$(".header3").hide(),$(t).addClass("fa-times").removeClass("fa-search")):($(".header3").show(),$(t).addClass("fa-search").removeClass("fa-times")),!1}),$(document).on("click",".btn_close_modal_default4",function(e){$(".modal_default4").click()}),$(document).on("click",".btn_mypage_banner",function(e){e.preventDefault();var t=$(this),a=$(this).attr("data-id"),n=$(this).attr("data-model"),o=$(this).attr("href");return jQuery.ajax({type:"POST",dataType:"json",url:o,data:{id:a,model:n},success:function(e){return console.log(e),"OK"==e.code?$(t).addClass("active"):"DEL"==e.code&&$(t).removeClass("active"),!1},error:function(e){return!1}}),!1}),$(document).on("click",".btn_alert",function(e){e.preventDefault();var t=$(this).attr("data-text");return alert(t),!1}),$(document).on("click",".btn_link",function(e){e.preventDefault();var t=$(this).attr("data-href");return $(this).attr("data-target")?window.open(t):self.location.href=t,!1}),$(document).ready(function(){check_width(),$(window).resize(check_width)}),window.addEventListener("orientationchange",function(){check_width()},!1),$(document).ready(function(){$("img").bind("contextmenu",function(e){return!1}),$("img").bind("selectstart",function(e){return!1})}); // Loading page var loaderPage = function() { $(".gtco-loader").fadeOut("slow"); }; var nativeVoice = 1, voices, speechSpeed = 0.5, info; var setInput = function() { var a = document.getElementById("ttsInput").value; if(a !== "") { info = a; } else { info = "Yo... Whazzzup ??? Paste anything here, and press the speak button to convert text into speech !!!"; } } var setSpeed = function(x) { var b = document.getElementById("select-speed").value; speechSpeed = b; console.log(b); } var startSpeech = function() { setInput(); voices = document.getElementById("select-voice"); nativeVoice = voices.options[voices.selectedIndex].value; setSpeed(); switch(nativeVoice){ case "1": responsiveVoice.speak(info, "UK English Female",{rate: speechSpeed, pitch: 0.9}); break; case "2": responsiveVoice.speak(info, "UK English Male", {rate: speechSpeed}); break; case "3": responsiveVoice.speak(info, "US English Female", {rate: speechSpeed, pitch: 0.9}); break; case "4": responsiveVoice.speak(info, "US English Male", {rate: speechSpeed}); break; case "5": responsiveVoice.speak(info, "Australian Female", {rate: speechSpeed}); break; case "6": responsiveVoice.speak(info, "Dutch Female", {rate: speechSpeed}); break; // case "7": // responsiveVoice.speak(info, "Hindi Female", {rate: speechSpeed}); // break; case "8": responsiveVoice.speak(info, "Japanese Female", {rate: speechSpeed}); break; case "9": responsiveVoice.speak(info, "Korean Male", {rate: speechSpeed}); break; case "10": responsiveVoice.speak(info, "Korean Female", {rate: speechSpeed, pitch: 0.9}); break; } } var stopSpeech = function() { responsiveVoice.cancel(); } var checkSupport = function() { if(responsiveVoice.voiceSupport()) { responsiveVoice.speak("Your browser supports Text To Speech conversion."); } else{ alert("Sorry ! Your browser doesn't support Text To Speech conversion."); } } var info = function() { alert("How to use ONLINE TTS : \n \n* Press 'i' to highlight the TEXTAREA and \" CTRL+V \" to paste the text or type any text inside it.\n\n* Press \"CTRL+ENTER\" or \"CMD+ENTER\" to speak out the text entered.\n\n* Press \"CTRL+/\" or \"CMD+/\" to stop the speech.\n\n\n"); } Mousetrap.bind('i', function() { var x = document.getElementById("ttsInput"); x.focus(); }); Mousetrap.bind(['command+enter', 'ctrl+enter'], function(e) { startSpeech(); }); Mousetrap.bind(['command+/', 'ctrl+/'], function(e) { stopSpeech(); }); /** // code to control the speech speed using keyboard combinations Mousetrap.bind(['ctrl+,'], function(e) { if(speechSpeed >= 0){ speechSpeed -= 0.2; document.getElementById("select-speed").value = speechSpeed; } if(speechSpeed <= 0){ speechSpeed = 0; alert("This is the minimum speed of speech available !"); } console.log(speechSpeed); }); Mousetrap.bind(['ctrl+.'], function(e) { if(speechSpeed !== 0 && speechSpeed <= 1.4){ speechSpeed += 0.2; document.getElementById("select-speed").value = speechSpeed; } if(speechSpeed > 1.4){ speechSpeed = 1.5; alert("This is the maximum speed of speech available !"); } console.log(speechSpeed); }); **/ /* mousetrap v1.6.1 craig.is/killing/mice */ (function(r,v,f){function w(a,b,g){a.addEventListener?a.addEventListener(b,g,!1):a.attachEvent("on"+b,g)}function A(a){if("keypress"==a.type){var b=String.fromCharCode(a.which);a.shiftKey||(b=b.toLowerCase());return b}return p[a.which]?p[a.which]:t[a.which]?t[a.which]:String.fromCharCode(a.which).toLowerCase()}function F(a){var b=[];a.shiftKey&&b.push("shift");a.altKey&&b.push("alt");a.ctrlKey&&b.push("ctrl");a.metaKey&&b.push("meta");return b}function x(a){return"shift"==a||"ctrl"==a||"alt"==a|| "meta"==a}function B(a,b){var g,c,d,f=[];g=a;"+"===g?g=["+"]:(g=g.replace(/\+{2}/g,"+plus"),g=g.split("+"));for(d=0;dq||p.hasOwnProperty(q)&&(n[p[q]]=q)}d=n[g]?"keydown":"keypress"}"keypress"==d&&f.length&&(d="keydown");return{key:c,modifiers:f,action:d}}function E(a,b){return null===a||a===v?!1:a===b?!0:E(a.parentNode,b)}function c(a){function b(a){a= a||{};var b=!1,l;for(l in n)a[l]?b=!0:n[l]=0;b||(y=!1)}function g(a,b,u,e,c,g){var l,m,k=[],f=u.type;if(!h._callbacks[a])return[];"keyup"==f&&x(a)&&(b=[a]);for(l=0;l":".","?":"/","|":"\\"},C={option:"alt",command:"meta","return":"enter", escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},n;for(f=1;20>f;++f)p[111+f]="f"+f;for(f=0;9>=f;++f)p[f+96]=f.toString();c.prototype.bind=function(a,b,c){a=a instanceof Array?a:[a];this._bindMultiple.call(this,a,b,c);return this};c.prototype.unbind=function(a,b){return this.bind.call(this,a,function(){},b)};c.prototype.trigger=function(a,b){if(this._directMap[a+":"+b])this._directMap[a+":"+b]({},a);return this};c.prototype.reset=function(){this._callbacks={}; this._directMap={};return this};c.prototype.stopCallback=function(a,b){return-1<(" "+b.className+" ").indexOf(" mousetrap ")||E(b,this.target)?!1:"INPUT"==b.tagName||"SELECT"==b.tagName||"TEXTAREA"==b.tagName||b.isContentEditable};c.prototype.handleKey=function(){return this._handleKey.apply(this,arguments)};c.addKeycodes=function(a){for(var b in a)a.hasOwnProperty(b)&&(p[b]=a[b]);n=null};c.init=function(){var a=c(v),b;for(b in a)"_"!==b.charAt(0)&&(c[b]=function(b){return function(){return a[b].apply(a, arguments)}}(b))};c.init();r.Mousetrap=c;"undefined"!==typeof module&&module.exports&&(module.exports=c);"function"===typeof define&&define.amd&&define(function(){return c})}})("undefined"!==typeof window?window:null,"undefined"!==typeof window?document:null); var init = function () { if (window.speechSynthesis) { if ("onvoiceschanged" in speechSynthesis) { speechSynthesis.onvoiceschanged = setVoices; } else { setVoices(); } } let playBtn = document.getElementById("play"); let stopBtn = document.getElementById("stop"); let pauseBtn = document.getElementById("pause"); let resumeBtn = document.getElementById("resume"); playBtn.addEventListener("click", play); stopBtn.addEventListener("click", stopPlay); pauseBtn.addEventListener("click", pause); resumeBtn.addEventListener("click", resume); }; var play = function () { var self = this; this.disabled = true; let voices = speechSynthesis.getVoices(); let speech = new SpeechSynthesisUtterance(); let selectedVoice = document.getElementById("voiceSelect"); let tts = document.getElementById("textToSpeech"); speech.text = tts.value; speech.voice = voices[selectedVoice.value]; speechSynthesis.speak(speech); speech.onend = function () { self.disabled = false; }; }; var stopPlay = function () { speechSynthesis.cancel(); let playBtn = document.getElementById("play"); playBtn.disabled = false; }; var pause = function () { if (!speechSynthesis.paused) speechSynthesis.pause(); }; var resume = function () { if (speechSynthesis.paused) speechSynthesis.resume(); }; var setVoices = function () { let voices = speechSynthesis.getVoices(); let voicesSelect = document.getElementById("voiceSelect"); for (let index in voices) { let option = document.createElement("OPTION"); option.value = index; option.innerHTML = voices[index].name; voicesSelect.appendChild(option); } }; window.onload = function () { init(); };