|
| 1 | +/// <reference path="../jquery/jquery.d.ts"/> |
| 2 | +/// <reference path="jquery.pnotify.d.ts" /> |
| 3 | + |
| 4 | +function test_pnotify() { |
| 5 | + |
| 6 | + |
| 7 | + $.pnotify({ |
| 8 | + title: 'Regular Notice', |
| 9 | + text: 'Check me out! I\'m a notice.' |
| 10 | + }); |
| 11 | + |
| 12 | + $.pnotify({ |
| 13 | + title: 'Sticky Notice', |
| 14 | + text: 'Check me out! I\'m a sticky notice. You\'ll have to close me yourself.', |
| 15 | + hide: false |
| 16 | + }); |
| 17 | + $.pnotify({ |
| 18 | + title: 'See Through Notice', |
| 19 | + text: 'No one ever pays attention to me. Why should they? I\'m practically invisible.', |
| 20 | + opacity: .8 |
| 21 | + }); |
| 22 | + $.pnotify({ |
| 23 | + title: 'No Shadow Notice', |
| 24 | + text: 'I don\'t have a shadow. (It\'s cause I\'m a vampire or something. Or is that reflections...)', |
| 25 | + shadow: false |
| 26 | + }); |
| 27 | + $.pnotify('Check me out! I\'m a notice.'); |
| 28 | + |
| 29 | + $.pnotify(Math.round(Math.random() * 9999)); |
| 30 | + |
| 31 | + $.pnotify({ |
| 32 | + title: 'PIcon Notice', |
| 33 | + text: 'I have an icon that uses the PIcon styles.', |
| 34 | + icon: 'picon picon-mail-unread-new' |
| 35 | + }); |
| 36 | + |
| 37 | + $.pnotify({ |
| 38 | + title: 'jQuery UI Icon Notice', |
| 39 | + text: 'I have an icon that uses the jQuery UI icon styles.', |
| 40 | + icon: 'ui-icon ui-icon-mail-closed' |
| 41 | + }); |
| 42 | + |
| 43 | + $.pnotify({ |
| 44 | + title: 'Bootstrap Icon Notice', |
| 45 | + text: 'I have an icon that uses the Bootstrap icon styles.', |
| 46 | + icon: 'glyphicon glyphicon-envelope' |
| 47 | + }); |
| 48 | + |
| 49 | + $.pnotify({ |
| 50 | + title: 'No Icon Notice', |
| 51 | + text: 'I have no icon.', |
| 52 | + icon: false |
| 53 | + }); |
| 54 | + |
| 55 | + $.pnotify({ |
| 56 | + title: 'Bootstrap Notice', |
| 57 | + text: 'Look at my beautiful styling! ^_^', |
| 58 | + styling: 'bootstrap3' |
| 59 | + }); |
| 60 | + $.pnotify({ |
| 61 | + title: 'Bootstrap Info', |
| 62 | + text: 'Look at my beautiful styling! ^_^', |
| 63 | + type: 'info', |
| 64 | + styling: 'bootstrap3' |
| 65 | + }); |
| 66 | + $.pnotify({ |
| 67 | + title: 'Bootstrap Success', |
| 68 | + text: 'Look at my beautiful styling! ^_^', |
| 69 | + type: 'success', |
| 70 | + styling: 'bootstrap3' |
| 71 | + }); |
| 72 | + $.pnotify({ |
| 73 | + title: 'Bootstrap Error', |
| 74 | + text: 'Look at my beautiful styling! ^_^', |
| 75 | + type: 'error', |
| 76 | + styling: 'bootstrap3' |
| 77 | + }); |
| 78 | + $.pnotify({ |
| 79 | + title: 'jQuery UI Notice', |
| 80 | + text: 'Look at my beautiful styling! ^_^', |
| 81 | + styling: 'jqueryui' |
| 82 | + }); |
| 83 | + $.pnotify({ |
| 84 | + title: 'jQuery UI Info', |
| 85 | + text: 'Look at my beautiful styling! ^_^', |
| 86 | + type: 'info', |
| 87 | + styling: 'jqueryui' |
| 88 | + }); |
| 89 | + $.pnotify({ |
| 90 | + title: 'jQuery UI Success', |
| 91 | + text: 'Look at my beautiful styling! ^_^', |
| 92 | + type: 'success', |
| 93 | + styling: 'jqueryui' |
| 94 | + }); |
| 95 | + $.pnotify({ |
| 96 | + title: 'jQuery UI Error', |
| 97 | + text: 'Look at my beautiful styling! ^_^', |
| 98 | + type: 'error', |
| 99 | + styling: 'jqueryui' |
| 100 | + }); |
| 101 | + $.pnotify({ |
| 102 | + title: 'Font Awesome Notice', |
| 103 | + text: 'Look at my beautiful styling! ^_^', |
| 104 | + styling: 'fontawesome' |
| 105 | + }); |
| 106 | + $.pnotify({ |
| 107 | + title: 'Font Awesome Info', |
| 108 | + text: 'Look at my beautiful styling! ^_^', |
| 109 | + type: 'info', |
| 110 | + styling: 'fontawesome' |
| 111 | + }); |
| 112 | + $.pnotify({ |
| 113 | + title: 'Font Awesome Success', |
| 114 | + text: 'Look at my beautiful styling! ^_^', |
| 115 | + type: 'success', |
| 116 | + styling: 'fontawesome' |
| 117 | + }); |
| 118 | + $.pnotify({ |
| 119 | + title: 'Font Awesome Error', |
| 120 | + text: 'Look at my beautiful styling! ^_^', |
| 121 | + type: 'error', |
| 122 | + styling: 'fontawesome' |
| 123 | + }); |
| 124 | + |
| 125 | + $.pnotify({ |
| 126 | + title: 'New Thing', |
| 127 | + text: 'Just to let you know, something happened.', |
| 128 | + type: 'info' |
| 129 | + }); |
| 130 | + |
| 131 | + $.pnotify({ |
| 132 | + title: 'Sticky Info', |
| 133 | + text: 'Sticky info, you know, like a newspaper covered in honey.', |
| 134 | + type: 'info', |
| 135 | + hide: false |
| 136 | + }); |
| 137 | + |
| 138 | + $.pnotify({ |
| 139 | + title: 'See Through Info', |
| 140 | + text: 'Not only does it not matter, but I don\'t even care if you see this info.', |
| 141 | + type: 'info', |
| 142 | + opacity: .8 |
| 143 | + }); |
| 144 | + |
| 145 | + $.pnotify({ |
| 146 | + title: 'No Shadow Success', |
| 147 | + text: 'I don\'t have a shadow. (It\'s cause I\'m a vampire or something. Or is that reflections...)', |
| 148 | + type: 'success', |
| 149 | + shadow: false |
| 150 | + }); |
| 151 | + |
| 152 | + $.pnotify({ |
| 153 | + title: 'PIcon Success', |
| 154 | + text: 'We reached the moon first! See, we planted a flag.', |
| 155 | + type: 'success', |
| 156 | + icon: 'picon picon-flag-green' |
| 157 | + }); |
| 158 | + |
| 159 | + $.pnotify({ |
| 160 | + title: 'Oh No!', |
| 161 | + text: 'Something terrible happened.', |
| 162 | + type: 'error' |
| 163 | + }); |
| 164 | + |
| 165 | + $.pnotify({ |
| 166 | + title: 'No Icon Error', |
| 167 | + text: 'I have no icon.', |
| 168 | + type: 'error', |
| 169 | + icon: false |
| 170 | + }); |
| 171 | + |
| 172 | + $.pnotify({ |
| 173 | + title: 'No Sticky Button Notice', |
| 174 | + text: 'Check me out! I\'m a sticky notice with no unsticky button. You\'ll have to close me yourself.', |
| 175 | + hide: false, |
| 176 | + sticker: false |
| 177 | + }); |
| 178 | + |
| 179 | + $.pnotify({ |
| 180 | + title: 'No Mouse Reset Notice', |
| 181 | + text: 'I don\'t care if you move your mouse over me, I\'ll disappear when I want.', |
| 182 | + mouse_reset: false |
| 183 | + }); |
| 184 | + |
| 185 | + $.pnotify({ |
| 186 | + title: '<em>Escaped Notice</em>', |
| 187 | + title_escape: true, |
| 188 | + text: $('#evil_html').html(), |
| 189 | + text_escape: true |
| 190 | + }); |
| 191 | + |
| 192 | + $.pnotify({ |
| 193 | + title: 'Non-Blocking Notice', |
| 194 | + text: 'I\'m a special kind of notice called "non-blocking". When you hover over me I\'ll fade to show the elements underneath. Feel free to click any of them just like I wasn\'t even here.\n\nNote: HTML links don\'t trigger in some browsers, due to security settings.', |
| 195 | + nonblock: true, |
| 196 | + nonblock_opacity: .2 |
| 197 | + }); |
| 198 | + |
| 199 | + $.pnotify({ |
| 200 | + title: 'Custom Styling', |
| 201 | + text: 'I have an additional class that\'s used to give me special styling. I always wanted to be pretty.', |
| 202 | + addclass: 'custom', |
| 203 | + icon: 'picon picon-32 picon-fill-color', |
| 204 | + opacity: .8, |
| 205 | + nonblock: true, |
| 206 | + nonblock_opacity: .2 |
| 207 | + }); |
| 208 | + |
| 209 | + $.pnotify({ |
| 210 | + title: "PNotify Stacks", |
| 211 | + text: "Stacks are used to position notices and determine where new notices will go when they're created. Each notice that's placed into a stack will be positioned related to the other notices in that stack. There is no limit to the number of stacks, and no limit to the number of notices in each stack.", |
| 212 | + type: "info", |
| 213 | + icon: "fa fa-bars", |
| 214 | + delay: 20000, |
| 215 | + history: false, |
| 216 | + stack: false |
| 217 | + }); |
| 218 | + |
| 219 | + var type = "error"; |
| 220 | + var stack_bottomright = {"dir1": "up", "dir2": "left", "firstpos1": 25, "firstpos2": 25}; |
| 221 | + |
| 222 | + var opts = { |
| 223 | + title: "Over Here", |
| 224 | + text: "Check me out. I'm in a different stack.", |
| 225 | + addclass: "stack-bar-top", |
| 226 | + cornerclass: "", |
| 227 | + width: "100%", |
| 228 | + stack: stack_bottomright, |
| 229 | + type: "error" |
| 230 | + |
| 231 | + }; |
| 232 | + $.pnotify(opts); |
| 233 | + |
| 234 | + $.pnotify({ |
| 235 | + title: 'Show Effect', |
| 236 | + text: 'I use a different effect.', |
| 237 | + animation: 'show' |
| 238 | + }); |
| 239 | + |
| 240 | + $.pnotify_remove_all(); |
| 241 | + |
| 242 | +} |
0 commit comments