No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ui.js 667B

123456789101112131415161718192021222324
  1. function on_generate() {
  2. // Generate output HTML
  3. var card_html = card_pages_generate_html(card_data);
  4. // Open a new window for the output
  5. // Use a separate window to avoid CSS conflicts
  6. var tab = window.open("output.html", 'rpg-cards-output');
  7. // Send the generated HTML to the new window
  8. // Use a delay to give the new window time to set up a message listener
  9. setTimeout(function () { tab.postMessage(card_html, '*') }, 100);
  10. }
  11. function on_load_sample() {
  12. card_data = card_data_example;
  13. }
  14. $(document).ready(function () {
  15. $("#button-generate").click(on_generate);
  16. $("#button-load-sample").click(on_load_sample);
  17. });