fomantic-ui 2.10.0-beta.5 → 2.10.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/accordion.css +1 -1
- package/dist/components/accordion.js +1 -1
- package/dist/components/accordion.min.css +1 -1
- package/dist/components/accordion.min.js +1 -1
- package/dist/components/ad.css +1 -1
- package/dist/components/ad.min.css +1 -1
- package/dist/components/api.js +1 -1
- package/dist/components/api.min.js +1 -1
- package/dist/components/breadcrumb.css +1 -1
- package/dist/components/breadcrumb.min.css +1 -1
- package/dist/components/button.css +1 -1
- package/dist/components/button.min.css +1 -1
- package/dist/components/calendar.css +1 -1
- package/dist/components/calendar.js +1 -1
- package/dist/components/calendar.min.css +1 -1
- package/dist/components/calendar.min.js +1 -1
- package/dist/components/card.css +1 -1
- package/dist/components/card.min.css +1 -1
- package/dist/components/checkbox.css +1 -1
- package/dist/components/checkbox.js +1 -1
- package/dist/components/checkbox.min.css +1 -1
- package/dist/components/checkbox.min.js +1 -1
- package/dist/components/comment.css +1 -1
- package/dist/components/comment.min.css +1 -1
- package/dist/components/container.css +1 -1
- package/dist/components/container.min.css +1 -1
- package/dist/components/dimmer.css +1 -1
- package/dist/components/dimmer.js +1 -1
- package/dist/components/dimmer.min.css +1 -1
- package/dist/components/dimmer.min.js +1 -1
- package/dist/components/divider.css +1 -1
- package/dist/components/divider.min.css +1 -1
- package/dist/components/dropdown.css +1 -1
- package/dist/components/dropdown.js +29 -43
- package/dist/components/dropdown.min.css +1 -1
- package/dist/components/dropdown.min.js +2 -2
- package/dist/components/embed.css +1 -1
- package/dist/components/embed.js +26 -8
- package/dist/components/embed.min.css +1 -1
- package/dist/components/embed.min.js +2 -2
- package/dist/components/emoji.css +1 -1
- package/dist/components/emoji.min.css +1 -1
- package/dist/components/feed.css +1 -1
- package/dist/components/feed.min.css +1 -1
- package/dist/components/flag.css +1 -1
- package/dist/components/flag.min.css +1 -1
- package/dist/components/flyout.css +1 -1
- package/dist/components/flyout.js +13 -18
- package/dist/components/flyout.min.css +1 -1
- package/dist/components/flyout.min.js +2 -2
- package/dist/components/form.css +1 -1
- package/dist/components/form.js +1 -1
- package/dist/components/form.min.css +1 -1
- package/dist/components/form.min.js +1 -1
- package/dist/components/grid.css +1 -1
- package/dist/components/grid.min.css +1 -1
- package/dist/components/header.css +1 -1
- package/dist/components/header.min.css +1 -1
- package/dist/components/icon.css +1 -1
- package/dist/components/icon.min.css +1 -1
- package/dist/components/image.css +1 -1
- package/dist/components/image.min.css +1 -1
- package/dist/components/input.css +1 -1
- package/dist/components/input.min.css +1 -1
- package/dist/components/item.css +1 -1
- package/dist/components/item.min.css +1 -1
- package/dist/components/label.css +1 -1
- package/dist/components/label.min.css +1 -1
- package/dist/components/list.css +1 -1
- package/dist/components/list.min.css +1 -1
- package/dist/components/loader.css +1 -1
- package/dist/components/loader.min.css +1 -1
- package/dist/components/menu.css +1 -1
- package/dist/components/menu.min.css +1 -1
- package/dist/components/message.css +1 -1
- package/dist/components/message.min.css +1 -1
- package/dist/components/modal.css +1 -1
- package/dist/components/modal.js +13 -18
- package/dist/components/modal.min.css +1 -1
- package/dist/components/modal.min.js +2 -2
- package/dist/components/nag.css +1 -1
- package/dist/components/nag.js +1 -1
- package/dist/components/nag.min.css +1 -1
- package/dist/components/nag.min.js +1 -1
- package/dist/components/placeholder.css +1 -1
- package/dist/components/placeholder.min.css +1 -1
- package/dist/components/popup.css +1 -1
- package/dist/components/popup.js +5 -7
- package/dist/components/popup.min.css +1 -1
- package/dist/components/popup.min.js +2 -2
- package/dist/components/progress.css +1 -1
- package/dist/components/progress.js +1 -1
- package/dist/components/progress.min.css +1 -1
- package/dist/components/progress.min.js +1 -1
- package/dist/components/rail.css +1 -1
- package/dist/components/rail.min.css +1 -1
- package/dist/components/rating.css +1 -1
- package/dist/components/rating.js +23 -5
- package/dist/components/rating.min.css +1 -1
- package/dist/components/rating.min.js +2 -2
- package/dist/components/reset.css +1 -1
- package/dist/components/reset.min.css +1 -1
- package/dist/components/reveal.css +1 -1
- package/dist/components/reveal.min.css +1 -1
- package/dist/components/search.css +1 -1
- package/dist/components/search.js +9 -14
- package/dist/components/search.min.css +1 -1
- package/dist/components/search.min.js +2 -2
- package/dist/components/segment.css +1 -1
- package/dist/components/segment.min.css +1 -1
- package/dist/components/shape.css +1 -1
- package/dist/components/shape.js +1 -1
- package/dist/components/shape.min.css +1 -1
- package/dist/components/shape.min.js +1 -1
- package/dist/components/sidebar.css +1 -1
- package/dist/components/sidebar.js +1 -1
- package/dist/components/sidebar.min.css +1 -1
- package/dist/components/sidebar.min.js +1 -1
- package/dist/components/site.css +1 -1
- package/dist/components/site.js +1 -1
- package/dist/components/site.min.css +1 -1
- package/dist/components/site.min.js +1 -1
- package/dist/components/slider.css +1 -1
- package/dist/components/slider.js +1 -1
- package/dist/components/slider.min.css +1 -1
- package/dist/components/slider.min.js +1 -1
- package/dist/components/state.js +1 -1
- package/dist/components/state.min.js +1 -1
- package/dist/components/statistic.css +1 -1
- package/dist/components/statistic.min.css +1 -1
- package/dist/components/step.css +1 -1
- package/dist/components/step.min.css +1 -1
- package/dist/components/sticky.css +1 -1
- package/dist/components/sticky.js +1 -1
- package/dist/components/sticky.min.css +1 -1
- package/dist/components/sticky.min.js +1 -1
- package/dist/components/tab.css +1 -1
- package/dist/components/tab.js +1 -1
- package/dist/components/tab.min.css +1 -1
- package/dist/components/tab.min.js +1 -1
- package/dist/components/table.css +1 -1
- package/dist/components/table.min.css +1 -1
- package/dist/components/text.css +1 -1
- package/dist/components/text.min.css +1 -1
- package/dist/components/toast.css +1 -1
- package/dist/components/toast.js +14 -19
- package/dist/components/toast.min.css +1 -1
- package/dist/components/toast.min.js +2 -2
- package/dist/components/transition.css +1 -1
- package/dist/components/transition.js +1 -1
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +1 -1
- package/dist/components/visibility.js +1 -1
- package/dist/components/visibility.min.js +1 -1
- package/dist/semantic.css +53 -53
- package/dist/semantic.js +150 -150
- package/dist/semantic.min.css +1 -1
- package/dist/semantic.min.js +2 -2
- package/package.json +1 -2
- package/src/definitions/modules/dropdown.js +28 -42
- package/src/definitions/modules/embed.js +25 -7
- package/src/definitions/modules/flyout.js +12 -17
- package/src/definitions/modules/modal.js +12 -17
- package/src/definitions/modules/popup.js +4 -6
- package/src/definitions/modules/rating.js +22 -4
- package/src/definitions/modules/search.js +8 -13
- package/src/definitions/modules/toast.js +13 -18
- package/tasks/config/defaults.js +0 -1
- package/tasks/config/project/install.js +5 -8
- package/tasks/install.js +10 -11
- package/types/fomantic-ui-dropdown.d.ts +1 -6
- package/types/fomantic-ui-embed.d.ts +1 -1
- package/types/fomantic-ui-search.d.ts +1 -1
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "fomantic-ui",
|
3
|
-
"version": "2.10.0-beta.
|
3
|
+
"version": "2.10.0-beta.6+42a411a",
|
4
4
|
"description": "Fomantic empowers designers and developers by creating a shared vocabulary for UI.",
|
5
5
|
"keywords": [
|
6
6
|
"fomantic-ui",
|
@@ -69,7 +69,6 @@
|
|
69
69
|
"ordered-read-streams": "^1.0.1",
|
70
70
|
"replace-ext": "^1.0.0",
|
71
71
|
"require-dot-file": "^0.4.0",
|
72
|
-
"wrench-sui": "^0.0.3",
|
73
72
|
"js-yaml": "^4.1.0"
|
74
73
|
},
|
75
74
|
"devDependencies": {
|
@@ -114,11 +114,6 @@
|
|
114
114
|
if (module.is.alreadySetup()) {
|
115
115
|
module.setup.reference();
|
116
116
|
} else {
|
117
|
-
if (settings.ignoreDiacritics && !String.prototype.normalize) {
|
118
|
-
settings.ignoreDiacritics = false;
|
119
|
-
module.error(error.noNormalize, element);
|
120
|
-
}
|
121
|
-
|
122
117
|
module.create.id();
|
123
118
|
module.setup.layout();
|
124
119
|
|
@@ -1110,7 +1105,7 @@
|
|
1110
1105
|
$input.append('<option disabled selected value></option>');
|
1111
1106
|
$.each(values, function (index, item) {
|
1112
1107
|
var
|
1113
|
-
value = settings.templates.
|
1108
|
+
value = settings.templates.escape(item[fields.value]),
|
1114
1109
|
name = settings.templates.escape(
|
1115
1110
|
item[fields.name] || '',
|
1116
1111
|
settings
|
@@ -3841,14 +3836,13 @@
|
|
3841
3836
|
htmlEntities: function (string, forceAmpersand) {
|
3842
3837
|
forceAmpersand = typeof forceAmpersand === 'number' ? false : forceAmpersand;
|
3843
3838
|
var
|
3844
|
-
badChars = /["'
|
3845
|
-
shouldEscape = /["&'
|
3839
|
+
badChars = /["'<>]/g,
|
3840
|
+
shouldEscape = /["&'<>]/,
|
3846
3841
|
escape = {
|
3847
3842
|
'<': '<',
|
3848
3843
|
'>': '>',
|
3849
3844
|
'"': '"',
|
3850
|
-
"'": '
|
3851
|
-
'`': '`',
|
3845
|
+
"'": ''',
|
3852
3846
|
},
|
3853
3847
|
escapedChar = function (chr) {
|
3854
3848
|
return escape[chr];
|
@@ -4152,7 +4146,6 @@
|
|
4152
4146
|
noAPI: 'The API module is required to load resources remotely',
|
4153
4147
|
noStorage: 'Saving remote data requires session storage',
|
4154
4148
|
noElement: 'This module requires ui {element}',
|
4155
|
-
noNormalize: '"ignoreDiacritics" setting will be ignored. Browser does not support String().normalize(). You may consider including <https://cdn.jsdelivr.net/npm/unorm@1.4.1/lib/unorm.min.js> as a polyfill.',
|
4156
4149
|
},
|
4157
4150
|
|
4158
4151
|
regExp: {
|
@@ -4266,22 +4259,18 @@
|
|
4266
4259
|
|
4267
4260
|
/* Templates */
|
4268
4261
|
$.fn.dropdown.settings.templates = {
|
4269
|
-
deQuote: function (string, encode) {
|
4270
|
-
return String(string).replace(/"/g, encode ? '"' : '');
|
4271
|
-
},
|
4272
4262
|
escape: function (string, settings) {
|
4273
|
-
if (settings.preserveHTML) {
|
4263
|
+
if (settings !== undefined && settings.preserveHTML) {
|
4274
4264
|
return string;
|
4275
4265
|
}
|
4276
4266
|
var
|
4277
|
-
badChars = /["'
|
4278
|
-
shouldEscape = /["&'
|
4267
|
+
badChars = /["'<>]/g,
|
4268
|
+
shouldEscape = /["&'<>]/,
|
4279
4269
|
escape = {
|
4280
4270
|
'<': '<',
|
4281
4271
|
'>': '>',
|
4282
4272
|
'"': '"',
|
4283
|
-
"'": '
|
4284
|
-
'`': '`',
|
4273
|
+
"'": ''',
|
4285
4274
|
},
|
4286
4275
|
escapedChar = function (chr) {
|
4287
4276
|
return escape[chr];
|
@@ -4300,14 +4289,13 @@
|
|
4300
4289
|
placeholder = select.placeholder || false,
|
4301
4290
|
html = '',
|
4302
4291
|
className = settings.className,
|
4303
|
-
escape = settings.templates.escape
|
4304
|
-
deQuote = settings.templates.deQuote
|
4292
|
+
escape = settings.templates.escape
|
4305
4293
|
;
|
4306
4294
|
html += '<i class="dropdown icon"></i>';
|
4307
4295
|
html += placeholder
|
4308
4296
|
? '<div class="default text">' + escape(placeholder, settings) + '</div>'
|
4309
4297
|
: '<div class="text"></div>';
|
4310
|
-
html += '<div class="' +
|
4298
|
+
html += '<div class="' + escape(className.menu) + '">';
|
4311
4299
|
html += settings.templates.menu(select, settings);
|
4312
4300
|
html += '</div>';
|
4313
4301
|
|
@@ -4321,8 +4309,7 @@
|
|
4321
4309
|
values = response[fields.values] || [],
|
4322
4310
|
html = '',
|
4323
4311
|
className = settings.className,
|
4324
|
-
escape = settings.templates.escape
|
4325
|
-
deQuote = settings.templates.deQuote
|
4312
|
+
escape = settings.templates.escape
|
4326
4313
|
;
|
4327
4314
|
$.each(values, function (index, option) {
|
4328
4315
|
var
|
@@ -4338,14 +4325,14 @@
|
|
4338
4325
|
for (dataKey in dataObject) {
|
4339
4326
|
dataKeyEscaped = String(dataKey).replace(/\W/g, '');
|
4340
4327
|
if (Object.prototype.hasOwnProperty.call(dataObject, dataKey) && ['text', 'value'].indexOf(dataKeyEscaped.toLowerCase()) === -1) {
|
4341
|
-
maybeData += ' data-' + dataKeyEscaped + '="' +
|
4328
|
+
maybeData += ' data-' + dataKeyEscaped + '="' + escape(String(dataObject[dataKey])) + '"';
|
4342
4329
|
}
|
4343
4330
|
}
|
4344
4331
|
}
|
4345
4332
|
if (itemType === 'item' || isMenu) {
|
4346
4333
|
var
|
4347
4334
|
maybeText = option[fields.text]
|
4348
|
-
? ' data-text="' +
|
4335
|
+
? ' data-text="' + escape(option[fields.text]) + '"'
|
4349
4336
|
: '',
|
4350
4337
|
maybeActionable = option[fields.actionable]
|
4351
4338
|
? className.actionable + ' '
|
@@ -4358,27 +4345,27 @@
|
|
4358
4345
|
: '',
|
4359
4346
|
hasDescription = escape(option[fields.description] || '', settings) !== ''
|
4360
4347
|
;
|
4361
|
-
html += '<div class="' +
|
4348
|
+
html += '<div class="' + escape(maybeActionable + maybeDisabled + maybeDescriptionVertical + (option[fields.class] || className.item)) + '" data-value="' + escape(option[fields.value]) + '"' + maybeText + maybeData + '>';
|
4362
4349
|
if (isMenu) {
|
4363
4350
|
html += '<i class="' + (itemType.indexOf('left') !== -1 ? 'left' : '') + ' dropdown icon"></i>';
|
4364
4351
|
}
|
4365
4352
|
if (option[fields.image]) {
|
4366
|
-
html += '<img class="' +
|
4353
|
+
html += '<img class="' + escape(option[fields.imageClass] || className.image) + '" src="' + escape(option[fields.image]) + '"' + (option[fields.alt] ? ' alt="' + escape(option[fields.alt]) + '"' : '') + '>';
|
4367
4354
|
}
|
4368
4355
|
if (option[fields.icon]) {
|
4369
|
-
html += '<i class="' +
|
4356
|
+
html += '<i class="' + escape(option[fields.icon] + ' ' + (option[fields.iconClass] || className.icon)) + '"></i>';
|
4370
4357
|
}
|
4371
4358
|
if (hasDescription) {
|
4372
|
-
html += '<span class="' +
|
4373
|
-
html += !isMenu ? '<span class="' +
|
4359
|
+
html += '<span class="' + escape(className.description) + '">' + escape(option[fields.description] || '', settings) + '</span>';
|
4360
|
+
html += !isMenu ? '<span class="' + escape(className.text) + '">' : '';
|
4374
4361
|
}
|
4375
4362
|
if (isMenu) {
|
4376
|
-
html += '<span class="' +
|
4363
|
+
html += '<span class="' + escape(className.text) + '">';
|
4377
4364
|
}
|
4378
4365
|
html += escape(option[fields.name] || '', settings);
|
4379
4366
|
if (isMenu) {
|
4380
4367
|
html += '</span>';
|
4381
|
-
html += '<div class="' +
|
4368
|
+
html += '<div class="' + escape(itemType) + '">';
|
4382
4369
|
html += settings.templates.menu(option, settings);
|
4383
4370
|
html += '</div>';
|
4384
4371
|
} else if (hasDescription) {
|
@@ -4387,19 +4374,19 @@
|
|
4387
4374
|
html += '</div>';
|
4388
4375
|
} else if (itemType === 'header') {
|
4389
4376
|
var
|
4390
|
-
groupName =
|
4391
|
-
groupIcon =
|
4377
|
+
groupName = option[fields.name] || '',
|
4378
|
+
groupIcon = option[fields.icon] || className.groupIcon
|
4392
4379
|
;
|
4393
4380
|
if (groupName !== '' || groupIcon !== '') {
|
4394
|
-
html += '<div class="' +
|
4381
|
+
html += '<div class="' + escape(option[fields.class] || className.header) + '">';
|
4395
4382
|
if (groupIcon !== '') {
|
4396
|
-
html += '<i class="' +
|
4383
|
+
html += '<i class="' + escape(groupIcon + ' ' + (option[fields.iconClass] || className.icon)) + '"></i>';
|
4397
4384
|
}
|
4398
|
-
html += groupName;
|
4385
|
+
html += escape(groupName, settings);
|
4399
4386
|
html += '</div>';
|
4400
4387
|
}
|
4401
4388
|
if (option[fields.divider]) {
|
4402
|
-
html += '<div class="' +
|
4389
|
+
html += '<div class="' + escape(className.divider) + '"></div>';
|
4403
4390
|
}
|
4404
4391
|
}
|
4405
4392
|
});
|
@@ -4411,11 +4398,10 @@
|
|
4411
4398
|
label: function (value, text, settings) {
|
4412
4399
|
var
|
4413
4400
|
className = settings.className,
|
4414
|
-
escape = settings.templates.escape
|
4415
|
-
deQuote = settings.templates.deQuote
|
4401
|
+
escape = settings.templates.escape
|
4416
4402
|
;
|
4417
4403
|
|
4418
|
-
return escape(text, settings) + '<i class="' +
|
4404
|
+
return escape(text, settings) + '<i class="' + escape(className.delete) + ' icon"></i>';
|
4419
4405
|
},
|
4420
4406
|
|
4421
4407
|
// generates messages like "No results"
|
@@ -645,33 +645,51 @@
|
|
645
645
|
},
|
646
646
|
|
647
647
|
templates: {
|
648
|
-
|
649
|
-
|
648
|
+
escape: function (string) {
|
649
|
+
var
|
650
|
+
badChars = /["'<>]/g,
|
651
|
+
shouldEscape = /["&'<>]/,
|
652
|
+
escape = {
|
653
|
+
'<': '<',
|
654
|
+
'>': '>',
|
655
|
+
'"': '"',
|
656
|
+
"'": ''',
|
657
|
+
},
|
658
|
+
escapedChar = function (chr) {
|
659
|
+
return escape[chr];
|
660
|
+
}
|
661
|
+
;
|
662
|
+
if (shouldEscape.test(string)) {
|
663
|
+
string = string.replace(/&(?![\d#a-z]{1,12};)/gi, '&');
|
664
|
+
string = string.replace(badChars, escapedChar);
|
665
|
+
}
|
666
|
+
|
667
|
+
return string;
|
650
668
|
},
|
651
669
|
iframe: function (url, parameters) {
|
652
670
|
var
|
653
671
|
src = url,
|
654
|
-
|
672
|
+
escape = $.fn.embed.settings.templates.escape
|
655
673
|
;
|
656
674
|
if (parameters) {
|
657
675
|
src += '?' + parameters;
|
658
676
|
}
|
659
677
|
|
660
678
|
return ''
|
661
|
-
+ '<iframe src="' +
|
679
|
+
+ '<iframe src="' + escape(src) + '"'
|
662
680
|
+ ' width="100%" height="100%"'
|
663
681
|
+ ' msallowFullScreen allowFullScreen></iframe>';
|
664
682
|
},
|
665
683
|
placeholder: function (image, icon, alt) {
|
666
684
|
var
|
667
685
|
html = '',
|
668
|
-
|
686
|
+
escape = $.fn.embed.settings.templates.escape
|
669
687
|
;
|
670
688
|
if (icon) {
|
671
|
-
html += '<i class="' +
|
689
|
+
html += '<i class="' + escape(icon) + ' icon"></i>';
|
672
690
|
}
|
673
691
|
if (image) {
|
674
|
-
html += '<img class="placeholder" src="' +
|
692
|
+
html += '<img class="placeholder" src="' + escape(image) + '"' + (alt ? ' alt="' + escape(alt) + '"' : '') + '>';
|
675
693
|
}
|
676
694
|
|
677
695
|
return html;
|
@@ -117,10 +117,10 @@
|
|
117
117
|
}
|
118
118
|
$module.addClass(settings.class);
|
119
119
|
if (settings.title !== '') {
|
120
|
-
$module.find(selector.header).html(module.helpers.escape(settings.title)).addClass(settings.classTitle);
|
120
|
+
$module.find(selector.header).html(module.helpers.escape(settings.title, settings)).addClass(settings.classTitle);
|
121
121
|
}
|
122
122
|
if (settings.content !== '') {
|
123
|
-
$module.find(selector.content).html(module.helpers.escape(settings.content)).addClass(settings.classContent);
|
123
|
+
$module.find(selector.content).html(module.helpers.escape(settings.content, settings)).addClass(settings.classContent);
|
124
124
|
}
|
125
125
|
if (module.has.configActions()) {
|
126
126
|
var $actions = $module.find(selector.actions).addClass(settings.classActions);
|
@@ -132,10 +132,10 @@
|
|
132
132
|
settings.actions.forEach(function (el) {
|
133
133
|
var
|
134
134
|
icon = el[fields.icon]
|
135
|
-
? '<i ' + (el[fields.text] ? 'aria-hidden="true"' : '') + ' class="' + module.helpers.
|
135
|
+
? '<i ' + (el[fields.text] ? 'aria-hidden="true"' : '') + ' class="' + module.helpers.escape(el[fields.icon]) + ' icon"></i>'
|
136
136
|
: '',
|
137
|
-
text = module.helpers.escape(el[fields.text] || ''),
|
138
|
-
cls = module.helpers.
|
137
|
+
text = module.helpers.escape(el[fields.text] || '', settings),
|
138
|
+
cls = module.helpers.escape(el[fields.class] || ''),
|
139
139
|
click = el[fields.click] && isFunction(el[fields.click])
|
140
140
|
? el[fields.click]
|
141
141
|
: function () {}
|
@@ -1079,22 +1079,18 @@
|
|
1079
1079
|
},
|
1080
1080
|
|
1081
1081
|
helpers: {
|
1082
|
-
|
1083
|
-
|
1084
|
-
},
|
1085
|
-
escape: function (string) {
|
1086
|
-
if (settings.preserveHTML) {
|
1082
|
+
escape: function (string, settings) {
|
1083
|
+
if (settings !== undefined && settings.preserveHTML) {
|
1087
1084
|
return string;
|
1088
1085
|
}
|
1089
1086
|
var
|
1090
|
-
badChars = /["'
|
1091
|
-
shouldEscape = /["&'
|
1087
|
+
badChars = /["'<>]/g,
|
1088
|
+
shouldEscape = /["&'<>]/,
|
1092
1089
|
escape = {
|
1093
1090
|
'<': '<',
|
1094
1091
|
'>': '>',
|
1095
1092
|
'"': '"',
|
1096
|
-
"'": '
|
1097
|
-
'`': '`',
|
1093
|
+
"'": ''',
|
1098
1094
|
},
|
1099
1095
|
escapedChar = function (chr) {
|
1100
1096
|
return escape[chr];
|
@@ -1102,8 +1098,7 @@
|
|
1102
1098
|
;
|
1103
1099
|
if (shouldEscape.test(string)) {
|
1104
1100
|
string = string.replace(/&(?![\d#a-z]{1,12};)/gi, '&');
|
1105
|
-
|
1106
|
-
return string.replace(badChars, escapedChar);
|
1101
|
+
string = string.replace(badChars, escapedChar);
|
1107
1102
|
}
|
1108
1103
|
|
1109
1104
|
return string;
|
@@ -1482,7 +1477,7 @@
|
|
1482
1477
|
input = $($.parseHTML(args.content)).filter('.ui.input')
|
1483
1478
|
;
|
1484
1479
|
if (input.length === 0) {
|
1485
|
-
args.content += '<p><div class="' + settings.className.prompt + '"><input placeholder="' + this.helpers.
|
1480
|
+
args.content += '<p><div class="' + settings.className.prompt + '"><input placeholder="' + this.helpers.escape(args.placeholder || '') + '" type="text" value="' + this.helpers.escape(args.defaultValue || '') + '"></div></p>';
|
1486
1481
|
}
|
1487
1482
|
|
1488
1483
|
return {
|
@@ -111,10 +111,10 @@
|
|
111
111
|
}
|
112
112
|
$module.addClass(settings.class);
|
113
113
|
if (settings.title !== '') {
|
114
|
-
$module.find(selector.title).html(module.helpers.escape(settings.title)).addClass(settings.classTitle);
|
114
|
+
$module.find(selector.title).html(module.helpers.escape(settings.title, settings)).addClass(settings.classTitle);
|
115
115
|
}
|
116
116
|
if (settings.content !== '') {
|
117
|
-
$module.find(selector.content).html(module.helpers.escape(settings.content)).addClass(settings.classContent);
|
117
|
+
$module.find(selector.content).html(module.helpers.escape(settings.content, settings)).addClass(settings.classContent);
|
118
118
|
}
|
119
119
|
if (module.has.configActions()) {
|
120
120
|
var $actions = $module.find(selector.actions).addClass(settings.classActions);
|
@@ -126,10 +126,10 @@
|
|
126
126
|
settings.actions.forEach(function (el) {
|
127
127
|
var
|
128
128
|
icon = el[fields.icon]
|
129
|
-
? '<i ' + (el[fields.text] ? 'aria-hidden="true"' : '') + ' class="' + module.helpers.
|
129
|
+
? '<i ' + (el[fields.text] ? 'aria-hidden="true"' : '') + ' class="' + module.helpers.escape(el[fields.icon]) + ' icon"></i>'
|
130
130
|
: '',
|
131
|
-
text = module.helpers.escape(el[fields.text] || ''),
|
132
|
-
cls = module.helpers.
|
131
|
+
text = module.helpers.escape(el[fields.text] || '', settings),
|
132
|
+
cls = module.helpers.escape(el[fields.class] || ''),
|
133
133
|
click = el[fields.click] && isFunction(el[fields.click])
|
134
134
|
? el[fields.click]
|
135
135
|
: function () {}
|
@@ -927,22 +927,18 @@
|
|
927
927
|
module.debug('Caching modal and container sizes', module.cache);
|
928
928
|
},
|
929
929
|
helpers: {
|
930
|
-
|
931
|
-
|
932
|
-
},
|
933
|
-
escape: function (string) {
|
934
|
-
if (settings.preserveHTML) {
|
930
|
+
escape: function (string, settings) {
|
931
|
+
if (settings !== undefined && settings.preserveHTML) {
|
935
932
|
return string;
|
936
933
|
}
|
937
934
|
var
|
938
|
-
badChars = /["'
|
939
|
-
shouldEscape = /["&'
|
935
|
+
badChars = /["'<>]/g,
|
936
|
+
shouldEscape = /["&'<>]/,
|
940
937
|
escape = {
|
941
938
|
'<': '<',
|
942
939
|
'>': '>',
|
943
940
|
'"': '"',
|
944
|
-
"'": '
|
945
|
-
'`': '`',
|
941
|
+
"'": ''',
|
946
942
|
},
|
947
943
|
escapedChar = function (chr) {
|
948
944
|
return escape[chr];
|
@@ -950,8 +946,7 @@
|
|
950
946
|
;
|
951
947
|
if (shouldEscape.test(string)) {
|
952
948
|
string = string.replace(/&(?![\d#a-z]{1,12};)/gi, '&');
|
953
|
-
|
954
|
-
return string.replace(badChars, escapedChar);
|
949
|
+
string = string.replace(badChars, escapedChar);
|
955
950
|
}
|
956
951
|
|
957
952
|
return string;
|
@@ -1590,7 +1585,7 @@
|
|
1590
1585
|
}
|
1591
1586
|
;
|
1592
1587
|
if (input.length === 0) {
|
1593
|
-
args.content += '<p><div class="' + this.helpers.
|
1588
|
+
args.content += '<p><div class="' + this.helpers.escape(settings.className.prompt) + '"><input placeholder="' + this.helpers.escape(args.placeholder || '') + '" type="text" value="' + this.helpers.escape(args.defaultValue || '') + '"></div></p>';
|
1594
1589
|
}
|
1595
1590
|
|
1596
1591
|
return {
|
@@ -1516,14 +1516,13 @@
|
|
1516
1516
|
templates: {
|
1517
1517
|
escape: function (string) {
|
1518
1518
|
var
|
1519
|
-
badChars = /["'
|
1520
|
-
shouldEscape = /["&'
|
1519
|
+
badChars = /["'<>]/g,
|
1520
|
+
shouldEscape = /["&'<>]/,
|
1521
1521
|
escape = {
|
1522
1522
|
'<': '<',
|
1523
1523
|
'>': '>',
|
1524
1524
|
'"': '"',
|
1525
|
-
"'": '
|
1526
|
-
'`': '`',
|
1525
|
+
"'": ''',
|
1527
1526
|
},
|
1528
1527
|
escapedChar = function (chr) {
|
1529
1528
|
return escape[chr];
|
@@ -1531,8 +1530,7 @@
|
|
1531
1530
|
;
|
1532
1531
|
if (shouldEscape.test(string)) {
|
1533
1532
|
string = string.replace(/&(?![\d#a-z]{1,12};)/gi, '&');
|
1534
|
-
|
1535
|
-
return string.replace(badChars, escapedChar);
|
1533
|
+
string = string.replace(badChars, escapedChar);
|
1536
1534
|
}
|
1537
1535
|
|
1538
1536
|
return string;
|
@@ -518,17 +518,35 @@
|
|
518
518
|
},
|
519
519
|
|
520
520
|
templates: {
|
521
|
-
|
522
|
-
|
521
|
+
escape: function (string) {
|
522
|
+
var
|
523
|
+
badChars = /["'<>]/g,
|
524
|
+
shouldEscape = /["&'<>]/,
|
525
|
+
escape = {
|
526
|
+
'<': '<',
|
527
|
+
'>': '>',
|
528
|
+
'"': '"',
|
529
|
+
"'": ''',
|
530
|
+
},
|
531
|
+
escapedChar = function (chr) {
|
532
|
+
return escape[chr];
|
533
|
+
}
|
534
|
+
;
|
535
|
+
if (shouldEscape.test(string)) {
|
536
|
+
string = string.replace(/&(?![\d#a-z]{1,12};)/gi, '&');
|
537
|
+
string = string.replace(badChars, escapedChar);
|
538
|
+
}
|
539
|
+
|
540
|
+
return string;
|
523
541
|
},
|
524
542
|
icon: function (maxRating, iconClass) {
|
525
543
|
var
|
526
544
|
icon = 1,
|
527
545
|
html = '',
|
528
|
-
|
546
|
+
escape = $.fn.rating.settings.templates.escape
|
529
547
|
;
|
530
548
|
while (icon <= maxRating) {
|
531
|
-
html += '<i class="' +
|
549
|
+
html += '<i class="' + escape(iconClass) + ' icon"></i>';
|
532
550
|
icon++;
|
533
551
|
}
|
534
552
|
|
@@ -461,10 +461,6 @@
|
|
461
461
|
settings.fullTextSearch = parameters.searchFullText;
|
462
462
|
module.error(settings.error.oldSearchSyntax, element);
|
463
463
|
}
|
464
|
-
if (settings.ignoreDiacritics && !String.prototype.normalize) {
|
465
|
-
settings.ignoreDiacritics = false;
|
466
|
-
module.error(error.noNormalize, element);
|
467
|
-
}
|
468
464
|
},
|
469
465
|
inputEvent: function () {
|
470
466
|
var
|
@@ -1433,7 +1429,6 @@
|
|
1433
1429
|
serverError: 'There was an issue querying the server.',
|
1434
1430
|
maxResults: 'Results must be an array to use maxResults setting',
|
1435
1431
|
method: 'The method you called is not defined.',
|
1436
|
-
noNormalize: '"ignoreDiacritics" setting will be ignored. Browser does not support String().normalize(). You may consider including <https://cdn.jsdelivr.net/npm/unorm@1.4.1/lib/unorm.min.js> as a polyfill.',
|
1437
1432
|
},
|
1438
1433
|
|
1439
1434
|
metadata: {
|
@@ -1477,22 +1472,22 @@
|
|
1477
1472
|
|
1478
1473
|
templates: {
|
1479
1474
|
escape: function (string, settings) {
|
1480
|
-
if (settings.preserveHTML) {
|
1475
|
+
if (settings !== undefined && settings.preserveHTML) {
|
1481
1476
|
return string;
|
1482
1477
|
}
|
1483
1478
|
var
|
1484
|
-
badChars = /["'
|
1485
|
-
shouldEscape = /["&'
|
1479
|
+
badChars = /["'<>]/g,
|
1480
|
+
shouldEscape = /["&'<>]/,
|
1486
1481
|
escape = {
|
1487
1482
|
'<': '<',
|
1488
1483
|
'>': '>',
|
1489
1484
|
'"': '"',
|
1490
|
-
"'": '
|
1491
|
-
'`': '`',
|
1485
|
+
"'": ''',
|
1492
1486
|
},
|
1493
1487
|
escapedChar = function (chr) {
|
1494
1488
|
return escape[chr];
|
1495
|
-
}
|
1489
|
+
}
|
1490
|
+
;
|
1496
1491
|
if (shouldEscape.test(string)) {
|
1497
1492
|
string = string.replace(/&(?![\d#a-z]{1,12};)/gi, '&');
|
1498
1493
|
string = string.replace(badChars, escapedChar);
|
@@ -1544,7 +1539,7 @@
|
|
1544
1539
|
if (result[fields.image] !== undefined) {
|
1545
1540
|
html += ''
|
1546
1541
|
+ '<div class="image">'
|
1547
|
-
+ ' <img src="' + result[fields.image].replace(/"/g, '') + (result[fields.alt] ? '
|
1542
|
+
+ ' <img src="' + result[fields.image].replace(/"/g, '') + '"' + (result[fields.alt] ? ' alt="' + result[fields.alt].replace(/"/g, '') + '"' : '') + '>'
|
1548
1543
|
+ '</div>';
|
1549
1544
|
}
|
1550
1545
|
html += '<div class="content">';
|
@@ -1598,7 +1593,7 @@
|
|
1598
1593
|
if (result[fields.image] !== undefined) {
|
1599
1594
|
html += ''
|
1600
1595
|
+ '<div class="image">'
|
1601
|
-
+ ' <img src="' + result[fields.image].replace(/"/g, '') + (result[fields.alt] ? '
|
1596
|
+
+ ' <img src="' + result[fields.image].replace(/"/g, '') + '"' + (result[fields.alt] ? ' alt="' + result[fields.alt].replace(/"/g, '') + '"' : '') + '>'
|
1602
1597
|
+ '</div>';
|
1603
1598
|
}
|
1604
1599
|
html += '<div class="content">';
|
@@ -192,7 +192,7 @@
|
|
192
192
|
$content.append($('<div/>', {
|
193
193
|
class: className.title,
|
194
194
|
id: titleId,
|
195
|
-
html: module.helpers.escape(settings.title),
|
195
|
+
html: module.helpers.escape(settings.title, settings),
|
196
196
|
}));
|
197
197
|
}
|
198
198
|
var descId = '_' + module.get.id() + 'desc';
|
@@ -200,7 +200,7 @@
|
|
200
200
|
$content.append($('<div/>', {
|
201
201
|
class: className.message,
|
202
202
|
id: descId,
|
203
|
-
html: module.helpers.escape(settings.message),
|
203
|
+
html: module.helpers.escape(settings.message, settings),
|
204
204
|
}));
|
205
205
|
|
206
206
|
$toast
|
@@ -232,10 +232,10 @@
|
|
232
232
|
$toast.find(selector.image).attr('src', settings.showImage).attr('alt', settings.alt || '');
|
233
233
|
}
|
234
234
|
if (settings.title !== '') {
|
235
|
-
$toast.find(selector.title).html(module.helpers.escape(settings.title));
|
235
|
+
$toast.find(selector.title).html(module.helpers.escape(settings.title, settings));
|
236
236
|
}
|
237
237
|
if (settings.message !== '') {
|
238
|
-
$toast.find(selector.message).html(module.helpers.escape(settings.message));
|
238
|
+
$toast.find(selector.message).html(module.helpers.escape(settings.message, settings));
|
239
239
|
}
|
240
240
|
}
|
241
241
|
if ($toast.hasClass(className.compact)) {
|
@@ -260,10 +260,10 @@
|
|
260
260
|
var
|
261
261
|
icon = el[fields.icon]
|
262
262
|
? '<i ' + (el[fields.text] ? 'aria-hidden="true"' : '')
|
263
|
-
+ ' class="' + module.helpers.
|
263
|
+
+ ' class="' + module.helpers.escape(el[fields.icon]) + ' icon"></i>'
|
264
264
|
: '',
|
265
|
-
text = module.helpers.escape(el[fields.text] || ''),
|
266
|
-
cls = module.helpers.
|
265
|
+
text = module.helpers.escape(el[fields.text] || '', settings),
|
266
|
+
cls = module.helpers.escape(el[fields.class] || ''),
|
267
267
|
click = el[fields.click] && isFunction(el[fields.click])
|
268
268
|
? el[fields.click]
|
269
269
|
: function () {}
|
@@ -592,22 +592,18 @@
|
|
592
592
|
|
593
593
|
return result;
|
594
594
|
},
|
595
|
-
|
596
|
-
|
597
|
-
},
|
598
|
-
escape: function (string) {
|
599
|
-
if (settings.preserveHTML) {
|
595
|
+
escape: function (string, settings) {
|
596
|
+
if (settings !== undefined && settings.preserveHTML) {
|
600
597
|
return string;
|
601
598
|
}
|
602
599
|
var
|
603
|
-
badChars = /["'
|
604
|
-
shouldEscape = /["&'
|
600
|
+
badChars = /["'<>]/g,
|
601
|
+
shouldEscape = /["&'<>]/,
|
605
602
|
escape = {
|
606
603
|
'<': '<',
|
607
604
|
'>': '>',
|
608
605
|
'"': '"',
|
609
|
-
"'": '
|
610
|
-
'`': '`',
|
606
|
+
"'": ''',
|
611
607
|
},
|
612
608
|
escapedChar = function (chr) {
|
613
609
|
return escape[chr];
|
@@ -615,8 +611,7 @@
|
|
615
611
|
;
|
616
612
|
if (shouldEscape.test(string)) {
|
617
613
|
string = string.replace(/&(?![\d#a-z]{1,12};)/gi, '&');
|
618
|
-
|
619
|
-
return string.replace(badChars, escapedChar);
|
614
|
+
string = string.replace(badChars, escapedChar);
|
620
615
|
}
|
621
616
|
|
622
617
|
return string;
|