public static void Main()
var localize = function (key) {
return abp.localization.getResource('AbpUi')(key);
/* A simple jQuery plug-in to make a button busy. */
$.fn.buttonBusy = function (isBusy) {
return $(this).each(function () {
var $icon = $button.find('i');
var $buttonInnerSpan = $button.find('span');
if (isBusy === undefined) {
if ($button.hasClass('button-busy')) {
$button.attr('disabled', 'disabled');
$button.data('iconOriginalClasses', $icon.attr('class'));
$icon.addClass('fa fa-spin fa-spinner');
if ($buttonInnerSpan.length && $button.attr('data-busy-text')) {
$button.data('buttonOriginalText', $buttonInnerSpan.html());
if ($button.data('busy-text-is-html')) {
$buttonInnerSpan.html($button.attr('data-busy-text'));
$buttonInnerSpan.text($button.attr('data-busy-text'));
$button.addClass('button-busy');
if (!$button.hasClass('button-busy')) {
$button.removeAttr('disabled');
if ($icon.length && $button.data('iconOriginalClasses')) {
$icon.addClass($button.data('iconOriginalClasses'));
if ($buttonInnerSpan.length && $button.data('buttonOriginalText')) {
$buttonInnerSpan.html($button.data('buttonOriginalText'));
$button.removeClass('button-busy');
var toCamelCase = function (str) {
/(^[A-Z])/, // first char of string
/((\.)[A-Z])/ // first char after a dot (.)
while (regex.test(str)) {
.replace(regex, function ($1) { return $1.toLowerCase(); });
if (infLoopAvoider++ > 1000) {
$.fn.serializeFormToObject = function (camelCase) {
var data = $(this).serializeArray();
// add unchecked checkboxes because serializeArray ignores them
$(this).find('input[type=checkbox]').each(function () {
if (!$(this).is(':checked')) {
data.push({name: this.name, value: this.checked});
//add also disabled items
$(':disabled[name]', this)
if ($(this).is(':checkbox')) {
value = $(this).is(':checked');
data.push({ name: this.name, value: value });
if (camelCase !== undefined ? camelCase : true) {
data.forEach(function (d) {
d.name = toCamelCase(d.name);
var getNames = function (index, variable) {
for (var i = 0; i <= index; i++) {
name = variable + '[' + i + ']'
name += '][' + variable + '[' + i + ']'
var names = x.name.split('.');
for (var i = 0; i < names.length; i++) {
if (eval('!obj[' + getNames(i, 'names') + ']')) {
eval('obj[' + getNames(i, 'names') + '] = {}');
if ($.isEmptyObject(eval('obj[' + getNames(names.length - 1, 'names') + ']'))) {
eval('obj[' + getNames(names.length - 1, 'names') + '] = x.value');
$.fn.focusEndOfText = function () {
return this.each(function () {
$this[0].selectionStart = $this[0].selectionEnd = 10000;
$.fn.needConfirmationOnUnsavedClose = function ($modal) {
var unEditedForm = JSON.stringify($form.serializeFormToObject());
$modal.on('hide.bs.modal', function (e) {
var currentForm = JSON.stringify($form.serializeFormToObject());
var thereAreUnsavedChanges = currentForm !== unEditedForm;
if (!formSaved && thereAreUnsavedChanges) {
abp.message.confirm(localize('AreYouSureYouWantToCancelEditingWarningMessage'),
$(this).on('abp-ajax-success', function () {
var wrongDefineUgly = Uglify.Js(wrongDefine);
Console.WriteLine(wrongDefineUgly);