13 $this->jquery_code_for_compile[] = $jsScript;
29 protected function defer($script) {
30 $result =
"(function(){window.defer=function (method) {if (window.jQuery) method(); else setTimeout(function() { window.defer(method); }, 50);};";
31 $result .=
"window.defer(function(){" . $script .
"})})()";
35 protected function ready($script) {
36 $result =
'$(function() {' .
"\n";
37 $result .= $script .
'});';
42 if (trim($input) ===
"")
44 $input = preg_replace(array(
46 '#\s*("(?:[^"\\\]++|\\\.)*+"|\'(?:[^\'\\\\]++|\\\.)*+\')\s*|\s*\/\*(?!\!|@cc_on)(?>[\s\S]*?\*\/)\s*|\s*(?<![\:\=])\/\/.*(?=[\n\r]|$)|^\s*|\s*$#',
48 '#("(?:[^"\\\]++|\\\.)*+"|\'(?:[^\'\\\\]++|\\\.)*+\'|\/\*(?>.*?\*\/)|\/(?!\/)[^\n\r]*?\/(?=[\s.,;]|[gimuy]|$))|\s*([!%&*\(\)\-=+\[\]\{\}|;:,.<>?\/])\s*#s',
52 '#([\{,])([\'])(\d+|[a-z_][a-z0-9_]*)\2(?=\:)#i',
54 '#([a-z0-9_\)\]])\[([\'"])([a-z_][a-z0-9_]*)\2\]#i'
62 $input = str_replace(
"}$",
"};$", $input);
74 $str .= ($src ==
'') ?
'>' :
' src="' . $src .
'">';
85 return "</script>$extra";
89 $this->
_addToCompile(
"var btn = $.fn.button.noConflict();$.fn.btn = btn;");
compileHtml(JsUtils $js=NULL, &$view=NULL)
$jquery_code_for_compile_at_last
_compileLibrary(BaseGui $library, &$view=NULL)
_close_script($extra="\n")
Outputs an closing </script>
_open_script($src='')
Outputs an opening <script>