Some people seem to be a little bit unhappy with the way the default jQuery Mobile loading ajax spinner rotates. Luckily, this can be changed easily by contorlling the css animation settings. Here are three simple variations.
Works only in Safari and Chrome:
variation 1 (jQuery Mobile standard):
variation 2 (ease-in-out spun over multiple rotations):
Since Phonegap version 0.9.5 the orientationchange event is triggered on the document object instead of the window object. This might be a problem as most libraries (amongst jQueryMobile) expect the event to occur on the window object.
However, there is an easy solution (this one requires jQuery but can be easily adapted):
Today I packaged two filters I am using to manage client side caching:
jfCacheHeadersFilter: sets the HTTP headers required to server pages from client side (or proxy) cache
jfCacheInvalidateStaticSourceUrlsFilter: append a cache key to the URLs of referenced Javascript and CSS files so that you can configure a very long cache expire time for those files
I wrote a symfony plugin that allows you to easily optimize your existing symfony application for mobile devices using jQuery Mobile.
And if you want to distribute your application in Android Market or Apple App Store it is possible using e.g. Phonegap.
If you are visiting my website using one of the supported operating systems (e.g. iOs or Android) then you will be prompted if you wish to view the mobile-enhanced version or the regular version: http://www.jonasfischer.net/.
The standard sfWidgetFormDoctrineChoice “add_empty” option is only useful if the relation has not yet been set. However, once a relation is saved, selecting the empty value again will result in an validation error.
Here is a simple way to allow users to unlink relations by selecting the empty value of a sfWidgetFormDoctrineChoice select list. Simply add these lines to your form’s configure()-method:
$this->widgetSchema['rdr_images_list']->setOption('add_empty', true);
$valuesRaw = sfContext::getInstance()->getRequest()->getParameter($this->getName());
if (1 === count($valuesRaw['images_list']) && '' === $valuesRaw['images_list'][0]) {
$this->validatorSchema['images_list'] = new sfValidatorPass();
}
I updated my old Symfony helper (see http://jnotes.jonasfischer.net/2010/03/smyfony-helper-for-jquerys-excellen-form-validation-plugin/) for the jQuery plugin “jquery.validate” (see http://docs.jquery.com/Plugins/Validation). It now supports embedded forms and is much simpler to use:
Usage
Simply insert the following code directly after the opening <form>-Tag:
This will add some css classes to the form widgets based on the validators configured in your form.
Then you can add more complex validation afterwards:
<script>
//Certificate name field is only required if a certificate is requested
$('#rdr_donation_cert_name').rules('add', {
required: '#rdr_donation_certificate_1:checked'
});
</script>
In some cases you might want to access the jQuery-validate object itself:
<script>
if (typeof < ?php echo $form->getName() ?>Validator !== 'undefined') {
var donationCertificateValidator = < ?php echo $form->getName() ?>Validator; //jQuery.validate validator (instantiated in jquery_validate_form() helper)
donationCertificateValidator.element($('#rdr_donation_cert_name'));
}
</script>
I wrote this little helper method to extract the validation rules from forms defined with the symfon form framework and to automatically create the jquery.validate code to validate those forms on the client side. Of course, server side validation will still work, too.
I wrote two filters that allow you to configure redirect rules for requests sent from special user agents e.g. iphone, android & co.
If the requesting user agent matches the redirect rules then the redirect is issued using HTTP Headers. As a fallback for cached pages, the redirect is issued again using javascript (the filter inserts some lines of javascript code in the
-section of your document).
The first one, redirectUserAgentFilter, is a generic approach to redirects depending on the user agent string. You can activate it in your filters.yml using these lines:
In this case, the filter would redirect all requests coming from user agents containing “android”, “iphone” oder “ipod” in their names to http://mobile.yourdomain.com. Read the rest of this entry »
I planned to use the sfFacebookConnectPlugin to pre-fill user a user profile form in one of my upcoming projects. At first I thought this would be no problem because the “More with Symfony” Book states:
“The terms of use of Facebook Connect clearly remind that one should not store any personal information about the user without the user explicitly agreeing about it, but the information provided can be used to fill forms and ask for confirmation in a click. Additionally, the website can rely on public information like name and profile picture without needing to store them.” (http://www.symfony-project.org/more-with-symfony/1_4/en/12-Developing-for-Facebook)
Unfortunately (or fortunately, because I had not invested too much time in developing the feature, yet), as a digged through the facebook api documentation, I read that this is no longer true:
“For example, we clarified that user data you get from the API is always subject to the restrictions on storage (so you shouldn’t pre-fill data in a form for users to submit to your application if you plan to store that data; users should enter that information directly)” (see http://developers.facebook.com/news.php?blog=1&story=234 or http://www.facebook.com/help/?page=431#!/help.php?page=888)
ZipArchive seems to fail when adding the 1012th file.
I tested this with two different file sized and in bith cases ZipArchive::addFile() fails when adding the 1012th file. Strange.
Then I tested the same with the ZipArchiveImproved Class proposed by Farzad Ghanei (http://de.php.net/manual/de/function.ziparchive-addfile.php#88266) without problems.
I stopped testing after 5000 files without problems.
I tested this on two different machines both running PHP 5.2.6-3ubuntu4.2 with Suhosin-Patch 0.9.6.2