@@ -16,8 +16,9 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | protected function _compileLibrary($library, &$view=NULL){ |
| 18 | 18 | if ($library!=NULL) { |
| 19 | - if(isset($view)) |
|
| 20 | - $library->compileHtml($this, $view); |
|
| 19 | + if(isset($view)) { |
|
| 20 | + $library->compileHtml($this, $view); |
|
| 21 | + } |
|
| 21 | 22 | if ($library->isAutoCompile()) { |
| 22 | 23 | $library->compile(true); |
| 23 | 24 | } |
@@ -37,7 +38,9 @@ discard block |
||
| 37 | 38 | } |
| 38 | 39 | |
| 39 | 40 | protected function minify($input) { |
| 40 | - if(trim($input) === "") return $input; |
|
| 41 | + if(trim($input) === "") { |
|
| 42 | + return $input; |
|
| 43 | + } |
|
| 41 | 44 | return preg_replace( |
| 42 | 45 | array( |
| 43 | 46 | // Remove comment(s) |
@@ -28,8 +28,9 @@ discard block |
||
| 28 | 28 | $callback=", function(){\n{$callback}\n}"; |
| 29 | 29 | } |
| 30 | 30 | $str="$({$element}).{$action}({$speed}{$callback});"; |
| 31 | - if ($immediatly) |
|
| 32 | - $this->jquery_code_for_compile[]=$str; |
|
| 31 | + if ($immediatly) { |
|
| 32 | + $this->jquery_code_for_compile[]=$str; |
|
| 33 | + } |
|
| 33 | 34 | return $str; |
| 34 | 35 | } |
| 35 | 36 | /** |
@@ -61,10 +62,12 @@ discard block |
||
| 61 | 62 | if (isset($param)) { |
| 62 | 63 | $param=Javascript::prep_value($param); |
| 63 | 64 | $str="$({$element}).{$jQueryCall}({$param});"; |
| 64 | - } else |
|
| 65 | - $str="$({$element}).{$jQueryCall}();"; |
|
| 66 | - if ($immediatly) |
|
| 67 | - $this->jquery_code_for_compile[]=$str; |
|
| 65 | + } else { |
|
| 66 | + $str="$({$element}).{$jQueryCall}();"; |
|
| 67 | + } |
|
| 68 | + if ($immediatly) { |
|
| 69 | + $this->jquery_code_for_compile[]=$str; |
|
| 70 | + } |
|
| 68 | 71 | return $str; |
| 69 | 72 | } |
| 70 | 73 | |
@@ -80,8 +83,9 @@ discard block |
||
| 80 | 83 | $to=Javascript::prep_element($to); |
| 81 | 84 | $element=Javascript::prep_element($element); |
| 82 | 85 | $str="$({$to}).{$jQueryCall}({$element});"; |
| 83 | - if ($immediatly) |
|
| 84 | - $this->jquery_code_for_compile[]=$str; |
|
| 86 | + if ($immediatly) { |
|
| 87 | + $this->jquery_code_for_compile[]=$str; |
|
| 88 | + } |
|
| 85 | 89 | return $str; |
| 86 | 90 | } |
| 87 | 91 | /** |
@@ -130,10 +134,12 @@ discard block |
||
| 130 | 134 | if (isset($value)) { |
| 131 | 135 | $value=Javascript::prep_value($value); |
| 132 | 136 | $str="$({$element}).attr(\"$attributeName\",{$value});"; |
| 133 | - } else |
|
| 134 | - $str="$({$element}).attr(\"$attributeName\");"; |
|
| 135 | - if ($immediatly) |
|
| 136 | - $this->jquery_code_for_compile[]=$str; |
|
| 137 | + } else { |
|
| 138 | + $str="$({$element}).attr(\"$attributeName\");"; |
|
| 139 | + } |
|
| 140 | + if ($immediatly) { |
|
| 141 | + $this->jquery_code_for_compile[]=$str; |
|
| 142 | + } |
|
| 137 | 143 | return $str; |
| 138 | 144 | } |
| 139 | 145 | |
@@ -189,8 +195,9 @@ discard block |
||
| 189 | 195 | |
| 190 | 196 | $str="$({$element}).animate({\n$animations\n\t\t}".$speed.$extra.");"; |
| 191 | 197 | |
| 192 | - if ($immediatly) |
|
| 193 | - $this->jquery_code_for_compile[]=$str; |
|
| 198 | + if ($immediatly) { |
|
| 199 | + $this->jquery_code_for_compile[]=$str; |
|
| 200 | + } |
|
| 194 | 201 | return $str; |
| 195 | 202 | } |
| 196 | 203 | |
@@ -340,8 +347,9 @@ discard block |
||
| 340 | 347 | $element=Javascript::prep_element($element); |
| 341 | 348 | $str="$({$element}).trigger(\"$event\");"; |
| 342 | 349 | |
| 343 | - if ($immediatly) |
|
| 344 | - $this->jquery_code_for_compile[]=$str; |
|
| 350 | + if ($immediatly) { |
|
| 351 | + $this->jquery_code_for_compile[]=$str; |
|
| 352 | + } |
|
| 345 | 353 | return $str; |
| 346 | 354 | } |
| 347 | 355 | |
@@ -403,8 +411,9 @@ discard block |
||
| 403 | 411 | $str.="else{".$jsCodeIfFalse."}"; |
| 404 | 412 | } |
| 405 | 413 | |
| 406 | - if ($immediatly) |
|
| 407 | - $this->jquery_code_for_compile[]=$str; |
|
| 414 | + if ($immediatly) { |
|
| 415 | + $this->jquery_code_for_compile[]=$str; |
|
| 416 | + } |
|
| 408 | 417 | return $str; |
| 409 | 418 | } |
| 410 | 419 | |
@@ -420,11 +429,13 @@ discard block |
||
| 420 | 429 | private function _doJQuery($element, $jqueryCall, $param="", $jsCallback="", $immediatly=false) { |
| 421 | 430 | $param=Javascript::prep_value($param); |
| 422 | 431 | $callback=""; |
| 423 | - if ($jsCallback!="") |
|
| 424 | - $callback=", function(event){\n{$jsCallback}\n}"; |
|
| 432 | + if ($jsCallback!="") { |
|
| 433 | + $callback=", function(event){\n{$jsCallback}\n}"; |
|
| 434 | + } |
|
| 425 | 435 | $script="$(".Javascript::prep_element($element).").".$jqueryCall."(".$param.$callback.");\n"; |
| 426 | - if ($immediatly) |
|
| 427 | - $this->jquery_code_for_compile[]=$script; |
|
| 436 | + if ($immediatly) { |
|
| 437 | + $this->jquery_code_for_compile[]=$script; |
|
| 438 | + } |
|
| 428 | 439 | return $script; |
| 429 | 440 | } |
| 430 | 441 | |
@@ -495,8 +506,9 @@ discard block |
||
| 495 | 506 | */ |
| 496 | 507 | public function exec($js, $immediatly=false) { |
| 497 | 508 | $script=$js."\n"; |
| 498 | - if ($immediatly) |
|
| 499 | - $this->jquery_code_for_compile[]=$script; |
|
| 509 | + if ($immediatly) { |
|
| 510 | + $this->jquery_code_for_compile[]=$script; |
|
| 511 | + } |
|
| 500 | 512 | return $script; |
| 501 | 513 | } |
| 502 | 514 | |