framework-agnostic styled alert system for javascript

Overview

SMOKE.JS - 0.1.3

Notify or get approval from your users quickly and with style. This alert system uses css animations and background (so there are no images or js animation code...so it's really lightweight).

It's trivial to implement and really easy to change the style.

Take a look at the demo: http://smoke.js.org/

Also, we've made some cool themes for you: http://github.com/hxgf/smoke-themes/

New in 0.1.3

Supported Browsers

  • Chrome
  • Firefox
  • Safari
  • IE 6+ (usable, no animation [who cares], visual IE6 support [transparencies, etc] is up to you)
  • iOS Mobile Safari

(widespread mobile support [android, blackberry, windows] uncertain (I mean, it probably works, but I can't really say that))

Current User Notices

  • If you're using custom themes, you might want to check yourself. The markup/structure hasn't changed, but the base styles are different from the way they've always been, so just think about that for a while.
  • .alert()'s callback/function order is changed to be consistent with the other methods. [http://smoke.js.org/](See the docs) for the correct order.

Bugs/Contributing

  • If you find a bug or have a cool idea for a feature, fork this repo and add a pull request. Your changes will probably get added as long as they're legit.
  • If you've made any cool themes, add them to http://github.com/hxgf/smoke-themes/

Planned Updates

  • Stop all the click/esc/enter listeners once a dialog is closed.
  • Helpful code comments.
  • This thing used to pass JSLint, but it doesn't now. Whatever...

Thanks Y'all

  • Hugo Diaz
  • Michal Zielenkiewicz
  • Leon Fedotov
  • Lautaro Orazi
  • Leonardo Souza
  • Carlos Brito Lage

License

(MIT License)

Copyright (c) 2011-2013 Jonathan Youngblood <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Comments
  • Added support for reversing order of prompt / confirm buttons and cleaned up the code a bit

    Added support for reversing order of prompt / confirm buttons and cleaned up the code a bit

    Hey,

    I needed to add support for changing the order of the prompt / confirm buttons, so I made it a param "reverseButtons", that if passed as true, will make the buttons be rendered in the opposite order.

    I also cleaned up the code a bit, and made it validate with JSLint, which I think is a good way of ensuring code readability and bug-freeness.

    What do you think?

    -Carlos

    opened by cblage 6
  • Plan for IE 8 support ?

    Plan for IE 8 support ?

    Hi I am planning to integrate this library. Some of my users still uses IE8. what is the plan and when you are adding the support for IE8 ?

    Thanks -Divagar

    opened by divagar 5
  • Keyboard management

    Keyboard management

    Wrong behavior when press Enter or Space in FF and Chrome:

    • Alert doesn't close in both browsers.
    • Confirm doesn't close in FF pressing Enter or Space.
    • When press Enter in Chrome prompt canceled. In FF it's OK.
    opened by bel1k0v 4
  • Fixed smoke dialogs availability when there are slow loading images and cleaned tabs mixed with spaces

    Fixed smoke dialogs availability when there are slow loading images and cleaned tabs mixed with spaces

    Hey,

    I was testing smoke.js on a pre-prodution website and I noticed that it was taking a long time for the dialogs to be available because of a DNS problem with our pre-production CDN. This was because window.onload was being used, and that only fires after the last asset is loaded.

    I decided to use a very minimal DOMContentLoaded cross-browser library made by Diego Perini (https://github.com/dperini/ContentLoaded), it's also MIT licensed, so it's compatible) to fix this problem.

    This way, smoke dialogs are available as soon as the DOM is ready.

    Since I put it in a self-calling lambda, the global namespace won't be polluted, and only window.smoke will be defined.

    I also fixed a couple of tabs mixed with spaces indentation issues.

    Hope you don't mind the usage of an external library, it's very minimal and doesn't pollute the global namespace.

    Carlos

    opened by cblage 4
  • stacking messages...

    stacking messages...

    Hi there. I changed your basic layout to support multiple messages (stacked). Now you don't need to init a container. Each message builds one smoke-container with a timestamp-based id. You must minify the js again.

    opened by tarolandia 4
  • Default value for

    Default value for "ok" and "cancel" button

    Is it possibile to set a default value for "ok" and "cancel" buttons?

    I notice that in your code ( https://github.com/hxgf/smoke.js/blob/master/smoke.js#L52 ) you have "OK" and "Cancel" labels, is it possible to overwrite this?

    opened by billmn 3
  • diable clicking on background to close smoke.confirm dialog

    diable clicking on background to close smoke.confirm dialog

    I have a smoke.confirm dialog with ok and cancel buttons. I would like to force users to click on ok or cancel buttons only - not allow them to click on the background or anywhere else on the page.

    Is this possible?

    opened by eamonnfaherty 3
  • Fallback support for IE 6,7,8

    Fallback support for IE 6,7,8

    IE6/7/8 are still browsers that are used today. (Unfortunately) Alerts and user messages are important, even a simple 'alert()' will suffice here :)

    What do you think?

    opened by rafi 3
  • Support for passing an initial value for the prompt and a callback for the alert

    Support for passing an initial value for the prompt and a callback for the alert

    I needed these features in a project I'm working on and I thought they'd be useful for the general public:

    • You can pass a "value" param (along with the other options, such as the button labels) when calling smoke.prompt and the input will be pre-filled with it.
    • You can pass a callback as the third parameter for smoke.alert (thus, not breaking backwards-compatibility), and the callback will be called whenever the alert is closed
    opened by cblage 2
  • User code needs to wait for window.load event

    User code needs to wait for window.load event

    I tried to use smoke.js in my project but hit problems where it would silently fail if I tried to show a smoke.alert immediately. I was triggering from document.ready(), but it seems I need to wait for window.load() before using smoke.js.

    It might help others if this were documented somewhere. Thanks.

    opened by tobyjaffey 2
  • Compatible Browser List

    Compatible Browser List

    The readme should include a list of browsers this script is intended to work with; this way we'll if a incompatibility issue found is a bug or not a feature.

    opened by MarioRicalde 2
  • Limitation to 3 quiz buttons

    Limitation to 3 quiz buttons

    Just simply replace button_1, button_2, button_3 with array:

    		buttons: [
    						{value : '11', name: "Option 33"},
    						{value : '20', name: "Option 66"},
    						{value : '61', name: "Option 91"},
    						{value : '42', name: "Option 55"},
    						{value : '99', name: "Option 42"}
    					]
    

    callback handler returns reference to the button. value can be accessed by reading data-quiz-value property

    opened by Falseclock 0
  • fix #62 quiz now accept parameter options. Usage:

    fix #62 quiz now accept parameter options. Usage:

    smoke.quiz("Select an option:", function(e){ if (e == 1){

    }
    

    }, { options: [ {value: 1, label: "Option 1"}, {value: 2, label: "Option 2"}, {value: 3, label: "Option 3"} ], button_cancel: "Nothing" });

    opened by ThomasPerraudin 0
  • Quiz illimited options

    Quiz illimited options

    The quiz function is useless for me because I cannot display more than 3 options. The list of options should be customizable. For instance, the quiz function could receive a parameter options = [{value: 1, label: "Option 1"}, {value: 2, "Option 2"}]

    opened by ThomasPerraudin 0
  • bower.json main field should not be used as description

    bower.json main field should not be used as description

    Hi,

    the bower.json file contains the main field which should not be used as desciption. Instead of a description it should list the main files (once per type) See: https://github.com/bower/spec/blob/master/json.md

    Pull request: https://github.com/hxgf/smoke.js/pull/60

    opened by QualifiedSuccess 0
  • minified version is missing semicolon at the end

    minified version is missing semicolon at the end

    Hi,

    the minified version is missing a semicolon at the end.

    You fixed that once by a0cce74f3da89a65139f19de795e3d3c1d8640e1 but the semicolon is missing again in release 0.1.3 and master branch. I dont know how you are generating the minified version cause there is no script so you have to fix that.

    It can cause errors if you concat multiple js scripts and smoke.js is followed by another one.

    18133Uncaught TypeError: (intermediate value)(intermediate value)(intermediate value)(...) is not a function

    opened by QualifiedSuccess 0
Owner
j youngblood
The makers of the makers fall before the child. Second level clear. [End of line]
j youngblood
A simple, modern, browser notification system

humane.js This project was heavily inspired by humanmsg project for jQuery. I really liked the project but I wanted to remove the jQuery dependency, a

Marc Harter 2.1k Dec 10, 2022
Beautiful JavaScript notifications with Web Notifications support.

v4: v5: A JavaScript/TypeScript notification, confirmation, and prompt library. Notifications can display as toast style, snackbar style, banners, dia

SciActive 3.6k Dec 30, 2022
Simple javascript toast notifications

toastr toastr is a Javascript library for non-blocking notifications. jQuery is required. The goal is to create a simple core library that can be cust

null 11.5k Jan 6, 2023
🔔 a clean and simple notification, input, and selection suite for javascript, with no dependencies

notie notie is a clean and simple notification, input, and selection suite for javascript, with no dependencies Live demo: https://jaredreich.com/noti

Jared Reich 6.3k Dec 26, 2022
Pure JavaScript library for better notification messages

Toastify Toastify is a lightweight, vanilla JS toast notification library. Demo Click here Features Multiple stacked notifications Customizable No blo

Varun A P 1.3k Dec 30, 2022
Custom alert box using javaScript and css. This plugin will provide the functionality to customize the default JavaScript alert box.

customAlertBoxPlugin Custom Alert Box Plugin Using JavaScript and CSS Author: Suraj Aswal Must Include CSS Code/Default Custom Alert Box Class: /* mus

Suraj Aswal 17 Sep 10, 2022
A Powerful and Elegant "alert" library for JavaScript that replaces that boring alert style of Javascript.

A Powerful , Elegant and fully customizable "alert" library using JavaScript that replaces that boring style of alert. Installation Place the below sc

Cosmogic 11 Aug 10, 2021
It's an alert library build with JavaScript. You can replace your traditional JavaScript alert, confirm and toast with the library.

asteroid-alert It's an alert library build with JavaScript. You can replace your traditional JavaScript alert, confirm with the library. It has also e

Khan Md Sagar 4 Mar 12, 2021
⛔️ DEPRECATED - Dependency-free notification library that makes it easy to create alert - success - error - warning - information - confirmation messages as an alternative the standard alert dialog.

DEPRECATED This repository is no longer supported, please consider using alternatives. Dependency-free notification library. Documentation » Hi NOTY i

Nedim Arabacı 6.7k Dec 21, 2022
Terminal Styled Portfolio Website ˋ( ° ▽、° ) , a terminal style/styled portfolio website made with <3 using react.

AshTerm A Terminal Styled Portfolio Website. ??‍?? Made Using- ⚛ Framework ReactJS ?? Terminal react-console-emulator ?? Deployed using CloudFlare Run

ashish 67 Nov 22, 2022
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
🏭 Framework-agnostic model factory system for clean testing

@julr/factorify Framework-agnostic model factory system for clean testing. Built-on top of Knex + Faker, and heavily inspired by Adonis.js and Laravel

Julien Ripouteau 14 Sep 29, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
JavaScript Alert/Notification System

alertify.js - browser dialogs never looked so good The end of maintenance... at least for now Unfortunately, I will no longer be maintaining alertify.

Fabien Doiron 4.3k Dec 22, 2022
The Frontend of Escobar's Inventory Management System, Employee Management System, Ordering System, and Income & Expense System

Usage Create an App # with npx $ npx create-nextron-app my-app --example with-javascript # with yarn $ yarn create nextron-app my-app --example with-

Viver Bungag 4 Jan 2, 2023
Framework-agnostic CSS-in-JS with support for server-side rendering, browser prefixing, and minimum CSS generation

Aphrodite Framework-agnostic CSS-in-JS with support for server-side rendering, browser prefixing, and minimum CSS generation. Support for colocating y

Khan Academy 5.3k Jan 1, 2023
Shoelace - A collection of professionally designed, every day UI components built on a framework-agnostic technology. 🥾

Shoelace A forward-thinking library of web components. Works with all frameworks ?? Works with CDNs ?? Fully customizable with CSS ?? Includes an offi

Shoelace 7.7k Dec 26, 2022
Framework agnostic CLI tool for routes parsing and generation of a type-safe helper for safe route usage. 🗺️ Remix driver included. 🤟

About routes-gen is a framework agnostic CLI tool for routes parsing and generation of a type-safe helper for safe route usage. Think of it as Prisma,

Stratulat Alexandru 192 Jan 2, 2023
Lightweight, fast and framework-agnostic sse service for NodeJS

SSE service Lightweight, fast and framework-agnostic sse service for NodeJS Written on TS. Features Could be embedded to Express, Fastify, Nest, etc.

null 9 Dec 9, 2022