User talk:Js/ajaxPreview.js

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Need QDiff[edit]

Could you make a new gadget for quickly displaying the change of editing like this so useful gadget? --百楽兎 (talk) 01:51, 26 January 2010 (UTC)[reply]

I assume you mean that it would be very nice if this user script was added as a Wikipedia:Gadget. And I agree with that, it would be very nice, since this is a fantastic script. So please add your "support" over at Wikipedia:Gadget/proposals#Ajax preview.
--David Göthberg (talk) 02:22, 26 January 2010 (UTC)[reply]
I mean I need a new tool like ajaxPreview.js, but its function is quickly showing the changes of editing as the same as the result of pushing down the "Show changes" button.--百楽兎 (talk) 01:48, 30 January 2010 (UTC)[reply]

Stopped working[edit]

This script stopped working for me today. I got the error “wgWikiEditorPreferences is not defined” in the error console, but when I tried the recently added code, typeof wgWikiEditorPreferences != undefined, it returns false, despite the variable wgWikiEditorPreferences not being defined. I think it should be typeof wgWikiEditorPreferences != 'undefined' instead. That seems to work for me (i.e. it returns true). I use Vector and Firefox 3.6. Svick (talk) 22:46, 22 April 2010 (UTC)[reply]

Thank you for reporting that. Problem now fixed, and the preview and diff functions work again as well (had been broken since Mediawiki 1.16 upgrade). —TheDJ (talkcontribs) 23:19, 22 April 2010 (UTC)[reply]

Changes button doesn't work for editing sections[edit]

If you are editing just a section, the Changes button doesn't work - it thinks you are deleting all the other sections! For example, try to edit a section on this talk page.--greenrd (talk) 09:08, 30 September 2010 (UTC)[reply]

This has been fixed some time ago. — AlexSm 18:48, 30 September 2011 (UTC)[reply]

Changes button gives cryptic error if page does not exist yet[edit]

If the page you are editing does not exist yet (i.e. you're creating a new page), the Changes button shows a technical error message. A more user-friendly error message, or even showing all the new text as changes, would be preferable.--greenrd (talk) 09:31, 30 September 2010 (UTC)[reply]

I'll see if I can fix that. — AlexSm 18:48, 30 September 2011 (UTC)[reply]
I simply removed the button on page creation. I could look into making it work properly instead if someone requests this. — AlexSm 03:38, 9 October 2011 (UTC)[reply]

[BUG] AJAX preview is different from what is saved[edit]

I'm using the secure server and the code

{{fullurl:{{FULLPAGENAME}}|action=history}}

should generate a URL which points to

https://secure.wikimedia.org/wikipedia/en/w/index.php?title=User_talk:Js/ajaxPreview.js&action=history

but when I preview this section using User:Js/ajaxPreview.js it points to

//en.wikipedia.org/w/index.php?title=User_talk:Js/ajaxPreview.js&action=history

<!-- http://en.wikipedia.org/wikipedia/en/w/index.php?title=User_talk:Js/ajaxPreview.js&action=history --> which doesn't exist.

If I save the page, or use the normal preview from MediaWiki, the link is correct.

Could you fix the ajaxPreview script? Helder 18:02, 30 September 2011 (UTC)[reply]

I think I traced it to a temporary hack which is mentioned at WM blog relative-urls and explained at this post. It's not the script's fault that MediaWiki API returns incorrect link so I don't have plans to fix the script. The developer wrote "I am not leaving this up for more than two weeks"; I'll see if I can contact the developer to fix this sooner. — AlexSm 18:48, 30 September 2011 (UTC)[reply]
I suspected it could be something like that. Thanks for investigating the root of the problem. Helder 20:24, 30 September 2011 (UTC)[reply]
The developer says it was fixed and indeed now API outputs working link although not a secure one. I'm not sure if API will produce secure link some time in the future but imho it's not a big problem anyway. — AlexSm 21:00, 30 September 2011 (UTC)[reply]
Thanks! Helder 22:02, 30 September 2011 (UTC)[reply]

Fix loading issues[edit]

Hi!

Could someone make this update to fix some issues with this script? (sometimes the buttons are not shown, because the code gets executed too soon). Helder 22:18, 12 September 2012 (UTC)[reply]

So? Helder 17:12, 6 October 2012 (UTC)[reply]
done —TheDJ (talkcontribs) 09:02, 9 October 2012 (UTC)[reply]

Preview of the titles of sections with links is broken[edit]

If we add a link to the summary, as in this example and use the ajax "Preview" button, the link is not parsed as it should. Specifically, we get

<h2>[https://en.wikipedia.org Test]</h2>

instead of

<h2> <span class="mw-headline" id="Test"><a class="external text" href="https://en.wikipedia.org">Test</a></span></h2>

in the HTML. Helder 16:36, 14 January 2013 (UTC)[reply]

Fix dependencies[edit]

After the addition of mathjax rendering support (thanks TheDJ!), I believe it is necessary to make sure User:Js/preview2.js is only loaded after the module "user.options", as in this change. Helder 14:45, 3 June 2013 (UTC)[reply]

 Done - Hoo man (talk) 20:42, 3 June 2013 (UTC)[reply]

tooltipAccessKeyRegexp and tooltipAccessKeyPrefix are deprecated[edit]

Hi!

I noticed this script is generating the following warning:

Use of "tooltipAccessKeyRegexp" property is deprecated. Use mediawiki.util instead.

and

Use of "tooltipAccessKeyPrefix" property is deprecated. Use mediawiki.util instead.

Could someone fix this? Alex Smotrov, TheDJ? Helder 14:57, 23 August 2013 (UTC)[reply]

I've disabled the edit request for now - edit requests are only for when the change is obvious or when the code to be used is available in a sandbox somewhere. Not many of the admins who patrol CAT:EP can code JavaScript, actually. If you don't get a reply from Alex or from TheDJ, perhaps you could try asking at WP:VPT? — Mr. Stradivarius ♪ talk ♪ 07:05, 24 August 2013 (UTC)[reply]
I had already done this, but forgot to disable the request. There is some further work to do here, mostly in regard to firing the wikipage.content hook and replacing the collapsible triggers with mw.hook point in Common.js. But that's for a different day :D —TheDJ (talkcontribs) 11:20, 24 August 2013 (UTC)[reply]

Since gerrit:125426 is live, we are now getting another error: Use of "tooltipAccessKeyRegexp" is deprecated. Use jquery.accessKeyLabel instead. I think gerrit:132003 can be used as an example as how to fix this issue. Helder.wiki 15:07, 17 May 2014 (UTC)[reply]

Fixed. Helder.wiki 20:26, 26 July 2014 (UTC)[reply]

Use mw.config.get[edit]

Hi!

Could someone (TheDJ, Js, Alex Smotrov?) replace wgArticleId by a call to mw.config.get('wgArticleId')? This would make the script to work on Translatewiki, where these variables are not in the global scope (currently I get the error message "Uncaught ReferenceError: wgArticleId is not defined"). Helder 00:48, 29 August 2013 (UTC)[reply]

done —TheDJ (talkcontribs) 06:54, 29 August 2013 (UTC)[reply]

Diff doesn't work on pages where CodeEditor is enabled[edit]