Bot:Gadget-figureSource.js: Difference between revisions

Content deleted Content added
Zero-dependency rewrite: mediawiki.util hangs at loading under this wiki module soup
Viewer: ink page border + coral box anchored to the page frame (wide-window drift fix)
Line 393:
'<button class="fig-prev">‹ prev</button>' +
'<button class="fig-next">next ›</button></div>' +
'<div class="fig-stage"><canvas></canvas><div class="fig-boxpage"></div></div>'; +
'<canvas></canvas><div class="fig-box"></div></div></div>';
var render = function () {
pdf.page(page).then(function (pg) {
Line 465 ⟶ 466:
'.fig-viewer-bar button{font:inherit;background:#fff;' +
'border:1px solid #0d0d0d;padding:2px 12px;cursor:pointer}' +
'.fig-stage{position:relative;overflow:auto;text-align:center}' +
// the page frame: ink border so the white page reads as an OBJECT on
'.fig-stage canvas{display:block;margin:0 auto}' +
// the white wiki background; position:relative so the coral box is
// canvas-anchored (absolute children resolve against the padding box,
// so the border adds no offset) — centering via the stage no longer
// drifts the box on wide windows
'.fig-page{position:relative;display:inline-block;' +
'border:1px solid #0d0d0d;background:#fff}' +
'.fig-stagepage canvas{display:block;margin:0 auto}' +
'.fig-box{position:absolute;display:none;border:3px solid ' + coral +
';pointer-events:none}');