MediaWiki talk:Gadget-NopInserter.js

Redundant \n in regex
editprotected might not necessarily come after a new line, so we need to change the regex var match = /\n\s*$/.exec(parts[2]); to var match = /\s*$/.exec(parts[2]); --DixonD (talk) 13:03, 16 May 2013 (UTC)
 * Ah yes, this precedes a version of proofread page that had to be alterted due to a WMF change. BUT it may follow a   so maybe we should make it  . Yes? — billinghurst  sDrewth  13:13, 16 May 2013 (UTC)
 * This regex matches the ending of the text, so the case with  after   will work as well. --DixonD (talk) 13:18, 16 May 2013 (UTC)
 * Are folks inserting nop at the end of a "line" rather than on its own line? (I hope not). Its application should be one or the other - not both. Lets remember - Nop was only meant to be work-a-round that has been around for so long now that we've become reliant on, if not just acceptive of, applying it without thought (i.e. "Lets Gadgetize It!!!!! Yum!!!"). So a null, empty block (div) on its own line is easily trimmed if anybody ever gets aropund to re-doing the Proofreading code but the same block at the end of a line (which is really a paragraph block) might not be so simple - especially if closing paragraph tags are no longer automatic but returned to optional as defined by the W3 specification. -- George Orwell III (talk) 19:32, 16 May 2013 (UTC)
 * Then make it clear everywhere starting from Help:Formatting conventions. I was adding the template at the end of the last line every time without any clue why it could be wrong if it actually works. --DixonD (talk) 19:54, 16 May 2013 (UTC)
 * I'd be surprised if NOP has been specifically made part of any guideline or Help: page - please point me to them/it if I'm wrong. At the same time, NOP usage is documented on the Template:Nop page and that info is what I've operating under all this time (but I've been wrong before... soooo). -- George Orwell III (talk) 20:43, 16 May 2013 (UTC)
 * Help:Formatting conventions was saying "If a paragraph ends at the bottom of a page scan and a new paragraph in the same chapter will start on the next page, add nop at the bottom of the page, to force a break in the text. Otherwise, when the pages are transcluded the separation between the two pages will be treated as single space rather than a new line." And today Beeswaxcandle added a clarification "(on its own line)" So no problem anymore. Μoreover, I forked the gadget and adjusted it for my needs. But just remember one thing before talking - new editors like me wouldn't bother themselves finding out "the true nature" of every single template and every single line on help pages before starting working. Just saying. --DixonD (talk) 21:46, 16 May 2013 (UTC)
 * Your point is well taken here and progress in cleaning up and updating stuff like this does take place (albeit mostly in fits & starts), but I cannot deny - overall we pretty much suck at making all this as easy as it could be & that makes it especially hard on newbies. :( George Orwell III (talk) 22:00, 16 May 2013 (UTC)


 * The nop template should be put on a line on its own, but this gadget shouldn’t assume that it has been. For example, I just did this with the gadget, but if I’d not gone to look I never would’ve seen the duplication. I think the leading newline should be removed from the regex. (The not-on-its-own-line nops will be caught by proofreading; that’s a separate thing.) &mdash; Sam Wilson ( Talk &bull; Contribs ) &hellip; 07:08, 17 September 2014 (UTC)

Move nop button to .editCheckboxes
I have hidden the sidebar for when I'm proofreading, to give me some more horizontal room, and so I've used the following to shift the nopinserter link. Is there a better way of doing this?

$(function($) {	// Add the inserter to the .editCheckboxes	if( mw.config.get( 'wgNamespaceNumber' ) == 104 ) {		var NopInserterInstance = new NopInserter(96);		$nop = $(" Prev. page ");		$nop.click( function ( e ) { NopInserterInstance.get_raw_page(NopInserterInstance.prev_page, NopInserterInstance.check_nop); });		$("div.editCheckboxes").append($nop);	} });

&mdash; Sam Wilson ( Talk &bull; Contribs ) &hellip; 01:46, 16 September 2015 (UTC)

All-uppercase also?
Would it be possible to get this gadget to check for all-uppercase NOP also? I hadn't realised that people use that variant of the template, but it seems they do. I accidentally inserted a second nop below the existing one on a page. &mdash; Sam Wilson ( Talk &bull; Contribs ) &hellip; 02:13, 3 February 2016 (UTC)

Update wikitext-getting code
Editprotected I'd like to suggest this change (in response to this bug report). It does away with jQuery ajax to index.php, and replaces it with a normal API call. Sam Wilson 01:21, 25 February 2019 (UTC)


 * do you have a moment to look at this? Sam Wilson 09:46, 3 March 2019 (UTC)
 * +1, this is a really useful feature when it's working. -Pete (talk) 20:42, 5 March 2019 (UTC)
 * Any chance you could make this change? Or would you prefer we place such requests through the global IA queue at meta? --Xover (talk) 04:55, 23 June 2019 (UTC)
 * ✅ appears to be working (one page one test), though will probably need more rigorous confirmation. — billinghurst  sDrewth  05:30, 23 June 2019 (UTC)
 * Thanks! Seems to be working. Sam Wilson 01:03, 24 June 2019 (UTC)

LST support
Currently if there's a trailing nop before a closing  tag, this gadget thinks there's no trailing nop. Would it be possible to treat cases like this as having a nop, and if adding a new nop, then maybe adding it before any closing  as well? -- Yodin T 02:12, 10 February 2024 (UTC)