Comments (10)
I don't think this is a good idea and here is why. Setting up options per notification type (rather than per notification) provides you the developer with a notification "framework" that keeps your messages to users consistent (logging frameworks do this). You have done the leg work of defining three types of notifications which is good, my recommendation is to configure those three types using the four provided in humane.
e.g.
humane.log.timeout = 1000;
humane.info.timeout = 3000;
humane.error.timeout = 0;
Now you've classified your logging system for your site. I could see making 'custom' types perhaps in the future, but do sites really need more than four classifications for notifications? I don't know, I usually use one :)
Marc
from humane-js.
I must disagree.
The current situation does not quite satisfy my motivating examples and current needs.
Also, a logging system is only superficially similar to a notification system. A notification framework forms part of the UI and as such must be as flexible and extensible as is required to meet user experience requirements. (Usually no such analog exists for app logging.) Furthermore, app logging is very "historical", decoupled, searchable, etc.; notifications are none of these and are only useful in the present.
On Jan 25, 2012, at 7:47 PM, Marc [email protected] wrote:
I don't think this is a good idea and here is why. Setting up options per notification type (rather than per notification) provides you the developer with a notification "framework" that keeps your messages to users consistent (logging frameworks do this). You have done the leg work of defining three types of notifications which is good, my recommendation is to configure those three types using the four provided in humane.
e.g.
humane.log.timeout = 1000; humane.info.timeout = 3000; humane.error.timeout = 0;Now you've classified your logging system for your site. I could see making 'custom' types perhaps in the future, but do sites really need more than four classifications for notifications? I don't know, I usually use one :)
Marc
Reply to this email directly or view it on GitHub:
#19 (comment)
from humane-js.
You listed three types above, I showed you a configuration for those three types, help me understand why does this not work for you?
from humane-js.
The first bullet point was an info message (type "info") that I would want to show for shorter than most other "type info" messages.
The second two bullets were both "error" type messages.
from humane-js.
Consider the alternative, currently, given my needs:
Setting options for the type about to be used, immediately before using it – every time! It feels (and is!) very, very dirty.
from humane-js.
I agree that is dirty nor will it really do what you want because it will override others in the queue of the same type when its time for them to shine. The API isn't very good for your use case. I'll think about it. Right now I could see doing:
var mycustomnotify = humane.create( { type: 'info', timeout: 1000, clickToClose: true } );
mycustomnotify('hello world')
from humane-js.
That would make more sense, yeah.
A few days ago, I modified the API to better suit my needs, where the second parameter is no longer a function, but an options hash (including a callback, still), capable of setting clickToClose, timeout, and an id
(for use in remove
, as I mentioned elsewhere). I haven’t had much time to test it, yet. Would you be interested in playing with it?
from humane-js.
I'll take a peak, is it in a fork?
from humane-js.
It’s not a fork and I likely won’t create a public fork, but I made this gist if you’re interested.
https://gist.github.com/1735493
Again, I haven’t had the opportunity to really test the changes yet or anything.
from humane-js.
ok @alanhogan, I put this in per the api outlined above, feel free to play around;
from humane-js.
Related Issues (20)
- Stacking of notifications HOT 2
- Limiting number of pending notifications HOT 1
- fatty theme not on bower HOT 2
- Indicator count for queued notifications HOT 3
- css styling in messages HOT 1
- Missing semicolon at the end of the non-minified source HOT 2
- bower install humane-js does not reflect #master HOT 4
- remove before log (or error/info/etc) together option HOT 2
- Humane stylesheet displays scrollbars when it shouldn't HOT 2
- Option to manually attach humane div. HOT 2
- Humane.js Customize Style
- please add links to cdn to README HOT 1
- custom html markup HOT 1
- Adding hyperlinks to notification? HOT 2
- Add unit tests HOT 1
- Support for confirm and alert custom dialog HOT 1
- Is there a way to get a clicked element in the callback?
- Text doesnt feed to notification
- Use new syntax of linear-gradient HOT 5
- how do you "stack" the notifications? getting overlapped one over the other HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from humane-js.