Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where is the website? #159

Open
aleabodo opened this issue Jul 20, 2018 · 9 comments
Open

Where is the website? #159

aleabodo opened this issue Jul 20, 2018 · 9 comments

Comments

@aleabodo
Copy link

https://alertifyjs.org is gone. Yesterday the package disappeared in npmjs.com (Today back again). Is this package still supported and are we going to have the documentation back?

@bmcx
Copy link

bmcx commented Jul 25, 2018

@aleabodo i dont knw wht happen't to the site, but you should use achive.org ;)
https://web.archive.org/web/20180402165002/https://alertifyjs.org/

@jesobreira
Copy link

jesobreira commented Aug 16, 2018

One month and the website is still down. At least the repo owners could set it up on a Github Pages for free...

But since the last commit was 2 years ago, I wonder if this project is still maintained.

https://i.ytimg.com/vi/xZ_JiU7L9Zk/hqdefault.jpg

@rbrlortie
Copy link

rbrlortie commented Oct 2, 2018

Here it is:

alertify.js

Simple browser dialogs v1.0.10

file_download Download Now

Alertify.js is a small library which provides light-weight, high performance browser dialogs. Since it uses only 1 HTTP request and a payload of less than 3kB, it's a great option for adding basic style to alert, dialog, prompt and log messages even on low bandwidth connections.

Getting Started

Notes

We're working to get the latest version on all major public CDN's but until then, you'll need to either use a GitHub raw service, download it, or install via NPM or Bower.

Obviously, if you're installing via Bower or NPM, you'll need to include the files in the "dist" directory in your HTML for everything to work. But you knew that already.

It's also worth noting that the CSS is bundled by default, so there's no need to include any stylesheets to use the default theme. It's dyamically inserted before any other elements (like) stylesheets so it's super easy to override with your own styles.

Via RawGit

<-- standard version -->
<script src="https://cdn.rawgit.com/alertifyjs/alertify.js/v1.0.10/dist/js/alertify.js"></script>

<-- angular module -->
<script src="https://cdn.rawgit.com/alertifyjs/alertify.js/v1.0.10/dist/js/ngAlertify.js"></script>

Via Bower

bower install --save alertifyjs

Via NPM

npm install --save alertify.js

Disabling CSS Injection

If you don't want to inject CSS for some reason, just insert your own styles (any style or link element with an id of alertifyCSS) before the javascript file:

<script src="/path/to/alertify.js"></script>

AngularJS

An AngularJS module is also included. It's in the "ngAlertify.js" file, so use that instead if you're building an AngularJS app.

If you want to check out a live demo of log messages with ngAlertify, click here.

Initialize ngAlertify

// Make sure to include the ngAlertify.js file.
angular
		.module("myApp", \["ngAlertify"\])
		.controller("myController", function($scope, alertify) {
				alertify.success("Welcome to alertify!");
		});

Performance

Alertify is designed from the ground-up for great performance and a small footprint. That means it's not as feature-rich as some other options. That's on purpose. We don't plan on adding a lot more features so it stays a great option for every kind of website and user.

Currently, the entire library, with JavaScript and CSS is ~2.29 kB (gzipped), and getting smaller all the time. That's quite impressive considering it's only a single HTTP request, and no external dependencies at all being required.

The Angular module is only 2.32kB, so that's light, too!

Usage

Dialogs

Alert Dialog

Dialogs display a text and require user to acknowledge the message.

Try It

Code Example
alertify.alert("Message");
Confirm Dialog

Try It

Code Example
// confirm dialog
alertify.confirm("Message", function () {
		// user clicked "ok"
}, function() {
		// user clicked "cancel"
});
Prompt Dialog

Try It

Code Example
alertify
	.defaultValue("Default Value")
	.prompt("This is a prompt dialog",
		function (val, ev) {

			// The click event is in the event variable, so you can use it here.
			ev.preventDefault();

			// The value entered is availble in the val variable.
			alertify.success("You've clicked OK and typed: " + val);

		}, function(ev) {

			// The click event is in the event variable, so you can use it here.
			ev.preventDefault();

			alertify.error("You've clicked Cancel");

		}
	});
Custom Labels

You're not limited to the "Ok" and "Cancel" button labels. You can easily set your own labels.

Try It

Code Example
alertify
	.okBtn("Accept")
	.cancelBtn("Deny")
	.confirm("Confirm dialog with custom button labels", function (ev) {

			// The click event is in the
			// event variable, so you can use
			// it here.
			ev.preventDefault();
			alertify.success("You've clicked OK");

	}, function(ev) {

			// The click event is in the
			// event variable, so you can use
			// it here.
			ev.preventDefault();

			alertify.error("You've clicked Cancel");

	});
Ajax - Multiple Dialog

Try It

Code Example
alertify.confirm("Confirm?", function (ev) {

		// The click event is in the
		// event variable, so you can use
		// it here.
		ev.preventDefault();

		alertify.alert("Successful AJAX after OK");


}, function(ev) {

		// The click event is in the
		// event variable, so you can use
		// it here.
		ev.preventDefault();

		alertify.alert("Successful AJAX after Cancel");

});
Promise Aware

If your browser supports promises, you can use them instead of callbacks

Try It

Code Example
if ("function" !== typeof Promise) {
		alertify.alert("Your browser doesn't support promises");
		return;
}

alertify.confirm("Confirm?").then(function (resolvedValue) {
		// "resolvedValue" is an object with the following keys:
		// buttonClicked
		// inputValue (only for prompts)
		// event

		// The click event is in
		// resolvedValue, so you can use
		// it here.
		resolvedValue.event.preventDefault();
		alertify.alert("You clicked the " + resolvedValue.buttonClicked + " button!");
});

Log Messages

Setting the Position

Try It

Code Example
alertify.delay(1000); // This is just to make the demo go faster.
alertify.log("Default botoom left position");
setTimeout(function() {
		alertify.logPosition("top left");
		alertify.log("top left");
}, 1500);
setTimeout(function() {
		alertify.logPosition("top right");
		alertify.log("top right");
}, 3000);
setTimeout(function() {
		alertify.logPosition("bottom right");
		alertify.log("bottom right");
}, 4500);
setTimeout(function() {
		alertify.reset(); // Puts the message back to default position.
		alertify.log("Back to default");
}, 6000);
Setting the parent element

You can set where parent element where Alertify is appended into the DOM.

Code Example

// By default, Alertify is appended to document.body.
// You can easily change that, though, like this:
var elem = document.getElementById("my-element");
alertify.parent(elem);

Standard Log

Try It

Code Example
alertify.log("Standard log message");
Standard Log With HTML

HTML works just fine in log messages. Have at it!

Try It

Code Example
var msg = "<img src='https://placehold.it/256x128'>" +
					"<h3>This is HTML</h3>" +
					"<p>It's great, right?</p>";
alertify.log(msg);
Standard Log with callback

Keep in mind that the when setting a callback, clicking the log message doesn't automatically close the log message, which is different than previous functionality. This means that the callback could be called multiple times if the user clicks multiple times. If you're callback is an action that must be completed only once, you'll need to keep track of that separately.

Try It

Code Example
alertify.log("Standard log message with callback", function(ev) {

		// The click event is in the
		// event variable, so you can use
		// it here.
		ev.preventDefault();

		alertify.log("You clicked the notification");

});
Success Log

Try It

Code Example
alertify.success("Success log message");
Success Log with callback

Try It

Code Example
alertify.success("Standard log message with callback", function(ev) {

		// The click event is in the
		// event variable, so you can use
		// it here.
		ev.preventDefault();

		alertify.success("You clicked the notification");

});
Error Log

Try It

Code Example
alertify.error("Error log message");
Error Log with callback

Try It

Code Example
alertify.error("Standard log message with callback", function(ev) {

		// The click event is in the
		// event variable, so you can use
		// it here.    ev.preventDefault();
		alertify.error("You clicked the notification");

});
Closing Log On Click

Try It

Code Example
alertify
	.closeLogOnClick(true)
	.log("Click me to close!");
Disable Log On Click

Clicking on a log message to close is disabled by default, but if you've enabled it and need to reset it to disabled, you can do so very easily.

The decision to disable it by default was to allow any type of html to be included in the log messages, including links.

Try It

Code Example
alertify
	.closeLogOnClick(true)
	.log("Click me to close!")
	.closeLogOnClick(false)
	.log("You can't click to close this!");
Hide in 10 seconds

Try It

Code Example
alertify.delay(10000).log("Hiding in 10 seconds");
Persistent Log

Persistent log messages will stay until clicked (if closeLogOnClick(true) is set) or until forcibly removed when the number of messages exceeds the maxLogItems setting.

Try It

Code Example
alertify.delay(0).log("Will stay until clicked");
Maximum Number of Log Messages

You can easily set the maximum number of log/success/error messages that will be displayed at a single time. The default is two.

Try It

Code Example
alertify
	.maxLogItems(1)
	.log("This is the first message");

// The timeout is just for visual effect.
setTimeout(function() {
	alertify.log("The second message will force the first to close.");
}, 1000);
Setting a template for logs

You can change the template for all logs.

Try It

Code Example
alertify
	.setLogTemplate(function (input) { return 'log message: ' + input; })
	.log("This is the message");

Other Options

Resetting Default Values

When you change values like the button labels, delays, default prompt values or placeholders, etc., you can easily reset the defaults.

Try It

Code Example
// Notice the okay button is not the custom value, it was reset.
alertify
	.okBtn("Go For It!")
	.reset()
	.alert("Custom values were reset!");

@dshastry
Copy link

I've been needing to see live examples that the site had before it went down so I grabbed the website folder from the repo, updated the links and threw it on my server. Hope it helps!

http://dev.davidshastry.com/alertify/

@SamMorrowDrums
Copy link

Rawgit reaches actual end of life in October, so also, an alternative CDN solution would really be an important move to make for the website / documentation.

Rawgit's suggestion of jsdelivr seems like the most appropriate choice for now.

https://cdn.jsdelivr.net/gh/alertifyjs/alertify.js@v1.0.10/dist/js/alertify.js

@jesobreira
Copy link

That's why I believe GH Pages is there for that and project websites should be hosted nowhere else...

@dshastry your mirror has gone too?

@GregOriol
Copy link

@jesobreira You should probably switch away from this project as it is unmaintained... a website is not needed at this point

@jesobreira
Copy link

I have a huge legacy codebase that uses this lib... To be honest, it's a better option for me if I keep giving this library the maintenance and attention it deserves, but I'd like to check how the old maintainers would see it first...

I could get the website at Web Archive and host it in GH Pages but as the footer states, it's a copyrighted work...

@dshastry
Copy link

dshastry commented Apr 8, 2021

@jesobreira : http://davidshastry.com/dev/alertify/

Sorry moved webhosts to URL changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants