Difference between revisions of "User:Abel/experimental.js"
Jump to navigation
Jump to search
m |
m |
||
Line 3: | Line 3: | ||
console.log("'⌣'"); | console.log("'⌣'"); | ||
− | var | + | var relational_id_list = { |
− | + | controller_id: ['instanceOfRekations', 96], | |
− | + | personal_data_id: ['subclassOfRekations', 421], | |
+ | interface_button_id: ['instanceOfRekations', 487] | ||
+ | }, | ||
language = "en", | language = "en", | ||
Line 19: | Line 21: | ||
standardValue: 'labels' + '.' + language + '.' + 'value' | standardValue: 'labels' + '.' + language + '.' + 'value' | ||
}, | }, | ||
+ | |||
mwEStruct = { | mwEStruct = { | ||
wbXntity: 'config.values.wbEntity' | wbXntity: 'config.values.wbEntity' | ||
Line 24: | Line 27: | ||
mw.loader.using( ['ext.gadget.WbProcessor', 'ext.gadget.PersonalDataBase', 'ext.gadget.PDOOUI'] , function (){ | mw.loader.using( ['ext.gadget.WbProcessor', 'ext.gadget.PersonalDataBase', 'ext.gadget.PDOOUI'] , function (){ | ||
− | + | console.log('Wbprocessor active'); | |
− | + | console.log('Personaldatabase active'); | |
− | + | console.log('User Interface active'); | |
− | + | wbproc = wbContainer(mw, mwEStruct[wbXntity]); | |
− | + | // Check whether the current page is in a relation of interest to an id of interest | |
− | + | current_entity = wbproc.checkentity( relational_id_list, wbEStruct['IDPropLoc'], wbEStruct['IDName'] ); | |
− | + | // This should return an object of relations and ids | |
− | |||
− | + | console.log(current_entity); | |
− | |||
− | |||
− | + | // for each match, render the corresponding ui elements | |
− | + | // current_entity.forEach(pdooui.render); | |
− | |||
}); | }); |
Revision as of 06:00, 14 May 2019
// License: GPL
// Experimental Main
console.log("'⌣'");
var relational_id_list = {
controller_id: ['instanceOfRekations', 96],
personal_data_id: ['subclassOfRekations', 421],
interface_button_id: ['instanceOfRekations', 487]
},
language = "en",
wbEStruct = {
subclassOfRelations: 'claims.P4', // location of P4 relations in wbEntity
defaultValRelation: 'claims.P108',
concernsRelation: 'claims.P110',
instanceOfRelations: 'claims.P3',
IDPropLoc: 'mainsnak.datavalue.value', // location of ID properties in related entity
IDName: 'numeric-id', // ID property name which checked
qIDPropName: 'id',
standardValue: 'labels' + '.' + language + '.' + 'value'
},
mwEStruct = {
wbXntity: 'config.values.wbEntity'
};
mw.loader.using( ['ext.gadget.WbProcessor', 'ext.gadget.PersonalDataBase', 'ext.gadget.PDOOUI'] , function (){
console.log('Wbprocessor active');
console.log('Personaldatabase active');
console.log('User Interface active');
wbproc = wbContainer(mw, mwEStruct[wbXntity]);
// Check whether the current page is in a relation of interest to an id of interest
current_entity = wbproc.checkentity( relational_id_list, wbEStruct['IDPropLoc'], wbEStruct['IDName'] );
// This should return an object of relations and ids
console.log(current_entity);
// for each match, render the corresponding ui elements
// current_entity.forEach(pdooui.render);
});