Posts From May, 2007

Google Gears Looks Interesting

Google just released a beta of a new product called Google Gears. They've combined a browser plugin and a javascript API to enable local storage of data so that web apps can work offline. This is similar in concept to Smart Client, or so it seems to me, but with the desktop application replaced by the browser extension an the UI all handled by the browser rather than having the desktop UI installed on the client machine.

So I think for example you could implement something like for a travelling salesman who gets to connect from time to time but is not always connected. You might implement his contacts and product catalog as a web site but when he is disconnected the contacts and product catalog come from a local database via Google Gears. Whenever he connects the contacts and catalog would be updated and any orders he has entered can be pushed to the server.

The developer page for Google Gears is here: http://code.google.com/apis/gears/

TinyMCE editor is in svn branches/2.x

In follow up to my previous post, my initial implementation of the EditorProvider model is now implemented in svn (branches/2.x) with support for both FCKeditor and TinyMCE. You can set the default editor from Site Settings. Get the latest code from svn to check it out. We are also getting very close to a new release since we have a lot of good new things in svn.

Since FCKeditor doesn't work in Opera, I have it setup so that TinyMCE will be used for Opera regardless of the Site Settings default. I also have it currently set to use TinyMCE for Safari, but so far it doesn't seem to work. It says this is experimental which is the same status FCKeditor has but I've never been able to get either of them working in Safari myself so far. Tiny MCE does seem to work nicely in Opera. In Safari, both are degrading to a TextArea which is still functional but requires manual entry and formatting of html.

FCKeditor has browsing and uploading of images/files while TinyMCE requires entering an url. I'm going to look into trying to make a generic one that works with both based on the FCKeditor version. I'm also planning to get content templates working in both editors using a common source for the templates. I would like to  implement this also for styles, formats, fonts, colors etc so that they are the same regardless of the editor.

I've also noticed that there might be problems if switching back and forth between editors, content tends to get reformatted differently sometimes.

It nice to have both of these great editors working and now we can fully support Opera. Hopefully I can get one of these editors working decently in Safari at some point.

If you do any testing, let me know what you think.

Joe

 

TinyMCE editor coming soon

I'm planning soon to implement wrapper aound the WYSIWYG editor in mojoPortal using the provider model pattern so that different WYSIWYG html editors can be plugged in. In the early days of mojoPortal I decided not to do this because at the time there was really only 1 good open source editor and that is FCKeditor which we currently use. There were other things like FreeTextBox but it held no interest for me because its free only in dll form and is not open source.

Recently I have noticed that the TinyMCE editor has really matured and since it is open source I now have a motivation to implement the provider model to make it possible to use this editor in addition to or instead of FCKeditor.

The big advantage I see right away is that it supports Safari and Opera which FCKeditor does not. I also have read some things indicating it has advantages in terms of accessibility as well. I still have not figured out if there is a way to tab out of the FCKeditor with the keyboard, it always requires the mouse because the tab key just tabs within the editor. Maybe I'm missing something if anyone knows how to do this with any key combination let me know.

So I'm thinking it will be good to be able to specify a default editor for the site but if the browser is Opera or  Safari always use TinyMCE. Not sure how long it will take me to implement this but I'm going to look into it this weekend.

I suppose once the provider model is in place it will be possible for using other commercially available editors as well if anyone wants to implement the provider for it.

Improving Markup Semantics and Accessibility

Those of you who subscribe to svn commit notifications have probably noticed a lot of changes being committed to svn recently in the skins for mojoPortal. I've been doing a lot of work to improve the markup semantics and accessibility and to better organize the css files.

Some of you may be scratching your head and wondering what are markup semantics so I'll explain a little. Historically most web developers and designers have just done whatever it takes to make a web page look a certain way in the browser, we haven't really considered what should the html itself look like very much. The w3c standards and recommendations have been evolving all the while in the background and they have quite a bit to say about how html documents should be structured.

It starts with simple things like the most important heading on the page should use an h1 element and other things on the page should use h2 then h3 and so on for headings in order of importance and containment. Raise your hand if you've ever put a title in an h1 tag then changed it to an h4 or h5 because it was too big. Hasn't everyone done that at some time or another or perhaps we just don't use any h elements at all we just use css to assign a large font that looks like a heading in the browser. By making the most important heading on the page h1 and the next level down h2 and so on we are adding meaning to the markup without regard to its presentation and that meaning will be there even if there is no css. It gives meaning that is helpful for search indexes, screen readers and other devices or web clients so that they can better understand your content. If the default font size for h1 looks too big that can easily be changed with css. The idea is the html should convey a lot of information about the structure of your content and presentation can be handled by css.

Another important example is with lists, I know plenty of times in the past I've made lists of links by just using a br after each link in the list. It looked the way I wanted it to in the browser but it doesn't convey the idea that this is a list. Its much more meaningful to use a ul with li elements to convey a list but when we tried that it indented and put bullets we didn't like so we went back to the br approach. The smart way is to use the ul and li but style it the way we want with css. If we don't like the bullet we use list-style:none;. If we don't like the indent we can use a margins or padding negative amounts if needed. Now the search indexes know this is a list and it still looks the way we wanted.

A good book for those who would like to learn more:

Another important thing is to reduce as much unsemantic markup as possible. That is avoid extra divs and spans as much as possible. Sometimes you really need them to achieve a visual design goal but keep it to a minimum is a worthy goal both in terms of semantics and in terms of performance.  Less markup means faster page loads. The book above and some others have shown me that often when I thought I needed a div to style it was possible to achieve the same result without it, css is very powerful. There is a lot more to it so I recommend the above book as a starting point to learn more but these are some of the core goals and benefits.

I mention this because I've done a lot of work in mojoPortal recently to improve the semantics of the markup including better use of headins and lists. I've also gone through each of the included skins and painstakingly split the css into separate files:

  • style.css which ties the others together
  • stylelayout.css which has css rules for position, margins, padding, etc
  • stylecolors.css
  • styleborders.css
  • styleimages.css
  • styletext.css

These changes are in svn and will be in the next release which should be pretty soon. It was a lot of tedious work cutting and pasting the css to organize it this way in all the skins included with mojoPortal but I think it makes it easier to manage and to understand.

New Multi Sites Feature landed in svn

I mentioned in this previous post that I'm working on a new variation of the Multi Sites hosting feature. This work is being sponsored as open source development by one of my customers. I'm not sure if I can mention who the customer is so for now I will leave them nameless.

For a long time it has been possible to host multiple sites using a single installation of mojoPortal with the secondary sites defined by different host names. The new feature provides an option to define the secondary sites by the first folder after the host name like http://somehostname/somefoldername.

The initial implementation of this has landed in svn/branches2.x for anyone interested in trying it out or providing testing. I'm sure there are still a few bugs here and there and am working to test all the features and fix any outstanding issues before making an official release.

I've also updated the documentation here:
http://www.mojoportal.com/muliplesites.aspx
and here:
http://www.mojoportal.com/multiplesitesbasedonfoldernames.aspx
with information about using this feature.