Skip to content
This repository has been archived by the owner on Feb 25, 2023. It is now read-only.

Commit

Permalink
Merge pull request #409 from toasted-nutbread/update-global-declarati…
Browse files Browse the repository at this point in the history
…on-format

Update global declaration format
  • Loading branch information
toasted-nutbread authored Mar 14, 2020
2 parents f7bbcb6 + adbdca6 commit 1cacbb6
Show file tree
Hide file tree
Showing 39 changed files with 399 additions and 71 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"semi-spacing": ["error", {"before": false, "after": true}],
"space-in-parens": ["error", "never"],
"space-unary-ops": "error",
"spaced-comment": ["error", "always", {"markers": ["global"]}],
"spaced-comment": ["error", "always"],
"switch-colon-spacing": ["error", {"after": true, "before": false}],
"template-curly-spacing": ["error", "never"],
"template-tag-spacing": ["error", "never"],
Expand Down
4 changes: 3 additions & 1 deletion ext/bg/js/anki.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

/*global requestJson*/
/* global
* requestJson
*/

/*
* AnkiConnect
Expand Down
4 changes: 3 additions & 1 deletion ext/bg/js/audio-uri-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

/*global jpIsStringEntirelyKana*/
/* global
* jpIsStringEntirelyKana
*/

class AudioUriBuilder {
constructor() {
Expand Down
33 changes: 26 additions & 7 deletions ext/bg/js/backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,32 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

/*global optionsSave, utilIsolate
conditionsTestValue, profileConditionsDescriptor
handlebarsRenderDynamic
requestText, requestJson, optionsLoad
dictConfigured, dictTermsSort, dictEnabledSet
jpConvertReading, jpDistributeFuriganaInflected, jpKatakanaToHiragana
AnkiNoteBuilder, AudioSystem, AudioUriBuilder, Translator, AnkiConnect, AnkiNull, Mecab, BackendApiForwarder, JsonSchema, ClipboardMonitor*/
/* global
* AnkiConnect
* AnkiNoteBuilder
* AnkiNull
* AudioSystem
* AudioUriBuilder
* BackendApiForwarder
* ClipboardMonitor
* JsonSchema
* Mecab
* Translator
* conditionsTestValue
* dictConfigured
* dictEnabledSet
* dictTermsSort
* handlebarsRenderDynamic
* jpConvertReading
* jpDistributeFuriganaInflected
* jpKatakanaToHiragana
* optionsLoad
* optionsSave
* profileConditionsDescriptor
* requestJson
* requestText
* utilIsolate
*/

class Backend {
constructor() {
Expand Down
4 changes: 3 additions & 1 deletion ext/bg/js/clipboard-monitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

/*global jpIsStringPartiallyJapanese*/
/* global
* jpIsStringPartiallyJapanese
*/

class ClipboardMonitor extends EventDispatcher {
constructor({getClipboard}) {
Expand Down
6 changes: 5 additions & 1 deletion ext/bg/js/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

/*global apiCommandExec, apiGetEnvironmentInfo, apiOptionsGet*/
/* global
* apiCommandExec
* apiGetEnvironmentInfo
* apiOptionsGet
*/

function showExtensionInfo() {
const node = document.getElementById('extension-info');
Expand Down
7 changes: 6 additions & 1 deletion ext/bg/js/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

/*global dictFieldSplit, requestJson, JsonSchema, JSZip*/
/* global
* JSZip
* JsonSchema
* dictFieldSplit
* requestJson
*/

class Database {
constructor() {
Expand Down
6 changes: 5 additions & 1 deletion ext/bg/js/handlebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

/*global jpIsCodePointKanji, jpDistributeFurigana, Handlebars*/
/* global
* Handlebars
* jpDistributeFurigana
* jpIsCodePointKanji
*/

function handlebarsEscape(text) {
return Handlebars.Utils.escapeExpression(text);
Expand Down
4 changes: 3 additions & 1 deletion ext/bg/js/japanese.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

/*global wanakana*/
/* global
* wanakana
*/

const JP_HALFWIDTH_KATAKANA_MAPPING = new Map([
['ヲ', 'ヲヺ-'],
Expand Down
4 changes: 3 additions & 1 deletion ext/bg/js/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

/*global utilStringHashCode*/
/* global
* utilStringHashCode
*/

/*
* Generic options functions
Expand Down
4 changes: 3 additions & 1 deletion ext/bg/js/search-frontend.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

/*global apiOptionsGet*/
/* global
* apiOptionsGet
*/

async function searchFrontendSetup() {
await yomichan.prepare();
Expand Down
5 changes: 4 additions & 1 deletion ext/bg/js/search-query-parser-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

/*global apiGetQueryParserTemplatesHtml, TemplateHandler*/
/* global
* TemplateHandler
* apiGetQueryParserTemplatesHtml
*/

class QueryParserGenerator {
constructor() {
Expand Down
10 changes: 9 additions & 1 deletion ext/bg/js/search-query-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,15 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

/*global apiTermsFind, apiOptionsSet, apiTextParse, apiTextParseMecab, TextScanner, QueryParserGenerator, docSentenceExtract*/
/* global
* QueryParserGenerator
* TextScanner
* apiOptionsSet
* apiTermsFind
* apiTextParse
* apiTextParseMecab
* docSentenceExtract
*/

class QueryParser extends TextScanner {
constructor(search) {
Expand Down
9 changes: 8 additions & 1 deletion ext/bg/js/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

/*global apiOptionsSet, apiTermsFind, apiClipboardGet, Display, QueryParser, ClipboardMonitor*/
/* global
* ClipboardMonitor
* Display
* QueryParser
* apiClipboardGet
* apiOptionsSet
* apiTermsFind
*/

class DisplaySearch extends Display {
constructor() {
Expand Down
16 changes: 12 additions & 4 deletions ext/bg/js/settings/anki-templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,18 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

/*global getOptionsContext, getOptionsMutable, settingsSaveOptions
ankiGetFieldMarkers, ankiGetFieldMarkersHtml
apiOptionsGet, apiTermsFind, apiGetDefaultAnkiFieldTemplates, apiTemplateRender
AnkiNoteBuilder*/
/* global
* AnkiNoteBuilder
* ankiGetFieldMarkers
* ankiGetFieldMarkersHtml
* apiGetDefaultAnkiFieldTemplates
* apiOptionsGet
* apiTemplateRender
* apiTermsFind
* getOptionsContext
* getOptionsMutable
* settingsSaveOptions
*/

function onAnkiFieldTemplatesReset(e) {
e.preventDefault();
Expand Down
13 changes: 10 additions & 3 deletions ext/bg/js/settings/anki.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,16 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

/*global getOptionsContext, getOptionsMutable, settingsSaveOptions
utilBackgroundIsolate, utilAnkiGetDeckNames, utilAnkiGetModelNames, utilAnkiGetModelFieldNames
onFormOptionsChanged*/
/* global
* getOptionsContext
* getOptionsMutable
* onFormOptionsChanged
* settingsSaveOptions
* utilAnkiGetDeckNames
* utilAnkiGetModelFieldNames
* utilAnkiGetModelNames
* utilBackgroundIsolate
*/

// Private

Expand Down
10 changes: 8 additions & 2 deletions ext/bg/js/settings/audio.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,14 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

/*global getOptionsContext, getOptionsMutable, settingsSaveOptions, apiAudioGetUri
AudioSystem, AudioSourceUI*/
/* global
* AudioSourceUI
* AudioSystem
* apiAudioGetUri
* getOptionsContext
* getOptionsMutable
* settingsSaveOptions
*/

let audioSourceUI = null;
let audioSystem = null;
Expand Down
14 changes: 11 additions & 3 deletions ext/bg/js/settings/backup.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,17 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

/*global apiOptionsGetFull, apiGetEnvironmentInfo, apiGetDefaultAnkiFieldTemplates
utilBackend, utilIsolate, utilBackgroundIsolate, utilReadFileArrayBuffer
optionsGetDefault, optionsUpdateVersion*/
/* global
* apiGetDefaultAnkiFieldTemplates
* apiGetEnvironmentInfo
* apiOptionsGetFull
* optionsGetDefault
* optionsUpdateVersion
* utilBackend
* utilBackgroundIsolate
* utilIsolate
* utilReadFileArrayBuffer
*/

// Exporting

Expand Down
4 changes: 3 additions & 1 deletion ext/bg/js/settings/conditions-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

/*global conditionsNormalizeOptionValue*/
/* global
* conditionsNormalizeOptionValue
*/

class ConditionsUI {
static instantiateTemplate(templateSelector) {
Expand Down
22 changes: 17 additions & 5 deletions ext/bg/js/settings/dictionaries.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,23 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

/*global getOptionsContext, getOptionsMutable, getOptionsFullMutable, settingsSaveOptions, apiOptionsGetFull, apiOptionsGet
utilBackgroundIsolate, utilDatabaseDeleteDictionary, utilDatabaseGetDictionaryInfo, utilDatabaseGetDictionaryCounts
utilDatabasePurge, utilDatabaseImport
storageUpdateStats, storageEstimate
PageExitPrevention*/
/* global
* PageExitPrevention
* apiOptionsGet
* apiOptionsGetFull
* getOptionsContext
* getOptionsFullMutable
* getOptionsMutable
* settingsSaveOptions
* storageEstimate
* storageUpdateStats
* utilBackgroundIsolate
* utilDatabaseDeleteDictionary
* utilDatabaseGetDictionaryCounts
* utilDatabaseGetDictionaryInfo
* utilDatabaseImport
* utilDatabasePurge
*/

let dictionaryUI = null;

Expand Down
27 changes: 20 additions & 7 deletions ext/bg/js/settings/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,26 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

/*global getOptionsContext, apiOptionsSave
utilBackend, utilIsolate, utilBackgroundIsolate
ankiErrorShown, ankiFieldsToDict
ankiTemplatesUpdateValue, onAnkiOptionsChanged, onDictionaryOptionsChanged
appearanceInitialize, audioSettingsInitialize, profileOptionsSetup, dictSettingsInitialize
ankiInitialize, ankiTemplatesInitialize, storageInfoInitialize, backupInitialize
*/
/* global
* ankiErrorShown
* ankiFieldsToDict
* ankiInitialize
* ankiTemplatesInitialize
* ankiTemplatesUpdateValue
* apiOptionsSave
* appearanceInitialize
* audioSettingsInitialize
* backupInitialize
* dictSettingsInitialize
* getOptionsContext
* onAnkiOptionsChanged
* onDictionaryOptionsChanged
* profileOptionsSetup
* storageInfoInitialize
* utilBackend
* utilBackgroundIsolate
* utilIsolate
*/

function getOptionsMutable(optionsContext) {
return utilBackend().getOptions(
Expand Down
8 changes: 7 additions & 1 deletion ext/bg/js/settings/popup-preview-frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

/*global apiOptionsGet, Popup, PopupProxyHost, Frontend, TextSourceRange*/
/* global
* Frontend
* Popup
* PopupProxyHost
* TextSourceRange
* apiOptionsGet
*/

class SettingsPopupPreview {
constructor() {
Expand Down
14 changes: 11 additions & 3 deletions ext/bg/js/settings/profiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,17 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

/*global getOptionsMutable, getOptionsFullMutable, settingsSaveOptions, apiOptionsGetFull
utilBackgroundIsolate, formWrite
conditionsClearCaches, ConditionsUI, profileConditionsDescriptor*/
/* global
* ConditionsUI
* apiOptionsGetFull
* conditionsClearCaches
* formWrite
* getOptionsFullMutable
* getOptionsMutable
* profileConditionsDescriptor
* settingsSaveOptions
* utilBackgroundIsolate
*/

let currentProfileIndex = 0;
let profileConditionsContainer = null;
Expand Down
Loading

0 comments on commit 1cacbb6

Please sign in to comment.