removing unused files

community
Steve L. Nyemba 6 years ago
parent e9c7b3e9e3
commit e81835d919

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -1,248 +0,0 @@
!function ($) {
/* CHECKBOX PUBLIC CLASS DEFINITION
* ============================== */
var Checkbox = function (element, options) {
this.init(element, options);
}
Checkbox.prototype = {
constructor: Checkbox
, init: function (element, options) {
var $el = this.$element = $(element)
this.options = $.extend({}, $.fn.checkbox.defaults, options);
$el.before(this.options.template);
this.setState();
}
, setState: function () {
var $el = this.$element
, $parent = $el.closest('.checkbox');
$el.prop('disabled') && $parent.addClass('disabled');
$el.prop('checked') && $parent.addClass('checked');
}
, toggle: function () {
var ch = 'checked'
, $el = this.$element
, $parent = $el.closest('.checkbox')
, checked = $el.prop(ch)
, e = $.Event('toggle')
if ($el.prop('disabled') == false) {
$parent.toggleClass(ch) && checked ? $el.removeAttr(ch) : $el.prop(ch, ch);
$el.trigger(e).trigger('change');
}
}
, setCheck: function (option) {
var d = 'disabled'
, ch = 'checked'
, $el = this.$element
, $parent = $el.closest('.checkbox')
, checkAction = option == 'check' ? true : false
, e = $.Event(option)
$parent[checkAction ? 'addClass' : 'removeClass' ](ch) && checkAction ? $el.prop(ch, ch) : $el.removeAttr(ch);
$el.trigger(e).trigger('change');
}
}
/* CHECKBOX PLUGIN DEFINITION
* ======================== */
var old = $.fn.checkbox
$.fn.checkbox = function (option) {
return this.each(function () {
var $this = $(this)
, data = $this.data('checkbox')
, options = $.extend({}, $.fn.checkbox.defaults, $this.data(), typeof option == 'object' && option);
if (!data) $this.data('checkbox', (data = new Checkbox(this, options)));
if (option == 'toggle') data.toggle()
if (option == 'check' || option == 'uncheck') data.setCheck(option)
else if (option) data.setState();
});
}
$.fn.checkbox.defaults = {
template: '<span class="icons"><span class="first-icon fa fa-square fa-base"></span><span class="second-icon fa fa-check-square fa-base"></span></span>'
}
/* CHECKBOX NO CONFLICT
* ================== */
$.fn.checkbox.noConflict = function () {
$.fn.checkbox = old;
return this;
}
/* CHECKBOX DATA-API
* =============== */
$(document).on('click.checkbox.data-api', '[data-toggle^=checkbox], .checkbox', function (e) {
var $checkbox = $(e.target);
if (e.target.tagName != "A") {
e && e.preventDefault() && e.stopPropagation();
if (!$checkbox.hasClass('checkbox')) $checkbox = $checkbox.closest('.checkbox');
$checkbox.find(':checkbox').checkbox('toggle');
}
});
$(function () {
$('input[type="checkbox"]').each(function () {
var $checkbox = $(this);
$checkbox.checkbox();
});
});
}(window.jQuery);
/* =============================================================
* flatui-radio v0.0.3
* ============================================================ */
!function ($) {
/* RADIO PUBLIC CLASS DEFINITION
* ============================== */
var Radio = function (element, options) {
this.init(element, options);
}
Radio.prototype = {
constructor: Radio
, init: function (element, options) {
var $el = this.$element = $(element)
this.options = $.extend({}, $.fn.radio.defaults, options);
$el.before(this.options.template);
this.setState();
}
, setState: function () {
var $el = this.$element
, $parent = $el.closest('.radio');
$el.prop('disabled') && $parent.addClass('disabled');
$el.prop('checked') && $parent.addClass('checked');
}
, toggle: function () {
var d = 'disabled'
, ch = 'checked'
, $el = this.$element
, checked = $el.prop(ch)
, $parent = $el.closest('.radio')
, $parentWrap = $el.closest('form').length ? $el.closest('form') : $el.closest('body')
, $elemGroup = $parentWrap.find(':radio[name="' + $el.attr('name') + '"]')
, e = $.Event('toggle')
if ($el.prop(d) == false) {
$elemGroup.not($el).each(function () {
var $el = $(this)
, $parent = $(this).closest('.radio');
if ($el.prop(d) == false) {
$parent.removeClass(ch) && $el.removeAttr(ch).trigger('change');
}
});
if (checked == false) $parent.addClass(ch) && $el.prop(ch, true);
$el.trigger(e);
if (checked !== $el.prop(ch)) {
$el.trigger('change');
}
}
}
, setCheck: function (option) {
var ch = 'checked'
, $el = this.$element
, $parent = $el.closest('.radio')
, checkAction = option == 'check' ? true : false
, checked = $el.prop(ch)
, $parentWrap = $el.closest('form').length ? $el.closest('form') : $el.closest('body')
, $elemGroup = $parentWrap.find(':radio[name="' + $el['attr']('name') + '"]')
, e = $.Event(option)
$elemGroup.not($el).each(function () {
var $el = $(this)
, $parent = $(this).closest('.radio');
$parent.removeClass(ch) && $el.removeAttr(ch);
});
$parent[checkAction ? 'addClass' : 'removeClass'](ch) && checkAction ? $el.prop(ch, ch) : $el.removeAttr(ch);
$el.trigger(e);
if (checked !== $el.prop(ch)) {
$el.trigger('change');
}
}
}
/* RADIO PLUGIN DEFINITION
* ======================== */
var old = $.fn.radio
$.fn.radio = function (option) {
return this.each(function () {
var $this = $(this)
, data = $this.data('radio')
, options = $.extend({}, $.fn.radio.defaults, $this.data(), typeof option == 'object' && option);
if (!data) $this.data('radio', (data = new Radio(this, options)));
if (option == 'toggle') data.toggle()
if (option == 'check' || option == 'uncheck') data.setCheck(option)
else if (option) data.setState();
});
}
$.fn.radio.defaults = {
template: '<span class="icons"><span class="first-icon fa fa-circle-o fa-base"></span><span class="second-icon fa fa-dot-circle-o fa-base"></span></span>'
}
/* RADIO NO CONFLICT
* ================== */
$.fn.radio.noConflict = function () {
$.fn.radio = old;
return this;
}
/* RADIO DATA-API
* =============== */
$(document).on('click.radio.data-api', '[data-toggle^=radio], .radio', function (e) {
var $radio = $(e.target);
e && e.preventDefault() && e.stopPropagation();
if (!$radio.hasClass('radio')) $radio = $radio.closest('.radio');
$radio.find(':radio').radio('toggle');
});
$(function () {
$('input[type="radio"]').each(function () {
var $radio = $(this);
$radio.radio();
});
});
}(window.jQuery);

@ -1,404 +0,0 @@
/*
Creative Tim Modifications
Lines: 239, 240 was changed from top: 5px to top: 50% and we added margin-top: -13px. In this way the close button will be aligned vertically
Line:242 - modified when the icon is set, we add the class "alert-with-icon", so there will be enough space for the icon.
*/
/*
* Project: Bootstrap Notify = v3.1.5
* Description: Turns standard Bootstrap alerts into "Growl-like" notifications.
* Author: Mouse0270 aka Robert McIntosh
* License: MIT License
* Website: https://github.com/mouse0270/bootstrap-growl
*/
/* global define:false, require: false, jQuery:false */
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
} else if (typeof exports === 'object') {
// Node/CommonJS
factory(require('jquery'));
} else {
// Browser globals
factory(jQuery);
}
}(function ($) {
// Create the defaults once
var defaults = {
element: 'body',
position: null,
type: "info",
allow_dismiss: true,
allow_duplicates: true,
newest_on_top: false,
showProgressbar: false,
placement: {
from: "top",
align: "right"
},
offset: 20,
spacing: 10,
z_index: 1031,
delay: 5000,
timer: 1000,
url_target: '_blank',
mouse_over: null,
animate: {
enter: 'animated fadeInDown',
exit: 'animated fadeOutUp'
},
onShow: null,
onShown: null,
onClose: null,
onClosed: null,
icon_type: 'class',
template: '<div data-notify="container" class="col-xs-11 col-sm-4 alert alert-{0}" role="alert"><button type="button" aria-hidden="true" class="close" data-notify="dismiss">&times;</button><span data-notify="icon"></span> <span data-notify="title">{1}</span> <span data-notify="message">{2}</span><div class="progress" data-notify="progressbar"><div class="progress-bar progress-bar-{0}" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%;"></div></div><a href="{3}" target="{4}" data-notify="url"></a></div>'
};
String.format = function () {
var str = arguments[0];
for (var i = 1; i < arguments.length; i++) {
str = str.replace(RegExp("\\{" + (i - 1) + "\\}", "gm"), arguments[i]);
}
return str;
};
function isDuplicateNotification(notification) {
var isDupe = false;
$('[data-notify="container"]').each(function (i, el) {
var $el = $(el);
var title = $el.find('[data-notify="title"]').text().trim();
var message = $el.find('[data-notify="message"]').html().trim();
// The input string might be different than the actual parsed HTML string!
// (<br> vs <br /> for example)
// So we have to force-parse this as HTML here!
var isSameTitle = title === $("<div>" + notification.settings.content.title + "</div>").html().trim();
var isSameMsg = message === $("<div>" + notification.settings.content.message + "</div>").html().trim();
var isSameType = $el.hasClass('alert-' + notification.settings.type);
if (isSameTitle && isSameMsg && isSameType) {
//we found the dupe. Set the var and stop checking.
isDupe = true;
}
return !isDupe;
});
return isDupe;
}
function Notify(element, content, options) {
// Setup Content of Notify
var contentObj = {
content: {
message: typeof content === 'object' ? content.message : content,
title: content.title ? content.title : '',
icon: content.icon ? content.icon : '',
url: content.url ? content.url : '#',
target: content.target ? content.target : '-'
}
};
options = $.extend(true, {}, contentObj, options);
this.settings = $.extend(true, {}, defaults, options);
this._defaults = defaults;
if (this.settings.content.target === "-") {
this.settings.content.target = this.settings.url_target;
}
this.animations = {
start: 'webkitAnimationStart oanimationstart MSAnimationStart animationstart',
end: 'webkitAnimationEnd oanimationend MSAnimationEnd animationend'
};
if (typeof this.settings.offset === 'number') {
this.settings.offset = {
x: this.settings.offset,
y: this.settings.offset
};
}
//if duplicate messages are not allowed, then only continue if this new message is not a duplicate of one that it already showing
if (this.settings.allow_duplicates || (!this.settings.allow_duplicates && !isDuplicateNotification(this))) {
this.init();
}
}
$.extend(Notify.prototype, {
init: function () {
var self = this;
this.buildNotify();
if (this.settings.content.icon) {
this.setIcon();
}
if (this.settings.content.url != "#") {
this.styleURL();
}
this.styleDismiss();
this.placement();
this.bind();
this.notify = {
$ele: this.$ele,
update: function (command, update) {
var commands = {};
if (typeof command === "string") {
commands[command] = update;
} else {
commands = command;
}
for (var cmd in commands) {
switch (cmd) {
case "type":
this.$ele.removeClass('alert-' + self.settings.type);
this.$ele.find('[data-notify="progressbar"] > .progress-bar').removeClass('progress-bar-' + self.settings.type);
self.settings.type = commands[cmd];
this.$ele.addClass('alert-' + commands[cmd]).find('[data-notify="progressbar"] > .progress-bar').addClass('progress-bar-' + commands[cmd]);
break;
case "icon":
var $icon = this.$ele.find('[data-notify="icon"]');
if (self.settings.icon_type.toLowerCase() === 'class') {
$icon.removeClass(self.settings.content.icon).addClass(commands[cmd]);
} else {
if (!$icon.is('img')) {
$icon.find('img');
}
$icon.attr('src', commands[cmd]);
}
break;
case "progress":
var newDelay = self.settings.delay - (self.settings.delay * (commands[cmd] / 100));
this.$ele.data('notify-delay', newDelay);
this.$ele.find('[data-notify="progressbar"] > div').attr('aria-valuenow', commands[cmd]).css('width', commands[cmd] + '%');
break;
case "url":
this.$ele.find('[data-notify="url"]').attr('href', commands[cmd]);
break;
case "target":
this.$ele.find('[data-notify="url"]').attr('target', commands[cmd]);
break;
default:
this.$ele.find('[data-notify="' + cmd + '"]').html(commands[cmd]);
}
}
var posX = this.$ele.outerHeight() + parseInt(self.settings.spacing) + parseInt(self.settings.offset.y);
self.reposition(posX);
},
close: function () {
self.close();
}
};
},
buildNotify: function () {
var content = this.settings.content;
this.$ele = $(String.format(this.settings.template, this.settings.type, content.title, content.message, content.url, content.target));
this.$ele.attr('data-notify-position', this.settings.placement.from + '-' + this.settings.placement.align);
if (!this.settings.allow_dismiss) {
this.$ele.find('[data-notify="dismiss"]').css('display', 'none');
}
if ((this.settings.delay <= 0 && !this.settings.showProgressbar) || !this.settings.showProgressbar) {
this.$ele.find('[data-notify="progressbar"]').remove();
}
},
setIcon: function () {
this.$ele.addClass('alert-with-icon');
if (this.settings.icon_type.toLowerCase() === 'class') {
this.$ele.find('[data-notify="icon"]').addClass(this.settings.content.icon);
} else {
if (this.$ele.find('[data-notify="icon"]').is('img')) {
this.$ele.find('[data-notify="icon"]').attr('src', this.settings.content.icon);
} else {
this.$ele.find('[data-notify="icon"]').append('<img src="' + this.settings.content.icon + '" alt="Notify Icon" />');
}
}
},
styleDismiss: function () {
this.$ele.find('[data-notify="dismiss"]').css({
position: 'absolute',
right: '10px',
top: '50%',
marginTop: '-13px',
zIndex: this.settings.z_index + 2
});
},
styleURL: function () {
this.$ele.find('[data-notify="url"]').css({
backgroundImage: 'url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)',
height: '100%',
left: 0,
position: 'absolute',
top: 0,
width: '100%',
zIndex: this.settings.z_index + 1
});
},
placement: function () {
var self = this,
offsetAmt = this.settings.offset.y,
css = {
display: 'inline-block',
margin: '0px auto',
position: this.settings.position ? this.settings.position : (this.settings.element === 'body' ? 'fixed' : 'absolute'),
transition: 'all .5s ease-in-out',
zIndex: this.settings.z_index
},
hasAnimation = false,
settings = this.settings;
$('[data-notify-position="' + this.settings.placement.from + '-' + this.settings.placement.align + '"]:not([data-closing="true"])').each(function () {
offsetAmt = Math.max(offsetAmt, parseInt($(this).css(settings.placement.from)) + parseInt($(this).outerHeight()) + parseInt(settings.spacing));
});
if (this.settings.newest_on_top === true) {
offsetAmt = this.settings.offset.y;
}
css[this.settings.placement.from] = offsetAmt + 'px';
switch (this.settings.placement.align) {
case "left":
case "right":
css[this.settings.placement.align] = this.settings.offset.x + 'px';
break;
case "center":
css.left = 0;
css.right = 0;
break;
}
this.$ele.css(css).addClass(this.settings.animate.enter);
$.each(Array('webkit-', 'moz-', 'o-', 'ms-', ''), function (index, prefix) {
self.$ele[0].style[prefix + 'AnimationIterationCount'] = 1;
});
$(this.settings.element).append(this.$ele);
if (this.settings.newest_on_top === true) {
offsetAmt = (parseInt(offsetAmt) + parseInt(this.settings.spacing)) + this.$ele.outerHeight();
this.reposition(offsetAmt);
}
if ($.isFunction(self.settings.onShow)) {
self.settings.onShow.call(this.$ele);
}
this.$ele.one(this.animations.start, function () {
hasAnimation = true;
}).one(this.animations.end, function () {
if ($.isFunction(self.settings.onShown)) {
self.settings.onShown.call(this);
}
});
setTimeout(function () {
if (!hasAnimation) {
if ($.isFunction(self.settings.onShown)) {
self.settings.onShown.call(this);
}
}
}, 600);
},
bind: function () {
var self = this;
this.$ele.find('[data-notify="dismiss"]').on('click', function () {
self.close();
});
this.$ele.mouseover(function () {
$(this).data('data-hover', "true");
}).mouseout(function () {
$(this).data('data-hover', "false");
});
this.$ele.data('data-hover', "false");
if (this.settings.delay > 0) {
self.$ele.data('notify-delay', self.settings.delay);
var timer = setInterval(function () {
var delay = parseInt(self.$ele.data('notify-delay')) - self.settings.timer;
if ((self.$ele.data('data-hover') === 'false' && self.settings.mouse_over === "pause") || self.settings.mouse_over != "pause") {
var percent = ((self.settings.delay - delay) / self.settings.delay) * 100;
self.$ele.data('notify-delay', delay);
self.$ele.find('[data-notify="progressbar"] > div').attr('aria-valuenow', percent).css('width', percent + '%');
}
if (delay <= -(self.settings.timer)) {
clearInterval(timer);
self.close();
}
}, self.settings.timer);
}
},
close: function () {
var self = this,
posX = parseInt(this.$ele.css(this.settings.placement.from)),
hasAnimation = false;
this.$ele.data('closing', 'true').addClass(this.settings.animate.exit);
self.reposition(posX);
if ($.isFunction(self.settings.onClose)) {
self.settings.onClose.call(this.$ele);
}
this.$ele.one(this.animations.start, function () {
hasAnimation = true;
}).one(this.animations.end, function () {
$(this).remove();
if ($.isFunction(self.settings.onClosed)) {
self.settings.onClosed.call(this);
}
});
setTimeout(function () {
if (!hasAnimation) {
self.$ele.remove();
if (self.settings.onClosed) {
self.settings.onClosed(self.$ele);
}
}
}, 600);
},
reposition: function (posX) {
var self = this,
notifies = '[data-notify-position="' + this.settings.placement.from + '-' + this.settings.placement.align + '"]:not([data-closing="true"])',
$elements = this.$ele.nextAll(notifies);
if (this.settings.newest_on_top === true) {
$elements = this.$ele.prevAll(notifies);
}
$elements.each(function () {
$(this).css(self.settings.placement.from, posX);
posX = (parseInt(posX) + parseInt(self.settings.spacing)) + $(this).outerHeight();
});
}
});
$.notify = function (content, options) {
var plugin = new Notify(this, content, options);
return plugin.notify;
};
$.notifyDefaults = function (options) {
defaults = $.extend(true, {}, defaults, options);
return defaults;
};
$.notifyClose = function (command) {
if (typeof command === "undefined" || command === "all") {
$('[data-notify]').find('[data-notify="dismiss"]').trigger('click');
} else {
$('[data-notify-position="' + command + '"]').find('[data-notify="dismiss"]').trigger('click');
}
};
}));

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,216 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta content="origin" name="referrer" />
<link crossorigin="anonymous" href="https://assets-cdn.github.com/assets/frameworks-d48d0c441ed0ab66aa7d582c5aaf762f4a1eef9a915871a36ddb07e71b01ffb2.css" media="all" rel="stylesheet" />
<link crossorigin="anonymous" href="https://assets-cdn.github.com/assets/github-eceee2011dedd755b4dda5f1d5d1e21b21898ea894ef433b5ac3113bbae89a6e.css" media="all" rel="stylesheet" />
<link crossorigin="anonymous" href="https://assets-cdn.github.com/assets/site-7f1a41ba2b363d8328a1603010c1c34aa7da36bd92ed8693a262fc5b703f2b10.css" media="all" rel="stylesheet" />
<meta name="viewport" content="width=device-width">
<title>Sign in to GitHub · GitHub</title>
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub">
<link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub">
<meta property="fb:app_id" content="1401488693436528">
<meta property="og:url" content="https://github.com">
<meta property="og:site_name" content="GitHub">
<meta property="og:title" content="Build software better, together">
<meta property="og:description" content="GitHub is where people build software. More than 22 million people use GitHub to discover, fork, and contribute to over 60 million projects.">
<meta property="og:image" content="https://assets-cdn.github.com/images/modules/open_graph/github-logo.png">
<meta property="og:image:type" content="image/png">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="1200">
<meta property="og:image" content="https://assets-cdn.github.com/images/modules/open_graph/github-mark.png">
<meta property="og:image:type" content="image/png">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="620">
<meta property="og:image" content="https://assets-cdn.github.com/images/modules/open_graph/github-octocat.png">
<meta property="og:image:type" content="image/png">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="620">
<link rel="assets" href="https://assets-cdn.github.com/">
<meta name="pjax-timeout" content="1000">
<meta name="request-id" content="F4D1:0758:104FC4A:1870ADF:5939D212" data-pjax-transient>
<meta name="selected-link" value="/login" data-pjax-transient>
<meta name="google-site-verification" content="KT5gs8h0wvaagLKAVWq8bbeNwnZZK1r1XQysX3xurLU">
<meta name="google-site-verification" content="ZzhVyEFwb7w3e0-uOTltm8Jsck2F5StVihD0exw2fsA">
<meta name="google-analytics" content="UA-3769691-2">
<meta content="collector.githubapp.com" name="octolytics-host" /><meta content="github" name="octolytics-app-id" /><meta content="https://collector.githubapp.com/github-external/browser_event" name="octolytics-event-url" /><meta content="F4D1:0758:104FC4A:1870ADF:5939D212" name="octolytics-dimension-request_id" /><meta content="iad" name="octolytics-dimension-region_edge" /><meta content="iad" name="octolytics-dimension-region_render" />
<meta content="true" data-pjax-transient="true" name="analytics-location-query-strip" />
<meta class="js-ga-set" name="dimension1" content="Logged Out">
<meta name="hostname" content="github.com">
<meta name="user-login" content="">
<meta name="expected-hostname" content="github.com">
<meta name="js-proxy-site-detection-payload" content="YzUxN2E0MzU5NThkYzJjMzJhNmI3MTRlYzg4M2NmNzMxOGNlYmY4OWRmZGExNjAwZWQwYjVhZTQ4OGZhZTgxY3x7InJlbW90ZV9hZGRyZXNzIjoiNzUuMTQ5LjEwMC4yNTIiLCJyZXF1ZXN0X2lkIjoiRjREMTowNzU4OjEwNEZDNEE6MTg3MEFERjo1OTM5RDIxMiIsInRpbWVzdGFtcCI6MTQ5Njk2MTU1NCwiaG9zdCI6ImdpdGh1Yi5jb20ifQ==">
<meta name="html-safe-nonce" content="f53b182df68775bfd599d2db2b3644f6f57f3d6c">
<meta http-equiv="x-pjax-version" content="4b86b6b789ca74deb1b3578459c44709">
<meta name="description" content="GitHub is where people build software. More than 22 million people use GitHub to discover, fork, and contribute to over 60 million projects.">
<link rel="canonical" href="https://github.com/login" data-pjax-transient>
<meta name="browser-stats-url" content="https://api.github.com/_private/browser/stats">
<meta name="browser-errors-url" content="https://api.github.com/_private/browser/errors">
<link rel="mask-icon" href="https://assets-cdn.github.com/pinned-octocat.svg" color="#000000">
<link rel="icon" type="image/x-icon" href="https://assets-cdn.github.com/favicon.ico">
<meta name="theme-color" content="#1e2327">
</head>
<body class="logged-out env-production session-authentication page-responsive min-width-0">
<div class="position-relative js-header-wrapper ">
<a href="#start-of-content" tabindex="1" class="accessibility-aid js-skip-to-content">Skip to content</a>
<div id="js-pjax-loader-bar" class="pjax-loader-bar"><div class="progress"></div></div>
<div class="header header-logged-out width-full pt-5 pb-4" role="banner">
<div class="container clearfix width-full">
<a class="header-logo" href="https://github.com/" aria-label="Homepage" data-ga-click="(Logged out) Header, go to homepage, icon:logo-wordmark">
<svg aria-hidden="true" class="octicon octicon-mark-github" height="48" version="1.1" viewBox="0 0 16 16" width="48"><path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"/></svg>
</a>
</div>
</div>
</div>
<div id="start-of-content" class="accessibility-aid"></div>
<div role="main">
<div id="js-pjax-container" data-pjax-container>
<div class="auth-form px-3" id="login">
<!-- '"` --><!-- </textarea></xmp> --></option></form><form accept-charset="UTF-8" action="/session" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /><input name="authenticity_token" type="hidden" value="7XZSonP0W9pDyZpVrbdXWHCiRNfnCXldeVF5M83at4CARFuqW64xs69pW4t4+L8Uumbz21TkBxVMPfv/xF3/aw==" /></div> <div class="auth-form-header p-0">
<h1>Sign in to GitHub</h1>
</div>
<div id="js-flash-container">
</div>
<div class="auth-form-body mt-3">
<label for="login_field">
Username or email address
</label>
<input autocapitalize="off" autocorrect="off" autofocus="autofocus" class="form-control input-block" id="login_field" name="login" tabindex="1" type="text" />
<label for="password">
Password <a href="/password_reset" class="label-link">Forgot password?</a>
</label>
<input class="form-control form-control input-block" id="password" name="password" tabindex="2" type="password" />
<input class="btn btn-primary btn-block" data-disable-with="Signing in…" name="commit" tabindex="3" type="submit" value="Sign in" />
</div>
</form>
<p class="create-account-callout mt-3">
New to GitHub?
<a href="/join?return_to=https%3A%2F%2Fgithub.com%2Fgionkunz%2Fchartist-js%2Fedit%2Fdevelop%2Fdist%2Fchartist.min.js.map&amp;source=login" data-ga-click="Sign in, switch to sign up">Create an account</a>.
</p>
</div>
</div>
<div class="modal-backdrop js-touch-events"></div>
</div>
<div class="site-footer" role="contentinfo">
<ul class="site-footer-links">
<li><a href="https://github.com/site/terms" data-ga-click="Footer, go to terms, text:terms">Terms</a></li>
<li><a href="https://github.com/site/privacy" data-ga-click="Footer, go to privacy, text:privacy">Privacy</a></li>
<li><a href="https://github.com/security" data-ga-click="Footer, go to security, text:security">Security</a></li>
<li><a href="https://github.com/contact" data-ga-click="Footer, go to contact, text:contact">Contact GitHub</a></li>
</ul>
</div>
<div id="ajax-error-message" class="ajax-error-message flash flash-error">
<svg aria-hidden="true" class="octicon octicon-alert" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M8.865 1.52c-.18-.31-.51-.5-.87-.5s-.69.19-.87.5L.275 13.5c-.18.31-.18.69 0 1 .19.31.52.5.87.5h13.7c.36 0 .69-.19.86-.5.17-.31.18-.69.01-1L8.865 1.52zM8.995 13h-2v-2h2v2zm0-3h-2V6h2v4z"/></svg>
<button type="button" class="flash-close js-flash-close js-ajax-error-dismiss" aria-label="Dismiss error">
<svg aria-hidden="true" class="octicon octicon-x" height="16" version="1.1" viewBox="0 0 12 16" width="12"><path fill-rule="evenodd" d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48z"/></svg>
</button>
You can't perform that action at this time.
</div>
<script crossorigin="anonymous" src="https://assets-cdn.github.com/assets/compat-8a4318ffea09a0cdb8214b76cf2926b9f6a0ced318a317bed419db19214c690d.js"></script>
<script crossorigin="anonymous" src="https://assets-cdn.github.com/assets/frameworks-73720f027bb317fceb118c259275da4be5efa344c246a12341a68c3168ceeaa7.js"></script>
<script async="async" crossorigin="anonymous" src="https://assets-cdn.github.com/assets/github-3ad5579f0af51ee1adcb93de64d25ce6771132f49f8044580b60743ec58d520c.js"></script>
<div class="js-stale-session-flash stale-session-flash flash flash-warn flash-banner d-none">
<svg aria-hidden="true" class="octicon octicon-alert" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M8.865 1.52c-.18-.31-.51-.5-.87-.5s-.69.19-.87.5L.275 13.5c-.18.31-.18.69 0 1 .19.31.52.5.87.5h13.7c.36 0 .69-.19.86-.5.17-.31.18-.69.01-1L8.865 1.52zM8.995 13h-2v-2h2v2zm0-3h-2V6h2v4z"/></svg>
<span class="signed-in-tab-flash">You signed in with another tab or window. <a href="">Reload</a> to refresh your session.</span>
<span class="signed-out-tab-flash">You signed out in another tab or window. <a href="">Reload</a> to refresh your session.</span>
</div>
<div class="facebox" id="facebox" style="display:none;">
<div class="facebox-popup">
<div class="facebox-content" role="dialog" aria-labelledby="facebox-header" aria-describedby="facebox-description">
</div>
<button type="button" class="facebox-close js-facebox-close" aria-label="Close modal">
<svg aria-hidden="true" class="octicon octicon-x" height="16" version="1.1" viewBox="0 0 12 16" width="12"><path fill-rule="evenodd" d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48z"/></svg>
</button>
</div>
</div>
</body>
</html>

@ -1,205 +0,0 @@
type = ['','info','success','warning','danger'];
dashboard = {
initPickColor: function(){
$('.pick-class-label').click(function(){
var new_class = $(this).attr('new-class');
var old_class = $('#display-buttons').attr('data-class');
var display_div = $('#display-buttons');
if(display_div.length) {
var display_buttons = display_div.find('.btn');
display_buttons.removeClass(old_class);
display_buttons.addClass(new_class);
display_div.attr('data-class', new_class);
}
});
},
initChartist: function(){
function make_array() {
triple_array = [];
for (i=0;i<3;i++){
myarray = Array.from({length: 24}, () => Math.floor(Math.random() * 100))
triple_array.push(myarray)
}
return triple_array
}
// monitoring apps chart
var getData = $.get('/1/app/usage/trend');
getData.done(function(results) {
var app_usage_trend = JSON.parse(results);
if ($.isEmptyObject(app_usage_trend)){
console.log('app_usage_trend is empty, setting testing values.');
app_usage_trend = [];
random_array = make_array();
app_usage_trend = random_array
}
var dataChart = {
labels: ['24','23','22','21','20','19','18','17','16','15','14','13','12','11','10','9','8','7','6','5','4','3','2','1' ],
series: app_usage_trend //TODO: Check the order, the graph is by index not name.
};
dataChartArray = dataChart.series;
var maxlist = dataChartArray.map(function (dataChartArray) {
return Math.max.apply(null, dataChartArray);
});
maxNum = Math.max.apply(null, maxlist);
var optionsChart = {
lineSmooth: false,
low: 0,
high: maxNum + 1,
showArea: true,
height: "245px",
axisX: {
showGrid: false
},
lineSmooth: Chartist.Interpolation.simple({
divisor: 1
}),
showLine: true,
showPoint: false
};
var responsiveChart = [
['screen and (max-width: 640px)', {
axisX: {
labelInterpolationFnc: function (value) {
return value[0];
}
}
}]
];
Chartist.Line('#chartHours', dataChart, optionsChart, responsiveChart);
// cpu and memory usage--------------------------
var data = {
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
series: make_array()
};
var options = {
seriesBarDistance: 10,
axisX: {
showGrid: false
},
height: "245px"
};
var responsiveOptions = [
['screen and (max-width: 640px)', {
seriesBarDistance: 5,
axisX: {
labelInterpolationFnc: function (value) {
return value[0];
}
}
}]
];
Chartist.Line('#chartActivity', data, options, responsiveOptions);
//app status pie chart, idle, running, crash
var getStatus = $.get('1/app/status');
getStatus.done(function(results) {
var pie_chart = JSON.parse(results);
if ($.isEmptyObject(pie_chart)){
console.log('pie_chart is empty, setting testing values.');
app_status = [1,2,3]
}
// var app_status = [];
// app_status.push(pie_chart.idle);
// app_status.push(pie_chart.crash);
// app_status.push(pie_chart.running);
Chartist.Pie('#chartPreferences', {
labels: app_status,
series: app_status
},{donut:true});
}) /// end getStatus
})
},
// End chartist function
initGoogleMaps: function(){
var myLatlng = new google.maps.LatLng(40.748817, -73.985428);
var mapOptions = {
zoom: 13,
center: myLatlng,
scrollwheel: false, //we disable de scroll over the map, it is a really annoing when you scroll through page
styles: [{"featureType":"water","stylers":[{"saturation":43},{"lightness":-11},{"hue":"#0088ff"}]},{"featureType":"road","elementType":"geometry.fill","stylers":[{"hue":"#ff0000"},{"saturation":-100},{"lightness":99}]},{"featureType":"road","elementType":"geometry.stroke","stylers":[{"color":"#808080"},{"lightness":54}]},{"featureType":"landscape.man_made","elementType":"geometry.fill","stylers":[{"color":"#ece2d9"}]},{"featureType":"poi.park","elementType":"geometry.fill","stylers":[{"color":"#ccdca1"}]},{"featureType":"road","elementType":"labels.text.fill","stylers":[{"color":"#767676"}]},{"featureType":"road","elementType":"labels.text.stroke","stylers":[{"color":"#ffffff"}]},{"featureType":"poi","stylers":[{"visibility":"off"}]},{"featureType":"landscape.natural","elementType":"geometry.fill","stylers":[{"visibility":"on"},{"color":"#b8cb93"}]},{"featureType":"poi.park","stylers":[{"visibility":"on"}]},{"featureType":"poi.sports_complex","stylers":[{"visibility":"on"}]},{"featureType":"poi.medical","stylers":[{"visibility":"on"}]},{"featureType":"poi.business","stylers":[{"visibility":"simplified"}]}]
};
var map = new google.maps.Map(document.getElementById("map"), mapOptions);
var marker = new google.maps.Marker({
position: myLatlng,
title:"Hello World!"
});
// To add the marker to the map, call setMap();
marker.setMap(map);
},
showNotification: function(from, align){
color = Math.floor((Math.random() * 4) + 1);
$.notify({
icon: "ti-comment",
message: "Message."
},{
type: type[color],
timer: 4000,
placement: {
from: from,
align: align
}
});
}
};
/**
* Global information about the dashboard
* @TODO: Add socket handling ... it would make non-blocking updating information
*/
var g = {}
g.summary = {}
/**
* Initializing the top section of the dashboard (apps and folders)
*/
g.summary.factory = function (url,pointer) {
var object = {};
object.url = url;
var observer = null;
var TIME_ELLAPSED = 2000 ;
object.callback = function (r) {
r = JSON.parse(r.responseText);
pointer(r)
//observer.notify()
};
object.init = function (observer) {
observer = observer
var httpclient = HttpClient.instance();
//httpclient.setAsync(false)
httpclient.get(this.url, this.callback);
setTimeout(function(){
observer.notify()
},TIME_ELLAPSED) ;
//observer.notify()
};
return object
};

@ -1,140 +0,0 @@
var fixedTop = false;
var transparent = true;
var navbar_initialized = false;
$(document).ready(function(){
window_width = $(window).width();
// Init navigation toggle for small screens
if(window_width <= 991){
pd.initRightMenu();
}
// Activate the tooltips
$('[rel="tooltip"]').tooltip();
});
// activate collapse right menu when the windows is resized
$(window).resize(function(){
if($(window).width() <= 991){
pd.initRightMenu();
}
});
pd = {
misc:{
navbar_menu_visible: 0
},
checkScrollForTransparentNavbar: debounce(function() {
if($(document).scrollTop() > 381 ) {
if(transparent) {
transparent = false;
$('.navbar-color-on-scroll').removeClass('navbar-transparent');
$('.navbar-title').removeClass('hidden');
}
} else {
if( !transparent ) {
transparent = true;
$('.navbar-color-on-scroll').addClass('navbar-transparent');
$('.navbar-title').addClass('hidden');
}
}
}),
initRightMenu: function(){
if(!navbar_initialized){
$off_canvas_sidebar = $('nav').find('.navbar-collapse').first().clone(true);
$sidebar = $('.sidebar');
sidebar_bg_color = $sidebar.data('background-color');
sidebar_active_color = $sidebar.data('active-color');
$logo = $sidebar.find('.logo').first();
logo_content = $logo[0].outerHTML;
ul_content = '';
// set the bg color and active color from the default sidebar to the off canvas sidebar;
$off_canvas_sidebar.attr('data-background-color',sidebar_bg_color);
$off_canvas_sidebar.attr('data-active-color',sidebar_active_color);
$off_canvas_sidebar.addClass('off-canvas-sidebar');
//add the content from the regular header to the right menu
$off_canvas_sidebar.children('ul').each(function(){
content_buff = $(this).html();
ul_content = ul_content + content_buff;
});
// add the content from the sidebar to the right menu
content_buff = $sidebar.find('.nav').html();
ul_content = ul_content + '<li class="divider"></li>'+ content_buff;
ul_content = '<ul class="nav navbar-nav">' + ul_content + '</ul>';
navbar_content = logo_content + ul_content;
navbar_content = '<div class="sidebar-wrapper">' + navbar_content + '</div>';
$off_canvas_sidebar.html(navbar_content);
$('body').append($off_canvas_sidebar);
$toggle = $('.navbar-toggle');
$off_canvas_sidebar.find('a').removeClass('btn btn-round btn-default');
$off_canvas_sidebar.find('button').removeClass('btn-round btn-fill btn-info btn-primary btn-success btn-danger btn-warning btn-neutral');
$off_canvas_sidebar.find('button').addClass('btn-simple btn-block');
$toggle.click(function (){
if(pd.misc.navbar_menu_visible == 1) {
$('html').removeClass('nav-open');
pd.misc.navbar_menu_visible = 0;
$('#bodyClick').remove();
setTimeout(function(){
$toggle.removeClass('toggled');
}, 400);
} else {
setTimeout(function(){
$toggle.addClass('toggled');
}, 430);
div = '<div id="bodyClick"></div>';
$(div).appendTo("body").click(function() {
$('html').removeClass('nav-open');
pd.misc.navbar_menu_visible = 0;
$('#bodyClick').remove();
setTimeout(function(){
$toggle.removeClass('toggled');
}, 400);
});
$('html').addClass('nav-open');
pd.misc.navbar_menu_visible = 1;
}
});
navbar_initialized = true;
}
}
}
// Returns a function, that, as long as it continues to be invoked, will not
// be triggered. The function will be called after it stops being called for
// N milliseconds. If `immediate` is passed, trigger the function on the
// leading edge, instead of the trailing.
function debounce(func, wait, immediate) {
var timeout;
return function() {
var context = this, args = arguments;
clearTimeout(timeout);
timeout = setTimeout(function() {
timeout = null;
if (!immediate) func.apply(context, args);
}, wait);
if (immediate && !timeout) func.apply(context, args);
};
};

File diff suppressed because it is too large Load Diff

@ -1,130 +0,0 @@
module.exports = function(grunt) {
"use strict"
var banner =
"/*\n" +
" * jsGrid v<%= pkg.version %> (<%= pkg.homepage %>)\n" +
" * (c) <%= grunt.template.today('yyyy') %> <%= pkg.author %>\n" +
" * Licensed under <%= pkg.license.type %> (<%= pkg.license.url %>)\n" +
" */\n";
grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),
copy: {
imgs: {
expand: true,
cwd: "css/",
src: "*.png",
dest: "dist/"
},
i18n: {
expand: true,
cwd: "src/i18n/",
src: "*.js",
dest: "dist/i18n/",
rename: function(dest, src) {
return dest + "jsgrid-" + src;
}
}
},
concat: {
options: {
banner: banner + "\n",
separator: "\n"
},
js: {
src: [
"src/jsgrid.core.js",
"src/jsgrid.load-indicator.js",
"src/jsgrid.load-strategies.js",
"src/jsgrid.sort-strategies.js",
"src/jsgrid.validation.js",
"src/jsgrid.field.js",
"src/fields/jsgrid.field.text.js",
"src/fields/jsgrid.field.number.js",
"src/fields/jsgrid.field.textarea.js",
"src/fields/jsgrid.field.select.js",
"src/fields/jsgrid.field.checkbox.js",
"src/fields/jsgrid.field.control.js"
],
dest: "dist/<%= pkg.name %>.js"
},
css: {
src: "css/jsgrid.css",
dest: "dist/<%= pkg.name %>.css"
},
theme: {
src: "css/theme.css",
dest: "dist/<%= pkg.name %>-theme.css"
}
},
"string-replace": {
version: {
files: [{
src: "<%= concat.js.dest %>",
dest: "<%= concat.js.dest %>"
}],
options: {
replacements: [{
pattern: /"@VERSION"/g,
replacement: "'<%= pkg.version %>'"
}]
}
}
},
imageEmbed: {
options: {
deleteAfterEncoding : true
},
theme: {
src: "<%= concat.theme.dest %>",
dest: "<%= concat.theme.dest %>"
}
},
uglify: {
options : {
banner: banner + "\n"
},
js: {
src: "<%= concat.js.dest %>",
dest: "dist/<%= pkg.name %>.min.js"
}
},
cssmin: {
options : {
banner: banner
},
css: {
src: "<%= concat.css.dest %>",
dest: "dist/<%= pkg.name %>.min.css"
},
theme: {
src: "<%= concat.theme.dest %>",
dest: "dist/<%= pkg.name %>-theme.min.css"
}
},
qunit: {
files: ["tests/index.html"]
}
});
grunt.loadNpmTasks("grunt-contrib-copy");
grunt.loadNpmTasks("grunt-contrib-concat");
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-image-embed");
grunt.loadNpmTasks("grunt-contrib-cssmin");
grunt.loadNpmTasks("grunt-contrib-qunit");
grunt.loadNpmTasks('grunt-string-replace');
grunt.registerTask("default", ["copy", "concat", "string-replace", "imageEmbed", "uglify", "cssmin"]);
grunt.registerTask("test", "qunit");
};

@ -1,22 +0,0 @@
The MIT License (MIT)
Copyright (c) 2014 Artem Tabalin
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

File diff suppressed because it is too large Load Diff

@ -1,28 +0,0 @@
{
"name": "jsgrid",
"version": "1.5.3",
"main": [
"dist/jsgrid.js",
"dist/jsgrid.css",
"dist/jsgrid-theme.css"
],
"ignore": [
"demos",
"external",
"tests",
".editorconfig",
".gitignore",
".travis.yml",
"bower.json",
"Gruntfile.js",
"LICENSE",
"package.json",
"README.md"
],
"dependencies": {
"jquery": ">=1.8.3"
},
"devDependencies": {
"qunit": ">=1.10.0"
}
}

@ -1,59 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>jsGrid - Basic Scenario</title>
<link rel="stylesheet" type="text/css" href="demos.css" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,600,400' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="../css/jsgrid.css" />
<link rel="stylesheet" type="text/css" href="../css/theme.css" />
<script src="../external/jquery/jquery-1.8.3.js"></script>
<script src="db.js"></script>
<script src="../src/jsgrid.core.js"></script>
<script src="../src/jsgrid.load-indicator.js"></script>
<script src="../src/jsgrid.load-strategies.js"></script>
<script src="../src/jsgrid.sort-strategies.js"></script>
<script src="../src/jsgrid.field.js"></script>
<script src="../src/fields/jsgrid.field.text.js"></script>
<script src="../src/fields/jsgrid.field.number.js"></script>
<script src="../src/fields/jsgrid.field.select.js"></script>
<script src="../src/fields/jsgrid.field.checkbox.js"></script>
<script src="../src/fields/jsgrid.field.control.js"></script>
</head>
<body>
<h1>Basic Scenario</h1>
<div id="jsGrid"></div>
<script>
$(function() {
$("#jsGrid").jsGrid({
height: "70%",
width: "100%",
filtering: true,
editing: true,
inserting: true,
sorting: true,
paging: true,
autoload: true,
pageSize: 15,
pageButtonCount: 5,
deleteConfirm: "Do you really want to delete the client?",
controller: db,
fields: [
{ name: "Name", type: "text", width: 150 },
{ name: "Age", type: "number", width: 50 },
{ name: "Address", type: "text", width: 200 },
{ name: "Country", type: "select", items: db.countries, valueField: "Id", textField: "Name" },
{ name: "Married", type: "checkbox", title: "Is Married", sorting: false },
{ type: "control" }
]
});
});
</script>
</body>
</html>

@ -1,102 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>jsGrid - Batch Delete</title>
<link rel="stylesheet" type="text/css" href="demos.css" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,600,400' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="../css/jsgrid.css" />
<link rel="stylesheet" type="text/css" href="../css/theme.css" />
<script src="../external/jquery/jquery-1.8.3.js"></script>
<script src="db.js"></script>
<script src="../src/jsgrid.core.js"></script>
<script src="../src/jsgrid.load-indicator.js"></script>
<script src="../src/jsgrid.load-strategies.js"></script>
<script src="../src/jsgrid.sort-strategies.js"></script>
<script src="../src/jsgrid.field.js"></script>
<script src="../src/fields/jsgrid.field.text.js"></script>
<script src="../src/fields/jsgrid.field.number.js"></script>
<script src="../src/fields/jsgrid.field.control.js"></script>
</head>
<body>
<h1>Batch Delete</h1>
<div id="jsGrid"></div>
<script>
$(function() {
$("#jsGrid").jsGrid({
height: "50%",
width: "100%",
autoload: true,
confirmDeleting: false,
paging: true,
controller: {
loadData: function() {
return db.clients;
}
},
fields: [
{
headerTemplate: function() {
return $("<button>").attr("type", "button").text("Delete")
.on("click", function () {
deleteSelectedItems();
});
},
itemTemplate: function(_, item) {
return $("<input>").attr("type", "checkbox")
.prop("checked", $.inArray(item, selectedItems) > -1)
.on("change", function () {
$(this).is(":checked") ? selectItem(item) : unselectItem(item);
});
},
align: "center",
width: 50
},
{ name: "Name", type: "text", width: 150 },
{ name: "Age", type: "number", width: 50 },
{ name: "Address", type: "text", width: 200 }
]
});
var selectedItems = [];
var selectItem = function(item) {
selectedItems.push(item);
};
var unselectItem = function(item) {
selectedItems = $.grep(selectedItems, function(i) {
return i !== item;
});
};
var deleteSelectedItems = function() {
if(!selectedItems.length || !confirm("Are you sure?"))
return;
deleteClientsFromDb(selectedItems);
var $grid = $("#jsGrid");
$grid.jsGrid("option", "pageIndex", 1);
$grid.jsGrid("loadData");
selectedItems = [];
};
var deleteClientsFromDb = function(deletingClients) {
db.clients = $.map(db.clients, function(client) {
return ($.inArray(client, deletingClients) > -1) ? null : client;
});
};
});
</script>
</body>
</html>

@ -1,97 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>jsGrid - Custom Grid Field Scenario</title>
<link rel="stylesheet" type="text/css" href="demos.css" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,600,400' rel='stylesheet' type='text/css' />
<link rel="stylesheet" href="http://code.jquery.com/ui/1.11.2/themes/cupertino/jquery-ui.css">
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script src="http://code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
<link rel="stylesheet" type="text/css" href="../css/jsgrid.css" />
<link rel="stylesheet" type="text/css" href="../css/theme.css" />
<script src="db.js"></script>
<script src="../src/jsgrid.core.js"></script>
<script src="../src/jsgrid.load-indicator.js"></script>
<script src="../src/jsgrid.load-strategies.js"></script>
<script src="../src/jsgrid.sort-strategies.js"></script>
<script src="../src/jsgrid.field.js"></script>
<script src="../src/fields/jsgrid.field.text.js"></script>
<script src="../src/fields/jsgrid.field.control.js"></script>
<style>
.hasDatepicker {
width: 100px;
text-align: center;
}
.ui-datepicker * {
font-family: 'Helvetica Neue Light', 'Open Sans', Helvetica;
font-size: 14px;
font-weight: 300 !important;
}
</style>
</head>
<body>
<h1>Custom Grid DateField</h1>
<div id="jsGrid"></div>
<script>
$(function() {
var MyDateField = function(config) {
jsGrid.Field.call(this, config);
};
MyDateField.prototype = new jsGrid.Field({
sorter: function(date1, date2) {
return new Date(date1) - new Date(date2);
},
itemTemplate: function(value) {
return new Date(value).toDateString();
},
insertTemplate: function(value) {
return this._insertPicker = $("<input>").datepicker({ defaultDate: new Date() });
},
editTemplate: function(value) {
return this._editPicker = $("<input>").datepicker().datepicker("setDate", new Date(value));
},
insertValue: function() {
return this._insertPicker.datepicker("getDate").toISOString();
},
editValue: function() {
return this._editPicker.datepicker("getDate").toISOString();
}
});
jsGrid.fields.myDateField = MyDateField;
$("#jsGrid").jsGrid({
height: "70%",
width: "100%",
inserting: true,
editing: true,
sorting: true,
paging: true,
fields: [
{ name: "Account", width: 150, align: "center" },
{ name: "Name", type: "text" },
{ name: "RegisterDate", type: "myDateField", width: 100, align: "center" },
{ type: "control", editButton: false, modeSwitchButton: false }
],
data: db.users
});
});
</script>
</body>
</html>

@ -1,90 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>jsGrid - Custom Load Indicator</title>
<link rel="stylesheet" type="text/css" href="demos.css" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,600,400' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="../css/jsgrid.css" />
<link rel="stylesheet" type="text/css" href="../css/theme.css" />
<script src="http://cdnjs.cloudflare.com/ajax/libs/spin.js/2.3.1/spin.min.js"></script>
<script src="../external/jquery/jquery-1.8.3.js"></script>
<script src="../src/jsgrid.core.js"></script>
<script src="../src/jsgrid.load-indicator.js"></script>
<script src="../src/jsgrid.load-strategies.js"></script>
<script src="../src/jsgrid.sort-strategies.js"></script>
<script src="../src/jsgrid.field.js"></script>
<script src="../src/fields/jsgrid.field.text.js"></script>
<script src="../src/fields/jsgrid.field.textarea.js"></script>
<script src="../src/fields/jsgrid.field.number.js"></script>
<style>
.rating {
color: #F8CA03;
}
</style>
</head>
<body>
<h1>Custom Load Indicator</h1>
<div id="jsGrid"></div>
<script>
$(function() {
$("#jsGrid").jsGrid({
height: "50%",
width: "100%",
sorting: true,
paging: false,
autoload: true,
controller: {
loadData: function() {
var d = $.Deferred();
$.ajax({
url: "http://services.odata.org/V3/(S(3mnweai3qldmghnzfshavfok))/OData/OData.svc/Products",
dataType: "json"
}).done(function(response) {
setTimeout(function() {
d.resolve(response.value);
}, 2000);
});
return d.promise();
}
},
loadIndicator: function(config) {
var container = config.container[0];
var spinner = new Spinner();
return {
show: function() {
spinner.spin(container);
},
hide: function() {
spinner.stop();
}
};
},
fields: [
{ name: "Name", type: "text" },
{ name: "Description", type: "textarea", width: 150 },
{ name: "Rating", type: "number", width: 50, align: "center",
itemTemplate: function(value) {
return $("<div>").addClass("rating").append(Array(value + 1).join("&#9733;"));
}
},
{ name: "Price", type: "number", width: 50,
itemTemplate: function(value) {
return value.toFixed(2) + "$"; }
}
]
});
});
</script>
</body>
</html>

@ -1,79 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>jsGrid - Custom Row Renderer</title>
<link rel="stylesheet" type="text/css" href="demos.css" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,600,400' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="../css/jsgrid.css" />
<link rel="stylesheet" type="text/css" href="../css/theme.css" />
<script src="../external/jquery/jquery-1.8.3.js"></script>
<script src="../src/jsgrid.core.js"></script>
<script src="../src/jsgrid.load-indicator.js"></script>
<script src="../src/jsgrid.load-strategies.js"></script>
<script src="../src/jsgrid.sort-strategies.js"></script>
<script src="../src/jsgrid.field.js"></script>
<style>
.client-photo { float: left; margin: 0 20px 0 10px; }
.client-photo img { border-radius: 50%; border: 1px solid #ddd; }
.client-info { margin-top: 10px; }
.client-info p { line-height: 25px; }
</style>
</head>
<body>
<h1>Custom Row Renderer</h1>
<div id="jsGrid"></div>
<script>
$(function() {
$("#jsGrid").jsGrid({
height: "80%",
width: "50%",
autoload: true,
paging: true,
controller: {
loadData: function() {
var deferred = $.Deferred();
$.ajax({
url: 'http://api.randomuser.me/?results=40',
dataType: 'jsonp',
success: function(data){
deferred.resolve(data.results);
}
});
return deferred.promise();
}
},
rowRenderer: function(item) {
var user = item;
var $photo = $("<div>").addClass("client-photo").append($("<img>").attr("src", user.picture.large));
var $info = $("<div>").addClass("client-info")
.append($("<p>").append($("<strong>").text(user.name.first.capitalize() + " " + user.name.last.capitalize())))
.append($("<p>").text("Location: " + user.location.city.capitalize() + ", " + user.location.street))
.append($("<p>").text("Email: " + user.email))
.append($("<p>").text("Phone: " + user.phone))
.append($("<p>").text("Cell: " + user.cell));
return $("<tr>").append($("<td>").append($photo).append($info));
},
fields: [
{ title: "Clients" }
]
});
String.prototype.capitalize = function() {
return this.charAt(0).toUpperCase() + this.slice(1);
};
});
</script>
</body>
</html>

@ -1,85 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>jsGrid - Custom View Scenario</title>
<link rel="stylesheet" type="text/css" href="demos.css" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,600,400' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="../css/jsgrid.css" />
<link rel="stylesheet" type="text/css" href="../css/theme.css" />
<script src="../external/jquery/jquery-1.8.3.js"></script>
<script src="db.js"></script>
<script src="../src/jsgrid.core.js"></script>
<script src="../src/jsgrid.load-indicator.js"></script>
<script src="../src/jsgrid.load-strategies.js"></script>
<script src="../src/jsgrid.sort-strategies.js"></script>
<script src="../src/jsgrid.field.js"></script>
<script src="../src/fields/jsgrid.field.text.js"></script>
<script src="../src/fields/jsgrid.field.number.js"></script>
<script src="../src/fields/jsgrid.field.select.js"></script>
<script src="../src/fields/jsgrid.field.checkbox.js"></script>
<script src="../src/fields/jsgrid.field.control.js"></script>
<style>
.config-panel {
padding: 10px;
margin: 10px 0;
background: #fcfcfc;
border: 1px solid #e9e9e9;
display: inline-block;
}
.config-panel label {
margin-right: 10px;
}
</style>
</head>
<body>
<h1>Custom View</h1>
<div class="config-panel">
<label><input id="heading" type="checkbox" checked /> Heading</label>
<label><input id="filtering" type="checkbox" checked /> Filtering</label>
<label><input id="inserting" type="checkbox" /> Inserting</label>
<label><input id="editing" type="checkbox" checked /> Editing</label>
<label><input id="paging" type="checkbox" checked /> Paging</label>
<label><input id="sorting" type="checkbox" checked /> Sorting</label>
<label><input id="selecting" type="checkbox" checked /> Selecting</label>
</div>
<div id="jsGrid"></div>
<script>
$(function() {
$("#jsGrid").jsGrid({
height: "70%",
width: "100%",
filtering: true,
editing: true,
sorting: true,
paging: true,
autoload: true,
pageSize: 15,
pageButtonCount: 5,
controller: db,
fields: [
{ name: "Name", type: "text", width: 150 },
{ name: "Age", type: "number", width: 50 },
{ name: "Address", type: "text", width: 200 },
{ name: "Country", type: "select", items: db.countries, valueField: "Id", textField: "Name" },
{ name: "Married", type: "checkbox", title: "Is Married", sorting: false },
{ type: "control", modeSwitchButton: false, editButton: false }
]
});
$(".config-panel input[type=checkbox]").on("click", function() {
var $cb = $(this);
$("#jsGrid").jsGrid("option", $cb.attr("id"), $cb.is(":checked"));
});
});
</script>
</body>
</html>

@ -1,212 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>jsGrid - Data Manipulation</title>
<link rel="stylesheet" type="text/css" href="demos.css" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,600,400' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="../css/jsgrid.css" />
<link rel="stylesheet" type="text/css" href="../css/theme.css" />
<link rel="stylesheet" href="http://code.jquery.com/ui/1.11.2/themes/cupertino/jquery-ui.css">
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script src="http://code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.min.js"></script>
<script src="db.js"></script>
<script src="../src/jsgrid.core.js"></script>
<script src="../src/jsgrid.load-indicator.js"></script>
<script src="../src/jsgrid.load-strategies.js"></script>
<script src="../src/jsgrid.sort-strategies.js"></script>
<script src="../src/jsgrid.field.js"></script>
<script src="../src/fields/jsgrid.field.text.js"></script>
<script src="../src/fields/jsgrid.field.number.js"></script>
<script src="../src/fields/jsgrid.field.select.js"></script>
<script src="../src/fields/jsgrid.field.checkbox.js"></script>
<script src="../src/fields/jsgrid.field.control.js"></script>
<style>
.ui-widget *, .ui-widget input, .ui-widget select, .ui-widget button {
font-family: 'Helvetica Neue Light', 'Open Sans', Helvetica;
font-size: 14px;
font-weight: 300 !important;
}
.details-form-field input,
.details-form-field select {
width: 250px;
float: right;
}
.details-form-field {
margin: 30px 0;
}
.details-form-field:first-child {
margin-top: 10px;
}
.details-form-field:last-child {
margin-bottom: 10px;
}
.details-form-field button {
display: block;
width: 100px;
margin: 0 auto;
}
input.error, select.error {
border: 1px solid #ff9999;
background: #ffeeee;
}
label.error {
float: right;
margin-left: 100px;
font-size: .8em;
color: #ff6666;
}
</style>
</head>
<body>
<h1>Data Manipulation</h1>
<div id="jsGrid"></div>
<div id="detailsDialog">
<form id="detailsForm">
<div class="details-form-field">
<label for="name">Name:</label>
<input id="name" name="name" type="text" />
</div>
<div class="details-form-field">
<label for="age">Age:</label>
<input id="age" name="age" type="number" />
</div>
<div class="details-form-field">
<label for="address">Address:</label>
<input id="address" name="address" type="text" />
</div>
<div class="details-form-field">
<label for="country">Country:</label>
<select id="country" name="country">
<option value="">(Select)</option>
<option value="1">United States</option>
<option value="2">Canada</option>
<option value="3">United Kingdom</option>
<option value="4">France</option>
<option value="5">Brazil</option>
<option value="6">China</option>
<option value="7">Russia</option>
</select>
</div>
<div class="details-form-field">
<label for="married">Is Married</label>
<input id="married" name="married" type="checkbox" />
</div>
<div class="details-form-field">
<button type="submit" id="save">Save</button>
</div>
</form>
</div>
<script>
$(function() {
$("#jsGrid").jsGrid({
height: "70%",
width: "100%",
editing: true,
autoload: true,
paging: true,
deleteConfirm: function(item) {
return "The client \"" + item.Name + "\" will be removed. Are you sure?";
},
rowClick: function(args) {
showDetailsDialog("Edit", args.item);
},
controller: db,
fields: [
{ name: "Name", type: "text", width: 150 },
{ name: "Age", type: "number", width: 50 },
{ name: "Address", type: "text", width: 200 },
{ name: "Country", type: "select", items: db.countries, valueField: "Id", textField: "Name" },
{ name: "Married", type: "checkbox", title: "Is Married", sorting: false },
{
type: "control",
modeSwitchButton: false,
editButton: false,
headerTemplate: function() {
return $("<button>").attr("type", "button").text("Add")
.on("click", function () {
showDetailsDialog("Add", {});
});
}
}
]
});
$("#detailsDialog").dialog({
autoOpen: false,
width: 400,
close: function() {
$("#detailsForm").validate().resetForm();
$("#detailsForm").find(".error").removeClass("error");
}
});
$("#detailsForm").validate({
rules: {
name: "required",
age: { required: true, range: [18, 150] },
address: { required: true, minlength: 10 },
country: "required"
},
messages: {
name: "Please enter name",
age: "Please enter valid age",
address: "Please enter address (more than 10 chars)",
country: "Please select country"
},
submitHandler: function() {
formSubmitHandler();
}
});
var formSubmitHandler = $.noop;
var showDetailsDialog = function(dialogType, client) {
$("#name").val(client.Name);
$("#age").val(client.Age);
$("#address").val(client.Address);
$("#country").val(client.Country);
$("#married").prop("checked", client.Married);
formSubmitHandler = function() {
saveClient(client, dialogType === "Add");
};
$("#detailsDialog").dialog("option", "title", dialogType + " Client")
.dialog("open");
};
var saveClient = function(client, isNew) {
$.extend(client, {
Name: $("#name").val(),
Age: parseInt($("#age").val(), 10),
Address: $("#address").val(),
Country: parseInt($("#country").val(), 10),
Married: $("#married").is(":checked")
});
$("#jsGrid").jsGrid(isNew ? "insertItem" : "updateItem", client);
$("#detailsDialog").dialog("close");
};
});
</script>
</body>
</html>

@ -1,884 +0,0 @@
(function() {
var db = {
loadData: function(filter) {
return $.grep(this.clients, function(client) {
return (!filter.Name || client.Name.indexOf(filter.Name) > -1)
&& (filter.Age === undefined || client.Age === filter.Age)
&& (!filter.Address || client.Address.indexOf(filter.Address) > -1)
&& (!filter.Country || client.Country === filter.Country)
&& (filter.Married === undefined || client.Married === filter.Married);
});
},
insertItem: function(insertingClient) {
this.clients.push(insertingClient);
},
updateItem: function(updatingClient) { },
deleteItem: function(deletingClient) {
var clientIndex = $.inArray(deletingClient, this.clients);
this.clients.splice(clientIndex, 1);
}
};
window.db = db;
db.countries = [
{ Name: "", Id: 0 },
{ Name: "United States", Id: 1 },
{ Name: "Canada", Id: 2 },
{ Name: "United Kingdom", Id: 3 },
{ Name: "France", Id: 4 },
{ Name: "Brazil", Id: 5 },
{ Name: "China", Id: 6 },
{ Name: "Russia", Id: 7 }
];
db.clients = [
{
"Name": "Otto Clay",
"Age": 61,
"Country": 6,
"Address": "Ap #897-1459 Quam Avenue",
"Married": false
},
{
"Name": "Connor Johnston",
"Age": 73,
"Country": 7,
"Address": "Ap #370-4647 Dis Av.",
"Married": false
},
{
"Name": "Lacey Hess",
"Age": 29,
"Country": 7,
"Address": "Ap #365-8835 Integer St.",
"Married": false
},
{
"Name": "Timothy Henson",
"Age": 78,
"Country": 1,
"Address": "911-5143 Luctus Ave",
"Married": false
},
{
"Name": "Ramona Benton",
"Age": 43,
"Country": 5,
"Address": "Ap #614-689 Vehicula Street",
"Married": true
},
{
"Name": "Ezra Tillman",
"Age": 51,
"Country": 1,
"Address": "P.O. Box 738, 7583 Quisque St.",
"Married": true
},
{
"Name": "Dante Carter",
"Age": 59,
"Country": 1,
"Address": "P.O. Box 976, 6316 Lorem, St.",
"Married": false
},
{
"Name": "Christopher Mcclure",
"Age": 58,
"Country": 1,
"Address": "847-4303 Dictum Av.",
"Married": true
},
{
"Name": "Ruby Rocha",
"Age": 62,
"Country": 2,
"Address": "5212 Sagittis Ave",
"Married": false
},
{
"Name": "Imelda Hardin",
"Age": 39,
"Country": 5,
"Address": "719-7009 Auctor Av.",
"Married": false
},
{
"Name": "Jonah Johns",
"Age": 28,
"Country": 5,
"Address": "P.O. Box 939, 9310 A Ave",
"Married": false
},
{
"Name": "Herman Rosa",
"Age": 49,
"Country": 7,
"Address": "718-7162 Molestie Av.",
"Married": true
},
{
"Name": "Arthur Gay",
"Age": 20,
"Country": 7,
"Address": "5497 Neque Street",
"Married": false
},
{
"Name": "Xena Wilkerson",
"Age": 63,
"Country": 1,
"Address": "Ap #303-6974 Proin Street",
"Married": true
},
{
"Name": "Lilah Atkins",
"Age": 33,
"Country": 5,
"Address": "622-8602 Gravida Ave",
"Married": true
},
{
"Name": "Malik Shepard",
"Age": 59,
"Country": 1,
"Address": "967-5176 Tincidunt Av.",
"Married": false
},
{
"Name": "Keely Silva",
"Age": 24,
"Country": 1,
"Address": "P.O. Box 153, 8995 Praesent Ave",
"Married": false
},
{
"Name": "Hunter Pate",
"Age": 73,
"Country": 7,
"Address": "P.O. Box 771, 7599 Ante, Road",
"Married": false
},
{
"Name": "Mikayla Roach",
"Age": 55,
"Country": 5,
"Address": "Ap #438-9886 Donec Rd.",
"Married": true
},
{
"Name": "Upton Joseph",
"Age": 48,
"Country": 4,
"Address": "Ap #896-7592 Habitant St.",
"Married": true
},
{
"Name": "Jeanette Pate",
"Age": 59,
"Country": 2,
"Address": "P.O. Box 177, 7584 Amet, St.",
"Married": false
},
{
"Name": "Kaden Hernandez",
"Age": 79,
"Country": 3,
"Address": "366 Ut St.",
"Married": true
},
{
"Name": "Kenyon Stevens",
"Age": 20,
"Country": 3,
"Address": "P.O. Box 704, 4580 Gravida Rd.",
"Married": false
},
{
"Name": "Jerome Harper",
"Age": 31,
"Country": 5,
"Address": "2464 Porttitor Road",
"Married": false
},
{
"Name": "Jelani Patel",
"Age": 36,
"Country": 2,
"Address": "P.O. Box 541, 5805 Nec Av.",
"Married": true
},
{
"Name": "Keaton Oconnor",
"Age": 21,
"Country": 1,
"Address": "Ap #657-1093 Nec, Street",
"Married": false
},
{
"Name": "Bree Johnston",
"Age": 31,
"Country": 2,
"Address": "372-5942 Vulputate Avenue",
"Married": false
},
{
"Name": "Maisie Hodges",
"Age": 70,
"Country": 7,
"Address": "P.O. Box 445, 3880 Odio, Rd.",
"Married": false
},
{
"Name": "Kuame Calhoun",
"Age": 39,
"Country": 2,
"Address": "P.O. Box 609, 4105 Rutrum St.",
"Married": true
},
{
"Name": "Carlos Cameron",
"Age": 38,
"Country": 5,
"Address": "Ap #215-5386 A, Avenue",
"Married": false
},
{
"Name": "Fulton Parsons",
"Age": 25,
"Country": 7,
"Address": "P.O. Box 523, 3705 Sed Rd.",
"Married": false
},
{
"Name": "Wallace Christian",
"Age": 43,
"Country": 3,
"Address": "416-8816 Mauris Avenue",
"Married": true
},
{
"Name": "Caryn Maldonado",
"Age": 40,
"Country": 1,
"Address": "108-282 Nonummy Ave",
"Married": false
},
{
"Name": "Whilemina Frank",
"Age": 20,
"Country": 7,
"Address": "P.O. Box 681, 3938 Egestas. Av.",
"Married": true
},
{
"Name": "Emery Moon",
"Age": 41,
"Country": 4,
"Address": "Ap #717-8556 Non Road",
"Married": true
},
{
"Name": "Price Watkins",
"Age": 35,
"Country": 4,
"Address": "832-7810 Nunc Rd.",
"Married": false
},
{
"Name": "Lydia Castillo",
"Age": 59,
"Country": 7,
"Address": "5280 Placerat, Ave",
"Married": true
},
{
"Name": "Lawrence Conway",
"Age": 53,
"Country": 1,
"Address": "Ap #452-2808 Imperdiet St.",
"Married": false
},
{
"Name": "Kalia Nicholson",
"Age": 67,
"Country": 5,
"Address": "P.O. Box 871, 3023 Tellus Road",
"Married": true
},
{
"Name": "Brielle Baxter",
"Age": 45,
"Country": 3,
"Address": "Ap #822-9526 Ut, Road",
"Married": true
},
{
"Name": "Valentine Brady",
"Age": 72,
"Country": 7,
"Address": "8014 Enim. Road",
"Married": true
},
{
"Name": "Rebecca Gardner",
"Age": 57,
"Country": 4,
"Address": "8655 Arcu. Road",
"Married": true
},
{
"Name": "Vladimir Tate",
"Age": 26,
"Country": 1,
"Address": "130-1291 Non, Rd.",
"Married": true
},
{
"Name": "Vernon Hays",
"Age": 56,
"Country": 4,
"Address": "964-5552 In Rd.",
"Married": true
},
{
"Name": "Allegra Hull",
"Age": 22,
"Country": 4,
"Address": "245-8891 Donec St.",
"Married": true
},
{
"Name": "Hu Hendrix",
"Age": 65,
"Country": 7,
"Address": "428-5404 Tempus Ave",
"Married": true
},
{
"Name": "Kenyon Battle",
"Age": 32,
"Country": 2,
"Address": "921-6804 Lectus St.",
"Married": false
},
{
"Name": "Gloria Nielsen",
"Age": 24,
"Country": 4,
"Address": "Ap #275-4345 Lorem, Street",
"Married": true
},
{
"Name": "Illiana Kidd",
"Age": 59,
"Country": 2,
"Address": "7618 Lacus. Av.",
"Married": false
},
{
"Name": "Adria Todd",
"Age": 68,
"Country": 6,
"Address": "1889 Tincidunt Road",
"Married": false
},
{
"Name": "Kirsten Mayo",
"Age": 71,
"Country": 1,
"Address": "100-8640 Orci, Avenue",
"Married": false
},
{
"Name": "Willa Hobbs",
"Age": 60,
"Country": 6,
"Address": "P.O. Box 323, 158 Tristique St.",
"Married": false
},
{
"Name": "Alexis Clements",
"Age": 69,
"Country": 5,
"Address": "P.O. Box 176, 5107 Proin Rd.",
"Married": false
},
{
"Name": "Akeem Conrad",
"Age": 60,
"Country": 2,
"Address": "282-495 Sed Ave",
"Married": true
},
{
"Name": "Montana Silva",
"Age": 79,
"Country": 6,
"Address": "P.O. Box 120, 9766 Consectetuer St.",
"Married": false
},
{
"Name": "Kaseem Hensley",
"Age": 77,
"Country": 6,
"Address": "Ap #510-8903 Mauris. Av.",
"Married": true
},
{
"Name": "Christopher Morton",
"Age": 35,
"Country": 5,
"Address": "P.O. Box 234, 3651 Sodales Avenue",
"Married": false
},
{
"Name": "Wade Fernandez",
"Age": 49,
"Country": 6,
"Address": "740-5059 Dolor. Road",
"Married": true
},
{
"Name": "Illiana Kirby",
"Age": 31,
"Country": 2,
"Address": "527-3553 Mi Ave",
"Married": false
},
{
"Name": "Kimberley Hurley",
"Age": 65,
"Country": 5,
"Address": "P.O. Box 637, 9915 Dictum St.",
"Married": false
},
{
"Name": "Arthur Olsen",
"Age": 74,
"Country": 5,
"Address": "887-5080 Eget St.",
"Married": false
},
{
"Name": "Brody Potts",
"Age": 59,
"Country": 2,
"Address": "Ap #577-7690 Sem Road",
"Married": false
},
{
"Name": "Dillon Ford",
"Age": 60,
"Country": 1,
"Address": "Ap #885-9289 A, Av.",
"Married": true
},
{
"Name": "Hannah Juarez",
"Age": 61,
"Country": 2,
"Address": "4744 Sapien, Rd.",
"Married": true
},
{
"Name": "Vincent Shaffer",
"Age": 25,
"Country": 2,
"Address": "9203 Nunc St.",
"Married": true
},
{
"Name": "George Holt",
"Age": 27,
"Country": 6,
"Address": "4162 Cras Rd.",
"Married": false
},
{
"Name": "Tobias Bartlett",
"Age": 74,
"Country": 4,
"Address": "792-6145 Mauris St.",
"Married": true
},
{
"Name": "Xavier Hooper",
"Age": 35,
"Country": 1,
"Address": "879-5026 Interdum. Rd.",
"Married": false
},
{
"Name": "Declan Dorsey",
"Age": 31,
"Country": 2,
"Address": "Ap #926-4171 Aenean Road",
"Married": true
},
{
"Name": "Clementine Tran",
"Age": 43,
"Country": 4,
"Address": "P.O. Box 176, 9865 Eu Rd.",
"Married": true
},
{
"Name": "Pamela Moody",
"Age": 55,
"Country": 6,
"Address": "622-6233 Luctus Rd.",
"Married": true
},
{
"Name": "Julie Leon",
"Age": 43,
"Country": 6,
"Address": "Ap #915-6782 Sem Av.",
"Married": true
},
{
"Name": "Shana Nolan",
"Age": 79,
"Country": 5,
"Address": "P.O. Box 603, 899 Eu St.",
"Married": false
},
{
"Name": "Vaughan Moody",
"Age": 37,
"Country": 5,
"Address": "880 Erat Rd.",
"Married": false
},
{
"Name": "Randall Reeves",
"Age": 44,
"Country": 3,
"Address": "1819 Non Street",
"Married": false
},
{
"Name": "Dominic Raymond",
"Age": 68,
"Country": 1,
"Address": "Ap #689-4874 Nisi Rd.",
"Married": true
},
{
"Name": "Lev Pugh",
"Age": 69,
"Country": 5,
"Address": "Ap #433-6844 Auctor Avenue",
"Married": true
},
{
"Name": "Desiree Hughes",
"Age": 80,
"Country": 4,
"Address": "605-6645 Fermentum Avenue",
"Married": true
},
{
"Name": "Idona Oneill",
"Age": 23,
"Country": 7,
"Address": "751-8148 Aliquam Avenue",
"Married": true
},
{
"Name": "Lani Mayo",
"Age": 76,
"Country": 1,
"Address": "635-2704 Tristique St.",
"Married": true
},
{
"Name": "Cathleen Bonner",
"Age": 40,
"Country": 1,
"Address": "916-2910 Dolor Av.",
"Married": false
},
{
"Name": "Sydney Murray",
"Age": 44,
"Country": 5,
"Address": "835-2330 Fringilla St.",
"Married": false
},
{
"Name": "Brenna Rodriguez",
"Age": 77,
"Country": 6,
"Address": "3687 Imperdiet Av.",
"Married": true
},
{
"Name": "Alfreda Mcdaniel",
"Age": 38,
"Country": 7,
"Address": "745-8221 Aliquet Rd.",
"Married": true
},
{
"Name": "Zachery Atkins",
"Age": 30,
"Country": 1,
"Address": "549-2208 Auctor. Road",
"Married": true
},
{
"Name": "Amelia Rich",
"Age": 56,
"Country": 4,
"Address": "P.O. Box 734, 4717 Nunc Rd.",
"Married": false
},
{
"Name": "Kiayada Witt",
"Age": 62,
"Country": 3,
"Address": "Ap #735-3421 Malesuada Avenue",
"Married": false
},
{
"Name": "Lysandra Pierce",
"Age": 36,
"Country": 1,
"Address": "Ap #146-2835 Curabitur St.",
"Married": true
},
{
"Name": "Cara Rios",
"Age": 58,
"Country": 4,
"Address": "Ap #562-7811 Quam. Ave",
"Married": true
},
{
"Name": "Austin Andrews",
"Age": 55,
"Country": 7,
"Address": "P.O. Box 274, 5505 Sociis Rd.",
"Married": false
},
{
"Name": "Lillian Peterson",
"Age": 39,
"Country": 2,
"Address": "6212 A Avenue",
"Married": false
},
{
"Name": "Adria Beach",
"Age": 29,
"Country": 2,
"Address": "P.O. Box 183, 2717 Nunc Avenue",
"Married": true
},
{
"Name": "Oleg Durham",
"Age": 80,
"Country": 4,
"Address": "931-3208 Nunc Rd.",
"Married": false
},
{
"Name": "Casey Reese",
"Age": 60,
"Country": 4,
"Address": "383-3675 Ultrices, St.",
"Married": false
},
{
"Name": "Kane Burnett",
"Age": 80,
"Country": 1,
"Address": "759-8212 Dolor. Ave",
"Married": false
},
{
"Name": "Stewart Wilson",
"Age": 46,
"Country": 7,
"Address": "718-7845 Sagittis. Av.",
"Married": false
},
{
"Name": "Charity Holcomb",
"Age": 31,
"Country": 6,
"Address": "641-7892 Enim. Ave",
"Married": false
},
{
"Name": "Kyra Cummings",
"Age": 43,
"Country": 4,
"Address": "P.O. Box 702, 6621 Mus. Av.",
"Married": false
},
{
"Name": "Stuart Wallace",
"Age": 25,
"Country": 7,
"Address": "648-4990 Sed Rd.",
"Married": true
},
{
"Name": "Carter Clarke",
"Age": 59,
"Country": 6,
"Address": "Ap #547-2921 A Street",
"Married": false
}
];
db.users = [
{
"ID": "x",
"Account": "A758A693-0302-03D1-AE53-EEFE22855556",
"Name": "Carson Kelley",
"RegisterDate": "2002-04-20T22:55:52-07:00"
},
{
"Account": "D89FF524-1233-0CE7-C9E1-56EFF017A321",
"Name": "Prescott Griffin",
"RegisterDate": "2011-02-22T05:59:55-08:00"
},
{
"Account": "06FAAD9A-5114-08F6-D60C-961B2528B4F0",
"Name": "Amir Saunders",
"RegisterDate": "2014-08-13T09:17:49-07:00"
},
{
"Account": "EED7653D-7DD9-A722-64A8-36A55ECDBE77",
"Name": "Derek Thornton",
"RegisterDate": "2012-02-27T01:31:07-08:00"
},
{
"Account": "2A2E6D40-FEBD-C643-A751-9AB4CAF1E2F6",
"Name": "Fletcher Romero",
"RegisterDate": "2010-06-25T15:49:54-07:00"
},
{
"Account": "3978F8FA-DFF0-DA0E-0A5D-EB9D281A3286",
"Name": "Thaddeus Stein",
"RegisterDate": "2013-11-10T07:29:41-08:00"
},
{
"Account": "658DBF5A-176E-569A-9273-74FB5F69FA42",
"Name": "Nash Knapp",
"RegisterDate": "2005-06-24T09:11:19-07:00"
},
{
"Account": "76D2EE4B-7A73-1212-F6F2-957EF8C1F907",
"Name": "Quamar Vega",
"RegisterDate": "2011-04-13T20:06:29-07:00"
},
{
"Account": "00E46809-A595-CE82-C5B4-D1CAEB7E3E58",
"Name": "Philip Galloway",
"RegisterDate": "2008-08-21T18:59:38-07:00"
},
{
"Account": "C196781C-DDCC-AF83-DDC2-CA3E851A47A0",
"Name": "Mason French",
"RegisterDate": "2000-11-15T00:38:37-08:00"
},
{
"Account": "5911F201-818A-B393-5888-13157CE0D63F",
"Name": "Ross Cortez",
"RegisterDate": "2010-05-27T17:35:32-07:00"
},
{
"Account": "B8BB78F9-E1A1-A956-086F-E12B6FE168B6",
"Name": "Logan King",
"RegisterDate": "2003-07-08T16:58:06-07:00"
},
{
"Account": "06F636C3-9599-1A2D-5FD5-86B24ADDE626",
"Name": "Cedric Leblanc",
"RegisterDate": "2011-06-30T14:30:10-07:00"
},
{
"Account": "FE880CDD-F6E7-75CB-743C-64C6DE192412",
"Name": "Simon Sullivan",
"RegisterDate": "2013-06-11T16:35:07-07:00"
},
{
"Account": "BBEDD673-E2C1-4872-A5D3-C4EBD4BE0A12",
"Name": "Jamal West",
"RegisterDate": "2001-03-16T20:18:29-08:00"
},
{
"Account": "19BC22FA-C52E-0CC6-9552-10365C755FAC",
"Name": "Hector Morales",
"RegisterDate": "2012-11-01T01:56:34-07:00"
},
{
"Account": "A8292214-2C13-5989-3419-6B83DD637D6C",
"Name": "Herrod Hart",
"RegisterDate": "2008-03-13T19:21:04-07:00"
},
{
"Account": "0285564B-F447-0E7F-EAA1-7FB8F9C453C8",
"Name": "Clark Maxwell",
"RegisterDate": "2004-08-05T08:22:24-07:00"
},
{
"Account": "EA78F076-4F6E-4228-268C-1F51272498AE",
"Name": "Reuben Walter",
"RegisterDate": "2011-01-23T01:55:59-08:00"
},
{
"Account": "6A88C194-EA21-426F-4FE2-F2AE33F51793",
"Name": "Ira Ingram",
"RegisterDate": "2008-08-15T05:57:46-07:00"
},
{
"Account": "4275E873-439C-AD26-56B3-8715E336508E",
"Name": "Damian Morrow",
"RegisterDate": "2015-09-13T01:50:55-07:00"
},
{
"Account": "A0D733C4-9070-B8D6-4387-D44F0BA515BE",
"Name": "Macon Farrell",
"RegisterDate": "2011-03-14T05:41:40-07:00"
},
{
"Account": "B3683DE8-C2FA-7CA0-A8A6-8FA7E954F90A",
"Name": "Joel Galloway",
"RegisterDate": "2003-02-03T04:19:01-08:00"
},
{
"Account": "01D95A8E-91BC-2050-F5D0-4437AAFFD11F",
"Name": "Rigel Horton",
"RegisterDate": "2015-06-20T11:53:11-07:00"
},
{
"Account": "F0D12CC0-31AC-A82E-FD73-EEEFDBD21A36",
"Name": "Sylvester Gaines",
"RegisterDate": "2004-03-12T09:57:13-08:00"
},
{
"Account": "874FCC49-9A61-71BC-2F4E-2CE88348AD7B",
"Name": "Abbot Mckay",
"RegisterDate": "2008-12-26T20:42:57-08:00"
},
{
"Account": "B8DA1912-20A0-FB6E-0031-5F88FD63EF90",
"Name": "Solomon Green",
"RegisterDate": "2013-09-04T01:44:47-07:00"
}
];
}());

@ -1,82 +0,0 @@
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html {
height: 100%;
}
body {
height: 100%;
padding: 10px;
color: #262626;
font-family: 'Helvetica Neue Light', 'Open Sans', Helvetica;
font-size: 14px;
font-weight: 300;
}
h1 {
margin: 0 0 8px 0;
font-size: 24px;
font-family: 'Helvetica Neue Light', 'Open Sans', Helvetica;
font-weight: 300;
}
h2 {
margin: 16px 0 8px 0;
font-size: 18px;
font-family: 'Helvetica Neue Light', 'Open Sans', Helvetica;
font-weight: 300;
}
ul {
list-style: none;
}
a {
color: #2ba6cb;
text-decoration: none;
}
a:hover {
text-decoration: underline;
color: #258faf;
}
input, button, select {
font-family: 'Helvetica Neue Light', 'Open Sans', Helvetica;
font-weight: 300;
font-size: 14px;
padding: 2px;
}
.navigation {
width: 200px;
position: absolute;
top: 0;
bottom: 0;
left: 0;
padding: 10px;
border-right: 1px solid #e9e9e9;
}
.navigation li {
margin: 10px 0;
}
.demo-frame {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 200px;
}
iframe[name='demo'] {
display: block;
width: 100%;
height: 100%;
border: none;
}

@ -1,72 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>jsGrid - External Pager Scenario</title>
<link rel="stylesheet" type="text/css" href="demos.css" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,600,400' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="../css/jsgrid.css" />
<link rel="stylesheet" type="text/css" href="../css/theme.css" />
<script src="../external/jquery/jquery-1.8.3.js"></script>
<script src="db.js"></script>
<script src="../src/jsgrid.core.js"></script>
<script src="../src/jsgrid.load-indicator.js"></script>
<script src="../src/jsgrid.load-strategies.js"></script>
<script src="../src/jsgrid.sort-strategies.js"></script>
<script src="../src/jsgrid.field.js"></script>
<script src="../src/fields/jsgrid.field.text.js"></script>
<script src="../src/fields/jsgrid.field.number.js"></script>
<script src="../src/fields/jsgrid.field.select.js"></script>
<script src="../src/fields/jsgrid.field.checkbox.js"></script>
<style>
.external-pager {
margin: 10px 0;
}
.external-pager .jsgrid-pager-current-page {
background: #c4e2ff;
color: #fff;
}
</style>
</head>
<body>
<h1>External Customized Pager</h1>
<div id="externalPager" class="external-pager"></div>
<div id="jsGrid"></div>
<script>
$(function() {
$("#jsGrid").jsGrid({
height: "70%",
width: "100%",
paging: true,
pageSize: 15,
pageButtonCount: 5,
pagerContainer: "#externalPager",
pagerFormat: "current page: {pageIndex} &nbsp;&nbsp; {first} {prev} {pages} {next} {last} &nbsp;&nbsp; total pages: {pageCount} total items: {itemCount}",
pagePrevText: "<",
pageNextText: ">",
pageFirstText: "<<",
pageLastText: ">>",
pageNavigatorNextText: "&#8230;",
pageNavigatorPrevText: "&#8230;",
fields: [
{ name: "Name", type: "text", width: 150 },
{ name: "Age", type: "number", width: 50 },
{ name: "Address", type: "text", width: 200 },
{ name: "Country", type: "select", items: db.countries, valueField: "Id", textField: "Name" },
{ name: "Married", type: "checkbox", title: "Is Married" }
],
data: db.clients
});
});
</script>
</body>
</html>

@ -1,31 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>jsGrid - Simple jQuery DataGrid - Demos</title>
<link rel="stylesheet" type="text/css" href="demos.css" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,600,400' rel='stylesheet' type='text/css'>
</head>
<body>
<div class="navigation">
<h1>jsGrid Demos</h1>
<ul>
<li><a href="basic.html" target="demo">Basic Scenario</a></li>
<li><a href="static-data.html" target="demo">Static Data</a></li>
<li><a href="odata-service.html" target="demo">OData Service</a></li>
<li><a href="data-manipulation.html" target="demo">Data Manipulation</a></li>
<li><a href="validation.html" target="demo">Validation</a></li>
<li><a href="sorting.html" target="demo">Sorting</a></li>
<li><a href="loading-by-page.html" target="demo">Loading by Page</a></li>
<li><a href="custom-view.html" target="demo">Custom View</a></li>
<li><a href="custom-row-renderer.html" target="demo">Custom Row Renderer</a></li>
<li><a href="external-pager.html" target="demo">External Pager</a></li>
<li><a href="custom-grid-field.html" target="demo">Custom Grid Field</a></li>
<li><a href="localization.html" target="demo">Localization</a></li>
</ul>
</div>
<div class="demo-frame">
<iframe name="demo" src="basic.html"></iframe>
</div>
</body>
</html>

@ -1,90 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>jsGrid - Loading Data by Page Scenario</title>
<link rel="stylesheet" type="text/css" href="demos.css" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,600,400' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="../css/jsgrid.css" />
<link rel="stylesheet" type="text/css" href="../css/theme.css" />
<script src="../external/jquery/jquery-1.8.3.js"></script>
<script src="db.js"></script>
<script src="../src/jsgrid.core.js"></script>
<script src="../src/jsgrid.load-indicator.js"></script>
<script src="../src/jsgrid.load-strategies.js"></script>
<script src="../src/jsgrid.sort-strategies.js"></script>
<script src="../src/jsgrid.field.js"></script>
<script src="../src/fields/jsgrid.field.text.js"></script>
<script src="../src/fields/jsgrid.field.number.js"></script>
<script src="../src/fields/jsgrid.field.select.js"></script>
<script src="../src/fields/jsgrid.field.checkbox.js"></script>
<style>
.pager-panel {
padding: 10px;
margin: 10px 0;
background: #fcfcfc;
border: 1px solid #e9e9e9;
display: inline-block;
}
</style>
</head>
<body>
<h1>Loading Data by Page</h1>
<div class="pager-panel">
<label>Page:
<select id="pager">
<option>1</option>
<option selected>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
</select>
</label>
</div>
<div id="jsGrid"></div>
<script>
$(function() {
$("#jsGrid").jsGrid({
height: "70%",
width: "100%",
autoload: true,
paging: true,
pageLoading: true,
pageSize: 15,
pageIndex: 2,
controller: {
loadData: function(filter) {
var startIndex = (filter.pageIndex - 1) * filter.pageSize;
return {
data: db.clients.slice(startIndex, startIndex + filter.pageSize),
itemsCount: db.clients.length
};
}
},
fields: [
{ name: "Name", type: "text", width: 150 },
{ name: "Age", type: "number", width: 50 },
{ name: "Address", type: "text", width: 200 },
{ name: "Country", type: "select", items: db.countries, valueField: "Id", textField: "Name" },
{ name: "Married", type: "checkbox", title: "Is Married" }
]
});
$("#pager").on("change", function() {
var page = parseInt($(this).val(), 10);
$("#jsGrid").jsGrid("openPage", page);
});
});
</script>
</body>
</html>

@ -1,62 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>jsGrid - Localization (FR)</title>
<link rel="stylesheet" type="text/css" href="demos.css" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,600,400' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="../css/jsgrid.css" />
<link rel="stylesheet" type="text/css" href="../css/theme.css" />
<script src="../external/jquery/jquery-1.8.3.js"></script>
<script src="db.js"></script>
<script src="../src/jsgrid.core.js"></script>
<script src="../src/jsgrid.load-indicator.js"></script>
<script src="../src/jsgrid.load-strategies.js"></script>
<script src="../src/jsgrid.sort-strategies.js"></script>
<script src="../src/jsgrid.validation.js"></script>
<script src="../src/jsgrid.field.js"></script>
<script src="../src/fields/jsgrid.field.text.js"></script>
<script src="../src/fields/jsgrid.field.number.js"></script>
<script src="../src/fields/jsgrid.field.select.js"></script>
<script src="../src/fields/jsgrid.field.checkbox.js"></script>
<script src="../src/fields/jsgrid.field.control.js"></script>
<script src="../src/i18n/fr.js"></script>
</head>
<body>
<h1>Localization (FR)</h1>
<div id="jsGrid"></div>
<script>
$(function() {
jsGrid.locale("fr");
$("#jsGrid").jsGrid({
height: "70%",
width: "100%",
filtering: true,
editing: true,
inserting: true,
sorting: true,
paging: true,
autoload: true,
pageSize: 15,
pageButtonCount: 5,
controller: db,
fields: [
{ name: "Name", title: "Nom", type: "text", width: 150, validate: "required" },
{ name: "Age", title: "Âge", type: "number", width: 50, validate: { validator: "range", param: [18,80] } },
{ name: "Address", title: "Adresse", type: "text", width: 200, validate: { validator: "rangeLength", param: [10, 250] } },
{ name: "Country", title: "Pays", type: "select", items: db.countries, valueField: "Id", textField: "Name" },
{ name: "Married", title: "Marié", type: "checkbox", sorting: false },
{ type: "control" }
]
});
});
</script>
</body>
</html>

@ -1,74 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>jsGrid - OData Service Scenario</title>
<link rel="stylesheet" type="text/css" href="demos.css" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,600,400' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="../css/jsgrid.css" />
<link rel="stylesheet" type="text/css" href="../css/theme.css" />
<script src="../external/jquery/jquery-1.8.3.js"></script>
<script src="../src/jsgrid.core.js"></script>
<script src="../src/jsgrid.load-indicator.js"></script>
<script src="../src/jsgrid.load-strategies.js"></script>
<script src="../src/jsgrid.sort-strategies.js"></script>
<script src="../src/jsgrid.field.js"></script>
<script src="../src/fields/jsgrid.field.text.js"></script>
<script src="../src/fields/jsgrid.field.textarea.js"></script>
<script src="../src/fields/jsgrid.field.number.js"></script>
<style>
.rating {
color: #F8CA03;
}
</style>
</head>
<body>
<h1>OData Service</h1>
<div id="jsGrid"></div>
<script>
$(function() {
$("#jsGrid").jsGrid({
height: "auto",
width: "auto",
sorting: true,
paging: false,
autoload: true,
controller: {
loadData: function() {
var d = $.Deferred();
$.ajax({
url: "http://services.odata.org/V3/(S(3mnweai3qldmghnzfshavfok))/OData/OData.svc/Products",
dataType: "json"
}).done(function(response) {
d.resolve(response.value);
});
return d.promise();
}
},
fields: [
{ name: "Name", type: "text", width: 100 },
{ name: "Description", type: "textarea", width: 200 },
{ name: "Rating", type: "number", width: 150, align: "center",
itemTemplate: function(value) {
return $("<div>").addClass("rating").append(Array(value + 1).join("&#9733;"));
}
},
{ name: "Price", type: "number", width: 100,
itemTemplate: function(value) {
return value.toFixed(2) + "$"; }
}
]
});
});
</script>
</body>
</html>

@ -1,83 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>jsGrid - Rows Reordering Scenario</title>
<link rel="stylesheet" type="text/css" href="demos.css" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,600,400' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="../css/jsgrid.css" />
<link rel="stylesheet" type="text/css" href="../css/theme.css" />
<link rel="stylesheet" href="http://code.jquery.com/ui/1.11.2/themes/cupertino/jquery-ui.css">
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script src="http://code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
<script src="db.js"></script>
<script src="../src/jsgrid.core.js"></script>
<script src="../src/jsgrid.load-indicator.js"></script>
<script src="../src/jsgrid.load-strategies.js"></script>
<script src="../src/jsgrid.sort-strategies.js"></script>
<script src="../src/jsgrid.field.js"></script>
<script src="../src/fields/jsgrid.field.text.js"></script>
<script src="../src/fields/jsgrid.field.number.js"></script>
<script src="../src/fields/jsgrid.field.select.js"></script>
<script src="../src/fields/jsgrid.field.checkbox.js"></script>
<script src="../src/fields/jsgrid.field.control.js"></script>
</head>
<body>
<h1>Rows Reordering Scenario</h1>
<div id="jsGrid"></div>
<script>
$(function() {
$("#jsGrid").jsGrid({
height: "70%",
width: "100%",
autoload: true,
rowClass: function(item, itemIndex) {
return "client-" + itemIndex;
},
controller: {
loadData: function() {
return db.clients.slice(0, 15);
}
},
fields: [
{ name: "Name", type: "text", width: 150 },
{ name: "Age", type: "number", width: 50 },
{ name: "Address", type: "text", width: 200 },
{ name: "Country", type: "select", items: db.countries, valueField: "Id", textField: "Name" },
{ name: "Married", type: "checkbox", title: "Is Married", sorting: false }
],
onRefreshed: function() {
var $gridData = $("#jsGrid .jsgrid-grid-body tbody");
$gridData.sortable({
update: function(e, ui) {
// array of indexes
var clientIndexRegExp = /\s*client-(\d+)\s*/;
var indexes = $.map($gridData.sortable("toArray", { attribute: "class" }), function(classes) {
return clientIndexRegExp.exec(classes)[1];
});
alert("Reordered indexes: " + indexes.join(", "));
// arrays of items
var items = $.map($gridData.find("tr"), function(row) {
return $(row).data("JSGridItem");
});
console && console.log("Reordered items", items);
}
});
}
});
});
</script>
</body>
</html>

@ -1,78 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>jsGrid - Sorting Scenario</title>
<link rel="stylesheet" type="text/css" href="demos.css" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,600,400' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="../css/jsgrid.css" />
<link rel="stylesheet" type="text/css" href="../css/theme.css" />
<script src="../external/jquery/jquery-1.8.3.js"></script>
<script src="db.js"></script>
<script src="../src/jsgrid.core.js"></script>
<script src="../src/jsgrid.load-indicator.js"></script>
<script src="../src/jsgrid.load-strategies.js"></script>
<script src="../src/jsgrid.sort-strategies.js"></script>
<script src="../src/jsgrid.field.js"></script>
<script src="../src/fields/jsgrid.field.text.js"></script>
<script src="../src/fields/jsgrid.field.number.js"></script>
<script src="../src/fields/jsgrid.field.select.js"></script>
<script src="../src/fields/jsgrid.field.checkbox.js"></script>
<style>
.sort-panel {
padding: 10px;
margin: 10px 0;
background: #fcfcfc;
border: 1px solid #e9e9e9;
display: inline-block;
}
</style>
</head>
<body>
<h1>Sorting</h1>
<div class="sort-panel">
<label>Sorting Field:
<select id="sortingField">
<option>Name</option>
<option>Age</option>
<option>Address</option>
<option>Country</option>
<option>Married</option>
</select>
<button type="button" id="sort">Sort</button>
</label>
</div>
<div id="jsGrid"></div>
<script>
$(function() {
$("#jsGrid").jsGrid({
height: "70%",
width: "100%",
autoload: true,
selecting: false,
controller: db,
fields: [
{ name: "Name", type: "text", width: 150 },
{ name: "Age", type: "number", width: 50 },
{ name: "Address", type: "text", width: 200 },
{ name: "Country", type: "select", items: db.countries, valueField: "Id", textField: "Name" },
{ name: "Married", type: "checkbox", title: "Is Married" }
]
});
$("#sort").click(function() {
var field = $("#sortingField").val();
$("#jsGrid").jsGrid("sort", field);
});
});
</script>
</body>
</html>

@ -1,50 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>jsGrid - Static Data Scenario</title>
<link rel="stylesheet" type="text/css" href="demos.css" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,600,400' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="../css/jsgrid.css" />
<link rel="stylesheet" type="text/css" href="../css/theme.css" />
<script src="../external/jquery/jquery-1.8.3.js"></script>
<script src="db.js"></script>
<script src="../src/jsgrid.core.js"></script>
<script src="../src/jsgrid.load-indicator.js"></script>
<script src="../src/jsgrid.load-strategies.js"></script>
<script src="../src/jsgrid.sort-strategies.js"></script>
<script src="../src/jsgrid.field.js"></script>
<script src="../src/fields/jsgrid.field.text.js"></script>
<script src="../src/fields/jsgrid.field.number.js"></script>
<script src="../src/fields/jsgrid.field.select.js"></script>
<script src="../src/fields/jsgrid.field.checkbox.js"></script>
</head>
<body>
<h1>Static Data</h1>
<div id="jsGrid"></div>
<script>
$(function() {
$("#jsGrid").jsGrid({
height: "70%",
width: "100%",
sorting: true,
paging: true,
fields: [
{ name: "Name", type: "text", width: 150 },
{ name: "Age", type: "number", width: 50 },
{ name: "Address", type: "text", width: 200 },
{ name: "Country", type: "select", items: db.countries, valueField: "Id", textField: "Name" },
{ name: "Married", type: "checkbox", title: "Is Married" }
],
data: db.clients
});
});
</script>
</body>
</html>

@ -1,61 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>jsGrid - Validation</title>
<link rel="stylesheet" type="text/css" href="demos.css" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,600,400' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="../css/jsgrid.css" />
<link rel="stylesheet" type="text/css" href="../css/theme.css" />
<script src="../external/jquery/jquery-1.8.3.js"></script>
<script src="db.js"></script>
<script src="../src/jsgrid.core.js"></script>
<script src="../src/jsgrid.load-indicator.js"></script>
<script src="../src/jsgrid.load-strategies.js"></script>
<script src="../src/jsgrid.sort-strategies.js"></script>
<script src="../src/jsgrid.validation.js"></script>
<script src="../src/jsgrid.field.js"></script>
<script src="../src/fields/jsgrid.field.text.js"></script>
<script src="../src/fields/jsgrid.field.number.js"></script>
<script src="../src/fields/jsgrid.field.select.js"></script>
<script src="../src/fields/jsgrid.field.checkbox.js"></script>
<script src="../src/fields/jsgrid.field.control.js"></script>
</head>
<body>
<h1>Validation</h1>
<div id="jsGrid"></div>
<script>
$(function() {
$("#jsGrid").jsGrid({
height: "70%",
width: "100%",
filtering: true,
editing: true,
inserting: true,
sorting: true,
paging: true,
autoload: true,
pageSize: 15,
pageButtonCount: 5,
deleteConfirm: "Do you really want to delete the client?",
controller: db,
fields: [
{ name: "Name", type: "text", width: 150, validate: "required" },
{ name: "Age", type: "number", width: 50, validate: { validator: "range", param: [18,80] } },
{ name: "Address", type: "text", width: 200, validate: { validator: "rangeLength", param: [10, 250] } },
{ name: "Country", type: "select", items: db.countries, valueField: "Id", textField: "Name",
validate: { message: "Country should be specified", validator: function(value) { return value > 0; } } },
{ name: "Married", type: "checkbox", title: "Is Married", sorting: false },
{ type: "control" }
]
});
});
</script>
</body>
</html>

@ -1,235 +0,0 @@
/**
* QUnit v1.10.0 - A JavaScript Unit Testing Framework
*
* http://qunitjs.com
*
* Copyright 2012 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*/
/** Font Family and Sizes */
#qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult {
font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif;
}
#qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; }
#qunit-tests { font-size: smaller; }
/** Resets */
#qunit-tests, #qunit-tests ol, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult, #qunit-modulefilter {
margin: 0;
padding: 0;
}
/** Header */
#qunit-header {
padding: 0.5em 0 0.5em 1em;
color: #8699a4;
background-color: #0d3349;
font-size: 1.5em;
line-height: 1em;
font-weight: normal;
border-radius: 5px 5px 0 0;
-moz-border-radius: 5px 5px 0 0;
-webkit-border-top-right-radius: 5px;
-webkit-border-top-left-radius: 5px;
}
#qunit-header a {
text-decoration: none;
color: #c2ccd1;
}
#qunit-header a:hover,
#qunit-header a:focus {
color: #fff;
}
#qunit-testrunner-toolbar label {
display: inline-block;
padding: 0 .5em 0 .1em;
}
#qunit-banner {
height: 5px;
}
#qunit-testrunner-toolbar {
padding: 0.5em 0 0.5em 2em;
color: #5E740B;
background-color: #eee;
overflow: hidden;
}
#qunit-userAgent {
padding: 0.5em 0 0.5em 2.5em;
background-color: #2b81af;
color: #fff;
text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px;
}
#qunit-modulefilter-container {
float: right;
}
/** Tests: Pass/Fail */
#qunit-tests {
list-style-position: inside;
}
#qunit-tests li {
padding: 0.4em 0.5em 0.4em 2.5em;
border-bottom: 1px solid #fff;
list-style-position: inside;
}
#qunit-tests.hidepass li.pass, #qunit-tests.hidepass li.running {
display: none;
}
#qunit-tests li strong {
cursor: pointer;
}
#qunit-tests li a {
padding: 0.5em;
color: #c2ccd1;
text-decoration: none;
}
#qunit-tests li a:hover,
#qunit-tests li a:focus {
color: #000;
}
#qunit-tests ol {
margin-top: 0.5em;
padding: 0.5em;
background-color: #fff;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
}
#qunit-tests table {
border-collapse: collapse;
margin-top: .2em;
}
#qunit-tests th {
text-align: right;
vertical-align: top;
padding: 0 .5em 0 0;
}
#qunit-tests td {
vertical-align: top;
}
#qunit-tests pre {
margin: 0;
white-space: pre-wrap;
word-wrap: break-word;
}
#qunit-tests del {
background-color: #e0f2be;
color: #374e0c;
text-decoration: none;
}
#qunit-tests ins {
background-color: #ffcaca;
color: #500;
text-decoration: none;
}
/*** Test Counts */
#qunit-tests b.counts { color: black; }
#qunit-tests b.passed { color: #5E740B; }
#qunit-tests b.failed { color: #710909; }
#qunit-tests li li {
padding: 5px;
background-color: #fff;
border-bottom: none;
list-style-position: inside;
}
/*** Passing Styles */
#qunit-tests li li.pass {
color: #3c510c;
background-color: #fff;
border-left: 10px solid #C6E746;
}
#qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; }
#qunit-tests .pass .test-name { color: #366097; }
#qunit-tests .pass .test-actual,
#qunit-tests .pass .test-expected { color: #999999; }
#qunit-banner.qunit-pass { background-color: #C6E746; }
/*** Failing Styles */
#qunit-tests li li.fail {
color: #710909;
background-color: #fff;
border-left: 10px solid #EE5757;
white-space: pre;
}
#qunit-tests > li:last-child {
border-radius: 0 0 5px 5px;
-moz-border-radius: 0 0 5px 5px;
-webkit-border-bottom-right-radius: 5px;
-webkit-border-bottom-left-radius: 5px;
}
#qunit-tests .fail { color: #000000; background-color: #EE5757; }
#qunit-tests .fail .test-name,
#qunit-tests .fail .module-name { color: #000000; }
#qunit-tests .fail .test-actual { color: #EE5757; }
#qunit-tests .fail .test-expected { color: green; }
#qunit-banner.qunit-fail { background-color: #EE5757; }
/** Result */
#qunit-testresult {
padding: 0.5em 0.5em 0.5em 2.5em;
color: #2b81af;
background-color: #D2E0E6;
border-bottom: 1px solid white;
}
#qunit-testresult .module-name {
font-weight: bold;
}
/** Fixture */
#qunit-fixture {
position: absolute;
top: -10000px;
left: -10000px;
width: 1000px;
height: 1000px;
}

File diff suppressed because it is too large Load Diff

@ -1,38 +0,0 @@
{
"name": "jsgrid",
"version": "1.5.3",
"description": "Lightweight data grid jQuery plugin. It supports basic grid operations like inserting, filtering, editing, deleting, paging, sorting, and validation. jsGrid is tunable and allows to customize appearance and components.",
"keywords": [
"grid",
"jquery",
"plugin"
],
"homepage": "http://js-grid.com",
"author": "Artem Tabalin",
"license": {
"type": "MIT",
"url": "https://github.com/tabalinas/jsgrid/blob/master/LICENSE"
},
"main": "dist/jsgrid.js",
"directories": {
"test": "tests"
},
"repository": {
"type": "git",
"url": "https://github.com/tabalinas/jsgrid"
},
"bugs": {
"url": "https://github.com/tabalinas/jsgrid/issues"
},
"dependencies": {},
"devDependencies": {
"grunt": "^0.4.5",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-copy": "^0.7.0",
"grunt-contrib-cssmin": "^0.10.0",
"grunt-contrib-qunit": "^0.5.2",
"grunt-contrib-uglify": "^0.4.0",
"grunt-image-embed": "^0.3.1",
"grunt-string-replace": "^1.2.1"
}
}

@ -1,97 +0,0 @@
(function(jsGrid, $, undefined) {
var Field = jsGrid.Field;
function CheckboxField(config) {
Field.call(this, config);
}
CheckboxField.prototype = new Field({
sorter: "number",
align: "center",
autosearch: true,
itemTemplate: function(value) {
return this._createCheckbox().prop({
checked: value,
disabled: true
});
},
filterTemplate: function() {
if(!this.filtering)
return "";
var grid = this._grid,
$result = this.filterControl = this._createCheckbox();
$result.prop({
readOnly: true,
indeterminate: true
});
$result.on("click", function() {
var $cb = $(this);
if($cb.prop("readOnly")) {
$cb.prop({
checked: false,
readOnly: false
});
}
else if(!$cb.prop("checked")) {
$cb.prop({
readOnly: true,
indeterminate: true
});
}
});
if(this.autosearch) {
$result.on("click", function() {
grid.search();
});
}
return $result;
},
insertTemplate: function() {
if(!this.inserting)
return "";
return this.insertControl = this._createCheckbox();
},
editTemplate: function(value) {
if(!this.editing)
return this.itemTemplate.apply(this, arguments);
var $result = this.editControl = this._createCheckbox();
$result.prop("checked", value);
return $result;
},
filterValue: function() {
return this.filterControl.get(0).indeterminate
? undefined
: this.filterControl.is(":checked");
},
insertValue: function() {
return this.insertControl.is(":checked");
},
editValue: function() {
return this.editControl.is(":checked");
},
_createCheckbox: function() {
return $("<input>").attr("type", "checkbox");
}
});
jsGrid.fields.checkbox = jsGrid.CheckboxField = CheckboxField;
}(jsGrid, jQuery));

@ -1,223 +0,0 @@
(function(jsGrid, $, undefined) {
var Field = jsGrid.Field;
function ControlField(config) {
Field.call(this, config);
this._configInitialized = false;
}
ControlField.prototype = new Field({
css: "jsgrid-control-field",
align: "center",
width: 50,
filtering: false,
inserting: false,
editing: false,
sorting: false,
buttonClass: "jsgrid-button",
modeButtonClass: "jsgrid-mode-button",
modeOnButtonClass: "jsgrid-mode-on-button",
searchModeButtonClass: "jsgrid-search-mode-button",
insertModeButtonClass: "jsgrid-insert-mode-button",
editButtonClass: "jsgrid-edit-button",
deleteButtonClass: "jsgrid-delete-button",
searchButtonClass: "jsgrid-search-button",
clearFilterButtonClass: "jsgrid-clear-filter-button",
insertButtonClass: "jsgrid-insert-button",
updateButtonClass: "jsgrid-update-button",
cancelEditButtonClass: "jsgrid-cancel-edit-button",
searchModeButtonTooltip: "Switch to searching",
insertModeButtonTooltip: "Switch to inserting",
editButtonTooltip: "Edit",
deleteButtonTooltip: "Delete",
searchButtonTooltip: "Search",
clearFilterButtonTooltip: "Clear filter",
insertButtonTooltip: "Insert",
updateButtonTooltip: "Update",
cancelEditButtonTooltip: "Cancel edit",
editButton: true,
deleteButton: true,
clearFilterButton: true,
modeSwitchButton: true,
_initConfig: function() {
this._hasFiltering = this._grid.filtering;
this._hasInserting = this._grid.inserting;
if(this._hasInserting && this.modeSwitchButton) {
this._grid.inserting = false;
}
this._configInitialized = true;
},
headerTemplate: function() {
if(!this._configInitialized) {
this._initConfig();
}
var hasFiltering = this._hasFiltering;
var hasInserting = this._hasInserting;
if(!this.modeSwitchButton || (!hasFiltering && !hasInserting))
return "";
if(hasFiltering && !hasInserting)
return this._createFilterSwitchButton();
if(hasInserting && !hasFiltering)
return this._createInsertSwitchButton();
return this._createModeSwitchButton();
},
itemTemplate: function(value, item) {
var $result = $([]);
if(this.editButton) {
$result = $result.add(this._createEditButton(item));
}
if(this.deleteButton) {
$result = $result.add(this._createDeleteButton(item));
}
return $result;
},
filterTemplate: function() {
var $result = this._createSearchButton();
return this.clearFilterButton ? $result.add(this._createClearFilterButton()) : $result;
},
insertTemplate: function() {
return this._createInsertButton();
},
editTemplate: function() {
return this._createUpdateButton().add(this._createCancelEditButton());
},
_createFilterSwitchButton: function() {
return this._createOnOffSwitchButton("filtering", this.searchModeButtonClass, true);
},
_createInsertSwitchButton: function() {
return this._createOnOffSwitchButton("inserting", this.insertModeButtonClass, false);
},
_createOnOffSwitchButton: function(option, cssClass, isOnInitially) {
var isOn = isOnInitially;
var updateButtonState = $.proxy(function() {
$button.toggleClass(this.modeOnButtonClass, isOn);
}, this);
var $button = this._createGridButton(this.modeButtonClass + " " + cssClass, "", function(grid) {
isOn = !isOn;
grid.option(option, isOn);
updateButtonState();
});
updateButtonState();
return $button;
},
_createModeSwitchButton: function() {
var isInserting = false;
var updateButtonState = $.proxy(function() {
$button.attr("title", isInserting ? this.searchModeButtonTooltip : this.insertModeButtonTooltip)
.toggleClass(this.insertModeButtonClass, !isInserting)
.toggleClass(this.searchModeButtonClass, isInserting);
}, this);
var $button = this._createGridButton(this.modeButtonClass, "", function(grid) {
isInserting = !isInserting;
grid.option("inserting", isInserting);
grid.option("filtering", !isInserting);
updateButtonState();
});
updateButtonState();
return $button;
},
_createEditButton: function(item) {
return this._createGridButton(this.editButtonClass, this.editButtonTooltip, function(grid, e) {
grid.editItem(item);
e.stopPropagation();
});
},
_createDeleteButton: function(item) {
return this._createGridButton(this.deleteButtonClass, this.deleteButtonTooltip, function(grid, e) {
grid.deleteItem(item);
e.stopPropagation();
});
},
_createSearchButton: function() {
return this._createGridButton(this.searchButtonClass, this.searchButtonTooltip, function(grid) {
grid.search();
});
},
_createClearFilterButton: function() {
return this._createGridButton(this.clearFilterButtonClass, this.clearFilterButtonTooltip, function(grid) {
grid.clearFilter();
});
},
_createInsertButton: function() {
return this._createGridButton(this.insertButtonClass, this.insertButtonTooltip, function(grid) {
grid.insertItem().done(function() {
grid.clearInsert();
});
});
},
_createUpdateButton: function() {
return this._createGridButton(this.updateButtonClass, this.updateButtonTooltip, function(grid, e) {
grid.updateItem();
e.stopPropagation();
});
},
_createCancelEditButton: function() {
return this._createGridButton(this.cancelEditButtonClass, this.cancelEditButtonTooltip, function(grid, e) {
grid.cancelEdit();
e.stopPropagation();
});
},
_createGridButton: function(cls, tooltip, clickHandler) {
var grid = this._grid;
return $("<input>").addClass(this.buttonClass)
.addClass(cls)
.attr({
type: "button",
title: tooltip
})
.on("click", function(e) {
clickHandler(grid, e);
});
},
editValue: function() {
return "";
}
});
jsGrid.fields.control = jsGrid.ControlField = ControlField;
}(jsGrid, jQuery));

@ -1,41 +0,0 @@
(function(jsGrid, $, undefined) {
var TextField = jsGrid.TextField;
function NumberField(config) {
TextField.call(this, config);
}
NumberField.prototype = new TextField({
sorter: "number",
align: "right",
readOnly: false,
filterValue: function() {
return this.filterControl.val()
? parseInt(this.filterControl.val() || 0, 10)
: undefined;
},
insertValue: function() {
return this.insertControl.val()
? parseInt(this.insertControl.val() || 0, 10)
: undefined;
},
editValue: function() {
return this.editControl.val()
? parseInt(this.editControl.val() || 0, 10)
: undefined;
},
_createTextBox: function() {
return $("<input>").attr("type", "number")
.prop("readonly", !!this.readOnly);
}
});
jsGrid.fields.number = jsGrid.NumberField = NumberField;
}(jsGrid, jQuery));

@ -1,121 +0,0 @@
(function(jsGrid, $, undefined) {
var NumberField = jsGrid.NumberField;
var numberValueType = "number";
var stringValueType = "string";
function SelectField(config) {
this.items = [];
this.selectedIndex = -1;
this.valueField = "";
this.textField = "";
if(config.valueField && config.items.length) {
var firstItemValue = config.items[0][config.valueField];
this.valueType = (typeof firstItemValue) === numberValueType ? numberValueType : stringValueType;
}
this.sorter = this.valueType;
NumberField.call(this, config);
}
SelectField.prototype = new NumberField({
align: "center",
valueType: numberValueType,
itemTemplate: function(value) {
var items = this.items,
valueField = this.valueField,
textField = this.textField,
resultItem;
if(valueField) {
resultItem = $.grep(items, function(item, index) {
return item[valueField] === value;
})[0] || {};
}
else {
resultItem = items[value];
}
var result = (textField ? resultItem[textField] : resultItem);
return (result === undefined || result === null) ? "" : result;
},
filterTemplate: function() {
if(!this.filtering)
return "";
var grid = this._grid,
$result = this.filterControl = this._createSelect();
if(this.autosearch) {
$result.on("change", function(e) {
grid.search();
});
}
return $result;
},
insertTemplate: function() {
if(!this.inserting)
return "";
return this.insertControl = this._createSelect();
},
editTemplate: function(value) {
if(!this.editing)
return this.itemTemplate.apply(this, arguments);
var $result = this.editControl = this._createSelect();
(value !== undefined) && $result.val(value);
return $result;
},
filterValue: function() {
var val = this.filterControl.val();
return this.valueType === numberValueType ? parseInt(val || 0, 10) : val;
},
insertValue: function() {
var val = this.insertControl.val();
return this.valueType === numberValueType ? parseInt(val || 0, 10) : val;
},
editValue: function() {
var val = this.editControl.val();
return this.valueType === numberValueType ? parseInt(val || 0, 10) : val;
},
_createSelect: function() {
var $result = $("<select>"),
valueField = this.valueField,
textField = this.textField,
selectedIndex = this.selectedIndex;
$.each(this.items, function(index, item) {
var value = valueField ? item[valueField] : index,
text = textField ? item[textField] : item;
var $option = $("<option>")
.attr("value", value)
.text(text)
.appendTo($result);
$option.prop("selected", (selectedIndex === index));
});
$result.prop("disabled", !!this.readOnly);
return $result;
}
});
jsGrid.fields.select = jsGrid.SelectField = SelectField;
}(jsGrid, jQuery));

@ -1,69 +0,0 @@
(function(jsGrid, $, undefined) {
var Field = jsGrid.Field;
function TextField(config) {
Field.call(this, config);
}
TextField.prototype = new Field({
autosearch: true,
readOnly: false,
filterTemplate: function() {
if(!this.filtering)
return "";
var grid = this._grid,
$result = this.filterControl = this._createTextBox();
if(this.autosearch) {
$result.on("keypress", function(e) {
if(e.which === 13) {
grid.search();
e.preventDefault();
}
});
}
return $result;
},
insertTemplate: function() {
if(!this.inserting)
return "";
return this.insertControl = this._createTextBox();
},
editTemplate: function(value) {
if(!this.editing)
return this.itemTemplate.apply(this, arguments);
var $result = this.editControl = this._createTextBox();
$result.val(value);
return $result;
},
filterValue: function() {
return this.filterControl.val();
},
insertValue: function() {
return this.insertControl.val();
},
editValue: function() {
return this.editControl.val();
},
_createTextBox: function() {
return $("<input>").attr("type", "text")
.prop("readonly", !!this.readOnly);
}
});
jsGrid.fields.text = jsGrid.TextField = TextField;
}(jsGrid, jQuery));

@ -1,34 +0,0 @@
(function(jsGrid, $, undefined) {
var TextField = jsGrid.TextField;
function TextAreaField(config) {
TextField.call(this, config);
}
TextAreaField.prototype = new TextField({
insertTemplate: function() {
if(!this.inserting)
return "";
return this.insertControl = this._createTextArea();
},
editTemplate: function(value) {
if(!this.editing)
return this.itemTemplate.apply(this, arguments);
var $result = this.editControl = this._createTextArea();
$result.val(value);
return $result;
},
_createTextArea: function() {
return $("<textarea>").prop("readonly", !!this.readOnly);
}
});
jsGrid.fields.textarea = jsGrid.TextAreaField = TextAreaField;
}(jsGrid, jQuery));

@ -1,46 +0,0 @@
(function(jsGrid) {
jsGrid.locales.de = {
grid: {
noDataContent: "Die Daten konnten nicht gefunden werden",
deleteConfirm: "Möchten Sie die Daten unwiederruflich löschen?",
pagerFormat: "Seiten: {first} {prev} {pages} {next} {last} &nbsp;&nbsp; {pageIndex} von {pageCount}",
pagePrevText: "<",
pageNextText: ">",
pageFirstText: "<<",
pageLastText: ">>",
loadMessage: "Bitte warten...",
invalidMessage: "Ihre Eingabe ist nicht zulässig!"
},
loadIndicator: {
message: "Lädt..."
},
fields: {
control: {
searchModeButtonTooltip: "Suche",
insertModeButtonTooltip: "Eintrag hinzufügen",
editButtonTooltip: "Bearbeiten",
deleteButtonTooltip: "Löschen",
searchButtonTooltip: "Eintrag finden",
clearFilterButtonTooltip: "Filter zurücksetzen",
insertButtonTooltip: "Hinzufügen",
updateButtonTooltip: "Speichern",
cancelEditButtonTooltip: "Abbrechen"
}
},
validators: {
required: { message: "Dies ist ein Pflichtfeld" },
rangeLength: { message: "Die Länge der Eingabe liegt außerhalb des zulässigen Bereichs" },
minLength: { message: "Die Eingabe ist zu kurz" },
maxLength: { message: "Die Eingabe ist zu lang" },
pattern: { message: "Die Eingabe entspricht nicht dem gewünschten Muster" },
range: { message: "Der eingegebene Wert liegt außerhalb des zulässigen Bereichs" },
min: { message: "Der eingegebene Wert ist zu niedrig" },
max: { message: "Der eingegebene Wert ist zu hoch" }
}
};
}(jsGrid, jQuery));

@ -1,46 +0,0 @@
(function(jsGrid) {
jsGrid.locales.es = {
grid: {
noDataContent: "No encontrado",
deleteConfirm: "¿Está seguro?",
pagerFormat: "Paginas: {first} {prev} {pages} {next} {last} &nbsp;&nbsp; {pageIndex} de {pageCount}",
pagePrevText: "Anterior",
pageNextText: "Siguiente",
pageFirstText: "Primero",
pageLastText: "Ultimo",
loadMessage: "Por favor, espere...",
invalidMessage: "¡Datos no válidos!"
},
loadIndicator: {
message: "Cargando..."
},
fields: {
control: {
searchModeButtonTooltip: "Cambiar a búsqueda",
insertModeButtonTooltip: "Cambiar a inserción",
editButtonTooltip: "Editar",
deleteButtonTooltip: "Suprimir",
searchButtonTooltip: "Buscar",
clearFilterButtonTooltip: "Borrar filtro",
insertButtonTooltip: "Insertar",
updateButtonTooltip: "Actualizar",
cancelEditButtonTooltip: "Cancelar edición"
}
},
validators: {
required: { message: "Campo requerido" },
rangeLength: { message: "La longitud del valor está fuera del intervalo definido" },
minLength: { message: "La longitud del valor es demasiado corta" },
maxLength: { message: "La longitud del valor es demasiado larga" },
pattern: { message: "El valor no se ajusta al patrón definido" },
range: { message: "Valor fuera del rango definido" },
min: { message: "Valor demasiado bajo" },
max: { message: "Valor demasiado alto" }
}
};
}(jsGrid, jQuery));

@ -1,47 +0,0 @@
(function(jsGrid) {
jsGrid.locales.fr = {
grid: {
noDataContent: "Pas de données",
deleteConfirm: "Êtes-vous sûr ?",
pagerFormat: "Pages: {first} {prev} {pages} {next} {last} &nbsp;&nbsp; {pageIndex} de {pageCount}",
pagePrevText: "<",
pageNextText: ">",
pageFirstText: "<<",
pageLastText: ">>",
loadMessage: "Chargement en cours...",
invalidMessage: "Des données incorrectes sont entrés !"
},
loadIndicator: {
message: "Chargement en cours..."
},
fields: {
control: {
searchModeButtonTooltip: "Recherche",
insertModeButtonTooltip: "Ajouter une entrée",
editButtonTooltip: "Changer",
deleteButtonTooltip: "Effacer",
searchButtonTooltip: "Trouve",
clearFilterButtonTooltip: "Effacer",
insertButtonTooltip: "Ajouter",
updateButtonTooltip: "Sauvegarder",
cancelEditButtonTooltip: "Annuler"
}
},
validators: {
required: { message: "Champ requis" },
rangeLength: { message: "Longueur de la valeur du champ est hors de la plage définie" },
minLength: { message: "La valeur du champ est trop court" },
maxLength: { message: "La valeur du champ est trop long" },
pattern: { message: "La valeur du champ ne correspond pas à la configuration définie" },
range: { message: "La valeur du champ est hors de la plage définie" },
min: { message: "La valeur du champ est trop petit" },
max: { message: "La valeur du champ est trop grande" }
}
};
}(jsGrid, jQuery));

@ -1,46 +0,0 @@
(function(jsGrid) {
jsGrid.locales.he = {
grid: {
noDataContent: "לא נמצא",
deleteConfirm: "האם אתה בטוח?",
pagerFormat: "עמודים: {first} {prev} {pages} {next} {last} &nbsp;&nbsp; {pageIndex} מתוך {pageCount}",
pagePrevText: "הקודם",
pageNextText: "הבא",
pageFirstText: "ראשון",
pageLastText: "אחרון",
loadMessage: "אנא המתן ...",
invalidMessage: "נתונים לא חוקיים!"
},
loadIndicator: {
message: "טוען..."
},
fields: {
control: {
searchModeButtonTooltip: "ביצוע חיפוש",
insertModeButtonTooltip: "ביצוע עריכת שורה",
editButtonTooltip: "עריכה",
deleteButtonTooltip: "מחיקה",
searchButtonTooltip: "חיפוש",
clearFilterButtonTooltip: "ניקוי מסנן",
insertButtonTooltip: "הכנסה",
updateButtonTooltip: "עדכון",
cancelEditButtonTooltip: "ביטול עריכה"
}
},
validators: {
required: { message: "שדה נדרש" },
rangeLength: { message: "אורכו של הערך הוא מחוץ לטווח המוגדר" },
minLength: { message: "אורכו של הערך קצר מדי" },
maxLength: { message: "אורכו של הערך ארוך מדי" },
pattern: { message: "אורכו של הערך ארוך מדי" },
range: { message: "ערך מחוץ לטווח" },
min: { message: "ערך נמוך מדי" },
max: { message: "גבוה מדי" }
}
};
}(jsGrid, jQuery));

@ -1,46 +0,0 @@
(function(jsGrid) {
jsGrid.locales.ja = {
grid: {
noDataContent: "データが見つかりません。",
deleteConfirm: "削除しますよろしですか。",
pagerFormat: "頁: {first} {prev} {pages} {next} {last} &nbsp;&nbsp; 【{pageIndex}{pageCount}】",
pagePrevText: "前",
pageNextText: "次",
pageFirstText: "最初",
pageLastText: "最後",
loadMessage: "しばらくお待ちください…",
invalidMessage: "入力されたデータが不正です。"
},
loadIndicator: {
message: "処理中…"
},
fields: {
control: {
searchModeButtonTooltip: "検索モードへ",
insertModeButtonTooltip: "登録モードへ",
editButtonTooltip: "編集",
deleteButtonTooltip: "削除",
searchButtonTooltip: "フィルター",
clearFilterButtonTooltip: "クリア",
insertButtonTooltip: "登録",
updateButtonTooltip: "更新",
cancelEditButtonTooltip: "編集戻す"
}
},
validators: {
required: { message: "項目が必要です。" },
rangeLength: { message: "項目の桁数が範囲外です。" },
minLength: { message: "項目の桁数が超過しています。" },
maxLength: { message: "項目の桁数が不足しています。" },
pattern: { message: "項目の値がパターンに一致しません。" },
range: { message: "項目の値が範囲外です。" },
min: { message: "項目の値が超過しています。" },
max: { message: "項目の値が不足しています。" }
}
};
}(jsGrid, jQuery));

@ -1,46 +0,0 @@
(function(jsGrid) {
jsGrid.locales.ka = {
grid: {
noDataContent: "მონაცემები ცარიელია.",
deleteConfirm: "ნამდვილად გსურთ ჩანაწერის წაშლა?",
pagerFormat: "გვერდები: {first} {prev} {pages} {next} {last} &nbsp;&nbsp; {pageIndex} - {pageCount} დან.",
pagePrevText: "<",
pageNextText: ">",
pageFirstText: "<<",
pageLastText: ">>",
loadMessage: "გთხოვთ დაიცადოთ...",
invalidMessage: "შეყვანილია არასწორი მონაცემები!"
},
loadIndicator: {
message: "მიმდინარეობს ჩატვირთვა..."
},
fields: {
control: {
searchModeButtonTooltip: "ძებნა",
insertModeButtonTooltip: "ჩანაწერის დამატება",
editButtonTooltip: "შესწორება",
deleteButtonTooltip: "წაშლა",
searchButtonTooltip: "ძებნა",
clearFilterButtonTooltip: "ფილტრის გასუფთავება",
insertButtonTooltip: "დამატება",
updateButtonTooltip: "შენახვა",
cancelEditButtonTooltip: "გაუქმება"
}
},
validators: {
required: { message: "ველი აუცილებელია შესავსებად." },
rangeLength: { message: "შეყვანილი ჩანაწერის ზომა არ ექვემდებარება დიაპაზონს." },
minLength: { message: "შეყვანილი ჩანაწერის ზომა საკმაოდ პატარა არის." },
maxLength: { message: "შეყვანილი ჩანაწერის ზომა საკმაოდ დიდი არის." },
pattern: { message: "შეყვანილი მნიშვნელობა არ ემთხვევა მითითებულ შაბლონს." },
range: { message: "შეყვანილი ინფორმაცია არ ჯდება დიაპაზონში." },
min: { message: "შეყვანილი ინფორმაციის ზომა საკმაოდ პატარა არის." },
max: { message: "შეყვანილი ინფორმაციის ზომა საკმაოდ დიდი არის." }
}
};
}(jsGrid, jQuery));

@ -1,62 +0,0 @@
(function(jsGrid) {
jsGrid.locales.pl = {
grid: {
noDataContent: "Nie znaleziono",
deleteConfirm: "Czy jesteś pewien?",
pagerFormat: "Strony: {first} {prev} {pages} {next} {last} &nbsp;&nbsp; {pageIndex} z {pageCount}",
pagePrevText: "Poprzednia",
pageNextText: "Następna",
pageFirstText: "Pierwsza",
pageLastText: "Ostatnia",
loadMessage: "Proszę czekać...",
invalidMessage: "Wprowadzono nieprawidłowe dane!"
},
loadIndicator: {
message: "Ładowanie..."
},
fields: {
control: {
searchModeButtonTooltip: "Wyszukiwanie",
insertModeButtonTooltip: "Dodawanie",
editButtonTooltip: "Edytuj",
deleteButtonTooltip: "Usuń",
searchButtonTooltip: "Szukaj",
clearFilterButtonTooltip: "Wyczyść filtr",
insertButtonTooltip: "Dodaj",
updateButtonTooltip: "Aktualizuj",
cancelEditButtonTooltip: "Anuluj edytowanie"
}
},
validators: {
required: {
message: "Pole jest wymagane"
},
rangeLength: {
message: "Długość wartości pola znajduje się poza zdefiniowanym zakresem"
},
minLength: {
message: "Wartość pola jest zbyt krótka"
},
maxLength: {
message: "Wartość pola jest zbyt długa"
},
pattern: {
message: "Wartość pola nie zgadza się ze zdefiniowanym wzorem"
},
range: {
message: "Wartość pola znajduje się poza zdefiniowanym zakresem"
},
min: {
message: "Wartość pola jest zbyt mała"
},
max: {
message: "Wartość pola jest zbyt duża"
}
}
};
}(jsGrid, jQuery));

@ -1,46 +0,0 @@
(function(jsGrid) {
jsGrid.locales["pt-br"] = {
grid: {
noDataContent: "Não encontrado",
deleteConfirm: "Você tem certeza que deseja remover este item?",
pagerFormat: "Páginas: {first} {prev} {pages} {next} {last} &nbsp;&nbsp; {pageIndex} de {pageCount}",
pagePrevText: "Anterior",
pageNextText: "Seguinte",
pageFirstText: "Primeira",
pageLastText: "Última",
loadMessage: "Por favor, espere...",
invalidMessage: "Dados inválidos!"
},
loadIndicator: {
message: "Carregando..."
},
fields: {
control: {
searchModeButtonTooltip: "Mudar para busca",
insertModeButtonTooltip: "Mudar para inserção",
editButtonTooltip: "Editar",
deleteButtonTooltip: "Remover",
searchButtonTooltip: "Buscar",
clearFilterButtonTooltip: "Remover filtro",
insertButtonTooltip: "Adicionar",
updateButtonTooltip: "Atualizar",
cancelEditButtonTooltip: "Cancelar Edição"
}
},
validators: {
required: { message: "Campo obrigatório" },
rangeLength: { message: "O valor esta fora do intervaldo definido" },
minLength: { message: "O comprimento do valor é muito curto" },
maxLength: { message: "O comprimento valor é muito longo" },
pattern: { message: "O valor informado não é compatível com o padrão" },
range: { message: "O valor informado esta fora do limite definido" },
min: { message: "O valor é muito curto" },
max: { message: "O valor é muito longo" }
}
};
}(jsGrid, jQuery));

@ -1,46 +0,0 @@
(function(jsGrid) {
jsGrid.locales.pt = {
grid: {
noDataContent: "Não encontrado",
deleteConfirm: "Você tem certeza que deseja remover este item?",
pagerFormat: "Páginas: {first} {prev} {pages} {next} {last} &nbsp;&nbsp; {pageIndex} de {pageCount}",
pagePrevText: "Anterior",
pageNextText: "Seguinte",
pageFirstText: "Primeira",
pageLastText: "Última",
loadMessage: "Por favor, espere...",
invalidMessage: "Dados inválidos!"
},
loadIndicator: {
message: "Carregando..."
},
fields: {
control: {
searchModeButtonTooltip: "Mudar para busca",
insertModeButtonTooltip: "Mudar para inserção",
editButtonTooltip: "Editar",
deleteButtonTooltip: "Remover",
searchButtonTooltip: "Buscar",
clearFilterButtonTooltip: "Remover filtro",
insertButtonTooltip: "Adicionar",
updateButtonTooltip: "Atualizar",
cancelEditButtonTooltip: "Cancelar Edição"
}
},
validators: {
required: { message: "Campo obrigatório" },
rangeLength: { message: "O valor esta fora do intervaldo definido" },
minLength: { message: "O comprimento do valor é muito curto" },
maxLength: { message: "O comprimento valor é muito longo" },
pattern: { message: "O valor informado não é compatível com o padrão" },
range: { message: "O valor informado esta fora do limite definido" },
min: { message: "O valor é muito curto" },
max: { message: "O valor é muito longo" }
}
};
}(jsGrid, jQuery));

@ -1,47 +0,0 @@
(function(jsGrid) {
jsGrid.locales.ru = {
grid: {
noDataContent: "Данных не найдено",
deleteConfirm: "Вы действительно хотите удалить запись?",
pagerFormat: "Страницы: {first} {prev} {pages} {next} {last} &nbsp;&nbsp; {pageIndex} из {pageCount}",
pagePrevText: "<",
pageNextText: ">",
pageFirstText: "<<",
pageLastText: ">>",
loadMessage: "Пожалуйста, подождите...",
invalidMessage: "Введены неверные данные!"
},
loadIndicator: {
message: "Загрузка..."
},
fields: {
control: {
searchModeButtonTooltip: "Поиск",
insertModeButtonTooltip: "Добавить запись",
editButtonTooltip: "Изменить",
deleteButtonTooltip: "Удалить",
searchButtonTooltip: "Найти",
clearFilterButtonTooltip: "Очистить фильтр",
insertButtonTooltip: "Добавить",
updateButtonTooltip: "Сохранить",
cancelEditButtonTooltip: "Отменить"
}
},
validators: {
required: { message: "Поле обязательно для заполения" },
rangeLength: { message: "Длинна введенного значения вне допустимого диапазона" },
minLength: { message: "Введенное значение слишком короткое" },
maxLength: { message: "Введенное значение слишком длинное" },
pattern: { message: "Введенное значение не соответствует заданному шаблону" },
range: { message: "Введенное значение вне допустимого диапазона" },
min: { message: "Введенное значение слишком маленькое" },
max: { message: "Введенное значение слишком большое" }
}
};
}(jsGrid, jQuery));

@ -1,47 +0,0 @@
(function(jsGrid) {
jsGrid.locales.tr = {
grid: {
noDataContent: "Kayıt Bulunamadı",
deleteConfirm: "Emin misiniz ?",
pagerFormat: "Sayfalar: {first} {prev} {pages} {next} {last} &nbsp;&nbsp; {pageIndex} / {pageCount}",
pagePrevText: "<",
pageNextText: ">",
pageFirstText: "<<",
pageLastText: ">>",
loadMessage: "Lütfen bekleyiniz...",
invalidMessage: "Geçersiz veri girişi !"
},
loadIndicator: {
message: "Yükleniyor..."
},
fields: {
control: {
searchModeButtonTooltip: "Arama moduna geç",
insertModeButtonTooltip: "Yeni kayıt moduna geç",
editButtonTooltip: "Değiştir",
deleteButtonTooltip: "Sil",
searchButtonTooltip: "Bul",
clearFilterButtonTooltip: "Filtreyi temizle",
insertButtonTooltip: "Ekle",
updateButtonTooltip: "Güncelle",
cancelEditButtonTooltip: "Güncelleme iptali"
}
},
validators: {
required: { message: "Gerekli alandır" },
rangeLength: { message: "Alan değerinin uzunluğu tanımlanan aralık dışındadır" },
minLength: { message: "Alan değeri çok kısadır" },
maxLength: { message: "Alan değeri çok uzundur" },
pattern: { message: "Alan değeri tanımlanan şablon ile eşleşmiyor" },
range: { message: "Alan değeri tanımlı aralığın dışındadır" },
min: { message: "Alan değeri çok küçüktür" },
max: { message: "Alan değeri çok büyüktür" }
}
};
}(jsGrid, jQuery));

@ -1,46 +0,0 @@
(function(jsGrid) {
jsGrid.locales["zh-cn"] = {
grid: {
noDataContent: "暂无数据",
deleteConfirm: "确认删除?",
pagerFormat: "页码: {first} {prev} {pages} {next} {last} &nbsp;&nbsp; {pageIndex} / {pageCount}",
pagePrevText: "上一页",
pageNextText: "下一页",
pageFirstText: "第一页",
pageLastText: "最后页",
loadMessage: "请稍后...",
invalidMessage: "数据有误!"
},
loadIndicator: {
message: "载入中..."
},
fields: {
control: {
searchModeButtonTooltip: "切换为搜索",
insertModeButtonTooltip: "切换为新增",
editButtonTooltip: "编辑",
deleteButtonTooltip: "删除",
searchButtonTooltip: "搜索",
clearFilterButtonTooltip: "清空过滤",
insertButtonTooltip: "插入",
updateButtonTooltip: "更新",
cancelEditButtonTooltip: "取消编辑"
}
},
validators: {
required: { message: "字段必填" },
rangeLength: { message: "字段值长度超过定义范围" },
minLength: { message: "字段长度过短" },
maxLength: { message: "字段长度过长" },
pattern: { message: "字段值不符合定义规则" },
range: { message: "字段值超过定义范围" },
min: { message: "字段值太小" },
max: { message: "字段值太大" }
}
};
}(jsGrid, jQuery));

@ -1,46 +0,0 @@
(function(jsGrid) {
jsGrid.locales["zh-tw"] = {
grid: {
noDataContent: "暫無資料",
deleteConfirm: "確認刪除?",
pagerFormat: "頁碼: {first} {prev} {pages} {next} {last} &nbsp;&nbsp; {pageIndex} / {pageCount}",
pagePrevText: "上一頁",
pageNextText: "下一頁",
pageFirstText: "第一頁",
pageLastText: "最後一頁",
loadMessage: "請稍候...",
invalidMessage: "輸入資料不正確"
},
loadIndicator: {
message: "載入中..."
},
fields: {
control: {
searchModeButtonTooltip: "切換為搜尋",
insertModeButtonTooltip: "切換為新增",
editButtonTooltip: "編輯",
deleteButtonTooltip: "刪除",
searchButtonTooltip: "搜尋",
clearFilterButtonTooltip: "清除搜尋條件",
insertButtonTooltip: "新增",
updateButtonTooltip: "修改",
cancelEditButtonTooltip: "取消編輯"
}
},
validators: {
required: { message: "欄位必填" },
rangeLength: { message: "欄位字串長度超出範圍" },
minLength: { message: "欄位字串長度太短" },
maxLength: { message: "欄位字串長度太長" },
pattern: { message: "欄位字串不符合規則" },
range: { message: "欄位數值超出範圍" },
min: { message: "欄位數值太小" },
max: { message: "欄位數值太大" }
}
};
}(jsGrid, jQuery));

File diff suppressed because it is too large Load Diff

@ -1,72 +0,0 @@
(function(jsGrid, $, undefined) {
function Field(config) {
$.extend(true, this, config);
this.sortingFunc = this._getSortingFunc();
}
Field.prototype = {
name: "",
title: null,
css: "",
align: "",
width: 100,
visible: true,
filtering: true,
inserting: true,
editing: true,
sorting: true,
sorter: "string", // name of SortStrategy or function to compare elements
headerTemplate: function() {
return (this.title === undefined || this.title === null) ? this.name : this.title;
},
itemTemplate: function(value, item) {
return value;
},
filterTemplate: function() {
return "";
},
insertTemplate: function() {
return "";
},
editTemplate: function(value, item) {
this._value = value;
return this.itemTemplate(value, item);
},
filterValue: function() {
return "";
},
insertValue: function() {
return "";
},
editValue: function() {
return this._value;
},
_getSortingFunc: function() {
var sorter = this.sorter;
if($.isFunction(sorter)) {
return sorter;
}
if(typeof sorter === "string") {
return jsGrid.sortStrategies[sorter];
}
throw Error("wrong sorter for the field \"" + this.name + "\"!");
}
};
jsGrid.Field = Field;
}(jsGrid, jQuery));

@ -1,82 +0,0 @@
(function(jsGrid, $, undefined) {
function LoadIndicator(config) {
this._init(config);
}
LoadIndicator.prototype = {
container: "body",
message: "Loading...",
shading: true,
zIndex: 1000,
shaderClass: "jsgrid-load-shader",
loadPanelClass: "jsgrid-load-panel",
_init: function(config) {
$.extend(true, this, config);
this._initContainer();
this._initShader();
this._initLoadPanel();
},
_initContainer: function() {
this._container = $(this.container);
},
_initShader: function() {
if(!this.shading)
return;
this._shader = $("<div>").addClass(this.shaderClass)
.hide()
.css({
position: "absolute",
top: 0,
right: 0,
bottom: 0,
left: 0,
zIndex: this.zIndex
})
.appendTo(this._container);
},
_initLoadPanel: function() {
this._loadPanel = $("<div>").addClass(this.loadPanelClass)
.text(this.message)
.hide()
.css({
position: "absolute",
top: "50%",
left: "50%",
zIndex: this.zIndex
})
.appendTo(this._container);
},
show: function() {
var $loadPanel = this._loadPanel.show();
var actualWidth = $loadPanel.outerWidth();
var actualHeight = $loadPanel.outerHeight();
$loadPanel.css({
marginTop: -actualHeight / 2,
marginLeft: -actualWidth / 2
});
this._shader.show();
},
hide: function() {
this._loadPanel.hide();
this._shader.hide();
}
};
jsGrid.LoadIndicator = LoadIndicator;
}(jsGrid, jQuery));

@ -1,122 +0,0 @@
(function(jsGrid, $, undefined) {
function DirectLoadingStrategy(grid) {
this._grid = grid;
}
DirectLoadingStrategy.prototype = {
firstDisplayIndex: function() {
var grid = this._grid;
return grid.option("paging") ? (grid.option("pageIndex") - 1) * grid.option("pageSize") : 0;
},
lastDisplayIndex: function() {
var grid = this._grid;
var itemsCount = grid.option("data").length;
return grid.option("paging")
? Math.min(grid.option("pageIndex") * grid.option("pageSize"), itemsCount)
: itemsCount;
},
itemsCount: function() {
return this._grid.option("data").length;
},
openPage: function(index) {
this._grid.refresh();
},
loadParams: function() {
return {};
},
sort: function() {
this._grid._sortData();
this._grid.refresh();
return $.Deferred().resolve().promise();
},
reset: function() {
this._grid.refresh();
return $.Deferred().resolve().promise();
},
finishLoad: function(loadedData) {
this._grid.option("data", loadedData);
},
finishInsert: function(insertedItem) {
var grid = this._grid;
grid.option("data").push(insertedItem);
grid.refresh();
},
finishDelete: function(deletedItem, deletedItemIndex) {
var grid = this._grid;
grid.option("data").splice(deletedItemIndex, 1);
grid.reset();
}
};
function PageLoadingStrategy(grid) {
this._grid = grid;
this._itemsCount = 0;
}
PageLoadingStrategy.prototype = {
firstDisplayIndex: function() {
return 0;
},
lastDisplayIndex: function() {
return this._grid.option("data").length;
},
itemsCount: function() {
return this._itemsCount;
},
openPage: function(index) {
this._grid.loadData();
},
loadParams: function() {
var grid = this._grid;
return {
pageIndex: grid.option("pageIndex"),
pageSize: grid.option("pageSize")
};
},
reset: function() {
return this._grid.loadData();
},
sort: function() {
return this._grid.loadData();
},
finishLoad: function(loadedData) {
this._itemsCount = loadedData.itemsCount;
this._grid.option("data", loadedData.data);
},
finishInsert: function(insertedItem) {
this._grid.search();
},
finishDelete: function(deletedItem, deletedItemIndex) {
this._grid.search();
}
};
jsGrid.loadStrategies = {
DirectLoadingStrategy: DirectLoadingStrategy,
PageLoadingStrategy: PageLoadingStrategy
};
}(jsGrid, jQuery));

@ -1,36 +0,0 @@
(function(jsGrid, $, undefined) {
var isDefined = function(val) {
return typeof(val) !== "undefined" && val !== null;
};
var sortStrategies = {
string: function(str1, str2) {
if(!isDefined(str1) && !isDefined(str2))
return 0;
if(!isDefined(str1))
return -1;
if(!isDefined(str2))
return 1;
return ("" + str1).localeCompare("" + str2);
},
number: function(n1, n2) {
return n1 - n2;
},
date: function(dt1, dt2) {
return dt1 - dt2;
},
numberAsString: function(n1, n2) {
return parseFloat(n1) - parseFloat(n2);
}
};
jsGrid.sortStrategies = sortStrategies;
}(jsGrid, jQuery));

@ -1,135 +0,0 @@
(function(jsGrid, $, undefined) {
function Validation(config) {
this._init(config);
}
Validation.prototype = {
_init: function(config) {
$.extend(true, this, config);
},
validate: function(args) {
var errors = [];
$.each(this._normalizeRules(args.rules), function(_, rule) {
if(rule.validator(args.value, args.item, rule.param))
return;
var errorMessage = $.isFunction(rule.message) ? rule.message(args.value, args.item) : rule.message;
errors.push(errorMessage);
});
return errors;
},
_normalizeRules: function(rules) {
if(!$.isArray(rules))
rules = [rules];
return $.map(rules, $.proxy(function(rule) {
return this._normalizeRule(rule);
}, this));
},
_normalizeRule: function(rule) {
if(typeof rule === "string")
rule = { validator: rule };
if($.isFunction(rule))
rule = { validator: rule };
if($.isPlainObject(rule))
rule = $.extend({}, rule);
else
throw Error("wrong validation config specified");
if($.isFunction(rule.validator))
return rule;
return this._applyNamedValidator(rule, rule.validator);
},
_applyNamedValidator: function(rule, validatorName) {
delete rule.validator;
var validator = validators[validatorName];
if(!validator)
throw Error("unknown validator \"" + validatorName + "\"");
if($.isFunction(validator)) {
validator = { validator: validator };
}
return $.extend({}, validator, rule);
}
};
jsGrid.Validation = Validation;
var validators = {
required: {
message: "Field is required",
validator: function(value) {
return value !== undefined && value !== null && value !== "";
}
},
rangeLength: {
message: "Field value length is out of the defined range",
validator: function(value, _, param) {
return value.length >= param[0] && value.length <= param[1];
}
},
minLength: {
message: "Field value is too short",
validator: function(value, _, param) {
return value.length >= param;
}
},
maxLength: {
message: "Field value is too long",
validator: function(value, _, param) {
return value.length <= param;
}
},
pattern: {
message: "Field value is not matching the defined pattern",
validator: function(value, _, param) {
if(typeof param === "string") {
param = new RegExp("^(?:" + param + ")$");
}
return param.test(value);
}
},
range: {
message: "Field value is out of the defined range",
validator: function(value, _, param) {
return value >= param[0] && value <= param[1];
}
},
min: {
message: "Field value is too small",
validator: function(value, _, param) {
return value >= param;
}
},
max: {
message: "Field value is too large",
validator: function(value, _, param) {
return value <= param;
}
}
};
jsGrid.validators = validators;
}(jsGrid, jQuery));

@ -1,37 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JSGrid QUnit Tests</title>
<link rel="stylesheet" href="../external/qunit/qunit-1.10.0.css">
</head>
<body>
<div id="qunit"></div>
<div id="qunit-fixture">
<div id="jsGrid"></div>
</div>
<script src="../external/qunit/qunit-1.10.0.js"></script>
<script src="../external/jquery/jquery-1.8.3.js"></script>
<script src="../src/jsgrid.core.js"></script>
<script src="../src/jsgrid.load-indicator.js"></script>
<script src="../src/jsgrid.load-strategies.js"></script>
<script src="../src/jsgrid.sort-strategies.js"></script>
<script src="../src/jsgrid.validation.js"></script>
<script src="../src/jsgrid.field.js"></script>
<script src="../src/fields/jsgrid.field.text.js"></script>
<script src="../src/fields/jsgrid.field.number.js"></script>
<script src="../src/fields/jsgrid.field.textarea.js"></script>
<script src="../src/fields/jsgrid.field.checkbox.js"></script>
<script src="../src/fields/jsgrid.field.select.js"></script>
<script src="../src/fields/jsgrid.field.control.js"></script>
<script src="jsgrid.tests.js"></script>
<script src="jsgrid.field.tests.js"></script>
<script src="jsgrid.sort-strategies.tests.js"></script>
<script src="jsgrid.validation.tests.js"></script>
</body>
</html>

@ -1,461 +0,0 @@
$(function() {
var Grid = jsGrid.Grid;
module("common field config", {
setup: function() {
this.isFieldExcluded = function(FieldClass) {
return FieldClass === jsGrid.ControlField;
};
}
});
test("filtering=false prevents rendering filter template", function() {
var isFieldExcluded = this.isFieldExcluded;
$.each(jsGrid.fields, function(name, FieldClass) {
if(isFieldExcluded(FieldClass))
return;
var field = new FieldClass({ filtering: false });
equal(field.filterTemplate(), "", "empty filter template for field " + name);
});
});
test("inserting=false prevents rendering insert template", function() {
var isFieldExcluded = this.isFieldExcluded;
$.each(jsGrid.fields, function(name, FieldClass) {
if(isFieldExcluded(FieldClass))
return;
var field = new FieldClass({ inserting: false });
equal(field.insertTemplate(), "", "empty insert template for field " + name);
});
});
test("editing=false renders itemTemplate", function() {
var isFieldExcluded = this.isFieldExcluded;
$.each(jsGrid.fields, function(name, FieldClass) {
if(isFieldExcluded(FieldClass))
return;
var item = {
field: "test"
};
var args;
var field = new FieldClass({
editing: false,
itemTemplate: function() {
args = arguments;
FieldClass.prototype.itemTemplate.apply(this, arguments);
}
});
var itemTemplate = field.itemTemplate("test", item);
var editTemplate = field.editTemplate("test", item);
var editTemplateContent = editTemplate instanceof jQuery ? editTemplate[0].outerHTML : editTemplate;
var itemTemplateContent = itemTemplate instanceof jQuery ? itemTemplate[0].outerHTML : itemTemplate;
equal(editTemplateContent, itemTemplateContent, "item template is rendered instead of edit template for " + name);
equal(args.length, 2, "passed both arguments for " + name);
equal(args[0], "test", "field value passed as a first argument for " + name);
equal(args[1], item, "item passed as a second argument for " + name);
});
});
module("jsGrid.field");
test("basic", function() {
var customSortingFunc = function() {
return 1;
},
field = new jsGrid.Field({
name: "testField",
title: "testTitle",
sorter: customSortingFunc
});
equal(field.headerTemplate(), "testTitle");
equal(field.itemTemplate("testValue"), "testValue");
equal(field.filterTemplate(), "");
equal(field.insertTemplate(), "");
equal(field.editTemplate("testValue"), "testValue");
strictEqual(field.filterValue(), "");
strictEqual(field.insertValue(), "");
strictEqual(field.editValue(), "testValue");
strictEqual(field.sortingFunc, customSortingFunc);
});
module("jsGrid.field.text");
test("basic", function() {
var field = new jsGrid.TextField({ name: "testField" });
equal(field.itemTemplate("testValue"), "testValue");
equal(field.filterTemplate()[0].tagName.toLowerCase(), "input");
equal(field.insertTemplate()[0].tagName.toLowerCase(), "input");
equal(field.editTemplate("testEditValue")[0].tagName.toLowerCase(), "input");
strictEqual(field.filterValue(), "");
strictEqual(field.insertValue(), "");
strictEqual(field.editValue(), "testEditValue");
});
test("set default field options with setDefaults", function() {
jsGrid.setDefaults("text", {
defaultOption: "test"
});
var $element = $("#jsGrid").jsGrid({
fields: [{ type: "text" }]
});
equal($element.jsGrid("option", "fields")[0].defaultOption, "test", "default field option set");
});
module("jsGrid.field.number");
test("basic", function() {
var field = new jsGrid.NumberField({ name: "testField" });
equal(field.itemTemplate(5), "5");
equal(field.filterTemplate()[0].tagName.toLowerCase(), "input");
equal(field.insertTemplate()[0].tagName.toLowerCase(), "input");
equal(field.editTemplate(6)[0].tagName.toLowerCase(), "input");
strictEqual(field.filterValue(), undefined);
strictEqual(field.insertValue(), undefined);
strictEqual(field.editValue(), 6);
});
module("jsGrid.field.textArea");
test("basic", function() {
var field = new jsGrid.TextAreaField({ name: "testField" });
equal(field.itemTemplate("testValue"), "testValue");
equal(field.filterTemplate()[0].tagName.toLowerCase(), "input");
equal(field.insertTemplate()[0].tagName.toLowerCase(), "textarea");
equal(field.editTemplate("testEditValue")[0].tagName.toLowerCase(), "textarea");
strictEqual(field.insertValue(), "");
strictEqual(field.editValue(), "testEditValue");
});
module("jsGrid.field.checkbox");
test("basic", function() {
var field = new jsGrid.CheckboxField({ name: "testField" }),
itemTemplate,
filterTemplate,
insertTemplate,
editTemplate;
itemTemplate = field.itemTemplate("testValue");
equal(itemTemplate[0].tagName.toLowerCase(), "input");
equal(itemTemplate.attr("type"), "checkbox");
equal(itemTemplate.attr("disabled"), "disabled");
filterTemplate = field.filterTemplate();
equal(filterTemplate[0].tagName.toLowerCase(), "input");
equal(filterTemplate.attr("type"), "checkbox");
equal(filterTemplate.prop("indeterminate"), true);
insertTemplate = field.insertTemplate();
equal(insertTemplate[0].tagName.toLowerCase(), "input");
equal(insertTemplate.attr("type"), "checkbox");
editTemplate = field.editTemplate(true);
equal(editTemplate[0].tagName.toLowerCase(), "input");
equal(editTemplate.attr("type"), "checkbox");
equal(editTemplate.is(":checked"), true);
strictEqual(field.filterValue(), undefined);
strictEqual(field.insertValue(), false);
strictEqual(field.editValue(), true);
});
module("jsGrid.field.select");
test("basic", function() {
var field,
filterTemplate,
insertTemplate,
editTemplate;
field = new jsGrid.SelectField({
name: "testField",
items: ["test1", "test2", "test3"],
selectedIndex: 1
});
equal(field.itemTemplate(1), "test2");
filterTemplate = field.filterTemplate();
equal(filterTemplate[0].tagName.toLowerCase(), "select");
equal(filterTemplate.children().length, 3);
insertTemplate = field.insertTemplate();
equal(insertTemplate[0].tagName.toLowerCase(), "select");
equal(insertTemplate.children().length, 3);
editTemplate = field.editTemplate(2);
equal(editTemplate[0].tagName.toLowerCase(), "select");
equal(editTemplate.find("option:selected").length, 1);
ok(editTemplate.children().eq(2).is(":selected"));
strictEqual(field.filterValue(), 1);
strictEqual(field.insertValue(), 1);
strictEqual(field.editValue(), 2);
});
test("items as array of integers", function() {
var field,
filterTemplate,
insertTemplate,
editTemplate;
field = new jsGrid.SelectField({
name: "testField",
items: [0, 10, 20],
selectedIndex: 0
});
strictEqual(field.itemTemplate(0), 0);
filterTemplate = field.filterTemplate();
equal(filterTemplate[0].tagName.toLowerCase(), "select");
equal(filterTemplate.children().length, 3);
insertTemplate = field.insertTemplate();
equal(insertTemplate[0].tagName.toLowerCase(), "select");
equal(insertTemplate.children().length, 3);
editTemplate = field.editTemplate(1);
equal(editTemplate[0].tagName.toLowerCase(), "select");
equal(editTemplate.find("option:selected").length, 1);
ok(editTemplate.children().eq(1).is(":selected"));
strictEqual(field.filterValue(), 0);
strictEqual(field.insertValue(), 0);
strictEqual(field.editValue(), 1);
});
test("string value type", function() {
var field = new jsGrid.SelectField({
name: "testField",
items: [
{ text: "test1", value: "1" },
{ text: "test2", value: "2" },
{ text: "test3", value: "3" }
],
textField: "text",
valueField: "value",
valueType: "string",
selectedIndex: 1
});
field.filterTemplate();
strictEqual(field.filterValue(), "2");
field.editTemplate("2");
strictEqual(field.editValue(), "2");
field.insertTemplate();
strictEqual(field.insertValue(), "2");
});
test("value type auto-defined", function() {
var field = new jsGrid.SelectField({
name: "testField",
items: [
{ text: "test1", value: "1" },
{ text: "test2", value: "2" },
{ text: "test3", value: "3" }
],
textField: "text",
valueField: "value",
selectedIndex: 1
});
strictEqual(field.sorter, "string", "sorter set according to value type");
field.filterTemplate();
strictEqual(field.filterValue(), "2");
field.editTemplate("2");
strictEqual(field.editValue(), "2");
field.insertTemplate();
strictEqual(field.insertValue(), "2");
});
test("value type defaulted to string", function() {
var field = new jsGrid.SelectField({
name: "testField",
items: [
{ text: "test1" },
{ text: "test2", value: "2" }
],
textField: "text",
valueField: "value"
});
strictEqual(field.sorter, "string", "sorter set to string if first item has no value field");
});
test("object items", function() {
var field = new jsGrid.SelectField({
name: "testField",
items: [
{ text: "test1", value: 1 },
{ text: "test2", value: 2 },
{ text: "test3", value: 3 }
]
});
strictEqual(field.itemTemplate(1), field.items[1]);
field.textField = "text";
strictEqual(field.itemTemplate(1), "test2");
field.textField = "";
field.valueField = "value";
strictEqual(field.itemTemplate(1), field.items[0]);
ok(field.editTemplate(2));
strictEqual(field.editValue(), 2);
field.textField = "text";
strictEqual(field.itemTemplate(1), "test1");
});
module("jsGrid.field.control");
test("basic", function() {
var field,
itemTemplate,
headerTemplate,
filterTemplate,
insertTemplate,
editTemplate;
field = new jsGrid.ControlField();
field._grid = {
filtering: true,
inserting: true,
option: $.noop
};
itemTemplate = field.itemTemplate("any_value");
equal(itemTemplate.filter("." + field.editButtonClass).length, 1);
equal(itemTemplate.filter("." + field.deleteButtonClass).length, 1);
headerTemplate = field.headerTemplate();
equal(headerTemplate.filter("." + field.insertModeButtonClass).length, 1);
var $modeSwitchButton = headerTemplate.filter("." + field.modeButtonClass);
$modeSwitchButton.trigger("click");
equal(headerTemplate.filter("." + field.searchModeButtonClass).length, 1);
filterTemplate = field.filterTemplate();
equal(filterTemplate.filter("." + field.searchButtonClass).length, 1);
equal(filterTemplate.filter("." + field.clearFilterButtonClass).length, 1);
insertTemplate = field.insertTemplate();
equal(insertTemplate.filter("." + field.insertButtonClass).length, 1);
editTemplate = field.editTemplate("any_value");
equal(editTemplate.filter("." + field.updateButtonClass).length, 1);
equal(editTemplate.filter("." + field.cancelEditButtonClass).length, 1);
strictEqual(field.filterValue(), "");
strictEqual(field.insertValue(), "");
strictEqual(field.editValue(), "");
});
test("switchMode button should consider filtering=false", function() {
var optionArgs = {};
var field = new jsGrid.ControlField();
field._grid = {
filtering: false,
inserting: true,
option: function(name, value) {
optionArgs = {
name: name,
value: value
};
}
};
var headerTemplate = field.headerTemplate();
equal(headerTemplate.filter("." + field.insertModeButtonClass).length, 1, "inserting switch button rendered");
var $modeSwitchButton = headerTemplate.filter("." + field.modeButtonClass);
$modeSwitchButton.trigger("click");
ok($modeSwitchButton.hasClass(field.modeOnButtonClass), "on class is attached");
equal(headerTemplate.filter("." + field.insertModeButtonClass).length, 1, "insert button rendered");
equal(headerTemplate.filter("." + field.searchModeButtonClass).length, 0, "search button not rendered");
deepEqual(optionArgs, { name: "inserting", value: true }, "turn on grid inserting mode");
$modeSwitchButton.trigger("click");
ok(!$modeSwitchButton.hasClass(field.modeOnButtonClass), "on class is detached");
deepEqual(optionArgs, { name: "inserting", value: false }, "turn off grid inserting mode");
});
test("switchMode button should consider inserting=false", function() {
var optionArgs = {};
var field = new jsGrid.ControlField();
field._grid = {
filtering: true,
inserting: false,
option: function(name, value) {
optionArgs = {
name: name,
value: value
};
}
};
var headerTemplate = field.headerTemplate();
equal(headerTemplate.filter("." + field.searchModeButtonClass).length, 1, "filtering switch button rendered");
var $modeSwitchButton = headerTemplate.filter("." + field.modeButtonClass);
$modeSwitchButton.trigger("click");
ok(!$modeSwitchButton.hasClass(field.modeOnButtonClass), "on class is detached");
equal(headerTemplate.filter("." + field.searchModeButtonClass).length, 1, "search button rendered");
equal(headerTemplate.filter("." + field.insertModeButtonClass).length, 0, "insert button not rendered");
deepEqual(optionArgs, { name: "filtering", value: false }, "turn off grid filtering mode");
$modeSwitchButton.trigger("click");
ok($modeSwitchButton.hasClass(field.modeOnButtonClass), "on class is attached");
deepEqual(optionArgs, { name: "filtering", value: true }, "turn on grid filtering mode");
});
test("switchMode is not rendered if inserting=false and filtering=false", function() {
var optionArgs = {};
var field = new jsGrid.ControlField();
field._grid = {
filtering: false,
inserting: false
};
var headerTemplate = field.headerTemplate();
strictEqual(headerTemplate, "", "empty header");
});
});

@ -1,51 +0,0 @@
$(function() {
var sortStrategies = jsGrid.sortStrategies;
module("sortStrategies");
test("string sorting", function() {
var data = ["c", "a", "d", "b"];
data.sort(sortStrategies["string"]);
deepEqual(data, ["a", "b", "c", "d"]);
});
test("string sorting should be robust", function() {
var data = ["a", 1, true, "b"];
data.sort(sortStrategies["string"]);
deepEqual(data, [1, "a", "b", true]);
});
test("number sorting", function() {
var data = [5, 3.2, 1e2, 4];
data.sort(sortStrategies["number"]);
deepEqual(data, [3.2, 4, 5, 100]);
});
test("date sorting", function() {
var date1 = new Date(2010, 0, 1),
date2 = new Date(2011, 0, 1),
date3 = new Date(2012, 0, 1);
var data = [date2, date3, date1];
data.sort(sortStrategies["date"]);
deepEqual(data, [date1, date2, date3]);
});
test("numberAsString sorting", function() {
var data = [".1", "2.1", "4e5", "2"];
data.sort(sortStrategies["numberAsString"]);
deepEqual(data, [".1", "2", "2.1", "4e5"]);
});
});

File diff suppressed because it is too large Load Diff

@ -1,279 +0,0 @@
$(function() {
var validators = jsGrid.validators;
module("validation.validate", {
setup: function() {
this.validation = new jsGrid.Validation();
}
});
test("as function", function() {
var validateFunction = function(value) {
return value === "test";
};
deepEqual(this.validation.validate({
value: "not_test",
rules: validateFunction
}), [undefined]);
deepEqual(this.validation.validate({
value: "test",
rules: validateFunction
}), []);
});
test("as rule config", function() {
var validateRule = {
validator: function(value) {
return value === "test";
},
message: "Error"
};
deepEqual(this.validation.validate({
value: "not_test",
rules: validateRule
}), ["Error"]);
deepEqual(this.validation.validate({
value: "test",
rules: validateRule
}), []);
});
test("as rule config with param", function() {
var validateRule = {
validator: function(value, item, param) {
return value === param;
},
param: "test",
message: "Error"
};
deepEqual(this.validation.validate({
value: "not_test",
rules: validateRule
}), ["Error"]);
deepEqual(this.validation.validate({
value: "test",
rules: validateRule
}), []);
});
test("as array of rules", function() {
var validateRules = [{
message: "Error",
validator: function(value) {
return value !== "";
}
}, {
validator: function(value) {
return value === "test";
}
}];
deepEqual(this.validation.validate({
value: "",
rules: validateRules
}), ["Error", undefined]);
deepEqual(this.validation.validate({
value: "test",
rules: validateRules
}), []);
});
test("as string", function() {
validators.test_validator = function(value) {
return value === "test";
};
deepEqual(this.validation.validate({
value: "not_test",
rules: "test_validator"
}), [undefined]);
deepEqual(this.validation.validate({
value: "test",
rules: "test_validator"
}), []);
delete validators.test_validator;
});
test("as rule config with validator as string", function() {
validators.test_validator = function(value) {
return value === "test";
};
var validateRule = {
validator: "test_validator",
message: "Error"
};
deepEqual(this.validation.validate({
value: "not_test",
rules: validateRule
}), ["Error"]);
deepEqual(this.validation.validate({
value: "test",
rules: validateRule
}), []);
delete validators.test_validator;
});
test("as array of mixed rules", function() {
validators.test_validator = function(value) {
return value === "test";
};
var validationRules = [
"test_validator",
function(value) {
return value !== "";
}, {
validator: function(value) {
return value === "test";
},
message: "Error"
}
];
deepEqual(this.validation.validate({
value: "",
rules: validationRules
}), [undefined, undefined, "Error"]);
deepEqual(this.validation.validate({
value: "not_test",
rules: validationRules
}), [undefined, "Error"]);
deepEqual(this.validation.validate({
value: "test",
rules: validationRules
}), []);
delete validators.test_validator;
});
test("as string validator with default error message", function() {
validators.test_validator = {
message: function(value) {
return "Error: " + value;
},
validator: function(value) {
return value === "test";
}
};
var validateRule = {
validator: "test_validator"
};
deepEqual(this.validation.validate({
value: "not_test",
rules: validateRule
}), ["Error: not_test"]);
deepEqual(this.validation.validate({
value: "test",
rules: validateRule
}), []);
delete validators.test_validator;
});
test("throws exception for unknown validator", function() {
var validateRule = {
validator: "unknown_validator"
};
var validation = this.validation;
throws(function() {
validation.validate({
value: "test",
rules: validateRule
});
}, /unknown validator "unknown_validator"/, "exception for unknown validator");
});
module("validators", {
setup: function() {
var validation = new jsGrid.Validation();
this.testValidator = function(validator, value, param) {
var result = validation.validate({
value: value,
rules: { validator: validator, param: param }
});
return !result.length;
}
}
});
test("required", function() {
equal(this.testValidator("required", ""), false);
equal(this.testValidator("required", undefined), false);
equal(this.testValidator("required", null), false);
equal(this.testValidator("required", 0), true);
equal(this.testValidator("required", "test"), true);
});
test("rangeLength", function() {
equal(this.testValidator("rangeLength", "123456", [0, 5]), false);
equal(this.testValidator("rangeLength", "", [1, 5]), false);
equal(this.testValidator("rangeLength", "123", [0, 5]), true);
equal(this.testValidator("rangeLength", "", [0, 5]), true);
equal(this.testValidator("rangeLength", "12345", [0, 5]), true);
});
test("minLength", function() {
equal(this.testValidator("minLength", "123", 5), false);
equal(this.testValidator("minLength", "12345", 5), true);
equal(this.testValidator("minLength", "123456", 5), true);
});
test("maxLength", function() {
equal(this.testValidator("maxLength", "123456", 5), false);
equal(this.testValidator("maxLength", "12345", 5), true);
equal(this.testValidator("maxLength", "123", 5), true);
});
test("pattern", function() {
equal(this.testValidator("pattern", "_13_", "1?3"), false);
equal(this.testValidator("pattern", "13", "1?3"), true);
equal(this.testValidator("pattern", "3", "1?3"), true);
equal(this.testValidator("pattern", "_13_", /1?3/), true);
});
test("range", function() {
equal(this.testValidator("range", 6, [0, 5]), false);
equal(this.testValidator("range", 0, [1, 5]), false);
equal(this.testValidator("range", 3, [0, 5]), true);
equal(this.testValidator("range", 0, [0, 5]), true);
equal(this.testValidator("range", 5, [0, 5]), true);
});
test("min", function() {
equal(this.testValidator("min", 3, 5), false);
equal(this.testValidator("min", 5, 5), true);
equal(this.testValidator("min", 6, 5), true);
});
test("max", function() {
equal(this.testValidator("max", 6, 5), false);
equal(this.testValidator("max", 5, 5), true);
equal(this.testValidator("max", 3, 5), true);
});
});

@ -1,395 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>Monitor</title>
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
<meta name="viewport" content="width=device-width" />
<!-- Bootstrap core CSS -->
<link href="{{context}}/static/css/bootstrap.min.css" rel="stylesheet" />
<!-- Animation library for notifications -->
<link href="{{context}}/static/css/animate.min.css" rel="stylesheet"/>
<!-- Dashboard core CSS -->
<link href="{{context}}/static/css/dashboard.css" rel="stylesheet"/>
<!-- Fonts and icons -->
<link href="http://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css" rel="stylesheet">
<!--
<link href='https://fonts.googleapis.com/css?family=Muli:400,300' rel='stylesheet' type='text/css'>
-->
<link href="{{context}}/static/css/themify-icons.css" rel="stylesheet">
<!-- Core JS Files -->
<script src="{{context}}/static/js/jquery-1.10.2.js" type="text/javascript"></script>
<script src="{{context}}/static/js/bootstrap.min.js" type="text/javascript"></script>
<!-- Checkbox, Radio & Switch Plugins -->
<script src="{{context}}/static/js/bootstrap-checkbox-radio.js"></script>
<!-- Charts Plugin -->
<script src="{{context}}/static/js/chartist.min.js"></script>
<!-- Notifications Plugin -->
<script src="{{context}}/static/js/bootstrap-notify.js"></script>
<!-- Google Maps Plugin
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js"></script>
-->
<!-- Dashboard Core javascript and methods for Demo purpose -->
<script src="{{context}}/static/js/default.js"></script>
<!-- Dashboard DEMO methods, don't include it in your project! -->
<script src="{{context}}/static/js/dashboard.js"></script>
{# <script src="{{context}}/static/js/jx/dom.js"></script>#}
{# <script src="{{context}}/static/js/jx/rpc.js"></script>#}
{# <script src="{{context}}/static/js/jx/utils.js"></script>#}
<script type="text/javascript">
var URI_CONTEXT="{{context}}";
$(document).ready(function(){
{#var lobservers = [#}
{# g.summary.factory('/1/get/summary/app_resources',function(r){#}
{##}
{# //r = JSON.parse(r.responseText)#}
{# jx.dom.set.value('total_cpu',r.cpu_usage)#}
{# jx.dom.set.value('total_mem',r.memory_usage)#}
{# jx.dom.set.value('mem_units',r.units)#}
{##}
{# }),#}
{# g.summary.factory('/1/get/summary/folder_size',function(r){#}
{# //console.log(r.responseText)#}
{# //r = JSON.parse(r.responseText)#}
{# if (r.length == 0){#}
{# r.size = "0.0"#}
{# r.units = 'MB'#}
{# }#}
{# jx.dom.set.value('total_folder_size',r.size)#}
{# jx.dom.set.value('folder_units',r.units)#}
{# }),#}
{# g.summary.factory('/1/get/summary/app_status',function(r){#}
{##}
{# jx.dom.set.value('total_app_crashes',r.crash)#}
{# })#}
{#]#}
{##}
{#jx.utils.patterns.observer(lobservers,"init")#}
//TODO Do we need the above JX stuff ?
dashboard.initChartist();
});
</script>
</head>
<body>
<div class="wrapper">
<div class="sidebar" data-background-color="white" data-active-color="danger">
<!--
Tip 1: you can change the color of the sidebar's background using: data-background-color="white | black"
Tip 2: you can change the color of the active button using the data-active-color="primary | info | success | warning | danger"
-->
<div class="sidebar-wrapper">
<div class="logo">
<a href="#" class="simple-text">
Monitor
</a>
</div>
<ul class="nav">
<li class="active">
<a href="dashboard.html">
<i class="ti-panel"></i>
<p>Dashboard</p>
</a>
</li>
<li>
<a href= "/user">
<i class="ti-user"></i>
<p>User Profile</p>
</a>
</li>
<li class="active-pro">
<a href="/upgrade">
<i class="ti-export"></i>
<p>Upgrade to PRO</p>
</a>
</li>
</ul>
</div>
</div>
<!-- End Side Bar -->
<div class="main-panel">
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar bar1"></span>
<span class="icon-bar bar2"></span>
<span class="icon-bar bar3"></span>
</button>
<a class="navbar-brand" href="#">Dashboard</a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav navbar-right">
<li>
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="ti-panel"></i>
<p>Stats</p>
</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="ti-server"></i>
<!-- <p class="notification">5</p> -->
<p>Servers</p>
<b class="caret"></b>
</a>
<ul class="dropdown-menu">
{% for name in app_names %}
<div class="action" data-name="{{name}}" id="app_names"><i class="fa fa-angle-right"></i>
<a href='#' onclick="getNode('{{name}}')">{{name|safe}}</a></div>
{% endfor %}
</ul>
</li>
<li>
<a href="#">
<i class="ti-settings"></i>
<p>Settings</p>
</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- End Menu Bar -->
<div class="content">
<div class="container-fluid">
<div class="row"> <!-- BEGIN SMALL WIDGETS ROW -->
<div class="row"> <!-- BEGIN ROW 1 -->
<div class="col-lg-6 col-sm-6">
<div class="card">
<div class="content">
<div class="row">
<div class="col-xs-5">
<div class="icon-big icon-warning text-center">
<i class="ti-dashboard"></i>
<div class="small">Total CPU</div>
</div>
</div>
<div class="col-xs-7">
<div class="numbers">
<div id="total_cpu" align="center"></div>
<div class="small" align="right">Percent</div>
</div>
</div>
</div>
<div class="footer">
<hr />
<div class="stats">
<i class="ti-reload"></i> Updated now
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-6 col-sm-6">
<div class="card">
<div class="content">
<div class="row">
<div class="col-xs-5">
<div class="icon-big icon-success text-center">
<i class="fa fa-microchip"></i>
<div class="small">Mem. Used</div>
</div>
</div>
<div class="col-xs-7">
<div class="numbers">
<div id="total_mem"></div>
<div class="small" id="mem_units" align="right"></div>
</div>
</div>
</div>
<div class="footer">
<hr />
<div class="stats">
<i class="ti-calendar"></i> Last day
</div>
</div>
</div>
</div>
</div>
</div> <!-- END ROW 1 -->
<div class="row"> <!-- BEGIN ROW 2-->
<div class="col-lg-6 col-sm-6">
<div class="card">
<div class="content">
<div class="row">
<div class="col-xs-5">
<div class="icon-big icon-danger text-center">
<i class="fa fa-warning"></i>
<div class="small" align="center">Crashes</div>
</div>
</div>
<div class="col-xs-7">
<div class="numbers">
<div id="total_app_crashes"></div>
<!-- show errors API. Crashed? -->
</div>
</div>
</div>
<div class="footer">
<hr />
<div class="stats">
<i class="ti-timer"></i> In the last hour
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-6 col-sm-6">
<div class="card">
<div class="content">
<div class="row">
<div class="col-xs-5">
<div class="icon-big icon-info text-center">
<i class="ti-folder"></i>
<div class="small">Folders</div>
</div>
</div>
<div class="col-xs-7">
<div class="numbers">
<div id="total_folder_size" align="center"></div>
<div class="small" align="center" id="folder_units"></div>
<!-- Folder Analysis API here. -->
</div>
</div>
</div>
<div class="footer">
<hr />
<div class="stats">
<i class="ti-reload"></i> Updated now
</div>
</div>
</div>
</div>
</div>
</div> <!-- END ROW 2 -->
</div> <!-- END ROW FOR SMALL WIDGETS -->
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="header">
<h4 class="title">Monitoring Apps</h4>
<p class="category">performance</p>
</div>
<div class="content">
<div id="chartHours" class="ct-chart"></div>
<div class="footer">
<div class="chart-legend">
<i class="fa fa-circle text-info"></i> cpu usage
<i class="fa fa-circle text-warning"></i> memory used
<i class="fa fa-circle text-danger"></i> available line
</div>
<hr>
<div class="stats">
<i class="ti-reload"></i> Updated 3 minutes ago
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="card">
<div class="header">
<h4 class="title">Summary</h4>
<p class="category">Running|Idle|Crash</p>
</div>
<div class="content">
<div id="chartPreferences" class="ct-chart ct-perfect-fourth"></div>
<div class="footer">
<div class="chart-legend">
<i class="fa fa-circle text-info"></i> Running
<i class="fa fa-circle text-danger"></i> Crashed
<i class="fa fa-circle text-warning"></i> Idle
</div>
<hr>
<div class="stats">
<i class="ti-timer"></i> Some footer
</div>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="card ">
<div class="header">
<h4 class="title">CPU and Memory</h4>
<p class="category">Usage Trends</p>
</div>
<div class="content">
<div id="chartActivity" class="ct-chart"></div>
<div class="footer">
<div class="chart-legend">
<i class="fa fa-circle text-info"></i> CPU
<i class="fa fa-circle text-warning"></i> Memory
</div>
<hr>
<div class="stats">
<i class="ti-check"></i> Data information certified
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="container-fluid">
<nav class="pull-left">
<ul>
<li>
<a href="#">
Monitor
</a>
</li>
<li>
<a href="#">
Invy
</a>
</li>
</ul>
</nav>
</div>
</footer>
</div>
</div>
</body>
</html>

@ -1,32 +0,0 @@
<meta charset="UTF-8">
<meta http-equiv="cache-control" content="no-cache">
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1">
<script src="https://cdn.socket.io/socket.io-1.4.5.js"></script>
<!--
*
* This section is to handle predictions, i.e multivariate anomaly detection
*
-->
<div class="left border info">
<div id="predict_chart" class="left"></div>
<div class="class">
<div>
<div></div>
<div>Accuracy</div>
</div>
<div class="left">
<div id="precision">00</div>
<div class="small">Precision</div>
</div>
<div class="left">
<div id="recall">00</div>
<div class="small">Recall</div>
</div>
<div class="left">
<div id="fscore">00</div>
<div class="small"></div>
</div>
</div>
</div>

@ -1 +0,0 @@
<H1>Upgrade</Hi>
Loading…
Cancel
Save