diff --git a/README.rst b/README.rst index eaa73d0..ec84cac 100644 --- a/README.rst +++ b/README.rst @@ -1,3 +1,9 @@ +.. image:: https://raw.githubusercontent.com/collective/collective.texttospeech/issue_4/docs/texttospeech.png + :align: left + :alt: Text-to-Speech + :height: 100px + :width: 100px + ************** Text-to-Speech ************** diff --git a/docs/texttospeech.png b/docs/texttospeech.png new file mode 100644 index 0000000..a49e409 Binary files /dev/null and b/docs/texttospeech.png differ diff --git a/src/collective/texttospeech/browser/templates/texttospeech.pt b/src/collective/texttospeech/browser/templates/texttospeech.pt index c6395c8..4d2e2a6 100644 --- a/src/collective/texttospeech/browser/templates/texttospeech.pt +++ b/src/collective/texttospeech/browser/templates/texttospeech.pt @@ -1,8 +1,8 @@
diff --git a/src/collective/texttospeech/locales/collective.texttospeech.pot b/src/collective/texttospeech/locales/collective.texttospeech.pot index ea2bc6b..93bc071 100644 --- a/src/collective/texttospeech/locales/collective.texttospeech.pot +++ b/src/collective/texttospeech/locales/collective.texttospeech.pot @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2016-06-10 20:11+0000\n" +"POT-Creation-Date: 2016-06-10 21:35+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -34,22 +34,10 @@ msgstr "" msgid "If selected, Text-to-Speech feature will be enabled sitewide." msgstr "" -#: collective/texttospeech/browser/templates/texttospeech.pt:1 -msgid "Listen" -msgstr "" - #: collective/texttospeech/interfaces.py:26 msgid "Only objects of these content types will display a Text-to-Speech button." msgstr "" -#: collective/texttospeech/browser/templates/texttospeech.pt:1 -msgid "Pause" -msgstr "" - -#: collective/texttospeech/browser/templates/texttospeech.pt:1 -msgid "Resume" -msgstr "" - #: collective/texttospeech/browser/templates/texttospeech.pt:11 msgid "Speech synthesis control" msgstr "" @@ -75,3 +63,15 @@ msgstr "" #: collective/texttospeech/profiles.zcml:23 msgid "collective.texttospeech: uninstall" msgstr "" + +#: collective/texttospeech/browser/templates/texttospeech.pt:1 +msgid "⏸ Pause" +msgstr "" + +#: collective/texttospeech/browser/templates/texttospeech.pt:1 +msgid "▶ Resume" +msgstr "" + +#: collective/texttospeech/browser/templates/texttospeech.pt:1 +msgid "🔊 Listen" +msgstr "" diff --git a/src/collective/texttospeech/locales/es/LC_MESSAGES/collective.texttospeech.po b/src/collective/texttospeech/locales/es/LC_MESSAGES/collective.texttospeech.po index 26722ee..ca1c97d 100644 --- a/src/collective/texttospeech/locales/es/LC_MESSAGES/collective.texttospeech.po +++ b/src/collective/texttospeech/locales/es/LC_MESSAGES/collective.texttospeech.po @@ -1,8 +1,8 @@ msgid "" msgstr "" "Project-Id-Version: \n" -"POT-Creation-Date: 2016-06-10 20:11+0000\n" -"PO-Revision-Date: 2016-06-10 17:16-0300\n" +"POT-Creation-Date: 2016-06-10 21:35+0000\n" +"PO-Revision-Date: 2016-06-10 18:35-0300\n" "Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -37,22 +37,10 @@ msgstr "Aquí puede modificar las configuraciones de síntesis de habla." msgid "If selected, Text-to-Speech feature will be enabled sitewide." msgstr "Si está seleccionado, la funcionalidad de síntesis de habla estará habilitada en el sitio." -#: collective/texttospeech/browser/templates/texttospeech.pt:1 -msgid "Listen" -msgstr "Escuchar" - #: collective/texttospeech/interfaces.py:26 msgid "Only objects of these content types will display a Text-to-Speech button." msgstr "Sólo los objetos de estos tipos de contenido mostrarán el botón de síntesis de habla." -#: collective/texttospeech/browser/templates/texttospeech.pt:1 -msgid "Pause" -msgstr "Pausar" - -#: collective/texttospeech/browser/templates/texttospeech.pt:1 -msgid "Resume" -msgstr "Continuar" - #: collective/texttospeech/browser/templates/texttospeech.pt:11 msgid "Speech synthesis control" msgstr "Control de la síntesis de habla" @@ -78,3 +66,15 @@ msgstr "Voz utilizada para leer el texto." #: collective/texttospeech/profiles.zcml:23 msgid "collective.texttospeech: uninstall" msgstr "collective.texttospeech: uninstall" + +#: collective/texttospeech/browser/templates/texttospeech.pt:1 +msgid "⏸ Pause" +msgstr "⏸ Pausar" + +#: collective/texttospeech/browser/templates/texttospeech.pt:1 +msgid "▶ Resume" +msgstr "▶ Continuar" + +#: collective/texttospeech/browser/templates/texttospeech.pt:1 +msgid "🔊 Listen" +msgstr "🔊 Escuchar" diff --git a/src/collective/texttospeech/locales/pt_BR/LC_MESSAGES/collective.texttospeech.po b/src/collective/texttospeech/locales/pt_BR/LC_MESSAGES/collective.texttospeech.po index 7a8c352..2e4f0ba 100644 --- a/src/collective/texttospeech/locales/pt_BR/LC_MESSAGES/collective.texttospeech.po +++ b/src/collective/texttospeech/locales/pt_BR/LC_MESSAGES/collective.texttospeech.po @@ -1,8 +1,8 @@ msgid "" msgstr "" "Project-Id-Version: \n" -"POT-Creation-Date: 2016-06-10 20:11+0000\n" -"PO-Revision-Date: 2016-06-10 17:15-0300\n" +"POT-Creation-Date: 2016-06-10 21:35+0000\n" +"PO-Revision-Date: 2016-06-10 18:35-0300\n" "Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -37,22 +37,10 @@ msgstr "Aqui pode modificar as configurações de síntese de voz." msgid "If selected, Text-to-Speech feature will be enabled sitewide." msgstr "Se estiver selecionado, a funcionalidade de síntese de voz estará habilitada no site." -#: collective/texttospeech/browser/templates/texttospeech.pt:1 -msgid "Listen" -msgstr "Ouvir" - #: collective/texttospeech/interfaces.py:26 msgid "Only objects of these content types will display a Text-to-Speech button." msgstr "Só objetos de esses tipos de conteúdo mostrarão o botão de síntese de voz." -#: collective/texttospeech/browser/templates/texttospeech.pt:1 -msgid "Pause" -msgstr "Pausar" - -#: collective/texttospeech/browser/templates/texttospeech.pt:1 -msgid "Resume" -msgstr "Continuar" - #: collective/texttospeech/browser/templates/texttospeech.pt:11 msgid "Speech synthesis control" msgstr "Controle da síntese de voz" @@ -78,3 +66,15 @@ msgstr "Voz utilizada para ler o texto." #: collective/texttospeech/profiles.zcml:23 msgid "collective.texttospeech: uninstall" msgstr "collective.texttospeech: uninstall" + +#: collective/texttospeech/browser/templates/texttospeech.pt:1 +msgid "⏸ Pause" +msgstr "⏸ Pausar" + +#: collective/texttospeech/browser/templates/texttospeech.pt:1 +msgid "▶ Resume" +msgstr "▶ Continuar" + +#: collective/texttospeech/browser/templates/texttospeech.pt:1 +msgid "🔊 Listen" +msgstr "🔊 Ouvir" diff --git a/src/collective/texttospeech/static/file-audio-o.svg b/src/collective/texttospeech/static/file-audio-o.svg new file mode 100644 index 0000000..4d8cddb --- /dev/null +++ b/src/collective/texttospeech/static/file-audio-o.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/collective/texttospeech/static/main.css b/src/collective/texttospeech/static/main.css index 6b7635d..80a67bc 100644 --- a/src/collective/texttospeech/static/main.css +++ b/src/collective/texttospeech/static/main.css @@ -1 +1,8 @@ -#viewlet-texttospeech{ text-align: right; } \ No newline at end of file +#viewlet-texttospeech +{ + text-align: right; +} +#texttospeech-button +{ + cursor: pointer; +} diff --git a/src/collective/texttospeech/static/main.js b/src/collective/texttospeech/static/main.js index 6b2c6bf..2a89da1 100644 --- a/src/collective/texttospeech/static/main.js +++ b/src/collective/texttospeech/static/main.js @@ -1 +1,80 @@ -var MainView = (function() { function MainView() { this.$el = $('#viewlet-texttospeech'); this.$button = $('#texttospeech-button', this.$el); this.voice = this.$el.attr('data-voice'); this.label_stopped = this.$el.attr('data-label-stopped'); this.label_playing = this.$el.attr('data-label-playing'); this.label_paused = this.$el.attr('data-label-paused'); this.playing = false; this.paused = true; this.$button.on('click', $.proxy(this.play_pause, this)); } MainView.prototype.onstart = function() { this.playing = true; this.paused = false; this.$button.attr('value', this.label_playing); this.$button.attr('class', 'playing'); }; MainView.prototype.onend = function() { this.playing = false; this.paused = true; this.$button.attr('value', this.label_stopped); this.$button.attr('class', 'stopped'); }; MainView.prototype.play_pause = function(e) { e.preventDefault(); if (this.playing) { if (this.paused) { this.paused = false; this.$button.attr('value', this.label_playing); this.$button.attr('class', 'playing'); responsiveVoice.resume(); } else { this.paused = true; this.$button.attr('value', this.label_paused); this.$button.attr('class', 'paused'); responsiveVoice.pause(); } } else { responsiveVoice.speak( $('#content').text(), this.voice, { onstart: $.proxy(this.onstart, this), onend: $.proxy(this.onend, this) } ); } }; return MainView; })(); var ControlPanelView = (function() { function ControlPanelView() { this.template = ""; this.actual_voice = $('#form-widgets-voice').val(); this.render(); } ControlPanelView.prototype.render = function() { $('#form-widgets-voice').replaceWith(this.template); var voicelist = responsiveVoice.getVoices(); var vselect = $('#form-widgets-voice'); var i, len, voice; for (i = 0, len = voicelist.length; i < len; i++) { voice = voicelist[i]; if (voice.name === this.actual_voice) { vselect.append($('