It seems that the first version of the jQuery Who's Who library is finished. I present here what I've done and some feedbacks on the use of jQuery.
It is very simple to use. You just have to include the javascript files (jquery and jquery.whoswho) and the stylesheet files (a CSS file I provided for the example). Then you must configure it :
{
10:{"first_name" : "Kylie","last_name" : "Minogue"},
20:{"first_name" : "Robbie","last_name" : "Williams"},
30:{"first_name" : "Mickael","last_name" : "Jackson"},
40:{"first_name" : "Madonna","last_name" : ""},
50:{"first_name" : "Christina","last_name" : "Aguilera"},
...
}
I have tested it a lot but some bugs may remain. Just tell me.
This is how I have organized the package :
And a little feedback of my jQuery's use.
It's very easy to use it and to bind functions to events, however, this tutorial recomands to bind a function to an event only when it is required.
It may occur that the DOM you would like to access doesn't exist at the moment you are running it. It means that if your code is appending HTML after a DOM node on a button click, you would like to access and manipulate this new fresh inserted code. It is not possible unless you call the bind function at the perfect moment.
$(document).ready( function(){
$("#button").click(function(){
$("#test").append('');
});
});
In this exemple, when we click on the button element (could be a real HTML input button, or not), jQuery inserts some HTML (a new div in this case) at the end of the inner HTML of the test element. So you have a new div which wasn't there before.
Then you can bind some event on this new element by adding code just after the append function has been called. The issue is that at each click, you will bind the event. Then after two clicks, the HTML code will be appended two times rather than one time as expected. The solution is to separate the functions adding content to the DOM and the functions that bind it. The way to do it is to concretely create a function outside the click bind and put our new bind inside it. Then, at the end of the click bind function, we just call the function we have created.
The other point is the way to develop and to debug your own application :
| Command line |
|
| DOM Inspector |
|
And finally, the next step is to integrate this library in eZPublish, I thought about some interesting features like a generic db connector to extract data from db and output JSON. By the way, it will use eZComponents...
It seems that the first version of the jQuery Who's Who library is finished. I present here what I've done and some feedbacks on the use of jQuery.
It is very simple to use. You just have to include the javascript files (jquery and jquery.whoswho) and the stylesheet files (a CSS file I provided for the example). Then you must configure it :
{
10:{"first_name" : "Kylie","last_name" : "Minogue"},
20:{"first_name" : "Robbie","last_name" : "Williams"},
30:{"first_name" : "Mickael","last_name" : "Jackson"},
40:{"first_name" : "Madonna","last_name" : ""},
50:{"first_name" : "Christina","last_name" : "Aguilera"},
...
}
I have tested it a lot but some bugs may remain. Just tell me.
This is how I have organized the package :
And a little feedback of my jQuery's use.
It's very easy to use it and to bind functions to events, however, this tutorial recomands to bind a function to an event only when it is required.
It may occur that the DOM you would like to access doesn't exist at the moment you are running it. It means that if your code is appending HTML after a DOM node on a button click, you would like to access and manipulate this new fresh inserted code. It is not possible unless you call the bind function at the perfect moment.
$(document).ready( function(){
$("#button").click(function(){
$("#test").append('');
});
});
In this exemple, when we click on the button element (could be a real HTML input button, or not), jQuery inserts some HTML (a new div in this case) at the end of the inner HTML of the test element. So you have a new div which wasn't there before.
Then you can bind some event on this new element by adding code just after the append function has been called. The issue is that at each click, you will bind the event. Then after two clicks, the HTML code will be appended two times rather than one time as expected. The solution is to separate the functions adding content to the DOM and the functions that bind it. The way to do it is to concretely create a function outside the click bind and put our new bind inside it. Then, at the end of the click bind function, we just call the function we have created.
The other point is the way to develop and to debug your own application :
| Command line |
|
| DOM Inspector |
|
And finally, the next step is to integrate this library in eZPublish, I thought about some interesting features like a generic db connector to extract data from db and output JSON. By the way, it will use eZComponents...
Just as I'm struggling with cache optimization for one of the current projects, I discovered that it would be great if cache-block functionality had one more parameter - a user-defined and user-readable identifier. Being able to clear all the cache by calling this identifier would be a great enhancement. It would be enough if it was implemented at eZ API level, so that users were able to create their own actions (views) to handle it. This would be especially benefitial for caching of custom modules and views, outside content and content tree itself.
Life example: Imagine expensive custom views that require couple of hundreds of SQL queries per view or view/param combination, and can be accessed/managed by a) the owner (of something), b) all other users. Now, leaving these views uncached would be suicidal, and cache-blocks would be quite handy, and there would be only two cache blocks per view (since you either are the owner or not). Now, the additional expectation is that the owner will always have his view up-to-date, which means we can't really cache it for him. Wouldn't it be great to be able to create a button named "Refresh my view", which would cause one particular cache-block (or cache block group) be cleared? In that way, we could cache the owner's view as well, making it possible to let a manual clear only when needed ;)

As Microsoft Silverlight technology is becoming increasingly popular, it will be supported in the upcoming eZ Publish 4.1 release. Sites using the Website Interface and eZ Flow will include a Silverlight class and the corresponding view templates. Simply upload .xap files (compressed Silverlight package) as attributes in Silverlight objects;

As Microsoft Silverlight technology is becoming increasingly popular, it will be supported in the upcoming eZ Publish 4.1 release. Sites using the Website Interface and eZ Flow will include a Silverlight class and the corresponding view templates. Simply upload .xap files (compressed Silverlight package) as attributes in Silverlight objects; when such an object is viewed by a site visitor, your Silverlight media is loaded in the web browser (provided that the visitor has the Silverlight browser plugin installed). This is similar to how eZ Publish already supports .swf files via the Flash class. More information will be available as the next eZ Publish release date approaches.

This issue is dedicated to the 2008 Open Nordic Conference. We have speakers, program and the exhibition area ready, please download the issue via the image below and read more about it.

Through Planet PHP I found an article on Pre-populating forms with the timezone. I'd normally add a comment instead, but the comment would almost be larger then the original post, so I am instead writing up an entry myself. The post describes several ways to obtain the user's timezone and use that to pre-fill a form. None of them are working properly though. I'll try to explain for each of them why not, but first of all it is important to know what a timezone actually is.
A timezone is a set of rules that determines the UTC offset for different times around the year for a specific location. Because of daylight savings time, a specific location can have two (or more) different UTC offsets depending on what point in time you look at it. Some areas might have had different rules in the past, even in the same country. An example here is China, where currently there is only one timezone, but previously there were multiple. Thus there are different timezones for the different locations in China, even though the current UTC offset is the same for all of them. Timezones are identified by Country/City or Country/Subcountry/City.
The offering by MaxMind allows you to link a country/region combination to Timezone identifier. For the US it subdivides this per state even. However, it misses the different timezones for Russia, Australia and even Indiana, USA.
IP2Location only provides a single UTC offset per IP range, totally ignoring daylight savings time.
The Hostip.info solution I can't access because phpclasses requires some stupid registration.
As for the author's own solution, using JavaScript, is flawed at least partly as well. In his example JavaScript only returns a UTC offset. Luckily it is possible to detect the correct timezone quite a bit better by using some of PHP's functionality. The following bit of code uses both the UTC offset and the timezone abbreviation to find out the user's timezone:
<?php
if (!isset($_GET['tzinfo'])) {
?>
<html>
<script type="text/javascript">
var d = new Date()
var tza = d.toLocaleString().split(" ").slice(-1)
var tzo = d.getTimezoneOffset()
window.location = window.location + '?tzinfo=' + tza + '|' + tzo
</script>
</html>
<?php
} else {
list( $abbr, $offset ) = explode( '|', $_GET['tzinfo']);
echo timezone_name_from_abbr( $abbr, $offset * -60 );
}
?>
This is still not perfect of course, because it would for example give the same result for most of Europe (Europe/Berlin).
Figuring out the user's timezone can be done by using a high-accuracy database of IPs to lat/longitudes such as hostip.info and MaxMind offer, as well as a mapping from location to timezone. The latter however, is not available as far as I know. If however a data file that has proper definitions of the different timezone boundaries exist (mostly, on a per-province level would be enough), then such a tool can be easily build. I saw that OpenStreetMap has such a map, but I can't really find the raw data for that unfortunately. It would however, be awesome to have such a data file.

Since a few days, there is a new package in Debian: php5-xdebug.
After a few years of talking licenses, due to the help of Martin
Meredith and François
Marier Xdebug can finally be installed with apt-get. See the
synaptic screen shot as well:
During a mission, I discovered jQuery : a javascript library providing facilities and strong functionnalities to static web pages.
The use of this library is very simple. It has been made to use the developper's life and specially the maintenance of functionnalities. The javascript entered is shorter and more simple. It has few concepts so it is very quick to learn.
There is only one entry point in jQuery : the $ function. It allows you to access some standard functions to select nodes in the DOM, to manipulate them or to handle events.
The selectors are very useful because you can select almost every item in the DOM using id, css class or javascript variable name. Then, if there is more than one occurence, the function will result an array. Moreover, you can use XPath expression as filters, to reduce the number of object returned.
The strength of jQuery is the chainability of the functions. It allows to increase readability and maintenance of a javascript. You can also combine jQuery with classical JavaScript scripts.
To test this library, I've decided to develop an eZPublish extension integrating the jQuery library.
As a user case, I've chosen the Facebook tagging functionnality : you choose a picture, you tag your friends, you save it, hovering the head of a friend, the name is shown...
I have first worked offline to design the javascript. Here's a snapshot of what I have done : image gallery
Conclusion : it's very easy to come to grips with jQuery and a bit hard to debug. So I've searched and found a plugin to debug my script. See below.
I also heard about the ExtJS library which is a professional javascript library providing user interface components to build professional applications. jQuery is also experimenting this way by launching jQuery UI. It will be at the end equivalent I guess, but you will be able to still use the jQuery library as an independant library.
Here's some ressource :
jQuery : http://www.jquery.com
Visual jQuery : http://www.visualjquery.com/1.1.2.html
Dump Plugin for jQuery : http://www.netgrow.com.au/files/javascript_dump.cfm
Javascript benchmark : http://flesler.blogspot.com/2008/04/benchmarking-javascript-variables-and.html
During a mission, I discovered jQuery : a javascript library providing facilities and strong functionnalities to static web pages.
The use of this library is very simple. It has been made to use the developper's life and specially the maintenance of functionnalities. The javascript entered is shorter and more simple. It has few concepts so it is very quick to learn.
There is only one entry point in jQuery : the $ function. It allows you to access some standard functions to select nodes in the DOM, to manipulate them or to handle events.
The selectors are very useful because you can select almost every item in the DOM using id, css class or javascript variable name. Then, if there is more than one occurence, the function will result an array. Moreover, you can use XPath expression as filters, to reduce the number of object returned.
The strength of jQuery is the chainability of the functions. It allows to increase readability and maintenance of a javascript. You can also combine jQuery with classical JavaScript scripts.
To test this library, I've decided to develop an eZPublish extension integrating the jQuery library.
As a user case, I've chosen the Facebook tagging functionnality : you choose a picture, you tag your friends, you save it, hovering the head of a friend, the name is shown...
I have first worked offline to design the javascript. Here's a snapshot of what I have done : image gallery
Conclusion : it's very easy to come to grips with jQuery and a bit hard to debug. So I've searched and found a plugin to debug my script. See below.
I also heard about the ExtJS library which is a professional javascript library providing user interface components to build professional applications. jQuery is also experimenting this way by launching jQuery UI. It will be at the end equivalent I guess, but you will be able to still use the jQuery library as an independant library.
Here's some ressource :
jQuery : http://www.jquery.com
Visual jQuery : http://www.visualjquery.com/1.1.2.html
Dump Plugin for jQuery : http://www.netgrow.com.au/files/javascript_dump.cfm
Javascript benchmark : http://flesler.blogspot.com/2008/04/benchmarking-javascript-variables-and.html