]> git.wh0rd.org - tt-rss.git/commitdiff
move some aux files to lib/
authorAndrew Dolgov <fox@bah.org.ru>
Mon, 21 Dec 2009 18:28:18 +0000 (21:28 +0300)
committerAndrew Dolgov <fox@bah.org.ru>
Mon, 21 Dec 2009 18:28:18 +0000 (21:28 +0300)
accept-to-gettext.php [deleted file]
functions.php
lib/accept-to-gettext.php [new file with mode: 0644]
lib/pngfix.js [new file with mode: 0644]
lib/xsl_mop-up.js [new file with mode: 0644]
login.php
login_form.php
pngfix.js [deleted file]
rss.xsl
xsl_mop-up.js [deleted file]

diff --git a/accept-to-gettext.php b/accept-to-gettext.php
deleted file mode 100644 (file)
index 6f366d0..0000000
+++ /dev/null
@@ -1,184 +0,0 @@
-<?php
-/*
- * accept-to-gettext.inc -- convert information in 'Accept-*' headers to
- * gettext language identifiers.
- * Copyright (c) 2003, Wouter Verhelst <wouter@debian.org>
- * 
- * 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 2 of the License, 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; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- * Usage:
- *
- *  $locale=al2gt(<array of supported languages/charsets in gettext syntax>,
- *                <MIME type of document>);
- *  setlocale('LC_ALL', $locale); // or 'LC_MESSAGES', or whatever...
- *
- * Example:
- *
- *  $langs=array('nl_BE.ISO-8859-15','nl_BE.UTF-8','en_US.UTF-8','en_GB.UTF-8');
- *  $locale=al2gt($langs, 'text/html');
- *  setlocale('LC_ALL', $locale);
- *
- * Note that this will send out header information (to be
- * RFC2616-compliant), so it must be called before anything is sent to
- * the user.
- * 
- * Assumptions made:
- * * Charset encodings are written the same way as the Accept-Charset
- *   HTTP header specifies them (RFC2616), except that they're parsed
- *   case-insensitive.
- * * Country codes and language codes are the same in both gettext and
- *   the Accept-Language syntax (except for the case differences, which
- *   are dealt with easily). If not, some input may be ignored.
- * * The provided gettext-strings are fully qualified; i.e., no "en_US";
- *   always "en_US.ISO-8859-15" or "en_US.UTF-8", or whichever has been
- *   used. "en.ISO-8859-15" is OK, though.
- * * The language is more important than the charset; i.e., if the
- *   following is given:
- * 
- *   Accept-Language: nl-be, nl;q=0.8, en-us;q=0.5, en;q=0.3
- *   Accept-Charset: ISO-8859-15, utf-8;q=0.5
- *
- *   And the supplied parameter contains (amongst others) nl_BE.UTF-8
- *   and nl.ISO-8859-15, then nl_BE.UTF-8 will be picked.
- * 
- * $Log: accept-to-gettext.inc,v $
- * Revision 1.1.1.1  2003/11/19 19:31:15  wouter
- * * moved to new CVS repo after death of the old
- * * Fixed code to apply a default to both Accept-Charset and
- *   Accept-Language if none of those headers are supplied; patch from
- *   Dominic Chambers <dominic@encasa.com>
- *
- * Revision 1.2  2003/08/14 10:23:59  wouter
- * Removed little error in Content-Type header syntaxis.
- *
- */
-
-/* not really important, this one; perhaps I could've put it inline with
- * the rest. */
-function find_match($curlscore,$curcscore,$curgtlang,$langval,$charval,
-                    $gtlang)
-{
-  if($curlscore < $langval) {
-    $curlscore=$langval;
-    $curcscore=$charval;
-    $curgtlang=$gtlang;
-  } else if ($curlscore == $langval) {
-    if($curcscore < $charval) {
-      $curcscore=$charval;
-      $curgtlang=$gtlang;
-    }
-  }
-  return array($curlscore, $curcscore, $curgtlang);
-}
-
-function al2gt($gettextlangs, $mime) {
-  /* default to "everything is acceptable", as RFC2616 specifies */
-  $acceptLang=(($_SERVER["HTTP_ACCEPT_LANGUAGE"] == '') ? '*' :
-       $_SERVER["HTTP_ACCEPT_LANGUAGE"]);
-  $acceptChar=(($_SERVER["HTTP_ACCEPT_CHARSET"] == '') ? '*' :
-       $_SERVER["HTTP_ACCEPT_CHARSET"]);
-  $alparts=@preg_split("/,/",$acceptLang);
-  $acparts=@preg_split("/,/",$acceptChar);
-  
-  /* Parse the contents of the Accept-Language header.*/
-  foreach($alparts as $part) {
-    $part=trim($part);
-    if(preg_match("/;/", $part)) {
-      $lang=@preg_split("/;/",$part);
-      $score=@preg_split("/=/",$lang[1]);
-      $alscores[$lang[0]]=$score[1];
-    } else {
-      $alscores[$part]=1;
-    }
-  }
-
-  /* Do the same for the Accept-Charset header. */
-
-  /* RFC2616: ``If no "*" is present in an Accept-Charset field, then
-   * all character sets not explicitly mentioned get a quality value of
-   * 0, except for ISO-8859-1, which gets a quality value of 1 if not
-   * explicitly mentioned.''
-   * 
-   * Making it 2 for the time being, so that we
-   * can distinguish between "not specified" and "specified as 1" later
-   * on. */
-  $acscores["ISO-8859-1"]=2;
-
-  foreach($acparts as $part) {
-    $part=trim($part);
-    if(preg_match("/;/", $part)) {
-      $cs=@preg_split("/;/",$part);
-      $score=@preg_split("/=/",$cs[1]);
-      $acscores[strtoupper($cs[0])]=$score[1];
-    } else {
-      $acscores[strtoupper($part)]=1;
-    }
-  }
-  if($acscores["ISO-8859-1"]==2) {
-    $acscores["ISO-8859-1"]=(isset($acscores["*"])?$acscores["*"]:1);
-  }
-
-  /* 
-   * Loop through the available languages/encodings, and pick the one
-   * with the highest score, excluding the ones with a charset the user
-   * did not include.
-   */
-  $curlscore=0;
-  $curcscore=0;
-  $curgtlang=NULL;
-  foreach($gettextlangs as $gtlang) {
-
-    $tmp1=preg_replace("/\_/","-",$gtlang);
-    $tmp2=@preg_split("/\./",$tmp1);
-    $allang=strtolower($tmp2[0]);
-    $gtcs=strtoupper($tmp2[1]);
-    $noct=@preg_split("/-/",$allang);
-
-    $testvals=array(
-         array($alscores[$allang], $acscores[$gtcs]),
-        array($alscores[$noct[0]], $acscores[$gtcs]),
-        array($alscores[$allang], $acscores["*"]),
-        array($alscores[$noct[0]], $acscores["*"]),
-        array($alscores["*"], $acscores[$gtcs]),
-        array($alscores["*"], $acscores["*"]));
-
-    $found=FALSE;
-    foreach($testvals as $tval) {
-      if(!$found && isset($tval[0]) && isset($tval[1])) {
-        $arr=find_match($curlscore, $curcscore, $curgtlang, $tval[0],
-                 $tval[1], $gtlang);
-        $curlscore=$arr[0];
-        $curcscore=$arr[1];
-        $curgtlang=$arr[2];
-       $found=TRUE;
-      }
-    }
-  }
-
-  /* We must re-parse the gettext-string now, since we may have found it
-   * through a "*" qualifier.*/
-  
-  $gtparts=@preg_split("/\./",$curgtlang);
-  $tmp=strtolower($gtparts[0]);
-  $lang=preg_replace("/\_/", "-", $tmp);
-  $charset=$gtparts[1];
-
-  header("Content-Language: $lang");
-  header("Content-Type: $mime; charset=$charset");
-
-  return $curgtlang;
-}
-
-?>
index 08b4c4b810501437ca942c7c8763f67367c12fc7..26e57ab4a716dd51d07e5b6be1e55a52f3307218 100644 (file)
@@ -40,7 +40,7 @@
        }
 
        if (ENABLE_TRANSLATIONS == true) { // If translations are enabled.
-               require_once "accept-to-gettext.php";
+               require_once "lib/accept-to-gettext.php";
                require_once "lib/gettext/gettext.inc";
 
                function startup_gettext() {
diff --git a/lib/accept-to-gettext.php b/lib/accept-to-gettext.php
new file mode 100644 (file)
index 0000000..6f366d0
--- /dev/null
@@ -0,0 +1,184 @@
+<?php
+/*
+ * accept-to-gettext.inc -- convert information in 'Accept-*' headers to
+ * gettext language identifiers.
+ * Copyright (c) 2003, Wouter Verhelst <wouter@debian.org>
+ * 
+ * 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 2 of the License, 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; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Usage:
+ *
+ *  $locale=al2gt(<array of supported languages/charsets in gettext syntax>,
+ *                <MIME type of document>);
+ *  setlocale('LC_ALL', $locale); // or 'LC_MESSAGES', or whatever...
+ *
+ * Example:
+ *
+ *  $langs=array('nl_BE.ISO-8859-15','nl_BE.UTF-8','en_US.UTF-8','en_GB.UTF-8');
+ *  $locale=al2gt($langs, 'text/html');
+ *  setlocale('LC_ALL', $locale);
+ *
+ * Note that this will send out header information (to be
+ * RFC2616-compliant), so it must be called before anything is sent to
+ * the user.
+ * 
+ * Assumptions made:
+ * * Charset encodings are written the same way as the Accept-Charset
+ *   HTTP header specifies them (RFC2616), except that they're parsed
+ *   case-insensitive.
+ * * Country codes and language codes are the same in both gettext and
+ *   the Accept-Language syntax (except for the case differences, which
+ *   are dealt with easily). If not, some input may be ignored.
+ * * The provided gettext-strings are fully qualified; i.e., no "en_US";
+ *   always "en_US.ISO-8859-15" or "en_US.UTF-8", or whichever has been
+ *   used. "en.ISO-8859-15" is OK, though.
+ * * The language is more important than the charset; i.e., if the
+ *   following is given:
+ * 
+ *   Accept-Language: nl-be, nl;q=0.8, en-us;q=0.5, en;q=0.3
+ *   Accept-Charset: ISO-8859-15, utf-8;q=0.5
+ *
+ *   And the supplied parameter contains (amongst others) nl_BE.UTF-8
+ *   and nl.ISO-8859-15, then nl_BE.UTF-8 will be picked.
+ * 
+ * $Log: accept-to-gettext.inc,v $
+ * Revision 1.1.1.1  2003/11/19 19:31:15  wouter
+ * * moved to new CVS repo after death of the old
+ * * Fixed code to apply a default to both Accept-Charset and
+ *   Accept-Language if none of those headers are supplied; patch from
+ *   Dominic Chambers <dominic@encasa.com>
+ *
+ * Revision 1.2  2003/08/14 10:23:59  wouter
+ * Removed little error in Content-Type header syntaxis.
+ *
+ */
+
+/* not really important, this one; perhaps I could've put it inline with
+ * the rest. */
+function find_match($curlscore,$curcscore,$curgtlang,$langval,$charval,
+                    $gtlang)
+{
+  if($curlscore < $langval) {
+    $curlscore=$langval;
+    $curcscore=$charval;
+    $curgtlang=$gtlang;
+  } else if ($curlscore == $langval) {
+    if($curcscore < $charval) {
+      $curcscore=$charval;
+      $curgtlang=$gtlang;
+    }
+  }
+  return array($curlscore, $curcscore, $curgtlang);
+}
+
+function al2gt($gettextlangs, $mime) {
+  /* default to "everything is acceptable", as RFC2616 specifies */
+  $acceptLang=(($_SERVER["HTTP_ACCEPT_LANGUAGE"] == '') ? '*' :
+       $_SERVER["HTTP_ACCEPT_LANGUAGE"]);
+  $acceptChar=(($_SERVER["HTTP_ACCEPT_CHARSET"] == '') ? '*' :
+       $_SERVER["HTTP_ACCEPT_CHARSET"]);
+  $alparts=@preg_split("/,/",$acceptLang);
+  $acparts=@preg_split("/,/",$acceptChar);
+  
+  /* Parse the contents of the Accept-Language header.*/
+  foreach($alparts as $part) {
+    $part=trim($part);
+    if(preg_match("/;/", $part)) {
+      $lang=@preg_split("/;/",$part);
+      $score=@preg_split("/=/",$lang[1]);
+      $alscores[$lang[0]]=$score[1];
+    } else {
+      $alscores[$part]=1;
+    }
+  }
+
+  /* Do the same for the Accept-Charset header. */
+
+  /* RFC2616: ``If no "*" is present in an Accept-Charset field, then
+   * all character sets not explicitly mentioned get a quality value of
+   * 0, except for ISO-8859-1, which gets a quality value of 1 if not
+   * explicitly mentioned.''
+   * 
+   * Making it 2 for the time being, so that we
+   * can distinguish between "not specified" and "specified as 1" later
+   * on. */
+  $acscores["ISO-8859-1"]=2;
+
+  foreach($acparts as $part) {
+    $part=trim($part);
+    if(preg_match("/;/", $part)) {
+      $cs=@preg_split("/;/",$part);
+      $score=@preg_split("/=/",$cs[1]);
+      $acscores[strtoupper($cs[0])]=$score[1];
+    } else {
+      $acscores[strtoupper($part)]=1;
+    }
+  }
+  if($acscores["ISO-8859-1"]==2) {
+    $acscores["ISO-8859-1"]=(isset($acscores["*"])?$acscores["*"]:1);
+  }
+
+  /* 
+   * Loop through the available languages/encodings, and pick the one
+   * with the highest score, excluding the ones with a charset the user
+   * did not include.
+   */
+  $curlscore=0;
+  $curcscore=0;
+  $curgtlang=NULL;
+  foreach($gettextlangs as $gtlang) {
+
+    $tmp1=preg_replace("/\_/","-",$gtlang);
+    $tmp2=@preg_split("/\./",$tmp1);
+    $allang=strtolower($tmp2[0]);
+    $gtcs=strtoupper($tmp2[1]);
+    $noct=@preg_split("/-/",$allang);
+
+    $testvals=array(
+         array($alscores[$allang], $acscores[$gtcs]),
+        array($alscores[$noct[0]], $acscores[$gtcs]),
+        array($alscores[$allang], $acscores["*"]),
+        array($alscores[$noct[0]], $acscores["*"]),
+        array($alscores["*"], $acscores[$gtcs]),
+        array($alscores["*"], $acscores["*"]));
+
+    $found=FALSE;
+    foreach($testvals as $tval) {
+      if(!$found && isset($tval[0]) && isset($tval[1])) {
+        $arr=find_match($curlscore, $curcscore, $curgtlang, $tval[0],
+                 $tval[1], $gtlang);
+        $curlscore=$arr[0];
+        $curcscore=$arr[1];
+        $curgtlang=$arr[2];
+       $found=TRUE;
+      }
+    }
+  }
+
+  /* We must re-parse the gettext-string now, since we may have found it
+   * through a "*" qualifier.*/
+  
+  $gtparts=@preg_split("/\./",$curgtlang);
+  $tmp=strtolower($gtparts[0]);
+  $lang=preg_replace("/\_/", "-", $tmp);
+  $charset=$gtparts[1];
+
+  header("Content-Language: $lang");
+  header("Content-Type: $mime; charset=$charset");
+
+  return $curgtlang;
+}
+
+?>
diff --git a/lib/pngfix.js b/lib/pngfix.js
new file mode 100644 (file)
index 0000000..c8ef4b2
--- /dev/null
@@ -0,0 +1,27 @@
+// stolen from http://homepage.ntlworld.com/bobosola/pngtestfixed.htm
+
+function correctPNG() // correctly handle PNG transparency in Win IE 5.5 or higher.
+   {
+   for(var i=0; i<document.images.length; i++)
+      {
+         var img = document.images[i]
+         var imgName = img.src.toUpperCase()
+         if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
+            {
+                var imgID = (img.id) ? "id='" + img.id + "' " : ""
+                var imgClass = (img.className) ? "class='" + img.className + "' " : ""
+                var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
+                var imgStyle = "display:inline-block;" + img.style.cssText 
+                if (img.align == "left") imgStyle = "float:left;" + imgStyle
+                if (img.align == "right") imgStyle = "float:right;" + imgStyle
+                if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle               
+                var strNewHTML = "<span " + imgID + imgClass + imgTitle
+                + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
+            + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
+                + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
+                img.outerHTML = strNewHTML
+                i = i-1
+            }
+      }
+   }
+window.attachEvent("onload", correctPNG);
diff --git a/lib/xsl_mop-up.js b/lib/xsl_mop-up.js
new file mode 100644 (file)
index 0000000..87c9670
--- /dev/null
@@ -0,0 +1,86 @@
+//  -*-coding: latin-1;-*-
+// Time-stamp: "2006-05-17 22:06:46 ADT" sburke@cpan.org
+
+// A workaround for XSL-to-XHTML systems that don't
+//  implement XSL 'disable-output-escaping="yes"'.
+//
+// sburke@cpan.org, Sean M. Burke.
+//  - I hereby release this JavaScript code into the public domain.
+
+var is_decoding;
+var DEBUG = 0;
+
+function complaining (s) { alert(s);  return new Error(s,s); }
+
+if(!(   document.getElementById && document.getElementsByName ))
+ throw complaining("Your browser is too old to render this page properly."
+  + "  Consider going to getfirefox.com to upgrade.");
+
+function check_decoding () {
+  var d = document.getElementById('cometestme');
+  if(!d) {
+    throw complaining("Can't find an id='cometestme' element?");
+  } else if(!('textContent' in d)) {
+    // It's a browser with a halfassed DOM implementation (like IE6)
+    // that doesn't implement textContent!  Assume that if it's that
+    // dumb, it probably doesn't implement disable-content-encoding.
+
+  } else {
+    var ampy = d.textContent;
+    if(DEBUG > 1) { alert("Got " + ampy); }
+
+    if(ampy == undefined) throw complaining("'cometestme' element has undefined text content?!");
+    if(ampy == ''       ) throw complaining("'cometestme' element has empty text content?!"    );
+
+    if      (ampy == "\x26"    ) { is_decoding =  true; }
+    else if (ampy == "\x26amp;" ) { is_decoding = false; }
+    else                    { throw complaining('Insane value: "' + ampy + '"!'); }
+  }
+
+  var msg =
+   (is_decoding == undefined) ? "I can't tell whether the XSL processor supports disable-content-encoding!D"
+   : is_decoding ? "The XSL processor DOES support disable-content-encoding"
+   : "The XSL processor does NOT support disable-content-encoding"
+  ;
+  if(DEBUG) alert(msg);
+  return msg;
+}
+
+
+function go_decoding () {
+  check_decoding();
+
+  if(is_decoding) {
+    DEBUG && alert("No work needs doing -- already decoded!");
+    return;
+  }
+
+  var to_decode = document.getElementsByName('decodeme');
+  if(!( to_decode && to_decode.length )) {
+    DEBUG && alert("No work needs doing -- no elements to decode!");
+    return;
+  }
+
+  if(!(  ( "innerHTML"   in to_decode[0]) &&  ( "textContent" in to_decode[0])  ))
+    throw complaining( "Your JavaScript version doesn't implement DOM " +
+     "properly enough to show this page correctly.  " +
+     "Consider going to getfirefox.com to upgrade.");
+
+  var s;
+  for(var i = to_decode.length - 1; i >= 0; i--) { 
+    s = to_decode[i].textContent;
+
+    if(
+      s == undefined ||
+      (s.indexOf('&') == -1 && s.indexOf('<') == -1)
+    ) {
+      // the null or markupless element needs no reworking
+    } else {
+      to_decode[i].innerHTML = s;  // that's the magic
+    }
+  }
+
+  return;
+}
+
+//End
index 71f2e73f3ccdec2a1a29b33faa7f06af8045442e..07ab1be2a3fd28b3b3abc5be050cf0787e984373 100644 (file)
--- a/login.php
+++ b/login.php
@@ -24,9 +24,6 @@
        <title>Tiny Tiny RSS : Login</title>
        <link rel="stylesheet" type="text/css" href="tt-rss.css">
        <link rel="shortcut icon" type="image/png" href="images/favicon.png">
-       <!--[if gte IE 5.5000]>
-               <script type="text/javascript" src="pngfix.js"></script>
-       <![endif]-->
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <script type="text/javascript" src="lib/prototype.js"></script>
        <script type="text/javascript" src="lib/scriptaculous/scriptaculous.js"></script>
index d6772600ef33fac7f1e6329d1a38a7bc6454eb21..db28991f3400df9f07ba32ec955854e28a8ec7ba 100644 (file)
@@ -3,9 +3,6 @@
        <title>Tiny Tiny RSS : Login</title>
        <link rel="stylesheet" type="text/css" href="tt-rss.css">
        <link rel="shortcut icon" type="image/png" href="images/favicon.png">
-       <!--[if gte IE 5.5000]>
-               <script type="text/javascript" src="pngfix.js"></script>
-       <![endif]-->
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <script type="text/javascript" src="lib/prototype.js"></script>
        <script type="text/javascript" src="lib/scriptaculous/scriptaculous.js"></script>
diff --git a/pngfix.js b/pngfix.js
deleted file mode 100644 (file)
index c8ef4b2..0000000
--- a/pngfix.js
+++ /dev/null
@@ -1,27 +0,0 @@
-// stolen from http://homepage.ntlworld.com/bobosola/pngtestfixed.htm
-
-function correctPNG() // correctly handle PNG transparency in Win IE 5.5 or higher.
-   {
-   for(var i=0; i<document.images.length; i++)
-      {
-         var img = document.images[i]
-         var imgName = img.src.toUpperCase()
-         if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
-            {
-                var imgID = (img.id) ? "id='" + img.id + "' " : ""
-                var imgClass = (img.className) ? "class='" + img.className + "' " : ""
-                var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
-                var imgStyle = "display:inline-block;" + img.style.cssText 
-                if (img.align == "left") imgStyle = "float:left;" + imgStyle
-                if (img.align == "right") imgStyle = "float:right;" + imgStyle
-                if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle               
-                var strNewHTML = "<span " + imgID + imgClass + imgTitle
-                + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
-            + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
-                + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
-                img.outerHTML = strNewHTML
-                i = i-1
-            }
-      }
-   }
-window.attachEvent("onload", correctPNG);
diff --git a/rss.xsl b/rss.xsl
index c6a95f139698dc2224a0ae470eadc9c7da030e5b..aa16f11198ab16ef8c6306957fbf7d09efeca025 100644 (file)
--- a/rss.xsl
+++ b/rss.xsl
@@ -8,7 +8,7 @@
        <head>
                <title><xsl:value-of select="rss/channel/title"/></title>
                <link rel="stylesheet" type="text/css" href="utility.css"/>
-               <script language="javascript" src="xsl_mop-up.js"></script>
+               <script language="javascript" src="lib/xsl_mop-up.js"></script>
        </head>
 
        <body onload="go_decoding()">
diff --git a/xsl_mop-up.js b/xsl_mop-up.js
deleted file mode 100644 (file)
index 87c9670..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-//  -*-coding: latin-1;-*-
-// Time-stamp: "2006-05-17 22:06:46 ADT" sburke@cpan.org
-
-// A workaround for XSL-to-XHTML systems that don't
-//  implement XSL 'disable-output-escaping="yes"'.
-//
-// sburke@cpan.org, Sean M. Burke.
-//  - I hereby release this JavaScript code into the public domain.
-
-var is_decoding;
-var DEBUG = 0;
-
-function complaining (s) { alert(s);  return new Error(s,s); }
-
-if(!(   document.getElementById && document.getElementsByName ))
- throw complaining("Your browser is too old to render this page properly."
-  + "  Consider going to getfirefox.com to upgrade.");
-
-function check_decoding () {
-  var d = document.getElementById('cometestme');
-  if(!d) {
-    throw complaining("Can't find an id='cometestme' element?");
-  } else if(!('textContent' in d)) {
-    // It's a browser with a halfassed DOM implementation (like IE6)
-    // that doesn't implement textContent!  Assume that if it's that
-    // dumb, it probably doesn't implement disable-content-encoding.
-
-  } else {
-    var ampy = d.textContent;
-    if(DEBUG > 1) { alert("Got " + ampy); }
-
-    if(ampy == undefined) throw complaining("'cometestme' element has undefined text content?!");
-    if(ampy == ''       ) throw complaining("'cometestme' element has empty text content?!"    );
-
-    if      (ampy == "\x26"    ) { is_decoding =  true; }
-    else if (ampy == "\x26amp;" ) { is_decoding = false; }
-    else                    { throw complaining('Insane value: "' + ampy + '"!'); }
-  }
-
-  var msg =
-   (is_decoding == undefined) ? "I can't tell whether the XSL processor supports disable-content-encoding!D"
-   : is_decoding ? "The XSL processor DOES support disable-content-encoding"
-   : "The XSL processor does NOT support disable-content-encoding"
-  ;
-  if(DEBUG) alert(msg);
-  return msg;
-}
-
-
-function go_decoding () {
-  check_decoding();
-
-  if(is_decoding) {
-    DEBUG && alert("No work needs doing -- already decoded!");
-    return;
-  }
-
-  var to_decode = document.getElementsByName('decodeme');
-  if(!( to_decode && to_decode.length )) {
-    DEBUG && alert("No work needs doing -- no elements to decode!");
-    return;
-  }
-
-  if(!(  ( "innerHTML"   in to_decode[0]) &&  ( "textContent" in to_decode[0])  ))
-    throw complaining( "Your JavaScript version doesn't implement DOM " +
-     "properly enough to show this page correctly.  " +
-     "Consider going to getfirefox.com to upgrade.");
-
-  var s;
-  for(var i = to_decode.length - 1; i >= 0; i--) { 
-    s = to_decode[i].textContent;
-
-    if(
-      s == undefined ||
-      (s.indexOf('&') == -1 && s.indexOf('<') == -1)
-    ) {
-      // the null or markupless element needs no reworking
-    } else {
-      to_decode[i].innerHTML = s;  // that's the magic
-    }
-  }
-
-  return;
-}
-
-//End