From: David ‘Bombe’ Roden Date: Fri, 12 Nov 2010 10:36:10 +0000 (+0100) Subject: Load texts for input fields only once. X-Git-Tag: 0.2.2~4 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=fa7f3a80a777bf743bcc5d7b95bfd811a417651f;p=Sone.git Load texts for input fields only once. --- diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 7b971bb..01f13e3 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -11,11 +11,7 @@ function registerInputTextareaSwap(inputSelector, defaultText, inputFieldName, o $(this).hide(); inputField = $(this).data("inputField"); inputField.show().removeAttr("disabled").addClass("default"); - (function(inputField) { - getTranslation(defaultText, function(translation) { - inputField.val(translation); - }); - })(inputField); + inputField.val(defaultText); } }).hide().data("inputField", $(this)).val($(this).val()); $(this).after(textarea); @@ -26,11 +22,7 @@ function registerInputTextareaSwap(inputSelector, defaultText, inputFieldName, o }); if (inputField.val() == "") { inputField.addClass("default"); - (function(inputField) { - getTranslation(defaultText, function(translation) { - inputField.val(translation); - }); - })(inputField); + inputField.val(defaultText); } else { inputField.hide().attr("disabled", "disabled"); textarea.show(); diff --git a/src/main/resources/templates/include/head.html b/src/main/resources/templates/include/head.html index 9330e14..e6038d7 100644 --- a/src/main/resources/templates/include/head.html +++ b/src/main/resources/templates/include/head.html @@ -8,7 +8,9 @@ @@ -24,8 +26,10 @@