Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
Loading items

Target

Select target project
  • oss/libraries/javascript/monster
1 result
Select Git revision
Loading items
Show changes
Commits on Source (5)
<a name="v3.31.1"></a>
## [v3.31.1] - 2023-03-20
### Bug Fixes
- check is attribute set
- ATTRIBUTE_UPDATER_SELECT_THIS and no ATTRIBUTE_UPDATER_ATTRIBUTES fail
<a name="v3.31.0"></a> <a name="v3.31.0"></a>
## [v3.31.0] - 2023-03-19 ## [v3.31.0] - 2023-03-19
### Add Features ### Add Features
...@@ -455,6 +462,7 @@ ...@@ -455,6 +462,7 @@
<a name="1.8.0"></a> <a name="1.8.0"></a>
## 1.8.0 - 2021-08-15 ## 1.8.0 - 2021-08-15
[v3.31.1]: https://gitlab.schukai.com/oss/libraries/javascript/monster/compare/v3.31.0...v3.31.1
[v3.31.0]: https://gitlab.schukai.com/oss/libraries/javascript/monster/compare/v3.30.0...v3.31.0 [v3.31.0]: https://gitlab.schukai.com/oss/libraries/javascript/monster/compare/v3.30.0...v3.31.0
[v3.30.0]: https://gitlab.schukai.com/oss/libraries/javascript/monster/compare/v3.29.0...v3.30.0 [v3.30.0]: https://gitlab.schukai.com/oss/libraries/javascript/monster/compare/v3.29.0...v3.30.0
[v3.29.0]: https://gitlab.schukai.com/oss/libraries/javascript/monster/compare/v3.28.0...v3.29.0 [v3.29.0]: https://gitlab.schukai.com/oss/libraries/javascript/monster/compare/v3.28.0...v3.29.0
......
{ {
"name": "@schukai/monster", "name": "@schukai/monster",
"version": "3.30.0", "version": "3.31.0",
"description": "Monster is a simple library for creating fast, robust and lightweight websites.", "description": "Monster is a simple library for creating fast, robust and lightweight websites.",
"keywords": [ "keywords": [
"framework", "framework",
......
...@@ -291,6 +291,7 @@ function retrieveAndSetValue(element) { ...@@ -291,6 +291,7 @@ function retrieveAndSetValue(element) {
const pathfinder = new Pathfinder(self[internalSymbol].subject.getSubject()); const pathfinder = new Pathfinder(self[internalSymbol].subject.getSubject());
let path = element.getAttribute(ATTRIBUTE_UPDATER_BIND); let path = element.getAttribute(ATTRIBUTE_UPDATER_BIND);
if (path === null) throw new Error("the bind argument must start as a value with a path");
if (path.indexOf("path:") !== 0) { if (path.indexOf("path:") !== 0) {
throw new Error("the bind argument must start as a value with a path"); throw new Error("the bind argument must start as a value with a path");
...@@ -434,6 +435,8 @@ function insertElement(change) { ...@@ -434,6 +435,8 @@ function insertElement(change) {
found = true; found = true;
const attributes = containerElement.getAttribute(ATTRIBUTE_UPDATER_INSERT); const attributes = containerElement.getAttribute(ATTRIBUTE_UPDATER_INSERT);
if (attributes === null) continue;
let def = trimSpaces(attributes); let def = trimSpaces(attributes);
let i = def.indexOf(" "); let i = def.indexOf(" ");
let key = trimSpaces(def.substr(0, i)); let key = trimSpaces(def.substr(0, i));
...@@ -489,6 +492,7 @@ function insertElement(change) { ...@@ -489,6 +492,7 @@ function insertElement(change) {
let nodes = containerElement.querySelectorAll( let nodes = containerElement.querySelectorAll(
`[${ATTRIBUTE_UPDATER_INSERT_REFERENCE}*="${refPrefix}"]`, `[${ATTRIBUTE_UPDATER_INSERT_REFERENCE}*="${refPrefix}"]`,
); );
for (const [, node] of Object.entries(nodes)) { for (const [, node] of Object.entries(nodes)) {
if (!available.has(node.getAttribute(ATTRIBUTE_UPDATER_INSERT_REFERENCE))) { if (!available.has(node.getAttribute(ATTRIBUTE_UPDATER_INSERT_REFERENCE))) {
try { try {
...@@ -699,7 +703,7 @@ function runUpdateAttributes(container, parts, subject) { ...@@ -699,7 +703,7 @@ function runUpdateAttributes(container, parts, subject) {
let iterator = new Set(); let iterator = new Set();
const query = `[${ATTRIBUTE_UPDATER_SELECT_THIS}], [${ATTRIBUTE_UPDATER_ATTRIBUTES}*="path:${current}"], [${ATTRIBUTE_UPDATER_ATTRIBUTES}^="static:"], [${ATTRIBUTE_UPDATER_ATTRIBUTES}^="i18n:"]`; const query = `[${ATTRIBUTE_UPDATER_SELECT_THIS}][${ATTRIBUTE_UPDATER_ATTRIBUTES}], [${ATTRIBUTE_UPDATER_ATTRIBUTES}*="path:${current}"], [${ATTRIBUTE_UPDATER_ATTRIBUTES}^="static:"], [${ATTRIBUTE_UPDATER_ATTRIBUTES}^="i18n:"]`;
const e = container.querySelectorAll(query); const e = container.querySelectorAll(query);
...@@ -715,6 +719,11 @@ function runUpdateAttributes(container, parts, subject) { ...@@ -715,6 +719,11 @@ function runUpdateAttributes(container, parts, subject) {
if (mem.has(element)) return; if (mem.has(element)) return;
mem.add(element); mem.add(element);
// this case occurs when the ATTRIBUTE_UPDATER_SELECT_THIS attribute is set
if (!element.hasAttribute(ATTRIBUTE_UPDATER_ATTRIBUTES)) {
continue;
}
const attributes = element.getAttribute(ATTRIBUTE_UPDATER_ATTRIBUTES); const attributes = element.getAttribute(ATTRIBUTE_UPDATER_ATTRIBUTES);
for (let [, def] of Object.entries(attributes.split(","))) { for (let [, def] of Object.entries(attributes.split(","))) {
......
...@@ -142,7 +142,7 @@ function getMonsterVersion() { ...@@ -142,7 +142,7 @@ function getMonsterVersion() {
} }
/** don't touch, replaced by make with package.json version */ /** don't touch, replaced by make with package.json version */
monsterVersion = new Version("3.30.0"); monsterVersion = new Version("3.31.0");
return monsterVersion; return monsterVersion;
} }
{ {
"name": "monster", "name": "monster",
"version": "3.30.0", "version": "3.31.0",
"description": "monster", "description": "monster",
"repository": { "repository": {
"type": "git", "type": "git",
......
...@@ -7,7 +7,7 @@ describe('Monster', function () { ...@@ -7,7 +7,7 @@ describe('Monster', function () {
let monsterVersion let monsterVersion
/** don´t touch, replaced by make with package.json version */ /** don´t touch, replaced by make with package.json version */
monsterVersion = new Version("3.30.0") monsterVersion = new Version("3.31.0")
let m = getMonsterVersion(); let m = getMonsterVersion();
......
{"version":"3.31.0"} {"version":"3.31.1"}