thiemowmde added a comment.
Thanks for this ticket and taking care of it!
Historically, this slice of JavaScript used to be even bigger:
<script>/*<![CDATA[*/
$( ".wb-entity" ).addClass( "loading" ).after( function() {
var $div = $( "<div/>" ).addClass( "wb-entity-spinner mw-small-spinner"
);
$div.css( "top", $div.height() + "px" );
$div.css(
"' . ( $lang->isRTL() ? 'right' : 'left' ) . '",
( ( $( this ).width() - $div.width() ) / 2 | 0 ) + "px"
);
return $div;
} );
// Remove loading spinner after a couple of seconds in any case. (e.g. some
resource
// might not have been loaded silently, so JavaScript is not initialising)
// Additionally attaching to window.error would only make sense before any
other
// JavaScript is parsed. Since the JavaScript is loaded in the header, it
does not make
// any sense to attach to window.error here.
window.setTimeout( function() {
$( ".wb-entity" ).removeClass( "loading" );
$( ".wb-entity-spinner" ).remove();
}, 7000 );
/*]]>*/</script>
Since I started working on Wikibase it was going through quite some iterations,
e.g. the comment removed, the CSS properties moved to the wikibase.css file,
and finally removed in T108365: [Task] Remove "wb-entity-spinner"
<https://phabricator.wikimedia.org/T108365>. Technically this makes this ticket
invalid, not a duplicate.
The naive `if ( $ )` was a mistake (should have been something like `if (
typeof $ !== 'undefined' )`) and fixed in
https://gerrit.wikimedia.org/r/#/c/229680/.
TASK DETAIL
https://phabricator.wikimedia.org/T95329
EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: thiemowmde
Cc: Ricordisamoa, aude, hoo, thiemowmde, Lydia_Pintscher, Aklapper, MaxSem,
Wikidata-bugs, Malyacko
_______________________________________________
Wikidata-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs