| 190 | |
| 191 | // markItUp! markups |
| 192 | function magicMarkups(string) { |
| 193 | if (string) { |
| 194 | string = string.toString(); |
| 195 | string = string.replace(/\(\!\(([\s\S]*?)\)\!\)/g, |
| 196 | function(x, a) { |
| 197 | var b = a.split('|!|'); |
| 198 | if (altKey === true) { |
| 199 | return (b[1] !== undefined) ? b[1] : b[0]; |
| 200 | } else { |
| 201 | return (b[1] === undefined) ? "" : b[0]; |
| 202 | } |
| 203 | } |
| 204 | ); |
| 205 | // [![prompt]!], [![prompt:!:value]!] |
| 206 | string = string.replace(/\[\!\[([\s\S]*?)\]\!\]/g, |
| 207 | function(x, a) { |
| 208 | var b = a.split(':!:'); |
| 209 | if (abort === true) { |
| 210 | return false; |
| 211 | } |
| 212 | value = prompt(b[0], (b[1]) ? b[1] : ''); |
| 213 | if (value === null) { |
| 214 | abort = true; |
| 215 | } |
| 216 | return value; |
| 217 | } |
| 218 | ); |
| 219 | return string; |
| 220 | } |
| 221 | return ""; |
| 222 | } |
| 223 | |
| 224 | // prepare action |
| 225 | function prepare(action) { |