summaryrefslogtreecommitdiffstats
path: root/public
diff options
context:
space:
mode:
authorFuXiaoHei <fuxiaohei@hexiaz.com>2014-03-17 15:17:44 +0800
committerFuXiaoHei <fuxiaohei@hexiaz.com>2014-03-17 15:17:44 +0800
commit24d91ecda8c819a33f326ff724559456bcae6d71 (patch)
tree9af7902cdbd4b1b5187bd1134e46e0111731c6e7 /public
parent3a2eee08278a71320140129ec29c8586264d9968 (diff)
downloadgitea-24d91ecda8c819a33f326ff724559456bcae6d71.tar.gz
gitea-24d91ecda8c819a33f326ff724559456bcae6d71.zip
ui and js update
Diffstat (limited to 'public')
-rwxr-xr-xpublic/css/gogs.css12
-rw-r--r--public/js/app.js35
2 files changed, 30 insertions, 17 deletions
diff --git a/public/css/gogs.css b/public/css/gogs.css
index f98cf7a184..3d0a31e6f5 100755
--- a/public/css/gogs.css
+++ b/public/css/gogs.css
@@ -51,7 +51,6 @@ html, body {
.gogs-masthead {
background-color: #428bca;
box-shadow: inset 0 -2px 5px rgba(0, 0, 0, .1);
- padding: 0 16px;
margin: 0;
}
@@ -133,6 +132,11 @@ html, body {
padding: 5px 0;
margin-left: 10px;
height: 28px;
+ float: right;
+}
+
+#gogs-nav-signin{
+ float: right;
}
#gogs-nav-out .fa {
@@ -349,10 +353,6 @@ html, body {
/* #gogs-feed */
-#gogs-feed-left {
- padding-left: 0;
-}
-
#gogs-feed-right .repo-panel .panel-heading .btn {
margin-top: -4px;
}
@@ -635,7 +635,7 @@ html, body {
}
#footer .footer-wrap {
- padding: 20px 0;
+ padding: 20px 15px;
}
#footer a {
diff --git a/public/js/app.js b/public/js/app.js
index 94e38cc134..58633718fc 100644
--- a/public/js/app.js
+++ b/public/js/app.js
@@ -43,7 +43,15 @@ var Gogits = {
Gogits.initTabs = function () {
var $tabs = $('[data-init=tabs]');
$tabs.find("li:eq(0) a").tab("show");
+ };
+
+ // render markdown
+ Gogits.renderMarkdown = function () {
+ var $pre = $('.markdown').find('pre > code').parent();
+ $pre.addClass("prettyprint");
+ prettyPrint();
}
+
})(jQuery);
// ajax utils
@@ -70,6 +78,7 @@ function initCore() {
Gogits.initTooltips();
Gogits.initTabs();
Gogits.initModals();
+ Gogits.renderMarkdown();
}
function initRegister() {
@@ -98,14 +107,14 @@ function initRegister() {
});
}
-function initUserSetting(){
+function initUserSetting() {
$('#gogs-ssh-keys .delete').confirmation({
singleton: true,
- onConfirm: function(e, $this){
- Gogits.ajaxDelete("",{"id":$this.data("del")},function(json){
- if(json.ok){
+ onConfirm: function (e, $this) {
+ Gogits.ajaxDelete("", {"id": $this.data("del")}, function (json) {
+ if (json.ok) {
window.location.reload();
- }else{
+ } else {
alert(json.err);
}
});
@@ -113,11 +122,15 @@ function initUserSetting(){
});
}
-;(function($){
- // on Dom Ready
- $(function(){
- var $pre = $('.markdown').find('pre > code').parent();
- $pre.addClass("prettyprint");
- prettyPrint();
+(function ($) {
+ $(function () {
+ initCore();
+ var body = $("#gogs-body");
+ if (body.data("page") == "user-signup") {
+ initRegister();
+ }
+ if (body.data("page") == "user") {
+ initUserSetting();
+ }
});
})(jQuery);