Change var number to string
This commit is contained in:
		
							parent
							
								
									ff1e82fc1a
								
							
						
					
					
						commit
						a45904e637
					
				| @ -56,7 +56,7 @@ Here you have some parameters to customize your embed timeline: | |||||||
| 
 | 
 | ||||||
| ``` | ``` | ||||||
|     // Maximum amount of toots to get from the user (default: 20) |     // Maximum amount of toots to get from the user (default: 20) | ||||||
|     toots_limit: 20 |     toots_limit: '20' | ||||||
| 
 | 
 | ||||||
|     // Hide boosted toots (default: don't hide) |     // Hide boosted toots (default: don't hide) | ||||||
|     hide_reblog: false |     hide_reblog: false | ||||||
| @ -65,7 +65,7 @@ Here you have some parameters to customize your embed timeline: | |||||||
|     hide_replies: false |     hide_replies: false | ||||||
| 
 | 
 | ||||||
|     // Limit the text content to a maximum number of lines (default: unlimited) |     // Limit the text content to a maximum number of lines (default: unlimited) | ||||||
|     text_max_lines: 0 |     text_max_lines: '0' | ||||||
| 
 | 
 | ||||||
|     // Customize the text of the button linking to the user profile page (appears after the last toot) |     // Customize the text of the button linking to the user profile page (appears after the last toot) | ||||||
|     btn_see_more: 'See more posts at Mastodon' |     btn_see_more: 'See more posts at Mastodon' | ||||||
|  | |||||||
| @ -8,12 +8,12 @@ document.addEventListener("DOMContentLoaded", () => { | |||||||
| 		container_id: 'mt-timeline', | 		container_id: 'mt-timeline', | ||||||
| 		container_body_id: 'mt-body', | 		container_body_id: 'mt-body', | ||||||
| 		instance_uri: 'https://mastodon.online', | 		instance_uri: 'https://mastodon.online', | ||||||
| 		user_id: 180745, | 		user_id: '180745', | ||||||
| 		profile_name: '@idotj', | 		profile_name: '@idotj', | ||||||
| 		toots_limit: 20, | 		toots_limit: '20', | ||||||
| 		hide_reblog: false, | 		hide_reblog: false, | ||||||
| 		hide_replies: false, | 		hide_replies: false, | ||||||
| 		text_max_lines: 0, | 		text_max_lines: '0', | ||||||
| 		btn_see_more: 'See more posts at Mastodon' | 		btn_see_more: 'See more posts at Mastodon' | ||||||
| 	}); | 	}); | ||||||
| }); | }); | ||||||
| @ -24,10 +24,10 @@ let MastodonApi = function (params_) { | |||||||
| 	this.INSTANCE_URI = params_.instance_uri; | 	this.INSTANCE_URI = params_.instance_uri; | ||||||
| 	this.USER_ID = params_.user_id; | 	this.USER_ID = params_.user_id; | ||||||
| 	this.PROFILE_NAME = params_.profile_name; | 	this.PROFILE_NAME = params_.profile_name; | ||||||
| 	this.TOOTS_LIMIT = params_.toots_limit || 20; | 	this.TOOTS_LIMIT = params_.toots_limit || '20'; | ||||||
| 	this.HIDE_REBLOG = typeof params_.hide_reblog !== 'undefined' ? params_.hide_reblog : false; | 	this.HIDE_REBLOG = typeof params_.hide_reblog !== 'undefined' ? params_.hide_reblog : false; | ||||||
| 	this.HIDE_REPLIES = typeof params_.hide_replies !== 'undefined' ? params_.hide_replies : false; | 	this.HIDE_REPLIES = typeof params_.hide_replies !== 'undefined' ? params_.hide_replies : false; | ||||||
| 	this.TEXT_MAX_LINES = params_.text_max_lines || 0; | 	this.TEXT_MAX_LINES = params_.text_max_lines || '0'; | ||||||
| 	this.BTN_SEE_MORE = params_.btn_see_more; | 	this.BTN_SEE_MORE = params_.btn_see_more; | ||||||
| 
 | 
 | ||||||
| 	// Target selectors
 | 	// Target selectors
 | ||||||
| @ -51,10 +51,10 @@ let MastodonApi = function (params_) { | |||||||
| 
 | 
 | ||||||
| 			spoilerText.classList.toggle('spoiler-text'); | 			spoilerText.classList.toggle('spoiler-text'); | ||||||
| 			if (spoilerBtnText == 'Show more') { | 			if (spoilerBtnText == 'Show more') { | ||||||
| 				event.target.textContent = 'Show less'; | 				spoilerBtnText = 'Show less'; | ||||||
| 				event.target.setAttribute('aria-expanded', 'true'); | 				event.target.setAttribute('aria-expanded', 'true'); | ||||||
| 			} else { | 			} else { | ||||||
| 				event.target.textContent = 'Show more'; | 				spoilerBtnText = 'Show more'; | ||||||
| 				event.target.setAttribute('aria-expanded', 'false'); | 				event.target.setAttribute('aria-expanded', 'false'); | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| @ -161,7 +161,7 @@ MastodonApi.prototype.getToots = function () { | |||||||
| 
 | 
 | ||||||
| 		// Main text
 | 		// Main text
 | ||||||
| 		let text_css = ''; | 		let text_css = ''; | ||||||
| 		if (this.TEXT_MAX_LINES) { | 		if (this.TEXT_MAX_LINES !== '0') { | ||||||
| 			text_css = 'truncate'; | 			text_css = 'truncate'; | ||||||
| 			document.documentElement.style.setProperty('--text-max-lines', this.TEXT_MAX_LINES); | 			document.documentElement.style.setProperty('--text-max-lines', this.TEXT_MAX_LINES); | ||||||
| 		} | 		} | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 idotj
						idotj