dsh-plugin-yanyan-toolkit 0.0.0-stage → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/LICENSE +29 -0
- package/README.i18n.yaml +6 -0
- package/README.md +65 -2
- package/README.zh.md +66 -0
- package/cordis.patch.yml +35 -0
- package/icon.svg +8 -0
- package/lib/client.js +26 -0
- package/lib/index.js +44 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +79 -4
- package/packages/dsh-plugin-yanyan-subagent/README.md +72 -0
- package/packages/dsh-plugin-yanyan-subagent/README.zh.md +72 -0
- package/packages/dsh-plugin-yanyan-subagent/cordis.patch.yml +8 -0
- package/packages/dsh-plugin-yanyan-subagent/icon.svg +8 -0
- package/packages/dsh-plugin-yanyan-subagent/lib/client.js +1250 -0
- package/packages/dsh-plugin-yanyan-subagent/lib/index.js +951 -0
- package/packages/dsh-plugin-yanyan-subagent/lib/legacy-hidden-ids.json +9 -0
- package/packages/dsh-plugin-yanyan-subagent/lib/log-rewrite.js +382 -0
- package/packages/dsh-plugin-yanyan-subagent/lib/zstd-frames.js +81 -0
- package/packages/dsh-plugin-yanyan-subagent/locale/en.json +1 -0
- package/packages/dsh-plugin-yanyan-subagent/locale/zh.json +1 -0
- package/packages/dsh-plugin-yanyan-subagent/package.json +32 -0
- package/packages/dsh-plugin-yanyan-update/README.md +24 -0
- package/packages/dsh-plugin-yanyan-update/README.zh.md +24 -0
- package/packages/dsh-plugin-yanyan-update/cordis.patch.yml +7 -0
- package/packages/dsh-plugin-yanyan-update/icon.svg +5 -0
- package/packages/dsh-plugin-yanyan-update/lib/client.js +400 -0
- package/packages/dsh-plugin-yanyan-update/lib/index.js +840 -0
- package/packages/dsh-plugin-yanyan-update/locale/en.json +1 -0
- package/packages/dsh-plugin-yanyan-update/locale/zh.json +1 -0
- package/packages/dsh-plugin-yanyan-update/package.json +32 -0
- package/scripts/cleanup-ghost-subagents.mjs +241 -0
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
// dsh-plugin-yanyan-update — 浏览器半区(__ModuleLoader__ 装载形态)。
|
|
2
|
+
//
|
|
3
|
+
// 严格照抄 dsh-plugin-wechat-session/lib/client.js:47-60 与 :1359-1364 的装载骨架。
|
|
4
|
+
// 只声明 inject = ['locale'],其余全部使用原生 document / fetch,不依赖 React,
|
|
5
|
+
// 避免 require('react') 失败。所有 observer 与事件监听集中在单个 ctx.effect 里
|
|
6
|
+
// 注册与撤销,容器自持、不做 DOM 改写、不干扰页面 React reconciliation。
|
|
7
|
+
//
|
|
8
|
+
// 所有 UI 文案中文,代码与注释禁用 emoji。
|
|
9
|
+
|
|
10
|
+
(function (root) {
|
|
11
|
+
if (!root) return;
|
|
12
|
+
if (!root.__ModuleLoader__ || typeof root.__ModuleLoader__.load !== 'function') return;
|
|
13
|
+
|
|
14
|
+
root.__ModuleLoader__.load({
|
|
15
|
+
id: 'dsh-plugin-yanyan-update',
|
|
16
|
+
factory: (require) => {
|
|
17
|
+
var module = { exports: {} };
|
|
18
|
+
var exports = module.exports;
|
|
19
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
20
|
+
|
|
21
|
+
var NS = 'yanyan-update';
|
|
22
|
+
var BASE = '/__dsh-plugin-yanyan-update';
|
|
23
|
+
|
|
24
|
+
// zh 为 key 源,en 键集完整对照。
|
|
25
|
+
var zh = {
|
|
26
|
+
check: '检查更新',
|
|
27
|
+
checking: '检查中…',
|
|
28
|
+
noUpdates: '没有需要更新的插件',
|
|
29
|
+
updatesTitle: '可更新的插件',
|
|
30
|
+
update: '更新',
|
|
31
|
+
updating: '更新中…',
|
|
32
|
+
updated: '已更新',
|
|
33
|
+
failed: '失败',
|
|
34
|
+
localNoGit: '本地源码,无法自动更新',
|
|
35
|
+
fetchFailed: '检查失败,请重试',
|
|
36
|
+
githubUnsupported: '该来源暂不支持一键更新',
|
|
37
|
+
close: '关闭',
|
|
38
|
+
refresh: '刷新',
|
|
39
|
+
restartHint: '更新完成,重启 DSH 服务后生效',
|
|
40
|
+
};
|
|
41
|
+
var en = {
|
|
42
|
+
check: 'Check updates',
|
|
43
|
+
checking: 'Checking…',
|
|
44
|
+
noUpdates: 'No plugins need updating',
|
|
45
|
+
updatesTitle: 'Updatable plugins',
|
|
46
|
+
update: 'Update',
|
|
47
|
+
updating: 'Updating…',
|
|
48
|
+
updated: 'Updated',
|
|
49
|
+
failed: 'Failed',
|
|
50
|
+
localNoGit: 'Local source, cannot auto-update',
|
|
51
|
+
fetchFailed: 'Check failed, please retry',
|
|
52
|
+
githubUnsupported: 'This source does not support one-click update',
|
|
53
|
+
close: 'Close',
|
|
54
|
+
refresh: 'Refresh',
|
|
55
|
+
restartHint: 'Updated. Restart the DSH service to apply.',
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
var CSS = [
|
|
59
|
+
'.yyup-root{position:relative;display:inline-flex;align-items:center;margin-left:8px;font-family:inherit;vertical-align:middle;}',
|
|
60
|
+
// 主按钮填充严格用主按钮三件套,带回退色。
|
|
61
|
+
'.yyup-main{background:var(--dsw-alias-button-primary-fill,#4f46e5);color:var(--dsw-alias-label-primary-foreground,#fff);border:0;border-radius:6px;padding:4px 12px;font-size:12px;line-height:1.6;cursor:pointer;}',
|
|
62
|
+
'.yyup-main:hover{background:var(--dsw-alias-button-primary-hover,#4338ca);}',
|
|
63
|
+
'.yyup-main:disabled{opacity:.6;cursor:default;}',
|
|
64
|
+
'.yyup-panel{position:absolute;top:calc(100% + 6px);right:0;z-index:50;width:340px;max-width:80vw;box-sizing:border-box;background:var(--yyup-panel-bg,#ffffff);color:var(--yyup-panel-fg,#374151);border:1px solid var(--yyup-panel-border,#e5e7eb);border-radius:10px;box-shadow:0 8px 24px rgba(0,0,0,.18);padding:10px;font-size:12px;}',
|
|
65
|
+
'.yyup-head{font-weight:600;margin-bottom:8px;color:var(--yyup-head-fg,#111827);}',
|
|
66
|
+
'.yyup-list{list-style:none;margin:0;padding:0;max-height:260px;overflow:auto;}',
|
|
67
|
+
'.yyup-row{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 2px;border-bottom:1px solid var(--yyup-panel-border,#f3f4f6);}',
|
|
68
|
+
'.yyup-row-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}',
|
|
69
|
+
'.yyup-row-btn{background:var(--dsw-alias-button-primary-fill,#4f46e5);color:var(--dsw-alias-label-primary-foreground,#fff);border:0;border-radius:5px;padding:2px 10px;font-size:12px;cursor:pointer;flex:none;}',
|
|
70
|
+
'.yyup-row-btn:hover{background:var(--dsw-alias-button-primary-hover,#4338ca);}',
|
|
71
|
+
'.yyup-row-btn:disabled{opacity:.6;cursor:default;}',
|
|
72
|
+
'.yyup-empty{padding:10px 2px;color:#6b7280;}',
|
|
73
|
+
'.yyup-hint{margin-top:8px;color:#b45309;}',
|
|
74
|
+
'.yyup-foot{display:flex;justify-content:flex-end;gap:8px;margin-top:10px;}',
|
|
75
|
+
'.yyup-ghost{background:transparent;border:1px solid var(--yyup-panel-border,#d1d5db);border-radius:6px;padding:3px 10px;font-size:12px;cursor:pointer;color:inherit;}',
|
|
76
|
+
'.yyup-ghost:hover{background:var(--yyup-panel-border,#f3f4f6);}',
|
|
77
|
+
].join('\n');
|
|
78
|
+
|
|
79
|
+
var inject = ['locale'];
|
|
80
|
+
|
|
81
|
+
function apply(ctx) {
|
|
82
|
+
var disposeLocale = function () {};
|
|
83
|
+
var tr = function (k) { return zh[k] || k; };
|
|
84
|
+
try {
|
|
85
|
+
var r = ctx.locale.register(NS, { zh: zh, en: en });
|
|
86
|
+
if (typeof r === 'function') disposeLocale = r;
|
|
87
|
+
tr = ctx.locale.bind(NS);
|
|
88
|
+
} catch (e) {
|
|
89
|
+
// locale 服务异常时退化为中文默认字典,不影响工具条核心能力
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// 容器与关键部件引用,供各处理函数共享。
|
|
93
|
+
var container = null;
|
|
94
|
+
var mainBtn = null;
|
|
95
|
+
var panel = null;
|
|
96
|
+
var list = null;
|
|
97
|
+
var hint = null;
|
|
98
|
+
var refreshBtn = null;
|
|
99
|
+
var closeBtn = null;
|
|
100
|
+
var busy = false;
|
|
101
|
+
var ensureTimer = null;
|
|
102
|
+
var observer = null;
|
|
103
|
+
|
|
104
|
+
function seat() {
|
|
105
|
+
try {
|
|
106
|
+
var group = document.querySelector('[data-plugin-panel] [data-plugin-group="bundles"]');
|
|
107
|
+
if (!group) return null;
|
|
108
|
+
return group.firstElementChild || null; // 标题行元素
|
|
109
|
+
} catch (e) {
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function buildContainer() {
|
|
115
|
+
var c = document.createElement('div');
|
|
116
|
+
c.setAttribute('data-dsh-plugin', 'yanyan-update');
|
|
117
|
+
c.setAttribute('data-dsh-part', 'update-toolbar');
|
|
118
|
+
c.setAttribute('data-yanyan-update-toolbar', '');
|
|
119
|
+
c.className = 'yyup-root';
|
|
120
|
+
c.setAttribute('role', 'group');
|
|
121
|
+
|
|
122
|
+
var style = document.createElement('style');
|
|
123
|
+
style.setAttribute('data-yyup-style', '');
|
|
124
|
+
style.textContent = CSS;
|
|
125
|
+
c.appendChild(style);
|
|
126
|
+
|
|
127
|
+
mainBtn = document.createElement('button');
|
|
128
|
+
mainBtn.type = 'button';
|
|
129
|
+
mainBtn.className = 'yyup-main';
|
|
130
|
+
mainBtn.setAttribute('data-update-check', '');
|
|
131
|
+
mainBtn.setAttribute('aria-haspopup', 'true');
|
|
132
|
+
mainBtn.setAttribute('aria-expanded', 'false');
|
|
133
|
+
mainBtn.setAttribute('aria-controls', 'yyup-panel');
|
|
134
|
+
mainBtn.textContent = tr('check');
|
|
135
|
+
c.appendChild(mainBtn);
|
|
136
|
+
|
|
137
|
+
panel = document.createElement('div');
|
|
138
|
+
panel.className = 'yyup-panel';
|
|
139
|
+
panel.id = 'yyup-panel';
|
|
140
|
+
panel.setAttribute('role', 'region');
|
|
141
|
+
panel.setAttribute('aria-label', tr('updatesTitle'));
|
|
142
|
+
panel.style.display = 'none';
|
|
143
|
+
|
|
144
|
+
var head = document.createElement('div');
|
|
145
|
+
head.className = 'yyup-head';
|
|
146
|
+
head.textContent = tr('updatesTitle');
|
|
147
|
+
panel.appendChild(head);
|
|
148
|
+
|
|
149
|
+
list = document.createElement('ul');
|
|
150
|
+
list.className = 'yyup-list';
|
|
151
|
+
panel.appendChild(list);
|
|
152
|
+
|
|
153
|
+
hint = document.createElement('div');
|
|
154
|
+
hint.className = 'yyup-hint';
|
|
155
|
+
hint.style.display = 'none';
|
|
156
|
+
panel.appendChild(hint);
|
|
157
|
+
|
|
158
|
+
var foot = document.createElement('div');
|
|
159
|
+
foot.className = 'yyup-foot';
|
|
160
|
+
refreshBtn = document.createElement('button');
|
|
161
|
+
refreshBtn.type = 'button';
|
|
162
|
+
refreshBtn.className = 'yyup-ghost';
|
|
163
|
+
refreshBtn.setAttribute('data-update-refresh', '');
|
|
164
|
+
refreshBtn.textContent = tr('refresh');
|
|
165
|
+
foot.appendChild(refreshBtn);
|
|
166
|
+
closeBtn = document.createElement('button');
|
|
167
|
+
closeBtn.type = 'button';
|
|
168
|
+
closeBtn.className = 'yyup-ghost';
|
|
169
|
+
closeBtn.setAttribute('data-update-close', '');
|
|
170
|
+
closeBtn.textContent = tr('close');
|
|
171
|
+
foot.appendChild(closeBtn);
|
|
172
|
+
panel.appendChild(foot);
|
|
173
|
+
|
|
174
|
+
c.appendChild(panel);
|
|
175
|
+
return c;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
function openPanel() {
|
|
179
|
+
if (!panel || !mainBtn) return;
|
|
180
|
+
panel.style.display = 'block';
|
|
181
|
+
mainBtn.setAttribute('aria-expanded', 'true');
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
function closePanel() {
|
|
185
|
+
if (!panel || !mainBtn) return;
|
|
186
|
+
panel.style.display = 'none';
|
|
187
|
+
mainBtn.setAttribute('aria-expanded', 'false');
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
function clearHint() {
|
|
191
|
+
if (!hint) return;
|
|
192
|
+
hint.textContent = '';
|
|
193
|
+
hint.style.display = 'none';
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function showHint(text) {
|
|
197
|
+
if (!hint) return;
|
|
198
|
+
hint.textContent = text;
|
|
199
|
+
hint.style.display = 'block';
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
function setButtonLabel(text) {
|
|
203
|
+
if (mainBtn) mainBtn.textContent = text;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
function renderMessage(text) {
|
|
207
|
+
if (!list) return;
|
|
208
|
+
list.textContent = '';
|
|
209
|
+
var li = document.createElement('li');
|
|
210
|
+
li.className = 'yyup-empty';
|
|
211
|
+
li.textContent = text;
|
|
212
|
+
list.appendChild(li);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
function renderUpdates(updates) {
|
|
216
|
+
if (!list) return;
|
|
217
|
+
list.textContent = '';
|
|
218
|
+
if (!updates || !updates.length) {
|
|
219
|
+
renderMessage(tr('noUpdates'));
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
for (var i = 0; i < updates.length; i++) {
|
|
223
|
+
var row = updates[i] || {};
|
|
224
|
+
var id = String(row.id || '');
|
|
225
|
+
var li = document.createElement('li');
|
|
226
|
+
li.className = 'yyup-row';
|
|
227
|
+
li.setAttribute('data-yanyan-update-row', id);
|
|
228
|
+
var label = document.createElement('span');
|
|
229
|
+
label.className = 'yyup-row-label';
|
|
230
|
+
label.textContent = id + ' ' + String(row.current || '') + ' → ' + String(row.latest || '');
|
|
231
|
+
li.appendChild(label);
|
|
232
|
+
var b = document.createElement('button');
|
|
233
|
+
b.type = 'button';
|
|
234
|
+
b.className = 'yyup-row-btn';
|
|
235
|
+
b.setAttribute('data-update-row', id);
|
|
236
|
+
b.textContent = tr('update');
|
|
237
|
+
li.appendChild(b);
|
|
238
|
+
list.appendChild(li);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
function post(pathname, body) {
|
|
243
|
+
return fetch(pathname, {
|
|
244
|
+
method: 'POST',
|
|
245
|
+
headers: { 'content-type': 'application/json' },
|
|
246
|
+
body: JSON.stringify(body || {}),
|
|
247
|
+
}).then(function (resp) {
|
|
248
|
+
return resp.json();
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
function runCheck() {
|
|
253
|
+
if (busy) return;
|
|
254
|
+
busy = true;
|
|
255
|
+
if (mainBtn) {
|
|
256
|
+
mainBtn.disabled = true;
|
|
257
|
+
mainBtn.setAttribute('aria-busy', 'true');
|
|
258
|
+
setButtonLabel(tr('checking'));
|
|
259
|
+
}
|
|
260
|
+
clearHint();
|
|
261
|
+
openPanel();
|
|
262
|
+
renderMessage(tr('checking'));
|
|
263
|
+
post(BASE + '/check', {}).then(function (data) {
|
|
264
|
+
if (!data || data.ok !== true) throw new Error('invalid-response');
|
|
265
|
+
renderUpdates(data.updates);
|
|
266
|
+
}).catch(function () {
|
|
267
|
+
renderMessage(tr('fetchFailed'));
|
|
268
|
+
}).then(function () {
|
|
269
|
+
busy = false;
|
|
270
|
+
if (mainBtn) {
|
|
271
|
+
mainBtn.disabled = false;
|
|
272
|
+
mainBtn.removeAttribute('aria-busy');
|
|
273
|
+
setButtonLabel(tr('check'));
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
function runUpdate(id, li, btn) {
|
|
279
|
+
if (!id || btn.disabled) return;
|
|
280
|
+
btn.disabled = true;
|
|
281
|
+
btn.textContent = tr('updating');
|
|
282
|
+
// 每行独立 try/catch:单条失败不影响其它行。
|
|
283
|
+
post(BASE + '/update', { id: id }).then(function (data) {
|
|
284
|
+
if (data && data.ok === true && data.updated === true) {
|
|
285
|
+
if (li) li.setAttribute('data-yanyan-update-state', 'updated');
|
|
286
|
+
btn.textContent = tr('updated');
|
|
287
|
+
// host 会返回可读中文结果(含「已即时生效 / 重启后生效」),优先展示。
|
|
288
|
+
showHint((data && data.message) || tr('restartHint'));
|
|
289
|
+
} else {
|
|
290
|
+
var msg = (data && data.message) || tr('failed');
|
|
291
|
+
btn.textContent = tr('failed');
|
|
292
|
+
btn.disabled = false;
|
|
293
|
+
// 失败结果(含「已装回原版本 / 需手动重装」)必须让用户看见,
|
|
294
|
+
// 不能只塞进行 title。
|
|
295
|
+
showHint(String(msg));
|
|
296
|
+
if (li) li.setAttribute('title', String(msg));
|
|
297
|
+
}
|
|
298
|
+
}).catch(function (error) {
|
|
299
|
+
var msg = (error && error.message) || tr('failed');
|
|
300
|
+
btn.textContent = msg;
|
|
301
|
+
btn.disabled = false;
|
|
302
|
+
showHint(String(msg));
|
|
303
|
+
if (li) li.setAttribute('title', String(msg));
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
function onClick(e) {
|
|
308
|
+
var t = e.target;
|
|
309
|
+
var btn = t && t.closest ? t.closest('button') : null;
|
|
310
|
+
if (!btn) return;
|
|
311
|
+
if (btn.hasAttribute('data-update-check') || btn.hasAttribute('data-update-refresh')) {
|
|
312
|
+
runCheck();
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
if (btn.hasAttribute('data-update-close')) {
|
|
316
|
+
closePanel();
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
var rowId = btn.getAttribute('data-update-row');
|
|
320
|
+
if (rowId) runUpdate(rowId, btn.parentNode, btn);
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
function onKey(e) {
|
|
324
|
+
if (e.key === 'Escape' || e.keyCode === 27) closePanel();
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
function onOutside(e) {
|
|
328
|
+
if (!container || !container.contains(e.target)) closePanel();
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
// 座位消失则摘除容器,重新出现则重新 append;重复 apply 通过标记去重。
|
|
332
|
+
function ensureMounted() {
|
|
333
|
+
var s = seat();
|
|
334
|
+
if (!s) {
|
|
335
|
+
if (container && container.parentNode) {
|
|
336
|
+
try { container.parentNode.removeChild(container); } catch (e) {}
|
|
337
|
+
}
|
|
338
|
+
closePanel();
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
341
|
+
if (!container) {
|
|
342
|
+
var stale = document.querySelector('[data-yanyan-update-toolbar]');
|
|
343
|
+
if (stale && stale.parentNode) {
|
|
344
|
+
try { stale.parentNode.removeChild(stale); } catch (e) {}
|
|
345
|
+
}
|
|
346
|
+
container = buildContainer();
|
|
347
|
+
try { container.addEventListener('click', onClick); } catch (e) {}
|
|
348
|
+
}
|
|
349
|
+
if (container.parentNode !== s) {
|
|
350
|
+
try { s.appendChild(container); } catch (e) {}
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
function scheduleEnsure() {
|
|
355
|
+
if (ensureTimer !== null) return;
|
|
356
|
+
ensureTimer = setTimeout(function () {
|
|
357
|
+
ensureTimer = null;
|
|
358
|
+
ensureMounted();
|
|
359
|
+
}, 16);
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
// 所有 observer / 事件监听统一在这个 effect 内注册,并在清理函数里统一撤销。
|
|
363
|
+
ctx.effect(function () {
|
|
364
|
+
ensureMounted();
|
|
365
|
+
try {
|
|
366
|
+
observer = new MutationObserver(function () { scheduleEnsure(); });
|
|
367
|
+
observer.observe(document.body, { childList: true, subtree: true });
|
|
368
|
+
} catch (e) {
|
|
369
|
+
observer = null;
|
|
370
|
+
}
|
|
371
|
+
try { document.addEventListener('keydown', onKey); } catch (e) {}
|
|
372
|
+
try { document.addEventListener('click', onOutside, true); } catch (e) {}
|
|
373
|
+
|
|
374
|
+
return function () {
|
|
375
|
+
try { if (observer) observer.disconnect(); } catch (e) {}
|
|
376
|
+
observer = null;
|
|
377
|
+
if (ensureTimer !== null) {
|
|
378
|
+
try { clearTimeout(ensureTimer); } catch (e) {}
|
|
379
|
+
ensureTimer = null;
|
|
380
|
+
}
|
|
381
|
+
try { document.removeEventListener('keydown', onKey); } catch (e) {}
|
|
382
|
+
try { document.removeEventListener('click', onOutside, true); } catch (e) {}
|
|
383
|
+
if (container) {
|
|
384
|
+
try { container.removeEventListener('click', onClick); } catch (e) {}
|
|
385
|
+
if (container.parentNode) {
|
|
386
|
+
try { container.parentNode.removeChild(container); } catch (e) {}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
try { disposeLocale(); } catch (e) {}
|
|
390
|
+
container = null;
|
|
391
|
+
};
|
|
392
|
+
}, 'yanyan-update: toolbar');
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
exports.inject = inject;
|
|
396
|
+
exports.apply = apply;
|
|
397
|
+
return module.exports;
|
|
398
|
+
},
|
|
399
|
+
});
|
|
400
|
+
})(typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : null);
|