|
686 | 686 | }; |
687 | 687 |
|
688 | 688 | const strings = self.getString(); |
689 | | - const message = args.message || strings.confirm || ''; |
690 | | - const title = strings.confirmation || 'confirmation'; |
691 | | - const yes = strings.yes || 'yes'; |
692 | | - const cancel = strings.cancel || 'cancel'; |
| 689 | + const message = args.message || strings?.confirm || ''; |
| 690 | + const title = strings?.confirmation || 'confirmation'; |
| 691 | + const yes = strings?.yes || 'yes'; |
| 692 | + const cancel = strings?.cancel || 'cancel'; |
693 | 693 |
|
694 | 694 | $.confirm({ |
695 | 695 | title: title, |
|
940 | 940 | error: function (error) { |
941 | 941 |
|
942 | 942 | const strings = self.getString('activation'); |
943 | | - const title = strings.error || 'activation'; |
| 943 | + const title = strings?.error || 'activation'; |
944 | 944 |
|
945 | 945 | const globalStrings = self.getString('global'); |
946 | | - const message = globalStrings.error || 'error'; |
| 946 | + const message = globalStrings?.error || 'error'; |
947 | 947 |
|
948 | 948 | self.popupMore(title, message, 'error'); |
949 | 949 |
|
|
976 | 976 | if (!files.length) { |
977 | 977 | self.unloading(form); |
978 | 978 | const strings = self.getString('upload'); |
979 | | - const message = strings.error || 'error'; |
| 979 | + const message = strings?.error || 'error'; |
980 | 980 | self.notify(message, 'warning'); |
981 | 981 | return; |
982 | 982 | } |
|
1430 | 1430 |
|
1431 | 1431 | // Check file size |
1432 | 1432 | if (file.size > args.size) { |
1433 | | - self.notify(strings.size, 'warning', 0); |
| 1433 | + self.notify(strings?.size, 'warning', 0); |
1434 | 1434 | input.val(''); |
1435 | 1435 | return; |
1436 | 1436 | } |
|
1456 | 1456 | // Set content |
1457 | 1457 | parent.addClass('uploaded'); |
1458 | 1458 | if (span.length) { |
1459 | | - span.text(strings.added); |
| 1459 | + span.text(strings?.added); |
1460 | 1460 | } else { |
1461 | | - label.appendChild(`<span>${strings.added}</span>`) |
| 1461 | + label.appendChild(`<span>${strings?.added}</span>`) |
1462 | 1462 | } |
1463 | 1463 |
|
1464 | 1464 | if (icon.length) { |
|
1814 | 1814 |
|
1815 | 1815 | const strings = self.getString('cookie'); |
1816 | 1816 | const more = self.getString('more'); |
1817 | | - const title = strings.title || 'title'; |
1818 | | - const message = strings.message || 'message'; |
1819 | | - const accept = strings.accept || 'accept'; |
1820 | | - const decline = strings.decline || 'decline'; |
| 1817 | + const title = strings?.title || 'title'; |
| 1818 | + const message = strings?.message || 'message'; |
| 1819 | + const accept = strings?.accept || 'accept'; |
| 1820 | + const decline = strings?.decline || 'decline'; |
1821 | 1821 |
|
1822 | 1822 | let link = self.getLinking('privacy'); |
1823 | 1823 | link = self.getBaseUrl(link, true); |
|
2008 | 2008 |
|
2009 | 2009 | // getString |
2010 | 2010 | VanillePlugin.getString = function (item) { |
2011 | | - const strings = plugin.strings; |
| 2011 | + const strings = plugin.strings || {}; |
2012 | 2012 | if (item !== undefined) { |
2013 | 2013 | return strings[item] ?? null; |
2014 | 2014 | } |
|
0 commit comments