Merge branch 'dev' into sxw-dev

Conflicts:
	template/admin/admin.html
This commit is contained in:
sxw
2015-08-07 19:28:24 +08:00
17 changed files with 288 additions and 211 deletions

View File

@@ -7,25 +7,36 @@ define("admin", ["jquery", "avalon"], function($, avalon){
$(".list-group-item").attr("class", "list-group-item");
}
function show_template(url){
$("#loading-gif").show();
vm.template_url = url;
}
var vm = avalon.define({
$id: "admin",
template_url: "template/index/index.html",
hide_loading: function(){
$("#loading-gif").hide();
}
});
var hash = window.location.hash.substring(1);
if(hash){
li_active("#li-" + hash);
li_active("#li-" + hash.replace("/", "-"));
show_template("template/" + hash + ".html");
}else {
li_active("#li-index");
li_active("#li-index-index");
}
window.onhashchange = function() {
var hash = window.location.hash.substring(1);
if(hash){
li_inactive(".list-group-item");
li_active("#li-" + hash);
vm.template_url = "template/index/" + hash + ".html";
li_active("#li-" + hash.replace("/", "-"));
show_template("template/" + hash + ".html");
}
};
var vm = avalon.define({
$id: "admin",
template_url: "template/index/index.html"
});
});

View File

@@ -2,6 +2,7 @@ require(["jquery", "avalon", "editor", "uploader", "datetimepicker",
"validation"
],
function ($, avalon, editor, uploader) {
avalon.vmodels.add_contest = null;
$("#add-contest-form")
.formValidation({
framework: "bootstrap",