Giter Site home page Giter Site logo

anchors-reveal's People

Contributors

aeris avatar dascritch avatar jnvsor avatar makyen avatar myrdd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

anchors-reveal's Issues

Refactoring code

Via e-mail :

A reviewer sent a message regarding the review of version 1.0 of add-on Anchors reveal.

erosman wrote:

Please note the following for the next update:

  1. For inserting text, textContent (or JQuery text) or createTextNode() should be used instead of innerHTML.
    eg:
    legends[0].innerHTML = browser.i18n.getMessage('themeParameterDescription');

  2. Add-on contains duplicate/hidden/unused/unnecessary files or folders. These complicate the review process and may contain sensitive information about the system you created the XPI on. Such files may also create cause for rejection. Please correct your packaging process so that these files aren't included.
    e.g.:
    lib.js

If you want to respond please reply to this email or visit https://addons.mozilla.org/en-US/developers/addon/anchors-reveal/versions

You are receiving this email because you are an author of this add-on.

visibility detection: false negatives

First of all, thank you for this add-on! I've found a bug, and I think it's quite easy to fix.

Steps to reproduce:

What happens:

Mainly the form fields are marked by AR.

What should happen:

The headings should be marked as well.


Currently AR does these checks on each element having an ID:

    function(el) {
      if (
          (el.id.indexOf(prefix)!==0) // not generated by the addon ?
          && ( valid_id.test(el.id) ) // not malicious ?
          && (!el.hidden) && (el.style.display !== 'none') // visible ?
          && ( (el.clientWidth != 0) && (el.clientHeight != 0 ) ) // really visible ?
        ) {

In this case all tests evaluate to true, but clientWidth and clientHeight are false.

I did some research and it looks like it's better to use offsetWidth and offsetHeight. JQuery additionally uses getClientRects().length, see jquery's code:

jQuery.expr.filters.visible = function( elem ) {
    return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );
};

You might want to take that expression instead of the current ones. You could also remove usage of el.hidden and el.style.display.

MDN documentation: HTMLElement.offsetWidth, HTMLElement.offsetHeight, Element.getClientRects().

Inline elements not displayed

I've got a big issue if the element is inline. As in Wikipedia.
For GitHub, sorry but their improperly use of name="" should be ashamed

Spelling oopses

License name in README.md:
Purpose -> Public

In the AMO description:
clic -> click

Also the AMO description could be a little more elaborate, non-web developers might not know exactly what an anchor is.

Changing aspect of the tags

See addons reviews #874609/ :

One click shows the anchor, another click hides them. Very simple! But please, add an option to customize how it is shown. This yellow colour is too aggressive for me.

Yes, it is right. But we have a very simple addon (I bet on minimal functionality).
Perhaps I do some (home) works to build a simple preference page

Add short-key (parametrable)

Anchors-reveal should be able to be invoked via a shortkey. The sequence must be parametrable because of the number of potential addons.

Refresh on resize

If the user is resizing its viewport (resizing window of orientation device), tags ID aren't moving accordingly.
The script should redraw/recalc on this event.

Refresh on mutations

If the page is modifying its aspect (DOM mutation or CSS property), tags ID aren't moving accordingly.
The script should redraw/recalc on this event.

Do not show id on top

If element is positionned at top:0 and left:0 of the document, it should not be shown.

Add sidebar

Add a sidebar with the anchors lists (linked to the anchor)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.