WPS加载项(三)–拓展用:超强功能辅助
<button id="btnShowTaskPane" label="表格列表" onAction="taskpane" getImage="GetImage" size="large" keytip = "B"/>
function taskpane() {let tsId = window.Application.PluginStorage.getItem("taskpane_id")if (!tsId) {let tskpane = window.Application.CreateTaskPane(GetUrlPath() + "/ui/sheetlist.html","文件列表")let id = tskpane.IDwindow.Application.PluginStorage.setItem("taskpane_id", id)tskpane.Visible = truetskpane.DockPosition = wps.Enum.JSKsoEnum_msoCTPDockPositionLeft;} else {let tskpane = window.Application.GetTaskPane(tsId)tskpane.Visible = !tskpane.Visible}return true}
function GetUrlPath() {let e = document.location.toString()return -1!=(e=decodeURI(e)).indexOf("/")&&(e=e.substring(0,e.lastIndexOf("/"))),e}

tskpane.DockPosition = wps.Enum.JSKsoEnum_msoCTPDockPositionLeft;
已关注
关注
重播 分享 赞
夜雨聆风