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.
package/extend/bajo/intl/id.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import control from './control.js'
|
|
2
|
-
const prefix = '
|
|
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
|
-
|
|
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
|
|
75
|
-
if (window
|
|
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
|
|
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
|
|
104
|
-
setInterval(this
|
|
105
|
-
await this
|
|
106
|
-
setInterval(this
|
|
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('
|
|
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