diff --git a/_config.yml b/_config.yml new file mode 100644 index 0000000..c419263 --- /dev/null +++ b/_config.yml @@ -0,0 +1 @@ +theme: jekyll-theme-cayman \ No newline at end of file diff --git a/assets/js/netscope.js b/assets/js/netscope.js index d5fae14..c4dd23d 100644 --- a/assets/js/netscope.js +++ b/assets/js/netscope.js @@ -2833,10 +2833,11 @@ var Editor; module.exports = Editor = (function() { function Editor(loader) { - var $editorBox, editorWidthPercentage; + var $editorBox, editorWidthPercentage, hasShow; this.loader = loader; editorWidthPercentage = 30; - $editorBox = $($.parseHTML('
')); + hasShow = true; + $editorBox = $($.parseHTML('
')); $editorBox.width(editorWidthPercentage + '%'); $('#net-column').width((100 - editorWidthPercentage) + '%'); $('#master-container').prepend($editorBox); @@ -2850,6 +2851,21 @@ module.exports = Editor = (function() { return _this.onKeyDown(e); }; })(this)); + $('#net-column').on('dblclick', (function(_this) { + return function() { + if (hasShow === true) { + hasShow = false; + $("#editor-column").hide(); + $('#editor-column').width(0 + '%'); + return $('#net-column').width(100 + '%'); + } else { + hasShow = true; + $("#editor-column").show(); + $('#editor-column').width(30 + '%'); + return $('#net-column').width(70 + '%'); + } + }; + })(this)); } Editor.prototype.onKeyDown = function(e) { diff --git a/src/editor.coffee b/src/editor.coffee index f346405..b5a8631 100644 --- a/src/editor.coffee +++ b/src/editor.coffee @@ -2,15 +2,27 @@ module.exports = class Editor constructor: (@loader) -> editorWidthPercentage = 30; - $editorBox = $($.parseHTML '
') + hasShow = true + $editorBox = $($.parseHTML '
') $editorBox.width(editorWidthPercentage+'%') $('#net-column').width((100-editorWidthPercentage)+'%') $('#master-container').prepend $editorBox @editor = CodeMirror $editorBox[0], - value: '# Enter your network definition here.\n# Use Shift+Enter to update the visualization.' + value: '# Enter your network definition here.\n# Use Shift+Enter to update the visualization.\n# double click to control the editor hide or show' lineNumbers : true lineWrapping : true @editor.on 'keydown', (cm, e) => @onKeyDown(e) + $('#net-column').on 'dblclick', () => + if hasShow is true + hasShow = false + $("#editor-column").hide(); + $('#editor-column').width(0+'%') + $('#net-column').width(100+'%') + else + hasShow = true + $("#editor-column").show(); + $('#editor-column').width(30+'%') + $('#net-column').width(70+'%') onKeyDown: (e) -> if (e.shiftKey && e.keyCode==13)