Giter Site home page Giter Site logo

aadamsx / meteor-status Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 255kb/meteor-status

0.0 2.0 0.0 211 KB

Meteor status is a small package for Meteor alerting users when the connection to the server has been lost.

License: MIT License

JavaScript 82.04% CSS 10.22% HTML 7.75%

meteor-status's Introduction

Meteor Status

What is it?

Meteor Status is a package which automatically alerts users when the connection to the server has been lost. It also shows a countdown (in seconds) until the next retry and allows users to manually retry in the meantime.

Here is how it looks like:

Meteor Status screenshot

This package should be compatible with packages like Smart Disconnect as the alert does not show up in case of a manual disconnect (triggered with Meteor.disconnect()). Also, the first connection attempt (when the application is loaded for the first time) only shows the alert message on mobile (Cordova).

Installation

Add the package in your Meteor application with this command:

meteor add 255kb:meteor-status

Usage

Add the template before the body closing tag or anywhere else if you use the option style=false (see below):

<body>
    ...
    {{> meteorStatus}}
</body>

Options

You can add the following options to the template:

  • style=true: remove style/UI/positioning (only displays the text and the link)
  • lang='en': change language (currently 'fr', 'en', 'es', 'zh' and 'ar' supported, default to 'en')
  • position='bottom': change positioning for styled version ('top' or 'bottom', default to bottom)
  • showLink=true: display the retry link or not (true or false, default to true)
  • msgText='... %delay%': override the message (add '%delay%' in the string to insert the number of seconds until the next retry)
  • linkText='...': override the link text

Example:

<body>
    ...
    {{> meteorStatus style=false lang='fr' position='top' showLink=false msgText='Custom message'}}
</body>

Changelog

v1.4.2:

  • added Arabic language

v1.4.1:

  • added Spanish language

v1.4.0:

  • added option to show/hide the retry link
  • added the possibility to override the texts (message and link)

v1.3.2:

  • alert does not show on first connection on cordova anymore (avoid having the alert showed at every startup)
  • alert does not show on first retry when disconnected (avoid alert appearing too frequently when having a laggy mobile connection)

v1.3.1:

  • removed unneeded dependency (session)
  • new language (chinese)

v1.3.0:

  • package rewritten to allow multiple instances, also lighter
  • no more jquery dependency
  • higher z-index for styled version
  • ability to position to top
  • lighter unstyled version (text only, no wrapping div)

v1.2.0:

  • Improved default design (font and link style)
  • Option to disable UI/design (text only)
  • switch to local reactive vars instead of session vars
  • added i18n support and French language

meteor-status's People

Contributors

255kb avatar emadshaaban92 avatar drnachio avatar kristerv avatar qdsang avatar

Watchers

James Cloos avatar Aaron Adams avatar

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.