summaryrefslogtreecommitdiffstats
path: root/emacs.d/nxhtml/nxhtml/html-wtoc
diff options
context:
space:
mode:
Diffstat (limited to 'emacs.d/nxhtml/nxhtml/html-wtoc')
-rw-r--r--emacs.d/nxhtml/nxhtml/html-wtoc/PerlLib/PathSubs.pm207
-rw-r--r--emacs.d/nxhtml/nxhtml/html-wtoc/PerlLib/html_tags.pm127
-rw-r--r--emacs.d/nxhtml/nxhtml/html-wtoc/html-wtoc-template.css141
-rw-r--r--emacs.d/nxhtml/nxhtml/html-wtoc/html-wtoc-template.html143
-rw-r--r--emacs.d/nxhtml/nxhtml/html-wtoc/html-wtoc.css84
-rw-r--r--emacs.d/nxhtml/nxhtml/html-wtoc/html-wtoc.js361
-rw-r--r--emacs.d/nxhtml/nxhtml/html-wtoc/html-wtoc.pl1395
-rw-r--r--emacs.d/nxhtml/nxhtml/html-wtoc/img/blank12.gifbin825 -> 0 bytes
-rw-r--r--emacs.d/nxhtml/nxhtml/html-wtoc/img/down.gifbin853 -> 0 bytes
-rw-r--r--emacs.d/nxhtml/nxhtml/html-wtoc/img/freeCont.gifbin913 -> 0 bytes
-rw-r--r--emacs.d/nxhtml/nxhtml/html-wtoc/img/gnu-m-x-160.pngbin1957 -> 0 bytes
-rw-r--r--emacs.d/nxhtml/nxhtml/html-wtoc/img/gnu-m-x-160.xcfbin22466 -> 0 bytes
-rw-r--r--emacs.d/nxhtml/nxhtml/html-wtoc/img/hideCont.gifbin917 -> 0 bytes
-rw-r--r--emacs.d/nxhtml/nxhtml/html-wtoc/img/nailCont.gifbin917 -> 0 bytes
-rw-r--r--emacs.d/nxhtml/nxhtml/html-wtoc/img/nosearch.gifbin1100 -> 0 bytes
-rw-r--r--emacs.d/nxhtml/nxhtml/html-wtoc/img/other/CompFaceLogoTemp4.gifbin3202 -> 0 bytes
-rw-r--r--emacs.d/nxhtml/nxhtml/html-wtoc/img/other/CompFaceLogoTemp4.pngbin6710 -> 0 bytes
-rw-r--r--emacs.d/nxhtml/nxhtml/html-wtoc/img/other/blue_left_top.pngbin381 -> 0 bytes
-rw-r--r--emacs.d/nxhtml/nxhtml/html-wtoc/img/other/close-cross.gifbin866 -> 0 bytes
-rw-r--r--emacs.d/nxhtml/nxhtml/html-wtoc/img/other/lbiinfo_and_blue.pngbin3763 -> 0 bytes
-rw-r--r--emacs.d/nxhtml/nxhtml/html-wtoc/img/other/lbiinfo_and_blue1.pngbin4012 -> 0 bytes
-rw-r--r--emacs.d/nxhtml/nxhtml/html-wtoc/img/other/lbinfo_col1.gifbin3732 -> 0 bytes
-rw-r--r--emacs.d/nxhtml/nxhtml/html-wtoc/img/other/lbinfo_col1_30.gifbin1299 -> 0 bytes
-rw-r--r--emacs.d/nxhtml/nxhtml/html-wtoc/img/other/up.gifbin851 -> 0 bytes
-rw-r--r--emacs.d/nxhtml/nxhtml/html-wtoc/img/right.gifbin857 -> 0 bytes
-rw-r--r--emacs.d/nxhtml/nxhtml/html-wtoc/img/search.gifbin1118 -> 0 bytes
-rw-r--r--emacs.d/nxhtml/nxhtml/html-wtoc/img/showCont.gifbin909 -> 0 bytes
27 files changed, 0 insertions, 2458 deletions
diff --git a/emacs.d/nxhtml/nxhtml/html-wtoc/PerlLib/PathSubs.pm b/emacs.d/nxhtml/nxhtml/html-wtoc/PerlLib/PathSubs.pm
deleted file mode 100644
index e95b8d5..0000000
--- a/emacs.d/nxhtml/nxhtml/html-wtoc/PerlLib/PathSubs.pm
+++ /dev/null
@@ -1,207 +0,0 @@
-# Copyright 2006 Lennart Borgman, http://OurComments.org/. All rights
-# reserved.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; see the file COPYING. If not, write to the
-# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301, USA.
-
-package PathSubs;
-
-#####################################################
-### This package contains general path handling
-### routines and some win32 specific dito.
-### The latter should ev be moved to a new module!
-#####################################################
-use strict;
-
-use File::Spec;
-
-### Absolute path names
-
-sub is_abs_path ($) {
- my $path = shift;
- return 0 if $path eq "";
- return 1 if File::Spec->file_name_is_absolute($path);
- #return 1 if substr($path, 1, 1) eq ":"; # MSWin32
- #return 1 if substr($path, 0, 1) eq "/";
- return 1 if $path =~ /^https?:/i;
- return 1 if $path =~ /^file:/i;
- return 1 if $path =~ /^javascript:/i;
- return 1 if $path =~ /^mailto:/i;
-}
-sub is_abs_netpath($) {
- my $path = shift;
- return 1 if $path =~ /^https?:/i;
- # New
- return 1 if $path =~ /^ftp:/i;
- return 1 if $path =~ /^mailto:/i;
-}
-
-
-sub uniq_file($) {
- my $fname = shift;
- $fname =~ s!^\s+|\s+$!!g;
- return "" if ($fname eq "");
- $fname = File::Spec->rel2abs($fname);
- if (!File::Spec->file_name_is_absolute($fname)) {
- die "File name is not absolute: $fname";
- }
- #print STDERR "uniq_file($fname)\n";
- $fname =~ tr!\\!/!;
- if (-e $fname) {
- #print STDERR "exists $fname\n";
- ### There is an error in 522, compensate for this!
- #die substr($fname, -1);
- if (substr($fname, -1) eq "/") { chop $fname; }
- #print STDERR "exists $fname\n";
- ### Translate ..
- if (substr($fname, 1, 1) eq ":") {
- my $ffname = Win32::GetFullPathName($fname);
- ### Get case
- my $lfname = Win32::GetLongPathName($ffname);
- #print STDERR "lexists $lfname\n";
- $fname = $lfname if ($lfname ne "");
- }
- } else {
- #print STDERR "NOT exists $fname\n";
- if (substr($fname, -1) eq "/") { chop $fname; }
- my $head = "";
- if (substr($fname, 0, 2) eq "//") {
- $head = "//";
- $fname = substr($fname, 2);
- }
- my @fname = split("/", $fname);
- my $tail = pop @fname;
- $fname = uniq_dir($head . join("/", @fname)) . $tail;
- }
- if (substr($fname, 1, 1) eq ":") {
- $fname = uc(substr($fname, 0, 1)) . substr($fname, 1);
- #print STDERR "fname $fname\n";
- }
- $fname =~ tr!\\!/!;
- #print STDERR "fname ($fname)\n";
- return $fname;
-}
-sub uniq_dir($) {
- my $dir = shift;
- my $uq_dir = uniq_file($dir);
- if (substr($uq_dir, -1) ne "/") { $uq_dir .= "/"; }
- return $uq_dir;
-}
-
-
-
-### Relative paths
-sub _get_link_root($) {
- my $lnk = shift;
- if ($lnk =~ m!^(/|ftp://[^/]*|https?://[^/]*|[a-z]:/)!i) {
- return $1;
- } else {
- return "";
- }
-}
-
-sub resolve_dotdot($) {
- my $orig_url = shift;
- my $root = _get_link_root($orig_url);
- return $orig_url if length($root) == length($orig_url);
- my $url = substr($orig_url, length($root));
- if (substr($root, -1) eq "/") {
- chop $root;
- $url = "/$url";
- }
- #die "$root\n$url";
- my $iPosSearch = 2;
- #print "url=$url\n";
- while ((my $iPos = index($url, "/../", $iPosSearch)) > -1) {
- my $sLeft = substr($url, 0, $iPos);
- if (substr($sLeft, -2) eq "..") {
- $iPosSearch += 3;
- next;
- }
- my $sRight = substr($url, $iPos+3);
- #print "url=$url\n";
- #print "iPos=$iPos\n";
- #print "sLeft=$sLeft\n";
- $sLeft =~ s!/[^/]*$!!;
- #print "sLeft=$sLeft\n";
- #print "sRight=$sRight\n";
- $url = $sLeft . $sRight;
- #print "\t***url=$url\n";
- #print "url=$url\n";
- }
- if (index($url, "../") > -1) {
- return $orig_url;
- }
- return $root . $url;
-}
-
-sub mk_relative_link($$;$) {
- my $from = shift;
- my $to = shift;
- my $norm = shift;
- if ($norm) {
- $from = uniq_file($from);
- $to = uniq_file($to);
- }
- if (-e $from) {
- $from = uniq_file($from);
- } else {
- $from = resolve_dotdot($from);
- }
- if (-e $to) {
- $to = uniq_file($to);
- } else {
- $to = resolve_dotdot($to);
- }
- my $root_from = _get_link_root($from);
- my $root_to = _get_link_root($to );
- if ($root_from ne $root_to) {
- return $to;
- }
- my @from = split "/", $from;
- my @to = split "/", $to;
- while (@to) {
- last if ($to[0] ne $from[0]);
- shift @to;
- shift @from;
- }
- if (@to == 1 && @from == 1) {
- if (length($to[0]) > length($from[0])) {
- if (substr($to[0], 0, length($from[0])+1) eq ($from[0] . "#")) {
- return substr($to[0], length($from[0]));
- }
- }
- }
- my $rl;
- for (1..$#from) { $rl .= "../"; }
- $rl .= join("/", @to);
-
- return $rl;
-}
-
-
-
-sub mk_absolute_link($$) {
- my $from = shift;
- my $rel_to = shift;
- my $abs = $from;
- $abs =~ s![^/]*$!!;
- $abs .= $rel_to;
- if (!is_abs_netpath($abs)) { $abs = uniq_file($abs); }
- $abs;
-}
-
-
-1;
diff --git a/emacs.d/nxhtml/nxhtml/html-wtoc/PerlLib/html_tags.pm b/emacs.d/nxhtml/nxhtml/html-wtoc/PerlLib/html_tags.pm
deleted file mode 100644
index ecdfd53..0000000
--- a/emacs.d/nxhtml/nxhtml/html-wtoc/PerlLib/html_tags.pm
+++ /dev/null
@@ -1,127 +0,0 @@
-# Copyright 2006 Lennart Borgman, http://OurComments.org/. All rights
-# reserved.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; see the file COPYING. If not, write to the
-# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301, USA.
-
-
-package html_tags;
-use strict;
-
-use vars qw($AUTOLOAD);
-
-sub _make_attributes {
- my($self,$attr) = @_;
- return () unless $attr && ref($attr) && ref($attr) eq 'HASH';
- my(@att);
- foreach (keys %{$attr}) {
- my($key) = $_;
- $key=~s/^\-//; # get rid of initial - if present
- #$key=~tr/a-z_/A-Z-/; # parameters are upper case, use dashes
- $key=~tr/A-Z_/a-z-/; # parameters are lower case in XHTML
- push(@att,defined($attr->{$_}) ? qq/$key="$attr->{$_}"/ : qq/$key/);
- }
- return @att;
-}
-
-sub _tag {
- my $tag_name = shift;
- my $part = shift;
- my($attr) = '';
- if (ref($_[0]) && ref($_[0]) eq 'HASH') {
- my(@attr) = html_tags::_make_attributes( '',shift() );
- $attr = " @attr" if @attr;
- }
- #return "<$tag_name$attr />" unless @_;
- return "<$tag_name$attr />" if $part == 1;
- return "<$tag_name$attr>" if $part == 2;
- my($tag,$untag) = ("<$tag_name$attr\n>","</$tag_name\n>");
- my @result = map { "$tag$_$untag" } (ref($_[0]) eq 'ARRAY') ? @{$_[0]} : "@_";
- return $result[0] if $part == 1;
- return "@result";
-}
-
-sub _mk_tag_sub($$) {
- my $name = shift;
- my $package = shift;
- my $caller = caller;
- my $sep = ($name =~ s/^\*//);
- my $lc_name = lc $name;
- my $code =
- ($lc_name =~ m/^(?:br|hr|input|img)$/ ?
- "sub $package\:\:$name(;\$\$) { return $caller\:\:_tag('$lc_name',1,\@_); }\n"
- :
- "sub $package\:\:$name(\$;\$) { return $caller\:\:_tag('$lc_name',0,\@_); }\n"
- );
- if ($sep) {
- if ($lc_name eq "html") {
- $code .= "sub $package\:\:start_$name(\$;\$\$)
- {return $caller\:\:_start_html(\@_);}\n";
- $code .= "sub $package\:\:end_$name {return $caller\:\:_end_html();}\n";
- } else {
- $code .= "sub $package\:\:start_$name(;\$\$)
- {return $caller\:\:_tag('$lc_name',1,\@_);}\n";
- $code .= "sub $package\:\:end_$name {'</$lc_name>';}\n";
- }
- }
- $code;
-}
-sub _start_html {
- my $title = shift;
- my $head_tags = shift;
- my $body_attr = shift;
- # compensate for perl laziness... (will not detect undef sub)
- $head_tags = $head_tags . _tag("title", 0, $title);
- my $start =
- _tag("html", 2) .
- _tag("head", 0, $head_tags) .
- _tag("body", 2, $body_attr);
-}
-sub _end_html {
- return '</body></html>';
-}
-
-sub header(@) {
- my @lines = @_;
- my $header;
- my $type;
- while (@lines) {
- my $key = shift @lines; my $value = shift @lines;
- $header .= "$key: $value\n";
- $type = $value if $key =~ m/content-type/i;
- }
- $header .= "Content-type: text/html\n" unless defined $type;
- $header .= "\n";
-}
-sub import {
- shift;
- my %exported;
- $exported{$_}++ for (@_);
- my $caller = caller;
- my $to_eval = "package $caller;\n";
- for my $name (keys %exported) {
- die "Will not redefine $caller\:\:$name" if $caller->can($name);
- my $func;
- if ($name eq "header") {
- $func = "sub header { html_tags::header(); }";
- }
- $func = _mk_tag_sub($name, $caller) unless defined $func;
- $to_eval .= "$func\n";
- }
- eval $to_eval;
- die $@ if $@;
-}
-
-1;
diff --git a/emacs.d/nxhtml/nxhtml/html-wtoc/html-wtoc-template.css b/emacs.d/nxhtml/nxhtml/html-wtoc/html-wtoc-template.css
deleted file mode 100644
index a6ffabb..0000000
--- a/emacs.d/nxhtml/nxhtml/html-wtoc/html-wtoc-template.css
+++ /dev/null
@@ -1,141 +0,0 @@
-/* Main structures >>>>>>>>>>>>>>> */
-.html-wtoc-maintop {
- font-size: 1px;
- font-size: 1em;
- margin-top: 0em;
- margin-bottom: 0em;
-/* background-color:green; */
-}
-.html-wtoc-main {
-}
-
-td.html-wtoc-vdivline {
- //background-color: #8be;
- width: 0px;
-}
-
-.html-wtoc-search-form {
- margin-bottom: 0.1em;
-}
-.html-wtoc-search {
- font-size: 0.8em;
- color: green;
-}
-.html-wtoc-search a {
- color: green;
-}
-/* <<<<<<<<<<<<<<<<<<< */
-
-
-
-
-/* Table of content >>>>>>>>>>>>>> */
-
-#html-wtoc-id-hidetoc {
- height: 20px;
- border-bottom: 2px inset #ddf;
- border-color: #dff;
-}
-
-#html-wtoc-id-tocdiv {
- width: 2.5em;
- //background-color: #eff;
-}
-#html-wtoc-id-logo {
- width: 100%;
- height: 120px;
- padding: 0em;
- margin: 0em;
- border: 0em;
-}
-#html-wtoc-id-toc {
-}
-#html-wtoc-id-tocwidth {
- width: 18em;
- height: 0em;
- padding: 0em;
- margin: 0em;
- border: 0em;
- line-height: 0em;
-/* background-color: red; */
-}
-#html-wtoc-id-toccol {
- width: 18em;
-}
-
-.html-wtoc-contcol {
- background-color: #dFEfff;
- background-color: #dFEfff;
- background-color: #cd950c;
- background-color: #eead0e;
-}
-/* <<<<<<<<<<<<<<<<<<< */
-
-
-
-
-/* Buttons etc >>>>>>>>>>>>>>> */
-.html-wtoc-button {
- font-size: 0.75em;
- font-size: 8pt;
- color: #5A5D00;
- background-color: #9cf;
- background-color: #bcee68;
- background-color: #a2cd5a;
- padding: 0.2em;
- Border-Width: 2px;
- Border-Style: outset;
- text-align: center;
- border-color: #ddf;
-}
-a.html-wtoc-button {
- text-decoration: none;
- color: #5A5D00;
-}
-a.html-wtoc-button:hover {
- text-decoration:none;
- background-color: #6af;
- color:#340;
-}
-
-a.html-wtoc-buttonimg img {
- width: 16px;
- height: 16px;
- padding: 4px;
- border: 8px;
-}
-a.html-wtoc-buttonimg {
- border:2px;
- margin:2px;
- margin-left:2px;
- margin-right:2px;
-}
-a.html-wtoc-buttonimg {
- font-size:1px;
-}
-a.html-wtoc-buttonimg:hover {
- margin: 6px;
- margin-left:0px;
- margin-right:0px;
- border-color: #ddf;
- border-width: 2px;
- border-style: outset;
- background-color: #595C00;
- background-color: #bef;
- background-color: #b9ffb9;
-}
-
-/* <<<<<<<<<<<<<<<<<<< */
-
-
-#nxhtml-link {
- font-size: 0.7em;
- text-align: center;
- padding-top: 2em;
- padding: 1em;
-}
-
-.copyright {
- color : #872;
-}
-
diff --git a/emacs.d/nxhtml/nxhtml/html-wtoc/html-wtoc-template.html b/emacs.d/nxhtml/nxhtml/html-wtoc/html-wtoc-template.html
deleted file mode 100644
index 440ece7..0000000
--- a/emacs.d/nxhtml/nxhtml/html-wtoc/html-wtoc-template.html
+++ /dev/null
@@ -1,143 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>HEAD</title>
- <link rel="stylesheet" href="html-wtoc.css" type="text/css" />
- <link rel="stylesheet" href="html-wtoc-template.css" type="text/css" />
- <script type="text/javascript" src="html-wtoc.js"></script>
- <script type="text/javascript" src="html-wtoc-template.js"></script>
- <script type="text/javascript">
- var my_old_onload = window.onload;
- function my_onload() {
- HTML_WTOC_NS.onload_actions(%%PNUM%%);
- if (undefined != my_old_onload) { my_old_onload(); }
- }
- window.onload = my_onload;
- </script>
-
- </head>
-<body>
-
-
-
-
- <table summary="Page columns" cellspacing="0" border="0" cellpadding="0" width="100%" >
- <tr valign="top">
- <td id="html-wtoc-id-toccol" class="html-wtoc-contcol">
- <table summary="Contents column" id="html-wtoc-id-toc" class="html-wtoc-contcol"
- cellspacing="0" border="0" cellpadding="0" width="100%">
- <tr valign="top">
- <td colspan="2" height="50" >
- <table summary="Contents displaying buttons" id="html-wtoc-id-hidetoc"
- border="0" cellpadding="0" cellspacing="0" width="100%">
- <tr>
- <td width="70%">
- <a href="javascript:HTML_WTOC_NS.show_content(0); void(0);"
- class="html-wtoc-buttonimg"
- ><img src="img/showCont.gif"
- alt="Show table of content"
- border="0" /></a>
-
- <a style="display:none;"
- href="javascript:toggle_toc_nailing()"
- class="html-wtoc-buttonimg"
- ><img id="html-wtoc-id-nailimg"
- src="img/freeCont.gif"
- alt="Let table of content move with page"
- border="0" /></a>
-
- </td>
- </tr>
- </table>
- <table summary="Logo" id="html-wtoc-id-logo">
- <tr>
- <td align="right" valign="bottom" >
- <a href="http://www.OurComments.org/Emacs/EmacsW32.html"
- ><img src="img/gnu-m-x-160.png" width="80" height="80"
- alt="Go to EmacsW32 Home Page"
- title="Go to EmacsW32 Home Page"
- onmouseover="transLbi(this, false);"
- onmouseout ="transLbi(this, true);"
- style="
- margin-top:10px;
- padding-left:20px;
- padding-right:20px;
- padding-top:10px;
- padding-bottom:10px;
- "
- border="0"
- /></a>
- </td>
- </tr>
- </table>
- </td>
- </tr><tr valign="top">
- <td >
- <table>
- <tr>
- <td>%%TOC%%</td>
- </tr>
- <tr>
- <td id="nxhtml-link">
- <br />
- Built using Emacs
- <br />
- with nxhtml from
- <br />
- <a href="http://ourcomments.org/Emacs/Emacs.html"
- target="_blank">ourcomments.org</a>
- </td>
- </tr>
- </table>
- </td>
- <td class="html-wtoc-vdivline" width="1"></td>
- </tr><tr>
- <td colspan="2">
- </td>
- </tr>
- </table>
- <table summary="Ensure table width"
- cellspacing="0" id="html-wtoc-id-tocwidth"><tr><td></td></tr></table>
- </td>
- <td id="html-wtoc-id-tocdiv" ></td>
- <td align="left" >
- <table summary="Right column outermost"
- cellspacing="0" border="0" cellpadding="0" width="100%">
- <tr valign="top">
- <td >&nbsp;&nbsp;&nbsp;</td>
- <td align="left" class="html-wtoc-main">
- <p class="html-wtoc-maintop">
- <a href="javascript:HTML_WTOC_NS.show_content(1); void(0);"
- id="html-wtoc-id-showtoc" style="display:none;"
- class="html-wtoc-buttonimg"
- ><img src="img/hideCont.gif"
- alt="Hide table of content"
- border="0"
- /></a>
- &nbsp;
- </p>
- %%PAGE%%
- <p>&nbsp;</p>
- <!--
- <hr style="clear:both" width="50%" class="copyright" />
- <span class="copyright"
- >
- &copy; Copyright 2006 OurComments.org,
- <a href="http://www.OurComments.org/" target="_blank"
- class="copyright"
- >http://www.OurComments.org/</a>.
- All rights reserved.
- </span>
- -->
- <br />
- <br />
- </td>
- <td width="10">&nbsp;</td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </body>
-</html>
diff --git a/emacs.d/nxhtml/nxhtml/html-wtoc/html-wtoc.css b/emacs.d/nxhtml/nxhtml/html-wtoc/html-wtoc.css
deleted file mode 100644
index a12cb65..0000000
--- a/emacs.d/nxhtml/nxhtml/html-wtoc/html-wtoc.css
+++ /dev/null
@@ -1,84 +0,0 @@
-body {
- margin: 0;
-}
-td {
- font-size: 1em;
-}
-
-/* Added by html-wtoc.pl >>>>>>>>>>>>> */
-.html-wtoc-mark {
-/* background-color: #9cf; */
-/* background-color: #bcee68; */
-/* background-color: #a2cd5a; */
- width: 20px;
- padding: 0;
- border: 0;
- text-align: center;
-}
-.html-wtoc-contline {
- width: 100%;
-}
-
-.html-wtoc-margin {
- width: 0.6em;
-}
-.html-wtoc-contents {
- font-size: 0.9em;
- padding: 1em;
- background-color: #9cf;
- background-color: #a2cd5a;
- background-color: #efffcf;
- background-color: #ffffdf;
- -moz-border-radius-topleft: 2em;
-}
-.html-wtoc-contents td {
-/* background-color: #9cf; */
-/* background-color: #bcee68; */
-/* background-color: #a2cd5a; */
-}
-.html-wtoc-contents-a {
- text-decoration: none;
- color: #595C00;
-/* background-color: #9cf; */
-/* background-color: #bcee68; */
-/* background-color: #a2cd5a; */
- border: 1px #9cf solid;
- border: 1px #a2cd5a solid;
- border: 1px #ffffc0 solid;
- padding-left: 0.25em;
- padding-right: 0;
- margin: 1px;
- display: block;
-}
-.html-wtoc-contents a:hover {
- text-decoration: none;
- background-color: #b9ffb9;
- border: 1px #6b8e23 solid;
-}
-.html-wtoc-currcont {
- background-color: #738600;
- color: #ffff2f;
- background-color: #535600;
- border: 1px #6b8e23 inset;
- padding-left: 0.25em;
- padding-right: 0;
- margin: 1px;
- display: block;
-}
-a.html-wtoc-currcont {
- text-decoration: none;
-}
-a.html-wtoc-currcont:hover {
- background-color: #738600;
- background-color: #536600;
- background-color: #434620;
-}
-/* <<<<<<<<<<<<<<<<<<< */
-
-
-
-
-
-
-
-
diff --git a/emacs.d/nxhtml/nxhtml/html-wtoc/html-wtoc.js b/emacs.d/nxhtml/nxhtml/html-wtoc/html-wtoc.js
deleted file mode 100644
index 7f22db7..0000000
--- a/emacs.d/nxhtml/nxhtml/html-wtoc/html-wtoc.js
+++ /dev/null
@@ -1,361 +0,0 @@
-
-// © Copyright 2006 Lennart Borgman, http://www.OurComments.org/. All rights reserved.
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 3, or (at
-// your option) any later version.
-//
-// This program is distributed in the hope that it will be useful, but
-// WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; see the file COPYING. If not, write to
-// the Free Software Foundation, Inc., 51 Franklin Street, Fifth
-// Floor, Boston, MA 02110-1301, USA.
-
-
-var HTML_WTOC_NS_sCurrTocId;
-
-
-HTML_WTOC_NS = {
-
- /////////////////////////////
- //// Basic event functions
- /////////////////////////////
-
- getEventObject : function (ev) {
- var o;
- if (window.event)
- o = window.event.srcElement;
- else if (null != ev)
- o = ( ev.target );
- return o;
- },
- getEvent : function (ev) {
- if (window.event) {
- return window.event;
- } else if (null != ev) {
- return ev;
- }
- },
-
- eventStopPropagation : function (e) {
- if (e.stopPropagation)
- e.stopPropagation();
- else
- e.cancelBubble=true;
- },
-
- eventPreventDefault : function (e) {
- if (e.preventDefault)
- e.preventDefault();
- else
- e.returnValue=false;
- },
-
- /////////////////////////////
- //// TOC hide
- /////////////////////////////
-
- show_content : function (on) {
- var toc = document.getElementById("html-wtoc-id-toccol").style;
- var tdv = document.getElementById("html-wtoc-id-tocdiv").style;
- var shw = document.getElementById("html-wtoc-id-showtoc").style;
- var hid = document.getElementById("html-wtoc-id-hidetoc").style;
- if (on) {
- toc.display = "";
- tdv.display = "";
- shw.display = "none";
- hid.display = "";
- HTML_WTOC_NS.focus_page_link(0);
- } else {
- toc.display = "none";
- tdv.display = "none";
- shw.display = "";
- hid.display = "none";
- }
- },
-
-
-
-
-
- /////////////////////////////
- //// Open-Close
- /////////////////////////////
- onblur_action : function(ev) {
- HTML_WTOC_NS_sCurrTocId = null;
- },
- onfocus_action : function(ev) {
- var o = HTML_WTOC_NS.getEventObject(ev);
- if (!o) return;
-
- HTML_WTOC_NS_sCurrTocId = o.id;
- },
- onclick_action : function(ev) {
- var o = HTML_WTOC_NS.getEventObject(ev);
- var e = HTML_WTOC_NS.getEvent(ev);
- if (13 == e.keyCode) return true;
- if (!o) return true;
- if ("IMG" == o.tagName) o = o.parentNode;
- var iId = HTML_WTOC_NS.getIdnumFromId(o.id);
- var sChildId = "toc_child_"+iId;
- var sOldCurrTocId = HTML_WTOC_NS_sCurrTocId;
- HTML_WTOC_NS.toggle_open(sChildId, o);
- HTML_WTOC_NS_sCurrTocId = sOldCurrTocId;
- return false;
- },
-
- toggle_open : function (id, parent) {
- var child = document.getElementById(id).style;
- var sInner = parent.innerHTML;
- var re = new RegExp("[^/]*\.gif", "i");
- if ("none" == child.display) {
- child.display = "";
- parent.innerHTML = sInner.replace(re, "down.gif")+"";
- } else {
- child.display = "none";
- parent.innerHTML = sInner.replace(re, "right.gif")+"";
- }
- },
-
-
-
- /////////////////////////////
- //// Load
- /////////////////////////////
-
- onload_actions : function (iPageNum) {
- document.body.onkeydown = HTML_WTOC_NS.onkeydown_action;
- document.body.onmouseover = HTML_WTOC_NS.onmouseover_action;
- var aATags = document.getElementsByTagName("a");
- for(var i = 0; i < aATags.length; i++) {
- var o = aATags[i];
- if (null != HTML_WTOC_NS.getIdnumFromId(o.id)) {
- o.onfocus = HTML_WTOC_NS.onfocus_action;
- o.onblur = HTML_WTOC_NS.onblur_action;
- if (o.id.substr(0, 12) == "opener_text_") {
- o.onclick = HTML_WTOC_NS.onclick_action;
- o.title = "Open/Close";
- } else if (o.id.substr(0, 7) == "opener_") {
- o.onclick = HTML_WTOC_NS.onclick_action;
- o.className = "html-wtoc-mark";
- o.title = "Open/Close";
- }
- }
- }
- HTML_WTOC_NS.focus_page_link(iPageNum);
- },
- focus_page_link : function (iPageNum) {
- // Element might be hidden
- try {
- document.getElementById("toc_link_"+iPageNum).focus();
- } catch (exc) {
- }
- },
-
-
-
-
-
-
-
- /////////////////////
- //// Mouse
- /////////////////////
-
- onmouseover_action : function (ev) {
- if (null == HTML_WTOC_NS_sCurrTocId) return true;
- var o = HTML_WTOC_NS.getEventObject(ev);
- var iId = HTML_WTOC_NS.getIdnumFromId(o.id);
- if (null == iId) return true;
- o.focus();
- },
-
-
-
- /////////////////////
- //// Key
- /////////////////////
-
- onkeydown_action: function (ev) {
- var keyDown = 40;
- var keyUp = 38;
- var keyLeft = 37;
- var keyRight = 39;
- var keyReturn = 13;
- var keyF2 = 113;
- var keyInsert = 45;
- // Opera
- var keyOperaDown = 57386;
- var keyOperaUp = 57385;
- var keyOperaLeft = 57387;
- var keyOperaRight = 57388;
- var keyOperaF2 = 57346;
- var keyOperaInsert = 57394;
-
- var SwitchKey = keyInsert;
- var SwitchKeyOpera = keyOperaInsert;
-
- var bUp;
- var e = HTML_WTOC_NS.getEvent(ev);
- if (null == HTML_WTOC_NS_sCurrTocId) {
- switch (e.keyCode) {
- case SwitchKey:
- case SwitchKeyOpera:
- HTML_WTOC_NS.focus_page_link(0);
- HTML_WTOC_NS.eventStopPropagation(e);
- HTML_WTOC_NS.eventPreventDefault(e);
- return false;
- }
- return true;
- }
- switch (e.keyCode) {
- case keyLeft:
- case keyOperaLeft:
- case keyRight:
- case keyOperaRight:
- HTML_WTOC_NS.handle_leftright_keys(e);
- HTML_WTOC_NS.eventStopPropagation(e);
- HTML_WTOC_NS.eventPreventDefault(e);
- return false;
- case keyDown:
- case keyOperaDown:
- bUp = false;
- break;
- case keyUp:
- case keyOperaUp:
- bUp = true;
- break;
- case SwitchKey:
- case SwitchKeyOpera:
- if (null != HTML_WTOC_NS_sCurrTocId) {
- var o = document.getElementById(HTML_WTOC_NS_sCurrTocId);
- if (o) o.blur();
- HTML_WTOC_NS_sCurrTocId = null;
- }
- HTML_WTOC_NS.eventStopPropagation(e);
- HTML_WTOC_NS.eventPreventDefault(e);
- return false;
- default:
- //alert(e.keyCode);
- return true;
- }
- var oOpener;
- oOpener = HTML_WTOC_NS.getNextVisOpener(HTML_WTOC_NS_sCurrTocId, bUp);
- oOpener.focus();
- HTML_WTOC_NS.eventStopPropagation(e);
- HTML_WTOC_NS.eventPreventDefault(e);
- return false;
- },
-
- handle_leftright_keys: function (e) {
- var keyLeft = 37;
- var keyRight = 39;
- var keyOperaLeft = 57387;
- var keyOperaRight = 57388;
- var iId = HTML_WTOC_NS.getIdnumFromId(HTML_WTOC_NS_sCurrTocId);
- if (null == iId) return;
- var sId = "opener_" + iId;
- var oOpener = document.getElementById(sId);
- var sId = HTML_WTOC_NS_sCurrTocId; // It will be cleared before getNextVis
-
- var bOpenAction;
- var bOpened;
- var bUp;
- var oChild = document.getElementById("toc_child_"+iId);
- if (null == oChild) {
- } else {
- bOpened = (oChild.style.display != "none");
- }
- switch (e.keyCode) {
- case keyLeft:
- case keyOperaLeft:
- bUp = true;
- bOpenAction = (null != bOpened) && (bOpened);
- break;
- case keyRight:
- case keyOperaRight:
- bUp = false;
- bOpenAction = (null != bOpened) && (!bOpened);
- break;
- default:
- alert("bad key handling...");
- }
- if (bOpenAction) {
- oOpener.click();
- HTML_WTOC_NS_sCurrTocId = sId;
- } else {
- var oPrev = HTML_WTOC_NS.getNextVisOpener(sId, bUp);
- oPrev.focus();
- }
- },
-
-
-
-
-
-
- //////////////////////
- //// Util
- //////////////////////
- getNameFromId: function (sId) {
- var re = new RegExp("(.*?_)(\\d+)", "i");
- if (!re.test(sId)) return null;
- var iId = sId.replace(re, "$1");
- return iId;
- },
- getIdnumFromId: function (sId) {
- var re = new RegExp("(.*?_)(\\d+)", "i");
- if (!re.test(sId)) return null;
- var iId = sId.replace(re, "$2");
- return iId;
- },
-
-
- getNextVisOpener: function (sId, bUp, bTrace) {
- if (bTrace) alert("getNextVisOpener("+sId+","+bUp+")");
- var iId = HTML_WTOC_NS.getIdnumFromId(sId);
- if (null == iId) {
- alert("getNextVisOpener err iId==null");
- return;
- }
- var sIdName = HTML_WTOC_NS.getNameFromId(sId);
- if (null == sIdName) {
- alert("getNextVisOpener err sIdName==null");
- return;
- }
- var oOpener;
- var iLoop = -2;
- while (oOpener == null) {
- if (bTrace) alert(iId);
- if (iLoop++ > iMaxChildNum) { alert("Child num error"); return; }
- if (!bUp) {
- iId++;
- } else {
- iId--;
- }
- if (iId > iMaxChildNum) { iId = 0; }
- if (iId < 0) { iId = iMaxChildNum; }
- var s = sIdName+iId;
- oOpener = document.getElementById(s);
- if (oOpener != null) {
- if (bTrace) alert(oOpener.offsetLeft);
- if (oOpener.style.display == "none") { // All
- oOpener = null;
- } else if (oOpener.offsetLeft < 0) { // IE
- oOpener = null;
- } else if (0 == oOpener.scrollWidth) { // Opera
- oOpener = null;
- }
- }
- }
- return oOpener;
- }
-
-
-
-}; //HTML_WTOC_NS
diff --git a/emacs.d/nxhtml/nxhtml/html-wtoc/html-wtoc.pl b/emacs.d/nxhtml/nxhtml/html-wtoc/html-wtoc.pl
deleted file mode 100644
index 56c0e21..0000000
--- a/emacs.d/nxhtml/nxhtml/html-wtoc/html-wtoc.pl
+++ /dev/null
@@ -1,1395 +0,0 @@
-#! perl
-
-# Copyright 2006, 2007 Lennart Borgman, http://OurComments.org/. All
-# rights reserved.
-#
-# This file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This file is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-
-use strict;
-use File::Copy;
-use File::Spec;
-#use File::Path qw();
-use File::Path;
-use File::Find qw();
-use FindBin;
-
-use lib "$FindBin::Bin/PerlLib";
-use PathSubs qw();
-use html_tags qw(
-*html header
-div
-table Tr td
-p hr br
-a span img b
-);
-
-### Script start parameters
-my $m_param_action;
-my $m_param_files = 1;
-my $m_param_pnum = 0;
-my $m_param_single = 0;
-my $m_param_Template;
-my $m_param_InPages;
-my $m_param_OutRoot;
-my @m_param_InRoot;
-my $m_param_Overwrite;
-
-### Globals
-my $m_iAlwaysOpenedLevel = 0;
-my $m_sCommonIn;
-my $m_sInPagesFolder;
-my $m_sTemplateFolder;
-my $m_sStartTemplate;
-my $m_sBodyTemplate;
-#my $m_sEndTemplate;
-my $m_bBorders = 0;
-my @pages;
-my %page_num;
-my %js_show_page;
-my $m_TemplateTime;
-my $m_InPagesTime;
-my %m_linked_files;
-
-sub get_params();
-sub get_template();
-sub read_page_list($);
-sub find_pages($$);
-sub write_pages();
-sub send_page();
-sub find_template_files();
-sub find_linked_from_pages();
-sub copy_wtoc_files();
-sub copy_linked_files();
-
-#push @pages, [$ind, $tit, $full_fil, $anc, $hrf, $trg, $tip];
-sub IND { 0 }
-sub TIT { 1 }
-sub FULL_FIL { 2 }
-sub ANC { 3 }
-sub HRF { 4 }
-sub TRG { 5 }
-sub TIP { 6 }
-
-##########################################################
-### Main
-##########################################################
-print "\n";
-get_params();
-if ($m_param_action eq "FIND") {
- find_pages(\@m_param_InRoot, $m_param_InPages);
-} elsif($m_param_action eq "MERGE") {
- get_template();
- read_page_list($m_param_InPages);
- find_template_files();
- copy_wtoc_files();
- if ($m_param_files) {
- write_pages();
- } else {
- send_page();
- }
- find_linked_from_pages();
- copy_linked_files();
-} elsif($m_param_action eq "TOC") {
-}
-exit;
-
-sub copy_if_newer_or_overwrite($$) {
- my $in_file = shift;
- my $out = shift;
- my $out_file = $out;
- if (-d $out) {
- my ($in_v, $in_d, $in_f) = File::Spec->splitpath( $in_file );
- my ($out_v,$out_d,$out_f) = File::Spec->splitpath( $out, 1 );
- $out_file = File::Spec->catpath( $out_v, $out_d, $in_f );
- }
- my $should_write = 1;
- if (-e $out_file) {
- if ($m_param_Overwrite) {
- my $in_mdt = (stat $in_file)[9];
- my $outmdt = (stat $out_file)[9];
- if (($outmdt > $in_mdt)) {
- $should_write = 0;
- }
- } else {
- $should_write = 0;
- }
- }
- if ($should_write) {
- if (!File::Copy::syscopy($in_file, $out_file)) {
- die "syscopy($in_file, $out_file): $!";
- } else {
- print " $in_file => $out_file\n";
- }
- }
-} # copy_if_newer_or_overwrite
-
-sub copy_wtoc_files() {
- print "\n**** Copy html-wtoc files\n";
- mkdir $m_param_OutRoot, 0777;
- my $css_file = $FindBin::Bin . "/html-wtoc.css";
- copy_if_newer_or_overwrite($css_file, $m_param_OutRoot);
- my $js_file = $FindBin::Bin . "/html-wtoc.js";
- copy_if_newer_or_overwrite($js_file, $m_param_OutRoot);
- my $OutRootImg = $m_param_OutRoot . "img/";
- mkpath($OutRootImg);
- my $imgsrc = $FindBin::Bin . "/img/";
- opendir(IMGDIR, $imgsrc) or die "Can't opendir $imgsrc: $!";
- while (my $imgfile = readdir(IMGDIR)) {
- my $outimg = $OutRootImg . $imgfile;
- $imgfile = $imgsrc . $imgfile;
- #print STDERR ">>>$imgfile\n";
- if (-f $imgfile) {
- copy_if_newer_or_overwrite($imgfile, $outimg);
- }
- }
- closedir(IMGDIR);
-} # copy_wtoc_files
-
-sub add_to_linked_files($$) {
- my $from_file = shift;
- my $to_file = shift;
- if (exists $m_linked_files{$to_file}) {
- my $old_from = $m_linked_files{$to_file};
- unless ($old_from eq $from_file) {
- die "Both $from_file and $old_from should be copied to $to_file";
- }
- }
- $m_linked_files{$to_file} = $from_file;
-} # add_to_linked_files
-
-sub copy_linked_files() {
- print "\n**** Copy linked files\n";
- my %pages;
- for my $pnum (0..$#pages) {
- $pages{ full_in_name($pnum) } = 1;
- }
- for my $to_file (keys %m_linked_files) {
- my $from_file = $m_linked_files{$to_file};
- unless (exists $pages{$from_file}) {
- if (-e $from_file) {
- mkpath4file($to_file);
- copy_if_newer_or_overwrite($from_file, $to_file);
- }
- }
- }
-} # copy_linked_files
-
-sub find_linked_files($;$) {
- my $in_file = shift;
- my $out_file = shift;
- $out_file = in2out($in_file) unless ($out_file);
- my $whole = get_file($in_file);
- while ($whole =~ m!(?:\s|^)(?:href|src)="(.*?)"!gis) {
- my $l = $1;
- next unless $l =~ m!\.(?:css|js|jpg|jpeg|gif|png)$!;
- if (!File::Spec->file_name_is_absolute($l)) {
- next if $l =~ m!^javascript:!;
- next if $l =~ m!^http://!;
- next if $l =~ m!^ftp://!;
- next if $l =~ m!^mailto:!;
- }
- my $rel_l = $l;
- my $full_in = $l;
- if (File::Spec->file_name_is_absolute($l)) {
- $rel_l = PathSubs::mk_relative_link($in_file, $l);
- } else {
- $full_in = PathSubs::mk_absolute_link($in_file, $l);
- }
- my $full_out = PathSubs::mk_absolute_link($out_file, $rel_l);
- add_to_linked_files($full_in, $full_out);
- }
-} # find_linked_files
-
-sub find_template_files() {
- print "\n**** Find files referenced in template file\n";
- my $in_file = $m_param_Template;
- my $out_file = $m_param_OutRoot . "dummy.htm";
- find_linked_files($in_file, $out_file);
-}
-sub find_linked_from_pages() {
- for my $pnum (0..$#pages) {
- next unless defined $pages[$pnum][FULL_FIL];
- next unless $pages[$pnum][FULL_FIL] ne "";
- next if defined $pages[$pnum][TRG];
- find_linked_files( full_in_name($pnum) );
- }
-}
-
-sub should_write_merged($$) {
- my $pnum = shift;
- my $out_file = shift;
- my $should_write = 1;
- if (-e $out_file) {
- if ($m_param_Overwrite) {
- my $srcmdt = page_src_time($pnum);
- my $outmdt = (stat $out_file)[9];
- if (($outmdt > $srcmdt)
- && ($outmdt > $m_TemplateTime)
- && ($outmdt > $m_InPagesTime)) {
- $should_write = 0;
- }
- } else {
- $should_write = 0;
- }
- }
- return $should_write;
-}
-sub write_pages() {
- #print STDERR "*** param_OutRoot=$m_param_OutRoot\n";
- if ($m_param_single) {
- my $out_file = $m_param_OutRoot . "single_$m_param_pnum.html";
- if (should_write_merged($m_param_pnum, $out_file)) {
- my $page = create_single_page($m_param_pnum);
- $page = shrink($page);
- create_file_and_path($out_file, $page);
- }
- } else {
- my $iPages = 0;
- print "\n*** Creating pages:\n";
- for my $pnum (0..$#pages) {
- next unless defined $pages[$pnum][FULL_FIL];
- next unless $pages[$pnum][FULL_FIL] ne "";
- next if defined $pages[$pnum][TRG];
- $iPages++;
- my $out_file = full_out_name($pnum);
- if (should_write_merged($pnum, $out_file)) {
- my $page = create_page($pnum);
- next unless $page;
- print " Creating page $iPages: " . full_in_name($pnum) . "\n";
- $page = shrink($page);
- print "\t=> $out_file\n";
- create_file_and_path($out_file, $page);
- }
- }
- }
-} # write_pages
-
-sub send_page() {
- my $page = ($m_param_single ?
- create_single_page($m_param_pnum)
- :
- create_page($m_param_pnum) );
- print $page;
-} # send_page
-
-##########################################################
-### Params
-##########################################################
-sub die_usage() {
- my $sScript = $0;
- $sScript =~ tr!\\!/!;
- $sScript =~ s!.*/(.*)!$1!;
- die qq(Usage:
- Making preliminary file list:
- $sScript find in="in-dir" pages="pages-file" [overwrite=1]
-
- Merging pages and table of contents:
- $sScript merge pages="pages-file" outroot="out-dir" template="template-file" [overwrite=1]
-
- \n);
-}
-#use Getopt::Long;
-sub get_params() {
- $| = 1;
- for my $arg (@ARGV) { print " "; print $arg; } print "\n\n";
- die_usage() unless $#ARGV > 0;
- $m_param_action = $ARGV[0];
- $m_param_action =~ tr/a-z/A-Z/;
- #push @m_param_InRoot, $FindBin::Bin . "/doc/";
- #$m_param_OutRoot = $FindBin::Bin . "/tmp/";
- #$m_param_Template = $FindBin::Bin . "/doc/home_template.htm";
- #$m_param_InPages = $FindBin::Bin . "/doc/toc_pages.txt";
- for (my $i = 1; $i <= $#ARGV; $i++) {
- my ($k, $v) = ($ARGV[$i] =~ m!(.*?)=(.*)!);
- $v =~ tr!\\!/!;
- if ($k eq "in") {
- $v = PathSubs::uniq_file($v);
- $v .= "/" unless substr($v, -1) eq "/";
- push @m_param_InRoot, $v;
- } elsif( $k eq "outroot") {
- $v = PathSubs::uniq_dir($v);
- $v .= "/" unless substr($v, -1) eq "/";
- $m_param_OutRoot = $v;
- } elsif( $k eq "pages") {
- $v = PathSubs::uniq_file($v);
- $m_param_InPages = $v;
- } elsif( $k eq "template") {
- $v = PathSubs::uniq_file($v);
- $m_param_Template = $v;
- } elsif( $k eq "overwrite" ) {
- $m_param_Overwrite = $v;
- } elsif( $k eq "openedlevel" ) {
- $m_iAlwaysOpenedLevel = $v * 1;
- } else {
- die "Unknown parameter: $ARGV[$i]\n";
- }
- }
- if($m_param_action eq "FIND") {
- if ($#m_param_InRoot < 0) { die_usage(); }
- if (! defined $m_param_InPages) { die_usage(); }
- } elsif($m_param_action eq "MERGE") {
- if (! defined $m_param_InPages) { die_usage(); }
- if (! defined $m_param_OutRoot) { die_usage(); }
- if (! defined $m_param_Template) { die_usage(); }
- $m_sTemplateFolder = $m_param_Template;
- $m_sTemplateFolder =~ s![^/]*$!!;
- } else {
- die_usage();
- }
-
- $m_sInPagesFolder = $m_param_InPages;
- $m_sInPagesFolder =~ s![^/]*$!!;
- print "Parameters:\n";
- print " " . $m_param_action . "\n";
- print " pages=" . $m_param_InPages . "\n";
- print " outroot=" . $m_param_OutRoot . "\n";
- print " template=" . $m_param_Template . "\n";
- if (defined $m_param_Overwrite) {
- print " overwrite=" . $m_param_Overwrite . "\n";
- }
- #if ($#m_param_InRoot == -1) { push @m_param_InRoot,$m_sInPagesFolder; }
-}
-
-sub get_template() {
- my $sTemplate = get_file($m_param_Template, 1);
- $m_TemplateTime = (stat $m_param_Template)[9];
- $m_InPagesTime = (stat $m_param_InPages)[9];
- $sTemplate =~ s/<!--.*?-->//gs;
- if ( $sTemplate =~ m!(.*?<body.*?>)(.*)</body>!si ) {
- $m_sStartTemplate = $1;
- $m_sBodyTemplate = $2;
- #$m_sEndTemplate = $3;
- } else {
- die "Can't find body of template\n";
- }
-} # get_template
-
-sub read_page_list($) {
- my $sPagesFile = shift;
- my @in_files;
- open(P,$sPagesFile) or die "Can't open toc list file $sPagesFile: $!\n";
- while (my $sLine = <P>) {
- chomp $sLine;
- $sLine =~ s/^\s+|\s+$//g;
- next if $sLine eq "";
- next if substr($sLine, 0, 1) eq ";";
- #print STDERR "$sLine\n";
- my ($ind, $tit, $ref, $tip, $trg, $ico)
- = map { s/^\s+|\s+$//g; $_; } split("###", $sLine);
- #warn "trg=$trg\n" if defined $trg;
- my ($fil, $anc) = ("", "");
- my $hrf = "";
- my $full_fil = "";
- #$ref = "" unless defined $ref;
- #print STDERR "ref=$ref\n";
- if (defined $ref) {
- if (defined $trg) { undef $trg unless $trg ne ""; }
- if ((defined $trg) || ($ref =~ m/https?:/i)) {
- $hrf = $ref;
- } else {
- ($fil, $anc) = split('#', $ref);
- if ($ind >= 0) {
- if (File::Spec->file_name_is_absolute($fil)) {
- $full_fil = $fil;
- } else {
- $full_fil = PathSubs::uniq_file($m_sInPagesFolder . $fil);
- }
- }
- }
- }
- if ((!$tip) && ($full_fil ne "")) {
- $tip = get_title($full_fil);
- }
- push @pages, [$ind, $tit, $full_fil, $anc, $hrf, $trg, $tip];
- push @in_files, $full_fil if !defined $trg;
- }
- close P;
- $m_sCommonIn = get_common_root(\@in_files). "/";
-} # read_page_list
-
-
-
-sub get_common_root($) {
- my $psRoots = shift;
- my @sCommon;
- for my $s (@$psRoots) {
- my $full_s = PathSubs::uniq_file($s);
- my @full_s = split("/", $full_s);
- if ($#sCommon == -1) {
- @sCommon = @full_s;
- } else {
- my $iMax = $#sCommon; if ($#full_s < $iMax) { $iMax = $#full_s; }
- for (my $i = 0; $i <= $iMax; $i++) {
- if ($sCommon[$i] ne $full_s[$i]) {
- #print STDERR "$i: $sCommon[$i] != $full_s[$i]\n";
- @sCommon = @sCommon[0..$i-1];
- last;
- }
- }
- }
- }
- my $sCommon = join("/", @sCommon);
- return $sCommon;
-} # get_common_root
-
-
-sub find_pages($$) {
- my $pasInRoot = shift;
- my $sOutFile = shift;
- if (!$m_param_Overwrite) {
- die "Don't want to overwrite existing output file $sOutFile!\n" if -e $sOutFile;
- }
- my $root_level;
- my $sList;
- my $handle_file =
- sub {
- return unless m/.html?/i;
- return if -d $_;
- my $fname = PathSubs::uniq_file($_);
- die "Can't read $fname\n" unless -r $_;
- my $title = get_title($_);
- my $level = $fname =~ tr!/!!;
- $level -= $root_level;
- my $rel_fname = PathSubs::mk_relative_link($sOutFile, $fname);
- $sList .= "$level ### $title ### $rel_fname\n";
- };
- for my $sInRoot (@$pasInRoot) {
- $sInRoot = PathSubs::uniq_file($sInRoot);
- chop($sInRoot) if (substr($sInRoot, -1) eq "/");
- $root_level = $sInRoot =~ tr!/!!;
- File::Find::find($handle_file, $sInRoot);
- }
- create_file($sOutFile, $sList);
-} # find_pages
-
-
-##########################################################
-### File - page helpers
-##########################################################
-
-sub file_name($) {
- my $num = shift;
- return $pages[$num][FULL_FIL];
-}
-sub file_anchor($) {
- my $num = shift;
- return $pages[$num][ANC];
-}
-sub file_href($) {
- my $num = shift;
- #die $pages[$num][HRF] if defined $pages[$num][HRF];
- return $pages[$num][HRF];
-}
-sub file_target($) {
- my $num = shift;
- return $pages[$num][TRG];
-}
-sub file_title($) {
- my $num = shift;
- return $pages[$num][TIT];
-}
-sub file_tip($) {
- my $num = shift;
- return $pages[$num][TIP];
-}
-sub full_in_name($) {
- my $num = shift;
- my $name = file_name($num);
- return $name;
-}
-sub full_out_href($) {
- my $num = shift;
- my $anchor = file_anchor($num);
- my $full_href = full_out_name($num);
- warn "full_href is null" unless $full_href;
- if ((defined $anchor) && ($anchor ne "")) { $full_href .= "#" . $anchor; }
- return $full_href;
-}
-sub full_out_name($) {
- my $num = shift;
- my $in_name = file_name($num);
- return unless $in_name;
- my $anchor = file_anchor($num);
- #$m_param_OutRoot . $name;
- $anchor = "";
- my $name = substr($in_name, length($m_sCommonIn));
- if ($anchor) {
- my $base;
- my $ext;
- for (my $i = length($name);$i>0;$i--) {
- if (substr($name, $i, 1) eq ".") {
- $base = substr($name, 0, $i-1);
- $ext = substr($name, $i);
- $name = $base . "_sharp_" . $anchor . $ext;
- last;
- }
- }
- }
- $m_param_OutRoot . $name;
-}
-sub replace_name_link($) {
- my $page = shift;
- for my $k (keys %page_num) {
- my $num = $page_num{$k};
- my $href = ($m_param_single ? "javascript:ShowPage($num)" : file_name($num));
- $page =~ s!%%$k%%!$href!gs;
- }
- return $page;
-}
-
-##########################################################
-### File name helpers
-##########################################################
-sub in2out($) {
- my $in_name = shift;
- die "in2out: File name is not abs: $in_name" unless File::Spec->file_name_is_absolute($in_name);
- my $name = substr($in_name, length($m_sCommonIn));
- $m_param_OutRoot . $name;
-}
-
-##########################################################
-### File reading/writing
-##########################################################
-
-sub mkpath4file($) {
- my $file = shift;
- my $path = $file;
- $path =~ s|[^/]*$||;
- File::Path::mkpath($path);
-}
-sub create_file($$) {
- my ($out_file, $page) = @_;
- if (!$m_param_Overwrite) {
- if (-e $out_file) { die "Will not overwrite $out_file\n"; }
- }
- open(OUT, ">$out_file") or die "Can't create $out_file: $!";
- print OUT $page;
- close OUT;
- chmod 0111|((stat $out_file)[2]&07777), $out_file
-}
-sub create_file_and_path($$) {
- my ($out_file, $page) = @_;
- mkpath4file($out_file);
- create_file($out_file, $page);
-}
-
-
-sub get_file($$) {
- my ($file, $need) = @_;
- if (open(FL, $file)) {
- local $/;
- my $whole = <FL>;
- close FL;
- return $whole;
- } else {
- my $err = $!;
- die "Can't open $file: $err\n" if $need;
- return "";
- }
-}
-
-sub get_title($) {
- my $file = shift;
- open(H, $file) or die "Can't open and get title from $file: $!";
- while (my $line = <H>) {
- if ($line =~ m!<title>(.*?)</title>!i) { close H; return $1; }
- }
- close H;
-}
-
-
-
-##########################################################
-### Html parsing etc
-##########################################################
-
-sub get_head_from_file($) {
- my $fname = shift;
- my $err;
- my $head = get_head(get_file($fname, 1), \$err);
- die "\n\n$fname\n\t" . $err if defined $err;
- return $head;
-}
-# BUG: These actually requires parsing of the file, but it does not
-# seem very important:
-sub get_head($$) {
- my $html = shift;
- my $perr = shift;
- return "" unless $html;
- $html =~ s/<!--.*?-->//g;
- if ($html =~ m!<head.*?>(.*)</head>!is) {
- return $1;
- }
- $$perr = "Can't find <head>-tag in $html\n";
-}
-sub get_body($) {
- my $html = shift;
- return "" unless $html;
- $html =~ s/<!--.*?-->//gs;
- if ($html =~ m!<body[^>]*>(.*)</body>!is) {
- return $1;
- }
- die "Can't find <body>-tag in $html\n";
-}
-
-sub shrink($) {
- my $str = shift;
- my $out_str = "";
- my @str = split("\n", $str);
- my $in_pre = 0;
- for my $s (@str) {
- if ($s =~ m!<pre>!i) { $in_pre = 1; }
- if ($s =~ m!</pre>!i) { $in_pre = 0; }
- $s =~ s!^(\s*)!! unless $in_pre;
- $out_str .= $s . "\n";
- }
- return $out_str;
- $str =~ s!^(\s*)!!gm;
- $str;
-}
-
-
-##########################################################
-### Making what we see
-##########################################################
-
-sub mk_search() {
- return "" if ! $m_param_single;
- return qq[
- <a href="javascript:show_search()" xstyle="font-size: 8pt"
- title="Show Search Form"
- ><img src="img/search.gif" border="$m_bBorders" align="left"></a>
- <a href="javascript:show_search()" xstyle="font-size: 8pt"
- title="Show Search Form"
- class="html-wtoc-search"
- >Sök</a>
- ];
-}
-sub mk_main_table($$$$$) {
- my $left = shift;
- my $main = shift;
- my $srch_table = shift;
- my $sFile = shift;
- my $pNum = shift;
- my $search_tr = "";
- if ($m_param_single) {
- $search_tr =
- Tr(
- td("&nbsp;&nbsp;")
- . td({-valign=>'bottom', }, mk_search(), ) )
- }
- my $cont_table =
- table(
- { -border=>"$m_bBorders", -cellpadding=>0, -cellspacing=>0,
- -width=>"100%",
- -id=>"html-wtoc-contents",
- #-style=>"display:",
- -summary=>"Table of contents",
- },
- Tr(
- #td("&nbsp;&nbsp;")
- td({-class=>"html-wtoc-margin"})
- . td({-valign=>'top'}, $left) )
- . $search_tr
- )
- ;
- my $page = $m_sBodyTemplate;
- $page = replace_template_links($m_sBodyTemplate, $sFile);
- $page =~ s!%%TOC%%!$cont_table!;
- $page =~ s!%%PAGE%%!$main!;
- return $page;
-} # mk_main_table
-
-
-sub find_ind_level_prev($) {
- my $lThis = shift;
- for (my $i = $lThis - 1; $i > 0; $i--) {
- my $ind_lev = $pages[$i][IND];
- if ($ind_lev < 50) { return $ind_lev; }
- }
- return undef;
-}
-sub find_ind_level_next($) {
- my $lThis = shift;
- #print "find_ind_level_next($lThis)";
- #print ", ";
- #print file_title($lThis);
- #print "\n";
- #for (my $i = $lThis; $i < $#pages; $i++) {
- for (my $i = $lThis + 1; $i <= $#pages; $i++) {
- my $ind_lev = $pages[$i][IND];
- if ($ind_lev < 50) { return $ind_lev; }
- }
- return undef;
-}
-
-
-
-
-
-
-
-
-sub mk_opener_elem($$$) {
- my $iPi = shift;
- my $sHref = shift;
- my $bOpened = shift;
- my $Aattrib =
- {
- -id =>"opener_$iPi",
- };
- if ($sHref) { $$Aattrib{href} = $sHref; }
- my $sImg;
- my $sAlt;
- if ($bOpened) {
- $sImg = "down";
- $sAlt = "Close";
- } else {
- $sImg = "right";
- $sAlt = "Open";
- }
- return
- a(
- $Aattrib,
- img({
- -src=>"img/$sImg.gif",
- -alt=>$sAlt,
- -border=>0,
- -width=>12,
- -height=>12,
- },
- ),
- );
-} # mk_opener_elem
-
-sub mk_content($) {
- my $pnum = shift;
- if (!$pages[$pnum]) {
- return br();
- }
- my $cont;
- my @father;
- my @child_trace;
- my $this_indent = $pages[$pnum][IND];
- my $this_file = $pages[$pnum][FULL_FIL];
- if ($this_indent == -2) {
- return "";
- }
- my $this_href = full_out_name($pnum);
- #my $anchor = file_anchor($pnum);
- #if (defined $anchor) { $this_href .= "#" . $anchor; }
- my @size;
- $size[0] = "1em";
- $size[1] = "0.8em";
- $size[2] = "0.8em";
-
-
-
- ### Open all main level nodes
- my @opened; # rename to visible!!!!!
- for my $pi (0..$#pages) {
- my $indent = $pages[$pi][IND];
- if ($indent <= $m_iAlwaysOpenedLevel) {
- $opened[$pi] = 1;
- } else {
- $opened[$pi] = 0; # more simple to handle
- }
- }
-
-
-
- ### Open ancestors and older sisters (if not a standalone node)
- my $pnum_indent = $pages[$pnum][IND];
- my $high_open = $pnum_indent;
- my $standalone_open = 10;
- if ($high_open < $standalone_open) { ### Not a standalone node
- for (my $pi = $pnum; $pi >= 0; $pi--) {
- my $pi_indent = $pages[$pi][IND];
- if ($high_open >= $pi_indent) {
- $opened[$pi] = 1;
- $high_open = $pi_indent;
- for (my $ps = $pi+1; $ps <= $#pages; $ps++) {
- my $ps_indent = $pages[$ps][IND];
- last if $ps_indent < $pi_indent;
- $opened[$ps] = 1 if $ps_indent == $pi_indent;
- }
- }
- last if $pi_indent == 0;
- }
- }
-
-
-
-
- ### Open direct childs and younger sisters
- my $maybe_child = 1;
- my $more_sisters = 1;
- my $max_open_indent = $pnum_indent;
- for my $pi ($pnum+1..$#pages) {
- my $pi_indent = $pages[$pi][IND];
- if ($pi_indent <= $max_open_indent) { $maybe_child = 0; }
- if ($pi_indent < $pnum_indent) { $more_sisters = 0; }
- if ($pi_indent == $pnum_indent) {
- if ($more_sisters) { $opened[$pi] = 1; }
- $maybe_child = 0;
- } elsif ($pi_indent == $pnum_indent+1) {
- if ($maybe_child) { $opened[$pi] = 1; }
- }
- }
- #exit if $pnum == 3;
-
-
-
-
- ### Open all in the same file (necessary for non-JavaScript)
- for my $pi (0..$#pages) {
- my $file = $pages[$pi][FULL_FIL];
- #printf STDERR "file - open=(%s)\n", $file;
- #if ($file eq $this_file) {
- if ($file eq $this_file) {
- $opened[$pi] = 1;
- }
- if ($file eq "") {
- if ($pi < $#pages) {
- if ($pages[$pi][IND] < $pages[$pi+1][IND]) {
- $opened[$pi+1] = 1;
- }
- }
- }
- if ($pages[$pi][IND] > 10) {
- $opened[$pi] = 0;
- #print ">>>>>>>>\$opened[$pi] = 0;\n";
- }
- #print STDERR "+++++++++\$opened[$pi] = $opened[$pi]\n";
- }
-
-
-
-
- ### Make the actual contents
- my $tooltip;
- my $child_id;
- for my $pi (0..$#pages) {
-# if (!$pages[$pi][FULL_FIL] && !$pages[$pi][HRF]) {
-# my $txt = file_title($pi); #$pages[$pi][TIT];
-# $txt = qq(</p><hr width="50%" align="left" /><p style='margin-top:0'>) if $txt eq "-";
-# $cont .= $txt;
-# $cont .= br();
-# next;
-# }
- my $txt = file_title($pi); #$pages[$pi][TIT];
- if ($txt eq "-") {
- $txt = qq(</p><hr width="50%" align="left" /><p style='margin-top:0'>);
- $cont .= $txt;
- $cont .= br();
- next;
- }
- #if ($pages[$pi][TRG]) {
- # next;
- #}
- #next if ! defined $opened[$pi];
- #next if ! $opened[$pi];
- my $ind_lev = $pages[$pi][IND];
- next if $ind_lev > 50;
- my $ind_lev_next = find_ind_level_next($pi);
- #my $ind_lev_prev = find_ind_level_prev($pi);
-
- my $this_entry = "";
-
- ### Child id from previous row
- if (defined $child_id) {
- my $display = "";
- if (!$opened[$pi]) {
- $display = qq(style="display:none");
- } else {
- }
- $this_entry .= "\n<div id=\"$child_id\" $display>\n";
- undef $child_id;
- }
- my $opener_elem = ""; #qq(<img src="img/blank12.gif" width=12 height=12 alt=" ">);
- my $childs_are_visible = ($pi == $pnum);
- if ($pi < $#pages) {
- if ($pages[$pi][IND] < $pages[$pi+1][IND]) {
- if ($opened[$pi+1]) { $childs_are_visible = 1; }
- }
- }
- #if ($pages[$pi][IND] < $m_iAlwaysOpenedLevel) { $childs_are_visible = 1; }
-
- my $file_href;
- my $target;
- my $href;
- my $href_self;
- my $target_attrib;
- my $title = file_title($pi);
- my $file_name = file_name($pi);
- if ($title) {
- $file_href = file_href($pi); # || "";
- $target = file_target($pi);
- $href =
- ($file_name ?
- ($m_param_files ?
- ($m_param_single ? "JavaScript:ShowPage($pi);" :
- ($file_href ne ""? $file_href
- :
- PathSubs::mk_relative_link($this_href, full_out_href($pi))))
- :
- ($m_param_single ? "JavaScript:ShowPage($pi)" : "?pnum=$pi")
- )
- :
- (File::Spec->splitpath($this_href))[2]);
- if ($pi == $pnum) {
- $href_self = $this_href;
- if ($href_self =~ m!([^/\\]*$)!) {
- $href_self = $1;
- }
- }
- $target_attrib = (defined $target? qq(target="$target"): "");
- } else {
- $href = "";
- $target_attrib = "";
- }
-
- if (defined $ind_lev_next && $ind_lev_next > $ind_lev) {
- $child_id = "toc_child_$pi";
- #print " child_id=$child_id\n";
- push @child_trace, $child_id;
- $opener_elem = mk_opener_elem($pi,
- ($href? $href : $href_self),
- $childs_are_visible);
- }
- $title =~ s/_/&nbsp;/go;
- my $indent = ($ind_lev ? "&nbsp;" x (($ind_lev-1) * 4) : "");
- my $size = $size[$ind_lev];
- $title = b($title) if $ind_lev == 0;
-
- my $Aattrib =
- {
- id=>"toc_link_$pi",
- onclick=>"html_wtoc_nailing(this)",
- };
- if (!$file_name) {
- $Aattrib =
- {
- id=>"opener_text_$pi",
- };
- }
- if ($pi == $pnum) {
- ### Current page
- $$Aattrib{class} = "html-wtoc-currcont";
- $$Aattrib{title} = "You are here";
- $$Aattrib{href} = $href_self;
- $this_entry .=
- table({
- -cellspacing=>0,
- -cellpadding=>0,
- -class=>"html-wtoc-contline",
- -border=>0,
- -summary=>"Formatter",
- },
- Tr({
- },
- td({
- },
- a(
- $Aattrib,
- $indent . $title . "&nbsp;"
- )
- )
- . td({
- -class=>"html-wtoc-mark",
- },
- $opener_elem
- )
- )
- );
-
-
-
-
- } else {
- ### Link to other page
- if (file_title($pi)) {
- $tooltip = $pages[$pi][TIP];
- if (!defined $tooltip) { $tooltip = "Go to the page $title"; }
- $$Aattrib{class} = "html-wtoc-contents-a";
- my $a_or_span;
- if (!defined $href) {
- $a_or_span = span($Aattrib, $indent . $title);
- } else {
- $$Aattrib{title} = $tooltip;
- $$Aattrib{href} = $href;
- if (defined $target) { $$Aattrib{target} = $target; }
- $a_or_span = a($Aattrib, $indent . $title);
- }
- $this_entry .=
- table({
- -cellspacing=>0,
- -cellpadding=>0,
- -class=>"html-wtoc-contline",
- -border=>0,
- -summary=>"Formatter",
- },
- Tr({
- },
- td({
- },
- $a_or_span
- )
- . td({
- -class=>"html-wtoc-mark",
- },
- $opener_elem
- )
- )
- );
- } else {
- $this_entry .= $indent . " " . $title;
- #die $this_entry;
- }
- }
- if ((!defined $ind_lev_next) || $ind_lev_next <= $ind_lev) {
- my $ind_end = $ind_lev;
- if (defined $ind_lev_next) { $ind_end = $ind_lev_next+1; }
- for (my $i = $ind_end; $i <= $ind_lev; $i++) {
- my $end_id = pop @child_trace;
- if (defined $end_id) {
- $this_entry .= "</div><!-- end child $end_id -->"; # end childs' span
- #print " end $end_id\n";
- }
- }
- }
- $cont .= $this_entry;
- $father[$ind_lev] = $pi;
- } #for my $pi (0..$#pages)
-
- $cont = div({-class=>"html-wtoc-contents"}, $cont) . p("&nbsp;");
- #$cont =~ s|<|\n<|gms;
- #$cont =~ tr!\n\r! !;
- $cont =~ s{
- (\ssrc=)"(.*?)"
- }
- {
- my $s1 = $1;
- my $src = $2;
- if (!PathSubs::is_abs_path($src)) {
- my $srcabs = PathSubs::mk_absolute_link(full_out_name(0), $src);
- $src = PathSubs::mk_relative_link(full_out_name($pnum), $srcabs);
- };
- "${s1}\"$src\"";
- }egsmx;
- $cont;
-} # mk_content
-
-sub mk_main_window($) {
- my $pnum = shift;
- my $full_name = full_in_name($pnum);
- return unless defined $full_name;
- return get_body(get_file($full_name, 1));
-}
-
-
-
-
-
-
-
-
-##########################################################
-### The JavaScripts and styles we need
-##########################################################
-
-sub mk_style($) {
- return "";
- my $pnum = shift;
- my $rel_link =
- PathSubs::mk_relative_link(full_out_name($pnum), $m_param_OutRoot . "html-wtoc.css");
- return qq(<link rel="stylesheet" href="$rel_link" type="text/css">\n);
-}
-sub mk_js($) {
- my $pnum = shift;
- return <<__HTML_END_JS_PNUM__;
- <script type="text/JavaScript">
- var iCurrentChild = $pnum;
- var iMaxChildNum = $#pages;
- </script>
-__HTML_END_JS_PNUM__
- return "";
- my $single_js = "";
- if ($m_param_single) {
- $single_js = qq[if (!document.all) { navigate("0.html"); }];
- my $page_info = "var page_name = new Array;\n";
- for my $i (0..$#pages) {
- my $page_name = file_title($i); #$pages[$i][TIT];
- $page_info .= qq[ page_name[$i] = "$page_name";\n];
- }
- $single_js .= $page_info;
- }
- my $sch_link =
- PathSubs::mk_relative_link(full_out_name($pnum), $m_param_OutRoot . "search.js");
- my $top_link =
- PathSubs::mk_relative_link(full_out_name($pnum), $m_param_OutRoot . "html-wtoc.js");
- return <<__HTML_END_JS__;
- <script type="text/JavaScript" src="$sch_link"></script>
- <script type="text/JavaScript" src="$top_link"></script>
- <script type="text/JavaScript">
- $single_js
- </script>
-__HTML_END_JS__
-}
-
-##########################################################
-### Page creation
-##########################################################
-
-sub replace_template_links($$) {
- my $template = shift;
- my $sFile = shift;
- $template =~ s{\ssrc="(.*?)"}
- {
- my $sSrc = $m_param_OutRoot . $1;
- my $sRelSrc = PathSubs::mk_relative_link($sFile, $sSrc);
- qq( src="$sRelSrc");
- }exg;
- $template =~ s{\shref="(.*?)"}
- {
- my $sOld = $1;
- if ((lc substr($sOld, 0, 11)) eq "javascript:") {
- qq( href="$sOld");
- } elsif (PathSubs::is_abs_netpath($sOld)) {
- qq( href="$sOld");
- } else {
- my $sSrc = $m_param_OutRoot . $sOld;
- my $sRelSrc = PathSubs::mk_relative_link($sFile, $sSrc);
- qq( href="$sRelSrc");
- }
- }exg;
- return $template;
-} # replace_template_links
-
-sub mk_start_of_page($) {
- my $pnum = shift;
- my $page = "";
- my $page_style = mk_style($pnum);
- my $page_js = mk_js($pnum);
- my $sFile = full_out_name($pnum);
- my $head = "";
- $head .= $page_js;
- $head .= $page_style;
- $head .= get_head_from_file(full_in_name($pnum));
- $page .= header if !$m_param_files;
- $page .= replace_template_links($m_sStartTemplate, $sFile);
- $page =~ s!<title>HEAD</title>!$head!;
- my $focus_pnum = $pnum;
- my $ind_lev = $pages[$pnum][IND];
- if ($ind_lev > 50) { $focus_pnum = 0; }
- $page =~ s!%%PNUM%%!$focus_pnum!;
- return $page;
-} # mk_start_of_page
-
-my %m_sCreatedPages;
-sub page_src_time($) {
- my $pnum = shift;
- my $src_file = $pages[$pnum][FULL_FIL];
- return (stat $src_file)[9];
-}
-sub create_page($) {
- my $pnum = shift;
- return unless $pages[$pnum][FULL_FIL];
-
- my $out_name = full_out_name($pnum);
- return if exists $m_sCreatedPages{$out_name};
- $m_sCreatedPages{$out_name} = 1;
-
- my $page = mk_start_of_page($pnum);
- my $cont_win = mk_content($pnum);
- my $main_win = mk_main_window($pnum);
- $page .= mk_main_table(
- $cont_win,
- $main_win,
- "",
- $out_name,
- $pnum,
- );
- $page .= end_html;
- $page = replace_name_link($page);
- return $page;
-} # create_page
-
-
-__END__
-
-
- ##########################################################
- ### Unused currently
- ##########################################################
-
- sub build_ShowPage() {
- for my $num (0..$#pages) {
- $page_num{$pages[$num][FULL_FIL]} = $num;
- my $fon = full_out_name($num);
- if ($fon) { $js_show_page{$fon} = "ShowPage($num);"; }
- }
-}
-build_ShowPage();
-
-
-sub mk_meta_enter_exit() {
- return <<__HTML_EE__;
- <meta HTTP-EQUIV="Page-Enter" content="RevealTrans (Duration=0.1, Transition=31)">
- <meta HTTP-EQUIV="Page-Exit" content="RevealTrans (Duration=1, Transition=23)">
-__HTML_EE__
-}
-
-##########################################################
-### Single page
-##########################################################
-
-sub mk_noscript() {
- return <<__HTML_END_NOSCRIPT__;
- <noScript>
- Sorry, there is not yet any version for non-JavaScript browsers.
- You need to enable JavaScript to see the rest of the pages!
-__HTML_END_NOSCRIPT__
-}
-
-sub create_single_page($) {
- my $pnum = shift;
-
- my $page = mk_start_of_page($pnum);
- my $left_col = "";
- my $main = "";
- for my $pi (0..$#pages) {
- next unless $pages[$pi][FULL_FIL];
- my $display = ($pi == $pnum ? 'style="display: block"' : 'Style="display: none"');
- my $pi_left_col = replace_rel_link(mk_content($pi), full_out_name($pi));
- my $pi_main = replace_rel_link(mk_main_window($pi), full_out_name($pi));
- my $pi_margin = "";
- $left_col .= "\n<div id='left_col_$pi' $display>" . $pi_left_col . "</div>\n";
- $main .= "\n<div id='main_$pi' $display>" . $pi_main . "</div>\n";
- }
- my $search_table = qq[
- <table border="0" width="100%" height="200"
- cellpadding="0" cellspacing="0"
- xbgcolor="yellow"
- class="html-wtoc-search"
- id="search" style="display:none">
- <tr>
- <td>&nbsp;&nbsp;</td>
- <td align="left" valign="top" height="1">
- <form onsubmit="return do_search(input.value);"
- class="html-wtoc-search-form"
- >
- <input id="input" size="14"
- ><input type="image" name="Search" value="Search"
- title="Search"
- src="img/search.gif"
- align="top"
- >
- </td>
- </form>
- </tr>
- <tr valign="top">
- <td>&nbsp;&nbsp;</td>
- <td id="hits" valign="top">
- </td>
- </tr>
- <tr>
- <td>&nbsp;&nbsp;</td>
- <td valign="bottom">
-
- <a href="javascript:hide_search()" xstyle="font-size: 8pt"
- title="Show Menu"
- ><img src="img/nosearch.gif" border=0 align="left"></a>
- <a href="javascript:hide_search()"
- title="Show Menu"
- >Göm sökning</a>
- </td>
- </tr>
- </table>
- ];
- $page .= mk_main_table(
- $left_col,
- $main,
- $search_table,
- full_out_name($pnum),
- $pnum,
- );
- $page .= mk_noscript();
- $page .= end_html;
- $page =~ s/(\d+)\.html/javascript:ShowPage($1);/gs;
- #$page =~ s/<body(.*?)>/<body$1 onload="ShowPage(0)">/gis;
- $page =~ s/<body(.*?)>/<body$1 onload="HTML_WTOC_NS.onload_actions()">/gis;
- $page = replace_name_link($page);
- return $page;
-} # create_single_page
-
-my $abs_pos_tbl =
- qq(
- <table border="$m_bBorders" cellpadding=0 cellspacing=0
- width="100%" height=70
- bgcolor="white"
- style="
- position: absolute;
- left: 0;
- top: 0;
- "
- >
- <tr>
- <td>
- </td>
- </tr>
- </table>
- );
-
-
-##########################################################
-### Index.htm
-##########################################################
-
-# sub mk_index_page($) {
-# my $page = shift;
-# my $check_browser = qq[ //if (document.all) { navigate("single_0.html"); }\n];
-# #$page =~ s/(<script.*?>)/$1\n$check_browser/s;
-# mkdir $m_param_OutRoot, 0777;
-# my $out_file = $m_param_OutRoot . "index.htm";
-# create_file_and_path($out_file, $page);
-# }
-
-
-
-
-##########################################################
-### Links handling
-##########################################################
-
-
-sub replace_rel_link($$) {
- my ($page, $page_file) = @_;
- my $qr;
- $page =~
- s{
- (src|href)="(.*?)"
- }{
- my $src_href = $1;
- my $href = $2;
- if (!PathSubs::is_abs_path($href)) {
- $href = PathSubs::mk_absolute_link($page_file, $href);
- $href =~ tr|\\|/|;
- if (exists $js_show_page{$href}) {
- $href = "javascript:$js_show_page{$href}";
- }
- }
- qq($src_href="$href");
- }xegsm;
-
- $page;
-}
-
diff --git a/emacs.d/nxhtml/nxhtml/html-wtoc/img/blank12.gif b/emacs.d/nxhtml/nxhtml/html-wtoc/img/blank12.gif
deleted file mode 100644
index 0869f9f..0000000
--- a/emacs.d/nxhtml/nxhtml/html-wtoc/img/blank12.gif
+++ /dev/null
Binary files differ
diff --git a/emacs.d/nxhtml/nxhtml/html-wtoc/img/down.gif b/emacs.d/nxhtml/nxhtml/html-wtoc/img/down.gif
deleted file mode 100644
index 30d6ecf..0000000
--- a/emacs.d/nxhtml/nxhtml/html-wtoc/img/down.gif
+++ /dev/null
Binary files differ
diff --git a/emacs.d/nxhtml/nxhtml/html-wtoc/img/freeCont.gif b/emacs.d/nxhtml/nxhtml/html-wtoc/img/freeCont.gif
deleted file mode 100644
index 1c94b60..0000000
--- a/emacs.d/nxhtml/nxhtml/html-wtoc/img/freeCont.gif
+++ /dev/null
Binary files differ
diff --git a/emacs.d/nxhtml/nxhtml/html-wtoc/img/gnu-m-x-160.png b/emacs.d/nxhtml/nxhtml/html-wtoc/img/gnu-m-x-160.png
deleted file mode 100644
index 5254ef1..0000000
--- a/emacs.d/nxhtml/nxhtml/html-wtoc/img/gnu-m-x-160.png
+++ /dev/null
Binary files differ
diff --git a/emacs.d/nxhtml/nxhtml/html-wtoc/img/gnu-m-x-160.xcf b/emacs.d/nxhtml/nxhtml/html-wtoc/img/gnu-m-x-160.xcf
deleted file mode 100644
index f2ce5ce..0000000
--- a/emacs.d/nxhtml/nxhtml/html-wtoc/img/gnu-m-x-160.xcf
+++ /dev/null
Binary files differ
diff --git a/emacs.d/nxhtml/nxhtml/html-wtoc/img/hideCont.gif b/emacs.d/nxhtml/nxhtml/html-wtoc/img/hideCont.gif
deleted file mode 100644
index 9908895..0000000
--- a/emacs.d/nxhtml/nxhtml/html-wtoc/img/hideCont.gif
+++ /dev/null
Binary files differ
diff --git a/emacs.d/nxhtml/nxhtml/html-wtoc/img/nailCont.gif b/emacs.d/nxhtml/nxhtml/html-wtoc/img/nailCont.gif
deleted file mode 100644
index 4c1bca4..0000000
--- a/emacs.d/nxhtml/nxhtml/html-wtoc/img/nailCont.gif
+++ /dev/null
Binary files differ
diff --git a/emacs.d/nxhtml/nxhtml/html-wtoc/img/nosearch.gif b/emacs.d/nxhtml/nxhtml/html-wtoc/img/nosearch.gif
deleted file mode 100644
index e824f5b..0000000
--- a/emacs.d/nxhtml/nxhtml/html-wtoc/img/nosearch.gif
+++ /dev/null
Binary files differ
diff --git a/emacs.d/nxhtml/nxhtml/html-wtoc/img/other/CompFaceLogoTemp4.gif b/emacs.d/nxhtml/nxhtml/html-wtoc/img/other/CompFaceLogoTemp4.gif
deleted file mode 100644
index 40b7220..0000000
--- a/emacs.d/nxhtml/nxhtml/html-wtoc/img/other/CompFaceLogoTemp4.gif
+++ /dev/null
Binary files differ
diff --git a/emacs.d/nxhtml/nxhtml/html-wtoc/img/other/CompFaceLogoTemp4.png b/emacs.d/nxhtml/nxhtml/html-wtoc/img/other/CompFaceLogoTemp4.png
deleted file mode 100644
index ad6505e..0000000
--- a/emacs.d/nxhtml/nxhtml/html-wtoc/img/other/CompFaceLogoTemp4.png
+++ /dev/null
Binary files differ
diff --git a/emacs.d/nxhtml/nxhtml/html-wtoc/img/other/blue_left_top.png b/emacs.d/nxhtml/nxhtml/html-wtoc/img/other/blue_left_top.png
deleted file mode 100644
index e7da402..0000000
--- a/emacs.d/nxhtml/nxhtml/html-wtoc/img/other/blue_left_top.png
+++ /dev/null
Binary files differ
diff --git a/emacs.d/nxhtml/nxhtml/html-wtoc/img/other/close-cross.gif b/emacs.d/nxhtml/nxhtml/html-wtoc/img/other/close-cross.gif
deleted file mode 100644
index e5cb142..0000000
--- a/emacs.d/nxhtml/nxhtml/html-wtoc/img/other/close-cross.gif
+++ /dev/null
Binary files differ
diff --git a/emacs.d/nxhtml/nxhtml/html-wtoc/img/other/lbiinfo_and_blue.png b/emacs.d/nxhtml/nxhtml/html-wtoc/img/other/lbiinfo_and_blue.png
deleted file mode 100644
index d524ff1..0000000
--- a/emacs.d/nxhtml/nxhtml/html-wtoc/img/other/lbiinfo_and_blue.png
+++ /dev/null
Binary files differ
diff --git a/emacs.d/nxhtml/nxhtml/html-wtoc/img/other/lbiinfo_and_blue1.png b/emacs.d/nxhtml/nxhtml/html-wtoc/img/other/lbiinfo_and_blue1.png
deleted file mode 100644
index d111473..0000000
--- a/emacs.d/nxhtml/nxhtml/html-wtoc/img/other/lbiinfo_and_blue1.png
+++ /dev/null
Binary files differ
diff --git a/emacs.d/nxhtml/nxhtml/html-wtoc/img/other/lbinfo_col1.gif b/emacs.d/nxhtml/nxhtml/html-wtoc/img/other/lbinfo_col1.gif
deleted file mode 100644
index d3777ae..0000000
--- a/emacs.d/nxhtml/nxhtml/html-wtoc/img/other/lbinfo_col1.gif
+++ /dev/null
Binary files differ
diff --git a/emacs.d/nxhtml/nxhtml/html-wtoc/img/other/lbinfo_col1_30.gif b/emacs.d/nxhtml/nxhtml/html-wtoc/img/other/lbinfo_col1_30.gif
deleted file mode 100644
index 1df04d4..0000000
--- a/emacs.d/nxhtml/nxhtml/html-wtoc/img/other/lbinfo_col1_30.gif
+++ /dev/null
Binary files differ
diff --git a/emacs.d/nxhtml/nxhtml/html-wtoc/img/other/up.gif b/emacs.d/nxhtml/nxhtml/html-wtoc/img/other/up.gif
deleted file mode 100644
index c4795d9..0000000
--- a/emacs.d/nxhtml/nxhtml/html-wtoc/img/other/up.gif
+++ /dev/null
Binary files differ
diff --git a/emacs.d/nxhtml/nxhtml/html-wtoc/img/right.gif b/emacs.d/nxhtml/nxhtml/html-wtoc/img/right.gif
deleted file mode 100644
index 2400cf1..0000000
--- a/emacs.d/nxhtml/nxhtml/html-wtoc/img/right.gif
+++ /dev/null
Binary files differ
diff --git a/emacs.d/nxhtml/nxhtml/html-wtoc/img/search.gif b/emacs.d/nxhtml/nxhtml/html-wtoc/img/search.gif
deleted file mode 100644
index 9f58dfd..0000000
--- a/emacs.d/nxhtml/nxhtml/html-wtoc/img/search.gif
+++ /dev/null
Binary files differ
diff --git a/emacs.d/nxhtml/nxhtml/html-wtoc/img/showCont.gif b/emacs.d/nxhtml/nxhtml/html-wtoc/img/showCont.gif
deleted file mode 100644
index 7bd2e7d..0000000
--- a/emacs.d/nxhtml/nxhtml/html-wtoc/img/showCont.gif
+++ /dev/null
Binary files differ