adobe / brackets

An open source code editor for the web, written in JavaScript, HTML and CSS.
http://brackets.io
MIT License
33.26k stars 7.64k forks source link

Register custom Quick Views #10958

Open nicolo-ribaudo opened 9 years ago

nicolo-ribaudo commented 9 years ago

What about if extensions could register custom quick views? So that can be added previews for things like MathML, fonts, inline svg, css timing functions, ...

Maybe something like this:

var QuickViewManager = brackets.getModule("editor/QuickViewManager");

QuickViewManager.registerProvider({
    canOpen: function (document, cursorPosition) {
        if (/* canOpen */) {
            return true;
        }
        return false;
    },
    open: function (document, cursorPosition) {
        return "<div>Html code to display in the popover</div>";
    }
});
redmunds commented 9 years ago

The css timing functions inline editors provide a custom editor -- I think this would only work for non-editable views such as documentation.

"Quick View" is the name of the popover you see when you move mouse over certain items such as colors or images. Maybe "QuickDocsManager"?

nicolo-ribaudo commented 9 years ago

I was thinking of something like this: http://jsbin.com/widoricire/1/edit?js,output