Browse Source

REFA,DOC: several things

master
chris 6 months ago
parent
commit
b98c3be3be
  1. 5
      README.md
  2. 25
      join_js_files.sh
  3. 5
      src/builder.js

5
README.md

@ -32,3 +32,8 @@ Javascript is by far not my strongest field,
typescript even less. typescript even less.
So it is recommended to not expect to much, So it is recommended to not expect to much,
you have been warned. you have been warned.
```sh
sh join_js_files.sh
```

25
join_js_files.sh

@ -1,9 +1,28 @@
TARGET="jpc-like-websites.js" TARGET="jpc-like-websites.js"
SRC="src/js" SRC="src"
ORDERED_LIST="alignment.js arrangement.js color.js commonEvents.js componentAttribute.js sizeSideDependence.js modifier.js context.js component.js baseComponents.js builder.js"
SUB_LIST="siding.js shapes.js border.js dimensions.js"
MODIFIERS_LIST="alignment.js arrangement.js modifier.js"
HIGHER_LIST="commonEvents.js context.js component.js baseComponents.js builder.js"
echo "" > $TARGET echo "" > $TARGET
echo "/* ## color.js ## */" >> $TARGET
cat $SRC/color.js >> $TARGET
echo "/* # SUB_LIST # */" >> $TARGET
for i in $SUB_LIST; do
echo "/* ## $i ## */" >> $TARGET
cat $SRC/sizeSide/$i >> $TARGET
done
echo "/* # MODIFIERS_LIST # */" >> $TARGET
for i in $MODIFIERS_LIST; do
echo "/* ## $i ## */" >> $TARGET
cat $SRC/$i >> $TARGET
done
for i in $ORDERED_LIST; do echo "/* # HIGHER_LIST # */" >> $TARGET
for i in $HIGHER_LIST; do
echo "/* ## $i ## */" >> $TARGET
cat $SRC/$i >> $TARGET cat $SRC/$i >> $TARGET
done done

5
src/builder.js

@ -1,3 +1,6 @@
/**
* Method Collection with predefined HTMLElements
*/
const builder = { const builder = {
components: { components: {
parent: {}, parent: {},
@ -13,7 +16,7 @@ const builder = {
* @param {Map<string,string>} attr * @param {Map<string,string>} attr
* @returns {Component} * @returns {Component}
*/ */
genTag: function (tag, attr = {}) { return new Component(document.createElement(tag), attr); }, genTag: function (tag, attr = {}) { return new Component(document.createElement(tag), attr).addStyleClass(`el-${tag}`); },
/** /**
* *

Loading…
Cancel
Save