Menu

Dev Blog
Typical title for developers blog. Contains boring things.

Codeception Acceptance: Check if element is visible

There are cases, there User Interface state might depend on various factors. Or in our tests there might be case where button can be toggled or might get activated by remote action.

The first solution one might think of is to conditionally invoke action on element. Depending whether it is visible or not.

Hide tooltips on dropdowns in twitter's bootstrap 3

Tooltip left over dropdown
Tooltip left visible over
dropdown

When using tooltips on buttons which have dropdown menus, the tooltip might not disappear as we would like to, leaving it visible. This might even block user action. To avoid this issue, tooltip need to be hidden when dropdown is shown. But it turned out that it is not enough, as it might pop up again. Also when dropdown is closed by another click, tooltips still might be left visible.

In summary 

It turned out that tooltip must be hidden on events:

  1. Dropdown shown
  2. Dropdown hidden
  3. Mouse entering dropdown menu

Panoramio and digart termination

panoramio-logo.png
Panoramio Logo

The Panoramio was a world known photo sharing service allowing people to upload photos and place them on map. It was sold to Google. Then google decided to close it, effectively destroying community gathered around Panoramio. For the sake of integrating it with google maps.

Another, maybe not so known Polish service digart is going to be shut down this month. It is also photo and graphic sharing service with community, which was sold to large Polish portal Onet. Again all of the people (yes people, not users!) creating community are left with option to just download their photos, having all their contributions vanished.

Original authors of those websites are upset with decision of new owners. It seems that many web applications are being abandoned by big players, for which relatively small community is meaningless. There are many more cases like this. The only solution might be that web applications should be paid, thus allowing original authors to keep them indefinitely. As long as community is willing to keep their assets on application. So that owners would not be forced to sell their creation along with people.

Introducing polite PHP in error handler

Due to issues of handling exception in __toString PHP's method, the error handler can be invoked in such methods to catch exception and display nice stack trace. However using error handling in __toString methods need special care, thus very polite syntax have been introduced.

Example code to handle exceptions

public function __toString()
{
    try
    {
        // Do some stuff throwing exception
        return 'my result';
    }
    catch (Exception $exception)
    {
        ErrorHandler::please()->takeCareOf($this, $exception);
    }
}

This is actual working code in components project:)