Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Buckets & MOS plugins in ExternalFrames in Dashboard #195

Merged
merged 164 commits into from
May 26, 2020
Merged
Show file tree
Hide file tree
Changes from 81 commits
Commits
Show all changes
164 commits
Select commit Hold shift + click to select a range
0a568f9
Created Shelf Inspector component
gundelsby Aug 30, 2019
c65c0bc
Merge remote-tracking branch 'origin/develop' into feature/inline-nor…
gundelsby Sep 2, 2019
9c791fc
fix: typings for xml2js, also when running tests
gundelsby Sep 26, 2019
be3df0f
wip: adlibs shelf inspector with editor for Nora content
gundelsby Sep 26, 2019
fd76558
wip: xml generation for nora editor
gundelsby Oct 1, 2019
66099e9
chore: make XMLSerializer available for client code when running tests
gundelsby Oct 3, 2019
82669bd
Utility to create XML for Nora plugin based on content payload from A…
gundelsby Oct 8, 2019
c0d2180
wip: Send payload to Nora browser plugin
gundelsby Oct 8, 2019
f0aae75
wip: loading Nora plugin in editor iframe
gundelsby Oct 15, 2019
02e16d4
wip: Started on communication with the Nora browser module
gundelsby Oct 16, 2019
0977a1b
Communicating with Nora plugin without error messages :D
gundelsby Oct 25, 2019
9da81a9
added support for bakskjerm type
gundelsby Nov 5, 2019
8ac97ee
chore: developify version
jstarpl Jan 8, 2020
82bdcb8
Merge branch 'fix/prompter-jumping' into develop
jstarpl Jan 9, 2020
d61cc5b
Merge branch 'fix/prompter-jumping' into develop
jstarpl Jan 9, 2020
6f487ce
Merge branch 'fix/prompter-jumping' into develop
jstarpl Jan 10, 2020
e25735e
wip: initial db structure for buckets
Julusian Feb 12, 2020
fb2323e
feat: bucket adlib ingest and basic playout
Julusian Feb 12, 2020
00f8cde
Merge branch 'master' into feature/mos-plugin
jstarpl Feb 12, 2020
4fb6e38
chore: blueprints integration
Julusian Feb 12, 2020
8c48ac4
fix: refactor inspector
jstarpl Feb 12, 2020
9ff7061
Merge branch 'feature/mos-plugin' into feat/adlib-mos-plugin
jstarpl Feb 12, 2020
a0af2b0
feat: add inspector to Global AdLib tab
jstarpl Feb 12, 2020
5bae9b6
chore: update package.lock
jstarpl Feb 12, 2020
83559fb
chore: refactor mos-specific helper methods away from Nora inspector
jstarpl Feb 12, 2020
61dd000
feat: merge dashboard improvements from #173
jstarpl Feb 12, 2020
b7126b4
Merge branch 'master' into feat/adlib-mos-plugin
jstarpl Feb 12, 2020
d149866
Merge branch 'master' into feat/adlib-mos-plugin
jstarpl Feb 12, 2020
52a3801
chore: add test case of real mos data
Julusian Feb 12, 2020
0949890
feat: generate and parse mos-plugin xml via mos-connection
Julusian Feb 12, 2020
d5093ce
fix: some xml parsing issues
Julusian Feb 13, 2020
9c256d7
feat: support MOS Plugin drag-and-drop
jstarpl Feb 13, 2020
396ad02
chore: add some debug logging for integration development
jstarpl Feb 13, 2020
83c26e9
Merge branch 'master' into feat/adlib-mos-plugin
jstarpl Feb 13, 2020
da277eb
chore: refactor to static properties
jesperstarkar Feb 13, 2020
a658256
chore: refactor Shelf
jstarpl Feb 13, 2020
f90c4b7
feat: show links to shelf layouts in settings
jstarpl Feb 13, 2020
755de12
feat: add API to add new buckets
jstarpl Feb 13, 2020
1d8adb7
feat: show drag-drop hotspots
jstarpl Feb 13, 2020
867ba0f
chore: add the quantel browser mos plugin for testing into public/
jstarpl Feb 13, 2020
1d79474
fix: make sure the origin is correct in sendMOSMessage
jstarpl Feb 13, 2020
03e5ca8
chore: update quantel-browser plugin
jstarpl Feb 13, 2020
278d896
chore: another fix in quantel plugin
jstarpl Feb 13, 2020
69101d8
chore: another fix for quantel-browser
jstarpl Feb 13, 2020
3403640
chore: update quantel-browser
jstarpl Feb 13, 2020
81d6513
chore: update quantel-browser
jstarpl Feb 13, 2020
254c16f
chore: update quantel-browser
jstarpl Feb 14, 2020
b22fd78
chore: update quantel-plugin
jstarpl Feb 14, 2020
5c15d3e
chore: update quantel-browser
jstarpl Feb 14, 2020
d9d90fe
feat(Prompter): Initial support for Nintendo Joy-con controller thoru…
jesperstarkar Feb 14, 2020
29d1608
chore: refactor to static properties
jesperstarkar Feb 13, 2020
a6c5f28
feat(Prompter): Initial support for Nintendo Joy-con controller thoru…
jesperstarkar Feb 14, 2020
43c0726
chore: update quantel-plugin
jstarpl Feb 14, 2020
87088b1
chore: update quantel-browser
jstarpl Feb 14, 2020
d97d7bf
fix: some mos item xml parsing
Julusian Feb 14, 2020
ddc4496
chore: update quantel-browser
jstarpl Feb 14, 2020
f75862f
fix: use xml2js from mos-connection
Julusian Feb 14, 2020
0527fd9
feat: create expectedMedaItems for bucket AdLibs
jstarpl Feb 14, 2020
b33afba
fix(Prompter): Allow for multiple controllers.
jesperstarkar Feb 14, 2020
900bc7a
fix: remove bucketAdLibs along with the bucket
jstarpl Feb 14, 2020
13687b7
Merge branch 'feat/joycon-prompter-controller' into feat/adlibs-and-p…
jesperstarkar Feb 14, 2020
c189964
Merge branch 'feat/adlib-mos-plugin' into feat/adlibs-and-prompter
jstarpl Feb 14, 2020
4c7cb8b
fix: missing import
jstarpl Feb 14, 2020
aded439
Merge branch 'feat/adlibs-and-prompter' into feat/adlib-mos-plugin
jstarpl Feb 14, 2020
77c3dcc
Merge branch 'master' into feat/adlib-mos-plugin
Julusian Feb 14, 2020
cbf3eeb
feat(dashboard): allow hiding utility panels
jstarpl Nov 28, 2019
f4b89ac
fix: Shelf hiding
eol-account Nov 28, 2019
434ead1
fix: dashboard panel max-height with search box enabled
jstarpl Feb 14, 2020
1b99415
fix: minor tweaks
jstarpl Feb 14, 2020
21eb263
feat: add more bucket management APIs
jstarpl Feb 18, 2020
0885747
fix: some unruly condition in DashboardPieceButton
jstarpl Feb 18, 2020
b3296c7
feat: UI properties for Buckets
jstarpl Feb 21, 2020
a9c1631
feat: refactor Buckets
jstarpl Feb 24, 2020
f4e2116
Merge branch 'master' into feat/adlib-mos-plugin
jstarpl Feb 24, 2020
d4113c3
feat: bucket management
jstarpl Feb 25, 2020
8fb4654
feat: sorting buckets
jstarpl Feb 27, 2020
4e33a32
feat: support dropping into multiple buckets
jstarpl Feb 27, 2020
41e8ca4
fix: bucket creation auto-rename
jstarpl Feb 27, 2020
8d55896
fix: empty a bucket
jstarpl Feb 27, 2020
29cb9ad
fix: disable press-down for context-menu if not a touch-only device
jstarpl Feb 27, 2020
4d1aca8
fix: streamdeck stylesheet
jstarpl Mar 3, 2020
b2c5c88
feat: moving across buckets (WIP)
jstarpl Mar 3, 2020
238b300
feat: finish bucket adlib management functions
jstarpl Mar 9, 2020
5efc5e4
Merge branch 'master' into feat/adlib-mos-plugin
jstarpl Mar 18, 2020
6f906e5
chore: update blueprints-integration package
jstarpl Mar 18, 2020
5e4ebac
wip: initial db structure for buckets
Julusian Feb 12, 2020
c45a687
feat: bucket adlib ingest and basic playout
Julusian Feb 12, 2020
1fecb95
chore: blueprints integration
Julusian Feb 12, 2020
0571a21
Created Shelf Inspector component
gundelsby Aug 30, 2019
cd6d97c
fix: typings for xml2js, also when running tests
gundelsby Sep 26, 2019
2331451
wip: adlibs shelf inspector with editor for Nora content
gundelsby Sep 26, 2019
341462b
wip: xml generation for nora editor
gundelsby Oct 1, 2019
342982f
chore: make XMLSerializer available for client code when running tests
gundelsby Oct 3, 2019
4e7ffce
Utility to create XML for Nora plugin based on content payload from A…
gundelsby Oct 8, 2019
c6e2f38
wip: Send payload to Nora browser plugin
gundelsby Oct 8, 2019
37a3679
wip: loading Nora plugin in editor iframe
gundelsby Oct 15, 2019
0d70c56
wip: Started on communication with the Nora browser module
gundelsby Oct 16, 2019
6a886dd
Communicating with Nora plugin without error messages :D
gundelsby Oct 25, 2019
b5c400d
added support for bakskjerm type
gundelsby Nov 5, 2019
993e764
fix: refactor inspector
jstarpl Feb 12, 2020
e587117
feat: add inspector to Global AdLib tab
jstarpl Feb 12, 2020
30b9ac8
chore: refactor mos-specific helper methods away from Nora inspector
jstarpl Feb 12, 2020
cd1d432
feat: merge dashboard improvements from #173
jstarpl Feb 12, 2020
0ceb8e8
chore: add test case of real mos data
Julusian Feb 12, 2020
6616b92
feat: generate and parse mos-plugin xml via mos-connection
Julusian Feb 12, 2020
9b8e3ed
fix: some xml parsing issues
Julusian Feb 13, 2020
e1876a9
feat: support MOS Plugin drag-and-drop
jstarpl Feb 13, 2020
e1a83e0
chore: add some debug logging for integration development
jstarpl Feb 13, 2020
f254347
chore: refactor Shelf
jstarpl Feb 13, 2020
c8f264f
feat: show links to shelf layouts in settings
jstarpl May 5, 2020
928caab
feat: add API to add new buckets
jstarpl Feb 13, 2020
6ba5d61
feat: show drag-drop hotspots
jstarpl Feb 13, 2020
37763a1
chore: add the quantel browser mos plugin for testing into public/
jstarpl Feb 13, 2020
805f140
fix: make sure the origin is correct in sendMOSMessage
jstarpl Feb 13, 2020
1050395
chore: update quantel-browser plugin
jstarpl Feb 13, 2020
af02290
chore: another fix in quantel plugin
jstarpl Feb 13, 2020
0892e1b
chore: another fix for quantel-browser
jstarpl Feb 13, 2020
d5b3b87
chore: update quantel-browser
jstarpl Feb 13, 2020
98d4a2e
chore: update quantel-browser
jstarpl Feb 13, 2020
658a006
chore: update quantel-browser
jstarpl Feb 14, 2020
352e022
chore: update quantel-plugin
jstarpl Feb 14, 2020
b7c664a
chore: update quantel-browser
jstarpl Feb 14, 2020
96460b1
chore: refactor to static properties
jesperstarkar Feb 13, 2020
54709ae
feat(Prompter): Initial support for Nintendo Joy-con controller thoru…
jesperstarkar Feb 14, 2020
48a341c
chore: update quantel-plugin
jstarpl Feb 14, 2020
d3bf1a4
chore: update quantel-browser
jstarpl Feb 14, 2020
7f3c301
fix: some mos item xml parsing
Julusian Feb 14, 2020
61fb28a
chore: update quantel-browser
jstarpl Feb 14, 2020
56165dc
fix: use xml2js from mos-connection
Julusian Feb 14, 2020
a70a90e
feat: create expectedMedaItems for bucket AdLibs
jstarpl Feb 14, 2020
0286d48
fix: remove bucketAdLibs along with the bucket
jstarpl Feb 14, 2020
597878f
fix: missing import
jstarpl Feb 14, 2020
f284810
fix(Prompter): Allow for multiple controllers.
jesperstarkar Feb 14, 2020
1026bda
feat(dashboard): allow hiding utility panels
jstarpl Nov 28, 2019
1596779
fix: dashboard panel max-height with search box enabled
jstarpl Feb 14, 2020
0a6fd13
fix: minor tweaks
jstarpl Feb 14, 2020
c447da3
feat: add more bucket management APIs
jstarpl Feb 18, 2020
608ce0e
feat: UI properties for Buckets
jstarpl Feb 21, 2020
833d12c
feat: refactor Buckets
jstarpl Feb 24, 2020
8025cc8
feat: bucket management
jstarpl Feb 25, 2020
1eb384c
feat: sorting buckets
jstarpl Feb 27, 2020
a30d71f
feat: support dropping into multiple buckets
jstarpl Feb 27, 2020
cb427ed
fix: bucket creation auto-rename
jstarpl Feb 27, 2020
98f1b50
fix: empty a bucket
jstarpl Feb 27, 2020
f04dc47
fix: disable press-down for context-menu if not a touch-only device
jstarpl Feb 27, 2020
a5ff153
fix: streamdeck stylesheet
jstarpl Mar 3, 2020
a7d45d6
feat: moving across buckets (WIP)
jstarpl Mar 3, 2020
76a753f
feat: finish bucket adlib management functions
jstarpl Mar 9, 2020
1dd472c
Merge branch 'feat/adlib-mos-plugin' of github.com:nrkno/tv-automatio…
jstarpl May 7, 2020
6a7c62e
feat: remove unused imports
jstarpl May 7, 2020
fd5f41a
fix: import
jstarpl May 7, 2020
f93bb7a
chore: fix tests running
jstarpl May 7, 2020
ee32f34
fix: check getAdLibItem method
jstarpl May 7, 2020
20f9750
feat: get buckets branch to work again
jstarpl May 7, 2020
b9cd052
fix: subscribe only to relevant buckets
jstarpl May 7, 2020
a96b297
chore: fix tests
jstarpl May 8, 2020
e3121eb
Merge branch 'master' into feat/adlib-mos-plugin
jstarpl May 14, 2020
0388cef
chore: remove leftover copy of quantel-browser
jstarpl May 14, 2020
a447b5a
chore: update blueprints-integration
jstarpl May 14, 2020
134da6b
fix: problem with buckets management calls
jstarpl May 14, 2020
5beacbf
fix: target rundown selection when importing for bucket adlibs
jstarpl May 15, 2020
68157d2
fix: adlib bucket rundown selection when playlist inactive
jstarpl May 15, 2020
9524fbc
fix: allow the same adLib in multiple buckets
jstarpl May 20, 2020
acf756f
Merge branch 'master' into feat/adlib-mos-plugin
jstarpl May 26, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ The prompter can be controlled by different types of controllers. Which mode is
| Default | Controlled by both mouse and keyboard |
| `?mode=mouse` | Controlled by mouse only |
| `?mode=keyboard` | Controlled by keyboard only |
| `?mode=shuttlekeyboard` | Controlled by a Contour-ShuttleXpress or X-keys, configured as keyboard-inputs (see below) |
| `?mode=shuttlekeyboard` | Controlled by a Contour-ShuttleXpress or X-keys, configured as keyboard-inputs (see below) |
| `?mode=joycon` | Controlled by a Nintendo Joy-con controller over the HTML5 Gamepad API |

### Customize looks

Expand Down Expand Up @@ -162,6 +163,9 @@ Config-files to be used in respective config software:
* [Contour ShuttleXpress](resources/prompter_layout_shuttlexpress.pref)
* [X-keys](resources/prompter_layout_xkeys.mw3)

### Control using Nintendo Joy-con controlelr

This mode is intended to be used when having a Nintendo Joy-con. This wireless handheld controller works over Bluetooth and with the native HTML5 Gamepad API in the client.

# For developers

Expand Down
2 changes: 2 additions & 0 deletions meteor/client/__tests__/jest-setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// used by code creating XML with the DOM API to return an XML string
global.XMLSerializer = require('xmldom').XMLSerializer
9 changes: 5 additions & 4 deletions meteor/client/lib/UIStateStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import * as _ from 'underscore'
export namespace UIStateStorage {
let _collapsedState: {
[key: string]: {
[key: string]: boolean | BooleanMap | string | number
_modified: number | null
[key: string]: boolean | BooleanMap | string | number | null
}
} = {}
const NAMESPACE = 'uiState'
Expand All @@ -22,9 +23,9 @@ export namespace UIStateStorage {
}
_cleanUp()

export function setItem (scope: string, tag: string, value: boolean | BooleanMap | string | number) {
export function setItem (scope: string, tag: string, value: boolean | BooleanMap | string | number, permament?: boolean) {
_collapsedState[scope] = _collapsedState[scope] || {}
_collapsedState[scope]['_modified'] = Date.now()
_collapsedState[scope]['_modified'] = permament ? null : Date.now()
_collapsedState[scope][tag] = value
_persist()
}
Expand All @@ -46,7 +47,7 @@ export namespace UIStateStorage {
}

export function getItem (scope: string, tag: string, defaultValue: boolean | BooleanMap | string | number | undefined): boolean | BooleanMap | string | number | undefined {
return (_collapsedState[scope] || {})[tag] !== undefined ? _collapsedState[scope][tag] : defaultValue
return (_collapsedState[scope] || {})[tag] !== undefined ? (_collapsedState[scope][tag] || undefined) : defaultValue
}

function _persist () {
Expand Down
56 changes: 56 additions & 0 deletions meteor/client/lib/data/mos/__tests__/plugin-support.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import { createMosAppInfoXmlString } from "../plugin-support"
import * as parser from 'xml2json'

describe('createMosAppInfoXmlString', () => {
const xmlString = createMosAppInfoXmlString()

it('should return a string that is a valid XML document', () => {
expect(typeof xmlString).toEqual('string')
parser.toJson(xmlString) // will throw if invalid
})

describe('XML document', () => {
const doc: any = parser.toJson(xmlString, { object: true })

it('the root node should be named mos', () => {
const nodeNames = Object.keys(doc)

expect(nodeNames.length).toEqual(1)
expect(nodeNames[ 0 ]).toEqual('mos')
})

describe('mos node contents', () => {
const mos = doc.mos

//TODO: this should either be the official Sofie name or possibly the instance name?
it('node ncsID should be sofie-core', () => {
const expected = 'sofie-core'

const actual = mos.ncsID

expect(actual).toEqual(expected)
})

//TODO: this is completely bogus. The Nora plugin doesn't actually check the values
describe('node ncsAppInfo', () => {
const ncsAppInfo = mos.ncsAppInfo
describe('node ncsInformation', () => {
const ncsInformation = ncsAppInfo.ncsInformation

it('node userID should contain something', () => {
const actual = ncsInformation.userID

expect(actual).toEqual(expect.anything())
})

it('node software should contain something', () => {
const actual = ncsInformation.software

expect(actual).toEqual(expect.anything())
})
})
})
})
})

})
130 changes: 130 additions & 0 deletions meteor/client/lib/data/mos/plugin-support.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
import { isArray } from 'util'

const PackageInfo = require('../../../../package.json')

export enum AckStatus {
ACK = 'ACK',
Error = 'ERROR'
}

export enum UIMetricMode {
Contained = 'CONTAINED',
NonModal = 'NONMODAL',
Toolbar = 'TOOLBAR',
ModalDialog = 'MODALDIALOG'
}

export enum Events {
/** Event is emitted every now-and-then, generally to be used for simple displays */
'dragenter' = 'sofie:dragEnter',
/** event is emitted with a very high frequency (60 Hz), to be used sparingly as
* hooking up Components to it will cause a lot of renders
*/
'dragleave' = 'sofie:dragLeave'
}

export interface UIMetric {
startx: number
starty: number
endx: number
endy: number
mode: UIMetricMode
canClose?: boolean
}

export function createMosItemRequest () {
const doc = objectToXML({
ncsItemRequest: {}
},
'mos')

return new XMLSerializer().serializeToString(doc)
}

export function createMosAckString (status?: AckStatus, statusDescription?: string):string {
const doc = objectToXML({
ncsAck: {
status,
statusDescription
}
},
'mos')

return new XMLSerializer().serializeToString(doc)
}

export function createMosAppInfoXmlString (uiMetrics?: UIMetric[]):string {
const doc = objectToXML({
ncsID: 'sofie-core',
ncsAppInfo: {
ncsInformation: {
userID: 'sofie system',
runContext: 'BROWSE',
software: {
manufacturer: 'Sofie Project',
product: 'Sofie TV Automation',
version: PackageInfo.version || 'UNSTABLE'
},
uiMetric: uiMetrics ? uiMetrics.map((metric, index) => {
return Object.assign({}, metric, {
_attributes: {
num: index.toString()
}
})
}) : undefined
}
}
},
'mos')

return new XMLSerializer().serializeToString(doc)
}

export function objectToXML (obj: object, rootName: string): Document {
const doc = new Document()
const root = doc.createElement(rootName)

addNodes(obj, root)

doc.appendChild(root)
return doc
}

function addNodes (obj: object, rootNode: Node): void {
const doc = rootNode.ownerDocument

for (const name of Object.keys(obj)) {
const value = obj[ name ]

if (typeof value === 'object' && name === '_attributes') {
for (const attrName of Object.keys(value)) {
rootNode.appendChild(createAttribute(attrName, value[attrName], doc))
}
} else if (isArray(value)) {
value.forEach((element) => {
rootNode.appendChild(createNode(name, element, doc))
})
} else if (value !== undefined) {
rootNode.appendChild(createNode(name, value, doc))
}
}
}

function createAttribute(name: string, value: any, doc:Document) {
const attr = doc.createAttribute(name)
attr.textContent = value

return attr
}

function createNode(name:string, value:any, doc:Document) {
const node = doc.createElement(name)

if (typeof value === 'object' && value !== null) {
addNodes(value, node)
} else {
node.textContent = value
}

return node
}
12 changes: 12 additions & 0 deletions meteor/client/lib/data/nora/browser-plugin-data.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { PieceGeneric } from '../../../../lib/collections/Pieces'
import { NoraContent } from 'tv-automation-sofie-blueprints-integration'
import { generateMosPluginItemXml } from '../../parsers/mos/mosXml2Js'

export function createMosObjectXmlStringNoraBluePrintPiece (piece: PieceGeneric): string {
const noraContent = piece.content as NoraContent | undefined
if (!noraContent || !noraContent.externalPayload) {
throw new Error('Not a Nora blueprint piece')
}

return generateMosPluginItemXml(noraContent.externalPayload)
}
17 changes: 17 additions & 0 deletions meteor/client/lib/invalidatingTime.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Tracker } from 'meteor/tracker'
import { getCurrentTime } from '../../lib/lib'

/** Invalidate a reactive computation after a given amount of time */
export function invalidateAfter(timeout: number): void {
const time = new Tracker.Dependency
time.depend()
setTimeout(() => {
time.changed()
}, timeout)
}

/** Invalidate a reactive computation after when a given time is reached */
export function invalidateAt(timestamp: number): void {
const timeout = Math.max(0, timestamp - getCurrentTime())
invalidateAfter(timeout)
}
15 changes: 15 additions & 0 deletions meteor/client/lib/lib.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,21 @@ function isEventInInputField (e: Event) {
return (e && e.target && ['textarea', 'input'].indexOf(e.target.localName + '') !== -1)
}

export function contextMenuHoldToDisplayTime(): number {
return isTouchDevice() ? 1000 : -1
}

let touchDeviceCache: undefined | boolean = undefined
export function isTouchDevice(): boolean {
if (touchDeviceCache !== undefined) return touchDeviceCache

touchDeviceCache = false
if (window.matchMedia("(pointer: coarse)").matches) {
touchDeviceCache = true
}
return touchDeviceCache
}

const loadScriptCache: {[url: string]: {
status: 'loading' | 'ok',
callbacks: Array<(err?: any) => void>
Expand Down
3 changes: 3 additions & 0 deletions meteor/client/lib/parsers/mos/__tests__/mosReqAppInfo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<mos>
<ncsReqAppInfo/>
</mos>
90 changes: 90 additions & 0 deletions meteor/client/lib/parsers/mos/__tests__/mosSample1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
"ID": "6",
"Slug": "Uten tittel-6",
"ObjectID": "5c16aa49-cf36-440d-9d9a-138558665715",
"MOSID": "GFX.NRK.MOS",
"mosAbstract": "202 Bilde (00:00, Auto/OnNext): Hennie som French",
"MosExternalMetaData": [
{
"MosScope": "PLAYLIST",
"MosSchema": "http://nora.core.mesosint.nrk.no/mos/content",
"MosPayload": {
"uuid": "0cdd0edd-1e10-4e38-b970-b6661bbe1376",
"metadata": {
"modul": "nora.module.browser",
"selection": {
"design": {
"displayName": "Nyheter",
"id": "nyheter"
},
"type": {
"displayName": "bakskjerm",
"id": "bakskjerm"
},
"mal": {
"displayName": "202 Bilde",
"id": "202_bilde"
}
},
"name": {
"time": "(00:00, Auto/OnNext)",
"templateName": "202 Bilde",
"templateVariant": "",
"content": "Hennie som French",
"full": "202 Bilde (00:00, Auto/OnNext): Hennie som French"
},
"type": "bakskjerm",
"userContext": {
"userContext": {
"ncsID": "MAENPSTEST11",
"changedBy": "N23109",
"software": {
"manufacturer": "AP",
"product": "ENPS Client",
"version": 8
}
},
"changed": "2018-08-30-T17:56:41"
}
},
"template": {
"channel": "gfx3",
"system": "html",
"name": "202_bilde",
"layer": "bakskjerm"
},
"content": {
"bilde": {
"text": 0,
"creators": "ØYSTEIN TRONSLI DRABLØS / FRILAND/DAVID BLOOMER",
"credit": "",
"title": "Hennie som French",
"w": 0.8462222,
"format": "image/jpeg",
"width": 1920,
"x": 0.07688889,
"h": 1,
"y": 0,
"id": "QdncIGkD-IU8W5Ff5QBoIA",
"type": "image/jpeg",
"uri": "QdncIGkD-IU8W5Ff5QBoIARqUM5XjlRKIhner2t9Dsxg",
"quality": 0.9,
"height": 1080,
"url": "https://some-url"
}
}
}
},
{
"MosScope": "PLAYLIST",
"MosSchema": "http://nora.core.mesosint.nrk.no/mos/timing",
"MosPayload": {
"out": "onNext",
"text": 0,
"timeIn": 0,
"duration": 5000,
"in": "auto"
}
}
]
}
Loading