resources/src/mediawiki.page.preview.js
File mediawiki.page.preview.js
has 506 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
( function () {
var api = new mw.Api();
/**
* Show the edit summary.
Function doPreview
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function doPreview( config ) {
config = $.extend( {
$previewNode: $( '#wikiPreview' ),
$diffNode: $( '#wikiDiff' ),
$formNode: $( '#editform' ),
Function showTemplates
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function showTemplates( templates ) {
// The .templatesUsed div can be empty, if no templates are in use.
// In that case, we have to create the required structure.
var $parent = $( '.templatesUsed' );
Function handleParseResponse
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function handleParseResponse( config, response ) {
var $content;
// Js config variables and modules.
if ( response.parse.jsconfigvars ) {
Function getRestrictionsText
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getRestrictionsText( restrictions ) {
var msg = '';
if ( !restrictions ) {
return $.Deferred().resolve( msg );
}
Function getParseRequest
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getParseRequest( config, section ) {
var params = {
formatversion: 2,
action: 'parse',
summary: config.summary,
Function getDiffRequest
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getDiffRequest( config, section, pageExists ) {
var contents = config.$textareaNode.textSelection( 'getContents' ),
sectionTitle = config.summary;
if ( section === 'new' ) {