diff --git a/images/badge-bg.png b/images/badge-bg.png new file mode 100644 index 00000000..cd9655b2 Binary files /dev/null and b/images/badge-bg.png differ diff --git a/images/badge.png b/images/badge.png new file mode 100644 index 00000000..b6f96f1b Binary files /dev/null and b/images/badge.png differ diff --git a/images/project file/badge.fw.png b/images/project file/badge.fw.png new file mode 100644 index 00000000..cdee50fc Binary files /dev/null and b/images/project file/badge.fw.png differ diff --git a/script.js b/script.js index d50ad5fe..0845c51e 100644 --- a/script.js +++ b/script.js @@ -59,6 +59,7 @@ var Formation = function(teamCount,memberCount){ this.title = "", this.detail = "", this.team = []; + this.badge = 0; for (var ti=0;ti0) obj.b = this.badge; //徽章 return obj; } Formation.prototype.loadObj= function(f){ var dataVeision = f.f?2:1; //是第几版格式 this.title = dataVeision>1 ? f.t : f.title; this.detail = dataVeision>1 ? f.d : f.detail; + this.badge = f.b?f.b:0; //徽章 var teamArr = dataVeision>1 ? f.f : f.team; this.team.forEach(function(t,ti){ var tf = teamArr[ti] || []; @@ -243,7 +246,23 @@ function initialize() //队伍框 var formationBox = document.querySelector(".formation-box"); - formationBox.formationBox = formation; + formationBox.formation = formation; + + //徽章 + var badges = Array.prototype.slice.call(formationBox.querySelectorAll(".formation-badge .badge-bg")); + badges.forEach(function(badge,bidx){ + badge.onclick = function(){ + if (badges.some(function(b){return b.classList.contains("display-none");})) + { //未展开时 + badges.forEach(function(b,idx){if (idx!=bidx)b.classList.remove("display-none");}) + }else + { //展开时 + badges.forEach(function(b,idx){if (idx!=bidx)b.classList.add("display-none");}) + formation.badge = bidx; + creatNewUrl(); + } + } + }) //编辑框 var editBox = document.querySelector(".edit-box"); @@ -909,6 +928,9 @@ function refreshAll(fmt){ txtTitle.value = fmt.title || ""; txtDetail.value = fmt.detail || ""; txtDetail.onblur(); + + var badges = Array.prototype.slice.call(document.querySelectorAll(".formation-box .formation-badge .badge-bg")); + badges.forEach(function(b,idx){if (idx==fmt.badge) b.classList.remove("display-none"); else b.classList.add("display-none");}) var formationA = document.querySelector(".formation-box .formation-A-box"); var formationB = document.querySelector(".formation-box .formation-B-box"); diff --git a/solo.html b/solo.html index e3d466b6..a8c33bec 100644 --- a/solo.html +++ b/solo.html @@ -29,6 +29,22 @@ var formation = new Formation(1,6);
+
    +
  • + + + + + + + + + + + + + +