User talk:Js/preview2.js

Fixes
Could someone apply [//en.wikipedia.org/w/index.php?title=User:Js/preview2.js&oldid=494364425&diff=519842144&diffonly=1 this bug fix] to the script? Currently it does not works on Translatewiki, because $wgLegacyJavaScriptGlobals seems to be set to false there (and will be false here as well in the future). Helder 22:54, 25 October 2012 (UTC)

frm.wpSummary is undefined
I got Uncaught TypeError: Cannot read property 'value' of undefined from the following line when trying to do a preview in a [//www.wikidata.org/w/index.php?title=Wikidata:Requests_for_deletions&action=edit&section=new&preload=Wikidata:Requests%20for%20deletions/Preload&editintro=Wikidata:Requests_for_deletions/Editintro&nosummary=1 new topic on Wikidata]: data = { title: mw.config.get('wgPageName'), text: txt, summary: frm.wpSummary.value} Helder 17:18, 12 November 2012 (UTC)

Add MathJax compatibility
Could you replace if (window.ajaxPreviewExec) ajaxPreviewExec(wkPreview[0]) by something like to make the script work with the mathjax code from mw:Extension:Math? See 61183 for details. Helder 17:01, 1 June 2013 (UTC)
 * Red information icon with gradient background.svg Not done for now: The template should only be used when there is "a complete and specific description of the request, so that an editor unfamiliar with the subject matter could complete the requested edit immediately". The phrase "by something like" implies that the above request is not specific. -- Red rose64 (talk) 20:59, 2 June 2013 (UTC)
 * Done, with an additional check on actually having mathjax mode selected in your preferences. —Th e DJ (talk • contribs) 21:28, 2 June 2013 (UTC)
 * Thank you! I think it is necessary to move around the code which loads module "user.options" at User:Js/ajaxPreview.js, and made a request for this at User talk:Js/ajaxPreview.js. Helder 14:47, 3 June 2013 (UTC)

Make it compatible with the CodeEditor
Currently, if I make some changes in a JS or CSS page, and try to use the "Changes" button from this script, it compares the old text with itself. The button only works if I disable the CodeEditor (using the button ). Helder 15:39, 25 September 2013 (UTC)
 * Could someone apply [//en.wikipedia.org/w/index.php?title=User:Js/preview2.js&oldid=569890770&diff=593112899&diffonly=1 this change] to the code?
 * I tested it on Module:Bananas, Special:MyPage/common.js and Special:MyPage/common.css Helder 13:26, 30 January 2014 (UTC)


 * Are you using wikEd ? If so, you need to disable it in the top right corner of the screen before loading the .js or .css you want to edit.  It doesn't get along with CodeEditor and there is already a ticket on Bugzilla. Technical 13 (talk) 13:46, 30 January 2014 (UTC)
 * Nope. I think you are refering to 53914, but that is not the case here since I do not use WikEd. I'm using ajaxPreview, and when I'm on JS/CSS/Lua pages, I like to use the features from mw:Extension:CodeEditor, but then the ajax diff doesn't work unless I make a fork of this script with the changes above. Helder 16:22, 30 January 2014 (UTC)


 * This means there are multiple gadgets and scripts that are not working with codeEditor. This tells me the codeEditor is not backwards compatible and needs to be fixed, not all of the gadgets and scripts that conflict with it.  I'll see what I can do.  In the mean time, do you have a proposed fix for this script?  I'm guessing it is going to be hard to find and administrator that will try to debug it and figure it out on their own.  Let's ping  who is the only one who has made any edits to this script in the last two years since I'm not sure  is still around.  Also, disabling the Editprotected because I don't think it will help here. Technical 13 (talk) 15:28, 1 February 2014 (UTC)
 * But I provided [//en.wikipedia.org/w/index.php?diff=593112899&oldid=569890770 the fix] in the second comment above, after debugging it myself. Helder 12:23, 2 February 2014 (UTC)
 * ✅. Let me know of any problems, please. &mdash; Martin (MSGJ · talk) 20:38, 4 February 2014 (UTC)

Fix for Uncaught ReferenceError
Hello!

Some wikis (e.g.: wmbr:MediaWiki:Common.js) defines "createCollapseButtons" (from WP:Collapsible tables) but not "createNavigationBarToggleButton" (from WP:NavFrame), so the script needs to check for each function individually to avoid errors such as " Uncaught ReferenceError: createNavigationBarToggleButton is not defined ".

Could someone apply [//en.wikipedia.org/w/index.php?title=User:Js/preview2.js&oldid=593941136&diff=595491002 this update] to the script?

Thanks! Helder.wiki 19:58, 14 February 2014 (UTC)
 * ✅ Ruslik_ Zero 18:54, 19 February 2014 (UTC)

The script causes error in JS console in ruwiki
Hello! This script has some ruwiki-specific code: But it isn't executed properly (these functions need jQuery object with content element as parameter) and causes error in JavaScript console: «Uncaught TypeError: Cannot read property 'find' of undefined». Also, this code is not even needed, since 'wikipage.content' event is fired and collapsibleDivs and collapsibleTables are executed anyway. So I suggest to remove the code. Thank you. Jack who built the house (talk) 03:12, 1 November 2016 (UTC)

Update module name
Hi! Could someone change "mediawiki.action.history.diff" to "mediawiki.diff.styles"? The old module was removed (see Wikipedia:Village pump (technical)#mediawiki.action.history.diff). Helder 19:57, 23 January 2018 (UTC)
 * Yes check.svg Done &mdash; Martin (MSGJ · talk) 11:56, 24 January 2018 (UTC)