@@ -3,10 +3,10 @@ discard block |
||
3 | 3 | use Ajax\common\BaseGui; |
4 | 4 | use Ubiquity\js\Minify; |
5 | 5 | |
6 | -trait JsUtilsInternalTrait{ |
|
6 | +trait JsUtilsInternalTrait { |
|
7 | 7 | |
8 | - protected $jquery_code_for_compile=array (); |
|
9 | - protected $jquery_code_for_compile_at_last=array (); |
|
8 | + protected $jquery_code_for_compile=array(); |
|
9 | + protected $jquery_code_for_compile_at_last=array(); |
|
10 | 10 | |
11 | 11 | protected function _addToCompile($jsScript) { |
12 | 12 | $this->jquery_code_for_compile[]=$jsScript; |
@@ -16,28 +16,28 @@ discard block |
||
16 | 16 | * @param BaseGui $library |
17 | 17 | * @param mixed $view |
18 | 18 | */ |
19 | - protected function _compileLibrary(BaseGui $library, &$view=NULL){ |
|
20 | - if(isset($view)) |
|
19 | + protected function _compileLibrary(BaseGui $library, &$view=NULL) { |
|
20 | + if (isset($view)) |
|
21 | 21 | $library->compileHtml($this, $view); |
22 | 22 | if ($library->isAutoCompile()) { |
23 | 23 | $library->compile(true); |
24 | 24 | } |
25 | 25 | } |
26 | 26 | |
27 | - protected function defer($script){ |
|
27 | + protected function defer($script) { |
|
28 | 28 | $result="window.defer=function (method) {if (window.jQuery) method(); else setTimeout(function() { defer(method) }, 50);};"; |
29 | 29 | $result.="window.defer(function(){".$script."})"; |
30 | 30 | return $result; |
31 | 31 | } |
32 | 32 | |
33 | - protected function ready($script){ |
|
33 | + protected function ready($script) { |
|
34 | 34 | $result='$(document).ready(function() {'."\n"; |
35 | 35 | $result.=$script.'})'; |
36 | 36 | return $result; |
37 | 37 | } |
38 | 38 | |
39 | 39 | protected function minify($input) { |
40 | - if(trim($input) === "") return $input; |
|
40 | + if (trim($input)==="") return $input; |
|
41 | 41 | return Minify::minifyJavascript($input); |
42 | 42 | } |
43 | 43 |
@@ -17,8 +17,9 @@ discard block |
||
17 | 17 | * @param mixed $view |
18 | 18 | */ |
19 | 19 | protected function _compileLibrary(BaseGui $library, &$view=NULL){ |
20 | - if(isset($view)) |
|
21 | - $library->compileHtml($this, $view); |
|
20 | + if(isset($view)) { |
|
21 | + $library->compileHtml($this, $view); |
|
22 | + } |
|
22 | 23 | if ($library->isAutoCompile()) { |
23 | 24 | $library->compile(true); |
24 | 25 | } |
@@ -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 Minify::minifyJavascript($input); |
42 | 45 | } |
43 | 46 |