ã·ã³ãã«ãªéç¥ãå®è£ ã§ãã JavaScript ãã©ã°ã¤ã³ãnotie.jsãã®ä½¿ãæ¹
ãªã¬ã® Advent Calendar 2015 - Adventar ã® 16 æ¥ç®ã§ã.
phpshpot ããã®ã¨ã³ããªã¼ ããã¼ã¸ã®ä¸ããåºã¦ããéç¥çªã表示ãããã¨ãã§ãããnotie.jsã:phpspotéçºæ¥èªã ã§ç´¹ä»ããã¦ãã notie.js ã使ã£ã¦ã¿ã¾ãã.
è¯ãæãã ã£ãã®ã§å®éã«åãåä½ãµã³ãã«å«ãç´¹ä»ãããã¨æãã¾ã.
ãnotie.jsãã¨ã¯ï¼
å ¬å¼ãã
A clean and simple notification plugin (alert/growl style) for javascript, with no dependencies.
JavaScript ã®ããã§ã¯ãªã¼ã³(ããããä¾åæ§ããªãã£ã¦ãã¨)ã§ã·ã³ãã«ãªéç¥ã©ã¤ãã©ãªã§ã. çãªãã¨ãæ¸ããã¦ãã¾ã.
- Official ... https://jaredreich.com/projects/notie.js/
- Github ... https://github.com/jaredreich/notie.js
ãnotie.jsããã¢
ãnotie.jsãã®ä½¿ãæ¹
Install
cdn çµç·¯ã§èªã¿è¾¼ã¿ã¾ã.
github ãè¦ãéãã ã¨ã¾ã ãªãªã¼ã¹ãã¼ã¸ã§ã³ããªãããã ã£ãã®ã§ commit ãã¼ã¸ã§ã³ããã¦ãã㦠cdngit çµç±ã§èªã¿è¾¼ãã§ãã¾ã.
<body>
...
<script src='https://cdn.rawgit.com/jaredreich/notie.js/a9e4afbeea979c0e6ee50aaf5cb4ee80e65d225d/notie.js'></script>
</body>
head ã§èªã¿è¾¼ãã¨ã¨ã©ã¼ã«ãªãã¿ãããªã®ã§ body ã§èªã¿è¾¼ãããã«ã£ã¦ã¨ãã ãã注æãã ãã.
Usage
ãã¨ã¯å®éã« notie ã®æã¤ã¡ã½ãããå¼ã¶ã ãã§ã.
notie.alert
alert ã§ã.
notie.alert(style_number, 'message', time_in_seconds);
notie.confirm
confirm(Yes/no) ã§ãã.
notie.confirm('Title text', 'Yes button text', 'No button text', yes_callback)
æå¾ã®ã³ã¼ã«ããã¯ã¯ yes ã®ã¨ãã®ã¿å¼ã°ãããã¨ã«ã注æãã ãã.
notie.input
ã¤ã³ãããã§ãã. ããã¹ããå ¥åã§ãã¾ã. ã³ã¼ã«ããã¯ã¯ yes ãé¸æããã¨ãã ãå¼ã°ãã¦, 第ä¸å¼æ°ã«å ¥åããå 容ã渡ããã¾ã.
notie.input('Title text', 'Submit button text', 'Cancel button text', 'type', 'placeholder', submit_callback, 'Optional pre-filled value');