mirror of
https://github.com/estruyf/vscode-front-matter.git
synced 2026-08-07 17:32:58 +02:00
Remove image compress icon
This commit is contained in:
Generated
+136
-2787
File diff suppressed because it is too large
Load Diff
+1
-3
@@ -860,7 +860,5 @@
|
||||
"webpack": "4.44.2",
|
||||
"webpack-cli": "3.3.12"
|
||||
},
|
||||
"dependencies": {
|
||||
"imagemin-cli": "^7.0.0"
|
||||
}
|
||||
"dependencies": {}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@ import { ContentType } from '../helpers/ContentType';
|
||||
import { SortingOption } from '../dashboardWebView/models';
|
||||
import { Sorting } from '../helpers/Sorting';
|
||||
import imageSize from 'image-size';
|
||||
import { Media } from '../helpers/Media';
|
||||
|
||||
export class Dashboard {
|
||||
private static webview: WebviewPanel | null = null;
|
||||
@@ -204,9 +203,6 @@ export class Dashboard {
|
||||
case DashboardMessage.setFramework:
|
||||
Dashboard.setFramework(msg?.data);
|
||||
break;
|
||||
case DashboardMessage.compressImage:
|
||||
Media.optimize(msg?.data);
|
||||
break;
|
||||
case DashboardMessage.setState:
|
||||
if (msg?.data?.key && msg?.data?.value) {
|
||||
Extension.getInstance().setState(msg?.data?.key, msg?.data?.value, "workspace");
|
||||
|
||||
@@ -20,5 +20,4 @@ export enum DashboardMessage {
|
||||
createMediaFolder = 'createMediaFolder',
|
||||
setFramework = 'setFramework',
|
||||
setState = 'setState',
|
||||
compressImage = 'compressImage',
|
||||
}
|
||||
@@ -62,11 +62,6 @@ export const Item: React.FunctionComponent<IItemProps> = ({media}: React.PropsWi
|
||||
Messenger.send(DashboardMessage.copyToClipboard, parseWinPath(relPath) || "");
|
||||
};
|
||||
|
||||
const compressImage = () => {
|
||||
const relPath = getRelPath();
|
||||
Messenger.send(DashboardMessage.compressImage, parseWinPath(relPath) || "");
|
||||
};
|
||||
|
||||
const insertToArticle = () => {
|
||||
const relPath = getRelPath();
|
||||
Messenger.send(DashboardMessage.insertPreviewImage, {
|
||||
@@ -230,12 +225,6 @@ export const Item: React.FunctionComponent<IItemProps> = ({media}: React.PropsWi
|
||||
<ClipboardCopyIcon className={`h-5 w-5`} />
|
||||
<span className={`sr-only`}>Copy media path</span>
|
||||
</button>
|
||||
<button title={`Compress image`}
|
||||
className={`hover:text-teal-900 focus:outline-none`}
|
||||
onClick={compressImage}>
|
||||
<CompressIcon className={`h-5 w-5`} />
|
||||
<span className={`sr-only`}>Compress image</span>
|
||||
</button>
|
||||
<button title={`Delete media`}
|
||||
className={`hover:text-teal-900 focus:outline-none`}
|
||||
onClick={deleteMedia}>
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
import { readdirSync } from 'fs';
|
||||
import { Extension } from './Extension';
|
||||
import { Notifications } from './Notifications';
|
||||
|
||||
export class Media {
|
||||
|
||||
public static async optimize(file: string, quality: number = 0.8) {
|
||||
if (!file) {
|
||||
Notifications.warning('No file provided');
|
||||
return;
|
||||
}
|
||||
|
||||
Notifications.info(readdirSync(Extension.getInstance().extensionPath.fsPath).join(","));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user