SHOW:
|
|
- or go back to the newest paste.
| 1 | function zeroPad(num, places) {
| |
| 2 | var zero = places - num.toString().length + 1; | |
| 3 | return Array(+(zero > 0 && zero)).join("0") + num;
| |
| 4 | } | |
| 5 | ||
| 6 | - | var parts = item.newBasename.match(/^(.+)_(\d+)$/); |
| 6 | + | var parts = item.newBasename.match(/^(.+)-(\d+)$/); |
| 7 | ||
| 8 | if (app.global === undefined) {
| |
| 9 | app.global = {};
| |
| 10 | } | |
| 11 | if ( app.global[parts[1]] === undefined ) {
| |
| 12 | app.global[parts[1]] = []; | |
| 13 | } | |
| 14 | ||
| 15 | app.global[parts[1]].push(parts[0]); | |
| 16 | ||
| 17 | return parts[1] + '_' + zeroPad(app.global[parts[1]].length, 3); |