diff options
author | Christian Schneider | 2020-05-11 17:24:39 +0200 |
---|---|---|
committer | Christian Schneider | 2020-05-11 17:24:39 +0200 |
commit | cef3e6025587f84b3efaddcb127b88deb8c32a02 (patch) | |
tree | d3fe7241ce3022928e4a12147a29c6196ddd6725 /it_html.class | |
parent | c412f1c1463327866baee117504c3a4b3fc33bd6 (diff) | |
download | itools-cef3e6025587f84b3efaddcb127b88deb8c32a02.tar.gz itools-cef3e6025587f84b3efaddcb127b88deb8c32a02.tar.bz2 itools-cef3e6025587f84b3efaddcb127b88deb8c32a02.zip |
Remove obsolete itools javascript functions and loader/jsboot mechanism
Diffstat (limited to 'it_html.class')
-rw-r--r-- | it_html.class | 34 |
1 files changed, 6 insertions, 28 deletions
diff --git a/it_html.class b/it_html.class index 424559c..6ddbab9 100644 --- a/it_html.class +++ b/it_html.class @@ -79,7 +79,6 @@ function __construct($p = array()) 'name' => $p['htmltype'] == 'xml' ? 'it_html_xml' : 'it_html', # Name of global variable $this is assigned to (string), XXX Copy and paste in configure() 'nonewlinetags' => 'a,b,em,img,input,label,span,noscript', # tags that do not like newlines after them 'prettyprint' => it::is_devel(), # Should output be prettily indented? - 'show_boot_dom' => false, # If true, append invisible <div id="it_boot_dom"> at the end of body 'show_content_type' => true, # If true, add <meta http-equiv="Content-Type" ...> header 'show_favicon' => true, # If true, add <link> tag to /favicon.ico if it exists 'favicon' => '', # If set, add favicon <link> tag to this url @@ -229,14 +228,7 @@ function head($args = array()) } $js = isset($p['jsenv']) ? "var env = " . itjs::serialize($p['jsenv']) . ";\n" : ''; - $js .= $this->_itjs($p['jsinline'], 'inline'); - - if ($p['js']) - { - $js .= $this->_itjs("boot.js", "inline"); - $js .= "function it_boot_start(){ " . trim($p['jsboot']) . " }\n"; - $js .= "it_boot('/itjs/" . U($p['js'], array('s' => itjs::checksum($p['js']))) . "');\n"; - } + $js .= $this->_itjs($p['jsinline']); if ($js) $data .= $this->js(array(self::_cleanup($js, $p['charset']))); @@ -266,9 +258,6 @@ function body($args) $args[] = div(array('style' => 'position:fixed; bottom:0; z-index:9999; font-family:monospace'), "Debugvars: " . join(" ", $debug_links)); } - if ($this->p['show_boot_dom']) - $args[] = div(array('id' => "it_boot_dom", 'style' => "visibility:hidden")); - return $this->head() . $this->_tag('body', $args); } @@ -580,30 +569,19 @@ function js($args) /** * Include javascript code or generate HTML to include it */ -function _itjs($files, $mode) +function _itjs($files) { $result = ""; if ($files) { $filenames = itjs::filenames($files); + $jsfile = ""; - if ($mode == "files") - { - foreach ($filenames as $file) - $result .= tag('script', array('type' => "text/javascript", 'src' => "/itjs/" . basename($file) . "?v=" . itjs::checksum($file))); - } - else if ($mode == "inline") - { - $jsfile = ""; - - foreach ($filenames as $file) - $jsfile .= @it::file_get_contents($file); + foreach ($filenames as $file) + $jsfile .= @it::file_get_contents($file); - $result .= itjs::strip($jsfile); - } - else - $result .= tag('script', array('type' => "text/javascript", 'src' => "/itjs/$files?v=" . itjs::checksum($filenames))); + $result .= itjs::strip($jsfile); } return $result; |