Skip to content

Commit

Permalink
Use tag button instead of input button
Browse files Browse the repository at this point in the history
  • Loading branch information
rodfersou committed Jun 16, 2016
1 parent a74cede commit 0982de2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions src/collective/texttospeech/browser/templates/texttospeech.pt
@@ -1,20 +1,20 @@
<div i18n:domain="collective.texttospeech"
id="viewlet-texttospeech"
data-label-stopped="🔊 Listen"
data-label-playing="Pause"
data-label-paused="Resume"
data-label-stopped="Listen"
data-label-playing="Pause"
data-label-paused="Resume"
data-error-message="Could not load ResponsiveVoice library; Text-To-Speech feature is disabled or is not available."
tal:attributes="data-voice view/voice;
data-enabled view/enabled"
i18n:attributes="data-label-stopped;
data-label-playing;
data-label-paused;
data-error-message">
<input id="texttospeech-button"
<button id="texttospeech-button"
class="stopped"
type="button"
value="🔊 Listen"
title="Speech synthesis control"
tal:condition="view/enabled"
i18n:attributes="value; title" />
i18n:attributes="title"
i18n:translate="">Listen</button>
</div>
8 changes: 4 additions & 4 deletions src/collective/texttospeech/static/main.js
Expand Up @@ -14,23 +14,23 @@ var MainView = (function() {
MainView.prototype.onstart = function() {
this.playing = true;
this.paused = false;
this.$button.attr('value', this.label_playing);
this.$button.html(this.label_playing);
};
MainView.prototype.onend = function() {
this.playing = false;
this.paused = true;
this.$button.attr('value', this.label_stopped);
this.$button.html(this.label_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.html(this.label_playing);
responsiveVoice.resume();
} else {
this.paused = true;
this.$button.attr('value', this.label_paused);
this.$button.html(this.label_paused);
responsiveVoice.pause();
}
} else {
Expand Down

0 comments on commit 0982de2

Please sign in to comment.