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
  • 1.31
  • master
  • 1.10.0
  • 1.30.1
  • 1.31.0
  • 1.8.0
  • 1.9.0
  • 3.100.0
  • 3.100.1
  • 3.100.10
  • 3.100.11
  • 3.100.12
  • 3.100.13
  • 3.100.14
  • 3.100.15
  • 3.100.16
  • 3.100.17
  • 3.100.18
  • 3.100.19
  • 3.100.2
  • 3.100.20
  • 3.100.3
  • 3.100.4
  • 3.100.5
  • 3.100.6
  • 3.100.7
  • 3.100.8
  • 3.100.9
  • 3.101.0
  • 3.101.1
  • 3.101.2
  • 3.101.3
  • 3.102.0
  • 3.102.1
  • 3.102.2
  • 3.102.3
  • 3.102.4
  • 3.102.5
  • 3.102.6
  • 3.103.0
  • 3.103.1
  • 3.104.0
  • 3.104.1
  • 3.105.0
  • 3.105.1
  • 3.105.2
  • 3.106.0
  • 3.106.1
  • 3.107.0
  • 3.108.0
  • 3.108.1
  • 3.108.2
  • 3.108.3
  • 3.108.4
  • 3.108.5
  • 3.109.0
  • 3.110.0
  • 3.110.1
  • 3.110.2
  • 3.110.3
  • 3.110.4
  • 3.111.0
  • 3.112.0
  • 3.112.1
  • 3.112.2
  • 3.112.3
  • 3.112.4
  • 3.113.0
  • 3.114.0
  • 3.114.1
  • 3.114.2
  • 3.114.3
  • 3.114.4
  • 3.114.5
  • 3.114.6
  • 3.114.7
  • 3.115.0
  • 3.115.1
  • 3.115.2
  • 3.115.3
  • 3.115.4
  • 3.116.0
  • 3.116.1
  • 3.117.0
  • 3.117.1
  • 3.117.2
  • 3.117.3
  • 3.118.0
  • 3.118.1
  • 3.119.0
  • 3.120.0
  • 3.121.0
  • 3.51.5
  • 3.52.0
  • 3.52.1
  • 3.53.0
  • 3.54.0
  • 3.55.0
  • 3.55.1
  • 3.55.2
  • 3.55.3
  • 3.55.4
102 results

Target

Select target project
  • oss/libraries/javascript/monster
1 result
Select Git revision
  • 1.31
  • master
  • 1.10.0
  • 1.30.1
  • 1.31.0
  • 1.8.0
  • 1.9.0
  • 3.100.0
  • 3.100.1
  • 3.100.10
  • 3.100.11
  • 3.100.12
  • 3.100.13
  • 3.100.14
  • 3.100.15
  • 3.100.16
  • 3.100.17
  • 3.100.18
  • 3.100.19
  • 3.100.2
  • 3.100.20
  • 3.100.3
  • 3.100.4
  • 3.100.5
  • 3.100.6
  • 3.100.7
  • 3.100.8
  • 3.100.9
  • 3.101.0
  • 3.101.1
  • 3.101.2
  • 3.101.3
  • 3.102.0
  • 3.102.1
  • 3.102.2
  • 3.102.3
  • 3.102.4
  • 3.102.5
  • 3.102.6
  • 3.103.0
  • 3.103.1
  • 3.104.0
  • 3.104.1
  • 3.105.0
  • 3.105.1
  • 3.105.2
  • 3.106.0
  • 3.106.1
  • 3.107.0
  • 3.108.0
  • 3.108.1
  • 3.108.2
  • 3.108.3
  • 3.108.4
  • 3.108.5
  • 3.109.0
  • 3.110.0
  • 3.110.1
  • 3.110.2
  • 3.110.3
  • 3.110.4
  • 3.111.0
  • 3.112.0
  • 3.112.1
  • 3.112.2
  • 3.112.3
  • 3.112.4
  • 3.113.0
  • 3.114.0
  • 3.114.1
  • 3.114.2
  • 3.114.3
  • 3.114.4
  • 3.114.5
  • 3.114.6
  • 3.114.7
  • 3.115.0
  • 3.115.1
  • 3.115.2
  • 3.115.3
  • 3.115.4
  • 3.116.0
  • 3.116.1
  • 3.117.0
  • 3.117.1
  • 3.117.2
  • 3.117.3
  • 3.118.0
  • 3.118.1
  • 3.119.0
  • 3.120.0
  • 3.121.0
  • 3.51.5
  • 3.52.0
  • 3.52.1
  • 3.53.0
  • 3.54.0
  • 3.55.0
  • 3.55.1
  • 3.55.2
  • 3.55.3
  • 3.55.4
102 results
Show changes
Commits on Source (4)
<a name="v3.10.0"></a>
## [v3.10.0] - 2023-02-04
### Add Features
- add CustomControl.updateI18n()
<a name="v3.9.1"></a>
## [v3.9.1] - 2023-02-02
### Bug Fixes
......@@ -249,6 +255,7 @@
<a name="1.8.0"></a>
## 1.8.0 - 2021-08-15
[v3.10.0]: https://gitlab.schukai.com/oss/libraries/javascript/monster/compare/v3.9.1...v3.10.0
[v3.9.1]: https://gitlab.schukai.com/oss/libraries/javascript/monster/compare/v3.9.0...v3.9.1
[v3.9.0]: https://gitlab.schukai.com/oss/libraries/javascript/monster/compare/v3.8.0...v3.9.0
[v3.8.0]: https://gitlab.schukai.com/oss/libraries/javascript/monster/compare/v3.7.0...v3.8.0
......
......@@ -86,7 +86,7 @@ include $(MAKEFILE_IMPORT_PATH)target-help.mk
include $(MAKEFILE_IMPORT_PATH)target-node-build.mk
include $(MAKEFILE_IMPORT_PATH)target-node-test.mk
include $(MAKEFILE_IMPORT_PATH)target-npm-publish.mk
#include $(MAKEFILE_IMPORT_PATH)target-npm.mk
include $(MAKEFILE_IMPORT_PATH)target-npm.mk
include $(MAKEFILE_IMPORT_PATH)target-git.mk
#include $(MAKEFILE_IMPORT_PATH)target-init-standard.mk
#include $(MAKEFILE_IMPORT_PATH)target-init-webcomponent.mk
......
{
"name": "@schukai/monster",
"version": "3.9.0",
"version": "3.9.1",
"description": "Monster is a simple library for creating fast, robust and lightweight websites.",
"keywords": [
"framework",
......
......@@ -11,7 +11,7 @@ import { Pathfinder } from "../data/pathfinder.mjs";
import { parseDataURL } from "../types/dataurl.mjs";
import { getGlobalObject } from "../types/global.mjs";
import { isArray, isFunction, isObject, isString } from "../types/is.mjs";
import {isArray, isFunction, isIterable, isObject, isString} from "../types/is.mjs";
import { Observer } from "../types/observer.mjs";
import { ProxyObserver } from "../types/proxyobserver.mjs";
import { validateFunction, validateInstance, validateObject, validateString } from "../types/validate.mjs";
......@@ -27,6 +27,7 @@ import {
import { findDocumentTemplate, Template } from "./template.mjs";
import { addObjectWithUpdaterToElement } from "./updater.mjs";
import { instanceSymbol } from "../constants.mjs";
import {getDocumentTranslations, Translations} from "../i18n/translations.mjs";
export {
CustomElement,
......@@ -281,6 +282,39 @@ class CustomElement extends HTMLElement {
};
}
/**
* This method updates the labels of the element.
* The labels are defined in the options object.
* The key of the label is used to retrieve the translation from the document.
* If the translation is different from the label, the label is updated.
*
* Before you can use this method, you must have loaded the translations.
*
* @returns {Monster.DOM.CustomElement}
*/
updateI18n() {
const translations = getDocumentTranslations();
if (!translations) {
return this;
}
const labels = this.getOption("labels");
if(!isIterable(labels)){
return this;
}
for (const key in labels) {
const text = translations.getText(key, labels[key]);
if (text !== labels[key]) {
this.setOption("labels." + key, text);
}
}
return this;
}
/**
* There is no check on the name by this class. the developer is responsible for assigning an appropriate tag.
* if the name is not valid, registerCustomElement() will issue an error
......@@ -294,6 +328,7 @@ class CustomElement extends HTMLElement {
throw new Error("the method getTag must be overwritten by the derived class.");
}
/**
* At this point a `CSSStyleSheet` object can be returned. If the environment does not
* support a constructor, then an object can also be built using the following detour.
......
......@@ -142,7 +142,7 @@ function getMonsterVersion() {
}
/** don't touch, replaced by make with package.json version */
monsterVersion = new Version("3.9.0");
monsterVersion = new Version("3.9.1");
return monsterVersion;
}
......@@ -26,4 +26,9 @@ npm-preview:
$(QUIET) $(NPM) --prefix $(NODE_ROOT_DIR) run preview
.PHONY: npm-update-all
## Update Node Components
npm-update-all:
$(ECHOMARKER) "Search and Update recursive all node_modules (npm and pnpm"
$(QUIET) $(FIND) . -type f ! -path '*node_modules*' -iname pnpm-lock.yaml -exec bash -c 'cd $$(dirname {} ) ; pwd; pnpm update -Lr ; cd - ' \;
$(QUIET) $(FIND) . -type f ! -path '*node_modules*' -iname package-lock.json -exec bash -c 'cd $$(dirname {} ) ; pwd; npm install -g npm-check-updates; npx npm-check-updates; npm install ; cd -' \;
{
"name": "monster",
"version": "3.9.0",
"version": "3.9.1",
"description": "monster",
"repository": {
"type": "git",
......@@ -28,8 +28,8 @@
"clean-jsdoc-theme": "^4.2.3",
"create-polyfill-service-url": "^2.2.6",
"crypt": "^0.0.2",
"esbuild": "^0.17.4",
"flow-bin": "^0.198.1",
"esbuild": "^0.17.5",
"flow-bin": "^0.199.1",
"fs": "0.0.1-security",
"graphviz": "^0.0.9",
"jsdoc": "^4.0.0",
......
This diff is collapsed.
......@@ -7,7 +7,7 @@ describe('Monster', function () {
let monsterVersion
/** don´t touch, replaced by make with package.json version */
monsterVersion = new Version("3.9.0")
monsterVersion = new Version("3.9.1")
let m = getMonsterVersion();
......
{"version":"3.9.1"}
{"version":"3.10.0"}