|
@@ -648,6 +648,49 @@ Copyright (c) 2014-2018 Nikolai Suslov and the Krestianstvo.org project contribu
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ gridListItemWithIco(obj) {
|
|
|
+ return {
|
|
|
+ $type: "div",
|
|
|
+ class: "mdc-layout-grid__cell mdc-layout-grid__cell--span-2 tooltip " + obj.styleClass,
|
|
|
+ $components:[
|
|
|
+ {
|
|
|
+ class: "tooltiptext",
|
|
|
+ $type: "span",
|
|
|
+ $text: obj.title
|
|
|
+ },
|
|
|
+ // {
|
|
|
+
|
|
|
+ // $type: "button",
|
|
|
+ // class: "mdc-button",
|
|
|
+ // onclick: obj.onclickfunc,
|
|
|
+ // $components:[
|
|
|
+ // {
|
|
|
+
|
|
|
+ // $type: "i",
|
|
|
+ // class: "material-icons mdc-button__icon",
|
|
|
+ // $text: obj.imgSrc
|
|
|
+ // }
|
|
|
+ // ]
|
|
|
+ // }
|
|
|
+ {
|
|
|
+ $type: "div",
|
|
|
+ style: "background-color: transparent;",
|
|
|
+ $components:[
|
|
|
+ {
|
|
|
+ $type: "i",
|
|
|
+ class: "material-icons mdc-list-item__graphic",
|
|
|
+ 'aria-hidden': "true",
|
|
|
+ $text: obj.imgSrc,
|
|
|
+ onclick: obj.onclickfunc
|
|
|
+ }
|
|
|
+
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
gridListItem(obj) {
|
|
|
return {
|
|
|
$type: "div",
|
|
@@ -972,48 +1015,55 @@ Copyright (c) 2014-2018 Nikolai Suslov and the Krestianstvo.org project contribu
|
|
|
|
|
|
}
|
|
|
|
|
|
- reflectorGUI() {
|
|
|
+ streamMsgConfig() {
|
|
|
|
|
|
- let self = this;
|
|
|
+ return {
|
|
|
|
|
|
- let webrtcConnection = {
|
|
|
$cell: true,
|
|
|
+ _streamMsgConfig: null,
|
|
|
$components: [
|
|
|
{
|
|
|
$type: "p",
|
|
|
class: "mdc-typography--headline5",
|
|
|
- $text: "Use WebRTC for connection"
|
|
|
+ $text: "Use Stream of Messages"
|
|
|
},
|
|
|
{
|
|
|
$type: 'p'
|
|
|
},
|
|
|
_app.widgets.switch({
|
|
|
- 'id': 'forceWebRTC',
|
|
|
+ 'id': 'streamMsgConfig',
|
|
|
'init': function () {
|
|
|
this._switch = new mdc.switchControl.MDCSwitch(this);
|
|
|
let config = localStorage.getItem('lcs_config');
|
|
|
- this._switch.checked = JSON.parse(config).webrtc;
|
|
|
-
|
|
|
- // this._replaceSwitch = this._switch;
|
|
|
- this.addEventListener('change',
|
|
|
- function (e) {
|
|
|
+ this._switch.checked = JSON.parse(config).streamMsg;
|
|
|
+ this.addEventListener('change',
|
|
|
+ function (e) {
|
|
|
|
|
|
if (this._switch) {
|
|
|
let chkAttr = this._switch.checked;//this.getAttribute('checked');
|
|
|
if (chkAttr) {
|
|
|
let config = JSON.parse(localStorage.getItem('lcs_config'));
|
|
|
- config.webrtc = true;
|
|
|
+ config.streamMsg = true;
|
|
|
localStorage.setItem('lcs_config', JSON.stringify(config));
|
|
|
+ //update _app
|
|
|
+ if(_app){
|
|
|
+ _app.streamMsg = config.streamMsg;
|
|
|
+ }
|
|
|
+
|
|
|
//this._switch.checked = false;
|
|
|
} else {
|
|
|
let config = JSON.parse(localStorage.getItem('lcs_config'));
|
|
|
- config.webrtc = false;
|
|
|
+ config.streamMsg = false;
|
|
|
localStorage.setItem('lcs_config', JSON.stringify(config));
|
|
|
+ //update _app
|
|
|
+ if(_app){
|
|
|
+ _app.streamMsg = config.streamMsg;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- )
|
|
|
+ )
|
|
|
+ // this._replaceSwitch = this._switch;
|
|
|
|
|
|
},
|
|
|
'onchange': ""
|
|
@@ -1021,51 +1071,58 @@ Copyright (c) 2014-2018 Nikolai Suslov and the Krestianstvo.org project contribu
|
|
|
),
|
|
|
{
|
|
|
$type: 'label',
|
|
|
- for: 'input-forceWebRTC',
|
|
|
+ for: 'input-streamMsgConfig',
|
|
|
$text: 'On / Off'
|
|
|
}
|
|
|
|
|
|
]
|
|
|
- }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ reflectorGUI() {
|
|
|
|
|
|
- let streamMsgConfig = {
|
|
|
+ let self = this;
|
|
|
|
|
|
+ let webrtcConnection = {
|
|
|
$cell: true,
|
|
|
- _streamMsgConfig: null,
|
|
|
$components: [
|
|
|
{
|
|
|
$type: "p",
|
|
|
class: "mdc-typography--headline5",
|
|
|
- $text: "Use Stream of Messages"
|
|
|
+ $text: "Use WebRTC for connection"
|
|
|
},
|
|
|
{
|
|
|
$type: 'p'
|
|
|
},
|
|
|
_app.widgets.switch({
|
|
|
- 'id': 'streamMsgConfig',
|
|
|
+ 'id': 'forceWebRTC',
|
|
|
'init': function () {
|
|
|
this._switch = new mdc.switchControl.MDCSwitch(this);
|
|
|
let config = localStorage.getItem('lcs_config');
|
|
|
- this._switch.checked = JSON.parse(config).streamMsg;
|
|
|
- this.addEventListener('change',
|
|
|
- function (e) {
|
|
|
+ this._switch.checked = JSON.parse(config).webrtc;
|
|
|
+
|
|
|
+ // this._replaceSwitch = this._switch;
|
|
|
+ this.addEventListener('change',
|
|
|
+ function (e) {
|
|
|
|
|
|
if (this._switch) {
|
|
|
let chkAttr = this._switch.checked;//this.getAttribute('checked');
|
|
|
if (chkAttr) {
|
|
|
let config = JSON.parse(localStorage.getItem('lcs_config'));
|
|
|
- config.streamMsg = true;
|
|
|
+ config.webrtc = true;
|
|
|
localStorage.setItem('lcs_config', JSON.stringify(config));
|
|
|
//this._switch.checked = false;
|
|
|
} else {
|
|
|
let config = JSON.parse(localStorage.getItem('lcs_config'));
|
|
|
- config.streamMsg = false;
|
|
|
+ config.webrtc = false;
|
|
|
localStorage.setItem('lcs_config', JSON.stringify(config));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- )
|
|
|
- // this._replaceSwitch = this._switch;
|
|
|
+
|
|
|
+ )
|
|
|
|
|
|
},
|
|
|
'onchange': ""
|
|
@@ -1073,12 +1130,14 @@ Copyright (c) 2014-2018 Nikolai Suslov and the Krestianstvo.org project contribu
|
|
|
),
|
|
|
{
|
|
|
$type: 'label',
|
|
|
- for: 'input-streamMsgConfig',
|
|
|
+ for: 'input-forceWebRTC',
|
|
|
$text: 'On / Off'
|
|
|
}
|
|
|
|
|
|
]
|
|
|
- }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
let multiSocket = {
|
|
|
$cell: true,
|
|
@@ -1437,7 +1496,7 @@ Copyright (c) 2014-2018 Nikolai Suslov and the Krestianstvo.org project contribu
|
|
|
{
|
|
|
$type: "div",
|
|
|
class: "mdc-layout-grid__cell mdc-layout-grid__cell--span-12",
|
|
|
- $components: [streamMsgConfig ]
|
|
|
+ $components: [self.streamMsgConfig() ]
|
|
|
},
|
|
|
// {
|
|
|
// $type: "div",
|