Changes

Jump to navigation Jump to search
no edit summary
Line 20: Line 20:  
function isDataController() {
 
function isDataController() {
 
let foundThatThisIsAnInstanceOfDataController = false;
 
let foundThatThisIsAnInstanceOfDataController = false;
 +
console.log('here1');
 
if ( typeof mw.config.values.wbEntity !=  "undefined" ) // if we are on the page of a loaded entity
 
if ( typeof mw.config.values.wbEntity !=  "undefined" ) // if we are on the page of a loaded entity
 
{
 
{
 +
    console.log('here2');
 
console.dir(obj);
 
console.dir(obj);
 
let obj = JSON.parse ( mw.config.values.wbEntity );
 
let obj = JSON.parse ( mw.config.values.wbEntity );
 
if ( typeof check( obj, INSTANCE_OF_PROPERTY ) != "undefined" ) // if the entity has any "instance of" claim
 
if ( typeof check( obj, INSTANCE_OF_PROPERTY ) != "undefined" ) // if the entity has any "instance of" claim
 
{
 
{
 +
console.log('here3');
 
let claims = dive( obj, INSTANCE_OF_PROPERTY ); // get the claims which use the "instance of" property
 
let claims = dive( obj, INSTANCE_OF_PROPERTY ); // get the claims which use the "instance of" property
 
if (claims.some(claimUsesDataControllerAsItsObject))
 
if (claims.some(claimUsesDataControllerAsItsObject))
 
{
 
{
 +
  console.log('here4');
 
  foundThatThisIsAnInstanceOfDataController = true;
 
  foundThatThisIsAnInstanceOfDataController = true;
 
}
 
}
editors
3,524

edits

Navigation menu