From 39ad72ff718c0aa0ea8be03aefeb5f41b629ef2e Mon Sep 17 00:00:00 2001
From: Koustubha Kale <kmkale@anantcorp.com>
Date: Sun, 14 Nov 2010 20:04:52 +0530
Subject: [PATCH 2/2] Bug 5401: WYSWYG for Koha News Patch 2 Koha files
Content-Type: text/plain; charset="utf-8"

This patch adds WYSWYG editor functionality to Koha news in staff client using elRTE editor from elrte.org which is BSD style licensed.
elrte.inc file to configure the elRTE WYSWYG editor from elrte.org
By using the opts array you can control the appearance of the buttons as well as size of the text area.
For options of the opts array and others to control the appearance of the editor, refer to eltre.org.
This header file is inserted in the koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tmpl
---
 koha-tmpl/intranet-tmpl/prog/en/includes/elrte.inc |   51 ++++++++++++++++++++
 .../prog/en/modules/tools/koha-news.tmpl           |    3 +-
 2 files changed, 53 insertions(+), 1 deletions(-)
 create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/elrte.inc

diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/elrte.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/elrte.inc
new file mode 100644
index 0000000..147fde9
--- /dev/null
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/elrte.inc
@@ -0,0 +1,51 @@
+<!--
+#writen 13th Nov 2010 by kmkale@anantcorp.com
+#inc file to configure the elRTE WYSWYG editor from elrte.org
+#By using the opts array you can control the appearance of the buttons as well as size of the text area.
+#For options of the opts array and others to control the appearance of the editor, refer to eltre.org.
+#I have tweaked the eltre css file elrte.full.css to get the buttons to display properly in Koha.
+#I have also removed the src directory, the changelog, readme and eltre.html files to reduce patch size and get rid of whitespace errors.
+#I have also used a sed one liner on the eltre dir to get rid of trailing whitespace errors.
+#This header file is inserted in the koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tmpl
+# Copyright Koustubha Kale
+#
+# This file is part of Koha.
+#
+# Koha 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.
+#
+# Koha 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 Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+-->
+<script src="<!-- TMPL_VAR name="themelang" -->/js/elrte-1.1/js/jquery-1.4.2.min.js" type="text/javascript" charset="utf-8"></script>
+<script src="<!-- TMPL_VAR name="themelang" -->/js/elrte-1.1/js/elrte.full.js" type="text/javascript" charset="utf-8"></script>
+<script src="<!-- TMPL_VAR name="themelang" -->/js/elrte-1.1/js/jquery-ui-1.8.5.custom.min.js" type="text/javascript" charset="utf-8"></script>
+
+<link rel="stylesheet" href="<!-- TMPL_VAR name="themelang" -->/js/elrte-1.1/css/elrte.full.css" type="text/css" media="screen" charset="utf-8">
+<link rel="stylesheet" href="<!-- TMPL_VAR name="themelang" -->/js/elrte-1.1/js/ui-themes/smoothness/jquery-ui-1.8.5.custom.css" type="text/css" media="screen" charset="utf-8">
+
+<script type="text/javascript" charset="utf-8">
+//<![CDATA[
+$().ready(function() {
+$("#header_search").find("ul").removeClass();
+$("#header_search").find("ul").addClass("ui-tabs-nav");
+  var opts = {
+      stripWhiteSpace : 'false',
+      cssClass : 'el-rte',
+      // lang     : 'ru',
+      height   : 450,
+      toolbar  : 'complete',
+      //toolbar  : 'tiny',
+      cssfiles : ['<!-- TMPL_VAR name="themelang" -->/js/elrte-1.1/css/elrte-inner.css']
+  }
+  $('#new').elrte(opts);
+})
+//]]>
+	</script>
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tmpl
index b7b6748..0ce483e 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tmpl
@@ -2,6 +2,7 @@
 <title>Koha &rsaquo; Tools &rsaquo; News</title>
 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
 <!-- TMPL_INCLUDE NAME="calendar.inc" -->
+<!-- TMPL_INCLUDE NAME="elrte.inc" -->
 <script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
 <script type="text/javascript">//<![CDATA[
 $(document).ready(function() {
@@ -9,7 +10,7 @@ $(document).ready(function() {
 		dateFormat: 'uk',<!-- /TMPL_IF -->
 		sortList: [[2,0]],
 		headers: { 0: {sorter:false},6: { sorter: false },7: { sorter: false }}
-	}); 
+	});
 }); 
 //]]>
 </script>
-- 
1.7.0.4

