generated from perst-one/kintone-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from perst-one/develop
Develop
- Loading branch information
Showing
13 changed files
with
97 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
.po-clip-target:hover { | ||
cursor: copy; | ||
} | ||
|
||
.po-clip-target.copied { | ||
cursor: inherit; | ||
animation: copied 1s; | ||
} | ||
|
||
@keyframes copied { | ||
0% { | ||
background-color: rgba(0, 255, 0, 0.25); | ||
} | ||
|
||
100% { | ||
background-color: inherit; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ | |
|
||
.kintoneplugin-input-text { | ||
width: 20em; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +0,0 @@ | ||
.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; | ||
} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +0,0 @@ | ||
.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; | ||
} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
<section class="settings"> | ||
<h2 class="settings-heading">Settings for kintone-sample-plugin</h2> | ||
<p class="kintoneplugin-desc">This message is displayed on the app page after the app has been updated.</p> | ||
<h2 class="settings-heading">設定画面</h2> | ||
<p class="kintoneplugin-desc">プラグインの設定画面です</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 for="selector"> | ||
CSSセレクタ: | ||
<input type="text" name="selector" class="js-text-selector 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> | ||
<button type="button" class="js-cancel-button kintoneplugin-button-dialog-cancel">キャンセル</button> | ||
<button class="kintoneplugin-button-dialog-ok">保存</button> | ||
</p> | ||
</form> | ||
</section> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,30 @@ | ||
const ClipboardJS = require('clipboard'); | ||
|
||
jQuery.noConflict(); | ||
|
||
(function($, PLUGIN_ID) { | ||
kintone.events.on('app.record.index.show', function() { | ||
const config = kintone.plugin.app.getConfig(PLUGIN_ID); | ||
const main = () => { | ||
setTimeout(() => { | ||
const className = 'po-clip-target'; | ||
const {selector} = kintone.plugin.app.getConfig(PLUGIN_ID); | ||
|
||
const spaceElement = kintone.app.getHeaderSpaceElement(); | ||
const fragment = document.createDocumentFragment(); | ||
const headingEl = document.createElement('h3'); | ||
const messageEl = document.createElement('p'); | ||
for (const element of document.querySelectorAll(selector)) { | ||
if (!element.classList.contains(className)) { | ||
element.classList.add(className); | ||
element.addEventListener('click', () => element.classList.add('copied')); | ||
element.addEventListener('animationend', () => element.classList.remove('copied')); | ||
|
||
messageEl.classList.add('plugin-space-message'); | ||
messageEl.textContent = config.message; | ||
headingEl.classList.add('plugin-space-heading'); | ||
headingEl.textContent = 'Hello kintone plugin desktop!'; | ||
new ClipboardJS(element, { | ||
text: (trigger) => trigger.innerText, | ||
}); | ||
} | ||
} | ||
}, 0); | ||
}; | ||
|
||
fragment.appendChild(headingEl); | ||
fragment.appendChild(messageEl); | ||
spaceElement.appendChild(fragment); | ||
}); | ||
kintone.events.on('app.record.index.show', main); | ||
kintone.events.on('app.record.index.edit.submit.success', main); | ||
kintone.events.on('app.record.detail.show', main); | ||
kintone.events.on('app.record.create.show', main); | ||
kintone.events.on('app.record.edit.show', main); | ||
})(jQuery, kintone.$PLUGIN_ID); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,5 @@ | ||
jQuery.noConflict(); | ||
|
||
(function($, PLUGIN_ID) { | ||
kintone.events.on('mobile.app.record.index.show', function() { | ||
const config = kintone.plugin.app.getConfig(PLUGIN_ID); | ||
(function(_$, _PLUGIN_ID) { | ||
|
||
const spaceElement = kintone.mobile.app.getHeaderSpaceElement(); | ||
const fragment = document.createDocumentFragment(); | ||
const headingEl = document.createElement('h3'); | ||
const messageEl = document.createElement('p'); | ||
|
||
messageEl.classList.add('plugin-space-message'); | ||
messageEl.textContent = config.message; | ||
headingEl.classList.add('plugin-space-heading'); | ||
headingEl.textContent = 'Hello kintone plugin mobile!'; | ||
|
||
fragment.appendChild(headingEl); | ||
fragment.appendChild(messageEl); | ||
spaceElement.appendChild(fragment); | ||
}); | ||
})(jQuery, kintone.$PLUGIN_ID); |