プラグイン初期作成

This commit is contained in:
2025-01-12 17:40:08 +09:00
commit 6d2bc0f2aa
59 changed files with 9263 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
(function (PLUGIN_ID) {
const formEl = document.querySelector('.js-submit-settings');
const cancelButtonEl = document.querySelector('.js-cancel-button');
const messageEl = document.querySelector('.js-text-message');
if (!(formEl && cancelButtonEl && messageEl)) {
throw new Error('Required elements do not exist.');
}
const config = kintone.plugin.app.getConfig(PLUGIN_ID);
if (config.message) {
messageEl.value = config.message;
}
formEl.addEventListener('submit', (e) => {
e.preventDefault();
kintone.plugin.app.setConfig({ message: messageEl.value }, () => {
alert('The plug-in settings have been saved. Please update the app!');
window.location.href = '../../flow?app=' + kintone.app.getId();
});
});
cancelButtonEl.addEventListener('click', () => {
window.location.href = '../../' + kintone.app.getId() + '/plugin/';
});
})(kintone.$PLUGIN_ID);

View File

@@ -0,0 +1,24 @@
import '../css/desktop.css'
import '../css/51-modern-default.css';
(function (PLUGIN_ID) {
kintone.events.on('app.record.index.show', () => {
const spaceEl = kintone.app.getHeaderSpaceElement();
if (spaceEl === null) {
throw new Error('The header element is unavailable on this page.');
}
const fragment = document.createDocumentFragment();
const headingEl = document.createElement('h3');
const messageEl = document.createElement('p');
const config = kintone.plugin.app.getConfig(PLUGIN_ID);
messageEl.textContent = config.message;
messageEl.classList.add('plugin-space-message');
headingEl.textContent = 'Hello kintone plugin!';
headingEl.classList.add('plugin-space-heading');
fragment.appendChild(headingEl);
fragment.appendChild(messageEl);
spaceEl.appendChild(fragment);
});
})(kintone.$PLUGIN_ID);

View File

@@ -0,0 +1,23 @@
import '../css/mobile.css';
(function (PLUGIN_ID) {
kintone.events.on('mobile.app.record.index.show', () => {
const spaceEl = kintone.mobile.app.getHeaderSpaceElement();
if (spaceEl === null) {
throw new Error('The header element is unavailable on this page.');
}
const fragment = document.createDocumentFragment();
const headingEl = document.createElement('h3');
const messageEl = document.createElement('p');
const config = kintone.plugin.app.getConfig(PLUGIN_ID);
messageEl.textContent = config.message;
messageEl.classList.add('plugin-space-message');
headingEl.textContent = 'Hello kintone plugin!';
headingEl.classList.add('plugin-space-heading');
fragment.appendChild(headingEl);
fragment.appendChild(messageEl);
spaceEl.appendChild(fragment);
});
})(kintone.$PLUGIN_ID);