Started integrating GoogieSpell

release-0.6
thomascube 20 years ago
parent fecb03f44a
commit dd53e2b489

@ -1,6 +1,12 @@
CHANGELOG RoundCube Webmail
---------------------------
- Applied prev/next patch by Leonard Bouchet
- Applied patches by Mark Bucciarelli
- Applied patch for requesting receipts by Salvatore Ansani
- Integrated GoogieSpell as suggested by phil (styling is not perfect yet, localization is missing)
2006/04/13
----------
- Added Slovenian localization

@ -2,7 +2,7 @@
/*
+-----------------------------------------------------------------------+
| RoundCube Webmail IMAP Client |
| Version 0.1-20060402 |
| Version 0.1-20060501 |
| |
| Copyright (C) 2005, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
@ -40,7 +40,7 @@
*/
define('RCMAIL_VERSION', '0.1-20060402');
define('RCMAIL_VERSION', '0.1-20060501');
// define global vars
$CHARSET = 'UTF-8';
@ -276,7 +276,10 @@ if ($_task=='mail')
include('program/steps/mail/list.inc');
if ($_action=='search')
include('program/steps/mail/search.inc');
include('program/steps/mail/search.inc');
if ($_action=='spell')
include('program/steps/mail/spell.inc');
if ($_action=='rss')
include('program/steps/mail/rss.inc');

@ -321,8 +321,9 @@ function load_gui()
$javascript .= "$JS_OBJECT_NAME.set_env('framed', true);\n";
$OUTPUT->add_script($javascript);
$OUTPUT->include_script('program/js/common.js');
$OUTPUT->include_script('program/js/app.js');
$OUTPUT->include_script('common.js');
$OUTPUT->include_script('app.js');
$OUTPUT->scripts_path = 'program/js/';
// set locale setting
rcmail_set_locale($sess_user_lang);

@ -193,6 +193,7 @@ class rcube_html_page
// correct absolute pathes in images and other tags
$output = preg_replace('/(src|href|background)=(["\']?)(\/[a-z0-9_\-]+)/Ui', "\\1=\\2$base_path\\3", $output);
$output = str_replace('$__skin_path', $base_path, $output);
print rcube_charset_convert($output, 'UTF-8', $this->charset);
}

@ -363,5 +363,36 @@ function rcube_get_object_pos(obj)
return {x:iX, y:iY};
}
// cookie functions by GoogieSpell
function setCookie(name, value, expires, path, domain, secure)
{
var curCookie = name + "=" + escape(value) +
(expires ? "; expires=" + expires.toGMTString() : "") +
(path ? "; path=" + path : "") +
(domain ? "; domain=" + domain : "") +
(secure ? "; secure" : "");
document.cookie = curCookie;
}
function getCookie(name)
{
var dc = document.cookie;
var prefix = name + "=";
var begin = dc.indexOf("; " + prefix);
if (begin == -1)
{
begin = dc.indexOf(prefix);
if (begin != 0) return null;
}
else
begin += 2;
var end = document.cookie.indexOf(";", begin);
if (end == -1)
end = dc.length;
return unescape(dc.substring(begin + prefix.length, end));
}
var bw = new roundcube_browser();

File diff suppressed because it is too large Load Diff

@ -297,11 +297,14 @@ function rcmail_compose_header_from($attrib)
function rcmail_compose_body($attrib)
{
global $CONFIG, $REPLY_MESSAGE, $FORWARD_MESSAGE;
global $CONFIG, $OUTPUT, $REPLY_MESSAGE, $FORWARD_MESSAGE;
list($form_start, $form_end) = get_form_tags($attrib);
unset($attrib['form']);
if (empty($attrib['id']))
$attrib['id'] = 'rcmComposeMessage';
$attrib['name'] = '_message';
$textarea = new textarea($attrib);
@ -330,7 +333,15 @@ function rcmail_compose_body($attrib)
$out = $form_start ? "$form_start\n" : '';
$out .= $textarea->show($body);
$out .= $form_end ? "\n$form_end" : '';
// include GoogieSpell
$OUTPUT->include_script('googiespell.js');
$OUTPUT->add_script(sprintf("var googie1 = new GoogieSpell('\$__skin_path/images/googiespell/','%s&_action=spell&lang=');\n".
"googie1.decorateTextarea('%s');",
$GLOBALS['COMM_PATH'],
$attrib['id']), 'foot');
return $out;
}

@ -0,0 +1,50 @@
<?php
/*
+-----------------------------------------------------------------------+
| program/steps/mail/spell.inc |
| |
| This file is part of the RoundCube Webmail client |
| Copyright (C) 2005, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
| Submit request to Google's spell checking engine |
| |
| CREDITS: |
| Script from GoogieSpell by amix.dk |
| |
+-----------------------------------------------------------------------+
| Author: Thomas Bruederli <roundcube@gmail.com> |
+-----------------------------------------------------------------------+
$Id$
*/
$REMOTE_REQUEST = TRUE;
$google = "www.google.com";
$lang = $_GET['lang'];
$path = "/tbproxy/spell?lang=$lang";
$data = file_get_contents('php://input');
$store = "";
if ($fp = fsockopen($google, 80, $errno, $errstr, 30))
{
$out = "POST $path HTTP/1.0\r\n";
$out .= "Host: $google\r\n";
$out .= "Content-Length: " . strlen($data) . "\r\n";
$out .= "Content-type: application/x-www-form-urlencoded\r\n";
$out .= "Connection: Close\r\n\r\n";
$out .= $data;
fwrite($fp, $out);
while (!feof($fp))
$store .= fgets($fp, 128);
fclose($fp);
}
print $store;
exit;
?>

@ -0,0 +1,94 @@
/***** modified styles for GoogieSpell *****/
.googie_window {
font-size: 11px;
width: 185px;
text-align: left;
border: 1px solid #666666;
background-color: #ffffff;
margin: 0;
padding: 0;
position: absolute;
visibility: hidden;
}
.googie_list {
width: 100%;
margin: 0;
padding: 0;
}
.googie_list td {
font-size: 11px;
padding-left: 10px;
padding-right: 10px;
padding-top: 2px;
padding-bottom: 2px;
cursor: pointer;
list-style-type: none;
}
.googie_list_onhover {
color: #FFFFFF;
background-color: #CC3333;
}
.googie_list_onout {
background-color: #F6F6F6;
}
.googie_list_selected {
background-color: #cccccc;
font-weight: bold;
}
.googie_list_close {
color: #b91414;
}
.googie_list_revert {
color: #b91479;
}
.googie_link {
color: #b91414;
text-decoration: underline;
cursor: pointer;
}
.googie_check_spelling_link {
color: #CC0000;
font-size: 11px;
text-decoration: none;
cursor: pointer;
}
.googie_check_spelling_link:hover {
text-decoration: underline;
}
.googie_no_style {
text-decoration: none;
}
.googie_check_spelling_ok {
color: green;
text-decoration: underline;
cursor: pointer;
}
.googie_lang_3d_click img {
vertical-align: middle;
border-top: 1px solid #555;
border-left: 1px solid #555;
border-right: 1px solid #b1b1b1;
border-bottom: 1px solid #b1b1b1;
}
.googie_lang_3d_on img {
vertical-align: middle;
border-top: 1px solid #b1b1b1;
border-left: 1px solid #b1b1b1;
border-right: 1px solid #555;
border-bottom: 1px solid #555;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 722 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 B

@ -749,7 +749,7 @@ div.message-part pre
#compose-body
{
margin-top: 10px;
margin-top: 5px;
margin-bottom: 5px;
width: 99% !important;
width: 95%;

@ -4,6 +4,7 @@
<title><roundcube:object name="productname" /> :: <roundcube:label name="compose" /></title>
<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">
<!--

Loading…
Cancel
Save