User talk:The Transhumanist/ViewAnnotationToggler.js

This is an old revision of this page, as edited by The Transhumanist (talk | contribs) at 09:08, 11 December 2016 (prioritize). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Latest comment: 8 years ago by The Transhumanist in topic Program on/off switch

Change log

  • 2016-12-11
  • 2016-12-08
    • Anchor regexes on <li> (starting only) element delimiters
    • Primary functionality completed - it does as intended: switches between having and not having annotations (Turns on and off, albeit per page)
      • Clones the page's state, to restore it after annotations are removed
      • Uses regex to remove annotations
      • Uses a toggle to switch back and forth between the two states

Desired features

Improvements needed:

  • Have the screen stay anchored on its top entry when the toggle is used
  • Find a better hot-key (Shift-Alt-a) -- this one conflicts with the sidebar toggle.
  • Since it hides content, an indicator is needed to show when it is on/off.
  • Find/replace annotations of lead list entries (without bullets)
    • Only on pages with the title "Outline of"
    • Match entry that follows heading
    • Match entry that follows "{{Main}}"?
  • Find/replace annotations of other formats
    • regular hyphens
    • em dashes
    • no-break space-hyphen combos
    • commas
    • hanging hyphens (hyphen, with no annotation)
    • parenthetic annotations?
    • colons
  • Convert annotations, and then clone? (then it will toggle with fixed format)
  • Test on many pages of every page type
  • Feature to apply and save fixes (conversions) to wikicode (i.e., replace non-standard annotation punctuation in the page source)

Scroll position

The goal here is to maintain the position of the scroll, with respect to the topmost list entry on the screen, and have the formatting change while maintaining that position.

Some potentially relevant resources:

Program on/off switch

The current objective is to store global variables, and pass them on to the next page, including the current page upon refresh.

The state of the program can then be controlled from page to page, via conditionals applied upon the global variables.

Methods that persists data across a page refresh include:

  • iframe – ?
  • ajax – ?
  • cookies – this requires a server call, and is inefficient
  • localstorage
    • localStorage.setItem("annostatus", "hide");
      
    • var annostatus = localStorage.getItem('annostatus');
      

Feature completed. The Transhumanist 09:06, 11 December 2016 (UTC)Reply

Find/verify non-li list-lead entries