User:PerfektesChaos/js/refNames/core/d.js: Difference between revisions

Content deleted Content added
-0.01
-0.02
Line 1:
/// User:PerfektesChaos/js/refNames/core/d.js
/// 2022-07-0125 PerfektesChaos@de.wikipedia
// <ref name="..."> major work
// ResourceLoader: compatible;
Line 19:
( function ( mw, $ ) {
"use strict";
var Version = -0.0102,
Signature = "refNames",
THIS = { lapsus: false,
Line 78:
".limitreport" ],
locked: true,
pics: { dropdrag: [ "de", "OOjs_UI_icon_trash"
+ "-destructive.svg" ],
drop: [ "9b", "OOjs_UI_icon_trash"
+ "-invert.svg" ],
exch: [ "e9", "OOjs_UI_icon_reload"
+ "-invert.svg" ],
Line 534 ⟶ 536:
k = after + 1;
break;
} // switch flat()
} // for k
}
Line 1,285 ⟶ 1,287:
// > SOURCE.locked
// > PARSER.lock
// > SOURCE.groups
// > SOURCE.grouped
// > VIEW.offered
Line 1,291 ⟶ 1,292:
// > THIS.selProblem
// > SOURCE.pics.edit
// > SOURCE.pics.dropdrag
// >< SOURCE.groups
// < SOURCE.lock
// fruit()
Line 1,299 ⟶ 1,301:
// (SOURCE.further)
// (SOURCE.flip)
// (SOURCE.flopflopping)
// 2022-07-0125 PerfektesChaos@de.wikipedia
var css = { "display": "inline-block",
"margin-left": "1em",
"margin-right": "1em" },
n = SOURCE.groups.length,
e, group, i, k, o, s, $head, $img, $item, $li, $ul;
if ( ! adjust ) {
Line 1,311 ⟶ 1,314:
SOURCE.lock = false;
}
forif ( in => 0; i < SOURCE.groups.length; i++1 ) {
SOURCE.groups.sort();
if ( ! SOURCE.groups[ n - 1 ] ) {
SOURCE.groups.pop();
SOURCE.groups.unshift( false );
}
}
for ( i = 0; i < n; i++ ) {
s = SOURCE.groups[ i ];
group = SOURCE.grouped[ s ];
for ( k = 0; k < group.length; k++ ) {
e = group[ k ];
if ( e.lone ) {
PARSER.lock = true;
}
} // for k
} // for i
for ( i = 0; i < n; i++ ) {
s = SOURCE.groups[ i ];
group = SOURCE.grouped[ s ];
Line 1,369 ⟶ 1,389:
$li.append( $item );
if ( ! e.linked ) {
$img = $file( SOURCE.pics.dropdrag, 16 );
$item = $( "<span>" );
$item.append( $img )
Line 1,375 ⟶ 1,395:
"role": "button",
"title": "discard" } )
.click( [ $li, e, s, $item, css ], SOURCE.flop )
SOURCE.flopping )
.css( css )
.css( { "cursor": "pointer" } );
Line 1,443 ⟶ 1,464:
}
}; // SOURCE.first()
 
 
 
SOURCE.flash = function ( about ) {
// Removing requested
// Precondition:
// about -- Event object, with Array .data[ 6 ]
// Uses:
// > VIEW.offered
// < SOURCE.lock
// PARSER.fire()
// 2022-07-01 PerfektesChaos@de.wikipedia
var $li = about.data[ 0 ],
pre = about.data[ 1 ],
group = about.data[ 2 ],
$drag = about.data[ 3 ],
$drop = about.data[ 5 ];
$drop.remove();
if ( PARSER.fire( false,
{ group: group,
seek: pre.name,
shift: false } ) ) {
if ( typeof VIEW.offered[ pre.name ] === "object" ) {
delete VIEW.offered[ pre.name ];
}
pre.name = false;
$li.remove();
} else {
$drag.show();
}
SOURCE.lock = false;
}; // SOURCE.flash()
 
 
Line 1,498 ⟶ 1,551:
 
SOURCE.flop = function ( about ) {
// RemovingOffer requestedremoval
// Precondition:
// about -- Event object, with Array .data[ 46 ]
// Uses:
// > SOURCE.lock
// (SOURCE.flash)
// 2022-07-01 PerfektesChaos@de.wikipedia
var $drop;
if ( SOURCE.lock ) {
$drop = about[ 5 ];
$drop.click( about, SOURCE.flash )
.css( { "background-color": "#FF0000",
"cursor": "pointer" } );
}
}; // SOURCE.flop()
 
 
 
SOURCE.flopped = function ( about ) {
// Abort removal
// Precondition:
// about -- Event object, with Array .data[ 6 ]
// Uses:
// >< SOURCE.lock
// PARSER.fire()
// 2022-07-01 PerfektesChaos@de.wikipedia
var pre, $itemdrag, $lidrop;
if ( SOURCE.lock ) {
$drag = about.data[ 3 ];
$drop = about.data[ 5 ];
if ( $drop ) {
$drop.remove();
}
if ( $drag ) {
$drag.show();
}
SOURCE.lock = false;
}
}; // SOURCE.flopped()
 
 
 
SOURCE.flopping = function ( about ) {
// Preparing removal
// Precondition:
// about -- Event object, with Array .data[ 5 ]
// Uses:
// > SOURCE.pics.drop
// > THIS.selector
// >< SOURCE.lock
// (SOURCE.flop)
// (SOURCE.flopped)
// 2022-07-01 PerfektesChaos@de.wikipedia
var css, discard, e, s, $drag, $img, $drop, $li;
if ( ! SOURCE.lock ) {
SOURCE.lock = true;
$li = about.data[ 0 ];
pree = about.data[ 1 ];
$items = about.data[ 32 ];
$itemdrag = about.remove()data[ 3 ];
ifcss ( PARSER = about.fire(data[ 4 false,];
$drag.focus()
{ group: about.data[ 2 ],
seek: pre.name,hide();
$img = $file( SOURCE.pics.drop, shift: false }16 ) ) {;
$drop if= $( typeof VIEW.offered[ pre.name ] === "object<span>" ) {;
discard = [ $li, e, s, delete$drag, VIEW.offered[css, pre.name$drop ];
$drop.addClass( THIS.selector + }"discard" )
pre .nameappend( =$img false;)
$li .removeattr(); { "lang": "en",
} "role": "button",
"title": "discard" } )
SOURCE.lock = false;
.css( css )
.css( { "background-color": "#FFB0B0",
"border-color": "transparent",
"border-radius": "2px",
"border-style": "solid",
"border-width": "2px",
"cursor": "none",
"transition": "background-color 2s" } )
.focusout( discard, SOURCE.flopped )
.mouseout( discard, SOURCE.flopped );
$li.append( $drop );
$drop.focus();
window.setTimeout( SOURCE.flop, 1500, discard );
}
}; // SOURCE.flopflopping()