From 5f660cd7c4662c30921b76b04a7b9d92e82182df Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Thu, 02 Oct 2008 04:39:49 -0400
Subject: [PATCH] - Minimize "inline" javascript use (#1485433)

---
 skins/default/templates/compose.html |   68 +---------------------------------
 1 files changed, 2 insertions(+), 66 deletions(-)

diff --git a/skins/default/templates/compose.html b/skins/default/templates/compose.html
index 2f156c3..beabe98 100644
--- a/skins/default/templates/compose.html
+++ b/skins/default/templates/compose.html
@@ -5,59 +5,9 @@
 <roundcube:include file="/includes/links.html" />
 <link rel="stylesheet" type="text/css" href="/mail.css" />
 <link rel="stylesheet" type="text/css" href="/googiespell.css" />
-<script type="text/javascript">
-<!--
-
-function rcmail_show_header_form(id, link)
-{
-  var row, parent, ns, ps, links;
-
-  if (link)
-  {
-    var parent = link.parentNode;
-
-    if ((ns = rcmail_next_sibling(link)))
-      parent.removeChild(ns);
-    else if ((ps = rcmail_prev_sibling(link)))
-      parent.removeChild(ps);
-    
-    parent.removeChild(link);
-
-    if(!parent.getElementsByTagName('A').length)
-      document.getElementById('compose-links').style.display = 'none';
-  }
-
-  if (row = document.getElementById(id))
-    {
-    var div = document.getElementById('compose-div');
-    var headers_div = document.getElementById('compose-headers-div');
-    row.style.display = (document.all && !window.opera) ? 'block' : 'table-row';
-    div.style.top = (parseInt(headers_div.offsetHeight)) + 'px';
-    }
-
-  return false;
-}
-
-function rcmail_next_sibling(elm)
-{
-  var ns = elm.nextSibling;
-  while (ns && ns.nodeType == 3)
-    ns = ns.nextSibling;
-  return ns;
-}
-
-function rcmail_prev_sibling(elm)
-{
-  var ps = elm.previousSibling;
-  while (ps && ps.nodeType == 3)
-    ps = ps.previousSibling;
-  return ps;
-}
-
-//-->
-</script>
+<script type="text/javascript" src="/functions.js"></script>
 </head>
-<body>
+<body onload="rcmail_init_compose_form()">
 
 <roundcube:include file="/includes/taskbar.html" />
 <roundcube:include file="/includes/header.html" />
@@ -146,20 +96,6 @@
 </form>
 
 <roundcube:object name="composeAttachmentForm" id="attachment-form" />
-
-<script type="text/javascript">
-<!--
-
-var cc_field = document.getElementById('rcmcomposecc');
-if (cc_field && cc_field.value!='')
-  rcmail_show_header_form('compose-cc', document.getElementById('addcclink'));
-var bcc_field = document.getElementById('rcmcomposebcc');
-if (bcc_field && bcc_field.value!='')
-  rcmail_show_header_form('compose-bcc', document.getElementById('addbcclink'));
-
-//-->
-</script>
-
 
 </body>
 </html>

--
Gitblit v1.9.1