2019-05-22 01:22:58 +00:00
|
|
|
// Search button function
|
2019-08-10 14:39:23 +00:00
|
|
|
document.getElementById('searchClick').addEventListener('click', () => {
|
2019-06-07 09:09:51 +00:00
|
|
|
searchForm.submit()
|
|
|
|
}, false)
|
2019-06-01 09:21:51 +00:00
|
|
|
|
2019-08-10 14:39:23 +00:00
|
|
|
document.getElementById('searchClickMob').addEventListener('click', () => {
|
|
|
|
searchFormMob.submit()
|
2019-06-01 09:21:51 +00:00
|
|
|
}, false)
|
2018-09-29 09:07:34 +00:00
|
|
|
|
2019-05-22 01:22:58 +00:00
|
|
|
/*
|
2019-08-25 06:37:58 +00:00
|
|
|
* Copy button
|
2019-05-22 01:22:58 +00:00
|
|
|
* Following functions only execute after
|
|
|
|
* the 'document' is ready or
|
|
|
|
* <script src> is executed.
|
|
|
|
*/
|
|
|
|
document.addEventListener('DOMContentLoaded', () => {
|
2019-06-07 09:09:51 +00:00
|
|
|
|
2019-05-22 01:22:58 +00:00
|
|
|
// Copy button
|
|
|
|
const copyCode = new ClipboardJS('.copy-button', {
|
|
|
|
target: (trigger) => {
|
|
|
|
return trigger.previousElementSibling
|
|
|
|
}
|
|
|
|
})
|
2019-05-21 01:19:30 +00:00
|
|
|
|
2019-05-22 01:22:58 +00:00
|
|
|
copyCode.on('success', (event) => {
|
|
|
|
event.clearSelection()
|
|
|
|
event.trigger.textContent = 'Copied'
|
|
|
|
window.setTimeout(() => {
|
|
|
|
event.trigger.textContent = 'Copy'
|
|
|
|
}, 2000)
|
2018-10-25 09:03:38 +00:00
|
|
|
})
|
2019-05-21 04:42:30 +00:00
|
|
|
|
2019-05-22 01:22:58 +00:00
|
|
|
copyCode.on('error', (event) => {
|
|
|
|
event.trigger.textContent = 'Press "Ctrl + C" to copy'
|
|
|
|
window.setTimeout(() => {
|
|
|
|
event.trigger.textContent = 'Copy'
|
|
|
|
}, 2000)
|
|
|
|
})
|
2019-05-25 14:28:52 +00:00
|
|
|
}, false)
|