@knight-lab/timelinejs 3.9.4 → 3.9.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knight-lab/timelinejs",
3
- "version": "3.9.4",
3
+ "version": "3.9.6",
4
4
  "license": "MPL-2.0",
5
5
  "description": "TimelineJS v3: A Storytelling Timeline built in JavaScript, made by Northwestern University Knight Lab.",
6
6
  "dependencies": {
@@ -89,7 +89,7 @@ export function lookupMediaType(m, image_only) {
89
89
  {
90
90
  type: "twitter",
91
91
  name: "Twitter",
92
- match_str: "^(https?:)?\/*(www.)?twitter\.com",
92
+ match_str: "^(https?:)?\/*(www.)?(twitter|x)\.com",
93
93
  cls: Twitter
94
94
  },
95
95
  {
@@ -247,4 +247,4 @@ export function lookupMediaType(m, image_only) {
247
247
  }
248
248
  }
249
249
  return false;
250
- }
250
+ }
@@ -12,7 +12,7 @@ export default class Twitter extends Media {
12
12
  this._el.content_container.className = "tl-media-content-container tl-media-content-container-text";
13
13
 
14
14
  // Get Media ID
15
- if (this.data.url.match("^(https?:)?\/*(www.)?twitter\.com")) {
15
+ if (this.data.url.match("^(https?:)?\/*(www.)?(twitter|x)\.com")) {
16
16
  if (this.data.url.match("status\/")) {
17
17
  this.media_id = this.data.url.split("status\/")[1];
18
18
  } else if (this.data.url.match("statuses\/")) {
@@ -70,8 +70,8 @@ export default class Twitter extends Media {
70
70
  // Open links in new window
71
71
  tweet_text = tweet_text.replace(/<a href/ig, '<a target="_blank" rel="noopener" href');
72
72
 
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
75
75
  loadJS('https://platform.twitter.com/widgets.js', function() {
76
76
  twttr.widgets.createTweet(self.media_id, self._el.content_item, {
77
77
  conversation: 'none', // or all
@@ -117,4 +117,4 @@ export default class Twitter extends Media {
117
117
  _updateMediaDisplay() {
118
118
 
119
119
  }
120
- }
120
+ }
@@ -458,7 +458,9 @@ class Timeline {
458
458
 
459
459
 
460
460
  // Update Display
461
- this._updateDisplay(this._timenav.options.height, true, 2000);
461
+ // don't pass the height, since it gets computed
462
+ // and passing it leads to accidental duplicate adjustments
463
+ this._updateDisplay() // this._timenav.options.height, true, 2000);
462
464
 
463
465
  }
464
466
 
@@ -695,7 +697,9 @@ class Timeline {
695
697
 
696
698
  var height = 0;
697
699
 
698
- if (timenav_height) {
700
+ if (false) {
701
+ // was if (timenav_height) but that led to repetitive application
702
+ // of the padding adjustment at the en
699
703
  height = timenav_height;
700
704
  } else {
701
705
  if (this.options.timenav_height_percentage || timenav_height_percentage) {