Skip to content

Commit ab41a80

Browse files
committed
Remove "open in detail view" button
1 parent 91ac109 commit ab41a80

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

libs/pandautils/src/main/java/com/instructure/pandautils/utils/HtmlContentFormatter.kt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class HtmlContentFormatter(
6666
if (studioEmbedImprovementsEnabled) {
6767
val videoTitle = extractVideoTitle(iframe)
6868
val immersiveUrl = convertStudioEmbedToImmersiveView(srcUrl, videoTitle)
69-
val newIframe = iframeWithStudioButton(immersiveUrl, iframe, context)
69+
val newIframe = iframeWithStudioEmbed(immersiveUrl, iframe)
7070
newHTML = newHTML.replace(iframe, newIframe)
7171
}
7272
} else if (hasStudioMediaUrl(srcUrl)) {
@@ -78,7 +78,7 @@ class HtmlContentFormatter(
7878
if (studioEmbedImprovementsEnabled) {
7979
val videoTitle = extractVideoTitle(iframe)
8080
val immersiveUrl = convertToImmersiveViewUrl(srcUrl, videoTitle)
81-
val newIframe = iframeWithStudioButton(immersiveUrl, iframe, context)
81+
val newIframe = iframeWithStudioEmbed(immersiveUrl, iframe)
8282
newHTML = newHTML.replace(iframe, newIframe)
8383
}
8484
} else if (hasExternalTools(srcUrl)) {
@@ -172,11 +172,10 @@ class HtmlContentFormatter(
172172
}
173173
}
174174

175-
private fun iframeWithStudioButton(immersiveUrl: String, iframe: String, context: Context): String {
176-
val buttonText = context.getString(R.string.openInDetailView)
175+
private fun iframeWithStudioEmbed(immersiveUrl: String, iframe: String): String {
177176
val escapedUrl = immersiveUrl.replace("&", "&")
178177

179-
val htmlButton = "</br><p><div class=\"lti_button\" onClick=\"location.href='$escapedUrl'\">$buttonText</div></p>"
178+
val htmlButton = "</br><p><div class=\"studio_embed\" onClick=\"location.href='$escapedUrl'\"></div></p>"
180179
return iframe + htmlButton
181180
}
182181

@@ -291,7 +290,9 @@ class HtmlContentFormatter(
291290
// The launch type parameters are URL-encoded within the nested url parameter
292291
val normalizedText = text?.replace("&amp;", "&") ?: ""
293292
return (normalizedText.contains("custom_arc_launch_type%3Dthumbnail_embed") ||
294-
normalizedText.contains("custom_arc_launch_type%3Dlearn_embed"))
293+
normalizedText.contains("custom_arc_launch_type%3Dlearn_embed") ||
294+
normalizedText.contains("custom_arc_launch_type%3Dcollaboration_embed") ||
295+
normalizedText.contains("custom_arc_launch_type%3Dquiz_embed"))
295296
}
296297
}
297298
}

0 commit comments

Comments
 (0)