-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Also define the shared constants as globals in Hawkejs templates
- Loading branch information
Showing
5 changed files
with
36 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,21 @@ function DEFINE(name, value) { | |
Object.defineProperty(globalThis, name, {value: value}); | ||
} | ||
|
||
/** | ||
* Function to define global constants | ||
* and have them inside Hawkejs views too | ||
* | ||
* @author Jelle De Loecker <[email protected]> | ||
* @since 1.4.0 | ||
* @version 1.4.0 | ||
* | ||
* @type {Function} | ||
*/ | ||
function DEFINE_CLIENT(name, value) { | ||
DEFINE(name, value); | ||
Classes.Hawkejs.setGlobal(name, value); | ||
} | ||
|
||
/** | ||
* Use DEFINE for itself | ||
* | ||
|
@@ -37,7 +52,7 @@ DEFINE('DEFINE', DEFINE); | |
* | ||
* @type {Informer} | ||
*/ | ||
DEFINE('Blast', __Protoblast); | ||
DEFINE_CLIENT('Blast', __Protoblast); | ||
|
||
/** | ||
* All classes will be collected here | ||
|
@@ -48,7 +63,7 @@ DEFINE('Blast', __Protoblast); | |
* | ||
* @type {Object} | ||
*/ | ||
DEFINE('Classes', Blast.Classes); | ||
DEFINE_CLIENT('Classes', Blast.Classes); | ||
|
||
/** | ||
* Available types | ||
|
@@ -59,7 +74,7 @@ DEFINE('Classes', Blast.Classes); | |
* | ||
* @type {Object} | ||
*/ | ||
DEFINE('Types', Blast.Types); | ||
DEFINE_CLIENT('Types', Blast.Types); | ||
|
||
/** | ||
* The new Local Date/Time classes | ||
|
@@ -68,9 +83,9 @@ DEFINE('Types', Blast.Types); | |
* @since 1.3.20 | ||
* @version 1.3.20 | ||
*/ | ||
DEFINE('LocalDateTime', Classes.Develry.LocalDateTime); | ||
DEFINE('LocalDate', Classes.Develry.LocalDate); | ||
DEFINE('LocalTime', Classes.Develry.LocalTime); | ||
DEFINE_CLIENT('LocalDateTime', Classes.Develry.LocalDateTime); | ||
DEFINE_CLIENT('LocalDate', Classes.Develry.LocalDate); | ||
DEFINE_CLIENT('LocalTime', Classes.Develry.LocalTime); | ||
|
||
/** | ||
* The new Decimal classes | ||
|
@@ -79,10 +94,10 @@ DEFINE('LocalTime', Classes.Develry.LocalTime); | |
* @since 1.3.20 | ||
* @version 1.3.20 | ||
*/ | ||
DEFINE('Decimal', Classes.Develry.Decimal); | ||
DEFINE('MutableDecimal', Classes.Develry.MutableDecimal); | ||
DEFINE('FixedDecimal', Classes.Develry.FixedDecimal); | ||
DEFINE('MutableFixedDecimal', Classes.Develry.MutableFixedDecimal); | ||
DEFINE_CLIENT('Decimal', Classes.Develry.Decimal); | ||
DEFINE_CLIENT('MutableDecimal', Classes.Develry.MutableDecimal); | ||
DEFINE_CLIENT('FixedDecimal', Classes.Develry.FixedDecimal); | ||
DEFINE_CLIENT('MutableFixedDecimal', Classes.Develry.MutableFixedDecimal); | ||
|
||
/** | ||
* The Trail class: | ||
|
@@ -92,4 +107,4 @@ DEFINE('MutableFixedDecimal', Classes.Develry.MutableFixedDecimal); | |
* @since 1.4.0 | ||
* @version 1.4.0 | ||
*/ | ||
DEFINE('Trail', Classes.Develry.Trail); | ||
DEFINE_CLIENT('Trail', Classes.Develry.Trail); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "alchemymvc", | ||
"description": "MVC framework for Node.js", | ||
"version": "1.4.0-alpha.2", | ||
"version": "1.4.0-alpha.3", | ||
"author": "Jelle De Loecker <[email protected]>", | ||
"keywords": [ | ||
"alchemy", | ||
|