Line 745: |
Line 745: |
| x: params.pointer.DOM.x, | | x: params.pointer.DOM.x, |
| y: params.pointer.DOM.y | | y: params.pointer.DOM.y |
− | })).id) + '","ns":0}&format=json') | + | })).id) + '","options":{"showAll":"true"}, "ns":0, "type":"html"}&format=json') //inverse properties are only available in html format |
| .then(response => response.json()) | | .then(response => response.json()) |
| .then(data => { | | .then(data => { |
Line 764: |
Line 764: |
| | | |
| } | | } |
− | var page_properties = data.query.data; //normal page | + | var page_properties = []; |
| + | $html = $(data.query); |
| + | $html.find("div.smwb-propvalue").each(function(){ |
| + | $prop = $(this).find("div.smwb-prophead a"); |
| + | //var propName = $prop.text(); |
| + | var propName = $prop.attr('title').replace("Property:", ""); |
| + | if (propName === "Special:Categories") propName = "Category"; |
| + | page_properties.push(propName); |
| + | console.log(propName); |
| + | $(this).find("div.smwb-propval span.smwb-value").each(function(){ |
| + | var value = $(this).find("a").attr("title"); |
| + | console.log("-> " + value); |
| + | }); |
| + | }) |
| + | $html.find("div.smwb-ipropvalue").each(function(){ |
| + | $prop = $(this).find("div.smwb-prophead a"); |
| + | //var propName = $prop.text(); |
| + | var propName = $prop.attr('title').replace("Property:", ""); |
| + | if (propName === "Special:Categories") propName = "Category"; |
| + | page_properties.push(propName); |
| + | console.log("-" + propName); |
| + | $(this).find("div.smwb-propval span.smwb-ivalue").each(function(){ |
| + | var value = $(this).find("a").attr("title"); |
| + | console.log("-> " + value); |
| + | }); |
| + | }) |
| + | /*var page_properties = data.query.data; //normal page |
| if (selected_node.id.includes('#')) { //subobject | | if (selected_node.id.includes('#')) { //subobject |
| for (var i = 0; i < data.query.sobj.length; i++) { | | for (var i = 0; i < data.query.sobj.length; i++) { |
Line 780: |
Line 806: |
| ul.append(li); | | ul.append(li); |
| } | | } |
− | } | + | }*/ |
| | | |
| $(".custom-menu li").click(function() { | | $(".custom-menu li").click(function() { |