{"id":4872,"date":"2021-08-06T12:20:29","date_gmt":"2021-08-06T12:20:29","guid":{"rendered":"https:\/\/www.bearloga.space\/?page_id=4872"},"modified":"2021-08-06T12:20:30","modified_gmt":"2021-08-06T12:20:30","slug":"jquery-alertify-js","status":"publish","type":"page","link":"https:\/\/www.bearloga.space\/uk\/jquery-alertify-js\/","title":{"rendered":"jQuery \u2014 Alertify.js"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Alertify.js \u2014 \u044d\u0442\u043e \u043f\u043b\u0430\u0433\u0438\u043d jQuery \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u043f\u043e\u0432\u0435\u0449\u0435\u043d\u0438\u044f, \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0438\u0436\u0435 \u2014<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;!doctype html&gt;\n&lt;html lang = \"en\"&gt;\n   \n   &lt;head&gt;\n      &lt;meta charset = \"utf-8\"&gt;\n      &lt;title&gt;alertify.js - example page&lt;\/title&gt;\n      &lt;link rel = \"stylesheet\" href = \"alertify.core.css\" \/&gt;\n      &lt;link rel = \"stylesheet\" href = \"alertify.default.css\" id = \"toggleCSS\" \/&gt;\n      &lt;meta name = \"viewport\" content = \"width = device-width\"&gt;\n\t\t\n      &lt;style&gt;\n         .alertify-log-custom {\n            background: blue;\n         }\n      &lt;\/style&gt;\n   &lt;\/head&gt;\n\t\n   &lt;body&gt;\n      &lt;h2&gt;Dialogs&lt;\/h2&gt;\n\t\t\n      &lt;a href = \"#\" id = \"alert\"&gt;Alert Dialog&lt;\/a&gt;&lt;br&gt;\n      &lt;a href = \"#\" id = \"confirm\"&gt;Confirm Dialog&lt;\/a&gt;&lt;br&gt;\n      &lt;a href = \"#\" id = \"prompt\"&gt;Prompt Dialog&lt;\/a&gt;&lt;br&gt;\n      &lt;a href = \"#\" id = \"labels\"&gt;Custom Labels&lt;\/a&gt;&lt;br&gt;\n      &lt;a href = \"#\" id = \"focus\"&gt;Button Focus&lt;\/a&gt;&lt;br&gt;\n      &lt;a href = \"#\" id = \"order\"&gt;Button Order&lt;\/a&gt;\n\n      &lt;h2&gt;Ajax&lt;\/h2&gt;\n      &lt;a href = \"#\" id = \"ajax\"&gt;Ajax - Multiple Dialog&lt;\/a&gt;\n\n      &lt;h2&gt;Logs&lt;\/h2&gt;\n\t\t\n      &lt;a href = \"#\" id = \"notification\"&gt;Standard Log&lt;\/a&gt;&lt;br&gt;\n      &lt;a href = \"#\" id = \"success\"&gt;Success Log&lt;\/a&gt;&lt;br&gt;\n      &lt;a href = \"#\" id = \"error\"&gt;Error Log&lt;\/a&gt;&lt;br&gt;\n      &lt;a href = \"#\" id = \"custom\"&gt;Custom Log&lt;\/a&gt;&lt;br&gt;\n      &lt;a href = \"#\" id = \"delay\"&gt;Hide in 10 seconds&lt;\/a&gt;&lt;br&gt;\n      &lt;a href = \"#\" id = \"forever\"&gt;Persistent Log&lt;\/a&gt;\n\n      &lt;h2&gt;Themes&lt;\/h2&gt;\n      &lt;a href = \"#\" id = \"bootstrap\"&gt;Bootstrap Theme&lt;\/a&gt;\n\n      &lt;script src = \"https:\/\/code.jquery.com\/jquery-1.9.1.js\"&gt;\n      &lt;\/script&gt;\n      &lt;script src = \"alertify.min.js\"&gt;&lt;\/script&gt;\n\t\t\n      &lt;script&gt;\n         function reset () {\n            $(\"#toggleCSS\").attr(\"href\", \"alertify.default.css\");\n\t\t\t\t\n            alertify.set({\n               labels : {\n                  ok     : \"OK\",\n                  cancel : \"Cancel\"\n               },\n\t\t\t\t\tdelay : 5000,\n               buttonReverse : false,\n               buttonFocus   : \"ok\"\n            });\n         }\n         $(\"#alert\").on( 'click', function () {\n            reset();\n            alertify.alert(\"This is an alert dialog\");\n            return false;\n         });\n         $(\"#confirm\").on( 'click', function () {\n            reset();\n\t\t\t\t\n            alertify.confirm(\"This is a confirm dialog\", function (e) {\n               if (e) {\n                  alertify.success(\"You've clicked OK\");\n               } else {\n                  alertify.error(\"You've clicked Cancel\");\n               }\n            });\n\t\t\t\t\n            return false;\n         });\n         $(\"#prompt\").on( 'click', function () {\n            reset();\n\t\t\t\t\n            alertify.prompt(\"This is a prompt dialog\", function (e, str) {\n               if (e) {\n                  alertify.success(\"You've clicked OK and typed: \" + str);\n               } else {\n                  alertify.error(\"You've clicked Cancel\");\n               }\n            }, \"Default Value\");\n\t\t\t\t\n            return false;\n         });\n         $(\"#ajax\").on(\"click\", function () {\n            reset();\n\t\t\t\t\n            alertify.confirm(\"Confirm?\", function (e) {\n               if (e) {\n                  alertify.alert(\"Successful AJAX after OK\");\n               } else {\n                  alertify.alert(\"Successful AJAX after Cancel\");\n               }\n            });\n         });\n         $(\"#notification\").on( 'click', function () {\n            reset();\n            alertify.log(\"Standard log message\");\n            return false;\n         });\n         $(\"#success\").on( 'click', function () {\n            reset();\n            alertify.success(\"Success log message\");\n            return false;\n         });\n         $(\"#error\").on( 'click', function () {\n            reset();\n            alertify.error(\"Error log message\");\n            return false;\n         });\n         $(\"#delay\").on( 'click', function () {\n            reset();\n            alertify.set({ delay: 10000 });\n            alertify.log(\"Hiding in 10 seconds\");\n            return false;\n         });\n         $(\"#forever\").on( 'click', function () {\n            reset();\n            alertify.log(\"Will stay until clicked\", \"\", 0);\n            return false;\n         });\n         $(\"#labels\").on( 'click', function () {\n            reset();\n            alertify.set({ labels: { ok: \"Accept\", cancel: \"Deny\" } });\n\t\t\t\t\n            alertify.confirm(\"Confirm dialog with custom button labels\", function (e) {\n               if (e) {\n                  alertify.success(\"You've clicked OK\");\n               } else {\n                  alertify.error(\"You've clicked Cancel\");\n               }\n            });\n\t\t\t\t\n            return false;\n         });\n         $(\"#focus\").on( 'click', function () {\n            reset();\n            alertify.set({ buttonFocus: \"cancel\" });\n\t\t\t\t\n            alertify.confirm(\"Confirm dialog with cancel button focused\", function (e) {\n               if (e) {\n                  alertify.success(\"You've clicked OK\");\n               } else {\n                  alertify.error(\"You've clicked Cancel\");\n               }\n            });\n\t\t\t\t\n            return false;\n         });\n         $(\"#order\").on( 'click', function () {\n            reset();\n            alertify.set({ buttonReverse: true });\n\t\t\t\t\n            alertify.confirm(\"Confirm dialog with reversed button order\", function (e) {\n               if (e) {\n                  alertify.success(\"You've clicked OK\");\n               } else {\n                  alertify.error(\"You've clicked Cancel\");\n               }\n            });\n\t\t\t\t\n            return false;\n         });\n         $(\"#custom\").on( 'click', function () {\n            reset();\n            alertify.custom = alertify.extend(\"custom\");\n            alertify.custom(\"I'm a custom log message\");\n            return false;\n         });\n         $(\"#bootstrap\").on( 'click', function () {\n            reset();\n            $(\"#toggleCSS\").attr(\"href\", \".alertify.bootstrap.css\");\n\t\t\t\t\n            alertify.prompt(\"Prompt dialog with bootstrap theme\", function (e) {\n               if (e) {\n                  alertify.success(\"You've clicked OK\");\n               } else {\n                  alertify.error(\"You've clicked Cancel\");\n               }\n            }, \"Default Value\");\n\t\t\t\t\n            return false;\n         });\n\t\t\t\n      &lt;\/script&gt;\n   &lt;\/body&gt;\n&lt;\/html&gt;<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Alertify.js \u2014 \u044d\u0442\u043e \u043f\u043b\u0430\u0433\u0438\u043d jQuery \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435. \u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u043f\u043e\u0432\u0435\u0449\u0435\u043d\u0438\u044f, \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0438\u0436\u0435 \u2014 &lt;!doctype html&gt; [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[154],"tags":[],"class_list":["post-4872","page","type-page","status-publish","hentry","category-jquery"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/pages\/4872","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/comments?post=4872"}],"version-history":[{"count":0,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/pages\/4872\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/media?parent=4872"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/categories?post=4872"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/tags?post=4872"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}