Giter Site home page Giter Site logo

anchorlinks's People

Contributors

christoomey avatar

Watchers

 avatar  avatar  avatar

Forkers

treasonx

anchorlinks's Issues

Icon updates

  • Clean up the icon transparency
  • Use base64 to inline it.
  • Make sure inserting the links doesn't cause any scrolling of the window.

Filter to only elements within viewport

Typical usage is to activate while viewing the element:

From this stack overflow answer

function isElementInViewport (el) {

    //special bonus for those using jQuery
    if (typeof jQuery === "function" && el instanceof jQuery) {
        el = el[0];
    }

    var rect = el.getBoundingClientRect();

    return (
        rect.top >= 0 &&
        rect.left >= 0 &&
        rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && /*or $(window).height() */
        rect.right <= (window.innerWidth || document.documentElement.clientWidth) /*or $(window).width() */
    );
}

Failure / Not Found notification

Currently nothing is displayed if there are no matches. Would prefer to have some sort of notification to say that none were found (within current viewport)

Avoid false positives like highlighter nodes

Rails guides use highlighter that adds an ID. This is likely not the desired anchor, and more importantly, since it's injected after page load it won't work the majority of the time.

Unsure if it's possible to filter out these sorts of links. The only thing I can think of is the fact that they are added after the fact, but not even sure how to hook into that.

Sample from the rails routing guides

<div id="highlighter_138920" class="syntaxhighlighter nogutter  ruby">

Hotkeys for visible links

The mouse is the worst! This will register a hotkey for each of the visible (viewport, not page) links. Should be able to go through the whole process without touching the mouse.

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.