added bookmarklet that doesn't work yet

This commit is contained in:
smilerz
2021-03-25 14:02:57 -05:00
parent 4d5a9e446f
commit 09d2e9f831
4 changed files with 69 additions and 3 deletions

View File

@ -0,0 +1,37 @@
(function(){
var v = "1.3.2";
if (window.jQuery === undefined || window.jQuery.fn.jquery < v) {
var done = false;
var script = document.createElement("script");
script.src = "https://ajax.googleapis.com/ajax/libs/jquery/" + v + "/jquery.min.js";
script.onload = script.onreadystatechange = function(){
if (!done && (!this.readyState || this.readyState == "loaded" || this.readyState == "complete")) {
done = true;
initBookmarklet();
}
};
document.getElementsByTagName("head")[0].appendChild(script);
} else {
initBookmarklet();
}
function initBookmarklet() {
(window.bookmarkletTandoor = function() {
r = confirm('Click OK to import recipe automatically, click Cancel to import the recipe manually.');
if (r) {
auto=true
} else {
auto=false
}
var newIframe = document.createElement('iframe');
newIframe.width = '200';newIframe.height = '200';
newIframe.src = localStorage.getItem('importURL');
document.body.appendChild(newIframe);
}
)();
}
})();