@christianriedl/media 1.0.208 → 1.0.209

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@christianriedl/media",
3
- "version": "1.0.208",
3
+ "version": "1.0.209",
4
4
  "description": "RIC media interfaces",
5
5
 
6
6
  "main": "dist/index.js",
@@ -13,31 +13,26 @@
13
13
  const textHinten = computed (() => buildText (place.hinten, place.hinten2, place.hintenSelFrom, place.hintenSelTo));
14
14
 
15
15
  function buildText (buchstaben: string, buchstaben2: string, selFrom?: number, selTo?: number) : string {
16
- let text = "";
17
- if (selFrom === undefined || selTo === undefined)
16
+ let text1 = buchstaben;
17
+ let text2 = buchstaben2;
18
+ if (selFrom !== undefined && selTo !== undefined)
18
19
  {
19
- return buchstaben + "<br>" + buchstaben2;
20
- }
21
- for (let i = 0; i < buchstaben.length; i++) {
22
- const buchstabe = buchstaben.substring(i, i+1);
23
- if (i >= selFrom && i <= selTo) {
24
- text += `<span style="color: red; font-weight: 900">${buchstabe}</span>`;
20
+ selTo++;
21
+ if (selFrom > 0) {
22
+ text1 = '<span>' + buchstaben.substring(0, selFrom) + '</span>';
23
+ text2 = '<span>' + buchstaben2.substring(0, selFrom) + '</span>';
25
24
  }
26
25
  else {
27
- text += `<span>${buchstabe}</span>`;
28
- }
29
- }
30
- text += "<br>";
31
- for (let i = 0; i < buchstaben2.length; i++) {
32
- const buchstabe = buchstaben2.substring(i, i+1);
33
- if (i >= selFrom && i <= selTo) {
34
- text += `<span style="color: red; font-weight: 900">${buchstabe}</span>`;
26
+ text1 = text2 = '';
35
27
  }
36
- else {
37
- text += `<span>${buchstabe}</span>`;
28
+ text1 += '<span style="color: red; font-weight: 900">' + buchstaben.substring(selFrom, selTo) + '</span>';
29
+ text2 += '<span style="color: red; font-weight: 900">' + buchstaben2.substring(selFrom, selTo) + '</span>';
30
+ if (selTo < buchstaben.length) {
31
+ text1 += '<span>' + buchstaben.substring(selTo) + '</span>';
32
+ text2 += '<span>' + buchstaben2.substring(selTo) + '</span>';
38
33
  }
39
34
  }
40
- return text;
35
+ return text1 + "<br>" + text2;
41
36
  }
42
37
 
43
38
  function selectVorne () {