Files

67 lines
1.5 KiB
Plaintext

//- Functions
//- @pugdoc
name: script
description: Creates a generic [Roll20 script block](https://wiki.roll20.net/Building_Character_Sheets#JavaScript_2) for use with the sheetworker system.
arguments:
attributes:
example: |
include _htmlelements.pug
+script
mixin script
script(type='text/worker')
block
//-End Mixin
mixin kscriptContents(testing)
|const k = (function(){
|const kFuncs = {};
//- The below declarations import variables from the pug file and mixins into the sheetworker code
- const propArray = ['cascades','repeatingSectionDetails'];
each prop in propArray
|
|const !{prop} = !{JSON.stringify(varObjects[prop])};
|
|kFuncs.!{prop} = !{prop};
- delete varObjects[prop];
|
|
include kvariables.js
include utility.js
include attribute_proxy.js
include accessSheet.js
include parse_cascade.js
include sheetworker_aliases.js
include listeners.js
include ../tabs/tabs.js
|
|return kFuncs;
|}());
|
each content,prop in varObjects
|
if typeof content === 'object'
|const !{prop} = !{JSON.stringify(content)};
else
|let !{prop} = !{content};
|
|
block
|
|k.registerEventHandlers();
|
//- @pugdoc
name: kscript
description: Similar to {@link script}, but includes the K-scaffold\'s javascript function library.
arguments:
attributes:
example: |
include _htmlelements.pug
+kscript
mixin kscript
- scriptUsed = true;
+script
+kscriptContents
block
//- End Mixin