Skip to content

Commit

Permalink
西元2024年05月23日 (週四) 08時33分56秒 CST
Browse files Browse the repository at this point in the history
  • Loading branch information
pulipulichen committed May 23, 2024
1 parent 17d9b9a commit 87a9ea4
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/components/VocabularyTranslator.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/components/VocabularyTranslator.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Names of the two caches used in this version of the service worker.
// Change to v2, etc. when you update any of the local resources, which will
// in turn trigger the install event again.
const PRECACHE = 'precache-v20240522-225430';
const PRECACHE = 'precache-v20240523-003322';
const RUNTIME = 'runtime';

/**
Expand Down
11 changes: 11 additions & 0 deletions src/components/VocabularyTranslator/VocabularyTranslator.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
{{ $t('Stop Speak') }}
</button>
</div>



</div>
</div>
<div class="column">
Expand Down Expand Up @@ -52,4 +54,13 @@
</div>
</div>
</div>

<div class="ui blue compact basic buttons">
<a v-for="vocabulary in computedVocabularyList"
class="ui button"
:href="buildLink(vocabulary)"
:target="buildCacheKey(vocabulary)">
{{ vocabulary }}
</a>
</div>
</form>
7 changes: 7 additions & 0 deletions src/components/VocabularyTranslator/VocabularyTranslator.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ let app = {
},
},
computed: {
computedVocabularyList () {
let output = this.db.localConfig.vocabularyInput.trim().split('\n').filter((line) => line.trim() !== '').map(l => l.trim())
return [...new Set(output)]
},
computedSpeakButtonClassList () {
let classList = ['ui']

Expand Down Expand Up @@ -212,6 +216,9 @@ let app = {
},
addDictionary: function() {
this.$parent.$refs.VocabularyDictionary.addDictionary()
},
buildLink: function (vocabulary) {
return `https://dictionary.cambridge.org/dictionary/${this.db.localConfig.languageSource}-${this.db.localConfig.languageTarget}/${vocabulary}`
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.VocabularyTranslator {

.ui.blue.compact.basic.buttons {
border-width: 0 !important;
}
}

0 comments on commit 87a9ea4

Please sign in to comment.