<script language="javascript">
function recheckMoveButtons() {
$("#sone .profile-field").each(function() {
- $(".move-up-field", this).toggleClass("hidden", $(this).prev(".profile-field").length == 0);
- $(".move-down-field", this).toggleClass("hidden", $(this).next(".profile-field").length == 0);
+ $(".move-up-field", this).toggleClass("hidden", $(this).prev(".profile-field").length === 0);
+ $(".move-down-field", this).toggleClass("hidden", $(this).next(".profile-field").length === 0);
});
}
registerInputTextareaSwap("#sone #edit-profile input[name=birth-year]", birthYearDefaultText, "birth-year", true, true);
});
getTranslation("WebInterface.DefaultText.FieldName", function(fieldNameDefaultText) {
- registerInputTextareaSwap("#sone #add-profile-field input[name=field-name]", fieldNameDefaultText, "field-name", true, true);
+ registerInputTextareaSwap("#sone #add-profile-field input[name=field-name]", fieldNameDefaultText, "field-name", false, true);
});
<%foreach fields field>
deleteButton.fadeOut("slow", function() {
confirmButton.fadeIn("slow");
$(document).one("click", function() {
- if (this != confirmButton.get(0)) {
+ if (this !== confirmButton.get(0)) {
confirmButton.fadeOut("slow", function() {
deleteButton.fadeIn("slow");
});
});
confirmButton.click(function() {
confirmButton.fadeOut("slow");
- buttonName = confirmButton.attr("name");
+ buttonName = confirmButton.prop("name");
fieldId = buttonName.substring("delete-field-".length);
deleteProfileField(fieldId);
recheckMoveButtons();
fieldNameElement.removeClass("hidden");
};
confirmButton.click(function() {
- inputField.attr("disabled", "disabled");
- confirmButton.attr("disabled", "disabled");
- cancelButton.attr("disabled", "disabled");
- editProfileField(confirmButton.parents(".profile-field").attr("id"), inputField.val(), function() {
+ inputField.prop("disabled", "disabled");
+ confirmButton.prop("disabled", "disabled");
+ cancelButton.prop("disabled", "disabled");
+ editProfileField(confirmButton.parents(".profile-field").prop("id"), inputField.val(), function() {
fieldNameElement.text(inputField.val());
cleanUp(editButton, inputField, confirmButton, cancelButton, fieldNameElement);
});
return false;
});
inputField.keypress(function(event) {
- if (event.which == 13) {
+ if (event.which === 13) {
confirmButton.click();
return false;
- } else if (event.which == 27) {
+ } else if (event.which === 27) {
cancelButton.click();
return false;
}
});
editButton.click(function() {
- editButton.attr("disabled", "disabled");
+ editButton.prop("disabled", "disabled");
fieldNameElement.addClass("hidden");
inputField.removeAttr("disabled").val(fieldNameElement.text()).removeClass("hidden").focus().select();
confirmButton.removeAttr("disabled").removeClass("hidden");
/* ajaxify “move up” and “move down” buttons. */
$("#sone .profile-field .move-down-field button").click(function() {
profileField = $(this).parents(".profile-field");
- moveProfileFieldDown(profileField.attr("id"), function() {
+ moveProfileFieldDown(profileField.prop("id"), function() {
next = profileField.next();
current = profileField.insertAfter(next);
recheckMoveButtons();
});
$("#sone .profile-field .move-up-field button").click(function() {
profileField = $(this).parents(".profile-field");
- moveProfileFieldUp(profileField.attr("id"), function() {
+ moveProfileFieldUp(profileField.prop("id"), function() {
previous = profileField.prev();
current = profileField.insertBefore(previous);
recheckMoveButtons();
<input type="text" name="birth-year" value="<% birthYear|html>" />
</div>
+ <h1><%= Page.EditProfile.Avatar.Title|l10n|html></h1>
+
+ <p><%= Page.EditProfile.Avatar.Description|l10n|html></p>
+
+ <ul id="avatar-selection">
+ <li id="no-avatar">
+ <input type="radio" name="avatarId" value="none"<%ifnull avatarId> checked="checked"<%/if>/>
+ <%= Page.EditProfile.Avatar.Delete|l10n|html>
+ </li>
+ <%foreach currentSone.allImages image>
+ <li>
+ <input type="radio" name="avatarId" value="<%image.id|html>"<%if avatarId|match value=image.id> checked="checked"<%/if>/>
+ <div class="post-avatar"><% image|image-link max-width==48 max-height==48 mode==enlarge title=image.title></div>
+ </li>
+ <%/foreach>
+ </ul>
+
<div>
<button type="submit" name="save-profile" value="true"><%= Page.EditProfile.Button.Save|l10n|html></button>
</div>
<%foreach fields field fieldLoop>
<div class="profile-field" id="<% field.id|html>">
<div class="name"><% field.name|html></div>
- <input class="short hidden" type="text"><button class="confirm hidden" type="button">✔</button><button class="cancel hidden" type="button">✘</button>
+ <input class="short hidden" type="text"><button class="edit confirm hidden" type="button">✔</button><button class="cancel hidden" type="button">✘</button>
<div class="edit-field-name"><button type="submit" name="edit-field-<% field.id|html>" value="true"><%= Page.EditProfile.Fields.Button.Edit|l10n|html></button></div>
<div class="delete-field-name"><button type="submit" name="delete-field-<% field.id|html>" value="true"><%= Page.EditProfile.Fields.Button.Delete|l10n|html></button></div>
<div class="<%if fieldLoop.last>hidden <%/if>move-down-field"><button type="submit" name="move-down-field-<% field.id|html>" value="true"><%= Page.EditProfile.Fields.Button.MoveDown|l10n|html></button></div>
<h2><%= Page.EditProfile.Fields.AddField.Title|l10n|html></h2>
<%if duplicateFieldName>
- <p><%= Page.EditProfile.Error.DuplicateFieldName|l10n|replace needle="{fieldName}" replacementKey="fieldName"|html></p>
+ <p><%= Page.EditProfile.Error.DuplicateFieldName|l10n|replace needle=="{fieldName}" replacement=fieldName|html></p>
<%/if>
<div id="new-field">