From 2a233bd62184de12d9f0ee6bf0c6985dafe497fd Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Sat, 8 Apr 2017 13:11:06 -0700 Subject: add hint about specifying anki model fields --- ext/bg/options.html | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'ext/bg/options.html') diff --git a/ext/bg/options.html b/ext/bg/options.html index 939227b0..77ea0e3c 100644 --- a/ext/bg/options.html +++ b/ext/bg/options.html @@ -193,6 +193,13 @@ +

+ Specify the information you would like included in your flashcards in the field editor below. + Please be aware that Anki requires the first field in the model to be unique. It is highly recommended + that you set it to {expression} for term flashcards and {character} for + Kanji flashcards. +

+
-

+

Specify the information you would like included in your flashcards in the field editor below. Please be aware that Anki requires the first field in the model to be unique. It is highly recommended that you set it to {expression} for term flashcards and {character} for -- cgit v1.2.3 From d263a93d446096abfc33e47f591dbb71eb7fe928 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Sat, 8 Apr 2017 18:01:36 -0700 Subject: usage guide --- ext/bg/guide.html | 32 ++++++++++++++------------------ ext/bg/js/options.js | 2 ++ ext/bg/js/util.js | 6 +++++- ext/bg/js/yomichan.js | 10 ++-------- ext/bg/options.html | 4 ++++ 5 files changed, 27 insertions(+), 27 deletions(-) (limited to 'ext/bg/options.html') diff --git a/ext/bg/guide.html b/ext/bg/guide.html index 6c38e351..4b01ae7c 100644 --- a/ext/bg/guide.html +++ b/ext/bg/guide.html @@ -9,28 +9,24 @@

-

Thank you for downloading this extension! I hope that Yomichan will help you on your language learning journey.

+

+ Read the steps below to get up and running with Yomichan. For complete documentation, + visit the official homepage. +

-
-

Quick Guide

+
    +
  1. Click on the icon in the browser toolbar to open the Yomichan actions dialog.
  2. +
  3. Click on the monkey wrench icon in the middle to open the options page.
  4. +
  5. Import the dictionaries you wish to use for term and Kanji searches.
  6. +
  7. Hold down Shift key or the middle mouse button as you move your mouse over text to display definitions.
  8. +
  9. Click on the icon to hear the term pronounced by a native speaker.
  10. +
  11. Click on individual Kanji in the term definition results to view additional information about those characters.
  12. +
-

- Read the steps below to get up and running with Yomichan. For complete documentation, - visit the official homepage. -

- -
    -
  1. Click on the icon in the browser toolbar to open the Yomichan actions dialog.
  2. -
  3. Click on the monkey wrench icon in the middle to open the options page.
  4. -
  5. Import the dictionaries you wish to use for term and Kanji searches.
  6. -
  7. Hold down Shift key or the middle mouse button as you move your mouse over text to display definitions.
  8. -
  9. Click on the icon to hear the term pronounced by a native speaker.
  10. -
  11. Click on individual Kanji in the term definition results to view additional information about those characters.
  12. -
-
+

This startup notification can be turned off on the Yomichan options page.

diff --git a/ext/bg/js/options.js b/ext/bg/js/options.js index 51f242c2..49544840 100644 --- a/ext/bg/js/options.js +++ b/ext/bg/js/options.js @@ -25,6 +25,7 @@ function formRead() { return optionsLoad().then(optionsOld => { const optionsNew = $.extend(true, {}, optionsOld); + optionsNew.general.showGuide = $('#show-usage-guide').prop('checked'); optionsNew.general.audioSource = $('#audio-playback-source').val(); optionsNew.general.audioVolume = $('#audio-playback-volume').val(); optionsNew.general.groupResults = $('#group-terms-results').prop('checked'); @@ -111,6 +112,7 @@ $(document).ready(() => { handlebarsRegister(); optionsLoad().then(options => { + $('#show-usage-guide').prop('checked', options.general.showGuide); $('#audio-playback-source').val(options.general.audioSource); $('#audio-playback-volume').val(options.general.audioVolume); $('#group-terms-results').prop('checked', options.general.groupResults); diff --git a/ext/bg/js/util.js b/ext/bg/js/util.js index 05c7ff27..64143ffe 100644 --- a/ext/bg/js/util.js +++ b/ext/bg/js/util.js @@ -89,7 +89,8 @@ function optionsSetDefaults(options) { showAdvanced: false, popupWidth: 400, popupHeight: 250, - popupOffset: 10 + popupOffset: 10, + showGuide: true }, scanning: { @@ -144,6 +145,9 @@ function optionsVersion(options) { } else { options.general.audioSource = 'disabled'; } + }, + () => { + options.general.showGuide = false; } ]; diff --git a/ext/bg/js/yomichan.js b/ext/bg/js/yomichan.js index feb74b6e..51e05c80 100644 --- a/ext/bg/js/yomichan.js +++ b/ext/bg/js/yomichan.js @@ -28,8 +28,8 @@ window.yomichan = new class { this.translator.prepare().then(optionsLoad).then(this.optionsSet.bind(this)).then(() => { chrome.commands.onCommand.addListener(this.onCommand.bind(this)); chrome.runtime.onMessage.addListener(this.onMessage.bind(this)); - if (chrome.runtime.onInstalled) { - chrome.runtime.onInstalled.addListener(this.onInstalled.bind(this)); + if (this.options.general.showGuide) { + chrome.tabs.create({url: chrome.extension.getURL('/bg/guide.html')}); } }); } @@ -157,12 +157,6 @@ window.yomichan = new class { return Promise.resolve(handlebarsRender(template, data)); } - onInstalled(details) { - if (details.reason === 'install') { - chrome.tabs.create({url: chrome.extension.getURL('/bg/guide.html')}); - } - } - onCommand(command) { const handlers = { search: () => { diff --git a/ext/bg/options.html b/ext/bg/options.html index 0e73178a..e6c5e8be 100644 --- a/ext/bg/options.html +++ b/ext/bg/options.html @@ -25,6 +25,10 @@

General Options

+
+ +
+
-- cgit v1.2.3