dproofreaders icon indicating copy to clipboard operation
dproofreaders copied to clipboard

remove scripts from theme.inc (simpified version)

Open 70ray opened this issue 1 year ago • 0 comments

Sandbox at: https://www.pgdp.org/~rp31/c.branch/alt_theme_script

There are some considerations regarding the icon links: It was necessary to use the url "#" for the search to prevent the page from refreshing and immediately removing the search box. This apparently does not happen if "onclick" is present. This is mentioned in https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#onclick_events. Using an anchor in this way it is possible to right-click and attempt to open the search in a new tab which does not work (same for present version). As discussed on the mozilla page, ideally a button should be used for this purpose. I tried this earlier but it presents a different appearance which could probably be fixed by styling. I also tried (in the earlier PR) using a 'div'. This does not change the appearance but behaves slightly differently: it is not tabbable (unless it is given a tab_order) and if selected (by tabbing) does not actuate on pressing 'enter' (possibly also fixable by adding an event listener). It then seemed best for this PR just to remove embedded scripts and leave the rest unchanged. It would also be possible in future to re-arrange the icon link code to use classes which could make it clearer and make it easier to revise how search option works.

70ray avatar Aug 16 '24 08:08 70ray