diff --git a/cmd/web.go b/cmd/web.go index 8a87f86bb1..f226e76ea3 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -50,6 +50,7 @@ and it takes care of all the other things for you`, // checkVersion checks if binary matches the version of templates files. func checkVersion() { + // Templates. data, err := ioutil.ReadFile(path.Join(setting.StaticRootPath, "templates/.VERSION")) if err != nil { log.Fatal(4, "Fail to read 'templates/.VERSION': %v", err) @@ -57,6 +58,11 @@ func checkVersion() { if string(data) != setting.AppVer { log.Fatal(4, "Binary and template file version does not match, did you forget to recompile?") } + + // Macaron. + if macaron.Version() != "0.1.8.0927" { + log.Fatal(4, "Macaron version does not match, did you forget to update?(github.com/Unknwon/macaron)") + } } // newMacaron initializes Macaron instance. diff --git a/conf/locale/locale_en-US.ini b/conf/locale/locale_en-US.ini index f0e0877f86..3990ea8784 100644 --- a/conf/locale/locale_en-US.ini +++ b/conf/locale/locale_en-US.ini @@ -223,6 +223,8 @@ unbind_success = Social account has been unbound. delete_account = Delete Your Account delete_prompt = The operation will delete your account permanently, and CANNOT be undone! confirm_delete_account = Confirm Deletion +delete_account_title = Account Deletion +delete_account_desc = This account is going to be deleted permanently, do you want to continue? [repo] owner = Owner @@ -257,6 +259,7 @@ unstar = Unstar star = Star fork = Fork +no_desc = No Description quick_guide = Quick Guide clone_this_repo = Clone this repository create_new_repo_command = Create a new repository on the command line @@ -289,6 +292,8 @@ settings.basic_settings = Basic Settings settings.danger_zone = Danger Zone settings.site = Official Site settings.update_settings = Update Settings +settings.change_reponame = Repository Name Changed +settings.change_reponame_desc = Repository name has been changed, do you want to continue? This will affect all links relate to this repository. settings.transfer = Transfer Ownership settings.transfer_desc = Transfer this repo to another user or to an organization where you have admin rights. settings.new_owner_has_same_repo = New owner already has a repository with same name. @@ -349,11 +354,15 @@ settings.full_name = Full Name settings.website = Website settings.location = Location settings.update_settings = Update Settings +settings.change_orgname = Organization Name Changed +settings.change_orgname_desc = Organization name has been changed, do you want to continue? This will affect all links relate to this organization. settings.update_setting_success = Organization setting has been successfully updated. settings.delete = Delete Organization settings.delete_account = Delete This Organization settings.delete_prompt = The operation will delete this organization permanently, and CANNOT be undone! settings.confirm_delete_account = Confirm Deletion +settings.delete_org_title = Organization Deletion +settings.delete_org_desc = This organization is going to be deleted permanently, do you want to continue? settings.hooks_desc = Add webhooks that will be triggered for all repositories under this organization. members.public = Public @@ -383,6 +392,8 @@ teams.members = Team Members teams.update_settings = Update Settings teams.delete_team = Delete This Team teams.add_team_member = Add Team Member +teams.delete_team_title = Team Deletion +teams.delete_team_desc = This team is going to be deleted, do you want to continue? Members of this team may lose access to some repositories. teams.delete_team_success = Given team has been successfully deleted. teams.read_permission_desc = This team grants Read access: members can view and clone the team's repositories. teams.write_permission_desc = This team grants Write access: members can read from and push to the team's repositories. @@ -499,6 +510,8 @@ auths.activated = This authentication has activated auths.update_success = Authorization setting has been successfully updated. auths.update = Update Authorization Setting auths.delete = Delete This Authorization +auths.delete_auth_title = Authorization Deletion +auths.delete_auth_desc = This authorization is going to be deleted, do you want to continue? config.server_config = Server Configuration config.app_name = Application Name diff --git a/conf/locale/locale_zh-CN.ini b/conf/locale/locale_zh-CN.ini index 4d80327e56..6ecd529ddb 100644 --- a/conf/locale/locale_zh-CN.ini +++ b/conf/locale/locale_zh-CN.ini @@ -223,6 +223,8 @@ unbind_success = 社交帐号解除绑定成功! delete_account = 删除当前帐户 delete_prompt = 删除操作会永久清除您的帐户信息,并且 不可恢复! confirm_delete_account = 确认删除帐户 +delete_account_title = 帐户删除操作 +delete_account_desc = 该帐户将被永久性删除,您确定要继续操作吗? [repo] owner = 拥有者 @@ -257,6 +259,7 @@ unstar = 取消点赞 star = 点赞 fork = 派生 +no_desc = 暂无描述 quick_guide = 快速帮助 clone_this_repo = 克隆当前仓库 create_new_repo_command = 从命令行创建一个新的仓库 @@ -289,6 +292,8 @@ settings.basic_settings = 基本设置 settings.danger_zone = 危险操作区 settings.site = 官方网站 settings.update_settings = 更新仓库设置 +settings.change_reponame = 仓库名称将被修改 +settings.change_reponame_desc = 仓库名称被修改,您确定要继续操作吗?这将会影响到所有与该仓库有关的链接。 settings.transfer = 转移仓库所有权 settings.transfer_desc = 您可以将仓库转移至您拥有管理员权限的帐户或组织。 settings.new_owner_has_same_repo = 新的仓库拥有者已经存在同名仓库! @@ -349,11 +354,16 @@ settings.full_name = 组织全名 settings.website = 官方网站 settings.location = 所在地区 settings.update_settings = 更新组织设置 +settings.change_orgname = 组织名称将被修改 +settings.change_orgname_desc = 组织名称被修改,您确定要继续操作吗?这将会影响到所有与该组织有关的链接。 settings.update_setting_success = 组织设置更新成功! settings.delete = 删除组织 settings.delete_account = 删除当前组织 settings.delete_prompt = 删除操作会永久清除该组织的信息,并且 不可恢复! settings.confirm_delete_account = 确认删除组织 +settings.delete_org_title = 组织删除操作 +settings.delete_org_desc = 该组织将被永久性删除,您确定要继续操作吗? +settings.hooks_desc = 在此处添加的 Web 钩子将会应用到该组织下的 所有仓库。 members.public = 公开成员 members.public_helper = 设为私有 @@ -382,6 +392,8 @@ teams.members = 团队成员 teams.update_settings = 更新团队设置 teams.delete_team = 删除当前团队 teams.add_team_member = 添加团队成员 +teams.delete_team_title = 团队删除操作 +teams.delete_team_desc = 删除操作会永久清除有关该团队的信息,您确定要继续操作吗?团队成员可能会失去对某些仓库的操作权限。 teams.delete_team_success = 指定团队删除成功! teams.read_permission_desc = 该团队拥有对所属仓库的 读取 权限,团队成员可以进行查看和克隆等只读操作。 teams.write_permission_desc = 该团队拥有对所属仓库的 读取写入 的权限。 @@ -457,6 +469,7 @@ users.is_activated = 该用户已被激活 users.is_admin = 该用户具有管理员权限 users.update_profile = 更新用户信息 users.delete_account = 删除该用户 +users.still_own_repo = 该帐户仍然是某些仓库的拥有者,您必须先转移或删除它们才能执行删除帐户操作! orgs.org_manage_panel = 组织管理面板 orgs.name = 组织名称 @@ -497,6 +510,8 @@ auths.activated = 该授权认证已经启用 auths.update_success = 授权认证设置更新成功! auths.update = 更新授权认证信息 auths.delete = 删除该授权认证 +auths.delete_auth_title = 授权认证删除操作 +auths.delete_auth_desc = 该授权认证将被删除,您确定要继续吗? config.server_config = 服务器配置 config.app_name = 应用名称 diff --git a/gogs.go b/gogs.go index 28b0feccb2..a5d9a49f82 100644 --- a/gogs.go +++ b/gogs.go @@ -17,7 +17,7 @@ import ( "github.com/gogits/gogs/modules/setting" ) -const APP_VER = "0.5.4.0926 Beta" +const APP_VER = "0.5.4.0927 Beta" func init() { runtime.GOMAXPROCS(runtime.NumCPU()) @@ -38,5 +38,6 @@ func main() { cmd.CmdCert, } app.Flags = append(app.Flags, []cli.Flag{}...) + println(runtime.Version()) app.Run(os.Args) } diff --git a/modules/middleware/context.go b/modules/middleware/context.go index 9145038fb0..90716d2c59 100644 --- a/modules/middleware/context.go +++ b/modules/middleware/context.go @@ -9,7 +9,6 @@ import ( "html/template" "io" "net/http" - "path" "strings" "time" @@ -140,23 +139,6 @@ func (ctx *Context) Handle(status int, title string, err error) { ctx.HTML(status, base.TplName(fmt.Sprintf("status/%d", status))) } -func (ctx *Context) ServeFile(file string, names ...string) { - var name string - if len(names) > 0 { - name = names[0] - } else { - name = path.Base(file) - } - ctx.Resp.Header().Set("Content-Description", "File Transfer") - ctx.Resp.Header().Set("Content-Type", "application/octet-stream") - ctx.Resp.Header().Set("Content-Disposition", "attachment; filename="+name) - ctx.Resp.Header().Set("Content-Transfer-Encoding", "binary") - ctx.Resp.Header().Set("Expires", "0") - ctx.Resp.Header().Set("Cache-Control", "must-revalidate") - ctx.Resp.Header().Set("Pragma", "public") - http.ServeFile(ctx.Resp, ctx.Req, file) -} - func (ctx *Context) ServeContent(name string, r io.ReadSeeker, params ...interface{}) { modtime := time.Now() for _, p := range params { diff --git a/public/ng/css/gogs.css b/public/ng/css/gogs.css index dbaa3db1c9..a0be4ee436 100644 --- a/public/ng/css/gogs.css +++ b/public/ng/css/gogs.css @@ -1472,6 +1472,10 @@ The register and sign-in page style font-family: Consolas, Menlo, Monaco, "Lucida Console", monospace; font-size: 14px; } +.no-desc { + color: #888; + font-style: italic; +} #admin-wrapper, #setting-wrapper { padding-bottom: 100px; diff --git a/public/ng/js/gogs.js b/public/ng/js/gogs.js index fcad5cbcc9..9a861004c2 100644 --- a/public/ng/js/gogs.js +++ b/public/ng/js/gogs.js @@ -293,39 +293,38 @@ function initCore() { } e.preventDefault(); }); + + // Popup. + $(document).on('click', '.popup-modal-dismiss', function (e) { + e.preventDefault(); + $.magnificPopup.close(); + }); } function initUserSetting() { // Confirmation of change username in user profile page. var $username = $('#username'); - var $form = $('#user-profile-form'); - var confimed = false; - $('.popup-modal').magnificPopup({ + var $profile_form = $('#user-profile-form'); + $('#change-username-btn').magnificPopup({ modal: true, callbacks: { open: function () { if (($username.data('uname') == $username.val())) { $.magnificPopup.close(); - $form.submit(); + $profile_form.submit(); } } } - }); - $(document).on('click', '.popup-modal-dismiss', function (e) { - e.preventDefault(); - $.magnificPopup.close(); - }); - $('#modal-submit').click(function(){ - $.magnificPopup.close(); - confimed = true; - $form.submit(); - }); - $form.submit(function (e) { - if (($username.data('uname') != $username.val()) && !confimed) { + }).click(function () { + if (($username.data('uname') != $username.val())) { e.preventDefault(); return true; } }); + $('#change-username-submit').click(function () { + $.magnificPopup.close(); + $profile_form.submit(); + }); // Show add SSH key panel. $('#ssh-add').click(function () { @@ -333,11 +332,15 @@ function initUserSetting() { }); // Confirmation of delete account. - $('#delete-account-button').click(function (e) { - if (!confirm('This account is going to be deleted, do you want to continue?')) { - e.preventDefault(); - return true; - } + $('#delete-account-btn').magnificPopup({ + modal: true + }).click(function (e) { + e.preventDefault(); + return true; + }); + $('#delete-account-submit').click(function () { + $.magnificPopup.close(); + $('#delete-account-form').submit(); }); } @@ -409,13 +412,28 @@ function initHookTypeChange() { function initRepoSetting() { // Options. // Confirmation of changing repository name. - $('#repo-setting-form').submit(function (e) { - var $reponame = $('#repo_name'); - if (($reponame.data('repo-name') != $reponame.val()) && !confirm('Repository name has been changed, do you want to continue?')) { + var $reponame = $('#repo_name'); + var $setting_form = $('#repo-setting-form'); + $('#change-reponame-btn').magnificPopup({ + modal: true, + callbacks: { + open: function () { + if (($reponame.data('repo-name') == $reponame.val())) { + $.magnificPopup.close(); + $setting_form.submit(); + } + } + } + }).click(function () { + if (($reponame.data('repo-name') != $reponame.val())) { e.preventDefault(); return true; } }); + $('#change-reponame-submit').click(function () { + $.magnificPopup.close(); + $setting_form.submit(); + }); initHookTypeChange(); @@ -451,19 +469,39 @@ function initRepoSetting() { function initOrgSetting() { // Options. // Confirmation of changing organization name. - $('#org-setting-form').submit(function (e) { - var $orgname = $('#orgname'); - if (($orgname.data('orgname') != $orgname.val()) && !confirm('Organization name has been changed, do you want to continue?')) { + var $orgname = $('#orgname'); + var $setting_form = $('#org-setting-form'); + $('#change-orgname-btn').magnificPopup({ + modal: true, + callbacks: { + open: function () { + if (($orgname.data('orgname') == $orgname.val())) { + $.magnificPopup.close(); + $setting_form.submit(); + } + } + } + }).click(function () { + if (($orgname.data('orgname') != $orgname.val())) { e.preventDefault(); return true; } }); + $('#change-orgname-submit').click(function () { + $.magnificPopup.close(); + $setting_form.submit(); + }); + // Confirmation of delete organization. - $('#delete-org-button').click(function (e) { - if (!confirm('This organization is going to be deleted, do you want to continue?')) { - e.preventDefault(); - return true; - } + $('#delete-org-btn').magnificPopup({ + modal: true + }).click(function (e) { + e.preventDefault(); + return true; + }); + $('#delete-org-submit').click(function () { + $.magnificPopup.close(); + $('#delete-org-form').submit(); }); initHookTypeChange(); @@ -493,11 +531,14 @@ function initInvite() { function initOrgTeamCreate() { // Delete team. - $('#org-team-delete').click(function (e) { - if (!confirm('This team is going to be deleted, do you want to continue?')) { - e.preventDefault(); - return true; - } + $('#org-team-delete').magnificPopup({ + modal: true + }).click(function (e) { + e.preventDefault(); + return true; + }); + $('#delete-team-submit').click(function () { + $.magnificPopup.close(); var $form = $('#team-create-form'); $form.attr('action', $form.data('delete-url')); }); @@ -561,15 +602,20 @@ function initAdmin() { $('.auth-name').toggleShow(); } }); + // Delete account. - $('#user-delete').click(function (e) { - if (!confirm('This account is going to be deleted, do you want to continue?')) { - e.preventDefault(); - return true; - } + $('#delete-account-btn').magnificPopup({ + modal: true + }).click(function (e) { + e.preventDefault(); + return true; + }); + $('#delete-account-submit').click(function () { + $.magnificPopup.close(); var $form = $('#user-profile-form'); $form.attr('action', $form.data('delete-url')); }); + // Create authorization. $('#auth-type').on("change", function () { var v = $(this).val(); @@ -582,13 +628,17 @@ function initAdmin() { $('.ldap').toggleHide(); } }); + // Delete authorization. - $('#auth-delete').click(function (e) { - if (!confirm('This authorization is going to be deleted, do you want to continue?')) { - e.preventDefault(); - return true; - } - var $form = $('auth-setting-form'); + $('#delete-auth-btn').magnificPopup({ + modal: true + }).click(function (e) { + e.preventDefault(); + return true; + }); + $('#delete-auth-submit').click(function () { + $.magnificPopup.close(); + var $form = $('#auth-setting-form'); $form.attr('action', $form.data('delete-url')); }); } diff --git a/public/ng/js/min/gogs-min.js b/public/ng/js/min/gogs-min.js index d27e0a8b33..5bb6daa7f8 100644 --- a/public/ng/js/min/gogs-min.js +++ b/public/ng/js/min/gogs-min.js @@ -1,5 +1,5 @@ -function Tabs(e){function t(e){console.log("hide",e),e.removeClass("js-tab-nav-show"),$(e.data("tab-target")).removeClass("js-tab-show").hide()}function n(e){console.log("show",e),e.addClass("js-tab-nav-show"),$(e.data("tab-target")).addClass("js-tab-show").show()}var r=$(e);if(r.length){var i=r.find(".js-tab-nav-show");i.length&&$(i.data("tab-target")).addClass("js-tab-show"),r.on("click",".js-tab-nav",function(e){e.preventDefault();var o=$(this);o.hasClass("js-tab-nav-show")||(i=r.find(".js-tab-nav-show").eq(0),t(i),n(o))}),console.log("init tabs @",e)}}function Preview(e,t){function n(e){return e.find(".js-preview-input").eq(0)}function r(e){return e.hasClass("js-preview-container")?e:e.find(".js-preview-container").eq(0)}var i=$(e),o=$(t),a=n(o);if(!a.length)return void console.log("[preview]: no preview input");var s=r(o);return s.length?(i.on("click",function(){$.post("/api/v1/markdown",{text:a.val()},function(e){s.html(e)})}),void console.log("[preview]: init preview @",e,"&",t)):void console.log("[preview]: no preview container")}function initCore(){Gogs.renderMarkdown(),Gogs.renderCodeView(),$(".js-tab-nav").click(function(e){$(this).hasClass("js-tab-nav-show")||($(this).parent().find(".js-tab-nav-show").each(function(){$(this).removeClass("js-tab-nav-show"),$($(this).data("tab-target")).hide()}),$(this).addClass("js-tab-nav-show"),$($(this).data("tab-target")).show()),e.preventDefault()})}function initUserSetting(){var e=$("#username"),t=$("#user-profile-form"),n=!1;$(".popup-modal").magnificPopup({modal:!0,callbacks:{open:function(){e.data("uname")==e.val()&&($.magnificPopup.close(),t.submit())}}}),$(document).on("click",".popup-modal-dismiss",function(e){e.preventDefault(),$.magnificPopup.close()}),$("#modal-submit").click(function(){$.magnificPopup.close(),n=!0,t.submit()}),t.submit(function(t){return e.data("uname")==e.val()||n?void 0:(t.preventDefault(),!0)}),$("#ssh-add").click(function(){$("#user-ssh-add-form").removeClass("hide")}),$("#delete-account-button").click(function(e){return confirm("This account is going to be deleted, do you want to continue?")?void 0:(e.preventDefault(),!0)})}function initRepoCreate(){$("#repo-create-owner-list").on("click","li",function(){if(!$(this).hasClass("checked")){var e=$(this).data("uid");$("#repo-owner-id").val(e),$("#repo-owner-avatar").attr("src",$(this).find("img").attr("src")),$("#repo-owner-name").text($(this).text().trim()),$(this).parent().find(".checked").removeClass("checked"),$(this).addClass("checked"),console.log("set repo owner to uid :",e,$(this).text().trim())}}),$("#auth-button").click(function(e){$("#repo-migrate-auth").slideToggle("fast"),e.preventDefault()}),console.log("initRepoCreate")}function initRepo(){$("#repo-clone-ssh").click(function(){$(this).removeClass("btn-gray").addClass("btn-blue"),$("#repo-clone-https").removeClass("btn-blue").addClass("btn-gray"),$("#repo-clone-url").val($(this).data("link")),$(".clone-url").text($(this).data("link"))}),$("#repo-clone-https").click(function(){$(this).removeClass("btn-gray").addClass("btn-blue"),$("#repo-clone-ssh").removeClass("btn-blue").addClass("btn-gray"),$("#repo-clone-url").val($(this).data("link")),$(".clone-url").text($(this).data("link"))});var e=$("#repo-clone-copy");e.hover(function(){Gogs.bindCopy($(this))}),e.tipsy({fade:!0})}function initHookTypeChange(){$("select#hook-type").on("change",function(){hookTypes=["Gogs","Slack"];var e=$(this).val();hookTypes.forEach(function(t){e===t?$("div#"+t.toLowerCase()).toggleShow():$("div#"+t.toLowerCase()).toggleHide()})})}function initRepoSetting(){$("#repo-setting-form").submit(function(e){var t=$("#repo_name");return t.data("repo-name")==t.val()||confirm("Repository name has been changed, do you want to continue?")?void 0:(e.preventDefault(),!0)}),initHookTypeChange(),$("#transfer-button").click(function(){$("#transfer-form").show()}),$("#delete-button").click(function(){$("#delete-form").show()}),$("#repo-collab-list hr:last-child").remove();var e=$("#repo-collaborator").next().next().find("ul");$("#repo-collaborator").on("keyup",function(){var t=$(this);return t.val()?void Gogs.searchUsers(t.val(),e):void e.toggleHide()}).on("focus",function(){$(this).val()?e.toggleShow():e.toggleHide()}).next().next().find("ul").on("click","li",function(){$("#repo-collaborator").val($(this).text()),e.toggleHide()})}function initOrgSetting(){$("#org-setting-form").submit(function(e){var t=$("#orgname");return t.data("orgname")==t.val()||confirm("Organization name has been changed, do you want to continue?")?void 0:(e.preventDefault(),!0)}),$("#delete-org-button").click(function(e){return confirm("This organization is going to be deleted, do you want to continue?")?void 0:(e.preventDefault(),!0)}),initHookTypeChange()}function initInvite(){var e=$("#org-member-invite-list");$("#org-member-invite").on("keyup",function(){var t=$(this);return t.val()?void Gogs.searchUsers(t.val(),e):void e.toggleHide()}).on("focus",function(){$(this).val()?e.toggleShow():e.toggleHide()}).next().next().find("ul").on("click","li",function(){$("#org-member-invite").val($(this).text()),e.toggleHide()})}function initOrgTeamCreate(){$("#org-team-delete").click(function(e){if(!confirm("This team is going to be deleted, do you want to continue?"))return e.preventDefault(),!0;var t=$("#team-create-form");t.attr("action",t.data("delete-url"))})}function initTeamMembersList(){var e=$("#org-team-members-list");$("#org-team-members-add").on("keyup",function(){var t=$(this);return t.val()?void Gogs.searchUsers(t.val(),e):void e.toggleHide()}).on("focus",function(){$(this).val()?e.toggleShow():e.toggleHide()}).next().next().find("ul").on("click","li",function(){$("#org-team-members-add").val($(this).text()),e.toggleHide()})}function initTeamRepositoriesList(){var e=$("#org-team-repositories-list");$("#org-team-repositories-add").on("keyup",function(){var t=$(this);return t.val()?void Gogs.searchRepos(t.val(),e,"uid="+t.data("uid")):void e.toggleHide()}).on("focus",function(){$(this).val()?e.toggleShow():e.toggleHide()}).next().next().find("ul").on("click","li",function(){$("#org-team-repositories-add").val($(this).text()),e.toggleHide()})}function initAdmin(){$("#login-type").on("change",function(){var e=$(this).val();e.indexOf("0-")+1?($(".auth-name").toggleHide(),$(".pwd").find("input").attr("required","required").end().toggleShow()):($(".pwd").find("input").removeAttr("required").end().toggleHide(),$(".auth-name").toggleShow())}),$("#user-delete").click(function(e){if(!confirm("This account is going to be deleted, do you want to continue?"))return e.preventDefault(),!0;var t=$("#user-profile-form");t.attr("action",t.data("delete-url"))}),$("#auth-type").on("change",function(){var e=$(this).val();2==e&&($(".ldap").toggleShow(),$(".smtp").toggleHide()),3==e&&($(".smtp").toggleShow(),$(".ldap").toggleHide())}),$("#auth-delete").click(function(e){if(!confirm("This authorization is going to be deleted, do you want to continue?"))return e.preventDefault(),!0;var t=$("auth-setting-form");t.attr("action",t.data("delete-url"))})}function initInstall(){!function(){var e="127.0.0.1:3306",t="127.0.0.1:5432";$("#install-database").on("change",function(){var n=$(this).val();"SQLite3"!=n?($(".server-sql").show(),$(".sqlite-setting").addClass("hide"),"PostgreSQL"==n?($(".pgsql-setting").removeClass("hide"),$("#database-host").val()==e&&$("#database-host").val(t)):"MySQL"==n?($(".pgsql-setting").addClass("hide"),$("#database-host").val()==t&&$("#database-host").val(e)):$(".pgsql-setting").addClass("hide")):($(".server-sql").hide(),$(".pgsql-setting").hide(),$(".sqlite-setting").removeClass("hide"))})}()}function initProfile(){$("#profile-avatar").tipsy({fade:!0})}function homepage(){$("#promo-form").submit(function(e){return""===$("#username").val()?(e.preventDefault(),window.location.href=Gogs.AppSubUrl+"/user/login",!0):void 0}),$("#register-button").click(function(e){return""===$("#username").val()?(e.preventDefault(),window.location.href=Gogs.AppSubUrl+"/user/sign_up",!0):void $("#promo-form").attr("action",Gogs.AppSubUrl+"/user/sign_up")})}!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function n(e){var t=e.length,n=ot.type(e);return"function"===n||ot.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e}function r(e,t,n){if(ot.isFunction(t))return ot.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return ot.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(pt.test(t))return ot.filter(t,e,n);t=ot.filter(t,e)}return ot.grep(e,function(e){return ot.inArray(e,t)>=0!==n})}function i(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function o(e){var t=wt[e]={};return ot.each(e.match(xt)||[],function(e,n){t[n]=!0}),t}function a(){mt.addEventListener?(mt.removeEventListener("DOMContentLoaded",s,!1),e.removeEventListener("load",s,!1)):(mt.detachEvent("onreadystatechange",s),e.detachEvent("onload",s))}function s(){(mt.addEventListener||"load"===event.type||"complete"===mt.readyState)&&(a(),ot.ready())}function l(e,t,n){if(void 0===n&&1===e.nodeType){var r="data-"+t.replace($t,"-$1").toLowerCase();if(n=e.getAttribute(r),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:kt.test(n)?ot.parseJSON(n):n}catch(i){}ot.data(e,t,n)}else n=void 0}return n}function u(e){var t;for(t in e)if(("data"!==t||!ot.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function c(e,t,n,r){if(ot.acceptData(e)){var i,o,a=ot.expando,s=e.nodeType,l=s?ot.cache:e,u=s?e[a]:e[a]&&a;if(u&&l[u]&&(r||l[u].data)||void 0!==n||"string"!=typeof t)return u||(u=s?e[a]=V.pop()||ot.guid++:a),l[u]||(l[u]=s?{}:{toJSON:ot.noop}),("object"==typeof t||"function"==typeof t)&&(r?l[u]=ot.extend(l[u],t):l[u].data=ot.extend(l[u].data,t)),o=l[u],r||(o.data||(o.data={}),o=o.data),void 0!==n&&(o[ot.camelCase(t)]=n),"string"==typeof t?(i=o[t],null==i&&(i=o[ot.camelCase(t)])):i=o,i}}function d(e,t,n){if(ot.acceptData(e)){var r,i,o=e.nodeType,a=o?ot.cache:e,s=o?e[ot.expando]:ot.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){ot.isArray(t)?t=t.concat(ot.map(t,ot.camelCase)):t in r?t=[t]:(t=ot.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;for(;i--;)delete r[t[i]];if(n?!u(r):!ot.isEmptyObject(r))return}(n||(delete a[s].data,u(a[s])))&&(o?ot.cleanData([e],!0):rt.deleteExpando||a!=a.window?delete a[s]:a[s]=null)}}}function f(){return!0}function p(){return!1}function h(){try{return mt.activeElement}catch(e){}}function m(e){var t=Pt.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function g(e,t){var n,r,i=0,o=typeof e.getElementsByTagName!==St?e.getElementsByTagName(t||"*"):typeof e.querySelectorAll!==St?e.querySelectorAll(t||"*"):void 0;if(!o)for(o=[],n=e.childNodes||e;null!=(r=n[i]);i++)!t||ot.nodeName(r,t)?o.push(r):ot.merge(o,g(r,t));return void 0===t||t&&ot.nodeName(e,t)?ot.merge([e],o):o}function v(e){jt.test(e.type)&&(e.defaultChecked=e.checked)}function y(e,t){return ot.nodeName(e,"table")&&ot.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function b(e){return e.type=(null!==ot.find.attr(e,"type"))+"/"+e.type,e}function x(e){var t=Zt.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function w(e,t){for(var n,r=0;null!=(n=e[r]);r++)ot._data(n,"globalEval",!t||ot._data(t[r],"globalEval"))}function C(e,t){if(1===t.nodeType&&ot.hasData(e)){var n,r,i,o=ot._data(e),a=ot._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)ot.event.add(t,n,s[n][r])}a.data&&(a.data=ot.extend({},a.data))}}function S(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!rt.noCloneEvent&&t[ot.expando]){i=ot._data(t);for(r in i.events)ot.removeEvent(t,r,i.handle);t.removeAttribute(ot.expando)}"script"===n&&t.text!==e.text?(b(t).text=e.text,x(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),rt.html5Clone&&e.innerHTML&&!ot.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&jt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}function T(t,n){var r,i=ot(n.createElement(t)).appendTo(n.body),o=e.getDefaultComputedStyle&&(r=e.getDefaultComputedStyle(i[0]))?r.display:ot.css(i[0],"display");return i.detach(),o}function k(e){var t=mt,n=Jt[e];return n||(n=T(e,t),"none"!==n&&n||(Kt=(Kt||ot("