jquery-grid
Version:
jQuery Grid by Gijgo.com is a plug-in for the jQuery Javascript library. It is a very fast and extandable datagrid, and will add advanced interaction controls to any HTML table. This plugin has build-in integration with Bootstrap and Material Design. Free
816 lines (735 loc) • 33 kB
JavaScript
/*
* Gijgo JavaScript Library v1.9.13
* http://gijgo.com/
*
* Copyright 2014, 2019 gijgo.com
* Released under the MIT license
*/
var gj = {};
gj.widget = function () {
var self = this;
self.xhr = null;
self.generateGUID = function () {
function s4() {
return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
}
return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();
};
self.mouseX = function (e) {
if (e) {
if (e.pageX) {
return e.pageX;
} else if (e.clientX) {
return e.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
} else if (e.touches && e.touches.length) {
return e.touches[0].pageX;
} else if (e.changedTouches && e.changedTouches.length) {
return e.changedTouches[0].pageX;
} else if (e.originalEvent && e.originalEvent.touches && e.originalEvent.touches.length) {
return e.originalEvent.touches[0].pageX;
} else if (e.originalEvent && e.originalEvent.changedTouches && e.originalEvent.changedTouches.length) {
return e.originalEvent.touches[0].pageX;
}
}
return null;
};
self.mouseY = function (e) {
if (e) {
if (e.pageY) {
return e.pageY;
} else if (e.clientY) {
return e.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
} else if (e.touches && e.touches.length) {
return e.touches[0].pageY;
} else if (e.changedTouches && e.changedTouches.length) {
return e.changedTouches[0].pageY;
} else if (e.originalEvent && e.originalEvent.touches && e.originalEvent.touches.length) {
return e.originalEvent.touches[0].pageY;
} else if (e.originalEvent && e.originalEvent.changedTouches && e.originalEvent.changedTouches.length) {
return e.originalEvent.touches[0].pageY;
}
}
return null;
};
};
gj.widget.prototype.init = function (jsConfig, type) {
var option, clientConfig, fullConfig;
this.attr('data-type', type);
clientConfig = $.extend(true, {}, this.getHTMLConfig() || {});
$.extend(true, clientConfig, jsConfig || {});
fullConfig = this.getConfig(clientConfig, type);
this.attr('data-guid', fullConfig.guid);
this.data(fullConfig);
// Initialize events configured as options
for (option in fullConfig) {
if (gj[type].events.hasOwnProperty(option)) {
this.on(option, fullConfig[option]);
delete fullConfig[option];
}
}
// Initialize all plugins
for (plugin in gj[type].plugins) {
if (gj[type].plugins.hasOwnProperty(plugin)) {
gj[type].plugins[plugin].configure(this, fullConfig, clientConfig);
}
}
return this;
};
gj.widget.prototype.getConfig = function (clientConfig, type) {
var config, uiLibrary, iconsLibrary, plugin;
config = $.extend(true, {}, gj[type].config.base);
uiLibrary = clientConfig.hasOwnProperty('uiLibrary') ? clientConfig.uiLibrary : config.uiLibrary;
if (gj[type].config[uiLibrary]) {
$.extend(true, config, gj[type].config[uiLibrary]);
}
iconsLibrary = clientConfig.hasOwnProperty('iconsLibrary') ? clientConfig.iconsLibrary : config.iconsLibrary;
if (gj[type].config[iconsLibrary]) {
$.extend(true, config, gj[type].config[iconsLibrary]);
}
for (plugin in gj[type].plugins) {
if (gj[type].plugins.hasOwnProperty(plugin)) {
$.extend(true, config, gj[type].plugins[plugin].config.base);
if (gj[type].plugins[plugin].config[uiLibrary]) {
$.extend(true, config, gj[type].plugins[plugin].config[uiLibrary]);
}
if (gj[type].plugins[plugin].config[iconsLibrary]) {
$.extend(true, config, gj[type].plugins[plugin].config[iconsLibrary]);
}
}
}
$.extend(true, config, clientConfig);
if (!config.guid) {
config.guid = this.generateGUID();
}
return config;
}
gj.widget.prototype.getHTMLConfig = function () {
var result = this.data(),
attrs = this[0].attributes;
if (attrs['width']) {
result.width = attrs['width'].value;
}
if (attrs['height']) {
result.height = attrs['height'].value;
}
if (attrs['value']) {
result.value = attrs['value'].value;
}
if (attrs['align']) {
result.align = attrs['align'].value;
}
if (result && result.source) {
result.dataSource = result.source;
delete result.source;
}
return result;
};
gj.widget.prototype.createDoneHandler = function () {
var $widget = this;
return function (response) {
if (typeof (response) === 'string' && JSON) {
response = JSON.parse(response);
}
gj[$widget.data('type')].methods.render($widget, response);
};
};
gj.widget.prototype.createErrorHandler = function () {
var $widget = this;
return function (response) {
if (response && response.statusText && response.statusText !== 'abort') {
alert(response.statusText);
}
};
};
gj.widget.prototype.reload = function (params) {
var ajaxOptions, result, data = this.data(), type = this.data('type');
if (data.dataSource === undefined) {
gj[type].methods.useHtmlDataSource(this, data);
}
$.extend(data.params, params);
if ($.isArray(data.dataSource)) {
result = gj[type].methods.filter(this);
gj[type].methods.render(this, result);
} else if (typeof(data.dataSource) === 'string') {
ajaxOptions = { url: data.dataSource, data: data.params };
if (this.xhr) {
this.xhr.abort();
}
this.xhr = $.ajax(ajaxOptions).done(this.createDoneHandler()).fail(this.createErrorHandler());
} else if (typeof (data.dataSource) === 'object') {
if (!data.dataSource.data) {
data.dataSource.data = {};
}
$.extend(data.dataSource.data, data.params);
ajaxOptions = $.extend(true, {}, data.dataSource); //clone dataSource object
if (ajaxOptions.dataType === 'json' && typeof(ajaxOptions.data) === 'object') {
ajaxOptions.data = JSON.stringify(ajaxOptions.data);
}
if (!ajaxOptions.success) {
ajaxOptions.success = this.createDoneHandler();
}
if (!ajaxOptions.error) {
ajaxOptions.error = this.createErrorHandler();
}
if (this.xhr) {
this.xhr.abort();
}
this.xhr = $.ajax(ajaxOptions);
}
return this;
}
gj.documentManager = {
events: {},
subscribeForEvent: function (eventName, widgetId, callback) {
if (!gj.documentManager.events[eventName] || gj.documentManager.events[eventName].length === 0) {
gj.documentManager.events[eventName] = [{ widgetId: widgetId, callback: callback }];
$(document).on(eventName, gj.documentManager.executeCallbacks);
} else if (!gj.documentManager.events[eventName][widgetId]) {
gj.documentManager.events[eventName].push({ widgetId: widgetId, callback: callback });
} else {
throw 'Event ' + eventName + ' for widget with guid="' + widgetId + '" is already attached.';
}
},
executeCallbacks: function (e) {
var callbacks = gj.documentManager.events[e.type];
if (callbacks) {
for (var i = 0; i < callbacks.length; i++) {
callbacks[i].callback(e);
}
}
},
unsubscribeForEvent: function (eventName, widgetId) {
var success = false,
events = gj.documentManager.events[eventName];
if (events) {
for (var i = 0; i < events.length; i++) {
if (events[i].widgetId === widgetId) {
events.splice(i, 1);
success = true;
if (events.length === 0) {
$(document).off(eventName);
delete gj.documentManager.events[eventName];
}
}
}
}
if (!success) {
throw 'The "' + eventName + '" for widget with guid="' + widgetId + '" can\'t be removed.';
}
}
};
/**
*/
gj.core = {
messages: {
'en-us': {
monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
monthShortNames: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
weekDaysMin: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
weekDaysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
weekDays: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
am: 'AM',
pm: 'PM',
ok: 'Ok',
cancel: 'Cancel',
titleFormat: 'mmmm yyyy'
}
},
/**
*/
parseDate: function (value, format, locale) {
var i, year = 0, month = 0, date = 1, hour = 0, minute = 0, dateParts, formatParts, result;
if (value && typeof value === 'string') {
if (/^\d+$/.test(value)) {
result = new Date(value);
} else if (value.indexOf('/Date(') > -1) {
result = new Date(parseInt(value.substr(6), 10));
} else if (value) {
formatParts = format.split(/[\s,-\.//\:]+/);
// Split only by spaces
dateParts = value.split(/[\s]+/);
// Split by other chars if the split by spaces doesn't work
if (dateParts.length != formatParts.length) {
dateParts = value.split(/[\s,-\.//\:]+/);
}
for (i = 0; i < formatParts.length; i++) {
if (['d', 'dd'].indexOf(formatParts[i]) > -1) {
date = parseInt(dateParts[i], 10);
} else if (['m', 'mm'].indexOf(formatParts[i]) > -1) {
month = parseInt(dateParts[i], 10) - 1;
} else if ('mmm' === formatParts[i]) {
month = gj.core.messages[locale || 'en-us'].monthShortNames.indexOf(dateParts[i]);
} else if ('mmmm' === formatParts[i]) {
month = gj.core.messages[locale || 'en-us'].monthNames.indexOf(dateParts[i]);
} else if (['yy', 'yyyy'].indexOf(formatParts[i]) > -1) {
year = parseInt(dateParts[i], 10);
if (formatParts[i] === 'yy') {
year += 2000;
}
} else if (['h', 'hh', 'H', 'HH'].indexOf(formatParts[i]) > -1) {
hour = parseInt(dateParts[i], 10);
} else if (['M', 'MM'].indexOf(formatParts[i]) > -1) {
minute = parseInt(dateParts[i], 10);
}
}
result = new Date(year, month, date, hour, minute);
}
} else if (typeof value === 'number') {
result = new Date(value);
} else if (value instanceof Date) {
result = value;
}
return result;
},
/**
*/
formatDate: function (date, format, locale) {
var result = '', separator, tmp,
formatParts = format.split(/[\s,-\.//\:]+/),
separators = format.split(/s+|M+|H+|h+|t+|T+|d+|m+|y+/);
separators = separators.splice(1, separators.length - 2);
for (i = 0; i < formatParts.length; i++) {
separator = (separators[i] || '');
switch (formatParts[i]) {
case 's':
result += date.getSeconds() + separator;
break;
case 'ss':
result += gj.core.pad(date.getSeconds()) + separator;
break;
case 'M':
result += date.getMinutes() + separator;
break;
case 'MM':
result += gj.core.pad(date.getMinutes()) + separator;
break;
case 'H':
result += date.getHours() + separator;
break;
case 'HH':
result += gj.core.pad(date.getHours()) + separator;
break;
case 'h':
tmp = date.getHours() > 12 ? date.getHours() % 12 : date.getHours();
result += tmp + separator;
break;
case 'hh':
tmp = date.getHours() > 12 ? date.getHours() % 12 : date.getHours();
result += gj.core.pad(tmp) + separator;
break;
case 'tt':
result += (date.getHours() >= 12 ? 'pm' : 'am') + separator;
break;
case 'TT':
result += (date.getHours() >= 12 ? 'PM' : 'AM') + separator;
break;
case 'd':
result += date.getDate() + separator;
break;
case 'dd':
result += gj.core.pad(date.getDate()) + separator;
break;
case 'ddd':
result += gj.core.messages[locale || 'en-us'].weekDaysShort[date.getDay()] + separator;
break;
case 'dddd':
result += gj.core.messages[locale || 'en-us'].weekDays[date.getDay()] + separator;
break;
case 'm' :
result += (date.getMonth() + 1) + separator;
break;
case 'mm':
result += gj.core.pad(date.getMonth() + 1) + separator;
break;
case 'mmm':
result += gj.core.messages[locale || 'en-us'].monthShortNames[date.getMonth()] + separator;
break;
case 'mmmm':
result += gj.core.messages[locale || 'en-us'].monthNames[date.getMonth()] + separator;
break;
case 'yy' :
result += date.getFullYear().toString().substr(2) + separator;
break;
case 'yyyy':
result += date.getFullYear() + separator;
break;
}
}
return result;
},
pad: function (val, len) {
val = String(val);
len = len || 2;
while (val.length < len) {
val = '0' + val;
}
return val;
},
center: function ($dialog) {
var left = ($(window).width() / 2) - ($dialog.width() / 2),
top = ($(window).height() / 2) - ($dialog.height() / 2);
$dialog.css('position', 'absolute');
$dialog.css('left', left > 0 ? left : 0);
$dialog.css('top', top > 0 ? top : 0);
},
isIE: function () {
return !!navigator.userAgent.match(/Trident/g) || !!navigator.userAgent.match(/MSIE/g);
},
setChildPosition: function (mainEl, childEl) {
var mainElRect = mainEl.getBoundingClientRect(),
mainElHeight = gj.core.height(mainEl, true),
childElHeight = gj.core.height(childEl, true),
mainElWidth = gj.core.width(mainEl, true),
childElWidth = gj.core.width(childEl, true),
scrollY = window.scrollY || window.pageYOffset || 0,
scrollX = window.scrollX || window.pageXOffset || 0;
if ((mainElRect.top + mainElHeight + childElHeight) > window.innerHeight && mainElRect.top > childElHeight) {
childEl.style.top = Math.round(mainElRect.top + scrollY - childElHeight - 3) + 'px';
} else {
childEl.style.top = Math.round(mainElRect.top + scrollY + mainElHeight + 3) + 'px';
}
if (mainElRect.left + childElWidth > document.body.clientWidth) {
childEl.style.left = Math.round(mainElRect.left + scrollX + mainElWidth - childElWidth) + 'px';
} else {
childEl.style.left = Math.round(mainElRect.left + scrollX) + 'px';
}
},
height: function (el, margin) {
var result, style = window.getComputedStyle(el);
if (style.boxSizing === 'border-box') { // border-box include padding and border within the height
result = parseInt(style.height, 10);
if (gj.core.isIE()) {
result += parseInt(style.paddingTop || 0, 10) + parseInt(style.paddingBottom || 0, 10);
result += parseInt(style.borderTopWidth || 0, 10) + parseInt(style.borderBottomWidth || 0, 10);
}
} else {
result = parseInt(style.height, 10);
result += parseInt(style.paddingTop || 0, 10) + parseInt(style.paddingBottom || 0, 10);
result += parseInt(style.borderTopWidth || 0, 10) + parseInt(style.borderBottomWidth || 0, 10);
}
if (margin) {
result += parseInt(style.marginTop || 0, 10) + parseInt(style.marginBottom || 0, 10);
}
return result;
},
width: function (el, margin) {
var result, style = window.getComputedStyle(el);
if (style.boxSizing === 'border-box') { // border-box include padding and border within the width
result = parseInt(style.width, 10);
} else {
result = parseInt(style.width, 10);
result += parseInt(style.paddingLeft || 0, 10) + parseInt(style.paddingRight || 0, 10);
result += parseInt(style.borderLeftWidth || 0, 10) + parseInt(style.borderRightWidth || 0, 10);
}
if (margin) {
result += parseInt(style.marginLeft || 0, 10) + parseInt(style.marginRight || 0, 10);
}
return result;
},
addClasses: function (el, classes) {
var i, arr;
if (classes) {
arr = classes.split(' ');
for (i = 0; i < arr.length; i++) {
el.classList.add(arr[i]);
}
}
},
position: function (el) {
var xScroll, yScroll, left = 0, top = 0,
height = gj.core.height(el),
width = gj.core.width(el);
while (el) {
if (el.tagName == "BODY") {
xScroll = el.scrollLeft || document.documentElement.scrollLeft;
yScroll = el.scrollTop || document.documentElement.scrollTop;
left += el.offsetLeft - xScroll; // + el.clientLeft);
top += el.offsetTop - yScroll; // + el.clientTop);
} else {
left += el.offsetLeft - el.scrollLeft; // + el.clientLeft;
top += el.offsetTop - el.scrollTop; // + el.clientTop;
}
el = el.offsetParent;
}
return { top: top, left: left, bottom: top + height, right: left + width };
},
setCaretAtEnd: function (elem) {
var elemLen;
if (elem) {
elemLen = elem.value.length;
if (document.selection) { // For IE Only
elem.focus();
var oSel = document.selection.createRange();
oSel.moveStart('character', -elemLen);
oSel.moveStart('character', elemLen);
oSel.moveEnd('character', 0);
oSel.select();
} else if (elem.selectionStart || elem.selectionStart == '0') { // Firefox/Chrome
elem.selectionStart = elemLen;
elem.selectionEnd = elemLen;
elem.focus();
}
}
},
getScrollParent: function (node) {
if (node == null) {
return null;
} else if (node.scrollHeight > node.clientHeight) {
return node;
} else {
return gj.core.getScrollParent(node.parentNode);
}
}
};
gj.picker = {
messages: {
'en-us': {
}
}
};
gj.picker.methods = {
initialize: function ($input, data, methods) {
var $calendar, $rightIcon,
$picker = methods.createPicker($input, data),
$wrapper = $input.parent('div[role="wrapper"]');
if (data.uiLibrary === 'bootstrap') {
$rightIcon = $('<span class="input-group-addon">' + data.icons.rightIcon + '</span>');
} else if (data.uiLibrary === 'bootstrap4') {
$rightIcon = $('<span class="input-group-append"><button class="btn btn-outline-secondary border-left-0" type="button">' + data.icons.rightIcon + '</button></span>');
} else {
$rightIcon = $(data.icons.rightIcon);
}
$rightIcon.attr('role', 'right-icon');
if ($wrapper.length === 0) {
$wrapper = $('<div role="wrapper" />').addClass(data.style.wrapper); // The css class needs to be added before the wrapping, otherwise doesn't work.
$input.wrap($wrapper);
} else {
$wrapper.addClass(data.style.wrapper);
}
$wrapper = $input.parent('div[role="wrapper"]');
data.width && $wrapper.css('width', data.width);
$input.val(data.value).addClass(data.style.input).attr('role', 'input');
data.fontSize && $input.css('font-size', data.fontSize);
if (data.uiLibrary === 'bootstrap' || data.uiLibrary === 'bootstrap4') {
if (data.size === 'small') {
$wrapper.addClass('input-group-sm');
$input.addClass('form-control-sm');
} else if (data.size === 'large') {
$wrapper.addClass('input-group-lg');
$input.addClass('form-control-lg');
}
} else {
if (data.size === 'small') {
$wrapper.addClass('small');
} else if (data.size === 'large') {
$wrapper.addClass('large');
}
}
$rightIcon.on('click', function (e) {
if ($picker.is(':visible')) {
$input.close();
} else {
$input.open();
}
});
$wrapper.append($rightIcon);
if (data.footer !== true) {
$input.on('blur', function () {
$input.timeout = setTimeout(function () {
$input.close();
}, 500);
});
$picker.mousedown(function () {
clearTimeout($input.timeout);
$input.focus();
return false;
});
$picker.on('click', function () {
clearTimeout($input.timeout);
$input.focus();
});
}
}
};
gj.picker.widget = function ($element, jsConfig) {
var self = this,
methods = gj.picker.methods;
self.destroy = function () {
return methods.destroy(this);
};
return $element;
};
gj.picker.widget.prototype = new gj.widget();
gj.picker.widget.constructor = gj.picker.widget;
gj.picker.widget.prototype.init = function (jsConfig, type, methods) {
gj.widget.prototype.init.call(this, jsConfig, type);
this.attr('data-' + type, 'true');
gj.picker.methods.initialize(this, this.data(), gj[type].methods);
return this;
};
gj.picker.widget.prototype.open = function (type) {
var data = this.data(),
$picker = $('body').find('[role="picker"][guid="' + this.attr('data-guid') + '"]');
$picker.show();
$picker.closest('div[role="modal"]').show();
if (data.modal) {
gj.core.center($picker);
} else {
gj.core.setChildPosition(this[0], $picker[0]);
this.focus();
}
clearTimeout(this.timeout);
gj[type].events.open(this);
return this;
};
gj.picker.widget.prototype.close = function (type) {
var $picker = $('body').find('[role="picker"][guid="' + this.attr('data-guid') + '"]');
$picker.hide();
$picker.closest('div[role="modal"]').hide();
gj[type].events.close(this);
return this;
};
gj.picker.widget.prototype.destroy = function (type) {
var data = this.data(),
$parent = this.parent(),
$picker = $('body').find('[role="picker"][guid="' + this.attr('data-guid') + '"]');
if (data) {
this.off();
if ($picker.parent('[role="modal"]').length > 0) {
$picker.unwrap();
}
$picker.remove();
this.removeData();
this.removeAttr('data-type').removeAttr('data-guid').removeAttr('data-' + type);
this.removeClass();
$parent.children('[role="right-icon"]').remove();
this.unwrap();
}
return this;
};
gj.core.messages['bg-bg'] = {
monthNames: ['Януари', 'Февруари', 'Март', 'Април', 'Май', 'Юни', 'Юли', 'Август', 'Септември', 'Октомври', 'Ноември', 'Декември'],
monthShortNames: ['Яну', 'Фев', 'Мар', 'Апр', 'Май', 'Юни', 'Юли', 'Авг', 'Сеп', 'ОКт', 'Ное', 'Дек'],
weekDaysMin: ['Н', 'П', 'В', 'С', 'Ч', 'П', 'С'],
weekDaysShort: ['Нед', 'Пон', 'Вто', 'Сря', 'Чет', 'Пет', 'Съб'],
weekDays: ['Неделя', 'Понеделник', 'Вторник', 'Сряда', 'Четвъртък', 'Петък', 'Събота'],
am: 'AM',
pm: 'PM',
ok: 'ОК',
cancel: 'Отказ',
titleFormat: 'mmmm yyyy'
};
gj.core.messages['fr-fr'] = {
monthNames: ['janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet', 'août', 'septembre', 'octobre', 'novembre', 'décembre'],
monthShortNames: ['janv.', 'févr.', 'mars', 'avr.', 'mai', 'juin', 'juil.', 'août', 'sept.', 'oct.', 'nov.', 'déc.'],
weekDaysMin: ['D', 'L', 'M', 'M', 'J', 'V', 'S'],
weekDaysShort: ['dim.', 'lun.', 'mar.', 'mer.', 'jeu.', 'ven.', 'sam.'],
weekDays: ['dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi'],
am: 'AM',
pm: 'PM',
ok: 'OK',
cancel: 'Annuler',
titleFormat: 'mmmm yyyy'
};
gj.core.messages['de-de'] = {
monthNames: ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'],
monthShortNames: ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'],
weekDaysMin: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'],
weekDaysShort: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'],
weekDays: ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'],
am: 'AM',
pm: 'PM',
ok: 'OK',
cancel: 'Abbrechen',
titleFormat: 'mmmm yyyy'
};
gj.core.messages['pt-br'] = {
monthNames: ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro'],
monthShortNames: ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'],
weekDaysMin: ['D', 'S', 'T', 'Q', 'Q', 'S', 'S'],
weekDaysShort: ['Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sáb'],
weekDays: ['Domingo', 'Segunda-feira', 'Terça-feira', 'Quarta-feira', 'Quinta-feira', 'Sexta-feira', 'Sábado'],
am: 'AM',
pm: 'PM',
ok: 'OK',
cancel: 'Cancelar',
titleFormat: 'mmmm yyyy'
};
gj.core.messages['ru-ru'] = {
monthNames: ['Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь'],
monthShortNames: ['Янв', 'Фев', 'Мар', 'Апр', 'Май', 'Июн', 'Июл', 'Авг', 'Сен', 'Окт', 'Ноя', 'Дек'],
weekDaysMin: ['Вс', 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб'],
weekDaysShort: ['вск', 'пнд', 'втр', 'срд', 'чтв', 'птн', 'сбт'],
weekDays: ['воскресенье', 'понедельник', 'вторник', 'среда', 'четверг', 'пятница', 'суббота'],
am: 'AM',
pm: 'PM',
ok: 'ОК',
cancel: 'Отмена',
titleFormat: 'mmmm yyyy'
};
gj.core.messages['es-es'] = {
monthNames: ['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'],
monthShortNames: ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'],
weekDaysMin: ['D', 'L', 'M', 'M', 'J', 'V', 'S'],
weekDaysShort: ['Dom', 'Lun', 'Mar', 'Mié', 'Jue', 'Vie', 'Sáb'],
weekDays: ['Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado'],
am: 'AM',
pm: 'PM',
ok: 'OK',
cancel: 'Cancelar',
titleFormat: 'mmmm yyyy'
};
gj.core.messages['it-it'] = {
monthNames: ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"],
monthShortNames: ["Gen", "Feb", "Mar", "Apr", "Mag", "Giu", "Lug", "Ago", "Set", "Ott", "Nov", "Dic"],
weekDaysMin: ['Do', 'Lu', 'Ma', 'Me', 'Gi', 'Ve', 'Sa'],
weekDaysShort: ['Dom', 'Lun', 'Mar', 'Mer', 'Gio', 'Ven','Sab'],
weekDays: ['Domenica', 'Lunedì', 'Martedì', 'Mercoledì', 'Giovedì', 'Venerdì', 'Sabato'],
am: 'AM',
pm: 'PM',
ok: 'OK',
cancel: 'Annulla',
titleFormat: 'mmmm yyyy'
};
gj.core.messages['tr-tr'] = {
monthNames: ['Ocak', 'Şubat', 'Mart', 'Nisan', 'Mayıs', 'Haziran', 'Temmuz', 'Ağustos', 'Eylül', 'Ekim', 'Kasım', 'Aralık'],
monthShortNames: ['Oca', 'Şub', 'Mar', 'Nis', 'May', 'Haz', 'Tem', 'Ağu', 'Eyl', 'Eki', 'Kas', 'Ara'],
weekDaysMin: ['P', 'P', 'S', 'Ç', 'P', 'C', 'C'],
weekDaysShort: ['Pz', 'Pzt', 'Sal', 'Çrş', 'Prş', 'Cu', 'Cts'],
weekDays: ['Pazar', 'Pazartesi', 'Salı', 'Çarşamba', 'Perşembe', 'Cuma', 'Cumartesi'],
am: 'AM',
pm: 'PM',
ok: 'Tamam',
cancel: 'İptal',
titleFormat: 'mmmm yyyy'
};
gj.core.messages['ja-jp'] = {
monthNames: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
monthShortNames: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
weekDaysMin: ['日', '月', '火', '水', '木', '金', '土'],
weekDaysShort: ['日', '月', '火', '水', '木', '金', '土'],
weekDays: ['日曜', '月曜', '火曜', '水曜', '木曜', '金曜', '土曜'],
am: '午前',
pm: '午後',
ok: 'OK',
cancel: 'キャンセル',
titleFormat: 'yyyy年mmmm'
};
gj.core.messages['zh-cn'] = {
monthNames: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
monthShortNames: ['01.', '02.', '03.', '04.', '05.', '06.', '07.', '08.', '09.', '10.', '11.', '12.'],
weekDaysMin: ['日', '一', '二', '三', '四', '五', '六'],
weekDaysShort: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
weekDays: ['星期天', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
am: '上午',
pm: '下午',
ok: '确认',
cancel: '取消',
titleFormat: 'yyyy年mmmm'
};
gj.core.messages['zh-tw'] = {
monthNames: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
monthShortNames: ['01.', '02.', '03.', '04.', '05.', '06.', '07.', '08.', '09.', '10.', '11.', '12.'],
weekDaysMin: ['日', '一', '二', '三', '四', '五', '六'],
weekDaysShort: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
weekDays: ['星期天', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
am: '上午',
pm: '下午',
ok: '確認',
cancel: '取消',
titleFormat: 'yyyy年mmmm'
};