diff --git a/platypush/backend/http/static/js/tts.google.js b/platypush/backend/http/static/js/tts.google.js new file mode 100644 index 000000000..5330d2b63 --- /dev/null +++ b/platypush/backend/http/static/js/tts.google.js @@ -0,0 +1,34 @@ +$(document).ready(function() { + var $container = $('#tts-container'), + $ttsForm = $('#tts-form'); + + var initBindings = function() { + $ttsForm.on('submit', function(event) { + var formData = $(this).serializeArray().reduce(function(obj, item) { + var value = item.value.trim(); + if (value.length > 0) { + obj[item.name] = item.value; + } + + return obj; + }, {}); + + execute( + { + type: 'request', + action: 'tts.google.say', + args: formData, + } + ); + + return false; + }); + }; + + var init = function() { + initBindings(); + }; + + init(); +}); + diff --git a/platypush/backend/http/templates/plugins/tts.google.html b/platypush/backend/http/templates/plugins/tts.google.html new file mode 100644 index 000000000..2d8dfe93f --- /dev/null +++ b/platypush/backend/http/templates/plugins/tts.google.html @@ -0,0 +1,19 @@ + + + +