User:Gryllida/js/truncateEditSummaryWithClickableEllipsis.js

/* Author : Svetlana Tkachenko svetlana@members.fsf.org This file is a part of truncateEditSummaryWithClickableEllipsis.js. Licence: GPLv3+ Version: 0.1.1 Release date: 2018-03-05 Description: truncates edit summary (not in diff views) with clickable ellipsis

if($('.diff-otitle').length === 0){ var n = 80; $('.comment').each(function(i){		var original = $(this).text;		if(original.length > n){			var $a = $('',{ href: "javascript:void(0)", text: "..." });			$a.click(function{ $(this).parent.text(original); });			var shortText = $.trim(original).substring(0, n).trim(this);			shortText = shortText + " [";			$(this).text(shortText);			$(this).append($a);			$(this).append('])'); }	}); }