Styling and skinning your apps with TravelTripper

Styling/Skinning RezTrip

At TravelTripper, we make hotel reservation software. Our main product is a “booking engine” called RezTrip, a web based application that allows visitors of a hotel’s website to directly book a stay with that hotel.

As GWT applications go, we think RezTrip, when it comes to the question of styling, presents an interesting departure from traditional development. As a “white label” application, we needed to create our app in such a way that allows our hotel clients the ability to customize not only the “frame” around the application, but also the internal style of the application itself, such as fonts, colors, etc.

In other words, each hotel needs the ability to create their own custom header, footer, or sidebar and have it wrap the booking “application” portion of the page. Furthermore, each hotel needs to be able to change all the colors, fonts, and even some icons within the application.

The desired end result is a single booking engine application, running on multiple web sites, but always mimicking the look and feel of each individual hotel site.

We have two additional constraints:

  1. Cost – While our first priority is building a system with ultimate flexibility, the time spent to create each customization represents a direct bite into our profit margins. The business guys were explicit about keeping these costs to a minimum.
  2. Dynamic Changes – Clients are naturally picky about the appearance of their website, and their tailored booking engine is no exception. Experience told us that we would be fielding constant requests to tweak different aspects of the customized properties. This has to be easy to do and have minimal impact on the overall site performance.

Satisfying our Constraints

Keeping Costs Low

Our in-house GWT team is top-notch, but expensive. The previous version of our application was built on basic JSP/HTML/CSS technology, and the customization work had been done by a more affordable entry-level web designer. Similarly, for this version of the application, we wanted to limit the involvement of our GWT developers as much as possible, where possibly leaving stylistic tweaks to our web designer.

We want the customizer to be able to do *all* the work, without requiring any Java or GWT knowledge.

Making Changes Easy and Harmless

We realized that GWT’s application compilation philosophy changed a lot of our longstanding web development assumptions. We didn’t want to create custom UiBinder files for each hotel’s frame, or have to make spot changes to CSS that would require a full recompile and redeployment of the application.

We want to be able to make CSS changes without recompiling or redeploying the app.

Our Solution

The only way to satisfy the above two constraints is to have all the customization work happen in simple HTML/CSS files that live outside the GWT project and WAR directory. This allows the customizer to work in pure HTML/CSS, directly with the files on the server, without ever having to modify the internals of the GWT application. Changes can take effect immediately, without a need to redeploy the app.

The Application Frame

We decided to have a separate index.html file for each property’s customization. This allows custom header/footer/sidebar HTML, CSS and JavaScript to be included in the hotel’s main page.

Another challenge for us was the need for the application portion of the booking engine to be able to be dynamically resized relative to the user’s browser. To accomplish this, we decided to use a DockLayoutPanel, which handles the separation between the main application and the custom frame. We load an empty SimplePanel into each of the North, South, West, East sections of the DockLayoutPanel, and our application in the Center.

Next, we add special code that runs directly from onModuleLoad() that scours the host HTML document for four DIVs with 4 unique ids: tt-Header, tt-Footer, tt-EastSidebar, and tt-WestSidebar. If the app finds a DIV with those ids, it loads it into the corresponding SimplePanel and auto-sizes to the contents. If no corresponding DIV is found, the app hides the SimplePanel entirely and sets the width or height to 0.

What this means is, that the customizer doesn’t get to lay out the HTML page exactly like it will be displayed when live. Instead s/he must smash the relevant content into the four qualified DIVs. This is a minor annoyance, but at the end of the day, the code itself is still the same basic HTML/CSS/JavaScript, and so it is perfectly manageable by the web designer. The GWT application is already compiled to super-fast JavaScript, so there’s no need for the customizer to know any GWT. Instead, the customizer can just edit the contents in the HTML file and hit refresh to see the changes.

The CSS

Here again, we had to come up with a custom solution. To avoid the recompile/redeploy issue and also to keep it simple for the customizer, we had to handle the CSS for customizing the application without having to modify any code inside the GWT project.

What we ended up doing was creating three levels of CSS:

  1. UiBinder – Any time we needed to use a CSS style to adjust the size or layout of a widget or panel, we kept that CSS code in UiBinder XML. We only want the actual GWT developers to change the layout/size of the UI elements, so they needed to be in a sense “hidden” from the customizer. We loved how the default UiBinder behaviour is to generate md5 class names, allowing us to create lots of custom CSS rules, without worrying about namespace overlap and also ensure that the customizer would know not to override them.
  2. master.css – Next, we created a “master” CSS file where we put all the other CSS styles, which we thought were fair game, to be overridden by the customizer. This is a huge CSS file, but when minimized (yuicompressor) and gzipped, the end result was still better than the latency hit we had when originally we tried to spread these across multiple files (for organizational purposes). Note that the master.css file is loaded directly from the main HTML file.
  3. designer.css – The final layer is the “designer” CSS, which is where we have the customizer put all the CSS rules which override the defaults. The class names in this file all match the class names in the master CSS, but since we load the designer CSS in the page *after* we load the master CSS, the former will always override the latter.

Summary

Despite our constraints, we were able to configure our GWT application to perform exactly as we desired. Our application is fully customizable, both in terms of the surrounding frame layout and also the internal application’s colors and fonts, all without the customizer having to know any Java or GWT. By carefully separating the different layers of the app, we were able to make it easily and efficiently customizable on the fly, without ever having to redeploy the application.

New version of Safari browser

Safari is a browser initially designed as a platform for Apple Macintosh, but later created his own version and operating systems of Windows.

The program has a full set of features necessary for comfortable work on the Internet.Interface is equipped with tabs, bookmarks system, with means of searching and reading of RSS, and a module for automatically filling out forms.

Among the major changes in Safari five stand out:function Safari Reader, higher productivity, search using Microsoft Bing, expanded support for HTML5, and the new Safari Developer Program, under which developers can write their own extensions to the browser.According to Apple, for greater certainty, these extensions will work completely independently of the browser, which means that the stability of various additives will not affect the stability of the application as a whole.

Higher operating speed of Safari 5 is achieved in three ways.First, the processing speed of JavaScript has grown by 25 percent, and according to observations of its first users – even by 30%. Second is the improved caching – recorded in the browser cache more data types. Third, fifth in Safari appears pre-extraction of DNS.In practice this means that when you open a page Safari automatically passes through links on this page and search addresses. Thus, after you’ve clicked on a specific address, Safari will now be ready to immediately retrieve data from it.Safari 5 now uses the resources of the graphics card for faster processing of the contents of windows and tabs.

With speed indicators Safari does not differ significantly from modern solutions with similar features, and some even exceeded.However, developers argue that their browser has two times higher performance than that of Firefox when displaying pages in HTML format. Built-in RSS-client is not comfortable enough, while other solutions for Windows can be found more useful examples.

Safari supports many new features of HTML5, including the function to determine the location (Geolocation), full-screen mode for HTML5 video, hide the subtitles in HTML5 video elements of the new layout of the pages (article, aside, footer, header, hgroup, nav and section), the history of HTML5 AJAX, EventSource, WebSocket, attribute the function of dragging in HTML5, checking forms and HTML5 HTML5 Ruby.

Among other changes in Safari five stand out: a search with MS Bing; smart address bar (when entering text in the intelligent address bar search is performed to match the titles of Web pages in history and bookmarks, as well as parts of URL-addresses these web pages);setting tabs allows automatic opening of Web pages do not in separate windows, in new tabs, a search in the whole story was added to label the date of viewing the page, when you turn the mode “Private Browsing” in the smart address bar appears on the corresponding icon ;detection of potentially harmful scripts used in cross site scripting attacks through (XSS) and others.

Google създаде онлайн-учебник по интернет за начинаещи

Корпорацията Google създаде онлайн-учебник по интернет за начинаещи потребители на мрежата. С помощта на интерактивната книга интернет-гигантът иска да научи хората, които са на Вие с технологиите, на основите на езика HTML, на принципите на работа на TCP/IP протокола, на начина на работа на браузърите и “бисквитките”, на защита от вредоносни програми и много други.

Ръководството за “леймъри” с името “20 Things I Learned About Browsers and the Web” (“20 факта, които научих за браузърите и мрежата”) е достъпна на адрес 20thingsilearned.com. За отваряне на учебника е необходим съвременен браузър с поддръжка на HTML5.

Неголямата “книга” от 61 страници обяснява устройството и начина на работа на световната мрежа. Онлайн ръководството за начинаещи е било създадено от екипа, който разработва и браузъра Google Chrome и илюстрирано от германския художник и детски писател Кристоф Нийман.

Учебникът започва с главата “Интернет – що е то?”, а после развива темите за “облачните” технологии, приложенията за интернет, езиците за уеб програмиране, браузърите, програмите с отворен код и безопасността в мрежата.

От Google смятат, че болшинството от хората нямат и понятие за това, как работи един браузър и какво всъщност е HTML5. През изминалата година представители на Google задаваха на случайни хора, срещнати на улицата, въпроса “Какво представлява браузърът?”. Само 8% от запитаните са дали правилен отговор.