1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-11-26 05:32:59 +00:00

Fix new copy driver on pages without a copy button

This commit is contained in:
Starbeamrainbowlabs 2017-12-13 09:48:29 +00:00
parent 0d6e9d4c57
commit 582eda24d7
Signed by: sbrl
GPG key ID: 1BE5172E637709C2
3 changed files with 3 additions and 2 deletions

View file

@ -5375,8 +5375,8 @@ register_module([
// Add the snippet that copies the embed markdown code to the clipboard // Add the snippet that copies the embed markdown code to the clipboard
page_renderer::AddJSSnippet('window.addEventListener("load", function(event) { page_renderer::AddJSSnippet('window.addEventListener("load", function(event) {
console.log("initialising copy driver");
let button = document.querySelector(".short-embed-markdown-button"); let button = document.querySelector(".short-embed-markdown-button");
if(button == null) return;
button.addEventListener("click", function(inner_event) { button.addEventListener("click", function(inner_event) {
let input = document.querySelector(".short-embed-markdown-code"); let input = document.querySelector(".short-embed-markdown-code");
input.select(); input.select();

View file

@ -122,7 +122,7 @@
"author": "Starbeamrainbowlabs", "author": "Starbeamrainbowlabs",
"description": "Adds the ability to upload files to Pepperminty Wiki. Uploaded files act as pages and have the special 'File\/' prefix.", "description": "Adds the ability to upload files to Pepperminty Wiki. Uploaded files act as pages and have the special 'File\/' prefix.",
"id": "feature-upload", "id": "feature-upload",
"lastupdate": 1513119449, "lastupdate": 1513158485,
"optional": false "optional": false
}, },
{ {

View file

@ -532,6 +532,7 @@ register_module([
// Add the snippet that copies the embed markdown code to the clipboard // Add the snippet that copies the embed markdown code to the clipboard
page_renderer::AddJSSnippet('window.addEventListener("load", function(event) { page_renderer::AddJSSnippet('window.addEventListener("load", function(event) {
let button = document.querySelector(".short-embed-markdown-button"); let button = document.querySelector(".short-embed-markdown-button");
if(button == null) return;
button.addEventListener("click", function(inner_event) { button.addEventListener("click", function(inner_event) {
let input = document.querySelector(".short-embed-markdown-code"); let input = document.querySelector(".short-embed-markdown-code");
input.select(); input.select();