\n\n'+'Use the editor shortcuts to add tags, like this: \n\n'+'Some tags wrap around the text, like this one.\n\n'+' When you\'re ready, click the yellow button below, to ask Alexa to say this text out loud. \n\n'+'Here come some Power tips \n\n'+'Highlight some text, then click the \'Send to Alexa\' button. Alexa will only read the highlighted part. \n\n'+'When Alexa asks if you\'d like her to repeat the text, you can add a delay. For example, say, "Wait 10 seconds" or "Add a delay of 15 seconds". You can then make and save your edits, and then say, "Alexa, speak".\n\n'+'Good luck! We hope you build some incredible SSML experiences.';var editor=ace.edit("textarea");editor.setOptions({fontSize:18,showPrintMargin:false,indentedSoftWrap:false,wrap:1,useWorker:0});editor.setTheme("ace/theme/monokai");editor.session.setMode("ace/mode/xml");editor.insert(onloadText);var paired=false;var saveSub=false;$('.ssml-buttons input:not(.no-submit)').click(function(){var ssml=$(this).data('ssml');var value=$(this).val();var tag='';var selected=editor.getSelectedText();var replace='';if(selected==''){replace='REPLACE THIS TEXT'}else{replace=selected}switch(ssml){case'break':tag='';break;case'emphasis':tag=''+replace+'';break;case'pitch':tag=''+replace+'';break;case'rate':tag=''+replace+'';break;case'volume':tag=''+replace+'';break;case'voice':value='Ivy';if($('#voices').val()!=''){value=$('#voices').val()}tag=''+replace+'';var url='https://s3.amazonaws.com/ask-soundlibrary/transportation/amzn_sfx_car_accelerate_01.mp3';break;case'audio':value='https://s3.amazonaws.com/ask-soundlibrary/transportation/amzn_sfx_car_accelerate_01.mp3';if($('#audio').val()!=''){value=$('#audio').val()}tag='';break;case'sub':value='magnesium';if($('#alias').val()!=''){value=$('#alias').val()}tag=''+replace+'';break;case'say-as':if(selected==''){switch(value){case'number':replace='1234';break;case'characters':replace='TEST';break;case'spell-out':replace='TEST';break;case'cardinal':replace='1234';break;case'ordinal':replace='5';break;case'digits':replace='1234';break;case'fraction':replace='1/5';break;case'unit':replace='USD10';break;case'date':replace='01012024';break;case'time':replace='1\'21"';break;case'telephone':replace='(541) 754-3010';break;case'address':replace='711-2880 Nulla St., Mankato, Mississippi, 96522';break;case'expletive':replace='bad word';break;case'interjection':replace='boing';break;case'speechcon':replace='boing';break;default:replace='REPLACE THIS TEXT'}}tag=''+replace+'';break;case'whisper':tag=''+replace+'';break;default:}editor.focus();editor.insert(tag);return false});$('.new-pin').click(function(){showPair();return false});function showPair(){var modal=$('#pairModal');var span=$('.close');modal.show();span.click(function(){modal.hide()});$('#pair-input').focus()}$('#pair-form').submit(function(){if($('#i').val()!==''){$.ajax({type:'POST',url:'/ssml/pin',data:$("#pair-form").serialize(),beforeSend:function(){$('.pair-button').hide();$('.loading').show()},success:function(data){if(data.status==='success'){paired=true;$('#pairModal').hide();if(saveSub){submitText()}}else if(data.status==='expired'){alert('Sorry, that Pin Number does not exist or has expired.')}else{alert('Sorry, something went wrong please tweet @topvoiceapps to let us know.')}$('.pair-button').show();$('.loading').hide()},error:function(){alert('Oops. Something went wrong...check your connection and try again just to be sure.');$('.pair-button').show();$('.loading').hide()}})}return false});$('.save-button').click(function(){submitText();return false});function submitText(){saveSub=true;if(!paired){showPair()}else{var selectedInputValue=editor.getSelectedText();var inputValue=editor.getValue();if(selectedInputValue!==''){inputValue=selectedInputValue}if(inputValue==''){printReponse('Please enter some SSML into the editor.')}else{$.ajax({type:'POST',url:'/ssml/save',data:{i:'87256276eeac715282ddca49eefb6510',t:inputValue},beforeSend:function(){$('.save-button').hide();$('.save-loading').show()},success:function(data){$('.save-button').show();$('.save-loading').hide();if(data.status==='success'){printReponse('Saved! Now say..."Alexa, ask Speech Editor to speak"')}else{printReponse('Sorry, something went wrong please tweet @topvoiceapps to let us know.')}},error:function(){$('.save-button').show();$('.save-loading').hide();printReponse('Oops. Something went wrong...check your connection and try again just to be sure.')}});saveSub=false}}return false}function printReponse(response){var el=$('#response');el.html(response);el.show();setTimeout(function(){el.fadeOut();el.val('')},8000)}$('.section-menu').click(function(){var section=$(this).data('toggle');$('.'+section).slideToggle();return false});if(window.location.hash){var hash=window.location.hash.substring(1);var modal=$('#privacyModal');var span=$('.close');if(hash=='privacy'){modal.show()}span.click(function(){modal.hide()})}