Content deleted Content added
3.0 |
3.2 |
||
Line 1:
/// User:PerfektesChaos/js/lintHint/r.js
/// 2018-
/// Fingerprint:#0#
/// @license GPL [//www.mediawiki.org/w/COPYING](+GFDL,LGPL,CC-BY-SA)
///<nowiki>
(function(mw,$){
"use strict";
var Version=3.
"proofread-index":true,"proofread-page":true},doc:"en:User:PerfektesChaos/js/"+Signature,errors:["bogus-image-options","deletable-table-tag","fostered","html5-misnesting","ignored-table-attr","misc-tidy-replacement-issues","misnested-tag","missing-end-tag","missing-start-tag","mixed-content","multi-colon-escape","multiline-html-table-in-list","multiple-unclosed-formatting-tags","obsolete-tag","pwrap-bug-workaround","self-closed-tag","stripped-tag","tidy-font-bug","tidy-whitespace-bug","unclosed-quotes-in-heading"],idRev:0,last:true,later:false,launch:false,launched:false,layer:null,lazy:false,live:false,ltr:true,source:false,
using:["mediawiki.api","mediawiki.
HINT.texts={
"desc":{"en":"Show LintErrors analysis live.","de":"Zeige LintErrors-Analyse live.",
Line 93:
switch(s.substr(i+1)){
case Signature:
TEACH.fetch();▼
GUIDER.first();
listen=true;
Line 101 ⟶ 100:
PREGO.fire();
break;}}
break;
case "ExpandTemplates":
PREGO.fire();
fair(WIKITEXT.first);
break;
case "LintErrors":
Line 130 ⟶ 133:
if(mw.config.get("wgCurRevisionId")!==HINT.idRev){
HINT.last=false;
HINT.live=false;
}else if(s.indexOf("&lintid=")>0){
HINT.launch=true;}}
}else{
live=true;}}
Line 155 ⟶ 160:
if(live){
fair();
TEACH.fetch();▼
PREGO.fire();}
HINT.pub={doc:"[["+HINT.doc+"]]",type:Signature,vsn:Version};
Line 299 ⟶ 303:
};
BOX.feed=function(){
▲TEACH.fetch();
if(HINT.launch&&!HINT.launched&&!EDIT.live){
API.full();
Line 400 ⟶ 405:
if(HINT.$textarea&&!GUIDER.last&&typeof e.dsr==="object"&&e.dsr&&typeof e.dsr[0]==="number"&&typeof e.dsr[1]==="number"){
$td=$("<td>");
$td.click(BOX.find).
.data("sort-value",i).text(" ↓ ");
if(typeof BOX.swift==="string"){
$td.attr({title:BOX.swift});}
Line 499 ⟶ 504:
};
BOX.full=function(){
if(HINT.live){
if(BOX.$box){
Line 516 ⟶ 520:
if(EDIT.live){
if(!EDIT.$source){
if(!EDIT.source){
switch(HINT.source){
case "wikitext":
case "proofread-page":
EDIT.source="#wpTextbox1";
break;}}
if(EDIT.source){
EDIT.$source=HINT.$page.find(EDIT.source);
if(!(EDIT.$source.length||WIKITEXT.live)){
BOX.$collapsed.hide();
EDIT.live=false;}
}else{
EDIT.live=false;}}
if(EDIT.live&&EDIT.$source&&EDIT.$source.length){
EDIT.listen=false;
API.fire(EDIT.$source.val());
Line 668 ⟶ 673:
if(!API.Api){
API.Api=new mw.Api();}
▲TEACH.fetch();
for(i=0;i<HINT.errors.length;i++){
req.push("linter-category-"+HINT.errors[i]);}
Line 796 ⟶ 802:
var s="ext.gadget."+PREGO.signature;
if(mw.loader.getState(s)!=="ready"){
REPOS.fire(PREGO.site,PREGO.store+PREGO.signature+PREGO.sub,false,{action:"raw",ctype:"text/javascript",bcache:1,maxage:
};
PREGO.fiat=function(){
Line 889 ⟶ 895:
TEACH.feed=function(apply){
if(typeof TEACH.o!=="object"){
TEACH.o=
if(typeof TEACH.o.
TEACH.o.unknown=[];}▼
if($.inArray(apply,HINT.errors)<0){
HINT.errors.push(apply);
TEACH.o.unknown.push(apply);}
TEACH.flush();
};
TEACH.fetch=function(){
var
if(typeof
try{
if(got){▼
if(typeof parsed.translations==="object"&&parsed.translations){
▲parsed=JSON.parse(got);
TEACH.o={translations:parsed.translations};}
if(typeof parsed.unknown==="object"&&parsed.unknown&&typeof parsed.unknown.length==="number"&&parsed.unknown.length){
TEACH.o=parsed;▼
unknown=[];
for(i=0;i<
s=parsed.unknown[i];
if(typeof s==="string"
s=s.trim();
k=$.inArray(s,HINT.errors);
if(k<0){
HINT.errors.push(s);
unknown.push(s);}}}}
if(typeof TEACH.o==="object"){
TEACH.o.unknown=unknown;
}else{
TEACH.o={unknown:unknown};}}
if(unknown.length!==parsed.unknown.length){
TEACH.flush();}}}▼
if(!s){▼
▲if(typeof TEACH.o!=="object"){
▲TEACH.o=[];}
▲TEACH.flush();}
}catch(e){
if(typeof TEACH.o!=="object"){
};
TEACH.flush=function(){
var
if(typeof
mw.storage.set(Signature,storage);
▲if(TEACH.o.length){
▲webLs.setItem(Signature,JSON.stringify(TEACH.o));
}else{
};
WIKITEXT.first=function(){
WIKITEXT.live=true;
HINT.live=true;
EDIT.live=true;
EDIT.source="#output";
mw.loader.using(HINT.using,WIKITEXT.further);
};
WIKITEXT.further=function(){
mw.hook("wikipage.content").add(BOX.flip);
};
first();
|