From 329b3a7edc97db2b1a36826599276fabaf663e89 Mon Sep 17 00:00:00 2001
From: Jack Magne <jmagne@localhost.localdomain>
Date: Wed, 22 Apr 2015 17:48:08 -0700
Subject: [PATCH] OCSP Parameterized.

---
 base/ocsp/shared/webapps/ocsp/404.html             | 40 ++++++++++++++------
 base/ocsp/shared/webapps/ocsp/500.html             | 43 ++++++++++++++++------
 .../ocsp/shared/webapps/ocsp/agent/header.template | 25 ++++++++++++-
 base/ocsp/shared/webapps/ocsp/agent/index.template | 25 ++++++++++++-
 base/ocsp/shared/webapps/ocsp/agent/ports.template | 23 +++++++++++-
 dogtag/common-ui/shared/ocsp/404.properties        |  2 +
 dogtag/common-ui/shared/ocsp/500.properties        |  2 +
 .../common-ui/shared/ocsp/agent/header.properties  |  2 +
 .../common-ui/shared/ocsp/agent/index.properties   |  2 +
 .../common-ui/shared/ocsp/agent/ports.properties   |  1 +
 10 files changed, 137 insertions(+), 28 deletions(-)
 create mode 100644 dogtag/common-ui/shared/ocsp/404.properties
 create mode 100644 dogtag/common-ui/shared/ocsp/500.properties
 create mode 100644 dogtag/common-ui/shared/ocsp/agent/header.properties
 create mode 100644 dogtag/common-ui/shared/ocsp/agent/index.properties
 create mode 100644 dogtag/common-ui/shared/ocsp/agent/ports.properties

diff --git a/base/ocsp/shared/webapps/ocsp/404.html b/base/ocsp/shared/webapps/ocsp/404.html
index fd5264c..31b1d39 100755
--- a/base/ocsp/shared/webapps/ocsp/404.html
+++ b/base/ocsp/shared/webapps/ocsp/404.html
@@ -25,6 +25,27 @@ var port = location.port;
 </script>
 
 <head>
+<script type="text/javascript" language="JavaScript" src="/pki/js/jquery.js"></script>
+<script type="text/javascript" language="JavaScript" src="/pki/js/jquery.i18n.properties.js"></script>
+
+<script type="text/javascript" language="JavaScript">
+$(function() {
+    $.i18n.properties({
+        name: '404',
+        language: ' ', // suppress potential 404's due to .i18n.browserLang()
+        path: '/pki/ocsp/',
+        mode: 'map',
+        callback: function() {
+            var key;
+            for (key in $.i18n.map) {
+                var message = $.i18n.prop(key);
+                $('span.message[name='+key+']').html(message);
+            }
+        }
+    });
+});
+</script>
+
 <title>OCSP 404 Error!</title>
 <!-- always expand ALL relative paths -->
 <script language=javascript>
@@ -50,18 +71,15 @@ document.write('<META http-equiv=Content-Type content="text/html; charset=UTF-8"
 <body bgcolor="#FFFFFF" link="#666699" vlink="#666699" alink="#333366">
 <div id="header">
 <!-- always expand ALL relative paths -->
-<script language=javascript>
-document.write('<a href="http://pki.fedoraproject.org/" title="Visit pki.fedoraproject.org for more information about Dogtag products and services"><img src="');
-document.write(protocol);
-document.write('//');
-document.write(hostname);
-document.write(':');
-document.write(port);
-document.write('/pki/images/logo_header.gif');
-document.write('" alt="Dogtag" id="myLogo" /></a>');
-</script>
+
+
+<span class="message" name="logo">
+<a href="http://pki.fedoraproject.org/" title="Visit pki.fedoraproject.org for more information about Certificate System products and services"><img src="/pki/images/logo_header.gif" alt="Certificate System" id="myLogo" /></a>
+</span>
     <div id="headertitle">
-    <a href="/" title="Dogtag Network homepage">Dogtag<sup><font size="-2">&reg;</font></sup> Certificate System</a>
+    <span class="message" name="title">
+    <a href="/" title="Certificate System">Certificate System</a>
+    </span>
     </div>
     <div id="account">
           <dl><dt><span></span></dt><dd></dd></dl>
diff --git a/base/ocsp/shared/webapps/ocsp/500.html b/base/ocsp/shared/webapps/ocsp/500.html
index 2749fc7..0dc8826 100755
--- a/base/ocsp/shared/webapps/ocsp/500.html
+++ b/base/ocsp/shared/webapps/ocsp/500.html
@@ -25,6 +25,27 @@ var port = location.port;
 </script>
 
 <head>
+<script type="text/javascript" language="JavaScript" src="/pki/js/jquery.js"></script>
+<script type="text/javascript" language="JavaScript" src="/pki/js/jquery.i18n.properties.js"></script>
+
+<script type="text/javascript" language="JavaScript">
+$(function() {
+    $.i18n.properties({
+        name: '500',
+        language: ' ', // suppress potential 404's due to .i18n.browserLang()
+        path: '/pki/ocsp/',
+        mode: 'map',
+        callback: function() {
+            var key;
+            for (key in $.i18n.map) {
+                var message = $.i18n.prop(key);
+                $('span.message[name='+key+']').html(message);
+            }
+        }
+    });
+});
+</script>
+
 <title>OCSP 500 Error!</title>
 <!-- always expand ALL relative paths -->
 <script language=javascript>
@@ -50,18 +71,18 @@ document.write('<META http-equiv=Content-Type content="text/html; charset=UTF-8"
 <body bgcolor="#FFFFFF" link="#666699" vlink="#666699" alink="#333366">
 <div id="header">
 <!-- always expand ALL relative paths -->
-<script language=javascript>
-document.write('<a href="http://pki.fedoraproject.org/" title="Visit pki.fedoraproject.org for more information about Dogtag products and services"><img src="');
-document.write(protocol);
-document.write('//');
-document.write(hostname);
-document.write(':');
-document.write(port);
-document.write('/pki/images/logo_header.gif');
-document.write('" alt="Dogtag" id="myLogo" /></a>');
-</script>
+
+
+
+<span class="message" name="logo">
+<a href="http://pki.fedoraproject.org/" title="Visit pki.fedoraproject.org for more information about Certificate System products and services"><img src="/pki/images/logo_header.gif" alt="Certificate System" id="myLogo" /></a>
+</span>
+
     <div id="headertitle">
-    <a href="/" title="Dogtag Network homepage">Dogtag<sup><font size="-2">&reg;</font></sup> Certificate System</a>
+
+    <span class="message" name="title">
+    <a href="/" title="Certificate System">Certificate System</a>
+    </span>
     </div>
     <div id="account">
           <dl><dt><span></span></dt><dd></dd></dl>
diff --git a/base/ocsp/shared/webapps/ocsp/agent/header.template b/base/ocsp/shared/webapps/ocsp/agent/header.template
index d1221b1..2c5574e 100644
--- a/base/ocsp/shared/webapps/ocsp/agent/header.template
+++ b/base/ocsp/shared/webapps/ocsp/agent/header.template
@@ -18,6 +18,27 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 <html>
 <head>
+<script type="text/javascript" language="JavaScript" src="/pki/js/jquery.js"></script>
+<script type="text/javascript" language="JavaScript" src="/pki/js/jquery.i18n.properties.js"></script>
+
+<script type="text/javascript" language="JavaScript">
+$(function() {
+    $.i18n.properties({
+        name: 'header',
+        language: ' ', // suppress potential 404's due to .i18n.browserLang()
+        path: '/pki/ocsp/agent/',
+        mode: 'map',
+        callback: function() {
+            var key;
+            for (key in $.i18n.map) {
+                var message = $.i18n.prop(key);
+                $('span.message[name='+key+']').html(message);
+            }
+        }
+    });
+});
+</script>
+
 <CMS_TEMPLATE>
 <title>Header</title>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
@@ -29,9 +50,9 @@
     <td> 
       <table border="0" cellspacing="12" cellpadding="0">
         <tr>
-          <td><img src="/pki/images/logo_header.gif"></td>
+          <td><span class="message" name="logo"><img src="/pki/images/logo_header.gif"></span></td>
           <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
-          <td><font size="+1" face="PrimaSans BT, Verdana, sans-serif" color="white"><b>Dogtag<sup><font color="#999999" size="-2">&reg;</font></sup> Agent Services</b></font></td>
+          <td><span class="message" name="title"><font size="+1" face="PrimaSans BT, Verdana, sans-serif" color="white"><b>Agent Services</b></font></span></td>
         </tr>
       </table>
       <table border="0" cellspacing="0" cellpadding="0">
diff --git a/base/ocsp/shared/webapps/ocsp/agent/index.template b/base/ocsp/shared/webapps/ocsp/agent/index.template
index be2c39d..91ea503 100644
--- a/base/ocsp/shared/webapps/ocsp/agent/index.template
+++ b/base/ocsp/shared/webapps/ocsp/agent/index.template
@@ -18,6 +18,27 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 <html>
 <head>
+<script type="text/javascript" language="JavaScript" src="/pki/js/jquery.js"></script>
+<script type="text/javascript" language="JavaScript" src="/pki/js/jquery.i18n.properties.js"></script>
+
+<script type="text/javascript" language="JavaScript">
+$(function() {
+    $.i18n.properties({
+        name: 'index',
+        language: ' ', // suppress potential 404's due to .i18n.browserLang()
+        path: '/pki/ocsp/agent/',
+        mode: 'map',
+        callback: function() {
+            var key;
+            for (key in $.i18n.map) {
+                var message = $.i18n.prop(key);
+                $('span.message[name='+key+']').html(message);
+            }
+        }
+    });
+});
+</script>
+
 <CMS_TEMPLATE>
 <title>OCSP Agent</title>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
@@ -29,9 +50,9 @@
     <td> 
       <table border="0" cellspacing="12" cellpadding="0">
         <tr> 
-          <td><img src="/pki/images/logo_header.gif"></td>
+          <td><span class="message" name="logo"><img src="/pki/images/logo_header.gif"></span></td>
           <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
-          <td><font size="+1" face="PrimaSans BT, Verdana, sans-serif" color="white"><b>Dogtag<sup><font color="#999999" size="-2">&reg;</font></sup> Agent Services</b></font></td>
+          <td><span class="message" name="title"><font size="+1" face="PrimaSans BT, Verdana, sans-serif" color="white"><b>Agent Services</b></font></span></td>
         </tr>
       </table>
     </td>
diff --git a/base/ocsp/shared/webapps/ocsp/agent/ports.template b/base/ocsp/shared/webapps/ocsp/agent/ports.template
index 8413ada..67b6109 100644
--- a/base/ocsp/shared/webapps/ocsp/agent/ports.template
+++ b/base/ocsp/shared/webapps/ocsp/agent/ports.template
@@ -18,7 +18,26 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 <html>
 <head>
-<CMS_TEMPLATE>
+<script type="text/javascript" language="JavaScript" src="/pki/js/jquery.js"></script>
+<script type="text/javascript" language="JavaScript" src="/pki/js/jquery.i18n.properties.js"></script>
+
+<script type="text/javascript" language="JavaScript">
+$(function() {
+    $.i18n.properties({
+        name: 'ports',
+        language: ' ', // suppress potential 404's due to .i18n.browserLang()
+        path: '/pki/oscp/agent/',
+        mode: 'map',
+        callback: function() {
+            var key;
+            for (key in $.i18n.map) {
+                var message = $.i18n.prop(key);
+                $('span.message[name='+key+']').html(message);
+            }
+        }
+    });
+});
+</script>
 <title>OCSP Agent Ports</title>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 </head>
@@ -31,7 +50,7 @@
         <tr> 
           <td><img src="/pki/images/logo_header.gif"></td>
           <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
-          <td><font size="+1" face="PrimaSans BT, Verdana, sans-serif" color="white"><b>Dogtag<sup><font color="#999999" size="-2">&reg;</font></sup> Services Summary</b></font></td>
+          <td><span class="message" name="title"><font size="+1" face="PrimaSans BT, Verdana, sans-serif" color="white"><b>Services Summary</b></font></span></td>
         </tr>
       </table>
     </td>
diff --git a/dogtag/common-ui/shared/ocsp/404.properties b/dogtag/common-ui/shared/ocsp/404.properties
new file mode 100644
index 0000000..63d004e
--- /dev/null
+++ b/dogtag/common-ui/shared/ocsp/404.properties
@@ -0,0 +1,2 @@
+logo = <img src="/pki/images/logo_header.gif">
+title = <font size="+1" face="PrimaSans BT, Verdana, sans-serif" color="white"><b>Dogtag<sup><font color="#cccccc" size="-2">&reg;</font></sup> Certificate Manager</b></font>
diff --git a/dogtag/common-ui/shared/ocsp/500.properties b/dogtag/common-ui/shared/ocsp/500.properties
new file mode 100644
index 0000000..e9a1b34
--- /dev/null
+++ b/dogtag/common-ui/shared/ocsp/500.properties
@@ -0,0 +1,2 @@
+logo = <a href="http://pki.fedoraproject.org/" title="Visit pki.fedoraproject.org for more information about Dogtag products and services"><img src="/pki/images/logo_header.gif" alt="Dogtag" id="myLogo" /></a>
+title = <a href="/" title="Dogtag Network homepage">Dogtag<sup><font size="-2">&reg;</font></sup> Certificate System</a>
diff --git a/dogtag/common-ui/shared/ocsp/agent/header.properties b/dogtag/common-ui/shared/ocsp/agent/header.properties
new file mode 100644
index 0000000..17e5ce9
--- /dev/null
+++ b/dogtag/common-ui/shared/ocsp/agent/header.properties
@@ -0,0 +1,2 @@
+logo = <img src="/pki/images/logo_header.gif">
+title = <font size="+1" face="PrimaSans BT, Verdana, sans-serif" color="white"><b>Dogtag<sup><font color="#999999" size="-2">&reg;</font></sup> Agent Services</b></font>
diff --git a/dogtag/common-ui/shared/ocsp/agent/index.properties b/dogtag/common-ui/shared/ocsp/agent/index.properties
new file mode 100644
index 0000000..17e5ce9
--- /dev/null
+++ b/dogtag/common-ui/shared/ocsp/agent/index.properties
@@ -0,0 +1,2 @@
+logo = <img src="/pki/images/logo_header.gif">
+title = <font size="+1" face="PrimaSans BT, Verdana, sans-serif" color="white"><b>Dogtag<sup><font color="#999999" size="-2">&reg;</font></sup> Agent Services</b></font>
diff --git a/dogtag/common-ui/shared/ocsp/agent/ports.properties b/dogtag/common-ui/shared/ocsp/agent/ports.properties
new file mode 100644
index 0000000..59c0124
--- /dev/null
+++ b/dogtag/common-ui/shared/ocsp/agent/ports.properties
@@ -0,0 +1 @@
+title = <a href="/" title="Dogtag Network homepage">Dogtag<sup><font size="-2">&reg;</font></sup> Certificate System</a>
-- 
2.1.0

