npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

autoback-cl

v2.2.2

Published

Simple autoback mechanism for web sites

Downloads

19

Readme

autoback-cl

This component implements a simple "back button" behavior. I'm not a big fan of the back button and always try to provide users and alternative as part of the actual interface. For years I did this with a simple PHP library that kept a stack of visited pages in the session. Then I could put a 'Back To' link on the page that they could follow. This was really useful for pages that could be visited from any directing page, like pages with help information. But, my new system is moving to a RESTful server, so no sessions.

This version accomplishes the same thing in Javascript, only better. To use it, just add the cl-autoback class to a link:

<a class="cl-autoback" href="b.html">Link to b.html</a>

Following this link will add the current page to the autoback stack. Then, on any page you want an autoback link on (a link back to where you linked from), just add this div:

<div class="cl-autoback"></div>

This will appear as a link back to the page that you clicked on to get to this page, provided it has the cl-autoback class on the link. Arriving at a page other than through a cl-autoback link will clear the autoback stack.

Install

CDN

<script src="https://unpkg.com/icons-cl/dist/autoback-cl.js"></script>
<!-- or -->
<script src="https://unpkg.com/icons-cl/dist/autoback-cl.min.js"></script>

Package managers

npm: npm install autoback-cl --save

Using the Library

The library consists of only the single .js file autoback-cl.js or the minimized version autoback-cl.min.js. The icon images and style sheets are included in the .js file.

The strip option

The return page is determined entirely based on the page title. Since some sites (including my own) will prefix titles with additional information you may not want in this link, adding the cl-strip option to the div will strip off the first word.

<div class="cl-autoback cl-strip"></div>

For example, supposed you have the page 'CSE335 Step 1: Introduction to the course' linking to the page 'CSE335 Error Help: not found'. Clicking on the link for the error help page without the cl-strip option would create a link on that page with the text 'CSE335 Step 1: Introduction to the course'. If the cl-strip option is employed, the first word is stripped: 'Step 1: Introduction to the course'. This is done to make the links cleaner.

License

Copyright 2018 Michigan State University

Cirsim is released under the MIT license. Image is Copyright jQuery Foundation.


Written and maintained by Charles B. Owen