Skip to content

Commit e1d7816

Browse files
committed
update
1 parent 81f729a commit e1d7816

File tree

4 files changed

+53
-3
lines changed

4 files changed

+53
-3
lines changed

.idea/MarsCodeWorkspaceAppSettings.xml

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/dev/assets/js/dev.js

+46-3
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,38 @@ const toggleClass = (target, cls, toggle = false) => {
4141
// 触发键盘事件
4242
const keyEvent = (key, ctrlKey = false, altKey = false, shiftKey = false) => {
4343
const ke = new KeyboardEvent('keydown', { ctrlKey, altKey, shiftKey, detail: 1, view: window });
44+
// key是键盘对应键的code值
4445
Object.defineProperty(ke, 'key', { value: key });
4546
document.dispatchEvent(ke);
4647
};
47-
// 从localStorage获取值(值是整型或布尔型)
48+
// 通过浏览器协议打开工具
49+
const openProtocol = (protocolName) => {
50+
const winFeatures = [
51+
'left=0', // 新窗口距离屏幕左侧的像素数
52+
'top=-50', // 新窗口距离屏幕上侧的像素数
53+
'width=0', // 新窗口的宽度
54+
'height=0', // 新窗口的高度
55+
'innerWidth=0', // 新窗口的内部宽度
56+
'innerHeight=0', // 新窗口的内部高度
57+
'outerWidth=0', // 新窗口的外部宽度
58+
'outerHeight=0', // 新窗口的外部高度
59+
'centerscreen=no', // 是否在屏幕中央打开
60+
'fullscreen=no', // 是否全屏
61+
'titlebar=no', // 是否显示标题栏
62+
'toolbar=no', // 是否显示工具栏
63+
'menubar=no', // 是否显示菜单栏
64+
'location=no', // 是否显示地址栏
65+
'status=no', // 是否显示是否显示状态栏
66+
'scrollbars=no', // 是否显示滚动条
67+
'resizable=no', // 窗口是否可调整大小
68+
'director=no', // 是否显示目录栏
69+
'help=no', // 是否显示帮助按钮
70+
'minimizedbutton=no', // 是否显示最小化按钮
71+
'maximizedbutton=no', // 是否显示最大化按钮
72+
];
73+
window.open(`${protocolName}://`, protocolName, winFeatures.join(',')).close();
74+
};
75+
// 从localStorage获取值(值是整型或布尔型),没有或异常时取默认值
4876
const getLocalByDefault = (key, defaultValue) => {
4977
let value = localStorage.getItem(key);
5078
try {
@@ -150,9 +178,11 @@ const wtConfirm = (content) => window.Pedestal.callMethod('method://pedestal/con
150178
* @returns {Promise<void>}
151179
*/
152180
const wtNotifyPrompt = async ({ title, inputType = 'text', inputTestId, placeholders, defaultValue, maxLength = 1e5, callback }) => {
153-
const newProc = new Promise((resolve, reject) => {
181+
const newProc = new Promise((resolve) => {
154182
const d = window.Pedestal.callMethod('method://pedestal/notifyPrompt', {
155-
dialogId: Date.now(), title, inputParam: { inputType, placeholders, inputTestId, maxLength, defaultValue },
183+
dialogId: Date.now(),
184+
title,
185+
inputParam: { inputType, placeholders, inputTestId, maxLength, defaultValue },
156186
});
157187
setTimeout(() => {
158188
if (inputTestId) {
@@ -202,3 +232,16 @@ const openExternal = (url) => {
202232
} catch (e) {}
203233
};
204234
// endregion
235+
// region 特性方法
236+
// 生成资源默认路径
237+
const basePath = (index, path = 'assets/', padPath = '../') => path.padStart(index * padPath.length + path.length, padPath);
238+
// 生成样式表路径
239+
const stylePath = (index, viewID) => `${basePath(index)}css/${viewID}.css`;
240+
// 视频背景列表
241+
let videoList = [];
242+
// 获取视频显示名
243+
const setVideoName = (langCode, video) => {
244+
video.name = langCode === DEFAULT_LANGUAGE_CODE ? video.cnName : video.enName;
245+
!video.name && (video.name = video.fileName);
246+
};
247+
// endregion

resources/welink_msg_style.exe

0 Bytes
Binary file not shown.

resources/welink_themes.exe

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)