User:Sumit.iitp/editlabels.js

This is an old revision of this page, as edited by Sumit.iitp (talk | contribs) at 02:50, 8 September 2020. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
var get_changes_for_para = function(paragraph) {
	var regex = '/<\/ins> <ins class="diffchange diffchange-inline">/gi'
	var text = $(paragraph).find('div').html();
	console.log(text);
	//console.log(text.replaceAll(regex, ''));
	$(paragraph).find('ins').each(function(idx){
		console.log($(this).text());
	});
}

var label_edit = function() {
	if ( $( '.diff' ).length > 0  ) {
		paragraph_operations = []
		$('.diff').find('tr').each(function(idx) {
			if ( $(this).children('.diff-deletedline').length === 0 ) {
				console.log('Skipping!');
				return;
			}
			get_changes_for_para(this);
		});
	}
}

label_edit();