Content deleted Content added
-2.12 |
-2.13 |
||
Line 1:
/// User:PerfektesChaos/js/lintHint/d.js
// Show LintErrors analysis live
///
// ResourceLoader: compatible;
// dependencies: user, mw.API
Line 17:
( function ( mw, $ ) {
"use strict";
var Version = -2.
Signature = "lintHint",
HINT = {
"proofread-index": 104,
"proofread-page": 102 },
doc: "en:User:PerfektesChaos/js/" + Signature,
errors: [ "bogus-image-options",
"deletable-table-tag",
Line 49 ⟶ 52:
live: false,
ltr: true,
using: [ "mediawiki.api",
"mediawiki.api.messages",
Line 231 ⟶ 235:
// > Signature
// > LINTER.first
// > HINT.
// > HINT.doc
// > Version
Line 237 ⟶ 241:
// < HINT.signature
// < HINT.nsn
// < HINT.idRev
// < HINT.last
Line 252 ⟶ 257:
// (features)
// (BOX.feed)
//
var listen, live, re, s;
HINT.signature = "ext.gadget." + Signature;
Line 276 ⟶ 281:
} // switch wgCanonicalSpecialPageName
break;
case
case
s = mw.config.get( "wgPageContentModel" );
HINT.source = s;
break;
}
default:
HINT.idRev = mw.config.get( "wgRevisionId" );
Line 305 ⟶ 315:
case "parsermigration-edit":
EDIT.live = true;
HINT.nsn = mw.config.get( "wgNamespaceNumber" );
▲ if ( HINT.nsn === 0 ) {
▲ HINT.live = true;
▲ }
HINT.using.push( "jquery.textSelection" );
live = true;
if ( HINT.nsn === 104 ) {
s = mw.config.get( "wgPageContentModel" );
if ( s === "proofread-page" ) {
HINT.source = s;
}
}
break;
} // switch wgAction
if ( live ) {
live = ( HINT.source === "wikitext" );
}
listen = live;
}
if ( listen ) {
if ( HINT.nsn === 0 ) {
HINT.live = true;
}
mw.hook( Signature + ".config" ).add( features );
}
Line 443 ⟶ 461:
// mediawiki.api available
// Uses:
// > HINT.cmodels
// > API.single
// > API.Api
Line 452 ⟶ 471:
// (API.fed)
// (API.fault)
//
var id, q, s, w;
if ( typeof arrived === "object" &&
Line 462 ⟶ 481:
if ( q && q.revisions ) {
q = q.revisions[ 0 ];
if ( typeof q.contentmodel !== "string" ||
) {
s = q[ "*" ];
if ( /\{\{/.test( s ) ) {
Line 1,143 ⟶ 1,163:
// > BOX.fgcRun
// > GUIDER.live
// > HINT.source
// > HINT.$page
// >< API.errors
Line 1,152 ⟶ 1,173:
// < HINT.$textarea
// API.feed()
//
var source;
if ( HINT.live ) {
if ( BOX.$box ) {
Line 1,177 ⟶ 1,199:
if ( EDIT.live ) {
if ( ! EDIT.$source ) {
source= "#wpTextbox1";
break;
} // switch HINT.source
if ( source ) {
EDIT.$source = HINT.$page.find( source );
if ( ! EDIT.$source.length ) {
BOX.$collapsed.hide();
EDIT.live = false;
}
} else {
EDIT.live = false;
}
|