mirror of
https://github.com/Keyitdev/dotfiles.git
synced 2026-09-24 01:52:09 +00:00
New version: created v3
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = [
|
||||
'chalky',
|
||||
'coral',
|
||||
'dark',
|
||||
'error',
|
||||
'fountainBlue',
|
||||
'green',
|
||||
'invalid',
|
||||
'lightDark',
|
||||
'lightWhite',
|
||||
'malibu',
|
||||
'purple',
|
||||
'whiskey',
|
||||
'deepRed',
|
||||
];
|
||||
//# sourceMappingURL=colorObjArr.js.map
|
||||
@@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
__exportStar(require("./reload-prompt"), exports);
|
||||
__exportStar(require("./updateTheme"), exports);
|
||||
__exportStar(require("./updateCSS"), exports);
|
||||
//# sourceMappingURL=index.js.map
|
||||
@@ -0,0 +1,28 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.promptToReload = void 0;
|
||||
const vscode_1 = require("vscode");
|
||||
function promptToReload() {
|
||||
const action = 'Reload';
|
||||
const msg = {
|
||||
en: {
|
||||
reload: 'Please reload to apply the theme configuration changes.',
|
||||
},
|
||||
'zh-cn': {
|
||||
reload: '请重新加载以让主题配置更改生效',
|
||||
},
|
||||
};
|
||||
const config = JSON.parse(process.env.VSCODE_NLS_CONFIG);
|
||||
const locale = config.locale;
|
||||
let msgReload = msg.en.reload;
|
||||
if (locale === 'zh-cn') {
|
||||
msgReload = msg['zh-cn'].reload;
|
||||
}
|
||||
vscode_1.window.showInformationMessage(msgReload, action).then((selectedAction) => {
|
||||
if (selectedAction === action) {
|
||||
vscode_1.commands.executeCommand('workbench.action.reloadWindow');
|
||||
}
|
||||
});
|
||||
}
|
||||
exports.promptToReload = promptToReload;
|
||||
//# sourceMappingURL=reload-prompt.js.map
|
||||
@@ -0,0 +1,37 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.updateCSS = void 0;
|
||||
const vscode_1 = require("vscode");
|
||||
const util_1 = require("util");
|
||||
const path_1 = require("path");
|
||||
const getCSSPath = file => (0, path_1.join)(__dirname, '../../', 'styles', file);
|
||||
function updateCSS() {
|
||||
const configuration = vscode_1.workspace.getConfiguration('oneDarkPro');
|
||||
const files = [
|
||||
'atom-one-dark-inside.css',
|
||||
'base-inside.css',
|
||||
'markdown-inside.css'
|
||||
];
|
||||
if (!configuration.get('markdownStyle')) {
|
||||
files.forEach(file => {
|
||||
vscode_1.workspace.fs.writeFile(vscode_1.Uri.file(getCSSPath(file)), new util_1.TextEncoder().encode(''));
|
||||
});
|
||||
}
|
||||
else {
|
||||
files.forEach((file) => __awaiter(this, void 0, void 0, function* () {
|
||||
const fileContents = yield vscode_1.workspace.fs.readFile(vscode_1.Uri.file(getCSSPath(`./origin/${file}`)));
|
||||
vscode_1.workspace.fs.writeFile(vscode_1.Uri.file(getCSSPath(`./${file}`)), fileContents);
|
||||
}));
|
||||
}
|
||||
}
|
||||
exports.updateCSS = updateCSS;
|
||||
//# sourceMappingURL=updateCSS.js.map
|
||||
@@ -0,0 +1,36 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.updateTheme = void 0;
|
||||
const path_1 = require("path");
|
||||
const vscode_1 = require("vscode");
|
||||
const util_1 = require("util");
|
||||
const themes_1 = require("../themes");
|
||||
const _1 = require("./");
|
||||
function updateTheme() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const writeTheme = (fileName, themeName) => __awaiter(this, void 0, void 0, function* () {
|
||||
const THEME_PATH = vscode_1.Uri.file((0, path_1.join)(__dirname, '../../', 'themes', fileName));
|
||||
const theme = yield themes_1.generateTheme.fromSettings(themeName);
|
||||
return vscode_1.workspace.fs.writeFile(THEME_PATH, new util_1.TextEncoder().encode(JSON.stringify(theme, null, 2)));
|
||||
});
|
||||
let promiseArr = [];
|
||||
promiseArr = [
|
||||
writeTheme('OneDark-Pro.json'),
|
||||
writeTheme('OneDark-Pro-flat.json', 'One Dark Pro Flat'),
|
||||
writeTheme('OneDark-Pro-darker.json', 'One Dark Pro Darker'),
|
||||
];
|
||||
yield Promise.all(promiseArr);
|
||||
(0, _1.promptToReload)();
|
||||
});
|
||||
}
|
||||
exports.updateTheme = updateTheme;
|
||||
//# sourceMappingURL=updateTheme.js.map
|
||||
Reference in New Issue
Block a user