プラグイン初期作成
This commit is contained in:
13
data-fetch-pluging/.eslintrc.js
Normal file
13
data-fetch-pluging/.eslintrc.js
Normal file
@@ -0,0 +1,13 @@
|
||||
module.exports = {
|
||||
extends: [
|
||||
'@cybozu/eslint-config/globals/kintone.js',
|
||||
'@cybozu/eslint-config/lib/base.js',
|
||||
'@cybozu/eslint-config/lib/kintone.js',
|
||||
'@cybozu/eslint-config/lib/prettier.js',
|
||||
],
|
||||
rules: {
|
||||
'prettier/prettier': ['error', { singleQuote: true }],
|
||||
'space-before-function-paren': 0,
|
||||
'object-curly-spacing': 0,
|
||||
},
|
||||
};
|
||||
15
data-fetch-pluging/.vscode/launch.json
vendored
Normal file
15
data-fetch-pluging/.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
// IntelliSense を使用して利用可能な属性を学べます。
|
||||
// 既存の属性の説明をホバーして表示します。
|
||||
// 詳細情報は次を確認してください: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "chrome",
|
||||
"request": "launch",
|
||||
"name": "localhost に対して Chrome を起動する",
|
||||
"url": "http://localhost:8080",
|
||||
"webRoot": "${workspaceFolder}"
|
||||
}
|
||||
]
|
||||
}
|
||||
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"
|
||||
]
|
||||
}
|
||||
}
|
||||
4803
data-fetch-pluging/package-lock.json
generated
Normal file
4803
data-fetch-pluging/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
16
data-fetch-pluging/package.json
Normal file
16
data-fetch-pluging/package.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "data-fetch-pluging",
|
||||
"version": "0.1.1",
|
||||
"scripts": {
|
||||
"build": "kintone-plugin-packer --ppk private.ppk --out dist/plugin.zip src",
|
||||
"develop": "npm run build -- --watch",
|
||||
"lint": "eslint src",
|
||||
"start": "npm run develop",
|
||||
"test":"kintone-plugin-packer --help"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@cybozu/eslint-config": "^23.0.0",
|
||||
"@kintone/plugin-packer": "^8.1.3",
|
||||
"eslint": "^8.57.0"
|
||||
}
|
||||
}
|
||||
15
data-fetch-pluging/private.ppk
Normal file
15
data-fetch-pluging/private.ppk
Normal file
@@ -0,0 +1,15 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIICXQIBAAKBgQCF7z/zsYmoe+L1AYTeCYvy9yBXlsXOniTzox6svsXunibVP3y+
|
||||
f1jEwu2cnTdp/GABOzsVHNSrYGedRDlwG93Y8qxe7qNKLZAFL6ujmJ0FJixuYrh4
|
||||
xvaWR6SlKIbws+803qAyE6dUN893xeZeJdWGelZNBsCZu8Nwmi28k1flzQIDAQAB
|
||||
AoGAbWJchJZ2qtejIB5BeWWqmqAiFebZXkniO+j44HReCue3J2pWYu52fRwGG2Z7
|
||||
H2AyuE67jh6hweVWOibCEkFwCM+MwkSpKNRyFqJwdzZGoMm/oT67dDGYELrmNCx/
|
||||
9G5DdLgLXsA2dAANxTybaK8wg123Hhrh7NwJDETn9OC+uzECQQDeJTq4OSK9qUw9
|
||||
RCpgijpVdnzc4hC0CNjKe/+z8bQOPVcX7zLcggwX/7i2UmNxBxfYFrCN8XIGJNGN
|
||||
VXMpUdCjAkEAmliRAdgAJvoMvaS+gCcJt9tU18F2aunnGudpdwMWDFYdsnztLSJQ
|
||||
uLPsPQM0TJJYwXWZ+akQuReqXeKg4WgmzwJBAMZAg38VvqN1C81BoHA37IeJDzYx
|
||||
qqaBnrhWoYV+GCr9I1UA7GtOxGxGlBpivMyKgAUher+y0wgYo8t2jyg5E/ECQCRH
|
||||
JO42AvMmWtBIZK5ifppEZ1C/HEJM8BEWy2c5xnjn1NsbGfQ92JNRVvmQQz6sN0hh
|
||||
h+tynYej1Ft05TOV82kCQQCDd0/JtINW3Myj2nWIe8c9IjsBUtNOkaCa13tGOzwJ
|
||||
3G8Bg0GzdVSC73OnEaguC72kBvyGO4enUFkOq6p6kmFQ
|
||||
-----END RSA PRIVATE KEY-----
|
||||
15
data-fetch-pluging/scripts/npm-start.js
Normal file
15
data-fetch-pluging/scripts/npm-start.js
Normal file
@@ -0,0 +1,15 @@
|
||||
"use strict";
|
||||
const runAll = require("npm-run-all");
|
||||
|
||||
runAll(["develop", "upload"], {
|
||||
parallel: true,
|
||||
stdout: process.stdout,
|
||||
stdin: process.stdin
|
||||
}).catch(({results}) => {
|
||||
results
|
||||
.filter(({code}) => code)
|
||||
.forEach(({name}) => {
|
||||
console.log(`"npm run ${name}" was failed`);
|
||||
})
|
||||
;
|
||||
});
|
||||
665
data-fetch-pluging/src/css/51-modern-default.css
Normal file
665
data-fetch-pluging/src/css/51-modern-default.css
Normal file
File diff suppressed because one or more lines are too long
7
data-fetch-pluging/src/css/config.css
Normal file
7
data-fetch-pluging/src/css/config.css
Normal file
@@ -0,0 +1,7 @@
|
||||
.settings-heading {
|
||||
padding: 1em 0;
|
||||
}
|
||||
|
||||
.kintoneplugin-input-text {
|
||||
width: 20em;
|
||||
}
|
||||
10
data-fetch-pluging/src/css/desktop.css
Normal file
10
data-fetch-pluging/src/css/desktop.css
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/src/css/mobile.css
Normal file
10
data-fetch-pluging/src/css/mobile.css
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/src/html/config.html
Normal file
16
data-fetch-pluging/src/html/config.html
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/src/image/icon.png
Normal file
BIN
data-fetch-pluging/src/image/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 110 B |
25
data-fetch-pluging/src/js/config.js
Normal file
25
data-fetch-pluging/src/js/config.js
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);
|
||||
22
data-fetch-pluging/src/js/desktop.js
Normal file
22
data-fetch-pluging/src/js/desktop.js
Normal file
@@ -0,0 +1,22 @@
|
||||
(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);
|
||||
22
data-fetch-pluging/src/js/mobile.js
Normal file
22
data-fetch-pluging/src/js/mobile.js
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/src/manifest.json
Normal file
45
data-fetch-pluging/src/manifest.json
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