fullscreen

This commit is contained in:
Van 2014-08-30 12:54:46 +08:00
parent 037159e39e
commit 96df2619b9
2 changed files with 21 additions and 9 deletions

View File

@ -32,9 +32,10 @@ var editors = {
wide.curNode = undefined;
wide.curEditor = undefined;
$(".ico-fullscreen").hide();
return false;
}
if (nextId === editors.tabs.getCurrentId()) {
return false;
}
@ -53,6 +54,9 @@ var editors = {
}
});
},
fullscreen: function() {
wide.curEditor.setOption("fullScreen", true);
},
_initAutocomplete: function() {
CodeMirror.registerHelper("hint", "go", function(editor) {
var word = /[\w$]+/;
@ -111,6 +115,7 @@ var editors = {
};
},
newEditor: function(data) {
$(".ico-fullscreen").show();
var id = wide.curNode.tId;
for (var i = 0, ii = editors.data.length; i < ii; i++) {
if (editors.data[i].id === id) {
@ -132,7 +137,15 @@ var editors = {
indentUnit: 4,
extraKeys: {
"Ctrl-\\": "autocompleteAnyWord",
".": "autocompleteAfterDot"
".": "autocompleteAfterDot",
"Esc": function(cm) {
if (cm.getOption("fullScreen")) {
cm.setOption("fullScreen", false);
}
},
"F11": function(cm) {
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
}
}
});
editor.setSize('100%', 430);
@ -144,9 +157,6 @@ var editors = {
"editor": editor,
"id": id
});
},
removeEditor: function() {
}
};

View File

@ -3,9 +3,10 @@
<head>
<meta charset="UTF-8">
<title>{{.i18n.wide}}</title>
<link rel="stylesheet" href="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.4/codemirror.css">
<link rel="stylesheet" href="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.4/addon/hint/show-hint.css">
<link rel="stylesheet" href="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.4/theme/lesser-dark.css">
<link rel="stylesheet" href="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/codemirror.css">
<link rel="stylesheet" href="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/addon/hint/show-hint.css">
<link rel="stylesheet" href="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/addon/display/fullscreen.css">
<link rel="stylesheet" href="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/theme/lesser-dark.css">
<link rel="stylesheet" href="{{.Wide.StaticServer}}/static/js/lib/ztree/zTreeStyle.css">
@ -37,7 +38,7 @@
<div class="edit-panel">
<div class="edit-header fn-clear">
<div class="tabs fn-left"></div>
<span class="fn-right">全屏</span>
<span class="fn-none fn-right ico-fullscreen" onclick="editors.fullscreen()">全屏</span>
</div>
<div class="tabs-panel"></div>
</div>
@ -77,6 +78,7 @@
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/codemirror.js"></script>
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/addon/hint/show-hint.js"></script>
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/addon/hint/anyword-hint.js"></script>
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/addon/display/fullscreen.js"></script>
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/mode/go/go.js"></script>
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/mode/xml/xml.js"></script>
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/mode/htmlmixed/htmlmixed.js"></script>