Files
openclaw/skills/lampa-plugin-builder/references/plugin-template.js
2026-03-03 01:43:47 +03:00

37 lines
1.1 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
(function () {
'use strict';
var FLAG = 'lampa_plugin_template_started';
function start() {
if (window[FLAG]) return;
window[FLAG] = true;
// TODO: основная логика плагина
// Пример подписки на события:
// Lampa.Listener.follow('app', function (e) {
// if (e.type === 'ready') {
// console.log('[lampa-plugin] app ready');
// }
// });
// Пример расширения карточки (осторожно с переопределениями):
// if (window.Lampa && Lampa.Card && Lampa.Card.prototype) {
// var original = Lampa.Card.prototype.build;
// if (typeof original === 'function') {
// Lampa.Card.prototype.build = function () {
// original.apply(this, arguments);
// // TODO: post-build логика
// };
// }
// }
}
if (window.appready) {
start();
} else if (window.Lampa && Lampa.Listener) {
Lampa.Listener.follow('app', function (event) {
if (event.type === 'ready') start();
});
}
})();