We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
As I click on Bookmark it this error shows up
and then it is not working as intended and i don't know what to do.
This is the bookmarklet.js code:
bookmarklet.js
const siteUrl = "//127.0.0.1:8000/"; const styleUrl = siteUrl + "static/css/bookmarklet.css"; const minWidth = 250; const minHeight = 250; // load CSS var head = document.getElementsByTagName("head")[0]; // Get HTML head element var link = document.createElement("link"); // Create new link Element link.rel = "stylesheet"; // set the attributes for link element link.type = "text/css"; link.href = styleUrl + "?r=" + Math.floor(Math.random() * 9999999999999999); head.appendChild(link); // Append link element to HTML head // load HTML var body = document.getElementsByTagName("body")[0]; const boxHtml = ` <div id="bookmarklet"> <a href="#" id="close">×</a> <h1>Select an image to bookmark:</h1> <div class="images"></div> </div>`; body.innerHTML += boxHtml; function bookmarkletLaunch() { const bookmarklet = document.getElementById("bookmarklet"); var imagesFound = bookmarklet.querySelector(".images"); // clear images found imagesFound.innerHTML = ""; // display bookmarklet bookmarklet.style.display = "block"; // close event bookmarklet.querySelector("#close").addEventListener("click", function () { bookmarklet.style.display = "none"; }); // find images in the DOM with the minimum dimensions var images = document.querySelectorAll( 'img[src$=".jpg"], img[src$=".jpeg"], img[src$=".png"]' ); images.forEach((image) => { if ( image.naturalWidth >= minWidth && image.naturalHeight >= minHeight ) { var imageFound = document.createElement("img"); imageFound.src = image.src; imagesFound.append(imageFound); } }); // select image event imagesFound.querySelectorAll("img").forEach((image) => { image.addEventListener("click", function (event) { const imageSelected = event.target; bookmarklet.style.display = "none"; window.open( siteUrl + "images/create/?url=" + encodeURIComponent(imageSelected.src) + "&title=" + encodeURIComponent(document.title), "_blank" ); }); }); } // launch the bookmarklet bookmarkletLaunch();
Please help.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
As I click on Bookmark it this error shows up
![image](https://private-user-images.githubusercontent.com/125040659/344421282-c068737c-bbc2-4c66-8acc-a77eb1a5e5e5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk3MzY5MjEsIm5iZiI6MTczOTczNjYyMSwicGF0aCI6Ii8xMjUwNDA2NTkvMzQ0NDIxMjgyLWMwNjg3MzdjLWJiYzItNGM2Ni04YWNjLWE3N2ViMWE1ZTVlNS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxNlQyMDEwMjFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1kYWFhNzUwZjFhNWI0ZWY1Y2NhOWNlNzc1MGExOWFlZDg1NWZmOWM5NDQyNDJkYzBhOGI1NzRiNWExYzQyYTcwJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.Y6ejiZanOz_F3n6SHSPBpHXp19vMZJGZ5F4EDwIcCt8)
and then it is not working as intended and i don't know what to do.
This is the
bookmarklet.js
code:Please help.
The text was updated successfully, but these errors were encountered: