christoomey / anchorlinks Goto Github PK
View Code? Open in Web Editor NEWChrome extension for copying the anchored link to a web page
Chrome extension for copying the anchored link to a web page
C-a
C-e
will currently trigger. Or C-f
C-f
http://stackoverflow.com/questions/484719/html-anchors-with-name-or-id/484781#484781
So, it will look for id="foo" followed by name="foo"
Example link, from LYAH http://learnyouahaskell.com/starting-out#an-intro-to-lists
Despite expected formatting (id="foo"
attribute), anchorlinks not finding anyting:
http://weblog.rubyonrails.org/2014/12/19/Rails-4-2-final/#maintenance-consequences-and-rails-50
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() */
);
}
Seems to block focus events for inputs.
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)
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">
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.