From 593f42c109b23188996693c3eb018c68f8c5a8e8 Mon Sep 17 00:00:00 2001 From: Mark Tully Date: Sun, 7 Jul 2024 00:14:53 +0100 Subject: [PATCH] Fix a bug causing errors on non entity pages --- script.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/script.js b/script.js index 3d6a029..a1315f0 100644 --- a/script.js +++ b/script.js @@ -1,3 +1,11 @@ +/** + * EntityShape.js adds an input box to a wikidata page wherein you can enter an entityschema + * (such as E10). When you click "Check", checks whether each statement and property conforms + * to the schema. It then displays a summary at the top of the item for each property indicating + * whether they conform or not. It also adds a badge to each statement and each property on the + * page indicating whether they conform or not. + **/ + (function() { let entityschema_stylesheet = entityschema_getStylesheet(); $('html > head').append(""); @@ -62,7 +70,7 @@ function check_entity_for_schemas(entity_list) { } $(document).ajaxStop(function () { - if (value == "true") { + if (value == "true" && mw.config.get( 'wbEntityId' )) { entityschema_update() } $("#entityschema-entityToCheck:text").val(schema);