Skip to content

Commit b3ce4ea

Browse files
committed
Sync with Kendo UI Professional
1 parent b50deca commit b3ce4ea

File tree

17 files changed

+628
-342
lines changed

17 files changed

+628
-342
lines changed

docs-aspnet/html-helpers/editors/editor/overview.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,14 @@ The following example demonstrates the basic configuration of the Editor.
171171
| [Styling the content]({% slug htmlhelpers_editor_styling_aspnetcore %})| You can choose between the default styling options for the Editor's content or add your custom styles.|
172172
| [Accessibility]({% slug accessibility_aspnetcore_editor %})| The Editor is accessible by screen readers and provides WAI-ARIA, Section 508, WCAG 2.2, and keyboard support.|
173173

174+
## CSP Compliance
175+
176+
The Editor component relies on inline styles for several of its features. If strict [CSP mode]({% slug troubleshooting_content_security_policy_aspnetmvc %}) is enabled for the application you can use the following configuration options to make the Editor component CSP-compliant:
177+
178+
* Use the [`.Nonce`](/api/kendo.mvc.ui.fluent/editorbuilder#noncesystemstring) configuration and pass a value for the nonce attribute. The passed value would be used as the nonce attribute for the inline styles in the content area iframe, the placeholder inline style and the link tags loading external stylesheets in the content area.
179+
* Use the [`.UnsafeInline`](/api/kendo.mvc.ui.fluent/editorbuilder#unsafeinlinesystemboolean) configuration and set it to `false`, so no inline styles are used by the Formatting tool. As a result no decoration will be applied to the Formatting tool dropdown and the formated values will appear as plain text. Actual formatting will be applied (for example if the content of the Editor is exported to MS Word), but the applied format will not be visible in the Editor component, due to the enabled strict CSP mode.
180+
181+
174182
## Next Steps
175183

176184
* [Getting Started with the Editor]({% slug aspnetcore_editor_getting_started %})

docs/api/javascript/ui/editor.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1856,6 +1856,22 @@ The title of the Wrap Text option in Table Wizard.
18561856
});
18571857
</script>
18581858

1859+
### nonce `String`
1860+
1861+
When strict CSP is enabled a `nonce` can be provided for the inline styles. The passed value would be used as the nonce attribute for the inline styles in the content area iframe, the placeholder inline style and the link tags loading external stylesheets in the content area.
1862+
1863+
#### Example
1864+
1865+
<textarea id="editor"></textarea>
1866+
1867+
<script>
1868+
$(document).ready(function() {
1869+
$("#editor").kendoEditor({
1870+
nonce: "kendoNonce"
1871+
});
1872+
});
1873+
</script>
1874+
18591875
### navigateOnTab `Boolean` *(default: false)*
18601876

18611877
If set to `true` this configuration option would enable Tab-based navigation among Editor ToolBar items. By default navigation is arrow-based.
@@ -4707,6 +4723,22 @@ Defines text for search box placeholder.
47074723
});
47084724
</script>
47094725

4726+
### unsafeInline `Boolean` *(default: true)*
4727+
4728+
When set to false, the decoration applied by the Formatting tool dropdown will be skipped and the values will appear as plain text options.
4729+
4730+
#### Example
4731+
4732+
<textarea id="editor"></textarea>
4733+
4734+
<script>
4735+
$(document).ready(function() {
4736+
$("#editor").kendoEditor({
4737+
unsafeInline: false
4738+
});
4739+
});
4740+
</script>
4741+
47104742
## Fields
47114743

47124744
### body `Element`

docs/api/javascript/ui/ui.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ If a jQuery element is passed as the first it will render an icon classes and co
236236

237237
##### options `Object|String` *(required)*
238238

239-
If `string` is provided it will attempt to render a valid SVG icon from the predefined kendo svg collection (`kendo.ui.svgIcons`). Or add class for the font icon by preffixing with `k-i-`. Check teh available options in FontIcon or SvgIcon API sections.
239+
If a `string` is provided, it will attempt to render a valid SVG icon from the predefined kendo svg collection (`kendo.ui.svgIcons`). Or add class for the font icon by prefixing with `k-i-`. Check the available options in the [`FontIcon`](/styles-and-layout/sass-themes/font-icons) or the [`SvgIcon`](/styles-and-layout/sass-themes/svg-icons) API sections.
240240

241241
#### Example - extending an element
242242

6.3 KB
Loading
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
title: Colors
3+
page_title: jQuery CircularProgressBar Colors Documentation - CircularProgressBar Colors
4+
description: "Learn how to set different colors based on the value of the Kendo UI for jQuery CircularProgressBar component."
5+
slug: colors_kendoui_circularprogressbar_widget
6+
position: 3
7+
---
8+
9+
# Colors
10+
11+
The CircularProgressBar allows you to specify an array of colors that will indicate specific ranges of the progress. For example, the CircularProgressBar will be red in the 0%-25% range; orange in the 25%-50% range; yellow in the 50%-75% range; green in the 75%-100% range.
12+
13+
To configure the colors, use the [`colors`](/api/javascript/ui/circularprogressbar/configuration/colors) option.
14+
15+
The following example showcases a CircularProgressBar that changes its colors based on the current value:
16+
17+
```dojo
18+
<div id="circularprogressbar"></div>
19+
20+
<script>
21+
$("#circularprogressbar").kendoCircularProgressBar({
22+
value: 0,
23+
colors: [{
24+
to: 25,
25+
color: '#C0392B'
26+
}, {
27+
from: 25,
28+
to: 50,
29+
color: '#D35400'
30+
}, {
31+
from: 50,
32+
to: 75,
33+
color: '#D4AC0D'
34+
}, {
35+
from: 75,
36+
to: 99,
37+
color: '#58D68D'
38+
}, {
39+
from: 99,
40+
color: '#229954'
41+
}],
42+
centerTemplate: '<span style="color: #: color #;">#= value == 100 ? "<span class=\'k-icon k-i-check\'></span>" : value + "%" #</span>'
43+
});
44+
45+
// Update the value every 50 milliseconds until it reaches 100%.
46+
let interval = setInterval(function () {
47+
let pb = $("#circularprogressbar").data("kendoCircularProgressBar");
48+
let value = pb.value();
49+
if (value >= 100) {
50+
clearInterval(interval);
51+
return;
52+
}
53+
pb.value(value + 1);
54+
}, 50);
55+
</script>
56+
```
57+
58+
## See Also
59+
60+
* [Colors in the CircularProgressBar (Demo)](https://demos.telerik.com/kendo-ui/circularprogressbar/colors)
61+
* [JavaScript API Reference of the CircularProgressBar](/api/javascript/ui/circularprogressbar)
Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
---
2+
title: Getting Started
3+
page_title: jQuery CircularProgressBar Documentation - Getting Started with the CircularProgressBar
4+
description: "Get started with the jQuery CircularProgressBar by Kendo UI and learn how to create, initialize, and enable the component."
5+
slug: getting_started_kendoui_circularprogressbar_widget
6+
position: 2
7+
---
8+
9+
# Getting Started with the CircularProgressBar
10+
11+
This guide demonstrates how to get up and running with the Kendo UI for jQuery CircularProgressBar.
12+
13+
After the completion of this guide, you will be able to achieve the following end result:
14+
15+
```dojo
16+
<div id="circularprogressbar"></div>
17+
18+
<script>
19+
$("#circularprogressbar").kendoCircularProgressBar({
20+
value: 10, // Change the value to see the difference between the colors.
21+
colors: [{
22+
to: 25,
23+
color: '#C0392B'
24+
}, {
25+
from: 25,
26+
to: 50,
27+
color: '#D35400'
28+
}, {
29+
from: 50,
30+
to: 75,
31+
color: '#D4AC0D'
32+
}, {
33+
from: 75,
34+
to: 99,
35+
color: '#58D68D'
36+
}, {
37+
from: 99,
38+
color: '#229954'
39+
}],
40+
centerTemplate: '<span style="color: #: color #;">#= value == 100 ? "<span class=\'k-icon k-i-check\'></span>" : value + "%" #</span>'
41+
});
42+
43+
let interval = setInterval(function () {
44+
let pb = $("#circularprogressbar").data("kendoCircularProgressBar");
45+
let value = pb.value();
46+
if (value >= 100) {
47+
clearInterval(interval);
48+
return;
49+
}
50+
pb.value(value + 1);
51+
}, 50);
52+
</script>
53+
```
54+
55+
## 1. Create a Div Element
56+
57+
First, create an empty `<div>` element on the page and use it as an initialization element for the CircularProgressBar.
58+
59+
```html
60+
<div id="circularprogressbar"></div>
61+
```
62+
63+
## 2. Initialize the CircularProgressBar
64+
65+
In this step, you will initialize the CircularProgressBar from the `<div>` element. When you initialize the component, all settings of the CircularProgressBar will be provided in the script statement. You have to describe its configuration and event handlers in JavaScript.
66+
67+
```html
68+
<div id="circularprogressbar"></div>
69+
70+
<script>
71+
// Target the div element by using jQuery and then call the kendoCircularProgressBar() method.
72+
$("#circularprogressbar").kendoCircularProgressBar();
73+
</script>
74+
```
75+
76+
## 3. Set the Value
77+
78+
After the initialization, you can set the value of the component by using the [`value`](/api/javascript/ui/circularprogressbar/configuration/value) option.
79+
80+
```html
81+
<div id="circularprogressbar"></div>
82+
83+
<script>
84+
$("#circularprogressbar").kendoCircularProgressBar({
85+
value: 10
86+
})
87+
</script>
88+
```
89+
90+
## 4. Set the Colors Option
91+
92+
Using the [`colors`](/api/javascript/ui/circularprogressbar/configuration/colors) option, you can change the color of the CircularProgressBar line based on the current value.
93+
94+
```html
95+
<div id="circularprogressbar"></div>
96+
97+
<script>
98+
$("#circularprogressbar").kendoCircularProgressBar({
99+
value: 10, // Change the value to see the difference between the colors.
100+
colors: [{
101+
to: 25,
102+
color: '#C0392B'
103+
}, {
104+
from: 25,
105+
to: 50,
106+
color: '#D35400'
107+
}, {
108+
from: 50,
109+
to: 75,
110+
color: '#D4AC0D'
111+
}, {
112+
from: 75,
113+
to: 99,
114+
color: '#58D68D'
115+
}, {
116+
from: 99,
117+
color: '#229954'
118+
}]
119+
});
120+
</script>
121+
```
122+
123+
## 5. Set a Center Template
124+
125+
You can specify how the center of the CircularProgressBar will appear using a template.
126+
127+
```html
128+
<div id="circularprogressbar"></div>
129+
130+
<script>
131+
$("#circularprogressbar").kendoCircularProgressBar({
132+
value: 10, // Change the value to see the difference between the colors.
133+
colors: [{
134+
to: 25,
135+
color: '#C0392B'
136+
}, {
137+
from: 25,
138+
to: 50,
139+
color: '#D35400'
140+
}, {
141+
from: 50,
142+
to: 75,
143+
color: '#D4AC0D'
144+
}, {
145+
from: 75,
146+
to: 99,
147+
color: '#58D68D'
148+
}, {
149+
from: 99,
150+
color: '#229954'
151+
}],
152+
centerTemplate: '<span style="color: #: color #;">#= value == 100 ? "<span class=\'k-icon k-i-check\'></span>" : value + "%" #</span>'
153+
});
154+
155+
let interval = setInterval(function () {
156+
let pb = $("#circularprogressbar").data("kendoCircularProgressBar");
157+
let value = pb.value();
158+
if (value >= 100) {
159+
clearInterval(interval);
160+
return;
161+
}
162+
pb.value(value + 1);
163+
}, 50);
164+
</script>
165+
```
166+
167+
## Next Steps
168+
169+
* [Referencing Existing Component Instances]({% slug widget_methodsand_events_kendoui_installation %})
170+
* [Colors of the CircularProgressBar]({% slug colors_kendoui_circularprogressbar_widget %})
171+
172+
## See Also
173+
174+
* [Indeterminate CircularProgressBar (Demo)](https://demos.telerik.com/kendo-ui/circularprogressbar/indeterminate)
175+
* [JavaScript API Reference of the CircularProgressBar](/api/javascript/ui/circularprogressbar)
176+
* [Knowledge Base Section](/knowledge-base)
177+
178+
<script>
179+
window.onload = function() {
180+
document.getElementsByClassName("btn-run")[0].click();
181+
}
182+
</script>
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
title: Modes
3+
page_title: jQuery CircularProgressBar Modes Documentation - CircularProgressBar Modes
4+
description: "Learn about the modes of the Kendo UI for jQuery CircularProgressBar component."
5+
slug: modes_kendoui_circularprogressbar_widget
6+
position: 4
7+
---
8+
9+
# Modes
10+
11+
The CircularProgressBar comes in the `infinite` and `finite` modes:
12+
13+
* The `infinite` mode renders a CircularProgressBar that is always spinning and with no clear indication of when the task will be completed. To enable the `infinite` mode, set the [`indeterminate`](/api/javascript/ui/circularprogressbar/configuration/indeterminate) configuration to `true`:
14+
15+
```javascript
16+
$("#circularprogressbar").kendoCircularProgressBar({
17+
indeterminate: true
18+
});
19+
```
20+
21+
* The `finite` mode is the default mode of the CircularProgressBar and shows a clear indication of when a task will be completed. To update the value of the CircularProgressBar, use the [`value`](/api/javascript/ui/circularprogressbar/methods/value) method. The following example showcases how to update the value every 50 milliseconds:
22+
23+
```dojo
24+
<div id="circularprogressbar"></div>
25+
26+
<script>
27+
$("#circularprogressbar").kendoCircularProgressBar({
28+
value: 0,
29+
centerTemplate: '<span style="color: #: color #;">#= value #%</span>'
30+
});
31+
32+
// Update the value every 50 milliseconds until it reaches 100%.
33+
let interval = setInterval(function () {
34+
let pb = $("#circularprogressbar").data("kendoCircularProgressBar");
35+
let value = pb.value();
36+
if (value >= 100) {
37+
clearInterval(interval);
38+
return;
39+
}
40+
pb.value(value + 1);
41+
}, 50);
42+
</script>
43+
```
44+
45+
## See Also
46+
47+
* [Colors in the CircularProgressBar (Demo)](https://demos.telerik.com/kendo-ui/circularprogressbar/colors)
48+
* [JavaScript API Reference of the CircularProgressBar](/api/javascript/ui/circularprogressbar)

0 commit comments

Comments
 (0)