alchemy-chimera 0.5.4 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -4
- package/assets/scripts/chimera/chimera.js +13 -288
- package/assets/stylesheets/chimera/chimera.scss +451 -0
- package/bootstrap.js +6 -302
- package/config/routes.js +53 -5
- package/controller/00-chimera_controller.js +16 -0
- package/controller/chimera_editor_controller.js +159 -614
- package/controller/chimera_static_controller.js +102 -9
- package/lib/chimera_config.js +138 -163
- package/model/model.js +1 -1
- package/package.json +8 -12
- package/view/chimera/dashboard.hwk +8 -0
- package/view/chimera/editor/index.hwk +20 -0
- package/view/chimera/sidebar.hwk +4 -0
- package/view/chimera/widgets.hwk +8 -0
- package/view/layouts/chimera_base.hwk +15 -0
- package/view/layouts/chimera_basics.hwk +15 -0
- package/view/layouts/chimera_body.hwk +24 -0
- package/assets/scripts/chimera/assoc_field.js +0 -311
- package/assets/scripts/chimera/boolean_field.js +0 -53
- package/assets/scripts/chimera/chimera_field.js +0 -622
- package/assets/scripts/chimera/chimera_field_wrapper.js +0 -558
- package/assets/scripts/chimera/date_field.js +0 -170
- package/assets/scripts/chimera/geopoint_field.js +0 -147
- package/assets/scripts/chimera/medium-button.js +0 -6
- package/assets/scripts/chimera/object_field.js +0 -51
- package/assets/scripts/chimera/page-editor.js +0 -3
- package/assets/scripts/chimera/password_field.js +0 -73
- package/assets/scripts/chimera/schema_field.js +0 -300
- package/assets/scripts/chimera/text_field.js +0 -119
- package/assets/scripts/rome/rome.js +0 -4978
- package/assets/scripts/vex/vex.dialog.js +0 -151
- package/assets/scripts/vex/vex.js +0 -193
- package/assets/stylesheets/chimera/chimera.less +0 -1075
- package/assets/stylesheets/chimera_old/chimera.less +0 -351
- package/assets/stylesheets/chimera_old/core.less +0 -315
- package/assets/stylesheets/chimera_old/font.less +0 -38
- package/assets/stylesheets/chimera_old/mixins.less +0 -35
- package/assets/stylesheets/chimera_old/page-editor.less +0 -23
- package/assets/stylesheets/rome/rome.less +0 -130
- package/assets/stylesheets/vex/vex-theme-bottom-right-corner.less +0 -613
- package/assets/stylesheets/vex/vex.default.less +0 -501
- package/assets/stylesheets/vex/vex.flat.less +0 -443
- package/assets/stylesheets/vex/vex.less +0 -320
- package/controller/chimera_page_controller.js +0 -14
- package/controller/chimera_settings_controller.js +0 -129
- package/controller/tasks_chimera_controller.js +0 -106
- package/helper/chimera_helper.js +0 -202
- package/lib/chimera_action_fields.js +0 -292
- package/lib/chimera_field/belongsto_chimera_field.js +0 -160
- package/lib/chimera_field/boolean_chimera_field.js +0 -19
- package/lib/chimera_field/date_chimera_field.js +0 -20
- package/lib/chimera_field/datetime_chimera_field.js +0 -20
- package/lib/chimera_field/enum_chimera_field.js +0 -131
- package/lib/chimera_field/geopoint_chimera_field.js +0 -20
- package/lib/chimera_field/habtm_chimera_field.js +0 -55
- package/lib/chimera_field/hasoneparent_chimera_field.js +0 -18
- package/lib/chimera_field/html_chimera_field.js +0 -20
- package/lib/chimera_field/object_chimera_field.js +0 -18
- package/lib/chimera_field/password_chimera_field.js +0 -18
- package/lib/chimera_field/schema_chimera_field.js +0 -149
- package/lib/chimera_field/text_chimera_field.js +0 -20
- package/lib/chimera_field/time_chimera_field.js +0 -18
- package/lib/chimera_field.js +0 -208
- package/model/setting_model.js +0 -51
- package/public/chimera/codedor.svg +0 -28
- package/view/chimera/dashboard.ejs +0 -5
- package/view/chimera/editor/add.ejs +0 -32
- package/view/chimera/editor/edit.ejs +0 -33
- package/view/chimera/editor/index.ejs +0 -87
- package/view/chimera/editor/remove.ejs +0 -23
- package/view/chimera/editor/view.ejs +0 -54
- package/view/chimera/elements/editor_actions.ejs +0 -4
- package/view/chimera/elements/empty +0 -0
- package/view/chimera/field_wrappers/_entries.ejs +0 -91
- package/view/chimera/field_wrappers/_wrapper.ejs +0 -82
- package/view/chimera/field_wrappers/date_edit.ejs +0 -23
- package/view/chimera/field_wrappers/date_list.ejs +0 -3
- package/view/chimera/field_wrappers/date_view.ejs +0 -16
- package/view/chimera/field_wrappers/default_edit.ejs +0 -22
- package/view/chimera/field_wrappers/default_list.ejs +0 -3
- package/view/chimera/field_wrappers/default_peek.ejs +0 -3
- package/view/chimera/field_wrappers/default_view.ejs +0 -14
- package/view/chimera/field_wrappers/geopoint_edit.ejs +0 -25
- package/view/chimera/field_wrappers/geopoint_list.ejs +0 -5
- package/view/chimera/field_wrappers/geopoint_view.ejs +0 -18
- package/view/chimera/field_wrappers/schema_edit.ejs +0 -19
- package/view/chimera/field_wrappers/text_edit.ejs +0 -22
- package/view/chimera/field_wrappers/text_list.ejs +0 -1
- package/view/chimera/fields/belongsto_edit.ejs +0 -4
- package/view/chimera/fields/belongsto_list.ejs +0 -1
- package/view/chimera/fields/belongsto_peek.ejs +0 -1
- package/view/chimera/fields/boolean_edit.ejs +0 -17
- package/view/chimera/fields/boolean_list.ejs +0 -3
- package/view/chimera/fields/boolean_view.ejs +0 -3
- package/view/chimera/fields/date_edit.ejs +0 -14
- package/view/chimera/fields/date_list.ejs +0 -9
- package/view/chimera/fields/date_peek.ejs +0 -9
- package/view/chimera/fields/date_view.ejs +0 -9
- package/view/chimera/fields/datetime_edit.ejs +0 -24
- package/view/chimera/fields/datetime_list.ejs +0 -9
- package/view/chimera/fields/datetime_view.ejs +0 -10
- package/view/chimera/fields/default_edit.ejs +0 -10
- package/view/chimera/fields/default_list.ejs +0 -15
- package/view/chimera/fields/default_view.ejs +0 -1
- package/view/chimera/fields/enum_edit.ejs +0 -10
- package/view/chimera/fields/geopoint_edit.ejs +0 -10
- package/view/chimera/fields/geopoint_list.ejs +0 -9
- package/view/chimera/fields/geopoint_view.ejs +0 -9
- package/view/chimera/fields/habtm_edit.ejs +0 -5
- package/view/chimera/fields/hasoneparent_edit.ejs +0 -6
- package/view/chimera/fields/hasoneparent_list.ejs +0 -1
- package/view/chimera/fields/object_edit.ejs +0 -8
- package/view/chimera/fields/password_edit.ejs +0 -12
- package/view/chimera/fields/schema_edit.ejs +0 -14
- package/view/chimera/fields/text_edit.ejs +0 -5
- package/view/chimera/fields/text_list.ejs +0 -9
- package/view/chimera/fields/text_view.ejs +0 -3
- package/view/chimera/fields/time_edit.ejs +0 -15
- package/view/chimera/fields/time_list.ejs +0 -9
- package/view/chimera/fields/time_view.ejs +0 -9
- package/view/chimera/page/edit.ejs +0 -18
- package/view/chimera/page_editor.ejs +0 -5
- package/view/chimera/sidebar.ejs +0 -40
- package/view/chimera/tasks/index.ejs +0 -114
- package/view/layouts/chimera.ejs +0 -12
- package/view/layouts/chimera_base.ejs +0 -11
- package/view/layouts/chimera_body.ejs +0 -43
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
(function() {
|
|
2
|
-
var vexDialogFactory;
|
|
3
|
-
|
|
4
|
-
vexDialogFactory = function($, vex) {
|
|
5
|
-
var $formToObject, dialog;
|
|
6
|
-
if (vex == null) {
|
|
7
|
-
return $.error('Vex is required to use vex.dialog');
|
|
8
|
-
}
|
|
9
|
-
$formToObject = function($form) {
|
|
10
|
-
var object;
|
|
11
|
-
object = {};
|
|
12
|
-
$.each($form.serializeArray(), function() {
|
|
13
|
-
if (object[this.name]) {
|
|
14
|
-
if (!object[this.name].push) {
|
|
15
|
-
object[this.name] = [object[this.name]];
|
|
16
|
-
}
|
|
17
|
-
return object[this.name].push(this.value || '');
|
|
18
|
-
} else {
|
|
19
|
-
return object[this.name] = this.value || '';
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
return object;
|
|
23
|
-
};
|
|
24
|
-
dialog = {};
|
|
25
|
-
dialog.buttons = {
|
|
26
|
-
YES: {
|
|
27
|
-
text: 'OK',
|
|
28
|
-
type: 'submit',
|
|
29
|
-
className: 'vex-dialog-button-primary'
|
|
30
|
-
},
|
|
31
|
-
NO: {
|
|
32
|
-
text: 'Cancel',
|
|
33
|
-
type: 'button',
|
|
34
|
-
className: 'vex-dialog-button-secondary',
|
|
35
|
-
click: function($vexContent, event) {
|
|
36
|
-
$vexContent.data().vex.value = false;
|
|
37
|
-
return vex.close($vexContent.data().vex.id);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
dialog.defaultOptions = {
|
|
42
|
-
callback: function(value) {},
|
|
43
|
-
afterOpen: function() {},
|
|
44
|
-
message: 'Message',
|
|
45
|
-
input: "<input name=\"vex\" type=\"hidden\" value=\"_vex-empty-value\" />",
|
|
46
|
-
value: false,
|
|
47
|
-
buttons: [dialog.buttons.YES, dialog.buttons.NO],
|
|
48
|
-
showCloseButton: false,
|
|
49
|
-
onSubmit: function(event) {
|
|
50
|
-
var $form, $vexContent;
|
|
51
|
-
$form = $(this);
|
|
52
|
-
$vexContent = $form.parent();
|
|
53
|
-
event.preventDefault();
|
|
54
|
-
event.stopPropagation();
|
|
55
|
-
$vexContent.data().vex.value = dialog.getFormValueOnSubmit($formToObject($form));
|
|
56
|
-
return vex.close($vexContent.data().vex.id);
|
|
57
|
-
},
|
|
58
|
-
focusFirstInput: true
|
|
59
|
-
};
|
|
60
|
-
dialog.defaultAlertOptions = {
|
|
61
|
-
message: 'Alert',
|
|
62
|
-
buttons: [dialog.buttons.YES]
|
|
63
|
-
};
|
|
64
|
-
dialog.defaultConfirmOptions = {
|
|
65
|
-
message: 'Confirm'
|
|
66
|
-
};
|
|
67
|
-
dialog.open = function(options) {
|
|
68
|
-
var $vexContent;
|
|
69
|
-
options = $.extend({}, vex.defaultOptions, dialog.defaultOptions, options);
|
|
70
|
-
options.content = dialog.buildDialogForm(options);
|
|
71
|
-
options.beforeClose = function($vexContent) {
|
|
72
|
-
return options.callback($vexContent.data().vex.value);
|
|
73
|
-
};
|
|
74
|
-
$vexContent = vex.open(options);
|
|
75
|
-
if (options.focusFirstInput) {
|
|
76
|
-
$vexContent.find('input[type="submit"], textarea, input[type="date"], input[type="datetime"], input[type="datetime-local"], input[type="email"], input[type="month"], input[type="number"], input[type="password"], input[type="search"], input[type="tel"], input[type="text"], input[type="time"], input[type="url"], input[type="week"]').first().focus();
|
|
77
|
-
}
|
|
78
|
-
return $vexContent;
|
|
79
|
-
};
|
|
80
|
-
dialog.alert = function(options) {
|
|
81
|
-
if (typeof options === 'string') {
|
|
82
|
-
options = {
|
|
83
|
-
message: options
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
options = $.extend({}, dialog.defaultAlertOptions, options);
|
|
87
|
-
return dialog.open(options);
|
|
88
|
-
};
|
|
89
|
-
dialog.confirm = function(options) {
|
|
90
|
-
if (typeof options === 'string') {
|
|
91
|
-
return $.error('dialog.confirm(options) requires options.callback.');
|
|
92
|
-
}
|
|
93
|
-
options = $.extend({}, dialog.defaultConfirmOptions, options);
|
|
94
|
-
return dialog.open(options);
|
|
95
|
-
};
|
|
96
|
-
dialog.prompt = function(options) {
|
|
97
|
-
var defaultPromptOptions;
|
|
98
|
-
if (typeof options === 'string') {
|
|
99
|
-
return $.error('dialog.prompt(options) requires options.callback.');
|
|
100
|
-
}
|
|
101
|
-
defaultPromptOptions = {
|
|
102
|
-
message: "<label for=\"vex\">" + (options.label || 'Prompt:') + "</label>",
|
|
103
|
-
input: "<input name=\"vex\" type=\"text\" class=\"vex-dialog-prompt-input\" placeholder=\"" + (options.placeholder || '') + "\" value=\"" + (options.value || '') + "\" />"
|
|
104
|
-
};
|
|
105
|
-
options = $.extend({}, defaultPromptOptions, options);
|
|
106
|
-
return dialog.open(options);
|
|
107
|
-
};
|
|
108
|
-
dialog.buildDialogForm = function(options) {
|
|
109
|
-
var $form, $input, $message;
|
|
110
|
-
$form = $('<form class="vex-dialog-form" />');
|
|
111
|
-
$message = $('<div class="vex-dialog-message" />');
|
|
112
|
-
$input = $('<div class="vex-dialog-input" />');
|
|
113
|
-
$form.append($message.append(options.message)).append($input.append(options.input)).append(dialog.buttonsToDOM(options.buttons)).bind('submit.vex', options.onSubmit);
|
|
114
|
-
return $form;
|
|
115
|
-
};
|
|
116
|
-
dialog.getFormValueOnSubmit = function(formData) {
|
|
117
|
-
if (formData.vex || formData.vex === '') {
|
|
118
|
-
if (formData.vex === '_vex-empty-value') {
|
|
119
|
-
return true;
|
|
120
|
-
}
|
|
121
|
-
return formData.vex;
|
|
122
|
-
} else {
|
|
123
|
-
return formData;
|
|
124
|
-
}
|
|
125
|
-
};
|
|
126
|
-
dialog.buttonsToDOM = function(buttons) {
|
|
127
|
-
var $buttons;
|
|
128
|
-
$buttons = $('<div class="vex-dialog-buttons" />');
|
|
129
|
-
$.each(buttons, function(index, button) {
|
|
130
|
-
var $button;
|
|
131
|
-
$button = $("<input type=\"" + button.type + "\" />").val(button.text).addClass(button.className + ' vex-dialog-button ' + (index === 0 ? 'vex-first ' : '') + (index === buttons.length - 1 ? 'vex-last ' : '')).bind('click.vex', function(e) {
|
|
132
|
-
if (button.click) {
|
|
133
|
-
return button.click($(this).parents("." + vex.baseClassNames.content), e);
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
return $button.appendTo($buttons);
|
|
137
|
-
});
|
|
138
|
-
return $buttons;
|
|
139
|
-
};
|
|
140
|
-
return dialog;
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
if (typeof define === 'function' && define.amd) {
|
|
144
|
-
define(['jquery', 'vex'], vexDialogFactory);
|
|
145
|
-
} else if (typeof exports === 'object') {
|
|
146
|
-
module.exports = vexDialogFactory(require('jquery'), require('./vex.js'));
|
|
147
|
-
} else {
|
|
148
|
-
window.vex.dialog = vexDialogFactory(window.jQuery, window.vex);
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
}).call(this);
|
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
(function() {
|
|
2
|
-
|
|
3
|
-
var vexFactory;
|
|
4
|
-
|
|
5
|
-
vexFactory = function($) {
|
|
6
|
-
var animationEndSupport, vex;
|
|
7
|
-
animationEndSupport = false;
|
|
8
|
-
$(function() {
|
|
9
|
-
var s;
|
|
10
|
-
s = (document.body || document.documentElement).style;
|
|
11
|
-
animationEndSupport = s.animation !== void 0 || s.WebkitAnimation !== void 0 || s.MozAnimation !== void 0 || s.MsAnimation !== void 0 || s.OAnimation !== void 0;
|
|
12
|
-
return $(window).bind('keyup.vex', function(event) {
|
|
13
|
-
if (event.keyCode === 27) {
|
|
14
|
-
return vex.closeByEscape();
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
});
|
|
18
|
-
return vex = {
|
|
19
|
-
globalID: 1,
|
|
20
|
-
animationEndEvent: 'animationend webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend',
|
|
21
|
-
baseClassNames: {
|
|
22
|
-
vex: 'vex',
|
|
23
|
-
content: 'vex-content',
|
|
24
|
-
overlay: 'vex-overlay',
|
|
25
|
-
close: 'vex-close',
|
|
26
|
-
closing: 'vex-closing',
|
|
27
|
-
open: 'vex-open'
|
|
28
|
-
},
|
|
29
|
-
defaultOptions: {
|
|
30
|
-
content: '',
|
|
31
|
-
showCloseButton: true,
|
|
32
|
-
escapeButtonCloses: true,
|
|
33
|
-
overlayClosesOnClick: true,
|
|
34
|
-
appendLocation: 'body',
|
|
35
|
-
className: '',
|
|
36
|
-
css: {},
|
|
37
|
-
overlayClassName: '',
|
|
38
|
-
overlayCSS: {},
|
|
39
|
-
contentClassName: '',
|
|
40
|
-
contentCSS: {},
|
|
41
|
-
closeClassName: '',
|
|
42
|
-
closeCSS: {}
|
|
43
|
-
},
|
|
44
|
-
open: function(options) {
|
|
45
|
-
options = $.extend({}, vex.defaultOptions, options);
|
|
46
|
-
options.id = vex.globalID;
|
|
47
|
-
vex.globalID += 1;
|
|
48
|
-
options.$vex = $('<div>').addClass(vex.baseClassNames.vex).addClass(options.className).css(options.css).data({
|
|
49
|
-
vex: options
|
|
50
|
-
});
|
|
51
|
-
options.$vexOverlay = $('<div>').addClass(vex.baseClassNames.overlay).addClass(options.overlayClassName).css(options.overlayCSS).data({
|
|
52
|
-
vex: options
|
|
53
|
-
});
|
|
54
|
-
if (options.overlayClosesOnClick) {
|
|
55
|
-
options.$vexOverlay.bind('click.vex', function(e) {
|
|
56
|
-
if (e.target !== this) {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
return vex.close($(this).data().vex.id);
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
options.$vex.append(options.$vexOverlay);
|
|
63
|
-
options.$vexContent = $('<div>').addClass(vex.baseClassNames.content).addClass(options.contentClassName).css(options.contentCSS).append(options.content).data({
|
|
64
|
-
vex: options
|
|
65
|
-
});
|
|
66
|
-
options.$vex.append(options.$vexContent);
|
|
67
|
-
if (options.showCloseButton) {
|
|
68
|
-
options.$closeButton = $('<div>').addClass(vex.baseClassNames.close).addClass(options.closeClassName).css(options.closeCSS).data({
|
|
69
|
-
vex: options
|
|
70
|
-
}).bind('click.vex', function() {
|
|
71
|
-
return vex.close($(this).data().vex.id);
|
|
72
|
-
});
|
|
73
|
-
options.$vexContent.append(options.$closeButton);
|
|
74
|
-
}
|
|
75
|
-
$(options.appendLocation).append(options.$vex);
|
|
76
|
-
vex.setupBodyClassName(options.$vex);
|
|
77
|
-
if (options.afterOpen) {
|
|
78
|
-
options.afterOpen(options.$vexContent, options);
|
|
79
|
-
}
|
|
80
|
-
setTimeout((function() {
|
|
81
|
-
return options.$vexContent.trigger('vexOpen', options);
|
|
82
|
-
}), 0);
|
|
83
|
-
return options.$vexContent;
|
|
84
|
-
},
|
|
85
|
-
getAllVexes: function() {
|
|
86
|
-
return $("." + vex.baseClassNames.vex + ":not(\"." + vex.baseClassNames.closing + "\") ." + vex.baseClassNames.content);
|
|
87
|
-
},
|
|
88
|
-
getVexByID: function(id) {
|
|
89
|
-
return vex.getAllVexes().filter(function() {
|
|
90
|
-
return $(this).data().vex.id === id;
|
|
91
|
-
});
|
|
92
|
-
},
|
|
93
|
-
close: function(id) {
|
|
94
|
-
var $lastVex;
|
|
95
|
-
if (!id) {
|
|
96
|
-
$lastVex = vex.getAllVexes().last();
|
|
97
|
-
if (!$lastVex.length) {
|
|
98
|
-
return false;
|
|
99
|
-
}
|
|
100
|
-
id = $lastVex.data().vex.id;
|
|
101
|
-
}
|
|
102
|
-
return vex.closeByID(id);
|
|
103
|
-
},
|
|
104
|
-
closeAll: function() {
|
|
105
|
-
var ids;
|
|
106
|
-
ids = vex.getAllVexes().map(function() {
|
|
107
|
-
return $(this).data().vex.id;
|
|
108
|
-
}).toArray();
|
|
109
|
-
if (!(ids != null ? ids.length : void 0)) {
|
|
110
|
-
return false;
|
|
111
|
-
}
|
|
112
|
-
$.each(ids.reverse(), function(index, id) {
|
|
113
|
-
return vex.closeByID(id);
|
|
114
|
-
});
|
|
115
|
-
return true;
|
|
116
|
-
},
|
|
117
|
-
closeByID: function(id) {
|
|
118
|
-
var $vex, $vexContent, beforeClose, close, options;
|
|
119
|
-
$vexContent = vex.getVexByID(id);
|
|
120
|
-
if (!$vexContent.length) {
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
$vex = $vexContent.data().vex.$vex;
|
|
124
|
-
options = $.extend({}, $vexContent.data().vex);
|
|
125
|
-
beforeClose = function() {
|
|
126
|
-
if (options.beforeClose) {
|
|
127
|
-
return options.beforeClose($vexContent, options);
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
close = function() {
|
|
131
|
-
$vexContent.trigger('vexClose', options);
|
|
132
|
-
$vex.remove();
|
|
133
|
-
$('body').trigger('vexAfterClose', options);
|
|
134
|
-
if (options.afterClose) {
|
|
135
|
-
return options.afterClose($vexContent, options);
|
|
136
|
-
}
|
|
137
|
-
};
|
|
138
|
-
if (animationEndSupport) {
|
|
139
|
-
beforeClose();
|
|
140
|
-
$vex.unbind(vex.animationEndEvent).bind(vex.animationEndEvent, function() {
|
|
141
|
-
return close();
|
|
142
|
-
}).addClass(vex.baseClassNames.closing);
|
|
143
|
-
} else {
|
|
144
|
-
beforeClose();
|
|
145
|
-
close();
|
|
146
|
-
}
|
|
147
|
-
return true;
|
|
148
|
-
},
|
|
149
|
-
closeByEscape: function() {
|
|
150
|
-
var $lastVex, id, ids;
|
|
151
|
-
ids = vex.getAllVexes().map(function() {
|
|
152
|
-
return $(this).data().vex.id;
|
|
153
|
-
}).toArray();
|
|
154
|
-
if (!(ids != null ? ids.length : void 0)) {
|
|
155
|
-
return false;
|
|
156
|
-
}
|
|
157
|
-
id = Math.max.apply(Math, ids);
|
|
158
|
-
$lastVex = vex.getVexByID(id);
|
|
159
|
-
if ($lastVex.data().vex.escapeButtonCloses !== true) {
|
|
160
|
-
return false;
|
|
161
|
-
}
|
|
162
|
-
return vex.closeByID(id);
|
|
163
|
-
},
|
|
164
|
-
setupBodyClassName: function($vex) {
|
|
165
|
-
return $('body').bind('vexOpen.vex', function() {
|
|
166
|
-
return $('body').addClass(vex.baseClassNames.open);
|
|
167
|
-
}).bind('vexAfterClose.vex', function() {
|
|
168
|
-
if (!vex.getAllVexes().length) {
|
|
169
|
-
return $('body').removeClass(vex.baseClassNames.open);
|
|
170
|
-
}
|
|
171
|
-
});
|
|
172
|
-
},
|
|
173
|
-
hideLoading: function() {
|
|
174
|
-
return $('.vex-loading-spinner').remove();
|
|
175
|
-
},
|
|
176
|
-
showLoading: function() {
|
|
177
|
-
vex.hideLoading();
|
|
178
|
-
return $('body').append("<div class=\"vex-loading-spinner " + vex.defaultOptions.className + "\"></div>");
|
|
179
|
-
}
|
|
180
|
-
};
|
|
181
|
-
};
|
|
182
|
-
|
|
183
|
-
if (typeof define === 'function' && define.amd) {
|
|
184
|
-
define(['jquery'], vexFactory);
|
|
185
|
-
} else if (typeof exports === 'object') {
|
|
186
|
-
module.exports = vexFactory(require('jquery'));
|
|
187
|
-
} else {
|
|
188
|
-
window.vex = vexFactory(jQuery);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
vex.defaultOptions.className = 'vex-theme-flat-attack';
|
|
192
|
-
hawkejs.require('vex/vex.dialog');
|
|
193
|
-
}());
|