69 lines
2.0 KiB
Plaintext
69 lines
2.0 KiB
Plaintext
<script type="text/javascript">
|
|
//头部导航
|
|
var menuids=["TopUserNav"] //Enter id(s) of SuckerTree UL menus, separated by commas
|
|
function buildsubmenus(){
|
|
for (var i=0; i<menuids.length; i++){
|
|
var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
|
|
for (var t=0; t<ultags.length; t++){
|
|
ultags[t].parentNode.getElementsByTagName("a")[0].className="subfolderstyle"
|
|
ultags[t].parentNode.onmouseover=function(){
|
|
this.getElementsByTagName("ul")[0].style.display="block"
|
|
}
|
|
ultags[t].parentNode.onmouseout=function(){
|
|
this.getElementsByTagName("ul")[0].style.display="none"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
if (window.addEventListener)
|
|
window.addEventListener("load", buildsubmenus, false)
|
|
else if (window.attachEvent)
|
|
window.attachEvent("onload", buildsubmenus)
|
|
</script>
|
|
|
|
<script type="text/javascript">//侧导航
|
|
|
|
window.onload = function () {
|
|
var topic_id = getParam('topic_id');
|
|
document.getElementById(topic_id).focus();
|
|
}
|
|
|
|
var getParam = function(name){
|
|
var search = document.location.search;
|
|
var pattern = new RegExp("[?&]"+name+"\=([^&]+)", "g");
|
|
var matcher = pattern.exec(search);
|
|
var items = null;
|
|
if(null != matcher){
|
|
try{
|
|
items = decodeURIComponent(decodeURIComponent(matcher[1]));
|
|
}catch(e){
|
|
try{
|
|
items = decodeURIComponent(matcher[1]);
|
|
}catch(e){
|
|
items = matcher[1];
|
|
}
|
|
}
|
|
}
|
|
return items;
|
|
};
|
|
|
|
function show_newtalk()
|
|
{
|
|
$("#about_newtalk").toggle();
|
|
}
|
|
|
|
function show_newtalk1(id)
|
|
{
|
|
$(id).toggle();
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
<% if @project %>
|
|
<%= render :partial => 'project_show', locals: {project: @project} %>
|
|
<% elsif @course %>
|
|
<%= render :partial => 'course_show', locals: {course: @course} %>
|
|
<% end %>
|