diff --git a/src/MicroPlugin.ts b/src/MicroPlugin.ts index 0564060..c005df2 100644 --- a/src/MicroPlugin.ts +++ b/src/MicroPlugin.ts @@ -106,8 +106,8 @@ export default class MicroPlugin extends Plugin { }) this.addRibbonIcon( - "message-circle", - "Compose Micropost", + 'message-circle', + 'Compose Micropost', () => { this.openMicropostView() } diff --git a/src/networking/NetworkClient.ts b/src/networking/NetworkClient.ts index 8607809..6fc9e46 100644 --- a/src/networking/NetworkClient.ts +++ b/src/networking/NetworkClient.ts @@ -32,7 +32,7 @@ export class NetworkClient implements NetworkClientInterface { // Public public async run(request: NetworkRequest): Promise { - const url = 'https://micro.blog' + request.path + (request.parameters ? '?' + request.parameters : "") + const url = 'https://micro.blog' + request.path + (request.parameters ? '?' + request.parameters : '') const response = await fetch(url, { method: request.method, diff --git a/src/networking/NetworkRequestFactory.ts b/src/networking/NetworkRequestFactory.ts index 34e5b5e..c74ea3c 100644 --- a/src/networking/NetworkRequestFactory.ts +++ b/src/networking/NetworkRequestFactory.ts @@ -24,7 +24,7 @@ export interface NetworkRequestFactoryInterface { navigation: boolean ): NetworkRequest - // Builds the configuration request, `NetworkRequest` used to "log in" + // Builds the configuration request, `NetworkRequest` used to log in // the user. The config network request returns the list of blogs the // user can post to. makeConfigRequest(): NetworkRequest diff --git a/src/networking/NewPostRequest.ts b/src/networking/NewPostRequest.ts index 705cdef..32de3a3 100644 --- a/src/networking/NewPostRequest.ts +++ b/src/networking/NewPostRequest.ts @@ -5,7 +5,7 @@ export type NewPostRequest = { 'type': string[] 'mp-destination'?: string 'properties': { - "name"?: string[] + 'name'?: string[] 'content': string[], 'category': string[], 'published'?: string[], @@ -26,7 +26,7 @@ export function makeNewPostRequest( 'type': ["h-entry"], ...blogID.length > 0 && blogID !== 'default' && { 'mp-destination': blogID }, 'properties': { - ...title.length > 0 && { "name": [title] }, + ...title.length > 0 && { 'name': [title] }, 'content': [content], 'category': categories, ...published.length > 0 && { 'published': [published] }, diff --git a/src/networking/UpdatePostRequest.ts b/src/networking/UpdatePostRequest.ts index af8f4fd..5765ef6 100644 --- a/src/networking/UpdatePostRequest.ts +++ b/src/networking/UpdatePostRequest.ts @@ -7,7 +7,7 @@ export type UpdatePostRequest = { 'mp-destination': string 'replace': { 'content': string[], - "name": string[] + 'name': string[] } } @@ -24,7 +24,7 @@ export function makeUpdatePostRequest( 'mp-destination': blogID, 'replace': { 'content': [content], - "name": [title] + 'name': [title] } } } diff --git a/src/views/MicropostView.ts b/src/views/MicropostView.ts index 7702bcd..acc6d4e 100644 --- a/src/views/MicropostView.ts +++ b/src/views/MicropostView.ts @@ -41,7 +41,7 @@ export class MicropostView extends Modal implements MicropostViewModelDelegate { this.viewModel.content = value }) .then(textArea => { - textArea.inputEl.style.width = "100%"; + textArea.inputEl.style.width = '100%' textArea.inputEl.rows = 10; }) diff --git a/src/views/MicropostViewModel.ts b/src/views/MicropostViewModel.ts index 30197e3..ba24e0b 100644 --- a/src/views/MicropostViewModel.ts +++ b/src/views/MicropostViewModel.ts @@ -1,6 +1,6 @@ -import { NetworkClientInterface } from "@networking/NetworkClient"; -import { NetworkRequestFactoryInterface } from "@networking/NetworkRequestFactory"; -import { PublishResponse } from "@networking/PublishResponse"; +import { NetworkClientInterface } from '@networking/NetworkClient' +import { NetworkRequestFactoryInterface } from '@networking/NetworkRequestFactory' +import { PublishResponse } from '@networking/PublishResponse' export enum SubmitButtonStyle { Disabled, @@ -61,8 +61,8 @@ export class MicropostViewModel { networkRequestFactory: NetworkRequestFactoryInterface ) { this.visibilityWrappedValue = visibility - this.contentWrappedValue = "" - this.plainTextContent = "" + this.contentWrappedValue = '' + this.plainTextContent = '' this.blogs = blogs this.selectedBlogIDWrappedValue = selectedBlogID this.networkClient = networkClient @@ -114,12 +114,12 @@ export class MicropostViewModel { try { const request = this.networkRequestFactory.makePublishPostRequest( - "", + '', this.content, [], this.visibility, this.selectedBlogID, - "" + '' ) const result = await this.networkClient.run( diff --git a/src/views/PublishPageView.ts b/src/views/PublishPageView.ts index 0333181..e4f8b84 100644 --- a/src/views/PublishPageView.ts +++ b/src/views/PublishPageView.ts @@ -1,6 +1,6 @@ -import { PublishResponse } from "@networking/PublishResponse" -import { PublishPageViewModel, PublishPageViewModelDelegate } from "@views/PublishPageViewModel" -import { App, Modal, Setting } from "obsidian" +import { PublishResponse } from '@networking/PublishResponse' +import { PublishPageViewModel, PublishPageViewModelDelegate } from '@views/PublishPageViewModel' +import { App, Modal, Setting } from 'obsidian' /* * `PublishPageView` subclasses `Modal` and is presented via Obsidian's diff --git a/src/views/PublishPageViewModel.ts b/src/views/PublishPageViewModel.ts index 306ce35..d4bad07 100644 --- a/src/views/PublishPageViewModel.ts +++ b/src/views/PublishPageViewModel.ts @@ -1,6 +1,6 @@ import { NetworkClientInterface } from '@networking/NetworkClient' import { NetworkRequestFactoryInterface } from '@networking/NetworkRequestFactory' -import { PublishResponse } from "@networking/PublishResponse" +import { PublishResponse } from '@networking/PublishResponse' import { FrontmatterServiceInterface } from '@services/FrontmatterService' /* @@ -106,7 +106,7 @@ export class PublishPageViewModel { } public get missingTitleText(): string { - return this.hasValidTitle ? "" : "Title is mandatory" + return this.hasValidTitle ? '' : 'Title is mandatory' } public async publishPage() { diff --git a/src/views/PublishPostViewModel.ts b/src/views/PublishPostViewModel.ts index 22f0600..a5d9b88 100644 --- a/src/views/PublishPostViewModel.ts +++ b/src/views/PublishPostViewModel.ts @@ -137,7 +137,7 @@ export class PublishPostViewModel implements TagSuggestionDelegate { } public get invalidDateText(): string { - return this.isValidDate ? "" : "Invalid date format" + return this.isValidDate ? '' : 'Invalid date format' } public async publishNote() { @@ -156,7 +156,7 @@ export class PublishPostViewModel implements TagSuggestionDelegate { const response = this.networkRequestFactory.makePublishPostRequest( this.title, this.content, - this.tags.split(","), + this.tags.split(','), this.visibility, this.selectedBlogID, this.formattedScheduledDate() diff --git a/src/views/UpdatePageViewModel.ts b/src/views/UpdatePageViewModel.ts index f843c42..149c259 100644 --- a/src/views/UpdatePageViewModel.ts +++ b/src/views/UpdatePageViewModel.ts @@ -121,7 +121,7 @@ export class UpdatePageViewModel { } public get missingTitleText(): string { - return this.hasValidTitle ? "" : "Title is mandatory" + return this.hasValidTitle ? '' : 'Title is mandatory' } // Private