Skip to content

Commit be5812f

Browse files
author
Kendo Bot
committed
Sync with Kendo UI Professional
1 parent 54d50be commit be5812f

27 files changed

+438
-57
lines changed

docs/api/javascript/spreadsheet/range.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -461,13 +461,13 @@ Gets or sets the html rendering of the cells in the range.
461461
##### value `Boolean` *optional*
462462

463463
True to make the cell render the value as HTML.
464-
An important thing in this case is to sanitized the value of the cell on the server for passing save html because there is no client-side sanitizing.
464+
It is important to sanitize the value of the cell on the server for passing safe html because there is no client-side sanitizing. When editing a cell the new value can be checked and prevented in the client `changing` event.
465465

466-
> When the value is 'true ' the value of the cell should be always sanitized on the server for passing save html.
466+
> When the value is 'true ' the value of the cell should be always sanitized on the server for passing safe html.
467467
468468
#### Returns
469469

470-
`Boolean` the current disabled state of the top-left cell of the range.
470+
`Boolean` the current html state of the top-left cell of the range.
471471

472472
#### Example
473473

@@ -477,8 +477,8 @@ An important thing in this case is to sanitized the value of the cell on the ser
477477
$("#spreadsheet").kendoSpreadsheet();
478478
var spreadsheet = $("#spreadsheet").data("kendoSpreadsheet");
479479
var sheet = spreadsheet.activeSheet();
480-
sheet.range("A1").value("disabled");
481-
sheet.range("A1").enable(false);
480+
sheet.range("A1").value("<b>bold</b>");
481+
sheet.range("A1").html(true);
482482
</script>
483483
```
484484

docs/api/javascript/ui/spreadsheet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,7 @@ The cell formula without the leading equals sign, for example, `A1 * 10`.
995995
### sheets.rows.cells.html `Boolean`
996996

997997
If set to `true`, renders the cell value as HTML.
998-
An important thing in this case is to sanitized the value of the cell on the server for passing save html because there is no client-side sanitizing.
998+
It is important to sanitize the value of the cell on the server for passing safe html because there is no client-side sanitizing. When editing a cell the new value can be checked and prevented in the client `changing` event.
999999

10001000
### sheets.rows.cells.index `Number`
10011001

src/kendo.calendar.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,17 @@ var __meta__ = { // jshint ignore:line
7979
},
8080
HEADERSELECTOR = '.k-header, .k-calendar-header',
8181
CLASSIC_HEADER_TEMPLATE = '<div class="k-header">' +
82-
'<a href="#" ' + kendo.attr("action") + '="prev" role="button" class="k-link k-nav-prev" ' + ARIA_LABEL + '="Previous"><span class="k-icon k-i-arrow-60-left"></span></a>' +
83-
'<a href="#" ' + kendo.attr("action") + '="nav-up" role="button" aria-live="assertive" aria-atomic="true" class="k-link k-nav-fast"></a>' +
84-
'<a href="#" ' + kendo.attr("action") + '="next" role="button" class="k-link k-nav-next" ' + ARIA_LABEL + '="Next"><span class="k-icon k-i-arrow-60-right"></span></a>' +
82+
'<a href="\\#" ' + kendo.attr("action") + '="prev" role="button" class="k-link k-nav-prev" ' + ARIA_LABEL + '="Previous"><span class="k-icon k-i-arrow-60-left"></span></a>' +
83+
'<a href="\\#" ' + kendo.attr("action") + '="nav-up" role="button" aria-live="assertive" aria-atomic="true" class="k-link k-nav-fast"></a>' +
84+
'<a href="\\#" ' + kendo.attr("action") + '="next" role="button" class="k-link k-nav-next" ' + ARIA_LABEL + '="Next"><span class="k-icon k-i-arrow-60-right"></span></a>' +
8585
'</div>',
8686
MODERN_HEADER_TEMPLATE = '<div class="k-calendar-header">' +
87-
'<a href="#" ' + kendo.attr("action") + '="nav-up" role="button" aria-live="assertive" aria-atomic="true" class="k-button k-title"></a>' +
88-
'<span class="k-calendar-nav">' +
87+
'<a href="\\#" ' + kendo.attr("action") + '="nav-up" role="button" aria-live="assertive" aria-atomic="true" class="k-button k-title"></a>' +
88+
'<span class="k-calendar-nav">' +
8989
'<a ' + kendo.attr("action") + '="prev" class="k-button k-button-icon k-prev-view">' +
9090
'<span class="k-icon k-i-arrow-60-left"></span>' +
9191
'</a>' +
92-
'<a ' + kendo.attr("action") + '="today" class="k-today">Today</a>' +
92+
'<a ' + kendo.attr("action") + '="today" class="k-today">#=messages.today#</a>' +
9393
'<a ' + kendo.attr("action") + '="next" class="k-button k-button-icon k-next-view">' +
9494
'<span class="k-icon k-i-arrow-60-right"></span>' +
9595
'</a>' +
@@ -222,7 +222,8 @@ var __meta__ = { // jshint ignore:line
222222
}
223223
},
224224
messages: {
225-
weekColumnHeader: ""
225+
weekColumnHeader: "",
226+
today: "Today"
226227
}
227228
},
228229

@@ -1172,7 +1173,7 @@ var __meta__ = { // jshint ignore:line
11721173
linksSelector = that.options.linksSelector;
11731174

11741175
if (!element.find(HEADERSELECTOR)[0]) {
1175-
element.html(that.options.header.template);
1176+
element.html(kendo.template(that.options.header.template)(that.options));
11761177
}
11771178

11781179
element.find(linksSelector)

src/kendo.datetimepicker.js

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ var __meta__ = { // jshint ignore:line
5555
SINGLE_POPUP_TEMPLATE = '<div class="k-date-tab k-datetime-wrap">' +
5656
'<div class="k-datetime-buttongroup">'+
5757
'<div class="k-button-group k-button-group-stretched">'+
58-
'<button class="k-button k-state-active k-group-start">Date</button>'+
59-
'<button class="k-button k-group-end">Time</button>'+
58+
'<button class="k-button k-state-active k-group-start">#=messages.date#</button>'+
59+
'<button class="k-button k-group-end">#=messages.time#</button>'+
6060
'</div>'+
6161
'</div>'+
6262
'<div class="k-datetime-selector">'+
@@ -66,8 +66,8 @@ var __meta__ = { // jshint ignore:line
6666
'</div>'+
6767
'</div>'+
6868
'<div class="k-datetime-footer k-action-buttons">'+
69-
'<button class="k-button k-time-cancel" title="Cancel" aria-label="Cancel">Cancel</button>'+
70-
'<button class="k-time-accept k-button k-primary" title="Set" aria-label="Set">Set</button>'+
69+
'<button class="k-button k-time-cancel" title="Cancel" aria-label="Cancel">#=messages.cancel#</button>'+
70+
'<button class="k-time-accept k-button k-primary" title="Set" aria-label="Set">#=messages.set#</button>'+
7171
'</div>'+
7272
'</div>',
7373
STATE_ACTIVE = "k-state-active";
@@ -161,7 +161,19 @@ var __meta__ = { // jshint ignore:line
161161
dateButtonText: "Open the date view",
162162
timeButtonText: "Open the time view",
163163
dateInput: false,
164-
weekNumber: false
164+
weekNumber: false,
165+
messages: {
166+
set: "Set",
167+
cancel: "Cancel",
168+
hour: "hour",
169+
minute: "minute",
170+
second: "second",
171+
millisecond: "millisecond",
172+
now: "Now",
173+
date: "Date",
174+
time: "Time",
175+
today: "Today"
176+
}
165177
},
166178

167179
events: [
@@ -790,7 +802,8 @@ var __meta__ = { // jshint ignore:line
790802
specifiedRange: that._specifiedRange,
791803
omitPopup: omitPopup,
792804
timeDiv: timeDiv,
793-
timeView: timeViewOptions
805+
timeView: timeViewOptions,
806+
messages: that.options.messages
794807
});
795808
ul = timeView.ul;
796809
},
@@ -972,7 +985,7 @@ var __meta__ = { // jshint ignore:line
972985
.addClass("k-datetime-container k-group k-reset")
973986
.appendTo(document.body);
974987

975-
div.append(SINGLE_POPUP_TEMPLATE);
988+
div.append(kendo.template(SINGLE_POPUP_TEMPLATE)(that.options));
976989
that.popup = new ui.Popup(div, extend(options.popup, options, {
977990
name: "Popup",
978991
isRtl: kendo.support.isRtl(that.wrapper),

src/kendo.editable.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,20 @@ var __meta__ = { // jshint ignore:line
136136
return result;
137137
}
138138

139+
function getEditorTag(type, options) {
140+
var tag;
141+
142+
if (!type.length) { return; }
143+
144+
if ((type === "DropDownTree" && options && options.checkboxes) || type === "MultiSelect") {
145+
tag = "<select />";
146+
} else {
147+
tag = type === "Editor" ? "<textarea />" : "<input />";
148+
}
149+
150+
return tag;
151+
}
152+
139153
var kendoEditors = [
140154
"AutoComplete", "ColorPicker", "ComboBox", "DateInput",
141155
"DatePicker", "DateTimePicker", "DropDownTree",
@@ -182,9 +196,9 @@ var __meta__ = { // jshint ignore:line
182196
"kendoEditor": function (container, options) {
183197
var attr = createAttributes(options);
184198
var type = options.editor;
185-
var tag = type === "Editor" ? "<textarea />" : "<input />";
186199
var editor = "kendo" + type;
187200
var editorOptions = options.editorOptions;
201+
var tag = getEditorTag(type, editorOptions);
188202

189203
$(tag)
190204
.attr(attr)

src/kendo.timepicker.js

Lines changed: 50 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,15 @@ var __meta__ = { // jshint ignore:line
115115
MODERN_RENDERING_TEMPLATE = '<div tabindex="0" class="k-timeselector">' +
116116
'<div class="k-time-header">' +
117117
'<span class="k-title"></span>' +
118-
'<button class="k-button k-flat k-time-now" title="Select now" aria-label="Select now">Now</button>' +
118+
'<button class="k-button k-flat k-time-now" title="Select now" aria-label="Select now">#=messages.now#</button>' +
119119
'</div>' +
120120
'<div class="k-time-list-container">' +
121121
'<span class="k-time-highlight"></span>' +
122122
'</div>' +
123123
'</div>',
124124
NEW_RENDERING_FOOTER = '<div class="k-time-footer k-action-buttons">' +
125-
'<button class="k-button k-time-cancel" title="Cancel changes" aria-label="Cancel changes">Cancel</button>' +
126-
'<button class="k-time-accept k-button k-primary" title="Set time" aria-label="Set time">Set</button>' +
125+
'<button class="k-button k-time-cancel" title="Cancel changes" aria-label="Cancel changes">#=messages.cancel#</button>' +
126+
'<button class="k-time-accept k-button k-primary" title="Set time" aria-label="Set time">#=messages.set#</button>' +
127127
'</div>',
128128
HIGHLIGHTCONTAINER = '<span class="k-time-highlight"></span>';
129129

@@ -160,11 +160,11 @@ var __meta__ = { // jshint ignore:line
160160
}
161161
},
162162
_createScrollList: function () {
163-
this.list = $(MODERN_RENDERING_TEMPLATE)
163+
this.list = $(kendo.template(MODERN_RENDERING_TEMPLATE)(this.options))
164164
.on(MOUSEDOWN, preventDefault);
165165

166166
if (!this.options.omitPopup) {
167-
this.list.append(NEW_RENDERING_FOOTER);
167+
this.list.append(kendo.template(NEW_RENDERING_FOOTER)(this.options));
168168
}
169169

170170
this.ul = this.list.find(".k-time-list-container");
@@ -299,9 +299,11 @@ var __meta__ = { // jshint ignore:line
299299
var item;
300300

301301
if (is12hourFormat) {
302-
if (hours > 12) {
302+
if (hours >= 12) {
303303
designator = "PM";
304-
hours -= 12;
304+
if (hours > 12) {
305+
hours -= 12;
306+
}
305307
} else {
306308
designator = "AM";
307309
}
@@ -598,8 +600,8 @@ var __meta__ = { // jshint ignore:line
598600
if (!this.options.specifiedRange) {
599601
return;
600602
}
601-
if (!this._value) {
602-
this._value = new Date();
603+
if (!this._currentlySelected) {
604+
this._currentlySelected = new Date();
603605
}
604606

605607
var max = this.options.max;
@@ -608,20 +610,20 @@ var __meta__ = { // jshint ignore:line
608610
this._selectedDesignator = this._selectedHour = this._selectedMinutes = this._selectedSeconds = null;
609611

610612
if (this.options.validateDate) {
611-
if (max.getFullYear() === this._value.getFullYear() &&
612-
max.getMonth() === this._value.getMonth() &&
613-
max.getDate() === this._value.getDate()) {
613+
if (max.getFullYear() === this._currentlySelected.getFullYear() &&
614+
max.getMonth() === this._currentlySelected.getMonth() &&
615+
max.getDate() === this._currentlySelected.getDate()) {
614616
this._validateMax = true;
615617
} else {
616618
this._validateMax = false;
617619
}
618620

619-
if (min.getFullYear() === this._value.getFullYear() &&
620-
min.getMonth() === this._value.getMonth() &&
621-
min.getDate() === this._value.getDate()) {
621+
if (min.getFullYear() === this._currentlySelected.getFullYear() &&
622+
min.getMonth() === this._currentlySelected.getMonth() &&
623+
min.getDate() === this._currentlySelected.getDate()) {
622624
this._validateMin = true;
623625
} else {
624-
this._validateMax = true;
626+
this._validateMin = false;
625627
}
626628

627629
if (!this._validateMax && !this._validateMin) {
@@ -695,18 +697,25 @@ var __meta__ = { // jshint ignore:line
695697
},
696698

697699
_listScrollHandler: function (e) {
700+
var that = this;
698701
var itemHeight = Math.floor($(e.currentTarget).find(".k-item:visible:eq(0)").outerHeight());
699702

700-
if (e.currentTarget.scrollTop % itemHeight !== 0) {
701-
if(e.currentTarget.scrollTop > this._scrollTop){
702-
e.currentTarget.scrollTop = Math.ceil(e.currentTarget.scrollTop / itemHeight) * itemHeight;
703-
} else {
704-
e.currentTarget.scrollTop = Math.floor(e.currentTarget.scrollTop / itemHeight) * itemHeight;
705-
}
703+
if (that._scrollingTimeout) {
704+
clearTimeout(that._scrollingTimeout);
706705
}
707-
this._scrollTop = e.currentTarget.scrollTop;
708-
this._updateRanges();
709-
this._updateCurrentlySelected();
706+
707+
that._scrollingTimeout = setTimeout(function () {
708+
if (e.currentTarget.scrollTop % itemHeight !== 0) {
709+
if (e.currentTarget.scrollTop > that._scrollTop) {
710+
e.currentTarget.scrollTop = Math.ceil(e.currentTarget.scrollTop / itemHeight) * itemHeight;
711+
} else {
712+
e.currentTarget.scrollTop = Math.floor(e.currentTarget.scrollTop / itemHeight) * itemHeight;
713+
}
714+
}
715+
that._scrollTop = e.currentTarget.scrollTop;
716+
that._updateRanges();
717+
that._updateCurrentlySelected();
718+
}, 100);
710719
},
711720

712721
_updateCurrentlySelected: function () {
@@ -748,6 +757,9 @@ var __meta__ = { // jshint ignore:line
748757
if (is12hourFormat) {
749758
if (selectedDesignator == "PM") {
750759
selectedHour += 12;
760+
if (selectedHour == 24) {
761+
selectedHour = 12;
762+
}
751763
}
752764

753765
if (selectedDesignator === "AM" && selectedHour === 12) {
@@ -816,7 +828,7 @@ var __meta__ = { // jshint ignore:line
816828
result += this._literalTemplate(part);
817829
} else {
818830
values = this._getValues(part, true);
819-
result += this._itemTemplate(values.values, part, part.type, values.index);
831+
result += this._itemTemplate(values.values, part, this.options.messages[part.type], values.index);
820832
}
821833
}
822834

@@ -855,8 +867,9 @@ var __meta__ = { // jshint ignore:line
855867
var end;
856868

857869
if (part.type === "hour") {
870+
start = 1;
858871
index = 1;
859-
end = part.hour12 ? 12 : 23;
872+
end = part.hour12 ? 12 : 24;
860873
} else if (part.type === "minute") {
861874
index = 2;
862875
end = 59;
@@ -1335,7 +1348,16 @@ var __meta__ = { // jshint ignore:line
13351348
interval: 30,
13361349
height: 200,
13371350
animation: {},
1338-
dateInput: false
1351+
dateInput: false,
1352+
messages: {
1353+
set: "Set",
1354+
cancel: "Cancel",
1355+
hour: "hour",
1356+
minute: "minute",
1357+
second: "second",
1358+
millisecond: "millisecond",
1359+
now: "Now"
1360+
}
13391361
},
13401362

13411363
events: [

styles/web/Default/forms/_layout.less

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@
5454
flex-shrink: 0;
5555
}
5656

57+
.k-checkbox-label,
58+
.k-radio-label {
59+
display: inline-flex;
60+
}
61+
5762
// Inputs inside form
5863
.k-textbox,
5964
.k-textarea,

0 commit comments

Comments
 (0)