This commit is contained in:
Van 2014-09-10 18:08:35 +08:00
parent 7650879cde
commit 9f0f9cc0f6
4 changed files with 97 additions and 7 deletions

View File

@ -45,6 +45,7 @@ ul {
background-color: #F8F8F8;
width: 340px;
z-index: 5;
display: none;
}
.frame li {
@ -120,6 +121,21 @@ ul {
}
/* end framework */
/* start menu */
.menu > ul > li {
float: left;
}
.menu > ul > li > a,
.menu > ul > li > span {
color: #000;
font-size: 12px;
line-height: 24px;
padding: 5px;
text-decoration: none;
}
/* end menu */
/* start editor */
.edit-panel {
background-color: #D7D7D7;

19
static/js/menu.js Normal file
View File

@ -0,0 +1,19 @@
var menu = {
init: function() {
this.subMenu();
},
subMenu: function () {
$(".menu > ul > li > a, .menu > ul> li > span").click(function() {
var $it = $(this);
$it.next().show();
$(".menu > ul > li > a, .menu > ul> li > span").unbind();
$(".menu > ul > li > a, .menu > ul> li > span").mouseover(function() {
$(".frame").hide();
var $it = $(this);
$it.next().show();
});
});
}
};

View File

@ -83,6 +83,12 @@ var wide = {
if (!(event.target.id === "fileRMenu" || $(event.target).closest("#fileRMenu").length > 0)) {
$("#fileRMenu").hide();
}
if (!($(event.target).closest(".frame").length > 0 || event.target.className === "frame")) {
$(".frame").hide();
$(".menu > ul > li > a, .menu > ul> li > span").unbind("mouseover");
menu.subMenu();
}
});
},
save: function() {
@ -216,4 +222,5 @@ var wide = {
$(document).ready(function() {
wide.init();
tree.init();
menu.init();
});

View File

@ -17,17 +17,64 @@
</head>
<body>
<div class="menu fn-clear">
<a href="/doc/{{.locale}}/index.html" target="_blank">{{.i18n.file}}</a>
<a href="/doc/{{.locale}}/index.html" target="_blank">{{.i18n.run}}</a>
<a href="/doc/{{.locale}}/index.html" target="_blank">{{.i18n.debug}}</a>
<a href="/doc/{{.locale}}/index.html" target="_blank">{{.i18n.help}}</a>
<span class="fn-none ico-fullscreen" onclick="editors.fullscreen()">{{.i18n.full_screen}}</span>
<ul class="fn-cleaer">
<li>
<span>{{.i18n.file}}</span>
<div class="frame">
<ul>
<li>
<a href="/doc/{{.locale}}/index.html" target="_blank">{{.i18n.file}}</a>
</li>
<li>
<a href="/doc/{{.locale}}/index.html" target="_blank">{{.i18n.file}}</a>
</li>
<li>
<a href="/doc/{{.locale}}/index.html" target="_blank">{{.i18n.file}}</a>
</li>
</ul>
</div>
</li>
<li>
<span>{{.i18n.run}}</span>
<div class="frame">
<ul>
<li>
<span>{{.i18n.run}}</span>
</li>
<li>
<span>{{.i18n.run}}</span>
</li>
<li>
<span>{{.i18n.run}}</span>
</li>
</ul>
</div>
</li>
<li>
<span>{{.i18n.debug}}</span>
<div class="frame">
<ul>
<li>
<span>{{.i18n.run}}</span>
</li>
<li>
<span>{{.i18n.run}}</span>
</li>
</ul>
</div>
</li>
<li>
<a href="/doc/{{.locale}}/index.html" target="_blank">{{.i18n.help}}</a>
</li>
</ul>
<div class="toolbars fn-right">
<button onclick="wide.run()">{{.i18n.build_n_run}}</button>
<button onclick="wide.save()">{{.i18n.save}}</button>
<button onclick="wide.fmt()">{{.i18n.format}}</button>
<button onclick="wide.goget()">{{.i18n.goget}}</button>
<button onclick="wide.goinstall()">{{.i18n.goinstall}}</button>
<span class="fn-none ico-fullscreen" onclick="editors.fullscreen()">{{.i18n.full_screen}}</span>
</div>
</div>
@ -37,7 +84,7 @@
<ul id="files" class="ztree"></ul>
<!-- 目录右键菜单 -->
<div id="dirRMenu" class="frame fn-none">
<div id="dirRMenu" class="frame">
<ul>
<li onclick="tree.newFile();">{{.i18n.create_file}}</li>
<li onclick="tree.newDir();">{{.i18n.create_dir}}</li>
@ -46,7 +93,7 @@
</div>
<!-- 文件右键菜单 -->
<div id="fileRMenu" class="frame fn-none">
<div id="fileRMenu" class="frame">
<ul>
<li onclick="tree.removeIt();">{{.i18n.delete}}</li>
</ul>
@ -129,5 +176,6 @@
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/editor.js?{{.Wide.StaticResourceVersion}}"></script>
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/tree.js?{{.Wide.StaticResourceVersion}}"></script>
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/wide.js?{{.Wide.StaticResourceVersion}}"></script>
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/menu.js?{{.Wide.StaticResourceVersion}}"></script>
</body>
</html>