From 9a857413dc0c7e61da3e369141d6dc9d586f36ac Mon Sep 17 00:00:00 2001 From: GoldenFlame0 <49082712+GoldenFlame0@users.noreply.github.com> Date: Fri, 26 Sep 2025 17:08:49 +1000 Subject: [PATCH] Repair and partially update old export to html option. (#152) * Add old exporter from ancient times. --------- Co-authored-by: cajun <12363371+CajunAvenger@users.noreply.github.com> --- .../blank.gif | Bin 0 -> 49 bytes .../card_color.png | Bin 0 -> 876 bytes .../desktop.ini | 2 + .../export-template | 261 ++++++++++++++++++ .../preview.png | Bin 0 -> 6921 bytes .../sans-serif.png | Bin 0 -> 203 bytes .../script js | 74 +++++ .../serif.png | Bin 0 -> 265 bytes .../style css | 123 +++++++++ .../workaround | 10 + 10 files changed, 470 insertions(+) create mode 100644 data/magic-spoiler.mse-export-template/blank.gif create mode 100644 data/magic-spoiler.mse-export-template/card_color.png create mode 100644 data/magic-spoiler.mse-export-template/desktop.ini create mode 100644 data/magic-spoiler.mse-export-template/export-template create mode 100644 data/magic-spoiler.mse-export-template/preview.png create mode 100644 data/magic-spoiler.mse-export-template/sans-serif.png create mode 100644 data/magic-spoiler.mse-export-template/script js create mode 100644 data/magic-spoiler.mse-export-template/serif.png create mode 100644 data/magic-spoiler.mse-export-template/style css create mode 100644 data/magic-spoiler.mse-export-template/workaround diff --git a/data/magic-spoiler.mse-export-template/blank.gif b/data/magic-spoiler.mse-export-template/blank.gif new file mode 100644 index 0000000000000000000000000000000000000000..75b945d2553848b8b6f41fe5e24599c0687b8472 GIT binary patch literal 49 zcmZ?wbhEHbWMp7unE0RJ|Ns9C3=9Vj8~~DvKUo+V7?>DzfNY>Fh|Ltj$Y2csQN9XW literal 0 HcmV?d00001 diff --git a/data/magic-spoiler.mse-export-template/card_color.png b/data/magic-spoiler.mse-export-template/card_color.png new file mode 100644 index 0000000000000000000000000000000000000000..53c71a58fad3db29508274634f834d051c9ca7f6 GIT binary patch literal 876 zcmV-y1C#uTP))hq#IxcAdI+)p(WZ8zPZgr>$jTz$aj18Y|ry~KKnk;LlFNXU*8G}M*8ky445Jm$10-!es6O&DcdTwH9@NveRr9IuU zoW!F$&@0Qu*q5sqRr2xuT|UN#JCgoN;1a@O@d_my6S830DU%0pNOhw`_QhGt|z;hL9+Cde!3i-oF?qNUWE&-t+1DLOiTj@ zBFtZJ;8Ag~$OJz5I>@YX!5OI)WXigYr0?Y&tzzs;gK=&vmh#)+D3HUtpzWu$`oa0k zHG8Po6w5|Ho*nil8o~3TA>_(tQ!?k?w2UfZTPO^pMOcwq1HD)gG|rZf&4Mb#=UU5e_~e+yX#zKLn?ktfhZCGtbj#wysfbXNQrfP_%n^ zB89^W`js(fnyBJEqLC1A1RR>SbOD91Ar&^;IweWjY}7eh;8k)g#w*Lw?&O26!eaXw z*dq%%1E;;i(0l7Xu7&boW^9~5Dm`v!ATMIG(6Ee!yE;qo;jl0I-L|7Q|AzkzY>cWy zgBC%7Bij@gL&9OoHfbc4raNw_k7v+PV!0Ae)|jJyxjq^UjG(x6n>({9L7_o&Asve* zXI+ATh1DwZrs9}rW)O=x!K2fWxmX{k^cLd;(@6Czr$uP02%0X4$+p@QqI2?1y-20% z6vsp{g?|3c8IGG30$;A^c}+Ftcbr-@HON0{-scC=GJt" + else + "
  • + {if options.images == "full card image, preview" then + " +
    +
    { to_html(card.name ) }" + else if card_image_file != "" and contains(options.images, match:"linked") then + "
    +
    { to_html(card.name) }" + else + "
    +
    { to_html(card.name ) }" + }{ symbols_to_html(card.casting_cost ) }
    + {if card_image_file != "" and contains(options.images, match:"inline") then + "" + } +
    { to_html(card.type) }{ + if options.rarity_symbols then + "{card.rarity}" + else if card.rarity == "" then "(Common)" + else "(" + card.rarity + ")" + } +
    + { to_html(if card.special_text != "" then card.special_text else card.rule_text) } + { to_html(remove_tag(tag: "", card.flavor_text)) } + { card.pt + card.loyalty } + { to_html(card.card_number) } +
    +
  • " + } + kind_of_card := { if contains(card.shape, match:"token") then "" + else if contains(card.shape, match:"rulestip") then "" + else if contains(card.shape, match:"counter") then "" + else if contains(card.shape, match:"emblem") then "" + else if contains(card.shape, match:"split") then write_card() + else if contains(card.shape, match:"double faced") then write_card() + else if card.name_2 != "" then write_card() + else if card.loyalty != "" then write_card() + else if contains(card.shape, match:"leveler") then write_card() + else write_card() + } + write_cards := { + "
      { + for each card in sort_list(cards, order_by: {input.card_number}) do + kind_of_card() + }
    " + } + write_group := { + cards := filter_list(cards, filter: + { + # The first character of the color_of_card code must be equal to 'code' + substring(color_of_card(card:input), begin:0, end:1) == code + } + ) + count := number_of_items(in:cards) + if count > 0 then + "

    {title} ({count} {if count == 1 then "card" else "cards"})

    " + + write_cards() + else "" + } + # Used by print_cards() to format saga text, since those have unique boxes. + print_saga_text := + { + " {to_html(card.chapter_text)} + {to_html(card.level_1_text)} + {to_html(card.level_2_text)} + {to_html(card.level_3_text)} + {to_html(card.level_4_text)} " + } + # Used by print_cards() to format planeswalker text, since those have unique boxes. + print_walker_text := + { + " {to_html(card.level_1_text)} " + + " {to_html(card.level_2_text)} " + + " {to_html(card.level_3_text)} " + + " {to_html(card.level_4_text)} " + } + + # Actual export-ey bit starts here. + file_path := replace(copy_file("blank.gif"), match:"blank.gif", replace:"") + write_image_file( + file: "set-symbol.png", + width: 200, + symbol_variation(symbol: set.symbol, variation: "rare") + ) + write_image_file( + file: "set-icon.png", + width: 16, + heght: 16 + symbol_variation(symbol: set.symbol, variation: "rare") + ) + write_text_file( + script_string, + file: "script.js", + ) + write_text_file( + css_string, + file: "style.css" + ) + + # Generate html largely by string interpolation. + html := " + + + {set.title} + + + + + + + +

    {set.title}

    + +
    {set.description}
    + { if options.include_set_file then + "" + } + { if options.grouping == "group by color" then + # Codes as by sort_index + # Can't find anything that goes in other letters so far. + write_group(title: "Colorless" code:"A") + + write_group(title: "White", code:"B") + + write_group(title: "Blue", code:"C") + + write_group(title: "Black", code:"D") + + write_group(title: "Red", code:"E") + + write_group(title: "Green", code:"F") + + write_group(title: "Multicolor", code:"G") + + write_group(title: "Hybrids", code:"H") + + write_group(title: "Multicolor split", code:"I") + + write_group(title: "Artifact", code:"J") + + write_group(title: "Non-basic lands", code:"L") + + write_group(title: "Basic lands", code:"") + else write_cards(cards: cards) + } + + + " + + write_text_file(html, file:"index.html") + # make sure the urls are relative to the right directory + replace(html, match:"<[^<>]*(href|src)='", replace:"&{directory}/") diff --git a/data/magic-spoiler.mse-export-template/preview.png b/data/magic-spoiler.mse-export-template/preview.png new file mode 100644 index 0000000000000000000000000000000000000000..33da56a465888e37bc1a75d0aecad58482082baf GIT binary patch literal 6921 zcmV+k8}{UhP)pF33NqRbVF}#ZDnqB004<9jRpV!8m37^K~#90>|FO>Q`xrnk9eQ= z)4aL&ea5*{ykkWe6i1&^E~uc+*bzaxT}Q{EI4UKfq!L0&fIvVb^xlF<|_f7C6%dRHNq{OBfg!aKsa%qoejSHX0os zz(y{!Jpk3H_(288<#JwMU!OBMIde}<^$M7+mpPyAtwu#fMI3^OHfN)wSO0*nt}gC7 zdm0)Va;&MTVany@zRk_eF8H~nrNyPJtc<;CUIRSaEjDlbN6*ylW@~ir+@(Z?qJc4I zqwelLxc)e}6_ctZJ;ShUX&#a}SHq zPYid`Ge95^#QOR9%`8vZchjJyxfaI8#@-tJce3Dh;ABXU=4^EQCJX*ZE1ny;vZws~ zeD{Z~txPho4243$Ad<>_^ym?NN(!{KwF{3QKVH(?+e_cSe}Bb%aC&(Yw!A4$WKt<54zXfgnD;c8P8u5PS~qX{ zvb&<9ilzU{m+%^*g>*D4BeA2-&Q2#Ky;n!M_Lk7YG=o;FgFvPkQ{|3`ZWAi$y%5Rb z9l%Im3lt?c0VjW9VIfbYj!JT+(B4uF{hduPJUlY1etKs|QmNEGJUrZ=$KwTOWMl~9 zgfAx9&nHo1jmGNfFq}zo-r{o!twEOyLory8=DDrO`TBN+6#5nm3OnVQyK|M z4>FIO0s{l*h3+kZB#VxN$~<~+!k)Hn-P*in&6@gMyLOdoX=%ycb?57s)!{WHs=$|q z?ti@#qIYPhm^wN-oNwR09Y7>nM21{gUtj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wH_DbQjfq6~;W1FnVJGZr%35*w`f8zdsKTA1%Ry zM~iUp&k&>?s*0b%<1Ri~h*X0JhyOnDv=3n);|gMrg!{E7+pn2mcF~#k50V(ckCK_e z4|nD+f1H{h+)OVCZY$s}f0oM*ewvXN{5+Kw-1Nn_i#FR+bB&4>pFR>Xh_Gapm6b+R zytr-wDqb>TB<=0(GNN#G$gQ?r>bcOYQ$eTs{1Sta2^AIWDHNW~W)q|GCYuI(gTbIc zg|5@-8p-}?oMR@+TCY;6)C2~|91e%5t*uRt+2<5R;e9$p3YGBClba4!+n3MeD|NKVA7DX0jXC~$@4lQPl-gt()TLdn# zE^C;PQDNAosxa5!w&5L5S=Ji{KI*%e|3BXJ$UaQCt%pgWfbEfx(gtxo=9Y#CM$UA{ v!)sW4V_H_sXmGn-|7FGD*T(~yPaI}A<}mMi{cFBxpq&h!u6{1-oD!M3YG7FA>EaktF(>)Q|Nr*P9L^kUZRI=~N-KCKm@qSQZ#uv( zBI+T;6R5!?p|ydFp^;r+KI@~a4u7~it}}g%kD0dTaK4HitAl}fha(UF9JL2UDjhc% zj@)0!x0mBc<_Rv91z(C)UT@m4^Py#!_KH;xSp8TX9P=g>&LlrX&M~#|JWv{_pph40JJrr>mdK II;Vst0Q(MFCIA2c literal 0 HcmV?d00001 diff --git a/data/magic-spoiler.mse-export-template/style css b/data/magic-spoiler.mse-export-template/style css new file mode 100644 index 000000000..d0984c877 --- /dev/null +++ b/data/magic-spoiler.mse-export-template/style css @@ -0,0 +1,123 @@ +h1, h2 { + font-family: "Beleren", serif; +} + +.set-symbol { + float: right; + margin-right: .5em; +} + +ul { + list-style: none; + margin: 0; + padding: 0; +} +.card { + clear: left; + margin-top: 1em; + display: block; +} +li .box { + /* I don't think this was avaliable when this template was originally made.*/ + display: flex; + flex-direction: column; +} + +.box { + border: 1px solid rgb(192,192,192); +} +.test { + float: left; +} + +.card span { + display: block; +} + +.card .name { + font-weight: bold; + display: inline; + font-family: "Beleren", serif; + font-size: larger; +} +.card .casting-cost { + display: inline; + font-family: "Magic Symbols", "Magic Symbols 2004", sans-serif; + font-size: larger; + margin-left: .5em; + vertical-align: middle; +} + +.card .flavor-text { + font-style: italic; +} +.card .card-number { + color: rgb(128,128,128); + font-size: smaller; +} + + +.with-previews .card { + margin-top: 1.1em; + min-height: 100px; + position: relative; +} +.card .card-image { + height: 100px; + float: left; + top: 3px; + margin: 3px; + border: none; +} +.card .image { + display: block; + border: none; +} + +span.symbol { + display: inline; + vertical-align: middle; +} + +.fullcard { + float: left; +} +h2 { + clear: both; +} + +/* image preview */ +#preview-bg { + background-color: rgb(0,0,0); + width: 100%; + height: 100%; + cursor: pointer; + position: absolute; + opacity: 0.7; + -moz-opacity: 0.7; + filter: alpha(opacity=70); +} +#preview-img { + background-position: 50% 50%; + background-repeat: no-repeat; + width: 100%; + height: 100%; + cursor: pointer; + position: absolute; +} +#preview { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; +} +* html #preview { + position: absolute; +} + +@media print { + li { + break-inside: avoid; + } +} diff --git a/data/magic-spoiler.mse-export-template/workaround b/data/magic-spoiler.mse-export-template/workaround new file mode 100644 index 000000000..028e84a53 --- /dev/null +++ b/data/magic-spoiler.mse-export-template/workaround @@ -0,0 +1,10 @@ +# Various antiviruses freak out when there's a .js file or even a .css file + +# so they're converted to strings and only printed to those file types on the user end +# replace " -> \" +# replace { -> \{ +# replace linebreak -> \n + +script_string := "var isIE = navigator.appVersion.indexOf(\"MSIE\") != -1;\n\nvar preview, preview_img;\n\nfunction show_preview(url) \{\n preview.style.display = \"block\";\n preview_img.style.backgroundImage = \"url(\"+this.href+\")\";\n return false;\n}\n\nfunction hide_preview() \{\n preview.style.display = \"none\";\n}\n\nfunction fix_preview() \{\n var e = document.documentElement ? document.documentElement : document.body;\n preview.style.top = e.scrollTop + \"px\";\n preview.style.height = e.clientHeight;\n preview.style.width = e.clientWidth;\n}\n\nfunction nice_preview() \{\n // attach\n var links = document.getElementsByTagName(\"A\");\n for (var i in links) \{\n if (/(.jpg|.png|.gif)$/.test(links[i])) \{\n links[i].onclick = show_preview;\n }\n }\n // create divs\n preview = document.createElement(\"div\");\n var bg = document.createElement(\"div\");\n var img = document.createElement(\"div\");\n preview.id = \"preview\";\n bg.id = \"preview-bg\";\n img.id = \"preview-img\";\n hide_preview();\n preview.onclick = bg.onclick = img.onclick = hide_preview;\n preview.appendChild(bg);\n preview.appendChild(img);\n document.body.appendChild(preview);\n preview_img = img;\n if (isIE) \{\n window.onscroll = fix_preview;\n fix_preview();\n }\n}\n\nvar dir;\nfunction fix_img() \{\n if (this.currentStyle.width == 'auto' && this.currentStyle.height == 'auto') \{\n this.style.width = this.offsetWidth + 'px';\n this.style.height = this.offsetHeight + 'px';\n }\n this.onload = null;\n this.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\"'+this.src+'\",sizingMethod=\"scale\")';\n this.src = dir + \"blank.gif\";\n}\nfunction fix_png_alpha() \{\n if (!/MSIE (5\\.5|6\\.)/.test(navigator.userAgent)) return; // only in ie 5.5 and 6\n dir = document.getElementsByTagName(\"SCRIPT\")[0].src.replace(/[^\\/]*$/,''); // dir for blank image\n var imgs = document.getElementsByTagName(\"IMG\");\n for (var i in imgs) \{\n var img = imgs[i];\n if ((/\\.png$/i).test(img.src)) \{\n img.onload = fix_img;\n }\n }\n}\n\nfunction init() \{\n fix_png_alpha();\n nice_preview();\n}" + +css_string := "h1, h2 \{\n font-family: \"Beleren\", serif;\n}\n\n.set-symbol \{\n float: right;\n margin-right: .5em;\n}\n\nul \{\n list-style: none;\n margin: 0;\n padding: 0;\n}\n.card \{\n clear: left;\n margin-top: 1em;\n display: block;\n}\nli .box \{\n /* I don't think this was avaliable when this template was originally made.*/\n display: flex;\n flex-direction: column;\n}\n\n.box \{\n border: 1px solid rgb(192,192,192);\n}\n.test \{\n float: left;\n}\n\n.card span \{\n display: block;\n}\n\n.card .name \{\n font-weight: bold;\n display: inline;\n font-family: \"Beleren\", serif;\n font-size: larger;\n}\n.card .casting-cost \{\n display: inline;\n font-family: \"Magic Symbols\", \"Magic Symbols 2004\", sans-serif;\n font-size: larger;\n margin-left: .5em;\n vertical-align: middle;\n}\n\n.card .flavor-text \{\n font-style: italic;\n}\n.card .card-number \{\n color: rgb(128,128,128);\n font-size: smaller;\n}\n\n\n.with-previews .card \{\n margin-top: 1.1em;\n min-height: 100px;\n position: relative;\n}\n.card .card-image \{\n height: 100px;\n float: left;\n top: 3px;\n margin: 3px;\n border: none;\n}\n.card .image \{\n display: block;\n border: none;\n}\n\nspan.symbol \{\n display: inline;\n vertical-align: middle;\n}\n\n.fullcard \{\n float: left;\n}\nh2 \{\n clear: both;\n}\n\n/* image preview */\n#preview-bg \{\n background-color: rgb(0,0,0);\n width: 100%;\n height: 100%;\n cursor: pointer;\n position: absolute;\n opacity: 0.7;\n -moz-opacity: 0.7;\n filter: alpha(opacity=70);\n}\n#preview-img \{\n background-position: 50% 50%;\n background-repeat: no-repeat;\n width: 100%;\n height: 100%;\n cursor: pointer;\n position: absolute;\n}\n#preview \{\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n}\n* html #preview \{\n position: absolute;\n}\n\n@media print \{\n li \{\n break-inside: avoid;\n }\n}"