From 1b0142513e21fd37d477ca776ccf8d6f6f1bc928 Mon Sep 17 00:00:00 2001 From: FuXiaoHei Date: Sun, 6 Apr 2014 16:29:45 +0800 Subject: release-new page ui --- public/js/app.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'public/js/app.js') diff --git a/public/js/app.js b/public/js/app.js index 0ba0675f..93e01abd 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -520,6 +520,23 @@ function initIssue() { } +function initRelease() { +// release new ajax preview + (function () { + $('[data-ajax-name=release-preview]').on("click", function () { + var $this = $(this); + $this.toggleAjax(function (json) { + if (json.ok) { + $($this.data("preview")).html(json.content); + } + }) + }); + $('.release-write a[data-toggle]').on("click", function () { + $('.release-preview-content').html("loading..."); + }); + }()) +} + (function ($) { $(function () { initCore(); @@ -539,5 +556,8 @@ function initIssue() { if ($('#issue').length) { initIssue(); } + if ($('#release').length) { + initRelease(); + } }); })(jQuery); -- cgit v1.2.3 From d3a987eded8bf2d0afc35dce32238e59da8080a8 Mon Sep 17 00:00:00 2001 From: FuXiaoHei Date: Sun, 6 Apr 2014 16:48:02 +0800 Subject: username & repo-name changing help message --- public/js/app.js | 27 ++++++++++++++++++++++++++- templates/repo/setting.tmpl | 5 +++-- templates/user/setting.tmpl | 5 +++-- 3 files changed, 32 insertions(+), 5 deletions(-) (limited to 'public/js/app.js') diff --git a/public/js/app.js b/public/js/app.js index 93e01abd..059663e1 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 6e2d3bec..85d08c59 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 b32689fe..d5828338 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.

- +
- + +
-- cgit v1.2.3 From 8549b47e04a1461520d698bd87cbd67f1236508b Mon Sep 17 00:00:00 2001 From: FuXiaoHei Date: Mon, 14 Apr 2014 20:40:22 +0800 Subject: fix repo-new ui, fix top-nav search-bar ui --- public/css/gogs.css | 2 ++ public/js/app.js | 10 +++++++++- templates/release/new.tmpl | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) (limited to 'public/js/app.js') diff --git a/public/css/gogs.css b/public/css/gogs.css index b9c7b6ae..12b6d8b0 100755 --- a/public/css/gogs.css +++ b/public/css/gogs.css @@ -109,11 +109,13 @@ html, body { background-color: #F6F6F6; border-bottom-right-radius: 3px; border-top-right-radius: 3px; + -webkit-transition: width linear .25s; } #nav-search-form input[type=search]:focus { background-color: #FFF; border-color: #D9D9D9; + width: 320px; } /* gogits nav item active status */ diff --git a/public/js/app.js b/public/js/app.js index 059663e1..a5c79a39 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -559,7 +559,15 @@ function initRelease() { $('.release-write a[data-toggle]').on("click", function () { $('.release-preview-content').html("loading..."); }); - }()) + }()); + + // release new target selection + (function () { + $('#release-new-target-branch-list').on('click', 'a', function () { + $('#tag-target').val($(this).text()); + $('#release-new-target-name').text(" " + $(this).text()); + }); + }()); } (function ($) { diff --git a/templates/release/new.tmpl b/templates/release/new.tmpl index 439496ea..6dfe4a5c 100644 --- a/templates/release/new.tmpl +++ b/templates/release/new.tmpl @@ -28,6 +28,7 @@ {{end}} +

Choose an existing tag, or create a new tag on publish

-- cgit v1.2.3