This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var touchstartX = 0; | |
var touchstartY = 0; | |
var touchendX = 0; | |
var touchendY = 0; | |
var gesuredZone = document.getElementById('gesuredZone'); | |
gesuredZone.addEventListener('touchstart', function(event) { | |
touchstartX = event.screenX; | |
touchstartY = event.screenY; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Convert RGB(A) values to #hexdecimal using jQuery.css() | |
// Original: http://jsfiddle.net/DCaQb/ | |
// Note: This will not work on browsers which return 'color names' instead of rgb(a) values (i.e. IE8) | |
function rgba2hex( color_value ) { | |
if ( ! color_value ) return false; | |
var parts = color_value.toLowerCase().match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/), | |
length = color_value.indexOf('rgba') ? 3 : 2; // Fix for alpha values | |
delete(parts[0]); | |
for ( var i = 1; i <= length; i++ ) { | |
parts[i] = parseInt( parts[i] ).toString(16); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FormErrorsSerializer { | |
public function serializeFormErrors(\Symfony\Component\Form\Form $form, $flat_array = false, $add_form_name = false, $glue_keys = '_') | |
{ | |
$errors = array(); | |
$errors['global'] = array(); | |
$errors['fields'] = array(); | |
foreach ($form->getErrors() as $error) { | |
$errors['global'][] = $error->getMessage(); |