Code Monkey home page Code Monkey logo

smoke.js's Introduction

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.

smoke.js's People

Contributors

jyoungblood avatar korzha avatar thomasperraudin avatar

Stargazers

David Ochoa avatar  avatar dahui avatar  avatar Adnan Ahmed avatar  avatar Ersoy Filinte avatar Michael Ward avatar  avatar  avatar  avatar Yasin ATEŞ avatar  avatar pedoc avatar Ilhan Ahmad avatar  avatar Gordon avatar TinaLin avatar vulcangz avatar Jack Chang avatar  avatar Divine avatar GerritV avatar  avatar  avatar Guilherme Chafy avatar Abhijith Vijayan avatar  avatar Sean Powell avatar Pavel avatar Akey Zhang avatar jeking avatar bae jong young avatar Andres Garcia avatar AngeelRdz avatar Max avatar Mert Cankat avatar Jassy avatar Rodrigo Rosenfeld Rosas avatar pisces avatar  avatar Simon Benjámin avatar Pavel Salauyou avatar Rajkumar Magar avatar Stanislav (Stas) Katkov avatar Tobias Goecke (Göcke) avatar Nikolaus Schlemm avatar Ivan Vartanyan avatar  avatar Brian Lee avatar Adarsh Pathak avatar Sercan REYHANLI avatar Jovin Mwilanga avatar Đức An avatar  avatar  avatar sbhamad avatar Almamun avatar Alex avatar Colin Dekker avatar Richard Hess avatar Adriano avatar  avatar  avatar Miles avatar İzni Burak Demirtaş avatar Adem ilter avatar Cosmin Popovici avatar Hung Q. Le avatar Ken Huang avatar kuus avatar Zach Barnes avatar Jackeitor avatar Jordan Coeyman avatar Ankith Amtange avatar Oleh Aleinyk avatar Yao Cheng avatar Roman Ožana avatar fishchen avatar Renato Carvalho avatar Lennard van Gunst avatar AJ avatar Gordon Zhu avatar Pascal Maniraho avatar  avatar 曹文忠 avatar wangzhw avatar Yin Gang avatar 张骏龙 avatar xinhua avatar Michael Sprague avatar David Bautista avatar Yizhao He avatar Ngoni Murove avatar Simon avatar Philipp Andreychev avatar thewisenerd avatar 可乐 avatar Sanapoint 曾几何 avatar Vicky Dasta avatar

Watchers

 avatar sharper avatar Gary Von Schilling avatar That's me avatar Ola avatar Richard Hess avatar Jason Cole avatar  avatar Danny Sterne avatar  avatar James Cloos avatar Brian McCann avatar Michael Anthony avatar Adib Hanna avatar  avatar Tuna Aras avatar Ricardo avatar Huy Huynh avatar Innocent J. Blacius avatar Nurlan Mukhanov avatar Tali Walt avatar Pete Yan avatar Ivan Cutipa avatar Alex avatar mzsk avatar  avatar  avatar

smoke.js's Issues

Touch events cause problems with smoke.confirm on mobile Safari

Really loving this library, really nice.

But - there seems to be an issue with touch functions (touchstart, touchend, etc) in mobile safari.

Check the modified demo.html I've put up at http://mima.x.se/nils/smoke/demo.html

Apart from demo.html I've used the original package from github.

The confirm link has been modified to activate on "touchend" which screws up the confirm (it disappears within a fraction of a second). Binding it to a click event works fine.

User String on the iPad used:

Mozilla/5.0 (iPad; CPU OS 5_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B176 Safari/7534.48.3

Globally change "ok" and "cancel" labels

Is it possible to update "ok" and "cancel" labels avoiding to specify this in all Smoke calls?

Sorry if I've duplicated the issue that I've already open some days ago but I don't know if you receive notifications if I add a comment on a closed issue.

You can see the comment here:
#37 (comment)

Global destroy method

Is there anyway to access the destroy method globally using the smoke object? For example, if you are using the smoke library in Backbone and wanted to destroy the smoke object when navigating from one route to the other

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"}]

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.

smoke.signal ... the previous way

I am using smoke.js for a long time. I already wrote about this library on my blog: #manejandodatos Smoke.Js for showing alerts and messages - http://www.manejandodatos.es/2013/10/smoke-js-showing-alerts-messages

In a previous version of this library I code something like this:

smoke.signal('Message', 1000);

where 1000 is the time that the funcion is working!

A few days ago, I updated smoke.js to the new version and I have noticed that the previous function is not working anymore!

Although I can notice the improvement is the new "smoke.signal" allowing callbacks, is there any chance to have a "smoke.signal2" function like in the previous version?

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

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.

minified version is missing semicolon at the end

Hi,

the minified version is missing a semicolon at the end.

You fixed that once by a0cce74 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

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?

DOM is overwhelmed by residual .smoke-base elements

I use smoke.js in a web app (with no page reload in a full day time). Each time smoke is used, it adds a new element to the body. This kind of element :

<div id="smoke-out-1428659028629.3865" class="smoke-base" style="z-index: 1000;"></div>

To keep a clean DOM and for performance reasons I would like to get read of these elements. Could this be done automatically each time the alert is closed ?

Android explorer trouble

In the android explorer it doesn't slides with the scroll, only stays at the top of the document, I've used smok.js on a responsive design project but on my phone stays at the top of the document.

smoke.quiz does not work in IE

When using smoke.quiz with Internet Explorer the function does not return anything. 'e' is blank.
Seems ok in Chrome.

Better documentation for classname property

Given that the name is singular, it seems to indicate that it takes a single class as a string, However, in my testing it will take more than one, space delimited class name. You should consider updating the docs to reflect that.

can I use smoke.js to have an notification without a click

Dear all
I would like to use smoke.js for my site, unfortunately I do not have much knowledge of javascript, neither on php but OK I trying to learn.
What I have and I need to change is when I submit for something (e.g for contact) if is successful or not returns an output a simple link like this

$title = $error == 0 ? l(completed_ok') : ($error !== 0? l('error') : l('warning'));
$note = (!$note || empty($note)) ? '' : '<p>'.$note.'</p>';
$goto = '<p><a href="'._URL.'">'.l('home').'</a></p>';
$output = '<h3>'.$title.'</h3>'.$note.$goto;

My question is can I use smoke.js to have an notification without a click
and If I am not asking too much, is it possible to give me any example!
Thank in advance.

stacking messages...

When running the script

smoke.alert('this is #1 alert');
smoke.alert('this is #2 alert');

we only get 1 alert instead of 2, it could be great to have these alert stacked one under the other

nested smoke functions aren't working anymore

i realized it'd be better if the callback functions behaved like, you know, actual callback functions.

for instance, on the demo site there are nested smoke dialogs that should get written right after the previous dialog finishes, but it's getting written before and being destroyed when the parent is. this concept seemed to work before, but something (outside this lib) changed and exposed this bug.

anyway, i'm going to change this when i have time. or someone else can. any volunteers?

Big ol' list for 1.0 version

That's right, we're breathing some new life into this little library.

I've been wanting to do this for several years, but resources are limited and I have a job and a family and a life. No idea when I'll actually be able to make this happen but I'm putting my list of potential and planned improvements here.


  • also want to make an updated demo/docs site, ofc (smoke.js.org)
  • respond to all the open issues (and any relevant closed ones) if there's anything relevant / fixed in the new version.
    • sorry if anyone feels neglected, not trying to hurt anyones feelings 🥺

  • need to update the url for smoke.js.org (url update?)

keyboard control

Unlike real alerts, smoke does not respond to keyboard control. I think space and enter should activate the ok button. In any case it should behave the same way as the native dialogs.

Rabbit divs

smoke-base keeps multiplying on every alert.

keyboard and semantics issues

currently:

  • the dialogs are not modal for keyboard users
  • the examples cannot be activated with the keyboard.
  • the semantics of the pseduo dialogs are not provided to assitive tech users

Suggest checking out the follwoing design patterns:
http://www.w3.org/WAI/PF/aria-practices/#alert
http://www.w3.org/WAI/PF/aria-practices/#alertdialog
http://www.w3.org/WAI/PF/aria-practices/#dialog_modal
this may also be helpful:
http://www.w3.org/WAI/PF/aria-practices/#kbd_focus
and example of an accessibel dialog:
http://hanshillen.github.com/jqtest/#goto_dialog

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.

Dialog buttons are triggered by keyup from submitting form

When I submit a form using return key, server processes, sends back result, browser parses, throws up smoke confirm window - the keyup from the return key seems to 'Ok' that dialog.. as much as I like the speed of these boxes and the internal network, is there a fix or workaround for this?

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.