| 1 | <?php |
||
| 5 | class Javascript { |
||
| 6 | public static $preventDefault="\nif(event && event.preventDefault) event.preventDefault();\n"; |
||
| 7 | public static $stopPropagation="\nif(event && event.stopPropagation) event.stopPropagation();\n"; |
||
| 8 | |||
| 9 | public static function containsCode($expression){ |
||
| 12 | |||
| 13 | /** |
||
| 14 | * Puts HTML element in quotes for use in jQuery code |
||
| 15 | * unless the supplied element is the Javascript 'this' |
||
| 16 | * object, in which case no quotes are added |
||
| 17 | * |
||
| 18 | * @param string $element |
||
| 19 | * @return string |
||
| 20 | */ |
||
| 21 | public static function prep_element($element) { |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Puts HTML values in quotes for use in jQuery code |
||
| 30 | * unless the supplied value contains the Javascript 'this' or 'event' |
||
| 31 | * object, in which case no quotes are added |
||
| 32 | * |
||
| 33 | * @param string $value |
||
| 34 | * @return string |
||
| 35 | */ |
||
| 36 | public static function prep_value($value) { |
||
| 45 | |||
| 46 | public static function prep_jquery_selector($value){ |
||
| 52 | } |
||
| 53 |