chore: format with prettier

pull/145/head
dessant 4 years ago
parent fa06082672
commit bc5e8bd1b4

@ -183,7 +183,7 @@ See the LICENSE file for further information.
writeFileSync(`${distDir}/NOTICE`, notice);
gulp.src(['LICENSE']).pipe(gulp.dest(distDir));
done();
done();
});
gulp.task('copy', function(done) {

@ -1,10 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta charset="utf-8" />
</head>
<body>
<script src="/src/manifest.js"></script>
<script src="script.js"></script>
</body>

@ -57,10 +57,12 @@ async function getFramePos(tabId, frameId, frameIndex) {
let y = 0;
while (true) {
frameId = (await browser.webNavigation.getFrame({
tabId,
frameId
})).parentFrameId;
frameId = (
await browser.webNavigation.getFrame({
tabId,
frameId
})
).parentFrameId;
if (frameId === -1) {
break;
}
@ -80,10 +82,12 @@ async function getFramePos(tabId, frameId, frameIndex) {
}
async function resetCaptcha(tabId, frameId, challengeUrl) {
frameId = (await browser.webNavigation.getFrame({
tabId,
frameId: frameId
})).parentFrameId;
frameId = (
await browser.webNavigation.getFrame({
tabId,
frameId: frameId
})
).parentFrameId;
if (!(await scriptsAllowed(tabId, frameId))) {
await showNotification({messageId: 'error_scriptsNotAllowed'});

@ -1,9 +1,8 @@
<!-- prettier-ignore -->
<template>
<div id="app">
<v-contribute :extName="extName" :extSlug="extSlug" :notice="notice">
</v-contribute>
</div>
<div id="app">
<v-contribute :extName="extName" :extSlug="extSlug" :notice="notice">
</v-contribute>
</div>
</template>
<script>

@ -1,12 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="/src/icons/app/icon-16.png" type="image/png">
<link href="/src/fonts/roboto.css" rel="stylesheet">
<link href="/src/commons-ui/style.css" rel="stylesheet">
<link href="style.css" rel="stylesheet">
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" href="/src/icons/app/icon-16.png" type="image/png" />
<link href="/src/fonts/roboto.css" rel="stylesheet" />
<link href="/src/commons-ui/style.css" rel="stylesheet" />
<link href="style.css" rel="stylesheet" />
</head>
<body>
<div id="app"></div>

@ -1,137 +1,190 @@
<!-- prettier-ignore -->
<template>
<div id="app" v-if="dataLoaded">
<div class="section">
<div class="section-title" v-once>
{{ getText('optionSectionTitle_services') }}
</div>
<div class="option-wrap">
<div class="option select">
<v-select :label="getText('optionTitle_speechService')"
v-model="options.speechService"
:options="selectOptions.speechService">
</v-select>
<div id="app" v-if="dataLoaded">
<div class="section">
<div class="section-title" v-once>
{{ getText('optionSectionTitle_services') }}
</div>
<div class="option-wrap">
<div class="option select">
<v-select
:label="getText('optionTitle_speechService')"
v-model="options.speechService"
:options="selectOptions.speechService"
>
</v-select>
</div>
<div class="option text-field"
v-if="options.speechService === 'googleSpeechApi'">
<v-textfield v-model.trim="options.googleSpeechApiKey"
:label="getText('inputLabel_apiKey')">
</v-textfield>
</div>
<div
class="option text-field"
v-if="options.speechService === 'googleSpeechApi'"
>
<v-textfield
v-model.trim="options.googleSpeechApiKey"
:label="getText('inputLabel_apiKey')"
>
</v-textfield>
</div>
<div class="option select"
v-if="options.speechService === 'ibmSpeechApi'">
<v-select :label="getText('optionTitle_ibmSpeechApiLoc')"
<div
class="option select"
v-if="options.speechService === 'ibmSpeechApi'"
>
<v-select
:label="getText('optionTitle_ibmSpeechApiLoc')"
v-model="options.ibmSpeechApiLoc"
:options="selectOptions.ibmSpeechApiLoc">
</v-select>
</div>
<div class="option text-field"
v-if="options.speechService === 'ibmSpeechApi'">
<v-textfield v-model.trim="options.ibmSpeechApiKey"
:label="getText('inputLabel_apiKey')">
</v-textfield>
</div>
:options="selectOptions.ibmSpeechApiLoc"
>
</v-select>
</div>
<div
class="option text-field"
v-if="options.speechService === 'ibmSpeechApi'"
>
<v-textfield
v-model.trim="options.ibmSpeechApiKey"
:label="getText('inputLabel_apiKey')"
>
</v-textfield>
</div>
<div class="option select"
v-if="options.speechService === 'microsoftSpeechApi'">
<v-select :label="getText('optionTitle_microsoftSpeechApiLoc')"
<div
class="option select"
v-if="options.speechService === 'microsoftSpeechApi'"
>
<v-select
:label="getText('optionTitle_microsoftSpeechApiLoc')"
v-model="options.microsoftSpeechApiLoc"
:options="selectOptions.microsoftSpeechApiLoc">
</v-select>
</div>
<div class="option text-field"
v-if="options.speechService === 'microsoftSpeechApi'">
<v-textfield v-model.trim="options.microsoftSpeechApiKey"
:label="getText('inputLabel_apiKey')">
</v-textfield>
</div>
:options="selectOptions.microsoftSpeechApiLoc"
>
</v-select>
</div>
<div
class="option text-field"
v-if="options.speechService === 'microsoftSpeechApi'"
>
<v-textfield
v-model.trim="options.microsoftSpeechApiKey"
:label="getText('inputLabel_apiKey')"
>
</v-textfield>
</div>
<v-textfield
<v-textfield
v-if="options.speechService === 'witSpeechApi'"
v-for="item in witSpeechApis"
:key="item.id"
:value="options.witSpeechApiKeys[item] || ''"
:label="getText('inputLabel_apiKeyType',
[getText(`optionValue_witSpeechApiLang_${item}`)])"
@input="saveWitSpeechApiKey($event.trim(), item)">
</v-textfield>
<div class="wit-add-api"
v-if="options.speechService === 'witSpeechApi'">
<v-select
:label="
getText('inputLabel_apiKeyType', [
getText(`optionValue_witSpeechApiLang_${item}`)
])
"
@input="saveWitSpeechApiKey($event.trim(), item)"
>
</v-textfield>
<div
class="wit-add-api"
v-if="options.speechService === 'witSpeechApi'"
>
<v-select
v-model="witSpeechApiLang"
:options="selectOptions.witSpeechApiLang"
:label="getText('optionTitle_witSpeechApiLang')">
</v-select>
<v-button
:label="getText('optionTitle_witSpeechApiLang')"
>
</v-select>
<v-button
:outlined="true"
:disabled="!witSpeechApiLang"
@click="addWitSpeechApi">
{{ getText('buttonText_addApi') }}
</v-button>
@click="addWitSpeechApi"
>
{{ getText('buttonText_addApi') }}
</v-button>
</div>
</div>
</div>
</div>
<div class="section">
<div class="section-title" v-once>
{{ getText('optionSectionTitle_misc') }}
</div>
<div class="option-wrap">
<div class="option">
<v-form-field input-id="lec"
:label="getText('optionTitle_loadEnglishChallenge')">
<v-switch id="lec" v-model="options.loadEnglishChallenge"></v-switch>
</v-form-field>
<div class="section">
<div class="section-title" v-once>
{{ getText('optionSectionTitle_misc') }}
</div>
<div class="option-wrap">
<div class="option">
<v-form-field
input-id="lec"
:label="getText('optionTitle_loadEnglishChallenge')"
>
<v-switch
id="lec"
v-model="options.loadEnglishChallenge"
></v-switch>
</v-form-field>
</div>
<div class="option"
v-if="!options.loadEnglishChallenge">
<v-form-field input-id="esm"
:label="getText('optionTitle_tryEnglishSpeechModel')">
<v-switch id="esm" v-model="options.tryEnglishSpeechModel"></v-switch>
</v-form-field>
</div>
<div class="option" v-if="!options.loadEnglishChallenge">
<v-form-field
input-id="esm"
:label="getText('optionTitle_tryEnglishSpeechModel')"
>
<v-switch
id="esm"
v-model="options.tryEnglishSpeechModel"
></v-switch>
</v-form-field>
</div>
<div class="option">
<v-form-field input-id="si"
:label="getText('optionTitle_simulateUserInput')">
<v-switch id="si" v-model="options.simulateUserInput"></v-switch>
</v-form-field>
</div>
<div class="option">
<v-form-field
input-id="si"
:label="getText('optionTitle_simulateUserInput')"
>
<v-switch id="si" v-model="options.simulateUserInput"></v-switch>
</v-form-field>
</div>
<div class="option">
<v-form-field input-id="auc"
<div class="option">
<v-form-field
input-id="auc"
v-if="options.simulateUserInput"
:label="getText('optionTitle_autoUpdateClientApp')">
<v-switch id="auc" v-model="options.autoUpdateClientApp"></v-switch>
</v-form-field>
</div>
<div class="client-bownload" v-if="showClientAppNotice">
<div class="download-desc"
v-html="getText('pageContent_optionClientAppDownloadDesc',
[`<a target='_blank' rel='noreferrer' href='${installGuideUrl}'>${getText('linkText_installGuide')}</a>`])">
</div>
<div class="download-error" v-if="!clientAppDownloadUrl">
{{ getText('pageContent_optionClientAppOSError') }}
:label="getText('optionTitle_autoUpdateClientApp')"
>
<v-switch id="auc" v-model="options.autoUpdateClientApp"></v-switch>
</v-form-field>
</div>
<v-button class="download-button"
<div class="client-bownload" v-if="showClientAppNotice">
<div
class="download-desc"
v-html="
getText('pageContent_optionClientAppDownloadDesc', [
`<a target='_blank' rel='noreferrer' href='${installGuideUrl}'>${getText(
'linkText_installGuide'
)}</a>`
])
"
></div>
<div class="download-error" v-if="!clientAppDownloadUrl">
{{ getText('pageContent_optionClientAppOSError') }}
</div>
<v-button
class="download-button"
:unelevated="true"
:disabled="!clientAppDownloadUrl"
@click="$refs.dlLink.click()">
{{ getText('buttonText_downloadApp') }}
</v-button>
<a ref="dlLink" class="download-link"
@click="$refs.dlLink.click()"
>
{{ getText('buttonText_downloadApp') }}
</v-button>
<a
ref="dlLink"
class="download-link"
target="_blank"
rel="noreferrer"
:href="clientAppDownloadUrl"></a>
:href="clientAppDownloadUrl"
></a>
</div>
</div>
</div>
</div>
</div>
</template>
<script>

@ -1,12 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="/src/icons/app/icon-16.png" type="image/png">
<link href="/src/fonts/roboto.css" rel="stylesheet">
<link href="/src/commons-ui/style.css" rel="stylesheet">
<link href="style.css" rel="stylesheet">
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" href="/src/icons/app/icon-16.png" type="image/png" />
<link href="/src/fonts/roboto.css" rel="stylesheet" />
<link href="/src/commons-ui/style.css" rel="stylesheet" />
<link href="style.css" rel="stylesheet" />
</head>
<body>
<div id="app"></div>

@ -1,55 +1,64 @@
<!-- prettier-ignore -->
<template>
<div id="app" v-if="dataLoaded">
<div class="wrap" v-if="!isInstallSuccess && !isInstallError">
<div class="title">
{{ getText('pageContent_installTitle') }}
</div>
<div class="desc">
{{ getText('pageContent_installDesc') }}
</div>
<v-textfield
<div id="app" v-if="dataLoaded">
<div class="wrap" v-if="!isInstallSuccess && !isInstallError">
<div class="title">
{{ getText('pageContent_installTitle') }}
</div>
<div class="desc">
{{ getText('pageContent_installDesc') }}
</div>
<v-textfield
v-model.trim="appDir"
:label="getText('inputLabel_appLocation')">
</v-textfield>
:label="getText('inputLabel_appLocation')"
>
</v-textfield>
<div class="manifest-desc" v-if="manifestDirEditable">
{{ getText('pageContent_manifestLocationDesc') }}
</div>
<div class="manifest-desc" v-if="manifestDirEditable">
{{ getText('pageContent_manifestLocationDesc') }}
</div>
<v-textfield
<v-textfield
v-if="manifestDirEditable"
v-model.trim="manifestDir"
:label="getText('inputLabel_manifestLocation')">
</v-textfield>
:label="getText('inputLabel_manifestLocation')"
>
</v-textfield>
<v-button class="button install-button"
<v-button
class="button install-button"
:unelevated="true"
:disabled="isInstalling || !appDir || (manifestDirEditable && !manifestDir)"
@click="runInstall">
{{ getText('buttonText_installApp') }}
</v-button>
</div>
:disabled="
isInstalling || !appDir || (manifestDirEditable && !manifestDir)
"
@click="runInstall"
>
{{ getText('buttonText_installApp') }}
</v-button>
</div>
<div class="wrap" v-if="isInstallSuccess">
<div class="title">{{ getText('pageContent_installSuccessTitle') }}</div>
<div class="desc">{{ getText('pageContent_installSuccessDesc') }}</div>
<div class="wrap" v-if="isInstallSuccess">
<div class="title">{{ getText('pageContent_installSuccessTitle') }}</div>
<div class="desc">{{ getText('pageContent_installSuccessDesc') }}</div>
<div class="success-icon">🎉</div>
</div>
<div class="success-icon">🎉</div>
</div>
<div class="wrap" v-if="isInstallError">
<div class="title error-title">{{ getText('pageContent_installErrorTitle') }}</div>
<div class="desc">{{ getText('pageContent_installErrorDesc') }}</div>
<div class="wrap" v-if="isInstallError">
<div class="title error-title">
{{ getText('pageContent_installErrorTitle') }}
</div>
<div class="desc">{{ getText('pageContent_installErrorDesc') }}</div>
<v-button class="button error-button"
<v-button
class="button error-button"
:unelevated="true"
@click="isInstallError = false">
{{ getText('buttonText_goBack') }}
</v-button>
@click="isInstallError = false"
>
{{ getText('buttonText_goBack') }}
</v-button>
</div>
</div>
</div>
</template>
<script>

@ -1,12 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="/src/icons/app/icon-16.png" type="image/png">
<link href="/src/fonts/roboto.css" rel="stylesheet">
<link href="/src/commons-ui/style.css" rel="stylesheet">
<link href="style.css" rel="stylesheet">
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" href="/src/icons/app/icon-16.png" type="image/png" />
<link href="/src/fonts/roboto.css" rel="stylesheet" />
<link href="/src/commons-ui/style.css" rel="stylesheet" />
<link href="style.css" rel="stylesheet" />
</head>
<body>
<div id="app"></div>

Loading…
Cancel
Save