diff --git a/CHANGELOG.md b/CHANGELOG.md index 08d2294a..1ea0e7b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,17 @@ # Changelog +## 0.49.12 + +- bug fixes + - dropdown: value update issue on iOS 13 +- widgets + - html: allow `class`, `title` and `style` attributes + ## 0.49.11 - bug fixes - regression (0.49.10) breaking icon with short names (minimum valid length set to 2 characters) - - html widget: content not initialized properly + - html widget: content not initialized properly ## 0.49.10 diff --git a/package.json b/package.json index 9d146aba..b268a3e4 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "open-stage-control", "productName": "Open Stage Control", "description": "Libre and modular OSC / MIDI controller", - "version": "0.49.11", + "version": "0.49.12", "author": { "name": "Jean-Emmanuel Doucet", "email": "jean-emmanuel@ammd.net" diff --git a/src/client/app/ui/ios.js b/src/client/app/ui/ios.js index be04e7e2..20c25b57 100644 --- a/src/client/app/ui/ios.js +++ b/src/client/app/ui/ios.js @@ -2,7 +2,7 @@ var iOS -if (navigator.platform.match(/iPhone|iPod|iPad/)) { +if (navigator.platform.match(/iPhone|iPod|iPad/) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)) { iOS = true diff --git a/src/client/app/widgets/buttons/dropdown.js b/src/client/app/widgets/buttons/dropdown.js index f796e4ba..a40b6318 100644 --- a/src/client/app/widgets/buttons/dropdown.js +++ b/src/client/app/widgets/buttons/dropdown.js @@ -1,7 +1,8 @@ var Widget = require('../common/widget'), {iconify} = require('../../ui/utils'), html = require('nanohtml'), - raw = require('nanohtml/raw') + raw = require('nanohtml/raw'), + iOS = require('../../ui/ios') class Dropdown extends Widget { @@ -81,7 +82,10 @@ class Dropdown extends Widget { this.value = this.values[i] - if (!options.fromLocal) this.select.selectedIndex = i + 1 + if (!options.fromLocal) { + this.select.selectedIndex = i + 1 + if (iOS && document.activeElement === this.select) this.select.blur() + } if (options.send) this.sendValue() if (options.sync) this.changed(options) diff --git a/src/client/app/widgets/plots/html.js b/src/client/app/widgets/plots/html.js index 7a1b7fa0..b49c7075 100644 --- a/src/client/app/widgets/plots/html.js +++ b/src/client/app/widgets/plots/html.js @@ -5,7 +5,11 @@ var Widget = require('../common/widget'), StaticProperties = require('../mixins/static_properties') var sanitizeOptions = { - allowedTags: sanitizeHtml.defaults.allowedTags.concat(['img', 'h1', 'h2']).filter(x=>x!=='iframe') + allowedTags: sanitizeHtml.defaults.allowedTags.concat(['img', 'h1', 'h2']).filter(x=>x!=='iframe'), + allowedAttributes: { + '*': [ 'title', 'class', 'style'], + 'img': [ 'src' , 'title', 'class', 'style', 'width', 'height'] + } } class Html extends StaticProperties(Widget, {bypass: true}) { @@ -27,7 +31,10 @@ class Html extends StaticProperties(Widget, {bypass: true}) { 'Allowed HTML tags:', '  h1-6, blockquote, p, a, ul, ol, nl, li,', '  b, i, strong, em, strike, code, hr, br, div,', - '  table, thead, img, caption, tbody, tr, th, td, pre' + '  table, thead, img, caption, tbody, tr, th, td, pre', + 'Allowed attributes:', + '  <*>: class, style, title', + '  : src, width, height', ]}, border: {type: 'boolean', value: true, help: 'Set to `false` to disable the borders and background-color'},