Topic on Talk:Structured Discussions

137.147.93.250 (talkcontribs)

Will there be a way to view the source of someone's comment, for things like viewing code examples where the commenter hasn't put it in <code> tags?

I don't expect just anyone to be able to edit others comments, but being able to see their code would be useful.

SPage (WMF) (talkcontribs)

137.147.93.250: neat idea, I filed it as bug 60465.

Currently you aren't presented the edit action if you don't have rights to change a post, and even if you guess the URL for action=edit-post , it fails with "Insufficient permission to access the content", rather than falling back to presenting read-only wiki source the way action=edit works on a protected wiki page. (e.g. http://en.wikipedia.org/wiki/Main_Page?action=edit )

Skalman (talkcontribs)

S Page (WMF): I wonder if it wouldn't be better to allow anybody to edit anyone's comment, as long as "Edited by X" appears. That way you could correct someone's syntax, or clarify formatting.

Quiddity (WMF) (talkcontribs)
197.218.89.234 (talkcontribs)

Not sure why this wasn't done yet. It is so trivial to do this that a very naive implementation doesn't even take more than 9 lines:

$(".flow-reply-link").parent().append('<a class="flowviewsource"> View source </a>');
$(".flowviewsource").on("click", {	type: "normal"}, function (){
	flowPost = $(this).parents(".flow-post-meta").siblings(".flow-post-content")[0].innerHTML;
	$.post("https://en.wikipedia.org/api/rest_v1/transform/html/to/wikitext", {
		html: flowPost,
	}).then(function (data) {
		alert(data);
	});
});

It can probably be polished up and made into a gadget if the developers aren't interested.

Reply to "View source"