www/js/rec_forum.js

Tue, 10 Dec 2019 20:11:37 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Tue, 10 Dec 2019 20:11:37 +0100
changeset 565
dfc850e6ee1f
permissions
-rw-r--r--

Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.


$(document).ready(function() {

 /**
  * This will copy the innerHTML of an element to the clipboard
  * @param element reference OR string
  */
 function copyToClipboard(e) {
    var tempItem = document.createElement('textarea');

    document.body.appendChild(tempItem);
    tempItem.value = e;
    tempItem.select();
    document.execCommand('Copy');

    tempItem.parentElement.removeChild(tempItem);
 }


 $('#copytoClipboard').jqxButton({ template: 'success', theme: theme, width: 150 });
 $('#copytoClipboard').click(function() {
  copyToClipboard(forumstr);
  window.close();
 });

});

mercurial