Skip to content

Commit 805b8c5

Browse files
committed
Sync with Kendo UI Professional
1 parent 17ec9f9 commit 805b8c5

17 files changed

+81
-16
lines changed

docs/api/javascript/kendo.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,12 +315,20 @@ The `onChange` method will be executed when the media query is matched or not ma
315315

316316
The `destroy` method will remove the event listeners and destroy the `MediaQueryList` instance. Note that developers should call the `destroy` method when the media query is no longer needed.
317317

318+
You can modify the default [`media queries`](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_media_queries) for the adaptive components by modifying the breakpoints defined in `kendo.defaults.breakpoints`. The default break points are defined as:
319+
320+
`kendo.defaults.breakpoints = { small: '(max-width: 700px)', medium: '(min-width: 700.1px) and (max-width: 768px)', large: '(min-width: 768.1px)' }`
321+
318322
#### Parameters
319323

320324
##### media `String`
321325

322326
The media query that will create the [MediaQueryList instance](https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList).
323327

328+
#### Returns
329+
330+
`Object` with the `mediaQueryList` field and the `onChange`, `onEnter`, `onLeave` and `destroy` methods.
331+
324332
#### Example - Using a string
325333

326334
<script>
@@ -359,10 +367,26 @@ The media query that will create the [MediaQueryList instance](https://developer
359367
mediaQueryListener.destroy();
360368
</script>
361369

362-
#### Returns
370+
#### Example - Modify the default breakpoints for the the adaptive components
363371

364-
`Object` with the `mediaQueryList` field and the `onChange`, `onEnter`, `onLeave` and `destroy` methods.
372+
```dojo
373+
<input id="dropdownlist"/>
374+
<script>
375+
let defaultBreakpoints = {
376+
small: '(max-width: 2000px)',
377+
medium: '(min-width: 2000px) and (max-width: 2800px)',
378+
large: '(min-width: 2800px)'
379+
}
380+
381+
kendo.setDefaults('breakpoints', defaultBreakpoints);
365382
383+
$("#dropdownlist").kendoDropDownList({
384+
adaptiveMode:"auto",
385+
dataSource: ["Item1", "Item2"],
386+
value: "Item1"
387+
});
388+
</script>
389+
```
366390

367391

368392
### observableFileManagerData
106 KB
Loading
-13.7 KB
Binary file not shown.
146 KB
Loading
-19.2 KB
Binary file not shown.

docs/intro/installation/licensing/license-key-ci-services.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,14 @@ steps:
130130
bash
131131
```
132132

133-
![Azure Devops Classic Step 2](../images/azure-devops-classic-step-2.webp)
133+
![Azure Devops Classic Step 2](../images/azure-devops-classic-step-2.png)
134134

135135
```bash
136136
# Activate the license
137137
npx kendo-ui-license activate
138138
```
139139

140-
![Azure Devops Classic Step 3](../images/azure-devops-classic-step-3.webp)
140+
![Azure Devops Classic Step 3](../images/azure-devops-classic-step-3.png)
141141

142142
## See Also
143143

src/kendo.bottomnavigation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const __meta__ = {
4949

5050
var templates = {
5151
item: template(() => `<span class="${bottomNavigationStyles.item}"></span>`),
52-
anchor: template(({ url }) => `<a class="${bottomNavigationStyles.item}" href="${kendo.htmlEncode(url)}"></a>`),
52+
anchor: template(({ url }) => `<a class="${bottomNavigationStyles.item}" href="${kendo.sanitizeLink(url)}"></a>`),
5353
text: template(({ text }) => `<span class="${bottomNavigationStyles.text}" >${text}</span>`),
5454
icon: template(({ icon }) => kendo.ui.icon($(`<span class="${bottomNavigationStyles.navIcon}"></span>`), { icon: icon, size: "xlarge" }))
5555
};

src/kendo.button.menu.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export const __meta__ = {
1717
ui = kendo.ui,
1818
keys = kendo.keys,
1919
encode = kendo.htmlEncode,
20+
sanitizeLink = kendo.sanitizeLink,
2021
extend = $.extend,
2122

2223
DOT = ".",
@@ -85,7 +86,7 @@ export const __meta__ = {
8586
`${TEXT_TEMPLATE({ text })}` +
8687
`</span>`;
8788

88-
var LINK_TEMPLATE = ({ url, imageUrl, spriteCssClass, icon, text, attributes }) => `<a href="${encode(url)}" ${attributes.target ? `target="${attributes.target}"` : ''} class="${cssClasses.item}">` +
89+
var LINK_TEMPLATE = ({ url, imageUrl, spriteCssClass, icon, text, attributes }) => `<a href="${sanitizeLink(url)}" ${attributes.target ? `target="${attributes.target}"` : ''} class="${cssClasses.item}">` +
8990
`${IMAGE_TEMPLATE({ imageUrl })}` +
9091
`${SPRITE_TEMPLATE({ spriteCssClass })}` +
9192
`${ICON_TEMPLATE({ icon })}` +

src/kendo.buttongroup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ export const __meta__ = {
285285

286286
items.forEach(function(item, index) {
287287
var text = item.text ? item.encoded === false ? item.text : kendo.htmlEncode(item.text) : "",
288-
el = item.url ? $("<a href=" + item.url + ">") : $("<button>");
288+
el = item.url ? $("<a href=" + kendo.sanitizeLink(item.url) + ">") : $("<button>");
289289

290290
el.html(text);
291291

src/kendo.core.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2959,6 +2959,25 @@ function pad(number, digits, end) {
29592959
return ("" + value).replace(ampRegExp, "&amp;").replace(ltRegExp, "&lt;").replace(gtRegExp, "&gt;").replace(quoteRegExp, "&quot;").replace(aposRegExp, "&#39;");
29602960
}
29612961

2962+
function sanitizeLink(value) {
2963+
const allowedProtocols = ["http:", "https:"];
2964+
let link = "";
2965+
2966+
try {
2967+
// Use the default origin in case the value is a relative URL.
2968+
const url = new URL(value, window.location.origin);
2969+
if (allowedProtocols.includes(url.protocol)) {
2970+
link = value;
2971+
} else {
2972+
throw new Error("Invalid protocol");
2973+
}
2974+
} catch {
2975+
link = "#INVALIDLINK";
2976+
}
2977+
2978+
return htmlEncode(link);
2979+
}
2980+
29622981
function unescape(value) {
29632982
var template;
29642983

@@ -3126,6 +3145,7 @@ function pad(number, digits, end) {
31263145
stringify: JSON.stringify.bind(JSON),
31273146
eventTarget: eventTarget,
31283147
htmlEncode: htmlEncode,
3148+
sanitizeLink: sanitizeLink,
31293149
unescape: unescape,
31303150
isLocalUrl: function(url) {
31313151
return url && !localUrlRe.test(url);

0 commit comments

Comments
 (0)