Permalink
Browse files

- Merge devel-spellcheck branch:

  - Added spellchecker exceptions dictionary (shared or per-user)
  - Added possibility to ignore words containing caps, numbers, symbols (spellcheck_ignore_* options)
  • Loading branch information...
1 parent eb2365c commit 66df084203a217ab74a416064c459cc3420a648c @alecpl alecpl committed Sep 6, 2011
View
@@ -1,6 +1,9 @@
CHANGELOG Roundcube Webmail
===========================
+- Added spellchecker exceptions dictionary (shared or per-user)
+- Added possibility to ignore words containing caps, numbers, symbols (spellcheck_ignore_* options)
+
RELEASE 0.6-rc
----------------
- Send X-Frame-Options headers to protect from clickjacking (#1487037)
View
@@ -93,6 +93,13 @@ CREATE TABLE [dbo].[users] (
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
+CREATE TABLE [dbo].[dictionary] (
+ [user_id] [int] ,
+ [language] [varchar] (5) COLLATE Latin1_General_CI_AI NOT NULL ,
+ [data] [text] COLLATE Latin1_General_CI_AI NOT NULL
+) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
+GO
+
ALTER TABLE [dbo].[cache] WITH NOCHECK ADD
PRIMARY KEY CLUSTERED
(
@@ -264,6 +271,9 @@ GO
CREATE INDEX [IX_users_alias] ON [dbo].[users]([alias]) ON [PRIMARY]
GO
+CREATE UNIQUE INDEX [IX_dictionary_user_language] ON [dbo].[dictionary]([user_id],[language]) ON [PRIMARY]
+GO
+
ALTER TABLE [dbo].[identities] ADD CONSTRAINT [FK_identities_user_id]
FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id])
ON DELETE CASCADE ON UPDATE CASCADE
View
@@ -110,3 +110,14 @@ DELETE FROM [dbo].[messages]
GO
DELETE FROM [dbo].[cache]
GO
+
+-- Updates from version 0.6-stable
+
+CREATE TABLE [dbo].[dictionary] (
+ [user_id] [int] ,
+ [language] [varchar] (5) COLLATE Latin1_General_CI_AI NOT NULL ,
+ [data] [text] COLLATE Latin1_General_CI_AI NOT NULL
+) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
+GO
+CREATE UNIQUE INDEX [IX_dictionary_user_language] ON [dbo].[dictionary]([user_id],[language]) ON [PRIMARY]
+GO
View
@@ -144,4 +144,15 @@ CREATE TABLE `identities` (
) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
+-- Table structure for table `dictionary`
+
+CREATE TABLE `dictionary` (
+ `user_id` int(10) UNSIGNED DEFAULT NULL,
+ `language` varchar(5) NOT NULL,
+ `data` longtext NOT NULL,
+ CONSTRAINT `user_id_fk_dictionary` FOREIGN KEY (`user_id`)
+ REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ UNIQUE `uniqueness` (`user_id`, `language`)
+) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
+
/*!40014 SET FOREIGN_KEY_CHECKS=1 */;
View
@@ -144,3 +144,14 @@ ALTER TABLE `contactgroupmembers` ADD INDEX `contactgroupmembers_contact_index`
TRUNCATE TABLE `messages`;
TRUNCATE TABLE `cache`;
+
+-- Updates from version 0.6-stable
+
+CREATE TABLE `dictionary` (
+ `user_id` int(10) UNSIGNED DEFAULT NULL,
+ `language` varchar(5) NOT NULL,
+ `data` longtext NOT NULL,
+ CONSTRAINT `user_id_fk_dictionary` FOREIGN KEY (`user_id`)
+ REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ UNIQUE `uniqueness` (`user_id`, `language`)
+) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
View
@@ -225,3 +225,16 @@ CREATE TABLE messages (
CREATE INDEX messages_index_idx ON messages (user_id, cache_key, idx);
CREATE INDEX messages_created_idx ON messages (created);
+
+--
+-- Table "dictionary"
+-- Name: dictionary; Type: TABLE; Schema: public; Owner: postgres
+--
+
+CREATE TABLE dictionary (
+ user_id integer DEFAULT NULL
+ REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE,
+ "language" varchar(5) NOT NULL,
+ data text NOT NULL,
+ CONSTRAINT dictionary_user_id_language_key UNIQUE (user_id, "language")
+);
View
@@ -100,3 +100,13 @@ CREATE INDEX contactgroupmembers_contact_id_idx ON contactgroupmembers (contact_
TRUNCATE messages;
TRUNCATE cache;
+
+-- Updates from version 0.6-stable
+
+CREATE TABLE dictionary (
+ user_id integer DEFAULT NULL
+ REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE,
+ "language" varchar(5) NOT NULL,
+ data text NOT NULL,
+ CONSTRAINT dictionary_user_id_language_key UNIQUE (user_id, "language")
+);
View
@@ -146,3 +146,18 @@ CREATE TABLE messages (
CREATE UNIQUE INDEX ix_messages_user_cache_uid ON messages (user_id,cache_key,uid);
CREATE INDEX ix_messages_index ON messages (user_id,cache_key,idx);
CREATE INDEX ix_messages_created ON messages (created);
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table dictionary
+--
+
+CREATE TABLE dictionary (
+ user_id integer DEFAULT NULL,
+ "language" varchar(5) NOT NULL,
+ data text NOT NULL
+);
+
+CREATE UNIQUE INDEX ix_dictionary_user_language ON dictionary (user_id, "language");
+
View
@@ -226,3 +226,13 @@ DROP TABLE contacts_tmp;
DELETE FROM messages;
DELETE FROM cache;
CREATE INDEX ix_contactgroupmembers_contact_id ON contactgroupmembers (contact_id);
+
+-- Updates from version 0.6-stable
+
+CREATE TABLE dictionary (
+ user_id integer DEFAULT NULL,
+ "language" varchar(5) NOT NULL,
+ data text NOT NULL
+);
+
+CREATE UNIQUE INDEX ix_dictionary_user_language ON dictionary (user_id, "language");
View
@@ -427,6 +427,10 @@ $rcmail_config['quota_zero_as_unlimited'] = false;
// requires to be compiled with Open SSL support
$rcmail_config['enable_spellcheck'] = true;
+// Enables spellchecker exceptions dictionary.
+// Setting it to 'shared' will make the dictionary shared by all users.
+$rcmail_config['spellcheck_dictionary'] = false;
+
// Set the spell checking engine. 'googie' is the default. 'pspell' is also available,
// but requires the Pspell extensions. When using Nox Spell Server, also set 'googie' here.
$rcmail_config['spellcheck_engine'] = 'googie';
@@ -442,6 +446,15 @@ $rcmail_config['spellcheck_uri'] = '';
// Leave empty for default set of available language.
$rcmail_config['spellcheck_languages'] = NULL;
+// Makes that words with all letters capitalized will be ignored (e.g. GOOGLE)
+$rcmail_config['spellcheck_ignore_caps'] = false;
+
+// Makes that words with numbers will be ignored (e.g. g00gle)
+$rcmail_config['spellcheck_ignore_nums'] = false;
+
+// Makes that words with symbols will be ignored (e.g. g@@gle)
+$rcmail_config['spellcheck_ignore_syms'] = false;
+
// don't let users set pagesize to more than this value if set
$rcmail_config['max_pagesize'] = 200;
View
@@ -1595,7 +1595,7 @@ function rcube_html_editor($mode='')
$hook = $RCMAIL->plugins->exec_hook('html_editor', array('mode' => $mode));
if ($hook['abort'])
- return;
+ return;
$lang = strtolower($_SESSION['language']);
@@ -1607,9 +1607,14 @@ function rcube_html_editor($mode='')
$RCMAIL->output->include_script('tiny_mce/tiny_mce.js');
$RCMAIL->output->include_script('editor.js');
- $RCMAIL->output->add_script(sprintf("rcmail_editor_init('\$__skin_path', '%s', %d, '%s');",
- JQ($lang), intval($CONFIG['enable_spellcheck']), $mode),
- 'foot');
+ $RCMAIL->output->add_script(sprintf("rcmail_editor_init(%s)",
+ json_encode(array(
+ 'mode' => $mode,
+ 'skin_path' => '$__skin_path',
+ 'lang' => $lang,
+ 'spellcheck' => intval($CONFIG['enable_spellcheck']),
+ 'spelldict' => intval($CONFIG['spellcheck_dictionary']),
+ ))), 'foot');
}
Oops, something went wrong.

0 comments on commit 66df084

Please sign in to comment.