alchemymvc 1.3.21 → 1.4.0-alpha.1
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/LICENSE +1 -1
- package/README.md +3 -3
- package/lib/app/behaviour/publishable_behaviour.js +5 -5
- package/lib/app/behaviour/revision_behaviour.js +10 -10
- package/lib/app/behaviour/sluggable_behaviour.js +14 -14
- package/lib/app/conduit/electron_conduit.js +9 -9
- package/lib/app/conduit/http_conduit.js +13 -13
- package/lib/app/conduit/loopback_conduit.js +15 -15
- package/lib/app/conduit/socket_conduit.js +43 -43
- package/lib/app/config/routes.js +26 -0
- package/lib/app/controller/00-default_app_controller.js +21 -0
- package/lib/app/controller/alchemy_info_controller.js +12 -12
- package/lib/app/datasource/mongo_datasource.js +16 -16
- package/lib/app/element/00-default_app_element.js +19 -0
- package/lib/app/element/time_ago.js +5 -5
- package/lib/app/helper/00-default_app_helper.js +11 -0
- package/lib/app/helper/alchemy_helper.js +22 -22
- package/lib/app/helper/backed_map.js +1 -1
- package/lib/app/helper/breadcrumb.js +10 -10
- package/lib/app/helper/client_collection.js +3 -3
- package/lib/app/helper/cron.js +29 -29
- package/lib/app/helper/enum_values.js +6 -6
- package/lib/app/helper/pagination_helper.js +36 -36
- package/lib/app/helper/router_helper.js +35 -35
- package/lib/app/helper/socket_helper.js +57 -57
- package/lib/app/helper/syncable.js +84 -59
- package/lib/app/helper_component/paginate_component.js +9 -9
- package/lib/app/helper_controller/component.js +1 -1
- package/lib/app/helper_controller/conduit.js +31 -31
- package/lib/app/helper_controller/controller.js +54 -39
- package/lib/app/helper_datasource/00-nosql_datasource.js +624 -70
- package/lib/app/helper_datasource/05-fallback_datasource.js +10 -10
- package/lib/app/helper_datasource/idb_datasource.js +6 -6
- package/lib/app/helper_datasource/indexed_db.js +22 -22
- package/lib/app/helper_datasource/remote_datasource.js +5 -5
- package/lib/app/helper_error/http_error.js +4 -4
- package/lib/app/helper_error/model_error.js +2 -2
- package/lib/app/helper_error/validation_error.js +12 -12
- package/lib/app/helper_field/00-objectid_field.js +7 -7
- package/lib/app/helper_field/05-string_field.js +16 -12
- package/lib/app/helper_field/06-text_field.js +2 -4
- package/lib/app/helper_field/10-number_field.js +9 -12
- package/lib/app/helper_field/11-date_field.js +15 -15
- package/lib/app/helper_field/15-local_temporal_field.js +10 -10
- package/lib/app/helper_field/20-decimal_field.js +8 -9
- package/lib/app/helper_field/belongsto_field.js +1 -1
- package/lib/app/helper_field/big_int_field.js +8 -8
- package/lib/app/helper_field/boolean_field.js +9 -11
- package/lib/app/helper_field/datetime_field.js +3 -3
- package/lib/app/helper_field/enum_field.js +13 -8
- package/lib/app/helper_field/fixed_decimal_field.js +6 -7
- package/lib/app/helper_field/geopoint_field.js +9 -10
- package/lib/app/helper_field/habtm_field.js +3 -3
- package/lib/app/helper_field/hasoneparent_field.js +1 -1
- package/lib/app/helper_field/html_field.js +2 -4
- package/lib/app/helper_field/integer_field.js +8 -11
- package/lib/app/helper_field/local_date_field.js +5 -5
- package/lib/app/helper_field/local_date_time_field.js +5 -5
- package/lib/app/helper_field/local_time_field.js +5 -5
- package/lib/app/helper_field/mixed_field.js +5 -5
- package/lib/app/helper_field/object_field.js +8 -8
- package/lib/app/helper_field/password_field.js +3 -3
- package/lib/app/helper_field/regexp_field.js +7 -9
- package/lib/app/helper_field/schema_field.js +91 -88
- package/lib/app/helper_field/settings_field.js +92 -0
- package/lib/app/helper_field/time_field.js +6 -6
- package/lib/app/helper_field/url_field.js +2 -4
- package/lib/app/helper_model/00-base_criteria.js +662 -0
- package/lib/app/helper_model/05-criteria_expressions.js +605 -0
- package/lib/app/helper_model/10-model_criteria.js +1182 -0
- package/lib/app/helper_model/data_provider.js +2 -2
- package/lib/app/helper_model/document.js +103 -92
- package/lib/app/helper_model/document_list.js +14 -14
- package/lib/app/helper_model/field_config.js +11 -11
- package/lib/app/helper_model/field_set.js +17 -17
- package/lib/app/helper_model/model.js +203 -124
- package/lib/app/helper_model/remote_data_provider.js +2 -2
- package/lib/app/helper_validator/00_validator.js +16 -16
- package/lib/app/helper_validator/not_empty_validator.js +9 -9
- package/lib/app/model/00-default_app_model.js +18 -0
- package/lib/app/model/05-system_model.js +27 -0
- package/lib/app/model/{alchemy_migration_model.js → system_migration_model.js} +4 -4
- package/lib/app/model/system_setting_model.js +154 -0
- package/lib/app/model/{alchemy_task_history_model.js → system_task_history_model.js} +7 -7
- package/lib/app/model/{alchemy_task_model.js → system_task_model.js} +11 -11
- package/lib/bootstrap.js +22 -312
- package/lib/class/accumulator.js +5 -5
- package/lib/class/behaviour.js +5 -5
- package/lib/class/component.js +3 -3
- package/lib/class/conduit.js +203 -163
- package/lib/class/controller.js +42 -42
- package/lib/class/datasource.js +74 -79
- package/lib/class/document.js +74 -95
- package/lib/class/document_list.js +5 -5
- package/lib/class/element.js +17 -17
- package/lib/class/error.js +3 -3
- package/lib/class/field.js +169 -91
- package/lib/class/field_value.js +6 -6
- package/lib/class/helper.js +3 -3
- package/lib/class/inode.js +17 -17
- package/lib/class/inode_dir.js +12 -12
- package/lib/class/inode_file.js +50 -25
- package/lib/class/inode_list.js +4 -4
- package/lib/class/migration.js +4 -4
- package/lib/class/model.js +182 -168
- package/lib/class/path_definition.js +22 -22
- package/lib/class/path_evaluator.js +5 -5
- package/lib/class/path_param_definition.js +7 -7
- package/lib/class/plugin.js +312 -0
- package/lib/class/postponement.js +29 -29
- package/lib/class/reciprocal.js +8 -8
- package/lib/class/route.js +33 -33
- package/lib/class/router.js +73 -73
- package/lib/class/schema.js +21 -21
- package/lib/class/schema_client.js +73 -67
- package/lib/class/session.js +63 -29
- package/lib/class/session_scene.js +4 -4
- package/lib/class/sitemap.js +16 -16
- package/lib/class/task.js +39 -39
- package/lib/class/task_service.js +43 -47
- package/lib/{init → core}/alchemy.js +413 -374
- package/lib/{init/functions.js → core/alchemy_functions.js} +171 -108
- package/lib/core/alchemy_load_functions.js +715 -0
- package/lib/core/base.js +50 -62
- package/lib/core/client_alchemy.js +144 -152
- package/lib/core/client_base.js +39 -52
- package/lib/core/discovery.js +16 -18
- package/lib/core/middleware.js +54 -43
- package/lib/core/{routing.js → prefix.js} +14 -16
- package/lib/core/setting.js +1684 -0
- package/lib/core/stage.js +758 -0
- package/lib/scripts/create_constants.js +119 -0
- package/lib/{init/languages.js → scripts/create_languages.js} +5 -5
- package/lib/scripts/create_settings.js +449 -0
- package/lib/scripts/create_shared_constants.js +95 -0
- package/lib/scripts/create_stages.js +55 -0
- package/lib/scripts/init_alchemy.js +51 -0
- package/lib/{init/requirements.js → scripts/preload_modules.js} +15 -2
- package/lib/scripts/setup_devwatch.js +238 -0
- package/lib/stages/00-load_core.js +342 -0
- package/lib/stages/05-load_app.js +57 -0
- package/lib/stages/10-datasource.js +61 -0
- package/lib/stages/15-tasks.js +27 -0
- package/lib/stages/20-settings.js +68 -0
- package/lib/stages/50-routes.js +218 -0
- package/lib/stages/90-server.js +347 -0
- package/package.json +5 -7
- package/lib/app/helper_model/criteria.js +0 -2294
- package/lib/app/helper_model/db_query.js +0 -1488
- package/lib/app/routes.js +0 -11
- package/lib/core/socket.js +0 -171
- package/lib/init/constants.js +0 -158
- package/lib/init/devwatch.js +0 -238
- package/lib/init/load_functions.js +0 -973
- package/lib/stages.js +0 -513
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @constructor
|
|
5
5
|
*
|
|
6
|
-
* @author Jelle De Loecker
|
|
6
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
7
7
|
* @since 1.3.8
|
|
8
8
|
* @version 1.3.8
|
|
9
9
|
*
|
|
10
|
-
* @param {
|
|
10
|
+
* @param {string} input
|
|
11
11
|
*/
|
|
12
12
|
const Breadcrumb = Function.inherits('Alchemy.Base', function Breadcrumb(input) {
|
|
13
13
|
|
|
@@ -21,11 +21,11 @@ const Breadcrumb = Function.inherits('Alchemy.Base', function Breadcrumb(input)
|
|
|
21
21
|
/**
|
|
22
22
|
* Get the number of trails
|
|
23
23
|
*
|
|
24
|
-
* @author Jelle De Loecker
|
|
24
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
25
25
|
* @since 1.3.8
|
|
26
26
|
* @version 1.3.8
|
|
27
27
|
*
|
|
28
|
-
* @return {
|
|
28
|
+
* @return {number}
|
|
29
29
|
*/
|
|
30
30
|
Breadcrumb.setProperty(function length() {
|
|
31
31
|
return this.trails.length;
|
|
@@ -34,11 +34,11 @@ Breadcrumb.setProperty(function length() {
|
|
|
34
34
|
/**
|
|
35
35
|
* Add a breadcrumb trail
|
|
36
36
|
*
|
|
37
|
-
* @author Jelle De Loecker
|
|
37
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
38
38
|
* @since 1.3.8
|
|
39
39
|
* @version 1.3.8
|
|
40
40
|
*
|
|
41
|
-
* @param {
|
|
41
|
+
* @param {string} input
|
|
42
42
|
*/
|
|
43
43
|
Breadcrumb.setMethod(function addTrail(input) {
|
|
44
44
|
|
|
@@ -94,7 +94,7 @@ Breadcrumb.setMethod(function addTrail(input) {
|
|
|
94
94
|
/**
|
|
95
95
|
* Do these 2 breadcrumbs match loosely?
|
|
96
96
|
*
|
|
97
|
-
* @author Jelle De Loecker
|
|
97
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
98
98
|
* @since 1.3.8
|
|
99
99
|
* @version 1.3.8
|
|
100
100
|
*
|
|
@@ -107,13 +107,13 @@ Breadcrumb.setMethod(function matches(other) {
|
|
|
107
107
|
/**
|
|
108
108
|
* What leven of match is there between these 2 breadcrumbs?
|
|
109
109
|
*
|
|
110
|
-
* @author Jelle De Loecker
|
|
110
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
111
111
|
* @since 1.3.8
|
|
112
112
|
* @version 1.3.8
|
|
113
113
|
*
|
|
114
114
|
* @param {Alchemy.Breadcrumb} other
|
|
115
115
|
*
|
|
116
|
-
* @return {
|
|
116
|
+
* @return {number} 1 for a strict match, 2 for a loose match
|
|
117
117
|
*/
|
|
118
118
|
Breadcrumb.setMethod(function matchLevel(other) {
|
|
119
119
|
|
|
@@ -147,7 +147,7 @@ Breadcrumb.setMethod(function matchLevel(other) {
|
|
|
147
147
|
/**
|
|
148
148
|
* Turn it into a string
|
|
149
149
|
*
|
|
150
|
-
* @author Jelle De Loecker
|
|
150
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
151
151
|
* @since 1.3.8
|
|
152
152
|
* @version 1.3.8
|
|
153
153
|
*/
|
|
@@ -6,11 +6,11 @@ if (Blast.isNode) {
|
|
|
6
6
|
/**
|
|
7
7
|
* The ClientCollection class
|
|
8
8
|
*
|
|
9
|
-
* @author Jelle De Loecker
|
|
9
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
10
10
|
* @since 1.0.0
|
|
11
11
|
* @version 1.0.0
|
|
12
12
|
*
|
|
13
|
-
* @param {
|
|
13
|
+
* @param {string} name
|
|
14
14
|
*/
|
|
15
15
|
var ClientCollection = Blast.Bound.Function.inherits('Alchemy.Base', function ClientCollection(name) {
|
|
16
16
|
|
|
@@ -24,7 +24,7 @@ var ClientCollection = Blast.Bound.Function.inherits('Alchemy.Base', function Cl
|
|
|
24
24
|
/**
|
|
25
25
|
* Initialize the connection
|
|
26
26
|
*
|
|
27
|
-
* @author Jelle De Loecker <jelle@
|
|
27
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
28
28
|
* @since 1.0.0
|
|
29
29
|
* @version 1.0.0
|
|
30
30
|
*/
|
package/lib/app/helper/cron.js
CHANGED
|
@@ -54,7 +54,7 @@ const FIELD_INFO = {
|
|
|
54
54
|
* The Cron class:
|
|
55
55
|
* Represents a Cron frequency
|
|
56
56
|
*
|
|
57
|
-
* @author Jelle De Loecker
|
|
57
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
58
58
|
* @since 1.3.17
|
|
59
59
|
* @version 1.3.17
|
|
60
60
|
*/
|
|
@@ -95,13 +95,13 @@ Cron.setStatic('PREDEFINED_EXPRESSIONS', {
|
|
|
95
95
|
/**
|
|
96
96
|
* Undry this value
|
|
97
97
|
*
|
|
98
|
-
* @author Jelle De Loecker
|
|
98
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
99
99
|
* @since 1.3.17
|
|
100
100
|
* @version 1.3.17
|
|
101
101
|
*
|
|
102
|
-
* @param
|
|
102
|
+
* @param {Object} data
|
|
103
103
|
*
|
|
104
|
-
* @return
|
|
104
|
+
* @return {Cron}
|
|
105
105
|
*/
|
|
106
106
|
Cron.setStatic(function unDry(data) {
|
|
107
107
|
let result = new Cron(data.input, data.options);
|
|
@@ -111,7 +111,7 @@ Cron.setStatic(function unDry(data) {
|
|
|
111
111
|
/**
|
|
112
112
|
* Serialize this cron instance
|
|
113
113
|
*
|
|
114
|
-
* @author Jelle De Loecker
|
|
114
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
115
115
|
* @since 1.3.17
|
|
116
116
|
* @version 1.3.17
|
|
117
117
|
*/
|
|
@@ -151,7 +151,7 @@ Cron.setMethod(function parse(input) {
|
|
|
151
151
|
* @since 1.3.17
|
|
152
152
|
* @version 1.3.17
|
|
153
153
|
*
|
|
154
|
-
* @param {
|
|
154
|
+
* @param {string} expression
|
|
155
155
|
*
|
|
156
156
|
* @return {Cron.Expression}
|
|
157
157
|
*/
|
|
@@ -245,7 +245,7 @@ Cron.setMethod(function matches(date) {
|
|
|
245
245
|
* The CronExpression:
|
|
246
246
|
* This represents a single Cron frequency expression
|
|
247
247
|
*
|
|
248
|
-
* @author Jelle De Loecker
|
|
248
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
249
249
|
* @since 1.3.17
|
|
250
250
|
* @version 1.3.17
|
|
251
251
|
*/
|
|
@@ -674,7 +674,7 @@ CronExpression.setMethod(function parseLastDays(field, value) {
|
|
|
674
674
|
* @version 1.3.17
|
|
675
675
|
*
|
|
676
676
|
* @param {Date} current_date
|
|
677
|
-
* @param {
|
|
677
|
+
* @param {boolean} add_one_second When false, the current date might be returned
|
|
678
678
|
*
|
|
679
679
|
* @return {Date}
|
|
680
680
|
*/
|
|
@@ -731,7 +731,7 @@ CronExpression.setMethod(function getNextDate(current_date, add_one_second = tru
|
|
|
731
731
|
*
|
|
732
732
|
* @param {Date} date
|
|
733
733
|
* @param {Object} config
|
|
734
|
-
* @param {
|
|
734
|
+
* @param {string} unit
|
|
735
735
|
*/
|
|
736
736
|
CronExpression.setMethod(function _modifyDate(date) {
|
|
737
737
|
|
|
@@ -792,7 +792,7 @@ CronExpression.setMethod(function _modifyDate(date) {
|
|
|
792
792
|
*
|
|
793
793
|
* @param {Date} date
|
|
794
794
|
* @param {Object} config
|
|
795
|
-
* @param {
|
|
795
|
+
* @param {string} unit
|
|
796
796
|
*/
|
|
797
797
|
CronExpression.setMethod(function modifyDate(date, config, unit) {
|
|
798
798
|
|
|
@@ -856,9 +856,9 @@ CronExpression.setMethod(function modifyDate(date, config, unit) {
|
|
|
856
856
|
*
|
|
857
857
|
* @param {Date} date The date to modify in-place
|
|
858
858
|
* @param {Object} config The parsed Cron field expression
|
|
859
|
-
* @param {
|
|
859
|
+
* @param {string} unit The unit of time (day, month, second, hour, ...)
|
|
860
860
|
*
|
|
861
|
-
* @return {
|
|
861
|
+
* @return {boolean|null} True if the date was modified, false if it failed, null if it wasn't modified
|
|
862
862
|
*/
|
|
863
863
|
CronExpression.setMethod(function modifyDateUsingValues(date, config, unit) {
|
|
864
864
|
|
|
@@ -935,7 +935,7 @@ CronExpression.setMethod(function modifyDateUsingValues(date, config, unit) {
|
|
|
935
935
|
*
|
|
936
936
|
* @param {Date} date
|
|
937
937
|
* @param {Object} config
|
|
938
|
-
* @param {
|
|
938
|
+
* @param {string} unit
|
|
939
939
|
*/
|
|
940
940
|
CronExpression.setMethod(function modifyDateUsingRanges(date, config, unit) {
|
|
941
941
|
|
|
@@ -1000,7 +1000,7 @@ CronExpression.setMethod(function modifyDateUsingRanges(date, config, unit) {
|
|
|
1000
1000
|
*
|
|
1001
1001
|
* @param {Date} date
|
|
1002
1002
|
* @param {Object} config
|
|
1003
|
-
* @param {
|
|
1003
|
+
* @param {string} unit
|
|
1004
1004
|
*/
|
|
1005
1005
|
CronExpression.setMethod(function modifyDateUsingSteps(date, config, unit) {
|
|
1006
1006
|
|
|
@@ -1077,9 +1077,9 @@ CronExpression.setMethod(function modifyDateUsingSteps(date, config, unit) {
|
|
|
1077
1077
|
*
|
|
1078
1078
|
* @param {Date} date The date to modify in-place
|
|
1079
1079
|
* @param {Object} config The parsed Cron field expression
|
|
1080
|
-
* @param {
|
|
1080
|
+
* @param {string} unit The unit of time. Should always be day_of_week
|
|
1081
1081
|
*
|
|
1082
|
-
* @return {
|
|
1082
|
+
* @return {boolean|null} True if the date was modified, false if it failed, null if it wasn't modified
|
|
1083
1083
|
*/
|
|
1084
1084
|
CronExpression.setMethod(function modifyDateUsingNthDays(date, config, unit) {
|
|
1085
1085
|
|
|
@@ -1163,9 +1163,9 @@ CronExpression.setMethod(function modifyDateUsingNthDays(date, config, unit) {
|
|
|
1163
1163
|
*
|
|
1164
1164
|
* @param {Date} date The date to modify in-place
|
|
1165
1165
|
* @param {Object} config The parsed Cron field expression
|
|
1166
|
-
* @param {
|
|
1166
|
+
* @param {string} unit The unit of time. Should always be day_of_week
|
|
1167
1167
|
*
|
|
1168
|
-
* @return {
|
|
1168
|
+
* @return {boolean|null} True if the date was modified, false if it failed, null if it wasn't modified
|
|
1169
1169
|
*/
|
|
1170
1170
|
CronExpression.setMethod(function modifyDateUsingLastDays(date, config, unit) {
|
|
1171
1171
|
|
|
@@ -1212,9 +1212,9 @@ CronExpression.setMethod(function modifyDateUsingLastDays(date, config, unit) {
|
|
|
1212
1212
|
*
|
|
1213
1213
|
* @param {Date} date The date to modify in-place
|
|
1214
1214
|
* @param {Object} config The parsed Cron field expression
|
|
1215
|
-
* @param {
|
|
1215
|
+
* @param {string} unit The unit of time. Should always be day_of_week
|
|
1216
1216
|
*
|
|
1217
|
-
* @return {
|
|
1217
|
+
* @return {boolean|null} True if the date was modified, false if it failed, null if it wasn't modified
|
|
1218
1218
|
*/
|
|
1219
1219
|
CronExpression.setMethod(function modifyDateUsingLastWeekday(date, config, unit) {
|
|
1220
1220
|
|
|
@@ -1239,9 +1239,9 @@ CronExpression.setMethod(function modifyDateUsingLastWeekday(date, config, unit)
|
|
|
1239
1239
|
*
|
|
1240
1240
|
* @param {Date} date The date to modify in-place
|
|
1241
1241
|
* @param {Object} config The parsed Cron field expression
|
|
1242
|
-
* @param {
|
|
1242
|
+
* @param {string} unit The unit of time. Should always be day_of_week
|
|
1243
1243
|
*
|
|
1244
|
-
* @return {
|
|
1244
|
+
* @return {boolean|null} True if the date was modified, false if it failed, null if it wasn't modified
|
|
1245
1245
|
*/
|
|
1246
1246
|
CronExpression.setMethod(function modifyDateUsingLastDay(date, config, unit) {
|
|
1247
1247
|
|
|
@@ -1266,7 +1266,7 @@ CronExpression.setMethod(function modifyDateUsingLastDay(date, config, unit) {
|
|
|
1266
1266
|
*
|
|
1267
1267
|
* @param {Date} date
|
|
1268
1268
|
* @param {Object} config
|
|
1269
|
-
* @param {
|
|
1269
|
+
* @param {string} unit
|
|
1270
1270
|
*/
|
|
1271
1271
|
CronExpression.setMethod(function addUnitToDate(date, unit, amount) {
|
|
1272
1272
|
|
|
@@ -1295,7 +1295,7 @@ CronExpression.setMethod(function addUnitToDate(date, unit, amount) {
|
|
|
1295
1295
|
*
|
|
1296
1296
|
* @param {Date} date
|
|
1297
1297
|
*
|
|
1298
|
-
* @return {
|
|
1298
|
+
* @return {number} The date of the last weekday
|
|
1299
1299
|
*/
|
|
1300
1300
|
CronExpression.setMethod(function getDayOfLastWeekday(date) {
|
|
1301
1301
|
|
|
@@ -1327,9 +1327,9 @@ CronExpression.setMethod(function getDayOfLastWeekday(date) {
|
|
|
1327
1327
|
* @version 1.3.17
|
|
1328
1328
|
*
|
|
1329
1329
|
* @param {Date} date
|
|
1330
|
-
* @param {
|
|
1330
|
+
* @param {number} day_of_week
|
|
1331
1331
|
*
|
|
1332
|
-
* @return {
|
|
1332
|
+
* @return {number} The date of the last weekday
|
|
1333
1333
|
*/
|
|
1334
1334
|
CronExpression.setMethod(function getDayOfLastWantedDayOfWeek(date, wanted_day_of_week) {
|
|
1335
1335
|
|
|
@@ -1362,7 +1362,7 @@ CronExpression.setMethod(function getDayOfLastWantedDayOfWeek(date, wanted_day_o
|
|
|
1362
1362
|
* @version 1.3.17
|
|
1363
1363
|
*
|
|
1364
1364
|
* @param {Date} date
|
|
1365
|
-
* @param {
|
|
1365
|
+
* @param {string} unit
|
|
1366
1366
|
*/
|
|
1367
1367
|
CronExpression.setMethod(function getUnit(date, unit) {
|
|
1368
1368
|
|
|
@@ -1394,7 +1394,7 @@ CronExpression.setMethod(function getUnit(date, unit) {
|
|
|
1394
1394
|
* @since 1.3.17
|
|
1395
1395
|
* @version 1.3.17
|
|
1396
1396
|
*
|
|
1397
|
-
* @param {
|
|
1397
|
+
* @param {string} unit
|
|
1398
1398
|
*/
|
|
1399
1399
|
CronExpression.setMethod(function getUnitMax(unit, of_date) {
|
|
1400
1400
|
|
|
@@ -1441,7 +1441,7 @@ CronExpression.setMethod(function getUnitMax(unit, of_date) {
|
|
|
1441
1441
|
* @since 1.3.17
|
|
1442
1442
|
* @version 1.3.17
|
|
1443
1443
|
*
|
|
1444
|
-
* @param {
|
|
1444
|
+
* @param {string} unit
|
|
1445
1445
|
*/
|
|
1446
1446
|
CronExpression.setMethod(function getUnitMin(unit, of_date) {
|
|
1447
1447
|
const info = FIELD_INFO[unit];
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @constructor
|
|
5
5
|
*
|
|
6
|
-
* @author Jelle De Loecker
|
|
6
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
7
7
|
* @since 1.2.1
|
|
8
8
|
* @version 1.2.1
|
|
9
9
|
*/
|
|
@@ -12,11 +12,11 @@ const EnumMap = Function.inherits('Alchemy.Map.Backed', 'Enum');
|
|
|
12
12
|
/**
|
|
13
13
|
* Get a value by it's name
|
|
14
14
|
*
|
|
15
|
-
* @author Jelle De Loecker
|
|
15
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
16
16
|
* @since 1.2.1
|
|
17
17
|
* @version 1.2.1
|
|
18
18
|
*
|
|
19
|
-
* @param {
|
|
19
|
+
* @param {string} name
|
|
20
20
|
*
|
|
21
21
|
* @return {Mixed}
|
|
22
22
|
*/
|
|
@@ -38,11 +38,11 @@ EnumMap.setMethod(function get(name) {
|
|
|
38
38
|
/**
|
|
39
39
|
* Set a value
|
|
40
40
|
*
|
|
41
|
-
* @author Jelle De Loecker
|
|
41
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
42
42
|
* @since 1.2.1
|
|
43
43
|
* @version 1.2.1
|
|
44
44
|
*
|
|
45
|
-
* @param {
|
|
45
|
+
* @param {string} name
|
|
46
46
|
* @param {*} value
|
|
47
47
|
*
|
|
48
48
|
* @return {*}
|
|
@@ -89,7 +89,7 @@ EnumMap.setMethod(function set(name, value) {
|
|
|
89
89
|
/**
|
|
90
90
|
* Simplify the object for Hawkejs
|
|
91
91
|
*
|
|
92
|
-
* @author Jelle De Loecker
|
|
92
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
93
93
|
* @since 1.2.1
|
|
94
94
|
* @version 1.3.6
|
|
95
95
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The pagination helper
|
|
3
3
|
*
|
|
4
|
-
* @author Jelle De Loecker
|
|
4
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
5
5
|
* @since 0.2.0
|
|
6
6
|
* @version 1.0.0
|
|
7
7
|
*
|
|
@@ -14,11 +14,11 @@ var Pagination = Function.inherits('Alchemy.Helper', function Pagination(view) {
|
|
|
14
14
|
/**
|
|
15
15
|
* Return pagination config
|
|
16
16
|
*
|
|
17
|
-
* @author Jelle De Loecker
|
|
17
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
18
18
|
* @since 0.2.0
|
|
19
19
|
* @version 1.0.4
|
|
20
20
|
*
|
|
21
|
-
* @param {
|
|
21
|
+
* @param {string} name
|
|
22
22
|
*
|
|
23
23
|
* @return {Object}
|
|
24
24
|
*/
|
|
@@ -52,7 +52,7 @@ Pagination.setMethod(function getConfig(name) {
|
|
|
52
52
|
|
|
53
53
|
/**
|
|
54
54
|
* Default options for getInfo
|
|
55
|
-
* @type
|
|
55
|
+
* @type {Object}
|
|
56
56
|
*/
|
|
57
57
|
Pagination.setProperty('default_get_info', {
|
|
58
58
|
showing: 'Showing',
|
|
@@ -64,7 +64,7 @@ Pagination.setProperty('default_get_info', {
|
|
|
64
64
|
/**
|
|
65
65
|
* Is there a next page?
|
|
66
66
|
*
|
|
67
|
-
* @author Jelle De Loecker
|
|
67
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
68
68
|
* @since 0.4.1
|
|
69
69
|
* @version 0.4.1
|
|
70
70
|
*/
|
|
@@ -83,11 +83,11 @@ Pagination.setMethod(function hasNext(name) {
|
|
|
83
83
|
/**
|
|
84
84
|
* Return info
|
|
85
85
|
*
|
|
86
|
-
* @author Jelle De Loecker
|
|
86
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
87
87
|
* @since 0.2.0
|
|
88
88
|
* @version 0.2.0
|
|
89
89
|
*
|
|
90
|
-
* @param {
|
|
90
|
+
* @param {string} name
|
|
91
91
|
* @param {Object} options
|
|
92
92
|
*/
|
|
93
93
|
Pagination.setMethod(function getInfo(name, options) {
|
|
@@ -144,11 +144,11 @@ Pagination.setMethod(function getInfo(name, options) {
|
|
|
144
144
|
/**
|
|
145
145
|
* Return the current page number
|
|
146
146
|
*
|
|
147
|
-
* @author Jelle De Loecker
|
|
147
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
148
148
|
* @since 0.2.0
|
|
149
149
|
* @version 0.2.0
|
|
150
150
|
*
|
|
151
|
-
* @param {
|
|
151
|
+
* @param {string} name
|
|
152
152
|
*/
|
|
153
153
|
Pagination.setMethod(function getPageNumber(name) {
|
|
154
154
|
|
|
@@ -162,11 +162,11 @@ Pagination.setMethod(function getPageNumber(name) {
|
|
|
162
162
|
/**
|
|
163
163
|
* Return the available pages
|
|
164
164
|
*
|
|
165
|
-
* @author Jelle De Loecker
|
|
165
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
166
166
|
* @since 0.2.0
|
|
167
167
|
* @version 0.2.0
|
|
168
168
|
*
|
|
169
|
-
* @param {
|
|
169
|
+
* @param {string} name
|
|
170
170
|
*/
|
|
171
171
|
Pagination.setMethod(function getPages(name) {
|
|
172
172
|
|
|
@@ -180,11 +180,11 @@ Pagination.setMethod(function getPages(name) {
|
|
|
180
180
|
/**
|
|
181
181
|
* Return the total available items
|
|
182
182
|
*
|
|
183
|
-
* @author Jelle De Loecker
|
|
183
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
184
184
|
* @since 0.3.0
|
|
185
185
|
* @version 0.3.0
|
|
186
186
|
*
|
|
187
|
-
* @param {
|
|
187
|
+
* @param {string} name
|
|
188
188
|
*/
|
|
189
189
|
Pagination.setMethod(function getTotalItems(name) {
|
|
190
190
|
|
|
@@ -198,11 +198,11 @@ Pagination.setMethod(function getTotalItems(name) {
|
|
|
198
198
|
/**
|
|
199
199
|
* Return the first-of-page number
|
|
200
200
|
*
|
|
201
|
-
* @author Jelle De Loecker
|
|
201
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
202
202
|
* @since 0.3.0
|
|
203
203
|
* @version 0.3.0
|
|
204
204
|
*
|
|
205
|
-
* @param {
|
|
205
|
+
* @param {string} name
|
|
206
206
|
*/
|
|
207
207
|
Pagination.setMethod(function getFirstOfPage(name) {
|
|
208
208
|
|
|
@@ -223,11 +223,11 @@ Pagination.setMethod(function getFirstOfPage(name) {
|
|
|
223
223
|
/**
|
|
224
224
|
* Return the last-of-page number
|
|
225
225
|
*
|
|
226
|
-
* @author Jelle De Loecker
|
|
226
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
227
227
|
* @since 0.3.0
|
|
228
228
|
* @version 0.3.0
|
|
229
229
|
*
|
|
230
|
-
* @param {
|
|
230
|
+
* @param {string} name
|
|
231
231
|
*/
|
|
232
232
|
Pagination.setMethod(function getLastOfPage(name) {
|
|
233
233
|
|
|
@@ -255,7 +255,7 @@ Pagination.setMethod(function getLastOfPage(name) {
|
|
|
255
255
|
/**
|
|
256
256
|
* Print an arrow link (Up or down)
|
|
257
257
|
*
|
|
258
|
-
* @author Jelle De Loecker
|
|
258
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
259
259
|
* @since 0.0.1
|
|
260
260
|
* @version 0.2.0
|
|
261
261
|
*
|
|
@@ -283,7 +283,7 @@ Pagination.setMethod(function arrowLink(options) {
|
|
|
283
283
|
/**
|
|
284
284
|
* Print a link to the next page
|
|
285
285
|
*
|
|
286
|
-
* @author Jelle De Loecker
|
|
286
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
287
287
|
* @since 0.0.1
|
|
288
288
|
* @version 0.2.0
|
|
289
289
|
*
|
|
@@ -305,7 +305,7 @@ Pagination.setMethod(function next(options) {
|
|
|
305
305
|
/**
|
|
306
306
|
* Print a link to the previous page
|
|
307
307
|
*
|
|
308
|
-
* @author Jelle De Loecker
|
|
308
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
309
309
|
* @since 0.0.1
|
|
310
310
|
* @version 0.2.0
|
|
311
311
|
*
|
|
@@ -326,7 +326,7 @@ Pagination.setMethod(function previous(options) {
|
|
|
326
326
|
|
|
327
327
|
/**
|
|
328
328
|
* Default options for page
|
|
329
|
-
* @type
|
|
329
|
+
* @type {Object}
|
|
330
330
|
*/
|
|
331
331
|
Pagination.setProperty('default_page', {
|
|
332
332
|
skip_empty: false,
|
|
@@ -338,7 +338,7 @@ Pagination.setProperty('default_page', {
|
|
|
338
338
|
/**
|
|
339
339
|
* Print a link to a certain page
|
|
340
340
|
*
|
|
341
|
-
* @author Jelle De Loecker
|
|
341
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
342
342
|
* @since 0.0.1
|
|
343
343
|
* @version 1.0.0
|
|
344
344
|
*
|
|
@@ -455,11 +455,11 @@ Pagination.setMethod(function page(options) {
|
|
|
455
455
|
/**
|
|
456
456
|
* Print out the numbers
|
|
457
457
|
*
|
|
458
|
-
* @author Jelle De Loecker
|
|
458
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
459
459
|
* @since 0.0.1
|
|
460
460
|
* @version 0.2.0
|
|
461
461
|
*
|
|
462
|
-
* @param {
|
|
462
|
+
* @param {string} name The model we're paginating. Optional.
|
|
463
463
|
*/
|
|
464
464
|
Pagination.setMethod(function show(name, options) {
|
|
465
465
|
|
|
@@ -545,13 +545,13 @@ Pagination.setMethod(function show(name, options) {
|
|
|
545
545
|
* Create an anchor that will sort the pagination on the given field.
|
|
546
546
|
* The first argument can also be an object, which supports more features.
|
|
547
547
|
*
|
|
548
|
-
* @author Jelle De Loecker
|
|
548
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
549
549
|
* @since 0.0.1
|
|
550
550
|
* @version 1.0.0
|
|
551
551
|
*
|
|
552
|
-
* @param {
|
|
553
|
-
* @param {
|
|
554
|
-
* @param {
|
|
552
|
+
* @param {string} paginationName The model we're paginating.
|
|
553
|
+
* @param {string} fieldName The field we're sorting.
|
|
554
|
+
* @param {string} content The text to show in the anchor.
|
|
555
555
|
*/
|
|
556
556
|
Pagination.setMethod(function sort(paginationName, fieldName, content) {
|
|
557
557
|
|
|
@@ -615,13 +615,13 @@ Pagination.setMethod(function sort(paginationName, fieldName, content) {
|
|
|
615
615
|
/**
|
|
616
616
|
* Create an input to filter this row.
|
|
617
617
|
*
|
|
618
|
-
* @author Jelle De Loecker
|
|
618
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
619
619
|
* @since 0.0.1
|
|
620
620
|
* @version 1.0.4
|
|
621
621
|
*
|
|
622
|
-
* @param {
|
|
623
|
-
* @param {
|
|
624
|
-
* @param {
|
|
622
|
+
* @param {string} paginationName The model we're paginating.
|
|
623
|
+
* @param {string} fieldName The field we're sorting.
|
|
624
|
+
* @param {string} content The text to show in the input.
|
|
625
625
|
*/
|
|
626
626
|
Pagination.setMethod(function filter(paginationName, fieldName, content) {
|
|
627
627
|
|
|
@@ -667,11 +667,11 @@ Pagination.setMethod(function filter(paginationName, fieldName, content) {
|
|
|
667
667
|
/**
|
|
668
668
|
* Create an apply button
|
|
669
669
|
*
|
|
670
|
-
* @author Jelle De Loecker
|
|
670
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
671
671
|
* @since 0.5.0
|
|
672
672
|
* @version 0.5.0
|
|
673
673
|
*
|
|
674
|
-
* @param {
|
|
674
|
+
* @param {string} paginationName The model we're paginating.
|
|
675
675
|
*/
|
|
676
676
|
Pagination.setMethod(function applyButton(paginationName) {
|
|
677
677
|
|
|
@@ -698,7 +698,7 @@ Pagination.setMethod(function applyButton(paginationName) {
|
|
|
698
698
|
/**
|
|
699
699
|
* Apply the filter
|
|
700
700
|
*
|
|
701
|
-
* @author Jelle De Loecker
|
|
701
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
702
702
|
* @since 0.5.0
|
|
703
703
|
* @version 1.0.4
|
|
704
704
|
*/
|
|
@@ -746,7 +746,7 @@ Pagination.setMethod(function _apply(element, change_focus, callback) {
|
|
|
746
746
|
/**
|
|
747
747
|
* Create an input to filter this row.
|
|
748
748
|
*
|
|
749
|
-
* @author Jelle De Loecker
|
|
749
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
750
750
|
* @since 0.0.1
|
|
751
751
|
* @version 1.0.4
|
|
752
752
|
*/
|