Finish new UI for release page

This commit is contained in:
Unknwon 2014-12-10 16:37:54 -05:00
parent 01ba771783
commit bc8721fb6c
16 changed files with 520 additions and 239 deletions

View file

@ -403,6 +403,16 @@ function initRepo() {
$clone_btn.tipsy({
fade: true
});
// Markdown preview.
$('.markdown-preview').click(function() {
var $this = $(this);
$this.toggleAjax(function (resp) {
$($this.data("preview")).html(resp);
}, function () {
$($this.data("preview")).html("no content");
})
});
}
// when user changes hook type, hide/show proper divs
@ -423,6 +433,13 @@ function initHookTypeChange() {
});
}
function initRepoRelease() {
$('#release-new-target-branch-list li').click(function() {
$('#repo-branch-current').text($(this).text());
$('#tag-target').val($(this).text());
})
}
function initRepoSetting() {
// Options.
// Confirmation of changing repository name.
@ -753,8 +770,12 @@ $(document).ready(function () {
initRepoCreate();
}
if ($('#repo-header').length) {
initTimeSwitch();
initRepo();
}
if ($('#release').length) {
initRepoRelease();
}
if ($('#repo-setting').length) {
initRepoSetting();
}
@ -819,3 +840,7 @@ function homepage() {
$('#promo-form').attr('action', Gogs.AppSubUrl + '/user/sign_up');
});
}
String.prototype.endsWith = function (suffix) {
return this.indexOf(suffix, this.length - suffix.length) !== -1;
};