Nvu progress 20040518
By glazou on Tuesday 18 May 2004, 15:21 - Nvu - Permalink
The class dropdown menulist is now looking exactly how I wanted it to be but it does not do exactly what I want...
- if a class is to be added
- if the selection is collapsed, get the block-level container of the selection; if it's not the body, apply the class to that block; if it's the body, set TypeInState to create a span of the given class when the next char is entered at same location
- if the selection is not collapsed, traverse it and encapsulate adjacent inlines into a span carrying the class
- if a class is to be removed
- if the selection is collapsed, get the block-level container of the selection having that class (there must be one since we know we remove the class...); remove the class from that block
- if the selection is not collapsed, traverse the selection and remove all occurences of the given class

Comments
Questions:
1. Can you apply a class to a div, instead of to the container of the element (if collapsed), or a span (if not collapsed)?
2. Will the menu of classes only include styles declared within the web page? Or will the menu of classes also include classes declared within linked and imported style sheets?
Thanks!
- Dan
Dan: (1) yes, just right-click on the element in the bottom toolbar and apply the class (2) the menulist lists ALL classes defined in ALL stylesheets, embedded, imported or external.
Are you going to show any differences between the classes depending on their location? (Internal, external, imported)
Maybe have an icon or put the file name in brackets beside it or put them in a tree view where the classes are children of the filename.
Neil: hmmm, I am not sure. A class can be "defined" in both an embedded sheet and an external sheet, and I don't want to overload the UI. Is it **really** worth giving that information, or is it a super-geeky feature that only a few CSS gurus are going to use (and they won't use Nvu anyway, right ?) ?
Oh I don't know. I just figured some people might want to find out which file a particular class is located in for debugging reasons. The DOM inspector works nicely for that though.
I hope you appreciate what a wonderful thing you are doing by supporting classes in embedded, imported or linked style sheets.
The webmaster for small organizations will be able to use their choice of tool for creation of the main website, and send template pages to others who need to post updates. These can be non-computer persons equipped with (1) NVU, (2) a template of the page non-computer person is responsible for updating, and (3) an extra copy of the linked or embedded css files. The non-computer person can visually update the page in NVU, styling the page with the proper classes which are contained in the css files, then ftp the page to the webserver. You are creating the "poor man's content management system". You are creating the poor man's alternative to Macromedia Contribute (without the central control, without the roll back feature, etc.) You are performing a wonderful service!
Thank you!
- Dan Ashley
Thanx to code for Nvu, whats a great work. But has some bugs:
the code self-reformat adding extra at my build (the latest released)... this make the app unusable
somethimes pages load forever, ..etc..
Where is the correct location to send bugs?
Where is the CVS to download the latest version?