-
Notifications
You must be signed in to change notification settings - Fork 631
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
1,248 additions
and
745 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
{% extends "adv_base.html" %} | ||
{% block titleTag -%} | ||
<title>{{ _("Reader") }} - KindleEar</title> | ||
{% endblock -%} | ||
{% set dict = params.get('dict', {}) %} | ||
{% set src_lang = dict.get('src_lang', '') %} | ||
{% set dst_lang = dict.get('dst_lang', '') %} | ||
{% set api_host = dict.get('api_host', '') %} | ||
{% set api_keys = dict.get('api_keys', [])|join('\n') %} | ||
|
||
{% block advcontent -%} | ||
{% if g.allowReader -%} | ||
<form class="pure-form pure-form-aligned" action="" method="POST"> | ||
{% if tips -%} | ||
<div class="notice-box error">{{tips}}</div> | ||
{% endif -%} | ||
<fieldset> | ||
<legend>{{_("Dictionary")}}</legend> | ||
<p style="margin-top:10px;font-size:0.8em;"> | ||
{{_("Set up a dictionary for online reading.")}} | ||
</p> | ||
<div class="pure-control-group"> | ||
<label>{{_("Engine")}}</label> | ||
<select class="pure-u-1 pure-u-sm-1-2" name="engine" id="translator_engine" onchange="TranslatorEngineFieldChanged('{{src_lang}}', '{{dst_lang}}')"> | ||
<!-- 由脚本填充 --> | ||
</select> | ||
</div> | ||
<div class="pure-control-group" id="translator_api_host"> | ||
<label> {{_("Api Host")}}</label> | ||
<input type="text" name="api_host" id="api_host_input" value="{{api_host}}" class="pure-u-1 pure-u-sm-1-2" /> | ||
</div> | ||
<div class="pure-control-group" id="translator_api_key"> | ||
<label> {{_("Api Key")}}</label> | ||
<textarea name="api_keys" id="api_keys_textarea" placeholder="{{_('One key per line')}}" class="pure-u-1 pure-u-sm-1-2" >{{api_keys}}</textarea> | ||
</div> | ||
<div class="pure-control-group"> | ||
<label>{{_("Source language")}}</label> | ||
<select class="pure-u-1 pure-u-sm-1-2" name="src_lang" id="translator_src_lang"> | ||
<!-- 由脚本填充 --> | ||
</select> | ||
</div> | ||
<div class="pure-control-group"> | ||
<label>{{_("Target language")}}</label> | ||
<select class="pure-u-1 pure-u-sm-1-2" name="dst_lang" id="translator_dst_lang"> | ||
<!-- 由脚本填充 --> | ||
</select> | ||
</div> | ||
</fieldset> | ||
<p style="text-align:center;"> | ||
<button type="submit" class="pure-button pure-button-primary pure-input-rounded">{{_('Save settings')}} </button> | ||
</p> | ||
</form> | ||
<hr/> | ||
<form class="pure-form pure-form-aligned" action="" method="POST"> | ||
<fieldset> | ||
<legend>{{_("Test (Please save settings firstly)")}}</legend> | ||
<div class="pure-control-group"> | ||
<label>{{_("Text")}}</label> | ||
<textarea class="pure-u-1 pure-u-sm-1-2" name="translator_test_src_text" id="translator_test_src_text" rows="2">{{famous}}</textarea> | ||
</div> | ||
<div class="pure-control-group"> | ||
<label>{{_("Translation")}}</label> | ||
<textarea class="pure-u-1 pure-u-sm-1-2" name="translator_test_dst_text" id="translator_test_dst_text" rows="2" readonly></textarea> | ||
</div> | ||
</fieldset> | ||
<p style="text-align:center;"> | ||
<input type="button" class="pure-button pure-button-primary pure-input-rounded" value="{{_('Test')}}" onclick="TestReaderTranslator()" /> | ||
</p> | ||
</form> | ||
{% else %} | ||
<p style="margin-top:10px;font-size:0.8em;"> | ||
{{_("Online reading feature has not been activated yet.")}} | ||
</p> | ||
{% endif -%} | ||
{% endblock -%} | ||
{% block js -%} | ||
<script type="text/javascript"> | ||
var g_trans_engines = {{engines|safe}}; | ||
|
||
$(document).ready(function() { | ||
PopulateTranslatorFields("{{params['engine']}}"); | ||
TranslatorEngineFieldChanged('{{src_lang}}', '{{dst_lang}}'); | ||
}); | ||
</script> | ||
{% endblock -%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.