Skip to content

Commit

Permalink
documentcloud.org title param move back to previous naming and defaul…
Browse files Browse the repository at this point in the history
…t to false
  • Loading branch information
garmoncheg committed Nov 4, 2024
1 parent 743632d commit 2b40fed
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions plugins/domains/documentcloud.org.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,13 @@ export default {
"canonical",
"author",
"og-image",
"og-title",
"og-description"
],

// plugin is required to add aspect-ratio and with this fix embeds when used inside iFrame
// https://www.documentcloud.org/help/api#oembed

getMeta: function(og, options) {
var allowTitle = options.getRequestOptions('documentcloud.allowTitle');
if (allowTitle && og.title) {
return {
title: og.title
}
}
},

getLink: function(url, oembed, options) {

Expand All @@ -39,7 +32,7 @@ export default {

if (!/DC\-note/.test(html) && !/DC\-embed(?:\-page)?/.test(html)) {
var page = options.getRequestOptions('documentcloud.page', '1');
var allowTitle = !!options.getRequestOptions('documentcloud.allowTitle');
var title = options.getRequestOptions('documentcloud.title', false);

try {
var iframe = oembed.getIframe();
Expand All @@ -61,9 +54,9 @@ export default {
label: CONFIG.L.page,
value: parseInt (page)
},
allowTitle: {
label: 'Show Title',
value: allowTitle
title: {
label: 'Show title',
value: title
}
}
} catch (ex) {}
Expand Down Expand Up @@ -107,7 +100,8 @@ export default {
'og-description',
'author',
'canonical',
'og-image'
'og-image',
'og-title'
]},
'https://www.documentcloud.org/documents/73991-day-three-documents',
'https://www.documentcloud.org/documents/5766398-ASRS-Reports-for-737-max8.html#document/p2/a486265',
Expand Down

0 comments on commit 2b40fed

Please sign in to comment.