Line 165: |
Line 165: |
| var typefromdom=$.map($('#P3').find(".wikibase-snakview-value a"), function(value, index) { | | var typefromdom=$.map($('#P3').find(".wikibase-snakview-value a"), function(value, index) { |
| if(typeof value.attributes.href === "undefined") | | if(typeof value.attributes.href === "undefined") |
− | return []; | + | { |
− | else | + | mw.notify("exit 1"); |
− | return [value.attributes.href.value.substring(6)]; | + | return []; |
| + | } |
| + | else |
| + | { |
| + | mw.notify("exit 2"); |
| + | return [value.attributes.href.value.substring(6)]; |
| + | } |
| }); | | }); |
| if ( typefromdom.length === 0) { | | if ( typefromdom.length === 0) { |
| if(typeqid === null) | | if(typeqid === null) |
− | quickpresets_addinterface(qid, prop); | + | { |
| + | mw.notify("exit 3") |
| + | quickpresets_addinterface(qid, prop); |
| + | } |
| } | | } |
| else { | | else { |
| + | mw.notify("exit 4") |
| if ( typeqid === 0 ) { | | if ( typeqid === 0 ) { |
| + | mw.notify("exit 5") |
| quickpresets_addinterface(qid, prop); | | quickpresets_addinterface(qid, prop); |
| } | | } |
| else if ( typefromdom.includes("Q"+typeqid) ) { | | else if ( typefromdom.includes("Q"+typeqid) ) { |
| + | mw.notify("exit 6") |
| quickpresets_addinterface(qid, prop); | | quickpresets_addinterface(qid, prop); |
| } | | } |
| else { | | else { |
| + | mw.notify("exit 7") |
| // Now check via sparql (much slower but includes subtypes) | | // Now check via sparql (much slower but includes subtypes) |
| const endpointUrl = 'https://query.personaldata.io/proxy/wdqs/bigdata/namespace/wdq/sparql', | | const endpointUrl = 'https://query.personaldata.io/proxy/wdqs/bigdata/namespace/wdq/sparql', |