User:PerfektesChaos/js/lintHint/d.js: Difference between revisions

Content deleted Content added
-4.6
-4.7
Line 17:
( function ( mw, $ ) {
"use strict";
var Version = -4.67,
Signature = "lintHint",
HINT = { cmodels: { "wikitext": true,
Line 54:
live: false,
ltr: true,
selMain: "[role='main']",
source: false,
using: [ "mediawiki.api",
Line 60 ⟶ 61:
"user.options" ],
$body: false,
$indicatorcontent: false,
$pagemain: false,
$textarea: false },
$widget: false },
API = { Api: false,
errors: false,
Line 88 ⟶ 90:
$top: false },
CODMIRROR = { cm: false },
EDIT = { listenlayer: false,
livelisten: false,
sourcelive: false,
$sourceselTextbox: false }"div[role='textbox']",
GUIDER = { last selVEsrc: false,".ve-init-mw-desktopArticleTarget-"
live: false + "uneditableContent",
reTrimsource: false,
usingsourceVE: [ "jquery.textSelection&veaction=editsource",
$source: false "mediawiki.ui.button"},
GUIDER = { last: "mediawiki.ui.input" ]false,
live: false,
reTrim: false,
suitable: String.fromCharCode( 0x2714 ),
using: [ "jquery.textSelection",
"mediawiki.ui.button",
"mediawiki.ui.input" ],
$pagename: false },
LINTER = { live: false },
Line 335 ⟶ 343:
// > LINTER.first
// > HINT.cmodels
// > EDIT.sourceVE
// > EDIT.selTextbox
// > HINT.doc
// > Version
// >< HINT.using
// < HINT.signature
// < HINT.selector
// < HINT.nsn
// < PREGO.live
Line 348 ⟶ 359:
// < HINT.launch
// < EDIT.live
// < HINTEDIT.selectorlayer
// < EDIT.selector
// < HINT.pub
// mw.loader.getState()
Line 356 ⟶ 368:
// PREGO.fire()
// fair()
// mw.loader.using()
// mw.hook()
// (TMPLXPAND.first)
Line 361 ⟶ 374:
// (features)
// 2021-06-03 PerfektesChaos@de.wikipedia
var i, later, listen, live, re, rls, s;
HINT.signature = "ext.gadget." + Signature;
if ( mw.loader.getState( HINT.signature ) !== "ready" ) {
Line 367 ⟶ 380:
rls[ HINT.signature ] = "ready";
mw.loader.state( rls );
HINT.selector = Signature.toLowerCase();
switch ( mw.config.get( "wgAction" ) ) {
case "view":
Line 430 ⟶ 444:
} else if ( s.indexOf( "&lintid=" ) > 0 ) {
HINT.launch = true;
}
if ( s.indexOf( EDIT.sourceVE ) > 0 ) {
later = true;
EDIT.layer = true;
EDIT.live = true;
EDIT.selector = HINT.selTextbox;
}
}
Line 464 ⟶ 484:
}
if ( live ) {
HINT.selectorif = Signature.toLowerCase( later ); {
fair mw.loader.using( HINT.using, EDIT.fading );
PREGO.fire();} else {
fair();
PREGO.fire();
}
}
HINT.pub = { doc: "[[" + HINT.doc + "]]",
Line 709 ⟶ 732:
// > HINT.selector
// > Signature
// > BOX.$collapsedVersion
// >< BOX.$box
// < HINTBOX.$pagefirst()
// face()
// BOX.focus()
// BOX.flat()
// BOX.firing()
// (BOX.flip)
// (BOX.facet)
Line 720 ⟶ 744:
var $a, $e;
if ( HINT.live ) {
HINTBOX.$page =first( $area );
if ( BOX.$box ) {
if ( BOX.$failure ) {
Line 752 ⟶ 776:
"color": "#" + BOX.fgc,
"margin-bottom": "1em",
"opacity": "2 !important",
"padding": "0.5em",
"pointer-events": "all" } );
Line 772 ⟶ 795:
Signature );
}
}
if ( BOX.$collapsed ) {
BOX.$collapsed.attr( { disabled: true,
title: "!" } );
}
} else {
BOX.flat();
}
BOX.firing( Version, false );
}; // BOX.factory()
 
Line 792 ⟶ 812:
// > BOX.$box
// > BOX.$table
// > GUIDER.$pagename
// >< BOX.$failure
// < API.scream
// BOX.flat()
// BOX.factory()
// 2017-08-04 PerfektesChaos@de GUIDER.wikipediafine()
// 2021-06-03 PerfektesChaos@de.wikipedia
BOX.flat();
BOX.factory( $area );
Line 814 ⟶ 834:
.show();
}
if ( GUIDER.$pagenamefine( false ) {;
GUIDER.$pagename.hide();
}
}; // BOX.fault()
 
Line 827 ⟶ 845:
// > HINT.launched
// > EDIT.live
// < API.errors
// UPDATE.fetch()
// API.full()
// mw.hook()
// (BOX.flip)
// 20182021-0506-2003 PerfektesChaos@de.wikipedia
UPDATE.fetch();
if ( HINT.launch && ! HINT.launched && ! EDIT.live ) {
API.full();
} else {
API.errors = true;
mw.hook( "wikipage.content" ).add( BOX.flip );
}
Line 848 ⟶ 868:
// mediawiki.api.messages available
// Uses:
// > HINT.$indicator
// > BOX.$collapsed
// > BOXHINT.$nullwidget
// > BOX.$box
// > HINT.$textarea
Line 867 ⟶ 886:
// BOX.filler()
// mw.Api.loadMessagesIfMissing()
// GUIDER.fromfine()
// (BOX.flag)
// (BOX.filler)
// (API.fault)
// 2021-0506-2603 PerfektesChaos@de.wikipedia
var i, req, $th, $thead, $tr;
BOX.factory( $area );
if ( BOX.$collapsed && ! HINT.$indicatorwidget ) {
} else { BOX.$collapsed.hide();
if ( BOX.$collapsed ) {
BOX.$collapsed.hide();
}
if ( BOX.$null ) {
BOX.$null.hide();
}
}
if ( BOX.$box ) {
Line 926 ⟶ 939:
.attr( { id: HINT.selector + "-table" } )
.append( $thead, BOX.$tbody )
.css( { "clear": "both" } );,
"overflow": "scroll" } );
if ( HINT.errors.length > 1 || HINT.nsn < 0 ) {
BOX.$table.addClass( "sortable" );
Line 941 ⟶ 955:
.fail( API.fault );
}
if GUIDER.fine( BOX.$pagenamefalse ) {;
GUIDER.from( BOX.$pagename );
}
}
}; // BOX.fill()
Line 973 ⟶ 985:
// (BOX.find)
// (BOX.future)
// 2021-0506-2603 PerfektesChaos@de.wikipedia
var n = 0,
e, i, k, par, s, $e, $e2, $e3, $td, $tr;
Line 1,031 ⟶ 1,043:
typeof par.items.length === "number" ) {
for ( k = 0; k < par.items.length; k++ ) {
$es = $(par.items[ "<code>"k )];
$e.cssif ( {s.length "margin-right":> "6px",50 ) {
$e = $( "white-space<span>": "nowrap" } );
} else .text( par.items[ k ] );{
$e = $( "<code>" );
$e.css( { "margin-right": "6px",
"white-space": "nowrap" } );
}
$e.text( s );
$td.append( $e );
} // for k
Line 1,100 ⟶ 1,117:
end: range[ 1 ] } );
}; // BOX.find()
 
 
 
BOX.fine = function () {
// Analysis without errors
// Uses:
// > BOX.$collapsed
// > API.errors
// > HINT.selector
// > BOX.bgcOk
// BOX.firing()
// 2021-06-03 PerfektesChaos@de.wikipedia
if ( BOX.$collapsed && ! API.errors ) {
BOX.firing( "+" );
BOX.$collapsed.addClass( HINT.selector + "-fine" )
.css( { "background-color": "#" + BOX.bgcOk } );
}
}; // BOX.fine()
 
 
 
BOX.firing = function ( about, active, attach ) {
// Manage pivot button
// Precondition:
// about -- tooltip text
// active -- true, if enabled after call
// attach -- cursor style, or not
// Uses:
// > BOX.$collapsed
// > BOX.bgcRun
// > BOX.fgcRun
// > BOX.fgc
// > HINT.selector
// (BOX.full)
// 2021-06-03 PerfektesChaos@de.wikipedia
var signal;
if ( BOX.$collapsed ) {
if ( active ) {
BOX.$collapsed.click( BOX.full )
.css( { "color": "#" + BOX.fgc } );
signal = "pointer";
} else {
BOX.$collapsed.css( { "background-color": "#" + BOX.bgcRun,
"color": "#" + BOX.fgcRun
} )
.off( "click", BOX.full );
signal = "default";
}
BOX.$collapsed.attr( { "aria-disabled": ! active,
"title": about } )
.css( { "cursor": attach || signal } )
.removeClass( [ HINT.selector + "-fine",
HINT.selector + "-progress" ] )
.show();
}
}; // BOX.firing()
 
 
 
BOX.first = function ( $area ) {
// Detect main section of page
// Precondition:
// $area -- mw-content-text, or nil
// Uses:
// > HINT.selMain
// > EDIT.selVEsrc
// >< HINT.$main
// >< EDIT.layer
// < HINT.$content
// < EDIT.live
// 2021-06-03 PerfektesChaos@de.wikipedia
var $main, $top;
if ( $area ) {
HINT.$content = $area;
}
if ( ! HINT.$main ) {
$top = $( HINT.selMain );
switch ( $top.length ) {
case 0:
if ( $area ) {
HINT.$main = HINT.$content;
}
break;
case 1:
$main = $top;
break;
default:
$main = $top.eq( 0 );
} // switch $top.length
if ( $main ) {
HINT.$main = $main.children().eq( 0 );
if ( EDIT.layer &&
! $main.find( EDIT.selVEsrc ).length ) {
EDIT.layer = false;
EDIT.live = false;
}
}
}
}; // BOX.first()
 
 
Line 1,128 ⟶ 1,244:
// alive -- leave BOX.$collapsed
// Uses:
// > HINT.live
// > BOX.$box
// > BOX.$collapsed
// > EDIT.live
// > API.errors
Line 1,139 ⟶ 1,253:
// > HINT.selector
// > Signature
// > BOX.bgcOk
// > BOX.fgc
// > HINT.$indicator
// > GUIDER.live
// > Version
// > HINT.ltr
// > GUIDERBOX.$pagenamefirst()
// >< HINTBOX.$pagefiring()
// >< BOX.$nullfine()
// BOX.flip()
// faceGUIDER.fine()
// GUIDER.from()
// BOX.focus()
// 2021-06-03 PerfektesChaos@de.wikipedia
if BOX.first( $area && ! HINT.$page ) {;
HINT.$page = $area;
}
if ( BOX.$box ) {
BOX.$box.hide();
}
if ( BOXAPI.$collapsederrors ) {
if BOX.firing( ! alive && ! EDIT.live"?" ) {;
} else BOX.$collapsed.hide();{
} else {BOX.fine();
BOX.$collapsed.attr( { disabled: false,
title: "?" } );
}
}
if ( EDIT.live ) {
Line 1,171 ⟶ 1,274:
BOX.flip();
}
} else if ( ! API.errors &&
! API.scream &&
HINT.live ) {&&
if ( API.single && GUIDER.$pagenamelive ) {
if GUIDER.fine( BOX.$nulltrue ) {;
BOX.$null.hide();
}
GUIDER.from( GUIDER.$pagename );
} else if ( BOX.$null ) {
if ( HINT.lazy ) {
BOX.$null.hide();
} else {
BOX.$null.attr( { title: "+" } )
.show();
}
} else if ( ! HINT.lazy &&
HINT.launched &&
HINT.$page ) {
face();
BOX.$null = $( "<div>" );
BOX.$null.addClass( [ HINT.selector + "-null",
HINT.selector + "-fine" ] )
.attr( { id: HINT.selector + "-null" } )
.css( { "background-color": "#" + BOX.bgcOk,
"clear": "both",
"color": "#" + BOX.fgc,
"font-size": "smaller",
"padding": "3px" } )
.text( Signature );
if ( ! GUIDER.live ) {
BOX.$null.attr( { title: Signature + "@PerfektesChaos "
+ Version } );
}
BOX.focus( BOX.$null, true );
}
} else if ( BOX.$null ) {
BOX.$null.hide();
}
}; // BOX.flat()
Line 1,217 ⟶ 1,290:
// Uses:
// > GUIDER.live
// > Version
// > HINT.selector
// > HINT.ltr
// > BOX.bgc
// > BOX.fgc
// > Signature
// > Version
// > EDIT.live
// > API.errors
// > GUIDER.$pagename
// >< HINT.$page
// >< BOX.$collapsed
// BOX.first()
// face()
// BOX.flatfiring()
// BOX.focus()
// EDIT.fine()
// (BOX.full)
// 2021-0506-2603 PerfektesChaos@de.wikipedia
if BOX.first( $area && ! HINT.$page ) {;
HINT.$page = $area;
}
face();
BOX.flat( $area, true );
if ( ! GUIDER.live ) {
if ( BOX.$collapsed ) {
BOX.$collapsed.attrshow( { disabled: false } );
.show();
} else {
BOX.$collapsed = $( "<div>" );
Line 1,248 ⟶ 1,317:
.attr( { id: HINT.selector + "-collapsed",
role: "button" } )
.click( BOX.full )
.css( { /* "clear": ( HINT.ltr
? "right":
"left" ), */
"cursor": "pointer",
"padding-left": "2px",
"padding-right": "2px",
Line 1,260 ⟶ 1,327:
BOX.focus( BOX.$collapsed, true, true );
}
BOX.firing( Version, true );
BOX.$collapsed.css( { "background-color": "#" + BOX.bgc, } );
"color": "#" + BOX.fgc,
"opacity": "2 !important" } )
.removeClass( HINT.selector + "-fine" )
.attr( { title: Version } );
}
if ( EDIT.live && ! API.errors ) {
Line 1,277 ⟶ 1,341:
 
BOX.focus = function ( $apply, another, around ) {
// Insertion in page top region or toolbox
// Precondition:
// $apply -- jQuery object
Line 1,285 ⟶ 1,349:
// > HINT.indicators
// > HINT.selector
// > HINT.$pagemain
// >< HINT.$indicatorwidget
// >< BOX.$top
// 2021-0506-2603 PerfektesChaos@de.wikipedia
var learn, light, s, $e;
$apply.addClass( "noprint" );
if ( another ) {
if ( HINT.$indicatorwidget === false ) {
HINT.$indicatorwidget = $( HINT.indicators );
switch ( HINT.$indicatorwidget.length ) {
case 0:
HINT.$indicatorwidget = null;
break;
case 1:
break;
default:
HINT.$indicatorwidget = HINT.$indicatorwidget.eq( 0 );
} // switch HINT.$indicatorwidget.length
learn = true;
}
if ( HINT.$indicatorwidget ) {
$apply.css( { "display": "inline-block",
"line-height": "1.2em",
Line 1,311 ⟶ 1,375:
"margin-right": "3px",
"padding": "1px" } );
HINT.$indicatorwidget.append( $apply );
light = true;
} else {
Line 1,328 ⟶ 1,392:
$e = $( "<div>" );
$e.css( { "clear": "both" } );
HINT.$pagemain.before( BOX.$top, $e );
learn = true;
}
Line 1,355 ⟶ 1,419:
// > HINT.live
// > BOX.$box
// > HINT.$widget
// > BOX.$collapsed
// > BOXHINT.bgcRunselector
// > BOX.fgcRun
// > GUIDER.live
// > Version
// >< API.errors
// >< API.single
// >< EDIT.live
// < HINT.launch
// BOX.$collapsed.hidefiring()
// EDIT.fire()
// API.full()
// (BOX.full)
// 2021-0506-2603 PerfektesChaos@de.wikipedia
var idRev;
if ( HINT.live ) {
Line 1,372 ⟶ 1,438:
if ( EDIT.live ) {
API.errors = false;
} else if ( HINT.$widget ) {
BOX.$collapsed.hidefiring( "?" );
}
if ( API.errors ) {
Line 1,381 ⟶ 1,447:
}
}
if BOX.firing( ! API".errors..", )false, {"progress" );
BOX.$collapsed.attraddClass( {HINT.selector + disabled:"-progress" true,);
title: "..." } )
.css( { "background-color": "#" + BOX.bgcRun,
"color": "#" + BOX.fgcRun,
"opacity": "2 !important" }
);
}
if ( ! GUIDER.live ) {
if ( ! API.single ) {
Line 1,402 ⟶ 1,462:
HINT.launch = true;
API.full( API.single, idRev );
BOX.firing( "?", false, "progress" );
}
} else if ( HINT.$widget ) {
BOX.$collapsed.hidefiring( "?", false, "progress" );
}
}; // BOX.full()
Line 1,493 ⟶ 1,554:
}; // CODMIRROR.fire()
*/
 
 
 
EDIT.fading = function () {
// Add link to toolbox portlet
// Precondition:
// mediawiki.util available
// Postcondition:
// Toolbox prepared and execution started
// Uses:
// > Signature
// > EDIT.layer
// > HINT.selector
// < HINT.$widget
// BOX.first()
// mw.util.addPortletLink()
// fair()
// PREGO.fire()
// 2021-06-03 PerfektesChaos@de.wikipedia
var dom;
BOX.first();
if ( EDIT.layer ) {
dom = mw.util.addPortletLink( "p-tb",
"#",
Signature,
HINT.selector + "-portlet",
Version );
HINT.$widget = $( dom );
if ( dom.nodeName.toLowerCase() !== "li" ) {
HINT.$widget = HINT.$widget.parent();
}
HINT.$widget.empty();
}
fair();
PREGO.fire();
}; // EDIT.fading()
 
 
Line 1,501 ⟶ 1,598:
// Returns textarea contents, if present
// Uses:
// > EDIT.selTextbox
// > HINT.source
// > HINT.$pagemain
// > HINT.$content
// >< EDIT.selector
// >< EDIT.$source
// < EDIT.listen
// < HINT.$textarea
// 2018-072021-06-03 PerfektesChaos@de.wikipedia
var r, $div;
if ( ! EDIT.$source ) {
if ( ! EDIT.selectorlayer ) {
EDIT.selector = EDIT.selTextbox;
} else if ( ! EDIT.selector ) {
switch ( HINT.source ) {
case "wikitext":
Line 1,519 ⟶ 1,620:
}
if ( EDIT.selector ) {
EDIT.$sourceif = HINT.$page.find( EDIT.selectorlayer ); {
$div = HINT.$main;
} else {
$div = HINT.$content;
}
EDIT.$source = $div.find( EDIT.selector );
if ( ! EDIT.$source.length ) {
EDIT.live = false;
Line 1,528 ⟶ 1,634:
}
if ( EDIT.live && EDIT.$source && EDIT.$source.length ) {
HINT.$textareaif =( EDIT.$source;layer ) {
r r = EDIT.$source.valtext();
} else {
HINT.$textarea = EDIT.$source;
r = EDIT.$source.val();
}
}
return r;
Line 1,540 ⟶ 1,650:
// Uses:
// > EDIT.$source
// > HINT.selector
// > BOX.bgcOk
// > BOX.$collapsed
// < EDIT.listen
// BOX.fine()
// (EDIT.focus)
// 2021-0506-2603 PerfektesChaos@de.wikipedia
if ( EDIT.$source ) {
EDIT.listen = true;
EDIT.$source.focusin( EDIT.focus );
BOX.$collapsed.addClass( HINT.selector + "-fine" )
.attr( { title: "+" } )
.css( { "background-color": "#" + BOX.bgcOk,
"opacity": "2 !important" } );
}
BOX.fine();
}; // EDIT.fine()
 
Line 1,566 ⟶ 1,671:
// EDIT.fetch()
// API.fire()
// 2021-06-03 BOX.$collapsedPerfektesChaos@de.hide()wikipedia
// 2018-07-06 PerfektesChaos@de.wikipedia
var source;
if ( ! TMPLXPAND.live ) {
Line 1,581 ⟶ 1,685:
EDIT.listen = false;
API.fire( source );
} else {
BOX.$collapsed.hide();
}
}; // EDIT.fire()
Line 1,591 ⟶ 1,693:
// Source area has been touched
// Uses:
// > Version
// > BOX.bgc
// > BOX.$collapsed
// > HINT.selector
// > Version
// >< EDIT.listen
// 2021-05-26 PerfektesChaos@de BOX.wikipediafiring()
// 2021-06-03 PerfektesChaos@de.wikipedia
if ( EDIT.listen ) {
BOX.firing( Version, true );
BOX.$collapsed.css( { "background-color": "#" + BOX.bgc, } );
"opacity": "2 !important" } )
.removeClass( HINT.selector + "-fine" )
.attr( { title: Version } );
EDIT.listen = false;
}
Line 1,749 ⟶ 1,849:
// > GUIDER.$input
// > GUIDER.$rev
// > GUIDER.$startPage
// < GUIDER.last
// < API.single
// GUIDER.fired()
// API.full()
// 20182021-0506-0703 PerfektesChaos@de.wikipedia
var s = GUIDER.$input.val().trim();
GUIDER.$input.val( s );
Line 1,762 ⟶ 1,863:
API.full( s, GUIDER.$rev.val() );
}
GUIDER.$startPage.css( { "cursor": "progress" } );
}; // GUIDER.find()
 
 
 
GUIDER.fine = function ( action ) {
// Precondition:
// action -- boolean, or Event object
// Pretty result of analysis
// Uses:
// > GUIDER.live
// > GUIDER.$pagename
// > GUIDER.$okay
// > GUIDER.$textarea
// > BOX.bgcOk
// > GUIDER.$input
// > GUIDER.$startText
// > GUIDER.$startPage
// (GUIDER.fine)
// 2021-06-03 PerfektesChaos@de.wikipedia
var lapsus, $e;
if ( GUIDER.live ) {
lapsus = ( action !== true );
if ( ( ! API.single || lapsus )
&& GUIDER.$pagename ) {
GUIDER.$pagename.hide();
}
if ( lapsus ) {
GUIDER.$okay.hide();
GUIDER.$textarea.css( { "background-color": "transparent" } )
.off( "focusin", GUIDER.fine );
GUIDER.$input.off( "focusin", GUIDER.fine );
} else {
if ( API.single ) {
$e = GUIDER.$pagename.children();
if ( ! $e.length ) {
$e = $( "<a>" );
$e.attr( { target: "_blank" } );
GUIDER.$pagename.append( $e );
}
$e.attr( { href: mw.util.getUrl( API.single ) } )
.text( API.single );
GUIDER.$pagename.show();
} else {
GUIDER.$okay.show();
GUIDER.$textarea.css( { "background-color":
"#" + BOX.bgcOk } )
.focusin( GUIDER.fine );
GUIDER.$input.focusin( GUIDER.fine );
}
}
GUIDER.$startText.css( { "cursor": "pointer" } );
GUIDER.$startPage.css( { "cursor": "pointer" } );
}
}; // GUIDER.fine()
 
 
Line 1,774 ⟶ 1,929:
// > HINT.texts.howTo
// > GUIDER.$desc
// > HINT.$pagecontent
// > HINT.texts.___domain
// > Signature
Line 1,780 ⟶ 1,935:
// < PREGO.app
// PREGO.app.translation()
// 20172021-0806-0103 PerfektesChaos@de.wikipedia
var $e = $( "<div>" );
PREGO.app = application;
Line 1,787 ⟶ 1,942:
"margin-top": "8em" } )
.html( PREGO.app.translation( HINT.texts.howTo ) );
HINT.$pagecontent.append( $e );
$e = $( "<a>" );
$e.attr( { href: "https://"
Line 1,807 ⟶ 1,962:
// > GUIDER.$textarea
// > GUIDER.reTrim
// > GUIDER.$startText
// < GUIDER.last
// < API.single
Line 1,812 ⟶ 1,968:
// GUIDER.fired()
// API.fire()
// 2017-102021-06-03 PerfektesChaos@de.wikipedia
var s = GUIDER.$textarea.val();
GUIDER.fired();
Line 1,821 ⟶ 1,977:
HINT.launched = true;
}
GUIDER.$startText.css( { "cursor": "progress" } );
}; // GUIDER.fire()
 
Line 1,870 ⟶ 2,027:
// Uses:
// > BOX.$box
// > BOXGUIDER.$collapsedfine()
// 2021-06-03 > BOXPerfektesChaos@de.$nullwikipedia
// > GUIDER.$pagename
// 2017-08-05 PerfektesChaos@de.wikipedia
if ( BOX.$box ) {
BOX.$box.hide();
}
if GUIDER.fine( BOX.$collapsedfalse ) {;
BOX.$collapsed.hide();
}
if ( BOX.$null ) {
BOX.$null.hide();
}
if ( GUIDER.$pagename ) {
GUIDER.$pagename.hide();
}
}; // GUIDER.flat()
 
Line 1,924 ⟶ 2,071:
// Uses:
// > GUIDER.$formText
// > GUIDER.suitable
// > GUIDER.$formPage
// > HINT.ltr
// > PREGO.signature
// < GUIDER.$startText
// < GUIDER.$okay
// < GUIDER.$startPage
// mw.hook()
// (GUIDER.fire)
Line 1,933 ⟶ 2,084:
// (GUIDER.filled)
// (GUIDER.finish)
// 20182021-0906-2503 PerfektesChaos@de.wikipedia
var submit = mw.message( "go" ).text(),
$b = $( "<span>" ),
$div = $( "<div>" ),
$x = $( "<span>" );,
$b;
$x.css( { "color": "#FF0000",
"font-weight": "bolder" } )
.text( "X" );
$bGUIDER.addClass$startText = $( "mw-ui-button mw-ui-progressive<span>" );
GUIDER.$startText.addClass( "mw-ui-button mw-ui-progressive" )
.click( GUIDER.fire )
.css( { "color": "#FFFFFF" } .click( GUIDER.fire )
.textcss( submit{ "color": "#FFFFFF" } );
GUIDER.$formText .appendtext( $bsubmit );
GUIDER.$formText.append( GUIDER.$startText );
GUIDER.$okay = $( "<span>" );
GUIDER.$okay.css( { "background-color": "#" + BOX.bgcOk,
"margin-left": "1em",
"margin-right": "1em",
"padding": "0.2em 0.5em" } )
.hide()
.text( GUIDER.suitable );
GUIDER.$formText.append( GUIDER.$okay );
$b = $( "<input>" );
$b.addClass( "mw-ui-button" )
Line 1,964 ⟶ 2,124:
.css( { "float": ( HINT.ltr ? "right": "left" ) } );
GUIDER.$formPage.append( $b );
GUIDER.$bstartPage = $( "<span>" );
GUIDER.$bstartPage.addClass( "mw-ui-button mw-ui-progressive" )
.click( GUIDER.find )
.css( { "color": "#FFFFFF" } )
.text( submit );
GUIDER.$formPage.append( GUIDER.$bstartPage );
mw.hook( PREGO.signature + ".ready" ).add( GUIDER.finish );
}; // GUIDER.form()
 
 
 
GUIDER.from = function ( $at ) {
// Show or clear page name fields
// Precondition:
// $at -- container
// mediawiki.util available
// Uses:
// > API.single
// mw.util.getUrl()
// 2017-08-04 PerfektesChaos@de.wikipedia
var $e;
if ( API.single ) {
$e = $at.children();
if ( ! $e.length ) {
$e = $( "<a>" );
$e.attr( { target: "_blank" } );
$at.append( $e );
}
$e.attr( { href: mw.util.getUrl( API.single ) } )
.text( API.single );
$at.show();
} else {
$at.hide();
}
}; // GUIDER.from()
 
 
Line 2,015 ⟶ 2,148:
// > PREGO.signature
// > HINT.selector
// < HINT.$pagecontent
// < GUIDER.$doc
// < GUIDER.$desc
Line 2,031 ⟶ 2,164:
// (GUIDER.foreign)
// (GUIDER.facet)
// 2021-0506-2603 PerfektesChaos@de.wikipedia
var $v = $( "head" ),
$e = $v.find( "title" );
Line 2,038 ⟶ 2,171:
$e.text( Signature );
$v.prepend( $e );
HINT.$pagecontent = $area;
HINT.$pagecontent.empty();
face();
$v = HINT.$body.find( "#firstHeading,#section_0" );
Line 2,060 ⟶ 2,193:
.text( String.fromCharCode( 160 ) );
$v.append( $v, GUIDER.$desc );
HINT.$pagecontent.append( $v );
GUIDER.$formText = $( "<form>" );
GUIDER.$textarea = $( "<textarea>" );
GUIDER.$textarea.addClass( "mw-ui-input" )
.attr( { name: "wikitext" } )
.css( { "marginbackground-topcolor": "2emtransparent",
"maxmargin-widthtop": "100%2em",
"max-width": "100%" } );,
"width": "100%" } );
GUIDER.$formText.append( GUIDER.$textarea );
GUIDER.$formPage = $( "<form>" );
Line 2,101 ⟶ 2,235:
.mouseup( GUIDER.figure );
GUIDER.$formPage.append( GUIDER.$rev );
HINT.$pagecontent.append( GUIDER.$formText, GUIDER.$formPage );
GUIDER.$pagename = $( "<div>" );
GUIDER.$pagename.addClass( [ HINT.selector + "-pagename",
Line 2,110 ⟶ 2,244:
: "right" ),
"margin-bottom": "1em",
"opacity": "2 !important",
"padding": "4px",
"pointer-events": "all" } )
.hide();
HINT.$pagecontent.before( GUIDER.$pagename );
HINT.$textarea = GUIDER.$textarea;
mw.loader.using( HINT.using, GUIDER.foreign );