Changes

Jump to navigation Jump to search
no edit summary
Line 11: Line 11:  
     try {
 
     try {
 
$( ".quickpresetsiteminput input" ).entityselector( {
 
$( ".quickpresetsiteminput input" ).entityselector( {
    url: 'https://www.wikidata.org/w/api.php',
+
    url: 'http://wiki.personaldata.io/w/api.php',
 
    language: mw.config.get('wgUserLanguage')
 
    language: mw.config.get('wgUserLanguage')
 
} );
 
} );
Line 84: Line 84:  
     api.post( {  
 
     api.post( {  
 
action: 'wbsetclaim',
 
action: 'wbsetclaim',
summary: "Added with [[User:MichaelSchoenitzer/quickpresets|Quickpresets]]",
+
summary: "Added with [[User:Podehaye/quickpresets.js|Quickpresets]]",
 
claim: JSON.stringify(claim),
 
claim: JSON.stringify(claim),
 
token: token
 
token: token
Line 121: Line 121:  
     quickpresets_addclaim(claim,  "<p>Added "+pname+" "+toname+"</p>");
 
     quickpresets_addclaim(claim,  "<p>Added "+pname+" "+toname+"</p>");
 
     // Check if we now support it with another element of the config
 
     // Check if we now support it with another element of the config
     if(pid == 31) {
+
     if(pid == 3) { // MODIFIED LINE
 
$('#quickpresets').remove();
 
$('#quickpresets').remove();
 
for( var t = 0; t<quick_props.length; t++) {
 
for( var t = 0; t<quick_props.length; t++) {
Line 161: Line 161:  
     var typeqid=prop.qid;
 
     var typeqid=prop.qid;
 
     // Search in HTML-DOM
 
     // Search in HTML-DOM
     var typefromdom=$.map($('#P31').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 [];
 
    return [];
Line 180: Line 180:  
else {
 
else {
 
    // Now check via sparql (much slower but includes subtypes)
 
    // Now check via sparql (much slower but includes subtypes)
    const endpointUrl = 'https://query.wikidata.org/sparql',
+
    const endpointUrl = 'https://query.personaldata.io/sparql',
sparqlQuery = 'Ask { wd:Q' + qid + ' wdt:P31/wdt:P279* wd:Q' + typeqid +
+
sparqlQuery = 'Ask { wd:Q' + qid + ' wdt:P3/wdt:P4* wd:Q' + typeqid +
 
'. hint:Prior hint:gearing "forwards" }',
 
'. hint:Prior hint:gearing "forwards" }',
 
fullUrl = endpointUrl + '?query=' + encodeURIComponent( sparqlQuery ),
 
fullUrl = endpointUrl + '?query=' + encodeURIComponent( sparqlQuery ),

Navigation menu