View.Post.DeleteLink=Delete
View.Post.SendReply=Post Reply!
View.Post.Reply.DeleteLink=Delete
+
+WebInterface.DefaultText.StatusUpdate=What’s on your mind?
+WebInterface.DefaultText.CreateSoneName=The name of your Sone
+WebInterface.DefaultText.CreateSoneDocumentName=The document name of your Sone (e.g. the “foo” in USK@…/foo/0)
+WebInterface.DefaultText.CreateSoneInsertURI=The Insert Key of your Sone
+WebInterface.DefaultText.CreateSoneRequestURI=The Request Key of your Sone
+WebInterface.DefaultText.Reply=Write a Reply…
+WebInterface.DefaultText.SoneRequestURI=Sone Request Key
/* Sone JavaScript functions. */
-function registerInputTextareaSwap(inputSelector, defaultText, inputFieldName) {
+function registerInputTextareaSwap(inputSelector, defaultText, inputFieldName, optional) {
$(inputSelector).each(function() {
textarea = $("<textarea name=\"" + inputFieldName + "\"></textarea>").blur(function() {
if ($(this).val() == "") {
$(inputField).focus(function() {
$(this).hide().attr("disabled", "disabled");
textarea.show().focus();
- }).addClass("default").val(defaultText);
+ }).addClass("default");
+ (function(inputField) {
+ $.getJSON("ajax/getTranslation.ajax", {"key": defaultText}, function(data, textStatus) {
+ $(inputField).val(data.value);
+ });
+ })(inputField);
$(inputField.form).submit(function() {
- if (textarea.val() == "") {
+ if (!optional && (textarea.val() == "")) {
return false;
}
});
<script language="javascript">
$(document).ready(function() {
- registerInputTextareaSwap("#sone #create-sone input[name=name]", "The name of your Sone", "name");
- registerInputTextareaSwap("#sone #create-sone input[name=document-name]", "The document name of your Sone", "document-name");
- registerInputTextareaSwap("#sone #create-sone input[name=insert-uri]", "The insert URI of your Sone", "insert-uri");
- registerInputTextareaSwap("#sone #create-sone input[name=request-uri]", "The request URI of your Sone", "request-uri");
+ registerInputTextareaSwap("#sone #create-sone input[name=name]", "WebInterface.DefaultText.CreateSoneName", "name", false);
+ registerInputTextareaSwap("#sone #create-sone input[name=document-name]", "WebInterface.DefaultText.CreateSoneDocumentName", "document-name", false);
+ registerInputTextareaSwap("#sone #create-sone input[name=insert-uri]", "WebInterface.DefaultText.CreateSoneInsertURI", "insert-uri", true);
+ registerInputTextareaSwap("#sone #create-sone input[name=request-uri]", "WebInterface.DefaultText.CreateSoneRequestURI", "request-uri", true);
/* hide all the labels. */
$("#sone #create-sone label").hide();
<script language="javascript">
$(document).ready(function() {
- registerInputTextareaSwap("#sone #update-status .status-input", "What are you doing?", "text");
+ registerInputTextareaSwap("#sone #update-status .status-input", "WebInterface.DefaultText.StatusUpdate", "text", false);
});
</script>
<script language="javascript">
/* register input field/textarea swap. */
$(document).ready(function() {
- registerInputTextareaSwap("#sone input.reply-input", "Write a Reply…", "text");
+ registerInputTextareaSwap("#sone input.reply-input", "WebInterface.DefaultText.Reply", "text", false);
addCommentLinks();
});
</script>
<script language="javascript">
$(document).ready(function() {
- registerInputTextareaSwap("#add-sone input[name=request-uri]", "Sone Request Key", "request-uri");
+ registerInputTextareaSwap("#add-sone input[name=request-uri]", "WebInterface.DefaultText.SoneRequestURI", "request-uri", false);
})
</script>