From cef3e6025587f84b3efaddcb127b88deb8c32a02 Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Mon, 11 May 2020 17:24:39 +0200 Subject: Remove obsolete itools javascript functions and loader/jsboot mechanism --- it_html.class | 34 ++++++---------------------------- 1 file changed, 6 insertions(+), 28 deletions(-) (limited to 'it_html.class') 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
at the end of body 'show_content_type' => true, # If true, add header 'show_favicon' => true, # If true, add tag to /favicon.ico if it exists 'favicon' => '', # If set, add favicon 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; -- cgit v1.2.3