Skip to content

Commit a2c2c3f

Browse files
committed
smaller fixes
1 parent c51e0b5 commit a2c2c3f

File tree

4 files changed

+40
-30
lines changed

4 files changed

+40
-30
lines changed

www/css/sepiaFW-cards.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,9 @@
748748
font-size: 15px;
749749
max-width: 100%;
750750
}
751+
.sepiaFW-cards-list-body .linkCard .linkCardCenter h3:only-child {
752+
margin: 5px;
753+
}
751754
.sepiaFW-cards-list-body .linkCard .linkCardCenter p {
752755
word-wrap: break-word;
753756
max-width: 100%;

www/scripts/sepiaFW.ui.cards.embed.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,9 +423,13 @@ function sepiaFW_build_ui_cards_embed(){
423423
}
424424

425425
//Specials
426-
thisPlayer.openInExternalPage = function(){
426+
thisPlayer.openInExternalPage = function(givenUrl){
427427
//TODO: implement
428-
SepiaFW.ui.showPopup(SepiaFW.local.g("cant_execute") + " (Coming Soon)");
428+
if (givenUrl){
429+
SepiaFW.ui.actions.openUrlAutoTarget(givenUrl, true);
430+
}else{
431+
SepiaFW.ui.showPopup(SepiaFW.local.g("cant_execute") + " (Coming Soon)");
432+
}
429433
}
430434

431435
//Release resources and remove handler

www/scripts/sepiaFW.ui.cards.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,7 +1278,7 @@ function sepiaFW_build_ui_cards(){
12781278
var rightElement = "<div class='itemRight linkCardRight'><a href='' target='_blank' rel='noopener'><i class='material-icons md-mnu'>&#xE895;</i></a></div>";
12791279
linkCardEle.innerHTML = leftElement
12801280
+ SepiaFW.tools.sanitizeHtml("<div class='itemCenter linkCardCenter'>"
1281-
+ (data.title? ("<h3>" + data.title + "</h3>") : ("")) + "<p>" + description + "</p></div>")
1281+
+ (data.title? ("<h3>" + data.title + "</h3>") : ("")) + (description? ("<p>" + description + "</p></div>") : ""))
12821282
+ rightElement;
12831283
linkCardEle.title = linkUrl || data.title;
12841284
//linkCardEle.setAttribute('data-element', JSON.stringify(cardElementInfo));
@@ -1311,7 +1311,7 @@ function sepiaFW_build_ui_cards(){
13111311
SepiaFW.ui.onclick($(linkCardEle).find('.linkCardRight')[0], function(event){
13121312
event.preventDefault();
13131313
if (embedWebPlayer && typeInfo.mediaPlayer){
1314-
typeInfo.mediaPlayer.openInExternalPage();
1314+
typeInfo.mediaPlayer.openInExternalPage(linkUrl);
13151315
}else if (linkUrl){
13161316
SepiaFW.ui.actions.openUrlAutoTarget(linkUrl, true);
13171317
}else{

www/templates/media-player_template.html

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
//settings previously sent by the widget (widget/app specific etc. - NOTE: avoid autoplay!)
9090
handleSettingsRestore(ev);
9191
}else{
92-
console.error("event", ev);
92+
console.error("event", ev); //DEBUG
9393
}
9494
}
9595

@@ -103,7 +103,7 @@
103103

104104
function handleSettingsRestore(ev){
105105
//any widget specific data submitted by widget itself (either via 'postSettings' or during 'ready')
106-
console.error("Settings", ev.settings);
106+
console.error("Settings", ev.settings); //DEBUG
107107
var settings = ev.settings;
108108
//restore
109109
autoplay = settings.autoplay || false;
@@ -114,33 +114,35 @@
114114

115115
function handleControls(ev){
116116
//play, pause, fadeOut, fadeIn, next, previous, volumeUp, volumeDown, ... tbd
117-
console.error("Controls", ev.controls);
117+
console.error("Controls", ev.controls); //DEBUG
118118
var ctrl = ev.controls;
119-
if (player){
120-
switch (ev.controls){
121-
case "play":
122-
case "fadeIn": //for now just stop (alt.: reduce volume)
123-
player.play();
124-
break;
125-
case "pause":
126-
case "stop":
127-
case "fadeOut": //for now just resume (alt.: restore volume)
128-
player.pause();
129-
break;
130-
case "volumeUp":
131-
case "volumeDown":
132-
//ignore for now
133-
break;
134-
default:
135-
//Error: UnknownEvent
136-
postError("UnknownEvent", "Unknown control event: " + ev.controls, 1);
137-
break;
138-
}
119+
switch (ev.controls){
120+
case "play":
121+
case "fadeIn": //for now just resume (alt.: restore volume)
122+
player.play();
123+
break;
124+
case "pause":
125+
case "stop":
126+
case "fadeOut": //for now just pause (alt.: reduce volume)
127+
player.pause();
128+
break;
129+
case "next":
130+
case "previous":
131+
//TODO: ignored for now
132+
break;
133+
case "volumeUp":
134+
case "volumeDown":
135+
//TODO: ignored for now
136+
break;
137+
default:
138+
//Error: UnknownEvent
139+
postError("UnknownEvent", "Unknown control event: " + ev.controls, 1);
140+
break;
139141
}
140142
}
141143

142144
function handleMediaRequest(ev){
143-
console.error("Media request", ev.mediaRequest);
145+
console.error("Media request", ev.mediaRequest); //DEBUG
144146
var mr = ev.mediaRequest;
145147
/* type: music:
146148
{
@@ -151,7 +153,8 @@
151153
"album": "",
152154
"service": "",
153155
"genre": "",
154-
"uri": ""
156+
"uri": "",
157+
"serviceResult": {...} //specific to service
155158
}*/
156159
var safeRequest = ev.safeRequest; //request came from assistant or private channel?
157160
autoplay = ev.autoplay;
@@ -188,7 +191,7 @@
188191
player.title = title || "";
189192

190193
//Backup settings
191-
restoreSettings.src = player.src
194+
restoreSettings.src = player.src;
192195
restoreSettings.autoplay = false; //this should only be true at actualy requests
193196
restoreSettings.title = player.title;
194197
restoreSettings.preload = player.preload; //add?

0 commit comments

Comments
 (0)