-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CLOSED] Dialogs should be templatized #256
Comments
See TODO in |
QRB reviewing. Marking code cleanup--we should at least factor things so we don't have a bunch of different divs with almost the exact same structure in the HTML. |
I wanted to give this issue a shot but first I would like to know if what I'm thinking sounds right. First the showModalDialog needs to be changed so that it accept an additional argument. This argument could be a simple object defining the buttons like Since brackets already use require.js we then can use the text plugin to load additional *.html files just like javascript dependencies : http://requirejs.org/docs/api.html#text The next step would be to use an existing templating engine like underscore (http://underscorejs.org/#template) or http://handlebarsjs.com/ or any existing library. What do you think? |
That sounds right. I think we don't need to go as far as using a real templating library for now--we can just have a single basic dialog structure with defined IDs, and then stuff content into those IDs manually. We could worry about true templating later.
Thanks for looking into this! |
Using the RequireJS text plugin sounds like a good approach. With this plugin, the templates can be authored in separate files, but concatenated together (optionally with JavaScript files) for optimization. |
|
No, we haven't actually templatized our dialogs yet--they're still all separate |
Another issue that was fixed by #3086 :) |
Yay! Closing. |
Tuesday Feb 14, 2012 at 21:10 GMT
Originally opened as adobe/brackets#258
Currently, each different type of dialog we create has a separate chunk of HTML in the main index.html file. We should collapse these into a single chunk that is used by a flexible dialog function that allows the user to specify button labels, etc. We could also use a templating framework to help with this, although it's probably not a requirement.
The text was updated successfully, but these errors were encountered: