From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robert Klein Subject: Patch: HTML body onload/onunload attribute support for new exporter Date: Wed, 17 Oct 2012 15:20:40 +0200 Message-ID: <507EB0A8.4020903@mpip-mainz.mpg.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------030106040208060406080002" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:38978) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOTbA-00011N-46 for emacs-orgmode@gnu.org; Wed, 17 Oct 2012 09:23:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TOTb4-0004vG-7k for emacs-orgmode@gnu.org; Wed, 17 Oct 2012 09:23:48 -0400 Received: from gate1.mpip-mainz.mpg.de ([194.95.63.248]:28107) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOTb3-0004v4-U5 for emacs-orgmode@gnu.org; Wed, 17 Oct 2012 09:23:42 -0400 Received: from [10.20.2.71] (port=51845 helo=vmmail1.mpip-mainz.mpg.de) by gate1.mpip-mainz.mpg.de with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1TOTau-0006nC-03 for emacs-orgmode@gnu.org; Wed, 17 Oct 2012 15:23:32 +0200 Received: from pckr143.mpip-mainz.mpg.de ([10.20.70.83]) by vmmail1.mpip-mainz.mpg.de with esmtp (Exim 4.72) (envelope-from ) id 1TOTat-0007il-U3 for emacs-orgmode@gnu.org; Wed, 17 Oct 2012 15:23:31 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org This is a multi-part message in MIME format. --------------030106040208060406080002 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Hallo, I created a patch for the new exporter, so I can adding onload and onunload attributes to the body tag in HTML export. I'm rather new to emacs lisp, please check if this is to be included in org-mode. Best regards Robert -- Robert Klein - Max Planck-Institut für Polymerforschung Ackermannweg 10 55128 Mainz --------------030106040208060406080002 Content-Type: text/x-patch; name="html-e-body-onload.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="html-e-body-onload.diff" diff --git a/contrib/lisp/org-e-html.el b/contrib/lisp/org-e-html.el index fcdf006..78582a5 100644 --- a/contrib/lisp/org-e-html.el +++ b/contrib/lisp/org-e-html.el @@ -132,7 +132,9 @@ (:html-table-tag nil nil org-e-html-table-tag) (:xml-declaration nil nil org-e-html-xml-declaration) (:LaTeX-fragments nil "LaTeX" org-export-with-LaTeX-fragments) - (:mathjax "MATHJAX" nil "" space))) + (:mathjax "MATHJAX" nil "" space) + (:html-body-onload nil nil org-e-html-body-onload) + (:html-body-onunload nil nil org-e-html-body-onunload))) @@ -996,6 +998,33 @@ CSS classes, then this prefix can be very useful." :type 'string) +;;;; Template :: body-onload + +(defcustom org-e-html-body-onload nil + "Additional onload attribute for HTML body tags. +The value of this variable is inserted in a onload attribute of +the body tag in the HTML buffer. Use this variable to include +script code to be executed after loading the HTML page." + :group 'org-export-e-html + :type '(choice + (const :tag "No preamble" nil) + ((string ) :tag "Custom string"))) + + +;;;; Template :: body-onunload + +(defcustom org-e-html-body-onunload nil + "Additional onunload attribute for HTML body tags. +The value of this variable is inserted in a onunload attribute of +the body tag in the HTML buffer. Use this variable to include +script code to be executed when leaving the HTML page." + :group 'org-export-e-html + :type '(choice + (const :tag "No preamble" nil) + ((string ) :tag "Custom string"))) + + + ;;; Internal Functions @@ -1422,7 +1451,16 @@ holding export options." (org-e-html--build-style info) (org-e-html--build-mathjax-config info) "\n" - "\n" + "\n" (let ((link-up (org-trim (plist-get info :link-up))) (link-home (org-trim (plist-get info :link-home)))) (unless (and (string= link-up "") (string= link-up "")) --------------030106040208060406080002--