diff --git a/public/js/app.js b/public/js/app.js index 93e01abd28..059663e1a2 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -354,6 +354,7 @@ function initRegister() { } function initUserSetting() { + // ssh confirmation $('#ssh-keys .delete').confirmation({ singleton: true, onConfirm: function (e, $this) { @@ -366,6 +367,18 @@ function initUserSetting() { }); } }); + + // profile form + (function () { + $('#user-setting-username').on("keyup", function () { + var $this = $(this); + if ($this.val() != $this.attr('title')) { + $this.next('.help-block').toggleShow(); + } else { + $this.next('.help-block').toggleHide(); + } + }); + }()) } function initRepository() { @@ -383,7 +396,7 @@ function initRepository() { $clone.find('span.clone-url').text($this.data('link')); } }).eq(0).trigger("click"); - $("#repo-clone").on("shown.bs.dropdown",function () { + $("#repo-clone").on("shown.bs.dropdown", function () { Gogits.bindCopy("[data-init=copy]"); }); Gogits.bindCopy("[data-init=copy]:visible"); @@ -438,6 +451,18 @@ function initRepository() { $item.find(".bar .add").css("width", addPercent + "%"); }); }()); + + // repo setting form + (function () { + $('#repo-setting-name').on("keyup", function () { + var $this = $(this); + if ($this.val() != $this.attr('title')) { + $this.next('.help-block').toggleShow(); + } else { + $this.next('.help-block').toggleHide(); + } + }); + }()) } function initInstall() { diff --git a/templates/repo/setting.tmpl b/templates/repo/setting.tmpl index 6e2d3bec8b..85d08c5973 100644 --- a/templates/repo/setting.tmpl +++ b/templates/repo/setting.tmpl @@ -23,9 +23,10 @@ {{.CsrfTokenHtml}}
- +
- + +
diff --git a/templates/user/setting.tmpl b/templates/user/setting.tmpl index b32689fe12..d582833870 100644 --- a/templates/user/setting.tmpl +++ b/templates/user/setting.tmpl @@ -10,9 +10,10 @@ {{if .IsSuccess}}

Your profile has been successfully updated.

{{else if .HasError}}

{{.ErrorMsg}}

{{end}}

Your Email will be public and used for Account related notifications and any web based operations made via the web.

- +
- + +