@@ -5,12 +5,12 @@ discard block |
||
| 5 | 5 | |
| 6 | 6 | trait JsUtilsInternalTrait { |
| 7 | 7 | |
| 8 | - protected $jquery_code_for_compile = array(); |
|
| 8 | + protected $jquery_code_for_compile=array(); |
|
| 9 | 9 | |
| 10 | - protected $jquery_code_for_compile_at_last = array(); |
|
| 10 | + protected $jquery_code_for_compile_at_last=array(); |
|
| 11 | 11 | |
| 12 | 12 | protected function _addToCompile($jsScript) { |
| 13 | - $this->jquery_code_for_compile[] = $jsScript; |
|
| 13 | + $this->jquery_code_for_compile[]=$jsScript; |
|
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | /** |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | * @param BaseGui $library |
| 19 | 19 | * @param mixed $view |
| 20 | 20 | */ |
| 21 | - protected function _compileLibrary(BaseGui $library, &$view = NULL) { |
|
| 21 | + protected function _compileLibrary(BaseGui $library, &$view=NULL) { |
|
| 22 | 22 | if (isset($view)) |
| 23 | 23 | $library->compileHtml($this, $view); |
| 24 | 24 | if ($library->isAutoCompile()) { |
@@ -27,21 +27,21 @@ discard block |
||
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | protected function defer($script) { |
| 30 | - $result = "window.defer=function (method) {if (window.jQuery) method(); else setTimeout(function() { window.defer(method); }, 50);};"; |
|
| 31 | - $result .= "window.defer(function(){" . $script . "});"; |
|
| 30 | + $result="window.defer=function (method) {if (window.jQuery) method(); else setTimeout(function() { window.defer(method); }, 50);};"; |
|
| 31 | + $result.="window.defer(function(){".$script."});"; |
|
| 32 | 32 | return $result; |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | protected function ready($script) { |
| 36 | - $result = '$(function() {' . "\n"; |
|
| 37 | - $result .= $script . '});'; |
|
| 36 | + $result='$(function() {'."\n"; |
|
| 37 | + $result.=$script.'});'; |
|
| 38 | 38 | return $result; |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | protected function minify($input) { |
| 42 | - if (trim($input) === "") |
|
| 42 | + if (trim($input)==="") |
|
| 43 | 43 | return $input; |
| 44 | - $input = preg_replace(array( |
|
| 44 | + $input=preg_replace(array( |
|
| 45 | 45 | // Remove comment(s) |
| 46 | 46 | '#\s*("(?:[^"\\\]++|\\\.)*+"|\'(?:[^\'\\\\]++|\\\.)*+\')\s*|\s*\/\*(?!\!|@cc_on)(?>[\s\S]*?\*\/)\s*|\s*(?<![\:\=])\/\/.*(?=[\n\r]|$)|^\s*|\s*$#', |
| 47 | 47 | // Remove white-space(s) outside the string and regex |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | '$1$3', |
| 60 | 60 | '$1.$3' |
| 61 | 61 | ), $input); |
| 62 | - $input = str_replace("}$", "};$", $input); |
|
| 62 | + $input=str_replace("}$", "};$", $input); |
|
| 63 | 63 | return $input; |
| 64 | 64 | } |
| 65 | 65 | |
@@ -69,9 +69,9 @@ discard block |
||
| 69 | 69 | * @param string $src |
| 70 | 70 | * @return string |
| 71 | 71 | */ |
| 72 | - protected function _open_script($src = '') { |
|
| 73 | - $str = '<script '; |
|
| 74 | - $str .= ($src == '') ? '>' : ' src="' . $src . '">'; |
|
| 72 | + protected function _open_script($src='') { |
|
| 73 | + $str='<script '; |
|
| 74 | + $str.=($src=='') ? '>' : ' src="'.$src.'">'; |
|
| 75 | 75 | return $str; |
| 76 | 76 | } |
| 77 | 77 | |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | * @param string $extra |
| 82 | 82 | * @return string |
| 83 | 83 | */ |
| 84 | - protected function _close_script($extra = "\n") { |
|
| 84 | + protected function _close_script($extra="\n") { |
|
| 85 | 85 | return "</script>$extra"; |
| 86 | 86 | } |
| 87 | 87 | |