diff --git a/db/install.php b/db/install.php index 4b18d8ce..84ed20e9 100644 --- a/db/install.php +++ b/db/install.php @@ -33,7 +33,7 @@ function xmldb_filter_poodll_install() { 'nativeaudio', 'youtubeplayer', 'youtube','onceplayer', 'twiceaudioplayer','interactivetranscriptaudio','interactivetranscriptvideo', 'tabs', 'tabitem', 'accordian', 'accordianitem', 'Button-Maker','countdown','dice','flipclock','icontoggle','lightbox2','poodllcalc','popover','popuprecorder','speechcards','tapwordtohear', - 'textblockreader','tta'); + 'textblockreader','tta','soundboard'); $templateindex = 0; foreach ($presets as $preset) { if (in_array($preset['key'], $forinstall)) { diff --git a/presets/soundboard.txt b/presets/soundboard.txt new file mode 100644 index 00000000..668cdf82 --- /dev/null +++ b/presets/soundboard.txt @@ -0,0 +1 @@ +{"name":"Sound Board","key":"soundboard","version":"1.0.0","instructions":"Add an html list (bullets) of phrases to be read, between the tags. They will become buttons that speak when tapped.","showatto":"1","showplayers":"0","requirecss":"","requirejs":"","shim":"","defaults":"language=\"English(US)|English(GB)|English(AU)|English(In)|English(Welsh)|Danish|Dutch|French(FR)|French(CA)|German|Icelandic|Italian|Japanese|Korean|Norwegian|Polish|Portugese(BR)|Portugese(PT)|Romanian|Russian|Spanish(ES)|Spanish(US)|Swedish|Turkish|Welsh\",\nspeaker=\"Male|Female\"","amd":"1","body":"
\n\n
\n","bodyend":"
","script":"//remove any HTML editor artifacts\n$('#' + @@AUTOID@@ + ' p').remove();\n$('#' + @@AUTOID@@ + ' span').remove();\n\n//fetch the controls we inserted in \"body\"\nvar theplayer = $('#' + @@AUTOID@@ + '_player');\nvar theulcontainer = $('#' + @@AUTOID@@); \nvar theitemscontainer = $('#' + @@AUTOID@@ + '_container'); \n\ntheitemscontainer.on('click','.fp_soundboard_player_trigger', function(e){\n theplayer.attr('src',$(this).attr('data-src'));\n theplayer[0].play();\n});\n\n\n//determine voice\nvar mf=@@speaker@@\nswitch(@@language@@){\ncase \"English(US)\": voice = mf=='Male'?'Joey':'Kendra';break;\ncase \"English(GB)\": voice = mf=='Male'?'Brian':'Amy';break;\ncase \"English(AU)\": voice = mf=='Male'?'Russell':'Nicole';break;\ncase \"English(IN)\": voice = mf=='Male'?'Aditi':'Raveena';break;\ncase \"English(WELSH)\": voice = mf=='Male'? 'Geraint':'Geraint';break;\ncase \"Danish\": voice = mf=='Male'?'Mads':'Naja';break;\ncase \"Dutch\": voice = mf=='Male'?'Ruben':'Lotte';break;\ncase \"French(FR)\": voice = mf=='Male'?'Mathieu':'Celine';break;\ncase \"French(CA)\": voice = mf=='Male'?'Chantal':'Chantal';break;\ncase \"German\": voice = mf=='Male'?'Hans':'Marlene';break;\ncase \"Icelandic\": voice = mf=='Male'?'Karl':'Dora';break;\ncase \"Italian\": voice = mf=='Male'?'Carla':'Giorgio';break;\ncase \"Japanese\": voice = mf=='Male'?'Takumi':'Mizuki';break;\ncase \"Korean\": voice = mf=='Male'?'Seoyan':'Seoyan';break;\ncase \"Norwegian\": voice = mf=='Male'?'Liv':'Liv';break;\ncase \"Polish\": voice = mf=='Male'?'Jacek':'Ewa';break;\ncase \"Portugese(BR)\": voice = mf=='Male'?'Ricardo':'Vitoria';break;\ncase \"Portugese(PT)\": voice = mf=='Male'?'Cristiano':'Ines';break;\ncase \"Romanian\": voice = mf=='Male'?'Carmen':'Carmen';break;\ncase \"Russian\": voice = mf=='Male'?'Maxim':'Tatyana';break;\ncase \"Spanish(ES)\": voice = mf=='Male'?'Enrique':'Conchita';break;\ncase \"Spanish(US)\": voice = mf=='Male'?'Miguel':'Penelope';break;\ncase \"Swedish\": voice = mf=='Male'?'Astrid':'Astrid';break;\ncase \"Turkish\": voice = mf=='Male'?'Filiz':'Filiz';break;\ncase \"Welsh\": voice = mf=='Male'?'Gwyneth':'Gwyneth';break;\ndefault: voice = mf=='Male'?'Brian':'Amy';\n}\n\n\n\n//Build audio url components\nvar poodllfilelib = M.cfg.wwwroot + '/filter/poodll/poodllfilelib.php?datatype=speaktext¶mone=';\nvar format = 'text';\n\n//build template for one dictation item\nvar template ='
';\ntemplate += '
';\ntemplate += '@TEXT@';\ntemplate += '
';\n\n\nvar container = \n\n$('#' + @@AUTOID@@ + \" li\" ).each(function(index) {\n var usetext = $(this).text();\n var datastring= 'text' + '|' + voice + '|' + usetext;\n var src = poodllfilelib+encodeURIComponent(datastring);\n var usetemplate = template.replace('@AUDIO@',src); \n usetemplate = usetemplate.replace('@TEXT@',usetext); \n usetemplate = usetemplate.replace(/@ID@/g, index);\n theitemscontainer.append(usetemplate);\n \n //add events\n var theaudio= $('#fp_soundboard_player_' + index + ' audio');\n\n });//end of each loop","style":"","dataset":"","datasetvars":"","alternate":"","alternateend":""} \ No newline at end of file