Created
August 9, 2018 01:27
-
-
Save serinuntius/12b5d1fbad690812cd5538a8b5b62eff to your computer and use it in GitHub Desktop.
ライチのreadyに入れたタスクをtodaystaskに変換してくれるブックマークレット
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
javascript: (() => { | |
const b = document.getElementsByClassName('board')[1]; | |
const t = b.getElementsByClassName('task-card_desc_title'); | |
const tasks = Array.prototype.map.call(t,e => `- ${e.innerText}`); | |
const template = ` | |
*1.今日は何をする予定ですか?*\n | |
${tasks.join('\n')}\n | |
*2.予定より遅延している作業はありますか?*\n\n | |
*3.その他、何か困っていることや伝えたいことはありますか?*\n\n | |
`; | |
function execCopy(string){ | |
var temp = document.createElement('div'); | |
temp.appendChild(document.createElement('pre')).textContent = string; | |
var s = temp.style; | |
s.position = 'fixed'; | |
s.left = '-100%'; | |
document.body.appendChild(temp); | |
document.getSelection().selectAllChildren(temp); | |
var result = document.execCommand('copy'); | |
document.body.removeChild(temp); | |
return result; | |
} | |
execCopy(template); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment