Skip to content

Releases: ppavlidis/zotero-pdf-setHorizontal

v1.1.0

Choose a tag to compare

@ppavlidis ppavlidis released this 10 Sep 22:41

Zotero 10 compatibility: strict_max_version bumped to 10.* (Zotero 7 through 10). No code changes were required.

Also the first release of this fork to actually carry an installable XPI — v1.0 had no assets.

1.0

1.0

Choose a tag to compare

@ppavlidis ppavlidis released this 03 Jul 22:32
fork: Zotero 9 support, Page Layout option, preferences fixes (v0.0.9)

This commit contains all fork changes on top of qiwei-ma/zotero-pdf-setHorizontal@e7f9b24.

## New features
- Zotero 9 compatibility (strict_max_version bumped to 9.*).
- Page Layout option mapping to PDF.js SpreadMode: Single Page / Two
  Pages (1-2, 3-4, ...) / Two Pages (1 alone; 2-3, 4-5, ...). Labels
  include page-pattern examples and cross-reference Zotero's own View
  menu (Odd Spreads / Even Spreads).

## Preferences pane fixes
- FTL was loading asynchronously via DOM MutationObserver after
  document.l10n.translateFragment() had already fired, leaving all
  data-l10n-id labels blank. Added a pane 'scripts' entry
  (prefs-loader.js) that front-loads the FTL via
  MozXULElement.insertFTLIfNeeded() before markup is inserted.
- parseXULToFragment() doesn't wire event-handler attributes as real
  listeners (Zotero only patches oncommand). The <vbox onload> callback
  never fired, so registerPreferenceListeners was skipped. The loader
  attaches a capturing 'load' listener to invoke onPrefsEvent.
- Stable pane id ({addonRef}-pane) so repeat registrations no-op
  instead of appending duplicate sidebar rows. Swallow the duplicate-id
  throw from Zotero.PreferencePanes.register.
- Switched src/image/scripts URLs from rootURI concatenation to
  chrome:// URIs (more portable, avoids jar: URI edge cases).

## Settings now actually apply and stick
- PDFStateInitializer / PDFPreviewHandler / PDFHandToolHandler read
  prefs fresh inside methods instead of at module load — toggling a
  checkbox now takes effect without a Zotero restart. init() always
  registers the notifier; the enabled-check moved to event time.
- XUL <menulist native="true" preference=...> binding stores elem.value
  (a string) via Zotero.Prefs.set, which routes to setStringPref by
  typeof. That left int prefs stored as strings, and PDF.js's
  scrollMode/spreadMode setters throw on non-number input (they do
  Object.values(ScrollMode).includes(mode)). Every pref read now passes
  through Number() coercion.
- Switched scroll/spread application from direct pdfViewer property
  assignment to PDF.js event-bus dispatch (switchscrollmode /
  switchspreadmode), matching zotero/reader's own setScrollMode /
  setSpreadMode. This triggers Zotero Reader's _updateViewStats ->
  state-save side effect reliably.
- Dropped buggy 'already applied' early-return that compared
  currentScaleValue against raw pref value; with any string/number
  skew it bypassed the apply entirely.
- Re-apply at pagesinit + 400ms in case Zotero Reader's initial
  _handleViewAreaUpdate races with our first apply.
- 'Zoom to Page Height' now stores 'page-fit' (what zotero/reader's
  zoomPageHeight command uses), not 'page-height' (which clipped the
  second page of a spread). Startup migration rewrites legacy values.
- Default 'Every time a tab is opened' to true — the 'When an item is
  first added' path alone only writes state for newly-imported PDFs;
  previously-imported PDFs need the per-tab path to receive settings.
- Corrected swapped spread-mode labels. Upstream labeled value=1 'first
  page alone' and value=2 'cover page paired' exactly backwards vs
  PDF.js's pdf_viewer.js _updateSpreadMode (parity = spreadMode - 1,
  pair-left if pageNumber % 2 !== parity).

## Fork metadata
- package.json name=set-pdf-view-fork, addonName='Set PDF View (fork)'.
  Plugin ID and prefs namespace unchanged so users upgrade in place.
  Repository / homepage / bugs URLs point at ppavlidis fork; author
  credits ppavlidis as fork maintainer and qiwei-ma as original.
- zotero-plugin.config.ts updateURL / xpiDownloadLink target the
  fork's releases.
- README fork note summarising changes.
- English copy fixes (Everytime -> Every time, Itme typo, misleading
  'may cause items to fail to open' warning replaced with accurate copy
  explaining both triggers and confirming they are safe together).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Update Manifest

Update Manifest Pre-release
Pre-release

Choose a tag to compare

@ppavlidis ppavlidis released this 10 Sep 22:42

Zotero reads update.json from this release to offer in-app updates. The plugin's update_url points here; it is not a downloadable version of the plugin.