diff --git a/extensions/wikidata/module/MOD-INF/controller.js b/extensions/wikidata/module/MOD-INF/controller.js index eea0bae25..1f14b8615 100644 --- a/extensions/wikidata/module/MOD-INF/controller.js +++ b/extensions/wikidata/module/MOD-INF/controller.js @@ -57,6 +57,7 @@ function init() { "scripts/menu-bar-extension.js", "scripts/warningsrenderer.js", "scripts/langsuggest.js", + "scripts/bettersuggest.js", "scripts/dialogs/schema-alignment-dialog.js", "scripts/dialogs/manage-account-dialog.js", "scripts/dialogs/perform-edits-dialog.js", diff --git a/extensions/wikidata/module/langs/translation-en.json b/extensions/wikidata/module/langs/translation-en.json index fe5c0e855..0bdeb0960 100644 --- a/extensions/wikidata/module/langs/translation-en.json +++ b/extensions/wikidata/module/langs/translation-en.json @@ -9,11 +9,10 @@ }, "wikidata-schema": { "dialog-header": "Align to Wikidata", - "dialog-explanation": "The Wikidata schema below specifies how your tabular data will be transformed into Wikidata edits. You can drag and drop columns in most input boxes: for each row, the values in these columns will generate Wikidata edits.", + "dialog-explanation": "The Wikidata schema below specifies how your tabular data will be transformed into Wikidata edits. You can drag and drop the column names below in most input boxes: for each row, edits will be generated with the values in these columns.", "schema-tab-header": "Schema", "warnings-tab-header": "Issues", "qs-preview-tab-header": "QuickStatements preview", - "draggable-columns-header": "Columns:", "statements-header": "Statements", "terms-header": "Terms", "empty-statements": "no statements added", diff --git a/extensions/wikidata/module/scripts/bettersuggest.js b/extensions/wikidata/module/scripts/bettersuggest.js new file mode 100644 index 000000000..58fb8bec3 --- /dev/null +++ b/extensions/wikidata/module/scripts/bettersuggest.js @@ -0,0 +1,22 @@ + +/** + * Adds a few tweaks to a suggest widget, mostly to indicate + * the status of the validation. + */ +var fixSuggestInput = function(input) { + input.bind("fb-select", function(evt, data) { + input.addClass('wbs-validated-input'); + input.blur(); + }).bind("fb-textchange", function(evt, data) { + input.removeClass('wbs-validated-input'); + }).blur(function() { + setTimeout(function() { + if(! input.hasClass('wbs-validated-input')) { + input.addClass('wbs-unvalidated-input'); + } + }, 100); + }).focus(function() { + input.removeClass('wbs-unvalidated-input'); + }); +} + diff --git a/extensions/wikidata/module/scripts/dialogs/schema-alignment-dialog.html b/extensions/wikidata/module/scripts/dialogs/schema-alignment-dialog.html index 5136e9af3..80be6b4da 100644 --- a/extensions/wikidata/module/scripts/dialogs/schema-alignment-dialog.html +++ b/extensions/wikidata/module/scripts/dialogs/schema-alignment-dialog.html @@ -1,7 +1,6 @@