2018-01-08 21:14:13 +01:00
|
|
|
// Load the localization file
|
|
|
|
var dictionary = {};
|
|
|
|
$.ajax({
|
|
|
|
url : "command/core/load-language?",
|
|
|
|
type : "POST",
|
|
|
|
async : false,
|
|
|
|
data : {
|
|
|
|
module : "wikidata",
|
|
|
|
// lang : lang
|
|
|
|
},
|
|
|
|
success : function(data) {
|
|
|
|
dictionary = data;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
$.i18n.setDictionary(dictionary);
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-09-05 23:49:17 +02:00
|
|
|
ExporterManager.MenuItems.push({});
|
2017-09-05 16:26:32 +02:00
|
|
|
ExporterManager.MenuItems.push(
|
2017-09-05 23:49:17 +02:00
|
|
|
{
|
|
|
|
"id" : "exportQuickStatements",
|
2018-02-23 15:57:16 +01:00
|
|
|
"label": $.i18n._('wikidata-extions')["quickstatements-export-name"],
|
2017-09-05 23:49:17 +02:00
|
|
|
"click": function() { WikibaseExporterMenuBar.exportTo("quickstatements"); }
|
|
|
|
}
|
2017-09-05 16:26:32 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
WikibaseExporterMenuBar = {};
|
|
|
|
|
|
|
|
WikibaseExporterMenuBar.exportTo = function(format) {
|
|
|
|
var form = document.createElement("form");
|
|
|
|
$(form).css("display", "none")
|
|
|
|
.attr("method", "post")
|
|
|
|
.attr("action", "command/core/export-rows/statements.txt")
|
|
|
|
.attr("target", "gridworks-export");
|
|
|
|
$('<input />')
|
|
|
|
.attr("name", "engine")
|
|
|
|
.attr("value", JSON.stringify(ui.browsingEngine.getJSON()))
|
|
|
|
.appendTo(form);
|
|
|
|
$('<input />')
|
|
|
|
.attr("name", "project")
|
|
|
|
.attr("value", theProject.id)
|
|
|
|
.appendTo(form);
|
|
|
|
$('<input />')
|
|
|
|
.attr("name", "format")
|
|
|
|
.attr("value", format)
|
|
|
|
.appendTo(form);
|
|
|
|
|
|
|
|
document.body.appendChild(form);
|
|
|
|
|
|
|
|
window.open("about:blank", "gridworks-export");
|
|
|
|
form.submit();
|
|
|
|
|
|
|
|
document.body.removeChild(form);
|
|
|
|
};
|
|
|
|
|
|
|
|
//extend the column header menu
|
|
|
|
$(function(){
|
|
|
|
|
2017-09-05 23:49:17 +02:00
|
|
|
ExtensionBar.MenuItems.push(
|
|
|
|
{
|
|
|
|
"id":"reconcile",
|
2018-02-23 15:57:16 +01:00
|
|
|
"label": $.i18n._('wikidata-extension')["menu-label"],
|
2017-09-05 23:49:17 +02:00
|
|
|
"submenu" : [
|
|
|
|
{
|
2017-09-15 12:51:29 +02:00
|
|
|
id: "wikidata/edit-schema",
|
2018-02-23 15:57:16 +01:00
|
|
|
label: $.i18n._('wikidata-extension')["edit-wikidata-schema"],
|
2017-09-05 23:49:17 +02:00
|
|
|
click: function() { SchemaAlignmentDialog.launch(false); }
|
|
|
|
},
|
2017-09-15 12:51:29 +02:00
|
|
|
{
|
|
|
|
id:"wikidata/manage-account",
|
2018-02-23 15:57:16 +01:00
|
|
|
label: $.i18n._('wikidata-extension')["manage-wikidata-account"],
|
2017-09-15 12:51:29 +02:00
|
|
|
click: function() { ManageAccountDialog.checkAndLaunch(); }
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id:"wikidata/perform-edits",
|
2018-02-23 15:57:16 +01:00
|
|
|
label: $.i18n._('wikidata-extension')["perform-edits-on-wikidata"],
|
2017-09-15 12:51:29 +02:00
|
|
|
click: function() { PerformEditsDialog.checkAndLaunch(); }
|
|
|
|
},
|
2017-09-05 23:49:17 +02:00
|
|
|
{
|
2017-09-15 12:51:29 +02:00
|
|
|
id:"wikidata/export-qs",
|
2018-02-23 15:57:16 +01:00
|
|
|
label: $.i18n._('wikidata-extension')["export-to-qs"],
|
2017-09-15 12:51:29 +02:00
|
|
|
click: function() { WikibaseExporterMenuBar.exportTo("quickstatements"); }
|
|
|
|
},
|
|
|
|
|
2017-09-05 23:49:17 +02:00
|
|
|
]
|
|
|
|
}
|
|
|
|
);
|
2017-09-05 16:26:32 +02:00
|
|
|
});
|
|
|
|
|