User:FreightXPress/wd-sorted-statements.js

From Wikidata
Jump to navigation Jump to search

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
/**** TOP/human readable identification of the item ****/
/*instance of, subclass of, part of, has part*/ 
var p_top = [31,279,361,527];
var datatype_monolingualtext = [1448,1449,1450,1451,1476,1477,1549,1559,1635,1638,1680,1683,1684,1705,1813,1843];

/**** MIDDLE/real world statements ****/
var datatype_globe_coordinate = [625,626,1259,1332,1333,1334,1335];
var datatype_quantity = [1081,1082,1083,1086,1087,1088,1090,1092,1093,1096,1097,1098,1099,1100,1101,1102,1103,1104,1106,1107,1108,1109,1110,1111,1112,1113,1114,1117,1118,1119,1120,1121,1122,1123,1124,1125,1126,1127,1128,1129,1130,1131,1132,1139,1141,1148,1164,1174,1181,1193,1198,1215,1247,1279,1295,1301,1314,1339,1342,1345,1350,1351,1352,1355,1356,1357,1358,1359,1373,1390,1410,1418,1436,1446,1457,1458,1470,1538,1539,1540,1548,1561,1569,1570,1590,1603,1641,1658,1661,1674,1675,1676,1689,1697,1725,1752,1831,1833];
var datatype_time = [569,570,571,574,575,576,577,578,580,582,585,606,619,620,621,622,729,730,746,813,1191,1249,1317,1319,1326,1619,1636,1734];
var datatype_url = [854,855,856,857,953,963,968,973,1019,1065,1244,1324,1325,1348,1401,1421,1482,1581,1613,1628,1709,1713];
var datatype_wikibase_property = [1646,1647,1659,1687,1696];
var datatype_commonsmedia = [10,14,15,18,41,51,94,109,117,154,158,181,207,242,367,368,443,491,692,948,989,990,996,1442,1543,1621,1766,1801,1846];

var datatype_wikibase_item = '';
/* more than 500 - too much to list here 
		also contains several of Wikimedia internal things, e.g. topic's main portal, topic's main category etc.
	*/
/**** BOTTOM/external resources ****/
var datatype_string = '';
	/* don't mention here, will be at bottom automatically 
		most of the items will be external identifiers
	*/

/* lists in revers order of display
*/
wd_statement_prepend_by_property_list(datatype_commonsmedia);
wd_statement_prepend_by_property_list(datatype_wikibase_property);
wd_statement_prepend_by_property_list(datatype_url);
wd_statement_prepend_by_property_list(datatype_time);
wd_statement_prepend_by_property_list(datatype_quantity);
wd_statement_prepend_by_property_list(datatype_globe_coordinate);
wd_statement_prepend_by_property_list(datatype_monolingualtext);		
wd_statement_prepend_by_property_list(p_top);

function wd_statement_prepend_by_property_list(prop_array){
	var prop_string =prop_array.join(',#P');
	prop_string = '#P' + prop_string;
	//alert(prop_string);
	$('.wikibase-statementgrouplistview > .wikibase-listview').prepend($(prop_string));
}