outline
This commit is contained in:
		
							parent
							
								
									6d0b928b0e
								
							
						
					
					
						commit
						d3d5edb16d
					
				| 
						 | 
					@ -46,6 +46,10 @@
 | 
				
			||||||
    height: 100%;
 | 
					    height: 100%;
 | 
				
			||||||
    z-index: 11;
 | 
					    z-index: 11;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.side-right .tabs-panel > div {
 | 
				
			||||||
 | 
					    overflow: auto;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
/* end side right */
 | 
					/* end side right */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* start tree */
 | 
					/* start tree */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -22,6 +22,7 @@
 | 
				
			||||||
.side-right {
 | 
					.side-right {
 | 
				
			||||||
    background-color: #303130;
 | 
					    background-color: #303130;
 | 
				
			||||||
    border-left: 1px solid #000;
 | 
					    border-left: 1px solid #000;
 | 
				
			||||||
 | 
					    color: #999;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.footer {
 | 
					.footer {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -21,7 +21,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.side-right {
 | 
					.side-right {
 | 
				
			||||||
    background-color: #FFF;
 | 
					    background-color: #FFF;
 | 
				
			||||||
    border-right: 1px solid #919191;
 | 
					    border-left: 1px solid #919191;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.footer {
 | 
					.footer {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -61,19 +61,6 @@ var hotkeys = {
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                $("#outline").focus();
 | 
					                $("#outline").focus();
 | 
				
			||||||
                
 | 
					 | 
				
			||||||
//                var request = newWideRequest();
 | 
					 | 
				
			||||||
//                request.code = wide.curEditor.getValue();
 | 
					 | 
				
			||||||
//
 | 
					 | 
				
			||||||
//                $.ajax({
 | 
					 | 
				
			||||||
//                    type: 'POST',
 | 
					 | 
				
			||||||
//                    url: config.context + '/outline',
 | 
					 | 
				
			||||||
//                    data: JSON.stringify(request),
 | 
					 | 
				
			||||||
//                    dataType: "json",
 | 
					 | 
				
			||||||
//                    success: function (data) {
 | 
					 | 
				
			||||||
//                        console.log(data);
 | 
					 | 
				
			||||||
//                    }
 | 
					 | 
				
			||||||
//                });
 | 
					 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        // Ctrl-4
 | 
					        // Ctrl-4
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -330,6 +330,7 @@ var tree = {
 | 
				
			||||||
                wide.curEditor.scrollTo(0, cursorCoords.top);
 | 
					                wide.curEditor.scrollTo(0, cursorCoords.top);
 | 
				
			||||||
                wide.curEditor.focus();
 | 
					                wide.curEditor.focus();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                wide.refreshOutline();
 | 
				
			||||||
                return false;
 | 
					                return false;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -361,6 +362,8 @@ var tree = {
 | 
				
			||||||
                        tempCursor = CodeMirror.Pos(0, 0);
 | 
					                        tempCursor = CodeMirror.Pos(0, 0);
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    editors.newEditor(data, tempCursor);
 | 
					                    editors.newEditor(data, tempCursor);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    wide.refreshOutline();
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -18,6 +18,40 @@ var wide = {
 | 
				
			||||||
    curNode: undefined,
 | 
					    curNode: undefined,
 | 
				
			||||||
    curEditor: undefined,
 | 
					    curEditor: undefined,
 | 
				
			||||||
    curProcessId: undefined, // curent running process id (pid)
 | 
					    curProcessId: undefined, // curent running process id (pid)
 | 
				
			||||||
 | 
					    refreshOutline: function () {
 | 
				
			||||||
 | 
					        if (wide.curEditor.doc.getMode().name !== "go") {
 | 
				
			||||||
 | 
					            $("#outline").html('');
 | 
				
			||||||
 | 
					            return false;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        var request = newWideRequest();
 | 
				
			||||||
 | 
					        request.code = wide.curEditor.getValue();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        $.ajax({
 | 
				
			||||||
 | 
					            type: 'POST',
 | 
				
			||||||
 | 
					            url: config.context + '/outline',
 | 
				
			||||||
 | 
					            data: JSON.stringify(request),
 | 
				
			||||||
 | 
					            dataType: "json",
 | 
				
			||||||
 | 
					            success: function (data) {
 | 
				
			||||||
 | 
					                if (!data.succ) {
 | 
				
			||||||
 | 
					                    return;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                
 | 
				
			||||||
 | 
					                var outlineHTML = '<ul>',
 | 
				
			||||||
 | 
					                        decls = ['funcDecls', 'interfaceDecls', 'structDecls', 
 | 
				
			||||||
 | 
					                    'constDecls', 'varDecls'];
 | 
				
			||||||
 | 
					                
 | 
				
			||||||
 | 
					                for (var i = 0, max = decls.length; i < max; i++) {
 | 
				
			||||||
 | 
					                    var key = decls[i];
 | 
				
			||||||
 | 
					                    for (var j = 0, maxj = data[key].length; j < maxj; j++) {
 | 
				
			||||||
 | 
					                        var name = data[key][j].Name;
 | 
				
			||||||
 | 
					                        outlineHTML += '<li>' + name + '</li>';
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                $("#outline").html(outlineHTML + '</ul>');
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
    _initDialog: function () {
 | 
					    _initDialog: function () {
 | 
				
			||||||
        $(".dialog-prompt > input").keyup(function (event) {
 | 
					        $(".dialog-prompt > input").keyup(function (event) {
 | 
				
			||||||
            var $okBtn = $(this).closest(".dialog-main").find(".dialog-footer > button:eq(0)");
 | 
					            var $okBtn = $(this).closest(".dialog-main").find(".dialog-footer > button:eq(0)");
 | 
				
			||||||
| 
						 | 
					@ -321,6 +355,12 @@ var wide = {
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
            $(".bottom-window-group > .tabs-panel > div > div").height(bottomH - $bottomGroup.children(".tabs").height());
 | 
					            $(".bottom-window-group > .tabs-panel > div > div").height(bottomH - $bottomGroup.children(".tabs").height());
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        if ($(".side-right").hasClass("side-right-max")) {
 | 
				
			||||||
 | 
					            $(".side-right > .tabs-panel > div").height(mainH - $bottomGroup.children(".tabs").height());
 | 
				
			||||||
 | 
					        } else {
 | 
				
			||||||
 | 
					            $(".side-right > .tabs-panel > div").height($('.side-right').height() - $bottomGroup.children(".tabs").height());
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    _initWS: function () {
 | 
					    _initWS: function () {
 | 
				
			||||||
        var outputWS = new ReconnectingWebSocket(config.channel + '/output/ws?sid=' + config.wideSessionId);
 | 
					        var outputWS = new ReconnectingWebSocket(config.channel + '/output/ws?sid=' + config.wideSessionId);
 | 
				
			||||||
| 
						 | 
					@ -527,22 +567,7 @@ var wide = {
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            // refresh outline
 | 
					            // refresh outline
 | 
				
			||||||
            var request = newWideRequest();
 | 
					            wide.randerOutline();
 | 
				
			||||||
            request.code = wide.curEditor.getValue();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            $.ajax({
 | 
					 | 
				
			||||||
                type: 'POST',
 | 
					 | 
				
			||||||
                url: config.context + '/outline',
 | 
					 | 
				
			||||||
                data: JSON.stringify(request),
 | 
					 | 
				
			||||||
                dataType: "json",
 | 
					 | 
				
			||||||
                success: function (data) {
 | 
					 | 
				
			||||||
                    if (!data.succ) {
 | 
					 | 
				
			||||||
                        return;
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                    
 | 
					 | 
				
			||||||
                    $("#outline").html(JSON.stringify(data));
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            });
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            return;
 | 
					            return;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -149,6 +149,7 @@ var windows = {
 | 
				
			||||||
            windows.restoreSideRight();
 | 
					            windows.restoreSideRight();
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
            $it.addClass("side-right-max");
 | 
					            $it.addClass("side-right-max");
 | 
				
			||||||
 | 
					            $(".side-right > .tabs-panel > div").height($(".content").height() - $it.children(".tabs").height());
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    restoreBottom: function () {
 | 
					    restoreBottom: function () {
 | 
				
			||||||
| 
						 | 
					@ -212,8 +213,9 @@ var windows = {
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            $(".footer .ico-restore:eq(2)").hide();
 | 
					            $(".footer .ico-restore:eq(2)").hide();
 | 
				
			||||||
 | 
					            $(".side-right > .tabs-panel > div").height($('.side-right').height()
 | 
				
			||||||
 | 
					                    - $(this).children(".tabs").height());
 | 
				
			||||||
        }).removeClass("side-right-max");
 | 
					        }).removeClass("side-right-max");
 | 
				
			||||||
        ;
 | 
					 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    minBottom: function () {
 | 
					    minBottom: function () {
 | 
				
			||||||
        $(".edit-panel, .side-right").css("height", "100%");
 | 
					        $(".edit-panel, .side-right").css("height", "100%");
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue