aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2020-03-10 17:52:56 +0300
committerGravatar Vitaly Takmazov2020-03-10 17:52:56 +0300
commitee1ef7c01aa317fe484b1da5e40d108f0ec2e5ef (patch)
tree604b199bd38df75d93a262402bd12ce6e88ce450 /src/main
parentff437b1206824a87c1de051219dd5d054eb309d1 (diff)
Embed Instagram media
Diffstat (limited to 'src/main')
-rw-r--r--src/main/assets/embed.js15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/main/assets/embed.js b/src/main/assets/embed.js
index 6498971c..079d07db 100644
--- a/src/main/assets/embed.js
+++ b/src/main/assets/embed.js
@@ -267,7 +267,20 @@ function getEmbeddableLinkTypes() {
return div;
}
- }
+ },
+ {
+ name: 'Instagram media',
+ id: 'embed_instagram_images',
+ className: 'picture compact',
+ ctsDefault: true,
+ re: /https?:\/\/www\.?instagram\.com(\/p\/\w+)\/?/i,
+ makeNode: function(aNode, reResult, div) {
+ let [url, postId] = reResult;
+ let mediaUrl = `https://instagr.am${postId}/media`;
+ div.innerHTML = `<a href="${aNode.href}"><img src="${mediaUrl}"></a>`;
+ return div;
+ }
+ },
];
}