|
|
@ -43,7 +43,15 @@ var Gogits = {
|
|
|
|
Gogits.initTabs = function () {
|
|
|
|
Gogits.initTabs = function () {
|
|
|
|
var $tabs = $('[data-init=tabs]');
|
|
|
|
var $tabs = $('[data-init=tabs]');
|
|
|
|
$tabs.find("li:eq(0) a").tab("show");
|
|
|
|
$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);
|
|
|
|
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
// ajax utils
|
|
|
|
// ajax utils
|
|
|
@ -70,6 +78,7 @@ function initCore() {
|
|
|
|
Gogits.initTooltips();
|
|
|
|
Gogits.initTooltips();
|
|
|
|
Gogits.initTabs();
|
|
|
|
Gogits.initTabs();
|
|
|
|
Gogits.initModals();
|
|
|
|
Gogits.initModals();
|
|
|
|
|
|
|
|
Gogits.renderMarkdown();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function initRegister() {
|
|
|
|
function initRegister() {
|
|
|
@ -113,11 +122,15 @@ function initUserSetting(){
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
;(function($){
|
|
|
|
(function ($) {
|
|
|
|
// on Dom Ready
|
|
|
|
|
|
|
|
$(function () {
|
|
|
|
$(function () {
|
|
|
|
var $pre = $('.markdown').find('pre > code').parent();
|
|
|
|
initCore();
|
|
|
|
$pre.addClass("prettyprint");
|
|
|
|
var body = $("#gogs-body");
|
|
|
|
prettyPrint();
|
|
|
|
if (body.data("page") == "user-signup") {
|
|
|
|
|
|
|
|
initRegister();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (body.data("page") == "user") {
|
|
|
|
|
|
|
|
initUserSetting();
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
})(jQuery);
|
|
|
|
})(jQuery);
|
|
|
|