|
|
@@ -205,9 +205,52 @@ var _hmt = _hmt || []; |
|
|
|
<div class="ui top secondary stackable main menu following bar dark"> |
|
|
|
{{template "base/head_navbar" .}} |
|
|
|
</div><!-- end bar --> |
|
|
|
<div class="notic_content" id ="notic_content" > |
|
|
|
<a href={{.notice.Link}} class="a_width"> |
|
|
|
<marquee behavior="scroll" direction="left"> |
|
|
|
{{.notice.Title}} |
|
|
|
</marquee> |
|
|
|
</a> |
|
|
|
<i class="icon icon-octicon x_icon" onclick="closeNoice()">{{svg "octicon-x" 16}}</i> |
|
|
|
</div> |
|
|
|
{{end}} |
|
|
|
{{/* |
|
|
|
</div> |
|
|
|
</body> |
|
|
|
</html> |
|
|
|
*/}} |
|
|
|
|
|
|
|
<script> |
|
|
|
|
|
|
|
function closeNoice(){ |
|
|
|
document.getElementById("notic_content").style.display='none' |
|
|
|
localStorage.setItem("isCloseNotice",true) |
|
|
|
} |
|
|
|
function isShowNotice(){ |
|
|
|
var current_notice = localStorage.getItem("notice") |
|
|
|
|
|
|
|
if (current_notice != "{{.notice.CommitId}}"){ |
|
|
|
localStorage.setItem('notice',"{{.notice.CommitId}}"); |
|
|
|
isNewNotice=true; |
|
|
|
localStorage.setItem("isCloseNotice",false) |
|
|
|
}else{ |
|
|
|
isNewNotice=false; |
|
|
|
} |
|
|
|
if (JSON.parse("{{.notice.Visible}}")){ |
|
|
|
if(isNewNotice){ |
|
|
|
document.getElementById("notic_content").style.display='block' |
|
|
|
}else{ |
|
|
|
isCloseNotice = localStorage.getItem("isCloseNotice") |
|
|
|
if (JSON.parse(isCloseNotice)){ |
|
|
|
document.getElementById("notic_content").style.display='none' |
|
|
|
}else{ |
|
|
|
document.getElementById("notic_content").style.display='block' |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}else{ |
|
|
|
document.getElementById("notic_content").style.display='none' |
|
|
|
} |
|
|
|
} |
|
|
|
isShowNotice(); |
|
|
|
</script> |