File tree Expand file tree Collapse file tree 4 files changed +11
-7
lines changed
Expand file tree Collapse file tree 4 files changed +11
-7
lines changed Original file line number Diff line number Diff line change 1+ 3.9.5 (2024-12-13)
2+ -------------------------
3+ * Recognize x.com in URL to trigger tweet embeds
4+
153.9.4 (2024-12-04)
26-------------------------
37* Fix bug in WikipediaImage when float width parameters are sent to WP APIs
Original file line number Diff line number Diff line change 11{
22 "name" : " @knight-lab/timelinejs" ,
3- "version" : " 3.9.4 " ,
3+ "version" : " 3.9.5 " ,
44 "license" : " MPL-2.0" ,
55 "description" : " TimelineJS v3: A Storytelling Timeline built in JavaScript, made by Northwestern University Knight Lab." ,
66 "dependencies" : {
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ export function lookupMediaType(m, image_only) {
8989 {
9090 type : "twitter" ,
9191 name : "Twitter" ,
92- match_str : "^(https?:)?\/*(www.)?twitter\.com" ,
92+ match_str : "^(https?:)?\/*(www.)?( twitter|x) \.com" ,
9393 cls : Twitter
9494 } ,
9595 {
@@ -247,4 +247,4 @@ export function lookupMediaType(m, image_only) {
247247 }
248248 }
249249 return false ;
250- }
250+ }
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ export default class Twitter extends Media {
1212 this . _el . content_container . className = "tl-media-content-container tl-media-content-container-text" ;
1313
1414 // Get Media ID
15- if ( this . data . url . match ( "^(https?:)?\/*(www.)?twitter\.com" ) ) {
15+ if ( this . data . url . match ( "^(https?:)?\/*(www.)?( twitter|x) \.com" ) ) {
1616 if ( this . data . url . match ( "status\/" ) ) {
1717 this . media_id = this . data . url . split ( "status\/" ) [ 1 ] ;
1818 } else if ( this . data . url . match ( "statuses\/" ) ) {
@@ -70,8 +70,8 @@ export default class Twitter extends Media {
7070 // Open links in new window
7171 tweet_text = tweet_text . replace ( / < a h r e f / ig, '<a target="_blank" rel="noopener" href' ) ;
7272
73- if ( tweet_text . includes ( "pic.twitter.com" ) ) {
74-
73+ if ( tweet_text . includes ( "pic.twitter.com" ) || tweet_text . includes ( "pic.x.com" ) ) {
74+ // platform.x.com gets redirected to platform.twitter.com as of 2024-12-13
7575 loadJS ( 'https://platform.twitter.com/widgets.js' , function ( ) {
7676 twttr . widgets . createTweet ( self . media_id , self . _el . content_item , {
7777 conversation : 'none' , // or all
@@ -117,4 +117,4 @@ export default class Twitter extends Media {
117117 _updateMediaDisplay ( ) {
118118
119119 }
120- }
120+ }
You can’t perform that action at this time.
0 commit comments