New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

autoback-cl

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

autoback-cl

Simple autoback mechanism for web sites

  • 2.2.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

FAQs

Package last updated on 28 Dec 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc