HubSpot / offline

Automatically display online/offline indication to your users
http://github.hubspot.com/offline/docs/welcome
MIT License
8.67k stars 849 forks source link

Support for offline js to apply on specific pages ?? #246

Open ashwintastic opened 7 years ago

ashwintastic commented 7 years ago

Hi Team,

How can I apply offline js to work on some specific pages... I have used this library on my app, and I have include the script on some specific page but the functionaly of being offline is show on every page ..How can I restrict it to be called on specific page

wolfmaster8 commented 6 years ago

Hello @hiteshsomani , just add this code on the head of the specific page:

<link rel="stylesheet" type="text/css"  href="/themes/offline-theme-slide.css">
<link rel="stylesheet" type="text/css" href="/themes/offline-language-spanish-indicator.css">
<script src="/offline.min.js" type="text/javascript" charset="utf-8" ></script>

Just remember to change the paths. You must put the css files into themes folder.

This is the brute-force method.

Alternatively you can use Cloudflare as a CDN service. When you've configured Cloudflare go to Apps search for Offline. In the top menu it says Install on, there you can select the specific pages.