40 lines
924 B
JavaScript
40 lines
924 B
JavaScript
|
|
//这个函数在整个wps加载项中是第一个执行的
|
|
function OnAddinLoad(ribbonUI) {
|
|
if (typeof (window.Application.ribbonUI) != "object") {
|
|
window.Application.ribbonUI = ribbonUI
|
|
}
|
|
|
|
if (typeof (window.Application.Enum) != "object") { // 如果没有内置枚举值
|
|
window.Application.Enum = WPS_Enum
|
|
}
|
|
return true
|
|
}
|
|
|
|
|
|
function OnAction(control) {
|
|
const eleId = control.Id
|
|
switch (eleId) {
|
|
case "btnShowAbout":
|
|
{
|
|
alert("关于我们\n\n作者:Jianxin\n\n版本:1.0.0\n\n说明:自动化插件\n\n感谢使用!")
|
|
}
|
|
break;
|
|
default:
|
|
break
|
|
}
|
|
return true
|
|
}
|
|
|
|
|
|
function GetImage(control) {
|
|
const eleId = control.Id
|
|
switch (eleId) {
|
|
case "btnShowAbout":
|
|
return "images/about.svg"
|
|
default:
|
|
;
|
|
}
|
|
return "images/newFromTemp.svg"
|
|
}
|