mirror of
https://github.com/estruyf/vscode-front-matter.git
synced 2026-08-07 17:32:58 +02:00
Updates for v1.13.0
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
# Change Log
|
||||
|
||||
## [1.13.0] - 2020-02-26
|
||||
|
||||
- Implemented links to quickly open the extension settings + issue from the FrontMatter view panel
|
||||
- Added button to update the modified time in the FrontMatter view panel
|
||||
|
||||
## [1.12.1] - 2020-02-13
|
||||
|
||||
- Fix Front Matter SVG
|
||||
|
||||
@@ -197,4 +197,20 @@
|
||||
border-right: 1px solid var(--vscode-inputValidation-infoBorder);
|
||||
|
||||
filter: contrast(60%);
|
||||
}
|
||||
|
||||
.ext_link_block {
|
||||
margin-bottom: .5rem;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.ext_link_block a {
|
||||
color: var(--vscode-textLink-foreground);
|
||||
}
|
||||
|
||||
.ext_link_block a:hover,
|
||||
.ext_link_block a:active,
|
||||
.ext_link_block a:focus,
|
||||
.ext_link_block a:visited {
|
||||
color: var(--vscode-textLink-activeForeground);
|
||||
}
|
||||
@@ -2,9 +2,11 @@ export enum CommandToCode {
|
||||
getData = "get-data",
|
||||
updateSlug = 'update-slug',
|
||||
updateDate = 'update-date',
|
||||
updateLastMod = 'update-lastmod',
|
||||
publish = 'publish',
|
||||
updateTags = "update-tags",
|
||||
updateCategories = "update-categories",
|
||||
addTagToSettings = "add-tag",
|
||||
addCategoryToSettings = "add-category"
|
||||
addCategoryToSettings = "add-category",
|
||||
openSettings = "open-settings"
|
||||
}
|
||||
@@ -1,8 +1,10 @@
|
||||
import * as React from 'react';
|
||||
import { CommandToCode } from './CommandToCode';
|
||||
import { Actions } from './components/Actions';
|
||||
import { SeoStatus } from './components/SeoStatus';
|
||||
import { Spinner } from './components/Spinner';
|
||||
import { TagPicker } from './components/TagPicker';
|
||||
import { MessageHelper } from './helper/MessageHelper';
|
||||
import useMessages from './hooks/useMessages';
|
||||
import { TagType } from './TagType';
|
||||
|
||||
@@ -26,6 +28,10 @@ export const ViewPanel: React.FunctionComponent<IViewPanelProps> = (props: React
|
||||
);
|
||||
}
|
||||
|
||||
const openSettings = () => {
|
||||
MessageHelper.sendMessage(CommandToCode.openSettings);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="frontmatter">
|
||||
{
|
||||
@@ -54,6 +60,14 @@ export const ViewPanel: React.FunctionComponent<IViewPanelProps> = (props: React
|
||||
unsetFocus={unsetFocus} />
|
||||
)
|
||||
}
|
||||
|
||||
<div className="ext_link_block">
|
||||
<a href="javascript:;" onClick={openSettings}>Open settings</a>
|
||||
</div>
|
||||
|
||||
<div className="ext_link_block">
|
||||
<a href="https://github.com/estruyf/vscode-front-matter/issues" title="Open an issue on GitHub">Report an issue</a>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
import * as React from 'react';
|
||||
import { CommandToCode } from '../CommandToCode';
|
||||
import { MessageHelper } from '../helper/MessageHelper';
|
||||
@@ -11,10 +9,19 @@ export const DateAction: React.FunctionComponent<IDateActionProps> = (props: Rea
|
||||
const setDate = () => {
|
||||
MessageHelper.sendMessage(CommandToCode.updateDate);
|
||||
};
|
||||
|
||||
const setLastMod = () => {
|
||||
MessageHelper.sendMessage(CommandToCode.updateLastMod);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className={`article__action`}>
|
||||
<button onClick={setDate}>Set current date</button>
|
||||
</div>
|
||||
<>
|
||||
<div className={`article__action`}>
|
||||
<button onClick={setDate}>Set publish date</button>
|
||||
</div>
|
||||
<div className={`article__action`}>
|
||||
<button onClick={setLastMod}>Set modified date</button>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
@@ -1,5 +1,5 @@
|
||||
import { PanelSettings } from './../models/PanelSettings';
|
||||
import { CancellationToken, Disposable, Uri, Webview, WebviewView, WebviewViewProvider, WebviewViewResolveContext, window, workspace } from "vscode";
|
||||
import { CancellationToken, Disposable, Uri, Webview, WebviewView, WebviewViewProvider, WebviewViewResolveContext, window, workspace, commands } from "vscode";
|
||||
import { CONFIG_KEY, SETTING_PANEL_FREEFORM, SETTING_SEO_DESCRIPTION_LENGTH, SETTING_SEO_TITLE_LENGTH, SETTING_SLUG_PREFIX, SETTING_SLUG_SUFFIX, SETTING_TAXONOMY_CATEGORIES, SETTING_TAXONOMY_TAGS } from "../constants";
|
||||
import { ArticleHelper, SettingsHelper } from "../helpers";
|
||||
import { Command } from "../viewpanel/Command";
|
||||
@@ -82,6 +82,9 @@ export class ExplorerView implements WebviewViewProvider, Disposable {
|
||||
case CommandToCode.updateDate:
|
||||
Article.setDate();
|
||||
break;
|
||||
case CommandToCode.updateLastMod:
|
||||
Article.setLastModifiedDate();
|
||||
break;
|
||||
case CommandToCode.publish:
|
||||
Article.toggleDraft();
|
||||
break;
|
||||
@@ -97,6 +100,9 @@ export class ExplorerView implements WebviewViewProvider, Disposable {
|
||||
case CommandToCode.addCategoryToSettings:
|
||||
this.addTags(TagType.categories, msg.data);
|
||||
break;
|
||||
case CommandToCode.openSettings:
|
||||
commands.executeCommand('workbench.action.openSettings', '@ext:eliostruyf.vscode-front-matter');
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user