プラグイン初期作成
This commit is contained in:
BIN
data-fetch-pluging/dist/plugin.zip
vendored
Normal file
BIN
data-fetch-pluging/dist/plugin.zip
vendored
Normal file
Binary file not shown.
BIN
data-fetch-pluging/dist/plugin/PUBKEY
vendored
Normal file
BIN
data-fetch-pluging/dist/plugin/PUBKEY
vendored
Normal file
Binary file not shown.
2
data-fetch-pluging/dist/plugin/SIGNATURE
vendored
Normal file
2
data-fetch-pluging/dist/plugin/SIGNATURE
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
n<EFBFBD>mR<10><>ӹE<D3B9><45><EFBFBD>H<EFBFBD>ޥu<DEA5><75><EFBFBD><02><><EFBFBD><EFBFBD>?u<>OL<4F>luG<75><47><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>$v
|
||||
/9R{t<><74>M<>v#>T<>D<EFBFBD>F<EFBFBD>0<EFBFBD><><7F>L<EFBFBD>kC<6B>i!<05>J<EFBFBD><10>o
|
||||
BIN
data-fetch-pluging/dist/plugin/contents.zip
vendored
Normal file
BIN
data-fetch-pluging/dist/plugin/contents.zip
vendored
Normal file
Binary file not shown.
665
data-fetch-pluging/dist/plugin/contents/css/51-modern-default.css
vendored
Normal file
665
data-fetch-pluging/dist/plugin/contents/css/51-modern-default.css
vendored
Normal file
File diff suppressed because one or more lines are too long
7
data-fetch-pluging/dist/plugin/contents/css/config.css
vendored
Normal file
7
data-fetch-pluging/dist/plugin/contents/css/config.css
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
.settings-heading {
|
||||
padding: 1em 0;
|
||||
}
|
||||
|
||||
.kintoneplugin-input-text {
|
||||
width: 20em;
|
||||
}
|
||||
10
data-fetch-pluging/dist/plugin/contents/css/desktop.css
vendored
Normal file
10
data-fetch-pluging/dist/plugin/contents/css/desktop.css
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
.plugin-space-heading {
|
||||
font-size: 1.5rem;
|
||||
margin: 0.8rem;
|
||||
}
|
||||
.plugin-space-message {
|
||||
display: inline-block;
|
||||
font-size: 1.2em;
|
||||
margin: 0.8rem;
|
||||
margin-top: 0;
|
||||
}
|
||||
10
data-fetch-pluging/dist/plugin/contents/css/mobile.css
vendored
Normal file
10
data-fetch-pluging/dist/plugin/contents/css/mobile.css
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
.plugin-space-heading {
|
||||
font-size: 1.5rem;
|
||||
margin: 0.8rem;
|
||||
}
|
||||
.plugin-space-message {
|
||||
display: inline-block;
|
||||
font-size: 1.2em;
|
||||
margin: 0.8rem;
|
||||
margin-top: 0;
|
||||
}
|
||||
16
data-fetch-pluging/dist/plugin/contents/html/config.html
vendored
Normal file
16
data-fetch-pluging/dist/plugin/contents/html/config.html
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
<section class="settings">
|
||||
<h2 class="settings-heading">Settings for data fetch pluging</h2>
|
||||
<p class="kintoneplugin-desc">This message is displayed on the app page after the app has been updated.</p>
|
||||
<form class="js-submit-settings">
|
||||
<p class="kintoneplugin-row">
|
||||
<label for="message">
|
||||
Message:
|
||||
<input type="text" class="js-text-message kintoneplugin-input-text">
|
||||
</label>
|
||||
</p>
|
||||
<p class="kintoneplugin-row">
|
||||
<button type="button" class="js-cancel-button kintoneplugin-button-dialog-cancel">Cancel</button>
|
||||
<button class="kintoneplugin-button-dialog-ok">Save</button>
|
||||
</p>
|
||||
</form>
|
||||
</section>
|
||||
BIN
data-fetch-pluging/dist/plugin/contents/image/icon.png
vendored
Normal file
BIN
data-fetch-pluging/dist/plugin/contents/image/icon.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 110 B |
25
data-fetch-pluging/dist/plugin/contents/js/config.js
vendored
Normal file
25
data-fetch-pluging/dist/plugin/contents/js/config.js
vendored
Normal 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);
|
||||
23
data-fetch-pluging/dist/plugin/contents/js/desktop.js
vendored
Normal file
23
data-fetch-pluging/dist/plugin/contents/js/desktop.js
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
(function (PLUGIN_ID) {
|
||||
kintone.events.on('app.record.index.show', () => {
|
||||
alert('app.record.index.show run by pluging');
|
||||
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);
|
||||
22
data-fetch-pluging/dist/plugin/contents/js/mobile.js
vendored
Normal file
22
data-fetch-pluging/dist/plugin/contents/js/mobile.js
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
(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);
|
||||
45
data-fetch-pluging/dist/plugin/contents/manifest.json
vendored
Normal file
45
data-fetch-pluging/dist/plugin/contents/manifest.json
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/kintone/js-sdk/%40kintone/plugin-manifest-validator%4010.2.0/packages/plugin-manifest-validator/manifest-schema.json",
|
||||
"manifest_version": 1,
|
||||
"version": 2,
|
||||
"type": "APP",
|
||||
"desktop": {
|
||||
"js": [
|
||||
"js/desktop.js"
|
||||
],
|
||||
"css": [
|
||||
"css/51-modern-default.css",
|
||||
"css/desktop.css"
|
||||
]
|
||||
},
|
||||
"icon": "image/icon.png",
|
||||
"config": {
|
||||
"html": "html/config.html",
|
||||
"js": [
|
||||
"js/config.js"
|
||||
],
|
||||
"css": [
|
||||
"css/51-modern-default.css",
|
||||
"css/config.css"
|
||||
],
|
||||
"required_params": [
|
||||
"message"
|
||||
]
|
||||
},
|
||||
"name": {
|
||||
"en": "data fetch pluging",
|
||||
"ja": "データ取得プラグイン"
|
||||
},
|
||||
"description": {
|
||||
"en": "create search data pluging",
|
||||
"ja": "検索結果のデータを生成するプラグインです"
|
||||
},
|
||||
"mobile": {
|
||||
"js": [
|
||||
"js/mobile.js"
|
||||
],
|
||||
"css": [
|
||||
"css/mobile.css"
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user