|
@@ -6,16 +6,16 @@ discard block |
|
|
block discarded – undo |
|
6
|
6
|
public static $preventDefault="\nif(event && event.preventDefault) event.preventDefault();\n"; |
|
7
|
7
|
public static $stopPropagation="\nif(event && event.stopPropagation) event.stopPropagation();\n"; |
|
8
|
8
|
|
|
9
|
|
- public static function draggable($attr="id"){ |
|
|
9
|
+ public static function draggable($attr="id") { |
|
10
|
10
|
return 'var dt=event.dataTransfer || event.originalEvent.dataTransfer;dt.setData("text/plain",JSON.stringify({id:$(event.target).attr("id"),data:$(event.target).attr("'.$attr.'")}));'; |
|
11
|
11
|
} |
|
12
|
12
|
|
|
13
|
|
- public static function dropZone($jqueryDone,$jsCallback=""){ |
|
|
13
|
+ public static function dropZone($jqueryDone, $jsCallback="") { |
|
14
|
14
|
return 'var dt=event.dataTransfer || event.originalEvent.dataTransfer;var _data=JSON.parse(dt.getData("text/plain"));$(event.target).'.$jqueryDone.'($("#"+_data.id));var data=_data.data;'.$jsCallback; |
|
15
|
15
|
} |
|
16
|
16
|
|
|
17
|
|
- public static function containsCode($expression){ |
|
18
|
|
- return strrpos($expression, 'this')!==false||strrpos($expression, 'event')!==false||strrpos($expression, 'self')!==false; |
|
|
17
|
+ public static function containsCode($expression) { |
|
|
18
|
+ return strrpos($expression, 'this')!==false || strrpos($expression, 'event')!==false || strrpos($expression, 'self')!==false; |
|
19
|
19
|
} |
|
20
|
20
|
|
|
21
|
21
|
/** |
|
@@ -46,14 +46,14 @@ discard block |
|
|
block discarded – undo |
|
46
|
46
|
$value=implode(",", $value); |
|
47
|
47
|
} |
|
48
|
48
|
if (self::containsCode($value)===false) { |
|
49
|
|
- $value=\str_replace(["\\","\""], ["\\\\","\\\""], $value); |
|
|
49
|
+ $value=\str_replace(["\\", "\""], ["\\\\", "\\\""], $value); |
|
50
|
50
|
$value='"'.$value.'"'; |
|
51
|
51
|
} |
|
52
|
52
|
return $value; |
|
53
|
53
|
} |
|
54
|
54
|
|
|
55
|
|
- public static function prep_jquery_selector($value){ |
|
56
|
|
- if(JString::startswith($value, '$(')===false){ |
|
|
55
|
+ public static function prep_jquery_selector($value) { |
|
|
56
|
+ if (JString::startswith($value, '$(')===false) { |
|
57
|
57
|
return '$('.$value.')'; |
|
58
|
58
|
} |
|
59
|
59
|
return $value; |