waibu-maps 2.7.5 → 2.7.6

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.
@@ -23,6 +23,6 @@
23
23
  "czbp": "Zoom/Bearing/Pitch",
24
24
  "cmp": "Mouse Position",
25
25
  "centerpos": "Center Point",
26
- "newsticker": "News Ticker"
26
+ "news": "News Ticker"
27
27
  }
28
- }
28
+ }
@@ -25,6 +25,6 @@
25
25
  "czbp": "Zoom/Bearing/Pitch",
26
26
  "cmp": "Posisi Tetikus",
27
27
  "centerpos": "Titik Tengah",
28
- "newsticker": "Ticker Berita"
28
+ "news": "Ticker Berita"
29
29
  }
30
- }
30
+ }
@@ -1,5 +1,5 @@
1
1
  import control from './control.js'
2
- const prefix = 'newsticker'
2
+ const prefix = 'news'
3
3
 
4
4
  async function controlNewsticker () {
5
5
  const WmapsControl = await control.call(this)
@@ -49,9 +49,9 @@ async function controlNewsticker () {
49
49
  const att = item._attachments[0]
50
50
  let rsc = ''
51
51
  if (att) {
52
- if (att.mimeType.startsWith('video')) {
52
+ if (att.mimeType.startsWith('video') && !att.url.endsWith('.olv')) {
53
53
  rsc = '<iframe style="height:250px; width:100%" frameborder="0" allowfullscreen scrolling="no" allow="camera; microphone; fullscreen" src="' + att.url + '"></iframe>'
54
- } else {
54
+ } else if (att.mimeType.startsWith('image')) {
55
55
  rsc = '<img style="height:250px" class="img-fluid" src="' + att.url + '">'
56
56
  }
57
57
  }
@@ -66,13 +66,13 @@ async function controlNewsticker () {
66
66
  if (!el) return
67
67
  }
68
68
  `, `
69
- newstickerDt () {
69
+ ${prefix}Dt () {
70
70
  const el = document.querySelector('.maplibregl-ctrl-newsticker .datetime h5')
71
71
  el.textContent = dayjs().tz('Asia/Jakarta').format('HH:mm [WIB]')
72
72
  }
73
73
  `, `
74
- async getPosts () {
75
- if (window.newsticker) window.newsticker.destroy()
74
+ async ${prefix}GetPosts () {
75
+ // if (window.${prefix}) window.${prefix}.destroy()
76
76
  const el = document.querySelector('.maplibregl-ctrl-newsticker .content')
77
77
  el.innerHTML = ''
78
78
  this.posts = await wmpa.fetchApi('/cms/post', { headers: { 'X-Attachments': 'true' } }, { limit: 10 })
@@ -90,7 +90,7 @@ async function controlNewsticker () {
90
90
  li.appendChild(a)
91
91
  el.appendChild(li)
92
92
  })
93
- window.newsticker = new window.AcmeTicker(el, {
93
+ window.${prefix} = new window.AcmeTicker(el, {
94
94
  type: 'vertical',
95
95
  direction: 'down',
96
96
  speed: 600,
@@ -100,10 +100,10 @@ async function controlNewsticker () {
100
100
  `])
101
101
 
102
102
  this.addBlock('run', `
103
- this.newstickerDt()
104
- setInterval(this.newstickerDt, 1000)
105
- await this.getPosts()
106
- setInterval(this.getPosts, 3 * 60 * 1000)
103
+ this.${prefix}Dt()
104
+ setInterval(this.${prefix}Dt, 1000)
105
+ await this.${prefix}GetPosts()
106
+ setInterval(this.${prefix}GetPosts, 3 * 60 * 1000)
107
107
  `)
108
108
 
109
109
  const ui = await minify(await this.component.buildSentence(`
@@ -1,7 +1,7 @@
1
1
  async function wmapsBase () {
2
2
  const controls = ['csrc', 'navigation-control', 'crlr', 'scale-control', 'attribution-control',
3
3
  'centerpos', 'fullscreen-control', 'geolocate-control', 'czbp', 'cmp']
4
- if (this.app.sumbaCms) controls.push('newsticker')
4
+ if (this.app.sumbaCms) controls.push('news')
5
5
 
6
6
  return class WmapsBase extends this.app.baseClass.MpaWidget {
7
7
  static scripts = [...super.scripts,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waibu-maps",
3
- "version": "2.7.5",
3
+ "version": "2.7.6",
4
4
  "description": "Maps for Waibu MPA",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/wiki/CHANGES.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changes
2
2
 
3
+ ## 2026-11-22
4
+
5
+ - [2.7.6] Bug fix in `control-newsticker.js` widget
6
+ - [2.7.6] Bug fix in `wmaps-base.js` widget
7
+
3
8
  ## 2026-11-12
4
9
 
5
10
  - [2.7.5] Bug fix in `control-search.js` widget