Git Product home page Git Product logo

alert's Introduction

Backbone UI: Alert

A notification system to display errors, warnings, confirmations and notifications to the user

Examples

Install

Using bower

bower install backbone.ui.alert

Usage

In its basic implementation, the plugin is available under the Backbone.UI namespace

var alert = new Backbone.UI.Alert({
	message : $(e.target).attr("title"),
	type: "success"
});

You can control the fade out animation and the style of the alert through the options.

Options

These are the variables that give you access to a number of features of the plugin

  • parentEl: (default: "body" ),
  • message: (default: ""),
  • type: (default: "info"),
  • position: (default: "top-center"),
  • fade: (default: 0),

Using icon fonts

The example Icons, demonstrates how to add icons to the alerts and can be used as is, or customised if desired. The codes for the icons are as follows:

Icons with solid background

Success: e600 Error: e602 Warning: e604

Icons with transparent background

Success: e601 Error: e603 Warning: e605

For exact usage, please refer to the css in the header of the example file.

Customisation

To allow for customisation of the iconfont, the sources selection.json is available in the src/font folder, along with the svg files of the iconfont.

Showcase

A few of the sites using this open source:

Cloudvisio Roomchecking CRUDr GoCollab Chiiv tIssues

Credits

Initiated by Lyndel Thomas (@ryndel)

Distributed through Makesites.org

Released under the MIT license

alert's People

Contributors

ryndel avatar tracend avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

headforwards

alert's Issues

Alias options names

Although this plugin not a straight replacement of any other solution, it's good to comply with existing notification libraries. Noty of example has these differences:

text -> message
timeout -> fade
layout -> className

Maybe the middle ground is to support both option definitions instead of choosing one or the other.

Choose layout

An option named className can define the layout of the notification.

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.