GithubHelp home page GithubHelp logo

daveeel / meteor-connection-indicator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nate-strauser/meteor-connection-banner

0.0 1.0 0.0 43 KB

A connection status banner for meteor apps in an easy package

License: MIT License

CSS 3.36% HTML 16.33% JavaScript 74.41% LiveScript 5.90%

meteor-connection-indicator's Introduction

meteor-connection-indicator

An indicator ( banner or sweetalert ) that displays when meteor server is disconnected with countdown and reconnect option.

Usage

{{>connectionIndicator}} (default banner mode, best located right after the opening body tag)

{{>connectionIndicator mode='alert'}} (sweetalert mode, no screen space required)


Banner mode will look best with supporting packages font-awesome and bootstrap-3

With font-awesome and bootstrap 3

Without either or both of these packages, it is still quite useful, but unstyled and plain

Without font-awesome and bootstrap 3

Element IDs can be used to directly style the banner if needed #connection-lost-banner and #connection-try-reconnect


Customizing Banner Text

The connection banner will attempt to fetch custom text from Meteor.settings. If any value is not set, the default value for that text will be used. Below are example settings which cover all of the text in the banner.

{
	"public":{
		"connectionIndicator":{
			"connectionLostText":"Ooops. Something is wrong.",
			"tryReconnectText":"Try to reconnect now",
			"reconnectBeforeCountdownText":"Attempting to reconnect in",
			"reconnectAfterCountdownText":"seconds."
		}
	}
}

Settings are only required if you desire customized text


####Using with a Bootstrap Fixed Top Navbar

If you have a fixed navbar at the top of the page, the connectionIndicator will render invisibly behind it. You can use the following CSS to move the navbar down if the banner is rendered (or appear below the navbar).

#connection-lost-banner + .navbar-fixed-top,
#connection-try-reconnect + .navbar-fixed-top {
    top: 41px;
}
.navbar-fixed-top + #connection-lost-banner,
.navbar-fixed-top + #connection-try-reconnect {
    top: 51px;
}

And insert the template either directly before or after the navbar element, e.g.:

{{>connectionIndicator}}
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
  ...
</div>

meteor-connection-indicator's People

Contributors

daveeel avatar nate-strauser avatar pascoual avatar

Watchers

 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.