Capitalize background scripts

This commit is contained in:
Shin'ya Ueoka 2019-02-24 20:54:35 +09:00
parent 21788740c1
commit a26d8a8a1b
50 changed files with 247 additions and 245 deletions

View file

@ -1,8 +1,8 @@
import IndicatorPresenter from '../presenters/indicator';
import TabPresenter from '../presenters/tab';
import ContentMessageClient from '../infrastructures/content-message-client';
import IndicatorPresenter from '../presenters/IndicatorPresenter';
import TabPresenter from '../presenters/TabPresenter';
import ContentMessageClient from '../infrastructures/ContentMessageClient';
export default class AddonEnabledInteractor {
export default class AddonEnabledUseCase {
constructor() {
this.indicatorPresentor = new IndicatorPresenter();

View file

@ -1,11 +1,11 @@
import * as parsers from './parsers';
import * as urls from '../../shared/urls';
import TabPresenter from '../presenters/tab';
import WindowPresenter from '../presenters/window';
import SettingRepository from '../repositories/setting';
import BookmarkRepository from '../repositories/bookmark';
import ConsolePresenter from '../presenters/console';
import ContentMessageClient from '../infrastructures/content-message-client';
import TabPresenter from '../presenters/TabPresenter';
import WindowPresenter from '../presenters/WindowPresenter';
import SettingRepository from '../repositories/SettingRepository';
import BookmarkRepository from '../repositories/BookmarkRepository';
import ConsoleClient from '../infrastructures/ConsoleClient';
import ContentMessageClient from '../infrastructures/ContentMessageClient';
import * as properties from 'shared/settings/properties';
export default class CommandIndicator {
@ -14,7 +14,7 @@ export default class CommandIndicator {
this.windowPresenter = new WindowPresenter();
this.settingRepository = new SettingRepository();
this.bookmarkRepository = new BookmarkRepository();
this.consolePresenter = new ConsolePresenter();
this.consoleClient = new ConsoleClient();
this.contentMessageClient = new ContentMessageClient();
}
@ -105,7 +105,7 @@ export default class CommandIndicator {
let tab = await this.tabPresenter.getCurrent();
let item = await this.bookmarkRepository.create(title, tab.url);
let message = 'Saved current page: ' + item.url;
return this.consolePresenter.showInfo(tab.id, message);
return this.consoleClient.showInfo(tab.id, message);
}
async set(keywords) {

View file

@ -1,19 +1,19 @@
import CompletionItem from '../domains/completion-item';
import CompletionGroup from '../domains/completion-group';
import Completions from '../domains/completions';
import CommandDocs from '../domains/command-docs';
import CompletionRepository from '../repositories/completions';
import CompletionItem from '../domains/CompletionItem';
import CompletionGroup from '../domains/CompletionGroup';
import Completions from '../domains/Completions';
import CommandDocs from '../domains/CommandDocs';
import CompletionsRepository from '../repositories/CompletionsRepository';
import * as filters from './filters';
import SettingRepository from '../repositories/setting';
import TabPresenter from '../presenters/tab';
import SettingRepository from '../repositories/SettingRepository';
import TabPresenter from '../presenters/TabPresenter';
import * as properties from '../../shared/settings/properties';
const COMPLETION_ITEM_LIMIT = 10;
export default class CompletionsInteractor {
export default class CompletionsUseCase {
constructor() {
this.tabPresenter = new TabPresenter();
this.completionRepository = new CompletionRepository();
this.completionsRepository = new CompletionsRepository();
this.settingRepository = new SettingRepository();
}
@ -86,7 +86,7 @@ export default class CompletionsInteractor {
tabs = [tab];
}
} else {
tabs = await this.completionRepository.queryTabs(keywords, false);
tabs = await this.completionsRepository.queryTabs(keywords, false);
}
const flag = (tab) => {
if (tab.active) {
@ -153,7 +153,7 @@ export default class CompletionsInteractor {
}
async queryTabs(name, excludePinned, args) {
let tabs = await this.completionRepository.queryTabs(args, excludePinned);
let tabs = await this.completionsRepository.queryTabs(args, excludePinned);
let items = tabs.map(tab => new CompletionItem({
caption: tab.title,
content: name + ' ' + tab.title,
@ -177,7 +177,7 @@ export default class CompletionsInteractor {
}
async queryHistoryItems(name, keywords) {
let histories = await this.completionRepository.queryHistories(keywords);
let histories = await this.completionsRepository.queryHistories(keywords);
histories = [histories]
.map(filters.filterBlankTitle)
.map(filters.filterHttp)
@ -194,7 +194,7 @@ export default class CompletionsInteractor {
}
async queryBookmarkItems(name, keywords) {
let bookmarks = await this.completionRepository.queryBookmarks(keywords);
let bookmarks = await this.completionsRepository.queryBookmarks(keywords);
return bookmarks.slice(0, COMPLETION_ITEM_LIMIT)
.map(page => new CompletionItem({
caption: page.title,

View file

@ -1,6 +1,6 @@
import FindRepository from '../repositories/find';
import FindRepository from '../repositories/FindRepository';
export default class FindInteractor {
export default class FindUseCase {
constructor() {
this.findRepository = new FindRepository();
}

View file

@ -1,7 +1,7 @@
import SettingRepository from '../repositories/setting';
import TabPresenter from '../presenters/tab';
import SettingRepository from '../repositories/SettingRepository';
import TabPresenter from '../presenters/TabPresenter';
export default class LinkInteractor {
export default class LinkUseCase {
constructor() {
this.settingRepository = new SettingRepository();
this.tabPresenter = new TabPresenter();

View file

@ -1,14 +1,14 @@
import GlobalMark from '../domains/global-mark';
import TabPresenter from '../presenters/tab';
import MarkRepository from '../repositories/mark';
import ConsolePresenter from '../presenters/console';
import ContentMessageClient from '../infrastructures/content-message-client';
import GlobalMark from '../domains/GlobalMark';
import TabPresenter from '../presenters/TabPresenter';
import MarkRepository from '../repositories/MarkRepository';
import ConsoleClient from '../infrastructures/ConsoleClient';
import ContentMessageClient from '../infrastructures/ContentMessageClient';
export default class MarkInteractor {
export default class MarkUseCase {
constructor() {
this.tabPresenter = new TabPresenter();
this.markRepository = new MarkRepository();
this.consolePresenter = new ConsolePresenter();
this.consoleClient = new ConsoleClient();
this.contentMessageClient = new ContentMessageClient();
}
@ -23,7 +23,7 @@ export default class MarkInteractor {
let mark = await this.markRepository.getMark(key);
if (!mark) {
return this.consolePresenter.showError(current.id, 'Mark is not set');
return this.consoleClient.showError(current.id, 'Mark is not set');
}
return this.contentMessageClient.scrollTo(

View file

@ -1,5 +1,5 @@
import TabPresenter from '../presenters/tab';
import ConsolePresenter from '../presenters/console';
import TabPresenter from '../presenters/TabPresenter';
import ConsoleClient from '../infrastructures/ConsoleClient';
import * as urls from '../../shared/urls';
const ZOOM_SETTINGS = [
@ -7,10 +7,10 @@ const ZOOM_SETTINGS = [
1.10, 1.25, 1.50, 1.75, 2.00, 2.50, 3.00
];
export default class OperationInteractor {
export default class OperationUseCase {
constructor() {
this.tabPresenter = new TabPresenter();
this.consolePresenter = new ConsolePresenter();
this.consoleClient = new ConsoleClient();
}
async close(force) {
@ -134,7 +134,7 @@ export default class OperationInteractor {
async showCommand() {
let tab = await this.tabPresenter.getCurrent();
return this.consolePresenter.showCommand(tab.id, '');
return this.consoleClient.showCommand(tab.id, '');
}
async showOpenCommand(alter) {
@ -143,7 +143,7 @@ export default class OperationInteractor {
if (alter) {
command += tab.url;
}
return this.consolePresenter.showCommand(tab.id, command);
return this.consoleClient.showCommand(tab.id, command);
}
async showTabopenCommand(alter) {
@ -152,7 +152,7 @@ export default class OperationInteractor {
if (alter) {
command += tab.url;
}
return this.consolePresenter.showCommand(tab.id, command);
return this.consoleClient.showCommand(tab.id, command);
}
async showWinopenCommand(alter) {
@ -161,13 +161,13 @@ export default class OperationInteractor {
if (alter) {
command += tab.url;
}
return this.consolePresenter.showCommand(tab.id, command);
return this.consoleClient.showCommand(tab.id, command);
}
async showBufferCommand() {
let tab = await this.tabPresenter.getCurrent();
let command = 'buffer ';
return this.consolePresenter.showCommand(tab.id, command);
return this.consoleClient.showCommand(tab.id, command);
}
async showAddbookmarkCommand(alter) {
@ -176,17 +176,17 @@ export default class OperationInteractor {
if (alter) {
command += tab.title;
}
return this.consolePresenter.showCommand(tab.id, command);
return this.consoleClient.showCommand(tab.id, command);
}
async findStart() {
let tab = await this.tabPresenter.getCurrent();
return this.consolePresenter.showFind(tab.id);
return this.consoleClient.showFind(tab.id);
}
async hideConsole() {
let tab = await this.tabPresenter.getCurrent();
return this.consolePresenter.hide(tab.id);
return this.consoleClient.hide(tab.id);
}
async openHome(newTab) {

View file

@ -1,8 +1,9 @@
import Setting from '../domains/setting';
import PersistentSettingRepository from '../repositories/persistent-setting';
import SettingRepository from '../repositories/setting';
import Setting from '../domains/Setting';
// eslint-disable-next-line max-len
import PersistentSettingRepository from '../repositories/PersistentSettingRepository';
import SettingRepository from '../repositories/SettingRepository';
export default class SettingInteractor {
export default class SettingUseCase {
constructor() {
this.persistentSettingRepository = new PersistentSettingRepository();
this.settingRepository = new SettingRepository();

View file

@ -1,9 +1,9 @@
import manifest from '../../../manifest.json';
import VersionRepository from '../repositories/version';
import TabPresenter from '../presenters/tab';
import Notifier from '../infrastructures/notifier';
import VersionRepository from '../repositories/VersionRepository';
import TabPresenter from '../presenters/TabPresenter';
import Notifier from '../infrastructures/Notifier';
export default class VersionInteractor {
export default class VersionUseCase {
constructor() {
this.versionRepository = new VersionRepository();
this.tabPresenter = new TabPresenter();