Compare commits
3 Commits
1c6f6a3755
...
2deca7016f
Author | SHA1 | Date |
---|---|---|
Theunis J. Botha | 2deca7016f | |
Theunis J. Botha | 85f5a8bb2f | |
Theunis J. Botha | 3cea5e05b2 |
File diff suppressed because it is too large
Load Diff
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "r3",
|
||||
"version" : "2.0.758",
|
||||
"version" : "2.0.790",
|
||||
"description": "",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
|
|
104
r3.php
104
r3.php
|
@ -505,13 +505,15 @@ function extractOption($item, $template)
|
|||
{
|
||||
$item = trim($item);
|
||||
|
||||
$key_value = preg_split('/=/', $item);
|
||||
$matches = [];
|
||||
|
||||
$key_value = preg_match('/^(\s*\w+)=(.*)$/', $item, $matches);
|
||||
if ($key_value === false) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$key = $key_value[0];
|
||||
$value = $key_value[1];
|
||||
$key = $matches[1];
|
||||
$value = $matches[2];
|
||||
|
||||
$comment_value = preg_split('/\s+-\s+/', $value);
|
||||
$comment = '';
|
||||
|
@ -713,6 +715,44 @@ function generateUpdateFromInstanceOptions($file, $tokens, $token, $section, $ma
|
|||
}
|
||||
}
|
||||
|
||||
function getEventListenerInfo($item)
|
||||
{
|
||||
$item = trim($item);
|
||||
|
||||
$eventName = preg_replace('/Event./', '', $item);
|
||||
|
||||
$returns = null;
|
||||
$comment = null;
|
||||
|
||||
$values = preg_split('/\s*-\s*/', $eventName);
|
||||
|
||||
if (sizeof($values) > 1) {
|
||||
$eventName = $values[0];
|
||||
$comment = $values[1];
|
||||
}
|
||||
|
||||
$values = preg_split('/@return[s]*\s*/', $comment);
|
||||
if (sizeof($values) > 1) {
|
||||
$comment = $values[0];
|
||||
$returns = $values[1];
|
||||
}
|
||||
|
||||
$methodName = 'ON_'.$eventName;
|
||||
|
||||
$methodTokenName = $methodName;
|
||||
|
||||
$methodName = to_camel_case_from_upper_underscore($methodName);
|
||||
|
||||
return [
|
||||
'eventName' => $eventName,
|
||||
'fullEventName' => 'Event.'.$eventName,
|
||||
'returns' => $returns,
|
||||
'comment' => $comment,
|
||||
'methodName' => $methodName,
|
||||
'methodTokenName' => $methodTokenName
|
||||
];
|
||||
}
|
||||
|
||||
function generateEventListenersStart($file, $tokens)
|
||||
{
|
||||
$token = 'CUSTOM_EVENT_LISTENERS';
|
||||
|
@ -731,17 +771,12 @@ function generateEventListenersStart($file, $tokens)
|
|||
|
||||
foreach ($store as $item) {
|
||||
|
||||
$item = trim($item);
|
||||
$info = getEventListenerInfo($item);
|
||||
|
||||
$eventName = preg_replace('/Event./', '', $item);
|
||||
|
||||
$methodName = 'ON_'.$eventName;
|
||||
|
||||
$methodName = to_camel_case_from_upper_underscore($methodName);
|
||||
|
||||
$updates = str_replace('FULL_EVENT_NAME', $item, $template);
|
||||
$updates = str_replace('EVENT_NAME', $eventName, $updates);
|
||||
$updates = str_replace('CALL_BACK', $methodName, $updates);
|
||||
$updates = str_replace('FULL_EVENT_NAME', $info['fullEventName'], $template);
|
||||
$updates = str_replace('EVENT_NAME', $info['eventName'], $updates);
|
||||
$updates = str_replace('CALL_BACK', $info['methodName'], $updates);
|
||||
|
||||
$updated .= $updates;
|
||||
}
|
||||
|
@ -766,11 +801,10 @@ function generateEventListenersStop($file, $tokens)
|
|||
$updated = '';
|
||||
|
||||
foreach ($store as $item) {
|
||||
$item = trim($item);
|
||||
|
||||
$eventName = preg_replace('/Event./', '', $item);
|
||||
$info = getEventListenerInfo($item);
|
||||
|
||||
$updates = str_replace('EVENT_NAME', $eventName, $template);
|
||||
$updates = str_replace('EVENT_NAME', $info['eventName'], $template);
|
||||
|
||||
$updated .= $updates;
|
||||
}
|
||||
|
@ -796,17 +830,11 @@ function generateStaticEventListenersStart($file, $tokens)
|
|||
|
||||
foreach ($store as $item) {
|
||||
|
||||
$item = trim($item);
|
||||
$info = getEventListenerInfo($item);
|
||||
|
||||
$eventName = preg_replace('/Event./', '', $item);
|
||||
|
||||
$methodName = 'ON_'.$eventName;
|
||||
|
||||
$methodName = to_camel_case_from_upper_underscore($methodName);
|
||||
|
||||
$updates = str_replace('FULL_EVENT_NAME', $item, $template);
|
||||
$updates = str_replace('EVENT_NAME', $eventName, $updates);
|
||||
$updates = str_replace('CALL_BACK', $methodName, $updates);
|
||||
$updates = str_replace('FULL_EVENT_NAME', $info['fullEventName'], $template);
|
||||
$updates = str_replace('EVENT_NAME', $info['eventName'], $updates);
|
||||
$updates = str_replace('CALL_BACK', $info['methodName'], $updates);
|
||||
|
||||
$updated .= $updates;
|
||||
}
|
||||
|
@ -831,11 +859,10 @@ function generateStaticEventListenersStop($file, $tokens)
|
|||
$updated = '';
|
||||
|
||||
foreach ($store as $item) {
|
||||
$item = trim($item);
|
||||
|
||||
$eventName = preg_replace('/Event./', '', $item);
|
||||
$info = getEventListenerInfo($item);
|
||||
|
||||
$updates = str_replace('EVENT_NAME', $eventName, $template);
|
||||
$updates = str_replace('EVENT_NAME', $info['eventName'], $template);
|
||||
|
||||
$updated .= $updates;
|
||||
}
|
||||
|
@ -1051,15 +1078,7 @@ function getStaticEventListenerUpdates($template, $tokens, $token)
|
|||
|
||||
foreach ($store as $item) {
|
||||
|
||||
$item = trim($item);
|
||||
|
||||
$eventName = preg_replace('/Event./', '', $item);
|
||||
|
||||
$methodName = 'ON_'.$eventName;
|
||||
|
||||
$methodTokenName = $methodName;
|
||||
|
||||
$methodName = to_camel_case_from_upper_underscore($methodName);
|
||||
$info = getEventListenerInfo($item);
|
||||
|
||||
$updated = $template;
|
||||
|
||||
|
@ -1067,9 +1086,9 @@ function getStaticEventListenerUpdates($template, $tokens, $token)
|
|||
|
||||
$params = "\n * @param " . $methodArgs . " (The event data passed as argument - typically an R3Object)";
|
||||
|
||||
$returns = "\n * @return null";
|
||||
$returns = "\n * @return " . $info['returns']?:'null';
|
||||
|
||||
$potentialTemplate = strtolower('src/templates/static_' . $methodTokenName . '.template');
|
||||
$potentialTemplate = strtolower('src/templates/static_' . $info['methodTokenName'] . '.template');
|
||||
|
||||
if (file_exists($potentialTemplate)) {
|
||||
$functionTemplate = file_get_contents($potentialTemplate);
|
||||
|
@ -1078,12 +1097,13 @@ function getStaticEventListenerUpdates($template, $tokens, $token)
|
|||
$updated = preg_replace('/^.*?FUNCTION_TEMPLATE.*\n/m', '', $updated);
|
||||
}
|
||||
|
||||
$updated = str_replace('METHOD_NAME_UPPERCASE', $methodTokenName, $updated);
|
||||
$updated = str_replace('METHOD_NAME', $methodName, $updated);
|
||||
$updated = str_replace('METHOD_NAME_UPPERCASE', $info['methodTokenName'], $updated);
|
||||
$updated = str_replace('METHOD_NAME', $info['methodName'], $updated);
|
||||
$updated = str_replace('METHOD_ARGS', $methodArgs, $updated);
|
||||
|
||||
$comment = 'Listens to events of type ' . $item . ' and executes this function.';
|
||||
$comment = 'Listens to events of type ' . $info['fullEventName'] . ' and executes this function. ' . $info['comment'];
|
||||
$comment = wordwrap($comment, 110, "\n * ");
|
||||
$returns = wordwrap($returns, 110, "\n * ");
|
||||
|
||||
$updated = str_replace('COMMENT', $comment, $updated);
|
||||
$updated = str_replace('PARAMS', $params, $updated);
|
||||
|
|
|
@ -306,18 +306,30 @@ class ComponentDOM extends Component {
|
|||
initialize() {
|
||||
|
||||
//GENERATED_INITIALIZE_METHOD_START
|
||||
if (this.initialized) {
|
||||
console.warn('Multiple calls to initialize() - check your callstack');
|
||||
} else {
|
||||
try {
|
||||
super.initialize();
|
||||
} catch (err) {
|
||||
|
||||
if (!(err instanceof TypeError)) {
|
||||
//Another unexpected error occurred - and we are not inside a base class
|
||||
throw err;
|
||||
}
|
||||
|
||||
delete this.callDepth;
|
||||
this.initialized = true;
|
||||
|
||||
//CUSTOM_BEFORE_CREATE_INSTANCE_START
|
||||
Event.Emit(Event.DOM_COMPONENT_INITIALIZED, this);
|
||||
//CUSTOM_BEFORE_CREATE_INSTANCE_END
|
||||
|
||||
this.createInstance();
|
||||
|
||||
//CUSTOM_AFTER_CREATE_INSTANCE_START
|
||||
//CUSTOM_AFTER_CREATE_INSTANCE_END
|
||||
}
|
||||
//GENERATED_INITIALIZE_METHOD_END
|
||||
|
||||
//CUSTOM_INITIALIZE_METHOD_START
|
||||
Event.Emit(Event.OBJECT_INITIALIZED, this);
|
||||
Event.Emit(Event.COMPONENT_INITIALIZED, this);
|
||||
Event.Emit(Event.DOM_COMPONENT_INITIALIZED, this);
|
||||
//CUSTOM_INITIALIZE_METHOD_END
|
||||
|
||||
}
|
||||
|
|
|
@ -270,18 +270,30 @@ class ComponentGraphics extends Component {
|
|||
initialize() {
|
||||
|
||||
//GENERATED_INITIALIZE_METHOD_START
|
||||
if (this.initialized) {
|
||||
console.warn('Multiple calls to initialize() - check your callstack');
|
||||
} else {
|
||||
try {
|
||||
super.initialize();
|
||||
} catch (err) {
|
||||
|
||||
if (!(err instanceof TypeError)) {
|
||||
//Another unexpected error occurred - and we are not inside a base class
|
||||
throw err;
|
||||
}
|
||||
|
||||
delete this.callDepth;
|
||||
this.initialized = true;
|
||||
|
||||
//CUSTOM_BEFORE_CREATE_INSTANCE_START
|
||||
Event.Emit(Event.GRAPHICS_COMPONENT_INITIALIZED, this);
|
||||
//CUSTOM_BEFORE_CREATE_INSTANCE_END
|
||||
|
||||
this.createInstance();
|
||||
|
||||
//CUSTOM_AFTER_CREATE_INSTANCE_START
|
||||
//CUSTOM_AFTER_CREATE_INSTANCE_END
|
||||
}
|
||||
//GENERATED_INITIALIZE_METHOD_END
|
||||
|
||||
//CUSTOM_INITIALIZE_METHOD_START
|
||||
Event.Emit(Event.OBJECT_INITIALIZED, this);
|
||||
Event.Emit(Event.COMPONENT_INITIALIZED, this);
|
||||
Event.Emit(Event.GRAPHICS_COMPONENT_INITIALIZED, this);
|
||||
//CUSTOM_INITIALIZE_METHOD_END
|
||||
|
||||
}
|
||||
|
|
|
@ -107,15 +107,21 @@ const ComponentGraphics = require('.././r3-component-graphics.js');
|
|||
|
||||
Properties:
|
||||
|
||||
- src (Default value
|
||||
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAABhGlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AcxV9TpSotDu0g4pChumhBVMRRq1CECqFWaNXB5NIvaNKQpLg4Cq4FBz8Wqw4uzro6uAqC4AeIm5uToouU+L+k0CLWg+N+vLv3uHsHCPUy06yucUDTbTOViIuZ7KoYeEUvwgghgFGZWcacJCXRcXzdw8fXuxjP6nzuzxFScxYDfCLxLDNMm3iDeHrTNjjvE0dYUVaJz4nHTLog8SPXFY/fOBdcFnhmxEyn5okjxGKhjZU2ZkVTI54ijqqaTvlCxmOV8xZnrVxlzXvyFwZz+soy12kOIYFFLEGCCAVVlFCGjRitOikWUrQf7+AfdP0SuRRylcDIsYAKNMiuH/wPfndr5ScnvKRgHOh+cZyPYSCwCzRqjvN97DiNE8D/DFzpLX+lDsx8kl5radEjoH8buLhuacoecLkDDDwZsim7kp+mkM8D72f0TVkgfAv0rXm9Nfdx+gCkqavkDXBwCIwUKHu9w7t72nv790yzvx9QEXKZwXQv9wAAAAZiS0dEADIANAAxUB4d7wAAAAlwSFlzAAAuIwAALiMBeKU/dgAAAAd0SU1FB+UJEw0JHX/9/lIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAADUlEQVQI12Ng+M+gBgADKAEm2Ka93QAAAABJRU5ErkJggg)
|
||||
- alt (Default value '15% opaque 1x1 green pixel' - The alt attribute of this image)
|
||||
- fileName (Default value Utils.LowerUnderscore(options.name) - Name of the image under which it is
|
||||
stored)
|
||||
- extension (Default value '.unknown' - Extension of the file name including the '.' (ex. '.jpg'))
|
||||
- path (Default value '/' - Path on the server to the file, excluding filename)
|
||||
- contentType (Default value 'application/octet-stream' - Content type of the file (based on the
|
||||
extension, ex. 'image/jpeg'))
|
||||
- size (Default value 0 - Size of the file in bytes)
|
||||
- width (Default value 0 - Width of the image in pixels)
|
||||
- height (Default value 0 - height of the image in pixels)
|
||||
- extension (Default value '.png' - Extension of the file name including the '.' (ex. '.jpg'))
|
||||
- external_path (Default value '/images/' + options.id + '.png' - Path to the image relative to the
|
||||
project defined API URL)
|
||||
- internal_path (Default value '/tmp/' + options.id + '.png' - Server side path on the server to the
|
||||
file, excluding filename)
|
||||
- contentType (Default value 'image/png' - Content type of the file (based on the extension, ex.
|
||||
'image/jpeg'))
|
||||
- size (Default value 565 - Size of the file in bytes)
|
||||
- width (Default value 1 - Width of the image in pixels)
|
||||
- height (Default value 1 - height of the image in pixels)
|
||||
- orientation (Default value 'square' - The orientation of the image, one of 'square', 'landscape',
|
||||
'portrait')
|
||||
|
||||
|
@ -140,13 +146,16 @@ const ComponentGraphics = require('.././r3-component-graphics.js');
|
|||
TEMPLATE_OPTIONS_END
|
||||
|
||||
CUSTOM_OPTIONS_START
|
||||
src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAABhGlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AcxV9TpSotDu0g4pChumhBVMRRq1CECqFWaNXB5NIvaNKQpLg4Cq4FBz8Wqw4uzro6uAqC4AeIm5uToouU+L+k0CLWg+N+vLv3uHsHCPUy06yucUDTbTOViIuZ7KoYeEUvwgghgFGZWcacJCXRcXzdw8fXuxjP6nzuzxFScxYDfCLxLDNMm3iDeHrTNjjvE0dYUVaJz4nHTLog8SPXFY/fOBdcFnhmxEyn5okjxGKhjZU2ZkVTI54ijqqaTvlCxmOV8xZnrVxlzXvyFwZz+soy12kOIYFFLEGCCAVVlFCGjRitOikWUrQf7+AfdP0SuRRylcDIsYAKNMiuH/wPfndr5ScnvKRgHOh+cZyPYSCwCzRqjvN97DiNE8D/DFzpLX+lDsx8kl5radEjoH8buLhuacoecLkDDDwZsim7kp+mkM8D72f0TVkgfAv0rXm9Nfdx+gCkqavkDXBwCIwUKHu9w7t72nv790yzvx9QEXKZwXQv9wAAAAZiS0dEADIANAAxUB4d7wAAAAlwSFlzAAAuIwAALiMBeKU/dgAAAAd0SU1FB+UJEw0JHX/9/lIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAADUlEQVQI12Ng+M+gBgADKAEm2Ka93QAAAABJRU5ErkJggg==' - The src attribute of this image, defaults to a 15% opaque 1x1 green pixel
|
||||
alt='15% opaque 1x1 green pixel' - The alt attribute of this image
|
||||
fileName=Utils.LowerUnderscore(options.name) - Name of the image under which it is stored
|
||||
extension='.unknown' - Extension of the file name including the '.' (ex. '.jpg')
|
||||
path='/' - Path on the server to the file, excluding filename
|
||||
contentType='application/octet-stream' - Content type of the file (based on the extension, ex. 'image/jpeg')
|
||||
size=0 - Size of the file in bytes
|
||||
width=0 - Width of the image in pixels
|
||||
height=0 - height of the image in pixels
|
||||
extension='.png' - Extension of the file name including the '.' (ex. '.jpg')
|
||||
external_path='/images/' + options.id + '.png' - Path to the image relative to the project defined API URL
|
||||
internal_path='/tmp/' + options.id + '.png' - Server side path on the server to the file, excluding filename
|
||||
contentType='image/png' - Content type of the file (based on the extension, ex. 'image/jpeg')
|
||||
size=565 - Size of the file in bytes
|
||||
width=1 - Width of the image in pixels
|
||||
height=1 - height of the image in pixels
|
||||
orientation='square' - The orientation of the image, one of 'square', 'landscape', 'portrait'
|
||||
CUSTOM_OPTIONS_END
|
||||
|
||||
|
@ -228,6 +237,18 @@ class ComponentImage extends ComponentGraphics {
|
|||
//GENERATED_TEMPLATE_OPTIONS_INIT_END
|
||||
|
||||
//GENERATED_OPTIONS_INIT_START
|
||||
/**
|
||||
* src - The src attribute of this image, defaults to a 15% opaque 1x1 green pixel
|
||||
*/
|
||||
if (typeof options.src === 'undefined') {
|
||||
options.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAABhGlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AcxV9TpSotDu0g4pChumhBVMRRq1CECqFWaNXB5NIvaNKQpLg4Cq4FBz8Wqw4uzro6uAqC4AeIm5uToouU+L+k0CLWg+N+vLv3uHsHCPUy06yucUDTbTOViIuZ7KoYeEUvwgghgFGZWcacJCXRcXzdw8fXuxjP6nzuzxFScxYDfCLxLDNMm3iDeHrTNjjvE0dYUVaJz4nHTLog8SPXFY/fOBdcFnhmxEyn5okjxGKhjZU2ZkVTI54ijqqaTvlCxmOV8xZnrVxlzXvyFwZz+soy12kOIYFFLEGCCAVVlFCGjRitOikWUrQf7+AfdP0SuRRylcDIsYAKNMiuH/wPfndr5ScnvKRgHOh+cZyPYSCwCzRqjvN97DiNE8D/DFzpLX+lDsx8kl5radEjoH8buLhuacoecLkDDDwZsim7kp+mkM8D72f0TVkgfAv0rXm9Nfdx+gCkqavkDXBwCIwUKHu9w7t72nv790yzvx9QEXKZwXQv9wAAAAZiS0dEADIANAAxUB4d7wAAAAlwSFlzAAAuIwAALiMBeKU/dgAAAAd0SU1FB+UJEw0JHX/9/lIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAADUlEQVQI12Ng+M+gBgADKAEm2Ka93QAAAABJRU5ErkJggg==';
|
||||
}
|
||||
/**
|
||||
* alt - The alt attribute of this image
|
||||
*/
|
||||
if (typeof options.alt === 'undefined') {
|
||||
options.alt = '15% opaque 1x1 green pixel';
|
||||
}
|
||||
/**
|
||||
* fileName - Name of the image under which it is stored
|
||||
*/
|
||||
|
@ -238,37 +259,43 @@ class ComponentImage extends ComponentGraphics {
|
|||
* extension - Extension of the file name including the '.' (ex. '.jpg')
|
||||
*/
|
||||
if (typeof options.extension === 'undefined') {
|
||||
options.extension = '.unknown';
|
||||
options.extension = '.png';
|
||||
}
|
||||
/**
|
||||
* path - Path on the server to the file, excluding filename
|
||||
* external_path - Path to the image relative to the project defined API URL
|
||||
*/
|
||||
if (typeof options.path === 'undefined') {
|
||||
options.path = '/';
|
||||
if (typeof options.external_path === 'undefined') {
|
||||
options.external_path = '/images/' + options.id + '.png';
|
||||
}
|
||||
/**
|
||||
* internal_path - Server side path on the server to the file, excluding filename
|
||||
*/
|
||||
if (typeof options.internal_path === 'undefined') {
|
||||
options.internal_path = '/tmp/' + options.id + '.png';
|
||||
}
|
||||
/**
|
||||
* contentType - Content type of the file (based on the extension, ex. 'image/jpeg')
|
||||
*/
|
||||
if (typeof options.contentType === 'undefined') {
|
||||
options.contentType = 'application/octet-stream';
|
||||
options.contentType = 'image/png';
|
||||
}
|
||||
/**
|
||||
* size - Size of the file in bytes
|
||||
*/
|
||||
if (typeof options.size === 'undefined') {
|
||||
options.size = 0;
|
||||
options.size = 565;
|
||||
}
|
||||
/**
|
||||
* width - Width of the image in pixels
|
||||
*/
|
||||
if (typeof options.width === 'undefined') {
|
||||
options.width = 0;
|
||||
options.width = 1;
|
||||
}
|
||||
/**
|
||||
* height - height of the image in pixels
|
||||
*/
|
||||
if (typeof options.height === 'undefined') {
|
||||
options.height = 0;
|
||||
options.height = 1;
|
||||
}
|
||||
/**
|
||||
* orientation - The orientation of the image, one of 'square', 'landscape', 'portrait'
|
||||
|
@ -336,6 +363,62 @@ class ComponentImage extends ComponentGraphics {
|
|||
this.emit(Event.UPDATE_INSTANCE_BEFORE, this);
|
||||
|
||||
//GENERATED_UPDATE_INSTANCE_OPTIONS_START
|
||||
if (property === 'src') {
|
||||
this.instance.src = this.src;
|
||||
this.emit(
|
||||
Event.UPDATE_INSTANCE_PROPERTY,
|
||||
{
|
||||
component : this,
|
||||
property : 'src',
|
||||
instanceProperty : 'src'
|
||||
}
|
||||
);
|
||||
if (property !== 'all') {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (property === 'alt') {
|
||||
this.instance.alt = this.alt;
|
||||
this.emit(
|
||||
Event.UPDATE_INSTANCE_PROPERTY,
|
||||
{
|
||||
component : this,
|
||||
property : 'alt',
|
||||
instanceProperty : 'alt'
|
||||
}
|
||||
);
|
||||
if (property !== 'all') {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (property === 'external_path') {
|
||||
this.instance.external_path = this.external_path;
|
||||
this.emit(
|
||||
Event.UPDATE_INSTANCE_PROPERTY,
|
||||
{
|
||||
component : this,
|
||||
property : 'external_path',
|
||||
instanceProperty : 'external_path'
|
||||
}
|
||||
);
|
||||
if (property !== 'all') {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (property === 'internal_path') {
|
||||
this.instance.internal_path = this.internal_path;
|
||||
this.emit(
|
||||
Event.UPDATE_INSTANCE_PROPERTY,
|
||||
{
|
||||
component : this,
|
||||
property : 'internal_path',
|
||||
instanceProperty : 'internal_path'
|
||||
}
|
||||
);
|
||||
if (property !== 'all') {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (property === 'size') {
|
||||
this.instance.size = this.size;
|
||||
this.emit(
|
||||
|
@ -416,6 +499,62 @@ class ComponentImage extends ComponentGraphics {
|
|||
this.emit(Event.UPDATE_FROM_INSTANCE_BEFORE, this);
|
||||
|
||||
//GENERATED_UPDATE_FROM_INSTANCE_OPTIONS_START
|
||||
if (property === 'src' || property === 'all') {
|
||||
this.src = this.instance.src;
|
||||
this.emit(
|
||||
Event.UPDATE_PROPERTY_FROM_INSTANCE,
|
||||
{
|
||||
component : this,
|
||||
property : 'src',
|
||||
instanceProperty : 'src'
|
||||
}
|
||||
);
|
||||
if (property !== 'all') {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (property === 'alt' || property === 'all') {
|
||||
this.alt = this.instance.alt;
|
||||
this.emit(
|
||||
Event.UPDATE_PROPERTY_FROM_INSTANCE,
|
||||
{
|
||||
component : this,
|
||||
property : 'alt',
|
||||
instanceProperty : 'alt'
|
||||
}
|
||||
);
|
||||
if (property !== 'all') {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (property === 'external_path' || property === 'all') {
|
||||
this.external_path = this.instance.external_path;
|
||||
this.emit(
|
||||
Event.UPDATE_PROPERTY_FROM_INSTANCE,
|
||||
{
|
||||
component : this,
|
||||
property : 'external_path',
|
||||
instanceProperty : 'external_path'
|
||||
}
|
||||
);
|
||||
if (property !== 'all') {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (property === 'internal_path' || property === 'all') {
|
||||
this.internal_path = this.instance.internal_path;
|
||||
this.emit(
|
||||
Event.UPDATE_PROPERTY_FROM_INSTANCE,
|
||||
{
|
||||
component : this,
|
||||
property : 'internal_path',
|
||||
instanceProperty : 'internal_path'
|
||||
}
|
||||
);
|
||||
if (property !== 'all') {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (property === 'size' || property === 'all') {
|
||||
this.size = this.instance.size;
|
||||
this.emit(
|
||||
|
@ -496,19 +635,31 @@ class ComponentImage extends ComponentGraphics {
|
|||
initialize() {
|
||||
|
||||
//GENERATED_INITIALIZE_METHOD_START
|
||||
if (this.initialized) {
|
||||
console.warn('Multiple calls to initialize() - check your callstack');
|
||||
} else {
|
||||
try {
|
||||
super.initialize();
|
||||
} catch (err) {
|
||||
|
||||
if (!(err instanceof TypeError)) {
|
||||
//Another unexpected error occurred - and we are not inside a base class
|
||||
throw err;
|
||||
}
|
||||
|
||||
delete this.callDepth;
|
||||
this.initialized = true;
|
||||
|
||||
//CUSTOM_BEFORE_CREATE_INSTANCE_START
|
||||
Event.Emit(Event.IMAGE_COMPONENT_INITIALIZED, this);
|
||||
//CUSTOM_BEFORE_CREATE_INSTANCE_END
|
||||
|
||||
this.createInstance();
|
||||
|
||||
//CUSTOM_AFTER_CREATE_INSTANCE_START
|
||||
Event.Emit(Event.IMAGE_INSTANCE_CREATED, this);
|
||||
//CUSTOM_AFTER_CREATE_INSTANCE_END
|
||||
}
|
||||
//GENERATED_INITIALIZE_METHOD_END
|
||||
|
||||
//CUSTOM_INITIALIZE_METHOD_START
|
||||
Event.Emit(Event.OBJECT_INITIALIZED, this);
|
||||
Event.Emit(Event.COMPONENT_INITIALIZED, this);
|
||||
Event.Emit(Event.GRAPHICS_COMPONENT_INITIALIZED, this);
|
||||
Event.Emit(Event.IMAGE_COMPONENT_INITIALIZED, this);
|
||||
//CUSTOM_INITIALIZE_METHOD_END
|
||||
|
||||
}
|
||||
|
|
|
@ -270,18 +270,30 @@ class ComponentInput extends Component {
|
|||
initialize() {
|
||||
|
||||
//GENERATED_INITIALIZE_METHOD_START
|
||||
if (this.initialized) {
|
||||
console.warn('Multiple calls to initialize() - check your callstack');
|
||||
} else {
|
||||
try {
|
||||
super.initialize();
|
||||
} catch (err) {
|
||||
|
||||
if (!(err instanceof TypeError)) {
|
||||
//Another unexpected error occurred - and we are not inside a base class
|
||||
throw err;
|
||||
}
|
||||
|
||||
delete this.callDepth;
|
||||
this.initialized = true;
|
||||
|
||||
//CUSTOM_BEFORE_CREATE_INSTANCE_START
|
||||
Event.Emit(Event.INPUT_COMPONENT_INITIALIZED, this);
|
||||
//CUSTOM_BEFORE_CREATE_INSTANCE_END
|
||||
|
||||
this.createInstance();
|
||||
|
||||
//CUSTOM_AFTER_CREATE_INSTANCE_START
|
||||
//CUSTOM_AFTER_CREATE_INSTANCE_END
|
||||
}
|
||||
//GENERATED_INITIALIZE_METHOD_END
|
||||
|
||||
//CUSTOM_INITIALIZE_METHOD_START
|
||||
Event.Emit(Event.OBJECT_INITIALIZED, this);
|
||||
Event.Emit(Event.COMPONENT_INITIALIZED, this);
|
||||
Event.Emit(Event.INPUT_COMPONENT_INITIALIZED, this);
|
||||
//CUSTOM_INITIALIZE_METHOD_END
|
||||
|
||||
}
|
||||
|
|
|
@ -176,17 +176,30 @@ class Component extends R3Object {
|
|||
initialize() {
|
||||
|
||||
//GENERATED_INITIALIZE_METHOD_START
|
||||
if (this.initialized) {
|
||||
console.warn('Multiple calls to initialize() - check your callstack');
|
||||
} else {
|
||||
try {
|
||||
super.initialize();
|
||||
} catch (err) {
|
||||
|
||||
if (!(err instanceof TypeError)) {
|
||||
//Another unexpected error occurred - and we are not inside a base class
|
||||
throw err;
|
||||
}
|
||||
|
||||
delete this.callDepth;
|
||||
this.initialized = true;
|
||||
|
||||
//CUSTOM_BEFORE_CREATE_INSTANCE_START
|
||||
Event.Emit(Event.COMPONENT_INITIALIZED, this);
|
||||
//CUSTOM_BEFORE_CREATE_INSTANCE_END
|
||||
|
||||
this.createInstance();
|
||||
|
||||
//CUSTOM_AFTER_CREATE_INSTANCE_START
|
||||
//CUSTOM_AFTER_CREATE_INSTANCE_END
|
||||
}
|
||||
//GENERATED_INITIALIZE_METHOD_END
|
||||
|
||||
//CUSTOM_INITIALIZE_METHOD_START
|
||||
Event.Emit(Event.OBJECT_INITIALIZED, this);
|
||||
Event.Emit(Event.COMPONENT_INITIALIZED, this);
|
||||
//CUSTOM_INITIALIZE_METHOD_END
|
||||
|
||||
}
|
||||
|
@ -198,13 +211,30 @@ class Component extends R3Object {
|
|||
createInstance() {
|
||||
|
||||
//GENERATED_CREATE_INSTANCE_METHOD_START
|
||||
this.emit(Event.CREATE_INSTANCE_BEFORE, this);
|
||||
this.emit(
|
||||
Event.CREATE_INSTANCE_BEFORE,
|
||||
this,
|
||||
function(delayInstance) {
|
||||
if (delayInstance === true) {
|
||||
console.log('Instance creation delayed for ' + this.name);
|
||||
} else {
|
||||
/**
|
||||
* Set the runtime
|
||||
*/
|
||||
this.setRuntime();
|
||||
|
||||
this.setRuntime();
|
||||
/**
|
||||
* Let the runtime build the instance
|
||||
*/
|
||||
this.instance = this.runtime.buildInstance(this);
|
||||
|
||||
this.instance = this.runtime.buildInstance(this);
|
||||
|
||||
this.emit(Event.INSTANCE_CREATED, this);
|
||||
/**
|
||||
* Notify anyone who might be interested
|
||||
*/
|
||||
this.emit(Event.INSTANCE_CREATED, this);
|
||||
}
|
||||
}.bind(this)
|
||||
);
|
||||
//GENERATED_CREATE_INSTANCE_METHOD_END
|
||||
|
||||
//CUSTOM_CREATE_INSTANCE_METHOD_START
|
||||
|
|
|
@ -165,11 +165,25 @@ class Entity extends R3Object {
|
|||
initialize() {
|
||||
|
||||
//GENERATED_INITIALIZE_METHOD_START
|
||||
if (this.initialized) {
|
||||
console.warn('Multiple calls to initialize() - check your callstack');
|
||||
} else {
|
||||
try {
|
||||
super.initialize();
|
||||
} catch (err) {
|
||||
|
||||
if (!(err instanceof TypeError)) {
|
||||
//Another unexpected error occurred - and we are not inside a base class
|
||||
throw err;
|
||||
}
|
||||
|
||||
delete this.callDepth;
|
||||
this.initialized = true;
|
||||
|
||||
//CUSTOM_BEFORE_CREATE_INSTANCE_START
|
||||
//CUSTOM_BEFORE_CREATE_INSTANCE_END
|
||||
|
||||
this.createInstance();
|
||||
|
||||
//CUSTOM_AFTER_CREATE_INSTANCE_START
|
||||
//CUSTOM_AFTER_CREATE_INSTANCE_END
|
||||
}
|
||||
//GENERATED_INITIALIZE_METHOD_END
|
||||
|
||||
|
|
|
@ -349,32 +349,33 @@ Event.GET_WINDOW_SIZE = 0xa;
|
|||
Event.GRAPHICS_COMPONENT_INITIALIZED = 0xb;
|
||||
Event.IMAGE_COMPONENT_INITIALIZED = 0xc;
|
||||
Event.IMAGE_INITIALIZED = 0xd;
|
||||
Event.INPUT_COMPONENT_INITIALIZED = 0xe;
|
||||
Event.INSTANCE_CREATED = 0xf;
|
||||
Event.INSTANCE_DISPOSED = 0x10;
|
||||
Event.KEYBOARD_DOWN = 0x11;
|
||||
Event.KEYBOARD_UP = 0x12;
|
||||
Event.MOUSE_DOWN = 0x13;
|
||||
Event.MOUSE_MOVE = 0x14;
|
||||
Event.MOUSE_UP = 0x15;
|
||||
Event.MOUSE_WHEEL = 0x16;
|
||||
Event.OBJECT_CREATED = 0x17;
|
||||
Event.OBJECT_INITIALIZED = 0x18;
|
||||
Event.PAUSE = 0x19;
|
||||
Event.PROJECT_INITIALIZED = 0x1a;
|
||||
Event.RESTART = 0x1b;
|
||||
Event.START = 0x1c;
|
||||
Event.TOUCH_CANCEL = 0x1d;
|
||||
Event.TOUCH_END = 0x1e;
|
||||
Event.TOUCH_MOVE = 0x1f;
|
||||
Event.TOUCH_START = 0x20;
|
||||
Event.UPDATE_FROM_INSTANCE_AFTER = 0x21;
|
||||
Event.UPDATE_FROM_INSTANCE_BEFORE = 0x22;
|
||||
Event.UPDATE_INSTANCE_AFTER = 0x23;
|
||||
Event.UPDATE_INSTANCE_BEFORE = 0x24;
|
||||
Event.UPDATE_INSTANCE_PROPERTY = 0x25;
|
||||
Event.UPDATE_PROPERTY_FROM_INSTANCE = 0x26;
|
||||
Event.MAX_EVENTS = 0x27;
|
||||
Event.IMAGE_INSTANCE_CREATED = 0xe;
|
||||
Event.INPUT_COMPONENT_INITIALIZED = 0xf;
|
||||
Event.INSTANCE_CREATED = 0x10;
|
||||
Event.INSTANCE_DISPOSED = 0x11;
|
||||
Event.KEYBOARD_DOWN = 0x12;
|
||||
Event.KEYBOARD_UP = 0x13;
|
||||
Event.MOUSE_DOWN = 0x14;
|
||||
Event.MOUSE_MOVE = 0x15;
|
||||
Event.MOUSE_UP = 0x16;
|
||||
Event.MOUSE_WHEEL = 0x17;
|
||||
Event.OBJECT_CREATED = 0x18;
|
||||
Event.OBJECT_INITIALIZED = 0x19;
|
||||
Event.PAUSE = 0x1a;
|
||||
Event.PROJECT_INITIALIZED = 0x1b;
|
||||
Event.RESTART = 0x1c;
|
||||
Event.START = 0x1d;
|
||||
Event.TOUCH_CANCEL = 0x1e;
|
||||
Event.TOUCH_END = 0x1f;
|
||||
Event.TOUCH_MOVE = 0x20;
|
||||
Event.TOUCH_START = 0x21;
|
||||
Event.UPDATE_FROM_INSTANCE_AFTER = 0x22;
|
||||
Event.UPDATE_FROM_INSTANCE_BEFORE = 0x23;
|
||||
Event.UPDATE_INSTANCE_AFTER = 0x24;
|
||||
Event.UPDATE_INSTANCE_BEFORE = 0x25;
|
||||
Event.UPDATE_INSTANCE_PROPERTY = 0x26;
|
||||
Event.UPDATE_PROPERTY_FROM_INSTANCE = 0x27;
|
||||
Event.MAX_EVENTS = 0x28;
|
||||
|
||||
Event.GetEventName = function(eventId) {
|
||||
|
||||
|
@ -392,31 +393,32 @@ Event.GetEventName = function(eventId) {
|
|||
case 0xb : return 'graphics_component_initialized';
|
||||
case 0xc : return 'image_component_initialized';
|
||||
case 0xd : return 'image_initialized';
|
||||
case 0xe : return 'input_component_initialized';
|
||||
case 0xf : return 'instance_created';
|
||||
case 0x10 : return 'instance_disposed';
|
||||
case 0x11 : return 'keyboard_down';
|
||||
case 0x12 : return 'keyboard_up';
|
||||
case 0x13 : return 'mouse_down';
|
||||
case 0x14 : return 'mouse_move';
|
||||
case 0x15 : return 'mouse_up';
|
||||
case 0x16 : return 'mouse_wheel';
|
||||
case 0x17 : return 'object_created';
|
||||
case 0x18 : return 'object_initialized';
|
||||
case 0x19 : return 'pause';
|
||||
case 0x1a : return 'project_initialized';
|
||||
case 0x1b : return 'restart';
|
||||
case 0x1c : return 'start';
|
||||
case 0x1d : return 'touch_cancel';
|
||||
case 0x1e : return 'touch_end';
|
||||
case 0x1f : return 'touch_move';
|
||||
case 0x20 : return 'touch_start';
|
||||
case 0x21 : return 'update_from_instance_after';
|
||||
case 0x22 : return 'update_from_instance_before';
|
||||
case 0x23 : return 'update_instance_after';
|
||||
case 0x24 : return 'update_instance_before';
|
||||
case 0x25 : return 'update_instance_property';
|
||||
case 0x26 : return 'update_property_from_instance';
|
||||
case 0xe : return 'image_instance_created';
|
||||
case 0xf : return 'input_component_initialized';
|
||||
case 0x10 : return 'instance_created';
|
||||
case 0x11 : return 'instance_disposed';
|
||||
case 0x12 : return 'keyboard_down';
|
||||
case 0x13 : return 'keyboard_up';
|
||||
case 0x14 : return 'mouse_down';
|
||||
case 0x15 : return 'mouse_move';
|
||||
case 0x16 : return 'mouse_up';
|
||||
case 0x17 : return 'mouse_wheel';
|
||||
case 0x18 : return 'object_created';
|
||||
case 0x19 : return 'object_initialized';
|
||||
case 0x1a : return 'pause';
|
||||
case 0x1b : return 'project_initialized';
|
||||
case 0x1c : return 'restart';
|
||||
case 0x1d : return 'start';
|
||||
case 0x1e : return 'touch_cancel';
|
||||
case 0x1f : return 'touch_end';
|
||||
case 0x20 : return 'touch_move';
|
||||
case 0x21 : return 'touch_start';
|
||||
case 0x22 : return 'update_from_instance_after';
|
||||
case 0x23 : return 'update_from_instance_before';
|
||||
case 0x24 : return 'update_instance_after';
|
||||
case 0x25 : return 'update_instance_before';
|
||||
case 0x26 : return 'update_instance_property';
|
||||
case 0x27 : return 'update_property_from_instance';
|
||||
default :
|
||||
throw new Error('Event type not defined : ' + eventId);
|
||||
}
|
||||
|
|
|
@ -171,11 +171,25 @@ class Project extends R3Object {
|
|||
initialize() {
|
||||
|
||||
//GENERATED_INITIALIZE_METHOD_START
|
||||
if (this.initialized) {
|
||||
console.warn('Multiple calls to initialize() - check your callstack');
|
||||
} else {
|
||||
try {
|
||||
super.initialize();
|
||||
} catch (err) {
|
||||
|
||||
if (!(err instanceof TypeError)) {
|
||||
//Another unexpected error occurred - and we are not inside a base class
|
||||
throw err;
|
||||
}
|
||||
|
||||
delete this.callDepth;
|
||||
this.initialized = true;
|
||||
|
||||
//CUSTOM_BEFORE_CREATE_INSTANCE_START
|
||||
//CUSTOM_BEFORE_CREATE_INSTANCE_END
|
||||
|
||||
this.createInstance();
|
||||
|
||||
//CUSTOM_AFTER_CREATE_INSTANCE_START
|
||||
//CUSTOM_AFTER_CREATE_INSTANCE_END
|
||||
}
|
||||
//GENERATED_INITIALIZE_METHOD_END
|
||||
|
||||
|
|
|
@ -148,6 +148,7 @@ class R3Object extends Event {
|
|||
Object.assign(this, options);
|
||||
|
||||
//CUSTOM_BEFORE_INIT_START
|
||||
this.emit(Event.OBJECT_CREATED, this);
|
||||
//CUSTOM_BEFORE_INIT_END
|
||||
|
||||
if (options.callDepth === 0) {
|
||||
|
@ -173,16 +174,30 @@ class R3Object extends Event {
|
|||
initialize() {
|
||||
|
||||
//GENERATED_INITIALIZE_METHOD_START
|
||||
if (this.initialized) {
|
||||
console.warn('Multiple calls to initialize() - check your callstack');
|
||||
} else {
|
||||
try {
|
||||
super.initialize();
|
||||
} catch (err) {
|
||||
|
||||
if (!(err instanceof TypeError)) {
|
||||
//Another unexpected error occurred - and we are not inside a base class
|
||||
throw err;
|
||||
}
|
||||
|
||||
delete this.callDepth;
|
||||
this.initialized = true;
|
||||
|
||||
//CUSTOM_BEFORE_CREATE_INSTANCE_START
|
||||
Event.Emit(Event.OBJECT_INITIALIZED, this);
|
||||
//CUSTOM_BEFORE_CREATE_INSTANCE_END
|
||||
|
||||
this.createInstance();
|
||||
|
||||
//CUSTOM_AFTER_CREATE_INSTANCE_START
|
||||
//CUSTOM_AFTER_CREATE_INSTANCE_END
|
||||
}
|
||||
//GENERATED_INITIALIZE_METHOD_END
|
||||
|
||||
//CUSTOM_INITIALIZE_METHOD_START
|
||||
Event.Emit(Event.OBJECT_INITIALIZED, this);
|
||||
//CUSTOM_INITIALIZE_METHOD_END
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
class R3 {
|
||||
static version = '2.0.758';
|
||||
static compileDate = '2021 Sep 18 - 11:04:13 am';
|
||||
static version = '2.0.790';
|
||||
static compileDate = '2021 Sep 19 - 21:43:21 pm';
|
||||
}
|
||||
|
||||
//GENERATED_IMPORTS_START
|
||||
|
|
|
@ -76,7 +76,7 @@ const RuntimePhysics = require('./r3-runtime-physics.js');
|
|||
CUSTOM_STATIC_OPTIONS_END
|
||||
|
||||
TEMPLATE_METHODS_START
|
||||
buildInstance(component) - Creates an instance of R3.Component based on this Runtime.
|
||||
buildInstance(component) - Creates a runtime instance object based on the R3.Component representing it.
|
||||
TEMPLATE_METHODS_END
|
||||
|
||||
CUSTOM_METHODS_START
|
||||
|
@ -116,7 +116,7 @@ class RuntimeBullet extends RuntimePhysics {
|
|||
|
||||
/**
|
||||
* buildInstance()
|
||||
* - Creates an instance of R3.Component based on this Runtime.
|
||||
* - Creates a runtime instance object based on the R3.Component representing it.
|
||||
* @param component
|
||||
*/
|
||||
buildInstance(component) {
|
||||
|
|
|
@ -76,7 +76,7 @@ const RuntimeCoder = require('./r3-runtime-coder.js');
|
|||
CUSTOM_STATIC_OPTIONS_END
|
||||
|
||||
TEMPLATE_METHODS_START
|
||||
buildInstance(component) - Creates an instance of R3.Component based on this Runtime.
|
||||
buildInstance(component) - Creates a runtime instance object based on the R3.Component representing it.
|
||||
TEMPLATE_METHODS_END
|
||||
|
||||
CUSTOM_METHODS_START
|
||||
|
@ -116,7 +116,7 @@ class RuntimeCodeMirror extends RuntimeCoder {
|
|||
|
||||
/**
|
||||
* buildInstance()
|
||||
* - Creates an instance of R3.Component based on this Runtime.
|
||||
* - Creates a runtime instance object based on the R3.Component representing it.
|
||||
* @param component
|
||||
*/
|
||||
buildInstance(component) {
|
||||
|
|
|
@ -76,7 +76,7 @@ const RuntimeGUI = require('./r3-runtime-g-u-i.js');
|
|||
CUSTOM_STATIC_OPTIONS_END
|
||||
|
||||
TEMPLATE_METHODS_START
|
||||
buildInstance(component) - Creates an instance of R3.Component based on this Runtime.
|
||||
buildInstance(component) - Creates a runtime instance object based on the R3.Component representing it.
|
||||
TEMPLATE_METHODS_END
|
||||
|
||||
CUSTOM_METHODS_START
|
||||
|
@ -116,7 +116,7 @@ class RuntimeControlKit extends RuntimeGUI {
|
|||
|
||||
/**
|
||||
* buildInstance()
|
||||
* - Creates an instance of R3.Component based on this Runtime.
|
||||
* - Creates a runtime instance object based on the R3.Component representing it.
|
||||
* @param component
|
||||
*/
|
||||
buildInstance(component) {
|
||||
|
|
|
@ -74,7 +74,6 @@ class RuntimeDOM extends Runtime {
|
|||
//GENERATED_STATIC_OPTIONS_INIT_END
|
||||
|
||||
//GENERATED_OUT_OF_CLASS_IMPLEMENTATION_START
|
||||
Runtime.DOCUMENT = 0x9;
|
||||
//GENERATED_OUT_OF_CLASS_IMPLEMENTATION_END
|
||||
|
||||
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START
|
||||
|
|
|
@ -76,7 +76,7 @@ const RuntimeDOM = require('./r3-runtime-d-o-m.js');
|
|||
CUSTOM_STATIC_OPTIONS_END
|
||||
|
||||
TEMPLATE_METHODS_START
|
||||
buildInstance(component) - Creates an instance of R3.Component based on this Runtime.
|
||||
buildInstance(component) - Creates a runtime instance object based on the R3.Component representing it.
|
||||
TEMPLATE_METHODS_END
|
||||
|
||||
CUSTOM_METHODS_START
|
||||
|
@ -116,7 +116,7 @@ class RuntimeDocument extends RuntimeDOM {
|
|||
|
||||
/**
|
||||
* buildInstance()
|
||||
* - Creates an instance of R3.Component based on this Runtime.
|
||||
* - Creates a runtime instance object based on the R3.Component representing it.
|
||||
* @param component
|
||||
*/
|
||||
buildInstance(component) {
|
||||
|
|
|
@ -74,7 +74,6 @@ class RuntimeGUI extends Runtime {
|
|||
//GENERATED_STATIC_OPTIONS_INIT_END
|
||||
|
||||
//GENERATED_OUT_OF_CLASS_IMPLEMENTATION_START
|
||||
Runtime.CONTROL_KIT = 0xa;
|
||||
//GENERATED_OUT_OF_CLASS_IMPLEMENTATION_END
|
||||
|
||||
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START
|
||||
|
|
|
@ -74,7 +74,6 @@ class RuntimeGraphics extends Runtime {
|
|||
//GENERATED_STATIC_OPTIONS_INIT_END
|
||||
|
||||
//GENERATED_OUT_OF_CLASS_IMPLEMENTATION_START
|
||||
Runtime.THREE = 0xb;
|
||||
//GENERATED_OUT_OF_CLASS_IMPLEMENTATION_END
|
||||
|
||||
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START
|
||||
|
|
|
@ -74,8 +74,6 @@ class RuntimeImage extends Runtime {
|
|||
//GENERATED_STATIC_OPTIONS_INIT_END
|
||||
|
||||
//GENERATED_OUT_OF_CLASS_IMPLEMENTATION_START
|
||||
Runtime.NODE_JS_IMAGE = 0xc;
|
||||
Runtime.WEB_IMAGE = 0xd;
|
||||
//GENERATED_OUT_OF_CLASS_IMPLEMENTATION_END
|
||||
|
||||
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START
|
||||
|
|
|
@ -76,7 +76,7 @@ const RuntimeImage = require('./r3-runtime-image.js');
|
|||
CUSTOM_STATIC_OPTIONS_END
|
||||
|
||||
TEMPLATE_METHODS_START
|
||||
buildInstance(component) - Creates an instance of R3.Component based on this Runtime.
|
||||
buildInstance(component) - Creates a runtime instance object based on the R3.Component representing it.
|
||||
TEMPLATE_METHODS_END
|
||||
|
||||
CUSTOM_METHODS_START
|
||||
|
@ -116,7 +116,7 @@ class RuntimeNodeJSImage extends RuntimeImage {
|
|||
|
||||
/**
|
||||
* buildInstance()
|
||||
* - Creates an instance of R3.Component based on this Runtime.
|
||||
* - Creates a runtime instance object based on the R3.Component representing it.
|
||||
* @param component
|
||||
*/
|
||||
buildInstance(component) {
|
||||
|
|
|
@ -74,7 +74,6 @@ class RuntimePhysics extends Runtime {
|
|||
//GENERATED_STATIC_OPTIONS_INIT_END
|
||||
|
||||
//GENERATED_OUT_OF_CLASS_IMPLEMENTATION_START
|
||||
Runtime.BULLET = 0xe;
|
||||
//GENERATED_OUT_OF_CLASS_IMPLEMENTATION_END
|
||||
|
||||
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START
|
||||
|
|
|
@ -74,7 +74,6 @@ class RuntimeStatistics extends Runtime {
|
|||
//GENERATED_STATIC_OPTIONS_INIT_END
|
||||
|
||||
//GENERATED_OUT_OF_CLASS_IMPLEMENTATION_START
|
||||
Runtime.STATS = 0xf;
|
||||
//GENERATED_OUT_OF_CLASS_IMPLEMENTATION_END
|
||||
|
||||
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START
|
||||
|
|
|
@ -76,7 +76,7 @@ const RuntimeStatistics = require('./r3-runtime-statistics.js');
|
|||
CUSTOM_STATIC_OPTIONS_END
|
||||
|
||||
TEMPLATE_METHODS_START
|
||||
buildInstance(component) - Creates an instance of R3.Component based on this Runtime.
|
||||
buildInstance(component) - Creates a runtime instance object based on the R3.Component representing it.
|
||||
TEMPLATE_METHODS_END
|
||||
|
||||
CUSTOM_METHODS_START
|
||||
|
@ -116,7 +116,7 @@ class RuntimeStats extends RuntimeStatistics {
|
|||
|
||||
/**
|
||||
* buildInstance()
|
||||
* - Creates an instance of R3.Component based on this Runtime.
|
||||
* - Creates a runtime instance object based on the R3.Component representing it.
|
||||
* @param component
|
||||
*/
|
||||
buildInstance(component) {
|
||||
|
|
|
@ -76,7 +76,7 @@ const RuntimeGraphics = require('./r3-runtime-graphics.js');
|
|||
CUSTOM_STATIC_OPTIONS_END
|
||||
|
||||
TEMPLATE_METHODS_START
|
||||
buildInstance(component) - Creates an instance of R3.Component based on this Runtime.
|
||||
buildInstance(component) - Creates a runtime instance object based on the R3.Component representing it.
|
||||
TEMPLATE_METHODS_END
|
||||
|
||||
CUSTOM_METHODS_START
|
||||
|
@ -116,7 +116,7 @@ class RuntimeThree extends RuntimeGraphics {
|
|||
|
||||
/**
|
||||
* buildInstance()
|
||||
* - Creates an instance of R3.Component based on this Runtime.
|
||||
* - Creates a runtime instance object based on the R3.Component representing it.
|
||||
* @param component
|
||||
*/
|
||||
buildInstance(component) {
|
||||
|
|
|
@ -76,7 +76,7 @@ const RuntimeImage = require('./r3-runtime-image.js');
|
|||
CUSTOM_STATIC_OPTIONS_END
|
||||
|
||||
TEMPLATE_METHODS_START
|
||||
buildInstance(component) - Creates an instance of R3.Component based on this Runtime.
|
||||
buildInstance(component) - Creates a runtime instance object based on the R3.Component representing it.
|
||||
TEMPLATE_METHODS_END
|
||||
|
||||
CUSTOM_METHODS_START
|
||||
|
@ -116,7 +116,7 @@ class RuntimeWebImage extends RuntimeImage {
|
|||
|
||||
/**
|
||||
* buildInstance()
|
||||
* - Creates an instance of R3.Component based on this Runtime.
|
||||
* - Creates a runtime instance object based on the R3.Component representing it.
|
||||
* @param component
|
||||
*/
|
||||
buildInstance(component) {
|
||||
|
@ -125,6 +125,12 @@ class RuntimeWebImage extends RuntimeImage {
|
|||
//GENERATED_BUILD_INSTANCE_METHOD_END
|
||||
|
||||
//CUSTOM_BUILD_INSTANCE_METHOD_START
|
||||
if (component instanceof R3.Component.Graphics.Image) {
|
||||
let image = document.createElement('img');
|
||||
image.setAttribute('src', component.src);
|
||||
image.setAttribute('alt', component.alt);
|
||||
return image;
|
||||
}
|
||||
//CUSTOM_BUILD_INSTANCE_METHOD_END
|
||||
|
||||
}
|
||||
|
|
|
@ -188,9 +188,9 @@ class SystemDOM extends System {
|
|||
|
||||
/**
|
||||
* OnDomComponentInitialized()
|
||||
* - Listens to events of type Event.DOM_COMPONENT_INITIALIZED and executes this function.
|
||||
* - Listens to events of type Event.DOM_COMPONENT_INITIALIZED and executes this function.
|
||||
* @param object (The event data passed as argument - typically an R3Object)
|
||||
* @return null
|
||||
* @return
|
||||
*/
|
||||
static OnDomComponentInitialized(object) {
|
||||
|
||||
|
@ -198,7 +198,6 @@ class SystemDOM extends System {
|
|||
//GENERATED_STATIC_ON_DOM_COMPONENT_INITIALIZED_METHOD_END
|
||||
|
||||
//CUSTOM_STATIC_ON_DOM_COMPONENT_INITIALIZED_METHOD_START
|
||||
object.createInstance();
|
||||
//CUSTOM_STATIC_ON_DOM_COMPONENT_INITIALIZED_METHOD_END
|
||||
|
||||
}
|
||||
|
|
|
@ -269,9 +269,9 @@ class SystemInput extends System {
|
|||
|
||||
/**
|
||||
* OnTouchStart()
|
||||
* - Listens to events of type Event.TOUCH_START and executes this function.
|
||||
* - Listens to events of type Event.TOUCH_START and executes this function.
|
||||
* @param object (The event data passed as argument - typically an R3Object)
|
||||
* @return null
|
||||
* @return
|
||||
*/
|
||||
static OnTouchStart(object) {
|
||||
|
||||
|
@ -285,9 +285,9 @@ class SystemInput extends System {
|
|||
|
||||
/**
|
||||
* OnTouchEnd()
|
||||
* - Listens to events of type Event.TOUCH_END and executes this function.
|
||||
* - Listens to events of type Event.TOUCH_END and executes this function.
|
||||
* @param object (The event data passed as argument - typically an R3Object)
|
||||
* @return null
|
||||
* @return
|
||||
*/
|
||||
static OnTouchEnd(object) {
|
||||
|
||||
|
@ -301,9 +301,9 @@ class SystemInput extends System {
|
|||
|
||||
/**
|
||||
* OnTouchMove()
|
||||
* - Listens to events of type Event.TOUCH_MOVE and executes this function.
|
||||
* - Listens to events of type Event.TOUCH_MOVE and executes this function.
|
||||
* @param object (The event data passed as argument - typically an R3Object)
|
||||
* @return null
|
||||
* @return
|
||||
*/
|
||||
static OnTouchMove(object) {
|
||||
|
||||
|
@ -317,9 +317,9 @@ class SystemInput extends System {
|
|||
|
||||
/**
|
||||
* OnTouchCancel()
|
||||
* - Listens to events of type Event.TOUCH_CANCEL and executes this function.
|
||||
* - Listens to events of type Event.TOUCH_CANCEL and executes this function.
|
||||
* @param object (The event data passed as argument - typically an R3Object)
|
||||
* @return null
|
||||
* @return
|
||||
*/
|
||||
static OnTouchCancel(object) {
|
||||
|
||||
|
@ -333,9 +333,9 @@ class SystemInput extends System {
|
|||
|
||||
/**
|
||||
* OnKeyboardDown()
|
||||
* - Listens to events of type Event.KEYBOARD_DOWN and executes this function.
|
||||
* - Listens to events of type Event.KEYBOARD_DOWN and executes this function.
|
||||
* @param object (The event data passed as argument - typically an R3Object)
|
||||
* @return null
|
||||
* @return
|
||||
*/
|
||||
static OnKeyboardDown(object) {
|
||||
|
||||
|
@ -349,9 +349,9 @@ class SystemInput extends System {
|
|||
|
||||
/**
|
||||
* OnKeyboardUp()
|
||||
* - Listens to events of type Event.KEYBOARD_UP and executes this function.
|
||||
* - Listens to events of type Event.KEYBOARD_UP and executes this function.
|
||||
* @param object (The event data passed as argument - typically an R3Object)
|
||||
* @return null
|
||||
* @return
|
||||
*/
|
||||
static OnKeyboardUp(object) {
|
||||
|
||||
|
@ -365,9 +365,9 @@ class SystemInput extends System {
|
|||
|
||||
/**
|
||||
* OnMouseDown()
|
||||
* - Listens to events of type Event.MOUSE_DOWN and executes this function.
|
||||
* - Listens to events of type Event.MOUSE_DOWN and executes this function.
|
||||
* @param object (The event data passed as argument - typically an R3Object)
|
||||
* @return null
|
||||
* @return
|
||||
*/
|
||||
static OnMouseDown(object) {
|
||||
|
||||
|
@ -381,9 +381,9 @@ class SystemInput extends System {
|
|||
|
||||
/**
|
||||
* OnMouseUp()
|
||||
* - Listens to events of type Event.MOUSE_UP and executes this function.
|
||||
* - Listens to events of type Event.MOUSE_UP and executes this function.
|
||||
* @param object (The event data passed as argument - typically an R3Object)
|
||||
* @return null
|
||||
* @return
|
||||
*/
|
||||
static OnMouseUp(object) {
|
||||
|
||||
|
@ -397,9 +397,9 @@ class SystemInput extends System {
|
|||
|
||||
/**
|
||||
* OnMouseMove()
|
||||
* - Listens to events of type Event.MOUSE_MOVE and executes this function.
|
||||
* - Listens to events of type Event.MOUSE_MOVE and executes this function.
|
||||
* @param object (The event data passed as argument - typically an R3Object)
|
||||
* @return null
|
||||
* @return
|
||||
*/
|
||||
static OnMouseMove(object) {
|
||||
|
||||
|
@ -413,9 +413,9 @@ class SystemInput extends System {
|
|||
|
||||
/**
|
||||
* OnMouseWheel()
|
||||
* - Listens to events of type Event.MOUSE_WHEEL and executes this function.
|
||||
* - Listens to events of type Event.MOUSE_WHEEL and executes this function.
|
||||
* @param object (The event data passed as argument - typically an R3Object)
|
||||
* @return null
|
||||
* @return
|
||||
*/
|
||||
static OnMouseWheel(object) {
|
||||
|
||||
|
|
|
@ -33,7 +33,8 @@ const System = require('.././r3-system.js');
|
|||
|
||||
Static Properties:
|
||||
|
||||
<no static properties>
|
||||
- BlacklistedComponents (Default value [] - A list of component constructors which should not be
|
||||
permitted to create instances immediately)
|
||||
|
||||
Methods:
|
||||
|
||||
|
@ -57,6 +58,7 @@ const System = require('.././r3-system.js');
|
|||
TEMPLATE_STATIC_OPTIONS_END
|
||||
|
||||
CUSTOM_STATIC_OPTIONS_START
|
||||
BlacklistedComponents=[] - A list of component constructors which should not be permitted to create instances immediately
|
||||
CUSTOM_STATIC_OPTIONS_END
|
||||
|
||||
CUSTOM_EVENT_LISTENERS_START
|
||||
|
@ -66,6 +68,7 @@ const System = require('.././r3-system.js');
|
|||
Event.OBJECT_CREATED
|
||||
Event.OBJECT_INITIALIZED
|
||||
Event.INSTANCE_CREATED
|
||||
Event.CREATE_INSTANCE_BEFORE - @returns boolean delayInstance which indicates whether or not instance creation is delayed (handled) by another system. (i.e. where instance creation order is of importance)
|
||||
CUSTOM_STATIC_EVENT_LISTENERS_END
|
||||
|
||||
TEMPLATE_METHODS_START
|
||||
|
@ -144,6 +147,11 @@ class SystemLinking extends System {
|
|||
SystemLinking.OnInstanceCreated
|
||||
);
|
||||
|
||||
SystemLinking.Subscriptions['CREATE_INSTANCE_BEFORE'] = Event.Subscribe(
|
||||
Event.CREATE_INSTANCE_BEFORE,
|
||||
SystemLinking.OnCreateInstanceBefore
|
||||
);
|
||||
|
||||
//GENERATED_STATIC_EVENT_LISTENERS_START_END
|
||||
|
||||
//CUSTOM_BEFORE_STATIC_SYSTEM_START_START
|
||||
|
@ -179,6 +187,9 @@ class SystemLinking extends System {
|
|||
SystemLinking.Subscriptions['INSTANCE_CREATED'].remove();
|
||||
delete SystemLinking.Subscriptions['INSTANCE_CREATED'];
|
||||
|
||||
SystemLinking.Subscriptions['CREATE_INSTANCE_BEFORE'].remove();
|
||||
delete SystemLinking.Subscriptions['CREATE_INSTANCE_BEFORE'];
|
||||
|
||||
//GENERATED_STATIC_EVENT_LISTENERS_STOP_END
|
||||
|
||||
//CUSTOM_BEFORE_STATIC_SYSTEM_STOP_START
|
||||
|
@ -206,9 +217,9 @@ class SystemLinking extends System {
|
|||
|
||||
/**
|
||||
* OnObjectCreated()
|
||||
* - Listens to events of type Event.OBJECT_CREATED and executes this function.
|
||||
* - Listens to events of type Event.OBJECT_CREATED and executes this function.
|
||||
* @param object (The event data passed as argument - typically an R3Object)
|
||||
* @return null
|
||||
* @return
|
||||
*/
|
||||
static OnObjectCreated(object) {
|
||||
|
||||
|
@ -216,16 +227,16 @@ class SystemLinking extends System {
|
|||
//GENERATED_STATIC_ON_OBJECT_CREATED_METHOD_END
|
||||
|
||||
//CUSTOM_STATIC_ON_OBJECT_CREATED_METHOD_START
|
||||
console.log('Object Created');
|
||||
console.log('object created');
|
||||
//CUSTOM_STATIC_ON_OBJECT_CREATED_METHOD_END
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* OnObjectInitialized()
|
||||
* - Listens to events of type Event.OBJECT_INITIALIZED and executes this function.
|
||||
* - Listens to events of type Event.OBJECT_INITIALIZED and executes this function.
|
||||
* @param object (The event data passed as argument - typically an R3Object)
|
||||
* @return null
|
||||
* @return
|
||||
*/
|
||||
static OnObjectInitialized(object) {
|
||||
|
||||
|
@ -233,16 +244,16 @@ class SystemLinking extends System {
|
|||
//GENERATED_STATIC_ON_OBJECT_INITIALIZED_METHOD_END
|
||||
|
||||
//CUSTOM_STATIC_ON_OBJECT_INITIALIZED_METHOD_START
|
||||
console.log('Object Initialized : ' + object.constructor.name);
|
||||
console.log('object initialized');
|
||||
//CUSTOM_STATIC_ON_OBJECT_INITIALIZED_METHOD_END
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* OnInstanceCreated()
|
||||
* - Listens to events of type Event.INSTANCE_CREATED and executes this function.
|
||||
* - Listens to events of type Event.INSTANCE_CREATED and executes this function.
|
||||
* @param object (The event data passed as argument - typically an R3Object)
|
||||
* @return null
|
||||
* @return
|
||||
*/
|
||||
static OnInstanceCreated(object) {
|
||||
|
||||
|
@ -250,8 +261,33 @@ class SystemLinking extends System {
|
|||
//GENERATED_STATIC_ON_INSTANCE_CREATED_METHOD_END
|
||||
|
||||
//CUSTOM_STATIC_ON_INSTANCE_CREATED_METHOD_START
|
||||
console.log('instance created');
|
||||
//CUSTOM_STATIC_ON_INSTANCE_CREATED_METHOD_END
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* OnCreateInstanceBefore()
|
||||
* - Listens to events of type Event.CREATE_INSTANCE_BEFORE and executes this function.
|
||||
* @param object (The event data passed as argument - typically an R3Object)
|
||||
* @return boolean delayInstance which indicates whether or not instance creation is delayed (handled) by
|
||||
* another system. (i.e. where instance creation order is of importance)
|
||||
*/
|
||||
static OnCreateInstanceBefore(object) {
|
||||
|
||||
//GENERATED_STATIC_ON_CREATE_INSTANCE_BEFORE_METHOD_START
|
||||
//GENERATED_STATIC_ON_CREATE_INSTANCE_BEFORE_METHOD_END
|
||||
|
||||
//CUSTOM_STATIC_ON_CREATE_INSTANCE_BEFORE_METHOD_START
|
||||
for (let i = 0; i < SystemLinking.BlacklistedComponents.length; i++) {
|
||||
if (object instanceof SystemLinking.BlacklistedComponents) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
//CUSTOM_STATIC_ON_CREATE_INSTANCE_BEFORE_METHOD_END
|
||||
|
||||
}
|
||||
//GENERATED_STATIC_EVENT_LISTENER_METHODS_END
|
||||
|
||||
|
@ -274,6 +310,11 @@ SystemLinking.Subscriptions = {};
|
|||
//GENERATED_TEMPLATE_STATIC_OPTIONS_INIT_END
|
||||
|
||||
//GENERATED_STATIC_OPTIONS_INIT_START
|
||||
/**
|
||||
* static BlacklistedComponents - A list of component constructors which should not be permitted to create instances immediately
|
||||
*/
|
||||
SystemLinking.BlacklistedComponents = [];
|
||||
|
||||
//GENERATED_STATIC_OPTIONS_INIT_END
|
||||
|
||||
//GENERATED_OUT_OF_CLASS_IMPLEMENTATION_START
|
||||
|
|
|
@ -188,9 +188,9 @@ class SystemRender extends System {
|
|||
|
||||
/**
|
||||
* OnInstanceCreated()
|
||||
* - Listens to events of type Event.INSTANCE_CREATED and executes this function.
|
||||
* - Listens to events of type Event.INSTANCE_CREATED and executes this function.
|
||||
* @param object (The event data passed as argument - typically an R3Object)
|
||||
* @return null
|
||||
* @return
|
||||
*/
|
||||
static OnInstanceCreated(object) {
|
||||
|
||||
|
@ -203,6 +203,13 @@ class SystemRender extends System {
|
|||
document.body.appendChild(object.instance);
|
||||
}
|
||||
}
|
||||
|
||||
if (object instanceof R3.Component.Graphics.Image) {
|
||||
if (object.runtime instanceof R3.Runtime.Image.WebImage) {
|
||||
document.body.appendChild(object.instance);
|
||||
}
|
||||
}
|
||||
|
||||
//CUSTOM_STATIC_ON_INSTANCE_CREATED_METHOD_END
|
||||
|
||||
}
|
||||
|
|
|
@ -212,9 +212,9 @@ class SystemRuntime extends System {
|
|||
|
||||
/**
|
||||
* OnGetRuntime()
|
||||
* - Listens to events of type Event.GET_RUNTIME and executes this function.
|
||||
* - Listens to events of type Event.GET_RUNTIME and executes this function.
|
||||
* @param object (The event data passed as argument - typically an R3Object)
|
||||
* @return null
|
||||
* @return
|
||||
*/
|
||||
static OnGetRuntime(object) {
|
||||
|
||||
|
@ -245,9 +245,9 @@ class SystemRuntime extends System {
|
|||
|
||||
/**
|
||||
* OnProjectInitialized()
|
||||
* - Listens to events of type Event.PROJECT_INITIALIZED and executes this function.
|
||||
* - Listens to events of type Event.PROJECT_INITIALIZED and executes this function.
|
||||
* @param object (The event data passed as argument - typically an R3Object)
|
||||
* @return null
|
||||
* @return
|
||||
*/
|
||||
static OnProjectInitialized(object) {
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ const System = require('.././r3-system.js');
|
|||
CUSTOM_EVENT_LISTENERS_END
|
||||
|
||||
CUSTOM_STATIC_EVENT_LISTENERS_START
|
||||
Event.IMAGE_COMPONENT_INITIALIZED
|
||||
Event.IMAGE_INSTANCE_CREATED
|
||||
CUSTOM_STATIC_EVENT_LISTENERS_END
|
||||
|
||||
TEMPLATE_METHODS_START
|
||||
|
@ -127,9 +127,9 @@ class SystemStorage extends System {
|
|||
//GENERATED_STATIC_START_METHOD_START
|
||||
|
||||
//GENERATED_STATIC_EVENT_LISTENERS_START_START
|
||||
SystemStorage.Subscriptions['IMAGE_COMPONENT_INITIALIZED'] = Event.Subscribe(
|
||||
Event.IMAGE_COMPONENT_INITIALIZED,
|
||||
SystemStorage.OnImageComponentInitialized
|
||||
SystemStorage.Subscriptions['IMAGE_INSTANCE_CREATED'] = Event.Subscribe(
|
||||
Event.IMAGE_INSTANCE_CREATED,
|
||||
SystemStorage.OnImageInstanceCreated
|
||||
);
|
||||
|
||||
//GENERATED_STATIC_EVENT_LISTENERS_START_END
|
||||
|
@ -158,8 +158,8 @@ class SystemStorage extends System {
|
|||
//GENERATED_STATIC_STOP_METHOD_START
|
||||
|
||||
//GENERATED_STATIC_EVENT_LISTENERS_STOP_START
|
||||
SystemStorage.Subscriptions['IMAGE_COMPONENT_INITIALIZED'].remove();
|
||||
delete SystemStorage.Subscriptions['IMAGE_COMPONENT_INITIALIZED'];
|
||||
SystemStorage.Subscriptions['IMAGE_INSTANCE_CREATED'].remove();
|
||||
delete SystemStorage.Subscriptions['IMAGE_INSTANCE_CREATED'];
|
||||
|
||||
//GENERATED_STATIC_EVENT_LISTENERS_STOP_END
|
||||
|
||||
|
@ -187,19 +187,18 @@ class SystemStorage extends System {
|
|||
//GENERATED_STATIC_EVENT_LISTENER_METHODS_START
|
||||
|
||||
/**
|
||||
* OnImageComponentInitialized()
|
||||
* - Listens to events of type Event.IMAGE_COMPONENT_INITIALIZED and executes this function.
|
||||
* OnImageInstanceCreated()
|
||||
* - Listens to events of type Event.IMAGE_INSTANCE_CREATED and executes this function.
|
||||
* @param object (The event data passed as argument - typically an R3Object)
|
||||
* @return null
|
||||
* @return
|
||||
*/
|
||||
static OnImageComponentInitialized(object) {
|
||||
static OnImageInstanceCreated(object) {
|
||||
|
||||
//GENERATED_STATIC_ON_IMAGE_COMPONENT_INITIALIZED_METHOD_START
|
||||
//GENERATED_STATIC_ON_IMAGE_COMPONENT_INITIALIZED_METHOD_END
|
||||
//GENERATED_STATIC_ON_IMAGE_INSTANCE_CREATED_METHOD_START
|
||||
//GENERATED_STATIC_ON_IMAGE_INSTANCE_CREATED_METHOD_END
|
||||
|
||||
//CUSTOM_STATIC_ON_IMAGE_COMPONENT_INITIALIZED_METHOD_START
|
||||
object.createInstance();
|
||||
//CUSTOM_STATIC_ON_IMAGE_COMPONENT_INITIALIZED_METHOD_END
|
||||
//CUSTOM_STATIC_ON_IMAGE_INSTANCE_CREATED_METHOD_START
|
||||
//CUSTOM_STATIC_ON_IMAGE_INSTANCE_CREATED_METHOD_END
|
||||
|
||||
}
|
||||
//GENERATED_STATIC_EVENT_LISTENER_METHODS_END
|
||||
|
|
|
@ -1,7 +1,24 @@
|
|||
this.emit(Event.CREATE_INSTANCE_BEFORE, this);
|
||||
this.emit(
|
||||
Event.CREATE_INSTANCE_BEFORE,
|
||||
this,
|
||||
function(delayInstance) {
|
||||
if (delayInstance === true) {
|
||||
console.log('Instance creation delayed for ' + this.name);
|
||||
} else {
|
||||
/**
|
||||
* Set the runtime
|
||||
*/
|
||||
this.setRuntime();
|
||||
|
||||
this.setRuntime();
|
||||
/**
|
||||
* Let the runtime build the instance
|
||||
*/
|
||||
this.instance = this.runtime.buildInstance(this);
|
||||
|
||||
this.instance = this.runtime.buildInstance(this);
|
||||
|
||||
this.emit(Event.INSTANCE_CREATED, this);
|
||||
/**
|
||||
* Notify anyone who might be interested
|
||||
*/
|
||||
this.emit(Event.INSTANCE_CREATED, this);
|
||||
}
|
||||
}.bind(this)
|
||||
);
|
|
@ -1,6 +1,20 @@
|
|||
if (this.initialized) {
|
||||
console.warn('Multiple calls to initialize() - check your callstack');
|
||||
} else {
|
||||
try {
|
||||
super.initialize();
|
||||
} catch (err) {
|
||||
|
||||
if (!(err instanceof TypeError)) {
|
||||
//Another unexpected error occurred - and we are not inside a base class
|
||||
throw err;
|
||||
}
|
||||
|
||||
delete this.callDepth;
|
||||
this.initialized = true;
|
||||
|
||||
//CUSTOM_BEFORE_CREATE_INSTANCE_START
|
||||
//CUSTOM_BEFORE_CREATE_INSTANCE_END
|
||||
|
||||
this.createInstance();
|
||||
|
||||
//CUSTOM_AFTER_CREATE_INSTANCE_START
|
||||
//CUSTOM_AFTER_CREATE_INSTANCE_END
|
||||
}
|
|
@ -21,7 +21,7 @@ const EXTEND_CLASS = require('./EXTEND_CLASS_FILE_NAME');
|
|||
CUSTOM_STATIC_OPTIONS_END
|
||||
|
||||
TEMPLATE_METHODS_START
|
||||
buildInstance(component) - Creates an instance of R3.Component based on this Runtime.
|
||||
buildInstance(component) - Creates a runtime instance object based on the R3.Component representing it.
|
||||
TEMPLATE_METHODS_END
|
||||
|
||||
CUSTOM_METHODS_START
|
||||
|
|
|
@ -27,6 +27,7 @@ GENERATED_STATIC_EVENT_LISTENERS_START
|
|||
GENERATED_STATIC_EVENT_LISTENERS_STOP
|
||||
GENERATED_STATIC_METHOD_NAME_UPPERCASE_METHOD
|
||||
GENERATED_STATIC_METHODS
|
||||
GENERATED_STATIC_ON_CREATE_INSTANCE_BEFORE_METHOD
|
||||
GENERATED_STATIC_ON_DOM_COMPONENT_INITIALIZED_METHOD
|
||||
GENERATED_STATIC_ON_GET_RUNTIME_METHOD
|
||||
GENERATED_STATIC_ON_IMAGE_COMPONENT_INITIALIZED_METHOD
|
||||
|
@ -59,8 +60,10 @@ GENERATED_UPDATE_FROM_INSTANCE_METHOD
|
|||
GENERATED_UPDATE_FROM_INSTANCE_OPTIONS
|
||||
GENERATED_UPDATE_INSTANCE_METHOD
|
||||
GENERATED_UPDATE_INSTANCE_OPTIONS
|
||||
CUSTOM_AFTER_CREATE_INSTANCE
|
||||
CUSTOM_AFTER_INIT
|
||||
CUSTOM_ASYNC_METHOD
|
||||
CUSTOM_BEFORE_CREATE_INSTANCE
|
||||
CUSTOM_BEFORE_INIT
|
||||
CUSTOM_BEFORE_STATIC_SYSTEM_START
|
||||
CUSTOM_BEFORE_STATIC_SYSTEM_STOP
|
||||
|
@ -88,6 +91,7 @@ CUSTOM_STATIC_EMIT_METHOD
|
|||
CUSTOM_STATIC_EVENT_LISTENERS
|
||||
CUSTOM_STATIC_METHOD_NAME_UPPERCASE_METHOD
|
||||
CUSTOM_STATIC_METHODS
|
||||
CUSTOM_STATIC_ON_CREATE_INSTANCE_BEFORE_METHOD
|
||||
CUSTOM_STATIC_ON_DOM_COMPONENT_INITIALIZED_METHOD
|
||||
CUSTOM_STATIC_ON_GET_RUNTIME_METHOD
|
||||
CUSTOM_STATIC_ON_IMAGE_COMPONENT_INITIALIZED_METHOD
|
||||
|
|
Loading…
Reference in New Issue