php_value mbstring.func_overload 0
</IfModule>
-<FilesMatch "(\.inc|\~)$">
- Order allow,deny
- Deny from all
-</FilesMatch>
-
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^favicon.ico$ skins/default/images/favicon.ico
CHANGELOG RoundCube Webmail
----------------------------
+===========================
-- Fix mark popup in IE 7 (#1485369)
-- Fix line-break issue when copy & paste in Firefox (#1485425)
-- Fix autocomplete "unknown server error" (#1485637)
-- Fix STARTTLS before AUTH in SMTP connection (#1484883)
-- Support multiple quota values in QUOTAROOT resonse (#1485626)
-- Only abbreviate file name for IE < 7 browsers (#1485063)
-- Performance: allow setting imap rootdir and delimiter before connect (#1485172)
-- Fix sorting of folders with more than 2 levels (#1485569)
-- Fix search results page jumps in LDAP addressbook (#1485253)
-- Fix empty line before the signature in IE (#1485351)
-- Fix horizontal scrollbar in preview pane on IE (#1484633)
-- Add Robots meta tag in login page and installer (#1484846)
-- Added 'show_images' option, removed 'addrbook_show_images' (#1485597)
-- Option to check for new mails in all folders (#1484374)
-- Don't set client busy when checking for new messages (#1485276)
-- Allow UTF-8 folder names in config (#1485579)
-- Add junk_mbox option configuration in installer (#1485579)
-- Do serverside addressbook queries for autocompletion (#1485531)
-- Allow setting attachment col position in 'list_cols' option
-- Allow override 'list_cols' via skin (#1485577)
-- Fix 'cache' table cleanup on session destroy (#1485516)
-- Increase speed of session destroy and garbage clean up
-- Fix session timeout when DB server got clock skew (#1485490)
-- Fix handling of some malformed messages (#1484438)
-- Speed up raw message body handling
-- Better HTML entities conversion in html2text (#1485519)
-- Fix big memory consumption and speed up searching on servers without SORT capability
-- Fix setting locale to tr_TR, ku and az_AZ (#1485470)
-- Use SORT for searching on servers with SORT capability
-- Added message status filter
-- Fix empty file sending (#1485389)
-- Improved searching with many criterias (calling one SEARCH command)
-- Fix HTML editor initialization on IE (#1485304)
-- Add warning when switching editor mode from html to plain (#1485488)
-- Make identities list scrollable (#1485538)
-- Fix problem with numeric folder names (#1485527)
-- Added BYE response simple support to prevent from endless loops in imap.inc (#1483956)
-- Fix unread message unintentionally marked as read if read_when_deleted=true (#1485409)
-- Remove port number from SERVER_NAME in smtp_helo_host (#1485518)
-- Don't send disposition notification receipts for messages marked as 'read' (#1485523)
-- Added 'keep_alive' and 'min_keep_alive' options (#1485360)
-- Added option 'identities_level', removed 'multiple_identities'
-- Allow deleting identities when multiple_identities=false (#1485435)
-- Added option focus_on_new_message (#1485374)
-- Fix html2text class autoloading on Windows (#1485505)
-- Fix html signature formatting when identity save error occured (#1485426)
-- Add feedback and set busy when moving folder (#1485497)
-- Fix 'Empty' link visibility for some languages e.g. Slovak (#1485489)
-- Fix messages count bar overlapping (#1485270)
-- Fix adding signature in drafts compose mode (#1485484)
-- Fix iil_C_Sort() to support very long and/or divided responses (#1485283)
-- Fix matching case sensitivity when setting identity on reply (#1485480)
-- Prefer default identity on reply
-- Fix imap searching on ISMail server (#1485466)
-- Add css class for flagged messages (#1485464)
-- Write username instead of id in sendmail log (#1485477)
-- Fix htmlspecialchars() use for PHP version < 5.2.3 (#1485475)
-- Fix js keywords escaping in json_serialize() for IE/Opera (#1485472)
-- Added bin/killcache.php script (#1485434)
-- Add support for SJIS, GB2312, BIG5 in rc_detect_encoding()
-- Fix vCard file encoding detection for non-UTF-8 strings (#1485410)
-- Add 'skip_deleted' option in User Preferences (#1485445)
-- Minimize "inline" javascript scripts use (#1485433)
-- Fix css class setting for folders with names matching defined classes names (#1485355)
-- Fix race conditions when changing mailbox
-- Fix spellchecking when switching to html editor (#1485362)
-- Fix compose window width/height (#1485396)
-- Allow calling msgimport.sh/msgexport.sh from any directory (#1485431)
-- Localized filesize units (#1485340)
-- Better handling of "no identity" and "no email in identity" situations (#1485117)
-- Added 'mime_param_folding' option with possibility to choose long/non-ascii attachment names encoding eg. to be readable in MS Outlook/OE (#1485320)
-- Added "advanced options" feature in User Preferences
-- Fix unread counter when displaying cached massage in preview panel (#1485290)
-- Fix htmleditor spellchecking on MS Windows (#1485397)
-- Fix problem with non-ascii attachment names in Mail_mime (#1485267, #1485096)
-- Fix language autodetection (#1485401)
-- Fix button label in folders management (#1485405)
-- Fix collapsed folder not indicating unread msgs count of all subfolders (#1485403)
-- Fix handling of apostrophes in filenames decoded according to rfc2231
-
-RELEASE 0.2-BETA
-
-- Made config files location configurable (#1485215)
-- Reduced memory footprint when forwarding attachments (#1485345)
-- Allow and use spellcheck attribute for input/textarea fields (#1485060)
-- Added icons for forwarded/forwarded+replied messages (#1485257)
-- Added Reply-To to forwarded emails (#1485315)
-- Display progress message for folders create/delete/rename (#1485357)
-- Smart Tags and NOBR tag support in html messages (#1485363, #1485327)
-- Redesign of the identities settings (#1484042)
-- Add config option to disable creation/deletion of identities (#1484498)
-- Added 'sendmail_delay' option to restrict messages sending interval (#1484491)
-- Added vertical splitter for folders list resizing
-- Added possibility to view all headers in message view
-- Fixed splitter drag/resize on Opera (#1485170)
-- Fixed quota img height/width setting from template (#1484857)
-- Refactor drag & drop functionality. Don't rely on browser events anymore (#1484453)
-- Insert "virtual" folders in subscription list (#1484779)
-- Added link to open message in new window
-- Enable export of address book contacts as vCard
-- Add feature to import contacts from vcard files (#1326103)
-- Respect Content-Location headers in multipart/related messages according to RFC2110 (#1484946)
-- Allowed max. attachment size now indicated in compose screen (#1485030)
-- Also capture backspace key in list mode (#1484566)
-- Allow application/pgp parts to be displayed (#1484753)
-- Correctly handle options in mailto-links (#1485228)
-- Immediately save sort_col/sort_order in user prefs (#1485265)
-- Truncate very long (above 50 characters) attachment filenames when displaying
-- Allow to auto-detect client language if none set (#1484434)
-- Auto-detect the client timezone (user configurable)
-- Add RFC2231 header value continuations support for attachment filenames + hack for servers that not support that feature
-- Fix Reply-To header displaying (#1485314)
-- Mark form buttons that provide the most obvious operation (mainaction)
-- Added option 'quota_zero_as_unlimited' (#1484604)
-- Added PRE handling in html2text class (#1484740)
-- Added folder hierarchy collapsing
-- Added options to use syslog instead of log file (#1484850)
-- Added Logging & Debugging section in Installer
-- Fix In-Reply-To and References headers when composing saved draft message (#1485288)
-- Fix html message charset conversion for charsets with underline (#1485287)
-- Fix buttons status after contacts deletion (#1485233)
-- Fix escaping of To: and From: fields when building message body for reply or forward in the HTML editor (#1484904)
-- Use current mailbox name in template (#1485256)
-- Better fix for skipping untagged responses (#1485261)
-- Added pspell support patch by Kris Steinhoff (#1483960)
-- Enable spellchecker for HTML editor (#1485114)
-- Respect spellcheck_uri in tinyMCE spellchecker (#1484196)
-- Case insensitive contacts searching using PostgreSQL (#1485259)
-- Make default imap folders configurable for each user (#1485075)
-- Save outgoing mail to selectable folder (#1324581)
-- Fix hiding of mark menu when clicking th button again (#1484944)
-- Use long date format in print mode (#1485191)
-- Updated TinyMCE to version 3.1.0.1
-- Re-enable autocomplete attribute for login form (#1485211)
-- Check PERMANENTFLAGS before saving $MDNSent flag (#1484963, #1485163)
-- Added flag column on messages list (#1484623)
-- Patched Mail/MimePart.php (http://pear.php.net/bugs/bug.php?id=14232)
-- Allow trash/junk subfolders to be purged (#1485085)
-- Store compose parameters in session and redirect to a unique URL
-- Fixed CRAM-MD5 authentication (#1484819)
-- Fixed forwarding messages with one HTML attachment (#1484442)
-- Fixed encoding of message/rfc822 attachments and image/pjpeg handling (#1484914)
-- Added option to select skin in user preferences
-- Added option to configure displaying of attached images below the message body
-- Added option to display images in messages from known senders (#1484601)
-- User preferences grouped in more fieldsets
-- Fix corrupted MIME headers of messages in Sent folder (#1485111)
-- Fixed bug in MDB2 package: http://pear.php.net/bugs/bug.php?id=14124
-- Use keypress instead of keydown to select list's row (#1484816)
-- Don't call expunge and don't remove message row after message move if flag_for_deletion is set to true (#1485002)
-
-RELEASE 0.2-ALPHA
-
-- Added option to disable autocompletion from selected LDAP address books (#1484922)
-- TLS support in LDAP connections: 'use_tls' property (#1485104)
-- Fixed removing messages from search set after deleting them (#1485106)
-- imap.inc: Fixed iil_C_FetchStructureString() to handle many
- literal strings in response (#1484969)
-- Support for subfolders in default/protected folders (#1484665)
-- Disallowed delimiter in folder name (#1484803)
-- Support " and \ in folder names
-- Escape \ in login (#1484614)
-- Better HTML sanitization with the DOM-based washtml script (#1484701)
-- Fixed sorting of folders with non-ascii characters
-- Fixed Mysql DDL for default identities creation (#1485070)
-- In Preferences added possibility to configure 'read_when_deleted',
- 'mdn_requests', 'flag_for_deletion' options
-- Made IMAP auth type configurable (#1483825)
-- Fixed empty values with FROM_UNIXTIME() in rcube_mdb2 (#1485055)
-- Fixed attachment list on IE 6/7 (#1484807)
-- Fixed JavaScript in compose.html that shows cc/bcc fields if populated
-- Make password input fields of type password in installer (#1484886)
-- Don't attempt to delete cache entries if enable_caching is FALSE (#1485051)
-- Optimized messages sorting on servers without sort capability (#1485049)
-- Corrected message headers decoding when charset isn't specified and improved
- support for native languages (#1485050, #1485048)
-- Expanded LDAP configuration options to support LDAP server writes.
-- Installer: encode special characters in DB username/password (#1485042)
-- Fixed management of folders with national characters in names (#1485036, #1485001)
-- Fixed identities saving when using MDB2 pgsql driver (#1485032)
-- Fixed BCC header reset (#1484997)
-- Improved messages list performance - patch from Justin Heesemann
-- Append skin_path to images location only when it starts with '/' sign (#1484859)
-- Fix IMAP response in message body when message has no body (#1484964)
-- Fixed non-RFC dates formatting (#1484901)
-- Fixed typo in set_charset() (#1484991)
-- Decode entities when inserting HTML signature to plain text message (#1484990)
-- HTML editing is now working with PHP5 updates and TinyMCE v3.0.6
-- Fixed signature loading on Windows (#1484545)
-- Added language support to HTML editing (#1484862)
-- Fixed remove signature when replying (#1333167)
-- Fixed problem with line with a space at the end (#1484916)
-- Fixed <!DOCTYPE> tag filtering (#1484391)
-- Fixed <?xml> tag filtering (#1484403)
-- Added sections (fieldset+label) in Settings interface
-- Mark as read in one action with message preview (#1484972)
-- Deleted redundant quota reads (#1484972)
-- Added options for empty trash and expunge inbox on logout (#1483863)
-- Removed lines wrapping when displaying message
-- Fixed month localization
-- Changed codebase to PHP5 with autoloader
+- Use US-ASCII as failover when Unicode searching fails (#1485762)
+- Fix errors handling in IMAP command continuations (#1485762)
+- Fix FETCH result parsing for servers returning flags at the end of result (#1485763)
+- Fix datetime columns defaults in mysql's DDL (#1485641)
+- Fix attaching more than nine inline images (#1485759)
+- Support 'UNICODE-1-1-UTF-7' alias for UTF-7 encoding (#1485758)
+- Fix mime-type detection using a hard-coded map (#1485311)
+- Don't return empty string if charset conversion failed (#1485757)
+- Disable concurrent autocomplete query results display (#1485743)
+- Fix new lines stripped from message footer (#1485751)
+- Fix IE problem with mouse click autocomplete (#1485739)
+- Fix html body washing on reply/forward + fix attachments handling (#1485676)
+- Fix multiple recipients input parsing (#1485733)
+- Fix replying to message with html attachment (#1485676)
+- Use default_charset for messages without specified charset (#1485661, #1484961)
+- Support non-standard "GMT-XXXX" literal in date header (#1485729)
+- Added TNEF support to decode MS Outlook attachments (winmail.dat)
+- Fix "value continuation" MIME headers by adding required semicolon (#1485727)
+- Fix pressing select all/unread multiple times (#1485723)
+- Fix selecting all unread does not honor new messages (#1485724)
+- Fix some base64 encoded attachments handling (#1485725)
+- Support NGINX as IMAP backend: better BAD response handling (#1485720)
+- Performance fix: don't fetch attachment parts headers twice to parse filename
+- Fix checking for recent messages on various IMAP servers (#1485702)
+- Performance fix: Don't fetch quota and recent messages in "message view" mode
+- Fix displaying of alternative-inside-alternative messages (#1485713)
+- Fix MDNSent flag checking, use arbitrary keywords (asterisk) flag (#1485706)
+- Fix creation of folders with '&' sign in name
+- Fix parsing of email addresses without angle brackets (#1485693)
+- Save spellcheck corrections when switching from plain to html editor (and spellchecking is on)
+- Fix large search results on server without SORT capability (#1485668)
+- Get rid of preg_replace() with eval modifier and create_function usage (#1485686)
+- Bring back <base> and <link> tags in HTML messages
+- Fix XSS vulnerability through background attributes as reported by Julien Cayssol
+- Fix problems with backslash as IMAP hierarchy delimiter (#1484467)
+- Secure vcard export by getting rid of preg's 'e' modifier use (#1485689)
+- Fix authentication when submitting form with existing session (#1485679)
+- Allow absolute URLs to images in HTML messages/sigs (#1485666)
+- Fix message body which contains both inline attachments and emotions
+- Fix SQL query execution errors handling in rcube_mdb2 class (#1485509)
+- Fix address names with '@' sign handling (#1485654)
+- Improve messages display performance
+- Fix messages searching with 'to:' modifier
roundcube user. Here is an example of that procedure:
# mysql
-> CREATE DATABASE roundcubemail;
+> CREATE DATABASE roundcubemail /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
> GRANT ALL PRIVILEGES ON roundcubemail.* TO roundcube@localhost
IDENTIFIED BY 'password';
> quit
which ever is the database superuser):
$ createuser roundcube
-$ createdb -O roundcube roundcubemail
+$ createdb -O roundcube -E UNICODE roundcubemail
$ psql roundcubemail
roundcubemail =# ALTER USER roundcube WITH PASSWORD 'the_new_password';
CREATE TABLE `session` (
`sess_id` varchar(40) NOT NULL,
- `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
- `changed` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `created` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
+ `changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
`ip` varchar(40) NOT NULL,
`vars` text NOT NULL,
PRIMARY KEY(`sess_id`),
`username` varchar(128) NOT NULL,
`mail_host` varchar(128) NOT NULL,
`alias` varchar(128) NOT NULL,
- `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
- `last_login` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `created` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
+ `last_login` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
`language` varchar(5),
`preferences` text,
PRIMARY KEY(`user_id`),
`user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
`del` tinyint(1) NOT NULL DEFAULT '0',
`cache_key` varchar(128) /*!40101 CHARACTER SET ascii COLLATE ascii_general_ci */ NOT NULL,
- `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `created` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
`idx` int(11) UNSIGNED NOT NULL DEFAULT '0',
`uid` int(11) UNSIGNED NOT NULL DEFAULT '0',
`subject` varchar(255) NOT NULL,
`from` varchar(255) NOT NULL,
`to` varchar(255) NOT NULL,
`cc` varchar(255) NOT NULL,
- `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `date` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
`size` int(11) UNSIGNED NOT NULL DEFAULT '0',
`headers` text NOT NULL,
`structure` text,
CREATE TABLE `cache` (
`cache_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`cache_key` varchar(128) /*!40101 CHARACTER SET ascii COLLATE ascii_general_ci */ NOT NULL ,
- `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `created` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
`data` longtext NOT NULL,
`user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY(`cache_id`),
CREATE TABLE `contacts` (
`contact_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
- `changed` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
`del` tinyint(1) NOT NULL DEFAULT '0',
`name` varchar(128) NOT NULL,
`email` varchar(128) NOT NULL,
in your local config/main.inc.php file.
3. Let the update script/installer check your configuration and
update your config files as suggested by the updater.
-4. Run all commands in ./SQL/[yourdbtype].update.sql that are superscribed
- with the currently installed version number.
+4. If suggested by the update script, run all commands in
+ ./SQL/[yourdbtype].update.sql that are superscribed with the
+ currently installed version number.
5. Make sure 'enable_installer' is set to false again.
| bin/html2text.php |
| |
| This file is part of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
| Author: Thomas Bruederli <roundcube@gmail.com> |
+-----------------------------------------------------------------------+
- $Id: html2text.php 2187 2008-12-24 14:19:27Z thomasb $
+ $Id: html2text.php 2237 2009-01-17 01:55:39Z till $
*/
| bin/killcache.php |
| |
| This file is part of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
| Author: Dennis P. Nikolaenko <dennis@nikolaenko.ru> |
+-----------------------------------------------------------------------+
- $Id: killcache.php 1955 2008-10-07 19:11:06Z alec $
+ $Id: killcache.php 2238 2009-01-17 03:27:41Z till $
*/
define('INSTALL_PATH', realpath(dirname(__FILE__).'/..') . '/');
-require INSTALL_PATH.'program/include/iniset.php';
+require INSTALL_PATH . 'program/include/iniset.php';
$config = new rcube_config();
// don't allow public access if not in devel_mode
if (!$config->get('devel_mode') && $_SERVER['REMOTE_ADDR']) {
- header("HTTP/1.0 401 Access denied");
- die("Access denied!");
+ header("HTTP/1.0 401 Access denied");
+ die("Access denied!");
}
+$options = array(
+ 'use_transactions' => false,
+ 'log_line_break' => "\n",
+ 'idxname_format' => '%s',
+ 'debug' => false,
+ 'quote_identifier' => true,
+ 'force_defaults' => false,
+ 'portability' => true
+);
-$dbh =& MDB2::factory($config->get('db_dsnw'), $options);
+$dbh = MDB2::factory($config->get('db_dsnw'), $options);
if (PEAR::isError($dbh)) {
- exit($mdb2->getMessage());
+ exit($mdb2->getMessage());
}
//TODO: transaction here (if supported by DB) would be a good thing
$res =& $dbh->exec("DELETE FROM cache");
if (PEAR::isError($res)) {
- $dbh->disconnect();
- exit($res->getMessage());
-};
+ $dbh->disconnect();
+ exit($res->getMessage());
+}
$res =& $dbh->exec("DELETE FROM messages");
if (PEAR::isError($res)) {
- $dbh->disconnect();
- exit($res->getMessage());
-};
+ $dbh->disconnect();
+ exit($res->getMessage());
+}
echo "Cache cleared\n";
| bin/modcss.php |
| |
| This file is part of the RoundCube Webmail client |
- | Copyright (C) 2007-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2007-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
| Author: Thomas Bruederli <roundcube@gmail.com> |
+-----------------------------------------------------------------------+
- $Id: modcss.php 2187 2008-12-24 14:19:27Z thomasb $
+ $Id: modcss.php 2249 2009-01-22 11:23:00Z thomasb $
*/
$RCMAIL = rcmail::get_instance();
-$source = "";
-if (!empty($RCMAIL->user->ID) && ($url = preg_replace('/[^a-z0-9.-_\?\$&=%]/i', '', $_GET['u'])))
-{
- $a_uri = parse_url($url);
- $port = $a_uri['port'] ? $a_uri['port'] : 80;
- $host = $a_uri['host'];
- $path = $a_uri['path'] . ($a_uri['query'] ? '?'.$a_uri['query'] : '');
+$source = '';
+$error = 'Requires a valid user session and source url';
+if (empty($RCMAIL->user->ID)) {
+ header('HTTP/1.1 403 Forbidden');
+ echo $error;
+ exit;
+}
+
+$url = preg_replace('/[^a-z0-9.-_\?\$&=%]/i', '', $_GET['u']);
+if ($url === null) {
+ header('HTTP/1.1 403 Forbidden');
+ echo $error;
+ exit;
+}
- if ($fp = fsockopen($host, $port, $errno, $errstr, 30))
- {
- $out = "GET $path HTTP/1.0\r\n";
- $out .= "Host: $host\r\n";
- $out .= "Connection: Close\r\n\r\n";
- fwrite($fp, $out);
+$a_uri = parse_url($url);
+$port = $a_uri['port'] ? $a_uri['port'] : 80;
+$host = $a_uri['host'];
+$path = $a_uri['path'] . ($a_uri['query'] ? '?'.$a_uri['query'] : '');
- $header = true;
- while (!feof($fp))
- {
- $line = trim(fgets($fp, 4048));
-
- if ($header && preg_match('/^HTTP\/1\..\s+(\d+)/', $line, $regs) && intval($regs[1]) != 200)
- break;
- else if (empty($line) && $header)
- $header = false;
- else if (!$header)
- $source .= "$line\n";
- }
- fclose($fp);
- }
+if (!($fp = fsockopen($host, $port, $errno, $errstr, 30))) {
+ header('HTTP/1.1 500 Internal Server Error');
+ echo $error;
+ exit;
}
-if (!empty($source))
-{
- header("Content-Type: text/css");
- echo rcmail_mod_css_styles($source, preg_replace('/[^a-z0-9]/i', '', $_GET['c']), $url);
+$out = "GET $path HTTP/1.0\r\n";
+$out .= "Host: $host\r\n";
+$out .= "Connection: Close\r\n\r\n";
+fwrite($fp, $out);
+
+$header = true;
+while (!feof($fp)) {
+ $line = trim(fgets($fp, 4048));
+
+ if ($header
+ && preg_match('/^HTTP\/1\..\s+(\d+)/', $line, $regs)
+ && intval($regs[1]) != 200) {
+ break;
+ } else if (empty($line) && $header) {
+ $header = false;
+ } else if (!$header) {
+ $source .= "$line\n";
+ }
}
-else {
- header("HTTP/1.0 404 Not Found");
- echo "Requires a valid user session and source url";
+fclose($fp);
+
+if (!empty($source)) {
+ header('Content-Type: text/css');
+ echo rcmail_mod_css_styles(
+ $source,
+ preg_replace('/[^a-z0-9]/i', '', $_GET['c']),
+ $url
+ );
+ exit;
}
-?>
+header('HTTP/1.0 404 Not Found');
+echo $error;
+exit;
-#!/usr/bin/php
+#!/usr/bin/env php
<?php
+if (php_sapi_name() != 'cli') {
+ die('Not on the "shell" (php-cli).');
+}
define('INSTALL_PATH', realpath(dirname(__FILE__) . '/..') . '/' );
ini_set('memory_limit', -1);
vputs("IMAP login failed.\n");
}
-?>
\ No newline at end of file
+?>
-#!/usr/bin/php
+#!/usr/bin/env php
<?php
+if (php_sapi_name() != 'cli') {
+ die('Not on the "shell" (php-cli).');
+}
define('INSTALL_PATH', realpath(dirname(__FILE__) . '/..') . '/' );
ini_set('memory_limit', -1);
print "IMAP login failed.\n";
}
-?>
\ No newline at end of file
+?>
| bin/quotaimg.php |
| |
| This file is part of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
| Author: Brett Patterson <brett2@umbc.edu> |
+-----------------------------------------------------------------------+
- $Id: quotaimg.php 2187 2008-12-24 14:19:27Z thomasb $
+ $Id: quotaimg.php 2237 2009-01-17 01:55:39Z till $
*/
-#!/usr/bin/php
+#!/usr/bin/env php
<?php
-
+if (php_sapi_name() != 'cli') {
+ die('Not on the "shell" (php-cli).');
+}
define('INSTALL_PATH', realpath(dirname(__FILE__) . '/..') . '/' );
require_once INSTALL_PATH . 'program/include/iniset.php';
echo "\n";
-?>
\ No newline at end of file
+?>
| Configuration file for database access |
| |
| This file is part of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Main configuration file |
| |
| This file is part of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
$rcmail_config['date_today'] = 'H:i';
// add this user-agent to message headers when sending
-$rcmail_config['useragent'] = 'RoundCube Webmail/0.2';
+$rcmail_config['useragent'] = 'RoundCube Webmail/0.2.1';
// use this name to compose page titles
$rcmail_config['product_name'] = 'RoundCube Webmail';
// o=root
// ou=people
// uid=user@domain
-// mail=contact@contactdomain
-//
+// mail=contact@contactdomain
+//
// So the base_dn would be uid=%fu,ou=people,o=root
// The bind_dn would be the same as based_dn or some super user login.
-/**
+/*
* example config for Verisign directory
*
- * $rcmail_config['ldap_public']['Verisign'] = array(
- * 'name' => 'Verisign.com',
- * 'hosts' => array('directory.verisign.com'),
- * 'port' => 389,
- * 'use_tls' => false,
- * 'user_specific' => false, // If true the base_dn, bind_dn and bind_pass default to the user's IMAP login.
- * // %fu - The full username provided, assumes the username is an email
- * // address, uses the username_domain value if not an email address.
- * // %u - The username prior to the '@'.
- * // %d - The domain name after the '@'.
- * 'base_dn' => '',
- * 'bind_dn' => '',
- * 'bind_pass' => '',
- * 'writable' => false, // Indicates if we can write to the LDAP directory or not.
- * // If writable is true then these fields need to be populated:
- * // LDAP_Object_Classes, required_fields, LDAP_rdn
- * 'LDAP_Object_Classes' => array("top", "inetOrgPerson"), // To create a new contact these are the object classes to specify (or any other classes you wish to use).
- * 'required_fields' => array("cn", "sn", "mail"), // The required fields needed to build a new contact as required by the object classes (can include additional fields not required by the object classes).
- * 'LDAP_rdn' => 'mail', // The RDN field that is used for new entries, this field needs to be one of the search_fields, the base of base_dn is appended to the RDN to insert into the LDAP directory.
- * 'ldap_version' => 3, // using LDAPv3
- * 'search_fields' => array('mail', 'cn'), // fields to search in
- * 'name_field' => 'cn', // this field represents the contact's name
- * 'email_field' => 'mail', // this field represents the contact's e-mail
- * 'surname_field' => 'sn', // this field represents the contact's last name
- * 'firstname_field' => 'gn', // this field represents the contact's first name
- * 'sort' => 'cn', // The field to sort the listing by.
- * 'scope' => 'sub', // search mode: sub|base|list
- * 'filter' => '', // used for basic listing (if not empty) and will be &'d with search queries. example: status=act
- * 'fuzzy_search' => true); // server allows wildcard search
- */
+$rcmail_config['ldap_public']['Verisign'] = array(
+ 'name' => 'Verisign.com',
+ 'hosts' => array('directory.verisign.com'),
+ 'port' => 389,
+ 'use_tls' => false,
+ 'user_specific' => false, // If true the base_dn, bind_dn and bind_pass default to the user's IMAP login.
+ // %fu - The full username provided, assumes the username is an email
+ // address, uses the username_domain value if not an email address.
+ // %u - The username prior to the '@'.
+ // %d - The domain name after the '@'.
+ 'base_dn' => '',
+ 'bind_dn' => '',
+ 'bind_pass' => '',
+ 'writable' => false, // Indicates if we can write to the LDAP directory or not.
+ // If writable is true then these fields need to be populated:
+ // LDAP_Object_Classes, required_fields, LDAP_rdn
+ 'LDAP_Object_Classes' => array("top", "inetOrgPerson"), // To create a new contact these are the object classes to specify (or any other classes you wish to use).
+ 'required_fields' => array("cn", "sn", "mail"), // The required fields needed to build a new contact as required by the object classes (can include additional fields not required by the object classes).
+ 'LDAP_rdn' => 'mail', // The RDN field that is used for new entries, this field needs to be one of the search_fields, the base of base_dn is appended to the RDN to insert into the LDAP directory.
+ 'ldap_version' => 3, // using LDAPv3
+ 'search_fields' => array('mail', 'cn'), // fields to search in
+ 'name_field' => 'cn', // this field represents the contact's name
+ 'email_field' => 'mail', // this field represents the contact's e-mail
+ 'surname_field' => 'sn', // this field represents the contact's last name
+ 'firstname_field' => 'gn', // this field represents the contact's first name
+ 'sort' => 'cn', // The field to sort the listing by.
+ 'scope' => 'sub', // search mode: sub|base|list
+ 'filter' => '', // used for basic listing (if not empty) and will be &'d with search queries. example: status=act
+ 'fuzzy_search' => true); // server allows wildcard search
+*/
// An ordered array of the ids of the addressbooks that should be searched
// when populating address autocomplete fields server-side. ex: array('sql','Verisign');
--- /dev/null
+<?php
+
+return array(
+ 'xls' => 'application/vnd.ms-excel',
+ 'xlm' => 'application/vnd.ms-excel',
+ 'xla' => 'application/vnd.ms-excel',
+ 'xlc' => 'application/vnd.ms-excel',
+ 'xlt' => 'application/vnd.ms-excel',
+ 'xlw' => 'application/vnd.ms-excel',
+ 'ppt' => 'application/vnd.ms-powerpoint',
+ 'pps' => 'application/vnd.ms-powerpoint',
+ 'pot' => 'application/vnd.ms-powerpoint',
+ 'doc' => 'application/msword',
+ 'dot' => 'application/msword',
+ 'odc' => 'application/vnd.oasis.opendocument.chart',
+ 'otc' => 'application/vnd.oasis.opendocument.chart-template',
+ 'odf' => 'application/vnd.oasis.opendocument.formula',
+ 'otf' => 'application/vnd.oasis.opendocument.formula-template',
+ 'odg' => 'application/vnd.oasis.opendocument.graphics',
+ 'otg' => 'application/vnd.oasis.opendocument.graphics-template',
+ 'odi' => 'application/vnd.oasis.opendocument.image',
+ 'oti' => 'application/vnd.oasis.opendocument.image-template',
+ 'odp' => 'application/vnd.oasis.opendocument.presentation',
+ 'otp' => 'application/vnd.oasis.opendocument.presentation-template',
+ 'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
+ 'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template',
+ 'odt' => 'application/vnd.oasis.opendocument.text',
+ 'otm' => 'application/vnd.oasis.opendocument.text-master',
+ 'ott' => 'application/vnd.oasis.opendocument.text-template',
+ 'oth' => 'application/vnd.oasis.opendocument.text-web',
+ 'docm' => 'application/vnd.ms-word.document.macroEnabled.12',
+ 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
+ 'dotm' => 'application/vnd.ms-word.template.macroEnabled.12',
+ 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
+ 'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12',
+ 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
+ 'pptm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12',
+ 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
+ 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12',
+ 'xlsm' => 'application/vnd.ms-excel.sheet.macroEnabled.12',
+ 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
+ 'xps' => 'application/vnd.ms-xpsdocument',
+ 'rar' => 'application/x-rar-compressed',
+);
+
+?>
\ No newline at end of file
/*
+-------------------------------------------------------------------------+
| RoundCube Webmail IMAP Client |
- | Version 0.2-stable |
+ | Version 0.2.1 |
| |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| |
| This program is free software; you can redistribute it and/or modify |
| it under the terms of the GNU General Public License version 2 |
| Author: Thomas Bruederli <roundcube@gmail.com> |
+-------------------------------------------------------------------------+
- $Id: index.php 2201 2008-12-30 14:33:28Z thomasb $
+ $Id: index.php 2348 2009-03-10 08:13:26Z thomasb $
*/
// try to log in
if ($RCMAIL->action=='login' && $RCMAIL->task=='mail') {
+ // purge the session in case of new login when a session already exists
+ $RCMAIL->kill_session();
+
+ // set IMAP host
$host = $RCMAIL->autoselect_host();
// check if client supports cookies
set_include_path($include_path);
+require_once 'rcube_shared.inc';
require_once 'utils.php';
session_start();
</ol>
<?php
-$include_steps = array('welcome.html', 'check.php', 'config.php', 'test.php');
+$include_steps = array('./welcome.html', './check.php', './config.php', './test.php');
if ($include_steps[$RCI->step]) {
include $include_steps[$RCI->step];
| rcube_install.php |
| |
| This file is part of the RoundCube Webmail package |
- | Copyright (C) 2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2008-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU Public License |
+-----------------------------------------------------------------------+
| program/include/html.php |
| |
| This file is part of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev, - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev, - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
| program/include/iniset.php |
| |
| This file is part of the RoundCube Webmail client |
- | Copyright (C) 2008, RoundCube Dev, - Switzerland |
+ | Copyright (C) 2008-2009, RoundCube Dev, - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
// application constants
-define('RCMAIL_VERSION', '0.2-stable');
+define('RCMAIL_VERSION', '0.2.1');
define('RCMAIL_CHARSET', 'UTF-8');
define('JS_OBJECT_NAME', 'rcmail');
die('Fatal error: ini_set/set_include_path does not work.');
}
+ini_set('error_reporting', E_ALL&~E_NOTICE);
+if (isset($_SERVER['HTTPS'])) {
+ ini_set('session.cookie_secure', ($_SERVER['HTTPS'] && ($_SERVER['HTTPS'] != 'off'))?1:0);
+} else {
+ ini_set('session.cookie_secure', 0);
+}
ini_set('session.name', 'roundcube_sessid');
ini_set('session.use_cookies', 1);
ini_set('session.only_use_cookies', 1);
-ini_set('session.cookie_secure', ($_SERVER['HTTPS'] && ($_SERVER['HTTPS'] != 'off')));
-ini_set('error_reporting', E_ALL&~E_NOTICE);
set_magic_quotes_runtime(0);
// increase maximum execution time for php scripts
* Use PHP5 autoload for dynamic class loading
*
* @todo Make Zend, PEAR etc play with this
+ * @todo Make our classes conform to a more straight forward CS.
*/
function __autoload($classname)
{
),
$classname
);
- include_once $filename. '.php';
+ include $filename. '.php';
}
/**
// set PEAR error handling (will also load the PEAR main class)
PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'rcube_pear_error');
-
| program/include/main.inc |
| |
| This file is part of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev, - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev, - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
| Author: Thomas Bruederli <roundcube@gmail.com> |
+-----------------------------------------------------------------------+
- $Id: main.inc 2187 2008-12-24 14:19:27Z thomasb $
+ $Id: main.inc 2321 2009-03-01 08:14:14Z alec $
*/
$to = $to==NULL ? strtoupper(RCMAIL_CHARSET) : strtoupper($to);
$error = false; $conv = null;
+ # RFC1642
+ if ($from == 'UNICODE-1-1-UTF-7')
+ $from = 'UTF-7';
+ if ($to == 'UNICODE-1-1-UTF-7')
+ $to = 'UTF-7';
+
if ($from==$to || $str=='' || empty($from))
return $str;
);
// convert charset using iconv module
- if (function_exists('iconv') && $from != 'UTF-7' && $to != 'UTF-7')
- {
+ if (function_exists('iconv') && $from != 'UTF-7' && $to != 'UTF-7') {
$aliases['GB2312'] = 'GB18030';
$_iconv = iconv(($aliases[$from] ? $aliases[$from] : $from), ($aliases[$to] ? $aliases[$to] : $to) . "//IGNORE", $str);
- if ($_iconv !== false)
- {
+ if ($_iconv !== false) {
return $_iconv;
- }
}
-
+ }
if (is_null($mbstring_loaded))
$mbstring_loaded = extension_loaded('mbstring');
// convert charset using mbstring module
- if ($mbstring_loaded)
- {
+ if ($mbstring_loaded) {
$aliases['UTF-7'] = 'UTF7-IMAP';
$aliases['WINDOWS-1257'] = 'ISO-8859-13';
$mb_to = $aliases[$to] ? $aliases[$to] : $to;
// return if encoding found, string matches encoding and convert succeeded
- if (in_array($mb_from, $mbstring_list) && in_array($mb_to, $mbstring_list))
- if (mb_check_encoding($str, $mb_from))
- if ($out = mb_convert_encoding($str, $mb_to, $mb_from))
- return $out;
+ if (in_array($mb_from, $mbstring_list) && in_array($mb_to, $mbstring_list)) {
+ if (mb_check_encoding($str, $mb_from) && ($out = mb_convert_encoding($str, $mb_to, $mb_from)))
+ return $out;
}
-
-
+ }
+
+ # try to convert with custom classes
if (class_exists('utf8'))
$conv = new utf8();
// convert string to UTF-8
- if ($from == 'UTF-7')
- $str = utf7_to_utf8($str);
- else if (($from == 'ISO-8859-1') && function_exists('utf8_encode'))
+ if ($from == 'UTF-7') {
+ if ($_str = utf7_to_utf8($str))
+ $str = $_str;
+ }
+ else if (($from == 'ISO-8859-1') && function_exists('utf8_encode')) {
$str = utf8_encode($str);
- else if ($from != 'UTF-8' && $conv)
- {
+ }
+ else if ($from != 'UTF-8' && $conv) {
$conv->loadCharset($from);
$str = $conv->strToUtf8($str);
- }
- else if ($from != 'UTF-8')
+ }
+ else if ($from != 'UTF-8') {}
$error = true;
// encode string for output
- if ($to == 'UTF-7')
+ if ($to == 'UTF-7') {
return utf8_to_utf7($str);
- else if ($to == 'ISO-8859-1' && function_exists('utf8_decode'))
+ }
+ else if ($to == 'ISO-8859-1' && function_exists('utf8_decode')) {
return utf8_decode($str);
- else if ($to != 'UTF-8' && $conv)
- {
+ }
+ else if ($to != 'UTF-8' && $conv) {
$conv->loadCharset($to);
return $conv->utf8ToStr($str);
- }
- else if ($to != 'UTF-8')
+ }
+ else if ($to != 'UTF-8') {
$error = true;
-
+ }
+
// report error
- if ($error && !$convert_warning)
- {
+ if ($error && !$convert_warning){
raise_error(array(
'code' => 500,
'type' => 'php',
), true, false);
$convert_warning = true;
- }
+ }
// return UTF-8 string
return $str;
* @param string Container ID to use as prefix
* @return string Modified CSS source
*/
-function rcmail_mod_css_styles($source, $container_id, $base_url = '')
+function rcmail_mod_css_styles($source, $container_id)
{
- $a_css_values = array();
$last_pos = 0;
+ $replacements = new rcube_string_replacer;
// ignore the whole block if evil styles are detected
$stripped = preg_replace('/[^a-z\(:]/', '', rcmail_xss_entitiy_decode($source));
if (preg_match('/expression|behavior|url\(|import/', $stripped))
- return '';
+ return '/* evil! */';
// cut out all contents between { and }
while (($pos = strpos($source, '{', $last_pos)) && ($pos2 = strpos($source, '}', $pos)))
{
- $key = sizeof($a_css_values);
- $a_css_values[$key] = substr($source, $pos+1, $pos2-($pos+1));
- $source = substr($source, 0, $pos+1) . "<<str_replacement[$key]>>" . substr($source, $pos2, strlen($source)-$pos2);
+ $key = $replacements->add(substr($source, $pos+1, $pos2-($pos+1)));
+ $source = substr($source, 0, $pos+1) . $replacements->get_replacement($key) . substr($source, $pos2, strlen($source)-$pos2);
$last_pos = $pos+2;
}
-
+
// remove html comments and add #container to each tag selector.
// also replace body definition because we also stripped off the <body> tag
$styles = preg_replace(
),
$source);
- // replace all @import statements to modify the imported CSS sources too
- $styles = preg_replace_callback(
- '/@import\s+(url\()?[\'"]?([^\)\'"]+)[\'"]?(\))?/im',
- create_function('$matches', "return sprintf(\"@import url('./bin/modcss.php?u=%s&c=%s')\", urlencode(make_absolute_url(\$matches[2],'$base_url')), urlencode('$container_id'));"),
- $styles);
-
// put block contents back in
- $styles = preg_replace_callback(
- '/<<str_replacement\[([0-9]+)\]>>/',
- create_function('$matches', "\$values = ".var_export($a_css_values, true)."; return \$values[\$matches[1]];"),
- $styles);
+ $styles = $replacements->resolve($styles);
return $styles;
}
function rcmail_xss_entitiy_decode($content)
{
$out = html_entity_decode(html_entity_decode($content));
- $out = preg_replace_callback('/\\\([0-9a-f]{4})/i', create_function('$matches', 'return chr(hexdec($matches[1]));'), $out);
+ $out = preg_replace_callback('/\\\([0-9a-f]{4})/i', 'rcmail_xss_entitiy_decode_callback', $out);
$out = preg_replace('#/\*.*\*/#Um', '', $out);
return $out;
}
+/**
+ * preg_replace_callback callback for rcmail_xss_entitiy_decode_callback
+ *
+ * @param array matches result from preg_replace_callback
+ * @return string decoded entity
+ */
+function rcmail_xss_entitiy_decode_callback($matches)
+{
+ return chr(hexdec($matches[1]));
+}
+
/**
* Compose a valid attribute string for HTML tags
*
$ts = $date;
else if (!empty($date))
{
+ // support non-standard "GMTXXXX" literal
+ $date = preg_replace('/GMT\s*([+-][0-9]+)/', '\\1', $date);
// if date parsing fails, we have a date in non-rfc format.
// remove token from the end and try again
while ((($ts = @strtotime($date))===false) || ($ts < 0))
$OUTPUT->add_script('rcmail_editor_init("$__skin_path", "'.JQ($tinylang).'", '.intval($CONFIG['enable_spellcheck']).', "'.$mode.'");');
}
+
+
+/**
+ * Helper class to turn relative urls into absolute ones
+ * using a predefined base
+ */
+class rcube_base_replacer
+{
+ private $base_url;
+
+ public function __construct($base)
+ {
+ $this->base_url = $base;
+ }
+
+ public function callback($matches)
+ {
+ return $matches[1] . '="' . make_absolute_url($matches[3], $this->base_url) . '"';
+ }
+}
+
?>
| program/include/rcmail.php |
| |
| This file is part of the RoundCube Webmail client |
- | Copyright (C) 2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2008-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
/**
* This implements the 'singleton' design pattern
*
- * @return object qvert The one and only instance
+ * @return object rcmail The one and only instance
*/
static function get_instance()
{
| program/include/rcube_browser.php |
| |
| This file is part of the RoundCube Webmail client |
- | Copyright (C) 2007-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2007-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
| program/include/rcube_config.php |
| |
| This file is part of the RoundCube Webmail client |
- | Copyright (C) 2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2008-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
| program/include/rcube_contacts.php |
| |
| This file is part of the RoundCube Webmail client |
- | Copyright (C) 2006-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2006-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
| program/include/rcube_html_page.php |
| |
| This file is part of the RoundCube PHP suite |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| CONTENTS: |
| program/include/rcube_imap.php |
| |
| This file is part of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
| Author: Thomas Bruederli <roundcube@gmail.com> |
+-----------------------------------------------------------------------+
- $Id: rcube_imap.php 2189 2008-12-25 08:33:21Z alec $
+ $Id: rcube_imap.php 2335 2009-03-06 20:58:32Z alec $
*/
*/
require_once('lib/imap.inc');
require_once('lib/mime.inc');
+require_once('lib/tnef_decoder.inc');
/**
*/
function check_permflag($flag)
{
- $flagsmap = $GLOBALS['IMAP_FLAGS'];
- return (($imap_flag = $flagsmap[strtoupper($flag)]) && in_array_nocase($imap_flag, $this->conn->permanentflags));
+ $flag = strtoupper($flag);
+ $imap_flag = $GLOBALS['IMAP_FLAGS'][$flag];
+ return (in_array_nocase($imap_flag, $this->conn->permanentflags));
}
$cnt = count($msgs);
if ($cnt > 300 && $cnt > $this->page_size) { // experimantal value for best result
// use memory less expensive (and quick) method for big result set
- $a_index = $this->message_index($mailbox, $this->sort_field, $this->sort_order);
+ $a_index = $this->message_index('', $this->sort_field, $this->sort_order);
// get messages uids for one page...
- $msgs = array_slice(array_keys($a_index), $start_msg, min($cnt-$start_msg, $this->page_size));
+ $msgs = array_slice($a_index, $start_msg, min($cnt-$start_msg, $this->page_size));
// ...and fetch headers
$this->_fetch_headers($mailbox, join(',', $msgs), $a_msg_headers, NULL);
$results = $this->_search_index($mailbox, $str, $charset, $sort_field);
- // try search with ISO charset (should be supported by server)
+ // try search with US-ASCII charset (should be supported by server)
// only if UTF-8 search is not supported
- if (empty($results) && !is_array($results) && !empty($charset) && $charset!='ISO-8859-1')
+ if (empty($results) && !is_array($results) && !empty($charset) && $charset!='US-ASCII')
{
- // convert strings to ISO-8859-1
+ // convert strings to US_ASCII
if(preg_match_all('/\{([0-9]+)\}\r\n/', $str, $matches, PREG_OFFSET_CAPTURE))
{
$last = 0; $res = '';
{
$string_offset = $m[1] + strlen($m[0]) + 4; // {}\r\n
$string = substr($str, $string_offset - 1, $m[0]);
- $string = rcube_charset_convert($string, $charset, 'ISO-8859-1');
+ $string = rcube_charset_convert($string, $charset, 'US-ASCII');
+ if (!$string) continue;
$res .= sprintf("%s{%d}\r\n%s", substr($str, $last, $m[1] - $last - 1), strlen($string), $string);
$last = $m[0] + $string_offset - 1;
}
else // strings for conversion not found
$res = $str;
- $results = $this->search($mbox_name, $res, 'ISO-8859-1', $sort_field);
+ $results = $this->search($mbox_name, $res, 'US-ASCII', $sort_field);
}
$this->set_search_set($str, $results, $charset, $sort_field);
* @param int Message ID
* @param string Mailbox to read from
* @param boolean True if $id is the message UID
+ * @param boolean True if we need also BODYSTRUCTURE in headers
* @return object Message headers representation
*/
- function get_headers($id, $mbox_name=NULL, $is_uid=TRUE)
+ function get_headers($id, $mbox_name=NULL, $is_uid=TRUE, $bodystr=FALSE)
{
$mailbox = $mbox_name ? $this->_mod_mailbox($mbox_name) : $this->mailbox;
$uid = $is_uid ? $id : $this->_id2uid($id);
if ($uid && ($headers = &$this->get_cached_message($mailbox.'.msg', $uid)))
return $headers;
- $headers = iil_C_FetchHeader($this->conn, $mailbox, $id, $is_uid);
+ $headers = iil_C_FetchHeader($this->conn, $mailbox, $id, $is_uid, $bodystr);
// write headers cache
if ($headers)
* an object structure similar to the one generated by PEAR::Mail_mimeDecode
*
* @param int Message UID to fetch
+ * @param string Message BODYSTRUCTURE string (optional)
* @return object rcube_message_part Message part tree or False on failure
*/
- function &get_structure($uid)
+ function &get_structure($uid, $structure_str='')
{
$cache_key = $this->mailbox.'.msg';
$headers = &$this->get_cached_message($cache_key, $uid, true);
return FALSE;
}
- $structure_str = iil_C_FetchStructureString($this->conn, $this->mailbox, $msg_id);
+ if (!$structure_str)
+ $structure_str = iil_C_FetchStructureString($this->conn, $this->mailbox, $msg_id);
$structure = iml_GetRawStructureArray($structure_str);
$struct = false;
*
* @access private
*/
- function &_structure_part($part, $count=0, $parent='')
+ function &_structure_part($part, $count=0, $parent='', $raw_headers=null)
{
$struct = new rcube_message_part;
$struct->mime_id = empty($parent) ? (string)$count : "$parent.$count";
$struct->mimetype = 'multipart/'.$struct->ctype_secondary;
+ // build parts list for headers pre-fetching
+ for ($i=0, $count=0; $i<count($part); $i++)
+ if (is_array($part[$i]) && count($part[$i]) > 3)
+ // fetch message headers if message/rfc822 or named part (could contain Content-Location header)
+ if (strtolower($part[$i][0]) == 'message' ||
+ (in_array('name', (array)$part[$i][2]) && (empty($part[$i][3]) || $part[$i][3]=='NIL'))) {
+ $part_headers[] = $struct->mime_id ? $struct->mime_id.'.'.$i+1 : $i+1;
+ }
+
+ // pre-fetch headers of all parts (in one command for better performance)
+ if ($part_headers)
+ $part_headers = iil_C_FetchMIMEHeaders($this->conn, $this->mailbox, $this->_msg_id, $part_headers);
+
$struct->parts = array();
for ($i=0, $count=0; $i<count($part); $i++)
if (is_array($part[$i]) && count($part[$i]) > 3)
- $struct->parts[] = $this->_structure_part($part[$i], ++$count, $struct->mime_id);
-
+ $struct->parts[] = $this->_structure_part($part[$i], ++$count, $struct->mime_id,
+ $part_headers[$struct->mime_id ? $struck->mime_id.'.'.$i+1 : $i+1]);
+
return $struct;
}
// fetch message headers if message/rfc822 or named part (could contain Content-Location header)
if ($struct->ctype_primary == 'message' || ($struct->ctype_parameters['name'] && !$struct->content_id)) {
- $part_headers = iil_C_FetchPartHeader($this->conn, $this->mailbox, $this->_msg_id, $struct->mime_id);
- $struct->headers = $this->_parse_headers($part_headers) + $struct->headers;
+ if (empty($raw_headers))
+ $raw_headers = iil_C_FetchPartHeader($this->conn, $this->mailbox, $this->_msg_id, $struct->mime_id);
+ $struct->headers = $this->_parse_headers($raw_headers) + $struct->headers;
}
if ($struct->ctype_primary=='message') {
}
// normalize filename property
- $this->_set_part_filename($struct);
+ $this->_set_part_filename($struct, $raw_headers);
return $struct;
}
*
* @access private
* @param object rcube_message_part Part object
+ * @param string Part's raw headers
*/
- function _set_part_filename(&$part)
+ function _set_part_filename(&$part, $headers=null)
{
if (!empty($part->d_parameters['filename']))
$filename_mime = $part->d_parameters['filename'];
}
// some servers (eg. dovecot-1.x) have no support for parameter value continuations
// we must fetch and parse headers "manually"
- //TODO: fetching headers for a second time is not effecient, this code should be moved somewhere earlier --tensor
if ($i<2) {
- // TODO: fetch only Content-Type/Content-Disposition header
- $headers = iil_C_FetchPartHeader($this->conn, $this->mailbox, $this->_msg_id, $part->mime_id);
+ if (!$headers)
+ $headers = iil_C_FetchPartHeader($this->conn, $this->mailbox, $this->_msg_id, $part->mime_id);
$filename_mime = '';
$i = 0;
while (preg_match('/filename\*'.$i.'\s*=\s*"*([^"\n;]+)[";]*/', $headers, $matches)) {
$i++;
}
if ($i<2) {
- $headers = iil_C_FetchPartHeader($this->conn, $this->mailbox, $this->_msg_id, $part->mime_id);
+ if (!$headers)
+ $headers = iil_C_FetchPartHeader($this->conn, $this->mailbox, $this->_msg_id, $part->mime_id);
$filename_encoded = '';
$i = 0; $matches = array();
while (preg_match('/filename\*'.$i.'\*\s*=\s*"*([^"\n;]+)[";]*/', $headers, $matches)) {
$i++;
}
if ($i<2) {
- $headers = iil_C_FetchPartHeader($this->conn, $this->mailbox, $this->_msg_id, $part->mime_id);
+ if (!$headers)
+ $headers = iil_C_FetchPartHeader($this->conn, $this->mailbox, $this->_msg_id, $part->mime_id);
$filename_mime = '';
$i = 0; $matches = array();
while (preg_match('/\s+name\*'.$i.'\s*=\s*"*([^"\n;]+)[";]*/', $headers, $matches)) {
$i++;
}
if ($i<2) {
- $headers = iil_C_FetchPartHeader($this->conn, $this->mailbox, $this->_msg_id, $part->mime_id);
+ if (!$headers)
+ $headers = iil_C_FetchPartHeader($this->conn, $this->mailbox, $this->_msg_id, $part->mime_id);
$filename_encoded = '';
$i = 0; $matches = array();
while (preg_match('/\s+name\*'.$i.'\*\s*=\s*"*([^"\n;]+)[";]*/', $headers, $matches)) {
*/
function save_message($mbox_name, &$message)
{
- $mbox_name = stripslashes($mbox_name);
$mailbox = $this->_mod_mailbox($mbox_name);
// make sure mailbox exists
*/
function move_message($uids, $to_mbox, $from_mbox='')
{
- $to_mbox_in = stripslashes($to_mbox);
- $from_mbox = stripslashes($from_mbox);
- $to_mbox = $this->_mod_mailbox($to_mbox_in);
+ $to_mbox = $this->_mod_mailbox($to_mbox);
$from_mbox = $from_mbox ? $this->_mod_mailbox($from_mbox) : $this->mailbox;
// make sure mailbox exists
- if (!in_array($to_mbox, $this->_list_mailboxes()))
+ if ($to_mbox != 'INBOX' && !in_array($to_mbox, $this->_list_mailboxes()))
{
if (in_array($to_mbox_in, $this->default_folders))
$this->create_mailbox($to_mbox_in, TRUE);
*/
function delete_message($uids, $mbox_name='')
{
- $mbox_name = stripslashes($mbox_name);
$mailbox = $mbox_name ? $this->_mod_mailbox($mbox_name) : $this->mailbox;
// convert the list of uids to array
*/
function clear_mailbox($mbox_name=NULL)
{
- $mbox_name = stripslashes($mbox_name);
$mailbox = !empty($mbox_name) ? $this->_mod_mailbox($mbox_name) : $this->mailbox;
$msg_count = $this->_messagecount($mailbox, 'ALL');
*/
function expunge($mbox_name='', $clear_cache=TRUE)
{
- $mbox_name = stripslashes($mbox_name);
$mailbox = $mbox_name ? $this->_mod_mailbox($mbox_name) : $this->mailbox;
return $this->_expunge($mailbox, $clear_cache);
}
{
$result = FALSE;
- // replace backslashes
- $name = preg_replace('/[\\\]+/', '-', $name);
-
// reduce mailbox name to 100 chars
$name = substr($name, 0, 100);
{
$result = FALSE;
- // replace backslashes
- $name = preg_replace('/[\\\]+/', '-', $new_name);
-
// encode mailbox name and reduce it to 100 chars
$name = substr($new_name, 0, 100);
{
if (empty($key) || !is_object($headers) || empty($headers->uid))
return;
-
+
// add to internal (fast) cache
$this->cache['__single_msg'][$headers->uid] = $headers;
$this->cache['__single_msg'][$headers->uid]->structure = $struct;
return $out;
}
+
+
+ /**
+ * Decode a Microsoft Outlook TNEF part (winmail.dat)
+ *
+ * @param object rcube_message_part Message part to decode
+ * @param string UID of the message
+ * @return array List of rcube_message_parts extracted from windmail.dat
+ */
+ function tnef_decode(&$part, $uid)
+ {
+ if (!isset($part->body))
+ $part->body = $this->get_message_part($uid, $part->mime_id, $part);
+
+ $pid = 0;
+ $tnef_parts = array();
+ $tnef_arr = tnef_decode($part->body);
+ foreach ($tnef_arr as $winatt) {
+ $tpart = new rcube_message_part;
+ $tpart->filename = $winatt["name"];
+ $tpart->encoding = 'stream';
+ $tpart->ctype_primary = $winatt["type0"];
+ $tpart->ctype_secondary = $winatt["type1"];
+ $tpart->mimetype = strtolower($winatt["type0"] . "/" . $winatt["type1"]);
+ $tpart->mime_id = "winmail." . $part->mime_id . ".$pid";
+ $tpart->size = $winatt["size"];
+ $tpart->body = $winatt['stream'];
+
+ $tnef_parts[] = $tpart;
+ $pid++;
+ }
+
+ return $tnef_parts;
+ }
/**
function _parse_address_list($str, $decode=true)
{
// remove any newlines and carriage returns before
- $a = $this->_explode_quoted_string('[,;]', preg_replace( "/[\r\n]/", " ", $str));
+ $a = rcube_explode_quoted_string('[,;]', preg_replace( "/[\r\n]/", " ", $str));
$result = array();
-
+
foreach ($a as $key => $val)
{
$val = preg_replace("/([\"\w])</", "$1 <", $val);
- $sub_a = $this->_explode_quoted_string(' ', $decode ? $this->decode_header($val) : $val);
+ $sub_a = rcube_explode_quoted_string(' ', $decode ? $this->decode_header($val) : $val);
$result[$key]['name'] = '';
foreach ($sub_a as $k => $v)
{
- if (strpos($v, '@') > 0)
- $result[$key]['address'] = str_replace('<', '', str_replace('>', '', $v));
+ // use angle brackets in regexp to not handle names with @ sign
+ if (preg_match('/^<\S+@\S+>$/', $v))
+ $result[$key]['address'] = trim($v, '<>');
else
$result[$key]['name'] .= (empty($result[$key]['name'])?'':' ').str_replace("\"",'',stripslashes($v));
}
if (empty($result[$key]['name']))
$result[$key]['name'] = $result[$key]['address'];
+ elseif (empty($result[$key]['address']))
+ $result[$key]['address'] = $result[$key]['name'];
}
return $result;
}
-
- /**
- * @access private
- */
- function _explode_quoted_string($delimiter, $string)
- {
- $result = array();
- $strlen = strlen($string);
- for ($q=$p=$i=0; $i < $strlen; $i++)
- {
- if ($string{$i} == "\"" && $string{$i-1} != "\\")
- $q = $q ? false : true;
- else if (!$q && preg_match("/$delimiter/", $string{$i}))
- {
- $result[] = substr($string, $p, $i - $p);
- $p = $i + 1;
- }
- }
-
- $result[] = substr($string, $p);
- return $result;
- }
-
} // end class rcube_imap
| program/include/rcube_json_output.php |
| |
| This file is part of the RoundCube Webmail client |
- | Copyright (C) 2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2008-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
| program/include/rcube_ldap.php |
| |
| This file is part of the RoundCube Webmail client |
- | Copyright (C) 2006-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2006-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
| Author: Thomas Bruederli <roundcube@gmail.com> |
+-----------------------------------------------------------------------+
- $Id: rcube_ldap.php 2157 2008-12-16 15:28:07Z thomasb $
+ $Id: rcube_ldap.php 2237 2009-01-17 01:55:39Z till $
*/
global $RCMAIL;
if (!function_exists('ldap_connect'))
- raise_error(array('type' => 'ldap', 'message' => "No ldap support in this installation of PHP"), true);
+ raise_error(array('code' => 100, 'type' => 'ldap', 'message' => "No ldap support in this installation of PHP"), true);
if (is_resource($this->conn))
return true;
$this->ready = $this->bind($this->prop['bind_dn'], $this->prop['bind_pass']);
}
else
- raise_error(array('type' => 'ldap', 'message' => "Could not connect to any LDAP server, tried $host:{$this->prop[port]} last"), true);
+ raise_error(array('code' => 100, 'type' => 'ldap', 'message' => "Could not connect to any LDAP server, tried $host:{$this->prop[port]} last"), true);
// See if the directory is writeable.
if ($this->prop['writable']) {
| program/include/rcube_mail_mime.php |
| |
| This file is part of the RoundCube Webmail client |
- | Copyright (C) 2007-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2007-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
{
// if header contains e-mail addresses
if (preg_match('/\s<.+@[a-z0-9\-\.]+\.[a-z]+>/U', $hdr_value)) {
- $chunks = $this->_explode_quoted_string(',', $hdr_value);
+ $chunks = rcube_explode_quoted_string(',', $hdr_value);
}
else {
$chunks = array($hdr_value);
}
- function _explode_quoted_string($delimiter, $string)
- {
- $result = array();
- $strlen = strlen($string);
- for ($q=$p=$i=0; $i < $strlen; $i++) {
- if ($string{$i} == "\"" && $string{$i-1} != "\\") {
- $q = $q ? false : true;
- }
- else if (!$q && $string{$i} == $delimiter) {
- $result[] = substr($string, $p, $i - $p);
- $p = $i + 1;
- }
- }
-
- $result[] = substr($string, $p);
- return $result;
- }
-
/**
* Provides caching of body of constructed MIME Message to avoid
* duplicate construction of message and damage of MIME headers
| program/include/rcube_mdb2.php |
| |
| This file is part of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
| Author: Lukas Kahwe Smith <smith@pooteeweet.org> |
+-----------------------------------------------------------------------+
- $Id: rcube_mdb2.php 1978 2008-10-14 12:49:44Z thomasb $
+ $Id: rcube_mdb2.php 2237 2009-01-17 01:55:39Z till $
*/
/**
- * Get number of affected rows fort he last query
+ * Get number of affected rows for the last query
*
+ * @param number Optional query handle identifier
* @return mixed Number of rows or FALSE on failure
* @access public
*/
- function affected_rows($result = null)
+ function affected_rows($res_id = null)
{
if (!$this->db_handle)
return FALSE;
- return $this->_get_result($result);
+ return (int) $this->_get_result($res_id);
}
/**
- * Get co values for a result row
+ * Get col values for a result row
*
* @param object Query result handle
* @param number Fetch mode identifier
*/
function _fetch_row($result, $mode)
{
- if (PEAR::isError($result))
- {
- raise_error(array('code' => 500, 'type' => 'db', 'line' => __LINE__, 'file' => __FILE__,
- 'message' => $this->db_link->getMessage()), TRUE, FALSE);
+ if ($result === FALSE || PEAR::isError($result))
return FALSE;
- }
return $result->fetchRow($mode);
}
* @param string Value to quote
* @return string Quoted string for use in query
* @deprecated Replaced by rcube_MDB2::quote_identifier
- * @see rcube_MDB2::quote_identifier
+ * @see rcube_mdb2::quote_identifier
* @access public
*/
function quoteIdentifier($str)
- {
+ {
return $this->quote_identifier($str);
- }
+ }
/**
* Adds a query result and returns a handle ID
*
* @param object Query handle
- * @return mixed Handle ID or FALE on failure
+ * @return mixed Handle ID
* @access private
*/
function _add_result($res)
// sql error occured
if (PEAR::isError($res))
{
+ $this->db_error = TRUE;
+ $this->db_error_msg = $res->getMessage();
raise_error(array('code' => 500, 'type' => 'db', 'line' => __LINE__, 'file' => __FILE__,
- 'message' => $res->getMessage() . " Query: " . substr(preg_replace('/[\r\n]+\s*/', ' ', $res->userinfo), 0, 512)), TRUE, FALSE);
- return FALSE;
- }
- else
- {
- $res_id = sizeof($this->a_query_results);
- $this->a_query_results[$res_id] = $res;
- $this->last_res_id = $res_id;
- return $res_id;
+ 'message' => $res->getMessage() . " Query: "
+ . substr(preg_replace('/[\r\n]+\s*/', ' ', $res->userinfo), 0, 512)),
+ TRUE, FALSE);
}
+
+ $res_id = sizeof($this->a_query_results);
+ $this->last_res_id = $res_id;
+ $this->a_query_results[$res_id] = $res;
+ return $res_id;
}
/**
* Resolves a given handle ID and returns the according query handle
- * If no ID is specified, the last ressource handle will be returned
+ * If no ID is specified, the last resource handle will be returned
*
* @param number Handle ID
- * @return mixed Ressource handle or FALE on failure
+ * @return mixed Resource handle or FALSE on failure
* @access private
*/
function _get_result($res_id=NULL)
if ($res_id==NULL)
$res_id = $this->last_res_id;
- if ($res_id && isset($this->a_query_results[$res_id]))
- return $this->a_query_results[$res_id];
- else
- return FALSE;
+ if (isset($this->a_query_results[$res_id]))
+ if (!PEAR::isError($this->a_query_results[$res_id]))
+ return $this->a_query_results[$res_id];
+
+ return FALSE;
}
| program/include/rcube_message.php |
| |
| This file is part of the RoundCube Webmail client |
- | Copyright (C) 2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2008-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
$this->imap = $this->app->imap;
$this->uid = $uid;
- $this->headers = $this->imap->get_headers($uid);
+ $this->headers = $this->imap->get_headers($uid, NULL, true, true);
+
$this->subject = rcube_imap::decode_mime_string($this->headers->subject, $this->headers->charset);
list(, $this->sender) = each($this->imap->decode_address_list($this->headers->from));
$this->set_safe((intval($_GET['_safe']) || $_SESSION['safe_messages'][$uid]));
-
$this->opt = array(
'safe' => $this->is_safe,
'prefer_html' => $this->app->config->get('prefer_html'),
'get_url' => rcmail_url('get', array('_mbox' => $this->imap->get_mailbox_name(), '_uid' => $uid))
);
- if ($this->structure = $this->imap->get_structure($uid)) {
+ if ($this->structure = $this->imap->get_structure($uid, $this->headers->body_structure)) {
$this->get_mime_numbers($this->structure);
$this->parse_structure($this->structure);
}
*/
function first_html_part()
{
- $html_part = null;
-
// check all message parts
foreach ($this->mime_parts as $mime_id => $part) {
$mimetype = strtolower($part->ctype_primary . '/' . $part->ctype_secondary);
if ($mimetype == 'text/html') {
- $html_part = $this->imap->get_message_part($this->uid, $mime_id, $part);
+ return $this->imap->get_message_part($this->uid, $mime_id, $part);
}
}
-
- return $html_part;
}
$html_part = $p;
else if ($sub_ctype_primary=='text' && $sub_ctype_secondary=='enriched')
$enriched_part = $p;
- else if ($sub_ctype_primary=='multipart' && ($sub_ctype_secondary=='related' || $sub_ctype_secondary=='mixed'))
+ else if ($sub_ctype_primary=='multipart' && in_array($sub_ctype_secondary, array('related', 'mixed', 'alternative')))
$related_part = $p;
}
// ignore "virtual" protocol parts
else if ($primary_type == 'protocol')
continue;
+
+ // part is Microsoft outlook TNEF (winmail.dat)
+ else if ($primary_type == 'application' && $secondary_type == 'ms-tnef') {
+ foreach ((array)$this->imap->tnef_decode($mail_part, $structure->headers['uid']) as $tnef_part) {
+ $this->mime_parts[$tnef_part->mime_id] = $tnef_part;
+ $this->attachments[] = $tnef_part;
+ }
+ }
// part is file/attachment
else if ($mail_part->disposition == 'attachment' || $mail_part->disposition == 'inline' ||
if ($mail_part->headers['content-location'])
$mail_part->content_location = $mail_part->headers['content-base'] . $mail_part->headers['content-location'];
- if ($mail_part->content_id || $mail_part->content_location) {
+ if ($mail_part->content_id || $mail_part->content_location) {
$this->inline_parts[] = $mail_part;
}
- }
+ }
// is regular attachment
else {
if (!$mail_part->filename)
| program/include/rcube_result_set.php |
| |
| This file is part of the RoundCube Webmail client |
- | Copyright (C) 2006-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2006-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
| Author: Thomas Bruederli <roundcube@gmail.com> |
+-----------------------------------------------------------------------+
- $Id: rcube_shared.inc 2147 2008-12-11 17:29:50Z alec $
+ $Id: rcube_shared.inc 2313 2009-02-27 10:18:18Z thomasb $
*/
return $path;
// cut base_url to the last directory
- if (strpos($base_url, '/')>7)
+ if (strrpos($base_url, '/')>7)
{
$host_url = substr($base_url, 0, strpos($base_url, '/'));
$base_url = substr($base_url, 0, strrpos($base_url, '/'));
* A method to guess the mime_type of an attachment.
*
* @param string $path Path to the file.
+ * @param string $name File name (with suffix)
* @param string $failover Mime type supplied for failover.
*
* @return string
* @see http://de2.php.net/manual/en/ref.fileinfo.php
* @see http://de2.php.net/mime_content_type
*/
-function rc_mime_content_type($path, $failover = 'application/octet-stream')
+function rc_mime_content_type($path, $name, $failover = 'application/octet-stream')
{
$mime_type = null;
$mime_magic = rcmail::get_instance()->config->get('mime_magic');
+ $mime_ext = @include(RCMAIL_CONFIG_DIR . '/mimetypes.php');
+ $suffix = $name ? substr($name, strrpos($name, '.')+1) : '*';
- if (!extension_loaded('fileinfo')) {
- @dl('fileinfo.' . PHP_SHLIB_SUFFIX);
+ // use file name suffix with hard-coded mime-type map
+ if (is_array($mime_ext)) {
+ $mime_type = $mime_ext[$suffix];
}
-
- if (function_exists('finfo_open')) {
- if ($finfo = finfo_open(FILEINFO_MIME, $mime_magic)) {
- $mime_type = finfo_file($finfo, $path);
- finfo_close($finfo);
+ // try fileinfo extension if available
+ if (!$mime_type) {
+ if (!extension_loaded('fileinfo')) {
+ @dl('fileinfo.' . PHP_SHLIB_SUFFIX);
+ }
+ if (function_exists('finfo_open')) {
+ if ($finfo = finfo_open(FILEINFO_MIME, $mime_magic)) {
+ $mime_type = finfo_file($finfo, $path);
+ finfo_close($finfo);
+ }
}
}
+ // try PHP's mime_content_type
if (!$mime_type && function_exists('mime_content_type')) {
$mime_type = mime_content_type($path);
}
-
+ // fall back to user-submitted string
if (!$mime_type) {
$mime_type = $failover;
}
return $result ? $result : $failover;
}
+
+/**
+ * Explode quoted string
+ *
+ * @param string Delimiter expression string for preg_match()
+ * @param string Input string
+ */
+function rcube_explode_quoted_string($delimiter, $string)
+{
+ $result = array();
+ $strlen = strlen($string);
+
+ for ($q=$p=$i=0; $i < $strlen; $i++) {
+ if ($string[$i] == "\"" && $string[$i-1] != "\\") {
+ $q = $q ? false : true;
+ }
+ else if (!$q && preg_match("/$delimiter/", $string[$i])) {
+ $result[] = substr($string, $p, $i - $p);
+ $p = $i + 1;
+ }
+ }
+
+ $result[] = substr($string, $p);
+ return $result;
+}
+
?>
| Author: Thomas Bruederli <roundcube@gmail.com> |
+-----------------------------------------------------------------------+
- $Id: rcube_smtp.inc 2155 2008-12-16 13:00:55Z alec $
+ $Id: rcube_smtp.inc 2291 2009-02-13 10:44:49Z alec $
*/
$recipients = implode(', ', $recipients);
$addresses = array();
- $recipients = smtp_explode_quoted_str(",", $recipients);
+ $recipients = rcube_explode_quoted_string(',', $recipients);
reset($recipients);
while (list($k, $recipient) = each($recipients))
return $addresses;
}
-
-/**
- * @access private
- */
-function smtp_explode_quoted_str($delimiter, $string)
- {
- $quotes=explode("\"", $string);
- while ( list($key, $val) = each($quotes))
- if (($key % 2) == 1)
- $quotes[$key] = str_replace($delimiter, "_!@!_", $quotes[$key]);
- $string=implode("\"", $quotes);
-
- $result=explode($delimiter, $string);
- while (list($key, $val) = each($result))
- $result[$key] = str_replace("_!@!_", $delimiter, $result[$key]);
-
- return $result;
- }
-
-
?>
--- /dev/null
+<?php
+
+/*
+ +-----------------------------------------------------------------------+
+ | program/include/rcube_string_replacer.php |
+ | |
+ | This file is part of the RoundCube Webmail client |
+ | Copyright (C) 2009, RoundCube Dev. - Switzerland |
+ | Licensed under the GNU GPL |
+ | |
+ | PURPOSE: |
+ | Handle string replacements based on preg_replace_callback |
+ | |
+ +-----------------------------------------------------------------------+
+ | Author: Thomas Bruederli <roundcube@gmail.com> |
+ +-----------------------------------------------------------------------+
+
+ $Id: $
+
+*/
+
+
+/**
+ * Helper class for string replacements based on preg_replace_callback
+ *
+ * @package Core
+ */
+class rcube_string_replacer
+{
+ public static $pattern = '/##str_replacement\[([0-9]+)\]##/';
+
+ private $values = array();
+
+
+ /**
+ * Add a string to the internal list
+ *
+ * @param string String value
+ * @return int Index of value for retrieval
+ */
+ public function add($str)
+ {
+ $i = count($this->values);
+ $this->values[$i] = $str;
+ return $i;
+ }
+
+ /**
+ * Build replacement string
+ */
+ public function get_replacement($i)
+ {
+ return '##str_replacement['.$i.']##';
+ }
+
+ /**
+ * Callback function used to build HTML links around URL strings
+ *
+ * @param array Matches result from preg_replace_callback
+ * @return int Index of saved string value
+ */
+ public function link_callback($matches)
+ {
+ $i = -1;
+ $scheme = strtolower($matches[1]);
+
+ if ($scheme == 'http' || $scheme == 'https' || $scheme == 'ftp') {
+ $url = $matches[1] . '://' . $matches[2];
+ $i = $this->add(html::a(array('href' => $url, 'target' => "_blank"), Q($url)));
+ }
+ else if ($matches[2] == 'www.') {
+ $url = $matches[2] . $matches[3];
+ $i = $this->add($matches[1] . html::a(array('href' => 'http://' . $url, 'target' => "_blank"), Q($url)));
+ }
+
+ return $i >= 0 ? $this->get_replacement($i) : '';
+ }
+
+ /**
+ * Callback function used to build mailto: links around e-mail strings
+ *
+ * @param array Matches result from preg_replace_callback
+ * @return int Index of saved string value
+ */
+ public function mailto_callback($matches)
+ {
+ $i = $this->add(html::a(array(
+ 'href' => 'mailto:' . $matches[1],
+ 'onclick' => "return ".JS_OBJECT_NAME.".command('compose','".JQ($matches[1])."',this)",
+ ),
+ Q($matches[1])));
+
+ return $i >= 0 ? $this->get_replacement($i) : '';
+ }
+
+ /**
+ * Look up the index from the preg_replace matches array
+ * and return the substitution value.
+ *
+ * @param array Matches result from preg_replace_callback
+ * @return string Value at index $matches[1]
+ */
+ public function replace_callback($matches)
+ {
+ return $this->values[$matches[1]];
+ }
+
+ /**
+ * Replace substituted strings with original values
+ */
+ public function resolve($str)
+ {
+ return preg_replace_callback(self::$pattern, array($this, 'replace_callback'), $str);
+ }
+
+}
\ No newline at end of file
| program/include/rcube_template.php |
| |
| This file is part of the RoundCube Webmail client |
- | Copyright (C) 2006-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2006-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
| program/include/rcube_user.inc |
| |
| This file is part of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
| program/include/rcube_vcard.php |
| |
| This file is part of the RoundCube Webmail client |
- | Copyright (C) 2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2008-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
return $vcard;
}
+ private static function rfc2425_fold_callback($matches)
+ {
+ return ":\n ".rtrim(chunk_split($matches[1], 72, "\n "));
+ }
private static function rfc2425_fold($val)
{
- return preg_replace('/:([^\n]{72,})/e', '":\n ".rtrim(chunk_split("\\1", 72, "\n "))', $val) . "\n";
+ return preg_replace_callback('/:([^\n]{72,})/', array('self', 'rfc2425_fold_callback'), $val) . "\n";
}
| program/include/session.inc |
| |
| This file is part of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
| Author: Thomas Bruederli <roundcube@gmail.com> |
+-----------------------------------------------------------------------+
- $Id: session.inc 2084 2008-11-23 13:24:49Z thomasb $
+ $Id: session.inc 2237 2009-01-17 01:55:39Z till $
*/
+/*
+ +-----------------------------------------------------------------------+
+ | RoundCube Webmail Client Script |
+ | |
+ | This file is part of the RoundCube Webmail client |
+ | Copyright (C) 2005-2009, RoundCube Dev, - Switzerland |
+ | Licensed under the GNU GPL |
+ | |
+ +-----------------------------------------------------------------------+
+ | Authors: Thomas Bruederli <roundcube@gmail.com> |
+ | Charles McNulty <charles@charlesmcnulty.com> |
+ +-----------------------------------------------------------------------+
+ | Requires: common.js, list.js |
+ +-----------------------------------------------------------------------+
+
+ $Id: app.js 2318 2009-02-27 11:06:29Z thomasb $
+*/
+
+
var rcube_webmail_client;
-function rcube_webmail(){
-this.env=new Object();
-this.labels=new Object();
-this.buttons=new Object();
-this.gui_objects=new Object();
-this.commands=new Object();
-this.onloads=new Array();
-rcube_webmail_client=this;
-this.ref="rcube_webmail_client";
-var _1=this;
-this.dblclick_time=500;
-this.message_time=3000;
-this.identifier_expr=new RegExp("[^0-9a-z-_]","gi");
-this.mimetypes=new Array("text/plain","text/html","text/xml","image/jpeg","image/gif","image/png","application/x-javascript","application/pdf","application/x-shockwave-flash");
-this.env.keep_alive=60;
-this.env.request_timeout=180;
-this.env.draft_autosave=0;
-this.env.comm_path="./";
-this.env.bin_path="./bin/";
-this.env.blankpage="program/blank.gif";
-this.set_env=function(p,_3){
-if(p!=null&&typeof (p)=="object"&&!_3){
-for(var n in p){
-this.env[n]=p[n];
-}
-}else{
-this.env[p]=_3;
-}
-};
-this.add_label=function(_5,_6){
-this.labels[_5]=_6;
-};
-this.register_button=function(_7,id,_9,_a,_b,_c){
-if(!this.buttons[_7]){
-this.buttons[_7]=new Array();
-}
-var _d={id:id,type:_9};
-if(_a){
-_d.act=_a;
-}
-if(_b){
-_d.sel=_b;
-}
-if(_c){
-_d.over=_c;
-}
-this.buttons[_7][this.buttons[_7].length]=_d;
-};
-this.gui_object=function(_e,id){
-this.gui_objects[_e]=id;
-};
-this.add_onload=function(f){
-this.onloads[this.onloads.length]=f;
-};
-this.init=function(){
-var p=this;
-this.task=this.env.task;
-if(!bw.dom||!bw.xmlhttp_test()){
-this.goto_url("error","_code=0x199");
-return;
-}
-for(var n in this.gui_objects){
-this.gui_objects[n]=rcube_find_object(this.gui_objects[n]);
-}
-if(this.env.framed&&parent.rcmail&&parent.rcmail.set_busy){
-parent.rcmail.set_busy(false);
-}
-this.enable_command("logout","mail","addressbook","settings",true);
-if(this.env.permaurl){
-this.enable_command("permaurl",true);
-}
-switch(this.task){
-case "mail":
-if(this.gui_objects.messagelist){
-this.message_list=new rcube_list_widget(this.gui_objects.messagelist,{multiselect:true,draggable:true,keyboard:true,dblclick_time:this.dblclick_time});
-this.message_list.row_init=function(o){
-p.init_message_row(o);
-};
-this.message_list.addEventListener("dblclick",function(o){
-p.msglist_dbl_click(o);
-});
-this.message_list.addEventListener("keypress",function(o){
-p.msglist_keypress(o);
-});
-this.message_list.addEventListener("select",function(o){
-p.msglist_select(o);
-});
-this.message_list.addEventListener("dragstart",function(o){
-p.drag_start(o);
-});
-this.message_list.addEventListener("dragmove",function(o,e){
-p.drag_move(e);
-});
-this.message_list.addEventListener("dragend",function(o){
-p.drag_active=false;
-});
-this.message_list.init();
-this.enable_command("toggle_status","toggle_flag",true);
-if(this.gui_objects.mailcontframe){
-this.gui_objects.mailcontframe.onmousedown=function(e){
-return p.click_on_list(e);
-};
-document.onmouseup=function(e){
-return p.doc_mouse_up(e);
-};
-}else{
-this.message_list.focus();
-}
-}
-if(this.env.coltypes){
-this.set_message_coltypes(this.env.coltypes);
-}
-this.enable_command("list","checkmail","compose","add-contact","search","reset-search","collapse-folder",true);
-if(this.env.search_text!=null&&document.getElementById("quicksearchbox")!=null){
-document.getElementById("quicksearchbox").value=this.env.search_text;
-}
-if(this.env.action=="show"||this.env.action=="preview"){
-this.enable_command("show","reply","reply-all","forward","moveto","delete","mark","viewsource","print","load-attachment","load-headers",true);
-if(this.env.next_uid){
-this.enable_command("nextmessage",true);
-this.enable_command("lastmessage",true);
-}
-if(this.env.prev_uid){
-this.enable_command("previousmessage",true);
-this.enable_command("firstmessage",true);
-}
-}
-if(this.env.trash_mailbox&&this.env.mailbox!=this.env.trash_mailbox){
-this.set_alttext("delete","movemessagetotrash");
-}
-if(this.env.action=="preview"&&this.env.framed&&parent.rcmail){
-this.enable_command("compose","add-contact",false);
-parent.rcmail.show_contentframe(true);
-}
-if((this.env.action=="show"||this.env.action=="preview")&&this.env.blockedobjects){
-if(this.gui_objects.remoteobjectsmsg){
-this.gui_objects.remoteobjectsmsg.style.display="block";
-}
-this.enable_command("load-images","always-load",true);
-}
-if(this.env.action=="compose"){
-this.enable_command("add-attachment","send-attachment","remove-attachment","send",true);
-if(this.env.spellcheck){
-this.env.spellcheck.spelling_state_observer=function(s){
-_1.set_spellcheck_state(s);
-};
-this.set_spellcheck_state("ready");
-if(rcube_find_object("_is_html").value=="1"){
-this.display_spellcheck_controls(false);
-}
-}
-if(this.env.drafts_mailbox){
-this.enable_command("savedraft",true);
-}
-document.onmouseup=function(e){
-return p.doc_mouse_up(e);
-};
-}
-if(this.env.messagecount){
-this.enable_command("select-all","select-none","expunge",true);
-}
-if(this.purge_mailbox_test()){
-this.enable_command("purge",true);
-}
-this.set_page_buttons();
-if(this.env.action=="compose"){
-this.init_messageform();
-}
-if(this.env.action=="print"){
-window.print();
-}
-if(this.gui_objects.mailboxlist){
-this.env.unread_counts={};
-this.gui_objects.folderlist=this.gui_objects.mailboxlist;
-this.http_request("getunread","");
-}
-if(this.env.mdn_request&&this.env.uid){
-var _1f="_uid="+this.env.uid+"&_mbox="+urlencode(this.env.mailbox);
-if(confirm(this.get_label("mdnrequest"))){
-this.http_post("sendmdn",_1f);
-}else{
-this.http_post("mark",_1f+"&_flag=mdnsent");
-}
-}
-break;
-case "addressbook":
-if(this.gui_objects.contactslist){
-this.contact_list=new rcube_list_widget(this.gui_objects.contactslist,{multiselect:true,draggable:true,keyboard:true});
-this.contact_list.addEventListener("keypress",function(o){
-p.contactlist_keypress(o);
-});
-this.contact_list.addEventListener("select",function(o){
-p.contactlist_select(o);
-});
-this.contact_list.addEventListener("dragstart",function(o){
-p.drag_start(o);
-});
-this.contact_list.addEventListener("dragmove",function(o,e){
-p.drag_move(e);
-});
-this.contact_list.addEventListener("dragend",function(o){
-p.drag_active=false;
-});
-this.contact_list.init();
-if(this.env.cid){
-this.contact_list.highlight_row(this.env.cid);
-}
-if(this.gui_objects.contactslist.parentNode){
-this.gui_objects.contactslist.parentNode.onmousedown=function(e){
-return p.click_on_list(e);
-};
-document.onmouseup=function(e){
-return p.doc_mouse_up(e);
-};
-}else{
-this.contact_list.focus();
-}
-}
-this.set_page_buttons();
-if(this.env.address_sources&&this.env.address_sources[this.env.source]&&!this.env.address_sources[this.env.source].readonly){
-this.enable_command("add",true);
-}
-if(this.env.cid){
-this.enable_command("show","edit",true);
-}
-if((this.env.action=="add"||this.env.action=="edit")&&this.gui_objects.editform){
-this.enable_command("save",true);
-}else{
-this.enable_command("search","reset-search","moveto","import",true);
-}
-if(this.contact_list&&this.contact_list.rowcount>0){
-this.enable_command("export",true);
-}
-this.enable_command("list",true);
-break;
-case "settings":
-this.enable_command("preferences","identities","save","folders",true);
-if(this.env.action=="identities"||this.env.action=="edit-identity"||this.env.action=="add-identity"){
-this.enable_command("add",this.env.identities_level<2);
-this.enable_command("delete","edit",true);
-}
-if(this.env.action=="edit-identity"||this.env.action=="add-identity"){
-this.enable_command("save",true);
-}
-if(this.env.action=="folders"){
-this.enable_command("subscribe","unsubscribe","create-folder","rename-folder","delete-folder",true);
-}
-if(this.gui_objects.identitieslist){
-this.identity_list=new rcube_list_widget(this.gui_objects.identitieslist,{multiselect:false,draggable:false,keyboard:false});
-this.identity_list.addEventListener("select",function(o){
-p.identity_select(o);
-});
-this.identity_list.init();
-this.identity_list.focus();
-if(this.env.iid){
-this.identity_list.highlight_row(this.env.iid);
-}
-}
-if(this.gui_objects.subscriptionlist){
-this.init_subscription_list();
-}
-break;
-case "login":
-var _29=rcube_find_object("rcmloginuser");
-var _2a=rcube_find_object("rcmloginpwd");
-var _2b=rcube_find_object("rcmlogintz");
-if(_29){
-_29.onkeyup=function(e){
-return rcmail.login_user_keyup(e);
-};
-}
-if(_29&&_29.value==""){
-_29.focus();
-}else{
-if(_2a){
-_2a.focus();
-}
-}
-if(_2b){
-_2b.value=new Date().getTimezoneOffset()/-60;
-}
-this.enable_command("login",true);
-break;
-default:
-break;
-}
-this.enable_command("logout",true);
-this.loaded=true;
-if(this.pending_message){
-this.display_message(this.pending_message[0],this.pending_message[1]);
-}
-this.start_keepalive();
-for(var i=0;i<this.onloads.length;i++){
-if(typeof (this.onloads[i])=="string"){
-eval(this.onloads[i]);
-}else{
-if(typeof (this.onloads[i])=="function"){
-this.onloads[i]();
-}
-}
-}
-};
-this.start_keepalive=function(){
-if(this.env.keep_alive&&!this.env.framed&&this.task=="mail"&&this.gui_objects.mailboxlist){
-this._int=setInterval(function(){
-_1.check_for_recent(false);
-},this.env.keep_alive*1000);
-}else{
-if(this.env.keep_alive&&!this.env.framed&&this.task!="login"){
-this._int=setInterval(function(){
-_1.send_keep_alive();
-},this.env.keep_alive*1000);
-}
-}
-};
-this.init_message_row=function(row){
-var uid=row.uid;
-if(uid&&this.env.messages[uid]){
-row.deleted=this.env.messages[uid].deleted?true:false;
-row.unread=this.env.messages[uid].unread?true:false;
-row.replied=this.env.messages[uid].replied?true:false;
-row.flagged=this.env.messages[uid].flagged?true:false;
-row.forwarded=this.env.messages[uid].forwarded?true:false;
-}
-if((row.icon=row.obj.cells[0].childNodes[0])&&row.icon.nodeName=="IMG"){
-var p=this;
-row.icon.id="msgicn_"+row.uid;
-row.icon._row=row.obj;
-row.icon.onmousedown=function(e){
-p.command("toggle_status",this);
-};
-}
-if(!this.env.flagged_col&&this.env.coltypes){
-var _32;
-if((_32=find_in_array("flag",this.env.coltypes))>=0){
-this.set_env("flagged_col",_32+1);
-}
-}
-if(this.env.flagged_col&&(row.flagged_icon=row.obj.cells[this.env.flagged_col].childNodes[0])&&row.flagged_icon.nodeName=="IMG"){
-var p=this;
-row.flagged_icon.id="flaggedicn_"+row.uid;
-row.flagged_icon._row=row.obj;
-row.flagged_icon.onmousedown=function(e){
-p.command("toggle_flag",this);
-};
-}
-};
-this.init_messageform=function(){
-if(!this.gui_objects.messageform){
-return false;
-}
-var _34=rcube_find_object("_from");
-var _35=rcube_find_object("_to");
-var _36=rcube_find_object("_cc");
-var _37=rcube_find_object("_bcc");
-var _38=rcube_find_object("_replyto");
-var _39=rcube_find_object("_subject");
-var _3a=rcube_find_object("_message");
-var _3b=rcube_find_object("_draft_saveid");
-if(_35){
-this.init_address_input_events(_35);
-}
-if(_36){
-this.init_address_input_events(_36);
-}
-if(_37){
-this.init_address_input_events(_37);
-}
-if(_34&&_34.type=="select-one"&&(!_3b||_3b.value=="")&&rcube_find_object("_is_html").value!="1"){
-this.change_identity(_34);
-}
-if(_35&&_35.value==""){
-_35.focus();
-}else{
-if(_39&&_39.value==""){
-_39.focus();
-}else{
-if(_3a){
-this.set_caret2start(_3a);
-}
-}
-}
-this.compose_field_hash(true);
-this.auto_save_start();
-};
-this.init_address_input_events=function(obj){
-var _3d=function(e){
-return _1.ksearch_keypress(e,this);
-};
-if(obj.addEventListener){
-obj.addEventListener(bw.safari?"keydown":"keypress",_3d,false);
-}else{
-obj.onkeydown=_3d;
-}
-obj.setAttribute("autocomplete","off");
-};
-this.command=function(_3f,_40,obj){
-if(obj&&obj.blur){
-obj.blur();
-}
-if(this.busy){
-return false;
-}
-if(!this.commands[_3f]){
-if(this.env.framed&&parent.rcmail&&parent.rcmail.command){
-parent.rcmail.command(_3f,_40);
-}
-return false;
-}
-if(this.task=="mail"&&this.env.action=="compose"&&(_3f=="list"||_3f=="mail"||_3f=="addressbook"||_3f=="settings")){
-if(this.cmp_hash!=this.compose_field_hash()&&!confirm(this.get_label("notsentwarning"))){
-return false;
-}
-}
-switch(_3f){
-case "login":
-if(this.gui_objects.loginform){
-this.gui_objects.loginform.submit();
-}
-break;
-case "logout":
-this.goto_url("logout","",true);
-break;
-case "mail":
-case "addressbook":
-case "settings":
-this.switch_task(_3f);
-break;
-case "permaurl":
-if(obj&&obj.href&&obj.target){
-return true;
-}else{
-if(this.env.permaurl){
-parent.location.href=this.env.permaurl;
-}
-}
-break;
-case "list":
-if(this.task=="mail"){
-if(this.env.search_request<0||(_40!=""&&(this.env.search_request&&_40!=this.env.mailbox))){
-this.reset_qsearch();
-}
-this.list_mailbox(_40);
-if(this.env.trash_mailbox){
-this.set_alttext("delete",this.env.mailbox!=this.env.trash_mailbox?"movemessagetotrash":"deletemessage");
-}
-}else{
-if(this.task=="addressbook"){
-if(this.env.search_request<0||(this.env.search_request&&_40!=this.env.source)){
-this.reset_qsearch();
-}
-this.list_contacts(_40);
-this.enable_command("add",(this.env.address_sources&&!this.env.address_sources[_40].readonly));
-}
-}
-break;
-case "load-headers":
-this.load_headers(obj);
-break;
-case "sort":
-var _42=_40.split("_");
-var _43=_42[0];
-var _44=_42[1]?_42[1].toUpperCase():null;
-var _45;
-if(_44==null){
-if(this.env.sort_col==_43){
-_44=this.env.sort_order=="ASC"?"DESC":"ASC";
-}else{
-_44=this.env.sort_order;
-}
-}
-if(this.env.sort_col==_43&&this.env.sort_order==_44){
-break;
-}
-if(_45=document.getElementById("rcm"+this.env.sort_col)){
-this.set_classname(_45,"sorted"+(this.env.sort_order.toUpperCase()),false);
-}
-if(_45=document.getElementById("rcm"+_43)){
-this.set_classname(_45,"sorted"+_44,true);
-}
-this.env.sort_col=_43;
-this.env.sort_order=_44;
-this.list_mailbox("","",_43+"_"+_44);
-break;
-case "nextpage":
-this.list_page("next");
-break;
-case "lastpage":
-this.list_page("last");
-break;
-case "previouspage":
-this.list_page("prev");
-break;
-case "firstpage":
-this.list_page("first");
-break;
-case "expunge":
-if(this.env.messagecount){
-this.expunge_mailbox(this.env.mailbox);
-}
-break;
-case "purge":
-case "empty-mailbox":
-if(this.env.messagecount){
-this.purge_mailbox(this.env.mailbox);
-}
-break;
-case "show":
-if(this.task=="mail"){
-var uid=this.get_single_uid();
-if(uid&&(!this.env.uid||uid!=this.env.uid)){
-if(this.env.mailbox==this.env.drafts_mailbox){
-this.goto_url("compose","_draft_uid="+uid+"&_mbox="+urlencode(this.env.mailbox),true);
-}else{
-this.show_message(uid);
-}
-}
-}else{
-if(this.task=="addressbook"){
-var cid=_40?_40:this.get_single_cid();
-if(cid&&!(this.env.action=="show"&&cid==this.env.cid)){
-this.load_contact(cid,"show");
-}
-}
-}
-break;
-case "add":
-if(this.task=="addressbook"){
-this.load_contact(0,"add");
-}else{
-if(this.task=="settings"){
-this.identity_list.clear_selection();
-this.load_identity(0,"add-identity");
-}
-}
-break;
-case "edit":
-var cid;
-if(this.task=="addressbook"&&(cid=this.get_single_cid())){
-this.load_contact(cid,"edit");
-}else{
-if(this.task=="settings"&&_40){
-this.load_identity(_40,"edit-identity");
-}
-}
-break;
-case "save-identity":
-case "save":
-if(this.gui_objects.editform){
-var _48=rcube_find_object("_pagesize");
-var _49=rcube_find_object("_name");
-var _4a=rcube_find_object("_email");
-if(_48&&isNaN(parseInt(_48.value))){
-alert(this.get_label("nopagesizewarning"));
-_48.focus();
-break;
-}else{
-if(_49&&_49.value==""){
-alert(this.get_label("nonamewarning"));
-_49.focus();
-break;
-}else{
-if(_4a&&!rcube_check_email(_4a.value)){
-alert(this.get_label("noemailwarning"));
-_4a.focus();
-break;
-}
-}
-}
-this.gui_objects.editform.submit();
-}
-break;
-case "delete":
-if(this.task=="mail"){
-this.delete_messages();
-}else{
-if(this.task=="addressbook"){
-this.delete_contacts();
-}else{
-if(this.task=="settings"){
-this.delete_identity();
-}
-}
-}
-break;
-case "move":
-case "moveto":
-if(this.task=="mail"){
-this.move_messages(_40);
-}else{
-if(this.task=="addressbook"&&this.drag_active){
-this.copy_contact(null,_40);
-}
-}
-break;
-case "mark":
-if(_40){
-this.mark_message(_40);
-}
-break;
-case "toggle_status":
-if(_40&&!_40._row){
-break;
-}
-var uid;
-var _4b="read";
-if(_40._row.uid){
-uid=_40._row.uid;
-if(this.message_list.rows[uid].deleted){
-_4b="undelete";
-}else{
-if(!this.message_list.rows[uid].unread){
-_4b="unread";
-}
-}
-}
-this.mark_message(_4b,uid);
-break;
-case "toggle_flag":
-if(_40&&!_40._row){
-break;
-}
-var uid;
-var _4b="flagged";
-if(_40._row.uid){
-uid=_40._row.uid;
-if(this.message_list.rows[uid].flagged){
-_4b="unflagged";
-}
-}
-this.mark_message(_4b,uid);
-break;
-case "always-load":
-if(this.env.uid&&this.env.sender){
-this.add_contact(urlencode(this.env.sender));
-window.setTimeout(function(){
-_1.command("load-images");
-},300);
-break;
-}
-case "load-images":
-if(this.env.uid){
-this.show_message(this.env.uid,true,this.env.action=="preview");
-}
-break;
-case "load-attachment":
-var _4c="_mbox="+urlencode(this.env.mailbox)+"&_uid="+this.env.uid+"&_part="+_40.part;
-if(this.env.uid&&_40.mimetype&&find_in_array(_40.mimetype,this.mimetypes)>=0){
-if(_40.mimetype=="text/html"){
-_4c+="&_safe=1";
-}
-this.attachment_win=window.open(this.env.comm_path+"&_action=get&"+_4c+"&_frame=1","rcubemailattachment");
-if(this.attachment_win){
-window.setTimeout(function(){
-_1.attachment_win.focus();
-},10);
-break;
-}
-}
-this.goto_url("get",_4c+"&_download=1",false);
-break;
-case "select-all":
-this.message_list.select_all(_40);
-break;
-case "select-none":
-this.message_list.clear_selection();
-break;
-case "nextmessage":
-if(this.env.next_uid){
-this.show_message(this.env.next_uid,false,this.env.action=="preview");
-}
-break;
-case "lastmessage":
-if(this.env.last_uid){
-this.show_message(this.env.last_uid);
-}
-break;
-case "previousmessage":
-if(this.env.prev_uid){
-this.show_message(this.env.prev_uid,false,this.env.action=="preview");
-}
-break;
-case "firstmessage":
-if(this.env.first_uid){
-this.show_message(this.env.first_uid);
-}
-break;
-case "checkmail":
-this.check_for_recent(true);
-break;
-case "compose":
-var url=this.env.comm_path+"&_action=compose";
-if(this.task=="mail"){
-url+="&_mbox="+urlencode(this.env.mailbox);
-if(this.env.mailbox==this.env.drafts_mailbox){
-var uid;
-if(uid=this.get_single_uid()){
-url+="&_draft_uid="+uid;
-}
-}else{
-if(_40){
-url+="&_to="+urlencode(_40);
-}
-}
-}else{
-if(this.task=="addressbook"){
-if(_40&&_40.indexOf("@")>0){
-url=this.get_task_url("mail",url);
-this.redirect(url+"&_to="+urlencode(_40));
-break;
-}
-var _4e=new Array();
-if(_40){
-_4e[_4e.length]=_40;
-}else{
-if(this.contact_list){
-var _4f=this.contact_list.get_selection();
-for(var n=0;n<_4f.length;n++){
-_4e[_4e.length]=_4f[n];
-}
-}
-}
-if(_4e.length){
-this.http_request("mailto","_cid="+urlencode(_4e.join(","))+"&_source="+urlencode(this.env.source),true);
-}
-break;
-}
-}
-url=url.replace(/&_framed=1/,"");
-this.redirect(url);
-break;
-case "spellcheck":
-if(window.tinyMCE&&tinyMCE.get("compose-body")){
-tinyMCE.execCommand("mceSpellCheck",true);
-}else{
-if(this.env.spellcheck&&this.env.spellcheck.spellCheck&&this.spellcheck_ready){
-this.env.spellcheck.spellCheck(this.env.spellcheck.check_link);
-this.set_spellcheck_state("checking");
-}
-}
-break;
-case "savedraft":
-self.clearTimeout(this.save_timer);
-if(!this.gui_objects.messageform){
-break;
-}
-if(!this.env.drafts_mailbox||this.cmp_hash==this.compose_field_hash()){
-break;
-}
-this.set_busy(true,"savingmessage");
-var _51=this.gui_objects.messageform;
-_51.target="savetarget";
-_51._draft.value="1";
-_51.submit();
-break;
-case "send":
-if(!this.gui_objects.messageform){
-break;
-}
-if(!this.check_compose_input()){
-break;
-}
-self.clearTimeout(this.save_timer);
-this.set_busy(true,"sendingmessage");
-var _51=this.gui_objects.messageform;
-_51.target="savetarget";
-_51._draft.value="";
-_51.submit();
-clearTimeout(this.request_timer);
-break;
-case "add-attachment":
-this.show_attachment_form(true);
-case "send-attachment":
-self.clearTimeout(this.save_timer);
-this.upload_file(_40);
-break;
-case "remove-attachment":
-this.remove_attachment(_40);
-break;
-case "reply-all":
-case "reply":
-var uid;
-if(uid=this.get_single_uid()){
-this.goto_url("compose","_reply_uid="+uid+"&_mbox="+urlencode(this.env.mailbox)+(_3f=="reply-all"?"&_all=1":""),true);
-}
-break;
-case "forward":
-var uid;
-if(uid=this.get_single_uid()){
-this.goto_url("compose","_forward_uid="+uid+"&_mbox="+urlencode(this.env.mailbox),true);
-}
-break;
-case "print":
-var uid;
-if(uid=this.get_single_uid()){
-_1.printwin=window.open(this.env.comm_path+"&_action=print&_uid="+uid+"&_mbox="+urlencode(this.env.mailbox)+(this.env.safemode?"&_safe=1":""));
-if(this.printwin){
-window.setTimeout(function(){
-_1.printwin.focus();
-},20);
-if(this.env.action!="show"){
-this.mark_message("read",uid);
-}
-}
-}
-break;
-case "viewsource":
-var uid;
-if(uid=this.get_single_uid()){
-_1.sourcewin=window.open(this.env.comm_path+"&_action=viewsource&_uid="+this.env.uid+"&_mbox="+urlencode(this.env.mailbox));
-if(this.sourcewin){
-window.setTimeout(function(){
-_1.sourcewin.focus();
-},20);
-}
-}
-break;
-case "add-contact":
-this.add_contact(_40);
-break;
-case "search":
-if(!_40&&this.gui_objects.qsearchbox){
-_40=this.gui_objects.qsearchbox.value;
-}
-if(_40){
-this.qsearch(_40);
-break;
-}
-case "reset-search":
-var s=this.env.search_request;
-this.reset_qsearch();
-if(s&&this.env.mailbox){
-this.list_mailbox(this.env.mailbox);
-}else{
-if(s&&this.task=="addressbook"){
-this.list_contacts(this.env.source);
-}
-}
-break;
-case "import":
-if(this.env.action=="import"&&this.gui_objects.importform){
-var _53=document.getElementById("rcmimportfile");
-if(_53&&!_53.value){
-alert(this.get_label("selectimportfile"));
-break;
-}
-this.gui_objects.importform.submit();
-this.set_busy(true,"importwait");
-this.lock_form(this.gui_objects.importform,true);
-}else{
-this.goto_url("import");
-}
-break;
-case "export":
-if(this.contact_list.rowcount>0){
-var _54=(this.env.source?"_source="+urlencode(this.env.source)+"&":"");
-if(this.env.search_request){
-_54+="_search="+this.env.search_request;
-}
-this.goto_url("export",_54);
-}
-break;
-case "collapse-folder":
-if(_40){
-this.collapse_folder(_40);
-}
-break;
-case "preferences":
-this.goto_url("");
-break;
-case "identities":
-this.goto_url("identities");
-break;
-case "delete-identity":
-this.delete_identity();
-case "folders":
-this.goto_url("folders");
-break;
-case "subscribe":
-this.subscribe_folder(_40);
-break;
-case "unsubscribe":
-this.unsubscribe_folder(_40);
-break;
-case "create-folder":
-this.create_folder(_40);
-break;
-case "rename-folder":
-this.rename_folder(_40);
-break;
-case "delete-folder":
-this.delete_folder(_40);
-break;
-}
-return obj?false:true;
-};
-this.enable_command=function(){
-var _55=arguments;
-if(!_55.length){
-return -1;
-}
-var _56;
-var _57=_55[_55.length-1];
-for(var n=0;n<_55.length-1;n++){
-_56=_55[n];
-this.commands[_56]=_57;
-this.set_button(_56,(_57?"act":"pas"));
-}
-return true;
-};
-this.set_busy=function(a,_5a){
-if(a&&_5a){
-var msg=this.get_label(_5a);
-if(msg==_5a){
-msg="Loading...";
-}
-this.display_message(msg,"loading",true);
-}else{
-if(!a){
-this.hide_message();
-}
-}
-this.busy=a;
-if(this.gui_objects.editform){
-this.lock_form(this.gui_objects.editform,a);
-}
-if(this.request_timer){
-clearTimeout(this.request_timer);
-}
-if(a&&this.env.request_timeout){
-this.request_timer=window.setTimeout(function(){
-_1.request_timed_out();
-},this.env.request_timeout*1000);
-}
-};
-this.get_label=function(_5c){
-if(this.labels[_5c]){
-return this.labels[_5c];
-}else{
-return _5c;
-}
-};
-this.switch_task=function(_5d){
-if(this.task===_5d&&_5d!="mail"){
-return;
-}
-var url=this.get_task_url(_5d);
-if(_5d=="mail"){
-url+="&_mbox=INBOX";
-}
-this.redirect(url);
-};
-this.get_task_url=function(_5f,url){
-if(!url){
-url=this.env.comm_path;
-}
-return url.replace(/_task=[a-z]+/,"_task="+_5f);
-};
-this.request_timed_out=function(){
-this.set_busy(false);
-this.display_message("Request timed out!","error");
-};
-this.doc_mouse_up=function(e){
-var _62,li;
-if(this.message_list){
-this.message_list.blur();
-_62=this.env.mailboxes;
-}else{
-if(this.contact_list){
-this.contact_list.blur();
-_62=this.env.address_sources;
-}else{
-if(this.ksearch_value){
-this.ksearch_blur();
-}
-}
-}
-if(this.drag_active&&_62&&this.env.last_folder_target){
-this.set_classname(this.get_folder_li(this.env.last_folder_target),"droptarget",false);
-this.command("moveto",_62[this.env.last_folder_target].id);
-this.env.last_folder_target=null;
-}
-};
-this.drag_start=function(_64){
-var _65=this.task=="mail"?this.env.mailboxes:this.env.address_sources;
-this.drag_active=true;
-if(this.preview_timer){
-clearTimeout(this.preview_timer);
-}
-if(this.gui_objects.folderlist&&_65){
-var li,pos,_64,_68;
-_64=rcube_find_object(this.task=="mail"?"mailboxlist":"directorylist");
-pos=rcube_get_object_pos(_64);
-this.env.folderlist_coords={x1:pos.x,y1:pos.y,x2:pos.x+_64.offsetWidth,y2:pos.y+_64.offsetHeight};
-this.env.folder_coords=new Array();
-for(var k in _65){
-if(li=this.get_folder_li(k)){
-pos=rcube_get_object_pos(li.firstChild);
-if(_68=li.firstChild.offsetHeight){
-this.env.folder_coords[k]={x1:pos.x,y1:pos.y,x2:pos.x+li.firstChild.offsetWidth,y2:pos.y+_68};
-}
-}
-}
-}
-};
-this.drag_move=function(e){
-if(this.gui_objects.folderlist&&this.env.folder_coords){
-var li,pos,_6d;
-_6d=rcube_event.get_mouse_pos(e);
-pos=this.env.folderlist_coords;
-if(_6d.x<pos.x1||_6d.x>=pos.x2||_6d.y<pos.y1||_6d.y>=pos.y2){
-if(this.env.last_folder_target){
-this.set_classname(this.get_folder_li(this.env.last_folder_target),"droptarget",false);
-this.env.last_folder_target=null;
-}
-return;
-}
-for(var k in this.env.folder_coords){
-pos=this.env.folder_coords[k];
-if(this.check_droptarget(k)&&((_6d.x>=pos.x1)&&(_6d.x<pos.x2)&&(_6d.y>=pos.y1)&&(_6d.y<pos.y2))){
-this.set_classname(this.get_folder_li(k),"droptarget",true);
-this.env.last_folder_target=k;
-}else{
-this.set_classname(this.get_folder_li(k),"droptarget",false);
-}
-}
-}
-};
-this.collapse_folder=function(id){
-var div;
-if((li=this.get_folder_li(id))&&(div=li.getElementsByTagName("div")[0])&&(div.className.match(/collapsed/)||div.className.match(/expanded/))){
-var ul=li.getElementsByTagName("ul")[0];
-if(div.className.match(/collapsed/)){
-ul.style.display="";
-this.set_classname(div,"collapsed",false);
-this.set_classname(div,"expanded",true);
-var reg=new RegExp("&"+urlencode(id)+"&");
-this.set_env("collapsed_folders",this.env.collapsed_folders.replace(reg,""));
-}else{
-ul.style.display="none";
-this.set_classname(div,"expanded",false);
-this.set_classname(div,"collapsed",true);
-this.set_env("collapsed_folders",this.env.collapsed_folders+"&"+urlencode(id)+"&");
-if(this.env.mailbox.indexOf(id+this.env.delimiter)==0){
-this.command("list",id);
-}
-}
-if((bw.ie6||bw.ie7)&&li.nextSibling&&(li.nextSibling.getElementsByTagName("ul").length>0)&&li.nextSibling.getElementsByTagName("ul")[0].style&&(li.nextSibling.getElementsByTagName("ul")[0].style.display!="none")){
-li.nextSibling.getElementsByTagName("ul")[0].style.display="none";
-li.nextSibling.getElementsByTagName("ul")[0].style.display="";
-}
-this.http_post("save-pref","_name=collapsed_folders&_value="+urlencode(this.env.collapsed_folders));
-this.set_unread_count_display(id,false);
-}
-};
-this.click_on_list=function(e){
-if(this.message_list){
-this.message_list.focus();
-}else{
-if(this.contact_list){
-this.contact_list.focus();
-}
-}
-var _74;
-if(_74=this.get_folder_li()){
-this.set_classname(_74,"unfocused",true);
-}
-return rcube_event.get_button(e)==2?true:rcube_event.cancel(e);
-};
-this.msglist_select=function(_75){
-if(this.preview_timer){
-clearTimeout(this.preview_timer);
-}
-var _76=_75.selection.length==1;
-if(this.env.mailbox==this.env.drafts_mailbox){
-this.enable_command("reply","reply-all","forward",false);
-this.enable_command("show",_76);
-this.enable_command("delete","moveto","mark",(_75.selection.length>0?true:false));
-}else{
-this.enable_command("show","reply","reply-all","forward","print",_76);
-this.enable_command("delete","moveto","mark",(_75.selection.length>0?true:false));
-}
-if(_76&&this.env.contentframe&&!_75.multi_selecting){
-this.preview_timer=window.setTimeout(function(){
-_1.msglist_get_preview();
-},200);
-}else{
-if(this.env.contentframe){
-this.show_contentframe(false);
-}
-}
-};
-this.msglist_dbl_click=function(_77){
-if(this.preview_timer){
-clearTimeout(this.preview_timer);
-}
-var uid=_77.get_single_selection();
-if(uid&&this.env.mailbox==this.env.drafts_mailbox){
-this.goto_url("compose","_draft_uid="+uid+"&_mbox="+urlencode(this.env.mailbox),true);
-}else{
-if(uid){
-this.show_message(uid,false,false);
-}
-}
-};
-this.msglist_keypress=function(_79){
-if(_79.key_pressed==_79.ENTER_KEY){
-this.command("show");
-}else{
-if(_79.key_pressed==_79.DELETE_KEY){
-this.command("delete");
-}else{
-if(_79.key_pressed==_79.BACKSPACE_KEY){
-this.command("delete");
-}else{
-_79.shiftkey=false;
-}
-}
-}
-};
-this.msglist_get_preview=function(){
-var uid=this.get_single_uid();
-if(uid&&this.env.contentframe&&!this.drag_active){
-this.show_message(uid,false,true);
-}else{
-if(this.env.contentframe){
-this.show_contentframe(false);
-}
-}
-};
-this.check_droptarget=function(id){
-if(this.task=="mail"){
-return (this.env.mailboxes[id]&&this.env.mailboxes[id].id!=this.env.mailbox&&!this.env.mailboxes[id].virtual);
-}else{
-if(this.task=="addressbook"){
-return (id!=this.env.source&&this.env.address_sources[id]&&!this.env.address_sources[id].readonly);
-}else{
-if(this.task=="settings"){
-return (id!=this.env.folder);
-}
-}
-}
-};
-this.show_message=function(id,_7d,_7e){
-if(!id){
-return;
-}
-var _7f="";
-var _80=_7e?"preview":"show";
-var _81=window;
-if(_7e&&this.env.contentframe&&window.frames&&window.frames[this.env.contentframe]){
-_81=window.frames[this.env.contentframe];
-_7f="&_framed=1";
-}
-if(_7d){
-_7f="&_safe=1";
-}
-if(this.env.search_request){
-_7f+="&_search="+this.env.search_request;
-}
-var url="&_action="+_80+"&_uid="+id+"&_mbox="+urlencode(this.env.mailbox)+_7f;
-if(_80=="preview"&&String(_81.location.href).indexOf(url)>=0){
-this.show_contentframe(true);
-}else{
-this.set_busy(true,"loading");
-_81.location.href=this.env.comm_path+url;
-if(_80=="preview"&&this.message_list&&this.message_list.rows[id]&&this.message_list.rows[id].unread){
-this.set_message(id,"unread",false);
-if(this.env.unread_counts[this.env.mailbox]){
-this.env.unread_counts[this.env.mailbox]-=1;
-this.set_unread_count(this.env.mailbox,this.env.unread_counts[this.env.mailbox],this.env.mailbox=="INBOX");
-}
-}
-}
-};
-this.show_contentframe=function(_83){
-var frm;
-if(this.env.contentframe&&(frm=rcube_find_object(this.env.contentframe))){
-if(!_83&&window.frames[this.env.contentframe]){
-if(window.frames[this.env.contentframe].location.href.indexOf(this.env.blankpage)<0){
-window.frames[this.env.contentframe].location.href=this.env.blankpage;
-}
-}else{
-if(!bw.safari){
-frm.style.display=_83?"block":"none";
-}
-}
-}
-if(!_83&&this.busy){
-this.set_busy(false);
-}
-};
-this.list_page=function(_85){
-if(_85=="next"){
-_85=this.env.current_page+1;
-}
-if(_85=="last"){
-_85=this.env.pagecount;
-}
-if(_85=="prev"&&this.env.current_page>1){
-_85=this.env.current_page-1;
-}
-if(_85=="first"&&this.env.current_page>1){
-_85=1;
-}
-if(_85>0&&_85<=this.env.pagecount){
-this.env.current_page=_85;
-if(this.task=="mail"){
-this.list_mailbox(this.env.mailbox,_85);
-}else{
-if(this.task=="addressbook"){
-this.list_contacts(this.env.source,_85);
-}
-}
-}
-};
-this.filter_mailbox=function(_86){
-var _87;
-if(this.gui_objects.qsearchbox){
-_87=this.gui_objects.qsearchbox.value;
-}
-this.message_list.clear();
-this.env.current_page=1;
-this.set_busy(true,"searching");
-this.http_request("search","_filter="+_86+(_87?"&_q="+urlencode(_87):"")+(this.env.mailbox?"&_mbox="+urlencode(this.env.mailbox):""),true);
-};
-this.list_mailbox=function(_88,_89,_8a){
-this.last_selected=0;
-var _8b="";
-var _8c=window;
-if(!_88){
-_88=this.env.mailbox;
-}
-if(_8a){
-_8b+="&_sort="+_8a;
-}
-if(this.env.search_request){
-_8b+="&_search="+this.env.search_request;
-}
-if(!_89&&_88!=this.env.mailbox){
-_89=1;
-this.env.current_page=_89;
-if(this.message_list){
-this.message_list.clear_selection();
-}
-this.show_contentframe(false);
-}
-if(_88!=this.env.mailbox||(_88==this.env.mailbox&&!_89&&!_8a)){
-_8b+="&_refresh=1";
-}
-this.select_folder(_88,this.env.mailbox);
-this.env.mailbox=_88;
-if(this.gui_objects.messagelist){
-this.list_mailbox_remote(_88,_89,_8b);
-return;
-}
-if(this.env.contentframe&&window.frames&&window.frames[this.env.contentframe]){
-_8c=window.frames[this.env.contentframe];
-_8b+="&_framed=1";
-}
-if(_88){
-this.set_busy(true,"loading");
-_8c.location.href=this.env.comm_path+"&_mbox="+urlencode(_88)+(_89?"&_page="+_89:"")+_8b;
-}
-};
-this.list_mailbox_remote=function(_8d,_8e,_8f){
-this.message_list.clear();
-var url="_mbox="+urlencode(_8d)+(_8e?"&_page="+_8e:"");
-this.set_busy(true,"loading");
-this.http_request("list",url+_8f,true);
-};
-this.expunge_mailbox=function(_91){
-var _92=false;
-var _93="";
-if(_91==this.env.mailbox){
-_92=true;
-this.set_busy(true,"loading");
-_93="&_reload=1";
-}
-var url="_mbox="+urlencode(_91);
-this.http_post("expunge",url+_93,_92);
-};
-this.purge_mailbox=function(_95){
-var _96=false;
-var _97="";
-if(!confirm(this.get_label("purgefolderconfirm"))){
-return false;
-}
-if(_95==this.env.mailbox){
-_96=true;
-this.set_busy(true,"loading");
-_97="&_reload=1";
-}
-var url="_mbox="+urlencode(_95);
-this.http_post("purge",url+_97,_96);
-return true;
-};
-this.purge_mailbox_test=function(){
-return (this.env.messagecount&&(this.env.mailbox==this.env.trash_mailbox||this.env.mailbox==this.env.junk_mailbox||this.env.mailbox.match("^"+RegExp.escape(this.env.trash_mailbox)+RegExp.escape(this.env.delimiter))||this.env.mailbox.match("^"+RegExp.escape(this.env.junk_mailbox)+RegExp.escape(this.env.delimiter))));
-};
-this.set_message_icon=function(uid){
-var _9a;
-var _9b=this.message_list.rows;
-if(!_9b[uid]){
-return false;
-}
-if(_9b[uid].deleted&&this.env.deletedicon){
-_9a=this.env.deletedicon;
-}else{
-if(_9b[uid].replied&&this.env.repliedicon){
-if(_9b[uid].forwarded&&this.env.forwardedrepliedicon){
-_9a=this.env.forwardedrepliedicon;
-}else{
-_9a=this.env.repliedicon;
-}
-}else{
-if(_9b[uid].forwarded&&this.env.forwardedicon){
-_9a=this.env.forwardedicon;
-}else{
-if(_9b[uid].unread&&this.env.unreadicon){
-_9a=this.env.unreadicon;
-}else{
-if(this.env.messageicon){
-_9a=this.env.messageicon;
-}
-}
-}
-}
-}
-if(_9a&&_9b[uid].icon){
-_9b[uid].icon.src=_9a;
-}
-_9a="";
-if(_9b[uid].flagged&&this.env.flaggedicon){
-_9a=this.env.flaggedicon;
-}else{
-if(!_9b[uid].flagged&&this.env.unflaggedicon){
-_9a=this.env.unflaggedicon;
-}
-}
-if(_9b[uid].flagged_icon&&_9a){
-_9b[uid].flagged_icon.src=_9a;
-}
-};
-this.set_message_status=function(uid,_9d,_9e){
-var _9f=this.message_list.rows;
-if(!_9f[uid]){
-return false;
-}
-if(_9d=="unread"){
-_9f[uid].unread=_9e;
-}else{
-if(_9d=="deleted"){
-_9f[uid].deleted=_9e;
-}else{
-if(_9d=="replied"){
-_9f[uid].replied=_9e;
-}else{
-if(_9d=="forwarded"){
-_9f[uid].forwarded=_9e;
-}else{
-if(_9d=="flagged"){
-_9f[uid].flagged=_9e;
-}
-}
-}
-}
-}
-this.env.messages[uid]=_9f[uid];
-};
-this.set_message=function(uid,_a1,_a2){
-var _a3=this.message_list.rows;
-if(!_a3[uid]){
-return false;
-}
-if(_a1){
-this.set_message_status(uid,_a1,_a2);
-}
-if(_a3[uid].unread&&_a3[uid].classname.indexOf("unread")<0){
-_a3[uid].classname+=" unread";
-this.set_classname(_a3[uid].obj,"unread",true);
-}else{
-if(!_a3[uid].unread&&_a3[uid].classname.indexOf("unread")>=0){
-_a3[uid].classname=_a3[uid].classname.replace(/\s*unread/,"");
-this.set_classname(_a3[uid].obj,"unread",false);
-}
-}
-if(_a3[uid].deleted&&_a3[uid].classname.indexOf("deleted")<0){
-_a3[uid].classname+=" deleted";
-this.set_classname(_a3[uid].obj,"deleted",true);
-}else{
-if(!_a3[uid].deleted&&_a3[uid].classname.indexOf("deleted")>=0){
-_a3[uid].classname=_a3[uid].classname.replace(/\s*deleted/,"");
-this.set_classname(_a3[uid].obj,"deleted",false);
-}
-}
-if(_a3[uid].flagged&&_a3[uid].classname.indexOf("flagged")<0){
-_a3[uid].classname+=" flagged";
-this.set_classname(_a3[uid].obj,"flagged",true);
-}else{
-if(!_a3[uid].flagged&&_a3[uid].classname.indexOf("flagged")>=0){
-_a3[uid].classname=_a3[uid].classname.replace(/\s*flagged/,"");
-this.set_classname(_a3[uid].obj,"flagged",false);
-}
-}
-this.set_message_icon(uid);
-};
-this.move_messages=function(_a4){
-if(!_a4||_a4==this.env.mailbox||(!this.env.uid&&(!this.message_list||!this.message_list.get_selection().length))){
-return;
-}
-var _a5=false;
-var _a6="&_target_mbox="+urlencode(_a4)+"&_from="+(this.env.action?this.env.action:"");
-if(this.env.action=="show"){
-_a5=true;
-this.set_busy(true,"movingmessage");
-}else{
-if(!this.env.flag_for_deletion){
-this.show_contentframe(false);
-}
-}
-this.enable_command("reply","reply-all","forward","delete","mark","print",false);
-this._with_selected_messages("moveto",_a5,_a6,(this.env.flag_for_deletion?false:true));
-};
-this.delete_messages=function(){
-var _a7=this.message_list?this.message_list.get_selection():new Array();
-if(!this.env.uid&&!_a7.length){
-return;
-}
-if(this.env.trash_mailbox&&String(this.env.mailbox).toLowerCase()!=String(this.env.trash_mailbox).toLowerCase()){
-if(this.message_list&&this.message_list.shiftkey){
-if(confirm(this.get_label("deletemessagesconfirm"))){
-this.permanently_remove_messages();
-}
-}else{
-this.move_messages(this.env.trash_mailbox);
-}
-}else{
-if(this.env.trash_mailbox&&String(this.env.mailbox).toLowerCase()==String(this.env.trash_mailbox).toLowerCase()){
-this.permanently_remove_messages();
-}else{
-if(!this.env.trash_mailbox&&this.env.flag_for_deletion){
-this.mark_message("delete");
-if(this.env.action=="show"){
-this.command("nextmessage","",this);
-}else{
-if(_a7.length==1){
-this.message_list.select_next();
-}
-}
-}else{
-if(!this.env.trash_mailbox){
-this.permanently_remove_messages();
-}
-}
-}
-}
-};
-this.permanently_remove_messages=function(){
-if(!this.env.uid&&(!this.message_list||!this.message_list.get_selection().length)){
-return;
-}
-this.show_contentframe(false);
-this._with_selected_messages("delete",false,"&_from="+(this.env.action?this.env.action:""),true);
-};
-this._with_selected_messages=function(_a8,_a9,_aa,_ab){
-var _ac=new Array();
-if(this.env.uid){
-_ac[0]=this.env.uid;
-}else{
-var _ad=this.message_list.get_selection();
-var _ae=this.message_list.rows;
-var id;
-for(var n=0;n<_ad.length;n++){
-id=_ad[n];
-_ac[_ac.length]=id;
-if(_ab){
-this.message_list.remove_row(id,(n==_ad.length-1));
-}else{
-this.set_message_status(id,"deleted",true);
-if(this.env.read_when_deleted){
-this.set_message_status(id,"unread",false);
-}
-this.set_message(id);
-}
-}
-}
-if(this.env.search_request){
-_aa+="&_search="+this.env.search_request;
-}
-this.http_post(_a8,"_uid="+_ac.join(",")+"&_mbox="+urlencode(this.env.mailbox)+_aa,_a9);
-};
-this.mark_message=function(_b1,uid){
-var _b3=new Array();
-var _b4=new Array();
-var _b5=this.message_list?this.message_list.get_selection():new Array();
-if(uid){
-_b3[0]=uid;
-}else{
-if(this.env.uid){
-_b3[0]=this.env.uid;
-}else{
-if(this.message_list){
-for(var n=0;n<_b5.length;n++){
-_b3[_b3.length]=_b5[n];
-}
-}
-}
-}
-if(!this.message_list){
-_b4=_b3;
-}else{
-for(var id,n=0;n<_b3.length;n++){
-id=_b3[n];
-if((_b1=="read"&&this.message_list.rows[id].unread)||(_b1=="unread"&&!this.message_list.rows[id].unread)||(_b1=="delete"&&!this.message_list.rows[id].deleted)||(_b1=="undelete"&&this.message_list.rows[id].deleted)||(_b1=="flagged"&&!this.message_list.rows[id].flagged)||(_b1=="unflagged"&&this.message_list.rows[id].flagged)){
-_b4[_b4.length]=id;
-}
-}
-}
-if(!_b4.length){
-return;
-}
-switch(_b1){
-case "read":
-case "unread":
-this.toggle_read_status(_b1,_b4);
-break;
-case "delete":
-case "undelete":
-this.toggle_delete_status(_b4);
-break;
-case "flagged":
-case "unflagged":
-this.toggle_flagged_status(_b1,_b3);
-break;
-}
-};
-this.toggle_read_status=function(_b8,_b9){
-for(var i=0;i<_b9.length;i++){
-this.set_message(_b9[i],"unread",(_b8=="unread"?true:false));
-}
-this.http_post("mark","_uid="+_b9.join(",")+"&_flag="+_b8);
-};
-this.toggle_flagged_status=function(_bb,_bc){
-for(var i=0;i<_bc.length;i++){
-this.set_message(_bc[i],"flagged",(_bb=="flagged"?true:false));
-}
-this.http_post("mark","_uid="+_bc.join(",")+"&_flag="+_bb);
-};
-this.toggle_delete_status=function(_be){
-var _bf=this.message_list?this.message_list.rows:new Array();
-if(_be.length==1){
-if(!_bf.length||(_bf[_be[0]]&&!_bf[_be[0]].deleted)){
-this.flag_as_deleted(_be);
-}else{
-this.flag_as_undeleted(_be);
-}
-return true;
-}
-var _c0=true;
-for(var i=0;i<_be.length;i++){
-uid=_be[i];
-if(_bf[uid]){
-if(!_bf[uid].deleted){
-_c0=false;
-break;
-}
-}
-}
-if(_c0){
-this.flag_as_undeleted(_be);
-}else{
-this.flag_as_deleted(_be);
-}
-return true;
-};
-this.flag_as_undeleted=function(_c2){
-for(var i=0;i<_c2.length;i++){
-this.set_message(_c2[i],"deleted",false);
-}
-this.http_post("mark","_uid="+_c2.join(",")+"&_flag=undelete");
-return true;
-};
-this.flag_as_deleted=function(_c4){
-var _c5="";
-var _c6=new Array();
-var _c7=this.message_list?this.message_list.rows:new Array();
-for(var i=0;i<_c4.length;i++){
-uid=_c4[i];
-if(_c7[uid]){
-this.set_message(uid,"deleted",true);
-if(_c7[uid].unread){
-_c6[_c6.length]=uid;
-}
-}
-}
-if(_c6.length){
-_c5="&_ruid="+_c6.join(",");
-}
-this.http_post("mark","_uid="+_c4.join(",")+"&_flag=delete"+_c5);
-return true;
-};
-this.flag_deleted_as_read=function(_c9){
-var _ca;
-var _cb=this.message_list?this.message_list.rows:new Array();
-var str=String(_c9);
-var _cd=new Array();
-_cd=str.split(",");
-for(var uid,i=0;i<_cd.length;i++){
-uid=_cd[i];
-if(_cb[uid]){
-this.set_message(uid,"unread",false);
-}
-}
-};
-this.login_user_keyup=function(e){
-var key=rcube_event.get_keycode(e);
-var elm;
-if((key==13)&&(elm=rcube_find_object("_pass"))){
-elm.focus();
-return false;
-}
-};
-this.check_compose_input=function(){
-var _d3=rcube_find_object("_to");
-var _d4=rcube_find_object("_cc");
-var _d5=rcube_find_object("_bcc");
-var _d6=rcube_find_object("_from");
-var _d7=rcube_find_object("_subject");
-var _d8=rcube_find_object("_message");
-if(_d6.type=="text"&&!rcube_check_email(_d6.value,true)){
-alert(this.get_label("nosenderwarning"));
-_d6.focus();
-return false;
-}
-var _d9=_d3.value?_d3.value:(_d4.value?_d4.value:_d5.value);
-if(!rcube_check_email(_d9.replace(/^\s+/,"").replace(/[\s,;]+$/,""),true)){
-alert(this.get_label("norecipientwarning"));
-_d3.focus();
-return false;
-}
-if(_d7&&_d7.value==""){
-var _da=prompt(this.get_label("nosubjectwarning"),this.get_label("nosubject"));
-if(!_da&&_da!==""){
-_d7.focus();
-return false;
-}else{
-_d7.value=_da?_da:this.get_label("nosubject");
-}
-}
-if((!window.tinyMCE||!tinyMCE.get("compose-body"))&&_d8.value==""&&!confirm(this.get_label("nobodywarning"))){
-_d8.focus();
-return false;
-}else{
-if(window.tinyMCE&&tinyMCE.get("compose-body")&&!tinyMCE.get("compose-body").getContent()&&!confirm(this.get_label("nobodywarning"))){
-tinyMCE.get("compose-body").focus();
-return false;
-}
-}
-this.stop_spellchecking();
-return true;
-};
-this.stop_spellchecking=function(){
-if(this.env.spellcheck&&!this.spellcheck_ready){
-exec_event(this.env.spellcheck.check_link,"click");
-this.set_spellcheck_state("ready");
-}
-};
-this.display_spellcheck_controls=function(vis){
-if(this.env.spellcheck){
-if(!vis){
-this.stop_spellchecking();
-}
-this.env.spellcheck.check_link.style.visibility=vis?"visible":"hidden";
-this.env.spellcheck.switch_lan_pic.style.visibility=vis?"visible":"hidden";
-}
-};
-this.set_spellcheck_state=function(s){
-this.spellcheck_ready=(s=="check_spelling"||s=="ready");
-this.enable_command("spellcheck",this.spellcheck_ready);
-};
-this.set_draft_id=function(id){
-var f;
-if(f=rcube_find_object("_draft_saveid")){
-f.value=id;
-}
-};
-this.auto_save_start=function(){
-if(this.env.draft_autosave){
-this.save_timer=self.setTimeout(function(){
-_1.command("savedraft");
-},this.env.draft_autosave*1000);
-}
-this.busy=false;
-};
-this.compose_field_hash=function(_df){
-var _e0=rcube_find_object("_to");
-var _e1=rcube_find_object("_cc");
-var _e2=rcube_find_object("_bcc");
-var _e3=rcube_find_object("_subject");
-var _e4,_e5;
-var str="";
-if(_e0&&_e0.value){
-str+=_e0.value+":";
-}
-if(_e1&&_e1.value){
-str+=_e1.value+":";
-}
-if(_e2&&_e2.value){
-str+=_e2.value+":";
-}
-if(_e3&&_e3.value){
-str+=_e3.value+":";
-}
-if(_e4=tinyMCE.get("compose-body")){
-str+=_e4.getContent();
-}else{
-_e5=rcube_find_object("_message");
-str+=_e5.value;
-}
-if(_df){
-this.cmp_hash=str;
-}
-return str;
-};
-this.change_identity=function(obj){
-if(!obj||!obj.options){
-return false;
-}
-var id=obj.options[obj.selectedIndex].value;
-var _e9=rcube_find_object("_message");
-var _ea=_e9?_e9.value:"";
-var _eb=(rcube_find_object("_is_html").value=="1");
-var sig,p;
-if(!this.env.identity){
-this.env.identity=id;
-}
-if(!_eb){
-if(this.env.identity&&this.env.signatures&&this.env.signatures[this.env.identity]){
-if(this.env.signatures[this.env.identity]["is_html"]){
-sig=this.env.signatures[this.env.identity]["plain_text"];
-}else{
-sig=this.env.signatures[this.env.identity]["text"];
-}
-if(sig.indexOf("-- ")!=0){
-sig="-- \n"+sig;
-}
-p=_ea.lastIndexOf(sig);
-if(p>=0){
-_ea=_ea.substring(0,p-1)+_ea.substring(p+sig.length,_ea.length);
-}
-}
-_ea=_ea.replace(/[\r\n]+$/,"");
-if(this.env.signatures&&this.env.signatures[id]){
-sig=this.env.signatures[id]["text"];
-if(this.env.signatures[id]["is_html"]){
-sig=this.env.signatures[id]["plain_text"];
-}
-if(sig.indexOf("-- ")!=0){
-sig="-- \n"+sig;
-}
-_ea+="\n\n"+sig;
-}
-}else{
-var _ee=tinyMCE.get("compose-body");
-if(this.env.signatures){
-var _ef=_ee.dom.get("_rc_sig");
-var _f0="";
-var _f1=true;
-if(!_ef){
-if(bw.ie){
-_ee.getBody().appendChild(_ee.getDoc().createElement("br"));
-}
-_ef=_ee.getDoc().createElement("div");
-_ef.setAttribute("id","_rc_sig");
-_ee.getBody().appendChild(_ef);
-}
-if(this.env.signatures[id]){
-_f0=this.env.signatures[id]["text"];
-_f1=this.env.signatures[id]["is_html"];
-}
-if(_f1){
-_ef.innerHTML=_f0;
-}else{
-_ef.innerHTML="<pre>"+_f0+"</pre>";
-}
-}
-}
-if(_e9){
-_e9.value=_ea;
-}
-this.env.identity=id;
-return true;
-};
-this.show_attachment_form=function(a){
-if(!this.gui_objects.uploadbox){
-return false;
-}
-var elm,_f4;
-if(elm=this.gui_objects.uploadbox){
-if(a&&(_f4=this.gui_objects.attachmentlist)){
-var pos=rcube_get_object_pos(_f4);
-var _f6=pos.x;
-var top=pos.y+_f4.offsetHeight+10;
-elm.style.top=top+"px";
-elm.style.left=_f6+"px";
-}
-elm.style.visibility=a?"visible":"hidden";
-}
-try{
-if(!a&&this.gui_objects.attachmentform!=this.gui_objects.messageform){
-this.gui_objects.attachmentform.reset();
-}
-}
-catch(e){
-}
-return true;
-};
-this.upload_file=function(_f8){
-if(!_f8){
-return false;
-}
-var _f9=false;
-for(var n=0;n<_f8.elements.length;n++){
-if(_f8.elements[n].type=="file"&&_f8.elements[n].value){
-_f9=true;
-break;
-}
-}
-if(_f9){
-var ts=new Date().getTime();
-var _fc="rcmupload"+ts;
-if(document.all){
-var _fd="<iframe name=\""+_fc+"\" src=\"program/blank.gif\" style=\"width:0;height:0;visibility:hidden;\"></iframe>";
-document.body.insertAdjacentHTML("BeforeEnd",_fd);
-}else{
-var _fe=document.createElement("IFRAME");
-_fe.name=_fc;
-_fe.style.border="none";
-_fe.style.width=0;
-_fe.style.height=0;
-_fe.style.visibility="hidden";
-document.body.appendChild(_fe);
-}
-_f8.target=_fc;
-_f8.action=this.env.comm_path+"&_action=upload";
-_f8.setAttribute("enctype","multipart/form-data");
-_f8.submit();
-}
-this.gui_objects.attachmentform=_f8;
-return true;
-};
-this.add2attachment_list=function(_ff,_100){
-if(!this.gui_objects.attachmentlist){
-return false;
-}
-var li=document.createElement("LI");
-li.id=_ff;
-li.innerHTML=_100;
-this.gui_objects.attachmentlist.appendChild(li);
-return true;
-};
-this.remove_from_attachment_list=function(name){
-if(!this.gui_objects.attachmentlist){
-return false;
-}
-var list=this.gui_objects.attachmentlist.getElementsByTagName("li");
-for(i=0;i<list.length;i++){
-if(list[i].id==name){
-this.gui_objects.attachmentlist.removeChild(list[i]);
-}
-}
-};
-this.remove_attachment=function(name){
-if(name){
-this.http_post("remove-attachment","_file="+urlencode(name));
-}
-return true;
-};
-this.add_contact=function(_105){
-if(_105){
-this.http_post("addcontact","_address="+_105);
-}
-return true;
-};
-this.qsearch=function(_106,_107){
-if(_106!=""){
-if(this.message_list){
-this.message_list.clear();
-}else{
-if(this.contact_list){
-this.contact_list.clear(true);
-this.show_contentframe(false);
-}
-}
-if(this.gui_objects.search_filter){
-_107="&_filter="+this.gui_objects.search_filter.value;
-}
-this.env.current_page=1;
-this.set_busy(true,"searching");
-this.http_request("search","_q="+urlencode(_106)+(this.env.mailbox?"&_mbox="+urlencode(this.env.mailbox):"")+(this.env.source?"&_source="+urlencode(this.env.source):"")+(_107?_107:""),true);
-}
-return true;
-};
-this.reset_qsearch=function(){
-if(this.gui_objects.qsearchbox){
-this.gui_objects.qsearchbox.value="";
-}
-this.env.search_request=null;
-return true;
-};
-this.sent_successfully=function(type,msg){
-this.list_mailbox();
-this.display_message(msg,type,true);
-};
-this.ksearch_keypress=function(e,obj){
-if(this.ksearch_timer){
-clearTimeout(this.ksearch_timer);
-}
-var _10c;
-var key=rcube_event.get_keycode(e);
-var mod=rcube_event.get_modifier(e);
-switch(key){
-case 38:
-case 40:
-if(!this.ksearch_pane){
-break;
-}
-var dir=key==38?1:0;
-_10c=document.getElementById("rcmksearchSelected");
-if(!_10c){
-_10c=this.ksearch_pane.ul.firstChild;
-}
-if(_10c){
-this.ksearch_select(dir?_10c.previousSibling:_10c.nextSibling);
-}
-return rcube_event.cancel(e);
-case 9:
-if(mod==SHIFT_KEY){
-break;
-}
-case 13:
-if(this.ksearch_selected===null||!this.ksearch_input||!this.ksearch_value){
-break;
-}
-this.insert_recipient(this.ksearch_selected);
-this.ksearch_hide();
-return rcube_event.cancel(e);
-case 27:
-this.ksearch_hide();
-break;
-}
-this.ksearch_timer=window.setTimeout(function(){
-_1.ksearch_get_results();
-},200);
-this.ksearch_input=obj;
-return true;
-};
-this.ksearch_select=function(node){
-var _111=document.getElementById("rcmksearchSelected");
-if(_111&&node){
-_111.removeAttribute("id");
-this.set_classname(_111,"selected",false);
-}
-if(node){
-node.setAttribute("id","rcmksearchSelected");
-this.set_classname(node,"selected",true);
-this.ksearch_selected=node._rcm_id;
-}
-};
-this.insert_recipient=function(id){
-if(!this.env.contacts[id]||!this.ksearch_input){
-return;
-}
-var _113=this.ksearch_input.value.toLowerCase();
-var cpos=this.get_caret_pos(this.ksearch_input);
-var p=_113.lastIndexOf(this.ksearch_value,cpos);
-var pre=this.ksearch_input.value.substring(0,p);
-var end=this.ksearch_input.value.substring(p+this.ksearch_value.length,this.ksearch_input.value.length);
-var _118=this.env.contacts[id]+", ";
-this.ksearch_input.value=pre+_118+end;
-cpos=p+_118.length;
-if(this.ksearch_input.setSelectionRange){
-this.ksearch_input.setSelectionRange(cpos,cpos);
-}
-};
-this.ksearch_get_results=function(){
-var _119=this.ksearch_input?this.ksearch_input.value:null;
-if(_119===null){
-return;
-}
-if(this.ksearch_pane&&this.ksearch_pane.visible){
-this.ksearch_pane.show(0);
-}
-var cpos=this.get_caret_pos(this.ksearch_input);
-var p=_119.lastIndexOf(",",cpos-1);
-var q=_119.substring(p+1,cpos);
-q=q.replace(/(^\s+|\s+$)/g,"").toLowerCase();
-if(!q.length||q==this.ksearch_value){
-return;
-}
-this.ksearch_value=q;
-this.display_message(this.get_label("searching"),"loading",true);
-this.http_post("autocomplete","_search="+q);
-};
-this.ksearch_query_results=function(_11d){
-this.hide_message();
-this.env.contacts=_11d?_11d:[];
-var _11e=new Array();
-var c=0;
-for(var i=0;i<this.env.contacts.length;i++){
-_11e[c++]=i;
-if(c==15){
-break;
-}
-}
-this.ksearch_display_results(this.env.contacts,_11e,c);
-};
-this.ksearch_display_results=function(_121,_122,c){
-if(c&&_121.length&&this.ksearch_input){
-var p,ul,li;
-if(!this.ksearch_pane){
-ul=document.createElement("UL");
-this.ksearch_pane=new rcube_layer("rcmKSearchpane",{vis:0,zindex:30000});
-this.ksearch_pane.elm.appendChild(ul);
-this.ksearch_pane.ul=ul;
-}else{
-ul=this.ksearch_pane.ul;
-}
-ul.innerHTML="";
-for(i=0;i<_121.length;i++){
-li=document.createElement("LI");
-li.innerHTML=_121[i].replace(new RegExp("("+this.ksearch_value+")","ig"),"##$1%%").replace(/</g,"<").replace(/>/g,">").replace(/##([^%]+)%%/g,"<b>$1</b>");
-li.onmouseover=function(){
-_1.ksearch_select(this);
-};
-li.onmouseup=function(){
-_1.ksearch_click(this);
-};
-li._rcm_id=_122[i];
-ul.appendChild(li);
-}
-if(this.ksearch_selected!==null){
-p=find_in_array(this.ksearch_selected,_122);
-if(p>=0&&ul.childNodes){
-ul.childNodes[p].setAttribute("id","rcmksearchSelected");
-this.set_classname(ul.childNodes[p],"selected",true);
-}else{
-this.ksearch_selected=null;
-}
-}
-if(this.ksearch_selected===null){
-ul.firstChild.setAttribute("id","rcmksearchSelected");
-this.set_classname(ul.firstChild,"selected",true);
-this.ksearch_selected=_122[0];
-}
-var pos=rcube_get_object_pos(this.ksearch_input);
-this.ksearch_pane.move(pos.x,pos.y+this.ksearch_input.offsetHeight);
-this.ksearch_pane.show(1);
-}else{
-this.ksearch_hide();
-}
-};
-this.ksearch_click=function(node){
-this.insert_recipient(node._rcm_id);
-this.ksearch_hide();
-if(_1.ksearch_input){
-this.ksearch_input.focus();
-}
-};
-this.ksearch_blur=function(){
-if(this.ksearch_timer){
-clearTimeout(this.ksearch_timer);
-}
-this.ksearch_value="";
-this.ksearch_input=null;
-this.ksearch_hide();
-};
-this.ksearch_hide=function(){
-this.ksearch_selected=null;
-if(this.ksearch_pane){
-this.ksearch_pane.show(0);
-}
-};
-this.contactlist_keypress=function(list){
-if(list.key_pressed==list.DELETE_KEY){
-this.command("delete");
-}
-};
-this.contactlist_select=function(list){
-if(this.preview_timer){
-clearTimeout(this.preview_timer);
-}
-var id,_12c,_1=this;
-if(id=list.get_single_selection()){
-this.preview_timer=window.setTimeout(function(){
-_1.load_contact(id,"show");
-},200);
-}else{
-if(this.env.contentframe){
-this.show_contentframe(false);
-}
-}
-this.enable_command("compose",list.selection.length>0);
-this.enable_command("edit",(id&&this.env.address_sources&&!this.env.address_sources[this.env.source].readonly)?true:false);
-this.enable_command("delete",list.selection.length&&this.env.address_sources&&!this.env.address_sources[this.env.source].readonly);
-return false;
-};
-this.list_contacts=function(src,page){
-var _12f="";
-var _130=window;
-if(!src){
-src=this.env.source;
-}
-if(page&&this.current_page==page&&src==this.env.source){
-return false;
-}
-if(src!=this.env.source){
-page=1;
-this.env.current_page=page;
-this.reset_qsearch();
-}
-this.select_folder(src,this.env.source);
-this.env.source=src;
-if(this.gui_objects.contactslist){
-this.list_contacts_remote(src,page);
-return;
-}
-if(this.env.contentframe&&window.frames&&window.frames[this.env.contentframe]){
-_130=window.frames[this.env.contentframe];
-_12f="&_framed=1";
-}
-if(this.env.search_request){
-_12f+="&_search="+this.env.search_request;
-}
-this.set_busy(true,"loading");
-_130.location.href=this.env.comm_path+(src?"&_source="+urlencode(src):"")+(page?"&_page="+page:"")+_12f;
-};
-this.list_contacts_remote=function(src,page){
-this.contact_list.clear(true);
-this.show_contentframe(false);
-this.enable_command("delete","compose",false);
-var url=(src?"_source="+urlencode(src):"")+(page?(src?"&":"")+"_page="+page:"");
-this.env.source=src;
-if(this.env.search_request){
-url+="&_search="+this.env.search_request;
-}
-this.set_busy(true,"loading");
-this.http_request("list",url,true);
-};
-this.load_contact=function(cid,_135,_136){
-var _137="";
-var _138=window;
-if(this.env.contentframe&&window.frames&&window.frames[this.env.contentframe]){
-_137="&_framed=1";
-_138=window.frames[this.env.contentframe];
-this.show_contentframe(true);
-}else{
-if(_136){
-return false;
-}
-}
-if(_135&&(cid||_135=="add")&&!this.drag_active){
-this.set_busy(true);
-_138.location.href=this.env.comm_path+"&_action="+_135+"&_source="+urlencode(this.env.source)+"&_cid="+urlencode(cid)+_137;
-}
-return true;
-};
-this.copy_contact=function(cid,to){
-if(!cid){
-cid=this.contact_list.get_selection().join(",");
-}
-if(to!=this.env.source&&cid&&this.env.address_sources[to]&&!this.env.address_sources[to].readonly){
-this.http_post("copy","_cid="+urlencode(cid)+"&_source="+urlencode(this.env.source)+"&_to="+urlencode(to));
-}
-};
-this.delete_contacts=function(){
-var _13b=this.contact_list.get_selection();
-if(!(_13b.length||this.env.cid)||!confirm(this.get_label("deletecontactconfirm"))){
-return;
-}
-var _13c=new Array();
-var qs="";
-if(this.env.cid){
-_13c[_13c.length]=this.env.cid;
-}else{
-var id;
-for(var n=0;n<_13b.length;n++){
-id=_13b[n];
-_13c[_13c.length]=id;
-this.contact_list.remove_row(id,(n==_13b.length-1));
-}
-if(_13b.length==1){
-this.show_contentframe(false);
-}
-}
-if(this.env.search_request){
-qs+="&_search="+this.env.search_request;
-}
-this.http_post("delete","_cid="+urlencode(_13c.join(","))+"&_source="+urlencode(this.env.source)+"&_from="+(this.env.action?this.env.action:"")+qs);
-return true;
-};
-this.update_contact_row=function(cid,_141){
-var row;
-if(this.contact_list.rows[cid]&&(row=this.contact_list.rows[cid].obj)){
-for(var c=0;c<_141.length;c++){
-if(row.cells[c]){
-row.cells[c].innerHTML=_141[c];
-}
-}
-return true;
-}
-return false;
-};
-this.init_subscription_list=function(){
-var p=this;
-this.subscription_list=new rcube_list_widget(this.gui_objects.subscriptionlist,{multiselect:false,draggable:true,keyboard:false,toggleselect:true});
-this.subscription_list.addEventListener("select",function(o){
-p.subscription_select(o);
-});
-this.subscription_list.addEventListener("dragstart",function(o){
-p.drag_active=true;
-});
-this.subscription_list.addEventListener("dragend",function(o){
-p.subscription_move_folder(o);
-});
-this.subscription_list.row_init=function(row){
-var _149=row.obj.getElementsByTagName("A");
-if(_149[0]){
-_149[0].onclick=function(){
-p.rename_folder(row.id);
-return false;
-};
-}
-if(_149[1]){
-_149[1].onclick=function(){
-p.delete_folder(row.id);
-return false;
-};
-}
-row.obj.onmouseover=function(){
-p.focus_subscription(row.id);
-};
-row.obj.onmouseout=function(){
-p.unfocus_subscription(row.id);
-};
-};
-this.subscription_list.init();
-};
-this.identity_select=function(list){
-var id;
-if(id=list.get_single_selection()){
-this.load_identity(id,"edit-identity");
-}
-};
-this.load_identity=function(id,_14d){
-if(_14d=="edit-identity"&&(!id||id==this.env.iid)){
-return false;
-}
-var _14e="";
-var _14f=window;
-if(this.env.contentframe&&window.frames&&window.frames[this.env.contentframe]){
-_14e="&_framed=1";
-_14f=window.frames[this.env.contentframe];
-document.getElementById(this.env.contentframe).style.visibility="inherit";
-}
-if(_14d&&(id||_14d=="add-identity")){
-this.set_busy(true);
-_14f.location.href=this.env.comm_path+"&_action="+_14d+"&_iid="+id+_14e;
-}
-return true;
-};
-this.delete_identity=function(id){
-var _151=this.identity_list.get_selection();
-if(!(_151.length||this.env.iid)){
-return;
-}
-if(!id){
-id=this.env.iid?this.env.iid:_151[0];
-}
-this.goto_url("delete-identity","_iid="+id,true);
-return true;
-};
-this.focus_subscription=function(id){
-var row,_154;
-var reg=RegExp("["+RegExp.escape(this.env.delimiter)+"]?[^"+RegExp.escape(this.env.delimiter)+"]+$");
-if(this.drag_active&&this.env.folder&&(row=document.getElementById(id))){
-if(this.env.subscriptionrows[id]&&(_154=this.env.subscriptionrows[id][0])){
-if(this.check_droptarget(_154)&&!this.env.subscriptionrows[this.get_folder_row_id(this.env.folder)][2]&&(_154!=this.env.folder.replace(reg,""))&&(!_154.match(new RegExp("^"+RegExp.escape(this.env.folder+this.env.delimiter))))){
-this.set_env("dstfolder",_154);
-this.set_classname(row,"droptarget",true);
-}
-}else{
-if(this.env.folder.match(new RegExp(RegExp.escape(this.env.delimiter)))){
-this.set_env("dstfolder",this.env.delimiter);
-this.set_classname(this.subscription_list.frame,"droptarget",true);
-}
-}
-}
-};
-this.unfocus_subscription=function(id){
-var row;
-this.set_env("dstfolder",null);
-if(this.env.subscriptionrows[id]&&(row=document.getElementById(id))){
-this.set_classname(row,"droptarget",false);
-}else{
-this.set_classname(this.subscription_list.frame,"droptarget",false);
-}
-};
-this.subscription_select=function(list){
-var id,_15a;
-if((id=list.get_single_selection())&&this.env.subscriptionrows["rcmrow"+id]&&(_15a=this.env.subscriptionrows["rcmrow"+id][0])){
-this.set_env("folder",_15a);
-}else{
-this.set_env("folder",null);
-}
-if(this.gui_objects.createfolderhint){
-this.gui_objects.createfolderhint.innerHTML=this.env.folder?this.get_label("addsubfolderhint"):"";
-}
-};
-this.subscription_move_folder=function(list){
-var reg=RegExp("["+RegExp.escape(this.env.delimiter)+"]?[^"+RegExp.escape(this.env.delimiter)+"]+$");
-if(this.env.folder&&this.env.dstfolder&&(this.env.dstfolder!=this.env.folder)&&(this.env.dstfolder!=this.env.folder.replace(reg,""))){
-var reg=new RegExp("[^"+RegExp.escape(this.env.delimiter)+"]*["+RegExp.escape(this.env.delimiter)+"]","g");
-var _15d=this.env.folder.replace(reg,"");
-var _15e=this.env.dstfolder==this.env.delimiter?_15d:this.env.dstfolder+this.env.delimiter+_15d;
-this.set_busy(true,"foldermoving");
-this.http_post("rename-folder","_folder_oldname="+urlencode(this.env.folder)+"&_folder_newname="+urlencode(_15e),true);
-}
-this.drag_active=false;
-this.unfocus_subscription(this.get_folder_row_id(this.env.dstfolder));
-};
-this.create_folder=function(name){
-if(this.edit_folder){
-this.reset_folder_rename();
-}
-var form;
-if((form=this.gui_objects.editform)&&form.elements["_folder_name"]){
-name=form.elements["_folder_name"].value;
-if(name.indexOf(this.env.delimiter)>=0){
-alert(this.get_label("forbiddencharacter")+" ("+this.env.delimiter+")");
-return false;
-}
-if(this.env.folder&&name!=""){
-name=this.env.folder+this.env.delimiter+name;
-}
-this.set_busy(true,"foldercreating");
-this.http_post("create-folder","_name="+urlencode(name),true);
-}else{
-if(form.elements["_folder_name"]){
-form.elements["_folder_name"].focus();
-}
-}
-};
-this.rename_folder=function(id){
-var temp,row,form;
-if(temp=this.edit_folder){
-this.reset_folder_rename();
-if(temp==id){
-return;
-}
-}
-if(id&&this.env.subscriptionrows[id]&&(row=document.getElementById(id))){
-var reg=new RegExp(".*["+RegExp.escape(this.env.delimiter)+"]");
-this.name_input=document.createElement("INPUT");
-this.name_input.value=this.env.subscriptionrows[id][0].replace(reg,"");
-this.name_input.style.width="100%";
-reg=new RegExp("["+RegExp.escape(this.env.delimiter)+"]?[^"+RegExp.escape(this.env.delimiter)+"]+$");
-this.name_input.__parent=this.env.subscriptionrows[id][0].replace(reg,"");
-this.name_input.onkeypress=function(e){
-rcmail.name_input_keypress(e);
-};
-row.cells[0].replaceChild(this.name_input,row.cells[0].firstChild);
-this.edit_folder=id;
-this.name_input.select();
-if(form=this.gui_objects.editform){
-form.onsubmit=function(){
-return false;
-};
-}
-}
-};
-this.reset_folder_rename=function(){
-var cell=this.name_input?this.name_input.parentNode:null;
-if(cell&&this.edit_folder&&this.env.subscriptionrows[this.edit_folder]){
-cell.innerHTML=this.env.subscriptionrows[this.edit_folder][1];
-}
-this.edit_folder=null;
-};
-this.name_input_keypress=function(e){
-var key=rcube_event.get_keycode(e);
-if(key==13){
-var _16a=this.name_input?this.name_input.value:null;
-if(this.edit_folder&&_16a){
-if(_16a.indexOf(this.env.delimiter)>=0){
-alert(this.get_label("forbiddencharacter")+" ("+this.env.delimiter+")");
-return false;
-}
-if(this.name_input.__parent){
-_16a=this.name_input.__parent+this.env.delimiter+_16a;
-}
-this.set_busy(true,"folderrenaming");
-this.http_post("rename-folder","_folder_oldname="+urlencode(this.env.subscriptionrows[this.edit_folder][0])+"&_folder_newname="+urlencode(_16a),true);
-}
-}else{
-if(key==27){
-this.reset_folder_rename();
-}
-}
-};
-this.delete_folder=function(id){
-var _16c=this.env.subscriptionrows[id][0];
-if(this.edit_folder){
-this.reset_folder_rename();
-}
-if(_16c&&confirm(this.get_label("deletefolderconfirm"))){
-this.set_busy(true,"folderdeleting");
-this.http_post("delete-folder","_mboxes="+urlencode(_16c),true);
-this.set_env("folder",null);
-if(this.gui_objects.createfolderhint){
-this.gui_objects.createfolderhint.innerHTML="";
-}
-}
-};
-this.add_folder_row=function(name,_16e,_16f,_170){
-if(!this.gui_objects.subscriptionlist){
-return false;
-}
-for(var _171 in this.env.subscriptionrows){
-if(this.env.subscriptionrows[_171]!=null&&!this.env.subscriptionrows[_171][2]){
-break;
-}
-}
-var _172,form;
-var _174=this.gui_objects.subscriptionlist.tBodies[0];
-var id="rcmrow"+(_174.childNodes.length+1);
-var _176=this.subscription_list.get_single_selection();
-if(_16f&&_16f.id){
-id=_16f.id;
-_171=_16f.id;
-}
-if(!id||!(_172=document.getElementById(_171))){
-this.goto_url("folders");
-}else{
-var row=this.clone_table_row(_172);
-row.id=id;
-if(_170&&(_170=this.get_folder_row_id(_170))){
-_174.insertBefore(row,document.getElementById(_170));
-}else{
-_174.appendChild(row);
-}
-if(_16f){
-_174.removeChild(_16f);
-}
-}
-this.env.subscriptionrows[row.id]=[name,_16e,0];
-row.cells[0].innerHTML=_16e;
-if(!_16f){
-row.cells[1].innerHTML="*";
-}
-if(!_16f&&row.cells[2]&&row.cells[2].firstChild.tagName=="INPUT"){
-row.cells[2].firstChild.value=name;
-row.cells[2].firstChild.checked=true;
-}
-if(!_16f&&(form=this.gui_objects.editform)){
-if(form.elements["_folder_oldname"]){
-form.elements["_folder_oldname"].options[form.elements["_folder_oldname"].options.length]=new Option(name,name);
-}
-if(form.elements["_folder_name"]){
-form.elements["_folder_name"].value="";
-}
-}
-this.init_subscription_list();
-if(_176&&document.getElementById("rcmrow"+_176)){
-this.subscription_list.select_row(_176);
-}
-if(document.getElementById(id).scrollIntoView){
-document.getElementById(id).scrollIntoView();
-}
-};
-this.replace_folder_row=function(_178,_179,_17a,_17b){
-var id=this.get_folder_row_id(_178);
-var row=document.getElementById(id);
-this.add_folder_row(_179,_17a,row,_17b);
-var form,elm;
-if((form=this.gui_objects.editform)&&(elm=form.elements["_folder_oldname"])){
-for(var i=0;i<elm.options.length;i++){
-if(elm.options[i].value==_178){
-elm.options[i].text=_17a;
-elm.options[i].value=_179;
-break;
-}
-}
-form.elements["_folder_newname"].value="";
-}
-};
-this.remove_folder_row=function(_181){
-var row;
-var id=this.get_folder_row_id(_181);
-if(id&&(row=document.getElementById(id))){
-row.style.display="none";
-}
-var form;
-if((form=this.gui_objects.editform)&&form.elements["_folder_oldname"]){
-for(var i=0;i<form.elements["_folder_oldname"].options.length;i++){
-if(form.elements["_folder_oldname"].options[i].value==_181){
-form.elements["_folder_oldname"].options[i]=null;
-break;
-}
-}
-}
-if(form&&form.elements["_folder_newname"]){
-form.elements["_folder_newname"].value="";
-}
-};
-this.subscribe_folder=function(_186){
-if(_186){
-this.http_post("subscribe","_mbox="+urlencode(_186));
-}
-};
-this.unsubscribe_folder=function(_187){
-if(_187){
-this.http_post("unsubscribe","_mbox="+urlencode(_187));
-}
-};
-this.get_folder_row_id=function(_188){
-for(var id in this.env.subscriptionrows){
-if(this.env.subscriptionrows[id]&&this.env.subscriptionrows[id][0]==_188){
-break;
-}
-}
-return id;
-};
-this.clone_table_row=function(row){
-var cell,td;
-var _18d=document.createElement("TR");
-for(var n=0;n<row.cells.length;n++){
-cell=row.cells[n];
-td=document.createElement("TD");
-if(cell.className){
-td.className=cell.className;
-}
-if(cell.align){
-td.setAttribute("align",cell.align);
-}
-td.innerHTML=cell.innerHTML;
-_18d.appendChild(td);
-}
-return _18d;
-};
-this.set_page_buttons=function(){
-this.enable_command("nextpage",(this.env.pagecount>this.env.current_page));
-this.enable_command("lastpage",(this.env.pagecount>this.env.current_page));
-this.enable_command("previouspage",(this.env.current_page>1));
-this.enable_command("firstpage",(this.env.current_page>1));
-};
-this.set_button=function(_18f,_190){
-var _191=this.buttons[_18f];
-var _192,obj;
-if(!_191||!_191.length){
-return false;
-}
-for(var n=0;n<_191.length;n++){
-_192=_191[n];
-obj=document.getElementById(_192.id);
-if(obj&&_192.type=="image"&&!_192.status){
-_192.pas=obj._original_src?obj._original_src:obj.src;
-if(obj.runtimeStyle&&obj.runtimeStyle.filter&&obj.runtimeStyle.filter.match(/src=['"]([^'"]+)['"]/)){
-_192.pas=RegExp.$1;
-}
-}else{
-if(obj&&!_192.status){
-_192.pas=String(obj.className);
-}
-}
-if(obj&&_192.type=="image"&&_192[_190]){
-_192.status=_190;
-obj.src=_192[_190];
-}else{
-if(obj&&typeof (_192[_190])!="undefined"){
-_192.status=_190;
-obj.className=_192[_190];
-}
-}
-if(obj&&_192.type=="input"){
-_192.status=_190;
-obj.disabled=!_190;
-}
-}
-};
-this.set_alttext=function(_195,_196){
-if(!this.buttons[_195]||!this.buttons[_195].length){
-return;
-}
-var _197,obj,link;
-for(var n=0;n<this.buttons[_195].length;n++){
-_197=this.buttons[_195][n];
-obj=document.getElementById(_197.id);
-if(_197.type=="image"&&obj){
-obj.setAttribute("alt",this.get_label(_196));
-if((link=obj.parentNode)&&link.tagName=="A"){
-link.setAttribute("title",this.get_label(_196));
-}
-}else{
-if(obj){
-obj.setAttribute("title",this.get_label(_196));
-}
-}
-}
-};
-this.button_over=function(_19b,id){
-var _19d=this.buttons[_19b];
-var _19e,img;
-if(!_19d||!_19d.length){
-return false;
-}
-for(var n=0;n<_19d.length;n++){
-_19e=_19d[n];
-if(_19e.id==id&&_19e.status=="act"){
-img=document.getElementById(_19e.id);
-if(img&&_19e.over){
-img.src=_19e.over;
-}
-}
-}
-};
-this.button_sel=function(_1a1,id){
-var _1a3=this.buttons[_1a1];
-var _1a4,img;
-if(!_1a3||!_1a3.length){
-return;
-}
-for(var n=0;n<_1a3.length;n++){
-_1a4=_1a3[n];
-if(_1a4.id==id&&_1a4.status=="act"){
-img=document.getElementById(_1a4.id);
-if(img&&_1a4.sel){
-img.src=_1a4.sel;
-}
-}
-}
-};
-this.button_out=function(_1a7,id){
-var _1a9=this.buttons[_1a7];
-var _1aa,img;
-if(!_1a9||!_1a9.length){
-return;
-}
-for(var n=0;n<_1a9.length;n++){
-_1aa=_1a9[n];
-if(_1aa.id==id&&_1aa.status=="act"){
-img=document.getElementById(_1aa.id);
-if(img&&_1aa.act){
-img.src=_1aa.act;
-}
-}
-}
-};
-this.set_classname=function(obj,_1ae,set){
-var reg=new RegExp("s*"+_1ae,"i");
-if(!set&&obj.className.match(reg)){
-obj.className=obj.className.replace(reg,"");
-}else{
-if(set&&!obj.className.match(reg)){
-obj.className+=" "+_1ae;
-}
-}
-};
-this.set_pagetitle=function(_1b1){
-if(_1b1&&document.title){
-document.title=_1b1;
-}
-};
-this.display_message=function(msg,type,hold){
-if(!this.loaded){
-this.pending_message=new Array(msg,type);
-return true;
-}
-if(this.env.framed&&parent.rcmail){
-return parent.rcmail.display_message(msg,type,hold);
-}
-if(!this.gui_objects.message){
-return false;
-}
-if(this.message_timer){
-clearTimeout(this.message_timer);
-}
-var cont=msg;
-if(type){
-cont="<div class=\""+type+"\">"+cont+"</div>";
-}
-var _1b6=this;
-this.gui_objects.message.innerHTML=cont;
-this.gui_objects.message.style.display="block";
-if(type!="loading"){
-this.gui_objects.message.onmousedown=function(){
-_1b6.hide_message();
-return true;
-};
-}
-if(!hold){
-this.message_timer=window.setTimeout(function(){
-_1.hide_message();
-},this.message_time);
-}
-};
-this.hide_message=function(){
-if(this.gui_objects.message){
-this.gui_objects.message.style.display="none";
-this.gui_objects.message.onmousedown=null;
-}
-};
-this.select_folder=function(name,old){
-if(this.gui_objects.folderlist){
-var _1b9,_1ba;
-if((_1b9=this.get_folder_li(old))){
-this.set_classname(_1b9,"selected",false);
-this.set_classname(_1b9,"unfocused",false);
-}
-if((_1ba=this.get_folder_li(name))){
-this.set_classname(_1ba,"unfocused",false);
-this.set_classname(_1ba,"selected",true);
-}
-}
-};
-this.get_folder_li=function(name){
-if(this.gui_objects.folderlist){
-name=String(name).replace(this.identifier_expr,"");
-return document.getElementById("rcmli"+name);
-}
-return null;
-};
-this.set_message_coltypes=function(_1bc){
-this.coltypes=_1bc;
-var cell,col;
-var _1bf=this.gui_objects.messagelist?this.gui_objects.messagelist.tHead:null;
-for(var n=0;_1bf&&n<this.coltypes.length;n++){
-col=this.coltypes[n];
-if((cell=_1bf.rows[0].cells[n+1])&&(col=="from"||col=="to")){
-if(cell.firstChild&&cell.firstChild.tagName=="A"){
-cell.firstChild.innerHTML=this.get_label(this.coltypes[n]);
-cell.firstChild.onclick=function(){
-return rcmail.command("sort",this.__col,this);
-};
-cell.firstChild.__col=col;
-}else{
-cell.innerHTML=this.get_label(this.coltypes[n]);
-}
-cell.id="rcm"+col;
-}else{
-if(col=="subject"&&this.message_list){
-this.message_list.subject_col=n+1;
-}
-}
-}
-};
-this.add_message_row=function(uid,cols,_1c3,_1c4,_1c5){
-if(!this.gui_objects.messagelist||!this.message_list){
-return false;
-}
-var _1c6=this.gui_objects.messagelist.tBodies[0];
-var _1c7=_1c6.rows.length;
-var even=_1c7%2;
-this.env.messages[uid]={deleted:_1c3.deleted?1:0,replied:_1c3.replied?1:0,unread:_1c3.unread?1:0,forwarded:_1c3.forwarded?1:0,flagged:_1c3.flagged?1:0};
-var row=document.createElement("TR");
-row.id="rcmrow"+uid;
-row.className="message"+(even?" even":" odd")+(_1c3.unread?" unread":"")+(_1c3.deleted?" deleted":"")+(_1c3.flagged?" flagged":"");
-if(this.message_list.in_selection(uid)){
-row.className+=" selected";
-}
-var icon=this.env.messageicon;
-if(_1c3.deleted&&this.env.deletedicon){
-icon=this.env.deletedicon;
-}else{
-if(_1c3.replied&&this.env.repliedicon){
-if(_1c3.forwarded&&this.env.forwardedrepliedicon){
-icon=this.env.forwardedrepliedicon;
-}else{
-icon=this.env.repliedicon;
-}
-}else{
-if(_1c3.forwarded&&this.env.forwardedicon){
-icon=this.env.forwardedicon;
-}else{
-if(_1c3.unread&&this.env.unreadicon){
-icon=this.env.unreadicon;
-}
-}
-}
-}
-var col=document.createElement("TD");
-col.className="icon";
-col.innerHTML=icon?"<img src=\""+icon+"\" alt=\"\" />":"";
-row.appendChild(col);
-for(var n=0;n<this.coltypes.length;n++){
-var c=this.coltypes[n];
-col=document.createElement("TD");
-col.className=String(c).toLowerCase();
-if(c=="flag"){
-if(_1c3.flagged&&this.env.flaggedicon){
-col.innerHTML="<img src=\""+this.env.flaggedicon+"\" alt=\"\" />";
-}else{
-if(!_1c3.flagged&&this.env.unflaggedicon){
-col.innerHTML="<img src=\""+this.env.unflaggedicon+"\" alt=\"\" />";
-}
-}
-}else{
-if(c=="attachment"){
-col.innerHTML=_1c4&&this.env.attachmenticon?"<img src=\""+this.env.attachmenticon+"\" alt=\"\" />":" ";
-}else{
-col.innerHTML=cols[c];
-}
-}
-row.appendChild(col);
-}
-this.message_list.insert_row(row,_1c5);
-if(_1c5&&this.env.pagesize&&this.message_list.rowcount>this.env.pagesize){
-var uid=this.message_list.get_last_row();
-this.message_list.remove_row(uid);
-this.message_list.clear_selection(uid);
-}
-};
-this.set_rowcount=function(text){
-if(this.gui_objects.countdisplay){
-this.gui_objects.countdisplay.innerHTML=text;
-}
-this.set_page_buttons();
-};
-this.set_mailboxname=function(_1cf){
-if(this.gui_objects.mailboxname&&_1cf){
-this.gui_objects.mailboxname.innerHTML=_1cf;
-}
-};
-this.set_quota=function(_1d0){
-if(this.gui_objects.quotadisplay&&_1d0){
-this.gui_objects.quotadisplay.innerHTML=_1d0;
-}
-};
-this.set_unread_count=function(mbox,_1d2,_1d3){
-if(!this.gui_objects.mailboxlist){
-return false;
-}
-this.env.unread_counts[mbox]=_1d2;
-this.set_unread_count_display(mbox,_1d3);
-};
-this.set_unread_count_display=function(mbox,_1d5){
-var reg,_1d7,item,_1d9,_1da,div;
-if(item=this.get_folder_li(mbox)){
-_1d9=this.env.unread_counts[mbox]?this.env.unread_counts[mbox]:0;
-_1d7=item.getElementsByTagName("a")[0];
-reg=/\s+\([0-9]+\)$/i;
-_1da=0;
-if((div=item.getElementsByTagName("div")[0])&&div.className.match(/collapsed/)){
-for(var k in this.env.unread_counts){
-if(k.indexOf(mbox+this.env.delimiter)==0){
-_1da+=this.env.unread_counts[k];
-}
-}
-}
-if(_1d9&&_1d7.innerHTML.match(reg)){
-_1d7.innerHTML=_1d7.innerHTML.replace(reg," ("+_1d9+")");
-}else{
-if(_1d9){
-_1d7.innerHTML+=" ("+_1d9+")";
-}else{
-_1d7.innerHTML=_1d7.innerHTML.replace(reg,"");
-}
-}
-reg=new RegExp(RegExp.escape(this.env.delimiter)+"[^"+RegExp.escape(this.env.delimiter)+"]+$");
-if(mbox.match(reg)){
-this.set_unread_count_display(mbox.replace(reg,""),false);
-}
-this.set_classname(item,"unread",(_1d9+_1da)>0?true:false);
-}
-reg=/^\([0-9]+\)\s+/i;
-if(_1d5&&document.title){
-var _1dd=String(document.title);
-var _1de="";
-if(_1d9&&_1dd.match(reg)){
-_1de=_1dd.replace(reg,"("+_1d9+") ");
-}else{
-if(_1d9){
-_1de="("+_1d9+") "+_1dd;
-}else{
-_1de=_1dd.replace(reg,"");
-}
-}
-this.set_pagetitle(_1de);
-}
-};
-this.new_message_focus=function(){
-if(this.env.framed&&window.parent){
-window.parent.focus();
-}else{
-window.focus();
-}
-};
-this.add_contact_row=function(cid,cols,_1e1){
-if(!this.gui_objects.contactslist||!this.gui_objects.contactslist.tBodies[0]){
-return false;
-}
-var _1e2=this.gui_objects.contactslist.tBodies[0];
-var _1e3=_1e2.rows.length;
-var even=_1e3%2;
-var row=document.createElement("TR");
-row.id="rcmrow"+cid;
-row.className="contact "+(even?"even":"odd");
-if(this.contact_list.in_selection(cid)){
-row.className+=" selected";
-}
-for(var c in cols){
-col=document.createElement("TD");
-col.className=String(c).toLowerCase();
-col.innerHTML=cols[c];
-row.appendChild(col);
-}
-this.contact_list.insert_row(row);
-this.enable_command("export",(this.contact_list.rowcount>0));
-};
-this.toggle_prefer_html=function(_1e7){
-var _1e8;
-if(_1e8=document.getElementById("rcmfd_addrbook_show_images")){
-_1e8.disabled=!_1e7.checked;
-}
-};
-this.set_headers=function(_1e9){
-if(this.gui_objects.all_headers_row&&this.gui_objects.all_headers_box&&_1e9){
-var box=this.gui_objects.all_headers_box;
-box.innerHTML=_1e9;
-box.style.display="block";
-if(this.env.framed&&parent.rcmail){
-parent.rcmail.set_busy(false);
-}else{
-this.set_busy(false);
-}
-}
-};
-this.load_headers=function(elem){
-if(!this.gui_objects.all_headers_row||!this.gui_objects.all_headers_box||!this.env.uid){
-return;
-}
-this.set_classname(elem,"show-headers",false);
-this.set_classname(elem,"hide-headers",true);
-this.gui_objects.all_headers_row.style.display=bw.ie?"block":"table-row";
-elem.onclick=function(){
-rcmail.hide_headers(elem);
-};
-if(!this.gui_objects.all_headers_box.innerHTML){
-this.display_message(this.get_label("loading"),"loading",true);
-this.http_post("headers","_uid="+this.env.uid);
-}
-};
-this.hide_headers=function(elem){
-if(!this.gui_objects.all_headers_row||!this.gui_objects.all_headers_box){
-return;
-}
-this.set_classname(elem,"hide-headers",false);
-this.set_classname(elem,"show-headers",true);
-this.gui_objects.all_headers_row.style.display="none";
-elem.onclick=function(){
-rcmail.load_headers(elem);
-};
-};
-this.html2plain=function(_1ed,id){
-var _1ef=new rcube_http_request();
-var url=this.env.bin_path+"html2text.php";
-var _1f1=this;
-this.set_busy(true,"converting");
-_1ef.onerror=function(o){
-_1f1.http_error(o);
-};
-_1ef.oncomplete=function(o){
-_1f1.set_text_value(o,id);
-};
-_1ef.POST(url,_1ed,"application/octet-stream");
-};
-this.set_text_value=function(_1f4,id){
-this.set_busy(false);
-document.getElementById(id).value=_1f4.get_text();
-};
-this.redirect=function(url,lock){
-if(lock||lock===null){
-this.set_busy(true);
-}
-if(this.env.framed&&window.parent){
-parent.location.href=url;
-}else{
-location.href=url;
-}
-};
-this.goto_url=function(_1f8,_1f9,lock){
-var _1fb=_1f9?"&"+_1f9:"";
-this.redirect(this.env.comm_path+"&_action="+_1f8+_1fb,lock);
-};
-this.http_sockets=new Array();
-this.get_request_obj=function(){
-for(var n=0;n<this.http_sockets.length;n++){
-if(!this.http_sockets[n].busy){
-return this.http_sockets[n];
-}
-}
-var i=this.http_sockets.length;
-this.http_sockets[i]=new rcube_http_request();
-return this.http_sockets[i];
-};
-this.http_request=function(_1fe,_1ff,lock){
-var _201=this.get_request_obj();
-_1ff+=(_1ff?"&":"")+"_remote=1";
-if(bw.safari){
-_1ff+="&_ts="+(new Date().getTime());
-}
-if(_201){
-if(lock){
-this.set_busy(true);
-}
-var rcm=this;
-_201.__lock=lock?true:false;
-_201.__action=_1fe;
-_201.onerror=function(o){
-_1.http_error(o);
-};
-_201.oncomplete=function(o){
-_1.http_response(o);
-};
-_201.GET(this.env.comm_path+"&_action="+_1fe+"&"+_1ff);
-}
-};
-this.http_post=function(_205,_206,lock){
-var _208;
-if(_206&&typeof (_206)=="object"){
-_206._remote=1;
-}else{
-_206+=(_206?"&":"")+"_remote=1";
-}
-if(_208=this.get_request_obj()){
-if(lock){
-this.set_busy(true);
-}
-var rcm=this;
-_208.__lock=lock?true:false;
-_208.__action=_205;
-_208.onerror=function(o){
-rcm.http_error(o);
-};
-_208.oncomplete=function(o){
-rcm.http_response(o);
-};
-_208.POST(this.env.comm_path+"&_action="+_205,_206);
-}
-};
-this.http_response=function(_20c){
-var _20d=_20c.get_header("Content-Type");
-if(_20d){
-_20d=String(_20d).toLowerCase();
-var _20e=_20d.split(";");
-_20d=_20e[0];
-}
-if(_20c.__lock){
-this.set_busy(false);
-}
-if(_20c.get_text()&&(_20d=="text/javascript"||_20d=="application/x-javascript")){
-eval(_20c.get_text());
-}
-switch(_20c.__action){
-case "delete":
-if(this.task=="addressbook"){
-var uid=this.contact_list.get_selection();
-this.enable_command("compose",(uid&&this.contact_list.rows[uid]));
-this.enable_command("delete","edit",(uid&&this.contact_list.rows[uid]&&this.env.address_sources&&!this.env.address_sources[this.env.source].readonly));
-this.enable_command("export",(this.contact_list&&this.contact_list.rowcount>0));
-}
-case "moveto":
-if(this.env.action=="show"){
-this.command("list");
-}else{
-if(this.message_list){
-this.message_list.init();
-}
-}
-break;
-case "purge":
-case "expunge":
-if(!this.env.messagecount&&this.task=="mail"){
-if(this.env.contentframe){
-this.show_contentframe(false);
-}
-this.enable_command("show","reply","reply-all","forward","moveto","delete","mark","viewsource","print","load-attachment","purge","expunge","select-all","select-none","sort",false);
-}
-break;
-case "check-recent":
-case "getunread":
-case "list":
-if(this.task=="mail"){
-if(this.message_list&&_20c.__action=="list"){
-this.msglist_select(this.message_list);
-}
-this.enable_command("show","expunge","select-all","select-none","sort",(this.env.messagecount>0));
-this.enable_command("purge",this.purge_mailbox_test());
-}else{
-if(this.task=="addressbook"){
-this.enable_command("export",(this.contact_list&&this.contact_list.rowcount>0));
-}
-}
-break;
-}
-_20c.reset();
-};
-this.http_error=function(_210){
-if(_210.__lock){
-this.set_busy(false);
-}
-_210.reset();
-_210.__lock=false;
-this.display_message("Unknown Server Error!","error");
-};
-this.send_keep_alive=function(){
-var d=new Date();
-this.http_request("keep-alive","_t="+d.getTime());
-};
-this.check_for_recent=function(_212){
-if(this.busy){
-return;
-}
-if(_212){
-this.set_busy(true,"checkingmail");
-}
-this.http_request("check-recent",(this.env.search_request?"_search="+this.env.search_request+"&":"")+"_t="+(new Date().getTime()),true);
-};
-this.get_single_uid=function(){
-return this.env.uid?this.env.uid:(this.message_list?this.message_list.get_single_selection():null);
-};
-this.get_single_cid=function(){
-return this.env.cid?this.env.cid:(this.contact_list?this.contact_list.get_single_selection():null);
-};
-this.get_caret_pos=function(obj){
-if(typeof (obj.selectionEnd)!="undefined"){
-return obj.selectionEnd;
-}else{
-if(document.selection&&document.selection.createRange){
-var _214=document.selection.createRange();
-if(_214.parentElement()!=obj){
-return 0;
-}
-var gm=_214.duplicate();
-if(obj.tagName=="TEXTAREA"){
-gm.moveToElementText(obj);
-}else{
-gm.expand("textedit");
-}
-gm.setEndPoint("EndToStart",_214);
-var p=gm.text.length;
-return p<=obj.value.length?p:-1;
-}else{
-return obj.value.length;
-}
-}
-};
-this.set_caret2start=function(obj){
-if(obj.createTextRange){
-var _218=obj.createTextRange();
-_218.collapse(true);
-_218.select();
-}else{
-if(obj.setSelectionRange){
-obj.setSelectionRange(0,0);
-}
-}
-obj.focus();
-};
-this.lock_form=function(form,lock){
-if(!form||!form.elements){
-return;
-}
-var type;
-for(var n=0;n<form.elements.length;n++){
-type=form.elements[n];
-if(type=="hidden"){
-continue;
-}
-form.elements[n].disabled=lock;
-}
-};
-};
-function rcube_http_request(){
-this.url="";
-this.busy=false;
-this.xmlhttp=null;
-this.reset=function(){
-this.onloading=function(){
-};
-this.onloaded=function(){
-};
-this.oninteractive=function(){
-};
-this.oncomplete=function(){
-};
-this.onabort=function(){
-};
-this.onerror=function(){
-};
-this.url="";
-this.busy=false;
-this.xmlhttp=null;
-};
-this.build=function(){
-if(window.XMLHttpRequest){
-this.xmlhttp=new XMLHttpRequest();
-}else{
-if(window.ActiveXObject){
-try{
-this.xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
-}
-catch(e){
-this.xmlhttp=null;
-}
-}else{
-}
-}
-};
-this.GET=function(url){
-this.build();
-if(!this.xmlhttp){
-this.onerror(this);
-return false;
-}
-var _ref=this;
-this.url=url;
-this.busy=true;
-this.xmlhttp.onreadystatechange=function(){
-_ref.xmlhttp_onreadystatechange();
-};
-this.xmlhttp.open("GET",url,true);
-this.xmlhttp.setRequestHeader("X-RoundCube-Referer",bw.get_cookie("roundcube_sessid"));
-this.xmlhttp.send(null);
-};
-this.POST=function(url,body,_221){
-if(typeof (_221)=="undefined"){
-_221="application/x-www-form-urlencoded";
-}
-this.build();
-if(!this.xmlhttp){
-this.onerror(this);
-return false;
-}
-var _222=body;
-if(typeof (body)=="object"){
-_222="";
-for(var p in body){
-_222+=(_222?"&":"")+p+"="+urlencode(body[p]);
-}
-}
-var ref=this;
-this.url=url;
-this.busy=true;
-this.xmlhttp.onreadystatechange=function(){
-ref.xmlhttp_onreadystatechange();
-};
-this.xmlhttp.open("POST",url,true);
-this.xmlhttp.setRequestHeader("Content-Type",_221);
-this.xmlhttp.setRequestHeader("X-RoundCube-Referer",bw.get_cookie("roundcube_sessid"));
-this.xmlhttp.send(_222);
-};
-this.xmlhttp_onreadystatechange=function(){
-if(this.xmlhttp.readyState==1){
-this.onloading(this);
-}else{
-if(this.xmlhttp.readyState==2){
-this.onloaded(this);
-}else{
-if(this.xmlhttp.readyState==3){
-this.oninteractive(this);
-}else{
-if(this.xmlhttp.readyState==4){
-try{
-if(this.xmlhttp.status==0){
-this.onabort(this);
-}else{
-if(this.xmlhttp.status==200){
-this.oncomplete(this);
-}else{
-this.onerror(this);
-}
-}
-this.busy=false;
-}
-catch(err){
-this.onerror(this);
-this.busy=false;
-}
-}
-}
-}
-}
-};
-this.get_header=function(name){
-return this.xmlhttp.getResponseHeader(name);
-};
-this.get_text=function(){
-return this.xmlhttp.responseText;
-};
-this.get_xml=function(){
-return this.xmlhttp.responseXML;
-};
-this.reset();
-};
-function call_init(o){
-window.setTimeout("if (window['"+o+"'] && window['"+o+"'].init) { "+o+".init(); }",bw.win?500:200);
-};
+
+function rcube_webmail()
+ {
+ this.env = new Object();
+ this.labels = new Object();
+ this.buttons = new Object();
+ this.gui_objects = new Object();
+ this.commands = new Object();
+ this.onloads = new Array();
+
+ // create protected reference to myself
+ rcube_webmail_client = this;
+ this.ref = 'rcube_webmail_client';
+ var ref = this;
+
+ // webmail client settings
+ this.dblclick_time = 500;
+ this.message_time = 3000;
+
+ this.identifier_expr = new RegExp('[^0-9a-z\-_]', 'gi');
+
+ // mimetypes supported by the browser (default settings)
+ this.mimetypes = new Array('text/plain', 'text/html', 'text/xml',
+ 'image/jpeg', 'image/gif', 'image/png',
+ 'application/x-javascript', 'application/pdf',
+ 'application/x-shockwave-flash');
+
+ // default environment vars
+ this.env.keep_alive = 60; // seconds
+ this.env.request_timeout = 180; // seconds
+ this.env.draft_autosave = 0; // seconds
+ this.env.comm_path = './';
+ this.env.bin_path = './bin/';
+ this.env.blankpage = 'program/blank.gif';
+
+
+ // set environment variable(s)
+ this.set_env = function(p, value)
+ {
+ if (p != null && typeof(p) == 'object' && !value)
+ for (var n in p)
+ this.env[n] = p[n];
+ else
+ this.env[p] = value;
+ };
+
+ // add a localized label to the client environment
+ this.add_label = function(key, value)
+ {
+ this.labels[key] = value;
+ };
+
+ // add a button to the button list
+ this.register_button = function(command, id, type, act, sel, over)
+ {
+ if (!this.buttons[command])
+ this.buttons[command] = new Array();
+
+ var button_prop = {id:id, type:type};
+ if (act) button_prop.act = act;
+ if (sel) button_prop.sel = sel;
+ if (over) button_prop.over = over;
+
+ this.buttons[command][this.buttons[command].length] = button_prop;
+ };
+
+ // register a specific gui object
+ this.gui_object = function(name, id)
+ {
+ this.gui_objects[name] = id;
+ };
+
+ // execute the given script on load
+ this.add_onload = function(f)
+ {
+ this.onloads[this.onloads.length] = f;
+ };
+
+ // initialize webmail client
+ this.init = function()
+ {
+ var p = this;
+ this.task = this.env.task;
+
+ // check browser
+ if (!bw.dom || !bw.xmlhttp_test())
+ {
+ this.goto_url('error', '_code=0x199');
+ return;
+ }
+
+ // find all registered gui objects
+ for (var n in this.gui_objects)
+ this.gui_objects[n] = rcube_find_object(this.gui_objects[n]);
+
+ // tell parent window that this frame is loaded
+ if (this.env.framed && parent.rcmail && parent.rcmail.set_busy)
+ parent.rcmail.set_busy(false);
+
+ // enable general commands
+ this.enable_command('logout', 'mail', 'addressbook', 'settings', true);
+
+ if (this.env.permaurl)
+ this.enable_command('permaurl', true);
+
+ switch (this.task)
+ {
+ case 'mail':
+ if (this.gui_objects.messagelist)
+ {
+ this.message_list = new rcube_list_widget(this.gui_objects.messagelist, {multiselect:true, draggable:true, keyboard:true, dblclick_time:this.dblclick_time});
+ this.message_list.row_init = function(o){ p.init_message_row(o); };
+ this.message_list.addEventListener('dblclick', function(o){ p.msglist_dbl_click(o); });
+ this.message_list.addEventListener('keypress', function(o){ p.msglist_keypress(o); });
+ this.message_list.addEventListener('select', function(o){ p.msglist_select(o); });
+ this.message_list.addEventListener('dragstart', function(o){ p.drag_start(o); });
+ this.message_list.addEventListener('dragmove', function(o, e){ p.drag_move(e); });
+ this.message_list.addEventListener('dragend', function(o){ p.drag_active = false; });
+
+ this.message_list.init();
+ this.enable_command('toggle_status', 'toggle_flag', true);
+
+ if (this.gui_objects.mailcontframe)
+ {
+ this.gui_objects.mailcontframe.onmousedown = function(e){ return p.click_on_list(e); };
+ document.onmouseup = function(e){ return p.doc_mouse_up(e); };
+ }
+ else
+ this.message_list.focus();
+ }
+
+ if (this.env.coltypes)
+ this.set_message_coltypes(this.env.coltypes);
+
+ // enable mail commands
+ this.enable_command('list', 'checkmail', 'compose', 'add-contact', 'search', 'reset-search', 'collapse-folder', true);
+
+ if (this.env.search_text != null && document.getElementById('quicksearchbox') != null)
+ document.getElementById('quicksearchbox').value = this.env.search_text;
+
+ if (this.env.action=='show' || this.env.action=='preview')
+ {
+ this.enable_command('show', 'reply', 'reply-all', 'forward', 'moveto', 'delete', 'mark', 'viewsource', 'print', 'load-attachment', 'load-headers', true);
+ if (this.env.next_uid)
+ {
+ this.enable_command('nextmessage', true);
+ this.enable_command('lastmessage', true);
+ }
+ if (this.env.prev_uid)
+ {
+ this.enable_command('previousmessage', true);
+ this.enable_command('firstmessage', true);
+ }
+ }
+
+ if (this.env.trash_mailbox && this.env.mailbox != this.env.trash_mailbox)
+ this.set_alttext('delete', 'movemessagetotrash');
+
+ // make preview/message frame visible
+ if (this.env.action == 'preview' && this.env.framed && parent.rcmail)
+ {
+ this.enable_command('compose', 'add-contact', false);
+ parent.rcmail.show_contentframe(true);
+ }
+
+ if ((this.env.action=='show' || this.env.action=='preview') && this.env.blockedobjects)
+ {
+ if (this.gui_objects.remoteobjectsmsg)
+ this.gui_objects.remoteobjectsmsg.style.display = 'block';
+ this.enable_command('load-images', 'always-load', true);
+ }
+
+ if (this.env.action=='compose')
+ {
+ this.enable_command('add-attachment', 'send-attachment', 'remove-attachment', 'send', true);
+ if (this.env.spellcheck)
+ {
+ this.env.spellcheck.spelling_state_observer = function(s){ ref.set_spellcheck_state(s); };
+ this.set_spellcheck_state('ready');
+ if (rcube_find_object('_is_html').value == '1')
+ this.display_spellcheck_controls(false);
+ }
+ if (this.env.drafts_mailbox)
+ this.enable_command('savedraft', true);
+
+ document.onmouseup = function(e){ return p.doc_mouse_up(e); };
+ }
+
+ if (this.env.messagecount)
+ this.enable_command('select-all', 'select-none', 'expunge', true);
+
+ if (this.purge_mailbox_test())
+ this.enable_command('purge', true);
+
+ this.set_page_buttons();
+
+ // init message compose form
+ if (this.env.action=='compose')
+ this.init_messageform();
+
+ // show printing dialog
+ if (this.env.action=='print')
+ window.print();
+
+ // get unread count for each mailbox
+ if (this.gui_objects.mailboxlist)
+ {
+ this.env.unread_counts = {};
+ this.gui_objects.folderlist = this.gui_objects.mailboxlist;
+ this.http_request('getunread', '');
+ }
+
+ // ask user to send MDN
+ if (this.env.mdn_request && this.env.uid)
+ {
+ var mdnurl = '_uid='+this.env.uid+'&_mbox='+urlencode(this.env.mailbox);
+ if (confirm(this.get_label('mdnrequest')))
+ this.http_post('sendmdn', mdnurl);
+ else
+ this.http_post('mark', mdnurl+'&_flag=mdnsent');
+ }
+
+ break;
+
+
+ case 'addressbook':
+ if (this.gui_objects.contactslist)
+ {
+ this.contact_list = new rcube_list_widget(this.gui_objects.contactslist, {multiselect:true, draggable:true, keyboard:true});
+ this.contact_list.addEventListener('keypress', function(o){ p.contactlist_keypress(o); });
+ this.contact_list.addEventListener('select', function(o){ p.contactlist_select(o); });
+ this.contact_list.addEventListener('dragstart', function(o){ p.drag_start(o); });
+ this.contact_list.addEventListener('dragmove', function(o, e){ p.drag_move(e); });
+ this.contact_list.addEventListener('dragend', function(o){ p.drag_active = false; });
+ this.contact_list.init();
+
+ if (this.env.cid)
+ this.contact_list.highlight_row(this.env.cid);
+
+ if (this.gui_objects.contactslist.parentNode)
+ {
+ this.gui_objects.contactslist.parentNode.onmousedown = function(e){ return p.click_on_list(e); };
+ document.onmouseup = function(e){ return p.doc_mouse_up(e); };
+ }
+ else
+ this.contact_list.focus();
+ }
+
+ this.set_page_buttons();
+
+ if (this.env.address_sources && this.env.address_sources[this.env.source] && !this.env.address_sources[this.env.source].readonly)
+ this.enable_command('add', true);
+
+ if (this.env.cid)
+ this.enable_command('show', 'edit', true);
+
+ if ((this.env.action=='add' || this.env.action=='edit') && this.gui_objects.editform)
+ this.enable_command('save', true);
+ else
+ this.enable_command('search', 'reset-search', 'moveto', 'import', true);
+
+ if (this.contact_list && this.contact_list.rowcount > 0)
+ this.enable_command('export', true);
+
+ this.enable_command('list', true);
+ break;
+
+
+ case 'settings':
+ this.enable_command('preferences', 'identities', 'save', 'folders', true);
+
+ if (this.env.action=='identities' || this.env.action=='edit-identity' || this.env.action=='add-identity') {
+ this.enable_command('add', this.env.identities_level < 2);
+ this.enable_command('delete', 'edit', true);
+ }
+
+ if (this.env.action=='edit-identity' || this.env.action=='add-identity')
+ this.enable_command('save', true);
+
+ if (this.env.action=='folders')
+ this.enable_command('subscribe', 'unsubscribe', 'create-folder', 'rename-folder', 'delete-folder', true);
+
+ if (this.gui_objects.identitieslist)
+ {
+ this.identity_list = new rcube_list_widget(this.gui_objects.identitieslist, {multiselect:false, draggable:false, keyboard:false});
+ this.identity_list.addEventListener('select', function(o){ p.identity_select(o); });
+ this.identity_list.init();
+ this.identity_list.focus();
+
+ if (this.env.iid)
+ this.identity_list.highlight_row(this.env.iid);
+ }
+
+ if (this.gui_objects.subscriptionlist)
+ this.init_subscription_list();
+
+ break;
+
+ case 'login':
+ var input_user = rcube_find_object('rcmloginuser');
+ var input_pass = rcube_find_object('rcmloginpwd');
+ var input_tz = rcube_find_object('rcmlogintz');
+
+ if (input_user)
+ input_user.onkeyup = function(e){ return rcmail.login_user_keyup(e); };
+ if (input_user && input_user.value=='')
+ input_user.focus();
+ else if (input_pass)
+ input_pass.focus();
+
+ // detect client timezone
+ if (input_tz)
+ input_tz.value = new Date().getTimezoneOffset() / -60;
+
+ this.enable_command('login', true);
+ break;
+
+ default:
+ break;
+ }
+
+ // enable basic commands
+ this.enable_command('logout', true);
+
+ // flag object as complete
+ this.loaded = true;
+
+ // show message
+ if (this.pending_message)
+ this.display_message(this.pending_message[0], this.pending_message[1]);
+
+ // start keep-alive interval
+ this.start_keepalive();
+
+ // execute all foreign onload scripts
+ for (var i=0; i<this.onloads.length; i++)
+ {
+ if (typeof(this.onloads[i]) == 'string')
+ eval(this.onloads[i]);
+ else if (typeof(this.onloads[i]) == 'function')
+ this.onloads[i]();
+ }
+ };
+
+ // start interval for keep-alive/recent_check signal
+ this.start_keepalive = function()
+ {
+ if (this.env.keep_alive && !this.env.framed && this.task=='mail' && this.gui_objects.mailboxlist)
+ this._int = setInterval(function(){ ref.check_for_recent(false); }, this.env.keep_alive * 1000);
+ else if (this.env.keep_alive && !this.env.framed && this.task!='login')
+ this._int = setInterval(function(){ ref.send_keep_alive(); }, this.env.keep_alive * 1000);
+ }
+
+ this.init_message_row = function(row)
+ {
+ var uid = row.uid;
+ if (uid && this.env.messages[uid])
+ {
+ row.deleted = this.env.messages[uid].deleted ? true : false;
+ row.unread = this.env.messages[uid].unread ? true : false;
+ row.replied = this.env.messages[uid].replied ? true : false;
+ row.flagged = this.env.messages[uid].flagged ? true : false;
+ row.forwarded = this.env.messages[uid].forwarded ? true : false;
+ }
+
+ // set eventhandler to message icon
+ if ((row.icon = row.obj.cells[0].childNodes[0]) && row.icon.nodeName=='IMG')
+ {
+ var p = this;
+ row.icon.id = 'msgicn_'+row.uid;
+ row.icon._row = row.obj;
+ row.icon.onmousedown = function(e) { p.command('toggle_status', this); };
+ }
+
+ // global variable 'flagged_col' may be not defined yet
+ if (!this.env.flagged_col && this.env.coltypes)
+ {
+ var found;
+ if((found = find_in_array('flag', this.env.coltypes)) >= 0)
+ this.set_env('flagged_col', found+1);
+ }
+
+ // set eventhandler to flag icon, if icon found
+ if (this.env.flagged_col && (row.flagged_icon = row.obj.cells[this.env.flagged_col].childNodes[0])
+ && row.flagged_icon.nodeName=='IMG')
+ {
+ var p = this;
+ row.flagged_icon.id = 'flaggedicn_'+row.uid;
+ row.flagged_icon._row = row.obj;
+ row.flagged_icon.onmousedown = function(e) { p.command('toggle_flag', this); };
+ }
+ };
+
+ // init message compose form: set focus and eventhandlers
+ this.init_messageform = function()
+ {
+ if (!this.gui_objects.messageform)
+ return false;
+
+ //this.messageform = this.gui_objects.messageform;
+ var input_from = rcube_find_object('_from');
+ var input_to = rcube_find_object('_to');
+ var input_cc = rcube_find_object('_cc');
+ var input_bcc = rcube_find_object('_bcc');
+ var input_replyto = rcube_find_object('_replyto');
+ var input_subject = rcube_find_object('_subject');
+ var input_message = rcube_find_object('_message');
+ var draftid = rcube_find_object('_draft_saveid');
+
+ // init live search events
+ if (input_to)
+ this.init_address_input_events(input_to);
+ if (input_cc)
+ this.init_address_input_events(input_cc);
+ if (input_bcc)
+ this.init_address_input_events(input_bcc);
+
+ // add signature according to selected identity
+ if (input_from && input_from.type=='select-one' && (!draftid || draftid.value=='')
+ // if we have HTML editor, signature is added in callback
+ && rcube_find_object('_is_html').value != '1')
+ {
+ this.change_identity(input_from);
+ }
+
+ if (input_to && input_to.value=='')
+ input_to.focus();
+ else if (input_subject && input_subject.value=='')
+ input_subject.focus();
+ else if (input_message)
+ this.set_caret2start(input_message);
+
+ // get summary of all field values
+ this.compose_field_hash(true);
+
+ // start the auto-save timer
+ this.auto_save_start();
+ };
+
+ this.init_address_input_events = function(obj)
+ {
+ var handler = function(e){ return ref.ksearch_keypress(e,this); };
+
+ if (obj.addEventListener)
+ obj.addEventListener(bw.safari ? 'keydown' : 'keypress', handler, false);
+ else
+ obj.onkeydown = handler;
+
+ obj.setAttribute('autocomplete', 'off');
+ };
+
+
+ /*********************************************************/
+ /********* client command interface *********/
+ /*********************************************************/
+
+ // execute a specific command on the web client
+ this.command = function(command, props, obj)
+ {
+ if (obj && obj.blur)
+ obj.blur();
+
+ if (this.busy)
+ return false;
+
+ // command not supported or allowed
+ if (!this.commands[command])
+ {
+ // pass command to parent window
+ if (this.env.framed && parent.rcmail && parent.rcmail.command)
+ parent.rcmail.command(command, props);
+
+ return false;
+ }
+
+ // check input before leaving compose step
+ if (this.task=='mail' && this.env.action=='compose' && (command=='list' || command=='mail' || command=='addressbook' || command=='settings'))
+ {
+ if (this.cmp_hash != this.compose_field_hash() && !confirm(this.get_label('notsentwarning')))
+ return false;
+ }
+
+ // process command
+ switch (command)
+ {
+ case 'login':
+ if (this.gui_objects.loginform)
+ this.gui_objects.loginform.submit();
+ break;
+
+ case 'logout':
+ this.goto_url('logout', '', true);
+ break;
+
+ // commands to switch task
+ case 'mail':
+ case 'addressbook':
+ case 'settings':
+ this.switch_task(command);
+ break;
+
+ case 'permaurl':
+ if (obj && obj.href && obj.target)
+ return true;
+ else if (this.env.permaurl)
+ parent.location.href = this.env.permaurl;
+ break;
+
+ // misc list commands
+ case 'list':
+ if (this.task=='mail')
+ {
+ if (this.env.search_request<0 || (props != '' && (this.env.search_request && props != this.env.mailbox)))
+ this.reset_qsearch();
+
+ this.list_mailbox(props);
+
+ if (this.env.trash_mailbox)
+ this.set_alttext('delete', this.env.mailbox != this.env.trash_mailbox ? 'movemessagetotrash' : 'deletemessage');
+ }
+ else if (this.task=='addressbook')
+ {
+ if (this.env.search_request<0 || (this.env.search_request && props != this.env.source))
+ this.reset_qsearch();
+
+ this.list_contacts(props);
+ this.enable_command('add', (this.env.address_sources && !this.env.address_sources[props].readonly));
+ }
+ break;
+
+
+ case 'load-headers':
+ this.load_headers(obj);
+ break;
+
+
+ case 'sort':
+ // get the type of sorting
+ var a_sort = props.split('_');
+ var sort_col = a_sort[0];
+ var sort_order = a_sort[1] ? a_sort[1].toUpperCase() : null;
+ var header;
+
+ // no sort order specified: toggle
+ if (sort_order==null)
+ {
+ if (this.env.sort_col==sort_col)
+ sort_order = this.env.sort_order=='ASC' ? 'DESC' : 'ASC';
+ else
+ sort_order = this.env.sort_order;
+ }
+
+ if (this.env.sort_col==sort_col && this.env.sort_order==sort_order)
+ break;
+
+ // set table header class
+ if (header = document.getElementById('rcm'+this.env.sort_col))
+ this.set_classname(header, 'sorted'+(this.env.sort_order.toUpperCase()), false);
+ if (header = document.getElementById('rcm'+sort_col))
+ this.set_classname(header, 'sorted'+sort_order, true);
+
+ // save new sort properties
+ this.env.sort_col = sort_col;
+ this.env.sort_order = sort_order;
+
+ // reload message list
+ this.list_mailbox('', '', sort_col+'_'+sort_order);
+ break;
+
+ case 'nextpage':
+ this.list_page('next');
+ break;
+
+ case 'lastpage':
+ this.list_page('last');
+ break;
+
+ case 'previouspage':
+ this.list_page('prev');
+ break;
+
+ case 'firstpage':
+ this.list_page('first');
+ break;
+
+ case 'expunge':
+ if (this.env.messagecount)
+ this.expunge_mailbox(this.env.mailbox);
+ break;
+
+ case 'purge':
+ case 'empty-mailbox':
+ if (this.env.messagecount)
+ this.purge_mailbox(this.env.mailbox);
+ break;
+
+
+ // common commands used in multiple tasks
+ case 'show':
+ if (this.task=='mail')
+ {
+ var uid = this.get_single_uid();
+ if (uid && (!this.env.uid || uid != this.env.uid))
+ {
+ if (this.env.mailbox == this.env.drafts_mailbox)
+ this.goto_url('compose', '_draft_uid='+uid+'&_mbox='+urlencode(this.env.mailbox), true);
+ else
+ this.show_message(uid);
+ }
+ }
+ else if (this.task=='addressbook')
+ {
+ var cid = props ? props : this.get_single_cid();
+ if (cid && !(this.env.action=='show' && cid==this.env.cid))
+ this.load_contact(cid, 'show');
+ }
+ break;
+
+ case 'add':
+ if (this.task=='addressbook')
+ this.load_contact(0, 'add');
+ else if (this.task=='settings')
+ {
+ this.identity_list.clear_selection();
+ this.load_identity(0, 'add-identity');
+ }
+ break;
+
+ case 'edit':
+ var cid;
+ if (this.task=='addressbook' && (cid = this.get_single_cid()))
+ this.load_contact(cid, 'edit');
+ else if (this.task=='settings' && props)
+ this.load_identity(props, 'edit-identity');
+ break;
+
+ case 'save-identity':
+ case 'save':
+ if (this.gui_objects.editform)
+ {
+ var input_pagesize = rcube_find_object('_pagesize');
+ var input_name = rcube_find_object('_name');
+ var input_email = rcube_find_object('_email');
+
+ // user prefs
+ if (input_pagesize && isNaN(parseInt(input_pagesize.value)))
+ {
+ alert(this.get_label('nopagesizewarning'));
+ input_pagesize.focus();
+ break;
+ }
+ // contacts/identities
+ else
+ {
+ if (input_name && input_name.value == '')
+ {
+ alert(this.get_label('nonamewarning'));
+ input_name.focus();
+ break;
+ }
+ else if (input_email && !rcube_check_email(input_email.value))
+ {
+ alert(this.get_label('noemailwarning'));
+ input_email.focus();
+ break;
+ }
+ }
+
+ this.gui_objects.editform.submit();
+ }
+ break;
+
+ case 'delete':
+ // mail task
+ if (this.task=='mail')
+ this.delete_messages();
+ // addressbook task
+ else if (this.task=='addressbook')
+ this.delete_contacts();
+ // user settings task
+ else if (this.task=='settings')
+ this.delete_identity();
+ break;
+
+
+ // mail task commands
+ case 'move':
+ case 'moveto':
+ if (this.task == 'mail')
+ this.move_messages(props);
+ else if (this.task == 'addressbook' && this.drag_active)
+ this.copy_contact(null, props);
+ break;
+
+ case 'mark':
+ if (props)
+ this.mark_message(props);
+ break;
+
+ case 'toggle_status':
+ if (props && !props._row)
+ break;
+
+ var uid;
+ var flag = 'read';
+
+ if (props._row.uid)
+ {
+ uid = props._row.uid;
+
+ // toggle read/unread
+ if (this.message_list.rows[uid].deleted) {
+ flag = 'undelete';
+ } else if (!this.message_list.rows[uid].unread)
+ flag = 'unread';
+ }
+
+ this.mark_message(flag, uid);
+ break;
+
+ case 'toggle_flag':
+ if (props && !props._row)
+ break;
+
+ var uid;
+ var flag = 'flagged';
+
+ if (props._row.uid)
+ {
+ uid = props._row.uid;
+ // toggle flagged/unflagged
+ if (this.message_list.rows[uid].flagged)
+ flag = 'unflagged';
+ }
+ this.mark_message(flag, uid);
+ break;
+
+ case 'always-load':
+ if (this.env.uid && this.env.sender) {
+ this.add_contact(urlencode(this.env.sender));
+ window.setTimeout(function(){ ref.command('load-images'); }, 300);
+ break;
+ }
+
+ case 'load-images':
+ if (this.env.uid)
+ this.show_message(this.env.uid, true, this.env.action=='preview');
+ break;
+
+ case 'load-attachment':
+ var qstring = '_mbox='+urlencode(this.env.mailbox)+'&_uid='+this.env.uid+'&_part='+props.part;
+
+ // open attachment in frame if it's of a supported mimetype
+ if (this.env.uid && props.mimetype && find_in_array(props.mimetype, this.mimetypes)>=0)
+ {
+ if (props.mimetype == 'text/html')
+ qstring += '&_safe=1';
+ this.attachment_win = window.open(this.env.comm_path+'&_action=get&'+qstring+'&_frame=1', 'rcubemailattachment');
+ if (this.attachment_win)
+ {
+ window.setTimeout(function(){ ref.attachment_win.focus(); }, 10);
+ break;
+ }
+ }
+
+ this.goto_url('get', qstring+'&_download=1', false);
+ break;
+
+ case 'select-all':
+ this.message_list.select_all(props);
+ break;
+
+ case 'select-none':
+ this.message_list.clear_selection();
+ break;
+
+ case 'nextmessage':
+ if (this.env.next_uid)
+ this.show_message(this.env.next_uid, false, this.env.action=='preview');
+ break;
+
+ case 'lastmessage':
+ if (this.env.last_uid)
+ this.show_message(this.env.last_uid);
+ break;
+
+ case 'previousmessage':
+ if (this.env.prev_uid)
+ this.show_message(this.env.prev_uid, false, this.env.action=='preview');
+ break;
+
+ case 'firstmessage':
+ if (this.env.first_uid)
+ this.show_message(this.env.first_uid);
+ break;
+
+ case 'checkmail':
+ this.check_for_recent(true);
+ break;
+
+ case 'compose':
+ var url = this.env.comm_path+'&_action=compose';
+
+ if (this.task=='mail')
+ {
+ url += '&_mbox='+urlencode(this.env.mailbox);
+
+ if (this.env.mailbox==this.env.drafts_mailbox)
+ {
+ var uid;
+ if (uid = this.get_single_uid())
+ url += '&_draft_uid='+uid;
+ }
+ else if (props)
+ url += '&_to='+urlencode(props);
+ }
+ // modify url if we're in addressbook
+ else if (this.task=='addressbook')
+ {
+ // switch to mail compose step directly
+ if (props && props.indexOf('@') > 0)
+ {
+ url = this.get_task_url('mail', url);
+ this.redirect(url + '&_to='+urlencode(props));
+ break;
+ }
+
+ // use contact_id passed as command parameter
+ var a_cids = new Array();
+ if (props)
+ a_cids[a_cids.length] = props;
+ // get selected contacts
+ else if (this.contact_list)
+ {
+ var selection = this.contact_list.get_selection();
+ for (var n=0; n<selection.length; n++)
+ a_cids[a_cids.length] = selection[n];
+ }
+
+ if (a_cids.length)
+ this.http_request('mailto', '_cid='+urlencode(a_cids.join(','))+'&_source='+urlencode(this.env.source), true);
+
+ break;
+ }
+
+ // don't know if this is necessary...
+ url = url.replace(/&_framed=1/, "");
+
+ this.redirect(url);
+ break;
+
+ case 'spellcheck':
+ if (window.tinyMCE && tinyMCE.get('compose-body')) {
+ tinyMCE.execCommand('mceSpellCheck', true);
+ }
+ else if (this.env.spellcheck && this.env.spellcheck.spellCheck && this.spellcheck_ready) {
+ this.env.spellcheck.spellCheck(this.env.spellcheck.check_link);
+ this.set_spellcheck_state('checking');
+ }
+ break;
+
+ case 'savedraft':
+ // Reset the auto-save timer
+ self.clearTimeout(this.save_timer);
+
+ if (!this.gui_objects.messageform)
+ break;
+
+ // if saving Drafts is disabled in main.inc.php
+ // or if compose form did not change
+ if (!this.env.drafts_mailbox || this.cmp_hash == this.compose_field_hash())
+ break;
+
+ this.set_busy(true, 'savingmessage');
+ var form = this.gui_objects.messageform;
+ form.target = "savetarget";
+ form._draft.value = '1';
+ form.submit();
+ break;
+
+ case 'send':
+ if (!this.gui_objects.messageform)
+ break;
+
+ if (!this.check_compose_input())
+ break;
+
+ // Reset the auto-save timer
+ self.clearTimeout(this.save_timer);
+
+ // all checks passed, send message
+ this.set_busy(true, 'sendingmessage');
+ var form = this.gui_objects.messageform;
+ form.target = "savetarget";
+ form._draft.value = '';
+ form.submit();
+
+ // clear timeout (sending could take longer)
+ clearTimeout(this.request_timer);
+ break;
+
+ case 'add-attachment':
+ this.show_attachment_form(true);
+
+ case 'send-attachment':
+ // Reset the auto-save timer
+ self.clearTimeout(this.save_timer);
+
+ this.upload_file(props)
+ break;
+
+ case 'remove-attachment':
+ this.remove_attachment(props);
+ break;
+
+ case 'reply-all':
+ case 'reply':
+ var uid;
+ if (uid = this.get_single_uid())
+ this.goto_url('compose', '_reply_uid='+uid+'&_mbox='+urlencode(this.env.mailbox)+(command=='reply-all' ? '&_all=1' : ''), true);
+ break;
+
+ case 'forward':
+ var uid;
+ if (uid = this.get_single_uid())
+ this.goto_url('compose', '_forward_uid='+uid+'&_mbox='+urlencode(this.env.mailbox), true);
+ break;
+
+ case 'print':
+ var uid;
+ if (uid = this.get_single_uid())
+ {
+ ref.printwin = window.open(this.env.comm_path+'&_action=print&_uid='+uid+'&_mbox='+urlencode(this.env.mailbox)+(this.env.safemode ? '&_safe=1' : ''));
+ if (this.printwin)
+ {
+ window.setTimeout(function(){ ref.printwin.focus(); }, 20);
+ if (this.env.action != 'show')
+ this.mark_message('read', uid);
+ }
+ }
+ break;
+
+ case 'viewsource':
+ var uid;
+ if (uid = this.get_single_uid())
+ {
+ ref.sourcewin = window.open(this.env.comm_path+'&_action=viewsource&_uid='+this.env.uid+'&_mbox='+urlencode(this.env.mailbox));
+ if (this.sourcewin)
+ window.setTimeout(function(){ ref.sourcewin.focus(); }, 20);
+ }
+ break;
+
+ case 'add-contact':
+ this.add_contact(props);
+ break;
+
+ // quicksearch
+ case 'search':
+ if (!props && this.gui_objects.qsearchbox)
+ props = this.gui_objects.qsearchbox.value;
+ if (props)
+ {
+ this.qsearch(props);
+ break;
+ }
+
+ // reset quicksearch
+ case 'reset-search':
+ var s = this.env.search_request;
+ this.reset_qsearch();
+
+ if (s && this.env.mailbox)
+ this.list_mailbox(this.env.mailbox);
+ else if (s && this.task == 'addressbook')
+ this.list_contacts(this.env.source);
+ break;
+
+ case 'import':
+ if (this.env.action == 'import' && this.gui_objects.importform) {
+ var file = document.getElementById('rcmimportfile');
+ if (file && !file.value) {
+ alert(this.get_label('selectimportfile'));
+ break;
+ }
+ this.gui_objects.importform.submit();
+ this.set_busy(true, 'importwait');
+ this.lock_form(this.gui_objects.importform, true);
+ }
+ else
+ this.goto_url('import');
+ break;
+
+ case 'export':
+ if (this.contact_list.rowcount > 0) {
+ var add_url = (this.env.source ? '_source='+urlencode(this.env.source)+'&' : '');
+ if (this.env.search_request)
+ add_url += '_search='+this.env.search_request;
+
+ this.goto_url('export', add_url);
+ }
+ break;
+
+ // collapse/expand folder
+ case 'collapse-folder':
+ if (props)
+ this.collapse_folder(props);
+ break;
+
+ // user settings commands
+ case 'preferences':
+ this.goto_url('');
+ break;
+
+ case 'identities':
+ this.goto_url('identities');
+ break;
+
+ case 'delete-identity':
+ this.delete_identity();
+
+ case 'folders':
+ this.goto_url('folders');
+ break;
+
+ case 'subscribe':
+ this.subscribe_folder(props);
+ break;
+
+ case 'unsubscribe':
+ this.unsubscribe_folder(props);
+ break;
+
+ case 'create-folder':
+ this.create_folder(props);
+ break;
+
+ case 'rename-folder':
+ this.rename_folder(props);
+ break;
+
+ case 'delete-folder':
+ this.delete_folder(props);
+ break;
+
+ }
+
+ return obj ? false : true;
+ };
+
+ // set command enabled or disabled
+ this.enable_command = function()
+ {
+ var args = arguments;
+ if(!args.length) return -1;
+
+ var command;
+ var enable = args[args.length-1];
+
+ for(var n=0; n<args.length-1; n++)
+ {
+ command = args[n];
+ this.commands[command] = enable;
+ this.set_button(command, (enable ? 'act' : 'pas'));
+ }
+ return true;
+ };
+
+ // lock/unlock interface
+ this.set_busy = function(a, message)
+ {
+ if (a && message)
+ {
+ var msg = this.get_label(message);
+ if (msg==message)
+ msg = 'Loading...';
+
+ this.display_message(msg, 'loading', true);
+ }
+ else if (!a)
+ this.hide_message();
+
+ this.busy = a;
+ //document.body.style.cursor = a ? 'wait' : 'default';
+
+ if (this.gui_objects.editform)
+ this.lock_form(this.gui_objects.editform, a);
+
+ // clear pending timer
+ if (this.request_timer)
+ clearTimeout(this.request_timer);
+
+ // set timer for requests
+ if (a && this.env.request_timeout)
+ this.request_timer = window.setTimeout(function(){ ref.request_timed_out(); }, this.env.request_timeout * 1000);
+ };
+
+ // return a localized string
+ this.get_label = function(name)
+ {
+ if (this.labels[name])
+ return this.labels[name];
+ else
+ return name;
+ };
+
+ // switch to another application task
+ this.switch_task = function(task)
+ {
+ if (this.task===task && task!='mail')
+ return;
+
+ var url = this.get_task_url(task);
+ if (task=='mail')
+ url += '&_mbox=INBOX';
+
+ this.redirect(url);
+ };
+
+ this.get_task_url = function(task, url)
+ {
+ if (!url)
+ url = this.env.comm_path;
+
+ return url.replace(/_task=[a-z]+/, '_task='+task);
+ };
+
+ // called when a request timed out
+ this.request_timed_out = function()
+ {
+ this.set_busy(false);
+ this.display_message('Request timed out!', 'error');
+ };
+
+
+ /*********************************************************/
+ /********* event handling methods *********/
+ /*********************************************************/
+
+ this.doc_mouse_up = function(e)
+ {
+ var model, li;
+
+ if (this.message_list) {
+ this.message_list.blur();
+ model = this.env.mailboxes;
+ }
+ else if (this.contact_list) {
+ this.contact_list.blur();
+ model = this.env.address_sources;
+ }
+ else if (this.ksearch_value) {
+ this.ksearch_blur();
+ }
+
+ // handle mouse release when dragging
+ if (this.drag_active && model && this.env.last_folder_target) {
+ this.set_classname(this.get_folder_li(this.env.last_folder_target), 'droptarget', false);
+ this.command('moveto', model[this.env.last_folder_target].id);
+ this.env.last_folder_target = null;
+ }
+ };
+
+ this.drag_start = function(list)
+ {
+ var model = this.task == 'mail' ? this.env.mailboxes : this.env.address_sources;
+
+ this.drag_active = true;
+ if (this.preview_timer)
+ clearTimeout(this.preview_timer);
+
+ // save folderlist and folders location/sizes for droptarget calculation in drag_move()
+ if (this.gui_objects.folderlist && model)
+ {
+ var li, pos, list, height;
+ list = rcube_find_object(this.task == 'mail' ? 'mailboxlist' : 'directorylist');
+ pos = rcube_get_object_pos(list);
+ this.env.folderlist_coords = {x1:pos.x, y1:pos.y, x2:pos.x + list.offsetWidth, y2:pos.y + list.offsetHeight};
+
+ this.env.folder_coords = new Array();
+ for (var k in model) {
+ if (li = this.get_folder_li(k))
+ {
+ pos = rcube_get_object_pos(li.firstChild);
+ // only visible folders
+ if (height = li.firstChild.offsetHeight)
+ this.env.folder_coords[k] = {x1:pos.x, y1:pos.y, x2:pos.x + li.firstChild.offsetWidth, y2:pos.y + height};
+ }
+ }
+ }
+ };
+
+ this.drag_move = function(e)
+ {
+ if (this.gui_objects.folderlist && this.env.folder_coords)
+ {
+ var li, pos, mouse;
+ mouse = rcube_event.get_mouse_pos(e);
+ pos = this.env.folderlist_coords;
+
+ // if mouse pointer is outside of folderlist
+ if (mouse.x < pos.x1 || mouse.x >= pos.x2
+ || mouse.y < pos.y1 || mouse.y >= pos.y2)
+ {
+ if (this.env.last_folder_target) {
+ this.set_classname(this.get_folder_li(this.env.last_folder_target), 'droptarget', false);
+ this.env.last_folder_target = null;
+ }
+ return;
+ }
+
+ // over the folders
+ for (var k in this.env.folder_coords)
+ {
+ pos = this.env.folder_coords[k];
+ if (this.check_droptarget(k) && ((mouse.x >= pos.x1) && (mouse.x < pos.x2)
+ && (mouse.y >= pos.y1) && (mouse.y < pos.y2)))
+ {
+ this.set_classname(this.get_folder_li(k), 'droptarget', true);
+ this.env.last_folder_target = k;
+ }
+ else
+ this.set_classname(this.get_folder_li(k), 'droptarget', false);
+ }
+ }
+ };
+
+ this.collapse_folder = function(id)
+ {
+ var div;
+ if ((li = this.get_folder_li(id)) &&
+ (div = li.getElementsByTagName("div")[0]) &&
+ (div.className.match(/collapsed/) || div.className.match(/expanded/)))
+ {
+ var ul = li.getElementsByTagName("ul")[0];
+ if (div.className.match(/collapsed/))
+ {
+ ul.style.display = '';
+ this.set_classname(div, 'collapsed', false);
+ this.set_classname(div, 'expanded', true);
+ var reg = new RegExp('&'+urlencode(id)+'&');
+ this.set_env('collapsed_folders', this.env.collapsed_folders.replace(reg, ''));
+ }
+ else
+ {
+ ul.style.display = 'none';
+ this.set_classname(div, 'expanded', false);
+ this.set_classname(div, 'collapsed', true);
+ this.set_env('collapsed_folders', this.env.collapsed_folders+'&'+urlencode(id)+'&');
+
+ // select parent folder if one of its childs is currently selected
+ if (this.env.mailbox.indexOf(id + this.env.delimiter) == 0)
+ this.command('list', id);
+ }
+
+ // Work around a bug in IE6 and IE7, see #1485309
+ if ((bw.ie6 || bw.ie7) &&
+ li.nextSibling &&
+ (li.nextSibling.getElementsByTagName("ul").length>0) &&
+ li.nextSibling.getElementsByTagName("ul")[0].style &&
+ (li.nextSibling.getElementsByTagName("ul")[0].style.display!='none'))
+ {
+ li.nextSibling.getElementsByTagName("ul")[0].style.display = 'none';
+ li.nextSibling.getElementsByTagName("ul")[0].style.display = '';
+ }
+
+ this.http_post('save-pref', '_name=collapsed_folders&_value='+urlencode(this.env.collapsed_folders));
+ this.set_unread_count_display(id, false);
+ }
+ }
+
+ this.click_on_list = function(e)
+ {
+ if (this.message_list)
+ this.message_list.focus();
+ else if (this.contact_list)
+ this.contact_list.focus();
+
+ var mbox_li;
+ if (mbox_li = this.get_folder_li())
+ this.set_classname(mbox_li, 'unfocused', true);
+
+ return rcube_event.get_button(e) == 2 ? true : rcube_event.cancel(e);
+ };
+
+ this.msglist_select = function(list)
+ {
+ if (this.preview_timer)
+ clearTimeout(this.preview_timer);
+
+ var selected = list.selection.length==1;
+
+ // Hide certain command buttons when Drafts folder is selected
+ if (this.env.mailbox == this.env.drafts_mailbox)
+ {
+ this.enable_command('reply', 'reply-all', 'forward', false);
+ this.enable_command('show', 'print', selected);
+ this.enable_command('delete', 'moveto', 'mark', (list.selection.length > 0 ? true : false));
+ }
+ else
+ {
+ this.enable_command('show', 'reply', 'reply-all', 'forward', 'print', selected);
+ this.enable_command('delete', 'moveto', 'mark', (list.selection.length > 0 ? true : false));
+ }
+
+ // start timer for message preview (wait for double click)
+ if (selected && this.env.contentframe && !list.multi_selecting)
+ this.preview_timer = window.setTimeout(function(){ ref.msglist_get_preview(); }, 200);
+ else if (this.env.contentframe)
+ this.show_contentframe(false);
+ };
+
+ this.msglist_dbl_click = function(list)
+ {
+ if (this.preview_timer)
+ clearTimeout(this.preview_timer);
+
+ var uid = list.get_single_selection();
+ if (uid && this.env.mailbox == this.env.drafts_mailbox)
+ this.goto_url('compose', '_draft_uid='+uid+'&_mbox='+urlencode(this.env.mailbox), true);
+ else if (uid)
+ this.show_message(uid, false, false);
+ };
+
+ this.msglist_keypress = function(list)
+ {
+ if (list.key_pressed == list.ENTER_KEY)
+ this.command('show');
+ else if (list.key_pressed == list.DELETE_KEY)
+ this.command('delete');
+ else if (list.key_pressed == list.BACKSPACE_KEY)
+ this.command('delete');
+ else
+ list.shiftkey = false;
+ };
+
+ this.msglist_get_preview = function()
+ {
+ var uid = this.get_single_uid();
+ if (uid && this.env.contentframe && !this.drag_active)
+ this.show_message(uid, false, true);
+ else if (this.env.contentframe)
+ this.show_contentframe(false);
+ };
+
+ this.check_droptarget = function(id)
+ {
+ if (this.task == 'mail')
+ return (this.env.mailboxes[id] && this.env.mailboxes[id].id != this.env.mailbox && !this.env.mailboxes[id].virtual);
+ else if (this.task == 'addressbook')
+ return (id != this.env.source && this.env.address_sources[id] && !this.env.address_sources[id].readonly);
+ else if (this.task == 'settings')
+ return (id != this.env.folder);
+ };
+
+
+ /*********************************************************/
+ /********* (message) list functionality *********/
+ /*********************************************************/
+
+ // when user doble-clicks on a row
+ this.show_message = function(id, safe, preview)
+ {
+ if (!id) return;
+
+ var add_url = '';
+ var action = preview ? 'preview': 'show';
+ var target = window;
+
+ if (preview && this.env.contentframe && window.frames && window.frames[this.env.contentframe])
+ {
+ target = window.frames[this.env.contentframe];
+ add_url = '&_framed=1';
+ }
+
+ if (safe)
+ add_url = '&_safe=1';
+
+ // also send search request to get the right messages
+ if (this.env.search_request)
+ add_url += '&_search='+this.env.search_request;
+ var url = '&_action='+action+'&_uid='+id+'&_mbox='+urlencode(this.env.mailbox)+add_url;
+ if (action == 'preview' && String(target.location.href).indexOf(url) >= 0)
+ this.show_contentframe(true);
+ else
+ {
+ this.set_busy(true, 'loading');
+ target.location.href = this.env.comm_path+url;
+ // mark as read and change mbox unread counter
+ if (action == 'preview' && this.message_list && this.message_list.rows[id] && this.message_list.rows[id].unread)
+ {
+ this.set_message(id, 'unread', false);
+ if (this.env.unread_counts[this.env.mailbox])
+ {
+ this.env.unread_counts[this.env.mailbox] -= 1;
+ this.set_unread_count(this.env.mailbox, this.env.unread_counts[this.env.mailbox], this.env.mailbox == 'INBOX');
+ }
+ }
+ }
+ };
+
+ this.show_contentframe = function(show)
+ {
+ var frm;
+ if (this.env.contentframe && (frm = rcube_find_object(this.env.contentframe)))
+ {
+ if (!show && window.frames[this.env.contentframe])
+ {
+ if (window.frames[this.env.contentframe].location.href.indexOf(this.env.blankpage)<0)
+ window.frames[this.env.contentframe].location.href = this.env.blankpage;
+ }
+ else if (!bw.safari)
+ frm.style.display = show ? 'block' : 'none';
+ }
+
+ if (!show && this.busy)
+ this.set_busy(false);
+ };
+
+ // list a specific page
+ this.list_page = function(page)
+ {
+ if (page=='next')
+ page = this.env.current_page+1;
+ if (page=='last')
+ page = this.env.pagecount;
+ if (page=='prev' && this.env.current_page>1)
+ page = this.env.current_page-1;
+ if (page=='first' && this.env.current_page>1)
+ page = 1;
+
+ if (page > 0 && page <= this.env.pagecount)
+ {
+ this.env.current_page = page;
+
+ if (this.task=='mail')
+ this.list_mailbox(this.env.mailbox, page);
+ else if (this.task=='addressbook')
+ this.list_contacts(this.env.source, page);
+ }
+ };
+
+ // list messages of a specific mailbox using filter
+ this.filter_mailbox = function(filter)
+ {
+ var search;
+ if (this.gui_objects.qsearchbox)
+ search = this.gui_objects.qsearchbox.value;
+
+ this.message_list.clear();
+
+ // reset vars
+ this.env.current_page = 1;
+ this.set_busy(true, 'searching');
+ this.http_request('search', '_filter='+filter
+ + (search ? '&_q='+urlencode(search) : '')
+ + (this.env.mailbox ? '&_mbox='+urlencode(this.env.mailbox) : ''), true);
+ }
+
+
+ // list messages of a specific mailbox
+ this.list_mailbox = function(mbox, page, sort)
+ {
+ this.last_selected = 0;
+ var add_url = '';
+ var target = window;
+
+ if (!mbox)
+ mbox = this.env.mailbox;
+
+ // add sort to url if set
+ if (sort)
+ add_url += '&_sort=' + sort;
+
+ // also send search request to get the right messages
+ if (this.env.search_request)
+ add_url += '&_search='+this.env.search_request;
+
+ // set page=1 if changeing to another mailbox
+ if (!page && mbox != this.env.mailbox)
+ {
+ page = 1;
+ this.env.current_page = page;
+ if (this.message_list)
+ this.message_list.clear_selection();
+ this.show_contentframe(false);
+ }
+
+ if (mbox != this.env.mailbox || (mbox == this.env.mailbox && !page && !sort))
+ add_url += '&_refresh=1';
+
+ this.select_folder(mbox, this.env.mailbox);
+ this.env.mailbox = mbox;
+
+ // load message list remotely
+ if (this.gui_objects.messagelist)
+ {
+ this.list_mailbox_remote(mbox, page, add_url);
+ return;
+ }
+
+ if (this.env.contentframe && window.frames && window.frames[this.env.contentframe])
+ {
+ target = window.frames[this.env.contentframe];
+ add_url += '&_framed=1';
+ }
+
+ // load message list to target frame/window
+ if (mbox)
+ {
+ this.set_busy(true, 'loading');
+ target.location.href = this.env.comm_path+'&_mbox='+urlencode(mbox)+(page ? '&_page='+page : '')+add_url;
+ }
+ };
+
+ // send remote request to load message list
+ this.list_mailbox_remote = function(mbox, page, add_url)
+ {
+ // clear message list first
+ this.message_list.clear();
+
+ // send request to server
+ var url = '_mbox='+urlencode(mbox)+(page ? '&_page='+page : '');
+ this.set_busy(true, 'loading');
+ this.http_request('list', url+add_url, true);
+ };
+
+ this.expunge_mailbox = function(mbox)
+ {
+ var lock = false;
+ var add_url = '';
+
+ // lock interface if it's the active mailbox
+ if (mbox == this.env.mailbox)
+ {
+ lock = true;
+ this.set_busy(true, 'loading');
+ add_url = '&_reload=1';
+ }
+
+ // send request to server
+ var url = '_mbox='+urlencode(mbox);
+ this.http_post('expunge', url+add_url, lock);
+ };
+
+ this.purge_mailbox = function(mbox)
+ {
+ var lock = false;
+ var add_url = '';
+
+ if (!confirm(this.get_label('purgefolderconfirm')))
+ return false;
+
+ // lock interface if it's the active mailbox
+ if (mbox == this.env.mailbox)
+ {
+ lock = true;
+ this.set_busy(true, 'loading');
+ add_url = '&_reload=1';
+ }
+
+ // send request to server
+ var url = '_mbox='+urlencode(mbox);
+ this.http_post('purge', url+add_url, lock);
+ return true;
+ };
+
+ // test if purge command is allowed
+ this.purge_mailbox_test = function()
+ {
+ return (this.env.messagecount && (this.env.mailbox == this.env.trash_mailbox || this.env.mailbox == this.env.junk_mailbox
+ || this.env.mailbox.match('^' + RegExp.escape(this.env.trash_mailbox) + RegExp.escape(this.env.delimiter))
+ || this.env.mailbox.match('^' + RegExp.escape(this.env.junk_mailbox) + RegExp.escape(this.env.delimiter))));
+ };
+
+ // set message icon
+ this.set_message_icon = function(uid)
+ {
+ var icn_src;
+ var rows = this.message_list.rows;
+
+ if (!rows[uid])
+ return false;
+
+ if (rows[uid].deleted && this.env.deletedicon)
+ icn_src = this.env.deletedicon;
+ else if (rows[uid].replied && this.env.repliedicon)
+ {
+ if (rows[uid].forwarded && this.env.forwardedrepliedicon)
+ icn_src = this.env.forwardedrepliedicon;
+ else
+ icn_src = this.env.repliedicon;
+ }
+ else if (rows[uid].forwarded && this.env.forwardedicon)
+ icn_src = this.env.forwardedicon;
+ else if (rows[uid].unread && this.env.unreadicon)
+ icn_src = this.env.unreadicon;
+ else if (this.env.messageicon)
+ icn_src = this.env.messageicon;
+
+ if (icn_src && rows[uid].icon)
+ rows[uid].icon.src = icn_src;
+
+ icn_src = '';
+
+ if (rows[uid].flagged && this.env.flaggedicon)
+ icn_src = this.env.flaggedicon;
+ else if (!rows[uid].flagged && this.env.unflaggedicon)
+ icn_src = this.env.unflaggedicon;
+
+ if (rows[uid].flagged_icon && icn_src)
+ rows[uid].flagged_icon.src = icn_src;
+ }
+
+ // set message status
+ this.set_message_status = function(uid, flag, status)
+ {
+ var rows = this.message_list.rows;
+
+ if (!rows[uid]) return false;
+
+ if (flag == 'unread')
+ rows[uid].unread = status;
+ else if(flag == 'deleted')
+ rows[uid].deleted = status;
+ else if (flag == 'replied')
+ rows[uid].replied = status;
+ else if (flag == 'forwarded')
+ rows[uid].forwarded = status;
+ else if (flag == 'flagged')
+ rows[uid].flagged = status;
+
+ this.env.messages[uid] = rows[uid];
+ }
+
+ // set message row status, class and icon
+ this.set_message = function(uid, flag, status)
+ {
+ var rows = this.message_list.rows;
+
+ if (!rows[uid]) return false;
+
+ if (flag)
+ this.set_message_status(uid, flag, status);
+
+ if (rows[uid].unread && rows[uid].classname.indexOf('unread')<0)
+ {
+ rows[uid].classname += ' unread';
+ this.set_classname(rows[uid].obj, 'unread', true);
+ }
+ else if (!rows[uid].unread && rows[uid].classname.indexOf('unread')>=0)
+ {
+ rows[uid].classname = rows[uid].classname.replace(/\s*unread/, '');
+ this.set_classname(rows[uid].obj, 'unread', false);
+ }
+
+ if (rows[uid].deleted && rows[uid].classname.indexOf('deleted')<0)
+ {
+ rows[uid].classname += ' deleted';
+ this.set_classname(rows[uid].obj, 'deleted', true);
+ }
+ else if (!rows[uid].deleted && rows[uid].classname.indexOf('deleted')>=0)
+ {
+ rows[uid].classname = rows[uid].classname.replace(/\s*deleted/, '');
+ this.set_classname(rows[uid].obj, 'deleted', false);
+ }
+
+ if (rows[uid].flagged && rows[uid].classname.indexOf('flagged')<0)
+ {
+ rows[uid].classname += ' flagged';
+ this.set_classname(rows[uid].obj, 'flagged', true);
+ }
+ else if (!rows[uid].flagged && rows[uid].classname.indexOf('flagged')>=0)
+ {
+ rows[uid].classname = rows[uid].classname.replace(/\s*flagged/, '');
+ this.set_classname(rows[uid].obj, 'flagged', false);
+ }
+
+ this.set_message_icon(uid);
+ }
+
+ // move selected messages to the specified mailbox
+ this.move_messages = function(mbox)
+ {
+ // exit if current or no mailbox specified or if selection is empty
+ if (!mbox || mbox == this.env.mailbox || (!this.env.uid && (!this.message_list || !this.message_list.get_selection().length)))
+ return;
+
+ var lock = false;
+ var add_url = '&_target_mbox='+urlencode(mbox)+'&_from='+(this.env.action ? this.env.action : '');
+
+ // show wait message
+ if (this.env.action=='show')
+ {
+ lock = true;
+ this.set_busy(true, 'movingmessage');
+ }
+ else if (!this.env.flag_for_deletion)
+ this.show_contentframe(false);
+
+ // Hide message command buttons until a message is selected
+ this.enable_command('reply', 'reply-all', 'forward', 'delete', 'mark', 'print', false);
+
+ this._with_selected_messages('moveto', lock, add_url, (this.env.flag_for_deletion ? false : true));
+ };
+
+ // delete selected messages from the current mailbox
+ this.delete_messages = function()
+ {
+ var selection = this.message_list ? this.message_list.get_selection() : new Array();
+
+ // exit if no mailbox specified or if selection is empty
+ if (!this.env.uid && !selection.length)
+ return;
+
+ // if there is a trash mailbox defined and we're not currently in it:
+ if (this.env.trash_mailbox && String(this.env.mailbox).toLowerCase() != String(this.env.trash_mailbox).toLowerCase())
+ {
+ // if shift was pressed delete it immediately
+ if (this.message_list && this.message_list.shiftkey)
+ {
+ if (confirm(this.get_label('deletemessagesconfirm')))
+ this.permanently_remove_messages();
+ }
+ else
+ this.move_messages(this.env.trash_mailbox);
+ }
+ // if there is a trash mailbox defined but we *are* in it:
+ else if (this.env.trash_mailbox && String(this.env.mailbox).toLowerCase() == String(this.env.trash_mailbox).toLowerCase())
+ this.permanently_remove_messages();
+ // if there isn't a defined trash mailbox and the config is set to flag for deletion
+ else if (!this.env.trash_mailbox && this.env.flag_for_deletion)
+ {
+ this.mark_message('delete');
+ if(this.env.action=="show")
+ this.command('nextmessage','',this);
+ else if (selection.length == 1)
+ this.message_list.select_next();
+ }
+ // if there isn't a defined trash mailbox and the config is set NOT to flag for deletion
+ else if (!this.env.trash_mailbox)
+ this.permanently_remove_messages();
+ };
+
+ // delete the selected messages permanently
+ this.permanently_remove_messages = function()
+ {
+ // exit if no mailbox specified or if selection is empty
+ if (!this.env.uid && (!this.message_list || !this.message_list.get_selection().length))
+ return;
+
+ this.show_contentframe(false);
+ this._with_selected_messages('delete', false, '&_from='+(this.env.action ? this.env.action : ''), true);
+ };
+
+ // Send a specifc request with UIDs of all selected messages
+ // @private
+ this._with_selected_messages = function(action, lock, add_url, remove)
+ {
+ var a_uids = new Array();
+
+ if (this.env.uid)
+ a_uids[0] = this.env.uid;
+ else
+ {
+ var selection = this.message_list.get_selection();
+ var rows = this.message_list.rows;
+ var id;
+ for (var n=0; n<selection.length; n++)
+ {
+ id = selection[n];
+ a_uids[a_uids.length] = id;
+
+ if (remove)
+ this.message_list.remove_row(id, (n == selection.length-1));
+ else
+ {
+ this.set_message_status(id, 'deleted', true);
+ if (this.env.read_when_deleted)
+ this.set_message_status(id, 'unread', false);
+ this.set_message(id);
+ }
+ }
+ }
+
+ // also send search request to get the right messages
+ if (this.env.search_request)
+ add_url += '&_search='+this.env.search_request;
+
+ // send request to server
+ this.http_post(action, '_uid='+a_uids.join(',')+'&_mbox='+urlencode(this.env.mailbox)+add_url, lock);
+ };
+
+ // set a specific flag to one or more messages
+ this.mark_message = function(flag, uid)
+ {
+ var a_uids = new Array();
+ var r_uids = new Array();
+ var selection = this.message_list ? this.message_list.get_selection() : new Array();
+
+ if (uid)
+ a_uids[0] = uid;
+ else if (this.env.uid)
+ a_uids[0] = this.env.uid;
+ else if (this.message_list)
+ {
+ for (var n=0; n<selection.length; n++)
+ {
+ a_uids[a_uids.length] = selection[n];
+ }
+ }
+
+ if (!this.message_list)
+ r_uids = a_uids;
+ else
+ for (var id, n=0; n<a_uids.length; n++)
+ {
+ id = a_uids[n];
+ if ((flag=='read' && this.message_list.rows[id].unread)
+ || (flag=='unread' && !this.message_list.rows[id].unread)
+ || (flag=='delete' && !this.message_list.rows[id].deleted)
+ || (flag=='undelete' && this.message_list.rows[id].deleted)
+ || (flag=='flagged' && !this.message_list.rows[id].flagged)
+ || (flag=='unflagged' && this.message_list.rows[id].flagged))
+ {
+ r_uids[r_uids.length] = id;
+ }
+ }
+
+ // nothing to do
+ if (!r_uids.length)
+ return;
+
+ switch (flag)
+ {
+ case 'read':
+ case 'unread':
+ this.toggle_read_status(flag, r_uids);
+ break;
+ case 'delete':
+ case 'undelete':
+ this.toggle_delete_status(r_uids);
+ break;
+ case 'flagged':
+ case 'unflagged':
+ this.toggle_flagged_status(flag, a_uids);
+ break;
+ }
+ };
+
+ // set class to read/unread
+ this.toggle_read_status = function(flag, a_uids)
+ {
+ // mark all message rows as read/unread
+ for (var i=0; i<a_uids.length; i++)
+ this.set_message(a_uids[i], 'unread', (flag=='unread' ? true : false));
+
+ this.http_post('mark', '_uid='+a_uids.join(',')+'&_flag='+flag);
+ };
+
+ // set image to flagged or unflagged
+ this.toggle_flagged_status = function(flag, a_uids)
+ {
+ // mark all message rows as flagged/unflagged
+ for (var i=0; i<a_uids.length; i++)
+ this.set_message(a_uids[i], 'flagged', (flag=='flagged' ? true : false));
+
+ this.http_post('mark', '_uid='+a_uids.join(',')+'&_flag='+flag);
+ };
+
+ // mark all message rows as deleted/undeleted
+ this.toggle_delete_status = function(a_uids)
+ {
+ var rows = this.message_list ? this.message_list.rows : new Array();
+
+ if (a_uids.length==1)
+ {
+ if (!rows.length || (rows[a_uids[0]] && !rows[a_uids[0]].deleted))
+ this.flag_as_deleted(a_uids);
+ else
+ this.flag_as_undeleted(a_uids);
+
+ return true;
+ }
+
+ var all_deleted = true;
+ for (var i=0; i<a_uids.length; i++)
+ {
+ uid = a_uids[i];
+ if (rows[uid]) {
+ if (!rows[uid].deleted)
+ {
+ all_deleted = false;
+ break;
+ }
+ }
+ }
+
+ if (all_deleted)
+ this.flag_as_undeleted(a_uids);
+ else
+ this.flag_as_deleted(a_uids);
+
+ return true;
+ };
+
+ this.flag_as_undeleted = function(a_uids)
+ {
+ for (var i=0; i<a_uids.length; i++)
+ this.set_message(a_uids[i], 'deleted', false);
+
+ this.http_post('mark', '_uid='+a_uids.join(',')+'&_flag=undelete');
+ return true;
+ };
+
+ this.flag_as_deleted = function(a_uids)
+ {
+ var add_url = '';
+ var r_uids = new Array();
+ var rows = this.message_list ? this.message_list.rows : new Array();
+
+ for (var i=0; i<a_uids.length; i++)
+ {
+ uid = a_uids[i];
+ if (rows[uid])
+ {
+ this.set_message(uid, 'deleted', true);
+ if (rows[uid].unread)
+ r_uids[r_uids.length] = uid;
+ }
+ }
+
+ if (r_uids.length)
+ add_url = '&_ruid='+r_uids.join(',');
+
+ this.http_post('mark', '_uid='+a_uids.join(',')+'&_flag=delete'+add_url);
+ return true;
+ };
+
+ // flag as read without mark request (called from backend)
+ // argument should be a coma-separated list of uids
+ this.flag_deleted_as_read = function(uids)
+ {
+ var icn_src;
+ var rows = this.message_list ? this.message_list.rows : new Array();
+ var str = String(uids);
+ var a_uids = new Array();
+
+ a_uids = str.split(',');
+
+ for (var uid, i=0; i<a_uids.length; i++)
+ {
+ uid = a_uids[i];
+ if (rows[uid])
+ this.set_message(uid, 'unread', false);
+ }
+ };
+
+
+ /*********************************************************/
+ /********* login form methods *********/
+ /*********************************************************/
+
+ // handler for keyboard events on the _user field
+ this.login_user_keyup = function(e)
+ {
+ var key = rcube_event.get_keycode(e);
+ var elm;
+
+ // enter
+ if ((key==13) && (elm = rcube_find_object('_pass')))
+ {
+ elm.focus();
+ return false;
+ }
+ };
+
+
+ /*********************************************************/
+ /********* message compose methods *********/
+ /*********************************************************/
+
+ // checks the input fields before sending a message
+ this.check_compose_input = function()
+ {
+ // check input fields
+ var input_to = rcube_find_object('_to');
+ var input_cc = rcube_find_object('_cc');
+ var input_bcc = rcube_find_object('_bcc');
+ var input_from = rcube_find_object('_from');
+ var input_subject = rcube_find_object('_subject');
+ var input_message = rcube_find_object('_message');
+
+ // check sender (if have no identities)
+ if (input_from.type == 'text' && !rcube_check_email(input_from.value, true))
+ {
+ alert(this.get_label('nosenderwarning'));
+ input_from.focus();
+ return false;
+ }
+
+ // check for empty recipient
+ var recipients = input_to.value ? input_to.value : (input_cc.value ? input_cc.value : input_bcc.value);
+ if (!rcube_check_email(recipients.replace(/^\s+/, '').replace(/[\s,;]+$/, ''), true))
+ {
+ alert(this.get_label('norecipientwarning'));
+ input_to.focus();
+ return false;
+ }
+
+ // display localized warning for missing subject
+ if (input_subject && input_subject.value == '')
+ {
+ var subject = prompt(this.get_label('nosubjectwarning'), this.get_label('nosubject'));
+
+ // user hit cancel, so don't send
+ if (!subject && subject !== '')
+ {
+ input_subject.focus();
+ return false;
+ }
+ else
+ {
+ input_subject.value = subject ? subject : this.get_label('nosubject');
+ }
+ }
+
+ // check for empty body
+ if ((!window.tinyMCE || !tinyMCE.get('compose-body')) && input_message.value == '' && !confirm(this.get_label('nobodywarning')))
+ {
+ input_message.focus();
+ return false;
+ }
+ else if (window.tinyMCE && tinyMCE.get('compose-body') && !tinyMCE.get('compose-body').getContent() && !confirm(this.get_label('nobodywarning')))
+ {
+ tinyMCE.get('compose-body').focus();
+ return false;
+ }
+
+ // Apply spellcheck changes if spell checker is active
+ this.stop_spellchecking();
+
+ return true;
+ };
+
+ this.stop_spellchecking = function()
+ {
+ if (this.env.spellcheck && !this.spellcheck_ready) {
+ exec_event(this.env.spellcheck.check_link, 'click');
+ this.set_spellcheck_state('ready');
+ }
+ };
+
+ this.display_spellcheck_controls = function(vis)
+ {
+ if (this.env.spellcheck) {
+ // stop spellchecking process
+ if (!vis)
+ this.stop_spellchecking();
+
+ this.env.spellcheck.check_link.style.visibility = vis ? 'visible' : 'hidden';
+ this.env.spellcheck.switch_lan_pic.style.visibility = vis ? 'visible' : 'hidden';
+ }
+ };
+
+ this.set_spellcheck_state = function(s)
+ {
+ this.spellcheck_ready = (s=='check_spelling' || s=='ready');
+ this.enable_command('spellcheck', this.spellcheck_ready);
+ };
+
+ this.set_draft_id = function(id)
+ {
+ var f;
+ if (f = rcube_find_object('_draft_saveid'))
+ f.value = id;
+ };
+
+ this.auto_save_start = function()
+ {
+ if (this.env.draft_autosave)
+ this.save_timer = self.setTimeout(function(){ ref.command("savedraft"); }, this.env.draft_autosave * 1000);
+
+ // Unlock interface now that saving is complete
+ this.busy = false;
+ };
+
+ this.compose_field_hash = function(save)
+ {
+ // check input fields
+ var input_to = rcube_find_object('_to');
+ var input_cc = rcube_find_object('_cc');
+ var input_bcc = rcube_find_object('_bcc');
+ var input_subject = rcube_find_object('_subject');
+ var editor, input_message;
+ var str = '';
+
+ if (input_to && input_to.value)
+ str += input_to.value+':';
+ if (input_cc && input_cc.value)
+ str += input_cc.value+':';
+ if (input_bcc && input_bcc.value)
+ str += input_bcc.value+':';
+ if (input_subject && input_subject.value)
+ str += input_subject.value+':';
+
+ if (editor = tinyMCE.get('compose-body'))
+ str += editor.getContent();
+ else
+ {
+ input_message = rcube_find_object('_message');
+ str += input_message.value;
+ }
+
+ if (save)
+ this.cmp_hash = str;
+
+ return str;
+ };
+
+ this.change_identity = function(obj)
+ {
+ if (!obj || !obj.options)
+ return false;
+
+ var id = obj.options[obj.selectedIndex].value;
+ var input_message = rcube_find_object('_message');
+ var message = input_message ? input_message.value : '';
+ var is_html = (rcube_find_object('_is_html').value == '1');
+ var sig, p;
+
+ if (!this.env.identity)
+ this.env.identity = id
+
+ if (!is_html)
+ {
+ // remove the 'old' signature
+ if (this.env.identity && this.env.signatures && this.env.signatures[this.env.identity])
+ {
+ if (this.env.signatures[this.env.identity]['is_html'])
+ sig = this.env.signatures[this.env.identity]['plain_text'];
+ else
+ sig = this.env.signatures[this.env.identity]['text'];
+
+ if (sig.indexOf('-- ')!=0)
+ sig = '-- \n'+sig;
+
+ p = message.lastIndexOf(sig);
+ if (p>=0)
+ message = message.substring(0, p-1) + message.substring(p+sig.length, message.length);
+ }
+
+ message = message.replace(/[\r\n]+$/, '');
+
+ // add the new signature string
+ if (this.env.signatures && this.env.signatures[id])
+ {
+ sig = this.env.signatures[id]['text'];
+ if (this.env.signatures[id]['is_html'])
+ {
+ sig = this.env.signatures[id]['plain_text'];
+ }
+ if (sig.indexOf('-- ')!=0)
+ sig = '-- \n'+sig;
+ message += '\n\n'+sig;
+ }
+ }
+ else
+ {
+ var editor = tinyMCE.get('compose-body');
+
+ if (this.env.signatures)
+ {
+ // Append the signature as a div within the body
+ var sigElem = editor.dom.get('_rc_sig');
+ var newsig = '';
+ var htmlsig = true;
+
+ if (!sigElem)
+ {
+ // add empty line before signature on IE
+ if (bw.ie)
+ editor.getBody().appendChild(editor.getDoc().createElement('br'));
+
+ sigElem = editor.getDoc().createElement('div');
+ sigElem.setAttribute('id', '_rc_sig');
+ editor.getBody().appendChild(sigElem);
+ }
+
+ if (this.env.signatures[id])
+ {
+ newsig = this.env.signatures[id]['text'];
+ htmlsig = this.env.signatures[id]['is_html'];
+ }
+
+ if (htmlsig)
+ sigElem.innerHTML = newsig;
+ else
+ sigElem.innerHTML = '<pre>' + newsig + '</pre>';
+ }
+ }
+
+ if (input_message)
+ input_message.value = message;
+
+ this.env.identity = id;
+ return true;
+ };
+
+ this.show_attachment_form = function(a)
+ {
+ if (!this.gui_objects.uploadbox)
+ return false;
+
+ var elm, list;
+ if (elm = this.gui_objects.uploadbox)
+ {
+ if (a && (list = this.gui_objects.attachmentlist))
+ {
+ var pos = rcube_get_object_pos(list);
+ var left = pos.x;
+ var top = pos.y + list.offsetHeight + 10;
+
+ elm.style.top = top+'px';
+ elm.style.left = left+'px';
+ }
+
+ elm.style.visibility = a ? 'visible' : 'hidden';
+ }
+
+ // clear upload form
+ try {
+ if (!a && this.gui_objects.attachmentform != this.gui_objects.messageform)
+ this.gui_objects.attachmentform.reset();
+ }
+ catch(e){} // ignore errors
+
+ return true;
+ };
+
+ // upload attachment file
+ this.upload_file = function(form)
+ {
+ if (!form)
+ return false;
+
+ // get file input fields
+ var send = false;
+ for (var n=0; n<form.elements.length; n++)
+ if (form.elements[n].type=='file' && form.elements[n].value)
+ {
+ send = true;
+ break;
+ }
+
+ // create hidden iframe and post upload form
+ if (send)
+ {
+ var ts = new Date().getTime();
+ var frame_name = 'rcmupload'+ts;
+
+ // have to do it this way for IE
+ // otherwise the form will be posted to a new window
+ if(document.all)
+ {
+ var html = '<iframe name="'+frame_name+'" src="program/blank.gif" style="width:0;height:0;visibility:hidden;"></iframe>';
+ document.body.insertAdjacentHTML('BeforeEnd',html);
+ }
+ else // for standards-compilant browsers
+ {
+ var frame = document.createElement('IFRAME');
+ frame.name = frame_name;
+ frame.style.border = 'none';
+ frame.style.width = 0;
+ frame.style.height = 0;
+ frame.style.visibility = 'hidden';
+ document.body.appendChild(frame);
+ }
+
+ form.target = frame_name;
+ form.action = this.env.comm_path+'&_action=upload';
+ form.setAttribute('enctype', 'multipart/form-data');
+ form.submit();
+ }
+
+ // set reference to the form object
+ this.gui_objects.attachmentform = form;
+ return true;
+ };
+
+ // add file name to attachment list
+ // called from upload page
+ this.add2attachment_list = function(name, content)
+ {
+ if (!this.gui_objects.attachmentlist)
+ return false;
+
+ var li = document.createElement('LI');
+ li.id = name;
+ li.innerHTML = content;
+ this.gui_objects.attachmentlist.appendChild(li);
+ return true;
+ };
+
+ this.remove_from_attachment_list = function(name)
+ {
+ if (!this.gui_objects.attachmentlist)
+ return false;
+
+ var list = this.gui_objects.attachmentlist.getElementsByTagName("li");
+ for (i=0;i<list.length;i++)
+ if (list[i].id == name)
+ this.gui_objects.attachmentlist.removeChild(list[i]);
+ };
+
+ this.remove_attachment = function(name)
+ {
+ if (name)
+ this.http_post('remove-attachment', '_file='+urlencode(name));
+
+ return true;
+ };
+
+ // send remote request to add a new contact
+ this.add_contact = function(value)
+ {
+ if (value)
+ this.http_post('addcontact', '_address='+value);
+
+ return true;
+ };
+
+ // send remote request to search mail or contacts
+ this.qsearch = function(value, addurl)
+ {
+ if (value != '')
+ {
+ if (this.message_list)
+ this.message_list.clear();
+ else if (this.contact_list) {
+ this.contact_list.clear(true);
+ this.show_contentframe(false);
+ }
+
+ if (this.gui_objects.search_filter)
+ addurl = '&_filter=' + this.gui_objects.search_filter.value;
+
+ // reset vars
+ this.env.current_page = 1;
+ this.set_busy(true, 'searching');
+ this.http_request('search', '_q='+urlencode(value)
+ + (this.env.mailbox ? '&_mbox='+urlencode(this.env.mailbox) : '')
+ + (this.env.source ? '&_source='+urlencode(this.env.source) : '')
+ + (addurl ? addurl : ''), true);
+ }
+ return true;
+ };
+
+ // reset quick-search form
+ this.reset_qsearch = function()
+ {
+ if (this.gui_objects.qsearchbox)
+ this.gui_objects.qsearchbox.value = '';
+
+ this.env.search_request = null;
+ return true;
+ };
+
+ this.sent_successfully = function(type, msg)
+ {
+ this.list_mailbox();
+ this.display_message(msg, type, true);
+ }
+
+
+ /*********************************************************/
+ /********* keyboard live-search methods *********/
+ /*********************************************************/
+
+ // handler for keyboard events on address-fields
+ this.ksearch_keypress = function(e, obj)
+ {
+ if (this.ksearch_timer)
+ clearTimeout(this.ksearch_timer);
+
+ var highlight;
+ var key = rcube_event.get_keycode(e);
+ var mod = rcube_event.get_modifier(e);
+
+ switch (key)
+ {
+ case 38: // key up
+ case 40: // key down
+ if (!this.ksearch_pane)
+ break;
+
+ var dir = key==38 ? 1 : 0;
+
+ highlight = document.getElementById('rcmksearchSelected');
+ if (!highlight)
+ highlight = this.ksearch_pane.ul.firstChild;
+
+ if (highlight)
+ this.ksearch_select(dir ? highlight.previousSibling : highlight.nextSibling);
+
+ return rcube_event.cancel(e);
+
+ case 9: // tab
+ if(mod == SHIFT_KEY)
+ break;
+
+ case 13: // enter
+ if (this.ksearch_selected===null || !this.ksearch_input || !this.ksearch_value)
+ break;
+
+ // insert selected address and hide ksearch pane
+ this.insert_recipient(this.ksearch_selected);
+ this.ksearch_hide();
+
+ return rcube_event.cancel(e);
+
+ case 27: // escape
+ this.ksearch_hide();
+ break;
+
+ }
+
+ // start timer
+ this.ksearch_timer = window.setTimeout(function(){ ref.ksearch_get_results(); }, 200);
+ this.ksearch_input = obj;
+
+ return true;
+ };
+
+ this.ksearch_select = function(node)
+ {
+ var current = document.getElementById('rcmksearchSelected');
+ if (current && node) {
+ current.removeAttribute('id');
+ this.set_classname(current, 'selected', false);
+ }
+
+ if (node) {
+ node.setAttribute('id', 'rcmksearchSelected');
+ this.set_classname(node, 'selected', true);
+ this.ksearch_selected = node._rcm_id;
+ }
+ };
+
+ this.insert_recipient = function(id)
+ {
+ if (!this.env.contacts[id] || !this.ksearch_input)
+ return;
+
+ // get cursor pos
+ var inp_value = this.ksearch_input.value.toLowerCase();
+ var cpos = this.get_caret_pos(this.ksearch_input);
+ var p = inp_value.lastIndexOf(this.ksearch_value, cpos);
+
+ // replace search string with full address
+ var pre = this.ksearch_input.value.substring(0, p);
+ var end = this.ksearch_input.value.substring(p+this.ksearch_value.length, this.ksearch_input.value.length);
+ var insert = this.env.contacts[id]+', ';
+ this.ksearch_input.value = pre + insert + end;
+
+ // set caret to insert pos
+ cpos = p+insert.length;
+ if (this.ksearch_input.setSelectionRange)
+ this.ksearch_input.setSelectionRange(cpos, cpos);
+ };
+
+ // address search processor
+ this.ksearch_get_results = function()
+ {
+ var inp_value = this.ksearch_input ? this.ksearch_input.value : null;
+ if (inp_value === null)
+ return;
+
+ if (this.ksearch_pane && this.ksearch_pane.visible)
+ this.ksearch_pane.show(0);
+
+ // get string from current cursor pos to last comma
+ var cpos = this.get_caret_pos(this.ksearch_input);
+ var p = inp_value.lastIndexOf(',', cpos-1);
+ var q = inp_value.substring(p+1, cpos);
+
+ // trim query string
+ q = q.replace(/(^\s+|\s+$)/g, '').toLowerCase();
+
+ // Don't (re-)search if string is empty or if the last results are still active
+ if (!q.length || q == this.ksearch_value)
+ return;
+
+ this.ksearch_value = q;
+
+ this.display_message(this.get_label('searching'), 'loading', true);
+ this.http_post('autocomplete', '_search='+q);
+ };
+
+ this.ksearch_query_results = function(results, search)
+ {
+ // ignore this outdated search response
+ if (search != this.ksearch_value)
+ return;
+
+ this.hide_message();
+ this.env.contacts = results ? results : [];
+
+ var result_ids = new Array();
+ var c=0;
+ for (var i=0; i < this.env.contacts.length; i++) {
+ result_ids[c++] = i;
+ if (c == 15) // limit search results
+ break;
+ }
+
+ this.ksearch_display_results(this.env.contacts, result_ids, c);
+ };
+
+ this.ksearch_display_results = function (a_results, a_result_ids, c)
+ {
+ // display search results
+ if (c && a_results.length && this.ksearch_input) {
+ var p, ul, li;
+
+ // create results pane if not present
+ if (!this.ksearch_pane) {
+ ul = document.createElement('UL');
+ this.ksearch_pane = new rcube_layer('rcmKSearchpane', {vis:0, zindex:30000});
+ this.ksearch_pane.elm.appendChild(ul);
+ this.ksearch_pane.ul = ul;
+ }
+ else
+ ul = this.ksearch_pane.ul;
+
+ // remove all search results
+ ul.innerHTML = '';
+
+ // add each result line to list
+ for (i=0; i<a_results.length; i++) {
+ li = document.createElement('LI');
+ li.innerHTML = a_results[i].replace(new RegExp('('+this.ksearch_value+')', 'ig'), '##$1%%').replace(/</g, '<').replace(/>/g, '>').replace(/##([^%]+)%%/g, '<b>$1</b>');
+ li.onmouseover = function(){ ref.ksearch_select(this); };
+ li.onmouseup = function(){ ref.ksearch_click(this) };
+ li._rcm_id = a_result_ids[i];
+ ul.appendChild(li);
+ }
+
+ // check if last selected item is still in result list
+ if (this.ksearch_selected !== null) {
+ p = find_in_array(this.ksearch_selected, a_result_ids);
+ if (p >= 0 && ul.childNodes) {
+ ul.childNodes[p].setAttribute('id', 'rcmksearchSelected');
+ this.set_classname(ul.childNodes[p], 'selected', true);
+ }
+ else
+ this.ksearch_selected = null;
+ }
+
+ // if no item selected, select the first one
+ if (this.ksearch_selected === null) {
+ ul.firstChild.setAttribute('id', 'rcmksearchSelected');
+ this.set_classname(ul.firstChild, 'selected', true);
+ this.ksearch_selected = a_result_ids[0];
+ }
+
+ // move the results pane right under the input box and make it visible
+ var pos = rcube_get_object_pos(this.ksearch_input);
+ this.ksearch_pane.move(pos.x, pos.y+this.ksearch_input.offsetHeight);
+ this.ksearch_pane.show(1);
+ }
+ // hide results pane
+ else
+ this.ksearch_hide();
+ };
+
+ this.ksearch_click = function(node)
+ {
+ if (this.ksearch_input)
+ this.ksearch_input.focus();
+
+ this.insert_recipient(node._rcm_id);
+ this.ksearch_hide();
+ };
+
+ this.ksearch_blur = function()
+ {
+ if (this.ksearch_timer)
+ clearTimeout(this.ksearch_timer);
+
+ this.ksearch_value = '';
+ this.ksearch_input = null;
+
+ this.ksearch_hide();
+ };
+
+
+ this.ksearch_hide = function()
+ {
+ this.ksearch_selected = null;
+
+ if (this.ksearch_pane)
+ this.ksearch_pane.show(0);
+ };
+
+
+ /*********************************************************/
+ /********* address book methods *********/
+ /*********************************************************/
+
+ this.contactlist_keypress = function(list)
+ {
+ if (list.key_pressed == list.DELETE_KEY)
+ this.command('delete');
+ };
+
+ this.contactlist_select = function(list)
+ {
+ if (this.preview_timer)
+ clearTimeout(this.preview_timer);
+
+ var id, frame, ref = this;
+ if (id = list.get_single_selection())
+ this.preview_timer = window.setTimeout(function(){ ref.load_contact(id, 'show'); }, 200);
+ else if (this.env.contentframe)
+ this.show_contentframe(false);
+
+ this.enable_command('compose', list.selection.length > 0);
+ this.enable_command('edit', (id && this.env.address_sources && !this.env.address_sources[this.env.source].readonly) ? true : false);
+ this.enable_command('delete', list.selection.length && this.env.address_sources && !this.env.address_sources[this.env.source].readonly);
+
+ return false;
+ };
+
+ this.list_contacts = function(src, page)
+ {
+ var add_url = '';
+ var target = window;
+
+ if (!src)
+ src = this.env.source;
+
+ if (page && this.current_page==page && src == this.env.source)
+ return false;
+
+ if (src != this.env.source)
+ {
+ page = 1;
+ this.env.current_page = page;
+ this.reset_qsearch();
+ }
+
+ this.select_folder(src, this.env.source);
+ this.env.source = src;
+
+ // load contacts remotely
+ if (this.gui_objects.contactslist)
+ {
+ this.list_contacts_remote(src, page);
+ return;
+ }
+
+ if (this.env.contentframe && window.frames && window.frames[this.env.contentframe])
+ {
+ target = window.frames[this.env.contentframe];
+ add_url = '&_framed=1';
+ }
+
+ // also send search request to get the correct listing
+ if (this.env.search_request)
+ add_url += '&_search='+this.env.search_request;
+
+ this.set_busy(true, 'loading');
+ target.location.href = this.env.comm_path+(src ? '&_source='+urlencode(src) : '')+(page ? '&_page='+page : '')+add_url;
+ };
+
+ // send remote request to load contacts list
+ this.list_contacts_remote = function(src, page)
+ {
+ // clear message list first
+ this.contact_list.clear(true);
+ this.show_contentframe(false);
+ this.enable_command('delete', 'compose', false);
+
+ // send request to server
+ var url = (src ? '_source='+urlencode(src) : '') + (page ? (src?'&':'') + '_page='+page : '');
+ this.env.source = src;
+
+ // also send search request to get the right messages
+ if (this.env.search_request)
+ url += '&_search='+this.env.search_request;
+
+ this.set_busy(true, 'loading');
+ this.http_request('list', url, true);
+ };
+
+ // load contact record
+ this.load_contact = function(cid, action, framed)
+ {
+ var add_url = '';
+ var target = window;
+ if (this.env.contentframe && window.frames && window.frames[this.env.contentframe])
+ {
+ add_url = '&_framed=1';
+ target = window.frames[this.env.contentframe];
+ this.show_contentframe(true);
+ }
+ else if (framed)
+ return false;
+
+ if (action && (cid || action=='add') && !this.drag_active)
+ {
+ this.set_busy(true);
+ target.location.href = this.env.comm_path+'&_action='+action+'&_source='+urlencode(this.env.source)+'&_cid='+urlencode(cid) + add_url;
+ }
+ return true;
+ };
+
+ // copy a contact to the specified target (group or directory)
+ this.copy_contact = function(cid, to)
+ {
+ if (!cid)
+ cid = this.contact_list.get_selection().join(',');
+
+ if (to != this.env.source && cid && this.env.address_sources[to] && !this.env.address_sources[to].readonly)
+ this.http_post('copy', '_cid='+urlencode(cid)+'&_source='+urlencode(this.env.source)+'&_to='+urlencode(to));
+ };
+
+
+ this.delete_contacts = function()
+ {
+ // exit if no mailbox specified or if selection is empty
+ var selection = this.contact_list.get_selection();
+ if (!(selection.length || this.env.cid) || !confirm(this.get_label('deletecontactconfirm')))
+ return;
+
+ var a_cids = new Array();
+ var qs = '';
+
+ if (this.env.cid)
+ a_cids[a_cids.length] = this.env.cid;
+ else
+ {
+ var id;
+ for (var n=0; n<selection.length; n++)
+ {
+ id = selection[n];
+ a_cids[a_cids.length] = id;
+ this.contact_list.remove_row(id, (n == selection.length-1));
+ }
+
+ // hide content frame if we delete the currently displayed contact
+ if (selection.length == 1)
+ this.show_contentframe(false);
+ }
+
+ // also send search request to get the right records from the next page
+ if (this.env.search_request)
+ qs += '&_search='+this.env.search_request;
+
+ // send request to server
+ this.http_post('delete', '_cid='+urlencode(a_cids.join(','))+'&_source='+urlencode(this.env.source)+'&_from='+(this.env.action ? this.env.action : '')+qs);
+ return true;
+ };
+
+ // update a contact record in the list
+ this.update_contact_row = function(cid, cols_arr)
+ {
+ var row;
+ if (this.contact_list.rows[cid] && (row = this.contact_list.rows[cid].obj))
+ {
+ for (var c=0; c<cols_arr.length; c++)
+ if (row.cells[c])
+ row.cells[c].innerHTML = cols_arr[c];
+
+ return true;
+ }
+
+ return false;
+ };
+
+
+ /*********************************************************/
+ /********* user settings methods *********/
+ /*********************************************************/
+
+ this.init_subscription_list = function()
+ {
+ var p = this;
+ this.subscription_list = new rcube_list_widget(this.gui_objects.subscriptionlist, {multiselect:false, draggable:true, keyboard:false, toggleselect:true});
+ this.subscription_list.addEventListener('select', function(o){ p.subscription_select(o); });
+ this.subscription_list.addEventListener('dragstart', function(o){ p.drag_active = true; });
+ this.subscription_list.addEventListener('dragend', function(o){ p.subscription_move_folder(o); });
+ this.subscription_list.row_init = function (row)
+ {
+ var anchors = row.obj.getElementsByTagName('A');
+ if (anchors[0])
+ anchors[0].onclick = function() { p.rename_folder(row.id); return false; };
+ if (anchors[1])
+ anchors[1].onclick = function() { p.delete_folder(row.id); return false; };
+ row.obj.onmouseover = function() { p.focus_subscription(row.id); };
+ row.obj.onmouseout = function() { p.unfocus_subscription(row.id); };
+ }
+ this.subscription_list.init();
+ }
+
+ this.identity_select = function(list)
+ {
+ var id;
+ if (id = list.get_single_selection())
+ this.load_identity(id, 'edit-identity');
+ };
+
+ // load contact record
+ this.load_identity = function(id, action)
+ {
+ if (action=='edit-identity' && (!id || id==this.env.iid))
+ return false;
+
+ var add_url = '';
+ var target = window;
+ if (this.env.contentframe && window.frames && window.frames[this.env.contentframe])
+ {
+ add_url = '&_framed=1';
+ target = window.frames[this.env.contentframe];
+ document.getElementById(this.env.contentframe).style.visibility = 'inherit';
+ }
+
+ if (action && (id || action=='add-identity'))
+ {
+ this.set_busy(true);
+ target.location.href = this.env.comm_path+'&_action='+action+'&_iid='+id+add_url;
+ }
+ return true;
+ };
+
+ this.delete_identity = function(id)
+ {
+ // exit if no mailbox specified or if selection is empty
+ var selection = this.identity_list.get_selection();
+ if (!(selection.length || this.env.iid))
+ return;
+
+ if (!id)
+ id = this.env.iid ? this.env.iid : selection[0];
+
+ // if (this.env.framed && id)
+ this.goto_url('delete-identity', '_iid='+id, true);
+ return true;
+ };
+
+ this.focus_subscription = function(id)
+ {
+ var row, folder;
+ var reg = RegExp('['+RegExp.escape(this.env.delimiter)+']?[^'+RegExp.escape(this.env.delimiter)+']+$');
+
+ if (this.drag_active && this.env.folder && (row = document.getElementById(id)))
+ if (this.env.subscriptionrows[id] &&
+ (folder = this.env.subscriptionrows[id][0]))
+ {
+ if (this.check_droptarget(folder) &&
+ !this.env.subscriptionrows[this.get_folder_row_id(this.env.folder)][2] &&
+ (folder != this.env.folder.replace(reg, '')) &&
+ (!folder.match(new RegExp('^'+RegExp.escape(this.env.folder+this.env.delimiter)))))
+ {
+ this.set_env('dstfolder', folder);
+ this.set_classname(row, 'droptarget', true);
+ }
+ }
+ else if (this.env.folder.match(new RegExp(RegExp.escape(this.env.delimiter))))
+ {
+ this.set_env('dstfolder', this.env.delimiter);
+ this.set_classname(this.subscription_list.frame, 'droptarget', true);
+ }
+ }
+
+ this.unfocus_subscription = function(id)
+ {
+ var row;
+ this.set_env('dstfolder', null);
+ if (this.env.subscriptionrows[id] &&
+ (row = document.getElementById(id)))
+ this.set_classname(row, 'droptarget', false);
+ else
+ this.set_classname(this.subscription_list.frame, 'droptarget', false);
+ }
+
+ this.subscription_select = function(list)
+ {
+ var id, folder;
+ if ((id = list.get_single_selection()) &&
+ this.env.subscriptionrows['rcmrow'+id] &&
+ (folder = this.env.subscriptionrows['rcmrow'+id][0]))
+ this.set_env('folder', folder);
+ else
+ this.set_env('folder', null);
+
+ if (this.gui_objects.createfolderhint)
+ this.gui_objects.createfolderhint.innerHTML = this.env.folder ? this.get_label('addsubfolderhint') : '';
+ };
+
+ this.subscription_move_folder = function(list)
+ {
+ var reg = RegExp('['+RegExp.escape(this.env.delimiter)+']?[^'+RegExp.escape(this.env.delimiter)+']+$');
+ if (this.env.folder && this.env.dstfolder && (this.env.dstfolder != this.env.folder) &&
+ (this.env.dstfolder != this.env.folder.replace(reg, '')))
+ {
+ var reg = new RegExp('[^'+RegExp.escape(this.env.delimiter)+']*['+RegExp.escape(this.env.delimiter)+']', 'g');
+ var basename = this.env.folder.replace(reg, '');
+ var newname = this.env.dstfolder==this.env.delimiter ? basename : this.env.dstfolder+this.env.delimiter+basename;
+
+ this.set_busy(true, 'foldermoving');
+ this.http_post('rename-folder', '_folder_oldname='+urlencode(this.env.folder)+'&_folder_newname='+urlencode(newname), true);
+ }
+ this.drag_active = false;
+ this.unfocus_subscription(this.get_folder_row_id(this.env.dstfolder));
+ };
+
+ // tell server to create and subscribe a new mailbox
+ this.create_folder = function(name)
+ {
+ if (this.edit_folder)
+ this.reset_folder_rename();
+
+ var form;
+ if ((form = this.gui_objects.editform) && form.elements['_folder_name'])
+ {
+ name = form.elements['_folder_name'].value;
+
+ if (name.indexOf(this.env.delimiter)>=0)
+ {
+ alert(this.get_label('forbiddencharacter')+' ('+this.env.delimiter+')');
+ return false;
+ }
+
+ if (this.env.folder && name != '')
+ name = this.env.folder+this.env.delimiter+name;
+
+ this.set_busy(true, 'foldercreating');
+ this.http_post('create-folder', '_name='+urlencode(name), true);
+ }
+ else if (form.elements['_folder_name'])
+ form.elements['_folder_name'].focus();
+ };
+
+ // start renaming the mailbox name.
+ // this will replace the name string with an input field
+ this.rename_folder = function(id)
+ {
+ var temp, row, form;
+
+ // reset current renaming
+ if (temp = this.edit_folder)
+ {
+ this.reset_folder_rename();
+ if (temp == id)
+ return;
+ }
+
+ if (id && this.env.subscriptionrows[id] && (row = document.getElementById(id)))
+ {
+ var reg = new RegExp('.*['+RegExp.escape(this.env.delimiter)+']');
+ this.name_input = document.createElement('INPUT');
+ this.name_input.value = this.env.subscriptionrows[id][0].replace(reg, '');
+ this.name_input.style.width = '100%';
+
+ reg = new RegExp('['+RegExp.escape(this.env.delimiter)+']?[^'+RegExp.escape(this.env.delimiter)+']+$');
+ this.name_input.__parent = this.env.subscriptionrows[id][0].replace(reg, '');
+ this.name_input.onkeypress = function(e){ rcmail.name_input_keypress(e); };
+
+ row.cells[0].replaceChild(this.name_input, row.cells[0].firstChild);
+ this.edit_folder = id;
+ this.name_input.select();
+
+ if (form = this.gui_objects.editform)
+ form.onsubmit = function(){ return false; };
+ }
+ };
+
+ // remove the input field and write the current mailbox name to the table cell
+ this.reset_folder_rename = function()
+ {
+ var cell = this.name_input ? this.name_input.parentNode : null;
+
+ if (cell && this.edit_folder && this.env.subscriptionrows[this.edit_folder])
+ cell.innerHTML = this.env.subscriptionrows[this.edit_folder][1];
+
+ this.edit_folder = null;
+ };
+
+ // handler for keyboard events on the input field
+ this.name_input_keypress = function(e)
+ {
+ var key = rcube_event.get_keycode(e);
+
+ // enter
+ if (key==13)
+ {
+ var newname = this.name_input ? this.name_input.value : null;
+ if (this.edit_folder && newname)
+ {
+ if (newname.indexOf(this.env.delimiter)>=0)
+ {
+ alert(this.get_label('forbiddencharacter')+' ('+this.env.delimiter+')');
+ return false;
+ }
+
+ if (this.name_input.__parent)
+ newname = this.name_input.__parent + this.env.delimiter + newname;
+
+ this.set_busy(true, 'folderrenaming');
+ this.http_post('rename-folder', '_folder_oldname='+urlencode(this.env.subscriptionrows[this.edit_folder][0])+'&_folder_newname='+urlencode(newname), true);
+ }
+ }
+ // escape
+ else if (key==27)
+ this.reset_folder_rename();
+ };
+
+ // delete a specific mailbox with all its messages
+ this.delete_folder = function(id)
+ {
+ var folder = this.env.subscriptionrows[id][0];
+
+ if (this.edit_folder)
+ this.reset_folder_rename();
+
+ if (folder && confirm(this.get_label('deletefolderconfirm')))
+ {
+ this.set_busy(true, 'folderdeleting');
+ this.http_post('delete-folder', '_mboxes='+urlencode(folder), true);
+ this.set_env('folder', null);
+
+ if (this.gui_objects.createfolderhint)
+ this.gui_objects.createfolderhint.innerHTML = '';
+ }
+ };
+
+ // add a new folder to the subscription list by cloning a folder row
+ this.add_folder_row = function(name, display_name, replace, before)
+ {
+ if (!this.gui_objects.subscriptionlist)
+ return false;
+
+ // find not protected folder
+ for (var refid in this.env.subscriptionrows)
+ if (this.env.subscriptionrows[refid]!=null && !this.env.subscriptionrows[refid][2])
+ break;
+
+ var refrow, form;
+ var tbody = this.gui_objects.subscriptionlist.tBodies[0];
+ var id = 'rcmrow'+(tbody.childNodes.length+1);
+ var selection = this.subscription_list.get_single_selection();
+
+ if (replace && replace.id)
+ {
+ id = replace.id;
+ refid = replace.id;
+ }
+
+ if (!id || !(refrow = document.getElementById(refid)))
+ {
+ // Refresh page if we don't have a table row to clone
+ this.goto_url('folders');
+ }
+ else
+ {
+ // clone a table row if there are existing rows
+ var row = this.clone_table_row(refrow);
+ row.id = id;
+
+ if (before && (before = this.get_folder_row_id(before)))
+ tbody.insertBefore(row, document.getElementById(before));
+ else
+ tbody.appendChild(row);
+
+ if (replace)
+ tbody.removeChild(replace);
+ }
+
+ // add to folder/row-ID map
+ this.env.subscriptionrows[row.id] = [name, display_name, 0];
+
+ // set folder name
+ row.cells[0].innerHTML = display_name;
+
+ // set messages count to zero
+ if (!replace)
+ row.cells[1].innerHTML = '*';
+
+ if (!replace && row.cells[2] && row.cells[2].firstChild.tagName=='INPUT')
+ {
+ row.cells[2].firstChild.value = name;
+ row.cells[2].firstChild.checked = true;
+ }
+
+ // add new folder to rename-folder list and clear input field
+ if (!replace && (form = this.gui_objects.editform))
+ {
+ if (form.elements['_folder_oldname'])
+ form.elements['_folder_oldname'].options[form.elements['_folder_oldname'].options.length] = new Option(name,name);
+ if (form.elements['_folder_name'])
+ form.elements['_folder_name'].value = '';
+ }
+
+ this.init_subscription_list();
+ if (selection && document.getElementById('rcmrow'+selection))
+ this.subscription_list.select_row(selection);
+
+ if (document.getElementById(id).scrollIntoView)
+ document.getElementById(id).scrollIntoView();
+ };
+
+ // replace an existing table row with a new folder line
+ this.replace_folder_row = function(oldfolder, newfolder, display_name, before)
+ {
+ var id = this.get_folder_row_id(oldfolder);
+ var row = document.getElementById(id);
+
+ // replace an existing table row (if found)
+ this.add_folder_row(newfolder, display_name, row, before);
+
+ // rename folder in rename-folder dropdown
+ var form, elm;
+ if ((form = this.gui_objects.editform) && (elm = form.elements['_folder_oldname']))
+ {
+ for (var i=0;i<elm.options.length;i++)
+ {
+ if (elm.options[i].value == oldfolder)
+ {
+ elm.options[i].text = display_name;
+ elm.options[i].value = newfolder;
+ break;
+ }
+ }
+
+ form.elements['_folder_newname'].value = '';
+ }
+ };
+
+ // remove the table row of a specific mailbox from the table
+ // (the row will not be removed, just hidden)
+ this.remove_folder_row = function(folder)
+ {
+ var row;
+ var id = this.get_folder_row_id(folder);
+ if (id && (row = document.getElementById(id)))
+ row.style.display = 'none';
+
+ // remove folder from rename-folder list
+ var form;
+ if ((form = this.gui_objects.editform) && form.elements['_folder_oldname'])
+ {
+ for (var i=0;i<form.elements['_folder_oldname'].options.length;i++)
+ {
+ if (form.elements['_folder_oldname'].options[i].value == folder)
+ {
+ form.elements['_folder_oldname'].options[i] = null;
+ break;
+ }
+ }
+ }
+
+ if (form && form.elements['_folder_newname'])
+ form.elements['_folder_newname'].value = '';
+ };
+
+ this.subscribe_folder = function(folder)
+ {
+ if (folder)
+ this.http_post('subscribe', '_mbox='+urlencode(folder));
+ };
+
+ this.unsubscribe_folder = function(folder)
+ {
+ if (folder)
+ this.http_post('unsubscribe', '_mbox='+urlencode(folder));
+ };
+
+ // helper method to find a specific mailbox row ID
+ this.get_folder_row_id = function(folder)
+ {
+ for (var id in this.env.subscriptionrows)
+ if (this.env.subscriptionrows[id] && this.env.subscriptionrows[id][0] == folder)
+ break;
+
+ return id;
+ };
+
+ // duplicate a specific table row
+ this.clone_table_row = function(row)
+ {
+ var cell, td;
+ var new_row = document.createElement('TR');
+ for(var n=0; n<row.cells.length; n++)
+ {
+ cell = row.cells[n];
+ td = document.createElement('TD');
+
+ if (cell.className)
+ td.className = cell.className;
+ if (cell.align)
+ td.setAttribute('align', cell.align);
+
+ td.innerHTML = cell.innerHTML;
+ new_row.appendChild(td);
+ }
+
+ return new_row;
+ };
+
+
+ /*********************************************************/
+ /********* GUI functionality *********/
+ /*********************************************************/
+
+ // eable/disable buttons for page shifting
+ this.set_page_buttons = function()
+ {
+ this.enable_command('nextpage', (this.env.pagecount > this.env.current_page));
+ this.enable_command('lastpage', (this.env.pagecount > this.env.current_page));
+ this.enable_command('previouspage', (this.env.current_page > 1));
+ this.enable_command('firstpage', (this.env.current_page > 1));
+ }
+
+ // set button to a specific state
+ this.set_button = function(command, state)
+ {
+ var a_buttons = this.buttons[command];
+ var button, obj;
+
+ if(!a_buttons || !a_buttons.length)
+ return false;
+
+ for(var n=0; n<a_buttons.length; n++)
+ {
+ button = a_buttons[n];
+ obj = document.getElementById(button.id);
+
+ // get default/passive setting of the button
+ if (obj && button.type=='image' && !button.status) {
+ button.pas = obj._original_src ? obj._original_src : obj.src;
+ // respect PNG fix on IE browsers
+ if (obj.runtimeStyle && obj.runtimeStyle.filter && obj.runtimeStyle.filter.match(/src=['"]([^'"]+)['"]/))
+ button.pas = RegExp.$1;
+ }
+ else if (obj && !button.status)
+ button.pas = String(obj.className);
+
+ // set image according to button state
+ if (obj && button.type=='image' && button[state])
+ {
+ button.status = state;
+ obj.src = button[state];
+ }
+ // set class name according to button state
+ else if (obj && typeof(button[state])!='undefined')
+ {
+ button.status = state;
+ obj.className = button[state];
+ }
+ // disable/enable input buttons
+ if (obj && button.type=='input')
+ {
+ button.status = state;
+ obj.disabled = !state;
+ }
+ }
+ };
+
+ // display a specific alttext
+ this.set_alttext = function(command, label)
+ {
+ if (!this.buttons[command] || !this.buttons[command].length)
+ return;
+
+ var button, obj, link;
+ for (var n=0; n<this.buttons[command].length; n++)
+ {
+ button = this.buttons[command][n];
+ obj = document.getElementById(button.id);
+
+ if (button.type=='image' && obj)
+ {
+ obj.setAttribute('alt', this.get_label(label));
+ if ((link = obj.parentNode) && link.tagName == 'A')
+ link.setAttribute('title', this.get_label(label));
+ }
+ else if (obj)
+ obj.setAttribute('title', this.get_label(label));
+ }
+ };
+
+ // mouse over button
+ this.button_over = function(command, id)
+ {
+ var a_buttons = this.buttons[command];
+ var button, img;
+
+ if(!a_buttons || !a_buttons.length)
+ return false;
+
+ for(var n=0; n<a_buttons.length; n++)
+ {
+ button = a_buttons[n];
+ if(button.id==id && button.status=='act')
+ {
+ img = document.getElementById(button.id);
+ if (img && button.over)
+ img.src = button.over;
+ }
+ }
+
+ };
+
+ // mouse down on button
+ this.button_sel = function(command, id)
+ {
+ var a_buttons = this.buttons[command];
+ var button, img;
+
+ if(!a_buttons || !a_buttons.length)
+ return;
+
+ for(var n=0; n<a_buttons.length; n++)
+ {
+ button = a_buttons[n];
+ if(button.id==id && button.status=='act')
+ {
+ img = document.getElementById(button.id);
+ if (img && button.sel)
+ img.src = button.sel;
+ }
+ }
+ };
+
+ // mouse out of button
+ this.button_out = function(command, id)
+ {
+ var a_buttons = this.buttons[command];
+ var button, img;
+
+ if(!a_buttons || !a_buttons.length)
+ return;
+
+ for(var n=0; n<a_buttons.length; n++)
+ {
+ button = a_buttons[n];
+ if(button.id==id && button.status=='act')
+ {
+ img = document.getElementById(button.id);
+ if (img && button.act)
+ img.src = button.act;
+ }
+ }
+ };
+
+ // set/unset a specific class name
+ this.set_classname = function(obj, classname, set)
+ {
+ var reg = new RegExp('\s*'+classname, 'i');
+ if (!set && obj.className.match(reg))
+ obj.className = obj.className.replace(reg, '');
+ else if (set && !obj.className.match(reg))
+ obj.className += ' '+classname;
+ };
+
+ // write to the document/window title
+ this.set_pagetitle = function(title)
+ {
+ if (title && document.title)
+ document.title = title;
+ }
+
+ // display a system message
+ this.display_message = function(msg, type, hold)
+ {
+ if (!this.loaded) // save message in order to display after page loaded
+ {
+ this.pending_message = new Array(msg, type);
+ return true;
+ }
+
+ // pass command to parent window
+ if (this.env.framed && parent.rcmail)
+ return parent.rcmail.display_message(msg, type, hold);
+
+ if (!this.gui_objects.message)
+ return false;
+
+ if (this.message_timer)
+ clearTimeout(this.message_timer);
+
+ var cont = msg;
+ if (type)
+ cont = '<div class="'+type+'">'+cont+'</div>';
+
+ var _rcube = this;
+ this.gui_objects.message.innerHTML = cont;
+ this.gui_objects.message.style.display = 'block';
+
+ if (type!='loading')
+ this.gui_objects.message.onmousedown = function(){ _rcube.hide_message(); return true; };
+
+ if (!hold)
+ this.message_timer = window.setTimeout(function(){ ref.hide_message(); }, this.message_time);
+ };
+
+ // make a message row disapear
+ this.hide_message = function()
+ {
+ if (this.gui_objects.message)
+ {
+ this.gui_objects.message.style.display = 'none';
+ this.gui_objects.message.onmousedown = null;
+ }
+ };
+
+ // mark a mailbox as selected and set environment variable
+ this.select_folder = function(name, old)
+ {
+ if (this.gui_objects.folderlist)
+ {
+ var current_li, target_li;
+
+ if ((current_li = this.get_folder_li(old)))
+ {
+ this.set_classname(current_li, 'selected', false);
+ this.set_classname(current_li, 'unfocused', false);
+ }
+
+ if ((target_li = this.get_folder_li(name)))
+ {
+ this.set_classname(target_li, 'unfocused', false);
+ this.set_classname(target_li, 'selected', true);
+ }
+ }
+ };
+
+ // helper method to find a folder list item
+ this.get_folder_li = function(name)
+ {
+ if (this.gui_objects.folderlist)
+ {
+ name = String(name).replace(this.identifier_expr, '');
+ return document.getElementById('rcmli'+name);
+ }
+
+ return null;
+ };
+
+ // for reordering column array, Konqueror workaround
+ this.set_message_coltypes = function(coltypes)
+ {
+ this.coltypes = coltypes;
+
+ // set correct list titles
+ var cell, col;
+ var thead = this.gui_objects.messagelist ? this.gui_objects.messagelist.tHead : null;
+ for (var n=0; thead && n<this.coltypes.length; n++)
+ {
+ col = this.coltypes[n];
+ if ((cell = thead.rows[0].cells[n+1]) && (col=='from' || col=='to'))
+ {
+ // if we have links for sorting, it's a bit more complicated...
+ if (cell.firstChild && cell.firstChild.tagName=='A')
+ {
+ cell.firstChild.innerHTML = this.get_label(this.coltypes[n]);
+ cell.firstChild.onclick = function(){ return rcmail.command('sort', this.__col, this); };
+ cell.firstChild.__col = col;
+ }
+ else
+ cell.innerHTML = this.get_label(this.coltypes[n]);
+
+ cell.id = 'rcm'+col;
+ }
+ else if (col == 'subject' && this.message_list)
+ this.message_list.subject_col = n+1;
+ }
+ };
+
+ // create a table row in the message list
+ this.add_message_row = function(uid, cols, flags, attachment, attop)
+ {
+ if (!this.gui_objects.messagelist || !this.message_list)
+ return false;
+
+ var tbody = this.gui_objects.messagelist.tBodies[0];
+ var rowcount = tbody.rows.length;
+ var even = rowcount%2;
+
+ this.env.messages[uid] = {deleted:flags.deleted?1:0,
+ replied:flags.replied?1:0,
+ unread:flags.unread?1:0,
+ forwarded:flags.forwarded?1:0,
+ flagged:flags.flagged?1:0};
+
+ var row = document.createElement('TR');
+ row.id = 'rcmrow'+uid;
+ row.className = 'message'
+ + (even ? ' even' : ' odd')
+ + (flags.unread ? ' unread' : '')
+ + (flags.deleted ? ' deleted' : '')
+ + (flags.flagged ? ' flagged' : '');
+
+ if (this.message_list.in_selection(uid))
+ row.className += ' selected';
+
+ var icon = this.env.messageicon;
+ if (flags.deleted && this.env.deletedicon)
+ icon = this.env.deletedicon;
+ else if (flags.replied && this.env.repliedicon)
+ {
+ if (flags.forwarded && this.env.forwardedrepliedicon)
+ icon = this.env.forwardedrepliedicon;
+ else
+ icon = this.env.repliedicon;
+ }
+ else if (flags.forwarded && this.env.forwardedicon)
+ icon = this.env.forwardedicon;
+ else if(flags.unread && this.env.unreadicon)
+ icon = this.env.unreadicon;
+
+ var col = document.createElement('TD');
+ col.className = 'icon';
+ col.innerHTML = icon ? '<img src="'+icon+'" alt="" />' : '';
+ row.appendChild(col);
+
+ // add each submitted col
+ for (var n = 0; n < this.coltypes.length; n++)
+ {
+ var c = this.coltypes[n];
+ col = document.createElement('TD');
+ col.className = String(c).toLowerCase();
+
+ if (c=='flag')
+ {
+ if (flags.flagged && this.env.flaggedicon)
+ col.innerHTML = '<img src="'+this.env.flaggedicon+'" alt="" />';
+ else if(!flags.flagged && this.env.unflaggedicon)
+ col.innerHTML = '<img src="'+this.env.unflaggedicon+'" alt="" />';
+ }
+ else if (c=='attachment')
+ col.innerHTML = attachment && this.env.attachmenticon ? '<img src="'+this.env.attachmenticon+'" alt="" />' : ' ';
+ else
+ col.innerHTML = cols[c];
+
+ row.appendChild(col);
+ }
+
+ this.message_list.insert_row(row, attop);
+
+ // remove 'old' row
+ if (attop && this.env.pagesize && this.message_list.rowcount > this.env.pagesize)
+ {
+ var uid = this.message_list.get_last_row();
+ this.message_list.remove_row(uid);
+ this.message_list.clear_selection(uid);
+ }
+ };
+
+ // replace content of row count display
+ this.set_rowcount = function(text)
+ {
+ if (this.gui_objects.countdisplay)
+ this.gui_objects.countdisplay.innerHTML = text;
+
+ // update page navigation buttons
+ this.set_page_buttons();
+ };
+
+ // replace content of mailboxname display
+ this.set_mailboxname = function(content)
+ {
+ if (this.gui_objects.mailboxname && content)
+ this.gui_objects.mailboxname.innerHTML = content;
+ };
+
+ // replace content of quota display
+ this.set_quota = function(content)
+ {
+ if (this.gui_objects.quotadisplay && content)
+ this.gui_objects.quotadisplay.innerHTML = content;
+ };
+
+ // update the mailboxlist
+ this.set_unread_count = function(mbox, count, set_title)
+ {
+ if (!this.gui_objects.mailboxlist)
+ return false;
+
+ this.env.unread_counts[mbox] = count;
+ this.set_unread_count_display(mbox, set_title);
+ }
+
+ // update the mailbox count display
+ this.set_unread_count_display = function(mbox, set_title)
+ {
+ var reg, text_obj, item, mycount, childcount, div;
+ if (item = this.get_folder_li(mbox))
+ {
+ mycount = this.env.unread_counts[mbox] ? this.env.unread_counts[mbox] : 0;
+ text_obj = item.getElementsByTagName('a')[0];
+ reg = /\s+\([0-9]+\)$/i;
+
+ childcount = 0;
+ if ((div = item.getElementsByTagName('div')[0]) &&
+ div.className.match(/collapsed/))
+ {
+ // add children's counters
+ for (var k in this.env.unread_counts)
+ if (k.indexOf(mbox + this.env.delimiter) == 0) {
+ childcount += this.env.unread_counts[k];
+ }
+ }
+
+ if (mycount && text_obj.innerHTML.match(reg))
+ text_obj.innerHTML = text_obj.innerHTML.replace(reg, ' ('+mycount+')');
+ else if (mycount)
+ text_obj.innerHTML += ' ('+mycount+')';
+ else
+ text_obj.innerHTML = text_obj.innerHTML.replace(reg, '');
+
+ // set parent's display
+ reg = new RegExp(RegExp.escape(this.env.delimiter) + '[^' + RegExp.escape(this.env.delimiter) + ']+$');
+ if (mbox.match(reg))
+ this.set_unread_count_display(mbox.replace(reg, ''), false);
+
+ // set the right classes
+ this.set_classname(item, 'unread', (mycount+childcount)>0 ? true : false);
+ }
+
+ // set unread count to window title
+ reg = /^\([0-9]+\)\s+/i;
+ if (set_title && document.title)
+ {
+ var doc_title = String(document.title);
+ var new_title = "";
+
+ if (mycount && doc_title.match(reg))
+ new_title = doc_title.replace(reg, '('+mycount+') ');
+ else if (mycount)
+ new_title = '('+mycount+') '+doc_title;
+ else
+ new_title = doc_title.replace(reg, '');
+
+ this.set_pagetitle(new_title);
+ }
+ };
+
+ // notifies that a new message(s) has hit the mailbox
+ this.new_message_focus = function()
+ {
+ // focus main window
+ if (this.env.framed && window.parent)
+ window.parent.focus();
+ else
+ window.focus();
+ }
+
+ // add row to contacts list
+ this.add_contact_row = function(cid, cols, select)
+ {
+ if (!this.gui_objects.contactslist || !this.gui_objects.contactslist.tBodies[0])
+ return false;
+
+ var tbody = this.gui_objects.contactslist.tBodies[0];
+ var rowcount = tbody.rows.length;
+ var even = rowcount%2;
+
+ var row = document.createElement('TR');
+ row.id = 'rcmrow'+cid;
+ row.className = 'contact '+(even ? 'even' : 'odd');
+
+ if (this.contact_list.in_selection(cid))
+ row.className += ' selected';
+
+ // add each submitted col
+ for (var c in cols)
+ {
+ col = document.createElement('TD');
+ col.className = String(c).toLowerCase();
+ col.innerHTML = cols[c];
+ row.appendChild(col);
+ }
+
+ this.contact_list.insert_row(row);
+ this.enable_command('export', (this.contact_list.rowcount > 0));
+ };
+
+ this.toggle_prefer_html = function(checkbox)
+ {
+ var addrbook_show_images;
+ if (addrbook_show_images = document.getElementById('rcmfd_addrbook_show_images'))
+ addrbook_show_images.disabled = !checkbox.checked;
+ }
+
+ // display fetched raw headers
+ this.set_headers = function(content)
+ {
+ if (this.gui_objects.all_headers_row && this.gui_objects.all_headers_box && content)
+ {
+ var box = this.gui_objects.all_headers_box;
+ box.innerHTML = content;
+ box.style.display = 'block';
+
+ if (this.env.framed && parent.rcmail)
+ parent.rcmail.set_busy(false);
+ else
+ this.set_busy(false);
+ }
+ };
+
+ // display all-headers row and fetch raw message headers
+ this.load_headers = function(elem)
+ {
+ if (!this.gui_objects.all_headers_row || !this.gui_objects.all_headers_box || !this.env.uid)
+ return;
+
+ this.set_classname(elem, 'show-headers', false);
+ this.set_classname(elem, 'hide-headers', true);
+ this.gui_objects.all_headers_row.style.display = bw.ie ? 'block' : 'table-row';
+ elem.onclick = function() { rcmail.hide_headers(elem); }
+
+ // fetch headers only once
+ if (!this.gui_objects.all_headers_box.innerHTML)
+ {
+ this.display_message(this.get_label('loading'), 'loading', true);
+ this.http_post('headers', '_uid='+this.env.uid);
+ }
+ }
+
+ // hide all-headers row
+ this.hide_headers = function(elem)
+ {
+ if (!this.gui_objects.all_headers_row || !this.gui_objects.all_headers_box)
+ return;
+
+ this.set_classname(elem, 'hide-headers', false);
+ this.set_classname(elem, 'show-headers', true);
+ this.gui_objects.all_headers_row.style.display = 'none';
+ elem.onclick = function() { rcmail.load_headers(elem); }
+ }
+
+
+ /********************************************************/
+ /********* html to text conversion functions *********/
+ /********************************************************/
+
+ this.html2plain = function(htmlText, id)
+ {
+ var http_request = new rcube_http_request();
+ var url = this.env.bin_path+'html2text.php';
+ var rcmail = this;
+
+ this.set_busy(true, 'converting');
+ console.log('HTTP POST: '+url);
+
+ http_request.onerror = function(o) { rcmail.http_error(o); };
+ http_request.oncomplete = function(o) { rcmail.set_text_value(o, id); };
+ http_request.POST(url, htmlText, 'application/octet-stream');
+ }
+
+ this.set_text_value = function(httpRequest, id)
+ {
+ this.set_busy(false);
+ document.getElementById(id).value = httpRequest.get_text();
+ console.log(httpRequest.get_text());
+ }
+
+
+ /********************************************************/
+ /********* remote request methods *********/
+ /********************************************************/
+
+ this.redirect = function(url, lock)
+ {
+ if (lock || lock === null)
+ this.set_busy(true);
+
+ if (this.env.framed && window.parent)
+ parent.location.href = url;
+ else
+ location.href = url;
+ };
+
+ this.goto_url = function(action, query, lock)
+ {
+ var querystring = query ? '&'+query : '';
+ this.redirect(this.env.comm_path+'&_action='+action+querystring, lock);
+ };
+
+ this.http_sockets = new Array();
+
+ // find a non-busy socket or create a new one
+ this.get_request_obj = function()
+ {
+ for (var n=0; n<this.http_sockets.length; n++)
+ {
+ if (!this.http_sockets[n].busy)
+ return this.http_sockets[n];
+ }
+
+ // create a new XMLHTTP object
+ var i = this.http_sockets.length;
+ this.http_sockets[i] = new rcube_http_request();
+
+ return this.http_sockets[i];
+ };
+
+ // send a http request to the server
+ this.http_request = function(action, querystring, lock)
+ {
+ var request_obj = this.get_request_obj();
+ querystring += (querystring ? '&' : '') + '_remote=1';
+
+ // add timestamp to request url to avoid cacheing problems in Safari
+ if (bw.safari)
+ querystring += '&_ts='+(new Date().getTime());
+
+ // send request
+ if (request_obj)
+ {
+ console.log('HTTP request: '+this.env.comm_path+'&_action='+action+'&'+querystring);
+
+ if (lock)
+ this.set_busy(true);
+
+ var rcm = this;
+ request_obj.__lock = lock ? true : false;
+ request_obj.__action = action;
+ request_obj.onerror = function(o){ ref.http_error(o); };
+ request_obj.oncomplete = function(o){ ref.http_response(o); };
+ request_obj.GET(this.env.comm_path+'&_action='+action+'&'+querystring);
+ }
+ };
+
+ // send a http POST request to the server
+ this.http_post = function(action, postdata, lock)
+ {
+ var request_obj;
+ if (postdata && typeof(postdata) == 'object')
+ postdata._remote = 1;
+ else
+ postdata += (postdata ? '&' : '') + '_remote=1';
+
+ // send request
+ if (request_obj = this.get_request_obj())
+ {
+ console.log('HTTP POST: '+this.env.comm_path+'&_action='+action);
+
+ if (lock)
+ this.set_busy(true);
+
+ var rcm = this;
+ request_obj.__lock = lock ? true : false;
+ request_obj.__action = action;
+ request_obj.onerror = function(o){ rcm.http_error(o); };
+ request_obj.oncomplete = function(o){ rcm.http_response(o); };
+ request_obj.POST(this.env.comm_path+'&_action='+action, postdata);
+ }
+ };
+
+ // handle HTTP response
+ this.http_response = function(request_obj)
+ {
+ var ctype = request_obj.get_header('Content-Type');
+ if (ctype)
+ {
+ ctype = String(ctype).toLowerCase();
+ var ctype_array=ctype.split(";");
+ ctype = ctype_array[0];
+ }
+
+ if (request_obj.__lock)
+ this.set_busy(false);
+
+ console.log(request_obj.get_text());
+
+ // if we get javascript code from server -> execute it
+ if (request_obj.get_text() && (ctype=='text/javascript' || ctype=='application/x-javascript'))
+ eval(request_obj.get_text());
+
+ // process the response data according to the sent action
+ switch (request_obj.__action) {
+ case 'delete':
+ if (this.task == 'addressbook') {
+ var uid = this.contact_list.get_selection();
+ this.enable_command('compose', (uid && this.contact_list.rows[uid]));
+ this.enable_command('delete', 'edit', (uid && this.contact_list.rows[uid] && this.env.address_sources && !this.env.address_sources[this.env.source].readonly));
+ this.enable_command('export', (this.contact_list && this.contact_list.rowcount > 0));
+ }
+
+ case 'moveto':
+ if (this.env.action == 'show')
+ this.command('list');
+ else if (this.message_list)
+ this.message_list.init();
+ break;
+
+ case 'purge':
+ case 'expunge':
+ if (!this.env.messagecount && this.task == 'mail') {
+ // clear preview pane content
+ if (this.env.contentframe)
+ this.show_contentframe(false);
+ // disable commands useless when mailbox is empty
+ this.enable_command('show', 'reply', 'reply-all', 'forward', 'moveto', 'delete', 'mark', 'viewsource',
+ 'print', 'load-attachment', 'purge', 'expunge', 'select-all', 'select-none', 'sort', false);
+ }
+ break;
+
+ case 'check-recent':
+ case 'getunread':
+ case 'list':
+ if (this.task == 'mail') {
+ if (this.message_list && request_obj.__action == 'list')
+ this.msglist_select(this.message_list);
+ this.enable_command('show', 'expunge', 'select-all', 'select-none', 'sort', (this.env.messagecount > 0));
+ this.enable_command('purge', this.purge_mailbox_test());
+ }
+ else if (this.task == 'addressbook')
+ this.enable_command('export', (this.contact_list && this.contact_list.rowcount > 0));
+
+ break;
+ }
+
+ request_obj.reset();
+ };
+
+ // handle HTTP request errors
+ this.http_error = function(request_obj)
+ {
+ //alert('Error sending request: '+request_obj.url+' => HTTP '+request_obj.xmlhttp.status);
+ if (request_obj.__lock)
+ this.set_busy(false);
+
+ request_obj.reset();
+ request_obj.__lock = false;
+ this.display_message('Unknown Server Error!', 'error');
+ };
+
+ // use an image to send a keep-alive siganl to the server
+ this.send_keep_alive = function()
+ {
+ var d = new Date();
+ this.http_request('keep-alive', '_t='+d.getTime());
+ };
+
+ // send periodic request to check for recent messages
+ this.check_for_recent = function(setbusy)
+ {
+ if (this.busy)
+ return;
+
+ if (setbusy)
+ this.set_busy(true, 'checkingmail');
+
+ var addurl = '_t=' + (new Date().getTime());
+
+ if (this.gui_objects.messagelist)
+ addurl += '&_list=1';
+ if (this.gui_objects.quotadisplay)
+ addurl += '&_quota=1';
+ if (this.env.search_request)
+ addurl += '&_search=' + this.env.search_request;
+
+ this.http_request('check-recent', addurl, true);
+ };
+
+
+ /********************************************************/
+ /********* helper methods *********/
+ /********************************************************/
+
+ // check if we're in show mode or if we have a unique selection
+ // and return the message uid
+ this.get_single_uid = function()
+ {
+ return this.env.uid ? this.env.uid : (this.message_list ? this.message_list.get_single_selection() : null);
+ };
+
+ // same as above but for contacts
+ this.get_single_cid = function()
+ {
+ return this.env.cid ? this.env.cid : (this.contact_list ? this.contact_list.get_single_selection() : null);
+ };
+
+
+ this.get_caret_pos = function(obj)
+ {
+ if (typeof(obj.selectionEnd)!='undefined')
+ return obj.selectionEnd;
+ else if (document.selection && document.selection.createRange)
+ {
+ var range = document.selection.createRange();
+ if (range.parentElement()!=obj)
+ return 0;
+
+ var gm = range.duplicate();
+ if (obj.tagName=='TEXTAREA')
+ gm.moveToElementText(obj);
+ else
+ gm.expand('textedit');
+
+ gm.setEndPoint('EndToStart', range);
+ var p = gm.text.length;
+
+ return p<=obj.value.length ? p : -1;
+ }
+ else
+ return obj.value.length;
+ };
+
+ this.set_caret2start = function(obj)
+ {
+ if (obj.createTextRange)
+ {
+ var range = obj.createTextRange();
+ range.collapse(true);
+ range.select();
+ }
+ else if (obj.setSelectionRange)
+ obj.setSelectionRange(0,0);
+
+ obj.focus();
+ };
+
+ // set all fields of a form disabled
+ this.lock_form = function(form, lock)
+ {
+ if (!form || !form.elements)
+ return;
+
+ var type;
+ for (var n=0; n<form.elements.length; n++)
+ {
+ type = form.elements[n];
+ if (type=='hidden')
+ continue;
+
+ form.elements[n].disabled = lock;
+ }
+ };
+
+ } // end object rcube_webmail
+
+
+/**
+ * Class for sending HTTP requests
+ * @constructor
+ */
+function rcube_http_request()
+ {
+ this.url = '';
+ this.busy = false;
+ this.xmlhttp = null;
+
+ // reset object properties
+ this.reset = function()
+ {
+ // set unassigned event handlers
+ this.onloading = function(){ };
+ this.onloaded = function(){ };
+ this.oninteractive = function(){ };
+ this.oncomplete = function(){ };
+ this.onabort = function(){ };
+ this.onerror = function(){ };
+
+ this.url = '';
+ this.busy = false;
+ this.xmlhttp = null;
+ }
+
+ // create HTMLHTTP object
+ this.build = function()
+ {
+ if (window.XMLHttpRequest)
+ this.xmlhttp = new XMLHttpRequest();
+ else if (window.ActiveXObject)
+ {
+ try { this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); }
+ catch(e) { this.xmlhttp = null; }
+ }
+ else
+ {
+
+ }
+ }
+
+ // send GET request
+ this.GET = function(url)
+ {
+ this.build();
+
+ if (!this.xmlhttp)
+ {
+ this.onerror(this);
+ return false;
+ }
+
+ var _ref = this;
+ this.url = url;
+ this.busy = true;
+
+ this.xmlhttp.onreadystatechange = function(){ _ref.xmlhttp_onreadystatechange(); };
+ this.xmlhttp.open('GET', url, true);
+ this.xmlhttp.setRequestHeader('X-RoundCube-Referer', bw.get_cookie('roundcube_sessid'));
+ this.xmlhttp.send(null);
+ };
+
+ this.POST = function(url, body, contentType)
+ {
+ // default value for contentType if not provided
+ if (typeof(contentType) == 'undefined')
+ contentType = 'application/x-www-form-urlencoded';
+
+ this.build();
+
+ if (!this.xmlhttp)
+ {
+ this.onerror(this);
+ return false;
+ }
+
+ var req_body = body;
+ if (typeof(body) == 'object')
+ {
+ req_body = '';
+ for (var p in body)
+ req_body += (req_body ? '&' : '') + p+'='+urlencode(body[p]);
+ }
+
+ var ref = this;
+ this.url = url;
+ this.busy = true;
+
+ this.xmlhttp.onreadystatechange = function() { ref.xmlhttp_onreadystatechange(); };
+ this.xmlhttp.open('POST', url, true);
+ this.xmlhttp.setRequestHeader('Content-Type', contentType);
+ this.xmlhttp.setRequestHeader('X-RoundCube-Referer', bw.get_cookie('roundcube_sessid'));
+ this.xmlhttp.send(req_body);
+ };
+
+ // handle onreadystatechange event
+ this.xmlhttp_onreadystatechange = function()
+ {
+ if(this.xmlhttp.readyState == 1)
+ this.onloading(this);
+
+ else if(this.xmlhttp.readyState == 2)
+ this.onloaded(this);
+
+ else if(this.xmlhttp.readyState == 3)
+ this.oninteractive(this);
+
+ else if(this.xmlhttp.readyState == 4)
+ {
+ try {
+ if (this.xmlhttp.status == 0)
+ this.onabort(this);
+ else if(this.xmlhttp.status == 200)
+ this.oncomplete(this);
+ else
+ this.onerror(this);
+
+ this.busy = false;
+ }
+ catch(err)
+ {
+ this.onerror(this);
+ this.busy = false;
+ }
+ }
+ }
+
+ // getter method for HTTP headers
+ this.get_header = function(name)
+ {
+ return this.xmlhttp.getResponseHeader(name);
+ };
+
+ this.get_text = function()
+ {
+ return this.xmlhttp.responseText;
+ };
+
+ this.get_xml = function()
+ {
+ return this.xmlhttp.responseXML;
+ };
+
+ this.reset();
+
+ } // end class rcube_http_request
+
+// helper function to call the init method with a delay
+function call_init(o)
+ {
+ window.setTimeout('if (window[\''+o+'\'] && window[\''+o+'\'].init) { '+o+'.init(); }',
+ bw.win ? 500 : 200);
+ }
+++ /dev/null
-/*
- +-----------------------------------------------------------------------+
- | RoundCube Webmail Client Script |
- | |
- | This file is part of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev, - Switzerland |
- | Licensed under the GNU GPL |
- | |
- +-----------------------------------------------------------------------+
- | Authors: Thomas Bruederli <roundcube@gmail.com> |
- | Charles McNulty <charles@charlesmcnulty.com> |
- +-----------------------------------------------------------------------+
- | Requires: common.js, list.js |
- +-----------------------------------------------------------------------+
-
- $Id: app.js 2203 2008-12-30 15:22:35Z thomasb $
-*/
-
-
-var rcube_webmail_client;
-
-function rcube_webmail()
- {
- this.env = new Object();
- this.labels = new Object();
- this.buttons = new Object();
- this.gui_objects = new Object();
- this.commands = new Object();
- this.onloads = new Array();
-
- // create protected reference to myself
- rcube_webmail_client = this;
- this.ref = 'rcube_webmail_client';
- var ref = this;
-
- // webmail client settings
- this.dblclick_time = 500;
- this.message_time = 3000;
-
- this.identifier_expr = new RegExp('[^0-9a-z\-_]', 'gi');
-
- // mimetypes supported by the browser (default settings)
- this.mimetypes = new Array('text/plain', 'text/html', 'text/xml',
- 'image/jpeg', 'image/gif', 'image/png',
- 'application/x-javascript', 'application/pdf',
- 'application/x-shockwave-flash');
-
- // default environment vars
- this.env.keep_alive = 60; // seconds
- this.env.request_timeout = 180; // seconds
- this.env.draft_autosave = 0; // seconds
- this.env.comm_path = './';
- this.env.bin_path = './bin/';
- this.env.blankpage = 'program/blank.gif';
-
-
- // set environment variable(s)
- this.set_env = function(p, value)
- {
- if (p != null && typeof(p) == 'object' && !value)
- for (var n in p)
- this.env[n] = p[n];
- else
- this.env[p] = value;
- };
-
- // add a localized label to the client environment
- this.add_label = function(key, value)
- {
- this.labels[key] = value;
- };
-
- // add a button to the button list
- this.register_button = function(command, id, type, act, sel, over)
- {
- if (!this.buttons[command])
- this.buttons[command] = new Array();
-
- var button_prop = {id:id, type:type};
- if (act) button_prop.act = act;
- if (sel) button_prop.sel = sel;
- if (over) button_prop.over = over;
-
- this.buttons[command][this.buttons[command].length] = button_prop;
- };
-
- // register a specific gui object
- this.gui_object = function(name, id)
- {
- this.gui_objects[name] = id;
- };
-
- // execute the given script on load
- this.add_onload = function(f)
- {
- this.onloads[this.onloads.length] = f;
- };
-
- // initialize webmail client
- this.init = function()
- {
- var p = this;
- this.task = this.env.task;
-
- // check browser
- if (!bw.dom || !bw.xmlhttp_test())
- {
- this.goto_url('error', '_code=0x199');
- return;
- }
-
- // find all registered gui objects
- for (var n in this.gui_objects)
- this.gui_objects[n] = rcube_find_object(this.gui_objects[n]);
-
- // tell parent window that this frame is loaded
- if (this.env.framed && parent.rcmail && parent.rcmail.set_busy)
- parent.rcmail.set_busy(false);
-
- // enable general commands
- this.enable_command('logout', 'mail', 'addressbook', 'settings', true);
-
- if (this.env.permaurl)
- this.enable_command('permaurl', true);
-
- switch (this.task)
- {
- case 'mail':
- if (this.gui_objects.messagelist)
- {
- this.message_list = new rcube_list_widget(this.gui_objects.messagelist, {multiselect:true, draggable:true, keyboard:true, dblclick_time:this.dblclick_time});
- this.message_list.row_init = function(o){ p.init_message_row(o); };
- this.message_list.addEventListener('dblclick', function(o){ p.msglist_dbl_click(o); });
- this.message_list.addEventListener('keypress', function(o){ p.msglist_keypress(o); });
- this.message_list.addEventListener('select', function(o){ p.msglist_select(o); });
- this.message_list.addEventListener('dragstart', function(o){ p.drag_start(o); });
- this.message_list.addEventListener('dragmove', function(o, e){ p.drag_move(e); });
- this.message_list.addEventListener('dragend', function(o){ p.drag_active = false; });
-
- this.message_list.init();
- this.enable_command('toggle_status', 'toggle_flag', true);
-
- if (this.gui_objects.mailcontframe)
- {
- this.gui_objects.mailcontframe.onmousedown = function(e){ return p.click_on_list(e); };
- document.onmouseup = function(e){ return p.doc_mouse_up(e); };
- }
- else
- this.message_list.focus();
- }
-
- if (this.env.coltypes)
- this.set_message_coltypes(this.env.coltypes);
-
- // enable mail commands
- this.enable_command('list', 'checkmail', 'compose', 'add-contact', 'search', 'reset-search', 'collapse-folder', true);
-
- if (this.env.search_text != null && document.getElementById('quicksearchbox') != null)
- document.getElementById('quicksearchbox').value = this.env.search_text;
-
- if (this.env.action=='show' || this.env.action=='preview')
- {
- this.enable_command('show', 'reply', 'reply-all', 'forward', 'moveto', 'delete', 'mark', 'viewsource', 'print', 'load-attachment', 'load-headers', true);
- if (this.env.next_uid)
- {
- this.enable_command('nextmessage', true);
- this.enable_command('lastmessage', true);
- }
- if (this.env.prev_uid)
- {
- this.enable_command('previousmessage', true);
- this.enable_command('firstmessage', true);
- }
- }
-
- if (this.env.trash_mailbox && this.env.mailbox != this.env.trash_mailbox)
- this.set_alttext('delete', 'movemessagetotrash');
-
- // make preview/message frame visible
- if (this.env.action == 'preview' && this.env.framed && parent.rcmail)
- {
- this.enable_command('compose', 'add-contact', false);
- parent.rcmail.show_contentframe(true);
- }
-
- if ((this.env.action=='show' || this.env.action=='preview') && this.env.blockedobjects)
- {
- if (this.gui_objects.remoteobjectsmsg)
- this.gui_objects.remoteobjectsmsg.style.display = 'block';
- this.enable_command('load-images', 'always-load', true);
- }
-
- if (this.env.action=='compose')
- {
- this.enable_command('add-attachment', 'send-attachment', 'remove-attachment', 'send', true);
- if (this.env.spellcheck)
- {
- this.env.spellcheck.spelling_state_observer = function(s){ ref.set_spellcheck_state(s); };
- this.set_spellcheck_state('ready');
- if (rcube_find_object('_is_html').value == '1')
- this.display_spellcheck_controls(false);
- }
- if (this.env.drafts_mailbox)
- this.enable_command('savedraft', true);
-
- document.onmouseup = function(e){ return p.doc_mouse_up(e); };
- }
-
- if (this.env.messagecount)
- this.enable_command('select-all', 'select-none', 'expunge', true);
-
- if (this.purge_mailbox_test())
- this.enable_command('purge', true);
-
- this.set_page_buttons();
-
- // init message compose form
- if (this.env.action=='compose')
- this.init_messageform();
-
- // show printing dialog
- if (this.env.action=='print')
- window.print();
-
- // get unread count for each mailbox
- if (this.gui_objects.mailboxlist)
- {
- this.env.unread_counts = {};
- this.gui_objects.folderlist = this.gui_objects.mailboxlist;
- this.http_request('getunread', '');
- }
-
- // ask user to send MDN
- if (this.env.mdn_request && this.env.uid)
- {
- var mdnurl = '_uid='+this.env.uid+'&_mbox='+urlencode(this.env.mailbox);
- if (confirm(this.get_label('mdnrequest')))
- this.http_post('sendmdn', mdnurl);
- else
- this.http_post('mark', mdnurl+'&_flag=mdnsent');
- }
-
- break;
-
-
- case 'addressbook':
- if (this.gui_objects.contactslist)
- {
- this.contact_list = new rcube_list_widget(this.gui_objects.contactslist, {multiselect:true, draggable:true, keyboard:true});
- this.contact_list.addEventListener('keypress', function(o){ p.contactlist_keypress(o); });
- this.contact_list.addEventListener('select', function(o){ p.contactlist_select(o); });
- this.contact_list.addEventListener('dragstart', function(o){ p.drag_start(o); });
- this.contact_list.addEventListener('dragmove', function(o, e){ p.drag_move(e); });
- this.contact_list.addEventListener('dragend', function(o){ p.drag_active = false; });
- this.contact_list.init();
-
- if (this.env.cid)
- this.contact_list.highlight_row(this.env.cid);
-
- if (this.gui_objects.contactslist.parentNode)
- {
- this.gui_objects.contactslist.parentNode.onmousedown = function(e){ return p.click_on_list(e); };
- document.onmouseup = function(e){ return p.doc_mouse_up(e); };
- }
- else
- this.contact_list.focus();
- }
-
- this.set_page_buttons();
-
- if (this.env.address_sources && this.env.address_sources[this.env.source] && !this.env.address_sources[this.env.source].readonly)
- this.enable_command('add', true);
-
- if (this.env.cid)
- this.enable_command('show', 'edit', true);
-
- if ((this.env.action=='add' || this.env.action=='edit') && this.gui_objects.editform)
- this.enable_command('save', true);
- else
- this.enable_command('search', 'reset-search', 'moveto', 'import', true);
-
- if (this.contact_list && this.contact_list.rowcount > 0)
- this.enable_command('export', true);
-
- this.enable_command('list', true);
- break;
-
-
- case 'settings':
- this.enable_command('preferences', 'identities', 'save', 'folders', true);
-
- if (this.env.action=='identities' || this.env.action=='edit-identity' || this.env.action=='add-identity') {
- this.enable_command('add', this.env.identities_level < 2);
- this.enable_command('delete', 'edit', true);
- }
-
- if (this.env.action=='edit-identity' || this.env.action=='add-identity')
- this.enable_command('save', true);
-
- if (this.env.action=='folders')
- this.enable_command('subscribe', 'unsubscribe', 'create-folder', 'rename-folder', 'delete-folder', true);
-
- if (this.gui_objects.identitieslist)
- {
- this.identity_list = new rcube_list_widget(this.gui_objects.identitieslist, {multiselect:false, draggable:false, keyboard:false});
- this.identity_list.addEventListener('select', function(o){ p.identity_select(o); });
- this.identity_list.init();
- this.identity_list.focus();
-
- if (this.env.iid)
- this.identity_list.highlight_row(this.env.iid);
- }
-
- if (this.gui_objects.subscriptionlist)
- this.init_subscription_list();
-
- break;
-
- case 'login':
- var input_user = rcube_find_object('rcmloginuser');
- var input_pass = rcube_find_object('rcmloginpwd');
- var input_tz = rcube_find_object('rcmlogintz');
-
- if (input_user)
- input_user.onkeyup = function(e){ return rcmail.login_user_keyup(e); };
- if (input_user && input_user.value=='')
- input_user.focus();
- else if (input_pass)
- input_pass.focus();
-
- // detect client timezone
- if (input_tz)
- input_tz.value = new Date().getTimezoneOffset() / -60;
-
- this.enable_command('login', true);
- break;
-
- default:
- break;
- }
-
- // enable basic commands
- this.enable_command('logout', true);
-
- // flag object as complete
- this.loaded = true;
-
- // show message
- if (this.pending_message)
- this.display_message(this.pending_message[0], this.pending_message[1]);
-
- // start keep-alive interval
- this.start_keepalive();
-
- // execute all foreign onload scripts
- for (var i=0; i<this.onloads.length; i++)
- {
- if (typeof(this.onloads[i]) == 'string')
- eval(this.onloads[i]);
- else if (typeof(this.onloads[i]) == 'function')
- this.onloads[i]();
- }
- };
-
- // start interval for keep-alive/recent_check signal
- this.start_keepalive = function()
- {
- if (this.env.keep_alive && !this.env.framed && this.task=='mail' && this.gui_objects.mailboxlist)
- this._int = setInterval(function(){ ref.check_for_recent(false); }, this.env.keep_alive * 1000);
- else if (this.env.keep_alive && !this.env.framed && this.task!='login')
- this._int = setInterval(function(){ ref.send_keep_alive(); }, this.env.keep_alive * 1000);
- }
-
- this.init_message_row = function(row)
- {
- var uid = row.uid;
- if (uid && this.env.messages[uid])
- {
- row.deleted = this.env.messages[uid].deleted ? true : false;
- row.unread = this.env.messages[uid].unread ? true : false;
- row.replied = this.env.messages[uid].replied ? true : false;
- row.flagged = this.env.messages[uid].flagged ? true : false;
- row.forwarded = this.env.messages[uid].forwarded ? true : false;
- }
-
- // set eventhandler to message icon
- if ((row.icon = row.obj.cells[0].childNodes[0]) && row.icon.nodeName=='IMG')
- {
- var p = this;
- row.icon.id = 'msgicn_'+row.uid;
- row.icon._row = row.obj;
- row.icon.onmousedown = function(e) { p.command('toggle_status', this); };
- }
-
- // global variable 'flagged_col' may be not defined yet
- if (!this.env.flagged_col && this.env.coltypes)
- {
- var found;
- if((found = find_in_array('flag', this.env.coltypes)) >= 0)
- this.set_env('flagged_col', found+1);
- }
-
- // set eventhandler to flag icon, if icon found
- if (this.env.flagged_col && (row.flagged_icon = row.obj.cells[this.env.flagged_col].childNodes[0])
- && row.flagged_icon.nodeName=='IMG')
- {
- var p = this;
- row.flagged_icon.id = 'flaggedicn_'+row.uid;
- row.flagged_icon._row = row.obj;
- row.flagged_icon.onmousedown = function(e) { p.command('toggle_flag', this); };
- }
- };
-
- // init message compose form: set focus and eventhandlers
- this.init_messageform = function()
- {
- if (!this.gui_objects.messageform)
- return false;
-
- //this.messageform = this.gui_objects.messageform;
- var input_from = rcube_find_object('_from');
- var input_to = rcube_find_object('_to');
- var input_cc = rcube_find_object('_cc');
- var input_bcc = rcube_find_object('_bcc');
- var input_replyto = rcube_find_object('_replyto');
- var input_subject = rcube_find_object('_subject');
- var input_message = rcube_find_object('_message');
- var draftid = rcube_find_object('_draft_saveid');
-
- // init live search events
- if (input_to)
- this.init_address_input_events(input_to);
- if (input_cc)
- this.init_address_input_events(input_cc);
- if (input_bcc)
- this.init_address_input_events(input_bcc);
-
- // add signature according to selected identity
- if (input_from && input_from.type=='select-one' && (!draftid || draftid.value=='')
- // if we have HTML editor, signature is added in callback
- && rcube_find_object('_is_html').value != '1')
- {
- this.change_identity(input_from);
- }
-
- if (input_to && input_to.value=='')
- input_to.focus();
- else if (input_subject && input_subject.value=='')
- input_subject.focus();
- else if (input_message)
- this.set_caret2start(input_message);
-
- // get summary of all field values
- this.compose_field_hash(true);
-
- // start the auto-save timer
- this.auto_save_start();
- };
-
- this.init_address_input_events = function(obj)
- {
- var handler = function(e){ return ref.ksearch_keypress(e,this); };
-
- if (obj.addEventListener)
- obj.addEventListener(bw.safari ? 'keydown' : 'keypress', handler, false);
- else
- obj.onkeydown = handler;
-
- obj.setAttribute('autocomplete', 'off');
- };
-
-
- /*********************************************************/
- /********* client command interface *********/
- /*********************************************************/
-
- // execute a specific command on the web client
- this.command = function(command, props, obj)
- {
- if (obj && obj.blur)
- obj.blur();
-
- if (this.busy)
- return false;
-
- // command not supported or allowed
- if (!this.commands[command])
- {
- // pass command to parent window
- if (this.env.framed && parent.rcmail && parent.rcmail.command)
- parent.rcmail.command(command, props);
-
- return false;
- }
-
- // check input before leaving compose step
- if (this.task=='mail' && this.env.action=='compose' && (command=='list' || command=='mail' || command=='addressbook' || command=='settings'))
- {
- if (this.cmp_hash != this.compose_field_hash() && !confirm(this.get_label('notsentwarning')))
- return false;
- }
-
- // process command
- switch (command)
- {
- case 'login':
- if (this.gui_objects.loginform)
- this.gui_objects.loginform.submit();
- break;
-
- case 'logout':
- this.goto_url('logout', '', true);
- break;
-
- // commands to switch task
- case 'mail':
- case 'addressbook':
- case 'settings':
- this.switch_task(command);
- break;
-
- case 'permaurl':
- if (obj && obj.href && obj.target)
- return true;
- else if (this.env.permaurl)
- parent.location.href = this.env.permaurl;
- break;
-
- // misc list commands
- case 'list':
- if (this.task=='mail')
- {
- if (this.env.search_request<0 || (props != '' && (this.env.search_request && props != this.env.mailbox)))
- this.reset_qsearch();
-
- this.list_mailbox(props);
-
- if (this.env.trash_mailbox)
- this.set_alttext('delete', this.env.mailbox != this.env.trash_mailbox ? 'movemessagetotrash' : 'deletemessage');
- }
- else if (this.task=='addressbook')
- {
- if (this.env.search_request<0 || (this.env.search_request && props != this.env.source))
- this.reset_qsearch();
-
- this.list_contacts(props);
- this.enable_command('add', (this.env.address_sources && !this.env.address_sources[props].readonly));
- }
- break;
-
-
- case 'load-headers':
- this.load_headers(obj);
- break;
-
-
- case 'sort':
- // get the type of sorting
- var a_sort = props.split('_');
- var sort_col = a_sort[0];
- var sort_order = a_sort[1] ? a_sort[1].toUpperCase() : null;
- var header;
-
- // no sort order specified: toggle
- if (sort_order==null)
- {
- if (this.env.sort_col==sort_col)
- sort_order = this.env.sort_order=='ASC' ? 'DESC' : 'ASC';
- else
- sort_order = this.env.sort_order;
- }
-
- if (this.env.sort_col==sort_col && this.env.sort_order==sort_order)
- break;
-
- // set table header class
- if (header = document.getElementById('rcm'+this.env.sort_col))
- this.set_classname(header, 'sorted'+(this.env.sort_order.toUpperCase()), false);
- if (header = document.getElementById('rcm'+sort_col))
- this.set_classname(header, 'sorted'+sort_order, true);
-
- // save new sort properties
- this.env.sort_col = sort_col;
- this.env.sort_order = sort_order;
-
- // reload message list
- this.list_mailbox('', '', sort_col+'_'+sort_order);
- break;
-
- case 'nextpage':
- this.list_page('next');
- break;
-
- case 'lastpage':
- this.list_page('last');
- break;
-
- case 'previouspage':
- this.list_page('prev');
- break;
-
- case 'firstpage':
- this.list_page('first');
- break;
-
- case 'expunge':
- if (this.env.messagecount)
- this.expunge_mailbox(this.env.mailbox);
- break;
-
- case 'purge':
- case 'empty-mailbox':
- if (this.env.messagecount)
- this.purge_mailbox(this.env.mailbox);
- break;
-
-
- // common commands used in multiple tasks
- case 'show':
- if (this.task=='mail')
- {
- var uid = this.get_single_uid();
- if (uid && (!this.env.uid || uid != this.env.uid))
- {
- if (this.env.mailbox == this.env.drafts_mailbox)
- this.goto_url('compose', '_draft_uid='+uid+'&_mbox='+urlencode(this.env.mailbox), true);
- else
- this.show_message(uid);
- }
- }
- else if (this.task=='addressbook')
- {
- var cid = props ? props : this.get_single_cid();
- if (cid && !(this.env.action=='show' && cid==this.env.cid))
- this.load_contact(cid, 'show');
- }
- break;
-
- case 'add':
- if (this.task=='addressbook')
- this.load_contact(0, 'add');
- else if (this.task=='settings')
- {
- this.identity_list.clear_selection();
- this.load_identity(0, 'add-identity');
- }
- break;
-
- case 'edit':
- var cid;
- if (this.task=='addressbook' && (cid = this.get_single_cid()))
- this.load_contact(cid, 'edit');
- else if (this.task=='settings' && props)
- this.load_identity(props, 'edit-identity');
- break;
-
- case 'save-identity':
- case 'save':
- if (this.gui_objects.editform)
- {
- var input_pagesize = rcube_find_object('_pagesize');
- var input_name = rcube_find_object('_name');
- var input_email = rcube_find_object('_email');
-
- // user prefs
- if (input_pagesize && isNaN(parseInt(input_pagesize.value)))
- {
- alert(this.get_label('nopagesizewarning'));
- input_pagesize.focus();
- break;
- }
- // contacts/identities
- else
- {
- if (input_name && input_name.value == '')
- {
- alert(this.get_label('nonamewarning'));
- input_name.focus();
- break;
- }
- else if (input_email && !rcube_check_email(input_email.value))
- {
- alert(this.get_label('noemailwarning'));
- input_email.focus();
- break;
- }
- }
-
- this.gui_objects.editform.submit();
- }
- break;
-
- case 'delete':
- // mail task
- if (this.task=='mail')
- this.delete_messages();
- // addressbook task
- else if (this.task=='addressbook')
- this.delete_contacts();
- // user settings task
- else if (this.task=='settings')
- this.delete_identity();
- break;
-
-
- // mail task commands
- case 'move':
- case 'moveto':
- if (this.task == 'mail')
- this.move_messages(props);
- else if (this.task == 'addressbook' && this.drag_active)
- this.copy_contact(null, props);
- break;
-
- case 'mark':
- if (props)
- this.mark_message(props);
- break;
-
- case 'toggle_status':
- if (props && !props._row)
- break;
-
- var uid;
- var flag = 'read';
-
- if (props._row.uid)
- {
- uid = props._row.uid;
-
- // toggle read/unread
- if (this.message_list.rows[uid].deleted) {
- flag = 'undelete';
- } else if (!this.message_list.rows[uid].unread)
- flag = 'unread';
- }
-
- this.mark_message(flag, uid);
- break;
-
- case 'toggle_flag':
- if (props && !props._row)
- break;
-
- var uid;
- var flag = 'flagged';
-
- if (props._row.uid)
- {
- uid = props._row.uid;
- // toggle flagged/unflagged
- if (this.message_list.rows[uid].flagged)
- flag = 'unflagged';
- }
- this.mark_message(flag, uid);
- break;
-
- case 'always-load':
- if (this.env.uid && this.env.sender) {
- this.add_contact(urlencode(this.env.sender));
- window.setTimeout(function(){ ref.command('load-images'); }, 300);
- break;
- }
-
- case 'load-images':
- if (this.env.uid)
- this.show_message(this.env.uid, true, this.env.action=='preview');
- break;
-
- case 'load-attachment':
- var qstring = '_mbox='+urlencode(this.env.mailbox)+'&_uid='+this.env.uid+'&_part='+props.part;
-
- // open attachment in frame if it's of a supported mimetype
- if (this.env.uid && props.mimetype && find_in_array(props.mimetype, this.mimetypes)>=0)
- {
- if (props.mimetype == 'text/html')
- qstring += '&_safe=1';
- this.attachment_win = window.open(this.env.comm_path+'&_action=get&'+qstring+'&_frame=1', 'rcubemailattachment');
- if (this.attachment_win)
- {
- window.setTimeout(function(){ ref.attachment_win.focus(); }, 10);
- break;
- }
- }
-
- this.goto_url('get', qstring+'&_download=1', false);
- break;
-
- case 'select-all':
- this.message_list.select_all(props);
- break;
-
- case 'select-none':
- this.message_list.clear_selection();
- break;
-
- case 'nextmessage':
- if (this.env.next_uid)
- this.show_message(this.env.next_uid, false, this.env.action=='preview');
- break;
-
- case 'lastmessage':
- if (this.env.last_uid)
- this.show_message(this.env.last_uid);
- break;
-
- case 'previousmessage':
- if (this.env.prev_uid)
- this.show_message(this.env.prev_uid, false, this.env.action=='preview');
- break;
-
- case 'firstmessage':
- if (this.env.first_uid)
- this.show_message(this.env.first_uid);
- break;
-
- case 'checkmail':
- this.check_for_recent(true);
- break;
-
- case 'compose':
- var url = this.env.comm_path+'&_action=compose';
-
- if (this.task=='mail')
- {
- url += '&_mbox='+urlencode(this.env.mailbox);
-
- if (this.env.mailbox==this.env.drafts_mailbox)
- {
- var uid;
- if (uid = this.get_single_uid())
- url += '&_draft_uid='+uid;
- }
- else if (props)
- url += '&_to='+urlencode(props);
- }
- // modify url if we're in addressbook
- else if (this.task=='addressbook')
- {
- // switch to mail compose step directly
- if (props && props.indexOf('@') > 0)
- {
- url = this.get_task_url('mail', url);
- this.redirect(url + '&_to='+urlencode(props));
- break;
- }
-
- // use contact_id passed as command parameter
- var a_cids = new Array();
- if (props)
- a_cids[a_cids.length] = props;
- // get selected contacts
- else if (this.contact_list)
- {
- var selection = this.contact_list.get_selection();
- for (var n=0; n<selection.length; n++)
- a_cids[a_cids.length] = selection[n];
- }
-
- if (a_cids.length)
- this.http_request('mailto', '_cid='+urlencode(a_cids.join(','))+'&_source='+urlencode(this.env.source), true);
-
- break;
- }
-
- // don't know if this is necessary...
- url = url.replace(/&_framed=1/, "");
-
- this.redirect(url);
- break;
-
- case 'spellcheck':
- if (window.tinyMCE && tinyMCE.get('compose-body')) {
- tinyMCE.execCommand('mceSpellCheck', true);
- }
- else if (this.env.spellcheck && this.env.spellcheck.spellCheck && this.spellcheck_ready) {
- this.env.spellcheck.spellCheck(this.env.spellcheck.check_link);
- this.set_spellcheck_state('checking');
- }
- break;
-
- case 'savedraft':
- // Reset the auto-save timer
- self.clearTimeout(this.save_timer);
-
- if (!this.gui_objects.messageform)
- break;
-
- // if saving Drafts is disabled in main.inc.php
- // or if compose form did not change
- if (!this.env.drafts_mailbox || this.cmp_hash == this.compose_field_hash())
- break;
-
- this.set_busy(true, 'savingmessage');
- var form = this.gui_objects.messageform;
- form.target = "savetarget";
- form._draft.value = '1';
- form.submit();
- break;
-
- case 'send':
- if (!this.gui_objects.messageform)
- break;
-
- if (!this.check_compose_input())
- break;
-
- // Reset the auto-save timer
- self.clearTimeout(this.save_timer);
-
- // all checks passed, send message
- this.set_busy(true, 'sendingmessage');
- var form = this.gui_objects.messageform;
- form.target = "savetarget";
- form._draft.value = '';
- form.submit();
-
- // clear timeout (sending could take longer)
- clearTimeout(this.request_timer);
- break;
-
- case 'add-attachment':
- this.show_attachment_form(true);
-
- case 'send-attachment':
- // Reset the auto-save timer
- self.clearTimeout(this.save_timer);
-
- this.upload_file(props)
- break;
-
- case 'remove-attachment':
- this.remove_attachment(props);
- break;
-
- case 'reply-all':
- case 'reply':
- var uid;
- if (uid = this.get_single_uid())
- this.goto_url('compose', '_reply_uid='+uid+'&_mbox='+urlencode(this.env.mailbox)+(command=='reply-all' ? '&_all=1' : ''), true);
- break;
-
- case 'forward':
- var uid;
- if (uid = this.get_single_uid())
- this.goto_url('compose', '_forward_uid='+uid+'&_mbox='+urlencode(this.env.mailbox), true);
- break;
-
- case 'print':
- var uid;
- if (uid = this.get_single_uid())
- {
- ref.printwin = window.open(this.env.comm_path+'&_action=print&_uid='+uid+'&_mbox='+urlencode(this.env.mailbox)+(this.env.safemode ? '&_safe=1' : ''));
- if (this.printwin)
- {
- window.setTimeout(function(){ ref.printwin.focus(); }, 20);
- if (this.env.action != 'show')
- this.mark_message('read', uid);
- }
- }
- break;
-
- case 'viewsource':
- var uid;
- if (uid = this.get_single_uid())
- {
- ref.sourcewin = window.open(this.env.comm_path+'&_action=viewsource&_uid='+this.env.uid+'&_mbox='+urlencode(this.env.mailbox));
- if (this.sourcewin)
- window.setTimeout(function(){ ref.sourcewin.focus(); }, 20);
- }
- break;
-
- case 'add-contact':
- this.add_contact(props);
- break;
-
- // quicksearch
- case 'search':
- if (!props && this.gui_objects.qsearchbox)
- props = this.gui_objects.qsearchbox.value;
- if (props)
- {
- this.qsearch(props);
- break;
- }
-
- // reset quicksearch
- case 'reset-search':
- var s = this.env.search_request;
- this.reset_qsearch();
-
- if (s && this.env.mailbox)
- this.list_mailbox(this.env.mailbox);
- else if (s && this.task == 'addressbook')
- this.list_contacts(this.env.source);
- break;
-
- case 'import':
- if (this.env.action == 'import' && this.gui_objects.importform) {
- var file = document.getElementById('rcmimportfile');
- if (file && !file.value) {
- alert(this.get_label('selectimportfile'));
- break;
- }
- this.gui_objects.importform.submit();
- this.set_busy(true, 'importwait');
- this.lock_form(this.gui_objects.importform, true);
- }
- else
- this.goto_url('import');
- break;
-
- case 'export':
- if (this.contact_list.rowcount > 0) {
- var add_url = (this.env.source ? '_source='+urlencode(this.env.source)+'&' : '');
- if (this.env.search_request)
- add_url += '_search='+this.env.search_request;
-
- this.goto_url('export', add_url);
- }
- break;
-
- // collapse/expand folder
- case 'collapse-folder':
- if (props)
- this.collapse_folder(props);
- break;
-
- // user settings commands
- case 'preferences':
- this.goto_url('');
- break;
-
- case 'identities':
- this.goto_url('identities');
- break;
-
- case 'delete-identity':
- this.delete_identity();
-
- case 'folders':
- this.goto_url('folders');
- break;
-
- case 'subscribe':
- this.subscribe_folder(props);
- break;
-
- case 'unsubscribe':
- this.unsubscribe_folder(props);
- break;
-
- case 'create-folder':
- this.create_folder(props);
- break;
-
- case 'rename-folder':
- this.rename_folder(props);
- break;
-
- case 'delete-folder':
- this.delete_folder(props);
- break;
-
- }
-
- return obj ? false : true;
- };
-
- // set command enabled or disabled
- this.enable_command = function()
- {
- var args = arguments;
- if(!args.length) return -1;
-
- var command;
- var enable = args[args.length-1];
-
- for(var n=0; n<args.length-1; n++)
- {
- command = args[n];
- this.commands[command] = enable;
- this.set_button(command, (enable ? 'act' : 'pas'));
- }
- return true;
- };
-
- // lock/unlock interface
- this.set_busy = function(a, message)
- {
- if (a && message)
- {
- var msg = this.get_label(message);
- if (msg==message)
- msg = 'Loading...';
-
- this.display_message(msg, 'loading', true);
- }
- else if (!a)
- this.hide_message();
-
- this.busy = a;
- //document.body.style.cursor = a ? 'wait' : 'default';
-
- if (this.gui_objects.editform)
- this.lock_form(this.gui_objects.editform, a);
-
- // clear pending timer
- if (this.request_timer)
- clearTimeout(this.request_timer);
-
- // set timer for requests
- if (a && this.env.request_timeout)
- this.request_timer = window.setTimeout(function(){ ref.request_timed_out(); }, this.env.request_timeout * 1000);
- };
-
- // return a localized string
- this.get_label = function(name)
- {
- if (this.labels[name])
- return this.labels[name];
- else
- return name;
- };
-
- // switch to another application task
- this.switch_task = function(task)
- {
- if (this.task===task && task!='mail')
- return;
-
- var url = this.get_task_url(task);
- if (task=='mail')
- url += '&_mbox=INBOX';
-
- this.redirect(url);
- };
-
- this.get_task_url = function(task, url)
- {
- if (!url)
- url = this.env.comm_path;
-
- return url.replace(/_task=[a-z]+/, '_task='+task);
- };
-
- // called when a request timed out
- this.request_timed_out = function()
- {
- this.set_busy(false);
- this.display_message('Request timed out!', 'error');
- };
-
-
- /*********************************************************/
- /********* event handling methods *********/
- /*********************************************************/
-
- this.doc_mouse_up = function(e)
- {
- var model, li;
-
- if (this.message_list) {
- this.message_list.blur();
- model = this.env.mailboxes;
- }
- else if (this.contact_list) {
- this.contact_list.blur();
- model = this.env.address_sources;
- }
- else if (this.ksearch_value) {
- this.ksearch_blur();
- }
-
- // handle mouse release when dragging
- if (this.drag_active && model && this.env.last_folder_target) {
- this.set_classname(this.get_folder_li(this.env.last_folder_target), 'droptarget', false);
- this.command('moveto', model[this.env.last_folder_target].id);
- this.env.last_folder_target = null;
- }
- };
-
- this.drag_start = function(list)
- {
- var model = this.task == 'mail' ? this.env.mailboxes : this.env.address_sources;
-
- this.drag_active = true;
- if (this.preview_timer)
- clearTimeout(this.preview_timer);
-
- // save folderlist and folders location/sizes for droptarget calculation in drag_move()
- if (this.gui_objects.folderlist && model)
- {
- var li, pos, list, height;
- list = rcube_find_object(this.task == 'mail' ? 'mailboxlist' : 'directorylist');
- pos = rcube_get_object_pos(list);
- this.env.folderlist_coords = {x1:pos.x, y1:pos.y, x2:pos.x + list.offsetWidth, y2:pos.y + list.offsetHeight};
-
- this.env.folder_coords = new Array();
- for (var k in model) {
- if (li = this.get_folder_li(k))
- {
- pos = rcube_get_object_pos(li.firstChild);
- // only visible folders
- if (height = li.firstChild.offsetHeight)
- this.env.folder_coords[k] = {x1:pos.x, y1:pos.y, x2:pos.x + li.firstChild.offsetWidth, y2:pos.y + height};
- }
- }
- }
- };
-
- this.drag_move = function(e)
- {
- if (this.gui_objects.folderlist && this.env.folder_coords)
- {
- var li, pos, mouse;
- mouse = rcube_event.get_mouse_pos(e);
- pos = this.env.folderlist_coords;
-
- // if mouse pointer is outside of folderlist
- if (mouse.x < pos.x1 || mouse.x >= pos.x2
- || mouse.y < pos.y1 || mouse.y >= pos.y2)
- {
- if (this.env.last_folder_target) {
- this.set_classname(this.get_folder_li(this.env.last_folder_target), 'droptarget', false);
- this.env.last_folder_target = null;
- }
- return;
- }
-
- // over the folders
- for (var k in this.env.folder_coords)
- {
- pos = this.env.folder_coords[k];
- if (this.check_droptarget(k) && ((mouse.x >= pos.x1) && (mouse.x < pos.x2)
- && (mouse.y >= pos.y1) && (mouse.y < pos.y2)))
- {
- this.set_classname(this.get_folder_li(k), 'droptarget', true);
- this.env.last_folder_target = k;
- }
- else
- this.set_classname(this.get_folder_li(k), 'droptarget', false);
- }
- }
- };
-
- this.collapse_folder = function(id)
- {
- var div;
- if ((li = this.get_folder_li(id)) &&
- (div = li.getElementsByTagName("div")[0]) &&
- (div.className.match(/collapsed/) || div.className.match(/expanded/)))
- {
- var ul = li.getElementsByTagName("ul")[0];
- if (div.className.match(/collapsed/))
- {
- ul.style.display = '';
- this.set_classname(div, 'collapsed', false);
- this.set_classname(div, 'expanded', true);
- var reg = new RegExp('&'+urlencode(id)+'&');
- this.set_env('collapsed_folders', this.env.collapsed_folders.replace(reg, ''));
- }
- else
- {
- ul.style.display = 'none';
- this.set_classname(div, 'expanded', false);
- this.set_classname(div, 'collapsed', true);
- this.set_env('collapsed_folders', this.env.collapsed_folders+'&'+urlencode(id)+'&');
-
- // select parent folder if one of its childs is currently selected
- if (this.env.mailbox.indexOf(id + this.env.delimiter) == 0)
- this.command('list', id);
- }
-
- // Work around a bug in IE6 and IE7, see #1485309
- if ((bw.ie6 || bw.ie7) &&
- li.nextSibling &&
- (li.nextSibling.getElementsByTagName("ul").length>0) &&
- li.nextSibling.getElementsByTagName("ul")[0].style &&
- (li.nextSibling.getElementsByTagName("ul")[0].style.display!='none'))
- {
- li.nextSibling.getElementsByTagName("ul")[0].style.display = 'none';
- li.nextSibling.getElementsByTagName("ul")[0].style.display = '';
- }
-
- this.http_post('save-pref', '_name=collapsed_folders&_value='+urlencode(this.env.collapsed_folders));
- this.set_unread_count_display(id, false);
- }
- }
-
- this.click_on_list = function(e)
- {
- if (this.message_list)
- this.message_list.focus();
- else if (this.contact_list)
- this.contact_list.focus();
-
- var mbox_li;
- if (mbox_li = this.get_folder_li())
- this.set_classname(mbox_li, 'unfocused', true);
-
- return rcube_event.get_button(e) == 2 ? true : rcube_event.cancel(e);
- };
-
- this.msglist_select = function(list)
- {
- if (this.preview_timer)
- clearTimeout(this.preview_timer);
-
- var selected = list.selection.length==1;
-
- // Hide certain command buttons when Drafts folder is selected
- if (this.env.mailbox == this.env.drafts_mailbox)
- {
- this.enable_command('reply', 'reply-all', 'forward', false);
- this.enable_command('show', selected);
- this.enable_command('delete', 'moveto', 'mark', (list.selection.length > 0 ? true : false));
- }
- else
- {
- this.enable_command('show', 'reply', 'reply-all', 'forward', 'print', selected);
- this.enable_command('delete', 'moveto', 'mark', (list.selection.length > 0 ? true : false));
- }
-
- // start timer for message preview (wait for double click)
- if (selected && this.env.contentframe && !list.multi_selecting)
- this.preview_timer = window.setTimeout(function(){ ref.msglist_get_preview(); }, 200);
- else if (this.env.contentframe)
- this.show_contentframe(false);
- };
-
- this.msglist_dbl_click = function(list)
- {
- if (this.preview_timer)
- clearTimeout(this.preview_timer);
-
- var uid = list.get_single_selection();
- if (uid && this.env.mailbox == this.env.drafts_mailbox)
- this.goto_url('compose', '_draft_uid='+uid+'&_mbox='+urlencode(this.env.mailbox), true);
- else if (uid)
- this.show_message(uid, false, false);
- };
-
- this.msglist_keypress = function(list)
- {
- if (list.key_pressed == list.ENTER_KEY)
- this.command('show');
- else if (list.key_pressed == list.DELETE_KEY)
- this.command('delete');
- else if (list.key_pressed == list.BACKSPACE_KEY)
- this.command('delete');
- else
- list.shiftkey = false;
- };
-
- this.msglist_get_preview = function()
- {
- var uid = this.get_single_uid();
- if (uid && this.env.contentframe && !this.drag_active)
- this.show_message(uid, false, true);
- else if (this.env.contentframe)
- this.show_contentframe(false);
- };
-
- this.check_droptarget = function(id)
- {
- if (this.task == 'mail')
- return (this.env.mailboxes[id] && this.env.mailboxes[id].id != this.env.mailbox && !this.env.mailboxes[id].virtual);
- else if (this.task == 'addressbook')
- return (id != this.env.source && this.env.address_sources[id] && !this.env.address_sources[id].readonly);
- else if (this.task == 'settings')
- return (id != this.env.folder);
- };
-
-
- /*********************************************************/
- /********* (message) list functionality *********/
- /*********************************************************/
-
- // when user doble-clicks on a row
- this.show_message = function(id, safe, preview)
- {
- if (!id) return;
-
- var add_url = '';
- var action = preview ? 'preview': 'show';
- var target = window;
-
- if (preview && this.env.contentframe && window.frames && window.frames[this.env.contentframe])
- {
- target = window.frames[this.env.contentframe];
- add_url = '&_framed=1';
- }
-
- if (safe)
- add_url = '&_safe=1';
-
- // also send search request to get the right messages
- if (this.env.search_request)
- add_url += '&_search='+this.env.search_request;
- var url = '&_action='+action+'&_uid='+id+'&_mbox='+urlencode(this.env.mailbox)+add_url;
- if (action == 'preview' && String(target.location.href).indexOf(url) >= 0)
- this.show_contentframe(true);
- else
- {
- this.set_busy(true, 'loading');
- target.location.href = this.env.comm_path+url;
- // mark as read and change mbox unread counter
- if (action == 'preview' && this.message_list && this.message_list.rows[id] && this.message_list.rows[id].unread)
- {
- this.set_message(id, 'unread', false);
- if (this.env.unread_counts[this.env.mailbox])
- {
- this.env.unread_counts[this.env.mailbox] -= 1;
- this.set_unread_count(this.env.mailbox, this.env.unread_counts[this.env.mailbox], this.env.mailbox == 'INBOX');
- }
- }
- }
- };
-
- this.show_contentframe = function(show)
- {
- var frm;
- if (this.env.contentframe && (frm = rcube_find_object(this.env.contentframe)))
- {
- if (!show && window.frames[this.env.contentframe])
- {
- if (window.frames[this.env.contentframe].location.href.indexOf(this.env.blankpage)<0)
- window.frames[this.env.contentframe].location.href = this.env.blankpage;
- }
- else if (!bw.safari)
- frm.style.display = show ? 'block' : 'none';
- }
-
- if (!show && this.busy)
- this.set_busy(false);
- };
-
- // list a specific page
- this.list_page = function(page)
- {
- if (page=='next')
- page = this.env.current_page+1;
- if (page=='last')
- page = this.env.pagecount;
- if (page=='prev' && this.env.current_page>1)
- page = this.env.current_page-1;
- if (page=='first' && this.env.current_page>1)
- page = 1;
-
- if (page > 0 && page <= this.env.pagecount)
- {
- this.env.current_page = page;
-
- if (this.task=='mail')
- this.list_mailbox(this.env.mailbox, page);
- else if (this.task=='addressbook')
- this.list_contacts(this.env.source, page);
- }
- };
-
- // list messages of a specific mailbox using filter
- this.filter_mailbox = function(filter)
- {
- var search;
- if (this.gui_objects.qsearchbox)
- search = this.gui_objects.qsearchbox.value;
-
- this.message_list.clear();
-
- // reset vars
- this.env.current_page = 1;
- this.set_busy(true, 'searching');
- this.http_request('search', '_filter='+filter
- + (search ? '&_q='+urlencode(search) : '')
- + (this.env.mailbox ? '&_mbox='+urlencode(this.env.mailbox) : ''), true);
- }
-
-
- // list messages of a specific mailbox
- this.list_mailbox = function(mbox, page, sort)
- {
- this.last_selected = 0;
- var add_url = '';
- var target = window;
-
- if (!mbox)
- mbox = this.env.mailbox;
-
- // add sort to url if set
- if (sort)
- add_url += '&_sort=' + sort;
-
- // also send search request to get the right messages
- if (this.env.search_request)
- add_url += '&_search='+this.env.search_request;
-
- // set page=1 if changeing to another mailbox
- if (!page && mbox != this.env.mailbox)
- {
- page = 1;
- this.env.current_page = page;
- if (this.message_list)
- this.message_list.clear_selection();
- this.show_contentframe(false);
- }
-
- if (mbox != this.env.mailbox || (mbox == this.env.mailbox && !page && !sort))
- add_url += '&_refresh=1';
-
- this.select_folder(mbox, this.env.mailbox);
- this.env.mailbox = mbox;
-
- // load message list remotely
- if (this.gui_objects.messagelist)
- {
- this.list_mailbox_remote(mbox, page, add_url);
- return;
- }
-
- if (this.env.contentframe && window.frames && window.frames[this.env.contentframe])
- {
- target = window.frames[this.env.contentframe];
- add_url += '&_framed=1';
- }
-
- // load message list to target frame/window
- if (mbox)
- {
- this.set_busy(true, 'loading');
- target.location.href = this.env.comm_path+'&_mbox='+urlencode(mbox)+(page ? '&_page='+page : '')+add_url;
- }
- };
-
- // send remote request to load message list
- this.list_mailbox_remote = function(mbox, page, add_url)
- {
- // clear message list first
- this.message_list.clear();
-
- // send request to server
- var url = '_mbox='+urlencode(mbox)+(page ? '&_page='+page : '');
- this.set_busy(true, 'loading');
- this.http_request('list', url+add_url, true);
- };
-
- this.expunge_mailbox = function(mbox)
- {
- var lock = false;
- var add_url = '';
-
- // lock interface if it's the active mailbox
- if (mbox == this.env.mailbox)
- {
- lock = true;
- this.set_busy(true, 'loading');
- add_url = '&_reload=1';
- }
-
- // send request to server
- var url = '_mbox='+urlencode(mbox);
- this.http_post('expunge', url+add_url, lock);
- };
-
- this.purge_mailbox = function(mbox)
- {
- var lock = false;
- var add_url = '';
-
- if (!confirm(this.get_label('purgefolderconfirm')))
- return false;
-
- // lock interface if it's the active mailbox
- if (mbox == this.env.mailbox)
- {
- lock = true;
- this.set_busy(true, 'loading');
- add_url = '&_reload=1';
- }
-
- // send request to server
- var url = '_mbox='+urlencode(mbox);
- this.http_post('purge', url+add_url, lock);
- return true;
- };
-
- // test if purge command is allowed
- this.purge_mailbox_test = function()
- {
- return (this.env.messagecount && (this.env.mailbox == this.env.trash_mailbox || this.env.mailbox == this.env.junk_mailbox
- || this.env.mailbox.match('^' + RegExp.escape(this.env.trash_mailbox) + RegExp.escape(this.env.delimiter))
- || this.env.mailbox.match('^' + RegExp.escape(this.env.junk_mailbox) + RegExp.escape(this.env.delimiter))));
- };
-
- // set message icon
- this.set_message_icon = function(uid)
- {
- var icn_src;
- var rows = this.message_list.rows;
-
- if (!rows[uid])
- return false;
-
- if (rows[uid].deleted && this.env.deletedicon)
- icn_src = this.env.deletedicon;
- else if (rows[uid].replied && this.env.repliedicon)
- {
- if (rows[uid].forwarded && this.env.forwardedrepliedicon)
- icn_src = this.env.forwardedrepliedicon;
- else
- icn_src = this.env.repliedicon;
- }
- else if (rows[uid].forwarded && this.env.forwardedicon)
- icn_src = this.env.forwardedicon;
- else if (rows[uid].unread && this.env.unreadicon)
- icn_src = this.env.unreadicon;
- else if (this.env.messageicon)
- icn_src = this.env.messageicon;
-
- if (icn_src && rows[uid].icon)
- rows[uid].icon.src = icn_src;
-
- icn_src = '';
-
- if (rows[uid].flagged && this.env.flaggedicon)
- icn_src = this.env.flaggedicon;
- else if (!rows[uid].flagged && this.env.unflaggedicon)
- icn_src = this.env.unflaggedicon;
-
- if (rows[uid].flagged_icon && icn_src)
- rows[uid].flagged_icon.src = icn_src;
- }
-
- // set message status
- this.set_message_status = function(uid, flag, status)
- {
- var rows = this.message_list.rows;
-
- if (!rows[uid]) return false;
-
- if (flag == 'unread')
- rows[uid].unread = status;
- else if(flag == 'deleted')
- rows[uid].deleted = status;
- else if (flag == 'replied')
- rows[uid].replied = status;
- else if (flag == 'forwarded')
- rows[uid].forwarded = status;
- else if (flag == 'flagged')
- rows[uid].flagged = status;
-
- this.env.messages[uid] = rows[uid];
- }
-
- // set message row status, class and icon
- this.set_message = function(uid, flag, status)
- {
- var rows = this.message_list.rows;
-
- if (!rows[uid]) return false;
-
- if (flag)
- this.set_message_status(uid, flag, status);
-
- if (rows[uid].unread && rows[uid].classname.indexOf('unread')<0)
- {
- rows[uid].classname += ' unread';
- this.set_classname(rows[uid].obj, 'unread', true);
- }
- else if (!rows[uid].unread && rows[uid].classname.indexOf('unread')>=0)
- {
- rows[uid].classname = rows[uid].classname.replace(/\s*unread/, '');
- this.set_classname(rows[uid].obj, 'unread', false);
- }
-
- if (rows[uid].deleted && rows[uid].classname.indexOf('deleted')<0)
- {
- rows[uid].classname += ' deleted';
- this.set_classname(rows[uid].obj, 'deleted', true);
- }
- else if (!rows[uid].deleted && rows[uid].classname.indexOf('deleted')>=0)
- {
- rows[uid].classname = rows[uid].classname.replace(/\s*deleted/, '');
- this.set_classname(rows[uid].obj, 'deleted', false);
- }
-
- if (rows[uid].flagged && rows[uid].classname.indexOf('flagged')<0)
- {
- rows[uid].classname += ' flagged';
- this.set_classname(rows[uid].obj, 'flagged', true);
- }
- else if (!rows[uid].flagged && rows[uid].classname.indexOf('flagged')>=0)
- {
- rows[uid].classname = rows[uid].classname.replace(/\s*flagged/, '');
- this.set_classname(rows[uid].obj, 'flagged', false);
- }
-
- this.set_message_icon(uid);
- }
-
- // move selected messages to the specified mailbox
- this.move_messages = function(mbox)
- {
- // exit if current or no mailbox specified or if selection is empty
- if (!mbox || mbox == this.env.mailbox || (!this.env.uid && (!this.message_list || !this.message_list.get_selection().length)))
- return;
-
- var lock = false;
- var add_url = '&_target_mbox='+urlencode(mbox)+'&_from='+(this.env.action ? this.env.action : '');
-
- // show wait message
- if (this.env.action=='show')
- {
- lock = true;
- this.set_busy(true, 'movingmessage');
- }
- else if (!this.env.flag_for_deletion)
- this.show_contentframe(false);
-
- // Hide message command buttons until a message is selected
- this.enable_command('reply', 'reply-all', 'forward', 'delete', 'mark', 'print', false);
-
- this._with_selected_messages('moveto', lock, add_url, (this.env.flag_for_deletion ? false : true));
- };
-
- // delete selected messages from the current mailbox
- this.delete_messages = function()
- {
- var selection = this.message_list ? this.message_list.get_selection() : new Array();
-
- // exit if no mailbox specified or if selection is empty
- if (!this.env.uid && !selection.length)
- return;
-
- // if there is a trash mailbox defined and we're not currently in it:
- if (this.env.trash_mailbox && String(this.env.mailbox).toLowerCase() != String(this.env.trash_mailbox).toLowerCase())
- {
- // if shift was pressed delete it immediately
- if (this.message_list && this.message_list.shiftkey)
- {
- if (confirm(this.get_label('deletemessagesconfirm')))
- this.permanently_remove_messages();
- }
- else
- this.move_messages(this.env.trash_mailbox);
- }
- // if there is a trash mailbox defined but we *are* in it:
- else if (this.env.trash_mailbox && String(this.env.mailbox).toLowerCase() == String(this.env.trash_mailbox).toLowerCase())
- this.permanently_remove_messages();
- // if there isn't a defined trash mailbox and the config is set to flag for deletion
- else if (!this.env.trash_mailbox && this.env.flag_for_deletion)
- {
- this.mark_message('delete');
- if(this.env.action=="show")
- this.command('nextmessage','',this);
- else if (selection.length == 1)
- this.message_list.select_next();
- }
- // if there isn't a defined trash mailbox and the config is set NOT to flag for deletion
- else if (!this.env.trash_mailbox)
- this.permanently_remove_messages();
- };
-
- // delete the selected messages permanently
- this.permanently_remove_messages = function()
- {
- // exit if no mailbox specified or if selection is empty
- if (!this.env.uid && (!this.message_list || !this.message_list.get_selection().length))
- return;
-
- this.show_contentframe(false);
- this._with_selected_messages('delete', false, '&_from='+(this.env.action ? this.env.action : ''), true);
- };
-
- // Send a specifc request with UIDs of all selected messages
- // @private
- this._with_selected_messages = function(action, lock, add_url, remove)
- {
- var a_uids = new Array();
-
- if (this.env.uid)
- a_uids[0] = this.env.uid;
- else
- {
- var selection = this.message_list.get_selection();
- var rows = this.message_list.rows;
- var id;
- for (var n=0; n<selection.length; n++)
- {
- id = selection[n];
- a_uids[a_uids.length] = id;
-
- if (remove)
- this.message_list.remove_row(id, (n == selection.length-1));
- else
- {
- this.set_message_status(id, 'deleted', true);
- if (this.env.read_when_deleted)
- this.set_message_status(id, 'unread', false);
- this.set_message(id);
- }
- }
- }
-
- // also send search request to get the right messages
- if (this.env.search_request)
- add_url += '&_search='+this.env.search_request;
-
- // send request to server
- this.http_post(action, '_uid='+a_uids.join(',')+'&_mbox='+urlencode(this.env.mailbox)+add_url, lock);
- };
-
- // set a specific flag to one or more messages
- this.mark_message = function(flag, uid)
- {
- var a_uids = new Array();
- var r_uids = new Array();
- var selection = this.message_list ? this.message_list.get_selection() : new Array();
-
- if (uid)
- a_uids[0] = uid;
- else if (this.env.uid)
- a_uids[0] = this.env.uid;
- else if (this.message_list)
- {
- for (var n=0; n<selection.length; n++)
- {
- a_uids[a_uids.length] = selection[n];
- }
- }
-
- if (!this.message_list)
- r_uids = a_uids;
- else
- for (var id, n=0; n<a_uids.length; n++)
- {
- id = a_uids[n];
- if ((flag=='read' && this.message_list.rows[id].unread)
- || (flag=='unread' && !this.message_list.rows[id].unread)
- || (flag=='delete' && !this.message_list.rows[id].deleted)
- || (flag=='undelete' && this.message_list.rows[id].deleted)
- || (flag=='flagged' && !this.message_list.rows[id].flagged)
- || (flag=='unflagged' && this.message_list.rows[id].flagged))
- {
- r_uids[r_uids.length] = id;
- }
- }
-
- // nothing to do
- if (!r_uids.length)
- return;
-
- switch (flag)
- {
- case 'read':
- case 'unread':
- this.toggle_read_status(flag, r_uids);
- break;
- case 'delete':
- case 'undelete':
- this.toggle_delete_status(r_uids);
- break;
- case 'flagged':
- case 'unflagged':
- this.toggle_flagged_status(flag, a_uids);
- break;
- }
- };
-
- // set class to read/unread
- this.toggle_read_status = function(flag, a_uids)
- {
- // mark all message rows as read/unread
- for (var i=0; i<a_uids.length; i++)
- this.set_message(a_uids[i], 'unread', (flag=='unread' ? true : false));
-
- this.http_post('mark', '_uid='+a_uids.join(',')+'&_flag='+flag);
- };
-
- // set image to flagged or unflagged
- this.toggle_flagged_status = function(flag, a_uids)
- {
- // mark all message rows as flagged/unflagged
- for (var i=0; i<a_uids.length; i++)
- this.set_message(a_uids[i], 'flagged', (flag=='flagged' ? true : false));
-
- this.http_post('mark', '_uid='+a_uids.join(',')+'&_flag='+flag);
- };
-
- // mark all message rows as deleted/undeleted
- this.toggle_delete_status = function(a_uids)
- {
- var rows = this.message_list ? this.message_list.rows : new Array();
-
- if (a_uids.length==1)
- {
- if (!rows.length || (rows[a_uids[0]] && !rows[a_uids[0]].deleted))
- this.flag_as_deleted(a_uids);
- else
- this.flag_as_undeleted(a_uids);
-
- return true;
- }
-
- var all_deleted = true;
- for (var i=0; i<a_uids.length; i++)
- {
- uid = a_uids[i];
- if (rows[uid]) {
- if (!rows[uid].deleted)
- {
- all_deleted = false;
- break;
- }
- }
- }
-
- if (all_deleted)
- this.flag_as_undeleted(a_uids);
- else
- this.flag_as_deleted(a_uids);
-
- return true;
- };
-
- this.flag_as_undeleted = function(a_uids)
- {
- for (var i=0; i<a_uids.length; i++)
- this.set_message(a_uids[i], 'deleted', false);
-
- this.http_post('mark', '_uid='+a_uids.join(',')+'&_flag=undelete');
- return true;
- };
-
- this.flag_as_deleted = function(a_uids)
- {
- var add_url = '';
- var r_uids = new Array();
- var rows = this.message_list ? this.message_list.rows : new Array();
-
- for (var i=0; i<a_uids.length; i++)
- {
- uid = a_uids[i];
- if (rows[uid])
- {
- this.set_message(uid, 'deleted', true);
- if (rows[uid].unread)
- r_uids[r_uids.length] = uid;
- }
- }
-
- if (r_uids.length)
- add_url = '&_ruid='+r_uids.join(',');
-
- this.http_post('mark', '_uid='+a_uids.join(',')+'&_flag=delete'+add_url);
- return true;
- };
-
- // flag as read without mark request (called from backend)
- // argument should be a coma-separated list of uids
- this.flag_deleted_as_read = function(uids)
- {
- var icn_src;
- var rows = this.message_list ? this.message_list.rows : new Array();
- var str = String(uids);
- var a_uids = new Array();
-
- a_uids = str.split(',');
-
- for (var uid, i=0; i<a_uids.length; i++)
- {
- uid = a_uids[i];
- if (rows[uid])
- this.set_message(uid, 'unread', false);
- }
- };
-
-
- /*********************************************************/
- /********* login form methods *********/
- /*********************************************************/
-
- // handler for keyboard events on the _user field
- this.login_user_keyup = function(e)
- {
- var key = rcube_event.get_keycode(e);
- var elm;
-
- // enter
- if ((key==13) && (elm = rcube_find_object('_pass')))
- {
- elm.focus();
- return false;
- }
- };
-
-
- /*********************************************************/
- /********* message compose methods *********/
- /*********************************************************/
-
- // checks the input fields before sending a message
- this.check_compose_input = function()
- {
- // check input fields
- var input_to = rcube_find_object('_to');
- var input_cc = rcube_find_object('_cc');
- var input_bcc = rcube_find_object('_bcc');
- var input_from = rcube_find_object('_from');
- var input_subject = rcube_find_object('_subject');
- var input_message = rcube_find_object('_message');
-
- // check sender (if have no identities)
- if (input_from.type == 'text' && !rcube_check_email(input_from.value, true))
- {
- alert(this.get_label('nosenderwarning'));
- input_from.focus();
- return false;
- }
-
- // check for empty recipient
- var recipients = input_to.value ? input_to.value : (input_cc.value ? input_cc.value : input_bcc.value);
- if (!rcube_check_email(recipients.replace(/^\s+/, '').replace(/[\s,;]+$/, ''), true))
- {
- alert(this.get_label('norecipientwarning'));
- input_to.focus();
- return false;
- }
-
- // display localized warning for missing subject
- if (input_subject && input_subject.value == '')
- {
- var subject = prompt(this.get_label('nosubjectwarning'), this.get_label('nosubject'));
-
- // user hit cancel, so don't send
- if (!subject && subject !== '')
- {
- input_subject.focus();
- return false;
- }
- else
- {
- input_subject.value = subject ? subject : this.get_label('nosubject');
- }
- }
-
- // check for empty body
- if ((!window.tinyMCE || !tinyMCE.get('compose-body')) && input_message.value == '' && !confirm(this.get_label('nobodywarning')))
- {
- input_message.focus();
- return false;
- }
- else if (window.tinyMCE && tinyMCE.get('compose-body') && !tinyMCE.get('compose-body').getContent() && !confirm(this.get_label('nobodywarning')))
- {
- tinyMCE.get('compose-body').focus();
- return false;
- }
-
- // Apply spellcheck changes if spell checker is active
- this.stop_spellchecking();
-
- return true;
- };
-
- this.stop_spellchecking = function()
- {
- if (this.env.spellcheck && !this.spellcheck_ready) {
- exec_event(this.env.spellcheck.check_link, 'click');
- this.set_spellcheck_state('ready');
- }
- };
-
- this.display_spellcheck_controls = function(vis)
- {
- if (this.env.spellcheck) {
- // stop spellchecking process
- if (!vis)
- this.stop_spellchecking();
-
- this.env.spellcheck.check_link.style.visibility = vis ? 'visible' : 'hidden';
- this.env.spellcheck.switch_lan_pic.style.visibility = vis ? 'visible' : 'hidden';
- }
- };
-
- this.set_spellcheck_state = function(s)
- {
- this.spellcheck_ready = (s=='check_spelling' || s=='ready');
- this.enable_command('spellcheck', this.spellcheck_ready);
- };
-
- this.set_draft_id = function(id)
- {
- var f;
- if (f = rcube_find_object('_draft_saveid'))
- f.value = id;
- };
-
- this.auto_save_start = function()
- {
- if (this.env.draft_autosave)
- this.save_timer = self.setTimeout(function(){ ref.command("savedraft"); }, this.env.draft_autosave * 1000);
-
- // Unlock interface now that saving is complete
- this.busy = false;
- };
-
- this.compose_field_hash = function(save)
- {
- // check input fields
- var input_to = rcube_find_object('_to');
- var input_cc = rcube_find_object('_cc');
- var input_bcc = rcube_find_object('_bcc');
- var input_subject = rcube_find_object('_subject');
- var editor, input_message;
- var str = '';
-
- if (input_to && input_to.value)
- str += input_to.value+':';
- if (input_cc && input_cc.value)
- str += input_cc.value+':';
- if (input_bcc && input_bcc.value)
- str += input_bcc.value+':';
- if (input_subject && input_subject.value)
- str += input_subject.value+':';
-
- if (editor = tinyMCE.get('compose-body'))
- str += editor.getContent();
- else
- {
- input_message = rcube_find_object('_message');
- str += input_message.value;
- }
-
- if (save)
- this.cmp_hash = str;
-
- return str;
- };
-
- this.change_identity = function(obj)
- {
- if (!obj || !obj.options)
- return false;
-
- var id = obj.options[obj.selectedIndex].value;
- var input_message = rcube_find_object('_message');
- var message = input_message ? input_message.value : '';
- var is_html = (rcube_find_object('_is_html').value == '1');
- var sig, p;
-
- if (!this.env.identity)
- this.env.identity = id
-
- if (!is_html)
- {
- // remove the 'old' signature
- if (this.env.identity && this.env.signatures && this.env.signatures[this.env.identity])
- {
- if (this.env.signatures[this.env.identity]['is_html'])
- sig = this.env.signatures[this.env.identity]['plain_text'];
- else
- sig = this.env.signatures[this.env.identity]['text'];
-
- if (sig.indexOf('-- ')!=0)
- sig = '-- \n'+sig;
-
- p = message.lastIndexOf(sig);
- if (p>=0)
- message = message.substring(0, p-1) + message.substring(p+sig.length, message.length);
- }
-
- message = message.replace(/[\r\n]+$/, '');
-
- // add the new signature string
- if (this.env.signatures && this.env.signatures[id])
- {
- sig = this.env.signatures[id]['text'];
- if (this.env.signatures[id]['is_html'])
- {
- sig = this.env.signatures[id]['plain_text'];
- }
- if (sig.indexOf('-- ')!=0)
- sig = '-- \n'+sig;
- message += '\n\n'+sig;
- }
- }
- else
- {
- var editor = tinyMCE.get('compose-body');
-
- if (this.env.signatures)
- {
- // Append the signature as a div within the body
- var sigElem = editor.dom.get('_rc_sig');
- var newsig = '';
- var htmlsig = true;
-
- if (!sigElem)
- {
- // add empty line before signature on IE
- if (bw.ie)
- editor.getBody().appendChild(editor.getDoc().createElement('br'));
-
- sigElem = editor.getDoc().createElement('div');
- sigElem.setAttribute('id', '_rc_sig');
- editor.getBody().appendChild(sigElem);
- }
-
- if (this.env.signatures[id])
- {
- newsig = this.env.signatures[id]['text'];
- htmlsig = this.env.signatures[id]['is_html'];
- }
-
- if (htmlsig)
- sigElem.innerHTML = newsig;
- else
- sigElem.innerHTML = '<pre>' + newsig + '</pre>';
- }
- }
-
- if (input_message)
- input_message.value = message;
-
- this.env.identity = id;
- return true;
- };
-
- this.show_attachment_form = function(a)
- {
- if (!this.gui_objects.uploadbox)
- return false;
-
- var elm, list;
- if (elm = this.gui_objects.uploadbox)
- {
- if (a && (list = this.gui_objects.attachmentlist))
- {
- var pos = rcube_get_object_pos(list);
- var left = pos.x;
- var top = pos.y + list.offsetHeight + 10;
-
- elm.style.top = top+'px';
- elm.style.left = left+'px';
- }
-
- elm.style.visibility = a ? 'visible' : 'hidden';
- }
-
- // clear upload form
- try {
- if (!a && this.gui_objects.attachmentform != this.gui_objects.messageform)
- this.gui_objects.attachmentform.reset();
- }
- catch(e){} // ignore errors
-
- return true;
- };
-
- // upload attachment file
- this.upload_file = function(form)
- {
- if (!form)
- return false;
-
- // get file input fields
- var send = false;
- for (var n=0; n<form.elements.length; n++)
- if (form.elements[n].type=='file' && form.elements[n].value)
- {
- send = true;
- break;
- }
-
- // create hidden iframe and post upload form
- if (send)
- {
- var ts = new Date().getTime();
- var frame_name = 'rcmupload'+ts;
-
- // have to do it this way for IE
- // otherwise the form will be posted to a new window
- if(document.all)
- {
- var html = '<iframe name="'+frame_name+'" src="program/blank.gif" style="width:0;height:0;visibility:hidden;"></iframe>';
- document.body.insertAdjacentHTML('BeforeEnd',html);
- }
- else // for standards-compilant browsers
- {
- var frame = document.createElement('IFRAME');
- frame.name = frame_name;
- frame.style.border = 'none';
- frame.style.width = 0;
- frame.style.height = 0;
- frame.style.visibility = 'hidden';
- document.body.appendChild(frame);
- }
-
- form.target = frame_name;
- form.action = this.env.comm_path+'&_action=upload';
- form.setAttribute('enctype', 'multipart/form-data');
- form.submit();
- }
-
- // set reference to the form object
- this.gui_objects.attachmentform = form;
- return true;
- };
-
- // add file name to attachment list
- // called from upload page
- this.add2attachment_list = function(name, content)
- {
- if (!this.gui_objects.attachmentlist)
- return false;
-
- var li = document.createElement('LI');
- li.id = name;
- li.innerHTML = content;
- this.gui_objects.attachmentlist.appendChild(li);
- return true;
- };
-
- this.remove_from_attachment_list = function(name)
- {
- if (!this.gui_objects.attachmentlist)
- return false;
-
- var list = this.gui_objects.attachmentlist.getElementsByTagName("li");
- for (i=0;i<list.length;i++)
- if (list[i].id == name)
- this.gui_objects.attachmentlist.removeChild(list[i]);
- };
-
- this.remove_attachment = function(name)
- {
- if (name)
- this.http_post('remove-attachment', '_file='+urlencode(name));
-
- return true;
- };
-
- // send remote request to add a new contact
- this.add_contact = function(value)
- {
- if (value)
- this.http_post('addcontact', '_address='+value);
-
- return true;
- };
-
- // send remote request to search mail or contacts
- this.qsearch = function(value, addurl)
- {
- if (value != '')
- {
- if (this.message_list)
- this.message_list.clear();
- else if (this.contact_list) {
- this.contact_list.clear(true);
- this.show_contentframe(false);
- }
-
- if (this.gui_objects.search_filter)
- addurl = '&_filter=' + this.gui_objects.search_filter.value;
-
- // reset vars
- this.env.current_page = 1;
- this.set_busy(true, 'searching');
- this.http_request('search', '_q='+urlencode(value)
- + (this.env.mailbox ? '&_mbox='+urlencode(this.env.mailbox) : '')
- + (this.env.source ? '&_source='+urlencode(this.env.source) : '')
- + (addurl ? addurl : ''), true);
- }
- return true;
- };
-
- // reset quick-search form
- this.reset_qsearch = function()
- {
- if (this.gui_objects.qsearchbox)
- this.gui_objects.qsearchbox.value = '';
-
- this.env.search_request = null;
- return true;
- };
-
- this.sent_successfully = function(type, msg)
- {
- this.list_mailbox();
- this.display_message(msg, type, true);
- }
-
-
- /*********************************************************/
- /********* keyboard live-search methods *********/
- /*********************************************************/
-
- // handler for keyboard events on address-fields
- this.ksearch_keypress = function(e, obj)
- {
- if (this.ksearch_timer)
- clearTimeout(this.ksearch_timer);
-
- var highlight;
- var key = rcube_event.get_keycode(e);
- var mod = rcube_event.get_modifier(e);
-
- switch (key)
- {
- case 38: // key up
- case 40: // key down
- if (!this.ksearch_pane)
- break;
-
- var dir = key==38 ? 1 : 0;
-
- highlight = document.getElementById('rcmksearchSelected');
- if (!highlight)
- highlight = this.ksearch_pane.ul.firstChild;
-
- if (highlight)
- this.ksearch_select(dir ? highlight.previousSibling : highlight.nextSibling);
-
- return rcube_event.cancel(e);
-
- case 9: // tab
- if(mod == SHIFT_KEY)
- break;
-
- case 13: // enter
- if (this.ksearch_selected===null || !this.ksearch_input || !this.ksearch_value)
- break;
-
- // insert selected address and hide ksearch pane
- this.insert_recipient(this.ksearch_selected);
- this.ksearch_hide();
-
- return rcube_event.cancel(e);
-
- case 27: // escape
- this.ksearch_hide();
- break;
-
- }
-
- // start timer
- this.ksearch_timer = window.setTimeout(function(){ ref.ksearch_get_results(); }, 200);
- this.ksearch_input = obj;
-
- return true;
- };
-
- this.ksearch_select = function(node)
- {
- var current = document.getElementById('rcmksearchSelected');
- if (current && node) {
- current.removeAttribute('id');
- this.set_classname(current, 'selected', false);
- }
-
- if (node) {
- node.setAttribute('id', 'rcmksearchSelected');
- this.set_classname(node, 'selected', true);
- this.ksearch_selected = node._rcm_id;
- }
- };
-
- this.insert_recipient = function(id)
- {
- if (!this.env.contacts[id] || !this.ksearch_input)
- return;
-
- // get cursor pos
- var inp_value = this.ksearch_input.value.toLowerCase();
- var cpos = this.get_caret_pos(this.ksearch_input);
- var p = inp_value.lastIndexOf(this.ksearch_value, cpos);
-
- // replace search string with full address
- var pre = this.ksearch_input.value.substring(0, p);
- var end = this.ksearch_input.value.substring(p+this.ksearch_value.length, this.ksearch_input.value.length);
- var insert = this.env.contacts[id]+', ';
- this.ksearch_input.value = pre + insert + end;
-
- // set caret to insert pos
- cpos = p+insert.length;
- if (this.ksearch_input.setSelectionRange)
- this.ksearch_input.setSelectionRange(cpos, cpos);
- };
-
- // address search processor
- this.ksearch_get_results = function()
- {
- var inp_value = this.ksearch_input ? this.ksearch_input.value : null;
- if (inp_value === null)
- return;
-
- if (this.ksearch_pane && this.ksearch_pane.visible)
- this.ksearch_pane.show(0);
-
- // get string from current cursor pos to last comma
- var cpos = this.get_caret_pos(this.ksearch_input);
- var p = inp_value.lastIndexOf(',', cpos-1);
- var q = inp_value.substring(p+1, cpos);
-
- // trim query string
- q = q.replace(/(^\s+|\s+$)/g, '').toLowerCase();
-
- // Don't (re-)search if string is empty or if the last results are still active
- if (!q.length || q == this.ksearch_value)
- return;
-
- this.ksearch_value = q;
-
- this.display_message(this.get_label('searching'), 'loading', true);
- this.http_post('autocomplete', '_search='+q);
- };
-
- this.ksearch_query_results = function(results)
- {
- this.hide_message();
- this.env.contacts = results ? results : [];
-
- var result_ids = new Array();
- var c=0;
- for (var i=0; i < this.env.contacts.length; i++) {
- result_ids[c++] = i;
- if (c == 15) // limit search results
- break;
- }
-
- this.ksearch_display_results(this.env.contacts, result_ids, c);
- };
-
- this.ksearch_display_results = function (a_results, a_result_ids, c)
- {
- // display search results
- if (c && a_results.length && this.ksearch_input) {
- var p, ul, li;
-
- // create results pane if not present
- if (!this.ksearch_pane) {
- ul = document.createElement('UL');
- this.ksearch_pane = new rcube_layer('rcmKSearchpane', {vis:0, zindex:30000});
- this.ksearch_pane.elm.appendChild(ul);
- this.ksearch_pane.ul = ul;
- }
- else
- ul = this.ksearch_pane.ul;
-
- // remove all search results
- ul.innerHTML = '';
-
- // add each result line to list
- for (i=0; i<a_results.length; i++) {
- li = document.createElement('LI');
- li.innerHTML = a_results[i].replace(new RegExp('('+this.ksearch_value+')', 'ig'), '##$1%%').replace(/</g, '<').replace(/>/g, '>').replace(/##([^%]+)%%/g, '<b>$1</b>');
- li.onmouseover = function(){ ref.ksearch_select(this); };
- li.onmouseup = function(){ ref.ksearch_click(this) };
- li._rcm_id = a_result_ids[i];
- ul.appendChild(li);
- }
-
- // check if last selected item is still in result list
- if (this.ksearch_selected !== null) {
- p = find_in_array(this.ksearch_selected, a_result_ids);
- if (p >= 0 && ul.childNodes) {
- ul.childNodes[p].setAttribute('id', 'rcmksearchSelected');
- this.set_classname(ul.childNodes[p], 'selected', true);
- }
- else
- this.ksearch_selected = null;
- }
-
- // if no item selected, select the first one
- if (this.ksearch_selected === null) {
- ul.firstChild.setAttribute('id', 'rcmksearchSelected');
- this.set_classname(ul.firstChild, 'selected', true);
- this.ksearch_selected = a_result_ids[0];
- }
-
- // move the results pane right under the input box and make it visible
- var pos = rcube_get_object_pos(this.ksearch_input);
- this.ksearch_pane.move(pos.x, pos.y+this.ksearch_input.offsetHeight);
- this.ksearch_pane.show(1);
- }
- // hide results pane
- else
- this.ksearch_hide();
- };
-
- this.ksearch_click = function(node)
- {
- this.insert_recipient(node._rcm_id);
- this.ksearch_hide();
-
- if (ref.ksearch_input)
- this.ksearch_input.focus();
- };
-
- this.ksearch_blur = function()
- {
- if (this.ksearch_timer)
- clearTimeout(this.ksearch_timer);
-
- this.ksearch_value = '';
- this.ksearch_input = null;
-
- this.ksearch_hide();
- };
-
-
- this.ksearch_hide = function()
- {
- this.ksearch_selected = null;
-
- if (this.ksearch_pane)
- this.ksearch_pane.show(0);
- };
-
-
- /*********************************************************/
- /********* address book methods *********/
- /*********************************************************/
-
- this.contactlist_keypress = function(list)
- {
- if (list.key_pressed == list.DELETE_KEY)
- this.command('delete');
- };
-
- this.contactlist_select = function(list)
- {
- if (this.preview_timer)
- clearTimeout(this.preview_timer);
-
- var id, frame, ref = this;
- if (id = list.get_single_selection())
- this.preview_timer = window.setTimeout(function(){ ref.load_contact(id, 'show'); }, 200);
- else if (this.env.contentframe)
- this.show_contentframe(false);
-
- this.enable_command('compose', list.selection.length > 0);
- this.enable_command('edit', (id && this.env.address_sources && !this.env.address_sources[this.env.source].readonly) ? true : false);
- this.enable_command('delete', list.selection.length && this.env.address_sources && !this.env.address_sources[this.env.source].readonly);
-
- return false;
- };
-
- this.list_contacts = function(src, page)
- {
- var add_url = '';
- var target = window;
-
- if (!src)
- src = this.env.source;
-
- if (page && this.current_page==page && src == this.env.source)
- return false;
-
- if (src != this.env.source)
- {
- page = 1;
- this.env.current_page = page;
- this.reset_qsearch();
- }
-
- this.select_folder(src, this.env.source);
- this.env.source = src;
-
- // load contacts remotely
- if (this.gui_objects.contactslist)
- {
- this.list_contacts_remote(src, page);
- return;
- }
-
- if (this.env.contentframe && window.frames && window.frames[this.env.contentframe])
- {
- target = window.frames[this.env.contentframe];
- add_url = '&_framed=1';
- }
-
- // also send search request to get the correct listing
- if (this.env.search_request)
- add_url += '&_search='+this.env.search_request;
-
- this.set_busy(true, 'loading');
- target.location.href = this.env.comm_path+(src ? '&_source='+urlencode(src) : '')+(page ? '&_page='+page : '')+add_url;
- };
-
- // send remote request to load contacts list
- this.list_contacts_remote = function(src, page)
- {
- // clear message list first
- this.contact_list.clear(true);
- this.show_contentframe(false);
- this.enable_command('delete', 'compose', false);
-
- // send request to server
- var url = (src ? '_source='+urlencode(src) : '') + (page ? (src?'&':'') + '_page='+page : '');
- this.env.source = src;
-
- // also send search request to get the right messages
- if (this.env.search_request)
- url += '&_search='+this.env.search_request;
-
- this.set_busy(true, 'loading');
- this.http_request('list', url, true);
- };
-
- // load contact record
- this.load_contact = function(cid, action, framed)
- {
- var add_url = '';
- var target = window;
- if (this.env.contentframe && window.frames && window.frames[this.env.contentframe])
- {
- add_url = '&_framed=1';
- target = window.frames[this.env.contentframe];
- this.show_contentframe(true);
- }
- else if (framed)
- return false;
-
- if (action && (cid || action=='add') && !this.drag_active)
- {
- this.set_busy(true);
- target.location.href = this.env.comm_path+'&_action='+action+'&_source='+urlencode(this.env.source)+'&_cid='+urlencode(cid) + add_url;
- }
- return true;
- };
-
- // copy a contact to the specified target (group or directory)
- this.copy_contact = function(cid, to)
- {
- if (!cid)
- cid = this.contact_list.get_selection().join(',');
-
- if (to != this.env.source && cid && this.env.address_sources[to] && !this.env.address_sources[to].readonly)
- this.http_post('copy', '_cid='+urlencode(cid)+'&_source='+urlencode(this.env.source)+'&_to='+urlencode(to));
- };
-
-
- this.delete_contacts = function()
- {
- // exit if no mailbox specified or if selection is empty
- var selection = this.contact_list.get_selection();
- if (!(selection.length || this.env.cid) || !confirm(this.get_label('deletecontactconfirm')))
- return;
-
- var a_cids = new Array();
- var qs = '';
-
- if (this.env.cid)
- a_cids[a_cids.length] = this.env.cid;
- else
- {
- var id;
- for (var n=0; n<selection.length; n++)
- {
- id = selection[n];
- a_cids[a_cids.length] = id;
- this.contact_list.remove_row(id, (n == selection.length-1));
- }
-
- // hide content frame if we delete the currently displayed contact
- if (selection.length == 1)
- this.show_contentframe(false);
- }
-
- // also send search request to get the right records from the next page
- if (this.env.search_request)
- qs += '&_search='+this.env.search_request;
-
- // send request to server
- this.http_post('delete', '_cid='+urlencode(a_cids.join(','))+'&_source='+urlencode(this.env.source)+'&_from='+(this.env.action ? this.env.action : '')+qs);
- return true;
- };
-
- // update a contact record in the list
- this.update_contact_row = function(cid, cols_arr)
- {
- var row;
- if (this.contact_list.rows[cid] && (row = this.contact_list.rows[cid].obj))
- {
- for (var c=0; c<cols_arr.length; c++)
- if (row.cells[c])
- row.cells[c].innerHTML = cols_arr[c];
-
- return true;
- }
-
- return false;
- };
-
-
- /*********************************************************/
- /********* user settings methods *********/
- /*********************************************************/
-
- this.init_subscription_list = function()
- {
- var p = this;
- this.subscription_list = new rcube_list_widget(this.gui_objects.subscriptionlist, {multiselect:false, draggable:true, keyboard:false, toggleselect:true});
- this.subscription_list.addEventListener('select', function(o){ p.subscription_select(o); });
- this.subscription_list.addEventListener('dragstart', function(o){ p.drag_active = true; });
- this.subscription_list.addEventListener('dragend', function(o){ p.subscription_move_folder(o); });
- this.subscription_list.row_init = function (row)
- {
- var anchors = row.obj.getElementsByTagName('A');
- if (anchors[0])
- anchors[0].onclick = function() { p.rename_folder(row.id); return false; };
- if (anchors[1])
- anchors[1].onclick = function() { p.delete_folder(row.id); return false; };
- row.obj.onmouseover = function() { p.focus_subscription(row.id); };
- row.obj.onmouseout = function() { p.unfocus_subscription(row.id); };
- }
- this.subscription_list.init();
- }
-
- this.identity_select = function(list)
- {
- var id;
- if (id = list.get_single_selection())
- this.load_identity(id, 'edit-identity');
- };
-
- // load contact record
- this.load_identity = function(id, action)
- {
- if (action=='edit-identity' && (!id || id==this.env.iid))
- return false;
-
- var add_url = '';
- var target = window;
- if (this.env.contentframe && window.frames && window.frames[this.env.contentframe])
- {
- add_url = '&_framed=1';
- target = window.frames[this.env.contentframe];
- document.getElementById(this.env.contentframe).style.visibility = 'inherit';
- }
-
- if (action && (id || action=='add-identity'))
- {
- this.set_busy(true);
- target.location.href = this.env.comm_path+'&_action='+action+'&_iid='+id+add_url;
- }
- return true;
- };
-
- this.delete_identity = function(id)
- {
- // exit if no mailbox specified or if selection is empty
- var selection = this.identity_list.get_selection();
- if (!(selection.length || this.env.iid))
- return;
-
- if (!id)
- id = this.env.iid ? this.env.iid : selection[0];
-
- // if (this.env.framed && id)
- this.goto_url('delete-identity', '_iid='+id, true);
- return true;
- };
-
- this.focus_subscription = function(id)
- {
- var row, folder;
- var reg = RegExp('['+RegExp.escape(this.env.delimiter)+']?[^'+RegExp.escape(this.env.delimiter)+']+$');
-
- if (this.drag_active && this.env.folder && (row = document.getElementById(id)))
- if (this.env.subscriptionrows[id] &&
- (folder = this.env.subscriptionrows[id][0]))
- {
- if (this.check_droptarget(folder) &&
- !this.env.subscriptionrows[this.get_folder_row_id(this.env.folder)][2] &&
- (folder != this.env.folder.replace(reg, '')) &&
- (!folder.match(new RegExp('^'+RegExp.escape(this.env.folder+this.env.delimiter)))))
- {
- this.set_env('dstfolder', folder);
- this.set_classname(row, 'droptarget', true);
- }
- }
- else if (this.env.folder.match(new RegExp(RegExp.escape(this.env.delimiter))))
- {
- this.set_env('dstfolder', this.env.delimiter);
- this.set_classname(this.subscription_list.frame, 'droptarget', true);
- }
- }
-
- this.unfocus_subscription = function(id)
- {
- var row;
- this.set_env('dstfolder', null);
- if (this.env.subscriptionrows[id] &&
- (row = document.getElementById(id)))
- this.set_classname(row, 'droptarget', false);
- else
- this.set_classname(this.subscription_list.frame, 'droptarget', false);
- }
-
- this.subscription_select = function(list)
- {
- var id, folder;
- if ((id = list.get_single_selection()) &&
- this.env.subscriptionrows['rcmrow'+id] &&
- (folder = this.env.subscriptionrows['rcmrow'+id][0]))
- this.set_env('folder', folder);
- else
- this.set_env('folder', null);
-
- if (this.gui_objects.createfolderhint)
- this.gui_objects.createfolderhint.innerHTML = this.env.folder ? this.get_label('addsubfolderhint') : '';
- };
-
- this.subscription_move_folder = function(list)
- {
- var reg = RegExp('['+RegExp.escape(this.env.delimiter)+']?[^'+RegExp.escape(this.env.delimiter)+']+$');
- if (this.env.folder && this.env.dstfolder && (this.env.dstfolder != this.env.folder) &&
- (this.env.dstfolder != this.env.folder.replace(reg, '')))
- {
- var reg = new RegExp('[^'+RegExp.escape(this.env.delimiter)+']*['+RegExp.escape(this.env.delimiter)+']', 'g');
- var basename = this.env.folder.replace(reg, '');
- var newname = this.env.dstfolder==this.env.delimiter ? basename : this.env.dstfolder+this.env.delimiter+basename;
-
- this.set_busy(true, 'foldermoving');
- this.http_post('rename-folder', '_folder_oldname='+urlencode(this.env.folder)+'&_folder_newname='+urlencode(newname), true);
- }
- this.drag_active = false;
- this.unfocus_subscription(this.get_folder_row_id(this.env.dstfolder));
- };
-
- // tell server to create and subscribe a new mailbox
- this.create_folder = function(name)
- {
- if (this.edit_folder)
- this.reset_folder_rename();
-
- var form;
- if ((form = this.gui_objects.editform) && form.elements['_folder_name'])
- {
- name = form.elements['_folder_name'].value;
-
- if (name.indexOf(this.env.delimiter)>=0)
- {
- alert(this.get_label('forbiddencharacter')+' ('+this.env.delimiter+')');
- return false;
- }
-
- if (this.env.folder && name != '')
- name = this.env.folder+this.env.delimiter+name;
-
- this.set_busy(true, 'foldercreating');
- this.http_post('create-folder', '_name='+urlencode(name), true);
- }
- else if (form.elements['_folder_name'])
- form.elements['_folder_name'].focus();
- };
-
- // start renaming the mailbox name.
- // this will replace the name string with an input field
- this.rename_folder = function(id)
- {
- var temp, row, form;
-
- // reset current renaming
- if (temp = this.edit_folder)
- {
- this.reset_folder_rename();
- if (temp == id)
- return;
- }
-
- if (id && this.env.subscriptionrows[id] && (row = document.getElementById(id)))
- {
- var reg = new RegExp('.*['+RegExp.escape(this.env.delimiter)+']');
- this.name_input = document.createElement('INPUT');
- this.name_input.value = this.env.subscriptionrows[id][0].replace(reg, '');
- this.name_input.style.width = '100%';
-
- reg = new RegExp('['+RegExp.escape(this.env.delimiter)+']?[^'+RegExp.escape(this.env.delimiter)+']+$');
- this.name_input.__parent = this.env.subscriptionrows[id][0].replace(reg, '');
- this.name_input.onkeypress = function(e){ rcmail.name_input_keypress(e); };
-
- row.cells[0].replaceChild(this.name_input, row.cells[0].firstChild);
- this.edit_folder = id;
- this.name_input.select();
-
- if (form = this.gui_objects.editform)
- form.onsubmit = function(){ return false; };
- }
- };
-
- // remove the input field and write the current mailbox name to the table cell
- this.reset_folder_rename = function()
- {
- var cell = this.name_input ? this.name_input.parentNode : null;
-
- if (cell && this.edit_folder && this.env.subscriptionrows[this.edit_folder])
- cell.innerHTML = this.env.subscriptionrows[this.edit_folder][1];
-
- this.edit_folder = null;
- };
-
- // handler for keyboard events on the input field
- this.name_input_keypress = function(e)
- {
- var key = rcube_event.get_keycode(e);
-
- // enter
- if (key==13)
- {
- var newname = this.name_input ? this.name_input.value : null;
- if (this.edit_folder && newname)
- {
- if (newname.indexOf(this.env.delimiter)>=0)
- {
- alert(this.get_label('forbiddencharacter')+' ('+this.env.delimiter+')');
- return false;
- }
-
- if (this.name_input.__parent)
- newname = this.name_input.__parent + this.env.delimiter + newname;
-
- this.set_busy(true, 'folderrenaming');
- this.http_post('rename-folder', '_folder_oldname='+urlencode(this.env.subscriptionrows[this.edit_folder][0])+'&_folder_newname='+urlencode(newname), true);
- }
- }
- // escape
- else if (key==27)
- this.reset_folder_rename();
- };
-
- // delete a specific mailbox with all its messages
- this.delete_folder = function(id)
- {
- var folder = this.env.subscriptionrows[id][0];
-
- if (this.edit_folder)
- this.reset_folder_rename();
-
- if (folder && confirm(this.get_label('deletefolderconfirm')))
- {
- this.set_busy(true, 'folderdeleting');
- this.http_post('delete-folder', '_mboxes='+urlencode(folder), true);
- this.set_env('folder', null);
-
- if (this.gui_objects.createfolderhint)
- this.gui_objects.createfolderhint.innerHTML = '';
- }
- };
-
- // add a new folder to the subscription list by cloning a folder row
- this.add_folder_row = function(name, display_name, replace, before)
- {
- if (!this.gui_objects.subscriptionlist)
- return false;
-
- // find not protected folder
- for (var refid in this.env.subscriptionrows)
- if (this.env.subscriptionrows[refid]!=null && !this.env.subscriptionrows[refid][2])
- break;
-
- var refrow, form;
- var tbody = this.gui_objects.subscriptionlist.tBodies[0];
- var id = 'rcmrow'+(tbody.childNodes.length+1);
- var selection = this.subscription_list.get_single_selection();
-
- if (replace && replace.id)
- {
- id = replace.id;
- refid = replace.id;
- }
-
- if (!id || !(refrow = document.getElementById(refid)))
- {
- // Refresh page if we don't have a table row to clone
- this.goto_url('folders');
- }
- else
- {
- // clone a table row if there are existing rows
- var row = this.clone_table_row(refrow);
- row.id = id;
-
- if (before && (before = this.get_folder_row_id(before)))
- tbody.insertBefore(row, document.getElementById(before));
- else
- tbody.appendChild(row);
-
- if (replace)
- tbody.removeChild(replace);
- }
-
- // add to folder/row-ID map
- this.env.subscriptionrows[row.id] = [name, display_name, 0];
-
- // set folder name
- row.cells[0].innerHTML = display_name;
-
- // set messages count to zero
- if (!replace)
- row.cells[1].innerHTML = '*';
-
- if (!replace && row.cells[2] && row.cells[2].firstChild.tagName=='INPUT')
- {
- row.cells[2].firstChild.value = name;
- row.cells[2].firstChild.checked = true;
- }
-
- // add new folder to rename-folder list and clear input field
- if (!replace && (form = this.gui_objects.editform))
- {
- if (form.elements['_folder_oldname'])
- form.elements['_folder_oldname'].options[form.elements['_folder_oldname'].options.length] = new Option(name,name);
- if (form.elements['_folder_name'])
- form.elements['_folder_name'].value = '';
- }
-
- this.init_subscription_list();
- if (selection && document.getElementById('rcmrow'+selection))
- this.subscription_list.select_row(selection);
-
- if (document.getElementById(id).scrollIntoView)
- document.getElementById(id).scrollIntoView();
- };
-
- // replace an existing table row with a new folder line
- this.replace_folder_row = function(oldfolder, newfolder, display_name, before)
- {
- var id = this.get_folder_row_id(oldfolder);
- var row = document.getElementById(id);
-
- // replace an existing table row (if found)
- this.add_folder_row(newfolder, display_name, row, before);
-
- // rename folder in rename-folder dropdown
- var form, elm;
- if ((form = this.gui_objects.editform) && (elm = form.elements['_folder_oldname']))
- {
- for (var i=0;i<elm.options.length;i++)
- {
- if (elm.options[i].value == oldfolder)
- {
- elm.options[i].text = display_name;
- elm.options[i].value = newfolder;
- break;
- }
- }
-
- form.elements['_folder_newname'].value = '';
- }
- };
-
- // remove the table row of a specific mailbox from the table
- // (the row will not be removed, just hidden)
- this.remove_folder_row = function(folder)
- {
- var row;
- var id = this.get_folder_row_id(folder);
- if (id && (row = document.getElementById(id)))
- row.style.display = 'none';
-
- // remove folder from rename-folder list
- var form;
- if ((form = this.gui_objects.editform) && form.elements['_folder_oldname'])
- {
- for (var i=0;i<form.elements['_folder_oldname'].options.length;i++)
- {
- if (form.elements['_folder_oldname'].options[i].value == folder)
- {
- form.elements['_folder_oldname'].options[i] = null;
- break;
- }
- }
- }
-
- if (form && form.elements['_folder_newname'])
- form.elements['_folder_newname'].value = '';
- };
-
- this.subscribe_folder = function(folder)
- {
- if (folder)
- this.http_post('subscribe', '_mbox='+urlencode(folder));
- };
-
- this.unsubscribe_folder = function(folder)
- {
- if (folder)
- this.http_post('unsubscribe', '_mbox='+urlencode(folder));
- };
-
- // helper method to find a specific mailbox row ID
- this.get_folder_row_id = function(folder)
- {
- for (var id in this.env.subscriptionrows)
- if (this.env.subscriptionrows[id] && this.env.subscriptionrows[id][0] == folder)
- break;
-
- return id;
- };
-
- // duplicate a specific table row
- this.clone_table_row = function(row)
- {
- var cell, td;
- var new_row = document.createElement('TR');
- for(var n=0; n<row.cells.length; n++)
- {
- cell = row.cells[n];
- td = document.createElement('TD');
-
- if (cell.className)
- td.className = cell.className;
- if (cell.align)
- td.setAttribute('align', cell.align);
-
- td.innerHTML = cell.innerHTML;
- new_row.appendChild(td);
- }
-
- return new_row;
- };
-
-
- /*********************************************************/
- /********* GUI functionality *********/
- /*********************************************************/
-
- // eable/disable buttons for page shifting
- this.set_page_buttons = function()
- {
- this.enable_command('nextpage', (this.env.pagecount > this.env.current_page));
- this.enable_command('lastpage', (this.env.pagecount > this.env.current_page));
- this.enable_command('previouspage', (this.env.current_page > 1));
- this.enable_command('firstpage', (this.env.current_page > 1));
- }
-
- // set button to a specific state
- this.set_button = function(command, state)
- {
- var a_buttons = this.buttons[command];
- var button, obj;
-
- if(!a_buttons || !a_buttons.length)
- return false;
-
- for(var n=0; n<a_buttons.length; n++)
- {
- button = a_buttons[n];
- obj = document.getElementById(button.id);
-
- // get default/passive setting of the button
- if (obj && button.type=='image' && !button.status) {
- button.pas = obj._original_src ? obj._original_src : obj.src;
- // respect PNG fix on IE browsers
- if (obj.runtimeStyle && obj.runtimeStyle.filter && obj.runtimeStyle.filter.match(/src=['"]([^'"]+)['"]/))
- button.pas = RegExp.$1;
- }
- else if (obj && !button.status)
- button.pas = String(obj.className);
-
- // set image according to button state
- if (obj && button.type=='image' && button[state])
- {
- button.status = state;
- obj.src = button[state];
- }
- // set class name according to button state
- else if (obj && typeof(button[state])!='undefined')
- {
- button.status = state;
- obj.className = button[state];
- }
- // disable/enable input buttons
- if (obj && button.type=='input')
- {
- button.status = state;
- obj.disabled = !state;
- }
- }
- };
-
- // display a specific alttext
- this.set_alttext = function(command, label)
- {
- if (!this.buttons[command] || !this.buttons[command].length)
- return;
-
- var button, obj, link;
- for (var n=0; n<this.buttons[command].length; n++)
- {
- button = this.buttons[command][n];
- obj = document.getElementById(button.id);
-
- if (button.type=='image' && obj)
- {
- obj.setAttribute('alt', this.get_label(label));
- if ((link = obj.parentNode) && link.tagName == 'A')
- link.setAttribute('title', this.get_label(label));
- }
- else if (obj)
- obj.setAttribute('title', this.get_label(label));
- }
- };
-
- // mouse over button
- this.button_over = function(command, id)
- {
- var a_buttons = this.buttons[command];
- var button, img;
-
- if(!a_buttons || !a_buttons.length)
- return false;
-
- for(var n=0; n<a_buttons.length; n++)
- {
- button = a_buttons[n];
- if(button.id==id && button.status=='act')
- {
- img = document.getElementById(button.id);
- if (img && button.over)
- img.src = button.over;
- }
- }
-
- };
-
- // mouse down on button
- this.button_sel = function(command, id)
- {
- var a_buttons = this.buttons[command];
- var button, img;
-
- if(!a_buttons || !a_buttons.length)
- return;
-
- for(var n=0; n<a_buttons.length; n++)
- {
- button = a_buttons[n];
- if(button.id==id && button.status=='act')
- {
- img = document.getElementById(button.id);
- if (img && button.sel)
- img.src = button.sel;
- }
- }
- };
-
- // mouse out of button
- this.button_out = function(command, id)
- {
- var a_buttons = this.buttons[command];
- var button, img;
-
- if(!a_buttons || !a_buttons.length)
- return;
-
- for(var n=0; n<a_buttons.length; n++)
- {
- button = a_buttons[n];
- if(button.id==id && button.status=='act')
- {
- img = document.getElementById(button.id);
- if (img && button.act)
- img.src = button.act;
- }
- }
- };
-
- // set/unset a specific class name
- this.set_classname = function(obj, classname, set)
- {
- var reg = new RegExp('\s*'+classname, 'i');
- if (!set && obj.className.match(reg))
- obj.className = obj.className.replace(reg, '');
- else if (set && !obj.className.match(reg))
- obj.className += ' '+classname;
- };
-
- // write to the document/window title
- this.set_pagetitle = function(title)
- {
- if (title && document.title)
- document.title = title;
- }
-
- // display a system message
- this.display_message = function(msg, type, hold)
- {
- if (!this.loaded) // save message in order to display after page loaded
- {
- this.pending_message = new Array(msg, type);
- return true;
- }
-
- // pass command to parent window
- if (this.env.framed && parent.rcmail)
- return parent.rcmail.display_message(msg, type, hold);
-
- if (!this.gui_objects.message)
- return false;
-
- if (this.message_timer)
- clearTimeout(this.message_timer);
-
- var cont = msg;
- if (type)
- cont = '<div class="'+type+'">'+cont+'</div>';
-
- var _rcube = this;
- this.gui_objects.message.innerHTML = cont;
- this.gui_objects.message.style.display = 'block';
-
- if (type!='loading')
- this.gui_objects.message.onmousedown = function(){ _rcube.hide_message(); return true; };
-
- if (!hold)
- this.message_timer = window.setTimeout(function(){ ref.hide_message(); }, this.message_time);
- };
-
- // make a message row disapear
- this.hide_message = function()
- {
- if (this.gui_objects.message)
- {
- this.gui_objects.message.style.display = 'none';
- this.gui_objects.message.onmousedown = null;
- }
- };
-
- // mark a mailbox as selected and set environment variable
- this.select_folder = function(name, old)
- {
- if (this.gui_objects.folderlist)
- {
- var current_li, target_li;
-
- if ((current_li = this.get_folder_li(old)))
- {
- this.set_classname(current_li, 'selected', false);
- this.set_classname(current_li, 'unfocused', false);
- }
-
- if ((target_li = this.get_folder_li(name)))
- {
- this.set_classname(target_li, 'unfocused', false);
- this.set_classname(target_li, 'selected', true);
- }
- }
- };
-
- // helper method to find a folder list item
- this.get_folder_li = function(name)
- {
- if (this.gui_objects.folderlist)
- {
- name = String(name).replace(this.identifier_expr, '');
- return document.getElementById('rcmli'+name);
- }
-
- return null;
- };
-
- // for reordering column array, Konqueror workaround
- this.set_message_coltypes = function(coltypes)
- {
- this.coltypes = coltypes;
-
- // set correct list titles
- var cell, col;
- var thead = this.gui_objects.messagelist ? this.gui_objects.messagelist.tHead : null;
- for (var n=0; thead && n<this.coltypes.length; n++)
- {
- col = this.coltypes[n];
- if ((cell = thead.rows[0].cells[n+1]) && (col=='from' || col=='to'))
- {
- // if we have links for sorting, it's a bit more complicated...
- if (cell.firstChild && cell.firstChild.tagName=='A')
- {
- cell.firstChild.innerHTML = this.get_label(this.coltypes[n]);
- cell.firstChild.onclick = function(){ return rcmail.command('sort', this.__col, this); };
- cell.firstChild.__col = col;
- }
- else
- cell.innerHTML = this.get_label(this.coltypes[n]);
-
- cell.id = 'rcm'+col;
- }
- else if (col == 'subject' && this.message_list)
- this.message_list.subject_col = n+1;
- }
- };
-
- // create a table row in the message list
- this.add_message_row = function(uid, cols, flags, attachment, attop)
- {
- if (!this.gui_objects.messagelist || !this.message_list)
- return false;
-
- var tbody = this.gui_objects.messagelist.tBodies[0];
- var rowcount = tbody.rows.length;
- var even = rowcount%2;
-
- this.env.messages[uid] = {deleted:flags.deleted?1:0,
- replied:flags.replied?1:0,
- unread:flags.unread?1:0,
- forwarded:flags.forwarded?1:0,
- flagged:flags.flagged?1:0};
-
- var row = document.createElement('TR');
- row.id = 'rcmrow'+uid;
- row.className = 'message'
- + (even ? ' even' : ' odd')
- + (flags.unread ? ' unread' : '')
- + (flags.deleted ? ' deleted' : '')
- + (flags.flagged ? ' flagged' : '');
-
- if (this.message_list.in_selection(uid))
- row.className += ' selected';
-
- var icon = this.env.messageicon;
- if (flags.deleted && this.env.deletedicon)
- icon = this.env.deletedicon;
- else if (flags.replied && this.env.repliedicon)
- {
- if (flags.forwarded && this.env.forwardedrepliedicon)
- icon = this.env.forwardedrepliedicon;
- else
- icon = this.env.repliedicon;
- }
- else if (flags.forwarded && this.env.forwardedicon)
- icon = this.env.forwardedicon;
- else if(flags.unread && this.env.unreadicon)
- icon = this.env.unreadicon;
-
- var col = document.createElement('TD');
- col.className = 'icon';
- col.innerHTML = icon ? '<img src="'+icon+'" alt="" />' : '';
- row.appendChild(col);
-
- // add each submitted col
- for (var n = 0; n < this.coltypes.length; n++)
- {
- var c = this.coltypes[n];
- col = document.createElement('TD');
- col.className = String(c).toLowerCase();
-
- if (c=='flag')
- {
- if (flags.flagged && this.env.flaggedicon)
- col.innerHTML = '<img src="'+this.env.flaggedicon+'" alt="" />';
- else if(!flags.flagged && this.env.unflaggedicon)
- col.innerHTML = '<img src="'+this.env.unflaggedicon+'" alt="" />';
- }
- else if (c=='attachment')
- col.innerHTML = attachment && this.env.attachmenticon ? '<img src="'+this.env.attachmenticon+'" alt="" />' : ' ';
- else
- col.innerHTML = cols[c];
-
- row.appendChild(col);
- }
-
- this.message_list.insert_row(row, attop);
-
- // remove 'old' row
- if (attop && this.env.pagesize && this.message_list.rowcount > this.env.pagesize)
- {
- var uid = this.message_list.get_last_row();
- this.message_list.remove_row(uid);
- this.message_list.clear_selection(uid);
- }
- };
-
- // replace content of row count display
- this.set_rowcount = function(text)
- {
- if (this.gui_objects.countdisplay)
- this.gui_objects.countdisplay.innerHTML = text;
-
- // update page navigation buttons
- this.set_page_buttons();
- };
-
- // replace content of mailboxname display
- this.set_mailboxname = function(content)
- {
- if (this.gui_objects.mailboxname && content)
- this.gui_objects.mailboxname.innerHTML = content;
- };
-
- // replace content of quota display
- this.set_quota = function(content)
- {
- if (this.gui_objects.quotadisplay && content)
- this.gui_objects.quotadisplay.innerHTML = content;
- };
-
- // update the mailboxlist
- this.set_unread_count = function(mbox, count, set_title)
- {
- if (!this.gui_objects.mailboxlist)
- return false;
-
- this.env.unread_counts[mbox] = count;
- this.set_unread_count_display(mbox, set_title);
- }
-
- // update the mailbox count display
- this.set_unread_count_display = function(mbox, set_title)
- {
- var reg, text_obj, item, mycount, childcount, div;
- if (item = this.get_folder_li(mbox))
- {
- mycount = this.env.unread_counts[mbox] ? this.env.unread_counts[mbox] : 0;
- text_obj = item.getElementsByTagName('a')[0];
- reg = /\s+\([0-9]+\)$/i;
-
- childcount = 0;
- if ((div = item.getElementsByTagName('div')[0]) &&
- div.className.match(/collapsed/))
- {
- // add children's counters
- for (var k in this.env.unread_counts)
- if (k.indexOf(mbox + this.env.delimiter) == 0) {
- childcount += this.env.unread_counts[k];
- }
- }
-
- if (mycount && text_obj.innerHTML.match(reg))
- text_obj.innerHTML = text_obj.innerHTML.replace(reg, ' ('+mycount+')');
- else if (mycount)
- text_obj.innerHTML += ' ('+mycount+')';
- else
- text_obj.innerHTML = text_obj.innerHTML.replace(reg, '');
-
- // set parent's display
- reg = new RegExp(RegExp.escape(this.env.delimiter) + '[^' + RegExp.escape(this.env.delimiter) + ']+$');
- if (mbox.match(reg))
- this.set_unread_count_display(mbox.replace(reg, ''), false);
-
- // set the right classes
- this.set_classname(item, 'unread', (mycount+childcount)>0 ? true : false);
- }
-
- // set unread count to window title
- reg = /^\([0-9]+\)\s+/i;
- if (set_title && document.title)
- {
- var doc_title = String(document.title);
- var new_title = "";
-
- if (mycount && doc_title.match(reg))
- new_title = doc_title.replace(reg, '('+mycount+') ');
- else if (mycount)
- new_title = '('+mycount+') '+doc_title;
- else
- new_title = doc_title.replace(reg, '');
-
- this.set_pagetitle(new_title);
- }
- };
-
- // notifies that a new message(s) has hit the mailbox
- this.new_message_focus = function()
- {
- // focus main window
- if (this.env.framed && window.parent)
- window.parent.focus();
- else
- window.focus();
- }
-
- // add row to contacts list
- this.add_contact_row = function(cid, cols, select)
- {
- if (!this.gui_objects.contactslist || !this.gui_objects.contactslist.tBodies[0])
- return false;
-
- var tbody = this.gui_objects.contactslist.tBodies[0];
- var rowcount = tbody.rows.length;
- var even = rowcount%2;
-
- var row = document.createElement('TR');
- row.id = 'rcmrow'+cid;
- row.className = 'contact '+(even ? 'even' : 'odd');
-
- if (this.contact_list.in_selection(cid))
- row.className += ' selected';
-
- // add each submitted col
- for (var c in cols)
- {
- col = document.createElement('TD');
- col.className = String(c).toLowerCase();
- col.innerHTML = cols[c];
- row.appendChild(col);
- }
-
- this.contact_list.insert_row(row);
- this.enable_command('export', (this.contact_list.rowcount > 0));
- };
-
- this.toggle_prefer_html = function(checkbox)
- {
- var addrbook_show_images;
- if (addrbook_show_images = document.getElementById('rcmfd_addrbook_show_images'))
- addrbook_show_images.disabled = !checkbox.checked;
- }
-
- // display fetched raw headers
- this.set_headers = function(content)
- {
- if (this.gui_objects.all_headers_row && this.gui_objects.all_headers_box && content)
- {
- var box = this.gui_objects.all_headers_box;
- box.innerHTML = content;
- box.style.display = 'block';
-
- if (this.env.framed && parent.rcmail)
- parent.rcmail.set_busy(false);
- else
- this.set_busy(false);
- }
- };
-
- // display all-headers row and fetch raw message headers
- this.load_headers = function(elem)
- {
- if (!this.gui_objects.all_headers_row || !this.gui_objects.all_headers_box || !this.env.uid)
- return;
-
- this.set_classname(elem, 'show-headers', false);
- this.set_classname(elem, 'hide-headers', true);
- this.gui_objects.all_headers_row.style.display = bw.ie ? 'block' : 'table-row';
- elem.onclick = function() { rcmail.hide_headers(elem); }
-
- // fetch headers only once
- if (!this.gui_objects.all_headers_box.innerHTML)
- {
- this.display_message(this.get_label('loading'), 'loading', true);
- this.http_post('headers', '_uid='+this.env.uid);
- }
- }
-
- // hide all-headers row
- this.hide_headers = function(elem)
- {
- if (!this.gui_objects.all_headers_row || !this.gui_objects.all_headers_box)
- return;
-
- this.set_classname(elem, 'hide-headers', false);
- this.set_classname(elem, 'show-headers', true);
- this.gui_objects.all_headers_row.style.display = 'none';
- elem.onclick = function() { rcmail.load_headers(elem); }
- }
-
-
- /********************************************************/
- /********* html to text conversion functions *********/
- /********************************************************/
-
- this.html2plain = function(htmlText, id)
- {
- var http_request = new rcube_http_request();
- var url = this.env.bin_path+'html2text.php';
- var rcmail = this;
-
- this.set_busy(true, 'converting');
- //console.log('HTTP POST: '+url);
-
- http_request.onerror = function(o) { rcmail.http_error(o); };
- http_request.oncomplete = function(o) { rcmail.set_text_value(o, id); };
- http_request.POST(url, htmlText, 'application/octet-stream');
- }
-
- this.set_text_value = function(httpRequest, id)
- {
- this.set_busy(false);
- document.getElementById(id).value = httpRequest.get_text();
- //console.log(httpRequest.get_text());
- }
-
-
- /********************************************************/
- /********* remote request methods *********/
- /********************************************************/
-
- this.redirect = function(url, lock)
- {
- if (lock || lock === null)
- this.set_busy(true);
-
- if (this.env.framed && window.parent)
- parent.location.href = url;
- else
- location.href = url;
- };
-
- this.goto_url = function(action, query, lock)
- {
- var querystring = query ? '&'+query : '';
- this.redirect(this.env.comm_path+'&_action='+action+querystring, lock);
- };
-
- this.http_sockets = new Array();
-
- // find a non-busy socket or create a new one
- this.get_request_obj = function()
- {
- for (var n=0; n<this.http_sockets.length; n++)
- {
- if (!this.http_sockets[n].busy)
- return this.http_sockets[n];
- }
-
- // create a new XMLHTTP object
- var i = this.http_sockets.length;
- this.http_sockets[i] = new rcube_http_request();
-
- return this.http_sockets[i];
- };
-
- // send a http request to the server
- this.http_request = function(action, querystring, lock)
- {
- var request_obj = this.get_request_obj();
- querystring += (querystring ? '&' : '') + '_remote=1';
-
- // add timestamp to request url to avoid cacheing problems in Safari
- if (bw.safari)
- querystring += '&_ts='+(new Date().getTime());
-
- // send request
- if (request_obj)
- {
- //console.log('HTTP request: '+this.env.comm_path+'&_action='+action+'&'+querystring);
-
- if (lock)
- this.set_busy(true);
-
- var rcm = this;
- request_obj.__lock = lock ? true : false;
- request_obj.__action = action;
- request_obj.onerror = function(o){ ref.http_error(o); };
- request_obj.oncomplete = function(o){ ref.http_response(o); };
- request_obj.GET(this.env.comm_path+'&_action='+action+'&'+querystring);
- }
- };
-
- // send a http POST request to the server
- this.http_post = function(action, postdata, lock)
- {
- var request_obj;
- if (postdata && typeof(postdata) == 'object')
- postdata._remote = 1;
- else
- postdata += (postdata ? '&' : '') + '_remote=1';
-
- // send request
- if (request_obj = this.get_request_obj())
- {
- //console.log('HTTP POST: '+this.env.comm_path+'&_action='+action);
-
- if (lock)
- this.set_busy(true);
-
- var rcm = this;
- request_obj.__lock = lock ? true : false;
- request_obj.__action = action;
- request_obj.onerror = function(o){ rcm.http_error(o); };
- request_obj.oncomplete = function(o){ rcm.http_response(o); };
- request_obj.POST(this.env.comm_path+'&_action='+action, postdata);
- }
- };
-
- // handle HTTP response
- this.http_response = function(request_obj)
- {
- var ctype = request_obj.get_header('Content-Type');
- if (ctype)
- {
- ctype = String(ctype).toLowerCase();
- var ctype_array=ctype.split(";");
- ctype = ctype_array[0];
- }
-
- if (request_obj.__lock)
- this.set_busy(false);
-
- //console.log(request_obj.get_text());
-
- // if we get javascript code from server -> execute it
- if (request_obj.get_text() && (ctype=='text/javascript' || ctype=='application/x-javascript'))
- eval(request_obj.get_text());
-
- // process the response data according to the sent action
- switch (request_obj.__action) {
- case 'delete':
- if (this.task == 'addressbook') {
- var uid = this.contact_list.get_selection();
- this.enable_command('compose', (uid && this.contact_list.rows[uid]));
- this.enable_command('delete', 'edit', (uid && this.contact_list.rows[uid] && this.env.address_sources && !this.env.address_sources[this.env.source].readonly));
- this.enable_command('export', (this.contact_list && this.contact_list.rowcount > 0));
- }
-
- case 'moveto':
- if (this.env.action == 'show')
- this.command('list');
- else if (this.message_list)
- this.message_list.init();
- break;
-
- case 'purge':
- case 'expunge':
- if (!this.env.messagecount && this.task == 'mail') {
- // clear preview pane content
- if (this.env.contentframe)
- this.show_contentframe(false);
- // disable commands useless when mailbox is empty
- this.enable_command('show', 'reply', 'reply-all', 'forward', 'moveto', 'delete', 'mark', 'viewsource',
- 'print', 'load-attachment', 'purge', 'expunge', 'select-all', 'select-none', 'sort', false);
- }
- break;
-
- case 'check-recent':
- case 'getunread':
- case 'list':
- if (this.task == 'mail') {
- if (this.message_list && request_obj.__action == 'list')
- this.msglist_select(this.message_list);
- this.enable_command('show', 'expunge', 'select-all', 'select-none', 'sort', (this.env.messagecount > 0));
- this.enable_command('purge', this.purge_mailbox_test());
- }
- else if (this.task == 'addressbook')
- this.enable_command('export', (this.contact_list && this.contact_list.rowcount > 0));
-
- break;
- }
-
- request_obj.reset();
- };
-
- // handle HTTP request errors
- this.http_error = function(request_obj)
- {
- //alert('Error sending request: '+request_obj.url+' => HTTP '+request_obj.xmlhttp.status);
- if (request_obj.__lock)
- this.set_busy(false);
-
- request_obj.reset();
- request_obj.__lock = false;
- this.display_message('Unknown Server Error!', 'error');
- };
-
- // use an image to send a keep-alive siganl to the server
- this.send_keep_alive = function()
- {
- var d = new Date();
- this.http_request('keep-alive', '_t='+d.getTime());
- };
-
- // send periodic request to check for recent messages
- this.check_for_recent = function(setbusy)
- {
- if (this.busy)
- return;
-
- if (setbusy)
- this.set_busy(true, 'checkingmail');
-
- this.http_request('check-recent', (this.env.search_request ? '_search='+this.env.search_request+'&' : '') + '_t='+(new Date().getTime()), true);
- };
-
-
- /********************************************************/
- /********* helper methods *********/
- /********************************************************/
-
- // check if we're in show mode or if we have a unique selection
- // and return the message uid
- this.get_single_uid = function()
- {
- return this.env.uid ? this.env.uid : (this.message_list ? this.message_list.get_single_selection() : null);
- };
-
- // same as above but for contacts
- this.get_single_cid = function()
- {
- return this.env.cid ? this.env.cid : (this.contact_list ? this.contact_list.get_single_selection() : null);
- };
-
-
- this.get_caret_pos = function(obj)
- {
- if (typeof(obj.selectionEnd)!='undefined')
- return obj.selectionEnd;
-
- else if (document.selection && document.selection.createRange)
- {
- var range = document.selection.createRange();
- if (range.parentElement()!=obj)
- return 0;
-
- var gm = range.duplicate();
- if (obj.tagName=='TEXTAREA')
- gm.moveToElementText(obj);
- else
- gm.expand('textedit');
-
- gm.setEndPoint('EndToStart', range);
- var p = gm.text.length;
-
- return p<=obj.value.length ? p : -1;
- }
-
- else
- return obj.value.length;
- };
-
- this.set_caret2start = function(obj)
- {
- if (obj.createTextRange)
- {
- var range = obj.createTextRange();
- range.collapse(true);
- range.select();
- }
- else if (obj.setSelectionRange)
- obj.setSelectionRange(0,0);
-
- obj.focus();
- };
-
- // set all fields of a form disabled
- this.lock_form = function(form, lock)
- {
- if (!form || !form.elements)
- return;
-
- var type;
- for (var n=0; n<form.elements.length; n++)
- {
- type = form.elements[n];
- if (type=='hidden')
- continue;
-
- form.elements[n].disabled = lock;
- }
- };
-
- } // end object rcube_webmail
-
-
-/**
- * Class for sending HTTP requests
- * @constructor
- */
-function rcube_http_request()
- {
- this.url = '';
- this.busy = false;
- this.xmlhttp = null;
-
- // reset object properties
- this.reset = function()
- {
- // set unassigned event handlers
- this.onloading = function(){ };
- this.onloaded = function(){ };
- this.oninteractive = function(){ };
- this.oncomplete = function(){ };
- this.onabort = function(){ };
- this.onerror = function(){ };
-
- this.url = '';
- this.busy = false;
- this.xmlhttp = null;
- }
-
- // create HTMLHTTP object
- this.build = function()
- {
- if (window.XMLHttpRequest)
- this.xmlhttp = new XMLHttpRequest();
- else if (window.ActiveXObject)
- {
- try { this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); }
- catch(e) { this.xmlhttp = null; }
- }
- else
- {
-
- }
- }
-
- // send GET request
- this.GET = function(url)
- {
- this.build();
-
- if (!this.xmlhttp)
- {
- this.onerror(this);
- return false;
- }
-
- var _ref = this;
- this.url = url;
- this.busy = true;
-
- this.xmlhttp.onreadystatechange = function(){ _ref.xmlhttp_onreadystatechange(); };
- this.xmlhttp.open('GET', url, true);
- this.xmlhttp.setRequestHeader('X-RoundCube-Referer', bw.get_cookie('roundcube_sessid'));
- this.xmlhttp.send(null);
- };
-
- this.POST = function(url, body, contentType)
- {
- // default value for contentType if not provided
- if (typeof(contentType) == 'undefined')
- contentType = 'application/x-www-form-urlencoded';
-
- this.build();
-
- if (!this.xmlhttp)
- {
- this.onerror(this);
- return false;
- }
-
- var req_body = body;
- if (typeof(body) == 'object')
- {
- req_body = '';
- for (var p in body)
- req_body += (req_body ? '&' : '') + p+'='+urlencode(body[p]);
- }
-
- var ref = this;
- this.url = url;
- this.busy = true;
-
- this.xmlhttp.onreadystatechange = function() { ref.xmlhttp_onreadystatechange(); };
- this.xmlhttp.open('POST', url, true);
- this.xmlhttp.setRequestHeader('Content-Type', contentType);
- this.xmlhttp.setRequestHeader('X-RoundCube-Referer', bw.get_cookie('roundcube_sessid'));
- this.xmlhttp.send(req_body);
- };
-
- // handle onreadystatechange event
- this.xmlhttp_onreadystatechange = function()
- {
- if(this.xmlhttp.readyState == 1)
- this.onloading(this);
-
- else if(this.xmlhttp.readyState == 2)
- this.onloaded(this);
-
- else if(this.xmlhttp.readyState == 3)
- this.oninteractive(this);
-
- else if(this.xmlhttp.readyState == 4)
- {
- try {
- if (this.xmlhttp.status == 0)
- this.onabort(this);
- else if(this.xmlhttp.status == 200)
- this.oncomplete(this);
- else
- this.onerror(this);
-
- this.busy = false;
- }
- catch(err)
- {
- this.onerror(this);
- this.busy = false;
- }
- }
- }
-
- // getter method for HTTP headers
- this.get_header = function(name)
- {
- return this.xmlhttp.getResponseHeader(name);
- };
-
- this.get_text = function()
- {
- return this.xmlhttp.responseText;
- };
-
- this.get_xml = function()
- {
- return this.xmlhttp.responseXML;
- };
-
- this.reset();
-
- } // end class rcube_http_request
-
-// helper function to call the init method with a delay
-function call_init(o)
- {
- window.setTimeout('if (window[\''+o+'\'] && window[\''+o+'\'].init) { '+o+'.init(); }',
- bw.win ? 500 : 200);
- }
-
-var CONTROL_KEY=1;
-var SHIFT_KEY=2;
-var CONTROL_SHIFT_KEY=3;
-function roundcube_browser(){
-this.ver=parseFloat(navigator.appVersion);
-this.appver=navigator.appVersion;
-this.agent=navigator.userAgent;
-this.name=navigator.appName;
-this.vendor=navigator.vendor?navigator.vendor:"";
-this.vendver=navigator.vendorSub?parseFloat(navigator.vendorSub):0;
-this.product=navigator.product?navigator.product:"";
-this.platform=String(navigator.platform).toLowerCase();
-this.lang=(navigator.language)?navigator.language.substring(0,2):(navigator.browserLanguage)?navigator.browserLanguage.substring(0,2):(navigator.systemLanguage)?navigator.systemLanguage.substring(0,2):"en";
-this.win=(this.platform.indexOf("win")>=0)?true:false;
-this.mac=(this.platform.indexOf("mac")>=0)?true:false;
-this.linux=(this.platform.indexOf("linux")>=0)?true:false;
-this.unix=(this.platform.indexOf("unix")>=0)?true:false;
-this.dom=document.getElementById?true:false;
-this.dom2=(document.addEventListener&&document.removeEventListener);
-this.ie=(document.all)?true:false;
-this.ie4=(this.ie&&!this.dom);
-this.ie5=(this.dom&&this.appver.indexOf("MSIE 5")>0);
-this.ie6=(this.dom&&this.appver.indexOf("MSIE 6")>0);
-this.ie7=(this.dom&&this.appver.indexOf("MSIE 7")>0);
-this.mz=(this.dom&&this.ver>=5);
-this.ns=((this.ver<5&&this.name=="Netscape")||(this.ver>=5&&this.vendor.indexOf("Netscape")>=0));
-this.ns6=(this.ns&&parseInt(this.vendver)==6);
-this.ns7=(this.ns&&parseInt(this.vendver)==7);
-this.safari=(this.agent.toLowerCase().indexOf("safari")>0||this.agent.toLowerCase().indexOf("applewebkit")>0);
-this.konq=(this.agent.toLowerCase().indexOf("konqueror")>0);
-this.opera=(window.opera)?true:false;
-if(this.opera&&window.RegExp){
-this.vendver=(/opera(\s|\/)([0-9\.]+)/i.test(navigator.userAgent))?parseFloat(RegExp.$2):-1;
-}else{
-if(!this.vendver&&this.safari){
-this.vendver=(/(safari|applewebkit)\/([0-9]+)/i.test(this.agent))?parseInt(RegExp.$2):0;
-}else{
-if((!this.vendver&&this.mz)||this.agent.indexOf("Camino")>0){
-this.vendver=(/rv:([0-9\.]+)/.test(this.agent))?parseFloat(RegExp.$1):0;
-}else{
-if(this.ie&&window.RegExp){
-this.vendver=(/msie\s+([0-9\.]+)/i.test(this.agent))?parseFloat(RegExp.$1):0;
-}else{
-if(this.konq&&window.RegExp){
-this.vendver=(/khtml\/([0-9\.]+)/i.test(this.agent))?parseFloat(RegExp.$1):0;
-}
-}
-}
-}
-}
-if(this.safari&&(/;\s+([a-z]{2})-[a-z]{2}\)/i.test(this.agent))){
-this.lang=RegExp.$1;
-}
-this.dhtml=((this.ie4&&this.win)||this.ie5||this.ie6||this.ns4||this.mz);
-this.vml=(this.win&&this.ie&&this.dom&&!this.opera);
-this.pngalpha=(this.mz||(this.opera&&this.vendver>=6)||(this.ie&&this.mac&&this.vendver>=5)||(this.ie&&this.win&&this.vendver>=5.5)||this.safari);
-this.opacity=(this.mz||(this.ie&&this.vendver>=5.5&&!this.opera)||(this.safari&&this.vendver>=100));
-this.cookies=navigator.cookieEnabled;
-this.xmlhttp_test=function(){
-var _1=new Function("try{var o=new ActiveXObject('Microsoft.XMLHTTP');return true;}catch(err){return false;}");
-this.xmlhttp=(window.XMLHttpRequest||(window.ActiveXObject&&_1()))?true:false;
-return this.xmlhttp;
-};
-};
-var rcube_event={get_target:function(e){
-e=e||window.event;
-return e&&e.target?e.target:e.srcElement;
-},get_keycode:function(e){
-e=e||window.event;
-return e&&e.keyCode?e.keyCode:(e&&e.which?e.which:0);
-},get_button:function(e){
-e=e||window.event;
-return e&&(typeof e.button!="undefined")?e.button:(e&&e.which?e.which:0);
-},get_modifier:function(e){
-var _6=0;
-e=e||window.event;
-if(bw.mac&&e){
-_6+=(e.metaKey&&CONTROL_KEY)+(e.shiftKey&&SHIFT_KEY);
-return _6;
-}
-if(e){
-_6+=(e.ctrlKey&&CONTROL_KEY)+(e.shiftKey&&SHIFT_KEY);
-return _6;
-}
-},get_mouse_pos:function(e){
-if(!e){
-e=window.event;
-}
-var mX=(e.pageX)?e.pageX:e.clientX;
-var mY=(e.pageY)?e.pageY:e.clientY;
-if(document.body&&document.all){
-mX+=document.body.scrollLeft;
-mY+=document.body.scrollTop;
-}
-if(e._offset){
-mX+=e._offset.x;
-mY+=e._offset.y;
-}
-return {x:mX,y:mY};
-},add_listener:function(p){
-if(!p.object||!p.method){
-return;
-}
-if(!p.element){
-p.element=document;
-}
-if(!p.object._rc_events){
-p.object._rc_events=[];
-}
-var _b=p.event+"*"+p.method;
-if(!p.object._rc_events[_b]){
-p.object._rc_events[_b]=function(e){
-return p.object[p.method](e);
-};
-}
-if(p.element.addEventListener){
-p.element.addEventListener(p.event,p.object._rc_events[_b],false);
-}else{
-if(p.element.attachEvent){
-p.element.detachEvent("on"+p.event,p.object._rc_events[_b]);
-p.element.attachEvent("on"+p.event,p.object._rc_events[_b]);
-}else{
-p.element["on"+p.event]=p.object._rc_events[_b];
-}
-}
-},remove_listener:function(p){
-if(!p.element){
-p.element=document;
-}
-var _e=p.event+"*"+p.method;
-if(p.object&&p.object._rc_events&&p.object._rc_events[_e]){
-if(p.element.removeEventListener){
-p.element.removeEventListener(p.event,p.object._rc_events[_e],false);
-}else{
-if(p.element.detachEvent){
-p.element.detachEvent("on"+p.event,p.object._rc_events[_e]);
-}else{
-p.element["on"+p.event]=null;
-}
-}
-}
-},cancel:function(_f){
-var e=_f?_f:window.event;
-if(e.preventDefault){
-e.preventDefault();
-}
-if(e.stopPropagation){
-e.stopPropagation();
-}
-e.cancelBubble=true;
-e.returnValue=false;
-return false;
-}};
-var rcube_layer_objects=new Array();
-function rcube_layer(id,_12){
-this.name=id;
-this.create=function(arg){
-var l=(arg.x)?arg.x:0;
-var t=(arg.y)?arg.y:0;
-var w=arg.width;
-var h=arg.height;
-var z=arg.zindex;
-var vis=arg.vis;
-var _1a=arg.parent;
-var obj;
-obj=document.createElement("DIV");
-with(obj){
-id=this.name;
-with(style){
-position="absolute";
-visibility=(vis)?(vis==2)?"inherit":"visible":"hidden";
-left=l+"px";
-top=t+"px";
-if(w){
-width=w.toString().match(/\%$/)?w:w+"px";
-}
-if(h){
-height=h.toString().match(/\%$/)?h:h+"px";
-}
-if(z){
-zIndex=z;
-}
-}
-}
-if(_1a){
-_1a.appendChild(obj);
-}else{
-document.body.appendChild(obj);
-}
-this.elm=obj;
-};
-if(_12!=null){
-this.create(_12);
-this.name=this.elm.id;
-}else{
-this.elm=document.getElementById(id);
-}
-if(!this.elm){
-return false;
-}
-this.css=this.elm.style;
-this.event=this.elm;
-this.width=this.elm.offsetWidth;
-this.height=this.elm.offsetHeight;
-this.x=parseInt(this.elm.offsetLeft);
-this.y=parseInt(this.elm.offsetTop);
-this.visible=(this.css.visibility=="visible"||this.css.visibility=="show"||this.css.visibility=="inherit")?true:false;
-this.id=rcube_layer_objects.length;
-this.obj="rcube_layer_objects["+this.id+"]";
-rcube_layer_objects[this.id]=this;
-this.move=function(x,y){
-this.x=x;
-this.y=y;
-this.css.left=Math.round(this.x)+"px";
-this.css.top=Math.round(this.y)+"px";
-};
-this.shift=function(x,y){
-x=Math.round(x*100)/100;
-y=Math.round(y*100)/100;
-this.move(this.x+x,this.y+y);
-};
-this.resize=function(w,h){
-this.css.width=w+"px";
-this.css.height=h+"px";
-this.width=w;
-this.height=h;
-};
-this.clip=function(t,w,h,l){
-this.css.clip="rect("+t+" "+w+" "+h+" "+l+")";
-this.clip_height=h;
-this.clip_width=w;
-};
-this.show=function(a){
-if(a==1){
-this.css.visibility="visible";
-this.visible=true;
-}else{
-if(a==2){
-this.css.visibility="inherit";
-this.visible=true;
-}else{
-this.css.visibility="hidden";
-this.visible=false;
-}
-}
-};
-this.write=function(_27){
-this.elm.innerHTML=_27;
-};
-this.set_bgcolor=function(c){
-if(!c||c=="#"){
-c="transparent";
-}
-this.css.backgroundColor=c;
-};
-this.set_opacity=function(v){
-if(!bw.opacity){
-return;
-}
-var op=v<=1?Math.round(v*100):parseInt(v);
-if(bw.ie){
-this.css.filter="alpha(opacity:"+op+")";
-}else{
-if(bw.safari){
-this.css.opacity=op/100;
-this.css.KhtmlOpacity=op/100;
-}else{
-if(bw.mz){
-this.css.MozOpacity=op/100;
-}
-}
-}
-};
-};
-function rcube_check_email(_2b,_2c){
-if(_2b&&window.RegExp){
-var _2d="[^\\x0d\\x22\\x5c\\x80-\\xff]";
-var _2e="[^\\x0d\\x5b-\\x5d\\x80-\\xff]";
-var _2f="[^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+";
-var _30="\\x5c[\\x00-\\x7f]";
-var _31="\\x5b("+_2e+"|"+_30+")*\\x5d";
-var _32="\\x22("+_2d+"|"+_30+")*\\x22";
-var _33="("+_2f+"|"+_31+")";
-var _34="("+_2f+"|"+_32+")";
-var _35=_33+"(\\x2e"+_33+")*";
-var _36=_34+"(\\x2e"+_34+")*";
-var _37=_36+"\\x40"+_35;
-var _38="[,;s\n]";
-var _39=_2c?new RegExp("(^|<|"+_38+")"+_37+"($|>|"+_38+")","i"):new RegExp("^"+_37+"$","i");
-return _39.test(_2b)?true:false;
-}
-return false;
-};
-function find_in_array(){
-var _3a=find_in_array.arguments;
-if(!_3a.length){
-return -1;
-}
-var _3b=typeof (_3a[0])=="object"?_3a[0]:_3a.length>1&&typeof (_3a[1])=="object"?_3a[1]:new Array();
-var _3c=typeof (_3a[0])!="object"?_3a[0]:_3a.length>1&&typeof (_3a[1])!="object"?_3a[1]:"";
-var _3d=_3a.length==3?_3a[2]:false;
-if(!_3b.length){
-return -1;
-}
-for(var i=0;i<_3b.length;i++){
-if(_3d&&_3b[i].toLowerCase()==_3c.toLowerCase()){
-return i;
-}else{
-if(_3b[i]==_3c){
-return i;
-}
-}
-}
-return -1;
-};
-function urlencode(str){
-return window.encodeURIComponent?encodeURIComponent(str):escape(str);
-};
-function rcube_find_object(id,d){
-var n,f,obj,e;
-if(!d){
-d=document;
-}
-if(d.getElementsByName&&(e=d.getElementsByName(id))){
-obj=e[0];
-}
-if(!obj&&d.getElementById){
-obj=d.getElementById(id);
-}
-if(!obj&&d.all){
-obj=d.all[id];
-}
-if(!obj&&d.images.length){
-obj=d.images[id];
-}
-if(!obj&&d.forms.length){
-for(f=0;f<d.forms.length;f++){
-if(d.forms[f].name==id){
-obj=d.forms[f];
-}else{
-if(d.forms[f].elements[id]){
-obj=d.forms[f].elements[id];
-}
-}
-}
-}
-if(!obj&&d.layers){
-if(d.layers[id]){
-obj=d.layers[id];
-}
-for(n=0;!obj&&n<d.layers.length;n++){
-obj=rcube_find_object(id,d.layers[n].document);
-}
-}
-return obj;
-};
-function rcube_get_object_pos(obj,_47){
-if(typeof (obj)=="string"){
-obj=rcube_find_object(obj);
-}
-if(!obj){
-return {x:0,y:0};
-}
-var iX=(bw.layers)?obj.x:obj.offsetLeft;
-var iY=(bw.layers)?obj.y:obj.offsetTop;
-if(!_47&&(bw.ie||bw.mz)){
-var elm=obj.offsetParent;
-while(elm&&elm!=null){
-iX+=elm.offsetLeft-(elm.parentNode&&elm.parentNode.scrollLeft?elm.parentNode.scrollLeft:0);
-iY+=elm.offsetTop-(elm.parentNode&&elm.parentNode.scrollTop?elm.parentNode.scrollTop:0);
-elm=elm.offsetParent;
-}
-}
-return {x:iX,y:iY};
-};
-function rcube_mouse_is_over(ev,obj){
-var _4d=rcube_event.get_mouse_pos(ev);
-var pos=rcube_get_object_pos(obj);
-return ((_4d.x>=pos.x)&&(_4d.x<(pos.x+obj.offsetWidth))&&(_4d.y>=pos.y)&&(_4d.y<(pos.y+obj.offsetHeight)));
-};
-function get_elements_computed_style(_4f,_50,_51){
-if(arguments.length==2){
-_51=_50;
-}
-var el=_4f;
-if(typeof (_4f)=="string"){
-el=rcube_find_object(_4f);
-}
-if(el&&el.currentStyle){
-return el.currentStyle[_50];
-}else{
-if(el&&document.defaultView&&document.defaultView.getComputedStyle){
-return document.defaultView.getComputedStyle(el,null).getPropertyValue(_51);
-}else{
-return false;
-}
-}
-};
-function setCookie(_53,_54,_55,_56,_57,_58){
-var _59=_53+"="+escape(_54)+(_55?"; expires="+_55.toGMTString():"")+(_56?"; path="+_56:"")+(_57?"; domain="+_57:"")+(_58?"; secure":"");
-document.cookie=_59;
-};
-roundcube_browser.prototype.set_cookie=setCookie;
-function getCookie(_5a){
-var dc=document.cookie;
-var _5c=_5a+"=";
-var _5d=dc.indexOf("; "+_5c);
-if(_5d==-1){
-_5d=dc.indexOf(_5c);
-if(_5d!=0){
-return null;
-}
-}else{
-_5d+=2;
-}
-var end=document.cookie.indexOf(";",_5d);
-if(end==-1){
-end=dc.length;
-}
-return unescape(dc.substring(_5d+_5c.length,end));
-};
-roundcube_browser.prototype.get_cookie=getCookie;
-function rcube_console(){
-this.log=function(msg){
-box=rcube_find_object("console");
-if(box){
-if(msg.charAt(msg.length-1)=="\n"){
-box.value+=msg+"--------------------------------------\n";
-}else{
-box.value+=msg+"\n--------------------------------------\n";
-}
-}
-};
-this.reset=function(){
-box=rcube_find_object("console");
-if(box){
-box.value="";
-}
-};
-};
-var bw=new roundcube_browser();
-if(!window.console){
-console=new rcube_console();
+/*
+ +-----------------------------------------------------------------------+
+ | RoundCube common js library |
+ | |
+ | This file is part of the RoundCube web development suite |
+ | Copyright (C) 2005-2007, RoundCube Dev, - Switzerland |
+ | Licensed under the GNU GPL |
+ | |
+ +-----------------------------------------------------------------------+
+ | Author: Thomas Bruederli <roundcube@gmail.com> |
+ +-----------------------------------------------------------------------+
+
+ $Id: common.js 2150 2008-12-14 19:00:09Z alec $
+*/
+
+// Constants
+var CONTROL_KEY = 1;
+var SHIFT_KEY = 2;
+var CONTROL_SHIFT_KEY = 3;
+
+
+/**
+ * Default browser check class
+ * @construcotr
+ */
+function roundcube_browser()
+ {
+ this.ver = parseFloat(navigator.appVersion);
+ this.appver = navigator.appVersion;
+ this.agent = navigator.userAgent;
+ this.name = navigator.appName;
+ this.vendor = navigator.vendor ? navigator.vendor : '';
+ this.vendver = navigator.vendorSub ? parseFloat(navigator.vendorSub) : 0;
+ this.product = navigator.product ? navigator.product : '';
+ this.platform = String(navigator.platform).toLowerCase();
+ this.lang = (navigator.language) ? navigator.language.substring(0,2) :
+ (navigator.browserLanguage) ? navigator.browserLanguage.substring(0,2) :
+ (navigator.systemLanguage) ? navigator.systemLanguage.substring(0,2) : 'en';
+
+ this.win = (this.platform.indexOf('win')>=0) ? true : false;
+ this.mac = (this.platform.indexOf('mac')>=0) ? true : false;
+ this.linux = (this.platform.indexOf('linux')>=0) ? true : false;
+ this.unix = (this.platform.indexOf('unix')>=0) ? true : false;
+
+ this.dom = document.getElementById ? true : false;
+ this.dom2 = (document.addEventListener && document.removeEventListener);
+
+ this.ie = (document.all) ? true : false;
+ this.ie4 = (this.ie && !this.dom);
+ this.ie5 = (this.dom && this.appver.indexOf('MSIE 5')>0);
+ this.ie6 = (this.dom && this.appver.indexOf('MSIE 6')>0);
+ this.ie7 = (this.dom && this.appver.indexOf('MSIE 7')>0);
+
+ this.mz = (this.dom && this.ver>=5); // (this.dom && this.product=='Gecko')
+ this.ns = ((this.ver<5 && this.name=='Netscape') || (this.ver>=5 && this.vendor.indexOf('Netscape')>=0));
+ this.ns6 = (this.ns && parseInt(this.vendver)==6); // (this.mz && this.ns) ? true : false;
+ this.ns7 = (this.ns && parseInt(this.vendver)==7); // this.agent.indexOf('Netscape/7')>0);
+ this.safari = (this.agent.toLowerCase().indexOf('safari')>0 || this.agent.toLowerCase().indexOf('applewebkit')>0);
+ this.konq = (this.agent.toLowerCase().indexOf('konqueror')>0);
+
+ this.opera = (window.opera) ? true : false;
+
+ if(this.opera && window.RegExp)
+ this.vendver = (/opera(\s|\/)([0-9\.]+)/i.test(navigator.userAgent)) ? parseFloat(RegExp.$2) : -1;
+ else if(!this.vendver && this.safari)
+ this.vendver = (/(safari|applewebkit)\/([0-9]+)/i.test(this.agent)) ? parseInt(RegExp.$2) : 0;
+ else if((!this.vendver && this.mz) || this.agent.indexOf('Camino')>0)
+ this.vendver = (/rv:([0-9\.]+)/.test(this.agent)) ? parseFloat(RegExp.$1) : 0;
+ else if(this.ie && window.RegExp)
+ this.vendver = (/msie\s+([0-9\.]+)/i.test(this.agent)) ? parseFloat(RegExp.$1) : 0;
+ else if(this.konq && window.RegExp)
+ this.vendver = (/khtml\/([0-9\.]+)/i.test(this.agent)) ? parseFloat(RegExp.$1) : 0;
+
+
+ // get real language out of safari's user agent
+ if(this.safari && (/;\s+([a-z]{2})-[a-z]{2}\)/i.test(this.agent)))
+ this.lang = RegExp.$1;
+
+ this.dhtml = ((this.ie4 && this.win) || this.ie5 || this.ie6 || this.ns4 || this.mz);
+ this.vml = (this.win && this.ie && this.dom && !this.opera);
+ this.pngalpha = (this.mz || (this.opera && this.vendver>=6) || (this.ie && this.mac && this.vendver>=5) ||
+ (this.ie && this.win && this.vendver>=5.5) || this.safari);
+ this.opacity = (this.mz || (this.ie && this.vendver>=5.5 && !this.opera) || (this.safari && this.vendver>=100));
+ this.cookies = navigator.cookieEnabled;
+
+ // test for XMLHTTP support
+ this.xmlhttp_test = function()
+ {
+ var activeX_test = new Function("try{var o=new ActiveXObject('Microsoft.XMLHTTP');return true;}catch(err){return false;}");
+ this.xmlhttp = (window.XMLHttpRequest || (window.ActiveXObject && activeX_test())) ? true : false;
+ return this.xmlhttp;
+ }
+ }
+
+
+// static functions for event handling
+var rcube_event = {
+
+/**
+ * returns the event target element
+ */
+get_target: function(e)
+{
+ e = e || window.event;
+ return e && e.target ? e.target : e.srcElement;
+},
+
+/**
+ * returns the event key code
+ */
+get_keycode: function(e)
+{
+ e = e || window.event;
+ return e && e.keyCode ? e.keyCode : (e && e.which ? e.which : 0);
+},
+
+/**
+ * returns the event key code
+ */
+get_button: function(e)
+{
+ e = e || window.event;
+ return e && (typeof e.button != 'undefined') ? e.button : (e && e.which ? e.which : 0);
+},
+
+/**
+ * returns modifier key (constants defined at top of file)
+ */
+get_modifier: function(e)
+{
+ var opcode = 0;
+ e = e || window.event;
+
+ if (bw.mac && e)
+ {
+ opcode += (e.metaKey && CONTROL_KEY) + (e.shiftKey && SHIFT_KEY);
+ return opcode;
+ }
+ if (e)
+ {
+ opcode += (e.ctrlKey && CONTROL_KEY) + (e.shiftKey && SHIFT_KEY);
+ return opcode;
+ }
+},
+
+/**
+ * Return absolute mouse position of an event
+ */
+get_mouse_pos: function(e)
+{
+ if (!e) e = window.event;
+ var mX = (e.pageX) ? e.pageX : e.clientX;
+ var mY = (e.pageY) ? e.pageY : e.clientY;
+
+ if (document.body && document.all)
+ {
+ mX += document.body.scrollLeft;
+ mY += document.body.scrollTop;
+ }
+
+ if (e._offset) {
+ mX += e._offset.x;
+ mY += e._offset.y;
+ }
+
+ return { x:mX, y:mY };
+},
+
+/**
+ * Add an object method as event listener to a certain element
+ */
+add_listener: function(p)
+{
+ if (!p.object || !p.method) // not enough arguments
+ return;
+ if (!p.element)
+ p.element = document;
+
+ if (!p.object._rc_events)
+ p.object._rc_events = [];
+
+ var key = p.event + '*' + p.method;
+ if (!p.object._rc_events[key])
+ p.object._rc_events[key] = function(e){ return p.object[p.method](e); };
+
+ if (p.element.addEventListener)
+ p.element.addEventListener(p.event, p.object._rc_events[key], false);
+ else if (p.element.attachEvent)
+ {
+ // IE allows multiple events with the same function to be applied to the same object
+ // forcibly detach the event, then attach
+ p.element.detachEvent('on'+p.event, p.object._rc_events[key]);
+ p.element.attachEvent('on'+p.event, p.object._rc_events[key]);
+ }
+ else
+ p.element['on'+p.event] = p.object._rc_events[key];
+},
+
+/**
+ * Remove event listener
+ */
+remove_listener: function(p)
+{
+ if (!p.element)
+ p.element = document;
+
+ var key = p.event + '*' + p.method;
+ if (p.object && p.object._rc_events && p.object._rc_events[key]) {
+ if (p.element.removeEventListener)
+ p.element.removeEventListener(p.event, p.object._rc_events[key], false);
+ else if (p.element.detachEvent)
+ p.element.detachEvent('on'+p.event, p.object._rc_events[key]);
+ else
+ p.element['on'+p.event] = null;
+ }
+},
+
+/**
+ * Prevent event propagation and bubbeling
+ */
+cancel: function(evt)
+{
+ var e = evt ? evt : window.event;
+ if (e.preventDefault)
+ e.preventDefault();
+ if (e.stopPropagation)
+ e.stopPropagation();
+
+ e.cancelBubble = true;
+ e.returnValue = false;
+ return false;
}
-RegExp.escape=function(str){
-return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1");
+
};
-if(bw.ie){
-document._getElementById=document.getElementById;
-document.getElementById=function(id){
-var i=0;
-var o=document._getElementById(id);
-if(!o||o.id!=id){
-while((o=document.all[i])&&o.id!=id){
-i++;
-}
+
+
+var rcube_layer_objects = new Array();
+
+
+/**
+ * RoundCube generic layer (floating box) class
+ *
+ * @constructor
+ */
+function rcube_layer(id, attributes)
+ {
+ this.name = id;
+
+ // create a new layer in the current document
+ this.create = function(arg)
+ {
+ var l = (arg.x) ? arg.x : 0;
+ var t = (arg.y) ? arg.y : 0;
+ var w = arg.width;
+ var h = arg.height;
+ var z = arg.zindex;
+ var vis = arg.vis;
+ var parent = arg.parent;
+ var obj;
+
+ obj = document.createElement('DIV');
+
+ with(obj)
+ {
+ id = this.name;
+ with(style)
+ {
+ position = 'absolute';
+ visibility = (vis) ? (vis==2) ? 'inherit' : 'visible' : 'hidden';
+ left = l+'px';
+ top = t+'px';
+ if (w)
+ width = w.toString().match(/\%$/) ? w : w+'px';
+ if (h)
+ height = h.toString().match(/\%$/) ? h : h+'px';
+ if(z) zIndex = z;
+ }
+ }
+
+ if (parent)
+ parent.appendChild(obj);
+ else
+ document.body.appendChild(obj);
+
+ this.elm = obj;
+ };
+
+
+ // create new layer
+ if(attributes!=null)
+ {
+ this.create(attributes);
+ this.name = this.elm.id;
+ }
+ else // just refer to the object
+ this.elm = document.getElementById(id);
+
+
+ if(!this.elm)
+ return false;
+
+
+ // ********* layer object properties *********
+
+ this.css = this.elm.style;
+ this.event = this.elm;
+ this.width = this.elm.offsetWidth;
+ this.height = this.elm.offsetHeight;
+ this.x = parseInt(this.elm.offsetLeft);
+ this.y = parseInt(this.elm.offsetTop);
+ this.visible = (this.css.visibility=='visible' || this.css.visibility=='show' || this.css.visibility=='inherit') ? true : false;
+
+ this.id = rcube_layer_objects.length;
+ this.obj = 'rcube_layer_objects['+this.id+']';
+ rcube_layer_objects[this.id] = this;
+
+
+ // ********* layer object methods *********
+
+
+ // move the layer to a specific position
+ this.move = function(x, y)
+ {
+ this.x = x;
+ this.y = y;
+ this.css.left = Math.round(this.x)+'px';
+ this.css.top = Math.round(this.y)+'px';
+ }
+
+
+ // move the layer for a specific step
+ this.shift = function(x,y)
+ {
+ x = Math.round(x*100)/100;
+ y = Math.round(y*100)/100;
+ this.move(this.x+x, this.y+y);
+ }
+
+
+ // change the layers width and height
+ this.resize = function(w,h)
+ {
+ this.css.width = w+'px';
+ this.css.height = h+'px';
+ this.width = w;
+ this.height = h;
+ }
+
+
+ // cut the layer (top,width,height,left)
+ this.clip = function(t,w,h,l)
+ {
+ this.css.clip='rect('+t+' '+w+' '+h+' '+l+')';
+ this.clip_height = h;
+ this.clip_width = w;
+ }
+
+
+ // show or hide the layer
+ this.show = function(a)
+ {
+ if(a==1)
+ {
+ this.css.visibility = 'visible';
+ this.visible = true;
+ }
+ else if(a==2)
+ {
+ this.css.visibility = 'inherit';
+ this.visible = true;
+ }
+ else
+ {
+ this.css.visibility = 'hidden';
+ this.visible = false;
+ }
+ }
+
+
+ // write new content into a Layer
+ this.write = function(cont)
+ {
+ this.elm.innerHTML = cont;
+ }
+
+
+ // set the given color to the layer background
+ this.set_bgcolor = function(c)
+ {
+ if(!c || c=='#')
+ c = 'transparent';
+
+ this.css.backgroundColor = c;
+ }
+
+
+ // set the opacity of a layer to the given ammount (in %)
+ this.set_opacity = function(v)
+ {
+ if(!bw.opacity)
+ return;
+
+ var op = v<=1 ? Math.round(v*100) : parseInt(v);
+
+ if(bw.ie)
+ this.css.filter = 'alpha(opacity:'+op+')';
+ else if(bw.safari)
+ {
+ this.css.opacity = op/100;
+ this.css.KhtmlOpacity = op/100;
+ }
+ else if(bw.mz)
+ this.css.MozOpacity = op/100;
+ }
+ }
+
+
+// check if input is a valid email address
+// By Cal Henderson <cal@iamcal.com>
+// http://code.iamcal.com/php/rfc822/
+function rcube_check_email(input, inline)
+ {
+ if (input && window.RegExp)
+ {
+ var qtext = '[^\\x0d\\x22\\x5c\\x80-\\xff]';
+ var dtext = '[^\\x0d\\x5b-\\x5d\\x80-\\xff]';
+ var atom = '[^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+';
+ var quoted_pair = '\\x5c[\\x00-\\x7f]';
+ var domain_literal = '\\x5b('+dtext+'|'+quoted_pair+')*\\x5d';
+ var quoted_string = '\\x22('+qtext+'|'+quoted_pair+')*\\x22';
+ var sub_domain = '('+atom+'|'+domain_literal+')';
+ var word = '('+atom+'|'+quoted_string+')';
+ var domain = sub_domain+'(\\x2e'+sub_domain+')*';
+ var local_part = word+'(\\x2e'+word+')*';
+ var addr_spec = local_part+'\\x40'+domain;
+ var delim = '[,;\s\n]';
+ var reg1 = inline ? new RegExp('(^|<|'+delim+')'+addr_spec+'($|>|'+delim+')', 'i') : new RegExp('^'+addr_spec+'$', 'i');
+ return reg1.test(input) ? true : false;
+ }
+ return false;
+ }
+
+
+// find a value in a specific array and returns the index
+function find_in_array()
+ {
+ var args = find_in_array.arguments;
+ if(!args.length) return -1;
+
+ var haystack = typeof(args[0])=='object' ? args[0] : args.length>1 && typeof(args[1])=='object' ? args[1] : new Array();
+ var needle = typeof(args[0])!='object' ? args[0] : args.length>1 && typeof(args[1])!='object' ? args[1] : '';
+ var nocase = args.length==3 ? args[2] : false;
+
+ if(!haystack.length) return -1;
+
+ for(var i=0; i<haystack.length; i++)
+ if(nocase && haystack[i].toLowerCase()==needle.toLowerCase())
+ return i;
+ else if(haystack[i]==needle)
+ return i;
+
+ return -1;
+ }
+
+
+// make a string URL safe
+function urlencode(str)
+{
+ return window.encodeURIComponent ? encodeURIComponent(str) : escape(str);
}
-return o;
-};
+
+
+// get any type of html objects by id/name
+function rcube_find_object(id, d)
+ {
+ var n, f, obj, e;
+ if(!d) d = document;
+
+ if(d.getElementsByName && (e = d.getElementsByName(id)))
+ obj = e[0];
+ if(!obj && d.getElementById)
+ obj = d.getElementById(id);
+ if(!obj && d.all)
+ obj = d.all[id];
+
+ if(!obj && d.images.length)
+ obj = d.images[id];
+
+ if(!obj && d.forms.length)
+ for(f=0; f<d.forms.length; f++)
+ {
+ if(d.forms[f].name == id)
+ obj = d.forms[f];
+ else if(d.forms[f].elements[id])
+ obj = d.forms[f].elements[id];
+ }
+
+ if(!obj && d.layers)
+ {
+ if(d.layers[id]) obj = d.layers[id];
+ for(n=0; !obj && n<d.layers.length; n++)
+ obj = rcube_find_object(id, d.layers[n].document);
+ }
+
+ return obj;
+ }
+
+
+// return the absolute position of an object within the document
+function rcube_get_object_pos(obj, relative)
+ {
+ if(typeof(obj)=='string')
+ obj = rcube_find_object(obj);
+
+ if(!obj) return {x:0, y:0};
+
+ var iX = (bw.layers) ? obj.x : obj.offsetLeft;
+ var iY = (bw.layers) ? obj.y : obj.offsetTop;
+
+ if(!relative && (bw.ie || bw.mz))
+ {
+ var elm = obj.offsetParent;
+ while(elm && elm!=null)
+ {
+ iX += elm.offsetLeft - (elm.parentNode && elm.parentNode.scrollLeft ? elm.parentNode.scrollLeft : 0);
+ iY += elm.offsetTop - (elm.parentNode && elm.parentNode.scrollTop ? elm.parentNode.scrollTop : 0);
+ elm = elm.offsetParent;
+ }
+ }
+
+ return {x:iX, y:iY};
+ }
+
+// determine whether the mouse is over the given object or not
+function rcube_mouse_is_over(ev, obj)
+{
+ var mouse = rcube_event.get_mouse_pos(ev);
+ var pos = rcube_get_object_pos(obj);
+
+ return ((mouse.x >= pos.x) && (mouse.x < (pos.x + obj.offsetWidth)) &&
+ (mouse.y >= pos.y) && (mouse.y < (pos.y + obj.offsetHeight)));
}
-function exec_event(_64,_65){
-if(document.createEventObject){
-var evt=document.createEventObject();
-return _64.fireEvent("on"+_65,evt);
-}else{
-var evt=document.createEvent("HTMLEvents");
-evt.initEvent(_65,true,true);
-return !_64.dispatchEvent(evt);
+
+
+/**
+ * Return the currently applied value of a css property
+ *
+ * @param {Object} html_element Node reference
+ * @param {String} css_property Property name to read in Javascript notation (eg. 'textAlign')
+ * @param {String} mozilla_equivalent Equivalent property name in CSS notation (eg. 'text-align')
+ * @return CSS property value
+ * @type String
+ */
+function get_elements_computed_style(html_element, css_property, mozilla_equivalent)
+ {
+ if (arguments.length==2)
+ mozilla_equivalent = css_property;
+
+ var el = html_element;
+ if (typeof(html_element)=='string')
+ el = rcube_find_object(html_element);
+
+ if (el && el.currentStyle)
+ return el.currentStyle[css_property];
+ else if (el && document.defaultView && document.defaultView.getComputedStyle)
+ return document.defaultView.getComputedStyle(el, null).getPropertyValue(mozilla_equivalent);
+ else
+ return false;
+ }
+
+
+// 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;
+ }
+
+roundcube_browser.prototype.set_cookie = setCookie;
+
+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));
+ }
+
+roundcube_browser.prototype.get_cookie = getCookie;
+
+
+// tiny replacement for Firebox functionality
+function rcube_console()
+{
+ this.log = function(msg)
+ {
+ box = rcube_find_object('console');
+
+ if (box)
+ if (msg.charAt(msg.length-1)=='\n')
+ box.value += msg+'--------------------------------------\n';
+ else
+ box.value += msg+'\n--------------------------------------\n';
+ };
+
+ this.reset = function()
+ {
+ box = rcube_find_object('console');
+ if (box)
+ box.value = '';
+ };
}
-};
+var bw = new roundcube_browser();
+
+if (!window.console)
+ console = new rcube_console();
+
+
+// Add escape() method to RegExp object
+// http://dev.rubyonrails.org/changeset/7271
+RegExp.escape = function(str)
+ {
+ return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1');
+ }
+
+
+// Make getElementById() case-sensitive on IE
+if (bw.ie)
+ {
+ document._getElementById = document.getElementById;
+ document.getElementById = function(id)
+ {
+ var i = 0;
+ var o = document._getElementById(id);
+
+ if (!o || o.id != id)
+ while ((o = document.all[i]) && o.id != id)
+ i++;
+
+ return o;
+ }
+ }
+
+
+// Fire event on specified element
+function exec_event(element,event)
+{
+ if (document.createEventObject) {
+ // dispatch for IE
+ var evt = document.createEventObject();
+ return element.fireEvent('on'+event,evt)
+ }
+ else {
+ // dispatch for firefox + others
+ var evt = document.createEvent("HTMLEvents");
+ evt.initEvent(event, true, true); // event type,bubbling,cancelable
+ return !element.dispatchEvent(evt);
+ }
+}
+++ /dev/null
-/*
- +-----------------------------------------------------------------------+
- | RoundCube common js library |
- | |
- | This file is part of the RoundCube web development suite |
- | Copyright (C) 2005-2007, RoundCube Dev, - Switzerland |
- | Licensed under the GNU GPL |
- | |
- +-----------------------------------------------------------------------+
- | Author: Thomas Bruederli <roundcube@gmail.com> |
- +-----------------------------------------------------------------------+
-
- $Id: common.js 2150 2008-12-14 19:00:09Z alec $
-*/
-
-// Constants
-var CONTROL_KEY = 1;
-var SHIFT_KEY = 2;
-var CONTROL_SHIFT_KEY = 3;
-
-
-/**
- * Default browser check class
- * @construcotr
- */
-function roundcube_browser()
- {
- this.ver = parseFloat(navigator.appVersion);
- this.appver = navigator.appVersion;
- this.agent = navigator.userAgent;
- this.name = navigator.appName;
- this.vendor = navigator.vendor ? navigator.vendor : '';
- this.vendver = navigator.vendorSub ? parseFloat(navigator.vendorSub) : 0;
- this.product = navigator.product ? navigator.product : '';
- this.platform = String(navigator.platform).toLowerCase();
- this.lang = (navigator.language) ? navigator.language.substring(0,2) :
- (navigator.browserLanguage) ? navigator.browserLanguage.substring(0,2) :
- (navigator.systemLanguage) ? navigator.systemLanguage.substring(0,2) : 'en';
-
- this.win = (this.platform.indexOf('win')>=0) ? true : false;
- this.mac = (this.platform.indexOf('mac')>=0) ? true : false;
- this.linux = (this.platform.indexOf('linux')>=0) ? true : false;
- this.unix = (this.platform.indexOf('unix')>=0) ? true : false;
-
- this.dom = document.getElementById ? true : false;
- this.dom2 = (document.addEventListener && document.removeEventListener);
-
- this.ie = (document.all) ? true : false;
- this.ie4 = (this.ie && !this.dom);
- this.ie5 = (this.dom && this.appver.indexOf('MSIE 5')>0);
- this.ie6 = (this.dom && this.appver.indexOf('MSIE 6')>0);
- this.ie7 = (this.dom && this.appver.indexOf('MSIE 7')>0);
-
- this.mz = (this.dom && this.ver>=5); // (this.dom && this.product=='Gecko')
- this.ns = ((this.ver<5 && this.name=='Netscape') || (this.ver>=5 && this.vendor.indexOf('Netscape')>=0));
- this.ns6 = (this.ns && parseInt(this.vendver)==6); // (this.mz && this.ns) ? true : false;
- this.ns7 = (this.ns && parseInt(this.vendver)==7); // this.agent.indexOf('Netscape/7')>0);
- this.safari = (this.agent.toLowerCase().indexOf('safari')>0 || this.agent.toLowerCase().indexOf('applewebkit')>0);
- this.konq = (this.agent.toLowerCase().indexOf('konqueror')>0);
-
- this.opera = (window.opera) ? true : false;
-
- if(this.opera && window.RegExp)
- this.vendver = (/opera(\s|\/)([0-9\.]+)/i.test(navigator.userAgent)) ? parseFloat(RegExp.$2) : -1;
- else if(!this.vendver && this.safari)
- this.vendver = (/(safari|applewebkit)\/([0-9]+)/i.test(this.agent)) ? parseInt(RegExp.$2) : 0;
- else if((!this.vendver && this.mz) || this.agent.indexOf('Camino')>0)
- this.vendver = (/rv:([0-9\.]+)/.test(this.agent)) ? parseFloat(RegExp.$1) : 0;
- else if(this.ie && window.RegExp)
- this.vendver = (/msie\s+([0-9\.]+)/i.test(this.agent)) ? parseFloat(RegExp.$1) : 0;
- else if(this.konq && window.RegExp)
- this.vendver = (/khtml\/([0-9\.]+)/i.test(this.agent)) ? parseFloat(RegExp.$1) : 0;
-
-
- // get real language out of safari's user agent
- if(this.safari && (/;\s+([a-z]{2})-[a-z]{2}\)/i.test(this.agent)))
- this.lang = RegExp.$1;
-
- this.dhtml = ((this.ie4 && this.win) || this.ie5 || this.ie6 || this.ns4 || this.mz);
- this.vml = (this.win && this.ie && this.dom && !this.opera);
- this.pngalpha = (this.mz || (this.opera && this.vendver>=6) || (this.ie && this.mac && this.vendver>=5) ||
- (this.ie && this.win && this.vendver>=5.5) || this.safari);
- this.opacity = (this.mz || (this.ie && this.vendver>=5.5 && !this.opera) || (this.safari && this.vendver>=100));
- this.cookies = navigator.cookieEnabled;
-
- // test for XMLHTTP support
- this.xmlhttp_test = function()
- {
- var activeX_test = new Function("try{var o=new ActiveXObject('Microsoft.XMLHTTP');return true;}catch(err){return false;}");
- this.xmlhttp = (window.XMLHttpRequest || (window.ActiveXObject && activeX_test())) ? true : false;
- return this.xmlhttp;
- }
- }
-
-
-// static functions for event handling
-var rcube_event = {
-
-/**
- * returns the event target element
- */
-get_target: function(e)
-{
- e = e || window.event;
- return e && e.target ? e.target : e.srcElement;
-},
-
-/**
- * returns the event key code
- */
-get_keycode: function(e)
-{
- e = e || window.event;
- return e && e.keyCode ? e.keyCode : (e && e.which ? e.which : 0);
-},
-
-/**
- * returns the event key code
- */
-get_button: function(e)
-{
- e = e || window.event;
- return e && (typeof e.button != 'undefined') ? e.button : (e && e.which ? e.which : 0);
-},
-
-/**
- * returns modifier key (constants defined at top of file)
- */
-get_modifier: function(e)
-{
- var opcode = 0;
- e = e || window.event;
-
- if (bw.mac && e)
- {
- opcode += (e.metaKey && CONTROL_KEY) + (e.shiftKey && SHIFT_KEY);
- return opcode;
- }
- if (e)
- {
- opcode += (e.ctrlKey && CONTROL_KEY) + (e.shiftKey && SHIFT_KEY);
- return opcode;
- }
-},
-
-/**
- * Return absolute mouse position of an event
- */
-get_mouse_pos: function(e)
-{
- if (!e) e = window.event;
- var mX = (e.pageX) ? e.pageX : e.clientX;
- var mY = (e.pageY) ? e.pageY : e.clientY;
-
- if (document.body && document.all)
- {
- mX += document.body.scrollLeft;
- mY += document.body.scrollTop;
- }
-
- if (e._offset) {
- mX += e._offset.x;
- mY += e._offset.y;
- }
-
- return { x:mX, y:mY };
-},
-
-/**
- * Add an object method as event listener to a certain element
- */
-add_listener: function(p)
-{
- if (!p.object || !p.method) // not enough arguments
- return;
- if (!p.element)
- p.element = document;
-
- if (!p.object._rc_events)
- p.object._rc_events = [];
-
- var key = p.event + '*' + p.method;
- if (!p.object._rc_events[key])
- p.object._rc_events[key] = function(e){ return p.object[p.method](e); };
-
- if (p.element.addEventListener)
- p.element.addEventListener(p.event, p.object._rc_events[key], false);
- else if (p.element.attachEvent)
- {
- // IE allows multiple events with the same function to be applied to the same object
- // forcibly detach the event, then attach
- p.element.detachEvent('on'+p.event, p.object._rc_events[key]);
- p.element.attachEvent('on'+p.event, p.object._rc_events[key]);
- }
- else
- p.element['on'+p.event] = p.object._rc_events[key];
-},
-
-/**
- * Remove event listener
- */
-remove_listener: function(p)
-{
- if (!p.element)
- p.element = document;
-
- var key = p.event + '*' + p.method;
- if (p.object && p.object._rc_events && p.object._rc_events[key]) {
- if (p.element.removeEventListener)
- p.element.removeEventListener(p.event, p.object._rc_events[key], false);
- else if (p.element.detachEvent)
- p.element.detachEvent('on'+p.event, p.object._rc_events[key]);
- else
- p.element['on'+p.event] = null;
- }
-},
-
-/**
- * Prevent event propagation and bubbeling
- */
-cancel: function(evt)
-{
- var e = evt ? evt : window.event;
- if (e.preventDefault)
- e.preventDefault();
- if (e.stopPropagation)
- e.stopPropagation();
-
- e.cancelBubble = true;
- e.returnValue = false;
- return false;
-}
-
-};
-
-
-var rcube_layer_objects = new Array();
-
-
-/**
- * RoundCube generic layer (floating box) class
- *
- * @constructor
- */
-function rcube_layer(id, attributes)
- {
- this.name = id;
-
- // create a new layer in the current document
- this.create = function(arg)
- {
- var l = (arg.x) ? arg.x : 0;
- var t = (arg.y) ? arg.y : 0;
- var w = arg.width;
- var h = arg.height;
- var z = arg.zindex;
- var vis = arg.vis;
- var parent = arg.parent;
- var obj;
-
- obj = document.createElement('DIV');
-
- with(obj)
- {
- id = this.name;
- with(style)
- {
- position = 'absolute';
- visibility = (vis) ? (vis==2) ? 'inherit' : 'visible' : 'hidden';
- left = l+'px';
- top = t+'px';
- if (w)
- width = w.toString().match(/\%$/) ? w : w+'px';
- if (h)
- height = h.toString().match(/\%$/) ? h : h+'px';
- if(z) zIndex = z;
- }
- }
-
- if (parent)
- parent.appendChild(obj);
- else
- document.body.appendChild(obj);
-
- this.elm = obj;
- };
-
-
- // create new layer
- if(attributes!=null)
- {
- this.create(attributes);
- this.name = this.elm.id;
- }
- else // just refer to the object
- this.elm = document.getElementById(id);
-
-
- if(!this.elm)
- return false;
-
-
- // ********* layer object properties *********
-
- this.css = this.elm.style;
- this.event = this.elm;
- this.width = this.elm.offsetWidth;
- this.height = this.elm.offsetHeight;
- this.x = parseInt(this.elm.offsetLeft);
- this.y = parseInt(this.elm.offsetTop);
- this.visible = (this.css.visibility=='visible' || this.css.visibility=='show' || this.css.visibility=='inherit') ? true : false;
-
- this.id = rcube_layer_objects.length;
- this.obj = 'rcube_layer_objects['+this.id+']';
- rcube_layer_objects[this.id] = this;
-
-
- // ********* layer object methods *********
-
-
- // move the layer to a specific position
- this.move = function(x, y)
- {
- this.x = x;
- this.y = y;
- this.css.left = Math.round(this.x)+'px';
- this.css.top = Math.round(this.y)+'px';
- }
-
-
- // move the layer for a specific step
- this.shift = function(x,y)
- {
- x = Math.round(x*100)/100;
- y = Math.round(y*100)/100;
- this.move(this.x+x, this.y+y);
- }
-
-
- // change the layers width and height
- this.resize = function(w,h)
- {
- this.css.width = w+'px';
- this.css.height = h+'px';
- this.width = w;
- this.height = h;
- }
-
-
- // cut the layer (top,width,height,left)
- this.clip = function(t,w,h,l)
- {
- this.css.clip='rect('+t+' '+w+' '+h+' '+l+')';
- this.clip_height = h;
- this.clip_width = w;
- }
-
-
- // show or hide the layer
- this.show = function(a)
- {
- if(a==1)
- {
- this.css.visibility = 'visible';
- this.visible = true;
- }
- else if(a==2)
- {
- this.css.visibility = 'inherit';
- this.visible = true;
- }
- else
- {
- this.css.visibility = 'hidden';
- this.visible = false;
- }
- }
-
-
- // write new content into a Layer
- this.write = function(cont)
- {
- this.elm.innerHTML = cont;
- }
-
-
- // set the given color to the layer background
- this.set_bgcolor = function(c)
- {
- if(!c || c=='#')
- c = 'transparent';
-
- this.css.backgroundColor = c;
- }
-
-
- // set the opacity of a layer to the given ammount (in %)
- this.set_opacity = function(v)
- {
- if(!bw.opacity)
- return;
-
- var op = v<=1 ? Math.round(v*100) : parseInt(v);
-
- if(bw.ie)
- this.css.filter = 'alpha(opacity:'+op+')';
- else if(bw.safari)
- {
- this.css.opacity = op/100;
- this.css.KhtmlOpacity = op/100;
- }
- else if(bw.mz)
- this.css.MozOpacity = op/100;
- }
- }
-
-
-// check if input is a valid email address
-// By Cal Henderson <cal@iamcal.com>
-// http://code.iamcal.com/php/rfc822/
-function rcube_check_email(input, inline)
- {
- if (input && window.RegExp)
- {
- var qtext = '[^\\x0d\\x22\\x5c\\x80-\\xff]';
- var dtext = '[^\\x0d\\x5b-\\x5d\\x80-\\xff]';
- var atom = '[^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+';
- var quoted_pair = '\\x5c[\\x00-\\x7f]';
- var domain_literal = '\\x5b('+dtext+'|'+quoted_pair+')*\\x5d';
- var quoted_string = '\\x22('+qtext+'|'+quoted_pair+')*\\x22';
- var sub_domain = '('+atom+'|'+domain_literal+')';
- var word = '('+atom+'|'+quoted_string+')';
- var domain = sub_domain+'(\\x2e'+sub_domain+')*';
- var local_part = word+'(\\x2e'+word+')*';
- var addr_spec = local_part+'\\x40'+domain;
- var delim = '[,;\s\n]';
- var reg1 = inline ? new RegExp('(^|<|'+delim+')'+addr_spec+'($|>|'+delim+')', 'i') : new RegExp('^'+addr_spec+'$', 'i');
- return reg1.test(input) ? true : false;
- }
- return false;
- }
-
-
-// find a value in a specific array and returns the index
-function find_in_array()
- {
- var args = find_in_array.arguments;
- if(!args.length) return -1;
-
- var haystack = typeof(args[0])=='object' ? args[0] : args.length>1 && typeof(args[1])=='object' ? args[1] : new Array();
- var needle = typeof(args[0])!='object' ? args[0] : args.length>1 && typeof(args[1])!='object' ? args[1] : '';
- var nocase = args.length==3 ? args[2] : false;
-
- if(!haystack.length) return -1;
-
- for(var i=0; i<haystack.length; i++)
- if(nocase && haystack[i].toLowerCase()==needle.toLowerCase())
- return i;
- else if(haystack[i]==needle)
- return i;
-
- return -1;
- }
-
-
-// make a string URL safe
-function urlencode(str)
-{
- return window.encodeURIComponent ? encodeURIComponent(str) : escape(str);
-}
-
-
-// get any type of html objects by id/name
-function rcube_find_object(id, d)
- {
- var n, f, obj, e;
- if(!d) d = document;
-
- if(d.getElementsByName && (e = d.getElementsByName(id)))
- obj = e[0];
- if(!obj && d.getElementById)
- obj = d.getElementById(id);
- if(!obj && d.all)
- obj = d.all[id];
-
- if(!obj && d.images.length)
- obj = d.images[id];
-
- if(!obj && d.forms.length)
- for(f=0; f<d.forms.length; f++)
- {
- if(d.forms[f].name == id)
- obj = d.forms[f];
- else if(d.forms[f].elements[id])
- obj = d.forms[f].elements[id];
- }
-
- if(!obj && d.layers)
- {
- if(d.layers[id]) obj = d.layers[id];
- for(n=0; !obj && n<d.layers.length; n++)
- obj = rcube_find_object(id, d.layers[n].document);
- }
-
- return obj;
- }
-
-
-// return the absolute position of an object within the document
-function rcube_get_object_pos(obj, relative)
- {
- if(typeof(obj)=='string')
- obj = rcube_find_object(obj);
-
- if(!obj) return {x:0, y:0};
-
- var iX = (bw.layers) ? obj.x : obj.offsetLeft;
- var iY = (bw.layers) ? obj.y : obj.offsetTop;
-
- if(!relative && (bw.ie || bw.mz))
- {
- var elm = obj.offsetParent;
- while(elm && elm!=null)
- {
- iX += elm.offsetLeft - (elm.parentNode && elm.parentNode.scrollLeft ? elm.parentNode.scrollLeft : 0);
- iY += elm.offsetTop - (elm.parentNode && elm.parentNode.scrollTop ? elm.parentNode.scrollTop : 0);
- elm = elm.offsetParent;
- }
- }
-
- return {x:iX, y:iY};
- }
-
-// determine whether the mouse is over the given object or not
-function rcube_mouse_is_over(ev, obj)
-{
- var mouse = rcube_event.get_mouse_pos(ev);
- var pos = rcube_get_object_pos(obj);
-
- return ((mouse.x >= pos.x) && (mouse.x < (pos.x + obj.offsetWidth)) &&
- (mouse.y >= pos.y) && (mouse.y < (pos.y + obj.offsetHeight)));
-}
-
-
-/**
- * Return the currently applied value of a css property
- *
- * @param {Object} html_element Node reference
- * @param {String} css_property Property name to read in Javascript notation (eg. 'textAlign')
- * @param {String} mozilla_equivalent Equivalent property name in CSS notation (eg. 'text-align')
- * @return CSS property value
- * @type String
- */
-function get_elements_computed_style(html_element, css_property, mozilla_equivalent)
- {
- if (arguments.length==2)
- mozilla_equivalent = css_property;
-
- var el = html_element;
- if (typeof(html_element)=='string')
- el = rcube_find_object(html_element);
-
- if (el && el.currentStyle)
- return el.currentStyle[css_property];
- else if (el && document.defaultView && document.defaultView.getComputedStyle)
- return document.defaultView.getComputedStyle(el, null).getPropertyValue(mozilla_equivalent);
- else
- return false;
- }
-
-
-// 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;
- }
-
-roundcube_browser.prototype.set_cookie = setCookie;
-
-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));
- }
-
-roundcube_browser.prototype.get_cookie = getCookie;
-
-
-// tiny replacement for Firebox functionality
-function rcube_console()
-{
- this.log = function(msg)
- {
- box = rcube_find_object('console');
-
- if (box)
- if (msg.charAt(msg.length-1)=='\n')
- box.value += msg+'--------------------------------------\n';
- else
- box.value += msg+'\n--------------------------------------\n';
- };
-
- this.reset = function()
- {
- box = rcube_find_object('console');
- if (box)
- box.value = '';
- };
-}
-
-var bw = new roundcube_browser();
-
-if (!window.console)
- console = new rcube_console();
-
-
-// Add escape() method to RegExp object
-// http://dev.rubyonrails.org/changeset/7271
-RegExp.escape = function(str)
- {
- return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1');
- }
-
-
-// Make getElementById() case-sensitive on IE
-if (bw.ie)
- {
- document._getElementById = document.getElementById;
- document.getElementById = function(id)
- {
- var i = 0;
- var o = document._getElementById(id);
-
- if (!o || o.id != id)
- while ((o = document.all[i]) && o.id != id)
- i++;
-
- return o;
- }
- }
-
-
-// Fire event on specified element
-function exec_event(element,event)
-{
- if (document.createEventObject) {
- // dispatch for IE
- var evt = document.createEventObject();
- return element.fireEvent('on'+event,evt)
- }
- else {
- // dispatch for firefox + others
- var evt = document.createEvent("HTMLEvents");
- evt.initEvent(event, true, true); // event type,bubbling,cancelable
- return !element.dispatchEvent(evt);
- }
-}
theme_advanced_buttons1 : 'bold,italic,underline,strikethrough,justifyleft,justifycenter,justifyright,justifyfull,separator,outdent,indent,charmap,hr,link,unlink,code,forecolor',
theme_advanced_buttons2 : ',fontselect,fontsizeselect',
theme_advanced_buttons3 : '',
+ relative_urls : false,
+ remove_script_host : false,
gecko_spellcheck : true
});
else // mail compose
external_image_list_url : 'program/js/editor_images.js',
spellchecker_languages : (rcmail.env.spellcheck_langs ? rcmail.env.spellcheck_langs : 'Dansk=da,Deutsch=de,+English=en,Espanol=es,Francais=fr,Italiano=it,Nederlands=nl,Polski=pl,Portugues=pt,Suomi=fi,Svenska=sv'),
gecko_spellcheck : true,
+ relative_urls : false,
+ remove_script_host : false ,
rc_client: rcube_webmail_client,
oninit : 'rcmail_editor_callback'
});
if (ishtml)
{
- var existingPlainText = composeElement.value;
- var htmlText = "<pre>" + existingPlainText + "</pre>";
-
rcmail.display_spellcheck_controls(false);
+ var htmlText = "<pre>" + composeElement.value + "</pre>";
+
composeElement.value = htmlText;
tinyMCE.execCommand('mceAddControl', true, textAreaId);
if (flagElement && (flag = rcube_find_object(flagElement)))
-var AJS={getElement:function(id){
-if(typeof (id)=="string"){
-return document.getElementById(id);
-}else{
-return id;
-}
-},getElements:function(){
-var _2=new Array();
-for(var i=0;i<arguments.length;i++){
-var _4=this.getElement(arguments[i]);
-_2.push(_4);
-}
-return _2;
-},getQueryArgument:function(_5){
-var _6=window.location.search.substring(1);
-var _7=_6.split("&");
-for(var i=0;i<_7.length;i++){
-var _9=_7[i].split("=");
-if(_9[0]==_5){
-return _9[1];
-}
-}
-return null;
-},isIe:function(){
-return (navigator.userAgent.toLowerCase().indexOf("msie")!=-1&&navigator.userAgent.toLowerCase().indexOf("opera")==-1);
-},getBody:function(){
-return this.getElementsByTagAndClassName("body")[0];
-},getElementsByTagAndClassName:function(_a,_b,_c){
-var _d=new Array();
-if(!this.isDefined(_c)){
-_c=document;
-}
-if(!this.isDefined(_a)){
-_a="*";
-}
-var _e=_c.getElementsByTagName(_a);
-var _f=_e.length;
-var _10=new RegExp("(^|\\s)"+_b+"(\\s|$)");
-for(i=0,j=0;i<_f;i++){
-if(_10.test(_e[i].className)||_b==null){
-_d[j]=_e[i];
-j++;
-}
-}
-return _d;
-},appendChildNodes:function(_11){
-if(arguments.length>=2){
-for(var i=1;i<arguments.length;i++){
-var n=arguments[i];
-if(typeof (n)=="string"){
-n=document.createTextNode(n);
-}
-if(this.isDefined(n)){
-_11.appendChild(n);
-}
-}
-}
-return _11;
-},replaceChildNodes:function(_14){
-var _15;
-while((_15=_14.firstChild)){
-_14.removeChild(_15);
-}
-if(arguments.length<2){
-return _14;
-}else{
-return this.appendChildNodes.apply(this,arguments);
-}
-},insertAfter:function(_16,_17){
-_17.parentNode.insertBefore(_16,_17.nextSibling);
-},insertBefore:function(_18,_19){
-_19.parentNode.insertBefore(_18,_19);
-},showElement:function(elm){
-elm.style.display="";
-},hideElement:function(elm){
-elm.style.display="none";
-},isElementHidden:function(elm){
-return elm.style.visibility=="hidden";
-},swapDOM:function(_1d,src){
-_1d=this.getElement(_1d);
-var _1f=_1d.parentNode;
-if(src){
-src=this.getElement(src);
-_1f.replaceChild(src,_1d);
-}else{
-_1f.removeChild(_1d);
-}
-return src;
-},removeElement:function(elm){
-this.swapDOM(elm,null);
-},isDict:function(o){
-var _22=String(o);
-return _22.indexOf(" Object")!=-1;
-},createDOM:function(_23,_24){
-var i=0;
-elm=document.createElement(_23);
-if(this.isDict(_24[i])){
-for(k in _24[0]){
-if(k=="style"){
-elm.style.cssText=_24[0][k];
-}else{
-if(k=="class"){
-elm.className=_24[0][k];
-}else{
-elm.setAttribute(k,_24[0][k]);
-}
-}
-}
-i++;
-}
-if(_24[0]==null){
-i=1;
-}
-for(i;i<_24.length;i++){
-var n=_24[i];
-if(this.isDefined(n)){
-if(typeof (n)=="string"){
-n=document.createTextNode(n);
-}
-elm.appendChild(n);
-}
-}
-return elm;
-},UL:function(){
-return this.createDOM.apply(this,["ul",arguments]);
-},LI:function(){
-return this.createDOM.apply(this,["li",arguments]);
-},TD:function(){
-return this.createDOM.apply(this,["td",arguments]);
-},TR:function(){
-return this.createDOM.apply(this,["tr",arguments]);
-},TH:function(){
-return this.createDOM.apply(this,["th",arguments]);
-},TBODY:function(){
-return this.createDOM.apply(this,["tbody",arguments]);
-},TABLE:function(){
-return this.createDOM.apply(this,["table",arguments]);
-},INPUT:function(){
-return this.createDOM.apply(this,["input",arguments]);
-},SPAN:function(){
-return this.createDOM.apply(this,["span",arguments]);
-},B:function(){
-return this.createDOM.apply(this,["b",arguments]);
-},A:function(){
-return this.createDOM.apply(this,["a",arguments]);
-},DIV:function(){
-return this.createDOM.apply(this,["div",arguments]);
-},IMG:function(){
-return this.createDOM.apply(this,["img",arguments]);
-},BUTTON:function(){
-return this.createDOM.apply(this,["button",arguments]);
-},H1:function(){
-return this.createDOM.apply(this,["h1",arguments]);
-},H2:function(){
-return this.createDOM.apply(this,["h2",arguments]);
-},H3:function(){
-return this.createDOM.apply(this,["h3",arguments]);
-},BR:function(){
-return this.createDOM.apply(this,["br",arguments]);
-},TEXTAREA:function(){
-return this.createDOM.apply(this,["textarea",arguments]);
-},FORM:function(){
-return this.createDOM.apply(this,["form",arguments]);
-},P:function(){
-return this.createDOM.apply(this,["p",arguments]);
-},SELECT:function(){
-return this.createDOM.apply(this,["select",arguments]);
-},OPTION:function(){
-return this.createDOM.apply(this,["option",arguments]);
-},TN:function(_27){
-return document.createTextNode(_27);
-},IFRAME:function(){
-return this.createDOM.apply(this,["iframe",arguments]);
-},SCRIPT:function(){
-return this.createDOM.apply(this,["script",arguments]);
-},getXMLHttpRequest:function(){
-var _28=[function(){
-return new XMLHttpRequest();
-},function(){
-return new ActiveXObject("Msxml2.XMLHTTP");
-},function(){
-return new ActiveXObject("Microsoft.XMLHTTP");
-},function(){
-return new ActiveXObject("Msxml2.XMLHTTP.4.0");
-},function(){
-throw "Browser does not support XMLHttpRequest";
-}];
-for(var i=0;i<_28.length;i++){
-var _2a=_28[i];
-try{
-return _2a();
-}
-catch(e){
-}
-}
-},doSimpleXMLHttpRequest:function(url){
-var req=this.getXMLHttpRequest();
-req.open("GET",url,true);
-return this.sendXMLHttpRequest(req);
-},getRequest:function(url,_2e){
-var req=this.getXMLHttpRequest();
-req.open("POST",url,true);
-req.setRequestHeader("Content-type","application/x-www-form-urlencoded");
-return this.sendXMLHttpRequest(req);
-},sendXMLHttpRequest:function(req,_31){
-var d=new AJSDeferred(req);
-var _33=function(){
-if(req.readyState==4){
-try{
-var _34=req.status;
-}
-catch(e){
-}
-if(_34==200||_34==304||req.responseText==null){
-d.callback(req,_31);
-}else{
-d.errback();
-}
+/*
+Last Modified: 28/04/06 16:28:09
+
+ AmiJs library
+ A very small library with DOM and Ajax functions.
+ For a much larger script look on http://www.mochikit.com/
+ AUTHOR
+ 4mir Salihefendic (http://amix.dk) - amix@amix.dk
+ LICENSE
+ Copyright (c) 2006 Amir Salihefendic. All rights reserved.
+ Copyright (c) 2005 Bob Ippolito. All rights reserved.
+ http://www.opensource.org/licenses/mit-license.php
+ VERSION
+ 2.1
+ SITE
+ http://amix.dk/amijs
+**/
+
+var AJS = {
+////
+// Accessor functions
+////
+ /**
+ * @returns The element with the id
+ */
+ getElement: function(id) {
+ if(typeof(id) == "string")
+ return document.getElementById(id);
+ else
+ return id;
+ },
+
+ /**
+ * @returns The elements with the ids
+ */
+ getElements: function(/*id1, id2, id3*/) {
+ var elements = new Array();
+ for (var i = 0; i < arguments.length; i++) {
+ var element = this.getElement(arguments[i]);
+ elements.push(element);
+ }
+ return elements;
+ },
+
+ /**
+ * @returns The GET query argument
+ */
+ getQueryArgument: function(var_name) {
+ var query = window.location.search.substring(1);
+ var vars = query.split("&");
+ for (var i=0;i<vars.length;i++) {
+ var pair = vars[i].split("=");
+ if (pair[0] == var_name) {
+ return pair[1];
+ }
+ }
+ return null;
+ },
+
+ /**
+ * @returns If the browser is Internet Explorer
+ */
+ isIe: function() {
+ return (navigator.userAgent.toLowerCase().indexOf("msie") != -1 && navigator.userAgent.toLowerCase().indexOf("opera") == -1);
+ },
+
+ /**
+ * @returns The document body
+ */
+ getBody: function() {
+ return this.getElementsByTagAndClassName('body')[0]
+ },
+
+ /**
+ * @returns All the elements that have a specific tag name or class name
+ */
+ getElementsByTagAndClassName: function(tag_name, class_name, /*optional*/ parent) {
+ var class_elements = new Array();
+ if(!this.isDefined(parent))
+ parent = document;
+ if(!this.isDefined(tag_name))
+ tag_name = '*';
+
+ var els = parent.getElementsByTagName(tag_name);
+ var els_len = els.length;
+ var pattern = new RegExp("(^|\\s)" + class_name + "(\\s|$)");
+
+ for (i = 0, j = 0; i < els_len; i++) {
+ if ( pattern.test(els[i].className) || class_name == null ) {
+ class_elements[j] = els[i];
+ j++;
+ }
+ }
+ return class_elements;
+ },
+
+
+////
+// DOM manipulation
+////
+ /**
+ * Appends some nodes to a node
+ */
+ appendChildNodes: function(node/*, nodes...*/) {
+ if(arguments.length >= 2) {
+ for(var i=1; i < arguments.length; i++) {
+ var n = arguments[i];
+ if(typeof(n) == "string")
+ n = document.createTextNode(n);
+ if(this.isDefined(n))
+ node.appendChild(n);
+ }
+ }
+ return node;
+ },
+
+ /**
+ * Replaces a nodes children with another node(s)
+ */
+ replaceChildNodes: function(node/*, nodes...*/) {
+ var child;
+ while ((child = node.firstChild)) {
+ node.removeChild(child);
+ }
+ if (arguments.length < 2) {
+ return node;
+ } else {
+ return this.appendChildNodes.apply(this, arguments);
+ }
+ },
+
+ /**
+ * Insert a node after another node
+ */
+ insertAfter: function(node, referenceNode) {
+ referenceNode.parentNode.insertBefore(node, referenceNode.nextSibling);
+ },
+
+ /**
+ * Insert a node before another node
+ */
+ insertBefore: function(node, referenceNode) {
+ referenceNode.parentNode.insertBefore(node, referenceNode);
+ },
+
+ /**
+ * Shows the element
+ */
+ showElement: function(elm) {
+ elm.style.display = '';
+ },
+
+ /**
+ * Hides the element
+ */
+ hideElement: function(elm) {
+ elm.style.display = 'none';
+ },
+
+ isElementHidden: function(elm) {
+ return elm.style.visibility == "hidden";
+ },
+
+ /**
+ * Swaps one element with another. To delete use swapDOM(elm, null)
+ */
+ swapDOM: function(dest, src) {
+ dest = this.getElement(dest);
+ var parent = dest.parentNode;
+ if (src) {
+ src = this.getElement(src);
+ parent.replaceChild(src, dest);
+ } else {
+ parent.removeChild(dest);
+ }
+ return src;
+ },
+
+ /**
+ * Removes an element from the world
+ */
+ removeElement: function(elm) {
+ this.swapDOM(elm, null);
+ },
+
+ /**
+ * @returns Is an object a dictionary?
+ */
+ isDict: function(o) {
+ var str_repr = String(o);
+ return str_repr.indexOf(" Object") != -1;
+ },
+
+ /**
+ * Creates a DOM element
+ * @param {String} name The elements DOM name
+ * @param {Dict} attrs Attributes sent to the function
+ */
+ createDOM: function(name, attrs) {
+ var i=0;
+ elm = document.createElement(name);
+
+ if(this.isDict(attrs[i])) {
+ for(k in attrs[0]) {
+ if(k == "style")
+ elm.style.cssText = attrs[0][k];
+ else if(k == "class")
+ elm.className = attrs[0][k];
+ else
+ elm.setAttribute(k, attrs[0][k]);
+ }
+ i++;
+ }
+
+ if(attrs[0] == null)
+ i = 1;
+
+ for(i; i < attrs.length; i++) {
+ var n = attrs[i];
+ if(this.isDefined(n)) {
+ if(typeof(n) == "string")
+ n = document.createTextNode(n);
+ elm.appendChild(n);
+ }
+ }
+ return elm;
+ },
+
+ UL: function() { return this.createDOM.apply(this, ["ul", arguments]); },
+ LI: function() { return this.createDOM.apply(this, ["li", arguments]); },
+ TD: function() { return this.createDOM.apply(this, ["td", arguments]); },
+ TR: function() { return this.createDOM.apply(this, ["tr", arguments]); },
+ TH: function() { return this.createDOM.apply(this, ["th", arguments]); },
+ TBODY: function() { return this.createDOM.apply(this, ["tbody", arguments]); },
+ TABLE: function() { return this.createDOM.apply(this, ["table", arguments]); },
+ INPUT: function() { return this.createDOM.apply(this, ["input", arguments]); },
+ SPAN: function() { return this.createDOM.apply(this, ["span", arguments]); },
+ B: function() { return this.createDOM.apply(this, ["b", arguments]); },
+ A: function() { return this.createDOM.apply(this, ["a", arguments]); },
+ DIV: function() { return this.createDOM.apply(this, ["div", arguments]); },
+ IMG: function() { return this.createDOM.apply(this, ["img", arguments]); },
+ BUTTON: function() { return this.createDOM.apply(this, ["button", arguments]); },
+ H1: function() { return this.createDOM.apply(this, ["h1", arguments]); },
+ H2: function() { return this.createDOM.apply(this, ["h2", arguments]); },
+ H3: function() { return this.createDOM.apply(this, ["h3", arguments]); },
+ BR: function() { return this.createDOM.apply(this, ["br", arguments]); },
+ TEXTAREA: function() { return this.createDOM.apply(this, ["textarea", arguments]); },
+ FORM: function() { return this.createDOM.apply(this, ["form", arguments]); },
+ P: function() { return this.createDOM.apply(this, ["p", arguments]); },
+ SELECT: function() { return this.createDOM.apply(this, ["select", arguments]); },
+ OPTION: function() { return this.createDOM.apply(this, ["option", arguments]); },
+ TN: function(text) { return document.createTextNode(text); },
+ IFRAME: function() { return this.createDOM.apply(this, ["iframe", arguments]); },
+ SCRIPT: function() { return this.createDOM.apply(this, ["script", arguments]); },
+
+////
+// Ajax functions
+////
+ /**
+ * @returns A new XMLHttpRequest object
+ */
+ getXMLHttpRequest: function() {
+ var try_these = [
+ function () { return new XMLHttpRequest(); },
+ function () { return new ActiveXObject('Msxml2.XMLHTTP'); },
+ function () { return new ActiveXObject('Microsoft.XMLHTTP'); },
+ function () { return new ActiveXObject('Msxml2.XMLHTTP.4.0'); },
+ function () { throw "Browser does not support XMLHttpRequest"; }
+ ];
+ for (var i = 0; i < try_these.length; i++) {
+ var func = try_these[i];
+ try {
+ return func();
+ } catch (e) {
+ }
+ }
+ },
+
+ /**
+ * Use this function to do a simple HTTP Request
+ */
+ doSimpleXMLHttpRequest: function(url) {
+ var req = this.getXMLHttpRequest();
+ req.open("GET", url, true);
+ return this.sendXMLHttpRequest(req);
+ },
+
+ getRequest: function(url, data) {
+ var req = this.getXMLHttpRequest();
+ req.open("POST", url, true);
+ req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
+ return this.sendXMLHttpRequest(req);
+ },
+
+ /**
+ * Send a XMLHttpRequest
+ */
+ sendXMLHttpRequest: function(req, data) {
+ var d = new AJSDeferred(req);
+
+ var onreadystatechange = function () {
+ if (req.readyState == 4) {
+ try {
+ var status = req.status;
+ }
+ catch(e) {};
+ if(status == 200 || status == 304 || req.responseText == null) {
+ d.callback(req, data);
+ }
+ else {
+ d.errback();
+ }
+ }
+ }
+ req.onreadystatechange = onreadystatechange;
+ return d;
+ },
+
+ /**
+ * Represent an object as a string
+ */
+ reprString: function(o) {
+ return ('"' + o.replace(/(["\\])/g, '\\$1') + '"'
+ ).replace(/[\f]/g, "\\f"
+ ).replace(/[\b]/g, "\\b"
+ ).replace(/[\n]/g, "\\n"
+ ).replace(/[\t]/g, "\\t"
+ ).replace(/[\r]/g, "\\r");
+ },
+
+ /**
+ * Serialize an object to JSON notation
+ */
+ serializeJSON: function(o) {
+ var objtype = typeof(o);
+ if (objtype == "undefined") {
+ return "undefined";
+ } else if (objtype == "number" || objtype == "boolean") {
+ return o + "";
+ } else if (o === null) {
+ return "null";
+ }
+ if (objtype == "string") {
+ return this.reprString(o);
+ }
+ var me = arguments.callee;
+ var newObj;
+ if (typeof(o.__json__) == "function") {
+ newObj = o.__json__();
+ if (o !== newObj) {
+ return me(newObj);
+ }
+ }
+ if (typeof(o.json) == "function") {
+ newObj = o.json();
+ if (o !== newObj) {
+ return me(newObj);
+ }
+ }
+ if (objtype != "function" && typeof(o.length) == "number") {
+ var res = [];
+ for (var i = 0; i < o.length; i++) {
+ var val = me(o[i]);
+ if (typeof(val) != "string") {
+ val = "undefined";
+ }
+ res.push(val);
+ }
+ return "[" + res.join(",") + "]";
+ }
+ res = [];
+ for (var k in o) {
+ var useKey;
+ if (typeof(k) == "number") {
+ useKey = '"' + k + '"';
+ } else if (typeof(k) == "string") {
+ useKey = this.reprString(k);
+ } else {
+ // skip non-string or number keys
+ continue;
+ }
+ val = me(o[k]);
+ if (typeof(val) != "string") {
+ // skip non-serializable values
+ continue;
+ }
+ res.push(useKey + ":" + val);
+ }
+ return "{" + res.join(",") + "}";
+ },
+
+ /**
+ * Send and recive JSON using GET
+ */
+ loadJSONDoc: function(url) {
+ var d = this.getRequest(url);
+ var eval_req = function(req) {
+ var text = req.responseText;
+ return eval('(' + text + ')');
+ };
+ d.addCallback(eval_req);
+ return d;
+ },
+
+
+////
+// Misc.
+////
+ /**
+ * Alert the objects key attrs
+ */
+ keys: function(obj) {
+ var rval = [];
+ for (var prop in obj) {
+ rval.push(prop);
+ }
+ return rval;
+ },
+
+ urlencode: function(str) {
+ return encodeURIComponent(str.toString());
+ },
+
+ /**
+ * @returns True if the object is defined, otherwise false
+ */
+ isDefined: function(o) {
+ return (o != "undefined" && o != null)
+ },
+
+ /**
+ * @returns True if an object is a array, false otherwise
+ */
+ isArray: function(obj) {
+ try { return (typeof(obj.length) == "undefined") ? false : true; }
+ catch(e)
+ { return false; }
+ },
+
+ isObject: function(obj) {
+ return (obj && typeof obj == 'object');
+ },
+
+ /**
+ * Export DOM elements to the global namespace
+ */
+ exportDOMElements: function() {
+ UL = this.UL;
+ LI = this.LI;
+ TD = this.TD;
+ TR = this.TR;
+ TH = this.TH;
+ TBODY = this.TBODY;
+ TABLE = this.TABLE;
+ INPUT = this.INPUT;
+ SPAN = this.SPAN;
+ B = this.B;
+ A = this.A;
+ DIV = this.DIV;
+ IMG = this.IMG;
+ BUTTON = this.BUTTON;
+ H1 = this.H1;
+ H2 = this.H2;
+ H3 = this.H3;
+ BR = this.BR;
+ TEXTAREA = this.TEXTAREA;
+ FORM = this.FORM;
+ P = this.P;
+ SELECT = this.SELECT;
+ OPTION = this.OPTION;
+ TN = this.TN;
+ IFRAME = this.IFRAME;
+ SCRIPT = this.SCRIPT;
+ },
+
+ /**
+ * Export AmiJS functions to the global namespace
+ */
+ exportToGlobalScope: function() {
+ getElement = this.getElement;
+ getQueryArgument = this.getQueryArgument;
+ isIe = this.isIe;
+ $ = this.getElement;
+ getElements = this.getElements;
+ getBody = this.getBody;
+ getElementsByTagAndClassName = this.getElementsByTagAndClassName;
+ appendChildNodes = this.appendChildNodes;
+ ACN = appendChildNodes;
+ replaceChildNodes = this.replaceChildNodes;
+ RCN = replaceChildNodes;
+ insertAfter = this.insertAfter;
+ insertBefore = this.insertBefore;
+ showElement = this.showElement;
+ hideElement = this.hideElement;
+ isElementHidden = this.isElementHidden;
+ swapDOM = this.swapDOM;
+ removeElement = this.removeElement;
+ isDict = this.isDict;
+ createDOM = this.createDOM;
+ this.exportDOMElements();
+ getXMLHttpRequest = this.getXMLHttpRequest;
+ doSimpleXMLHttpRequest = this.doSimpleXMLHttpRequest;
+ getRequest = this.getRequest;
+ sendXMLHttpRequest = this.sendXMLHttpRequest;
+ reprString = this.reprString;
+ serializeJSON = this.serializeJSON;
+ loadJSONDoc = this.loadJSONDoc;
+ keys = this.keys;
+ isDefined = this.isDefined;
+ isArray = this.isArray;
+ }
}
+
+
+
+AJSDeferred = function(req) {
+ this.callbacks = [];
+ this.req = req;
+
+ this.callback = function (res) {
+ while (this.callbacks.length > 0) {
+ var fn = this.callbacks.pop();
+ res = fn(res);
+ }
+ };
+
+ this.errback = function(e){
+ alert("Error encountered:\n" + e);
+ };
+
+ this.addErrback = function(fn) {
+ this.errback = fn;
+ };
+
+ this.addCallback = function(fn) {
+ this.callbacks.unshift(fn);
+ };
+
+ this.addCallbacks = function(fn1, fn2) {
+ this.addCallback(fn1);
+ this.addErrback(fn2);
+ };
+
+ this.sendReq = function(data) {
+ if(AJS.isObject(data)) {
+ var post_data = [];
+ for(k in data) {
+ post_data.push(k + "=" + AJS.urlencode(data[k]));
+ }
+ post_data = post_data.join("&");
+ this.req.send(post_data);
+ }
+ else if(AJS.isDefined(data))
+ this.req.send(data);
+ else {
+ this.req.send("");
+ }
+ };
};
-req.onreadystatechange=_33;
-return d;
-},reprString:function(o){
-return ("\""+o.replace(/(["\\])/g,"\\$1")+"\"").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r");
-},serializeJSON:function(o){
-var _37=typeof (o);
-if(_37=="undefined"){
-return "undefined";
-}else{
-if(_37=="number"||_37=="boolean"){
-return o+"";
-}else{
-if(o===null){
-return "null";
-}
-}
-}
-if(_37=="string"){
-return this.reprString(o);
-}
-var me=arguments.callee;
-var _39;
-if(typeof (o.__json__)=="function"){
-_39=o.__json__();
-if(o!==_39){
-return me(_39);
-}
-}
-if(typeof (o.json)=="function"){
-_39=o.json();
-if(o!==_39){
-return me(_39);
-}
-}
-if(_37!="function"&&typeof (o.length)=="number"){
-var res=[];
-for(var i=0;i<o.length;i++){
-var val=me(o[i]);
-if(typeof (val)!="string"){
-val="undefined";
-}
-res.push(val);
-}
-return "["+res.join(",")+"]";
-}
-res=[];
-for(var k in o){
-var _3e;
-if(typeof (k)=="number"){
-_3e="\""+k+"\"";
-}else{
-if(typeof (k)=="string"){
-_3e=this.reprString(k);
-}else{
-continue;
-}
-}
-val=me(o[k]);
-if(typeof (val)!="string"){
-continue;
-}
-res.push(_3e+":"+val);
-}
-return "{"+res.join(",")+"}";
-},loadJSONDoc:function(url){
-var d=this.getRequest(url);
-var _41=function(req){
-var _43=req.responseText;
-return eval("("+_43+")");
-};
-d.addCallback(_41);
-return d;
-},keys:function(obj){
-var _45=[];
-for(var _46 in obj){
-_45.push(_46);
-}
-return _45;
-},urlencode:function(str){
-return encodeURIComponent(str.toString());
-},isDefined:function(o){
-return (o!="undefined"&&o!=null);
-},isArray:function(obj){
-try{
-return (typeof (obj.length)=="undefined")?false:true;
-}
-catch(e){
-return false;
-}
-},isObject:function(obj){
-return (obj&&typeof obj=="object");
-},exportDOMElements:function(){
-UL=this.UL;
-LI=this.LI;
-TD=this.TD;
-TR=this.TR;
-TH=this.TH;
-TBODY=this.TBODY;
-TABLE=this.TABLE;
-INPUT=this.INPUT;
-SPAN=this.SPAN;
-B=this.B;
-A=this.A;
-DIV=this.DIV;
-IMG=this.IMG;
-BUTTON=this.BUTTON;
-H1=this.H1;
-H2=this.H2;
-H3=this.H3;
-BR=this.BR;
-TEXTAREA=this.TEXTAREA;
-FORM=this.FORM;
-P=this.P;
-SELECT=this.SELECT;
-OPTION=this.OPTION;
-TN=this.TN;
-IFRAME=this.IFRAME;
-SCRIPT=this.SCRIPT;
-},exportToGlobalScope:function(){
-getElement=this.getElement;
-getQueryArgument=this.getQueryArgument;
-isIe=this.isIe;
-$=this.getElement;
-getElements=this.getElements;
-getBody=this.getBody;
-getElementsByTagAndClassName=this.getElementsByTagAndClassName;
-appendChildNodes=this.appendChildNodes;
-ACN=appendChildNodes;
-replaceChildNodes=this.replaceChildNodes;
-RCN=replaceChildNodes;
-insertAfter=this.insertAfter;
-insertBefore=this.insertBefore;
-showElement=this.showElement;
-hideElement=this.hideElement;
-isElementHidden=this.isElementHidden;
-swapDOM=this.swapDOM;
-removeElement=this.removeElement;
-isDict=this.isDict;
-createDOM=this.createDOM;
-this.exportDOMElements();
-getXMLHttpRequest=this.getXMLHttpRequest;
-doSimpleXMLHttpRequest=this.doSimpleXMLHttpRequest;
-getRequest=this.getRequest;
-sendXMLHttpRequest=this.sendXMLHttpRequest;
-reprString=this.reprString;
-serializeJSON=this.serializeJSON;
-loadJSONDoc=this.loadJSONDoc;
-keys=this.keys;
-isDefined=this.isDefined;
-isArray=this.isArray;
-}};
-AJSDeferred=function(req){
-this.callbacks=[];
-this.req=req;
-this.callback=function(res){
-while(this.callbacks.length>0){
-var fn=this.callbacks.pop();
-res=fn(res);
+AJSDeferred.prototype = new AJSDeferred();
+
+
+
+
+
+
+/****
+Last Modified: 28/04/06 15:26:06
+
+ GoogieSpell
+ Google spell checker for your own web-apps :)
+ Copyright Amir Salihefendic 2006
+ LICENSE
+ GPL (see gpl.txt for more information)
+ This basically means that you can't use this script with/in proprietary software!
+ There is another license that permits you to use this script with proprietary software. Check out:... for more info.
+ AUTHOR
+ 4mir Salihefendic (http://amix.dk) - amix@amix.dk
+ VERSION
+ 3.22
+****/
+var GOOGIE_CUR_LANG = "en";
+
+function GoogieSpell(img_dir, server_url) {
+ var cookie_value;
+ var lang;
+ cookie_value = getCookie('language');
+
+ if(cookie_value != null)
+ GOOGIE_CUR_LANG = cookie_value;
+
+ this.img_dir = img_dir;
+ this.server_url = server_url;
+
+ this.lang_to_word = {"da": "Dansk", "de": "Deutsch", "en": "English",
+ "es": "Español", "fr": "Français", "it": "Italiano",
+ "nl": "Nederlands", "pl": "Polski", "pt": "Português",
+ "fi": "Suomi", "sv": "Svenska"};
+ this.langlist_codes = AJS.keys(this.lang_to_word);
+
+ this.show_change_lang_pic = true;
+
+ this.lang_state_observer = null;
+
+ this.spelling_state_observer = null;
+
+ this.request = null;
+ this.error_window = null;
+ this.language_window = null;
+ this.edit_layer = null;
+ this.orginal_text = null;
+ this.results = null;
+ this.text_area = null;
+ this.gselm = null;
+ this.ta_scroll_top = 0;
+ this.el_scroll_top = 0;
+
+ this.lang_chck_spell = "Check spelling";
+ this.lang_rsm_edt = "Resume editing";
+ this.lang_close = "Close";
+ this.lang_no_error_found = "No spelling errors found";
+ this.lang_revert = "Revert to";
+ this.show_spell_img = false; // modified by roundcube
}
-};
-this.errback=function(e){
-alert("Error encountered:\n"+e);
-};
-this.addErrback=function(fn){
-this.errback=fn;
-};
-this.addCallback=function(fn){
-this.callbacks.unshift(fn);
-};
-this.addCallbacks=function(fn1,fn2){
-this.addCallback(fn1);
-this.addErrback(fn2);
-};
-this.sendReq=function(_53){
-if(AJS.isObject(_53)){
-var _54=[];
-for(k in _53){
-_54.push(k+"="+AJS.urlencode(_53[k]));
+
+GoogieSpell.prototype.setStateChanged = function(current_state) {
+ if(this.spelling_state_observer != null)
+ this.spelling_state_observer(current_state);
}
-_54=_54.join("&");
-this.req.send(_54);
-}else{
-if(AJS.isDefined(_53)){
-this.req.send(_53);
-}else{
-this.req.send("");
+
+GoogieSpell.item_onmouseover = function(e) {
+ var elm = GoogieSpell.getEventElm(e);
+ if(elm.className != "googie_list_close" && elm.className != "googie_list_revert")
+ elm.className = "googie_list_onhover";
+ else
+ elm.parentNode.className = "googie_list_onhover";
}
+
+GoogieSpell.item_onmouseout = function(e) {
+ var elm = GoogieSpell.getEventElm(e);
+ if(elm.className != "googie_list_close" && elm.className != "googie_list_revert")
+ elm.className = "googie_list_onout";
+ else
+ elm.parentNode.className = "googie_list_onout";
}
-};
-};
-AJSDeferred.prototype=new AJSDeferred();
-var GOOGIE_CUR_LANG="en";
-function GoogieSpell(_55,_56){
-var _57;
-var _58;
-_57=getCookie("language");
-if(_57!=null){
-GOOGIE_CUR_LANG=_57;
-}
-this.img_dir=_55;
-this.server_url=_56;
-this.lang_to_word={"da":"Dansk","de":"Deutsch","en":"English","es":"Español","fr":"Français","it":"Italiano","nl":"Nederlands","pl":"Polski","pt":"Português","fi":"Suomi","sv":"Svenska"};
-this.langlist_codes=AJS.keys(this.lang_to_word);
-this.show_change_lang_pic=true;
-this.lang_state_observer=null;
-this.spelling_state_observer=null;
-this.request=null;
-this.error_window=null;
-this.language_window=null;
-this.edit_layer=null;
-this.orginal_text=null;
-this.results=null;
-this.text_area=null;
-this.gselm=null;
-this.ta_scroll_top=0;
-this.el_scroll_top=0;
-this.lang_chck_spell="Check spelling";
-this.lang_rsm_edt="Resume editing";
-this.lang_close="Close";
-this.lang_no_error_found="No spelling errors found";
-this.lang_revert="Revert to";
-this.show_spell_img=false;
-};
-GoogieSpell.prototype.setStateChanged=function(_59){
-if(this.spelling_state_observer!=null){
-this.spelling_state_observer(_59);
+
+GoogieSpell.prototype.getGoogleUrl = function() {
+ return this.server_url + GOOGIE_CUR_LANG;
}
-};
-GoogieSpell.item_onmouseover=function(e){
-var elm=GoogieSpell.getEventElm(e);
-if(elm.className!="googie_list_close"&&elm.className!="googie_list_revert"){
-elm.className="googie_list_onhover";
-}else{
-elm.parentNode.className="googie_list_onhover";
+
+GoogieSpell.prototype.spellCheck = function(elm, name) {
+ this.ta_scroll_top = this.text_area.scrollTop;
+
+ this.appendIndicator(elm);
+
+ try {
+ this.hideLangWindow();
+ }
+ catch(e) {}
+
+ this.gselm = elm;
+
+ this.createEditLayer(this.text_area.offsetWidth, this.text_area.offsetHeight);
+
+ this.createErrorWindow();
+ AJS.getBody().appendChild(this.error_window);
+
+ try { netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead"); }
+ catch (e) { }
+
+ this.gselm.onclick = null;
+
+ this.orginal_text = this.text_area.value;
+ var me = this;
+
+ //Create request
+ var d = AJS.getRequest(this.getGoogleUrl());
+ var reqdone = function(req) {
+ var r_text = req.responseText;
+ if(r_text.match(/<c.*>/) != null) {
+ var results = GoogieSpell.parseResult(r_text);
+ //Before parsing be sure that errors were found
+ me.results = results;
+ me.showErrorsInIframe(results);
+ me.resumeEditingState();
+ }
+ else {
+ me.flashNoSpellingErrorState();
+ }
+ me.removeIndicator();
+ };
+
+ var reqfailed = function(req) {
+ alert("An error was encountered on the server. Please try again later.");
+ AJS.removeElement(me.gselm);
+ me.checkSpellingState();
+ me.removeIndicator();
+ };
+
+ d.addCallback(reqdone);
+ d.addErrback(reqfailed);
+
+ var req_text = GoogieSpell.escapeSepcial(this.orginal_text);
+ d.sendReq(GoogieSpell.createXMLReq(req_text));
}
-};
-GoogieSpell.item_onmouseout=function(e){
-var elm=GoogieSpell.getEventElm(e);
-if(elm.className!="googie_list_close"&&elm.className!="googie_list_revert"){
-elm.className="googie_list_onout";
-}else{
-elm.parentNode.className="googie_list_onout";
+
+GoogieSpell.escapeSepcial = function(val) {
+ return val.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
}
-};
-GoogieSpell.prototype.getGoogleUrl=function(){
-return this.server_url+GOOGIE_CUR_LANG;
-};
-GoogieSpell.prototype.spellCheck=function(elm,_5f){
-this.ta_scroll_top=this.text_area.scrollTop;
-this.appendIndicator(elm);
-try{
-this.hideLangWindow();
-}
-catch(e){
-}
-this.gselm=elm;
-this.createEditLayer(this.text_area.offsetWidth,this.text_area.offsetHeight);
-this.createErrorWindow();
-AJS.getBody().appendChild(this.error_window);
-try{
-netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
-}
-catch(e){
-}
-this.gselm.onclick=null;
-this.orginal_text=this.text_area.value;
-var me=this;
-var d=AJS.getRequest(this.getGoogleUrl());
-var _62=function(req){
-var _64=req.responseText;
-if(_64.match(/<c.*>/)!=null){
-var _65=GoogieSpell.parseResult(_64);
-me.results=_65;
-me.showErrorsInIframe(_65);
-me.resumeEditingState();
-}else{
-me.flashNoSpellingErrorState();
-}
-me.removeIndicator();
-};
-var _66=function(req){
-alert("An error was encountered on the server. Please try again later.");
-AJS.removeElement(me.gselm);
-me.checkSpellingState();
-me.removeIndicator();
-};
-d.addCallback(_62);
-d.addErrback(_66);
-var _68=GoogieSpell.escapeSepcial(this.orginal_text);
-d.sendReq(GoogieSpell.createXMLReq(_68));
-};
-GoogieSpell.escapeSepcial=function(val){
-return val.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");
-};
-GoogieSpell.createXMLReq=function(_6a){
-return "<?xml version=\"1.0\" encoding=\"utf-8\" ?><spellrequest textalreadyclipped=\"0\" ignoredups=\"0\" ignoredigits=\"1\" ignoreallcaps=\"1\"><text>"+_6a+"</text></spellrequest>";
-};
-GoogieSpell.parseResult=function(_6b){
-var _6c=/\w="\d+"/g;
-var _6d=/\t/g;
-var _6e=_6b.match(/<c[^>]*>[^<]*<\/c>/g);
-var _6f=new Array();
-for(var i=0;i<_6e.length;i++){
-var _71=new Array();
-_71["attrs"]=new Array();
-var _72=_6e[i].match(_6c);
-for(var j=0;j<_72.length;j++){
-var _74=_72[j].split(/=/);
-_71["attrs"][_74[0]]=parseInt(_74[1].replace("\"",""));
-}
-_71["suggestions"]=new Array();
-var _75=_6e[i].replace(/<[^>]*>/g,"");
-var _76=_75.split(_6d);
-for(var k=0;k<_76.length;k++){
-if(_76[k]!=""){
-_71["suggestions"].push(_76[k]);
-}
-}
-_6f.push(_71);
-}
-return _6f;
-};
-GoogieSpell.prototype.createErrorWindow=function(){
-this.error_window=AJS.DIV();
-this.error_window.className="googie_window";
-};
-GoogieSpell.prototype.hideErrorWindow=function(){
-this.error_window.style.visibility="hidden";
-};
-GoogieSpell.prototype.updateOrginalText=function(_78,_79,_7a,id){
-var _7c=this.orginal_text.substring(0,_78);
-var _7d=this.orginal_text.substring(_78+_79.length);
-this.orginal_text=_7c+_7a+_7d;
-var _7e=_7a.length-_79.length;
-for(var j=0;j<this.results.length;j++){
-if(j!=id&&j>id){
-this.results[j]["attrs"]["o"]+=_7e;
+
+GoogieSpell.createXMLReq = function (text) {
+ return '<?xml version="1.0" encoding="utf-8" ?><spellrequest textalreadyclipped="0" ignoredups="0" ignoredigits="1" ignoreallcaps="1"><text>' + text + '</text></spellrequest>';
}
+
+//Retunrs an array
+//result[item] -> ['attrs']
+// ['suggestions']
+GoogieSpell.parseResult = function(r_text) {
+ var re_split_attr_c = /\w="\d+"/g;
+ var re_split_text = /\t/g;
+
+ var matched_c = r_text.match(/<c[^>]*>[^<]*<\/c>/g);
+ var results = new Array();
+
+ for(var i=0; i < matched_c.length; i++) {
+ var item = new Array();
+
+ //Get attributes
+ item['attrs'] = new Array();
+ var split_c = matched_c[i].match(re_split_attr_c);
+ for(var j=0; j < split_c.length; j++) {
+ var c_attr = split_c[j].split(/=/);
+ item['attrs'][c_attr[0]] = parseInt(c_attr[1].replace('"', ''));
+ }
+
+ //Get suggestions
+ item['suggestions'] = new Array();
+ var only_text = matched_c[i].replace(/<[^>]*>/g, "");
+ var split_t = only_text.split(re_split_text);
+ for(var k=0; k < split_t.length; k++) {
+ if(split_t[k] != "")
+ item['suggestions'].push(split_t[k]);
+ }
+ results.push(item);
+ }
+ return results;
}
-};
-GoogieSpell.prototype.saveOldValue=function(id,_81){
-this.results[id]["is_changed"]=true;
-this.results[id]["old_value"]=_81;
-};
-GoogieSpell.prototype.showErrorWindow=function(elm,id){
-var me=this;
-var _85=GoogieSpell.absolutePosition(elm);
-_85.y-=this.edit_layer.scrollTop;
-this.error_window.style.visibility="visible";
-this.error_window.style.top=(_85.y+20)+"px";
-this.error_window.style.left=(_85.x)+"px";
-this.error_window.innerHTML="";
-var _86=AJS.TABLE({"class":"googie_list"});
-var _87=AJS.TBODY();
-var _88=this.results[id]["suggestions"];
-var _89=this.results[id]["attrs"]["o"];
-var len=this.results[id]["attrs"]["l"];
-if(_88.length==0){
-var row=AJS.TR();
-var _8c=AJS.TD();
-var _8d=AJS.SPAN();
-_8c.appendChild(AJS.TN("No suggestions :("));
-row.appendChild(_8c);
-_87.appendChild(row);
-}
-for(i=0;i<_88.length;i++){
-var row=AJS.TR();
-var _8c=AJS.TD();
-var _8d=AJS.SPAN();
-_8d.innerHTML=_88[i];
-_8c.appendChild(AJS.TN(_8d.innerHTML));
-_8c.onclick=function(e){
-var _8f=GoogieSpell.getEventElm(e);
-var _90=elm.innerHTML;
-var _91=_8f.innerHTML;
-elm.style.color="green";
-elm.innerHTML=_8f.innerHTML;
-me.hideErrorWindow();
-me.updateOrginalText(_89,_90,_91,id);
-me.results[id]["attrs"]["l"]=_91.length;
-me.saveOldValue(id,_90);
-};
-_8c.onmouseover=GoogieSpell.item_onmouseover;
-_8c.onmouseout=GoogieSpell.item_onmouseout;
-row.appendChild(_8c);
-_87.appendChild(row);
-}
-if(this.results[id]["is_changed"]){
-var _92=this.results[id]["old_value"];
-var _89=this.results[id]["attrs"]["o"];
-var _93=AJS.TR();
-var _94=AJS.TD();
-_94.onmouseover=GoogieSpell.item_onmouseover;
-_94.onmouseout=GoogieSpell.item_onmouseout;
-var _95=AJS.SPAN({"class":"googie_list_revert"});
-_95.innerHTML=this.lang_revert+" "+_92;
-_94.appendChild(_95);
-_94.onclick=function(e){
-me.updateOrginalText(_89,elm.innerHTML,_92,id);
-elm.style.color="#b91414";
-elm.innerHTML=_92;
-me.hideErrorWindow();
-};
-_93.appendChild(_94);
-_87.appendChild(_93);
-}
-var _97=AJS.TR();
-var _98=AJS.TD();
-var _99=AJS.INPUT({"style":"width: 120px; margin:0; padding:0"});
-var _9a=function(){
-if(_99.value!=""){
-me.saveOldValue(id,elm.innerHTML);
-me.updateOrginalText(_89,elm.innerHTML,_99.value,id);
-elm.style.color="green";
-elm.innerHTML=_99.value;
-me.hideErrorWindow();
-return false;
+
+/****
+ Error window (the drop-down window)
+****/
+GoogieSpell.prototype.createErrorWindow = function() {
+ this.error_window = AJS.DIV();
+ this.error_window.className = "googie_window";
}
-};
-var _9b=AJS.IMG({"src":this.img_dir+"ok.gif","style":"width: 32px; height: 16px; margin-left: 2px; margin-right: 2px;"});
-var _9c=AJS.FORM({"style":"margin: 0; padding: 0"},_99,_9b);
-_9b.onclick=_9a;
-_9c.onsubmit=_9a;
-_98.appendChild(_9c);
-_97.appendChild(_98);
-_87.appendChild(_97);
-var _9d=AJS.TR();
-var _9e=AJS.TD();
-_9e.onmouseover=GoogieSpell.item_onmouseover;
-_9e.onmouseout=GoogieSpell.item_onmouseout;
-var _9f=AJS.SPAN({"class":"googie_list_close"});
-_9f.innerHTML=this.lang_close;
-_9e.appendChild(_9f);
-_9e.onclick=function(){
-me.hideErrorWindow();
-};
-_9d.appendChild(_9e);
-_87.appendChild(_9d);
-_86.appendChild(_87);
-this.error_window.appendChild(_86);
-};
-GoogieSpell.prototype.createEditLayer=function(_a0,_a1){
-this.edit_layer=AJS.DIV({"class":"googie_edit_layer"});
-this.edit_layer.className=this.text_area.className;
-this.edit_layer.style.border="1px solid #999";
-this.edit_layer.style.overflow="auto";
-this.edit_layer.style.backgroundColor="#F1EDFE";
-this.edit_layer.style.padding="3px";
-this.edit_layer.style.width=(_a0-8)+"px";
-this.edit_layer.style.height=_a1+"px";
-};
-GoogieSpell.prototype.resumeEditing=function(e,me){
-this.setStateChanged("check_spelling");
-me.switch_lan_pic.style.display="inline";
-this.el_scroll_top=me.edit_layer.scrollTop;
-var elm=GoogieSpell.getEventElm(e);
-AJS.replaceChildNodes(elm,this.createSpellDiv());
-elm.onclick=function(e){
-me.spellCheck(elm,me.text_area.id);
-};
-me.hideErrorWindow();
-me.edit_layer.parentNode.removeChild(me.edit_layer);
-me.text_area.value=me.orginal_text;
-AJS.showElement(me.text_area);
-me.gselm.className="googie_no_style";
-me.text_area.scrollTop=this.el_scroll_top;
-elm.onmouseout=null;
-};
-GoogieSpell.prototype.createErrorLink=function(_a6,id){
-var elm=AJS.SPAN({"class":"googie_link"});
-var me=this;
-elm.onclick=function(){
-me.showErrorWindow(elm,id);
-};
-elm.innerHTML=_a6;
-return elm;
-};
-GoogieSpell.createPart=function(_aa){
-if(_aa==" "){
-return AJS.TN(" ");
-}
-var _ab=AJS.SPAN();
-var _ac=true;
-var _ad=(navigator.userAgent.toLowerCase().indexOf("safari")!=-1);
-var _ae=AJS.SPAN();
-_aa=GoogieSpell.escapeSepcial(_aa);
-_aa=_aa.replace(/\n/g,"<br>");
-_aa=_aa.replace(/ /g," ");
-_aa=_aa.replace(/^ /g," ");
-_aa=_aa.replace(/ $/g," ");
-_ae.innerHTML=_aa;
-return _ae;
-};
-GoogieSpell.prototype.showErrorsInIframe=function(_af){
-var _b0=AJS.DIV();
-_b0.style.textAlign="left";
-var _b1=0;
-for(var i=0;i<_af.length;i++){
-var _b3=_af[i]["attrs"]["o"];
-var len=_af[i]["attrs"]["l"];
-var _b5=this.orginal_text.substring(_b1,_b3);
-var _b6=GoogieSpell.createPart(_b5);
-_b0.appendChild(_b6);
-_b1+=_b3-_b1;
-_b0.appendChild(this.createErrorLink(this.orginal_text.substr(_b3,len),i));
-_b1+=len;
-}
-var _b7=this.orginal_text.substr(_b1,this.orginal_text.length);
-var _b8=GoogieSpell.createPart(_b7);
-_b0.appendChild(_b8);
-this.edit_layer.appendChild(_b0);
-AJS.hideElement(this.text_area);
-this.text_area.parentNode.insertBefore(this.edit_layer,this.text_area.nextSibling);
-this.edit_layer.scrollTop=this.ta_scroll_top;
-};
-GoogieSpell.Position=function(x,y){
-this.x=x;
-this.y=y;
-};
-GoogieSpell.absolutePosition=function(_bb){
-var _bc=new GoogieSpell.Position(_bb.offsetLeft,_bb.offsetTop);
-if(_bb.offsetParent){
-var _bd=GoogieSpell.absolutePosition(_bb.offsetParent);
-_bc.x+=_bd.x;
-_bc.y+=_bd.y;
-}
-return _bc;
-};
-GoogieSpell.getEventElm=function(e){
-var _bf;
-if(!e){
-var e=window.event;
+
+GoogieSpell.prototype.hideErrorWindow = function() {
+ this.error_window.style.visibility = "hidden";
+}
+
+GoogieSpell.prototype.updateOrginalText = function(offset, old_value, new_value, id) {
+ var part_1 = this.orginal_text.substring(0, offset);
+ var part_2 = this.orginal_text.substring(offset+old_value.length);
+ this.orginal_text = part_1 + new_value + part_2;
+ var add_2_offset = new_value.length - old_value.length;
+ for(var j=0; j < this.results.length; j++) {
+ //Don't edit the offset of the current item
+ if(j != id && j > id){
+ this.results[j]['attrs']['o'] += add_2_offset;
+ }
+ }
+}
+
+GoogieSpell.prototype.saveOldValue = function (id, old_value) {
+ this.results[id]['is_changed'] = true;
+ this.results[id]['old_value'] = old_value;
}
-if(e.target){
-_bf=e.target;
-}else{
-if(e.srcElement){
-_bf=e.srcElement;
+
+GoogieSpell.prototype.showErrorWindow = function(elm, id) {
+ var me = this;
+
+ var abs_pos = GoogieSpell.absolutePosition(elm);
+ abs_pos.y -= this.edit_layer.scrollTop;
+ this.error_window.style.visibility = "visible";
+ this.error_window.style.top = (abs_pos.y+20) + "px";
+ this.error_window.style.left = (abs_pos.x) + "px";
+ this.error_window.innerHTML = "";
+
+ //Build up the result list
+ var table = AJS.TABLE({'class': 'googie_list'});
+ var list = AJS.TBODY();
+
+ var suggestions = this.results[id]['suggestions'];
+ var offset = this.results[id]['attrs']['o'];
+ var len = this.results[id]['attrs']['l'];
+
+ if(suggestions.length == 0) {
+ var row = AJS.TR();
+ var item = AJS.TD();
+ var dummy = AJS.SPAN();
+ item.appendChild(AJS.TN("No suggestions :("));
+ row.appendChild(item);
+ list.appendChild(row);
+ }
+
+ for(i=0; i < suggestions.length; i++) {
+ var row = AJS.TR();
+ var item = AJS.TD();
+ var dummy = AJS.SPAN();
+ dummy.innerHTML = suggestions[i];
+ item.appendChild(AJS.TN(dummy.innerHTML));
+
+ item.onclick = function(e) {
+ var l_elm = GoogieSpell.getEventElm(e);
+ var old_value = elm.innerHTML;
+ var new_value = l_elm.innerHTML;
+
+ elm.style.color = "green";
+ elm.innerHTML = l_elm.innerHTML;
+ me.hideErrorWindow();
+
+ me.updateOrginalText(offset, old_value, new_value, id);
+
+ //Update to the new length
+ me.results[id]['attrs']['l'] = new_value.length;
+ me.saveOldValue(id, old_value);
+ };
+ item.onmouseover = GoogieSpell.item_onmouseover;
+ item.onmouseout = GoogieSpell.item_onmouseout;
+ row.appendChild(item);
+ list.appendChild(row);
+ }
+
+ //The element is changed, append the revert
+ if(this.results[id]['is_changed']) {
+ var old_value = this.results[id]['old_value'];
+ var offset = this.results[id]['attrs']['o'];
+ var revert_row = AJS.TR();
+ var revert = AJS.TD();
+
+ revert.onmouseover = GoogieSpell.item_onmouseover;
+ revert.onmouseout = GoogieSpell.item_onmouseout;
+ var rev_span = AJS.SPAN({'class': 'googie_list_revert'});
+ rev_span.innerHTML = this.lang_revert + " " + old_value;
+ revert.appendChild(rev_span);
+
+ revert.onclick = function(e) {
+ me.updateOrginalText(offset, elm.innerHTML, old_value, id);
+ elm.style.color = "#b91414";
+ elm.innerHTML = old_value;
+ me.hideErrorWindow();
+ };
+
+ revert_row.appendChild(revert);
+ list.appendChild(revert_row);
+ }
+
+ //Append the edit box
+ var edit_row = AJS.TR();
+ var edit = AJS.TD();
+
+ var edit_input = AJS.INPUT({'style': 'width: 120px; margin:0; padding:0'});
+
+ var onsub = function () {
+ if(edit_input.value != "") {
+ me.saveOldValue(id, elm.innerHTML);
+ me.updateOrginalText(offset, elm.innerHTML, edit_input.value, id);
+ elm.style.color = "green"
+ elm.innerHTML = edit_input.value;
+
+ me.hideErrorWindow();
+ return false;
+ }
+ };
+
+ var ok_pic = AJS.IMG({'src': this.img_dir + "ok.gif", 'style': 'width: 32px; height: 16px; margin-left: 2px; margin-right: 2px;'});
+ var edit_form = AJS.FORM({'style': 'margin: 0; padding: 0'}, edit_input, ok_pic);
+ ok_pic.onclick = onsub;
+ edit_form.onsubmit = onsub;
+
+ edit.appendChild(edit_form);
+ edit_row.appendChild(edit);
+ list.appendChild(edit_row);
+
+ //Close button
+ var close_row = AJS.TR();
+ var close = AJS.TD();
+
+ close.onmouseover = GoogieSpell.item_onmouseover;
+ close.onmouseout = GoogieSpell.item_onmouseout;
+
+ var spn_close = AJS.SPAN({'class': 'googie_list_close'});
+ spn_close.innerHTML = this.lang_close;
+ close.appendChild(spn_close);
+ close.onclick = function() { me.hideErrorWindow()};
+ close_row.appendChild(close);
+ list.appendChild(close_row);
+
+ table.appendChild(list);
+ this.error_window.appendChild(table);
}
+
+
+/****
+ Edit layer (the layer where the suggestions are stored)
+****/
+GoogieSpell.prototype.createEditLayer = function(width, height) {
+ this.edit_layer = AJS.DIV({'class': 'googie_edit_layer'});
+
+ //Set the style so it looks like edit areas
+ this.edit_layer.className = this.text_area.className;
+ this.edit_layer.style.border = "1px solid #999";
+ this.edit_layer.style.overflow = "auto";
+ this.edit_layer.style.backgroundColor = "#F1EDFE";
+ this.edit_layer.style.padding = "3px";
+
+ this.edit_layer.style.width = (width-8) + "px";
+ this.edit_layer.style.height = height + "px";
}
-if(_bf.nodeType==3){
-_bf=_bf.parentNode;
+
+GoogieSpell.prototype.resumeEditing = function(e, me) {
+ this.setStateChanged("check_spelling");
+ me.switch_lan_pic.style.display = "inline";
+
+ this.el_scroll_top = me.edit_layer.scrollTop;
+
+ var elm = GoogieSpell.getEventElm(e);
+ AJS.replaceChildNodes(elm, this.createSpellDiv());
+
+ elm.onclick = function(e) {
+ me.spellCheck(elm, me.text_area.id);
+ };
+ me.hideErrorWindow();
+
+ //Remove the EDIT_LAYER
+ me.edit_layer.parentNode.removeChild(me.edit_layer);
+
+ me.text_area.value = me.orginal_text;
+ AJS.showElement(me.text_area);
+ me.gselm.className = "googie_no_style";
+
+ me.text_area.scrollTop = this.el_scroll_top;
+
+ elm.onmouseout = null;
}
-return _bf;
-};
-GoogieSpell.prototype.removeIndicator=function(elm){
-if(window.rcube_webmail_client){
-rcube_webmail_client.set_busy(false);
+
+GoogieSpell.prototype.createErrorLink = function(text, id) {
+ var elm = AJS.SPAN({'class': 'googie_link'});
+ var me = this;
+ elm.onclick = function () {
+ me.showErrorWindow(elm, id);
+ };
+ elm.innerHTML = text;
+ return elm;
}
-};
-GoogieSpell.prototype.appendIndicator=function(elm){
-if(window.rcube_webmail_client){
-rcube_webmail_client.set_busy(true,"checking");
+
+GoogieSpell.createPart = function(txt_part) {
+ if(txt_part == " ")
+ return AJS.TN(" ");
+ var result = AJS.SPAN();
+
+ var is_first = true;
+ var is_safari = (navigator.userAgent.toLowerCase().indexOf("safari") != -1);
+
+ var part = AJS.SPAN();
+ txt_part = GoogieSpell.escapeSepcial(txt_part);
+ txt_part = txt_part.replace(/\n/g, "<br>");
+ txt_part = txt_part.replace(/ /g, " ");
+ txt_part = txt_part.replace(/^ /g, " ");
+ txt_part = txt_part.replace(/ $/g, " ");
+
+ part.innerHTML = txt_part;
+
+ return part;
}
-};
-GoogieSpell.prototype.createLangWindow=function(){
-this.language_window=AJS.DIV({"class":"googie_window"});
-this.language_window.style.width="130px";
-var _c2=AJS.TABLE({"class":"googie_list"});
-var _c3=AJS.TBODY();
-this.lang_elms=new Array();
-for(i=0;i<this.langlist_codes.length;i++){
-var row=AJS.TR();
-var _c5=AJS.TD();
-_c5.googieId=this.langlist_codes[i];
-this.lang_elms.push(_c5);
-var _c6=AJS.SPAN();
-_c6.innerHTML=this.lang_to_word[this.langlist_codes[i]];
-_c5.appendChild(AJS.TN(_c6.innerHTML));
-var me=this;
-_c5.onclick=function(e){
-var elm=GoogieSpell.getEventElm(e);
-me.deHighlightCurSel();
-me.setCurrentLanguage(elm.googieId);
-if(me.lang_state_observer!=null){
-me.lang_state_observer();
-}
-me.highlightCurSel();
-me.hideLangWindow();
-};
-_c5.onmouseover=function(e){
-var _cb=GoogieSpell.getEventElm(e);
-if(_cb.className!="googie_list_selected"){
-_cb.className="googie_list_onhover";
+
+GoogieSpell.prototype.showErrorsInIframe = function(results) {
+ var output = AJS.DIV();
+ output.style.textAlign = "left";
+ var pointer = 0;
+ for(var i=0; i < results.length; i++) {
+ var offset = results[i]['attrs']['o'];
+ var len = results[i]['attrs']['l'];
+
+ var part_1_text = this.orginal_text.substring(pointer, offset);
+ var part_1 = GoogieSpell.createPart(part_1_text);
+ output.appendChild(part_1);
+ pointer += offset - pointer;
+
+ //If the last child was an error, then insert some space
+ output.appendChild(this.createErrorLink(this.orginal_text.substr(offset, len), i));
+ pointer += len;
+ }
+ //Insert the rest of the orginal text
+ var part_2_text = this.orginal_text.substr(pointer, this.orginal_text.length);
+
+ var part_2 = GoogieSpell.createPart(part_2_text);
+ output.appendChild(part_2);
+
+ this.edit_layer.appendChild(output);
+
+ //Hide text area
+ AJS.hideElement(this.text_area);
+ this.text_area.parentNode.insertBefore(this.edit_layer, this.text_area.nextSibling);
+ this.edit_layer.scrollTop = this.ta_scroll_top;
}
-};
-_c5.onmouseout=function(e){
-var _cd=GoogieSpell.getEventElm(e);
-if(_cd.className!="googie_list_selected"){
-_cd.className="googie_list_onout";
+
+GoogieSpell.Position = function(x, y) {
+ this.x = x;
+ this.y = y;
+}
+
+//Get the absolute position of menu_slide
+GoogieSpell.absolutePosition = function(element) {
+ //Create a new object that has elements y and x pos...
+ var posObj = new GoogieSpell.Position(element.offsetLeft, element.offsetTop);
+
+ //Check if the element has an offsetParent - if it has .. loop until it has not
+ if(element.offsetParent) {
+ var temp_pos = GoogieSpell.absolutePosition(element.offsetParent);
+ posObj.x += temp_pos.x;
+ posObj.y += temp_pos.y;
+ }
+ return posObj;
}
-};
-row.appendChild(_c5);
-_c3.appendChild(row);
-}
-this.highlightCurSel();
-var _ce=AJS.TR();
-var _cf=AJS.TD();
-_cf.onmouseover=GoogieSpell.item_onmouseover;
-_cf.onmouseout=GoogieSpell.item_onmouseout;
-var _d0=AJS.SPAN({"class":"googie_list_close"});
-_d0.innerHTML=this.lang_close;
-_cf.appendChild(_d0);
-var me=this;
-_cf.onclick=function(e){
-me.hideLangWindow();
-GoogieSpell.item_onmouseout(e);
-};
-_ce.appendChild(_cf);
-_c3.appendChild(_ce);
-_c2.appendChild(_c3);
-this.language_window.appendChild(_c2);
-};
-GoogieSpell.prototype.setCurrentLanguage=function(_d2){
-GOOGIE_CUR_LANG=_d2;
-var now=new Date();
-now.setTime(now.getTime()+365*24*60*60*1000);
-setCookie("language",_d2,now);
-};
-GoogieSpell.prototype.hideLangWindow=function(){
-this.language_window.style.visibility="hidden";
-this.switch_lan_pic.className="googie_lang_3d_on";
-};
-GoogieSpell.prototype.deHighlightCurSel=function(){
-this.lang_cur_elm.className="googie_list_onout";
-};
-GoogieSpell.prototype.highlightCurSel=function(){
-for(var i=0;i<this.lang_elms.length;i++){
-if(this.lang_elms[i].googieId==GOOGIE_CUR_LANG){
-this.lang_elms[i].className="googie_list_selected";
-this.lang_cur_elm=this.lang_elms[i];
-}else{
-this.lang_elms[i].className="googie_list_onout";
+
+GoogieSpell.getEventElm = function(e) {
+ var targ;
+ if (!e) var e = window.event;
+ if (e.target) targ = e.target;
+ else if (e.srcElement) targ = e.srcElement;
+ if (targ.nodeType == 3) // defeat Safari bug
+ targ = targ.parentNode;
+ return targ;
}
+
+GoogieSpell.prototype.removeIndicator = function(elm) {
+ // modified by roundcube
+ if (window.rcube_webmail_client)
+ rcube_webmail_client.set_busy(false);
+ //AJS.removeElement(this.indicator);
}
-};
-GoogieSpell.prototype.showLangWindow=function(elm,_d6,_d7){
-if(!AJS.isDefined(_d6)){
-_d6=20;
-}
-if(!AJS.isDefined(_d7)){
-_d7=50;
-}
-this.createLangWindow();
-AJS.getBody().appendChild(this.language_window);
-var _d8=GoogieSpell.absolutePosition(elm);
-AJS.showElement(this.language_window);
-this.language_window.style.top=(_d8.y+_d6)+"px";
-this.language_window.style.left=(_d8.x+_d7-this.language_window.offsetWidth)+"px";
-this.highlightCurSel();
-this.language_window.style.visibility="visible";
-};
-GoogieSpell.prototype.flashNoSpellingErrorState=function(){
-this.setStateChanged("no_error_found");
-var me=this;
-AJS.hideElement(this.switch_lan_pic);
-this.gselm.innerHTML=this.lang_no_error_found;
-this.gselm.className="googie_check_spelling_ok";
-this.gselm.style.textDecoration="none";
-this.gselm.style.cursor="default";
-var fu=function(){
-AJS.removeElement(me.gselm);
-me.checkSpellingState();
-};
-setTimeout(fu,1000);
-};
-GoogieSpell.prototype.resumeEditingState=function(){
-this.setStateChanged("resume_editing");
-var me=this;
-AJS.hideElement(me.switch_lan_pic);
-me.gselm.innerHTML=this.lang_rsm_edt;
-me.gselm.onclick=function(e){
-me.resumeEditing(e,me);
-};
-me.gselm.className="googie_check_spelling_ok";
-me.edit_layer.scrollTop=me.ta_scroll_top;
-};
-GoogieSpell.prototype.createChangeLangPic=function(){
-var _dd=AJS.A({"class":"googie_lang_3d_on","style":"padding-left: 6px;"},AJS.IMG({"src":this.img_dir+"change_lang.gif","alt":"Change language"}));
-_dd.onmouseover=function(){
-if(this.className!="googie_lang_3d_click"){
-this.className="googie_lang_3d_on";
+
+GoogieSpell.prototype.appendIndicator = function(elm) {
+ // modified by roundcube
+ if (window.rcube_webmail_client)
+ rcube_webmail_client.set_busy(true, 'checking');
+/*
+ var img = AJS.IMG({'src': this.img_dir + 'indicator.gif', 'style': 'margin-right: 5px;'});
+ img.style.width = "16px";
+ img.style.height = "16px";
+ this.indicator = img;
+ img.style.textDecoration = "none";
+ AJS.insertBefore(img, elm);
+ */
}
-};
-var me=this;
-_dd.onclick=function(){
-if(this.className=="googie_lang_3d_click"){
-me.hideLangWindow();
-}else{
-me.showLangWindow(_dd);
-this.className="googie_lang_3d_click";
+
+/****
+ Choose language
+****/
+GoogieSpell.prototype.createLangWindow = function() {
+ this.language_window = AJS.DIV({'class': 'googie_window'});
+ this.language_window.style.width = "130px";
+
+ //Build up the result list
+ var table = AJS.TABLE({'class': 'googie_list'});
+ var list = AJS.TBODY();
+
+ this.lang_elms = new Array();
+
+ for(i=0; i < this.langlist_codes.length; i++) {
+ var row = AJS.TR();
+ var item = AJS.TD();
+ item.googieId = this.langlist_codes[i];
+ this.lang_elms.push(item);
+ var lang_span = AJS.SPAN();
+ lang_span.innerHTML = this.lang_to_word[this.langlist_codes[i]];
+ item.appendChild(AJS.TN(lang_span.innerHTML));
+
+ var me = this;
+
+ item.onclick = function(e) {
+ var elm = GoogieSpell.getEventElm(e);
+ me.deHighlightCurSel();
+
+ me.setCurrentLanguage(elm.googieId);
+
+ if(me.lang_state_observer != null) {
+ me.lang_state_observer();
+ }
+
+ me.highlightCurSel();
+ me.hideLangWindow();
+ };
+
+ item.onmouseover = function(e) {
+ var i_it = GoogieSpell.getEventElm(e);
+ if(i_it.className != "googie_list_selected")
+ i_it.className = "googie_list_onhover";
+ };
+ item.onmouseout = function(e) {
+ var i_it = GoogieSpell.getEventElm(e);
+ if(i_it.className != "googie_list_selected")
+ i_it.className = "googie_list_onout";
+ };
+
+ row.appendChild(item);
+ list.appendChild(row);
+ }
+
+ this.highlightCurSel();
+
+ //Close button
+ var close_row = AJS.TR();
+ var close = AJS.TD();
+ close.onmouseover = GoogieSpell.item_onmouseover;
+ close.onmouseout = GoogieSpell.item_onmouseout;
+ var spn_close = AJS.SPAN({'class': 'googie_list_close'});
+ spn_close.innerHTML = this.lang_close;
+ close.appendChild(spn_close);
+ var me = this;
+ close.onclick = function(e) {
+ me.hideLangWindow(); GoogieSpell.item_onmouseout(e);
+ };
+ close_row.appendChild(close);
+ list.appendChild(close_row);
+
+ table.appendChild(list);
+ this.language_window.appendChild(table);
}
-};
-return _dd;
-};
-GoogieSpell.prototype.createSpellDiv=function(){
-var _df=AJS.SPAN({"class":"googie_check_spelling_link"});
-_df.innerHTML=this.lang_chck_spell;
-var _e0=null;
-if(this.show_spell_img){
-_e0=AJS.IMG({"src":this.img_dir+"spellc.gif"});
-}
-return AJS.SPAN(_e0," ",_df);
-};
-GoogieSpell.prototype.checkSpellingState=function(){
-this.setStateChanged("check_spelling");
-var me=this;
-if(this.show_change_lang_pic){
-this.switch_lan_pic=this.createChangeLangPic();
-}else{
-this.switch_lan_pic=AJS.SPAN();
-}
-var _e2=this.createSpellDiv();
-_e2.onclick=function(){
-me.spellCheck(_e2);
-};
-AJS.appendChildNodes(this.spell_container,_e2," ",this.switch_lan_pic);
-this.check_link=_e2;
-};
-GoogieSpell.prototype.setLanguages=function(_e3){
-this.lang_to_word=_e3;
-this.langlist_codes=AJS.keys(_e3);
-};
-GoogieSpell.prototype.decorateTextarea=function(id,_e5,_e6){
-var me=this;
-if(typeof (id)=="string"){
-this.text_area=AJS.getElement(id);
-}else{
-this.text_area=id;
-}
-var _e8;
-if(this.text_area!=null){
-if(AJS.isDefined(_e5)){
-if(typeof (_e5)=="string"){
-this.spell_container=AJS.getElement(_e5);
-}else{
-this.spell_container=_e5;
-}
-}else{
-var _e9=AJS.TABLE();
-var _ea=AJS.TBODY();
-var tr=AJS.TR();
-if(AJS.isDefined(_e6)){
-_e8=_e6;
-}else{
-_e8=this.text_area.offsetWidth+"px";
-}
-var _ec=AJS.TD();
-this.spell_container=_ec;
-tr.appendChild(_ec);
-_ea.appendChild(tr);
-_e9.appendChild(_ea);
-AJS.insertBefore(_e9,this.text_area);
-_e9.style.width="100%";
-_ec.style.width=_e8;
-_ec.style.textAlign="right";
-}
-this.checkSpellingState();
-}else{
-alert("Text area not found");
+
+GoogieSpell.prototype.setCurrentLanguage = function(lan_code) {
+ GOOGIE_CUR_LANG = lan_code;
+
+ //Set cookie
+ var now = new Date();
+ now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000);
+ setCookie('language', lan_code, now);
+}
+
+GoogieSpell.prototype.hideLangWindow = function() {
+ this.language_window.style.visibility = "hidden";
+ this.switch_lan_pic.className = "googie_lang_3d_on";
+}
+
+GoogieSpell.prototype.deHighlightCurSel = function() {
+ this.lang_cur_elm.className = "googie_list_onout";
+}
+
+GoogieSpell.prototype.highlightCurSel = function() {
+ for(var i=0; i < this.lang_elms.length; i++) {
+ if(this.lang_elms[i].googieId == GOOGIE_CUR_LANG) {
+ this.lang_elms[i].className = "googie_list_selected";
+ this.lang_cur_elm = this.lang_elms[i];
+ }
+ else {
+ this.lang_elms[i].className = "googie_list_onout";
+ }
+ }
+}
+
+GoogieSpell.prototype.showLangWindow = function(elm, ofst_top, ofst_left) {
+ if(!AJS.isDefined(ofst_top))
+ ofst_top = 20;
+ if(!AJS.isDefined(ofst_left))
+ ofst_left = 50;
+
+ this.createLangWindow();
+ AJS.getBody().appendChild(this.language_window);
+
+ var abs_pos = GoogieSpell.absolutePosition(elm);
+ AJS.showElement(this.language_window);
+ this.language_window.style.top = (abs_pos.y+ofst_top) + "px";
+ this.language_window.style.left = (abs_pos.x+ofst_left-this.language_window.offsetWidth) + "px";
+ this.highlightCurSel();
+ this.language_window.style.visibility = "visible";
+}
+
+GoogieSpell.prototype.flashNoSpellingErrorState = function() {
+ this.setStateChanged("no_error_found");
+ var me = this;
+ AJS.hideElement(this.switch_lan_pic);
+ this.gselm.innerHTML = this.lang_no_error_found;
+ this.gselm.className = "googie_check_spelling_ok";
+ this.gselm.style.textDecoration = "none";
+ this.gselm.style.cursor = "default";
+ var fu = function() {
+ AJS.removeElement(me.gselm);
+ me.checkSpellingState();
+ };
+ setTimeout(fu, 1000);
+}
+
+GoogieSpell.prototype.resumeEditingState = function() {
+ this.setStateChanged("resume_editing");
+ var me = this;
+ AJS.hideElement(me.switch_lan_pic);
+
+ //Change link text to resume
+ me.gselm.innerHTML = this.lang_rsm_edt;
+ me.gselm.onclick = function(e) {
+ me.resumeEditing(e, me);
+ }
+ me.gselm.className = "googie_check_spelling_ok";
+ me.edit_layer.scrollTop = me.ta_scroll_top;
+}
+
+GoogieSpell.prototype.createChangeLangPic = function() {
+ var switch_lan = AJS.A({'class': 'googie_lang_3d_on', 'style': 'padding-left: 6px;'}, AJS.IMG({'src': this.img_dir + 'change_lang.gif', 'alt': "Change language"}));
+ switch_lan.onmouseover = function() {
+ if(this.className != "googie_lang_3d_click")
+ this.className = "googie_lang_3d_on";
+ }
+
+ var me = this;
+ switch_lan.onclick = function() {
+ if(this.className == "googie_lang_3d_click") {
+ me.hideLangWindow();
+ }
+ else {
+ me.showLangWindow(switch_lan);
+ this.className = "googie_lang_3d_click";
+ }
+ }
+ return switch_lan;
+}
+
+GoogieSpell.prototype.createSpellDiv = function() {
+ var chk_spell = AJS.SPAN({'class': 'googie_check_spelling_link'});
+ chk_spell.innerHTML = this.lang_chck_spell;
+ var spell_img = null;
+ if(this.show_spell_img)
+ spell_img = AJS.IMG({'src': this.img_dir + "spellc.gif"});
+ return AJS.SPAN(spell_img, " ", chk_spell);
}
-};
+GoogieSpell.prototype.checkSpellingState = function() {
+ this.setStateChanged("check_spelling");
+ var me = this;
+ if(this.show_change_lang_pic)
+ this.switch_lan_pic = this.createChangeLangPic();
+ else
+ this.switch_lan_pic = AJS.SPAN();
+
+ var span_chck = this.createSpellDiv();
+ span_chck.onclick = function() {
+ me.spellCheck(span_chck);
+ }
+ AJS.appendChildNodes(this.spell_container, span_chck, " ", this.switch_lan_pic);
+ // modified by roundcube
+ this.check_link = span_chck;
+}
+
+GoogieSpell.prototype.setLanguages = function(lang_dict) {
+ this.lang_to_word = lang_dict;
+ this.langlist_codes = AJS.keys(lang_dict);
+}
+
+GoogieSpell.prototype.decorateTextarea = function(id, /*optional*/spell_container_id, force_width) {
+ var me = this;
+
+ if(typeof(id) == "string")
+ this.text_area = AJS.getElement(id);
+ else
+ this.text_area = id;
+
+ var r_width;
+
+ if(this.text_area != null) {
+ if(AJS.isDefined(spell_container_id)) {
+ if(typeof(spell_container_id) == "string")
+ this.spell_container = AJS.getElement(spell_container_id);
+ else
+ this.spell_container = spell_container_id;
+ }
+ else {
+ var table = AJS.TABLE();
+ var tbody = AJS.TBODY();
+ var tr = AJS.TR();
+ if(AJS.isDefined(force_width)) {
+ r_width = force_width;
+ }
+ else {
+ r_width = this.text_area.offsetWidth + "px";
+ }
+
+ var spell_container = AJS.TD();
+ this.spell_container = spell_container;
+
+ tr.appendChild(spell_container);
+
+ tbody.appendChild(tr);
+ table.appendChild(tbody);
+
+ AJS.insertBefore(table, this.text_area);
+
+ //Set width
+ table.style.width = '100%'; // modified by roundcube (old: r_width)
+ spell_container.style.width = r_width;
+ spell_container.style.textAlign = "right";
+ }
+
+ this.checkSpellingState();
+ }
+ else {
+ alert("Text area not found");
+ }
+}
+++ /dev/null
-/*
-Last Modified: 28/04/06 16:28:09
-
- AmiJs library
- A very small library with DOM and Ajax functions.
- For a much larger script look on http://www.mochikit.com/
- AUTHOR
- 4mir Salihefendic (http://amix.dk) - amix@amix.dk
- LICENSE
- Copyright (c) 2006 Amir Salihefendic. All rights reserved.
- Copyright (c) 2005 Bob Ippolito. All rights reserved.
- http://www.opensource.org/licenses/mit-license.php
- VERSION
- 2.1
- SITE
- http://amix.dk/amijs
-**/
-
-var AJS = {
-////
-// Accessor functions
-////
- /**
- * @returns The element with the id
- */
- getElement: function(id) {
- if(typeof(id) == "string")
- return document.getElementById(id);
- else
- return id;
- },
-
- /**
- * @returns The elements with the ids
- */
- getElements: function(/*id1, id2, id3*/) {
- var elements = new Array();
- for (var i = 0; i < arguments.length; i++) {
- var element = this.getElement(arguments[i]);
- elements.push(element);
- }
- return elements;
- },
-
- /**
- * @returns The GET query argument
- */
- getQueryArgument: function(var_name) {
- var query = window.location.search.substring(1);
- var vars = query.split("&");
- for (var i=0;i<vars.length;i++) {
- var pair = vars[i].split("=");
- if (pair[0] == var_name) {
- return pair[1];
- }
- }
- return null;
- },
-
- /**
- * @returns If the browser is Internet Explorer
- */
- isIe: function() {
- return (navigator.userAgent.toLowerCase().indexOf("msie") != -1 && navigator.userAgent.toLowerCase().indexOf("opera") == -1);
- },
-
- /**
- * @returns The document body
- */
- getBody: function() {
- return this.getElementsByTagAndClassName('body')[0]
- },
-
- /**
- * @returns All the elements that have a specific tag name or class name
- */
- getElementsByTagAndClassName: function(tag_name, class_name, /*optional*/ parent) {
- var class_elements = new Array();
- if(!this.isDefined(parent))
- parent = document;
- if(!this.isDefined(tag_name))
- tag_name = '*';
-
- var els = parent.getElementsByTagName(tag_name);
- var els_len = els.length;
- var pattern = new RegExp("(^|\\s)" + class_name + "(\\s|$)");
-
- for (i = 0, j = 0; i < els_len; i++) {
- if ( pattern.test(els[i].className) || class_name == null ) {
- class_elements[j] = els[i];
- j++;
- }
- }
- return class_elements;
- },
-
-
-////
-// DOM manipulation
-////
- /**
- * Appends some nodes to a node
- */
- appendChildNodes: function(node/*, nodes...*/) {
- if(arguments.length >= 2) {
- for(var i=1; i < arguments.length; i++) {
- var n = arguments[i];
- if(typeof(n) == "string")
- n = document.createTextNode(n);
- if(this.isDefined(n))
- node.appendChild(n);
- }
- }
- return node;
- },
-
- /**
- * Replaces a nodes children with another node(s)
- */
- replaceChildNodes: function(node/*, nodes...*/) {
- var child;
- while ((child = node.firstChild)) {
- node.removeChild(child);
- }
- if (arguments.length < 2) {
- return node;
- } else {
- return this.appendChildNodes.apply(this, arguments);
- }
- },
-
- /**
- * Insert a node after another node
- */
- insertAfter: function(node, referenceNode) {
- referenceNode.parentNode.insertBefore(node, referenceNode.nextSibling);
- },
-
- /**
- * Insert a node before another node
- */
- insertBefore: function(node, referenceNode) {
- referenceNode.parentNode.insertBefore(node, referenceNode);
- },
-
- /**
- * Shows the element
- */
- showElement: function(elm) {
- elm.style.display = '';
- },
-
- /**
- * Hides the element
- */
- hideElement: function(elm) {
- elm.style.display = 'none';
- },
-
- isElementHidden: function(elm) {
- return elm.style.visibility == "hidden";
- },
-
- /**
- * Swaps one element with another. To delete use swapDOM(elm, null)
- */
- swapDOM: function(dest, src) {
- dest = this.getElement(dest);
- var parent = dest.parentNode;
- if (src) {
- src = this.getElement(src);
- parent.replaceChild(src, dest);
- } else {
- parent.removeChild(dest);
- }
- return src;
- },
-
- /**
- * Removes an element from the world
- */
- removeElement: function(elm) {
- this.swapDOM(elm, null);
- },
-
- /**
- * @returns Is an object a dictionary?
- */
- isDict: function(o) {
- var str_repr = String(o);
- return str_repr.indexOf(" Object") != -1;
- },
-
- /**
- * Creates a DOM element
- * @param {String} name The elements DOM name
- * @param {Dict} attrs Attributes sent to the function
- */
- createDOM: function(name, attrs) {
- var i=0;
- elm = document.createElement(name);
-
- if(this.isDict(attrs[i])) {
- for(k in attrs[0]) {
- if(k == "style")
- elm.style.cssText = attrs[0][k];
- else if(k == "class")
- elm.className = attrs[0][k];
- else
- elm.setAttribute(k, attrs[0][k]);
- }
- i++;
- }
-
- if(attrs[0] == null)
- i = 1;
-
- for(i; i < attrs.length; i++) {
- var n = attrs[i];
- if(this.isDefined(n)) {
- if(typeof(n) == "string")
- n = document.createTextNode(n);
- elm.appendChild(n);
- }
- }
- return elm;
- },
-
- UL: function() { return this.createDOM.apply(this, ["ul", arguments]); },
- LI: function() { return this.createDOM.apply(this, ["li", arguments]); },
- TD: function() { return this.createDOM.apply(this, ["td", arguments]); },
- TR: function() { return this.createDOM.apply(this, ["tr", arguments]); },
- TH: function() { return this.createDOM.apply(this, ["th", arguments]); },
- TBODY: function() { return this.createDOM.apply(this, ["tbody", arguments]); },
- TABLE: function() { return this.createDOM.apply(this, ["table", arguments]); },
- INPUT: function() { return this.createDOM.apply(this, ["input", arguments]); },
- SPAN: function() { return this.createDOM.apply(this, ["span", arguments]); },
- B: function() { return this.createDOM.apply(this, ["b", arguments]); },
- A: function() { return this.createDOM.apply(this, ["a", arguments]); },
- DIV: function() { return this.createDOM.apply(this, ["div", arguments]); },
- IMG: function() { return this.createDOM.apply(this, ["img", arguments]); },
- BUTTON: function() { return this.createDOM.apply(this, ["button", arguments]); },
- H1: function() { return this.createDOM.apply(this, ["h1", arguments]); },
- H2: function() { return this.createDOM.apply(this, ["h2", arguments]); },
- H3: function() { return this.createDOM.apply(this, ["h3", arguments]); },
- BR: function() { return this.createDOM.apply(this, ["br", arguments]); },
- TEXTAREA: function() { return this.createDOM.apply(this, ["textarea", arguments]); },
- FORM: function() { return this.createDOM.apply(this, ["form", arguments]); },
- P: function() { return this.createDOM.apply(this, ["p", arguments]); },
- SELECT: function() { return this.createDOM.apply(this, ["select", arguments]); },
- OPTION: function() { return this.createDOM.apply(this, ["option", arguments]); },
- TN: function(text) { return document.createTextNode(text); },
- IFRAME: function() { return this.createDOM.apply(this, ["iframe", arguments]); },
- SCRIPT: function() { return this.createDOM.apply(this, ["script", arguments]); },
-
-////
-// Ajax functions
-////
- /**
- * @returns A new XMLHttpRequest object
- */
- getXMLHttpRequest: function() {
- var try_these = [
- function () { return new XMLHttpRequest(); },
- function () { return new ActiveXObject('Msxml2.XMLHTTP'); },
- function () { return new ActiveXObject('Microsoft.XMLHTTP'); },
- function () { return new ActiveXObject('Msxml2.XMLHTTP.4.0'); },
- function () { throw "Browser does not support XMLHttpRequest"; }
- ];
- for (var i = 0; i < try_these.length; i++) {
- var func = try_these[i];
- try {
- return func();
- } catch (e) {
- }
- }
- },
-
- /**
- * Use this function to do a simple HTTP Request
- */
- doSimpleXMLHttpRequest: function(url) {
- var req = this.getXMLHttpRequest();
- req.open("GET", url, true);
- return this.sendXMLHttpRequest(req);
- },
-
- getRequest: function(url, data) {
- var req = this.getXMLHttpRequest();
- req.open("POST", url, true);
- req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
- return this.sendXMLHttpRequest(req);
- },
-
- /**
- * Send a XMLHttpRequest
- */
- sendXMLHttpRequest: function(req, data) {
- var d = new AJSDeferred(req);
-
- var onreadystatechange = function () {
- if (req.readyState == 4) {
- try {
- var status = req.status;
- }
- catch(e) {};
- if(status == 200 || status == 304 || req.responseText == null) {
- d.callback(req, data);
- }
- else {
- d.errback();
- }
- }
- }
- req.onreadystatechange = onreadystatechange;
- return d;
- },
-
- /**
- * Represent an object as a string
- */
- reprString: function(o) {
- return ('"' + o.replace(/(["\\])/g, '\\$1') + '"'
- ).replace(/[\f]/g, "\\f"
- ).replace(/[\b]/g, "\\b"
- ).replace(/[\n]/g, "\\n"
- ).replace(/[\t]/g, "\\t"
- ).replace(/[\r]/g, "\\r");
- },
-
- /**
- * Serialize an object to JSON notation
- */
- serializeJSON: function(o) {
- var objtype = typeof(o);
- if (objtype == "undefined") {
- return "undefined";
- } else if (objtype == "number" || objtype == "boolean") {
- return o + "";
- } else if (o === null) {
- return "null";
- }
- if (objtype == "string") {
- return this.reprString(o);
- }
- var me = arguments.callee;
- var newObj;
- if (typeof(o.__json__) == "function") {
- newObj = o.__json__();
- if (o !== newObj) {
- return me(newObj);
- }
- }
- if (typeof(o.json) == "function") {
- newObj = o.json();
- if (o !== newObj) {
- return me(newObj);
- }
- }
- if (objtype != "function" && typeof(o.length) == "number") {
- var res = [];
- for (var i = 0; i < o.length; i++) {
- var val = me(o[i]);
- if (typeof(val) != "string") {
- val = "undefined";
- }
- res.push(val);
- }
- return "[" + res.join(",") + "]";
- }
- res = [];
- for (var k in o) {
- var useKey;
- if (typeof(k) == "number") {
- useKey = '"' + k + '"';
- } else if (typeof(k) == "string") {
- useKey = this.reprString(k);
- } else {
- // skip non-string or number keys
- continue;
- }
- val = me(o[k]);
- if (typeof(val) != "string") {
- // skip non-serializable values
- continue;
- }
- res.push(useKey + ":" + val);
- }
- return "{" + res.join(",") + "}";
- },
-
- /**
- * Send and recive JSON using GET
- */
- loadJSONDoc: function(url) {
- var d = this.getRequest(url);
- var eval_req = function(req) {
- var text = req.responseText;
- return eval('(' + text + ')');
- };
- d.addCallback(eval_req);
- return d;
- },
-
-
-////
-// Misc.
-////
- /**
- * Alert the objects key attrs
- */
- keys: function(obj) {
- var rval = [];
- for (var prop in obj) {
- rval.push(prop);
- }
- return rval;
- },
-
- urlencode: function(str) {
- return encodeURIComponent(str.toString());
- },
-
- /**
- * @returns True if the object is defined, otherwise false
- */
- isDefined: function(o) {
- return (o != "undefined" && o != null)
- },
-
- /**
- * @returns True if an object is a array, false otherwise
- */
- isArray: function(obj) {
- try { return (typeof(obj.length) == "undefined") ? false : true; }
- catch(e)
- { return false; }
- },
-
- isObject: function(obj) {
- return (obj && typeof obj == 'object');
- },
-
- /**
- * Export DOM elements to the global namespace
- */
- exportDOMElements: function() {
- UL = this.UL;
- LI = this.LI;
- TD = this.TD;
- TR = this.TR;
- TH = this.TH;
- TBODY = this.TBODY;
- TABLE = this.TABLE;
- INPUT = this.INPUT;
- SPAN = this.SPAN;
- B = this.B;
- A = this.A;
- DIV = this.DIV;
- IMG = this.IMG;
- BUTTON = this.BUTTON;
- H1 = this.H1;
- H2 = this.H2;
- H3 = this.H3;
- BR = this.BR;
- TEXTAREA = this.TEXTAREA;
- FORM = this.FORM;
- P = this.P;
- SELECT = this.SELECT;
- OPTION = this.OPTION;
- TN = this.TN;
- IFRAME = this.IFRAME;
- SCRIPT = this.SCRIPT;
- },
-
- /**
- * Export AmiJS functions to the global namespace
- */
- exportToGlobalScope: function() {
- getElement = this.getElement;
- getQueryArgument = this.getQueryArgument;
- isIe = this.isIe;
- $ = this.getElement;
- getElements = this.getElements;
- getBody = this.getBody;
- getElementsByTagAndClassName = this.getElementsByTagAndClassName;
- appendChildNodes = this.appendChildNodes;
- ACN = appendChildNodes;
- replaceChildNodes = this.replaceChildNodes;
- RCN = replaceChildNodes;
- insertAfter = this.insertAfter;
- insertBefore = this.insertBefore;
- showElement = this.showElement;
- hideElement = this.hideElement;
- isElementHidden = this.isElementHidden;
- swapDOM = this.swapDOM;
- removeElement = this.removeElement;
- isDict = this.isDict;
- createDOM = this.createDOM;
- this.exportDOMElements();
- getXMLHttpRequest = this.getXMLHttpRequest;
- doSimpleXMLHttpRequest = this.doSimpleXMLHttpRequest;
- getRequest = this.getRequest;
- sendXMLHttpRequest = this.sendXMLHttpRequest;
- reprString = this.reprString;
- serializeJSON = this.serializeJSON;
- loadJSONDoc = this.loadJSONDoc;
- keys = this.keys;
- isDefined = this.isDefined;
- isArray = this.isArray;
- }
-}
-
-
-
-AJSDeferred = function(req) {
- this.callbacks = [];
- this.req = req;
-
- this.callback = function (res) {
- while (this.callbacks.length > 0) {
- var fn = this.callbacks.pop();
- res = fn(res);
- }
- };
-
- this.errback = function(e){
- alert("Error encountered:\n" + e);
- };
-
- this.addErrback = function(fn) {
- this.errback = fn;
- };
-
- this.addCallback = function(fn) {
- this.callbacks.unshift(fn);
- };
-
- this.addCallbacks = function(fn1, fn2) {
- this.addCallback(fn1);
- this.addErrback(fn2);
- };
-
- this.sendReq = function(data) {
- if(AJS.isObject(data)) {
- var post_data = [];
- for(k in data) {
- post_data.push(k + "=" + AJS.urlencode(data[k]));
- }
- post_data = post_data.join("&");
- this.req.send(post_data);
- }
- else if(AJS.isDefined(data))
- this.req.send(data);
- else {
- this.req.send("");
- }
- };
-};
-AJSDeferred.prototype = new AJSDeferred();
-
-
-
-
-
-
-/****
-Last Modified: 28/04/06 15:26:06
-
- GoogieSpell
- Google spell checker for your own web-apps :)
- Copyright Amir Salihefendic 2006
- LICENSE
- GPL (see gpl.txt for more information)
- This basically means that you can't use this script with/in proprietary software!
- There is another license that permits you to use this script with proprietary software. Check out:... for more info.
- AUTHOR
- 4mir Salihefendic (http://amix.dk) - amix@amix.dk
- VERSION
- 3.22
-****/
-var GOOGIE_CUR_LANG = "en";
-
-function GoogieSpell(img_dir, server_url) {
- var cookie_value;
- var lang;
- cookie_value = getCookie('language');
-
- if(cookie_value != null)
- GOOGIE_CUR_LANG = cookie_value;
-
- this.img_dir = img_dir;
- this.server_url = server_url;
-
- this.lang_to_word = {"da": "Dansk", "de": "Deutsch", "en": "English",
- "es": "Español", "fr": "Français", "it": "Italiano",
- "nl": "Nederlands", "pl": "Polski", "pt": "Português",
- "fi": "Suomi", "sv": "Svenska"};
- this.langlist_codes = AJS.keys(this.lang_to_word);
-
- this.show_change_lang_pic = true;
-
- this.lang_state_observer = null;
-
- this.spelling_state_observer = null;
-
- this.request = null;
- this.error_window = null;
- this.language_window = null;
- this.edit_layer = null;
- this.orginal_text = null;
- this.results = null;
- this.text_area = null;
- this.gselm = null;
- this.ta_scroll_top = 0;
- this.el_scroll_top = 0;
-
- this.lang_chck_spell = "Check spelling";
- this.lang_rsm_edt = "Resume editing";
- this.lang_close = "Close";
- this.lang_no_error_found = "No spelling errors found";
- this.lang_revert = "Revert to";
- this.show_spell_img = false; // modified by roundcube
-}
-
-GoogieSpell.prototype.setStateChanged = function(current_state) {
- if(this.spelling_state_observer != null)
- this.spelling_state_observer(current_state);
-}
-
-GoogieSpell.item_onmouseover = function(e) {
- var elm = GoogieSpell.getEventElm(e);
- if(elm.className != "googie_list_close" && elm.className != "googie_list_revert")
- elm.className = "googie_list_onhover";
- else
- elm.parentNode.className = "googie_list_onhover";
-}
-
-GoogieSpell.item_onmouseout = function(e) {
- var elm = GoogieSpell.getEventElm(e);
- if(elm.className != "googie_list_close" && elm.className != "googie_list_revert")
- elm.className = "googie_list_onout";
- else
- elm.parentNode.className = "googie_list_onout";
-}
-
-GoogieSpell.prototype.getGoogleUrl = function() {
- return this.server_url + GOOGIE_CUR_LANG;
-}
-
-GoogieSpell.prototype.spellCheck = function(elm, name) {
- this.ta_scroll_top = this.text_area.scrollTop;
-
- this.appendIndicator(elm);
-
- try {
- this.hideLangWindow();
- }
- catch(e) {}
-
- this.gselm = elm;
-
- this.createEditLayer(this.text_area.offsetWidth, this.text_area.offsetHeight);
-
- this.createErrorWindow();
- AJS.getBody().appendChild(this.error_window);
-
- try { netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead"); }
- catch (e) { }
-
- this.gselm.onclick = null;
-
- this.orginal_text = this.text_area.value;
- var me = this;
-
- //Create request
- var d = AJS.getRequest(this.getGoogleUrl());
- var reqdone = function(req) {
- var r_text = req.responseText;
- if(r_text.match(/<c.*>/) != null) {
- var results = GoogieSpell.parseResult(r_text);
- //Before parsing be sure that errors were found
- me.results = results;
- me.showErrorsInIframe(results);
- me.resumeEditingState();
- }
- else {
- me.flashNoSpellingErrorState();
- }
- me.removeIndicator();
- };
-
- var reqfailed = function(req) {
- alert("An error was encountered on the server. Please try again later.");
- AJS.removeElement(me.gselm);
- me.checkSpellingState();
- me.removeIndicator();
- };
-
- d.addCallback(reqdone);
- d.addErrback(reqfailed);
-
- var req_text = GoogieSpell.escapeSepcial(this.orginal_text);
- d.sendReq(GoogieSpell.createXMLReq(req_text));
-}
-
-GoogieSpell.escapeSepcial = function(val) {
- return val.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
-}
-
-GoogieSpell.createXMLReq = function (text) {
- return '<?xml version="1.0" encoding="utf-8" ?><spellrequest textalreadyclipped="0" ignoredups="0" ignoredigits="1" ignoreallcaps="1"><text>' + text + '</text></spellrequest>';
-}
-
-//Retunrs an array
-//result[item] -> ['attrs']
-// ['suggestions']
-GoogieSpell.parseResult = function(r_text) {
- var re_split_attr_c = /\w="\d+"/g;
- var re_split_text = /\t/g;
-
- var matched_c = r_text.match(/<c[^>]*>[^<]*<\/c>/g);
- var results = new Array();
-
- for(var i=0; i < matched_c.length; i++) {
- var item = new Array();
-
- //Get attributes
- item['attrs'] = new Array();
- var split_c = matched_c[i].match(re_split_attr_c);
- for(var j=0; j < split_c.length; j++) {
- var c_attr = split_c[j].split(/=/);
- item['attrs'][c_attr[0]] = parseInt(c_attr[1].replace('"', ''));
- }
-
- //Get suggestions
- item['suggestions'] = new Array();
- var only_text = matched_c[i].replace(/<[^>]*>/g, "");
- var split_t = only_text.split(re_split_text);
- for(var k=0; k < split_t.length; k++) {
- if(split_t[k] != "")
- item['suggestions'].push(split_t[k]);
- }
- results.push(item);
- }
- return results;
-}
-
-/****
- Error window (the drop-down window)
-****/
-GoogieSpell.prototype.createErrorWindow = function() {
- this.error_window = AJS.DIV();
- this.error_window.className = "googie_window";
-}
-
-GoogieSpell.prototype.hideErrorWindow = function() {
- this.error_window.style.visibility = "hidden";
-}
-
-GoogieSpell.prototype.updateOrginalText = function(offset, old_value, new_value, id) {
- var part_1 = this.orginal_text.substring(0, offset);
- var part_2 = this.orginal_text.substring(offset+old_value.length);
- this.orginal_text = part_1 + new_value + part_2;
- var add_2_offset = new_value.length - old_value.length;
- for(var j=0; j < this.results.length; j++) {
- //Don't edit the offset of the current item
- if(j != id && j > id){
- this.results[j]['attrs']['o'] += add_2_offset;
- }
- }
-}
-
-GoogieSpell.prototype.saveOldValue = function (id, old_value) {
- this.results[id]['is_changed'] = true;
- this.results[id]['old_value'] = old_value;
-}
-
-GoogieSpell.prototype.showErrorWindow = function(elm, id) {
- var me = this;
-
- var abs_pos = GoogieSpell.absolutePosition(elm);
- abs_pos.y -= this.edit_layer.scrollTop;
- this.error_window.style.visibility = "visible";
- this.error_window.style.top = (abs_pos.y+20) + "px";
- this.error_window.style.left = (abs_pos.x) + "px";
- this.error_window.innerHTML = "";
-
- //Build up the result list
- var table = AJS.TABLE({'class': 'googie_list'});
- var list = AJS.TBODY();
-
- var suggestions = this.results[id]['suggestions'];
- var offset = this.results[id]['attrs']['o'];
- var len = this.results[id]['attrs']['l'];
-
- if(suggestions.length == 0) {
- var row = AJS.TR();
- var item = AJS.TD();
- var dummy = AJS.SPAN();
- item.appendChild(AJS.TN("No suggestions :("));
- row.appendChild(item);
- list.appendChild(row);
- }
-
- for(i=0; i < suggestions.length; i++) {
- var row = AJS.TR();
- var item = AJS.TD();
- var dummy = AJS.SPAN();
- dummy.innerHTML = suggestions[i];
- item.appendChild(AJS.TN(dummy.innerHTML));
-
- item.onclick = function(e) {
- var l_elm = GoogieSpell.getEventElm(e);
- var old_value = elm.innerHTML;
- var new_value = l_elm.innerHTML;
-
- elm.style.color = "green";
- elm.innerHTML = l_elm.innerHTML;
- me.hideErrorWindow();
-
- me.updateOrginalText(offset, old_value, new_value, id);
-
- //Update to the new length
- me.results[id]['attrs']['l'] = new_value.length;
- me.saveOldValue(id, old_value);
- };
- item.onmouseover = GoogieSpell.item_onmouseover;
- item.onmouseout = GoogieSpell.item_onmouseout;
- row.appendChild(item);
- list.appendChild(row);
- }
-
- //The element is changed, append the revert
- if(this.results[id]['is_changed']) {
- var old_value = this.results[id]['old_value'];
- var offset = this.results[id]['attrs']['o'];
- var revert_row = AJS.TR();
- var revert = AJS.TD();
-
- revert.onmouseover = GoogieSpell.item_onmouseover;
- revert.onmouseout = GoogieSpell.item_onmouseout;
- var rev_span = AJS.SPAN({'class': 'googie_list_revert'});
- rev_span.innerHTML = this.lang_revert + " " + old_value;
- revert.appendChild(rev_span);
-
- revert.onclick = function(e) {
- me.updateOrginalText(offset, elm.innerHTML, old_value, id);
- elm.style.color = "#b91414";
- elm.innerHTML = old_value;
- me.hideErrorWindow();
- };
-
- revert_row.appendChild(revert);
- list.appendChild(revert_row);
- }
-
- //Append the edit box
- var edit_row = AJS.TR();
- var edit = AJS.TD();
-
- var edit_input = AJS.INPUT({'style': 'width: 120px; margin:0; padding:0'});
-
- var onsub = function () {
- if(edit_input.value != "") {
- me.saveOldValue(id, elm.innerHTML);
- me.updateOrginalText(offset, elm.innerHTML, edit_input.value, id);
- elm.style.color = "green"
- elm.innerHTML = edit_input.value;
-
- me.hideErrorWindow();
- return false;
- }
- };
-
- var ok_pic = AJS.IMG({'src': this.img_dir + "ok.gif", 'style': 'width: 32px; height: 16px; margin-left: 2px; margin-right: 2px;'});
- var edit_form = AJS.FORM({'style': 'margin: 0; padding: 0'}, edit_input, ok_pic);
- ok_pic.onclick = onsub;
- edit_form.onsubmit = onsub;
-
- edit.appendChild(edit_form);
- edit_row.appendChild(edit);
- list.appendChild(edit_row);
-
- //Close button
- var close_row = AJS.TR();
- var close = AJS.TD();
-
- close.onmouseover = GoogieSpell.item_onmouseover;
- close.onmouseout = GoogieSpell.item_onmouseout;
-
- var spn_close = AJS.SPAN({'class': 'googie_list_close'});
- spn_close.innerHTML = this.lang_close;
- close.appendChild(spn_close);
- close.onclick = function() { me.hideErrorWindow()};
- close_row.appendChild(close);
- list.appendChild(close_row);
-
- table.appendChild(list);
- this.error_window.appendChild(table);
-}
-
-
-/****
- Edit layer (the layer where the suggestions are stored)
-****/
-GoogieSpell.prototype.createEditLayer = function(width, height) {
- this.edit_layer = AJS.DIV({'class': 'googie_edit_layer'});
-
- //Set the style so it looks like edit areas
- this.edit_layer.className = this.text_area.className;
- this.edit_layer.style.border = "1px solid #999";
- this.edit_layer.style.overflow = "auto";
- this.edit_layer.style.backgroundColor = "#F1EDFE";
- this.edit_layer.style.padding = "3px";
-
- this.edit_layer.style.width = (width-8) + "px";
- this.edit_layer.style.height = height + "px";
-}
-
-GoogieSpell.prototype.resumeEditing = function(e, me) {
- this.setStateChanged("check_spelling");
- me.switch_lan_pic.style.display = "inline";
-
- this.el_scroll_top = me.edit_layer.scrollTop;
-
- var elm = GoogieSpell.getEventElm(e);
- AJS.replaceChildNodes(elm, this.createSpellDiv());
-
- elm.onclick = function(e) {
- me.spellCheck(elm, me.text_area.id);
- };
- me.hideErrorWindow();
-
- //Remove the EDIT_LAYER
- me.edit_layer.parentNode.removeChild(me.edit_layer);
-
- me.text_area.value = me.orginal_text;
- AJS.showElement(me.text_area);
- me.gselm.className = "googie_no_style";
-
- me.text_area.scrollTop = this.el_scroll_top;
-
- elm.onmouseout = null;
-}
-
-GoogieSpell.prototype.createErrorLink = function(text, id) {
- var elm = AJS.SPAN({'class': 'googie_link'});
- var me = this;
- elm.onclick = function () {
- me.showErrorWindow(elm, id);
- };
- elm.innerHTML = text;
- return elm;
-}
-
-GoogieSpell.createPart = function(txt_part) {
- if(txt_part == " ")
- return AJS.TN(" ");
- var result = AJS.SPAN();
-
- var is_first = true;
- var is_safari = (navigator.userAgent.toLowerCase().indexOf("safari") != -1);
-
- var part = AJS.SPAN();
- txt_part = GoogieSpell.escapeSepcial(txt_part);
- txt_part = txt_part.replace(/\n/g, "<br>");
- txt_part = txt_part.replace(/ /g, " ");
- txt_part = txt_part.replace(/^ /g, " ");
- txt_part = txt_part.replace(/ $/g, " ");
-
- part.innerHTML = txt_part;
-
- return part;
-}
-
-GoogieSpell.prototype.showErrorsInIframe = function(results) {
- var output = AJS.DIV();
- output.style.textAlign = "left";
- var pointer = 0;
- for(var i=0; i < results.length; i++) {
- var offset = results[i]['attrs']['o'];
- var len = results[i]['attrs']['l'];
-
- var part_1_text = this.orginal_text.substring(pointer, offset);
- var part_1 = GoogieSpell.createPart(part_1_text);
- output.appendChild(part_1);
- pointer += offset - pointer;
-
- //If the last child was an error, then insert some space
- output.appendChild(this.createErrorLink(this.orginal_text.substr(offset, len), i));
- pointer += len;
- }
- //Insert the rest of the orginal text
- var part_2_text = this.orginal_text.substr(pointer, this.orginal_text.length);
-
- var part_2 = GoogieSpell.createPart(part_2_text);
- output.appendChild(part_2);
-
- this.edit_layer.appendChild(output);
-
- //Hide text area
- AJS.hideElement(this.text_area);
- this.text_area.parentNode.insertBefore(this.edit_layer, this.text_area.nextSibling);
- this.edit_layer.scrollTop = this.ta_scroll_top;
-}
-
-GoogieSpell.Position = function(x, y) {
- this.x = x;
- this.y = y;
-}
-
-//Get the absolute position of menu_slide
-GoogieSpell.absolutePosition = function(element) {
- //Create a new object that has elements y and x pos...
- var posObj = new GoogieSpell.Position(element.offsetLeft, element.offsetTop);
-
- //Check if the element has an offsetParent - if it has .. loop until it has not
- if(element.offsetParent) {
- var temp_pos = GoogieSpell.absolutePosition(element.offsetParent);
- posObj.x += temp_pos.x;
- posObj.y += temp_pos.y;
- }
- return posObj;
-}
-
-GoogieSpell.getEventElm = function(e) {
- var targ;
- if (!e) var e = window.event;
- if (e.target) targ = e.target;
- else if (e.srcElement) targ = e.srcElement;
- if (targ.nodeType == 3) // defeat Safari bug
- targ = targ.parentNode;
- return targ;
-}
-
-GoogieSpell.prototype.removeIndicator = function(elm) {
- // modified by roundcube
- if (window.rcube_webmail_client)
- rcube_webmail_client.set_busy(false);
- //AJS.removeElement(this.indicator);
-}
-
-GoogieSpell.prototype.appendIndicator = function(elm) {
- // modified by roundcube
- if (window.rcube_webmail_client)
- rcube_webmail_client.set_busy(true, 'checking');
-/*
- var img = AJS.IMG({'src': this.img_dir + 'indicator.gif', 'style': 'margin-right: 5px;'});
- img.style.width = "16px";
- img.style.height = "16px";
- this.indicator = img;
- img.style.textDecoration = "none";
- AJS.insertBefore(img, elm);
- */
-}
-
-/****
- Choose language
-****/
-GoogieSpell.prototype.createLangWindow = function() {
- this.language_window = AJS.DIV({'class': 'googie_window'});
- this.language_window.style.width = "130px";
-
- //Build up the result list
- var table = AJS.TABLE({'class': 'googie_list'});
- var list = AJS.TBODY();
-
- this.lang_elms = new Array();
-
- for(i=0; i < this.langlist_codes.length; i++) {
- var row = AJS.TR();
- var item = AJS.TD();
- item.googieId = this.langlist_codes[i];
- this.lang_elms.push(item);
- var lang_span = AJS.SPAN();
- lang_span.innerHTML = this.lang_to_word[this.langlist_codes[i]];
- item.appendChild(AJS.TN(lang_span.innerHTML));
-
- var me = this;
-
- item.onclick = function(e) {
- var elm = GoogieSpell.getEventElm(e);
- me.deHighlightCurSel();
-
- me.setCurrentLanguage(elm.googieId);
-
- if(me.lang_state_observer != null) {
- me.lang_state_observer();
- }
-
- me.highlightCurSel();
- me.hideLangWindow();
- };
-
- item.onmouseover = function(e) {
- var i_it = GoogieSpell.getEventElm(e);
- if(i_it.className != "googie_list_selected")
- i_it.className = "googie_list_onhover";
- };
- item.onmouseout = function(e) {
- var i_it = GoogieSpell.getEventElm(e);
- if(i_it.className != "googie_list_selected")
- i_it.className = "googie_list_onout";
- };
-
- row.appendChild(item);
- list.appendChild(row);
- }
-
- this.highlightCurSel();
-
- //Close button
- var close_row = AJS.TR();
- var close = AJS.TD();
- close.onmouseover = GoogieSpell.item_onmouseover;
- close.onmouseout = GoogieSpell.item_onmouseout;
- var spn_close = AJS.SPAN({'class': 'googie_list_close'});
- spn_close.innerHTML = this.lang_close;
- close.appendChild(spn_close);
- var me = this;
- close.onclick = function(e) {
- me.hideLangWindow(); GoogieSpell.item_onmouseout(e);
- };
- close_row.appendChild(close);
- list.appendChild(close_row);
-
- table.appendChild(list);
- this.language_window.appendChild(table);
-}
-
-GoogieSpell.prototype.setCurrentLanguage = function(lan_code) {
- GOOGIE_CUR_LANG = lan_code;
-
- //Set cookie
- var now = new Date();
- now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000);
- setCookie('language', lan_code, now);
-}
-
-GoogieSpell.prototype.hideLangWindow = function() {
- this.language_window.style.visibility = "hidden";
- this.switch_lan_pic.className = "googie_lang_3d_on";
-}
-
-GoogieSpell.prototype.deHighlightCurSel = function() {
- this.lang_cur_elm.className = "googie_list_onout";
-}
-
-GoogieSpell.prototype.highlightCurSel = function() {
- for(var i=0; i < this.lang_elms.length; i++) {
- if(this.lang_elms[i].googieId == GOOGIE_CUR_LANG) {
- this.lang_elms[i].className = "googie_list_selected";
- this.lang_cur_elm = this.lang_elms[i];
- }
- else {
- this.lang_elms[i].className = "googie_list_onout";
- }
- }
-}
-
-GoogieSpell.prototype.showLangWindow = function(elm, ofst_top, ofst_left) {
- if(!AJS.isDefined(ofst_top))
- ofst_top = 20;
- if(!AJS.isDefined(ofst_left))
- ofst_left = 50;
-
- this.createLangWindow();
- AJS.getBody().appendChild(this.language_window);
-
- var abs_pos = GoogieSpell.absolutePosition(elm);
- AJS.showElement(this.language_window);
- this.language_window.style.top = (abs_pos.y+ofst_top) + "px";
- this.language_window.style.left = (abs_pos.x+ofst_left-this.language_window.offsetWidth) + "px";
- this.highlightCurSel();
- this.language_window.style.visibility = "visible";
-}
-
-GoogieSpell.prototype.flashNoSpellingErrorState = function() {
- this.setStateChanged("no_error_found");
- var me = this;
- AJS.hideElement(this.switch_lan_pic);
- this.gselm.innerHTML = this.lang_no_error_found;
- this.gselm.className = "googie_check_spelling_ok";
- this.gselm.style.textDecoration = "none";
- this.gselm.style.cursor = "default";
- var fu = function() {
- AJS.removeElement(me.gselm);
- me.checkSpellingState();
- };
- setTimeout(fu, 1000);
-}
-
-GoogieSpell.prototype.resumeEditingState = function() {
- this.setStateChanged("resume_editing");
- var me = this;
- AJS.hideElement(me.switch_lan_pic);
-
- //Change link text to resume
- me.gselm.innerHTML = this.lang_rsm_edt;
- me.gselm.onclick = function(e) {
- me.resumeEditing(e, me);
- }
- me.gselm.className = "googie_check_spelling_ok";
- me.edit_layer.scrollTop = me.ta_scroll_top;
-}
-
-GoogieSpell.prototype.createChangeLangPic = function() {
- var switch_lan = AJS.A({'class': 'googie_lang_3d_on', 'style': 'padding-left: 6px;'}, AJS.IMG({'src': this.img_dir + 'change_lang.gif', 'alt': "Change language"}));
- switch_lan.onmouseover = function() {
- if(this.className != "googie_lang_3d_click")
- this.className = "googie_lang_3d_on";
- }
-
- var me = this;
- switch_lan.onclick = function() {
- if(this.className == "googie_lang_3d_click") {
- me.hideLangWindow();
- }
- else {
- me.showLangWindow(switch_lan);
- this.className = "googie_lang_3d_click";
- }
- }
- return switch_lan;
-}
-
-GoogieSpell.prototype.createSpellDiv = function() {
- var chk_spell = AJS.SPAN({'class': 'googie_check_spelling_link'});
- chk_spell.innerHTML = this.lang_chck_spell;
- var spell_img = null;
- if(this.show_spell_img)
- spell_img = AJS.IMG({'src': this.img_dir + "spellc.gif"});
- return AJS.SPAN(spell_img, " ", chk_spell);
-}
-
-GoogieSpell.prototype.checkSpellingState = function() {
- this.setStateChanged("check_spelling");
- var me = this;
- if(this.show_change_lang_pic)
- this.switch_lan_pic = this.createChangeLangPic();
- else
- this.switch_lan_pic = AJS.SPAN();
-
- var span_chck = this.createSpellDiv();
- span_chck.onclick = function() {
- me.spellCheck(span_chck);
- }
- AJS.appendChildNodes(this.spell_container, span_chck, " ", this.switch_lan_pic);
- // modified by roundcube
- this.check_link = span_chck;
-}
-
-GoogieSpell.prototype.setLanguages = function(lang_dict) {
- this.lang_to_word = lang_dict;
- this.langlist_codes = AJS.keys(lang_dict);
-}
-
-GoogieSpell.prototype.decorateTextarea = function(id, /*optional*/spell_container_id, force_width) {
- var me = this;
-
- if(typeof(id) == "string")
- this.text_area = AJS.getElement(id);
- else
- this.text_area = id;
-
- var r_width;
-
- if(this.text_area != null) {
- if(AJS.isDefined(spell_container_id)) {
- if(typeof(spell_container_id) == "string")
- this.spell_container = AJS.getElement(spell_container_id);
- else
- this.spell_container = spell_container_id;
- }
- else {
- var table = AJS.TABLE();
- var tbody = AJS.TBODY();
- var tr = AJS.TR();
- if(AJS.isDefined(force_width)) {
- r_width = force_width;
- }
- else {
- r_width = this.text_area.offsetWidth + "px";
- }
-
- var spell_container = AJS.TD();
- this.spell_container = spell_container;
-
- tr.appendChild(spell_container);
-
- tbody.appendChild(tr);
- table.appendChild(tbody);
-
- AJS.insertBefore(table, this.text_area);
-
- //Set width
- table.style.width = '100%'; // modified by roundcube (old: r_width)
- spell_container.style.width = r_width;
- spell_container.style.textAlign = "right";
- }
-
- this.checkSpellingState();
- }
- else {
- alert("Text area not found");
- }
-}
-function rcube_list_widget(_1,p){
-this.ENTER_KEY=13;
-this.DELETE_KEY=46;
-this.BACKSPACE_KEY=8;
-this.list=_1?_1:null;
-this.frame=null;
-this.rows=[];
-this.selection=[];
-this.rowcount=0;
-this.subject_col=-1;
-this.shiftkey=false;
-this.multiselect=false;
-this.multi_selecting=false;
-this.draggable=false;
-this.keyboard=false;
-this.toggleselect=false;
-this.dont_select=false;
-this.drag_active=false;
-this.last_selected=0;
-this.shift_start=0;
-this.in_selection_before=false;
-this.focused=false;
-this.drag_mouse_start=null;
-this.dblclick_time=600;
-this.row_init=function(){
-};
-this.events={click:[],dblclick:[],select:[],keypress:[],dragstart:[],dragmove:[],dragend:[]};
-if(p&&typeof (p)=="object"){
-for(var n in p){
-this[n]=p[n];
-}
-}
-};
-rcube_list_widget.prototype={init:function(){
-if(this.list&&this.list.tBodies[0]){
-this.rows=new Array();
-this.rowcount=0;
-var _4;
-for(var r=0;r<this.list.tBodies[0].childNodes.length;r++){
-_4=this.list.tBodies[0].childNodes[r];
-while(_4&&(_4.nodeType!=1||_4.style.display=="none")){
-_4=_4.nextSibling;
-r++;
-}
-this.init_row(_4);
-this.rowcount++;
-}
-this.frame=this.list.parentNode;
-if(this.keyboard){
-rcube_event.add_listener({element:document,event:"keyup",object:this,method:"key_press"});
-rcube_event.add_listener({element:document,event:"keydown",object:this,method:"key_down"});
-}
-}
-},init_row:function(_6){
-if(_6&&String(_6.id).match(/rcmrow([a-z0-9\-_=]+)/i)){
-var p=this;
-var _8=RegExp.$1;
-_6.uid=_8;
-this.rows[_8]={uid:_8,id:_6.id,obj:_6,classname:_6.className};
-_6.onmousedown=function(e){
-return p.drag_row(e,this.uid);
-};
-_6.onmouseup=function(e){
-return p.click_row(e,this.uid);
-};
-if(document.all){
-_6.onselectstart=function(){
-return false;
-};
-}
-this.row_init(this.rows[_8]);
-}
-},clear:function(_b){
-var _c=document.createElement("TBODY");
-this.list.insertBefore(_c,this.list.tBodies[0]);
-this.list.removeChild(this.list.tBodies[1]);
-this.rows=new Array();
-this.rowcount=0;
-if(_b){
-this.clear_selection();
-}
-},remove_row:function(_d,_e){
-if(this.rows[_d].obj){
-this.rows[_d].obj.style.display="none";
-}
-if(_e){
-this.select_next();
-}
-this.rows[_d]=null;
-this.rowcount--;
-},insert_row:function(_f,_10){
-var _11=this.list.tBodies[0];
-if(_10&&_11.rows.length){
-_11.insertBefore(_f,_11.firstChild);
-}else{
-_11.appendChild(_f);
-}
-this.init_row(_f);
-this.rowcount++;
-},focus:function(e){
-this.focused=true;
-for(var n=0;n<this.selection.length;n++){
-id=this.selection[n];
-if(this.rows[id]&&this.rows[id].obj){
-this.set_classname(this.rows[id].obj,"selected",true);
-this.set_classname(this.rows[id].obj,"unfocused",false);
-}
-}
-if(e||(e=window.event)){
-rcube_event.cancel(e);
-}
-},blur:function(){
-var id;
-this.focused=false;
-for(var n=0;n<this.selection.length;n++){
-id=this.selection[n];
-if(this.rows[id]&&this.rows[id].obj){
-this.set_classname(this.rows[id].obj,"selected",false);
-this.set_classname(this.rows[id].obj,"unfocused",true);
-}
-}
-},drag_row:function(e,id){
-var _18=rcube_event.get_target(e);
-if(this.dont_select||(_18&&(_18.tagName=="INPUT"||_18.tagName=="IMG"))){
-return false;
-}
-if(rcube_event.get_button(e)==2){
-return true;
-}
-this.in_selection_before=this.in_selection(id)?id:false;
-if(!this.in_selection_before){
-var _19=rcube_event.get_modifier(e);
-this.select_row(id,_19,false);
-}
-if(this.draggable&&this.selection.length){
-this.drag_start=true;
-this.drag_mouse_start=rcube_event.get_mouse_pos(e);
-rcube_event.add_listener({element:document,event:"mousemove",object:this,method:"drag_mouse_move"});
-rcube_event.add_listener({element:document,event:"mouseup",object:this,method:"drag_mouse_up"});
-var _1a=document.getElementsByTagName("IFRAME");
-this.iframe_events=Object();
-for(var n in _1a){
-var _1c=null;
-if(_1a[n].contentDocument){
-_1c=_1a[n].contentDocument;
-}else{
-if(_1a[n].contentWindow){
-_1c=_1a[n].contentWindow.document;
-}else{
-if(_1a[n].document){
-_1c=_1a[n].document;
-}
-}
+/*
+ +-----------------------------------------------------------------------+
+ | RoundCube List Widget |
+ | |
+ | This file is part of the RoundCube Webmail client |
+ | Copyright (C) 2006-2009, RoundCube Dev, - Switzerland |
+ | Licensed under the GNU GPL |
+ | |
+ +-----------------------------------------------------------------------+
+ | Authors: Thomas Bruederli <roundcube@gmail.com> |
+ | Charles McNulty <charles@charlesmcnulty.com> |
+ +-----------------------------------------------------------------------+
+ | Requires: common.js |
+ +-----------------------------------------------------------------------+
+
+ $Id: list.js 2277 2009-02-06 14:42:39Z alec $
+*/
+
+
+/**
+ * RoundCube List Widget class
+ * @contructor
+ */
+function rcube_list_widget(list, p)
+ {
+ // static contants
+ this.ENTER_KEY = 13;
+ this.DELETE_KEY = 46;
+ this.BACKSPACE_KEY = 8;
+
+ this.list = list ? list : null;
+ this.frame = null;
+ this.rows = [];
+ this.selection = [];
+ this.rowcount = 0;
+
+ this.subject_col = -1;
+ this.shiftkey = false;
+ this.multiselect = false;
+ this.multi_selecting = false;
+ this.draggable = false;
+ this.keyboard = false;
+ this.toggleselect = false;
+
+ this.dont_select = false;
+ this.drag_active = false;
+ this.last_selected = 0;
+ this.shift_start = 0;
+ this.in_selection_before = false;
+ this.focused = false;
+ this.drag_mouse_start = null;
+ this.dblclick_time = 600;
+ this.row_init = function(){};
+ this.events = { click:[], dblclick:[], select:[], keypress:[], dragstart:[], dragmove:[], dragend:[] };
+
+ // overwrite default paramaters
+ if (p && typeof(p)=='object')
+ for (var n in p)
+ this[n] = p[n];
+ }
+
+
+rcube_list_widget.prototype = {
+
+
+/**
+ * get all message rows from HTML table and init each row
+ */
+init: function()
+{
+ if (this.list && this.list.tBodies[0])
+ {
+ this.rows = new Array();
+ this.rowcount = 0;
+
+ var row;
+ for(var r=0; r<this.list.tBodies[0].childNodes.length; r++)
+ {
+ row = this.list.tBodies[0].childNodes[r];
+ while (row && (row.nodeType != 1 || row.style.display == 'none'))
+ {
+ row = row.nextSibling;
+ r++;
+ }
+
+ this.init_row(row);
+ this.rowcount++;
+ }
+
+ this.frame = this.list.parentNode;
+
+ // set body events
+ if (this.keyboard) {
+ rcube_event.add_listener({element:document, event:'keyup', object:this, method:'key_press'});
+ rcube_event.add_listener({element:document, event:'keydown', object:this, method:'key_down'});
+ }
+ }
+},
+
+
+/**
+ *
+ */
+init_row: function(row)
+{
+ // make references in internal array and set event handlers
+ if (row && String(row.id).match(/rcmrow([a-z0-9\-_=]+)/i))
+ {
+ var p = this;
+ var uid = RegExp.$1;
+ row.uid = uid;
+ this.rows[uid] = {uid:uid, id:row.id, obj:row, classname:row.className};
+
+ // set eventhandlers to table row
+ row.onmousedown = function(e){ return p.drag_row(e, this.uid); };
+ row.onmouseup = function(e){ return p.click_row(e, this.uid); };
+
+ if (document.all)
+ row.onselectstart = function() { return false; };
+
+ this.row_init(this.rows[uid]);
+ }
+},
+
+
+/**
+ *
+ */
+clear: function(sel)
+{
+ var tbody = document.createElement('TBODY');
+ this.list.insertBefore(tbody, this.list.tBodies[0]);
+ this.list.removeChild(this.list.tBodies[1]);
+ this.rows = new Array();
+ this.rowcount = 0;
+
+ if (sel) this.clear_selection();
+},
+
+
+/**
+ * 'remove' message row from list (just hide it)
+ */
+remove_row: function(uid, sel_next)
+{
+ if (this.rows[uid].obj)
+ this.rows[uid].obj.style.display = 'none';
+
+ if (sel_next)
+ this.select_next();
+
+ this.rows[uid] = null;
+ this.rowcount--;
+},
+
+
+/**
+ *
+ */
+insert_row: function(row, attop)
+{
+ var tbody = this.list.tBodies[0];
+
+ if (attop && tbody.rows.length)
+ tbody.insertBefore(row, tbody.firstChild);
+ else
+ tbody.appendChild(row);
+
+ this.init_row(row);
+ this.rowcount++;
+},
+
+
+
+/**
+ * Set focus to the list
+ */
+focus: function(e)
+{
+ this.focused = true;
+ for (var n=0; n<this.selection.length; n++)
+ {
+ id = this.selection[n];
+ if (this.rows[id] && this.rows[id].obj)
+ {
+ this.set_classname(this.rows[id].obj, 'selected', true);
+ this.set_classname(this.rows[id].obj, 'unfocused', false);
+ }
+ }
+
+ if (e || (e = window.event))
+ rcube_event.cancel(e);
+},
+
+
+/**
+ * remove focus from the list
+ */
+blur: function()
+{
+ var id;
+ this.focused = false;
+ for (var n=0; n<this.selection.length; n++)
+ {
+ id = this.selection[n];
+ if (this.rows[id] && this.rows[id].obj)
+ {
+ this.set_classname(this.rows[id].obj, 'selected', false);
+ this.set_classname(this.rows[id].obj, 'unfocused', true);
+ }
+ }
+},
+
+
+/**
+ * onmousedown-handler of message list row
+ */
+drag_row: function(e, id)
+{
+ // don't do anything (another action processed before)
+ var evtarget = rcube_event.get_target(e);
+ if (this.dont_select || (evtarget && (evtarget.tagName == 'INPUT' || evtarget.tagName == 'IMG')))
+ return false;
+
+ // accept right-clicks
+ if (rcube_event.get_button(e) == 2)
+ return true;
+
+ this.in_selection_before = this.in_selection(id) ? id : false;
+
+ // selects currently unselected row
+ if (!this.in_selection_before)
+ {
+ var mod_key = rcube_event.get_modifier(e);
+ this.select_row(id, mod_key, false);
+ }
+
+ if (this.draggable && this.selection.length)
+ {
+ this.drag_start = true;
+ this.drag_mouse_start = rcube_event.get_mouse_pos(e);
+ rcube_event.add_listener({element:document, event:'mousemove', object:this, method:'drag_mouse_move'});
+ rcube_event.add_listener({element:document, event:'mouseup', object:this, method:'drag_mouse_up'});
+
+ // add listener for iframes
+ var iframes = document.getElementsByTagName('IFRAME');
+ this.iframe_events = Object();
+ for (var n in iframes)
+ {
+ var iframedoc = null;
+ if (iframes[n].contentDocument)
+ iframedoc = iframes[n].contentDocument;
+ else if (iframes[n].contentWindow)
+ iframedoc = iframes[n].contentWindow.document;
+ else if (iframes[n].document)
+ iframedoc = iframes[n].document;
+
+ if (iframedoc)
+ {
+ var list = this;
+ var pos = rcube_get_object_pos(document.getElementById(iframes[n].id));
+ this.iframe_events[n] = function(e) { e._offset = pos; return list.drag_mouse_move(e); }
+
+ if (iframedoc.addEventListener)
+ iframedoc.addEventListener('mousemove', this.iframe_events[n], false);
+ else if (iframes[n].attachEvent)
+ iframedoc.attachEvent('onmousemove', this.iframe_events[n]);
+ else
+ iframedoc['onmousemove'] = this.iframe_events[n];
+
+ rcube_event.add_listener({element:iframedoc, event:'mouseup', object:this, method:'drag_mouse_up'});
+ }
+ }
+ }
+
+ return false;
+},
+
+
+/**
+ * onmouseup-handler of message list row
+ */
+click_row: function(e, id)
+{
+ var now = new Date().getTime();
+ var mod_key = rcube_event.get_modifier(e);
+ var evtarget = rcube_event.get_target(e);
+
+ if ((evtarget && (evtarget.tagName == 'INPUT' || evtarget.tagName == 'IMG')))
+ return false;
+
+ // don't do anything (another action processed before)
+ if (this.dont_select)
+ {
+ this.dont_select = false;
+ return false;
+ }
+
+ var dblclicked = now - this.rows[id].clicked < this.dblclick_time;
+
+ // unselects currently selected row
+ if (!this.drag_active && this.in_selection_before == id && !dblclicked)
+ this.select_row(id, mod_key, false);
+
+ this.drag_start = false;
+ this.in_selection_before = false;
+
+ // row was double clicked
+ if (this.rows && dblclicked && this.in_selection(id))
+ this.trigger_event('dblclick');
+ else
+ this.trigger_event('click');
+
+ if (!this.drag_active)
+ rcube_event.cancel(e);
+
+ this.rows[id].clicked = now;
+ return false;
+},
+
+
+/**
+ * get next/previous/last rows that are not hidden
+ */
+get_next_row: function()
+{
+ if (!this.rows)
+ return false;
+
+ var last_selected_row = this.rows[this.last_selected];
+ var new_row = last_selected_row ? last_selected_row.obj.nextSibling : null;
+ while (new_row && (new_row.nodeType != 1 || new_row.style.display == 'none'))
+ new_row = new_row.nextSibling;
+
+ return new_row;
+},
+
+get_prev_row: function()
+{
+ if (!this.rows)
+ return false;
+
+ var last_selected_row = this.rows[this.last_selected];
+ var new_row = last_selected_row ? last_selected_row.obj.previousSibling : null;
+ while (new_row && (new_row.nodeType != 1 || new_row.style.display == 'none'))
+ new_row = new_row.previousSibling;
+
+ return new_row;
+},
+
+get_last_row: function()
+{
+ if (this.rowcount)
+ {
+ var rows = this.list.tBodies[0].rows;
+
+ for(var i=rows.length-1; i>=0; i--)
+ if(rows[i].id && String(rows[i].id).match(/rcmrow([a-z0-9\-_=]+)/i) && this.rows[RegExp.$1] != null)
+ return RegExp.$1;
+ }
+
+ return null;
+},
+
+
+/**
+ * selects or unselects the proper row depending on the modifier key pressed
+ */
+select_row: function(id, mod_key, with_mouse)
+{
+ var select_before = this.selection.join(',');
+ if (!this.multiselect)
+ mod_key = 0;
+
+ if (!this.shift_start)
+ this.shift_start = id
+
+ if (!mod_key)
+ {
+ this.shift_start = id;
+ this.highlight_row(id, false);
+ this.multi_selecting = false;
+ }
+ else
+ {
+ switch (mod_key)
+ {
+ case SHIFT_KEY:
+ this.shift_select(id, false);
+ break;
+
+ case CONTROL_KEY:
+ if (!with_mouse)
+ this.highlight_row(id, true);
+ break;
+
+ case CONTROL_SHIFT_KEY:
+ this.shift_select(id, true);
+ break;
+
+ default:
+ this.highlight_row(id, false);
+ break;
+ }
+ this.multi_selecting = true;
+ }
+
+ // trigger event if selection changed
+ if (this.selection.join(',') != select_before)
+ this.trigger_event('select');
+
+ if (this.last_selected != 0 && this.rows[this.last_selected])
+ this.set_classname(this.rows[this.last_selected].obj, 'focused', false);
+
+ // unselect if toggleselect is active and the same row was clicked again
+ if (this.toggleselect && this.last_selected == id)
+ {
+ this.clear_selection();
+ id = null;
+ }
+ else
+ this.set_classname(this.rows[id].obj, 'focused', true);
+
+ if (!this.selection.length)
+ this.shift_start = null;
+
+ this.last_selected = id;
+},
+
+
+/**
+ * Alias method for select_row
+ */
+select: function(id)
+{
+ this.select_row(id, false);
+ this.scrollto(id);
+},
+
+
+/**
+ * Select row next to the last selected one.
+ * Either below or above.
+ */
+select_next: function()
+{
+ var next_row = this.get_next_row();
+ var prev_row = this.get_prev_row();
+ var new_row = (next_row) ? next_row : prev_row;
+ if (new_row)
+ this.select_row(new_row.uid, false, false);
+},
+
+
+/**
+ * Perform selection when shift key is pressed
+ */
+shift_select: function(id, control)
+{
+ if (!this.rows[this.shift_start] || !this.selection.length)
+ this.shift_start = id;
+
+ var from_rowIndex = this.rows[this.shift_start].obj.rowIndex;
+ var to_rowIndex = this.rows[id].obj.rowIndex;
+
+ var i = ((from_rowIndex < to_rowIndex)? from_rowIndex : to_rowIndex);
+ var j = ((from_rowIndex > to_rowIndex)? from_rowIndex : to_rowIndex);
+
+ // iterate through the entire message list
+ for (var n in this.rows)
+ {
+ if ((this.rows[n].obj.rowIndex >= i) && (this.rows[n].obj.rowIndex <= j))
+ {
+ if (!this.in_selection(n))
+ this.highlight_row(n, true);
+ }
+ else
+ {
+ if (this.in_selection(n) && !control)
+ this.highlight_row(n, true);
+ }
+ }
+},
+
+
+/**
+ * Check if given id is part of the current selection
+ */
+in_selection: function(id)
+{
+ for(var n in this.selection)
+ if (this.selection[n]==id)
+ return true;
+
+ return false;
+},
+
+
+/**
+ * Select each row in list
+ */
+select_all: function(filter)
+{
+ if (!this.rows || !this.rows.length)
+ return false;
+
+ // reset but remember selection first
+ var select_before = this.selection.join(',');
+ this.selection = new Array();
+
+ for (var n in this.rows)
+ {
+ if (!filter || (this.rows[n] && this.rows[n][filter] == true))
+ {
+ this.last_selected = n;
+ this.highlight_row(n, true);
+ }
+ else if (this.rows[n])
+ {
+ this.set_classname(this.rows[n].obj, 'selected', false);
+ this.set_classname(this.rows[n].obj, 'unfocused', false);
+ }
+ }
+
+ // trigger event if selection changed
+ if (this.selection.join(',') != select_before)
+ this.trigger_event('select');
+
+ this.focus();
+
+ return true;
+},
+
+
+/**
+ * Unselect selected row(s)
+ */
+clear_selection: function(id)
+{
+ var num_select = this.selection.length;
+
+ // one row
+ if (id)
+ {
+ for (var n=0; n<this.selection.length; n++)
+ if (this.selection[n] == id)
+ {
+ this.selection.splice(n,1);
+ break;
+ }
+ }
+ // all rows
+ else
+ {
+ for (var n=0; n<this.selection.length; n++)
+ if (this.rows[this.selection[n]])
+ {
+ this.set_classname(this.rows[this.selection[n]].obj, 'selected', false);
+ this.set_classname(this.rows[this.selection[n]].obj, 'unfocused', false);
+ }
+
+ this.selection = new Array();
+ }
+
+ if (num_select && !this.selection.length)
+ this.trigger_event('select');
+},
+
+
+/**
+ * Getter for the selection array
+ */
+get_selection: function()
+{
+ return this.selection;
+},
+
+
+/**
+ * Return the ID if only one row is selected
+ */
+get_single_selection: function()
+{
+ if (this.selection.length == 1)
+ return this.selection[0];
+ else
+ return null;
+},
+
+
+/**
+ * Highlight/unhighlight a row
+ */
+highlight_row: function(id, multiple)
+{
+ if (this.rows[id] && !multiple)
+ {
+ if (this.selection.length > 1 || !this.in_selection(id))
+ {
+ this.clear_selection();
+ this.selection[0] = id;
+ this.set_classname(this.rows[id].obj, 'selected', true);
+ }
+ }
+ else if (this.rows[id])
+ {
+ if (!this.in_selection(id)) // select row
+ {
+ this.selection[this.selection.length] = id;
+ this.set_classname(this.rows[id].obj, 'selected', true);
+ }
+ else // unselect row
+ {
+ var p = find_in_array(id, this.selection);
+ var a_pre = this.selection.slice(0, p);
+ var a_post = this.selection.slice(p+1, this.selection.length);
+ this.selection = a_pre.concat(a_post);
+ this.set_classname(this.rows[id].obj, 'selected', false);
+ this.set_classname(this.rows[id].obj, 'unfocused', false);
+ }
+ }
+},
+
+
+/**
+ * Handler for keyboard events
+ */
+key_press: function(e)
+{
+ if (this.focused != true)
+ return true;
+
+ var keyCode = rcube_event.get_keycode(e);
+ var mod_key = rcube_event.get_modifier(e);
+ switch (keyCode)
+ {
+ case 40:
+ case 38:
+ case 63233: // "down", in safari keypress
+ case 63232: // "up", in safari keypress
+ // Stop propagation so that the browser doesn't scroll
+ rcube_event.cancel(e);
+ return this.use_arrow_key(keyCode, mod_key);
+ default:
+ this.shiftkey = e.shiftKey;
+ this.key_pressed = keyCode;
+ this.trigger_event('keypress');
+
+ if (this.key_pressed == this.BACKSPACE_KEY)
+ return rcube_event.cancel(e);
+ }
+
+ return true;
+},
+
+/**
+ * Handler for keydown events
+ */
+key_down: function(e)
+{
+ switch (rcube_event.get_keycode(e))
+ {
+ case 40:
+ case 38:
+ case 63233:
+ case 63232:
+ if (!rcube_event.get_modifier(e) && this.focused)
+ return rcube_event.cancel(e);
+
+ default:
+ }
+
+ return true;
+},
+
+
+/**
+ * Special handling method for arrow keys
+ */
+use_arrow_key: function(keyCode, mod_key)
+{
+ var new_row;
+ // Safari uses the nonstandard keycodes 63232/63233 for up/down, if we're
+ // using the keypress event (but not the keydown or keyup event).
+ if (keyCode == 40 || keyCode == 63233) // down arrow key pressed
+ new_row = this.get_next_row();
+ else if (keyCode == 38 || keyCode == 63232) // up arrow key pressed
+ new_row = this.get_prev_row();
+
+ if (new_row)
+ {
+ this.select_row(new_row.uid, mod_key, true);
+ this.scrollto(new_row.uid);
+ }
+
+ return false;
+},
+
+
+/**
+ * Try to scroll the list to make the specified row visible
+ */
+scrollto: function(id)
+{
+ var row = this.rows[id].obj;
+ if (row && this.frame)
+ {
+ var scroll_to = Number(row.offsetTop);
+
+ if (scroll_to < Number(this.frame.scrollTop))
+ this.frame.scrollTop = scroll_to;
+ else if (scroll_to + Number(row.offsetHeight) > Number(this.frame.scrollTop) + Number(this.frame.offsetHeight))
+ this.frame.scrollTop = (scroll_to + Number(row.offsetHeight)) - Number(this.frame.offsetHeight);
+ }
+},
+
+
+/**
+ * Handler for mouse move events
+ */
+drag_mouse_move: function(e)
+{
+ if (this.drag_start)
+ {
+ // check mouse movement, of less than 3 pixels, don't start dragging
+ var m = rcube_event.get_mouse_pos(e);
+
+ if (!this.drag_mouse_start || (Math.abs(m.x - this.drag_mouse_start.x) < 3 && Math.abs(m.y - this.drag_mouse_start.y) < 3))
+ return false;
+
+ if (!this.draglayer)
+ this.draglayer = new rcube_layer('rcmdraglayer', {x:0, y:0, vis:0, zindex:2000});
+
+ // get subjects of selectedd messages
+ var names = '';
+ var c, i, node, subject, obj;
+ for(var n=0; n<this.selection.length; n++)
+ {
+ if (n>12) // only show 12 lines
+ {
+ names += '...';
+ break;
+ }
+
+ if (this.rows[this.selection[n]].obj)
+ {
+ obj = this.rows[this.selection[n]].obj;
+ subject = '';
+
+ for(c=0, i=0; i<obj.childNodes.length; i++)
+ {
+ if (obj.childNodes[i].nodeName == 'TD')
+ {
+ if (((node = obj.childNodes[i].firstChild) && (node.nodeType==3 || node.nodeName=='A')) &&
+ (this.subject_col < 0 || (this.subject_col >= 0 && this.subject_col == c)))
+ {
+ subject = node.nodeType==3 ? node.data : node.innerHTML;
+ names += (subject.length > 50 ? subject.substring(0, 50)+'...' : subject) + '<br />';
+ break;
+ }
+ c++;
+ }
+ }
+ }
+ }
+
+ this.draglayer.write(names);
+ this.draglayer.show(1);
+
+ this.drag_active = true;
+ this.trigger_event('dragstart');
+ }
+
+ if (this.drag_active && this.draglayer)
+ {
+ var pos = rcube_event.get_mouse_pos(e);
+ this.draglayer.move(pos.x+20, pos.y-5);
+ this.trigger_event('dragmove', e);
+ }
+
+ this.drag_start = false;
+
+ return false;
+},
+
+
+/**
+ * Handler for mouse up events
+ */
+drag_mouse_up: function(e)
+{
+ document.onmousemove = null;
+
+ if (this.draglayer && this.draglayer.visible)
+ this.draglayer.show(0);
+
+ this.drag_active = false;
+ this.trigger_event('dragend');
+
+ rcube_event.remove_listener({element:document, event:'mousemove', object:this, method:'drag_mouse_move'});
+ rcube_event.remove_listener({element:document, event:'mouseup', object:this, method:'drag_mouse_up'});
+
+ var iframes = document.getElementsByTagName('IFRAME');
+ for (var n in iframes) {
+ var iframedoc;
+
+ if (iframes[n].contentDocument)
+ iframedoc = iframes[n].contentDocument;
+ else if (iframes[n].contentWindow)
+ iframedoc = iframes[n].contentWindow.document;
+ else if (iframes[n].document)
+ iframedoc = iframes[n].document;
+
+ if (iframedoc) {
+ if (this.iframe_events[n]) {
+ if (iframedoc.removeEventListener)
+ iframedoc.removeEventListener('mousemove', this.iframe_events[n], false);
+ else if (iframedoc.detachEvent)
+ iframedoc.detachEvent('onmousemove', this.iframe_events[n]);
+ else
+ iframedoc['onmousemove'] = null;
+ }
+ rcube_event.remove_listener({element:iframedoc, event:'mouseup', object:this, method:'drag_mouse_up'});
+ }
+ }
+
+ this.focus();
+
+ return rcube_event.cancel(e);
+},
+
+
+
+/**
+ * set/unset a specific class name
+ */
+set_classname: function(obj, classname, set)
+{
+ var reg = new RegExp('\s*'+classname, 'i');
+ if (!set && obj.className.match(reg))
+ obj.className = obj.className.replace(reg, '');
+ else if (set && !obj.className.match(reg))
+ obj.className += ' '+classname;
+},
+
+
+/**
+ * Setter for object event handlers
+ *
+ * @param {String} Event name
+ * @param {Function} Handler function
+ * @return Listener ID (used to remove this handler later on)
+ */
+addEventListener: function(evt, handler)
+{
+ if (this.events[evt]) {
+ var handle = this.events[evt].length;
+ this.events[evt][handle] = handler;
+ return handle;
+ }
+ else
+ return false;
+},
+
+
+/**
+ * Removes a specific event listener
+ *
+ * @param {String} Event name
+ * @param {Int} Listener ID to remove
+ */
+removeEventListener: function(evt, handle)
+{
+ if (this.events[evt] && this.events[evt][handle])
+ this.events[evt][handle] = null;
+},
+
+
+/**
+ * This will execute all registered event handlers
+ * @private
+ */
+trigger_event: function(evt, p)
+{
+ if (this.events[evt] && this.events[evt].length) {
+ for (var i=0; i<this.events[evt].length; i++)
+ if (typeof(this.events[evt][i]) == 'function')
+ this.events[evt][i](this, p);
+ }
}
-if(_1c){
-var _1d=this;
-var pos=rcube_get_object_pos(document.getElementById(_1a[n].id));
-this.iframe_events[n]=function(e){
-e._offset=pos;
-return _1d.drag_mouse_move(e);
+
+
};
-if(_1c.addEventListener){
-_1c.addEventListener("mousemove",this.iframe_events[n],false);
-}else{
-if(_1a[n].attachEvent){
-_1c.attachEvent("onmousemove",this.iframe_events[n]);
-}else{
-_1c["onmousemove"]=this.iframe_events[n];
-}
-}
-rcube_event.add_listener({element:_1c,event:"mouseup",object:this,method:"drag_mouse_up"});
-}
-}
-}
-return false;
-},click_row:function(e,id){
-var now=new Date().getTime();
-var _23=rcube_event.get_modifier(e);
-var _24=rcube_event.get_target(e);
-if((_24&&(_24.tagName=="INPUT"||_24.tagName=="IMG"))){
-return false;
-}
-if(this.dont_select){
-this.dont_select=false;
-return false;
-}
-var _25=now-this.rows[id].clicked<this.dblclick_time;
-if(!this.drag_active&&this.in_selection_before==id&&!_25){
-this.select_row(id,_23,false);
-}
-this.drag_start=false;
-this.in_selection_before=false;
-if(this.rows&&_25&&this.in_selection(id)){
-this.trigger_event("dblclick");
-}else{
-this.trigger_event("click");
-}
-if(!this.drag_active){
-rcube_event.cancel(e);
-}
-this.rows[id].clicked=now;
-return false;
-},get_next_row:function(){
-if(!this.rows){
-return false;
-}
-var _26=this.rows[this.last_selected];
-var _27=_26?_26.obj.nextSibling:null;
-while(_27&&(_27.nodeType!=1||_27.style.display=="none")){
-_27=_27.nextSibling;
-}
-return _27;
-},get_prev_row:function(){
-if(!this.rows){
-return false;
-}
-var _28=this.rows[this.last_selected];
-var _29=_28?_28.obj.previousSibling:null;
-while(_29&&(_29.nodeType!=1||_29.style.display=="none")){
-_29=_29.previousSibling;
-}
-return _29;
-},get_last_row:function(){
-if(this.rowcount){
-var _2a=this.list.tBodies[0].rows;
-for(var i=_2a.length-1;i>=0;i--){
-if(_2a[i].id&&String(_2a[i].id).match(/rcmrow([a-z0-9\-_=]+)/i)&&this.rows[RegExp.$1]!=null){
-return RegExp.$1;
-}
-}
-}
-return null;
-},select_row:function(id,_2d,_2e){
-var _2f=this.selection.join(",");
-if(!this.multiselect){
-_2d=0;
-}
-if(!this.shift_start){
-this.shift_start=id;
-}
-if(!_2d){
-this.shift_start=id;
-this.highlight_row(id,false);
-this.multi_selecting=false;
-}else{
-switch(_2d){
-case SHIFT_KEY:
-this.shift_select(id,false);
-break;
-case CONTROL_KEY:
-if(!_2e){
-this.highlight_row(id,true);
-}
-break;
-case CONTROL_SHIFT_KEY:
-this.shift_select(id,true);
-break;
-default:
-this.highlight_row(id,false);
-break;
-}
-this.multi_selecting=true;
-}
-if(this.selection.join(",")!=_2f){
-this.trigger_event("select");
-}
-if(this.last_selected!=0&&this.rows[this.last_selected]){
-this.set_classname(this.rows[this.last_selected].obj,"focused",false);
-}
-if(this.toggleselect&&this.last_selected==id){
-this.clear_selection();
-id=null;
-}else{
-this.set_classname(this.rows[id].obj,"focused",true);
-}
-if(!this.selection.length){
-this.shift_start=null;
-}
-this.last_selected=id;
-},select:function(id){
-this.select_row(id,false);
-this.scrollto(id);
-},select_next:function(){
-var _31=this.get_next_row();
-var _32=this.get_prev_row();
-var _33=(_31)?_31:_32;
-if(_33){
-this.select_row(_33.uid,false,false);
-}
-},shift_select:function(id,_35){
-if(!this.rows[this.shift_start]||!this.selection.length){
-this.shift_start=id;
-}
-var _36=this.rows[this.shift_start].obj.rowIndex;
-var _37=this.rows[id].obj.rowIndex;
-var i=((_36<_37)?_36:_37);
-var j=((_36>_37)?_36:_37);
-for(var n in this.rows){
-if((this.rows[n].obj.rowIndex>=i)&&(this.rows[n].obj.rowIndex<=j)){
-if(!this.in_selection(n)){
-this.highlight_row(n,true);
-}
-}else{
-if(this.in_selection(n)&&!_35){
-this.highlight_row(n,true);
-}
-}
-}
-},in_selection:function(id){
-for(var n in this.selection){
-if(this.selection[n]==id){
-return true;
-}
-}
-return false;
-},select_all:function(_3d){
-if(!this.rows||!this.rows.length){
-return false;
-}
-var _3e=this.selection.join(",");
-this.clear_selection();
-for(var n in this.rows){
-if(!_3d||this.rows[n][_3d]==true){
-this.last_selected=n;
-this.highlight_row(n,true);
-}
-}
-if(this.selection.join(",")!=_3e){
-this.trigger_event("select");
-}
-this.focus();
-return true;
-},clear_selection:function(id){
-var _41=this.selection.length;
-if(id){
-for(var n=0;n<this.selection.length;n++){
-if(this.selection[n]==id){
-this.selection.splice(n,1);
-break;
-}
-}
-}else{
-for(var n=0;n<this.selection.length;n++){
-if(this.rows[this.selection[n]]){
-this.set_classname(this.rows[this.selection[n]].obj,"selected",false);
-this.set_classname(this.rows[this.selection[n]].obj,"unfocused",false);
-}
-}
-this.selection=new Array();
-}
-if(_41&&!this.selection.length){
-this.trigger_event("select");
-}
-},get_selection:function(){
-return this.selection;
-},get_single_selection:function(){
-if(this.selection.length==1){
-return this.selection[0];
-}else{
-return null;
-}
-},highlight_row:function(id,_44){
-if(this.rows[id]&&!_44){
-if(this.selection.length>1||!this.in_selection(id)){
-this.clear_selection();
-this.selection[0]=id;
-this.set_classname(this.rows[id].obj,"selected",true);
-}
-}else{
-if(this.rows[id]){
-if(!this.in_selection(id)){
-this.selection[this.selection.length]=id;
-this.set_classname(this.rows[id].obj,"selected",true);
-}else{
-var p=find_in_array(id,this.selection);
-var _46=this.selection.slice(0,p);
-var _47=this.selection.slice(p+1,this.selection.length);
-this.selection=_46.concat(_47);
-this.set_classname(this.rows[id].obj,"selected",false);
-this.set_classname(this.rows[id].obj,"unfocused",false);
-}
-}
-}
-},key_press:function(e){
-if(this.focused!=true){
-return true;
-}
-var _49=rcube_event.get_keycode(e);
-var _4a=rcube_event.get_modifier(e);
-switch(_49){
-case 40:
-case 38:
-case 63233:
-case 63232:
-rcube_event.cancel(e);
-return this.use_arrow_key(_49,_4a);
-default:
-this.shiftkey=e.shiftKey;
-this.key_pressed=_49;
-this.trigger_event("keypress");
-if(this.key_pressed==this.BACKSPACE_KEY){
-return rcube_event.cancel(e);
-}
-}
-return true;
-},key_down:function(e){
-switch(rcube_event.get_keycode(e)){
-case 40:
-case 38:
-case 63233:
-case 63232:
-if(!rcube_event.get_modifier(e)&&this.focused){
-return rcube_event.cancel(e);
-}
-default:
-}
-return true;
-},use_arrow_key:function(_4c,_4d){
-var _4e;
-if(_4c==40||_4c==63233){
-_4e=this.get_next_row();
-}else{
-if(_4c==38||_4c==63232){
-_4e=this.get_prev_row();
-}
-}
-if(_4e){
-this.select_row(_4e.uid,_4d,true);
-this.scrollto(_4e.uid);
-}
-return false;
-},scrollto:function(id){
-var row=this.rows[id].obj;
-if(row&&this.frame){
-var _51=Number(row.offsetTop);
-if(_51<Number(this.frame.scrollTop)){
-this.frame.scrollTop=_51;
-}else{
-if(_51+Number(row.offsetHeight)>Number(this.frame.scrollTop)+Number(this.frame.offsetHeight)){
-this.frame.scrollTop=(_51+Number(row.offsetHeight))-Number(this.frame.offsetHeight);
-}
-}
-}
-},drag_mouse_move:function(e){
-if(this.drag_start){
-var m=rcube_event.get_mouse_pos(e);
-if(!this.drag_mouse_start||(Math.abs(m.x-this.drag_mouse_start.x)<3&&Math.abs(m.y-this.drag_mouse_start.y)<3)){
-return false;
-}
-if(!this.draglayer){
-this.draglayer=new rcube_layer("rcmdraglayer",{x:0,y:0,vis:0,zindex:2000});
-}
-var _54="";
-var c,i,_57,_58,obj;
-for(var n=0;n<this.selection.length;n++){
-if(n>12){
-_54+="...";
-break;
-}
-if(this.rows[this.selection[n]].obj){
-obj=this.rows[this.selection[n]].obj;
-_58="";
-for(c=0,i=0;i<obj.childNodes.length;i++){
-if(obj.childNodes[i].nodeName=="TD"){
-if(((_57=obj.childNodes[i].firstChild)&&(_57.nodeType==3||_57.nodeName=="A"))&&(this.subject_col<0||(this.subject_col>=0&&this.subject_col==c))){
-_58=_57.nodeType==3?_57.data:_57.innerHTML;
-_54+=(_58.length>50?_58.substring(0,50)+"...":_58)+"<br />";
-break;
-}
-c++;
-}
-}
-}
-}
-this.draglayer.write(_54);
-this.draglayer.show(1);
-this.drag_active=true;
-this.trigger_event("dragstart");
-}
-if(this.drag_active&&this.draglayer){
-var pos=rcube_event.get_mouse_pos(e);
-this.draglayer.move(pos.x+20,pos.y-5);
-this.trigger_event("dragmove",e);
-}
-this.drag_start=false;
-return false;
-},drag_mouse_up:function(e){
-document.onmousemove=null;
-if(this.draglayer&&this.draglayer.visible){
-this.draglayer.show(0);
-}
-this.drag_active=false;
-this.trigger_event("dragend");
-rcube_event.remove_listener({element:document,event:"mousemove",object:this,method:"drag_mouse_move"});
-rcube_event.remove_listener({element:document,event:"mouseup",object:this,method:"drag_mouse_up"});
-var _5d=document.getElementsByTagName("IFRAME");
-for(var n in _5d){
-var _5f;
-if(_5d[n].contentDocument){
-_5f=_5d[n].contentDocument;
-}else{
-if(_5d[n].contentWindow){
-_5f=_5d[n].contentWindow.document;
-}else{
-if(_5d[n].document){
-_5f=_5d[n].document;
-}
-}
-}
-if(_5f){
-if(this.iframe_events[n]){
-if(_5f.removeEventListener){
-_5f.removeEventListener("mousemove",this.iframe_events[n],false);
-}else{
-if(_5f.detachEvent){
-_5f.detachEvent("onmousemove",this.iframe_events[n]);
-}else{
-_5f["onmousemove"]=null;
-}
-}
-}
-rcube_event.remove_listener({element:_5f,event:"mouseup",object:this,method:"drag_mouse_up"});
-}
-}
-this.focus();
-return rcube_event.cancel(e);
-},set_classname:function(obj,_61,set){
-var reg=new RegExp("s*"+_61,"i");
-if(!set&&obj.className.match(reg)){
-obj.className=obj.className.replace(reg,"");
-}else{
-if(set&&!obj.className.match(reg)){
-obj.className+=" "+_61;
-}
-}
-},addEventListener:function(evt,_65){
-if(this.events[evt]){
-var _66=this.events[evt].length;
-this.events[evt][_66]=_65;
-return _66;
-}else{
-return false;
-}
-},removeEventListener:function(evt,_68){
-if(this.events[evt]&&this.events[evt][_68]){
-this.events[evt][_68]=null;
-}
-},trigger_event:function(evt,p){
-if(this.events[evt]&&this.events[evt].length){
-for(var i=0;i<this.events[evt].length;i++){
-if(typeof (this.events[evt][i])=="function"){
-this.events[evt][i](this,p);
-}
-}
-}
-}};
+++ /dev/null
-/*
- +-----------------------------------------------------------------------+
- | RoundCube List Widget |
- | |
- | This file is part of the RoundCube Webmail client |
- | Copyright (C) 2006-2008, RoundCube Dev, - Switzerland |
- | Licensed under the GNU GPL |
- | |
- +-----------------------------------------------------------------------+
- | Authors: Thomas Bruederli <roundcube@gmail.com> |
- | Charles McNulty <charles@charlesmcnulty.com> |
- +-----------------------------------------------------------------------+
- | Requires: common.js |
- +-----------------------------------------------------------------------+
-
- $Id: list.js 344 2006-09-18 03:49:28Z thomasb $
-*/
-
-
-/**
- * RoundCube List Widget class
- * @contructor
- */
-function rcube_list_widget(list, p)
- {
- // static contants
- this.ENTER_KEY = 13;
- this.DELETE_KEY = 46;
- this.BACKSPACE_KEY = 8;
-
- this.list = list ? list : null;
- this.frame = null;
- this.rows = [];
- this.selection = [];
- this.rowcount = 0;
-
- this.subject_col = -1;
- this.shiftkey = false;
- this.multiselect = false;
- this.multi_selecting = false;
- this.draggable = false;
- this.keyboard = false;
- this.toggleselect = false;
-
- this.dont_select = false;
- this.drag_active = false;
- this.last_selected = 0;
- this.shift_start = 0;
- this.in_selection_before = false;
- this.focused = false;
- this.drag_mouse_start = null;
- this.dblclick_time = 600;
- this.row_init = function(){};
- this.events = { click:[], dblclick:[], select:[], keypress:[], dragstart:[], dragmove:[], dragend:[] };
-
- // overwrite default paramaters
- if (p && typeof(p)=='object')
- for (var n in p)
- this[n] = p[n];
- }
-
-
-rcube_list_widget.prototype = {
-
-
-/**
- * get all message rows from HTML table and init each row
- */
-init: function()
-{
- if (this.list && this.list.tBodies[0])
- {
- this.rows = new Array();
- this.rowcount = 0;
-
- var row;
- for(var r=0; r<this.list.tBodies[0].childNodes.length; r++)
- {
- row = this.list.tBodies[0].childNodes[r];
- while (row && (row.nodeType != 1 || row.style.display == 'none'))
- {
- row = row.nextSibling;
- r++;
- }
-
- this.init_row(row);
- this.rowcount++;
- }
-
- this.frame = this.list.parentNode;
-
- // set body events
- if (this.keyboard) {
- rcube_event.add_listener({element:document, event:'keyup', object:this, method:'key_press'});
- rcube_event.add_listener({element:document, event:'keydown', object:this, method:'key_down'});
- }
- }
-},
-
-
-/**
- *
- */
-init_row: function(row)
-{
- // make references in internal array and set event handlers
- if (row && String(row.id).match(/rcmrow([a-z0-9\-_=]+)/i))
- {
- var p = this;
- var uid = RegExp.$1;
- row.uid = uid;
- this.rows[uid] = {uid:uid, id:row.id, obj:row, classname:row.className};
-
- // set eventhandlers to table row
- row.onmousedown = function(e){ return p.drag_row(e, this.uid); };
- row.onmouseup = function(e){ return p.click_row(e, this.uid); };
-
- if (document.all)
- row.onselectstart = function() { return false; };
-
- this.row_init(this.rows[uid]);
- }
-},
-
-
-/**
- *
- */
-clear: function(sel)
-{
- var tbody = document.createElement('TBODY');
- this.list.insertBefore(tbody, this.list.tBodies[0]);
- this.list.removeChild(this.list.tBodies[1]);
- this.rows = new Array();
- this.rowcount = 0;
-
- if (sel) this.clear_selection();
-},
-
-
-/**
- * 'remove' message row from list (just hide it)
- */
-remove_row: function(uid, sel_next)
-{
- if (this.rows[uid].obj)
- this.rows[uid].obj.style.display = 'none';
-
- if (sel_next)
- this.select_next();
-
- this.rows[uid] = null;
- this.rowcount--;
-},
-
-
-/**
- *
- */
-insert_row: function(row, attop)
-{
- var tbody = this.list.tBodies[0];
-
- if (attop && tbody.rows.length)
- tbody.insertBefore(row, tbody.firstChild);
- else
- tbody.appendChild(row);
-
- this.init_row(row);
- this.rowcount++;
-},
-
-
-
-/**
- * Set focus to the list
- */
-focus: function(e)
-{
- this.focused = true;
- for (var n=0; n<this.selection.length; n++)
- {
- id = this.selection[n];
- if (this.rows[id] && this.rows[id].obj)
- {
- this.set_classname(this.rows[id].obj, 'selected', true);
- this.set_classname(this.rows[id].obj, 'unfocused', false);
- }
- }
-
- if (e || (e = window.event))
- rcube_event.cancel(e);
-},
-
-
-/**
- * remove focus from the list
- */
-blur: function()
-{
- var id;
- this.focused = false;
- for (var n=0; n<this.selection.length; n++)
- {
- id = this.selection[n];
- if (this.rows[id] && this.rows[id].obj)
- {
- this.set_classname(this.rows[id].obj, 'selected', false);
- this.set_classname(this.rows[id].obj, 'unfocused', true);
- }
- }
-},
-
-
-/**
- * onmousedown-handler of message list row
- */
-drag_row: function(e, id)
-{
- // don't do anything (another action processed before)
- var evtarget = rcube_event.get_target(e);
- if (this.dont_select || (evtarget && (evtarget.tagName == 'INPUT' || evtarget.tagName == 'IMG')))
- return false;
-
- // accept right-clicks
- if (rcube_event.get_button(e) == 2)
- return true;
-
- this.in_selection_before = this.in_selection(id) ? id : false;
-
- // selects currently unselected row
- if (!this.in_selection_before)
- {
- var mod_key = rcube_event.get_modifier(e);
- this.select_row(id, mod_key, false);
- }
-
- if (this.draggable && this.selection.length)
- {
- this.drag_start = true;
- this.drag_mouse_start = rcube_event.get_mouse_pos(e);
- rcube_event.add_listener({element:document, event:'mousemove', object:this, method:'drag_mouse_move'});
- rcube_event.add_listener({element:document, event:'mouseup', object:this, method:'drag_mouse_up'});
-
- // add listener for iframes
- var iframes = document.getElementsByTagName('IFRAME');
- this.iframe_events = Object();
- for (var n in iframes)
- {
- var iframedoc = null;
- if (iframes[n].contentDocument)
- iframedoc = iframes[n].contentDocument;
- else if (iframes[n].contentWindow)
- iframedoc = iframes[n].contentWindow.document;
- else if (iframes[n].document)
- iframedoc = iframes[n].document;
-
- if (iframedoc)
- {
- var list = this;
- var pos = rcube_get_object_pos(document.getElementById(iframes[n].id));
- this.iframe_events[n] = function(e) { e._offset = pos; return list.drag_mouse_move(e); }
-
- if (iframedoc.addEventListener)
- iframedoc.addEventListener('mousemove', this.iframe_events[n], false);
- else if (iframes[n].attachEvent)
- iframedoc.attachEvent('onmousemove', this.iframe_events[n]);
- else
- iframedoc['onmousemove'] = this.iframe_events[n];
-
- rcube_event.add_listener({element:iframedoc, event:'mouseup', object:this, method:'drag_mouse_up'});
- }
- }
- }
-
- return false;
-},
-
-
-/**
- * onmouseup-handler of message list row
- */
-click_row: function(e, id)
-{
- var now = new Date().getTime();
- var mod_key = rcube_event.get_modifier(e);
- var evtarget = rcube_event.get_target(e);
-
- if ((evtarget && (evtarget.tagName == 'INPUT' || evtarget.tagName == 'IMG')))
- return false;
-
- // don't do anything (another action processed before)
- if (this.dont_select)
- {
- this.dont_select = false;
- return false;
- }
-
- var dblclicked = now - this.rows[id].clicked < this.dblclick_time;
-
- // unselects currently selected row
- if (!this.drag_active && this.in_selection_before == id && !dblclicked)
- this.select_row(id, mod_key, false);
-
- this.drag_start = false;
- this.in_selection_before = false;
-
- // row was double clicked
- if (this.rows && dblclicked && this.in_selection(id))
- this.trigger_event('dblclick');
- else
- this.trigger_event('click');
-
- if (!this.drag_active)
- rcube_event.cancel(e);
-
- this.rows[id].clicked = now;
- return false;
-},
-
-
-/**
- * get next/previous/last rows that are not hidden
- */
-get_next_row: function()
-{
- if (!this.rows)
- return false;
-
- var last_selected_row = this.rows[this.last_selected];
- var new_row = last_selected_row ? last_selected_row.obj.nextSibling : null;
- while (new_row && (new_row.nodeType != 1 || new_row.style.display == 'none'))
- new_row = new_row.nextSibling;
-
- return new_row;
-},
-
-get_prev_row: function()
-{
- if (!this.rows)
- return false;
-
- var last_selected_row = this.rows[this.last_selected];
- var new_row = last_selected_row ? last_selected_row.obj.previousSibling : null;
- while (new_row && (new_row.nodeType != 1 || new_row.style.display == 'none'))
- new_row = new_row.previousSibling;
-
- return new_row;
-},
-
-get_last_row: function()
-{
- if (this.rowcount)
- {
- var rows = this.list.tBodies[0].rows;
-
- for(var i=rows.length-1; i>=0; i--)
- if(rows[i].id && String(rows[i].id).match(/rcmrow([a-z0-9\-_=]+)/i) && this.rows[RegExp.$1] != null)
- return RegExp.$1;
- }
-
- return null;
-},
-
-
-/**
- * selects or unselects the proper row depending on the modifier key pressed
- */
-select_row: function(id, mod_key, with_mouse)
-{
- var select_before = this.selection.join(',');
- if (!this.multiselect)
- mod_key = 0;
-
- if (!this.shift_start)
- this.shift_start = id
-
- if (!mod_key)
- {
- this.shift_start = id;
- this.highlight_row(id, false);
- this.multi_selecting = false;
- }
- else
- {
- switch (mod_key)
- {
- case SHIFT_KEY:
- this.shift_select(id, false);
- break;
-
- case CONTROL_KEY:
- if (!with_mouse)
- this.highlight_row(id, true);
- break;
-
- case CONTROL_SHIFT_KEY:
- this.shift_select(id, true);
- break;
-
- default:
- this.highlight_row(id, false);
- break;
- }
- this.multi_selecting = true;
- }
-
- // trigger event if selection changed
- if (this.selection.join(',') != select_before)
- this.trigger_event('select');
-
- if (this.last_selected != 0 && this.rows[this.last_selected])
- this.set_classname(this.rows[this.last_selected].obj, 'focused', false);
-
- // unselect if toggleselect is active and the same row was clicked again
- if (this.toggleselect && this.last_selected == id)
- {
- this.clear_selection();
- id = null;
- }
- else
- this.set_classname(this.rows[id].obj, 'focused', true);
-
- if (!this.selection.length)
- this.shift_start = null;
-
- this.last_selected = id;
-},
-
-
-/**
- * Alias method for select_row
- */
-select: function(id)
-{
- this.select_row(id, false);
- this.scrollto(id);
-},
-
-
-/**
- * Select row next to the last selected one.
- * Either below or above.
- */
-select_next: function()
-{
- var next_row = this.get_next_row();
- var prev_row = this.get_prev_row();
- var new_row = (next_row) ? next_row : prev_row;
- if (new_row)
- this.select_row(new_row.uid, false, false);
-},
-
-
-/**
- * Perform selection when shift key is pressed
- */
-shift_select: function(id, control)
-{
- if (!this.rows[this.shift_start] || !this.selection.length)
- this.shift_start = id;
-
- var from_rowIndex = this.rows[this.shift_start].obj.rowIndex;
- var to_rowIndex = this.rows[id].obj.rowIndex;
-
- var i = ((from_rowIndex < to_rowIndex)? from_rowIndex : to_rowIndex);
- var j = ((from_rowIndex > to_rowIndex)? from_rowIndex : to_rowIndex);
-
- // iterate through the entire message list
- for (var n in this.rows)
- {
- if ((this.rows[n].obj.rowIndex >= i) && (this.rows[n].obj.rowIndex <= j))
- {
- if (!this.in_selection(n))
- this.highlight_row(n, true);
- }
- else
- {
- if (this.in_selection(n) && !control)
- this.highlight_row(n, true);
- }
- }
-},
-
-
-/**
- * Check if given id is part of the current selection
- */
-in_selection: function(id)
-{
- for(var n in this.selection)
- if (this.selection[n]==id)
- return true;
-
- return false;
-},
-
-
-/**
- * Select each row in list
- */
-select_all: function(filter)
-{
- if (!this.rows || !this.rows.length)
- return false;
-
- // reset but remember selection first
- var select_before = this.selection.join(',');
- this.clear_selection();
-
- for (var n in this.rows)
- {
- if (!filter || this.rows[n][filter]==true)
- {
- this.last_selected = n;
- this.highlight_row(n, true);
- }
- }
-
- // trigger event if selection changed
- if (this.selection.join(',') != select_before)
- this.trigger_event('select');
-
- this.focus();
-
- return true;
-},
-
-
-/**
- * Unselect selected row(s)
- */
-clear_selection: function(id)
-{
- var num_select = this.selection.length;
-
- // one row
- if (id)
- {
- for (var n=0; n<this.selection.length; n++)
- if (this.selection[n] == id)
- {
- this.selection.splice(n,1);
- break;
- }
- }
- // all rows
- else
- {
- for (var n=0; n<this.selection.length; n++)
- if (this.rows[this.selection[n]])
- {
- this.set_classname(this.rows[this.selection[n]].obj, 'selected', false);
- this.set_classname(this.rows[this.selection[n]].obj, 'unfocused', false);
- }
-
- this.selection = new Array();
- }
-
- if (num_select && !this.selection.length)
- this.trigger_event('select');
-},
-
-
-/**
- * Getter for the selection array
- */
-get_selection: function()
-{
- return this.selection;
-},
-
-
-/**
- * Return the ID if only one row is selected
- */
-get_single_selection: function()
-{
- if (this.selection.length == 1)
- return this.selection[0];
- else
- return null;
-},
-
-
-/**
- * Highlight/unhighlight a row
- */
-highlight_row: function(id, multiple)
-{
- if (this.rows[id] && !multiple)
- {
- if (this.selection.length > 1 || !this.in_selection(id))
- {
- this.clear_selection();
- this.selection[0] = id;
- this.set_classname(this.rows[id].obj, 'selected', true);
- }
- }
- else if (this.rows[id])
- {
- if (!this.in_selection(id)) // select row
- {
- this.selection[this.selection.length] = id;
- this.set_classname(this.rows[id].obj, 'selected', true);
- }
- else // unselect row
- {
- var p = find_in_array(id, this.selection);
- var a_pre = this.selection.slice(0, p);
- var a_post = this.selection.slice(p+1, this.selection.length);
- this.selection = a_pre.concat(a_post);
- this.set_classname(this.rows[id].obj, 'selected', false);
- this.set_classname(this.rows[id].obj, 'unfocused', false);
- }
- }
-},
-
-
-/**
- * Handler for keyboard events
- */
-key_press: function(e)
-{
- if (this.focused != true)
- return true;
-
- var keyCode = rcube_event.get_keycode(e);
- var mod_key = rcube_event.get_modifier(e);
- switch (keyCode)
- {
- case 40:
- case 38:
- case 63233: // "down", in safari keypress
- case 63232: // "up", in safari keypress
- // Stop propagation so that the browser doesn't scroll
- rcube_event.cancel(e);
- return this.use_arrow_key(keyCode, mod_key);
- default:
- this.shiftkey = e.shiftKey;
- this.key_pressed = keyCode;
- this.trigger_event('keypress');
-
- if (this.key_pressed == this.BACKSPACE_KEY)
- return rcube_event.cancel(e);
- }
-
- return true;
-},
-
-/**
- * Handler for keydown events
- */
-key_down: function(e)
-{
- switch (rcube_event.get_keycode(e))
- {
- case 40:
- case 38:
- case 63233:
- case 63232:
- if (!rcube_event.get_modifier(e) && this.focused)
- return rcube_event.cancel(e);
-
- default:
- }
-
- return true;
-},
-
-
-/**
- * Special handling method for arrow keys
- */
-use_arrow_key: function(keyCode, mod_key)
-{
- var new_row;
- // Safari uses the nonstandard keycodes 63232/63233 for up/down, if we're
- // using the keypress event (but not the keydown or keyup event).
- if (keyCode == 40 || keyCode == 63233) // down arrow key pressed
- new_row = this.get_next_row();
- else if (keyCode == 38 || keyCode == 63232) // up arrow key pressed
- new_row = this.get_prev_row();
-
- if (new_row)
- {
- this.select_row(new_row.uid, mod_key, true);
- this.scrollto(new_row.uid);
- }
-
- return false;
-},
-
-
-/**
- * Try to scroll the list to make the specified row visible
- */
-scrollto: function(id)
-{
- var row = this.rows[id].obj;
- if (row && this.frame)
- {
- var scroll_to = Number(row.offsetTop);
-
- if (scroll_to < Number(this.frame.scrollTop))
- this.frame.scrollTop = scroll_to;
- else if (scroll_to + Number(row.offsetHeight) > Number(this.frame.scrollTop) + Number(this.frame.offsetHeight))
- this.frame.scrollTop = (scroll_to + Number(row.offsetHeight)) - Number(this.frame.offsetHeight);
- }
-},
-
-
-/**
- * Handler for mouse move events
- */
-drag_mouse_move: function(e)
-{
- if (this.drag_start)
- {
- // check mouse movement, of less than 3 pixels, don't start dragging
- var m = rcube_event.get_mouse_pos(e);
-
- if (!this.drag_mouse_start || (Math.abs(m.x - this.drag_mouse_start.x) < 3 && Math.abs(m.y - this.drag_mouse_start.y) < 3))
- return false;
-
- if (!this.draglayer)
- this.draglayer = new rcube_layer('rcmdraglayer', {x:0, y:0, vis:0, zindex:2000});
-
- // get subjects of selectedd messages
- var names = '';
- var c, i, node, subject, obj;
- for(var n=0; n<this.selection.length; n++)
- {
- if (n>12) // only show 12 lines
- {
- names += '...';
- break;
- }
-
- if (this.rows[this.selection[n]].obj)
- {
- obj = this.rows[this.selection[n]].obj;
- subject = '';
-
- for(c=0, i=0; i<obj.childNodes.length; i++)
- {
- if (obj.childNodes[i].nodeName == 'TD')
- {
- if (((node = obj.childNodes[i].firstChild) && (node.nodeType==3 || node.nodeName=='A')) &&
- (this.subject_col < 0 || (this.subject_col >= 0 && this.subject_col == c)))
- {
- subject = node.nodeType==3 ? node.data : node.innerHTML;
- names += (subject.length > 50 ? subject.substring(0, 50)+'...' : subject) + '<br />';
- break;
- }
- c++;
- }
- }
- }
- }
-
- this.draglayer.write(names);
- this.draglayer.show(1);
-
- this.drag_active = true;
- this.trigger_event('dragstart');
- }
-
- if (this.drag_active && this.draglayer)
- {
- var pos = rcube_event.get_mouse_pos(e);
- this.draglayer.move(pos.x+20, pos.y-5);
- this.trigger_event('dragmove', e);
- }
-
- this.drag_start = false;
-
- return false;
-},
-
-
-/**
- * Handler for mouse up events
- */
-drag_mouse_up: function(e)
-{
- document.onmousemove = null;
-
- if (this.draglayer && this.draglayer.visible)
- this.draglayer.show(0);
-
- this.drag_active = false;
- this.trigger_event('dragend');
-
- rcube_event.remove_listener({element:document, event:'mousemove', object:this, method:'drag_mouse_move'});
- rcube_event.remove_listener({element:document, event:'mouseup', object:this, method:'drag_mouse_up'});
-
- var iframes = document.getElementsByTagName('IFRAME');
- for (var n in iframes) {
- var iframedoc;
-
- if (iframes[n].contentDocument)
- iframedoc = iframes[n].contentDocument;
- else if (iframes[n].contentWindow)
- iframedoc = iframes[n].contentWindow.document;
- else if (iframes[n].document)
- iframedoc = iframes[n].document;
-
- if (iframedoc) {
- if (this.iframe_events[n]) {
- if (iframedoc.removeEventListener)
- iframedoc.removeEventListener('mousemove', this.iframe_events[n], false);
- else if (iframedoc.detachEvent)
- iframedoc.detachEvent('onmousemove', this.iframe_events[n]);
- else
- iframedoc['onmousemove'] = null;
- }
- rcube_event.remove_listener({element:iframedoc, event:'mouseup', object:this, method:'drag_mouse_up'});
- }
- }
-
- this.focus();
-
- return rcube_event.cancel(e);
-},
-
-
-
-/**
- * set/unset a specific class name
- */
-set_classname: function(obj, classname, set)
-{
- var reg = new RegExp('\s*'+classname, 'i');
- if (!set && obj.className.match(reg))
- obj.className = obj.className.replace(reg, '');
- else if (set && !obj.className.match(reg))
- obj.className += ' '+classname;
-},
-
-
-/**
- * Setter for object event handlers
- *
- * @param {String} Event name
- * @param {Function} Handler function
- * @return Listener ID (used to remove this handler later on)
- */
-addEventListener: function(evt, handler)
-{
- if (this.events[evt]) {
- var handle = this.events[evt].length;
- this.events[evt][handle] = handler;
- return handle;
- }
- else
- return false;
-},
-
-
-/**
- * Removes a specific event listener
- *
- * @param {String} Event name
- * @param {Int} Listener ID to remove
- */
-removeEventListener: function(evt, handle)
-{
- if (this.events[evt] && this.events[evt][handle])
- this.events[evt][handle] = null;
-},
-
-
-/**
- * This will execute all registered event handlers
- * @private
- */
-trigger_event: function(evt, p)
-{
- if (this.events[evt] && this.events[evt].length) {
- for (var i=0; i<this.events[evt].length; i++)
- if (typeof(this.events[evt][i]) == 'function')
- this.events[evt][i](this, p);
- }
-}
-
-
-};
-
'/&(bull|#149|#8226);/i', // Bullet
'/&(pound|#163);/i', // Pound sign
'/&(euro|#8364);/i', // Euro sign
- '/&[^&;]+;/i', // Unknown/unhandled entities
'/[ ]{2,}/' // Runs of spaces, post-handling
);
"\n\n", // <ol> and </ol>
"\t* \\1\n", // <li> and </li>
"\n\t* ", // <li>
- "\n-------------------------\n", // <hr>
- "\n\n", // <table> and </table>
+ "\n-------------------------\n", // <hr>
+ "\n\n", // <table> and </table>
"\n", // <tr> and </tr>
"\t\t\\1\n", // <td> and </td>
' ', // Non-breaking space
'*',
'£',
'EUR', // Euro sign. \80 ?
- '', // Unknown/unhandled entities
' ' // Runs of spaces, post-handling
);
* @see $pre_replace
*/
var $pre_search = array(
- "/\n/",
- "/\t/",
- '/ /',
- '/<pre[^>]*>/',
- '/<\/pre>/'
+ "/\n/",
+ "/\t/",
+ '/ /',
+ '/<pre[^>]*>/',
+ '/<\/pre>/'
);
/**
* @see $pre_search
*/
var $pre_replace = array(
- '<br>',
- ' ',
- ' ',
- '',
- ''
+ '<br>',
+ ' ',
+ ' ',
+ '',
+ ''
);
/**
if ( !empty($source) ) {
$this->set_html($source, $from_file);
}
-
+
$this->set_base_url();
- $this->_do_links = $do_links;
- $this->width = $width;
+ $this->_do_links = $do_links;
+ $this->width = $width;
}
/**
function set_html( $source, $from_file = false )
{
if ( $from_file && file_exists($source) ) {
- $this->html = file_get_contents($source);
+ $this->html = file_get_contents($source);
}
else
- $this->html = $source;
+ $this->html = $source;
$this->_converted = false;
}
$text = trim(stripslashes($this->html));
- // Convert <PRE>
+ // Convert <PRE>
$this->_convert_pre($text);
// Run our defined search-and-replace
$text = preg_replace($this->search, $this->replace, $text);
$text = preg_replace_callback($this->callback_search, array('html2text', '_preg_callback'), $text);
- // Replace known html entities
- $text = html_entity_decode($text, ENT_COMPAT, 'UTF-8');
+ // Replace known html entities
+ $text = html_entity_decode($text, ENT_COMPAT, 'UTF-8');
+
+ // Remove unknown/unhandled entities (this cannot be done in search-and-replace block)
+ $text = preg_replace('/&[^&;]+;/i', '', $text);
// Strip any other HTML tags
$text = strip_tags($text, $this->allowed_tags);
*/
function _convert_pre(&$text)
{
- while(preg_match('/<pre[^>]*>(.*)<\/pre>/ismU', $text, $matches))
- {
- $result = preg_replace($this->pre_search, $this->pre_replace, $matches[1]);
- $text = preg_replace('/<pre[^>]*>.*<\/pre>/ismU', '<div><br>' . $result . '<br></div>', $text, 1);
- }
+ while(preg_match('/<pre[^>]*>(.*)<\/pre>/ismU', $text, $matches)) {
+ $result = preg_replace($this->pre_search, $this->pre_replace, $matches[1]);
+ $text = preg_replace('/<pre[^>]*>.*<\/pre>/ismU', '<div><br>' . $result . '<br></div>', $text, 1);
+ }
}
/**
*/
function _preg_callback($matches)
{
- switch($matches[1])
- {
- case 'b':
- case 'strong':
- return $this->_strtoupper($matches[2]);
- case 'hr':
- return $this->_strtoupper("\t\t". $matches[2] ."\n");
- case 'h':
- return $this->_strtoupper("\n\n". $matches[2] ."\n\n");
- case 'a':
- return $this->_build_link_list($matches[3], $matches[4]);
- }
+ switch($matches[1]) {
+ case 'b':
+ case 'strong':
+ return $this->_strtoupper($matches[2]);
+ case 'hr':
+ return $this->_strtoupper("\t\t". $matches[2] ."\n");
+ case 'h':
+ return $this->_strtoupper("\n\n". $matches[2] ."\n\n");
+ case 'a':
+ return $this->_build_link_list($matches[3], $matches[4]);
+ }
}
/**
*/
function _strtoupper($str)
{
- if (function_exists('mb_strtoupper'))
- return mb_strtoupper($str);
- else
- return strtoupper($str);
+ if (function_exists('mb_strtoupper'))
+ return mb_strtoupper($str);
+ else
+ return strtoupper($str);
}
}
- Removed some debuggers (echo ...)
File altered by Aleksander Machniak <alec@alec.pl>
- trim(chop()) replaced by trim()
- - added iil_Escape() with support for " and \ in folder names
+ - added iil_Escape()/iil_UnEscape() with support for " and \ in folder names
- support \ character in username in iil_C_Login()
- fixed iil_MultLine(): use iil_ReadBytes() instead of iil_ReadLine()
- fixed iil_C_FetchStructureString() to handle many literal strings in response
- iil_C_HandlePartBody(): added 6th argument and fixed endless loop
- added iil_PutLineC()
- fixed iil_C_Sort() to support very long and/or divided responses
- - added BYE response simple support for endless loop prevention
+ - added BYE/BAD response simple support for endless loop prevention
- added 3rd argument in iil_StartsWith* functions
- fix iil_C_FetchPartHeader() in some cases by use of iil_C_HandlePartBody()
- allow iil_C_HandlePartBody() to fetch whole message
- added 4th argument to iil_Connect()
- allow setting rootdir and delimiter before connect
- support multiquota result
+ - include BODYSTRUCTURE in iil_C_FetchHeaders()
+ - added iil_C_FetchMIMEHeaders() function
+ - added \* flag support
********************************************************/
'DRAFT' => '\\Draft',
'FLAGGED' => '\\Flagged',
'FORWARDED' => '$Forwarded',
- 'MDNSENT' => '$MDNSent');
+ 'MDNSENT' => '$MDNSent',
+ '*' => '\\*',
+);
$iil_error;
$iil_errornum;
var $flags;
var $timestamp;
var $f;
+ var $body_structure;
var $internaldate;
var $references;
var $priority;
if(preg_match('/^\{[0-9]+\}\r\n$/', $parts[$i+1])) {
$res += iil_PutLine($fp, $parts[$i].$parts[$i+1], false);
$line = iil_ReadLine($fp, 1000);
+ // handle error in command
+ if ($line[0] != '+')
+ return false;
$i++;
}
else
}
function iil_ParseResult($string) {
- $a=explode(' ', $string);
+ $a = explode(' ', $string);
if (count($a) > 2) {
if (strcasecmp($a[1], 'OK') == 0) {
return 0;
return -4;
}
-// check if $string starts with $match
-function iil_StartsWith($string, $match, $bye=false) {
+// check if $string starts with $match (or * BYE/BAD)
+function iil_StartsWith($string, $match, $error=false) {
$len = strlen($match);
if ($len == 0) {
return false;
if (strncmp($string, $match, $len) == 0) {
return true;
}
- if ($bye && strncmp($string, '* BYE ', 6) == 0) {
+ if ($error && preg_match('/^\* (BYE|BAD) /', $string)) {
return true;
}
return false;
return strtr($string, array('"'=>'\\"', '\\' => '\\\\'));
}
+function iil_UnEscape($string)
+{
+ return strtr($string, array('\\"'=>'"', '\\\\' => '\\'));
+}
+
function iil_C_GetCapability(&$conn, $name)
{
if (in_array($name, $conn->capability)) {
$line = iil_ReadLine($conn->fp, 1024);
if (iil_StartsWith($line, '* NAMESPACE')) {
$i = 0;
+ $line = iil_UnEscape($line);
$data = iil_ParseNamespace2(substr($line,11), $i, 0, 0);
}
} while (!iil_StartsWith($line, 'ns1', true));
}
if (empty($auth_method))
- $auth_method = 'plain';
+ $auth_method = 'check';
$message = "INITIAL: $auth_method\n";
return $t_index;
}
-function iil_C_FetchHeaders(&$conn, $mailbox, $message_set, $uidfetch=false)
+function iil_C_FetchHeaders(&$conn, $mailbox, $message_set, $uidfetch=false, $bodystr=false)
{
global $IMAP_USE_INTERNAL_DATE;
/* FETCH uid, size, flags and headers */
$key = 'FH12';
$request = $key . ($uidfetch ? ' UID' : '') . " FETCH $message_set ";
- $request .= "(UID RFC822.SIZE FLAGS INTERNALDATE BODY.PEEK[HEADER.FIELDS ";
+ $request .= "(UID RFC822.SIZE FLAGS INTERNALDATE ";
+ if ($bodystr)
+ $request .= "BODYSTRUCTURE ";
+ $request .= "BODY.PEEK[HEADER.FIELDS ";
$request .= "(DATE FROM TO SUBJECT REPLY-TO IN-REPLY-TO CC BCC ";
$request .= "CONTENT-TRANSFER-ENCODING CONTENT-TYPE MESSAGE-ID ";
$request .= "REFERENCES DISPOSITION-NOTIFICATION-TO X-PRIORITY)])";
return false;
}
do {
- $line = chop(iil_ReadLine($fp, 1024));
+ $line = iil_ReadLine($fp, 1024);
+ $line = iil_MultLine($fp, $line);
+
$a = explode(' ', $line);
if (($line[0] == '*') && ($a[2] == 'FETCH')) {
$id = $a[1];
$result[$id]->subject = '';
$result[$id]->messageID = 'mid:' . $id;
+ $lines = array();
+ $ln = 0;
/*
Sample reply line:
* 321 FETCH (UID 2417 RFC822.SIZE 2730 FLAGS (\Seen)
- INTERNALDATE "16-Nov-2008 21:08:46 +0100" BODY[HEADER.FIELDS ...
+ INTERNALDATE "16-Nov-2008 21:08:46 +0100" BODYSTRUCTURE (...)
+ BODY[HEADER.FIELDS ...
*/
-
- if (preg_match('/^\* [0-9]+ FETCH \((.*) BODY\[HEADER/', $line, $matches)) {
+
+ if (preg_match('/^\* [0-9]+ FETCH \((.*) BODY/s', $line, $matches)) {
$str = $matches[1];
- //swap parents with quotes, then explode
+ // swap parents with quotes, then explode
$str = eregi_replace("[()]", "\"", $str);
$a = iil_ExplodeQuotedString(' ', $str);
- //did we get the right number of replies?
+ // did we get the right number of replies?
$parts_count = count($a);
- if ($parts_count>=8) {
+ if ($parts_count>=6) {
for ($i=0; $i<$parts_count; $i=$i+2) {
if (strcasecmp($a[$i],'UID') == 0)
$result[$id]->uid = $a[$i+1];
$flags_str = $a[$i+1];
}
- // process flags
- $flags_str = eregi_replace('[\\\"]', '', $flags_str);
- $flags_a = explode(' ', $flags_str);
-
- if (is_array($flags_a)) {
- reset($flags_a);
- while (list(,$val)=each($flags_a)) {
- if (strcasecmp($val,'Seen') == 0) {
- $result[$id]->seen = true;
- } else if (strcasecmp($val, 'Deleted') == 0) {
- $result[$id]->deleted=true;
- } else if (strcasecmp($val, 'Recent') == 0) {
- $result[$id]->recent = true;
- } else if (strcasecmp($val, 'Answered') == 0) {
- $result[$id]->answered = true;
- } else if (strcasecmp($val, '$Forwarded') == 0) {
- $result[$id]->forwarded = true;
- } else if (strcasecmp($val, 'Draft') == 0) {
- $result[$id]->is_draft = true;
- } else if (strcasecmp($val, '$MDNSent') == 0) {
- $result[$id]->mdn_sent = true;
- } else if (strcasecmp($val, 'Flagged') == 0) {
- $result[$id]->flagged = true;
- }
- }
- $result[$id]->flags = $flags_a;
- }
-
$time_str = str_replace('"', '', $time_str);
// if time is gmt...
$result[$id]->timestamp = $timestamp;
$result[$id]->date = $time_str;
}
+
+ // BODYSTRUCTURE
+ if($bodystr) {
+ while (!preg_match('/ BODYSTRUCTURE (.*) BODY\[HEADER.FIELDS/s', $line, $m)) {
+ $line2 = iil_ReadLine($fp, 1024);
+ $line .= iil_MultLine($fp, $line2);
+ }
+ $result[$id]->body_structure = $m[1];
+ }
+
+ // the rest of the result
+ preg_match('/ BODY\[HEADER.FIELDS \(.*\)\]\s*(.*)/s', $line, $m);
+ $reslines = explode("\n", trim($m[1], '"'));
+ // re-parse (see below)
+ foreach ($reslines as $line) {
+ if (ord($line[0])<=32) {
+ $lines[$ln] .= (empty($lines[$ln])?'':"\n").trim($line);
+ } else {
+ $lines[++$ln] = trim($line);
+ }
+ }
}
/*
to the next valid header line.
*/
- $i = 0;
- $lines = array();
do {
$line = chop(iil_ReadLine($fp, 300), "\r\n");
- if (ord($line[0])<=32) {
- $lines[$i] .= (empty($lines[$i])?'':"\n").trim($line);
- } else {
- $i++;
- $lines[$i] = trim($line);
- }
- /*
- The preg_match below works around communigate imap, which outputs " UID <number>)".
- Without this, the while statement continues on and gets the "FH0 OK completed" message.
- If this loop gets the ending message, then the outer loop does not receive it from radline on line 1249.
- This in causes the if statement on line 1278 to never be true, which causes the headers to end up missing
- If the if statement was changed to pick up the fh0 from this loop, then it causes the outer loop to spin
- An alternative might be:
- if (!preg_match("/:/",$line) && preg_match("/\)$/",$line)) break;
- however, unsure how well this would work with all imap clients.
- */
+ // The preg_match below works around communigate imap, which outputs " UID <number>)".
+ // Without this, the while statement continues on and gets the "FH0 OK completed" message.
+ // If this loop gets the ending message, then the outer loop does not receive it from radline on line 1249.
+ // This in causes the if statement on line 1278 to never be true, which causes the headers to end up missing
+ // If the if statement was changed to pick up the fh0 from this loop, then it causes the outer loop to spin
+ // An alternative might be:
+ // if (!preg_match("/:/",$line) && preg_match("/\)$/",$line)) break;
+ // however, unsure how well this would work with all imap clients.
if (preg_match("/^\s*UID [0-9]+\)$/", $line)) {
break;
}
+
+ // handle FLAGS reply after headers (AOL, Zimbra?)
+ if (preg_match('/\s+FLAGS \((.*)\)\)$/', $line, $matches)) {
+ $flags_str = $matches[1];
+ break;
+ }
+
+ if (ord($line[0])<=32) {
+ $lines[$ln] .= (empty($lines[$ln])?'':"\n").trim($line);
+ } else {
+ $lines[++$ln] = trim($line);
+ }
// patch from "Maksim Rubis" <siburny@hotmail.com>
} while (trim($line[0]) != ')' && strncmp($line, $key, strlen($key)));
if (strncmp($line, $key, strlen($key))) {
- //process header, fill iilBasicHeader obj.
- // initialize
+ // process header, fill iilBasicHeader obj.
+ // initialize
if (is_array($headers)) {
reset($headers);
while (list($k, $bar) = each($headers)) {
}
}
- // create array with header field:data
+ // create array with header field:data
while ( list($lines_key, $str) = each($lines) ) {
list($field, $string) = iil_SplitHeaderLine($str);
} else {
$a = explode(' ', $line);
}
+
+ // process flags
+ if (!empty($flags_str)) {
+ $flags_str = eregi_replace('[\\\"]', '', $flags_str);
+ $flags_a = explode(' ', $flags_str);
+
+ if (is_array($flags_a)) {
+ reset($flags_a);
+ while (list(,$val)=each($flags_a)) {
+ if (strcasecmp($val,'Seen') == 0) {
+ $result[$id]->seen = true;
+ } else if (strcasecmp($val, 'Deleted') == 0) {
+ $result[$id]->deleted=true;
+ } else if (strcasecmp($val, 'Recent') == 0) {
+ $result[$id]->recent = true;
+ } else if (strcasecmp($val, 'Answered') == 0) {
+ $result[$id]->answered = true;
+ } else if (strcasecmp($val, '$Forwarded') == 0) {
+ $result[$id]->forwarded = true;
+ } else if (strcasecmp($val, 'Draft') == 0) {
+ $result[$id]->is_draft = true;
+ } else if (strcasecmp($val, '$MDNSent') == 0) {
+ $result[$id]->mdn_sent = true;
+ } else if (strcasecmp($val, 'Flagged') == 0) {
+ $result[$id]->flagged = true;
+ }
+ }
+ $result[$id]->flags = $flags_a;
+ }
+ }
}
} while (strcmp($a[0], $key) != 0);
return $result;
}
-function iil_C_FetchHeader(&$conn, $mailbox, $id, $uidfetch=false) {
+function iil_C_FetchHeader(&$conn, $mailbox, $id, $uidfetch=false, $bodystr=false) {
- $a = iil_C_FetchHeaders($conn, $mailbox, $id, $uidfetch);
+ $a = iil_C_FetchHeaders($conn, $mailbox, $id, $uidfetch, $bodystr);
if (is_array($a)) {
return array_shift($a);
}
$c = 0;
$query = 'srch1 SEARCH ' . chop($criteria);
- iil_PutLineC($fp, $query);
+ if (!iil_PutLineC($fp, $query)) {
+ return false;
+ }
do {
$line=trim(iil_ReadLine($fp, 10000));
if (eregi("^\* SEARCH", $line)) {
$line=iil_ReadLine($fp, 500);
if ($line[0] == '*') {
$line = rtrim($line);
- $a=iil_ExplodeQuotedString(' ', $line);
+ $a=iil_ExplodeQuotedString(' ', iil_UnEscape($line));
if ($a[0] == '*') {
$delimiter = str_replace('"', '', $a[count($a)-2]);
}
if (strlen($delimiter)>0) {
return $delimiter;
}
-
+
//if that fails, try namespace extension
//try to fetch namespace data
iil_PutLine($conn->fp, "ns1 NAMESPACE");
$line = iil_ReadLine($conn->fp, 1024);
if (iil_StartsWith($line, '* NAMESPACE')) {
$i = 0;
+ $line = iil_UnEscape($line);
$data = iil_ParseNamespace2(substr($line,11), $i, 0, 0);
}
} while (!iil_StartsWith($line, 'ns1', true));
return iil_ParseResult($line);
}
+function iil_C_FetchMIMEHeaders(&$conn, $mailbox, $id, $parts) {
+
+ $fp = $conn->fp;
+
+ if (!iil_C_Select($conn, $mailbox)) {
+ return false;
+ }
+
+ $result = false;
+ $parts = (array) $parts;
+ $key = 'fmh0';
+ $peeks = '';
+ $idx = 0;
+
+ // format request
+ foreach($parts as $part)
+ $peeks[] = "BODY[$part.MIME]";
+
+ $request = "$key FETCH $id (" . implode(' ', $peeks) . ')';
+
+ // send request
+ if (!iil_PutLine($fp, $request)) {
+ return false;
+ }
+
+ do {
+ $line = iil_ReadLine($fp, 1000);
+ $line = iil_MultLine($fp, $line);
+
+ if (preg_match('/BODY\[([0-9\.]+)\.MIME\]/', $line, $matches)) {
+ $idx = $matches[1];
+ $result[$idx] = preg_replace('/^(\* '.$id.' FETCH \()?\s*BODY\['.$idx.'\.MIME\]\s+/', '', $line);
+ $result[$idx] = trim($result[$idx], '"');
+ $result[$idx] = rtrim($result[$idx], "\t\r\n\0\x0B");
+ }
+ } while (!iil_StartsWith($line, $key, true));
+
+ return $result;
+}
+
function iil_C_FetchPartHeader(&$conn, $mailbox, $id, $part) {
$part = empty($part) ? 'HEADER' : $part.'.MIME';
- return iil_C_HandlePartBody($conn, $mailbox, $id, $part, 1);
+ return iil_C_HandlePartBody($conn, $mailbox, $id, $part, 1);
}
function iil_C_HandlePartBody(&$conn, $mailbox, $id, $part='', $mode=1, $file=NULL) {
$len = $to - $from;
$sizeStr = substr($line, $from, $len);
$bytes = (int)$sizeStr;
-
+ $prev = '';
+
while ($bytes > 0) {
$line = iil_ReadLine($fp, 1024);
$len = strlen($line);
}
$bytes -= strlen($line);
+ $line = rtrim($line, "\t\r\n\0\x0B");
+
if ($mode == 1) {
if ($file)
- fwrite($file, rtrim($line, "\t\r\n\0\x0B") . "\n");
+ fwrite($file, $line . "\n");
else
- $result .= rtrim($line, "\t\r\n\0\x0B") . "\n";
+ $result .= $line . "\n";
} else if ($mode == 2) {
- echo rtrim($line, "\t\r\n\0\x0B") . "\n";
+ echo $line . "\n";
} else if ($mode == 3) {
+ // create chunks with proper length for base64 decoding
+ $line = $prev.$line;
+ $length = strlen($line);
+ if ($length % 4) {
+ $length = floor($length / 4) * 4;
+ $prev = substr($line, $length);
+ $line = substr($line, 0, $length);
+ }
+ else
+ $prev = '';
+
if ($file)
fwrite($file, base64_decode($line));
else
--- /dev/null
+<?php
+/*
+ * tnef_decoder.php
+ * Graham Norbury <gnorbury@bondcar.com>
+ * (c) 2002 (GNU GPL - see ../../COPYING)
+ *
+ * Functions for decoding TNEF attachments in native PHP
+ *
+ * Adapted from original designs by:
+ * Thomas Boll <tb@boll.ch> [tnef.c]
+ * Mark Simpson <damned@world.std.com> [tnef-1.1.1]
+ *
+ */
+
+define("TNEF_SIGNATURE", 0x223e9f78);
+define("TNEF_LVL_MESSAGE", 0x01);
+define("TNEF_LVL_ATTACHMENT", 0x02);
+
+define("TNEF_STRING", 0x00010000);
+define("TNEF_TEXT", 0x00020000);
+define("TNEF_BYTE", 0x00060000);
+define("TNEF_WORD", 0x00070000);
+define("TNEF_DWORD", 0x00080000);
+
+define("TNEF_ASUBJECT", TNEF_DWORD | 0x8004);
+define("TNEF_AMCLASS", TNEF_WORD | 0x8008);
+define("TNEF_BODYTEXT", TNEF_TEXT | 0x800c);
+define("TNEF_ATTACHDATA", TNEF_BYTE | 0x800f);
+define("TNEF_AFILENAME", TNEF_STRING | 0x8010);
+define("TNEF_ARENDDATA", TNEF_BYTE | 0x9002);
+define("TNEF_AMAPIATTRS", TNEF_BYTE | 0x9005);
+define("TNEF_AVERSION", TNEF_DWORD | 0x9006);
+
+define("TNEF_MAPI_NULL", 0x0001);
+define("TNEF_MAPI_SHORT", 0x0002);
+define("TNEF_MAPI_INT", 0x0003);
+define("TNEF_MAPI_FLOAT", 0x0004);
+define("TNEF_MAPI_DOUBLE", 0x0005);
+define("TNEF_MAPI_CURRENCY", 0x0006);
+define("TNEF_MAPI_APPTIME", 0x0007);
+define("TNEF_MAPI_ERROR", 0x000a);
+define("TNEF_MAPI_BOOLEAN", 0x000b);
+define("TNEF_MAPI_OBJECT", 0x000d);
+define("TNEF_MAPI_INT8BYTE", 0x0014);
+define("TNEF_MAPI_STRING", 0x001e);
+define("TNEF_MAPI_UNICODE_STRING", 0x001f);
+define("TNEF_MAPI_SYSTIME", 0x0040);
+define("TNEF_MAPI_CLSID", 0x0048);
+define("TNEF_MAPI_BINARY", 0x0102);
+
+define("TNEF_MAPI_ATTACH_MIME_TAG", 0x370E);
+define("TNEF_MAPI_ATTACH_LONG_FILENAME", 0x3707);
+define("TNEF_MAPI_ATTACH_DATA", 0x3701);
+
+function tnef_getx($size, &$buf)
+{
+ $value = null;
+ if (strlen($buf) >= $size)
+ {
+ $value = substr($buf, 0, $size);
+ $buf = substr_replace($buf, '', 0, $size);
+ }
+ return $value;
+}
+
+function tnef_geti8(&$buf)
+{
+ $value = null;
+ if (strlen($buf) >= 1)
+ {
+ $value = ord($buf{0});
+ $buf = substr_replace($buf, '', 0, 1);
+ }
+ return $value;
+}
+
+function tnef_geti16(&$buf)
+{
+ $value = null;
+ if (strlen($buf) >= 2)
+ {
+ $value = ord($buf{0}) +
+ (ord($buf{1}) << 8);
+ $buf = substr_replace($buf, '', 0, 2);
+ }
+ return $value;
+}
+
+function tnef_geti32(&$buf)
+{
+ $value = null;
+ if (strlen($buf) >= 4)
+ {
+ $value = ord($buf{0}) +
+ (ord($buf{1}) << 8) +
+ (ord($buf{2}) << 16) +
+ (ord($buf{3}) << 24);
+ $buf = substr_replace($buf, '', 0, 4);
+ }
+ return $value;
+}
+
+function tnef_decode_attribute($attribute, &$buf)
+{
+ global $debug, $download;
+
+ $length = tnef_geti32($buf);
+ $value = tnef_getx($length, $buf); //data
+ tnef_geti16($buf); //checksum
+
+ if ($debug)
+ {
+ printf("ATTRIBUTE[%08x] %d bytes\n", $attribute, $length);
+ }
+
+ switch($attribute)
+ {
+ case TNEF_BODYTEXT:
+ if (!$download)
+ {
+ printf("<b>Embedded message:</b><pre>%s</pre>",$value);
+ }
+ break;
+
+ default:
+ }
+}
+
+function extract_mapi_attrs($buf, &$attachment_data)
+{
+ global $debug;
+
+ tnef_geti32($buf); // number of attributes
+ while(strlen($buf) > 0)
+ {
+ $value = null;
+ $length = 0;
+ $attr_type = tnef_geti16($buf);
+ $attr_name = tnef_geti16($buf);
+ if ($debug)
+ {
+ printf("mapi attribute: %04x:%04x\n", $attr_type, $attr_name);
+ }
+ switch($attr_type)
+ {
+ case TNEF_MAPI_SHORT:
+ $value = tnef_geti16($buf);
+ break;
+
+ case TNEF_MAPI_INT:
+ case TNEF_MAPI_BOOLEAN:
+ $value = tnef_geti32($buf);
+ break;
+
+ case TNEF_MAPI_FLOAT:
+ $value = tnef_getx(4, $buf);
+ break;
+
+ case TNEF_MAPI_DOUBLE:
+ case TNEF_MAPI_SYSTIME:
+ $value = tnef_getx(8, $buf);
+ break;
+
+ case TNEF_MAPI_STRING:
+ case TNEF_MAPI_UNICODE_STRING:
+ case TNEF_MAPI_BINARY:
+ case TNEF_MAPI_OBJECT:
+ $num_vals = tnef_geti32($buf);
+ for ($i = 0; $i < $num_vals; $i++) // usually just 1
+ {
+ $length = tnef_geti32($buf);
+ $buflen = $length + ((4 - ($length % 4)) % 4); // pad to next 4 byte boundary
+ $value = substr(tnef_getx($buflen, $buf), 0, $length); // read and truncate to length
+ }
+ break;
+
+ default:
+ if ($debug)
+ {
+ echo("Unknown mapi attribute!\n");
+ }
+ }
+
+ // store any interesting attributes
+ switch($attr_name)
+ {
+ case TNEF_MAPI_ATTACH_LONG_FILENAME: // used in preference to AFILENAME value
+ $attachment_data[0]['name'] = ereg_replace('.*[\/](.*)$', '\1', $value); // strip path
+ break;
+
+ case TNEF_MAPI_ATTACH_MIME_TAG: // Is this ever set, and what is format?
+ $attachment_data[0]['type0'] = ereg_replace('^(.*)/.*', '\1', $value);
+ $attachment_data[0]['type1'] = ereg_replace('.*/(.*)$', '\1', $value);
+ break;
+
+ case TNEF_MAPI_ATTACH_DATA:
+ tnef_getx(16, $value); // skip the next 16 bytes (unknown data)
+ array_shift($attachment_data); // eliminate the current (bogus) attachment
+ do_tnef_decode($value, $attachment_data); // recursively process the attached message
+ break;
+
+ default:
+ }
+ }
+}
+
+function tnef_decode_message(&$buf)
+{
+ global $debug;
+
+ if ($debug)
+ {
+ echo("MESSAGE ");
+ }
+
+ $attribute = tnef_geti32($buf);
+ tnef_decode_attribute($attribute, $buf);
+}
+
+function tnef_decode_attachment(&$buf, &$attachment_data)
+{
+ global $debug;
+
+ if ($debug)
+ {
+ echo("ATTACHMENT ");
+ }
+
+ $attribute = tnef_geti32($buf);
+ switch($attribute)
+ {
+ case TNEF_ARENDDATA: // marks start of new attachment
+ $length = tnef_geti32($buf);
+ tnef_getx($length, $buf);
+ tnef_geti16($buf); //checksum
+ if ($debug)
+ {
+ printf("ARENDDATA[%08x]: %d bytes\n", $attribute, $length);
+ }
+ // add a new default data block to hold details of this attachment
+ // reverse order is easier to handle later!
+ array_unshift($attachment_data, array('type0' => 'application',
+ 'type1' => 'octet-stream',
+ 'name' => 'unknown',
+ 'stream' => ''));
+ break;
+
+ case TNEF_AFILENAME: // filename
+ $length = tnef_geti32($buf);
+ $attachment_data[0]['name'] = ereg_replace('.*[\/](.*)$',
+ '\1',
+ tnef_getx($length, $buf)); // strip path
+ tnef_geti16($buf); //checksum
+ if ($debug)
+ {
+ printf("AFILENAME[%08x]: %s\n", $attribute, $attachment_data[0]['name']);
+ }
+ break;
+
+ case TNEF_ATTACHDATA: // the attachment itself
+ $length = tnef_geti32($buf);
+ $attachment_data[0]['size'] = $length;
+ $attachment_data[0]['stream'] = tnef_getx($length, $buf);
+ tnef_geti16($buf); //checksum
+ if ($debug)
+ {
+ printf("ATTACHDATA[%08x]: %d bytes\n", $attribute, $length);
+ }
+ break;
+
+ case TNEF_AMAPIATTRS:
+ $length = tnef_geti32($buf);
+ $value = tnef_getx($length, $buf);
+ tnef_geti16($buf); //checksum
+ if ($debug)
+ {
+ printf("AMAPIATTRS[%08x]: %d bytes\n", $attribute, $length);
+ }
+ extract_mapi_attrs($value, $attachment_data);
+ break;
+
+ default:
+ tnef_decode_attribute($attribute, $buf);
+ }
+}
+
+function do_tnef_decode(&$buf, &$attachment_data)
+{
+ global $debug;
+
+ $tnef_signature = tnef_geti32($buf);
+ if ($tnef_signature == TNEF_SIGNATURE)
+ {
+ $tnef_key = tnef_geti16($buf);
+ if ($debug)
+ {
+ printf("Signature: 0x%08x\nKey: 0x%04x\n", $tnef_signature, $tnef_key);
+ }
+
+ while (strlen($buf) > 0)
+ {
+ $lvl_type = tnef_geti8($buf);
+ switch($lvl_type)
+ {
+ case TNEF_LVL_MESSAGE:
+ tnef_decode_message($buf);
+ break;
+
+ case TNEF_LVL_ATTACHMENT:
+ tnef_decode_attachment($buf, $attachment_data);
+ break;
+
+ default:
+ if ($debug)
+ {
+ echo("Invalid file format!");
+ }
+ break 2;
+ }
+ }
+ }
+ else
+ {
+ if ($debug)
+ {
+ echo("Invalid file format!");
+ }
+ }
+}
+
+function tnef_decode($buf)
+{
+ global $debug;
+
+ $attachment_data = array();
+
+ if ($debug)
+ {
+ echo("<pre>");
+ }
+
+ do_tnef_decode($buf, $attachment_data);
+
+ if ($debug)
+ {
+ echo("</pre>");
+ }
+ return array_reverse($attachment_data);
+
+}
+
+?>
\ No newline at end of file
static $ignore_elements = array('html', 'head', 'body');
/* Allowed HTML attributes */
- static $html_attribs = array('name', 'class', 'title', 'alt', 'width', 'height', 'align', 'nowrap', 'col', 'row', 'id', 'rowspan', 'colspan', 'cellspacing', 'cellpadding', 'valign', 'bgcolor', 'color', 'border', 'bordercolorlight', 'bordercolordark', 'face', 'marginwidth', 'marginheight', 'axis', 'border', 'abbr', 'char', 'charoff', 'clear', 'compact', 'coords', 'vspace', 'hspace', 'cellborder', 'size', 'lang', 'dir', 'background');
+ static $html_attribs = array('name', 'class', 'title', 'alt', 'width', 'height', 'align', 'nowrap', 'col', 'row', 'id', 'rowspan', 'colspan', 'cellspacing', 'cellpadding', 'valign', 'bgcolor', 'color', 'border', 'bordercolorlight', 'bordercolordark', 'face', 'marginwidth', 'marginheight', 'axis', 'border', 'abbr', 'char', 'charoff', 'clear', 'compact', 'coords', 'vspace', 'hspace', 'cellborder', 'size', 'lang', 'dir');
/* State for linked objects in HTML */
public $extlinks = false;
$key = strtolower($key);
$value = $node->getAttribute($key);
if(isset($this->_html_attribs[$key]) ||
- ($key == 'href' && preg_match('/^(http|https|ftp|mailto):.*/i', $value)))
+ ($key == 'href' && preg_match('/^(http|https|ftp|mailto):.+/i', $value)))
$t .= ' ' . $key . '="' . htmlspecialchars($value, ENT_QUOTES) . '"';
else if($key == 'style' && ($style = $this->wash_style($value)))
$t .= ' style="' . $style . '"';
- else if($key == 'src' && strtolower($node->tagName) == 'img') { //check tagName anyway
+ else if($key == 'background' || ($key == 'src' && strtolower($node->tagName) == 'img')) { //check tagName anyway
if($src = $this->config['cid_map'][$value]) {
$t .= ' ' . $key . '="' . htmlspecialchars($src, ENT_QUOTES) . '"';
}
- else if(preg_match('/^(http|https|ftp):.*/i', $value)) {
+ else if(preg_match('/^(http|https|ftp):.+/i', $value)) {
if($this->config['allow_remote'])
$t .= ' ' . $key . '="' . htmlspecialchars($value, ENT_QUOTES) . '"';
else {
$this->extlinks = true;
if ($this->config['blocked_src'])
- $t .= ' src="' . htmlspecialchars($this->config['blocked_src'], ENT_QUOTES) . '"';
+ $t .= ' ' . $key . '="' . htmlspecialchars($this->config['blocked_src'], ENT_QUOTES) . '"';
}
}
} else
| language/ar_SA/labels.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Author: Ossama Khayat <okhayat@yahoo.com> |
+-----------------------------------------------------------------------+
-@version $Id: labels.inc 2115 2008-12-04 10:21:34Z alec $
+@version $Id: labels.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/ar_SA/messages.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Author: Ossama Khayat <okhayat@yahoo.com> |
+-----------------------------------------------------------------------+
-@version $Id: messages.inc 2102 2008-12-01 10:46:11Z yllar $
+@version $Id: messages.inc 2237 2009-01-17 01:55:39Z till $
*/
--- /dev/null
+<?php
+
+/*
+
++-----------------------------------------------------------------------+
+| language/ast/labels.inc |
+| |
+| Language file of the RoundCube Webmail client |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
+| Licensed under the GNU GPL |
+| |
++-----------------------------------------------------------------------+
+| Author: Mikel González <dangerous_piper@softastur.org> |
+| http://blogs.altuxa.com/gyg |
+| http://softastur.org |
++-----------------------------------------------------------------------+
+
+ @version $Id: labels.inc 2124 2009-02-02 03:55:53Z mikelg $
+
+*/
+
+$labels = array();
+
+// login page
+$labels['welcome'] = 'Bienllegáu a $product';
+$labels['username'] = 'Usuariu';
+$labels['password'] = 'Clave';
+$labels['server'] = 'Sirvidor';
+$labels['login'] = 'Entrar';
+
+// taskbar
+$labels['logout'] = 'Zarrar';
+$labels['mail'] = 'Corréu';
+$labels['settings'] = 'Preferencies personales';
+$labels['addressbook'] = 'Llibru de direiciones';
+
+// mailbox names
+$labels['inbox'] = 'Entrantes';
+$labels['drafts'] = 'Borradores';
+$labels['sent'] = 'Unviaos';
+$labels['trash'] = 'Papelera';
+$labels['junk'] = 'Puxarra';
+
+// message listing
+$labels['subject'] = 'Asuntu';
+$labels['from'] = 'De';
+$labels['to'] = 'Pa';
+$labels['cc'] = 'Copia';
+$labels['bcc'] = 'Bcc';
+$labels['replyto'] = 'Contestar a';
+$labels['date'] = 'Fecha';
+$labels['size'] = 'Tamañu';
+$labels['priority'] = 'Prioridá';
+$labels['organization'] = 'Organización';
+
+// aliases
+$labels['reply-to'] = $labels['replyto'];
+
+$labels['mailboxlist'] = 'Carpetes';
+$labels['messagesfromto'] = 'Mensaxes del $from a $to de $count';
+$labels['messagenrof'] = 'Mensaxe $nr de $count';
+
+$labels['moveto'] = 'mover pa...';
+$labels['download'] = 'baxar';
+
+$labels['filename'] = 'Nome del Ficheru';
+$labels['filesize'] = 'Tamañu del ficheru';
+
+$labels['preferhtml'] = 'Amosar HTML';
+$labels['htmlmessage'] = 'Mensaxe HTML';
+$labels['prettydate'] = 'Fecha prestosa';
+
+$labels['addtoaddressbook'] = 'Amestar al llibru de direiciones';
+
+// weekdays short
+$labels['sun'] = 'Dom';
+$labels['mon'] = 'Llu';
+$labels['tue'] = 'Mar';
+$labels['wed'] = 'Mie';
+$labels['thu'] = 'Xue';
+$labels['fri'] = 'Vie';
+$labels['sat'] = 'Sab';
+
+// weekdays long
+$labels['sunday'] = 'Domingu';
+$labels['monday'] = 'Llunes';
+$labels['tuesday'] = 'Martes';
+$labels['wednesday'] = 'Miércoles';
+$labels['thursday'] = 'Xueves';
+$labels['friday'] = 'Vienres';
+$labels['saturday'] = 'Sábadu';
+
+// months short
+$labels['jan'] = 'Xin';
+$labels['feb'] = 'Feb';
+$labels['mar'] = 'Mar';
+$labels['apr'] = 'Abr';
+$labels['may'] = 'May';
+$labels['jun'] = 'Xun';
+$labels['jul'] = 'Xnt';
+$labels['aug'] = 'Ago';
+$labels['sep'] = 'Set';
+$labels['oct'] = 'Och';
+$labels['nov'] = 'Pay';
+$labels['dec'] = 'Avi';
+
+// months long
+$labels['longjan'] = 'Xineru';
+$labels['longfeb'] = 'Febreru';
+$labels['longmar'] = 'Marzu';
+$labels['longapr'] = 'Abril';
+$labels['longmay'] = 'Mayu';
+$labels['longjun'] = 'Xunu';
+$labels['longjul'] = 'Xunetu';
+$labels['longaug'] = 'Agostu';
+$labels['longsep'] = 'Setiembre';
+$labels['longoct'] = 'Ochobre';
+$labels['longnov'] = 'Payares';
+$labels['longdec'] = 'Avientu';
+
+$labels['today'] = 'Güei';
+
+// toolbar buttons
+$labels['checkmail'] = 'Buscar mensaxes nuevos';
+$labels['writenewmessage'] = 'Facer un mensaxe nuevu';
+$labels['replytomessage'] = 'Contestar al mensaxe';
+$labels['replytoallmessage'] = 'Contestar a toos';
+$labels['forwardmessage'] = 'Reunviar mensaxe';
+$labels['deletemessage'] = 'Desaniciar mensaxe';
+$labels['movemessagetotrash'] = 'Mover mensaxe a la papelera';
+$labels['printmessage'] = 'Imprentar esti mensaxe';
+$labels['previousmessage'] = 'Amosar el mensaxe anterior';
+$labels['previousmessages'] = 'Amosar grupu de mensaxes anterior';
+$labels['firstmessage'] = 'Amosar primer mensaxe';
+$labels['firstmessages'] = 'Amosar primer grupu de mensaxes';
+$labels['nextmessage'] = 'Amosar el mensaxe siguiente';
+$labels['nextmessages'] = 'Amosar grupu de mensaxes que siguientes';
+$labels['lastmessage'] = 'Amosar l\'últimu mensaxe';
+$labels['lastmessages'] = 'Amosar l\'últimu grupu de mensaxes';
+$labels['backtolist'] = 'Tornar a la llista de mensaxes';
+$labels['viewsource'] = 'Amosar el códigu';
+$labels['markmessages'] = 'Marcar mensaxes';
+$labels['markread'] = 'Como lleíu';
+$labels['markunread'] = 'Como non lleíu';
+$labels['markflagged'] = 'Como marcáu';
+$labels['markunflagged'] = 'Como non marcáu';
+
+$labels['select'] = 'Escueye';
+$labels['all'] = 'Toos';
+$labels['none'] = 'Nengún';
+$labels['unread'] = 'Ensin lleer';
+$labels['flagged'] = 'Marcáu';
+$labels['unanswered'] = 'Ensin contestar';
+$labels['filter'] = 'Filtru';
+
+$labels['compact'] = 'Compautar';
+$labels['empty'] = 'Vaciar';
+$labels['purge'] = 'Desaniciar';
+
+$labels['quota'] = 'Espaciu en discu';
+$labels['unknown'] = 'desconocíu';
+$labels['unlimited'] = 'ensin llímite';
+
+$labels['quicksearch'] = 'Búsqueda rápida';
+$labels['resetsearch'] = 'Anovar la búsqueda';
+
+$labels['openinextwin'] = 'Abrir en una ventana nueva';
+
+// message compose
+$labels['compose'] = 'Escribir un mensaxe';
+$labels['savemessage'] = 'Guardar como borrador';
+$labels['sendmessage'] = 'Unviar el mensaxe yá';
+$labels['addattachment'] = 'Amestar un archivu';
+$labels['charset'] = 'Codificación';
+$labels['editortype'] = 'Tipo d\'editor';
+$labels['returnreceipt'] = 'Avisu de recibu';
+
+$labels['checkspelling'] = 'Revisar ortografía';
+$labels['resumeediting'] = 'Siguir cola edición';
+$labels['revertto'] = 'Desfacer a';
+
+$labels['attachments'] = 'Axuntos';
+$labels['upload'] = 'Xubir';
+$labels['close'] = 'Zarrar';
+
+$labels['low'] = 'Baxu';
+$labels['lowest'] = 'Mui baxu';
+$labels['normal'] = 'Normal';
+$labels['high'] = 'Altu';
+$labels['highest'] = 'Mui altu';
+
+$labels['nosubject'] = '(ensin asuntu)';
+$labels['showimages'] = 'Amosar imáxenes';
+$labels['alwaysshow'] = 'Amosar siempre les imáxenes de $sender';
+
+$labels['htmltoggle'] = 'HTML';
+$labels['plaintoggle'] = 'Testu';
+$labels['savesentmessagein'] = 'Guardar mensaxe unviau en';
+$labels['dontsave'] = 'Desanicialu';
+$labels['maxuploadsize'] = 'El tamañu másimu pa un ficheru ye $size';
+
+$labels['addcc'] = 'Amestar Cc';
+$labels['addbcc'] = 'Amestar Bcc';
+$labels['addreplyto'] = 'Amestar Rempuesta pa';
+
+// mdn
+$labels['mdnrequest'] = 'El qu\'unvia esti mensaxe quier que lo avises cuando lleas el corréu. ¿Quies avisalo?';
+$labels['receiptread'] = 'Avisu de llectura';
+$labels['yourmessage'] = 'Esto ye un avisu de llectura del to mensaxe';
+$labels['receiptnote'] = 'Nota: Esti avisu namás quier dicir que\'l to mensaxe amosośe nel equipu del receptor. Nun hai forma de garantizate que lo lleera o que pescanciara\'l to mensaxe.';
+
+// address boook
+$labels['name'] = 'Nome completu';
+$labels['firstname'] = 'Nome';
+$labels['surname'] = 'Apellíu';
+$labels['email'] = 'Corréu';
+
+$labels['addcontact'] = 'Amestar contautu nuevu';
+$labels['editcontact'] = 'Editar contautu';
+
+$labels['edit'] = 'Editar';
+$labels['cancel'] = 'Encaboxar';
+$labels['save'] = 'Guardar';
+$labels['delete'] = 'Desaniciar';
+
+$labels['newcontact'] = 'Facer un contautu nuevu';
+$labels['deletecontact'] = 'Desaniciar los contautos marcaos';
+$labels['composeto'] = 'Unviar mensaxe a';
+$labels['contactsfromto'] = 'Contautos $from a $to de $count';
+$labels['print'] = 'Imprentar';
+$labels['export'] = 'Esportar';
+$labels['exportvcards'] = 'Esportar contautos en formatu vCard';
+
+$labels['previouspage'] = 'Amosar grupu anterior';
+$labels['firstpage'] = 'Amosar primer grupu';
+$labels['nextpage'] = 'Amosar siguiente grupu';
+$labels['lastpage'] = 'Amosar l\'últimu grupu';
+
+$labels['groups'] = 'Grupos';
+$labels['personaladrbook'] = 'Direiciones personales';
+
+$labels['import'] = 'Importar';
+$labels['importcontacts'] = 'Importar contautos';
+$labels['importfromfile'] = 'Importar dende un ficheru:';
+$labels['importreplace'] = 'Trocar el llibru de direiciones enteru';
+$labels['importtext'] = 'Puedes xubir direcione d\'un llibr que yá tengas.<br/>Anguaño puedes importar direiciones en formatu <a href="http://ast.wikipedia.org/wiki/VCard">vCard</a>.';
+$labels['done'] = 'Fecho';
+
+// settings
+$labels['settingsfor'] = 'Configuración pa';
+
+$labels['preferences'] = 'Preferencies';
+$labels['userpreferences'] = 'Preferencies d\'usuariu';
+$labels['editpreferences'] = 'Editar preferencies d\'usuariu';
+
+$labels['identities'] = 'Identidaes';
+$labels['manageidentities'] = 'Remanar identidaes pa esta cuenta';
+$labels['newidentity'] = 'Identidad nueva';
+
+$labels['newitem'] = 'Nuevu';
+$labels['edititem'] = 'Editar';
+
+$labels['setdefault'] = 'Escoyer opción preferída';
+$labels['autodetect'] = 'Escoyer automáticamente';
+$labels['language'] = 'Idioma';
+$labels['timezone'] = 'Franxa horaria';
+$labels['pagesize'] = 'Fileres per páxina';
+$labels['signature'] = 'Firma';
+$labels['dstactive'] = 'Cambéu horariu';
+$labels['htmleditor'] = 'Facer el mensaxe n\'HTML';
+$labels['htmlsignature'] = 'Firma HTML';
+$labels['previewpane'] = 'Entever';
+$labels['skin'] = 'Estilu';
+$labels['logoutclear'] = 'Vaciar la papelera al zarrar la sesión';
+$labels['logoutcompact'] = 'Compautar la bandexa d\'entrada al zarrar la sesión';
+$labels['uisettings'] = 'Interfaz d\'usuariu';
+$labels['serversettings'] = 'Configuración del sirvidor';
+$labels['mailboxview'] = 'Vista del buzón';
+$labels['mdnrequests'] = 'Avisos d\'unvios';
+$labels['askuser'] = 'preguntar al usuariu';
+$labels['autosend'] = 'unviar de secute';
+$labels['ignore'] = 'ignoralos';
+$labels['readwhendeleted'] = 'Marcar el mensaxe como lleíu al desanicialu';
+$labels['flagfordeletion'] = 'Marcar el mensaxe pa desaniciase en cuenta de desanicialu dafechu';
+$labels['skipdeleted'] = 'Nun amosar los mensaxes desaniciaos';
+$labels['showremoteimages'] = 'Amosar imáxenes remotes';
+$labels['fromknownsenders'] = 'de contautos conocíos';
+$labels['always'] = 'siempre';
+$labels['showinlineimages'] = 'Amosar imáxenes axuntes embaxu\'l mensaxe';
+$labels['autosavedraft'] = 'Guardar borrador de secute';
+$labels['everynminutes'] = 'cada $n minutos';
+$labels['keepaliveevery'] = 'cada $n minutu/os';
+$labels['keepalive'] = 'Guetar mensaxes nuevos cada';
+$labels['never'] = 'nunca';
+$labels['messagesdisplaying'] = 'Vista de mensaxes';
+$labels['messagescomposition'] = 'Edición de mensaxes';
+$labels['mimeparamfolding'] = 'Nomes d\'axuntos';
+$labels['2231folding'] = 'Too RFC 2231 (Thunderbird)';
+$labels['miscfolding'] = 'RFC 2047/2231 (MS Outlook)';
+$labels['2047folding'] = 'Too RFC 2047 (otros)';
+$labels['advancedoptions'] = 'Opciones avanzaes';
+$labels['focusonnewmessage'] = 'Poner el focu nos mensaxes nuevos';
+$labels['checkallfolders'] = 'Guetar mensaxes nuevos en toles bandexes';
+
+$labels['folder'] = 'Bandexa';
+$labels['folders'] = 'Bandexes';
+$labels['foldername'] = 'Nome de bandexa';
+$labels['subscribed'] = 'Soscrita';
+$labels['messagecount'] = 'Mensaxes';
+$labels['create'] = 'Facer';
+$labels['createfolder'] = 'Facer una bandexa nueva';
+$labels['rename'] = 'Renomar';
+$labels['renamefolder'] = 'Renomar bandexa';
+$labels['deletefolder'] = 'Desaniciar bandexa';
+$labels['managefolders'] = 'Alministrar bandexes';
+$labels['specialfolders'] = 'Bandexes especiales';
+
+$labels['sortby'] = 'Ordenar por';
+$labels['sortasc'] = 'Orden ascendente';
+$labels['sortdesc'] = 'Orden descendente';
+
+// units
+$labels['B'] = 'B';
+$labels['KB'] = 'KB';
+$labels['MB'] = 'MB';
+$labels['GB'] = 'GB';
+
+//personalizau
+$labels['anu'] = date(Y);
+?>
--- /dev/null
+<?php
+
+/*
+
++-----------------------------------------------------------------------+
+| language/ast/messages.inc |
+| |
+| Language file of the RoundCube Webmail client |
+| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Licensed under the GNU GPL |
+| |
++-----------------------------------------------------------------------+
+| Author: Mikel González <dangerous_piper@softastur.org> |
+| http://blogs.altuxa.com/gyg |
+| http://softastur.org |
++-----------------------------------------------------------------------+
+
+ @version $Id: messages.inc 2036 2009-02-02 04:37:58Z mikelg $
+
+*/
+
+$messages = array();
+$messages['loginfailed'] = 'La clave nun val';
+$messages['cookiesdisabled'] = 'El to navegador nun acepta "cookies"';
+$messages['sessionerror'] = 'La to sesión nun val';
+$messages['imaperror'] = 'Fallu de conexón col sirvidor IMAP';
+$messages['nomessagesfound'] = 'Nun doi con mensaxes';
+$messages['loggedout'] = 'Zarraste la sesión.';
+$messages['mailboxempty'] = 'La to cuenta nun tien mensaxes';
+$messages['loading'] = 'Cargando...';
+$messages['loadingdata'] = 'Cargando datos...';
+$messages['checkingmail'] = 'A la gueta de mensaxes nuevos...';
+$messages['sendingmessage'] = 'Unviando mensaxe...';
+$messages['messagesent'] = 'Unviose\'l mensaxe';
+$messages['savingmessage'] = 'Guardar mensaxe...';
+$messages['messagesaved'] = 'El mensaxe guardóse en borradores';
+$messages['successfullysaved'] = 'Guardose correchamente';
+$messages['addedsuccessfully'] = 'El contautu amestose correchamente a la llibreta de direiciones';
+$messages['contactexists'] = 'Yá hai un contuaut con es direición de corréu';
+$messages['blockedimages'] = 'Pa protexer la to privacidá, torgáronse les imáxenes esternes n\'esti mensaxe';
+$messages['encryptedmessage'] = 'Esti ye un mensaxe cifráu y nun soi a amosalu.';
+$messages['nocontactsfound'] = 'Nun doi con nengún contautu';
+$messages['contactnotfound'] = 'Nun doi col contautu que pides';
+$messages['sendingfailed'] = 'Falló l\'unvio del mensaxe';
+$messages['senttooquickly'] = 'Por favor espera $sec segundu/os enantes d\'unviar esti mensaxe.';
+$messages['errorsavingsent'] = 'Di con un fallu al guardar el mensaxe';
+$messages['errorsaving'] = 'Falló al guardase';
+$messages['errormoving'] = 'Nun fui a mover el mensaxe';
+$messages['errordeleting'] = 'Nun fui a desaniciar el mensaxe';
+$messages['deletecontactconfirm'] = '¿Tas seguru de desaniciar los contautos que marcaste?';
+$messages['deletemessagesconfirm'] = '¿Tas seguru de desaniciar los mensaxes que marcaste?';
+$messages['deletefolderconfirm'] = '¿Tas seguru de desaniciar esta bandexa?';
+$messages['purgefolderconfirm'] = '¿Tas seguru de desaniciar tolos mensaxes d\'esta bandexa?';
+$messages['foldercreating'] = 'Faciendo la bandexa...';
+$messages['folderdeleting'] = 'Desaniciando la bandexa...';
+$messages['folderrenaming'] = 'Renomando la bandexa...';
+$messages['foldermoving'] = 'Moviendo la bandexa...';
+$messages['formincomplete'] = 'Tienes de rellenar tolos campos del formulariu';
+$messages['noemailwarning'] = 'Por favor, dame un corréu válidu';
+$messages['nonamewarning'] = 'Por favor, dame\'l to nome';
+$messages['nopagesizewarning'] = 'Por favor, dame un tamañu de páxina';
+$messages['nosenderwarning'] = 'Por favor dame un corréu dende donde unviar mesaxes';
+$messages['norecipientwarning'] = 'Por favor, dame polo menos un destinatariu';
+$messages['nosubjectwarning'] = 'El campo "Asuntu" ta vacíu. ¿Quiés rellenalu anguaño?';
+$messages['nobodywarning'] = '¿Quies unviar esti mensaxe ensin testu?';
+$messages['notsentwarning'] = 'Nun unvie\'l mensaxe. ¿Quies desanicialu?';
+$messages['noldapserver'] = 'Por favor, escueye un sirvidor LDAP pa buscar';
+$messages['nocontactsreturned'] = 'Nun di con nengún contautu';
+$messages['nosearchname'] = 'Por favor, dame un nome o una direición de corréu';
+$messages['searchsuccessful'] = 'Di con $nr mensaxes';
+$messages['searchnomatch'] = 'Nun di con nengún resultáu';
+$messages['searching'] = 'A la gueta...';
+$messages['checking'] = 'Comprobando...';
+$messages['nospellerrors'] = 'Nun di con errores ortográficos';
+$messages['folderdeleted'] = 'Desaniciose la bandexa correchamente';
+$messages['deletedsuccessfully'] = 'Desaniciose correchamente';
+$messages['converting'] = 'Desaniciando\'l formatu del mensaxe...';
+$messages['messageopenerror'] = 'Nun soi a baxer el mensaxe del sirvidor';
+$messages['fileuploaderror'] = 'Fallu al xubir ficheros';
+$messages['filesizeerror'] = 'El ficheru ye más grande de lo permitío ($size)';
+$messages['copysuccess'] = 'Copiaronse $nr direiciones correchamente';
+$messages['copyerror'] = 'Nun fui a copiar nenguna direición';
+$messages['sourceisreadonly'] = 'Esta direición ye de namái-llectura';
+$messages['errorsavingcontact'] = 'Nun fui a guardar la direición del contautu';
+$messages['movingmessage'] = 'Moviendo\'l mensaxe...';
+$messages['receiptsent'] = 'Unviose correchamente l\'avisu de llectura.';
+$messages['errorsendingreceipt'] = 'Nun fui a unviar l\'avisu de llectura.';
+$messages['nodeletelastidentity'] = 'Nun puedo desaniciar esa identidá porque ye la última.';
+$messages['addsubfolderhint'] = 'Esta bandexa va ser subandexa de la que ta marcada';
+$messages['forbiddencharacter'] = 'El nome de la bandexa tien un caráuter que nun val';
+$messages['selectimportfile'] = 'Por favor escueye el ficheru que quies xubir';
+$messages['addresswriterror'] = 'Nun puedo escribir nel llibru de direiciones qu\'escoyisti';
+$messages['importwait'] = 'Importando, dame un minutín...';
+$messages['importerror'] = 'Nun fui a importar. El ficheru qu\'escoyiste nun ye un ficheru vCard válidu.';
+$messages['importconfirm'] = '<b>Importaronse correchamente $inserted contautos, saltáronse $skipped entrase que yá esistíen</b>:<p><em>$names</em></p>';
+$messages['opnotpermitted'] = 'Nun tienes permisu pa facelo.';
+$messages['nofromaddress'] = 'Perdiose la direición de corréu de la identidá qu\'escoyisti';
+$messages['editorwarning'] = 'Si pases a editor en modu testu vas perder tol estilu aplicáu al mensaxe. ¿Tas seguru de que quies facelo?';
+
+?>
| language/az_AZ/labels.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| language/az_AZ/messages.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| language/bg/labels.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| language/bg/messages.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
--- /dev/null
+<?php
+
+/*
++-----------------------------------------------------------------------+
+| language/bn_BD/labels.inc |
+| |
+| Language file of the RoundCube Webmail client |
+| Copyright (C) 2008, RoundQube Dev. - Switzerland |
+| Licensed under the GNU GPL |
+| |
++-----------------------------------------------------------------------+
+| Author: |
++-----------------------------------------------------------------------+
+
+*/
+
+$labels = array();
+$labels['welcome'] = 'স্বাগতম';
+$labels['username'] = 'গ্রাহক নাম (username)';
+$labels['password'] = 'গোপোন শব্দ (password)';
+$labels['server'] = 'সারভার';
+$labels['login'] = 'প্রবেশ';
+$labels['logout'] = 'প্রস্থান';
+$labels['mail'] = 'ই-মেইল';
+$labels['settings'] = 'ব্যাক্তিগত খুটিনাটি';
+$labels['addressbook'] = 'ঠিকানার বই';
+$labels['inbox'] = 'প্রধান বাক্স';
+$labels['drafts'] = 'খসড়া';
+$labels['sent'] = 'প্রেরিত(পাঠানো মেইল)';
+$labels['trash'] = 'ডাস্টবিন';
+$labels['junk'] = 'আজেবাজে মেইল';
+$labels['subject'] = 'বিষয়';
+$labels['from'] = 'প্রেরক';
+$labels['to'] = 'প্রাপক';
+$labels['cc'] = 'অনুলিপির ঠিকানা';
+$labels['bcc'] = 'নাজানিয়ে অনুলিপির ঠিকানা';
+$labels['replyto'] = 'উত্তর পাঠানোর ঠিকানা';
+$labels['date'] = 'তারিখ';
+$labels['size'] = 'সাইজ';
+$labels['priority'] = 'গুরুত্ব';
+$labels['organization'] = 'কোম্পানি';
+$labels['reply-to'] = 'প্রতি উত্তর';
+$labels['mailboxlist'] = 'মেইল বক্স তালিকা';
+$labels['messagesfromto'] = '$count মেইলের মধ্যে, $from হতে $to দেখানো হচ্ছে ';
+$labels['messagenrof'] = '$nr #মেইল/চিঠি , $count এর মধ্যে';
+$labels['moveto'] = 'সরিয়ে ফেলুন..';
+$labels['download'] = 'ডাউনলোড';
+$labels['filename'] = 'ফাইলের নাম';
+$labels['filesize'] = 'ফাইলের সাইজ';
+$labels['preferhtml'] = 'HTML এ দেখি';
+$labels['htmlmessage'] = 'HTML মেইল/চিঠি';
+$labels['prettydate'] = 'তারিখ ভালো করে দেখা যাবে';
+$labels['addtoaddressbook'] = 'ঠিকানার বইতে ঢুকান';
+$labels['sun'] = 'রবি';
+$labels['mon'] = 'সোম';
+$labels['tue'] = 'মঙ্গল';
+$labels['wed'] = 'বুধ';
+$labels['thu'] = 'বৃহ:';
+$labels['fri'] = 'শুক্র';
+$labels['sat'] = 'শনি';
+$labels['sunday'] = 'রবিবার';
+$labels['monday'] = 'সোমবার';
+$labels['tuesday'] = 'মঙ্গলবার';
+$labels['wednesday'] = 'বুধবার';
+$labels['thursday'] = 'বৃহস্পতিবার';
+$labels['friday'] = 'শুক্রবার';
+$labels['saturday'] = 'শনিবার';
+$labels['jan'] = 'জানুয়ারি';
+$labels['feb'] = 'ফেব্রুয়ারি';
+$labels['mar'] = 'মার্চ';
+$labels['apr'] = 'এপ্রিল';
+$labels['may'] = 'মে';
+$labels['jun'] = 'জুন';
+$labels['jul'] = 'জুলাই';
+$labels['aug'] = 'আগস্ট';
+$labels['sep'] = 'সেপ্তেমবার';
+$labels['oct'] = 'অষ্টবার';
+$labels['nov'] = 'নবেমবার';
+$labels['dec'] = 'দিশেমবার';
+$labels['longjan'] = 'জানুয়ারি';
+$labels['longfeb'] = 'ফেব্রুয়ারি';
+$labels['longmar'] = 'মার্চ';
+$labels['longapr'] = 'এপ্রিল';
+$labels['longmay'] = 'মে';
+$labels['longjun'] = 'জুন';
+$labels['longjul'] = 'জুলাই';
+$labels['longaug'] = 'আগস্ট';
+$labels['longsep'] = 'সেপ্তেমবার (September)';
+$labels['longoct'] = 'অষ্টবার (October)';
+$labels['longnov'] = 'নবেমবার (November)';
+$labels['longdec'] = 'দিশেমবার (December)';
+$labels['today'] = 'আজকে';
+$labels['checkmail'] = 'দেখুন নতুন কোনো মেইল/চিঠি এলো কিনা ';
+$labels['writenewmessage'] = 'নতুন মেইল/চিঠি লিখুন';
+$labels['replytomessage'] = 'শুধু প্রেরকের কাছে উত্তর পাঠান';
+$labels['replytoallmessage'] = 'প্রেরক ও এই চিঠির অন্যান্য প্রাপকদের কাছে উত্তর পাঠান';
+$labels['forwardmessage'] = 'মেইল/চিঠি এগিয়ে দিন ';
+$labels['deletemessage'] = 'মেইল/চিঠি ছিড়ে ফেলুন';
+$labels['movemessagetotrash'] = 'মেইল/চিঠি ডাস্টবিনে ফেলুন';
+$labels['printmessage'] = 'মেইল/চিঠি প্রিন্ট করুন';
+$labels['previousmessage'] = 'আগের মেইল/চিঠিটি দেখুন';
+$labels['previousmessages'] = 'আগের মেইল/চিঠি গুলো দেখুন';
+$labels['firstmessage'] = 'প্রথম মেইল/চিঠিটি দেখুন';
+$labels['firstmessages'] = 'প্রথম মেইল/চিঠি গুলো দেখুন';
+$labels['nextmessage'] = 'পরের মেইল/চিঠিটি দেখুন';
+$labels['nextmessages'] = 'পরের মেইল/চিঠিগুলি দেখুন';
+$labels['lastmessage'] = 'শেষ মেইল/চিঠিটি দেখুন';
+$labels['lastmessages'] = 'শেষের দিকের মেইল/চিঠিগুলি দেখুন';
+$labels['backtolist'] = 'মেইল/চিঠির তালিকায় ফিরে যান';
+$labels['viewsource'] = 'মূল উৎসদেখুন';
+$labels['markmessages'] = 'মেইল/চিঠি (গুলো)';
+$labels['markread'] = 'পড়া শেষ (read)';
+$labels['markunread'] = 'নাদেখা (unread)';
+$labels['markflagged'] = 'দাগানো (flagged)';
+$labels['markunflagged'] = 'দাগহীন (unflagged)';
+$labels['select'] = 'বেছেনিন';
+$labels['all'] = 'সবগুলো';
+$labels['none'] = 'কোনোটাই না';
+$labels['unread'] = 'নাদেখা (unread)';
+$labels['flagged'] = 'দাগানো (flagged)';
+$labels['unanswered'] = 'উত্তর না দেওয়া গুলো';
+$labels['filter'] = 'ছাকনি';
+$labels['compact'] = 'টাইটকরুন';
+$labels['empty'] = 'খালিকরুন';
+$labels['purge'] = 'Purge';
+$labels['quota'] = 'ডিস্ক এ খালি যায়গা';
+$labels['unknown'] = 'অজানা';
+$labels['unlimited'] = 'সীমাহীন';
+$labels['quicksearch'] = 'ঝটকরে খোজা';
+$labels['resetsearch'] = 'নতুনকরে খুজুন';
+$labels['openinextwin'] = 'নতুন উইন্ডো তে দেখুন';
+$labels['compose'] = 'নতুন মেইল/চিঠি লিখুন';
+$labels['savemessage'] = 'খসড়া হিসাবে জমা করে রাখুন';
+$labels['sendmessage'] = 'এখুনি মেইল / চিঠিটি পাঠান';
+$labels['addattachment'] = 'একটা ফাইল জুড়ে দিন চিঠির সাথে';
+$labels['charset'] = 'Charset';
+$labels['editortype'] = 'Editor type';
+$labels['returnreceipt'] = 'ফিরতি রসিদ';
+$labels['checkspelling'] = 'Check spelling';
+$labels['resumeediting'] = 'Resume editing';
+$labels['revertto'] = 'Revert to';
+$labels['attachments'] = 'জুড়ে দেওয়া ফাইল (Attachments)';
+$labels['upload'] = 'উঠায় দেন';
+$labels['close'] = 'বন্ধ করুন';
+$labels['low'] = 'Low';
+$labels['lowest'] = 'Lowest';
+$labels['normal'] = 'Normal';
+$labels['high'] = 'High';
+$labels['highest'] = 'Highest';
+$labels['nosubject'] = '(বিষয়হীন)';
+$labels['showimages'] = 'ছবি দেখান';
+$labels['alwaysshow'] = 'সবসময় $sender এর কাছে থেকে পাওয়া ছবিগুলো দেখানো হোক';
+$labels['htmltoggle'] = 'HTML';
+$labels['plaintoggle'] = 'খালি লেখা দেখুন';
+$labels['savesentmessagein'] = 'পাঠানো চিঠি/মেইল জমা করুন >>';
+$labels['dontsave'] = 'জমিয়ে রাখা লাগবে না';
+$labels['maxuploadsize'] = 'ফাইল উঠানোর সর্বোচ্চ সাইজ $size';
+$labels['addcc'] = 'অনুলিপির ঠিকানা ঢুকান';
+$labels['addbcc'] = 'নাজানিয়ে অনুলিপির ঠিকানা ঢুকান';
+$labels['addreplyto'] = 'উত্তর পাঠানোর ঠিকানা ঢুকান';
+$labels['mdnrequest'] = 'প্রাপক আপনার কাছে মেইল/চিঠিটা যে পেয়েছেন তার ফিরতি রসিদ চেয়েছেন। আপনি কি ফিরতি রসিদ টা পাঠাবেন?';
+$labels['receiptread'] = 'মেইল/চিঠি যে পেয়েছেন তার ফিরতি রসিদ';
+$labels['yourmessage'] = 'নিচে রয়েছে আপনার চিঠিটা যে প্রাপক পেয়েছেন তার রসিদ';
+$labels['receiptnote'] = 'এই রসিদ খালি এতটুকু প্রমান করে যে প্রাপক চিঠিটি পেয়েছেন। কিন্তু তিনি ঠিকমতো পড়তে পেরেছেন কিনা অথবা তিনি পড়ে বুঝতে পেরেছেন কিনা তার কোনো প্রমান নেই।';
+$labels['name'] = 'নাম';
+$labels['firstname'] = 'নামের প্রথমাংশ';
+$labels['surname'] = 'নামের শেষাংশ';
+$labels['email'] = 'ই-মেইল/চিঠি';
+$labels['addcontact'] = 'নতুন ঠিকানা ঢুকান';
+$labels['editcontact'] = 'একটা ঠিকানা বদলান';
+$labels['edit'] = 'বদলান';
+$labels['cancel'] = 'বাতিল';
+$labels['save'] = 'জমা দিন';
+$labels['delete'] = 'ফেলে দিন';
+$labels['newcontact'] = 'একটা নতুন ঠিকানার কার্ড বানান';
+$labels['deletecontact'] = 'বেছে নেওয়া ঠিকানা গুলো ফেলে দিন';
+$labels['composeto'] = 'চিঠি পাঠাবেন কার কাছে?';
+$labels['contactsfromto'] = '$count ঠিকানার মধ্যে $from থেকে $to টা';
+$labels['print'] = 'প্রিন্ট করুন';
+$labels['export'] = 'রপ্তানি করুন';
+$labels['exportvcards'] = 'রপ্তানি করুন vCard আকারে';
+$labels['previouspage'] = 'আগের গুলো দেখান';
+$labels['firstpage'] = 'প্রথম গুলো দেখান';
+$labels['nextpage'] = 'পরের গুলো দেখান';
+$labels['lastpage'] = 'শেষের গুলো দেখান';
+$labels['groups'] = 'গ্রুপ';
+$labels['personaladrbook'] = 'নিজের ঠিকানা';
+$labels['import'] = 'আমদানি করুন';
+$labels['importcontacts'] = 'ঠিকানা আমদানি করুন';
+$labels['importfromfile'] = 'ফাইলের থেকে ঠিকানা আমদানি করুন';
+$labels['importreplace'] = 'পুরো ঠিকানার বইটি খালি করে নতুন ঠিকানা গুলো ভরুন';
+$labels['importtext'] = 'আপনি অন্য কোনো ঠিকানার বই (address book) আমাদের এখানে তুলতে পারেন। <br/>আমরা বর্তমানে <a href="http://en.wikipedia.org/wiki/VCard">vCard</a> আকারে খালি ঠিকানা তুলতে পারি।';
+$labels['done'] = 'শেষ';
+$labels['settingsfor'] = 'খুটিনাটি';
+$labels['preferences'] = 'পছন্দ';
+$labels['userpreferences'] = 'গ্রাহক পছন্দ';
+$labels['editpreferences'] = 'গ্রাহক পছন্দ বদলান';
+$labels['identities'] = 'পরিচিতি';
+$labels['manageidentities'] = 'এই অ্যাকউন্টের "পরচিতি" বদলান';
+$labels['newidentity'] = 'নতুন পরিচিতি';
+$labels['newitem'] = 'নতুন জিনিষ';
+$labels['edititem'] = 'জিনিষ বদলান';
+$labels['setdefault'] = 'এইটাই আসল';
+$labels['autodetect'] = 'কম্পুটার নিজেনিজি বেছে নেবে';
+$labels['language'] = 'ভাষা';
+$labels['timezone'] = 'সময়ভিত্তিক এলাকা';
+$labels['pagesize'] = 'প্রতি পৃষ্ঠায় লাইন সংখ্যা';
+$labels['signature'] = 'স্বাক্ষর';
+$labels['dstactive'] = 'Daylight saving time';
+$labels['htmleditor'] = 'HTML এ মেইল/চিঠি লিখুন';
+$labels['htmlsignature'] = 'HTML এ স্বাক্ষর';
+$labels['previewpane'] = 'ছোটোকরে দেখার জায়গা';
+$labels['skin'] = 'মেইলবক্স এর পুরোটার চেহারা';
+$labels['logoutclear'] = 'বেরহবার সময় ডাস্টবিন অটোমেটিক খালি হবে';
+$labels['logoutcompact'] = 'বেরহবার সময় প্রধান বাক্স অটোমেটিক টাইট হবে';
+$labels['uisettings'] = 'কম্পুটারের চেহারা';
+$labels['serversettings'] = 'সারভার এর খুটিনাটি';
+$labels['mailboxview'] = 'মেইলবক্স দেখার কায়দা';
+$labels['mdnrequests'] = 'প্রেরক নোটিশ পাঠালে কি করা হবে?';
+$labels['askuser'] = 'আমি গ্রাহক, আমাকে জিজ্ঞাসা করুন';
+$labels['autosend'] = 'কম্পুটার নিজেনিজি ফিরতি নোটিশ পাঠায় দেবে';
+$labels['ignore'] = 'পাত্তা দেওয়া হবেনা';
+$labels['readwhendeleted'] = 'ফেলে দেবার সময় মেইল/চিঠি পড়া হয়ে গেছে হিসাবে ধরে নেওয়া হবে';
+$labels['flagfordeletion'] = 'একেবারেই ফেলে না দিয়ে মেইল/চিঠি গুলোকে দাগিয়ে রাখুন ফেলে দেবার জন্যে';
+$labels['skipdeleted'] = 'ফেলে দেওয়া মেইল/চিঠি দেখানোর দরকার নেই';
+$labels['showremoteimages'] = 'মেইলে অন্য ওয়েবসাইট থেকে আসা ছবি থাকলে তা দেখা যাবে';
+$labels['fromknownsenders'] = 'পরিচিত প্রেরক এর ক্ষেত্রে';
+$labels['always'] = 'সবসময়';
+$labels['showinlineimages'] = 'মেইলের সাথে জোড়া লাগানো ছবি, মেইলের নিচে দেখা যাবে';
+$labels['autosavedraft'] = 'নিজেনিজি খসড়া জমা হয়ে যাবে';
+$labels['everynminutes'] = 'প্রতি $n মিনিটে';
+$labels['keepaliveevery'] = 'প্রতি $n মিনিটে';
+$labels['keepalive'] = 'নতুন মেইল/চিঠি এসেছে কিনা তা দেখা হবে,';
+$labels['never'] = 'কখোনোই না';
+$labels['messagesdisplaying'] = 'মেইল/চিঠি দেখা যাচ্ছে';
+$labels['messagescomposition'] = 'মেইল/চিঠি লেখা হচ্ছে';
+$labels['mimeparamfolding'] = 'জুড়ে দেওয়া জিনিষের নাম';
+$labels['2231folding'] = 'Full RFC 2231 (Thunderbird)';
+$labels['miscfolding'] = 'RFC 2047/2231 (MS Outlook)';
+$labels['2047folding'] = 'Full RFC 2047 (other)';
+$labels['advancedoptions'] = 'জটিল বিষয়';
+$labels['focusonnewmessage'] = 'নতুন মেইল এলেই তা হাইলাইট হয়ে যাবে';
+$labels['checkallfolders'] = 'সবগুলো মেইলবক্সে নতুন চিঠি খোজা হবে';
+$labels['folder'] = 'ফোল্ডার/মেইলবক্স';
+$labels['folders'] = 'ফোল্ডার/মেইলবক্স';
+$labels['foldername'] = 'ফোল্ডার/মেইলবক্স এর নাম';
+$labels['subscribed'] = 'গ্রহনকারি(Subscribed) ';
+$labels['messagecount'] = 'মেইল/চিঠি';
+$labels['create'] = 'প্রস্তুত করুন';
+$labels['createfolder'] = 'নতুন ফোল্ডার / মেইলবক্স প্রস্তুত করুন';
+$labels['rename'] = 'নাম বদলান';
+$labels['renamefolder'] = 'ফোল্ডার/মেইলবক্স এর নাম বদলান';
+$labels['deletefolder'] = 'ফোল্ডার/মেইলবক্স ফেলে দিন';
+$labels['managefolders'] = 'ফোল্ডার/মেইলবক্স গুলো কে গুছান';
+$labels['specialfolders'] = 'বিশেষ ফোল্ডার/মেইলবক্স';
+$labels['sortby'] = 'সাজান';
+$labels['sortasc'] = 'কম থেকে বেশি হিসাবে সাজান';
+$labels['sortdesc'] = 'বেশি থেকে কম হিসাবে সাজান';
+$labels['B'] = 'বাইট';
+$labels['KB'] = 'কিলোবাইট';
+$labels['MB'] = 'মেগাবাইট';
+$labels['GB'] = 'গিগাবাইট';
+
+?>
--- /dev/null
+<?php
+
+/*
++-----------------------------------------------------------------------+
+| language/bn_BD/messages.inc |
+| |
+| Language file of the RoundCube Webmail client |
+| Copyright (C) 2008, RoundQube Dev. - Switzerland |
+| Licensed under the GNU GPL |
+| |
++-----------------------------------------------------------------------+
+| Author: |
++-----------------------------------------------------------------------+
+
+*/
+
+$messages = array();
+$messages['loginfailed'] = 'ঢোকা গেল না';
+$messages['cookiesdisabled'] = 'আপনার ব্রাউজার, কুকি গ্রহন করে না';
+$messages['sessionerror'] = 'আপনার সেশন শেষ';
+$messages['imaperror'] = 'মেইল সারভার এর সাথে যোগাযোগ করা গেল না';
+$messages['nomessagesfound'] = 'এই মেইলবক্সে কোনো চিঠি নাই';
+$messages['loggedout'] = 'আপনের সেশন ঠিকঠাক মতো শেষ হইছে। শুভবিদায়।';
+$messages['mailboxempty'] = 'মেইলবক্স খালি';
+$messages['loading'] = 'কম্পুটার কাজ করতেছে . .';
+$messages['loadingdata'] = 'কম্পুটার তথ্য আনছে আপনার জন্য..';
+$messages['checkingmail'] = 'নতুন চিঠি আসছে কিনা তা দেখা হচ্ছে';
+$messages['sendingmessage'] = 'চিঠি পাঠায় দেওয়া হচ্ছে';
+$messages['messagesent'] = 'চিঠি ঠিকঠাকমতো পাঠানো শেষ';
+$messages['savingmessage'] = 'চিঠি জমা করে রাখা হচ্ছে';
+$messages['messagesaved'] = 'চিঠি খসড়া হিসাবে জমা করে রাখা হয়েছে';
+$messages['successfullysaved'] = 'ঠিকঠাকমতো জমা হয়ে গিয়েছে';
+$messages['addedsuccessfully'] = 'নতুন ঠিকানা ঠিকঠাক মতো ঢোকানো হয়ে গেছে';
+$messages['contactexists'] = 'একই ই-মেইল এ আরেকটা নাম ঠিকানা তালিকায় আছে';
+$messages['blockedimages'] = 'আপনার গোপনীয়তা রক্ষার জন্য আমরা ছবি গুলো সরিয়ে রেখেছি';
+$messages['encryptedmessage'] = 'এটা একটি গোপন (encrypted) চিঠি। এটা আপনাকে দেখানো যাবে না। দু্ঃখিত।';
+$messages['nocontactsfound'] = 'কোনো ঠিকানা পাওয়া গেলনা। দু্ঃখিত।';
+$messages['contactnotfound'] = 'আপনি যে ঠিকানা খুজছেন সেটা পাওয়া গেল না';
+$messages['sendingfailed'] = 'চিঠি পাঠানো গেলনা';
+$messages['senttooquickly'] = 'এই চিঠি পাঠানোর আগে, দয়া করে $sec সেকেন্ড ';
+$messages['errorsavingsent'] = 'প্রেরিত চিঠি হিসাবে জমা রাখার সময় একটা ঝামেলা হয়েছে';
+$messages['errorsaving'] = 'জমা করার সময় একটা ঝামেলা হয়েছে';
+$messages['errormoving'] = 'চিঠিটা সরানো গেলো না';
+$messages['errordeleting'] = 'চিঠিটা ফেলানো গেলো না';
+$messages['deletecontactconfirm'] = 'আপনি কি আসলেই এই ঠিকানা(গুলো) ফেলো দিতে চান?';
+$messages['deletemessagesconfirm'] = 'আপনি কি আসলেই এই চিঠি(গুলো) ফেলো দিতে চান?';
+$messages['deletefolderconfirm'] = 'আপনি কি আসলেই এই ফোল্ডার/মেইলবক্স ফেলো দিতে চান?';
+$messages['purgefolderconfirm'] = 'আপনি কি আসলেই এই ফোল্ডার/মেইলবক্স এর সব চিঠি ফেলো দিতে চান?';
+$messages['foldercreating'] = 'ফোল্ডার/মেইলবক্স প্রস্তুত করা হচ্ছে';
+$messages['folderdeleting'] = 'ফোল্ডার/মেইলবক্স ফেলে দেওয়া হচ্ছে';
+$messages['folderrenaming'] = 'ফোল্ডার/মেইলবক্স এর নাম বদলানো হচ্ছে';
+$messages['foldermoving'] = 'ফোল্ডার/মেইলবক্স সরানো হচ্ছে';
+$messages['formincomplete'] = 'আপনি সবগুলো জিনিষ লেখেননি';
+$messages['noemailwarning'] = 'একটি সঠিক ই-মেইল লিখুন';
+$messages['nonamewarning'] = 'দয়া করে নামটি লিখুন';
+$messages['nopagesizewarning'] = 'দয়া করে পৃষ্ঠার সাইজটি লিখুন';
+$messages['nosenderwarning'] = 'দয়া করে ফিরতি ই-মেইলটা লিখুন';
+$messages['norecipientwarning'] = 'দয়া করে একজন প্রাপক এর ই-মেইলটা লিখুন';
+$messages['nosubjectwarning'] = 'বিষয় হিসাবে কিছু লেখা হয়নি, আপনি কি কিছু লিখবেন এখন বিষয় হিসাবে?';
+$messages['nobodywarning'] = 'কোনো কিছু না লিখেই এই চিঠি পাঠিয়ে দেবেন?';
+$messages['notsentwarning'] = 'চিঠি পাঠানো হয়নি। চিঠিটা কি বাতিল করে দেবেন?';
+$messages['noldapserver'] = 'দয়া করে একটি এল্ডাপ সারভার বেছে নিন সার্চ করার জন্যে';
+$messages['nocontactsreturned'] = 'কোনো ঠিকানা পাওয়া গেলনা। দু্ঃখিত।';
+$messages['nosearchname'] = 'দয়া করে একজনের নাম অথবা ই-মেইল লিখুন';
+$messages['searchsuccessful'] = '$nr টা চিঠি পাওয়া গেছে';
+$messages['searchnomatch'] = 'খুজে কিছু পাওয়া গেলোনা';
+$messages['searching'] = 'খুজছি ....';
+$messages['checking'] = 'দেখছি ...';
+$messages['nospellerrors'] = 'No spelling errors found';
+$messages['folderdeleted'] = 'ফোল্ডার/মেইলবক্স ঠিকঠাকমতো ফেলানো হয়ে গেছে';
+$messages['deletedsuccessfully'] = 'ঠিকঠাকমতো ফেলানো হয়ে গেছে';
+$messages['converting'] = 'বিন্যাস (formatting) সরানো হচ্ছে ..';
+$messages['messageopenerror'] = 'সারভার থেকে চিঠি আনা গেলোনা';
+$messages['fileuploaderror'] = 'ফাইলটা সারভারে উঠানো গেলোনা';
+$messages['filesizeerror'] = 'যে ফাইলটা উঠানোর চেষ্টা করলেন সেটি সর্বোচ্চ সাইজ $size এর থেকে বেশি';
+$messages['copysuccess'] = 'ঠিকঠাকমতো $nr ঠিকানা নকল করে নেওয়া গেছে';
+$messages['copyerror'] = 'কোনো ঠিকানা তোলা গেলোনা';
+$messages['sourceisreadonly'] = 'এইঠিকানাটা খালি পড়ার জন্যে';
+$messages['errorsavingcontact'] = 'ঠিকানা জমা রাখা গেলোনা';
+$messages['movingmessage'] = 'চিঠি সরানো হচ্ছে..';
+$messages['receiptsent'] = 'ঠিকঠাক মতো ফিরতি রশিদ পাঠানো হয়েছে';
+$messages['errorsendingreceipt'] = 'রশিদ পাঠানো গেলোনা';
+$messages['nodeletelastidentity'] = 'আপনি এই পরিচিতি ফেলতে পারবেন না কারন এইটায় বর্তমানে আপনার একমাত্র পরিচিতি। ';
+$messages['addsubfolderhint'] = 'এই ফোল্ডারটি বর্তমান ফোল্ডার এর সাব-ফোল্ডার হিসাবে তৈরি হবে';
+$messages['forbiddencharacter'] = 'ফোল্ডার এর নামের মধ্যে নিষিদ্ধ অক্ষর আছে';
+$messages['selectimportfile'] = 'একটা ফাইল বেছে নিন তোলার জন্য';
+$messages['addresswriterror'] = 'বেছে নেওয়া ঠিকানার বইটিতে লেখাযায় না';
+$messages['importwait'] = 'আমদানি করা হচ্ছে। একটু অপেক্ষা করুন...';
+$messages['importerror'] = 'আমদানি করা গেলোনা। আপনি যে ফাইলটা তুলেছেন সেটা সঠিক vCard ফাইল নয়।';
+$messages['importconfirm'] = '<b>ঠিকমতো $inserted ঠিকানা আমদানি করা গেছে, $skipped ঠিকানা আগের থেকেই ছিলো বলে তাদের টা যা ছিলো তাই রাখা হয়েছে</b>:<p><em>$names</em></p>';
+$messages['opnotpermitted'] = 'এই কাজটা করার অনুমতি নাই আপনার';
+$messages['nofromaddress'] = 'বেছে নেওয়া যে পরিচিতিটা, তাতে ই-মেইল নেই';
+$messages['editorwarning'] = 'যদি আপনি শুধু লেখার স্টাইলে যান তাহলে বর্তমানের কোনো বিন্যাস হারিয়ে যাবে';
+
+?>
| language/bs_BA/labels.inc |
| |
| Language file of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Author: Begzudin Omerovic <Begzudin.Omerovic@gmail.com> |
+-----------------------------------------------------------------------+
- @version $Id: labels.inc 950 2008-01-04 08:04:53Z tomekp $
+ @version $Id: labels.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/bs_BA/messages.inc |
| |
| Language file of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Author: Begzudin Omerovic <Begzudin.Omerovic@gmail.com> |
+-----------------------------------------------------------------------+
- @version $Id: messages.inc 950 2008-01-04 08:04:53Z tomekp $
+ @version $Id: messages.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/ca_ES/labels.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Simo <sim6@graciasensefils.net> |
+-----------------------------------------------------------------------+
-@version $Id: labels.inc 2142 2008-12-10 19:22:22Z yllar $
+@version $Id: labels.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/ca_ES/messages.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Simo <sim6@graciasensefils.net> |
+-----------------------------------------------------------------------+
-@version $Id: messages.inc 2142 2008-12-10 19:22:22Z yllar $
+@version $Id: messages.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/cs_CZ/labels.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Jiri Kaderavek <jiri.kaderavek@webstep.net> |
+-----------------------------------------------------------------------+
-@version $Id: labels.inc 2115 2008-12-04 10:21:34Z alec $
+@version $Id: labels.inc 2237 2009-01-17 01:55:39Z till $
*/
$labels['all'] = 'Vše';
$labels['none'] = 'Nic';
$labels['unread'] = 'Nepřečtené';
+$labels['flagged'] = 'Označené';
+$labels['unanswered'] = 'Neoznačené';
+$labels['filter'] = 'Filtr';
$labels['compact'] = 'Zmenšit';
$labels['empty'] = 'Vymazat';
$labels['purge'] = 'Vyprázdnit';
$labels['savesentmessagein'] = 'Ukládat odeslané zprávy v';
$labels['dontsave'] = 'neukládat';
$labels['maxuploadsize'] = 'Maximální povolená velikost souboru je $size';
-$labels['addcc'] = 'Přidat pole \"Kopie\"';
-$labels['addbcc'] = 'Přidat pole \"Skrytá Kopie\"';
-$labels['addreplyto'] = 'Přidat pole \"Odpověď\"';
+$labels['addcc'] = 'Přidat pole "Kopie"';
+$labels['addbcc'] = 'Přidat pole "Skrytá Kopie"';
+$labels['addreplyto'] = 'Přidat pole "Odpověď"';
$labels['mdnrequest'] = 'Odesílatel této zprávy si přeje být upozorněn na to, že jste zprávu obdrželi. Chcete přijetí zprávy potvrdit?';
$labels['receiptread'] = 'Potvrzení o přijetí zprávy';
$labels['yourmessage'] = 'Toto je potvrzení o přijetí Vaší zprávy';
$labels['ignore'] = 'ignorovat';
$labels['readwhendeleted'] = 'Při odstranění označit zprávu jako přečtenou';
$labels['flagfordeletion'] = 'Zprávu nemazat, pouze označit pro odstranění';
+$labels['skipdeleted'] = 'Nezobrazovat smazané zprávy';
+$labels['showremoteimages'] = 'Zobrazovat obrázky uložené mimo mail';
+$labels['fromknownsenders'] = 'od známých uživatelů';
+$labels['always'] = 'vždy';
$labels['showinlineimages'] = 'Zobrazovat připojené obrázky pod textem';
$labels['autosavedraft'] = 'Automaticky uložit rozepsané zprávy';
$labels['everynminutes'] = 'každých $n minut';
+$labels['keepaliveevery'] = 'každých $n minut';
+$labels['keepalive'] = 'Zkontrolovat nové zprávy';
$labels['never'] = 'nikdy';
$labels['messagesdisplaying'] = 'Zobrazování zpráv';
$labels['messagescomposition'] = 'Psaní zpráv';
+$labels['mimeparamfolding'] = 'Jména příloh';
+$labels['2231folding'] = 'Podle RFC 2231 (Thunderbird)';
+$labels['miscfolding'] = 'RFC 2047/2231 (MS Outlook)';
+$labels['2047folding'] = 'Podle RFC 2047 (ostatní)';
+$labels['advancedoptions'] = 'Pokročilá nastavení';
+$labels['focusonnewmessage'] = 'Aktivovat okno prohlížeče při príchozí zprávě';
+$labels['checkallfolders'] = 'Kontrolovat nové zprávy ve všech složkách';
$labels['folder'] = 'Složka';
$labels['folders'] = 'Složky';
$labels['foldername'] = 'Jméno složky';
$labels['sortby'] = 'Seřadit podle';
$labels['sortasc'] = 'Seřadit vzestupně';
$labels['sortdesc'] = 'Seřadit sestupně';
+$labels['B'] = 'B';
+$labels['KB'] = 'KB';
+$labels['MB'] = 'MB';
+$labels['GB'] = 'GB';
-?>
\ No newline at end of file
+?>
| language/cs_CZ/messages.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Jiri Kaderavek <jiri.kaderavek@webstep.net> |
+-----------------------------------------------------------------------+
-@version $Id: messages.inc 2045 2008-11-11 15:09:24Z yllar $
+@version $Id: messages.inc 2237 2009-01-17 01:55:39Z till $
*/
$messages['foldercreating'] = 'Vytvářím složku...';
$messages['folderdeleting'] = 'Mažu složku...';
$messages['folderrenaming'] = 'Přejmenovávám složku...';
+$messages['foldermoving'] = 'Přesouvám složku...';
$messages['formincomplete'] = 'Formulář nebyl korektně vyplněn';
$messages['noemailwarning'] = 'Zadejte, prosím, platnou adresu';
$messages['nonamewarning'] = 'Zadejte, prosím, jméno';
$messages['nopagesizewarning'] = 'Zadejte, prosím, velikost stránky';
+$messages['nosenderwarning'] = 'Zadejte e-mailovou adresu odesílatele';
$messages['norecipientwarning'] = 'Zadejte, prosím, alespoň jednoho příjemce';
$messages['nosubjectwarning'] = 'Předmět nebyl vyplňen. Přejete si jej zadat nyní?';
$messages['nobodywarning'] = 'Opravdu chtete odeslat prázdnou zprávu?';
$messages['importerror'] = 'Během importu nastala chyba! Nahraný soubor není ve formátu vCard.';
$messages['importconfirm'] = '<b>Úspěšně naimportováno $inserted kontaktů, $skipped existujících záznamů přeskočeno</b>:<p><em>$names</em></p>';
$messages['opnotpermitted'] = 'Operace není povolena!';
+$messages['nofromaddress'] = 'Chybějící e-mailová adresa v označeném profilu';
+$messages['editorwarning'] = 'Přepnutím do režimu prostého textu ztratíte veškeré formátování. Chcete pokračovat?';
?>
| language/cy_GB/labels.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2008, RoundQube Dev. - Switzerland |
+| Copyright (C) 2008-2009, RoundQube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| language/cy_GB/messages.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2008, RoundQube Dev. - Switzerland |
+| Copyright (C) 2008-2009, RoundQube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| language/da/labels.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Søren Aggeboe <soren@aggeboe.dk> |
+-----------------------------------------------------------------------+
-@version $Id: labels.inc 2115 2008-12-04 10:21:34Z alec $
+@version $Id: labels.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/da/messages.inc |
| |
| Language file of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Søren Aggeboe <soren@aggeboe.dk> |
+-----------------------------------------------------------------------+
- @version $Id: messages.inc 1160 2008-03-01 15:32:44Z yllar $
+ @version $Id: messages.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/de_CH/labels.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Corrections: Alexander Stiebing <ja.stiebing[NOSPAM]@web.de> |
+-----------------------------------------------------------------------+
-@version $Id: labels.inc 2124 2008-12-06 17:59:26Z thomasb $
+@version $Id: labels.inc 2316 2009-02-27 10:54:17Z thomasb $
*/
$labels['longnov'] = 'November';
$labels['longdec'] = 'Dezember';
$labels['today'] = 'Heute';
-$labels['checkmail'] = 'Überprüfung auf neue Anzeigen';
+$labels['checkmail'] = 'Auf neue Nachrichten prüfen';
$labels['writenewmessage'] = 'Neue Nachricht schreiben';
$labels['replytomessage'] = 'Antwort verfassen';
$labels['replytoallmessage'] = 'Antwort an Absender und alle Empfänger verfassen';
$labels['previewpane'] = 'Nachrichtenvorschau anzeigen';
$labels['skin'] = 'Oberflächendesign';
$labels['logoutclear'] = 'Papierkorb beim Abmelden leeren';
-$labels['logoutcompact'] = 'Posteingang beim Abmleden packen';
+$labels['logoutcompact'] = 'Posteingang beim Abmelden packen';
$labels['uisettings'] = 'Benutzeroberfläche';
$labels['serversettings'] = 'Server-Einstellungen';
$labels['mailboxview'] = 'Mailbox-Ansicht';
$labels['readwhendeleted'] = 'Beim Löschen als gelesen markieren';
$labels['flagfordeletion'] = 'Als gelöscht markieren anstatt in den Papierkorb verschieben';
$labels['skipdeleted'] = 'Zeige keine gelöschten Nachrichten an';
-$labels['showremoteimages'] = 'Zeige entfernte eingebettete Bilder an';
+$labels['showremoteimages'] = 'Eingebettete Bilder vom Internet laden';
$labels['fromknownsenders'] = 'bei bekannten Absendern';
$labels['always'] = 'immer';
-$labels['showinlineimages'] = 'Stelle angehängte Bilder unter der Nachricht dar';
+$labels['showinlineimages'] = 'Angehängte Bilder unter der Nachricht anzeigen';
$labels['autosavedraft'] = 'Entwurf autom. speichern';
$labels['everynminutes'] = 'alle $n Minuten';
$labels['keepaliveevery'] = '$n Minute(n)';
| language/de_CH/messages.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Author: Thomas Bruederli <roundcube@gmail.com> |
+-----------------------------------------------------------------------+
-@version $Id: messages.inc 2063 2008-11-17 18:52:43Z alec $
+@version $Id: messages.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/de_DE/labels.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Author: Marcel Schlesinger <info@marcel-schlesinger.de> |
+-----------------------------------------------------------------------+
-@version $Id: labels.inc 2124 2008-12-06 17:59:26Z thomasb $
+@version $Id: labels.inc 2316 2009-02-27 10:54:17Z thomasb $
*/
$labels['plaintoggle'] = 'Nur-Text';
$labels['savesentmessagein'] = 'Nachricht speichern in';
$labels['dontsave'] = 'nicht speichern';
-$labels['maxuploadsize'] = 'Maximal erlaubte Dateigrösse ist $size';
+$labels['maxuploadsize'] = 'Maximal erlaubte Dateigröße ist $size';
$labels['addcc'] = 'Cc hinzufügen';
$labels['addbcc'] = 'Bcc hinzufügen';
$labels['addreplyto'] = 'Antwortadresse hinzufügen';
$labels['pagesize'] = 'Einträge pro Seite';
$labels['signature'] = 'Signatur';
$labels['dstactive'] = 'Sommerzeit';
-$labels['htmleditor'] = 'HTML-Nachrichten erstellen';
+$labels['htmleditor'] = 'HTML-Nachrichten verfassen';
$labels['htmlsignature'] = 'HTML-Signatur';
-$labels['previewpane'] = 'Vorschaufenster anzeigen';
+$labels['previewpane'] = 'Nachrichtenvorschau anzeigen';
$labels['skin'] = 'Oberflächendesign';
$labels['logoutclear'] = 'Papierkorb beim Abmelden leeren';
$labels['logoutcompact'] = 'Posteingang beim Abmelden packen';
$labels['readwhendeleted'] = 'Beim Löschen als gelesen markieren';
$labels['flagfordeletion'] = 'Als gelöscht markieren anstatt in den Papierkorb verschieben';
$labels['skipdeleted'] = 'Zeige keine gelöschten Nachrichten an';
-$labels['showremoteimages'] = 'Zeige entfernte eingebettete Bilder an';
+$labels['showremoteimages'] = 'Eingebettete Bilder vom Internet laden';
$labels['fromknownsenders'] = 'bei bekannten Absendern';
$labels['always'] = 'immer';
-$labels['showinlineimages'] = 'Stelle angehängte Bilder unter der Nachricht dar';
+$labels['showinlineimages'] = 'Angehängte Bilder unter der Nachricht anzeigen';
$labels['autosavedraft'] = 'Entwurf automatisch speichern';
$labels['everynminutes'] = 'alle $n Minuten';
$labels['keepaliveevery'] = '$n Minute(n)';
| language/de_DE/messages.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Author: Marcel Schlesinger <info@marcel-schlesinger.de> |
+-----------------------------------------------------------------------+
-@version $Id: messages.inc 2063 2008-11-17 18:52:43Z alec $
+@version $Id: messages.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/el/labels.inc |
| |
| Language file of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| John Economou <hsoc@irc.gr> |
+-----------------------------------------------------------------------+
- @version $Id: labels.inc 1160 2008-03-01 15:32:44Z yllar $
+ @version $Id: labels.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/el/messages.inc |
| |
| Language file of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| John Economou <hsoc@irc.gr> |
+-----------------------------------------------------------------------+
- @version $Id: messages.inc 1160 2008-03-01 15:32:44Z yllar $
+ @version $Id: messages.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/en_GB/labels.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Author: Weiran Zhang (weiran@weiran.co.uk) |
+-----------------------------------------------------------------------+
-@version $Id: labels.inc 2136 2008-12-08 20:44:46Z yllar $
+@version $Id: labels.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/en_GB/messages.inc |
| |
| Language file of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Author: Weiran Zhang (weiran@weiran.co.uk) |
+-----------------------------------------------------------------------+
- @version $Id: messages.inc 2045 2008-11-11 15:09:24Z yllar $
+ @version $Id: messages.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/en_US/labels.inc |
| |
| Language file of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Author: Thomas Bruederli <roundcube@gmail.com> |
+-----------------------------------------------------------------------+
- @version $Id: labels.inc 2124 2008-12-06 17:59:26Z thomasb $
+ @version $Id: labels.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/en_US/messages.inc |
| |
| Language file of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Author: Thomas Bruederli <roundcube@gmail.com> |
+-----------------------------------------------------------------------+
- @version $Id: messages.inc 2036 2008-11-03 18:09:35Z alec $
+ @version $Id: messages.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/eo/labels.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| language/eo/messages.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
--- /dev/null
+<?php
+/*
+
++-----------------------------------------------------------------------+
+| language/es_AR/labels.inc |
+| |
+| Language file of the RoundCube Webmail client |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
+| Licensed under the GNU GPL |
+| |
++-----------------------------------------------------------------------+
+| Author: Javier Smaldone <javier@smaldone.com.ar> |
+| http://www.smaldone.com.ar |
+| David Grajal Blanco <dgrabla@gmail.com> |
+| http://david.grajal.net |
+| Pablo Rosciani <pablo@netsud.com> |
+| http://www.netsud.com |
++-----------------------------------------------------------------------+
+
+@version $Id: labels.inc 2115 2009-01-13 11:40:34Z alec $
+
+*/
+
+$labels = array();
+$labels['welcome'] = 'Bienvenido a $product';
+$labels['username'] = 'Email';
+$labels['password'] = 'Contraseña';
+$labels['server'] = 'Servidor';
+$labels['login'] = 'Entrar';
+$labels['logout'] = 'Cerrar sesión';
+$labels['mail'] = 'Correo';
+$labels['settings'] = 'Configuración';
+$labels['addressbook'] = 'Contactos';
+$labels['inbox'] = 'Entrada';
+$labels['drafts'] = 'Borradores';
+$labels['sent'] = 'Enviados';
+$labels['trash'] = 'Papelera';
+$labels['junk'] = 'Basura';
+$labels['subject'] = 'Asunto';
+$labels['from'] = 'Remitente';
+$labels['to'] = 'Destinatario';
+$labels['cc'] = 'Copia';
+$labels['bcc'] = 'Cco';
+$labels['replyto'] = 'Responder a';
+$labels['date'] = 'Fecha';
+$labels['size'] = 'Tamaño';
+$labels['priority'] = 'Prioridad';
+$labels['organization'] = 'Organización';
+$labels['reply-to'] = 'Responder a';
+$labels['mailboxlist'] = 'Carpetas';
+$labels['messagesfromto'] = 'Mensajes $from a $to de $count';
+$labels['messagenrof'] = 'Mensaje $nr de $count';
+$labels['moveto'] = 'mover a...';
+$labels['download'] = 'descargar';
+$labels['filename'] = 'Nombre del archivo';
+$labels['filesize'] = 'Tamaño del archivo';
+$labels['preferhtml'] = 'Prefiero HTML';
+$labels['htmlmessage'] = 'Mensaje HTML';
+$labels['prettydate'] = 'Fecha detallada';
+$labels['addtoaddressbook'] = 'Añadir a contactos';
+$labels['sun'] = 'Dom';
+$labels['mon'] = 'Lun';
+$labels['tue'] = 'Mar';
+$labels['wed'] = 'Mié';
+$labels['thu'] = 'Jue';
+$labels['fri'] = 'Vie';
+$labels['sat'] = 'Sáb';
+$labels['sunday'] = 'Domingo';
+$labels['monday'] = 'Lunes';
+$labels['tuesday'] = 'Martes';
+$labels['wednesday'] = 'Miércoles';
+$labels['thursday'] = 'Jueves';
+$labels['friday'] = 'Viernes';
+$labels['saturday'] = 'Sábado';
+$labels['jan'] = 'Ene';
+$labels['feb'] = 'Feb';
+$labels['mar'] = 'Mar';
+$labels['apr'] = 'Abr';
+$labels['may'] = 'May';
+$labels['jun'] = 'Jun';
+$labels['jul'] = 'Jul';
+$labels['aug'] = 'Ago';
+$labels['sep'] = 'Sep';
+$labels['oct'] = 'Oct';
+$labels['nov'] = 'Nov';
+$labels['dec'] = 'Dic';
+$labels['longjan'] = 'Enero';
+$labels['longfeb'] = 'Febrero';
+$labels['longmar'] = 'Marzo';
+$labels['longapr'] = 'Abril';
+$labels['longmay'] = 'Mayo';
+$labels['longjun'] = 'Junio';
+$labels['longjul'] = 'Julio';
+$labels['longaug'] = 'Agosto';
+$labels['longsep'] = 'Septiembre';
+$labels['longoct'] = 'Octubre';
+$labels['longnov'] = 'Noviembre';
+$labels['longdec'] = 'Diciembre';
+$labels['today'] = 'Hoy';
+$labels['checkmail'] = 'Revisar si hay nuevos mensajes';
+$labels['writenewmessage'] = 'Crear nuevo mensaje';
+$labels['replytomessage'] = 'Responder mensaje';
+$labels['replytoallmessage'] = 'Responder al emisor y a todos los destinatarios';
+$labels['forwardmessage'] = 'Reenviar mensaje';
+$labels['deletemessage'] = 'Eliminar mensaje';
+$labels['movemessagetotrash'] = 'Mover mensaje a la papelera';
+$labels['printmessage'] = 'Imprimir este mensaje';
+$labels['previousmessage'] = 'Mostrar mensaje anterior';
+$labels['previousmessages'] = 'Mostrar grupo anterior de mensajes';
+$labels['firstmessage'] = 'Mostrar primer mensaje';
+$labels['firstmessages'] = 'Mostrar primer grupo de mensajes';
+$labels['nextmessage'] = 'Mostrar siguente mensaje';
+$labels['nextmessages'] = 'Mostrar siguente grupo de mensajes';
+$labels['lastmessage'] = 'Mostrar último mensaje';
+$labels['lastmessages'] = 'Mostrar último grupo de mensajes';
+$labels['backtolist'] = 'Volver a la lista de mensajes';
+$labels['viewsource'] = 'Mostrar código';
+$labels['markmessages'] = 'Marcar mensajes';
+$labels['markread'] = 'Como leído';
+$labels['markunread'] = 'Como no leído';
+$labels['markflagged'] = 'Como marcado';
+$labels['markunflagged'] = 'Como no marcado';
+$labels['select'] = 'Elija';
+$labels['all'] = 'Todos';
+$labels['none'] = 'Ninguno';
+$labels['unread'] = 'Sin leer';
+$labels['flagged'] = 'Marcado';
+$labels['unanswered'] = 'Sin respuesta';
+$labels['filter'] = 'Filtrar';
+$labels['compact'] = 'Compactar';
+$labels['empty'] = 'Vaciar';
+$labels['purge'] = 'Eliminar';
+$labels['quota'] = 'Uso de disco';
+$labels['unknown'] = 'desconocido';
+$labels['unlimited'] = 'sin límite';
+$labels['quicksearch'] = 'Búsqueda rápida';
+$labels['resetsearch'] = 'Reajustar la búsqueda';
+$labels['openinextwin'] = 'Abrir en ventana nueva';
+$labels['compose'] = 'Escribir un mensaje';
+$labels['savemessage'] = 'Guardar como borrador';
+$labels['sendmessage'] = 'Enviar ahora el mensaje';
+$labels['addattachment'] = 'Añadir un archivo';
+$labels['charset'] = 'Codificación';
+$labels['editortype'] = 'Tipo de editor';
+$labels['returnreceipt'] = 'Acuse de recibo';
+$labels['checkspelling'] = 'Revisar ortografía';
+$labels['resumeediting'] = 'Continuar edición';
+$labels['revertto'] = 'Revertir a';
+$labels['attachments'] = 'Adjuntos';
+$labels['upload'] = 'Agregar';
+$labels['close'] = 'Cerrar';
+$labels['low'] = 'Bajo';
+$labels['lowest'] = 'Bajísimo';
+$labels['normal'] = 'Normal';
+$labels['high'] = 'Alto';
+$labels['highest'] = 'Altísimo';
+$labels['nosubject'] = '(sin asunto)';
+$labels['showimages'] = 'Mostrar imágenes';
+$labels['alwaysshow'] = 'Siempre mostratr imágenes de $sender';
+$labels['htmltoggle'] = 'HTML';
+$labels['plaintoggle'] = 'Texto';
+$labels['savesentmessagein'] = 'Guardar mensaje enviado en';
+$labels['dontsave'] = 'no guardar';
+$labels['maxuploadsize'] = 'El tamaño maximo permitido por archivo es $size';
+$labels['addcc'] = 'Añadir Cc';
+$labels['addbcc'] = 'Añadir Cco';
+$labels['addreplyto'] = 'Añadir Respuesta a';
+$labels['mdnrequest'] = 'El emisor de este mensaje desea ser notificado cuando usted lo lea. ¿Quiere enviar esta notificación?';
+$labels['receiptread'] = 'Notificación de lectura';
+$labels['yourmessage'] = 'Esta es una notificación de lectura de su mensaje';
+$labels['receiptnote'] = 'Nota: Esta notificación sólo significa que su mensaje fue mostrado en la computadora del receptor. No hay garantía de que el receptor haya leído o entendido el contenido del mensaje.';
+$labels['name'] = 'Nombre completo';
+$labels['firstname'] = 'Nombre';
+$labels['surname'] = 'Apellido';
+$labels['email'] = 'Correo';
+$labels['addcontact'] = 'Añadir nuevo contacto';
+$labels['editcontact'] = 'Editar contacto';
+$labels['edit'] = 'Editar';
+$labels['cancel'] = 'Cancelar';
+$labels['save'] = 'Guardar';
+$labels['delete'] = 'Eliminar';
+$labels['newcontact'] = 'Añador nuevo contacto';
+$labels['deletecontact'] = 'Eliminar contactos seleccionados';
+$labels['composeto'] = 'Enviar mensaje a';
+$labels['contactsfromto'] = 'Contactos $from a $to de $count';
+$labels['print'] = 'Imprimir';
+$labels['export'] = 'Exportar';
+$labels['exportvcards'] = 'Exportar contactos en format vCard';
+$labels['previouspage'] = 'Mostrar grupo anterior';
+$labels['firstpage'] = 'Mostrar primer grupo';
+$labels['nextpage'] = 'Mostrar siguiente grupo';
+$labels['lastpage'] = 'Mostrar último grupo';
+$labels['groups'] = 'Grupos';
+$labels['personaladrbook'] = 'Direcciones personales';
+$labels['import'] = 'Importar';
+$labels['importcontacts'] = 'Importar contactos';
+$labels['importfromfile'] = 'Importar desde el archivo:';
+$labels['importreplace'] = 'Reemplazar completamente la lista de contactos';
+$labels['importtext'] = 'Puede importar contactos desde una lista existente.<br/>Actualmente soportamos la importación de contactos en formato <a href="http://es.wikipedia.org/wiki/VCard">vCard</a>.';
+$labels['done'] = 'Hecho';
+$labels['settingsfor'] = 'Configuración para';
+$labels['preferences'] = 'Preferencias';
+$labels['userpreferences'] = 'Preferencias de usuario';
+$labels['editpreferences'] = 'Editar preferencias de usuario';
+$labels['identities'] = 'Identidades';
+$labels['manageidentities'] = 'Gestionar identidades para esta cuenta';
+$labels['newidentity'] = 'Nueva identidad';
+$labels['newitem'] = 'Nuevo';
+$labels['edititem'] = 'Editar';
+$labels['setdefault'] = 'Seleccionar opción por defecto';
+$labels['autodetect'] = 'Automático';
+$labels['language'] = 'Idioma';
+$labels['timezone'] = 'Zona horaria';
+$labels['pagesize'] = 'Filas por página';
+$labels['signature'] = 'Firma';
+$labels['dstactive'] = 'Cambio de horario';
+$labels['htmleditor'] = 'Componer mensaje en HTML';
+$labels['htmlsignature'] = 'Firma HTML';
+$labels['previewpane'] = 'Mostrar vista preliminar';
+$labels['skin'] = 'Apariencia de la interfaz';
+$labels['logoutclear'] = 'Vaciar papelera al cerrar sesión';
+$labels['logoutcompact'] = 'Compactar la bandeja de entrada al cerrar sesión';
+$labels['uisettings'] = 'Interfaz de usuario';
+$labels['serversettings'] = 'Configuración del servidor';
+$labels['mailboxview'] = 'Vista de buzón';
+$labels['mdnrequests'] = 'Notificaciones de envío';
+$labels['askuser'] = 'preguntar al usuario';
+$labels['autosend'] = 'enviar automáticamente';
+$labels['ignore'] = 'ignorar';
+$labels['readwhendeleted'] = 'Marcar el mensage como leido al borrarlo';
+$labels['flagfordeletion'] = 'Marcar el mensage para borrarse en vez de borrarlo';
+$labels['skipdeleted'] = 'No mostrar mensajes eliminados';
+$labels['showremoteimages'] = 'Mostrar imágenes remotas';
+$labels['fromknownsenders'] = 'de remitentes conocidos';
+$labels['always'] = 'siempre';
+$labels['showinlineimages'] = 'Mostrar imágenes adjuntas debajo del mensaje';
+$labels['autosavedraft'] = 'Guardar borrador automáticamente';
+$labels['everynminutes'] = 'cada $n minutos';
+$labels['keepaliveevery'] = 'cada $n minutos(s)';
+$labels['keepalive'] = 'Verificar si hay nuevos mensajes en';
+$labels['never'] = 'nunca';
+$labels['messagesdisplaying'] = 'Vista de mensajes';
+$labels['messagescomposition'] = 'Composición de mensajes';
+$labels['mimeparamfolding'] = 'Nombre de adjuntos';
+$labels['2231folding'] = 'RFC 2231 Completo (Thunderbird)';
+$labels['miscfolding'] = 'RFC 2047/2231 (MS Outlook)';
+$labels['2047folding'] = 'RFC 2047 Completo (Otro)';
+$labels['advancedoptions'] = 'Opciones Avanzadas';
+$labels['focusonnewmessage'] = 'Traer al frente la ventana del navegador cuando haya nuevos mensajes';
+$labels['checkallfolders'] = 'Verificar todas las carpetas por nuevos mensajes';
+$labels['folder'] = 'Carpeta';
+$labels['folders'] = 'Carpetas';
+$labels['foldername'] = 'Nombre de carpeta';
+$labels['subscribed'] = 'Suscripta';
+$labels['messagecount'] = 'Mensajes';
+$labels['create'] = 'Crear';
+$labels['createfolder'] = 'Crear nueva carpeta';
+$labels['rename'] = 'Renombrar';
+$labels['renamefolder'] = 'Renombrar carpeta';
+$labels['deletefolder'] = 'Eliminar carpeta';
+$labels['managefolders'] = 'Administrar carpetas';
+$labels['specialfolders'] = 'Carpetas Especiales';
+$labels['sortby'] = 'Ordenar por';
+$labels['sortasc'] = 'Orden ascendente';
+$labels['sortdesc'] = 'Orden descendente';
+$labels['B'] = 'B';
+$labels['KB'] = 'KB';
+$labels['MB'] = 'MB';
+$labels['GB'] = 'GB';
+
+?>
--- /dev/null
+<?php
+/*
+
++-----------------------------------------------------------------------+
+| language/es_ES/messages.inc |
+| |
+| Language file of the RoundCube Webmail client |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
+| Licensed under the GNU GPL |
+| |
++-----------------------------------------------------------------------+
+| Author: Javier Smaldone <javier@smaldone.com.ar> |
+| David Grajal Blanco <dgrabla@gmail.com> |
+| Lito Jornero <jornero@gmail.com> |
+| Pablo Rosciani <pablo@netsud.com> |
+| http://www.netsud.com |
++-----------------------------------------------------------------------+
+
+@version $Id: messages.inc 1600 2009-01-13 11:40:30Z yllar $
+
+*/
+
+$messages = array();
+
+$messages['loginfailed'] = 'Contraseña incorrecta';
+$messages['cookiesdisabled'] = 'Su navegador no acepta cookies';
+$messages['sessionerror'] = 'Su sesión no existe o ha expirado';
+$messages['imaperror'] = 'Error de conexión con el servidor IMAP';
+$messages['nomessagesfound'] = 'No se han encontrado mensajes en esta casilla';
+$messages['loggedout'] = 'Ha cerrado la sesión. ¡Hasta pronto!';
+$messages['mailboxempty'] = 'La casilla está vacía';
+$messages['loading'] = 'Cargando...';
+$messages['loadingdata'] = 'Cargando datos...';
+$messages['checkingmail'] = 'Verificando si hay nuevos mensajes...';
+$messages['sendingmessage'] = 'Enviando mensaje...';
+$messages['messagesent'] = 'Mensaje enviado correctamente';
+$messages['savingmessage'] = 'Guardar mensaje...';
+$messages['messagesaved'] = 'Mensaje guardado en borradores';
+$messages['successfullysaved'] = 'Guardado correctamente';
+$messages['addedsuccessfully'] = 'Contacto añadido correctamente a la libreta de direcciones';
+$messages['contactexists'] = 'Ya existe un contacto con esta dirección de correo';
+$messages['blockedimages'] = 'Para proteger su privacidad, las imágenes externas han sido bloqueadas en este mensaje';
+$messages['encryptedmessage'] = 'Este es un mensaje cifrado y no puede ser mostrado. ¡Lo siento!';
+$messages['nocontactsfound'] = 'No hay contactos';
+$messages['contactnotfound'] = 'El contacto solicitado no existe';
+$messages['sendingfailed'] = 'Error al enviar mensaje';
+$messages['senttooquickly'] = 'Por favor, aguarde $sec segundo(s) antes de enviar este mensaje';
+$messages['errorsavingsent'] = 'Ocurrió un error al guardar el mensaje enviado';
+$messages['errorsaving'] = 'Ocurrió un error al guardar';
+$messages['errormoving'] = 'No se ha podido mover el mensaje';
+$messages['errordeleting'] = 'No se ha podido eliminar el mensaje';
+$messages['deletecontactconfirm'] = '¿Realmente quiere eliminar los contactos seleccionados?';
+$messages['deletemessagesconfirm'] = '¿Realmente quiere eliminar los mensajes seleccionados?';
+$messages['deletefolderconfirm'] = '¿Está seguro de que quiere eliminar esta carpeta?';
+$messages['purgefolderconfirm'] = '¿Está seguro de que quiere eliminar todos los mensajes de esta carpeta?';
+$messages['foldercreating'] = 'Creando carpeta...';
+$messages['folderdeleting'] = 'Eliminando carpeta...';
+$messages['folderrenaming'] = 'Renombrando carpeta...';
+$messages['foldermoving'] = 'Moviendo carpeta...';
+$messages['formincomplete'] = 'No se han llenado todos los campos del formulario';
+$messages['noemailwarning'] = 'Por favor, introduzca un e-mail válido';
+$messages['nonamewarning'] = 'Por favor, introduzca su nombre';
+$messages['nopagesizewarning'] = 'Por favor, introduzca un tamaño de página';
+$messages['nosenderwarning'] = 'Please enter sender e-mail address'; //TODO
+$messages['norecipientwarning'] = 'Por favor, introduzca al menos un destinatario';
+$messages['nosubjectwarning'] = 'El campo "Asunto" esta vacío. ¿Desea completarlo en este momento?';
+$messages['nobodywarning'] = '¿Quiere enviar este mensaje sin texto?';
+$messages['notsentwarning'] = 'El mensaje no ha sido enviado. ¿Desea descartar su mensaje?';
+$messages['noldapserver'] = 'Por favor, seleccione un servidor LDAP para buscar';
+$messages['nocontactsreturned'] = 'No se han encontrado contactos';
+$messages['nosearchname'] = 'Por favor, introduzca un nombre o la dirección de e-mail';
+$messages['searchsuccessful'] = 'Se encontraron $nr mensajes';
+$messages['searchnomatch'] = 'La búsqueda no obtuvo resultados';
+$messages['searching'] = 'Buscando...';
+$messages['checking'] = 'Revisando...';
+$messages['nospellerrors'] = 'No se encontraron errores ortográficos';
+$messages['folderdeleted'] = 'Carpeta eliminada exitosamente';
+$messages['deletedsuccessfully'] = 'Eliminado exitosamente';
+$messages['converting'] = 'Removiendo el formato del mensaje...';
+$messages['messageopenerror'] = 'No puedo descargar el mensaje del servidor';
+$messages['fileuploaderror'] = 'Fallo en la subida de archivos';
+$messages['filesizeerror'] = 'El archivo excede el tamaño maximo ($size)';
+$messages['copysuccess'] = '$nr direcciones copiadas con éxito';
+$messages['copyerror'] = 'No se pudo copiar ninguna dirección';
+$messages['sourceisreadonly'] = 'Esta dirección es de sólo-lectura';
+$messages['errorsavingcontact'] = 'No se pudo guardar la dirección de contacto';
+$messages['movingmessage'] = 'Moviendo mensaje...';
+$messages['receiptsent'] = 'La notificación de lectura se ha enviado con éxito.';
+$messages['errorsendingreceipt'] = 'No se ha podido enviar la notificación de lectura.';
+$messages['nodeletelastidentity'] = 'No se puede borrar esta identidad puesto que es la última.';
+$messages['addsubfolderhint'] = 'Esta carpeta se creará como una subcarpeta dentro de la carpeta seleccionada';
+$messages['forbiddencharacter'] = 'El nombre de la carpeta contiene un caracter prohibido';
+$messages['selectimportfile'] = 'Por favor, seleccione el archivo a subir';
+$messages['addresswriterror'] = 'La libreta de direcciones seleccionada es de solo lectura';
+$messages['importwait'] = 'Importando, aguarde por favor...';
+$messages['importerror'] = 'Falló la importación! El archivo seleccionado parece no ser un archivo del tipo vCard válido.';
+$messages['importconfirm'] = '<b>Se importaron $inserted contactos correctamente. $skipped ya existentes fueron ignorados</b>:<p><em>$names</em></p>'; //TODO: ¿names?
+$messages['opnotpermitted'] = 'Operación no permitida!';
+$messages['nofromaddress'] = 'Missing e-mail address in selected identity'; //TODO
+$messages['editorwarning'] = 'Si cambia a texto plano se perderán todas las opciones de formato. ¿Desea continuar?';
+
+?>
\ No newline at end of file
| http://www.smaldone.com.ar |
| David Grajal Blanco <dgrabla@gmail.com> |
| http://david.grajal.net |
+| Angel Bueno Prieto <info@mediaiberia.com> |
+| http://www.mediaiberia.com |
+-----------------------------------------------------------------------+
-@version $Id: labels.inc 2115 2008-12-04 10:21:34Z alec $
+@version $Id: labels.inc 2319 2009-03-01 06:43:24Z alec $
*/
$labels = array();
+// login page
$labels['welcome'] = 'Bienvenido a $product';
$labels['username'] = 'Nombre de usuario';
$labels['password'] = 'Contraseña';
$labels['server'] = 'Servidor';
$labels['login'] = 'Entrar';
+
+// taskbar
$labels['logout'] = 'Cerrar sesión';
$labels['mail'] = 'Correo';
$labels['settings'] = 'Configuración';
$labels['addressbook'] = 'Contactos';
+
+// mailbox names
$labels['inbox'] = 'Entrada';
$labels['drafts'] = 'Borradores';
$labels['sent'] = 'Enviados';
$labels['trash'] = 'Papelera';
$labels['junk'] = 'Basura';
+
+// message listing
$labels['subject'] = 'Asunto';
$labels['from'] = 'Remitente';
$labels['to'] = 'Destinatario';
$labels['size'] = 'Tamaño';
$labels['priority'] = 'Prioridad';
$labels['organization'] = 'Organización';
-$labels['reply-to'] = 'Respuesta a';
+
+// aliases
+$labels['reply-to'] = $labels['replyto'];
+
$labels['mailboxlist'] = 'Bandejas';
$labels['messagesfromto'] = 'Mensajes $from a $to de $count';
$labels['messagenrof'] = 'Mensaje $nr de $count';
-$labels['moveto'] = 'mover a...';
-$labels['download'] = 'descargar';
+
+$labels['moveto'] = 'Mover a...';
+$labels['download'] = 'Descargar';
+
$labels['filename'] = 'Nombre del archivo';
$labels['filesize'] = 'Tamaño del archivo';
+
$labels['preferhtml'] = 'Prefiero HTML';
$labels['htmlmessage'] = 'Mensaje HTML';
$labels['prettydate'] = 'Fecha detallada';
+
$labels['addtoaddressbook'] = 'Añadir a contactos';
+
+// weekdays short
$labels['sun'] = 'Dom';
$labels['mon'] = 'Lun';
$labels['tue'] = 'Mar';
$labels['thu'] = 'Jue';
$labels['fri'] = 'Vie';
$labels['sat'] = 'Sáb';
+
+// weekdays long
$labels['sunday'] = 'Domingo';
$labels['monday'] = 'Lunes';
$labels['tuesday'] = 'Martes';
$labels['thursday'] = 'Jueves';
$labels['friday'] = 'Viernes';
$labels['saturday'] = 'Sábado';
+
+// months short
$labels['jan'] = 'Ene';
$labels['feb'] = 'Feb';
$labels['mar'] = 'Mar';
$labels['sep'] = 'Sep';
$labels['oct'] = 'Oct';
$labels['nov'] = 'Nov';
-$labels['dec'] = 'Duc';
+$labels['dec'] = 'Dic';
+
+// months long
$labels['longjan'] = 'Enero';
$labels['longfeb'] = 'Febrero';
$labels['longmar'] = 'Marzo';
$labels['longoct'] = 'Octubre';
$labels['longnov'] = 'Noviembre';
$labels['longdec'] = 'Diciembre';
+
$labels['today'] = 'Hoy';
-$labels['checkmail'] = 'Revisar si hay nuevos mensajes';
-$labels['writenewmessage'] = 'Crear nuevo mensaje';
-$labels['replytomessage'] = 'Responder mensaje';
+
+// toolbar buttons
+$labels['checkmail'] = 'Revisar si hay nuevos mensajes';
+$labels['writenewmessage'] = 'Crear nuevo mensaje';
+$labels['replytomessage'] = 'Responder mensaje';
$labels['replytoallmessage'] = 'Responder al emisor y a todos los destinatarios';
-$labels['forwardmessage'] = 'Reenviar mensaje';
-$labels['deletemessage'] = 'Eliminar mensaje';
+$labels['forwardmessage'] = 'Reenviar mensaje';
+$labels['deletemessage'] = 'Eliminar mensaje';
$labels['movemessagetotrash'] = 'Mover mensaje a la papelera';
-$labels['printmessage'] = 'Imprimir este mensaje';
-$labels['previousmessage'] = 'Mostrar mensaje anterior';
-$labels['previousmessages'] = 'Mostrar grupo anterior de mensajes';
-$labels['firstmessage'] = 'Mostrar primer mensaje';
-$labels['firstmessages'] = 'Mostrar primer grupo de mensajes';
-$labels['nextmessage'] = 'Mostrar siguente mensaje';
-$labels['nextmessages'] = 'Mostrar siguente grupo de mensajes';
-$labels['lastmessage'] = 'Mostrar último mensaje';
-$labels['lastmessages'] = 'Mostrar último grupo de mensajes';
-$labels['backtolist'] = 'Volver a la lista de mensajes';
-$labels['viewsource'] = 'Mostrar código';
-$labels['markmessages'] = 'Marcar mensajes';
-$labels['markread'] = 'Como leído';
-$labels['markunread'] = 'Como no leído';
-$labels['markflagged'] = 'Como marcado';
-$labels['markunflagged'] = 'Como no marcado';
+$labels['printmessage'] = 'Imprimir este mensaje';
+$labels['previousmessage'] = 'Mostrar mensaje anterior';
+$labels['previousmessages'] = 'Mostrar grupo anterior de mensajes';
+$labels['firstmessage'] = 'Mostrar primer mensaje';
+$labels['firstmessages'] = 'Mostrar primer grupo de mensajes';
+$labels['nextmessage'] = 'Mostrar siguente mensaje';
+$labels['nextmessages'] = 'Mostrar siguente grupo de mensajes';
+$labels['lastmessage'] = 'Mostrar último mensaje';
+$labels['lastmessages'] = 'Mostrar último grupo de mensajes';
+$labels['backtolist'] = 'Volver a la lista de mensajes';
+$labels['viewsource'] = 'Mostrar código';
+$labels['markmessages'] = 'Marcar mensajes';
+$labels['markread'] = 'Como leído';
+$labels['markunread'] = 'Como no leído';
+$labels['markflagged'] = 'Como marcado';
+$labels['markunflagged'] = 'Como no marcado';
+
$labels['select'] = 'Elija';
$labels['all'] = 'Todos';
$labels['none'] = 'Ninguno';
$labels['unread'] = 'Sin leer';
+$labels['flagged'] = 'Señalado';
+$labels['unanswered'] = 'Sin respuesta';
+$labels['filter'] = 'Filtrar';
+
$labels['compact'] = 'Compacta';
-$labels['empty'] = 'Vacia';
+$labels['empty'] = 'Vacía';
$labels['purge'] = 'Eliminar';
-$labels['quota'] = 'Uso de disco';
+
+$labels['quota'] = 'Uso de cuenta';
$labels['unknown'] = 'desconocido';
$labels['unlimited'] = 'sin límite';
+
$labels['quicksearch'] = 'Búsqueda rápida';
-$labels['resetsearch'] = 'Reajustar la búsqueda';
+$labels['resetsearch'] = 'Afinar la búsqueda';
+
+$labels['openinextwin'] = 'Abrir en nueva ventana';
+
+// message compose
$labels['compose'] = 'Escribir un mensaje';
$labels['savemessage'] = 'Guardar como borrador';
$labels['sendmessage'] = 'Enviar ahora el mensaje';
$labels['charset'] = 'Codificación';
$labels['editortype'] = 'Tipo de editor';
$labels['returnreceipt'] = 'Acuse de recibo';
+
$labels['checkspelling'] = 'Revisar ortografía';
$labels['resumeediting'] = 'Continuar edición';
$labels['revertto'] = 'Revertir a';
+
$labels['attachments'] = 'Adjuntos';
$labels['upload'] = 'Subir';
$labels['close'] = 'Cerrar';
+
$labels['low'] = 'Bajo';
$labels['lowest'] = 'Bajísimo';
$labels['normal'] = 'Normal';
$labels['high'] = 'Alto';
$labels['highest'] = 'Altísimo';
+
$labels['nosubject'] = '(sin asunto)';
$labels['showimages'] = 'Mostrar imágenes';
$labels['alwaysshow'] = 'Muestra siempre imágenes de $sender';
+
$labels['htmltoggle'] = 'HTML';
$labels['plaintoggle'] = 'Texto';
+$labels['savesentmessagein'] = 'Guardar mensaje enviado en';
+$labels['dontsave'] = 'No guardar';
+$labels['maxuploadsize'] = 'Tamaño máximo permitido: $size';
+
$labels['addcc'] = 'Añadir Cc';
$labels['addbcc'] = 'Añadir Bcc';
$labels['addreplyto'] = 'Añadir Respuesta a';
+
+// mdn
$labels['mdnrequest'] = 'El emisor de este mensaje desea ser notificado cuando usted lo lea. ¿Quiere enviar esta notificación?';
$labels['receiptread'] = 'Notificación de lectura';
$labels['yourmessage'] = 'Esta es una notificación de lectura de su mensaje';
$labels['receiptnote'] = 'Nota: Esta notificación sólo significa que su mensaje fue mostrado en la computadora del receptor. No hay garantía de que el receptor haya leído o entendido el contenido del mensaje.';
+
+// address boook
$labels['name'] = 'Nombre completo';
$labels['firstname'] = 'Nombre';
$labels['surname'] = 'Apellido';
$labels['email'] = 'Correo';
+
$labels['addcontact'] = 'Añadir nuevo contacto';
$labels['editcontact'] = 'Editar contacto';
+
$labels['edit'] = 'Editar';
$labels['cancel'] = 'Cancelar';
$labels['save'] = 'Guardar';
$labels['delete'] = 'Eliminar';
+
$labels['newcontact'] = 'Crear nuevo contacto';
$labels['deletecontact'] = 'Eliminar contactos seleccionados';
$labels['composeto'] = 'Enviar mensaje a';
$labels['contactsfromto'] = 'Contactos $from a $to de $count';
$labels['print'] = 'Imprimir';
$labels['export'] = 'Exportar';
+$labels['exportvcards'] = 'Exportar contactos en formato vCard';
+
$labels['previouspage'] = 'Mostrar grupo anterior';
$labels['firstpage'] = 'Mostrar primer grupo';
$labels['nextpage'] = 'Mostrar grupo siguiente';
$labels['lastpage'] = 'Mostrar último grupo';
+
$labels['groups'] = 'Grupos';
$labels['personaladrbook'] = 'Direcciones personales';
+
+$labels['import'] = 'Importar';
+$labels['importcontacts'] = 'Importar contactos';
+$labels['importfromfile'] = 'Importar desde archivo:';
+$labels['importreplace'] = 'Reemplazar toda la lista de contactos';
+$labels['importtext'] = 'Puedes importar contactos de una lista existente.<br/>Puedes ver el formato soportado de datos en: <a href="http://en.wikipedia.org/wiki/VCard">vCard</a>.';
+$labels['done'] = 'Realizado';
+
+// settings
$labels['settingsfor'] = 'Configuración para';
+
$labels['preferences'] = 'Preferencias';
$labels['userpreferences'] = 'Preferencias de usuario';
$labels['editpreferences'] = 'Editar preferencias de usuario';
+
$labels['identities'] = 'Identidades';
$labels['manageidentities'] = 'Gestionar identidades para esta cuenta';
$labels['newidentity'] = 'Nueva identidad';
+
$labels['newitem'] = 'Nuevo';
$labels['edititem'] = 'Editar';
+
$labels['setdefault'] = 'Seleccionar opción por defecto';
+$labels['autodetect'] = 'Auto';
$labels['language'] = 'Idioma';
$labels['timezone'] = 'Zona horaria';
$labels['pagesize'] = 'Filas por página';
$labels['logoutclear'] = 'Vaciar papelera al cerrar sesión';
$labels['logoutcompact'] = 'Compactar la bandeja de entrada al cerrar sesión';
$labels['uisettings'] = 'Interfaz de usuario';
-$labels['serversettings'] = 'Configuracion del servidor';
+$labels['serversettings'] = 'Configuración del servidor';
$labels['mailboxview'] = 'Vista de buzón';
-$labels['mdnrequests'] = 'Notificaciones de envio';
+$labels['mdnrequests'] = 'Notificaciones de envío';
$labels['askuser'] = 'preguntar al usuario';
$labels['autosend'] = 'enviar automáticamente';
$labels['ignore'] = 'ignorar';
-$labels['readwhendeleted'] = 'Marcar el mensage como leido al borrarlo';
-$labels['flagfordeletion'] = 'Marcar el mensage para borrarse en vez de borrarlo';
+$labels['readwhendeleted'] = 'Marcar el mensaje como leído al borrarlo';
+$labels['flagfordeletion'] = 'Marcar el mensaje para borrarse en vez de borrarlo';
+$labels['skipdeleted'] = 'No mostrar mensajes borrados';
+$labels['showremoteimages'] = 'Mostrar las imágenes externas';
+$labels['fromknownsenders'] = 'de remitentes conocidos';
+$labels['always'] = 'siempre';
$labels['showinlineimages'] = 'Mostrar imágenes adjuntas debajo del mensaje';
$labels['autosavedraft'] = 'Guardar borrador automáticamente';
$labels['everynminutes'] = 'cada $n minutos';
+$labels['keepaliveevery'] = 'cada $n minuto(s)';
+$labels['keepalive'] = 'Comprobar mensajes en línea';
$labels['never'] = 'nunca';
$labels['messagesdisplaying'] = 'Vista de mensajes';
$labels['messagescomposition'] = 'Composición de mensajes';
+$labels['mimeparamfolding'] = 'Nombres de archivos adjuntos';
+$labels['2231folding'] = 'Full RFC 2231 (Thunderbird)';
+$labels['miscfolding'] = 'RFC 2047/2231 (MS Outlook)';
+$labels['2047folding'] = 'Full RFC 2047 (otro)';
+$labels['advancedoptions'] = 'Opciones Avanzadas';
+$labels['focusonnewmessage'] = 'Activar la ventana del navegador en un mensaje nuevo';
+$labels['checkallfolders'] = 'Comprobar todas las carpetas para mensajes nuevos';
+
$labels['folder'] = 'Bandeja';
$labels['folders'] = 'Bandejas';
$labels['foldername'] = 'Nombre de bandeja';
$labels['renamefolder'] = 'Renombrar bandeja';
$labels['deletefolder'] = 'Eliminar bandeja';
$labels['managefolders'] = 'Administrar bandejas';
+$labels['specialfolders'] = 'Bandejas Especiales';
+
$labels['sortby'] = 'Ordenar por';
$labels['sortasc'] = 'Orden ascendente';
$labels['sortdesc'] = 'Orden descendente';
+// units
+$labels['B'] = 'B';
+$labels['KB'] = 'Kb';
+$labels['MB'] = 'Mb';
+$labels['GB'] = 'Gb';
+
?>
| Author: Javier Smaldone <javier@smaldone.com.ar> |
| David Grajal Blanco <dgrabla@gmail.com> |
| Lito Jornero <jornero@gmail.com> |
+| Angel Bueno <info@mediaiberia.com> |
+| htt://www.mediaiberia.com |
+-----------------------------------------------------------------------+
-@version $Id: messages.inc 1600 2008-07-21 08:52:30Z yllar $
-
+@version $Id: messages.inc 2319 2009-03-01 06:43:24Z alec $
*/
$messages = array();
-$messages['loginfailed'] = 'Contraseña incorrecta';
+$messages['loginfailed'] = 'Contraseña o nombre de usuario incorrecto';
$messages['cookiesdisabled'] = 'Su navegador no acepta cookies';
$messages['sessionerror'] = 'Su sesión no existe o ha expirado';
$messages['imaperror'] = 'Error de conexión con el servidor IMAP';
$messages['nocontactsfound'] = 'No hay contactos';
$messages['contactnotfound'] = 'El contacto solicitado no existe';
$messages['sendingfailed'] = 'Error al enviar mensaje';
+$messages['senttooquickly'] = 'Por favor espere $sec seg(s). antes de mandar este mensaje';
+$messages['errorsavingsent'] = 'Un error ha ocurrido al guardar el mensaje enviado';
$messages['errorsaving'] = 'Ocurrió un error mientras se guardaba';
$messages['errormoving'] = 'No se ha podido mover el mensaje';
$messages['errordeleting'] = 'No se ha podido eliminar el mensaje';
$messages['deletemessagesconfirm'] = '¿Realmente quiere eliminar los mensajes seleccionados?';
$messages['deletefolderconfirm'] = '¿Está seguro de que quiere eliminar esta carpeta?';
$messages['purgefolderconfirm'] = '¿Está seguro de que quiere eliminar todos los mensajes de esta carpeta?';
-$messages['formincomplete'] = 'No se han llenado todos los campos del formulario';
+$messages['foldercreating'] = 'Creando carpeta...';
+$messages['folderdeleting'] = 'Borrando carpeta...';
+$messages['folderrenaming'] = 'Renombrando carpeta...';
+$messages['foldermoving'] = 'Moviendo carpeta...';
+$messages['formincomplete'] = 'No ha rellenado todos los campos del formulario';
$messages['noemailwarning'] = 'Por favor, introduzca un e-mail válido';
$messages['nonamewarning'] = 'Por favor, introduzca su nombre';
$messages['nopagesizewarning'] = 'Por favor, introduzca un tamaño de página';
+$messages['nosenderwarning'] = 'Por favor, introduzca el e-mail de quien envía';
$messages['norecipientwarning'] = 'Por favor, introduzca al menos un destinatario';
-$messages['nosubjectwarning'] = 'El campo "Asunto" esta vacío. ¿Desea completarlo en este momento?';
+$messages['nosubjectwarning'] = 'El campo "Asunto" está vacío. ¿Desea completarlo en este momento?';
$messages['nobodywarning'] = '¿Quiere enviar este mensaje sin texto?';
$messages['notsentwarning'] = 'El mensaje no ha sido enviado. ¿Desea descartar su mensaje?';
$messages['noldapserver'] = 'Por favor, seleccione un servidor LDAP para buscar';
$messages['nocontactsreturned'] = 'No se han encontrado contactos';
$messages['nosearchname'] = 'Por favor, introduzca un nombre o la dirección de e-mail';
$messages['searchsuccessful'] = 'Se encontraron $nr mensajes';
-$messages['searchnomatch'] = 'La búsqueda no obtuvo resultados';
+$messages['searchnomatch'] = 'No se obtuvieron resultados';
$messages['searching'] = 'Buscando...';
$messages['checking'] = 'Revisando...';
$messages['nospellerrors'] = 'No se encontraron errores ortográficos';
$messages['converting'] = 'Removiendo el formato del mensaje...';
$messages['messageopenerror'] = 'No puedo descargar el mensaje del servidor';
$messages['fileuploaderror'] = 'Fallo en la subida de archivos';
-$messages['filesizeerror'] = 'El archivo excede el tamaño maximo ($size)';
+$messages['filesizeerror'] = 'El archivo excede el tamaño máximo ($size)';
$messages['copysuccess'] = '$nr direcciones copiadas con éxito';
$messages['copyerror'] = 'No se pudo copiar ninguna dirección';
$messages['sourceisreadonly'] = 'Esta dirección es de sólo-lectura';
$messages['errorsendingreceipt'] = 'No se ha podido enviar la notificación de lectura.';
$messages['nodeletelastidentity'] = 'No se puede borrar esta identidad puesto que es la última.';
$messages['addsubfolderhint'] = 'Esta carpeta se creará como una subcarpeta dentro de la carpeta seleccionada';
-$messages['forbiddencharacter'] = 'El nombre de la carpeta contiene un caracter prohibido';
+$messages['forbiddencharacter'] = 'El nombre de la carpeta contiene un carácter prohibido';
+$messages['selectimportfile'] = 'Por favor, seleccione un archivo para subir';
+$messages['addresswriterror'] = 'No se puede escribir la dirección de contacto seleccionada';
+$messages['importwait'] = 'Importando, espere...';
+$messages['importerror'] = '¡Fallo al Importar! Este archivo no es un formato válido vCard.';
+$messages['importconfirm'] = '<b>Se han insertado: $inserted contactos, y se han omitido: $skipped porque ya existían</b>:<p><em>$names</em></p>';
+$messages['opnotpermitted'] = '¡Operación no permitida!';
+$messages['nofromaddress'] = 'No se encuentra la dirección e-mail en el contacto seleccionado';
+$messages['editorwarning'] = 'Cambiando a texto plano perderá el formato del mensaje. ¿Desea continuar?';
?>
| language/et_EE/labels.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| language/et_EE/messages.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| language/eu_ES/labels.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Bihar <gaurdabihar@gmail.com> |
+-----------------------------------------------------------------------+
-@version $Id: labels.inc 2115 2008-12-04 10:21:34Z alec $
+@version $Id: labels.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/eu_ES/messages.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Bihar <gaurdabihar@gmail.com> |
+-----------------------------------------------------------------------+
-@version $Id: messages.inc 1663 2008-08-21 06:19:10Z yllar $
+@version $Id: messages.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/fa/labels.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
-| Author: Mohammad Ebrahim Mohammadi Panah <mebrahim@gmail.com> |
-| Anoosh <anoosher2003@yahoo.com> |
+| Author: Mohammad Ebrahim Mohammadi Panah <mebrahim at gmail.com> |
+| Anoosh <anoosher2003 at yahoo.com> |
+| Nader Aghazadeh <Nader.aghazadeh at gmail.com> |
+-----------------------------------------------------------------------+
@version $Id$
$labels['markmessages'] = 'علامتگذاری پیغامها';
$labels['markread'] = 'به عنوان خواندهشده';
$labels['markunread'] = 'به عنوان خواندهنشده';
+$labels['markflagged'] = 'به عنوان علامت گذاری شده';
+$labels['markunflagged'] = 'به عنوان علامت گذاری نشده';
$labels['select'] = 'انتخاب';
$labels['all'] = 'همه';
$labels['none'] = 'هیچ';
$labels['unread'] = 'ناخوانده';
+$labels['flagged'] = 'علامت گذاری شده';
+$labels['unanswered'] = 'پاسخ داده نشده';
+$labels['filter'] = 'فیلتر';
$labels['compact'] = 'فشرده';
$labels['empty'] = 'خالی';
$labels['purge'] = 'خرد کردن';
$labels['unlimited'] = 'نامحدود';
$labels['quicksearch'] = 'جستجوی سریع';
$labels['resetsearch'] = 'شروع مجدد جستجو';
+$labels['openinextwin'] = 'نمایش در صفحه جدید';
$labels['compose'] = 'نوشتن پیغام';
$labels['savemessage'] = 'ذخیرهی این پیشنویس';
$labels['sendmessage'] = 'ارسال پیغام';
$labels['alwaysshow'] = 'را نمایش بده $sender همیشه عکسهای دریافتی از ';
$labels['htmltoggle'] = 'HTML';
$labels['plaintoggle'] = 'متن ساده';
+$labels['savesentmessagein'] = 'ذخیره پیغام ارسالی در';
+$labels['dontsave'] = 'ذخیره نکن';
+$labels['maxuploadsize'] = 'مجاز می باشد $size حجم فایل حداکثر تا میزان ';
$labels['addcc'] = 'افزودن رونوشت';
$labels['addbcc'] = 'افزودن رونوشت مخفی';
$labels['addreplyto'] = 'افزودن پاسخ-به';
$labels['contactsfromto'] = ' تا $count از $to تا $from تماسهای';
$labels['print'] = 'چاپ';
$labels['export'] = 'صدور';
+$labels['exportvcards'] = 'صدور اطلاعات تماس ها با فرمت Vcard';
$labels['previouspage'] = 'نمایش دستهی قبلی';
$labels['firstpage'] = 'نمایش دستهی اول';
$labels['nextpage'] = 'نمایش دستهی بعدی';
$labels['lastpage'] = 'نمایش دستهی آخر';
$labels['groups'] = 'گروهها';
$labels['personaladrbook'] = 'نشانیهای شخصی';
+$labels['import'] = 'وارد کردن ';
+$labels['importcontacts'] = 'وارد کردن تماسها';
+$labels['importfromfile'] = ':ورود اطلاعات از فایل ';
+$labels['importreplace'] = 'جایگزینی دفترچه آدرس کامل';
+$labels['importtext'] = 'شما میتوانید اطلاعات تماس ها را به دفترچه تلفن موجود منتقل کنید. <br/> ما در حال حاضر امکان انتقال آدرسها را با فرمت <a href="http://en.wikipedia.org/wiki/VCard">vCard</a> برای شما فراهم نموده ایم.';
+$labels['done'] = 'انجام شد';
$labels['settingsfor'] = 'تنظیمات';
$labels['preferences'] = 'ترجیحات';
$labels['userpreferences'] = 'ترجیحات کاربر';
$labels['newitem'] = 'مورد جدید';
$labels['edititem'] = 'ویرایش مورد';
$labels['setdefault'] = 'پیشفرض کن';
+$labels['autodetect'] = 'خودکار';
$labels['language'] = 'زبان';
$labels['timezone'] = 'محدودهی زمانی';
$labels['pagesize'] = 'سطر در صفحه';
$labels['htmleditor'] = 'HTML نوشتن پیغامهای';
$labels['htmlsignature'] = 'HTML امضای';
$labels['previewpane'] = 'نمایش قاب پیشنمایش';
+$labels['skin'] = 'پوسته ظاهری';
$labels['logoutclear'] = 'تمیز کردن زباله دان در هنگام خروچ';
$labels['logoutcompact'] = 'فشرده سازی صندوق در هنگام خروچ';
$labels['uisettings'] = 'محیط کاربری';
$labels['ignore'] = 'نادیده گیری';
$labels['readwhendeleted'] = 'در هنگام پاک کردن، پیغام را به عنوان خوانده شده علامت بزن';
$labels['flagfordeletion'] = 'پیغام را بجای پاک کردن، برای پاک شدن آماده کن ';
+$labels['skipdeleted'] = 'پیغام های حذف شده را نمایش نده';
+$labels['showremoteimages'] = 'تصاویر لینک شده را نمایش بده';
+$labels['fromknownsenders'] = 'از سوی فرستنده شناس';
+$labels['always'] = 'همواره';
$labels['showinlineimages'] = 'نمایش عکس های الصاق شده در پایین پیغام';
$labels['autosavedraft'] = 'ذخیرهی خودکار پیشنویس';
$labels['everynminutes'] = 'دقیقه $n هر';
+$labels['keepaliveevery'] = 'دقیقه/ها $n هر';
+$labels['keepalive'] = 'بررسی پیغام جدید روی';
$labels['never'] = 'هرگز';
$labels['messagesdisplaying'] = 'نمایش داده شدن پیغام ها';
$labels['messagescomposition'] = 'نوشته شدن پیغام ها';
+$labels['mimeparamfolding'] = 'عناوین پیوستی';
+$labels['2231folding'] = 'Full RFC 2231 (Thunderbird)';
+$labels['miscfolding'] = 'RFC 2047/2231 (MS Outlook)';
+$labels['2047folding'] = 'Full RFC 2047 (سایر)';
+$labels['advancedoptions'] = 'گزینه های پیشرفته';
+$labels['focusonnewmessage'] = 'مشخص نمودن پیغام جدید';
+$labels['checkallfolders'] = 'همه پوشه ها رو برای مشاهده پیغام های جدید بگردید';
$labels['folder'] = 'پوشه';
$labels['folders'] = 'پوشهها';
$labels['foldername'] = 'نام پوشه';
$labels['renamefolder'] = 'تغییر نام پوشه';
$labels['deletefolder'] = 'حذف پوشه';
$labels['managefolders'] = 'مدیریت پوشهها';
+$labels['specialfolders'] = 'پوشه های ویژه';
$labels['sortby'] = 'مرتبسازی بر اساس';
$labels['sortasc'] = 'مرتبسازی صعودی';
$labels['sortdesc'] = 'مرتبسازی نزولی';
+$labels['B'] = 'بایت';
+$labels['KB'] = 'کیلو بایت';
+$labels['MB'] = 'مگابایت';
+$labels['GB'] = 'گیگا بایت';
?>
| language/fa/messages.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
-| Author: Mohammad Ebrahim Mohammadi Panah <mebrahim@gmail.com> |
-| Anoosh <anoosher2003@yahoo.com> |
+| Author: Mohammad Ebrahim Mohammadi Panah <mebrahim at gmail.com> |
+| Anoosh <anoosher2003 at yahoo.com> |
+| Nader Aghazadeh <Nader.aghazadeh at gmail.com> |
+-----------------------------------------------------------------------+
@version $Id$
$messages['nocontactsfound'] = 'هیج تماسی پیدا نشد';
$messages['contactnotfound'] = 'تماس درخواست شده پیدا نشد';
$messages['sendingfailed'] = 'ناموفق در فرستادن پیغام';
+$messages['senttooquickly'] = 'دقیقه صبر کنید $sec لطفا قبل از ارسال این پیغام ';
+$messages['errorsavingsent'] = 'در لحظه ذخیره پیغام ارسال شده ، مشکل به وجود آمد';
$messages['errorsaving'] = 'هنگام ذخیرهسازی، اشکالی پیش آمد';
$messages['errormoving'] = 'ناتوان در انتقال پیغام';
$messages['errordeleting'] = 'ناتوان در حذف پیغام';
$messages['deletemessagesconfirm'] = 'آیا واقعاً میخواهید پیغام (های) انتخاب شده را حذف کنید؟';
$messages['deletefolderconfirm'] = 'آیا واقعاً میخواهید این پوشه را حذف کنید؟';
$messages['purgefolderconfirm'] = 'آیا واقعاً میخواهید همهی پیغامهای داخل این پوشه را حذف کنید؟';
+$messages['foldercreating'] = '...در حال ایجاد پوشه ';
+$messages['folderdeleting'] = '...در حال حذف پوشه ';
+$messages['folderrenaming'] = '...در حال تغییر نام پوشه ';
+$messages['foldermoving'] = '...در حال انتقال پوشه ';
$messages['formincomplete'] = 'فرم کاملاً پر نشده بود';
$messages['noemailwarning'] = 'لطفاً یک نشانی ایمیل معتبر وارد کنید';
$messages['nonamewarning'] = 'لطفاً یک نام وارد کنید';
$messages['nopagesizewarning'] = 'لطفاً یک اندازه برای صفحه وارد کنید';
+$messages['nosenderwarning'] = 'لطفاً آدرس فرستنده ایمیل را وارد کنید';
$messages['norecipientwarning'] = 'لطفاً حداقل یک گیرنده وارد کنید';
$messages['nosubjectwarning'] = 'قسمت \"موضوع\" خالی است. آیا میخواهید اکنون وارد کنید؟';
$messages['nobodywarning'] = 'این پیغام بدون متن ارسال شود؟';
$messages['nodeletelastidentity'] = '.نمیتوانید این هویت را حذف کنید، زیرا آخرین هویت شماست';
$messages['addsubfolderhint'] = 'پوشه به عنوان زیرپوشه ای ساخته خواهد شد که هم اکنون انتخاب شده است';
$messages['forbiddencharacter'] = 'نام پوشه شامل یک حرف غیر مجاز است';
+$messages['selectimportfile'] = 'لطفاً فایل را جهت بارگذاری انتخاب کنید';
+$messages['addresswriterror'] = 'در دفترچه تلفن انتخابی ، اجازه نوشتن ندارید';
+$messages['importwait'] = '...در حال انتقال اطلاعات ، لطفا صبر کنید';
+$messages['importerror'] = 'سازگار نیست vcard انتقال اطلاعات متوقف شده ، فرمت فایل بارگذاری شده با فرمت';
+$messages['importconfirm'] = 'p><em>$names</em></p> </b>: متوقف شد$skipped تماس با موفقبت انتقال یافت و $inserted <b>';
+$messages['opnotpermitted'] = '!عملیات مجاز نیست';
+$messages['nofromaddress'] = 'ایمیل های گم شده در گزینه انتخاب شده';
+$messages['editorwarning'] = 'تغییر ویرایشگر متن باعث ابطال فرمت همه متن ها می شود ، آیا می خواهید با این وجود عملیات را ادامه بدهید ؟';
?>
| language/fi/labels.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Veljo Velling <veve@utu.fi> |
+-----------------------------------------------------------------------+
-@version $Id: labels.inc 2115 2008-12-04 10:21:34Z alec $
+@version $Id: labels.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/fi/messages.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Veljo Velling <veve@utu.fi> |
+-----------------------------------------------------------------------+
-@version $Id: messages.inc 2045 2008-11-11 15:09:24Z yllar $
+@version $Id: messages.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/fr_FR/labels.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| language/fr_FR/messages.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| language/ga/labels.inc |
| |
| Language file of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| language/ga/messages.inc |
| |
| Language file of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| language/gl_ES/labels.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
$labels['today'] = 'Hoxe';
$labels['checkmail'] = 'Procurar novas mensaxes';
$labels['writenewmessage'] = 'Crear unha nova mensaxe';
-$labels['replytomessage'] = 'Respostar á mensaxe';
+$labels['replytomessage'] = 'Respostar a mensaxe';
$labels['replytoallmessage'] = 'Respostar a todos';
$labels['forwardmessage'] = 'Reenviar a mensaxe';
$labels['deletemessage'] = 'Eliminar a mensaxe';
$labels['backtolist'] = 'Voltar á lista de mensaxes';
$labels['viewsource'] = 'Ver fonte';
$labels['markmessages'] = 'Marcar mensaxes';
-$labels['markread'] = 'Coma lidos';
-$labels['markunread'] = 'Coma non lidos';
-$labels['markflagged'] = 'Coma marcados';
-$labels['markunflagged'] = 'Coma non marcados';
+$labels['markread'] = 'Coma lidas';
+$labels['markunread'] = 'Coma non lidas';
+$labels['markflagged'] = 'Coma marcadas';
+$labels['markunflagged'] = 'Coma non marcadas';
$labels['select'] = 'Seleccionar';
$labels['all'] = 'Todas';
$labels['none'] = 'Ningunha';
$labels['unread'] = 'Non lidas';
+$labels['flagged'] = 'Marcadas';
+$labels['unanswered'] = 'Non respostadas';
+$labels['filter'] = 'Filtro';
$labels['compact'] = 'Compactar';
$labels['empty'] = 'Baleiro';
$labels['purge'] = 'Baleirar';
$labels['quota'] = 'Uso de disco';
$labels['unknown'] = 'desconocido';
$labels['unlimited'] = 'ilimitado';
-$labels['quick'] = 'Busca rápida';
+$labels['quicksearch'] = 'Busca rápida';
$labels['resetsearch'] = 'Restablecer a busca';
$labels['openinextwin'] = 'Abrir nunha nova fiestra';
$labels['compose'] = 'Redactar unha mensaxe';
$labels['high'] = 'Alta';
$labels['highest'] = 'A máis alta';
$labels['nosubject'] = '(Sen asunto)';
-$labels['showimages'] = 'Mostrar imaxes';
-$labels['alwaysshow'] = 'Mostrar sempre as imaxes nas mensaxes remitidas por $sender';
+$labels['showimages'] = 'Amosar imaxes';
+$labels['alwaysshow'] = 'Amosar sempre as imaxes nas mensaxes remitidas por $sender';
$labels['htmltoggle'] = 'HTML';
$labels['plaintoggle'] = 'Texto claro';
$labels['savesentmessagein'] = 'Gardar a mensaxe enviada en';
$labels['ignore'] = 'ignorar';
$labels['readwhendeleted'] = 'Marcar a mensaxe coma lida ao eliminar';
$labels['flagfordeletion'] = 'Marcar a mensaxe para eliminar no canto de eliminar';
-$labels['skipdeleted'] = 'Non mostrar as mensaxes eliminadas';
-$labels['showinlineimages'] = 'Mostrar as imaxes anexas baixo a mensaxe';
+$labels['skipdeleted'] = 'Non amosar as mensaxes eliminadas';
+$labels['showremoteimages'] = 'Amosar imaxes anexas remotas';
+$labels['fromknownsenders'] = 'de remitentes coñecidos';
+$labels['always'] = 'sempre';
+$labels['showinlineimages'] = 'Amosar as imaxes anexas baixo a mensaxe';
$labels['autosavedraft'] = 'Gardar borrador automáticamente';
$labels['everynminutes'] = 'cada $n minutos';
+$labels['keepaliveevery'] = 'cada $n minuto(s)';
+$labels['keepalive'] = 'Procurar novas mensaxes en';
$labels['never'] = 'nunca';
$labels['messagesdisplaying'] = 'Visualización das mensaxes';
$labels['messagescomposition'] = 'Composición das mensaxes';
$labels['miscfolding'] = 'RFC 2047/2231 (MS Outlook)';
$labels['2047folding'] = 'Conforme ao RFC 2047 (other)';
$labels['advancedoptions'] = 'Opcións avanzadas';
+$labels['focusonnewmessage'] = 'Enfocar o navegador se hai mensaxes novas';
+$labels['checkallfolders'] = 'Procurar novas mensaxes en tódolos cartafoles';
$labels['folder'] = 'Cartafol';
$labels['folders'] = 'Cartafoles';
$labels['foldername'] = 'Nome do cartafol';
| language/gl_ES/messages.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
$messages['errorsaving'] = 'Ocurriu un erro mentres se gardaba';
$messages['errormoving'] = 'Non puiden mover a mensaxe';
$messages['errordeleting'] = 'Non puiden eliminar a mensaxe';
-$messages['deletecontactconfirm'] = 'Quere eliminar o(s) contacto(s) seleccionados?';
+$messages['deletecontactconfirm'] = 'Quere eliminar o(s) contacto(s) seleccionado(s)?';
$messages['deletemessagesconfirm'] = 'Quere eliminar a(s) mensaxe(s) seleccionadas?';
$messages['deletefolderconfirm'] = 'Quere eliminar este cartafol?';
$messages['purgefolderconfirm'] = 'Quere eliminar tódalas mensaxes neste cartafol?';
$messages['importconfirm'] = '<b>Importáronse correctamente $inserted contactos. Ignoráronse $skipped contactos que xa existían</b>:<p><em>$names</em></p>';
$messages['opnotpermitted'] = 'Operación non permitida';
$messages['nofromaddress'] = 'Falta o enderezo de correo electrónico na identidade que escolleu';
+$messages['editorwarning'] = 'Se troca neste intre ao editor de texto plano, vai perder todo o formato do texto. Quere continuar?';
?>
| language/he_IL/labels.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| language/he_IL/messages.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| localization/hi/labels.inc |
| |
| Language file of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| localization/hi/messages.inc |
| |
| Language file of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| language/hr/labels.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Author: Edi Budimilic <edi@gemstudio.hr> |
+-----------------------------------------------------------------------+
-@version $Id: labels.inc 2115 2008-12-04 10:21:34Z alec $
+@version $Id: labels.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/hr/messages.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Author: Edi Budimilic <edi@gemstudio.hr> |
+-----------------------------------------------------------------------+
-@version $Id: messages.inc 2102 2008-12-01 10:46:11Z yllar $
+@version $Id: messages.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/hu_HU/labels.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Ervin Hegedüs <airween@damson.hu> |
+-----------------------------------------------------------------------+
-@version $Id: labels.inc 2115 2008-12-04 10:21:34Z alec $
+@version $Id: labels.inc 2254 2009-01-22 19:52:46Z yllar $
*/
$labels['all'] = 'Összes';
$labels['none'] = 'Nincs';
$labels['unread'] = 'Olvasatlan';
+$labels['flagged'] = 'Megjelölt';
+$labels['unanswered'] = 'Megválaszolatlan';
+$labels['filter'] = 'Szűrés';
$labels['compact'] = 'Tömörítés';
$labels['empty'] = 'Ürítés';
$labels['purge'] = 'Tisztítás';
$labels['unlimited'] = 'korlátlan';
$labels['quicksearch'] = 'Gyorskeresés';
$labels['resetsearch'] = 'Alapállapot';
+$labels['openinextwin'] = 'Megnyitás új ablakban';
$labels['compose'] = 'Üzenet létrehozása';
$labels['savemessage'] = 'Vázlat mentése';
$labels['sendmessage'] = 'Üzenet azonnali küldése';
$labels['alwaysshow'] = 'Képek megjelenítése mindíg ha a feladó $sender';
$labels['htmltoggle'] = 'HTML';
$labels['plaintoggle'] = 'Egyszerű szöveg';
+$labels['savesentmessagein'] = 'Elküldött üzenet mentése ide:';
+$labels['dontsave'] = 'ne mentsük';
+$labels['maxuploadsize'] = 'A maximális feltölthető fájl mérete $size';
$labels['addcc'] = 'Cc (Másolati cím) hozzáadása';
$labels['addbcc'] = 'Bcc (Titkos másolati cím) hozzáadása';
$labels['addreplyto'] = 'Válaszcím hozzáadása';
$labels['contactsfromto'] = 'Kapcsolatok: $from - $to / $count';
$labels['print'] = 'Nyomtatás';
$labels['export'] = 'Exportálás';
+$labels['exportvcards'] = 'Kapcsolatok exportálása vCard formátumban';
$labels['previouspage'] = 'Előző lap';
$labels['firstpage'] = 'Első lap';
$labels['nextpage'] = 'Következő lap';
$labels['lastpage'] = 'Utolsó lap';
$labels['groups'] = 'Csoportok';
$labels['personaladrbook'] = 'Személyes címjegyzék';
+$labels['import'] = 'Importálás';
+$labels['importcontacts'] = 'Kapcsolatok importálása';
+$labels['importfromfile'] = 'Importálás fájlból:';
+$labels['importreplace'] = 'A teljes címjegyzék cseréje';
+$labels['importtext'] = 'Feltölthet kapcsolatokat egy már létező címjegyzékből. <br/> Jelenleg a <a href="http://en.wikipedia.org/wiki/VCard">vCard</a> formátumú adatok importálása támogatott.';
+$labels['done'] = 'Kész';
$labels['settingsfor'] = 'Beállítás';
$labels['preferences'] = 'Beállítások';
$labels['userpreferences'] = 'Felhasználói beállítások';
$labels['newitem'] = 'Új elem';
$labels['edititem'] = 'Elem szerkesztése';
$labels['setdefault'] = 'Beállítás alapértelmezettnek';
+$labels['autodetect'] = 'Automatikus';
$labels['language'] = 'Nyelv';
$labels['timezone'] = 'Időzóna';
$labels['pagesize'] = 'Sorok száma egy oldalon';
$labels['ignore'] = 'hagyja figyelmen kívül';
$labels['readwhendeleted'] = 'Üzenet olvasottként jelölése törléskor';
$labels['flagfordeletion'] = 'Üzenet törlendőnek jelölése törlés helyett ';
+$labels['skipdeleted'] = 'Ne mutassuk a törölt üzeneteket';
+$labels['showremoteimages'] = 'Távoli beágyazott képek mutatása';
+$labels['fromknownsenders'] = 'csak ismert feladóktól';
+$labels['always'] = 'mindig';
$labels['showinlineimages'] = 'Csatolt képek megjelenítése az üzenet alatt';
$labels['autosavedraft'] = 'Automatikus piszkozat mentés';
$labels['everynminutes'] = 'minden $n percben';
+$labels['keepaliveevery'] = 'minden $n percben';
+$labels['keepalive'] = 'Új üzenetek keresése itt: ';
$labels['never'] = 'soha';
$labels['messagesdisplaying'] = 'Üzenetek megjelenítése';
$labels['messagescomposition'] = 'Üzenetek írása';
+$labels['mimeparamfolding'] = 'Csatolt állományok nevei';
+$labels['2231folding'] = 'Teljes RFC 2231 ( pl. Thunderbird)';
+$labels['miscfolding'] = 'RFC 2047/2231 (MS Outlook)';
+$labels['2047folding'] = 'Full RFC 2047 (egyéb)';
+$labels['advancedoptions'] = 'Haladó beállítások';
+$labels['focusonnewmessage'] = 'Beérkező új üzenet ablakának fókuszba hozása';
+$labels['checkallfolders'] = 'Új üzenetek ellenőrzése minden (al)mappában';
$labels['folder'] = 'Mappa';
$labels['folders'] = 'Mappák';
$labels['foldername'] = 'Mappa neve';
$labels['renamefolder'] = 'Mappa átnevezése';
$labels['deletefolder'] = 'Mappa törlése';
$labels['managefolders'] = 'Mappák kezelése';
+$labels['specialfolders'] = 'Különleges mappák';
$labels['sortby'] = 'Rendezés';
$labels['sortasc'] = 'növekvő';
$labels['sortdesc'] = 'csökkenő';
+$labels['B'] = 'B';
+$labels['KB'] = 'KB';
+$labels['MB'] = 'MB';
+$labels['GB'] = 'GB';
?>
| language/hu_HU/messages.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Ervin Hegedüs <airween@damson.hu> |
+-----------------------------------------------------------------------+
-@version $Id: messages.inc 1600 2008-07-21 08:52:30Z yllar $
+@version $Id: messages.inc 2254 2009-01-22 19:52:46Z yllar $
*/
$messages['nocontactsfound'] = 'Nincs kapcsolat';
$messages['contactnotfound'] = 'A kiválasztott kapcsolat nem található';
$messages['sendingfailed'] = 'Az üzenet elküldése nem sikerült';
+$messages['senttooquickly'] = 'Kérem várjon még $sec másodpercet az üzenet elküldése előtt';
+$messages['errorsavingsent'] = 'Hiba történt az elküldött üzenet mentése közben';
$messages['errorsaving'] = 'A mentés során hiba lépett fel';
$messages['errormoving'] = 'Az üzenetet nem sikerült áthelyezni';
$messages['errordeleting'] = 'Az üzenetet nem sikerült törölni';
$messages['deletemessagesconfirm'] = 'Biztos, hogy törölni szeretnéd a kijelölt üzenete(ke)t?';
$messages['deletefolderconfirm'] = 'Biztos, hogy törölni szeretnéd ezt a mappát?';
$messages['purgefolderconfirm'] = 'Biztos vagy benne, hogy az összes üzenet törölhető?';
+$messages['foldercreating'] = 'Mappa létrehozása...';
+$messages['folderdeleting'] = 'Mappa törlése...';
+$messages['folderrenaming'] = 'Mappa átnevezése...';
+$messages['foldermoving'] = 'Mappa mozgatása...';
$messages['formincomplete'] = 'Az űrlap hiányosan lett kitöltve';
$messages['noemailwarning'] = 'Adj meg egy valós e-mail címet';
$messages['nonamewarning'] = 'Adj meg egy nevet';
$messages['nopagesizewarning'] = 'Add meg a papír méretét';
+$messages['nosenderwarning'] = 'Kérem adja meg a feladó email címét';
$messages['norecipientwarning'] = 'Legalább egy címzettet adj meg';
$messages['nosubjectwarning'] = 'A \"Tárgy\" mező üres. Szeretnéd most kitölteni?';
$messages['nobodywarning'] = 'Elküldöd az üzenetet tárgy nélkül?';
$messages['nodeletelastidentity'] = 'Nem törölheti ezt a profilt, ez az egyetlen';
$messages['addsubfolderhint'] = 'Az új könyvtárat az aktuálisan kiválasztott alkönyvtáraként fogjuk létrehozni';
$messages['forbiddencharacter'] = 'A mappa neve tiltott karaktert tartalmaz';
+$messages['selectimportfile'] = 'Kérjük válassza ki a feltölteni kívánt fájlt';
+$messages['addresswriterror'] = 'A kiválasztott címjegyzék nem írható';
+$messages['importwait'] = 'Importálás folyamatban, kérem várjon...';
+$messages['importerror'] = 'Az importálás sikertelen! A feltöltött állomány nem egy érvényes vCard fájl.';
+$messages['importconfirm'] = '<b>Sikeresen importálásra került $inserted kapcsolat, kihagyva $skipped már létező bejegyzés</b>:<p><em>$names</em></p>';
+$messages['opnotpermitted'] = 'A művelet nem megengedett!';
+$messages['nofromaddress'] = 'Hiányzó email cím a kiválasztott feladónál';
+$messages['editorwarning'] = 'Az egyszerű szöveges formátumra való váltás az összes formázás elvesztésével jár. Biztosan folytatja?';
?>
| language/am/labels.inc |
| |
| Language file of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Author: Vahan Yerkanian <vahan@arminco.com> |
+-----------------------------------------------------------------------+
- @version $Id: labels.inc 1160 2008-03-01 15:32:44Z yllar $
+ @version $Id: labels.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/am/messages.inc |
| |
| Language file of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Author: Vahan Yerkanian <vahan@arminco.com> |
+-----------------------------------------------------------------------+
- @version $Id: messages.inc 1160 2008-03-01 15:32:44Z yllar $
+ @version $Id: messages.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/id_ID/labels.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
$labels['inbox'] = 'Kotak Masuk';
$labels['drafts'] = 'Daftar tunggu';
$labels['sent'] = 'Terkirim';
-$labels['trash'] = 'Item-itenm tergapus';
+$labels['trash'] = 'Surat Terhapus';
$labels['junk'] = 'Sampah';
$labels['subject'] = 'Judul';
$labels['from'] = 'Pengirim';
$labels['cc'] = 'Lampiran';
$labels['bcc'] = 'Lampiran tersembunyi';
$labels['replyto'] = 'Balas kepada';
-$labels['date'] = 'Tangal';
+$labels['date'] = 'Tanggal';
$labels['size'] = 'Ukuran';
$labels['priority'] = 'Prioritas';
$labels['organization'] = 'Organisasi';
$labels['reply-to'] = 'Balas kepada';
-$labels['mailboxlist'] = 'Map-map';
+$labels['mailboxlist'] = 'Daftar Kotak Surat';
$labels['messagesfromto'] = 'Pesan $from kepada $to sebanyak $count';
$labels['messagenrof'] = 'Pesan $nr sebanyak $count';
-$labels['moveto'] = 'dipindahkan...';
-$labels['download'] = 'unduh';
+$labels['moveto'] = 'Pindahkan ke...';
+$labels['download'] = 'Dnduh';
$labels['filename'] = 'Nama berkas';
$labels['filesize'] = 'Ukuran berkas';
$labels['preferhtml'] = 'Lebih suka HTML';
$labels['htmlmessage'] = 'Pesan HTML';
-$labels['prettydate'] = 'Tanggal cantik';
-$labels['addtoaddressbook'] = 'Tambahkan ke buku tamu';
+$labels['prettydate'] = 'Tanggal Cantik';
+$labels['addtoaddressbook'] = 'Tambahkan Pada Buku Tamu';
$labels['sun'] = 'Min';
$labels['mon'] = 'Sen';
$labels['tue'] = 'Sel';
$labels['checkmail'] = 'Periksa pesan baru';
$labels['writenewmessage'] = 'Buat pesan baru';
$labels['replytomessage'] = 'Balas pesan';
-$labels['replytoallmessage'] = 'balas ke pengirim dan semua penerima';
+$labels['replytoallmessage'] = 'Balas kepada pengirim dan semua penerima';
$labels['forwardmessage'] = 'Teruskan pesan';
$labels['deletemessage'] = 'Pindahkan pesan ke tong sampah';
$labels['movemessagetotrash'] = 'Pindahkan pesan ke tong sampah';
-$labels['printmessage'] = 'cetak pesan ini';
+$labels['printmessage'] = 'Cetak pesan ini';
$labels['previousmessage'] = 'Perlihatkan pesan sebelumnya';
$labels['previousmessages'] = 'Perlihatkan kumpulan pesan-pesan sebelumnya';
$labels['firstmessage'] = 'Perlihatkan pesan pertama';
$labels['all'] = 'Semua';
$labels['none'] = 'Tidak satupun';
$labels['unread'] = 'Belum terbaca';
+$labels['flagged'] = 'Ditandai';
+$labels['unanswered'] = 'Belum terjawab';
+$labels['filter'] = 'Penyaringan';
$labels['compact'] = 'Ramping';
$labels['empty'] = 'Kosong';
$labels['purge'] = 'Kosongkan';
$labels['unlimited'] = 'Tidak terbatas';
$labels['quicksearch'] = 'Pencarian cepat';
$labels['resetsearch'] = 'Atur ulang pencarian';
+$labels['openinextwin'] = 'Buka dalam jendela baru';
$labels['compose'] = 'Tulis sebuah pesan';
-$labels['savemessage'] = 'Simpan daftar tunggu ini';
+$labels['savemessage'] = 'Simpan konsep surat ini';
$labels['sendmessage'] = 'Kirim pesan sekarang';
$labels['addattachment'] = 'Sisipkan sebuah berkas';
-$labels['charset'] = 'set karakter';
+$labels['charset'] = 'Set karakter';
$labels['editortype'] = 'Tipe editor';
$labels['returnreceipt'] = 'Kembalikan penerima';
$labels['checkspelling'] = 'Pemeriksaan ejaan';
$labels['resumeediting'] = 'Lanjutkan mengedit';
$labels['revertto'] = 'Balik ke';
$labels['attachments'] = 'Sisispan';
-$labels['upload'] = 'unggah';
+$labels['upload'] = 'Unggah';
$labels['close'] = 'Tutup';
$labels['low'] = 'Rendah';
-$labels['lowest'] = 'Terrendah';
+$labels['lowest'] = 'Paling Rendah';
$labels['normal'] = 'Normal';
$labels['high'] = 'Tinggi';
-$labels['highest'] = 'tertinggi';
+$labels['highest'] = 'Paling tinggi';
$labels['nosubject'] = '(tanpa judul)';
$labels['showimages'] = 'Tampilkan gambar';
$labels['alwaysshow'] = 'Selalu tampilkan gambar dari $sender';
$labels['htmltoggle'] = 'HTML';
-$labels['plaintoggle'] = 'Text murni';
+$labels['plaintoggle'] = 'Teks murni';
$labels['savesentmessagein'] = 'Simpan pesan terkirim di';
$labels['dontsave'] = 'Jangan disimpan';
+$labels['maxuploadsize'] = 'Ukuran file maksimal adalah $size';
$labels['addcc'] = 'Tambah Cc';
$labels['addbcc'] = 'Tambah Bcc';
$labels['addreplyto'] = 'Tambah Balas Ke';
$labels['contactsfromto'] = 'Kontak $from kepada $to sebanyak $count';
$labels['print'] = 'Cetak';
$labels['export'] = 'Ekspor';
+$labels['exportvcards'] = 'Ekspor kontak dalam format vCard';
$labels['previouspage'] = 'Perlihatkan kumpulan sebelumnya';
$labels['firstpage'] = 'Perlihatkan kumpulan pertama';
$labels['nextpage'] = 'Perlihatkan kumpulan selanjutnya';
$labels['lastpage'] = 'Perlihatkan kumpulan terakhir';
$labels['groups'] = 'Kelompok';
$labels['personaladrbook'] = 'Alamat personal';
+$labels['import'] = 'Import';
+$labels['importcontacts'] = 'Import kontak';
+$labels['importfromfile'] = 'Import dari berkas:';
+$labels['importreplace'] = 'Ganti seluruh buku alamat';
+$labels['importtext'] = 'Anda bisa mengunggah kontak dari buku alamat yang sudah ada.<br/>Kami kebetulan mendukung pengimportan alamat dari format data <a href="http://en.wikipedia.org/wiki/VCard">vCard</a>.';
$labels['settingsfor'] = 'Pengaturan untuk';
$labels['preferences'] = 'Pilihan';
$labels['userpreferences'] = 'Pilihan pengguna';
$labels['newitem'] = 'Item baru';
$labels['edititem'] = 'Ubah item';
$labels['setdefault'] = 'Pengaturan Awal';
+$labels['autodetect'] = 'Otomatis';
$labels['language'] = 'Bahasa';
$labels['timezone'] = 'Daerah Waktu';
$labels['pagesize'] = 'Baris per halaman';
$labels['ignore'] = 'acuhkan';
$labels['readwhendeleted'] = 'Tandai pesan sebagai terbaca saat dihapus';
$labels['flagfordeletion'] = 'Tandai pesan untuk penghapusan daripada dihapus';
+$labels['skipdeleted'] = 'Jangan tampilkan pesan terhapus';
+$labels['showremoteimages'] = 'Tampilkan remote inline images';
+$labels['fromknownsenders'] = 'dari pengirim yang dikenal';
+$labels['always'] = 'selalu';
$labels['showinlineimages'] = 'Tampilkan gambar terlampir dibawah pesan';
$labels['autosavedraft'] = 'Otomatis menyimpan pesan tertunda';
$labels['everynminutes'] = 'setiap $n menit';
+$labels['keepaliveevery'] = 'setiap $n menit';
+$labels['keepalive'] = 'Periksa pesan baru saat';
$labels['never'] = 'tidak pernah';
$labels['messagesdisplaying'] = 'Penampilan Pesan';
$labels['messagescomposition'] = 'Pengaturan Pesan';
+$labels['mimeparamfolding'] = 'Nama lampiran';
+$labels['2231folding'] = 'Full RFC 2231 (Thunderbird)';
+$labels['miscfolding'] = 'RFC 2047/2231 (MS Outlook)';
+$labels['2047folding'] = 'Full RFC 2047 (other)';
+$labels['advancedoptions'] = 'Pilihan canggih';
+$labels['focusonnewmessage'] = 'Pusatkan jendela broswer saat ada pesan baru';
+$labels['checkallfolders'] = 'Periksa semua map untuk pesan baru';
$labels['folder'] = 'Map';
$labels['folders'] = 'Map-map';
$labels['foldername'] = 'Nama map';
$labels['sortby'] = 'Urut berdasarkan';
$labels['sortasc'] = 'Urut menaik';
$labels['sortdesc'] = 'Urut menurun';
+$labels['B'] = 'B';
+$labels['KB'] = 'KB';
+$labels['MB'] = 'MB';
+$labels['GB'] = 'GB';
?>
| language/id_ID/messages.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
$messages['nocontactsfound'] = 'Kontak tidak ditemukan';
$messages['contactnotfound'] = 'Kontak yang diminta tidak ditemukan';
$messages['sendingfailed'] = 'Pengiriman pesan gagal';
+$messages['senttooquickly'] = 'Mohon tunggu $sec detik. sebelum mengirim pesan ini';
$messages['errorsavingsent'] = 'Error ketika menyimpan pesan terkirim';
$messages['errorsaving'] = 'Error ketika menyimpan';
$messages['errormoving'] = 'Pesan tidak bisa dipindahkan';
$messages['deletemessagesconfirm'] = 'Yakin menghapus pesan terpilih?';
$messages['deletefolderconfirm'] = 'Apakah anda benar-benar ingin menghapus map ini?';
$messages['purgefolderconfirm'] = 'Yakin menghapus semua pesan pada map ini?';
+$messages['foldercreating'] = 'Membuat map...';
+$messages['folderdeleting'] = 'Menghapus map...';
+$messages['folderrenaming'] = 'EMngubah nama map...';
+$messages['foldermoving'] = 'Memindahkan map...';
$messages['formincomplete'] = 'Blangko tidak terisi semua';
$messages['noemailwarning'] = 'Tolong masukkan alamat email yang valid';
$messages['nonamewarning'] = 'Tolong masukkan nama';
$messages['nopagesizewarning'] = 'Tolong masukkan ukuran halaman';
+$messages['nosenderwarning'] = 'Mohon memasukkan alamat e-mail pengirim';
$messages['norecipientwarning'] = 'Tolong masukkan sedikitnya satu penerima';
$messages['nosubjectwarning'] = '"Judul" kosong. Isi judul sekarang?';
$messages['nobodywarning'] = 'Kirim pesan ini tanpa teks?';
$messages['nodeletelastidentity'] = 'Anda tidak bida mengapus identitas ini, ini identitas yang terakhir';
$messages['addsubfolderhint'] = 'Folder ini akan dibuat sebagai subfolder pada folder yang terpilih';
$messages['forbiddencharacter'] = 'Nama folder mengandung karakter terlarang';
+$messages['selectimportfile'] = 'Mohon pilih sebuah berkas untuk diunggah';
+$messages['addresswriterror'] = 'Buku alamat terpilih tidak dapat ditulisi';
+$messages['importwait'] = 'Sedang mengimpor, harap menunggu...';
+$messages['importerror'] = 'Gagal mengimpor! Berkas terunggah bukan berkas vCard yang valid';
+$messages['importconfirm'] = '<b>Berhasil mengimpor $inserted kontak, $skipped entri dilewati</b>:<p><em>$names</em></p>';
+$messages['opnotpermitted'] = 'Operasi tidak diperbolehkan!';
+$messages['nofromaddress'] = 'kekurangan alamat e-mail pada identitas terpilih';
+$messages['editorwarning'] = 'Beralih pada editor teks murni akan mengakibatkan semua pemformatan teks hilang. Lanjutkan?';
?>
| program/localization/index.inc |
| |
| This file is part of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
| Author: Thomas Bruederli <roundcube@gmail.com> |
+-----------------------------------------------------------------------+
- $Id: index.inc 2039 2008-11-04 20:10:28Z alec $
+ $Id: index.inc 2284 2009-02-09 12:47:50Z yllar $
*/
'sq_AL' => 'Albanian',
'ar_SA' => 'Arabic',
'hy_AM' => 'Armenian',
+ 'ast' => 'Asturianu',
'az_AZ' => 'Azerbaijani',
'bs_BA' => 'Bosnian (Serbian Latin)',
'bg_BG' => 'Bulgarian',
+ 'bn_BD' => 'Bengali',
'ca_ES' => 'Català',
'cy_GB' => 'Cymraeg',
'zh_CN' => 'Chinese (Simplified)',
'de_CH' => 'Deutsch (Schweiz)',
'en_GB' => 'English (GB)',
'en_US' => 'English (US)',
+ 'es_AR' => 'Spanish (Argentina)',
'es_ES' => 'Español',
'eo' => 'Esperanto',
'et_EE' => 'Estonian',
/*
- +-----------------------------------------------------------------------+
- | language/en_GB/labels.inc |
- | |
- | Language file of the RoundCube Webmail client |
- | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland |
- | Licensed under the GNU GPL |
- | |
- +-----------------------------------------------------------------------+
- | Author: Weiran Zhang (weiran@weiran.co.uk) |
- +-----------------------------------------------------------------------+
-
- @version $Id: labels.inc 543 2007-04-28 18:07:12Z thomasb $
++-----------------------------------------------------------------------+
+| language/is_IS/labels.inc |
+| |
+| Language file of the RoundCube Webmail client |
+| Copyright (C) 2009, RoundCube Dev. - Switzerland |
+| Licensed under the GNU GPL |
+| |
++-----------------------------------------------------------------------+
+| Author: Hakon Orri Asgeirsson <hakon at opex.is> |
++-----------------------------------------------------------------------+
+
+@version $Id: labels.inc 543 2007-04-28 18:07:12Z thomasb $
*/
$labels = array();
-
-// login page
-$labels['welcome'] = 'Vefpóstur Vodafone';
-$labels['username'] = 'Netfang';
-$labels['password'] = 'Lykilorð';
-$labels['server'] = 'Server';
-$labels['login'] = 'Innskrá';
-
-// taskbar
-$labels['logout'] = 'Útskrá';
-$labels['mail'] = 'Tölvupóstur';
+$labels['welcome'] = 'Vefpóstur';
+$labels['username'] = 'Netfang';
+$labels['password'] = 'Lykilorð';
+$labels['server'] = 'Server';
+$labels['login'] = 'Innskrá';
+$labels['logout'] = 'Útskrá';
+$labels['mail'] = 'Tölvupóstur';
$labels['settings'] = 'Stillingar';
$labels['addressbook'] = 'Netfangaskrá';
-
-// mailbox names
-$labels['inbox'] = 'Innhólf';
+$labels['inbox'] = 'Innhólf';
$labels['drafts'] = 'Drög';
-$labels['sent'] = 'Sent';
-$labels['trash'] = 'Eyddir hlutir';
-$labels['junk'] = 'Ruslpóstur';
-
-// message listing
+$labels['sent'] = 'Sent';
+$labels['trash'] = 'Eyddir hlutir';
+$labels['junk'] = 'Ruslpóstur';
$labels['subject'] = 'Efni';
-$labels['from'] = 'Sendandi';
-$labels['to'] = 'Viðtakandi';
-$labels['cc'] = 'Afrit';
-$labels['bcc'] = 'Blint afrit';
+$labels['from'] = 'Sendandi';
+$labels['to'] = 'Viðtakandi';
+$labels['cc'] = 'Afrit';
+$labels['bcc'] = 'Blint afrit';
$labels['replyto'] = 'Reply-To';
-$labels['date'] = 'Dags';
-$labels['size'] = 'Stærð';
+$labels['date'] = 'Dags';
+$labels['size'] = 'Stærð';
$labels['priority'] = 'Forgangur';
$labels['organization'] = 'Stofnun';
-
-// aliases
-$labels['reply-to'] = $labels['replyto'];
-
+$labels['reply-to'] = 'Reply-To';
$labels['mailboxlist'] = 'Möppur';
$labels['messagesfromto'] = 'Skeyti $from til $to af $count';
$labels['messagenrof'] = 'Skeyti $nr af $count';
-
-$labels['moveto'] = 'færa í...';
+$labels['moveto'] = 'færa í...';
$labels['download'] = 'sækja';
-
$labels['filename'] = 'Skrárnafn';
$labels['filesize'] = 'Skrárstærð';
-
$labels['preferhtml'] = 'Vil HTML';
$labels['htmlmessage'] = 'HTML skeyti';
$labels['prettydate'] = 'Fallegar dagsetningar';
-
$labels['addtoaddressbook'] = 'Bæta í netfangaskrá';
-
-// weekdays short
$labels['sun'] = 'sun';
$labels['mon'] = 'mán';
$labels['tue'] = 'þri';
$labels['thu'] = 'fim';
$labels['fri'] = 'fös';
$labels['sat'] = 'lau';
-
-// weekdays long
-$labels['sunday'] = 'sunnudagur';
-$labels['monday'] = 'mánudagur';
-$labels['tuesday'] = 'þriðjudagur';
+$labels['sunday'] = 'sunnudagur';
+$labels['monday'] = 'mánudagur';
+$labels['tuesday'] = 'þriðjudagur';
$labels['wednesday'] = 'miðvikudagur';
-$labels['thursday'] = 'fimmtudagur';
-$labels['friday'] = 'föstudagur';
-$labels['saturday'] = 'laugardagur';
-
+$labels['thursday'] = 'fimmtudagur';
+$labels['friday'] = 'föstudagur';
+$labels['saturday'] = 'laugardagur';
+$labels['jan'] = 'Jan';
+$labels['feb'] = 'Feb';
+$labels['mar'] = 'Mar';
+$labels['apr'] = 'Apr';
+$labels['may'] = 'Maí';
+$labels['jun'] = 'Jún';
+$labels['jul'] = 'Júl';
+$labels['aug'] = 'Ágú';
+$labels['sep'] = 'Sep';
+$labels['oct'] = 'Okt';
+$labels['nov'] = 'Nóv';
+$labels['dec'] = 'Des';
+$labels['longjan'] = 'Janúar';
+$labels['longfeb'] = 'Febrúar';
+$labels['longmar'] = 'Mars';
+$labels['longapr'] = 'Apríl';
+$labels['longmay'] = 'Maí';
+$labels['longjun'] = 'Júní';
+$labels['longjul'] = 'Júlí';
+$labels['longaug'] = 'Ágúst';
+$labels['longsep'] = 'September';
+$labels['longoct'] = 'Október';
+$labels['longnov'] = 'Nóvember';
+$labels['longdec'] = 'Desember';
$labels['today'] = 'í dag';
-
-// toolbar buttons
-$labels['checkmail'] = 'Gá að nýjum skeytum';
-$labels['writenewmessage'] = 'Búa til nýtt skeyti';
-$labels['replytomessage'] = 'Svara skeyti';
+$labels['checkmail'] = 'Gá að nýjum skeytum';
+$labels['writenewmessage'] = 'Búa til nýtt skeyti';
+$labels['replytomessage'] = 'Svara skeyti';
$labels['replytoallmessage'] = 'Svara sendanda og öllum viðtakendum';
-$labels['forwardmessage'] = 'Framsenda skeyti';
-$labels['deletemessage'] = 'Færa skeyti í rusl';
-$labels['printmessage'] = 'Prenta skeyti';
+$labels['forwardmessage'] = 'Framsenda skeyti';
+$labels['deletemessage'] = 'Eyða skeyti';
+$labels['movemessagetotrash'] = 'Færa skeyti í rusl';
+$labels['printmessage'] = 'Prenta skeyti';
+$labels['previousmessage'] = 'Sýna fyrra skeyti';
$labels['previousmessages'] = 'Sýna fyrri skammt af skeytum';
-$labels['nextmessages'] = 'Sýna næsta skammt af skeytum';
-$labels['backtolist'] = 'Til baka í skeytalista';
-$labels['viewsource'] = 'Skoða kóða';
-
+$labels['firstmessage'] = 'Sýna fyrsta skeyti';
+$labels['firstmessages'] = 'Sýna fyrsta skammtinn af skeytum';
+$labels['nextmessage'] = 'Sýna næsta skeyti';
+$labels['nextmessages'] = 'Sýna næsta skammt af skeytum';
+$labels['lastmessage'] = 'Sýna síðasta skeytið';
+$labels['lastmessages'] = 'Sýna síðasta skammtinn af skeytum';
+$labels['backtolist'] = 'Til baka í skeytalista';
+$labels['viewsource'] = 'Skoða kóða';
+$labels['markmessages'] = 'Merkja skeyti';
+$labels['markread'] = 'Sem lesin';
+$labels['markunread'] = 'Sem ólesin';
+$labels['markflagged'] = 'Sem flögguð';
+$labels['markunflagged'] = 'Sem óflögguð';
$labels['select'] = 'Velja';
$labels['all'] = 'Allt';
$labels['none'] = 'Ekkert';
$labels['unread'] = 'Ólesið';
-
+$labels['flagged'] = 'Flaggað';
+$labels['unanswered'] = 'Ósvarað';
+$labels['filter'] = 'Sía';
$labels['compact'] = 'Pakka';
$labels['empty'] = 'Tæma';
$labels['purge'] = 'Hreinsa';
-
$labels['quota'] = 'Gagnamagn';
-
-
-// message compose
-$labels['compose'] = 'Semja skeyti';
-$labels['savemessage'] = 'Vista drög';
-$labels['sendmessage'] = 'Senda skeytið núna';
-$labels['addattachment'] = 'Hengja við';
-$labels['charset'] = 'Stafasett';
-
-$labels['returnreceipt'] = 'Kvittun við lestur';
-
+$labels['unknown'] = 'óþekkt';
+$labels['unlimited'] = 'ótakmarkað';
+$labels['quicksearch'] = 'Flýtileit';
+$labels['resetsearch'] = 'Tæma leit';
+$labels['openinextwin'] = 'Opna í nýjum glugga';
+$labels['compose'] = 'Semja skeyti';
+$labels['savemessage'] = 'Vista drög';
+$labels['sendmessage'] = 'Senda skeytið núna';
+$labels['addattachment'] = 'Hengja við';
+$labels['charset'] = 'Stafasett';
+$labels['editortype'] = 'Gerð ritils';
+$labels['returnreceipt'] = 'Kvittun við lestur';
+$labels['checkspelling'] = 'Villuleita';
+$labels['resumeediting'] = 'Aftur í ritham';
+$labels['revertto'] = 'Hverfa til';
$labels['attachments'] = 'Viðhengi';
$labels['upload'] = 'Senda';
-$labels['close'] = 'Loka';
-
-$labels['low'] = 'Lágt';
-$labels['lowest'] = 'Lægst';
-$labels['normal'] = 'Venjulegt';
-$labels['high'] = 'Hátt';
+$labels['close'] = 'Loka';
+$labels['low'] = 'Lágt';
+$labels['lowest'] = 'Lægst';
+$labels['normal'] = 'Venjulegt';
+$labels['high'] = 'Hátt';
$labels['highest'] = 'Hæst';
-
-$labels['nosubject'] = '(ekkert efni)';
+$labels['nosubject'] = '(ekkert efni)';
$labels['showimages'] = 'Birta myndir';
-
-$labels['editortype'] = 'Gerð ritils';
+$labels['alwaysshow'] = 'Sýna alltaf myndir frá $sender';
$labels['htmltoggle'] = 'HTML';
$labels['plaintoggle'] = 'Einfaldur';
-
-$labels['checkspelling'] = 'Villuleita';
-$labels['resumeediting'] = 'Aftur í ritham';
-$labels['revertto'] = 'Hverfa til';
-
+$labels['savesentmessagein'] = 'Vista send skeyti í ';
+$labels['dontsave'] = 'ekki vista';
+$labels['maxuploadsize'] = 'Leyfileg hámarksstærð skjals er $size';
$labels['addcc'] = 'Bæta við Cc';
$labels['addbcc'] = 'Bæta við Bcc';
$labels['addreplyto'] = 'Bæta við Reply-To';
-
-
-// address boook
-$labels['name'] = 'Nafn til birtingar';
+$labels['mdnrequest'] = 'Sendandi þessa skeytið hefur óskað þess að þú látir vita að þú hafir lesið þetta skeyti. Viltu láta hann vita?';
+$labels['receiptread'] = 'Kvittun (lesa)';
+$labels['yourmessage'] = 'Þetta er kvittun fyrir skeytið';
+$labels['receiptnote'] = 'ATH: Þessi kvittun segir aðeins til um að skeytið kom upp á skjánum á viðtakanda. Það er engin sönnun um að hann hafi lesið eða skilið innihaldið.';
+$labels['name'] = 'Nafn til birtingar';
$labels['firstname'] = 'Fornafn';
-$labels['surname'] = 'Eftirnafn';
-$labels['email'] = 'Netfang';
-$labels['mobile'] = 'Farsími';
-
+$labels['surname'] = 'Eftirnafn';
+$labels['email'] = 'Netfang';
$labels['addcontact'] = 'Bæta við nýju';
$labels['editcontact'] = 'Lagfæra';
-
-$labels['edit'] = 'Laga';
+$labels['edit'] = 'Laga';
$labels['cancel'] = 'Hætta við';
-$labels['save'] = 'Vista';
+$labels['save'] = 'Vista';
$labels['delete'] = 'Eyða';
-
-$labels['newcontact'] = 'Búa til nýtt nafnspjald';
-$labels['deletecontact'] = 'Eyða völdum netföngum';
-$labels['composeto'] = 'Skrifa skeyti til';
+$labels['newcontact'] = 'Búa til nýtt nafnspjald';
+$labels['deletecontact'] = 'Eyða völdum netföngum';
+$labels['composeto'] = 'Skrifa skeyti til';
$labels['contactsfromto'] = 'Netföng $from til $to af $count';
-$labels['print'] = 'Prenta';
-$labels['export'] = 'Flytja út';
-
-
-// settings
-$labels['settingsfor'] = 'Stillingar fyrir';
-
-$labels['preferences'] = 'Stillingar';
-$labels['userpreferences'] = 'Notendastillingar';
-$labels['editpreferences'] = 'Breyta notendastillingum';
-
-$labels['identities'] = 'Identities';
-$labels['manageidentities'] = 'Manage identities for this account';
-$labels['newidentity'] = 'New identity';
-
-$labels['newitem'] = 'Nýtt';
-$labels['edititem'] = 'Laga';
-
-$labels['setdefault'] = 'Gera sjálfgilt';
-$labels['language'] = 'Tungumál';
-$labels['timezone'] = 'Tímabelti';
-$labels['pagesize'] = 'Línur á síðu';
+$labels['print'] = 'Prenta';
+$labels['export'] = 'Flytja út';
+$labels['exportvcards'] = 'Flytja út nafnspjöld á vCard formi';
+$labels['previouspage'] = 'Sýni fyrri skammt';
+$labels['firstpage'] = 'Sýna fyrsta skammt';
+$labels['nextpage'] = 'Sýna næsta skammt';
+$labels['lastpage'] = 'Sýna síðasta skammt';
+$labels['groups'] = 'Hópar';
+$labels['personaladrbook'] = 'Persónuleg heimilisföng';
+$labels['import'] = 'Flytja inn';
+$labels['importcontacts'] = 'Flytja inn nafnspjöld';
+$labels['importfromfile'] = 'Flytja inn af skrá';
+$labels['importreplace'] = 'Skipta út allri netfangaskránni';
+$labels['importtext'] = 'Þú getur flutt inn nafnspjöld frá núverandi netfangaskrá. <br/>Nú styðjum við innflutning á netföngum á <a href="http://en.wikipedia.org/wiki/VCard">vCard</a> formi.';
+$labels['done'] = 'Afgreitt';
+$labels['settingsfor'] = 'Stillingar fyrir';
+$labels['preferences'] = 'Stillingar';
+$labels['userpreferences'] = 'Notendastillingar';
+$labels['editpreferences'] = 'Breyta notendastillingum';
+$labels['identities'] = 'Identities';
+$labels['manageidentities'] = 'Manage identities for this account';
+$labels['newidentity'] = 'New identity';
+$labels['newitem'] = 'Nýtt';
+$labels['edititem'] = 'Laga';
+$labels['setdefault'] = 'Gera sjálfgilt';
+$labels['autodetect'] = 'Sjálfvirkt';
+$labels['language'] = 'Tungumál';
+$labels['timezone'] = 'Tímabelti';
+$labels['pagesize'] = 'Línur á síðu';
$labels['signature'] = 'Undirskrift';
-$labels['dstactive'] = 'Sumar-/vetratími';
+$labels['dstactive'] = 'Sumar-/vetratími';
$labels['htmleditor'] = 'Skrifa HTML-skeyti';
$labels['htmlsignature'] = 'HTML-undirskrift';
$labels['previewpane'] = 'Sýna forskoðunarglugga';
-
-$labels['autosavedraft'] = 'Vista sjálfkrafa sem drög';
-$labels['everynminutes'] = 'á $n mínútna fresti';
-$labels['never'] = 'aldrei';
-
-$labels['folder'] = 'Mappa';
-$labels['folders'] = 'Möppur';
-$labels['foldername'] = 'Nafn möppu';
-$labels['subscribed'] = 'Valin';
-$labels['create'] = 'Búa til';
-$labels['createfolder'] = 'Búa til nýja möppu';
-$labels['deletefolder'] = 'Eyða möppu';
-$labels['managefolders'] = 'Sýsla með möppum';
+$labels['skin'] = 'Sniðmát á viðmóti';
+$labels['logoutclear'] = 'Tæma rusl við útskráningu';
+$labels['logoutcompact'] = 'Þjappa Innhólfi við útskráningu';
+$labels['uisettings'] = 'Notendasniðmát';
+$labels['serversettings'] = 'Stillingar þjóns';
+$labels['mailboxview'] = 'Pósthólfs útlit';
+$labels['mdnrequests'] = 'Viðvaranir sendanda';
+$labels['askuser'] = 'spyrja notanda';
+$labels['autosend'] = 'senda sjálfkrafa';
+$labels['ignore'] = 'hunsa';
+$labels['readwhendeleted'] = 'Merkja skeyti sem lesið þegar því er hent';
+$labels['flagfordeletion'] = 'Merkja skeyti til eyðingar í stað þess að eyða';
+$labels['skipdeleted'] = 'Ekki sýna eydd skeyti';
+$labels['showremoteimages'] = 'Sýna myndir annarsstaðar frá';
+$labels['fromknownsenders'] = 'frá þekktum sendendum';
+$labels['always'] = 'alltaf';
+$labels['showinlineimages'] = 'Sýna viðhangandi myndir fyrir neðan skeytið';
+$labels['autosavedraft'] = 'Vista sjálfkrafa sem drög';
+$labels['everynminutes'] = 'á $n mínútna fresti';
+$labels['keepaliveevery'] = '$n mínútu fresti';
+$labels['keepalive'] = 'Athuga ný skeyti á';
+$labels['never'] = 'aldrei';
+$labels['messagesdisplaying'] = 'Sýni skeyti';
+$labels['messagescomposition'] = 'Semja skeyti';
+$labels['mimeparamfolding'] = 'Nafn á viðhengjum';
+$labels['2231folding'] = 'Full RFC 2231 (Thunderbird)';
+$labels['miscfolding'] = 'RFC 2047/2231 (MS Outlook)';
+$labels['2047folding'] = 'Full RFC 2047 (other)';
+$labels['advancedoptions'] = 'Frekari möguleikar';
+$labels['focusonnewmessage'] = 'Láta glugga beinast að nýju skeyti';
+$labels['checkallfolders'] = 'Athuga ný skeyti í öllum möppum';
+$labels['folder'] = 'Mappa';
+$labels['folders'] = 'Möppur';
+$labels['foldername'] = 'Nafn möppu';
+$labels['subscribed'] = 'Valin';
+$labels['messagecount'] = 'Skeyti';
+$labels['create'] = 'Búa til';
+$labels['createfolder'] = 'Búa til nýja möppu';
+$labels['rename'] = 'Endurnefna';
$labels['renamefolder'] = 'Breyta nafni möppu';
-
-
-
+$labels['deletefolder'] = 'Eyða möppu';
+$labels['managefolders'] = 'Sýsla með möppum';
+$labels['specialfolders'] = 'Sérstakar möppur';
$labels['sortby'] = 'Raða eftir';
-$labels['sortasc'] = 'Raða vaxandi';
+$labels['sortasc'] = 'Raða vaxandi';
$labels['sortdesc'] = 'Raða minnkandi';
+$labels['B'] = 'B';
+$labels['KB'] = 'KB';
+$labels['MB'] = 'MB';
+$labels['GB'] = 'GB';
?>
| language/it/labels.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Yusef Maali <contact@yusefmaali.net> |
+-----------------------------------------------------------------------+
-@version $Id: labels.inc 2115 2008-12-04 10:21:34Z alec $
+@version $Id: labels.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/it/messages.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Yusef Maali <contact@yusefmaali.net> |
+-----------------------------------------------------------------------+
-@version $Id: messages.inc 2045 2008-11-11 15:09:24Z yllar $
+@version $Id: messages.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/ja_JP/labels.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Takashi Takamatsu <taka717@gmail.com> |
+-----------------------------------------------------------------------+
-@version $Id: labels.inc 2115 2008-12-04 10:21:34Z alec $
+@version $Id: labels.inc 2237 2009-01-17 01:55:39Z till $
*/
$labels['unread'] = '未読';
$labels['flagged'] = 'フラグあり';
$labels['unanswered'] = '未返信';
+$labels['filter'] = 'フィルタ';
$labels['compact'] = 'コンパクト';
$labels['empty'] = '空';
$labels['purge'] = '破棄';
$labels['quota'] = 'ディスク使用量';
$labels['unknown'] = '不明';
-$labels['unlimited'] = '無制限';
+$labels['unlimited'] = '制限なし';
$labels['quicksearch'] = '検索';
$labels['resetsearch'] = '検索の解除';
$labels['openinextwin'] = '新しいウィンドウで開く';
$labels['readwhendeleted'] = '削除したメールを既読にする';
$labels['flagfordeletion'] = '実際に削除せずに削除済みフラグを付ける';
$labels['skipdeleted'] = '削除済みメールを表示しない';
+$labels['showremoteimages'] = 'リモート画像の表示';
+$labels['fromknownsenders'] = '既知の送信者';
+$labels['always'] = '常に';
$labels['showinlineimages'] = 'メールに添付された画像を表示する';
$labels['autosavedraft'] = '自動的に下書きを保存';
-$labels['everynminutes'] = ' $n 分毎';
+$labels['everynminutes'] = '$n 分毎';
$labels['keepaliveevery'] = '$n 分毎';
$labels['keepalive'] = '新着メールの確認間隔';
$labels['never'] = 'しない';
$labels['2047folding'] = 'RFC 2047 準拠 (other)';
$labels['advancedoptions'] = '高度な設定';
$labels['focusonnewmessage'] = '新しいメールが届いたらブラウザにフォーカスを移す';
+$labels['checkallfolders'] = 'すべてのフォルダの新着メールを確認する';
$labels['folder'] = 'フォルダ';
$labels['folders'] = 'フォルダ一覧';
$labels['foldername'] = 'フォルダ名';
$labels['sortby'] = '整列の基準にする';
$labels['sortasc'] = '昇順で整列';
$labels['sortdesc'] = '降順で整列';
+$labels['B'] = 'B';
+$labels['KB'] = 'KB';
+$labels['MB'] = 'MB';
+$labels['GB'] = 'GB';
?>
| language/ja_JP/messages.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Takashi Takamatsu <taka717@gmail.com> |
+-----------------------------------------------------------------------+
-@version $Id: messages.inc 2093 2008-11-27 11:12:38Z alec $
+@version $Id: messages.inc 2237 2009-01-17 01:55:39Z till $
*/
$messages['successfullysaved'] = '保存しました。';
$messages['addedsuccessfully'] = 'アドレス帳への連絡先の追加しました。';
$messages['contactexists'] = 'このメールアドレスは既にアドレス帳に存在します。';
-$messages['blockedimages'] = 'プライバシーを保護するため、このメールに含まれるリモート画像はブロックされました。';
+$messages['blockedimages'] = 'プライバシー保護のため、このメールに含まれるリモート画像をブロックしました。';
$messages['encryptedmessage'] = 'このメールは暗号化されているため表示できません。';
$messages['nocontactsfound'] = '連絡先がありません。';
$messages['contactnotfound'] = '要求された連絡先が見つかりません。';
| language/ge/labels.inc |
| |
| Language file of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| language/ge/messages.inc |
| |
| Language file of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
/*
- +-----------------------------------------------------------------------+
- | localization/kr/labels.inc |
- | |
- | Language file of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
- | Licensed under the GNU GPL |
- | |
- +-----------------------------------------------------------------------+
- | Author: lordmiss <lordmiss@lordmiss.com> |
- +-----------------------------------------------------------------------+
++-----------------------------------------------------------------------+
+| localization/kr/labels.inc |
+| |
+| Language file of the RoundCube Webmail client |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
+| Licensed under the GNU GPL |
+| |
++-----------------------------------------------------------------------+
+| Author: lordmiss <lordmiss@lordmiss.com> |
++-----------------------------------------------------------------------+
- @version $Id: labels.inc 560 2007-05-17 15:01:26Z thomasb $
+@version $Id: labels.inc 560 2007-05-17 15:01:26Z thomasb $
*/
$labels['organization'] = '기관';
$labels['reply-to'] = '회신 주소';
$labels['mailboxlist'] = '폴더';
-$labels['messagesfromto'] = '$from 이 $to에게 보낸 메시지 $count 개';
-$labels['messagenrof'] = '메시지 $count 개 중 $nr 개';
+$labels['messagesfromto'] = '$count 개 중 $from 에서 $to 번 메시지';
+$labels['messagenrof'] = '$count 개 중 $nr 번 메시지';
$labels['moveto'] = '이동...';
$labels['download'] = '다운로드';
$labels['filename'] = '파일 이름';
$labels['thursday'] = '목요일';
$labels['friday'] = '금요일';
$labels['saturday'] = '토요일';
+$labels['jan'] = '1월';
+$labels['feb'] = '2월';
+$labels['mar'] = '3월';
+$labels['apr'] = '4월';
+$labels['may'] = '5월';
+$labels['jun'] = '6월';
+$labels['jul'] = '7월';
+$labels['aug'] = '8월';
+$labels['sep'] = '9월';
+$labels['oct'] = '10월';
+$labels['nov'] = '11월';
+$labels['dec'] = '12월';
+$labels['longjan'] = '1월';
+$labels['longfeb'] = '2월';
+$labels['longmar'] = '3월';
+$labels['longapr'] = '4월';
+$labels['longmay'] = '5월';
+$labels['longjun'] = '6월';
+$labels['longjul'] = '7월';
+$labels['longaug'] = '8월';
+$labels['longsep'] = '9월';
+$labels['longoct'] = '10월';
+$labels['longnov'] = '11월';
+$labels['longdec'] = '12월';
$labels['today'] = '오늘';
$labels['checkmail'] = '새 메일 확인';
$labels['writenewmessage'] = '새 메일 작성';
$labels['backtolist'] = '메일 목록으로';
$labels['viewsource'] = '소스 보기';
$labels['markmessages'] = '메시지 표시';
-$labels['markread'] = '읽은 것으로';
-$labels['markunread'] = '읽지 않은 것으로';
+$labels['markread'] = '읽은 것으로 표시';
+$labels['markunread'] = '읽지 않은 것으로 표시';
+$labels['markflagged'] = '깃발 달기';
+$labels['markunflagged'] = '깃발 내리기';
$labels['select'] = '선택';
$labels['all'] = '모두';
$labels['none'] = '없음';
$labels['unread'] = '읽지 않음';
+$labels['flagged'] = '깃발';
+$labels['unanswered'] = '답장하지 않음';
+$labels['filter'] = '필터';
$labels['compact'] = '간단하게';
$labels['empty'] = '비우기';
$labels['purge'] = '삭제';
$labels['unlimited'] = '제한 없음';
$labels['quicksearch'] = '빨리 찾기';
$labels['resetsearch'] = '찾기 리셋';
+$labels['openinextwin'] = '새 창에서 열기';
$labels['compose'] = '메일 쓰기';
$labels['savemessage'] = '드래프트 저장';
$labels['sendmessage'] = '메일 지금 보냄';
$labels['highest'] = '가장 높음';
$labels['nosubject'] = '(제목 없음)';
$labels['showimages'] = '이미지 표시';
+$labels['alwaysshow'] = '$sender 에서 온 이미지 항상 보기';
$labels['htmltoggle'] = 'HTML';
$labels['plaintoggle'] = '일반 텍스트';
+$labels['savesentmessagein'] = '보낸 메시지를 다음에 저장';
+$labels['dontsave'] = '저장하지 않음';
+$labels['maxuploadsize'] = '최대 파일 크기는 $size 입니다';
$labels['addcc'] = '참조 넣기';
$labels['addbcc'] = '숨은참조 넣기';
$labels['addreplyto'] = '회신주소 넣기';
$labels['contactsfromto'] = '$from 에서 $to 로의 연락처 $count 개';
$labels['print'] = '인쇄';
$labels['export'] = '내보내기';
+$labels['exportvcards'] = '연락처를 vCard 포맷으로 내보내기';
$labels['previouspage'] = '이전 세트 보기';
$labels['firstpage'] = '처음 세트 보기';
$labels['nextpage'] = '다음 세트 보기';
$labels['lastpage'] = '마지막 세트 보기';
$labels['groups'] = '그룹';
$labels['personaladrbook'] = '개인 주소';
+$labels['import'] = '가져오기';
+$labels['importcontacts'] = '연락처 가져오기';
+$labels['importfromfile'] = '파일에서 가져오기';
+$labels['importreplace'] = '전체 주소록을 바꿈';
+$labels['importtext'] = '연락처들을 가지고 있는 주소록에서 가져올 수 있습니다.<br/> 현재는 <a href="http://en.wikipedia.org/wiki/VCard">vCard</a> 포맷에서 가져오기를 지원합니다.';
+$labels['done'] = '완료';
$labels['settingsfor'] = '설정';
$labels['preferences'] = '환경 설정';
$labels['userpreferences'] = '사용자 환경';
$labels['newitem'] = '새 아이템';
$labels['edititem'] = '아이템 편집';
$labels['setdefault'] = '기본으로 설정';
+$labels['autodetect'] = '자동';
$labels['language'] = '언어';
$labels['timezone'] = '시간대';
$labels['pagesize'] = '페이지당 줄 수';
$labels['htmleditor'] = 'HTML 메일 쓰기';
$labels['htmlsignature'] = 'HTML 서명';
$labels['previewpane'] = '이전 구역 보기';
+$labels['skin'] = '인터페이스 스킨';
+$labels['logoutclear'] = '로그아웃할 때 휴지통 비우기';
+$labels['logoutcompact'] = '로그아웃할 때 받은편지함 압축하기';
+$labels['uisettings'] = '사용자 인터페이스';
+$labels['serversettings'] = '서버 설정';
+$labels['mailboxview'] = '메일 상자 보기';
+$labels['mdnrequests'] = '수신 확인';
+$labels['askuser'] = '사용자에게 묻기';
+$labels['autosend'] = '자동으로 보내기';
+$labels['ignore'] = '무시';
+$labels['readwhendeleted'] = '삭제할 때 메시지를 읽은 것으로 표시';
+$labels['flagfordeletion'] = '지우는 대신 지울 메시지에 깃발 달기';
+$labels['skipdeleted'] = '지운 메시지 보이지 않기';
+$labels['showremoteimages'] = '원격 이미지 보이기';
+$labels['fromknownsenders'] = '아는 발신인에게서만';
+$labels['always'] = '항상';
+$labels['showinlineimages'] = '메시지 아래에 첨부 이미지 보이기';
$labels['autosavedraft'] = '드래프트 자동 저장';
$labels['everynminutes'] = '$n 분마다';
+$labels['keepaliveevery'] = '$n 분마다';
+$labels['keepalive'] = '다음 간격마다 새 메시지 자동 체크';
$labels['never'] = '하지 않음';
+$labels['messagesdisplaying'] = '메시지 표시 중';
+$labels['messagescomposition'] = '메시지 작성 중';
+$labels['mimeparamfolding'] = '첨부 파일 이름';
+$labels['2231folding'] = 'Full RFC 2231 (선더버드)';
+$labels['miscfolding'] = 'RFC 2047/2231 (MS 아웃룻)';
+$labels['2047folding'] = 'Full RFC 2047 (다른 프로그램들)';
+$labels['advancedoptions'] = '상세 설정';
+$labels['focusonnewmessage'] = '새 메시지가 있으면 브라우저 윈도우로 포커스 이동';
+$labels['checkallfolders'] = '새 메시지를 위해 모든 폴더 체크';
$labels['folder'] = '폴더';
$labels['folders'] = '폴더';
$labels['foldername'] = '폴더 이름';
$labels['renamefolder'] = '폴더 이름 바꾸기';
$labels['deletefolder'] = '폴더 지우기';
$labels['managefolders'] = '폴더 관리';
+$labels['specialfolders'] = '특수 폴더';
$labels['sortby'] = '정렬';
$labels['sortasc'] = '오름차순으로 정렬';
$labels['sortdesc'] = '내림차순으로 정렬';
+$labels['B'] = '바이트';
+$labels['KB'] = '킬로바이트';
+$labels['MB'] = '메가바이트';
+$labels['GB'] = '기가바이트';
-?>
\ No newline at end of file
+?>
/*
- +-----------------------------------------------------------------------+
- | localization/kr/messages.inc |
- | |
- | Language file of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
- | Licensed under the GNU GPL |
- | |
- +-----------------------------------------------------------------------+
- | Author: lordmiss <lordmiss@lordmiss.com> |
- +-----------------------------------------------------------------------+
++-----------------------------------------------------------------------+
+| localization/kr/messages.inc |
+| |
+| Language file of the RoundCube Webmail client |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
+| Licensed under the GNU GPL |
+| |
++-----------------------------------------------------------------------+
+| Author: lordmiss <lordmiss@lordmiss.com> |
++-----------------------------------------------------------------------+
- @version $Id: labels.inc 560 2007-05-17 15:01:26Z thomasb $
+@version $Id: labels.inc 560 2007-05-17 15:01:26Z thomasb $
*/
$messages['nocontactsfound'] = '연락처 없음';
$messages['contactnotfound'] = '요청한 연락처가 없습니다';
$messages['sendingfailed'] = '메일을 보내지 못했습니다';
+$messages['senttooquickly'] = '이 메시지를 보내기 전에 $sec 초 동안 기다리십시오.';
+$messages['errorsavingsent'] = '보낸 메시지를 저장할 때 에러가 발생했습니다.';
$messages['errorsaving'] = '저장 중 에러가 발생했습니다';
$messages['errormoving'] = '메일을 옮길 수 없습니다';
$messages['errordeleting'] = '메일을 지울 수 없습니다';
$messages['deletemessagesconfirm'] = '정말 선택한 메일들을 삭제하시겠습니까?';
$messages['deletefolderconfirm'] = '정말 이 폴더를 삭제하시겠습니까?';
$messages['purgefolderconfirm'] = '정말 이 폴더의 모든 메일을 삭제하시겠습니까?';
+$messages['foldercreating'] = '폴더 만드는 중...';
+$messages['folderdeleting'] = '폴더 지우는 중...';
+$messages['folderrenaming'] = '폴더 이름 바꾸는 중...';
+$messages['foldermoving'] = '폴더 옮기는 중...';
$messages['formincomplete'] = '양식을 완전히 채우지 않았습니다';
$messages['noemailwarning'] = '유효한 이메일 주소를 넣어주십시오';
$messages['nonamewarning'] = '이름을 넣어주십시오';
$messages['nopagesizewarning'] = '페이지 크기를 넣어주십시오';
+$messages['nosenderwarning'] = '발신자 이메일 주소를 넣어주십시오';
$messages['norecipientwarning'] = '적어도 한 개 이상의 수신 주소를 넣어주십시오';
$messages['nosubjectwarning'] = '"제목"이 없습니다. 제목을 넣으시겠습니까?';
$messages['nobodywarning'] = '텍스트 없이 메일을 보낼까요?';
$messages['errorsendingreceipt'] = '읽음 확인을 보낼 수 없습니다';
$messages['nodeletelastidentity'] = '이 정보는 마지막 남은 것이므로 지울 수 없습니다';
$messages['addsubfolderhint'] = '이 폴더는 현재 선택된 폴더의 서브 폴더로 만들어질 것입니다';
+$messages['forbiddencharacter'] = '폴더 이름에 쓸 수 없는 문자가 포함되어 있습니다';
+$messages['selectimportfile'] = '업로드할 파일을 선택하세요';
+$messages['addresswriterror'] = '선택한 주소록은 쓸 수 없습니다';
+$messages['importwait'] = '가져오는 중, 기다리세요...';
+$messages['importerror'] = '가져오기 실패! 업로드한 파일이 유효한 vCard 파일이 아닙니다.';
+$messages['importconfirm'] = '<b>$inserted 연락처를 성공적으로 가져왔고, $skipped 존재하는 항목은 건너뛰었습니다.</b>:<p><em>$names</em></p>';
+$messages['opnotpermitted'] = '작업이 허가되지 않았습니다!';
+$messages['nofromaddress'] = '선택한 신원에 이메일 주소가 없음';
+$messages['editorwarning'] = '일반 텍스트 편집기로 바꾸면 모든 서식이 사라집니다. 계속할까요?';
-?>
\ No newline at end of file
+?>
| language/lt_LT/labels.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Author: Martynas Bendorius <martynas@evanet.lt> |
+-----------------------------------------------------------------------+'
-@version $Id: labels.inc 2184 2008-12-21 09:30:25Z yllar $
+@version $Id: labels.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/lt_LT/messages.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Author: Martynas Bendorius <martynas@evanet.lt> |
+-----------------------------------------------------------------------+
-@version $Id: messages.inc 2184 2008-12-21 09:30:25Z yllar $
+@version $Id: messages.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/lv/labels.inc |
| |
| Language file of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Mikelis Zalais <mik@prog.lv> |
+-----------------------------------------------------------------------+
- @version $Id: labels.inc 1093 2008-02-16 11:40:18Z tomekp $
+ @version $Id: labels.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/lv/messages.inc |
| |
| Language file of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Mikelis Zalais <mik@prog.lv> |
+-----------------------------------------------------------------------+
- @version $Id: messages.inc 1093 2008-02-16 11:40:18Z tomekp $
+ @version $Id: messages.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/mk_MK/labels.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
$labels['all'] = 'Сите';
$labels['none'] = 'Никоја';
$labels['unread'] = 'Непрочитани';
+$labels['flagged'] = 'Обележано';
+$labels['unanswered'] = 'Неодговорено';
+$labels['filter'] = 'Филтер';
$labels['compact'] = 'Уредно';
$labels['empty'] = 'Испразни';
$labels['purge'] = 'Чистење';
$labels['unlimited'] = 'неограничено';
$labels['quicksearch'] = 'Брзо претражување';
$labels['resetsearch'] = 'Ново претражување';
+$labels['openinextwin'] = 'Отвори во нов прозорец';
$labels['compose'] = 'Нова порака';
$labels['savemessage'] = 'Снимај ја пораката во Непратени';
$labels['sendmessage'] = 'Прати ја пораката';
$labels['alwaysshow'] = 'Секогаш прикажувај ги сликите од $sender';
$labels['htmltoggle'] = 'HTML';
$labels['plaintoggle'] = 'Обичен текст';
+$labels['savesentmessagein'] = 'Сними ја пратената порака во';
+$labels['dontsave'] = 'не ја снимај';
+$labels['maxuploadsize'] = 'Максималната дозволена големина на датотеката е $size';
$labels['addcc'] = 'Додај Cc';
$labels['addbcc'] = 'Додај Bcc';
$labels['addreplyto'] = 'Додај Одговори-На';
$labels['contactsfromto'] = '$count имиња $from до $to';
$labels['print'] = 'Испечати';
$labels['export'] = 'Извади како';
+$labels['exportvcards'] = 'Експортирај ги контактите во vCard формат';
$labels['previouspage'] = 'Прикажи претходна страна';
$labels['firstpage'] = 'Прикажи ја првата страна';
$labels['nextpage'] = 'Прикажи ја следната страна';
$labels['lastpage'] = 'Прикажи ја последната страна';
$labels['groups'] = 'Групи';
$labels['personaladrbook'] = 'Адреси';
+$labels['import'] = 'Импортирај';
+$labels['importcontacts'] = 'Импортирај контакти';
+$labels['importfromfile'] = 'Импортирај од датотека:';
+$labels['importreplace'] = 'Замени го целиот именик';
+$labels['importtext'] = 'Можеш да прикачеш контакти од веќе постоечки именик.<br/>Во моментот поддржуваме импортирање на адреси од <a href="http://en.wikipedia.org/wiki/VCard">vCard</a> форматот.';
+$labels['done'] = 'Завршено';
$labels['settingsfor'] = 'Подесувања за';
$labels['preferences'] = 'Подесувања';
$labels['userpreferences'] = 'Кориснички подесувања';
$labels['newitem'] = 'Нов објект';
$labels['edititem'] = 'Промени објект';
$labels['setdefault'] = 'Одбери за основно';
+$labels['autodetect'] = 'Автоматско';
$labels['language'] = 'Јазик';
$labels['timezone'] = 'Временска зона';
$labels['pagesize'] = 'Редови прикажани на страна';
$labels['ignore'] = 'игнорирање';
$labels['readwhendeleted'] = 'Обележи ја пораката како прочитана при бришење';
$labels['flagfordeletion'] = 'Обележи ја пораката за бришење наместо да ја избришеш';
+$labels['skipdeleted'] = 'Не ги прикажувај избришаните пораки';
+$labels['showremoteimages'] = 'Прикажи ги сликите';
+$labels['fromknownsenders'] = 'од познати праќачи';
+$labels['always'] = 'секогаш';
$labels['showinlineimages'] = 'Прикажи ги прикачените слики под пораката';
$labels['autosavedraft'] = 'Авоматски снимај во Непратени';
$labels['everynminutes'] = 'секои $n минути';
+$labels['keepaliveevery'] = 'секои $n минути';
+$labels['keepalive'] = 'Провери за нови пораки на';
$labels['never'] = 'никогаш';
$labels['messagesdisplaying'] = 'Прикажување на порака';
$labels['messagescomposition'] = 'Пишување на порака';
+$labels['mimeparamfolding'] = 'Име на прикачените датотеки';
+$labels['2231folding'] = 'Full RFC 2231 (Thunderbird)';
+$labels['miscfolding'] = 'RFC 2047/2231 (MS Outlook)';
+$labels['2047folding'] = 'Full RFC 2047 (друго)';
+$labels['advancedoptions'] = 'Напредни опции';
+$labels['focusonnewmessage'] = 'Фокусирај го прозорецот на прелистувачот на новата порака';
+$labels['checkallfolders'] = 'Провери ги сите папки за нови пораки';
$labels['folder'] = 'Папка';
$labels['folders'] = 'Папки';
$labels['foldername'] = 'Име на папката';
$labels['renamefolder'] = 'Преименувај ја папката';
$labels['deletefolder'] = 'Избриши ја папката';
$labels['managefolders'] = 'Организирање на папки';
+$labels['specialfolders'] = 'Специјални папки';
$labels['sortby'] = 'Уреди по';
$labels['sortasc'] = 'Уреди по азбучен ред';
$labels['sortdesc'] = 'Уреди опаѓачки';
+$labels['B'] = 'B';
+$labels['KB'] = 'KB';
+$labels['MB'] = 'MB';
+$labels['GB'] = 'GB';
?>
| language/mk_MK/messages.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
$messages['nocontactsfound'] = 'Нема Имиња во Именикот.';
$messages['contactnotfound'] = 'Бараното име не постои';
$messages['sendingfailed'] = 'Пораката не е пратена';
+$messages['senttooquickly'] = 'Ве молиме почекајте $sec секунда/и пред да ја испратите пораката';
+$messages['errorsavingsent'] = 'Грешка при снимањето на пратената порака';
$messages['errorsaving'] = 'Грешка при снимањето';
$messages['errormoving'] = 'Пораката неможе да се премести';
$messages['errordeleting'] = 'Пораката неможе да се избрише';
$messages['deletemessagesconfirm'] = 'Дали сте сигурни дека сакате да го избришете обележаниот(те) порака(и)?';
$messages['deletefolderconfirm'] = 'Дали сте сигурни дека сакате да ја избришете оваа папка?';
$messages['purgefolderconfirm'] = 'Дали сте сигурни дека сакате да ги избршете сите пораки во оваа папка?';
+$messages['foldercreating'] = 'Папката се креира...';
+$messages['folderdeleting'] = 'Папката се брише...';
+$messages['folderrenaming'] = 'Папката се преименува...';
+$messages['foldermoving'] = 'Папката се преместува...';
$messages['formincomplete'] = 'Имате изоставено непополнети информации';
$messages['noemailwarning'] = 'Внесете валидна емаил адреса';
$messages['nonamewarning'] = 'Внесете име';
$messages['nopagesizewarning'] = 'Внесете ја големината на страната';
+$messages['nosenderwarning'] = 'Внесете ја адресата на праќачот';
$messages['norecipientwarning'] = 'Внесете барем еден примач';
$messages['nosubjectwarning'] = 'Немате внесено „Наслов“. Дали сакате да внесете?';
$messages['nobodywarning'] = 'Пораката нема текст во неа. Дали сакате да ја пратите?';
$messages['nodeletelastidentity'] = 'Овој идентитет неможе да се избрише, тој е последниот.';
$messages['addsubfolderhint'] = 'Оваа папка ќе биде креирана како под-папка на селектираната.';
$messages['forbiddencharacter'] = 'Името на папката содржи несоодветен формат';
+$messages['selectimportfile'] = 'Изберете ја датотеката која сакате да ја прикачите';
+$messages['addresswriterror'] = 'Одберениот именик не може да се променува';
+$messages['importwait'] = 'Импортирам, ве молиме почекајте...';
+$messages['importerror'] = 'Импортирањето е неуспешно! Прикачената датотека не е валиден vCard документ.';
+$messages['importconfirm'] = '<b>Успешно се импортирани $inserted контакти, $skipped веќе постојат и се прескокнати</b>:<p><em>$names</em></p>';
+$messages['opnotpermitted'] = 'Операцијата не е дозволена';
+$messages['nofromaddress'] = 'Не е внесена е-пошта во одберениот идентитет';
+$messages['editorwarning'] = 'Променување во обичен текст променувач ќе резултира со губење на целото форматирање на текстот. Сакате да продолжите?';
?>
| language/ms_MY/labels.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| language/ms_MY/messages.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| language/nb_NO/labels.inc |
| |
| Language file of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Author: Tor Erik Linnerud - JKLM <tel@jklm.no> |
+-----------------------------------------------------------------------+
- @version $Id: labels.inc 1335 2008-04-27 15:18:13Z alec $
+ @version $Id: labels.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/nb_NO/messages.inc |
| |
| Language file of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Author: Tor Erik Linnerud - JKLM <tel@jklm.no> |
+-----------------------------------------------------------------------+
- @version $Id: messages.inc 1093 2008-02-16 11:40:18Z tomekp $
+ @version $Id: messages.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/nl_BE/labels.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Laurens Vets <laurens@daemon.be> |
+-----------------------------------------------------------------------+
-@version $Id: labels.inc 2136 2008-12-08 20:44:46Z yllar $
+@version $Id: labels.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/nl_BE/messages.inc |
| |
| Language file of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Author: Dennis Heeren <dennis.heeren@gmail.com> |
+-----------------------------------------------------------------------+
- @version $Id: messages.inc 1108 2008-02-17 20:08:44Z thomasb $
+ @version $Id: messages.inc 2237 2009-01-17 01:55:39Z till $
*/
$messages = array();
$messages['loginfailed'] = 'Aanmelden mislukt...';
$messages['cookiesdisabled'] = 'Uw browser accepteert geen cookies...';
-$messages['sessionerror'] = 'Sessie is reeds beëindigd of is ongeldig...';
+$messages['sessionerror'] = 'Sessie is reeds be�indigd of is ongeldig...';
$messages['imaperror'] = 'Kon geen verbinding maken met de IMAP server...';
$messages['nomessagesfound'] = 'Er zijn geen berichten in deze map...';
$messages['loggedout'] = 'U bent nu afgemeld. Tot ziens!';
$messages['addedsuccessfully'] = 'Contactpersoon is toegevoegd...';
$messages['contactexists'] = 'Er bestaat reeds een contactpersoon met dit e-mailadres...';
$messages['blockedimages'] = 'Om uw privacy te beschermen worden de afbeeldingen in dit bericht niet getoond...';
-$messages['encryptedmessage'] = 'Dit bericht is geëncrypteerd en kan niet worden weergegeven, sorry...';
+$messages['encryptedmessage'] = 'Dit bericht is ge�ncrypteerd en kan niet worden weergegeven, sorry...';
$messages['nocontactsfound'] = 'Geen contactpersonen gevonden...';
$messages['contactnotfound'] = 'De gevraagde contactpersoon was niet gevonden';
$messages['sendingfailed'] = 'Kon het bericht niet versturen...';
$messages['noemailwarning'] = 'Geef een geldig e-mailadres op...';
$messages['nonamewarning'] = 'Geef een naam op...';
$messages['nopagesizewarning'] = 'Geef een geldig aantal berichten per pagina op...';
-$messages['norecipientwarning'] = 'Geef minstens één bestemmeling op...';
+$messages['norecipientwarning'] = 'Geef minstens ��n bestemmeling op...';
$messages['nosubjectwarning'] = 'Geen onderwerp opgegeven. Wenst u alsnog een onderwerp te geven?';
$messages['nobodywarning'] = 'Wilt u dit lege bericht versturen?';
$messages['notsentwarning'] = 'Het bericht is niet verzonden. Wilt u het bericht verwijderen?';
$messages['messageopenerror'] = 'Kon het bericht niet ophalen van de server';
$messages['fileuploaderror'] = 'Bestandupload mislukt';
$messages['filesizeerror'] = 'Het bestand overschrijdt de maximum grootte van $size';
-$messages['copysuccess'] = '$nr adressen met succes gekopiëerd';
-$messages['copyerror'] = 'Kon de adressen niet kopiëren';
+$messages['copysuccess'] = '$nr adressen met succes gekopi�erd';
+$messages['copyerror'] = 'Kon de adressen niet kopi�ren';
$messages['sourceisreadonly'] = 'Het adres kan niet worden opgeslagen';
$messages['errorsavingcontact'] = 'Kon de contactpersoon niet bewaren';
$messages['movingmessage'] = 'Bericht wordt verplaatst...';
| language/nl_NL/labels.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Laurens Vets <laurens@daemon.be> |
+-----------------------------------------------------------------------+
-@version $Id: labels.inc 2136 2008-12-08 20:44:46Z yllar $
+@version $Id: labels.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/nl_NL/messages.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Lazlo Westerhof <roundcube@lazlo.me> |
+-----------------------------------------------------------------------+
-@version $Id: messages.inc 2037 2008-11-04 07:46:29Z robin $
+@version $Id: messages.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/nn_NO/labels.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Update: Odin Omdal Hørthe <odin.omdal@gmail.com> |
+-----------------------------------------------------------------------+
-@version $Id: labels.inc 2115 2008-12-04 10:21:34Z alec $
+@version $Id: labels.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/nn_NO/messages.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Update: Odin Omdal Hørthe <odin.omdal@gmail.com> |
+-----------------------------------------------------------------------+
-@version $Id: messages.inc 2045 2008-11-11 15:09:24Z yllar $
+@version $Id: messages.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/pl_PL/labels.inc |
| |
| Language file of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| language/pl_PL/messages.inc |
| |
| Language file of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| language/pt_BR/labels.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Victor Benincasa <vbenincasa@gmail.com> |
+-----------------------------------------------------------------------+
-@version $Id: labels.inc 2184 2008-12-21 09:30:25Z yllar $
+@version $Id: labels.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/pt_BR/messages.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Victor Benincasa <vbenincasa@gmail.com> |
+-----------------------------------------------------------------------+
-@version $Id: messages.inc 2184 2008-12-21 09:30:25Z yllar $
+@version $Id: messages.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/pt_PT/labels.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Nuno Costa <nuno@criacaoweb.net> |
+-----------------------------------------------------------------------+
-@version $Id: labels.inc 2115 2008-12-04 10:21:34Z alec $
+@version $Id: labels.inc 2254 2009-01-22 19:52:46Z yllar $
*/
$labels['all'] = 'Todas';
$labels['none'] = 'Nenhuma';
$labels['unread'] = 'Não lidas';
+$labels['flagged'] = 'Sinalizadas';
+$labels['unanswered'] = 'Não respondidas';
+$labels['filter'] = 'Filtro';
$labels['compact'] = 'Compactar';
$labels['empty'] = 'Vazio';
$labels['purge'] = 'Apagar';
$labels['readwhendeleted'] = 'Marcar a mensagem como lida ao excluir';
$labels['flagfordeletion'] = 'Marcar a mensagem de eliminação, em vez de a excluir';
$labels['skipdeleted'] = 'Não mostrar mensagens apagadas';
+$labels['showremoteimages'] = 'Mostrar imagens externas';
+$labels['fromknownsenders'] = 'de remetentes conhecidos';
+$labels['always'] = 'sempre';
$labels['showinlineimages'] = 'Mostrar imagens anexadas abaixo da mensagem';
$labels['autosavedraft'] = 'Salvar rascunho automaticamente';
$labels['everynminutes'] = 'a cada $n minutos';
$labels['2047folding'] = 'Total RFC 2047 (outro)';
$labels['advancedoptions'] = 'Opções avançadas';
$labels['focusonnewmessage'] = 'Focar janela de navegador na nova mensagem';
+$labels['checkallfolders'] = 'Verificar todas as pastas para novas mensagens';
$labels['folder'] = 'Pasta';
$labels['folders'] = 'Pastas';
$labels['foldername'] = 'Nome da pasta';
| language/pt_PT/messages.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Nuno Costa <nuno@criacaoweb.net> |
+-----------------------------------------------------------------------+
-@version $Id: messages.inc 2045 2008-11-11 15:09:24Z yllar $
+@version $Id: messages.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/ro/labels.inc |
| |
| Language file of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Ispas Dorin <dorinxp2004@yahoo.com> |
+-----------------------------------------------------------------------+
- @version $Id: labels.inc 1149 2008-02-28 19:52:09Z thomasb $
+ @version $Id: labels.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/ro/messages.inc |
| |
| Language file of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Ispas Dorin <dorinxp2004@yahoo.com> |
+-----------------------------------------------------------------------+
- @version $Id: messages.inc 1149 2008-02-28 19:52:09Z thomasb $
+ @version $Id: messages.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/ru_RU/labels.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Artur Smolkin <admin@roundcube.ru> |
+-----------------------------------------------------------------------+
-@version $Id: labels.inc 2115 2008-12-04 10:21:34Z alec $
+@version $Id: labels.inc 2237 2009-01-17 01:55:39Z till $
*/
$labels['unread'] = 'Непрочитанные';
$labels['flagged'] = 'Помеченные';
$labels['unanswered'] = 'Неотвеченные';
+$labels['filter'] = 'Фильтр';
$labels['compact'] = 'Сжать';
$labels['empty'] = 'Опустошить';
$labels['purge'] = 'Очистить';
$labels['readwhendeleted'] = 'Помечать как прочитанное при удалении';
$labels['flagfordeletion'] = 'Помечать для удаления вместо удаления';
$labels['skipdeleted'] = 'Не показывать удаленные сообщения';
+$labels['showremoteimages'] = 'Показывать удаленные изображения';
+$labels['fromknownsenders'] = 'от известных отправителей';
+$labels['always'] = 'всегда';
$labels['showinlineimages'] = 'Показывать вложенные изображения внизу сообщения';
$labels['autosavedraft'] = 'Автосохранение черновика';
$labels['everynminutes'] = 'каждые $n минут';
| language/ru_RU/messages.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Artur Smolkin <admin@roundcube.ru> |
+-----------------------------------------------------------------------+
-@version $Id: messages.inc 2105 2008-12-01 17:50:13Z alec $
+@version $Id: messages.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/si/labels.inc |\r
| |\r
| Language file of the RoundCube Webmail client |\r
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |\r
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |\r
| Licensed under the GNU GPL |\r
| |\r
+-----------------------------------------------------------------------+\r
| language/si/messages.inc |\r
| |\r
| Language file of the RoundCube Webmail client |\r
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |\r
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |\r
| Licensed under the GNU GPL |\r
| |\r
+-----------------------------------------------------------------------+\r
| language/sk/labels.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Peter Mann <peter.mann@tuke.sk> |
+-----------------------------------------------------------------------+
-@version $Id: labels.inc 2115 2008-12-04 10:21:34Z alec $
+@version $Id: labels.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/sk/messages.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Peter Mann <peter.mann@tuke.sk> |
+-----------------------------------------------------------------------+
-@version $Id: messages.inc 2045 2008-11-11 15:09:24Z yllar $
+@version $Id: messages.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/sl/labels.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Andrej Mocilnik <amocilnik@dotcom.ts.it> |
+-----------------------------------------------------------------------+
-@version $Id: labels.inc 1109 2008-02-17 20:22:05Z thomasb $
+@version $Id: labels.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/sl/messages.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Andrej Mocilnik <amocilnik@dotcom.ts.it> |
+-----------------------------------------------------------------------+
-@version $Id: messages.inc 1109 2008-02-17 20:22:05Z thomasb $
+@version $Id: messages.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/sq_AL/labels.inc |
| |
| Language file of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| language/sq_AL/messages.inc |
| |
| Language file of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| language/sr_cyrillic/labels.inc |\r
| |\r
| Language file of the RoundCube Webmail client |\r
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |\r
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |\r
| Licensed under the GNU GPL |\r
| |\r
+-----------------------------------------------------------------------+\r
| language/sr_cyrillic/messages.inc |\r
| |\r
| Language file of the RoundCube Webmail client |\r
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |\r
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |\r
| Licensed under the GNU GPL |\r
| |\r
+-----------------------------------------------------------------------+\r
/*
+-----------------------------------------------------------------------+
- | language/se/labels.inc |
+ | language/sv_SE/labels.inc |
| |
| Language file of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Author: Fredrik Nygren <f.nygren@gmail.com> |
- | Andreas Henriksson <andreas@fatal.se> |
- | Jonas Näsholm <hostmaster@bitfuse.net> |
+ | Andreas Henriksson <andreas@fatal.se> |
+ | Jonas Nasholm <info@bitfuse.net> |
+-----------------------------------------------------------------------+
- @version $Id: labels.inc 1191 2008-03-13 08:10:49Z yllar $
+ @version $Id: labels.inc 2215 2009-01-05 11:23:03Z alec $
*/
$labels = array();
+
+// login page
$labels['welcome'] = 'Välkommen till $product';
$labels['username'] = 'Användarnamn';
$labels['password'] = 'Lösenord';
$labels['server'] = 'Server';
$labels['login'] = 'Logga in';
+
+// taskbar
$labels['logout'] = 'Logga ut';
$labels['mail'] = 'Meddelanden';
$labels['settings'] = 'Personliga inställningar';
$labels['addressbook'] = 'Adressbok';
+
+// mailbox names
$labels['inbox'] = 'Inkorg';
$labels['drafts'] = 'Utkast';
$labels['sent'] = 'Skickat';
$labels['trash'] = 'Papperskorg';
$labels['junk'] = 'Skräp';
+
+// message listing
$labels['subject'] = 'Ämne';
$labels['from'] = 'Avsändare';
$labels['to'] = 'Mottagare';
$labels['size'] = 'Storlek';
$labels['priority'] = 'Prioritet';
$labels['organization'] = 'Organisation';
+
+// aliases
$labels['reply-to'] = 'Svara till';
-$labels['mailboxlist'] = 'Mappar';
+
+$labels['mailboxlist'] = 'Kataloger';
$labels['messagesfromto'] = 'Meddelande $from till $to av $count';
$labels['messagenrof'] = 'Meddelande $nr av $count';
-$labels['moveto'] = 'flytta till...';
-$labels['download'] = 'ladda ner';
+
+$labels['moveto'] = 'Flytta till:';
+$labels['download'] = 'Ladda ner';
+
$labels['filename'] = 'Filnamn';
$labels['filesize'] = 'Filstorlek';
-$labels['preferhtml'] = 'Visa HTML';
+
+$labels['preferhtml'] = 'Visa meddelanden i HTML-format';
$labels['htmlmessage'] = 'HTML-meddelande';
$labels['prettydate'] = 'Fina datum';
+
$labels['addtoaddressbook'] = 'Lägg till i adressbok';
+
+// weekdays short
$labels['sun'] = 'Sön';
$labels['mon'] = 'Mån';
$labels['tue'] = 'Tis';
$labels['thu'] = 'Tor';
$labels['fri'] = 'Fre';
$labels['sat'] = 'Lör';
+
+// weekdays long
$labels['sunday'] = 'Söndag';
$labels['monday'] = 'Måndag';
$labels['tuesday'] = 'Tisdag';
$labels['thursday'] = 'Torsdag';
$labels['friday'] = 'Fredag';
$labels['saturday'] = 'Lördag';
+
+// months short
+$labels['jan'] = 'Jan';
+$labels['feb'] = 'Feb';
+$labels['mar'] = 'Mar';
+$labels['apr'] = 'Apr';
+$labels['may'] = 'Maj';
+$labels['jun'] = 'Jun';
+$labels['jul'] = 'Jul';
+$labels['aug'] = 'Aug';
+$labels['sep'] = 'Sep';
+$labels['oct'] = 'Okt';
+$labels['nov'] = 'Nov';
+$labels['dec'] = 'Dec';
+
+// months long
+$labels['longjan'] = 'Januari';
+$labels['longfeb'] = 'Februari';
+$labels['longmar'] = 'Mars';
+$labels['longapr'] = 'April';
+$labels['longmay'] = 'Maj';
+$labels['longjun'] = 'Juni';
+$labels['longjul'] = 'Juli';
+$labels['longaug'] = 'Augusti';
+$labels['longsep'] = 'September';
+$labels['longoct'] = 'Oktober';
+$labels['longnov'] = 'November';
+$labels['longdec'] = 'December';
$labels['today'] = 'Idag';
+
+// toolbar buttons
$labels['checkmail'] = 'Hämta nya meddelanden';
$labels['writenewmessage'] = 'Skapa nytt meddelande';
$labels['replytomessage'] = 'Svara avsändaren';
$labels['backtolist'] = 'Tillbaka till meddelandelistan';
$labels['viewsource'] = 'Visa källa';
$labels['markmessages'] = 'Markera meddelande';
-$labels['markread'] = 'Som läst';
-$labels['markunread'] = 'Som oläst';
+$labels['markread'] = 'Läst';
+$labels['markunread'] = 'Oläst';
+$labels['markflagged'] = 'Flaggat';
+$labels['markunflagged'] = 'Oflaggat';
+
$labels['select'] = 'Välj';
$labels['all'] = 'Alla';
$labels['none'] = 'Ingen';
$labels['unread'] = 'Olästa';
+$labels['flagged'] = 'Flaggade';
+$labels['unanswered'] = 'Obesvarade';
+$labels['filter'] = 'Filter';
+
$labels['compact'] = 'Packa';
$labels['empty'] = 'Töm';
$labels['purge'] = 'Rensa';
+
$labels['quota'] = 'Diskutrymme';
-$labels['unknown'] = 'okänd';
-$labels['unlimited'] = 'obegränsad';
+$labels['unknown'] = 'okänt';
+$labels['unlimited'] = 'obegränsat';
+
$labels['quicksearch'] = 'Snabbsök';
$labels['resetsearch'] = 'Återställ sökning';
+
+$labels['openinextwin'] = 'Öppna i nytt fönster';
+
+// message compose
$labels['compose'] = 'Skapa nytt meddelande';
$labels['savemessage'] = 'Spara utkast';
$labels['sendmessage'] = 'Skicka meddelande';
$labels['charset'] = 'Teckenkodning';
$labels['editortype'] = 'Typ av redigerare';
$labels['returnreceipt'] = 'Mottagarkvitto';
+
$labels['checkspelling'] = 'Kontrollera stavning';
$labels['resumeediting'] = 'Återuppta redigering';
$labels['revertto'] = 'Återgå till';
+
$labels['attachments'] = 'Bilagor';
$labels['upload'] = 'Bifoga';
$labels['close'] = 'Stäng';
+
$labels['low'] = 'Låg';
$labels['lowest'] = 'Lägst';
$labels['normal'] = 'Normal';
$labels['high'] = 'Hög';
$labels['highest'] = 'Högst';
+
$labels['nosubject'] = '(inget ämne)';
$labels['showimages'] = 'Visa bilder';
+$labels['alwaysshow'] = 'Visa alltid bilder från $sender';
+
$labels['htmltoggle'] = 'HTML';
-$labels['plaintoggle'] = 'Oformaterad text';
+$labels['plaintoggle'] = 'Text';
+$labels['savesentmessagein'] = 'Spara kopia i';
+$labels['dontsave'] = 'Spara inte';
+$labels['maxuploadsize'] = 'Tillåten filstorlek är $size';
+
$labels['addcc'] = 'Kopia';
$labels['addbcc'] = 'Hemlig kopia';
$labels['addreplyto'] = 'Svara till';
-$labels['mdnrequest'] = 'Avsändaren har bett om att bli uppmärksammad när du läst det här meddelandet. Vill du skicka uppmärksamma avsändaren?';
-$labels['receiptread'] = 'Svarskvitto (läst)';
-$labels['yourmessage'] = 'Det här är ett svarskvitto för ditt meddelande';
-$labels['receiptnote'] = 'Notera: Det här kvittot berättar bara att meddelandet visats på mottagarens dator. Det finns ingen garanti att mottagaren har läst och förstått innehållet i meddelandet';
-$labels['name'] = 'Visa namn';
+
+// mdn
+$labels['mdnrequest'] = 'Avsändaren har begärt mottagarkvitto för det här meddelandet. Vill du skicka ett mottagarkvitto?';
+$labels['receiptread'] = 'Mottagarkvitto (läst)';
+$labels['yourmessage'] = 'Det här är ett mottagarkvitto för ditt meddelande';
+$labels['receiptnote'] = 'Notera: Mottagarkvittot innebär bara att meddelandet visats på mottagarens dator. Därmed finns ingen garanti att mottagaren har läst och förstått meddelandet.';
+
+// address boook
+$labels['name'] = 'Namn';
$labels['firstname'] = 'Förnamn';
$labels['surname'] = 'Efternamn';
$labels['email'] = 'E-post';
+
$labels['addcontact'] = 'Lägg till ny kontakt';
$labels['editcontact'] = 'Redigera kontakt';
+
$labels['edit'] = 'Redigera';
$labels['cancel'] = 'Avbryt';
$labels['save'] = 'Spara';
$labels['delete'] = 'Radera';
-$labels['newcontact'] = 'Skapa nytt kontaktkort';
-$labels['deletecontact'] = 'Radera valda kontakter';
-$labels['composeto'] = 'Skriv meddelande till';
-$labels['contactsfromto'] = 'Kontakter $from till $to av $count';
+
+$labels['newcontact'] = 'Ny kontakt';
+$labels['deletecontact'] = 'Radera vald kontakt';
+$labels['composeto'] = 'Skriv meddelande till vald kontakt';
+$labels['contactsfromto'] = 'Kontakt $from till $to av $count';
$labels['print'] = 'Skriv ut';
$labels['export'] = 'Exportera';
+$labels['exportvcards'] = 'Exportera kontakter';
+
$labels['previouspage'] = 'Visa föregående grupp';
$labels['firstpage'] = 'Visa första gruppen';
$labels['nextpage'] = 'Visa nästa grupp';
$labels['lastpage'] = 'Visa sista gruppen';
+
$labels['groups'] = 'Grupper';
$labels['personaladrbook'] = 'Personliga adresser';
+
+$labels['import'] = 'Importera';
+$labels['importcontacts'] = 'Importera kontakter';
+$labels['importfromfile'] = 'Importera från fil:';
+$labels['importreplace'] = 'Ersätt samtliga kontakter i adressboken';
+$labels['importtext'] = 'Kontakter kan importeras från en befintlig adressbok.<br/>För närvarande stöds import av adresser i <a href="http://en.wikipedia.org/wiki/VCard">vCard</a>-format.';
+$labels['done'] = 'Klart';
+
+// settings
$labels['settingsfor'] = 'Inställningar för';
+
$labels['preferences'] = 'Inställningar';
$labels['userpreferences'] = 'Användarinställningar';
$labels['editpreferences'] = 'Ändra användarinställningar';
+
$labels['identities'] = 'Profiler';
$labels['manageidentities'] = 'Hantera profiler för detta konto';
$labels['newidentity'] = 'Ny profil';
+
$labels['newitem'] = 'Ny post';
$labels['edititem'] = 'Ändra post';
+
$labels['setdefault'] = 'Sätt som standard';
+$labels['autodetect'] = 'Automatiskt';
$labels['language'] = 'Språk';
$labels['timezone'] = 'Tidszon';
$labels['pagesize'] = 'Rader per sida';
$labels['signature'] = 'Signatur';
$labels['dstactive'] = 'Sommartid';
-$labels['htmleditor'] = 'Skriv HTML-meddelanden';
+$labels['htmleditor'] = 'Skriv meddelanden i HTML-format';
$labels['htmlsignature'] = 'HTML-signatur';
-$labels['previewpane'] = 'Visa delad vy i inbox';
-$labels['autosavedraft'] = 'Spara utkast automatiskt';
-$labels['everynminutes'] = 'var $n minut';
-$labels['never'] = 'aldrig';
-$labels['folder'] = 'Mapp';
-$labels['folders'] = 'Mappar';
-$labels['foldername'] = 'Mappnamn';
+$labels['previewpane'] = 'Visa meddelandefältet';
+$labels['skin'] = 'Stilmall för användargränssnitt';
+$labels['logoutclear'] = 'Töm papperskorgen vid utloggning';
+$labels['logoutcompact'] = 'Packa inkorgen vid utloggning';
+$labels['uisettings'] = 'Användargränssnitt';
+$labels['serversettings'] = 'Serverinställningar';
+$labels['mailboxview'] = 'Hantering av meddelanden';
+$labels['mdnrequests'] = 'Skicka mottagarkvitton';
+$labels['askuser'] = 'Fråga';
+$labels['autosend'] = 'Automatiskt';
+$labels['ignore'] = 'Ignorera';
+$labels['readwhendeleted'] = 'Märk meddelande som läst vid borttagning';
+$labels['flagfordeletion'] = 'Flagga meddelande för borttagning istället för att radera direkt';
+$labels['skipdeleted'] = 'Visa inte raderade meddelanden';
+$labels['showremoteimages'] = 'Visa externt länkade bilder i meddelande';
+$labels['fromknownsenders'] = 'Från kända avsändare';
+$labels['always'] = 'Alltid';
+$labels['showinlineimages'] = 'Visa bifogade bilder efter meddelande';
+$labels['autosavedraft'] = 'Spara utkast med automatiskt intervall';
+$labels['everynminutes'] = '$n min';
+$labels['keepaliveevery'] = '$n min';
+$labels['keepalive'] = 'Hämta nya meddelanden med automatiskt intervall';
+$labels['never'] = 'Aldrig';
+$labels['messagesdisplaying'] = 'Visning av meddelanden';
+$labels['messagescomposition'] = 'Redigering av meddelanden';
+$labels['mimeparamfolding'] = 'Kodning av namn på bifogade filer';
+$labels['2231folding'] = 'Full RFC 2231 (Thunderbird)';
+$labels['miscfolding'] = 'RFC 2047/2231 (Outlook)';
+$labels['2047folding'] = 'Full RFC 2047 (övriga)';
+$labels['advancedoptions'] = 'Avancerade inställningar';
+$labels['focusonnewmessage'] = 'Fokusera webbläsarens fönster vid nytt meddelande';
+$labels['checkallfolders'] = 'Genomsök samtliga kataloger efter nya meddelanden';
+
+$labels['folder'] = 'Katalog';
+$labels['folders'] = 'Kataloger';
+$labels['foldername'] = 'Katalognamn';
$labels['subscribed'] = 'Ansluten';
$labels['messagecount'] = 'Meddelanden';
$labels['create'] = 'Skapa';
-$labels['createfolder'] = 'Skapa ny mapp';
+$labels['createfolder'] = 'Skapa ny katalog';
$labels['rename'] = 'Byt namn';
-$labels['renamefolder'] = 'Byt mappnamn';
-$labels['deletefolder'] = 'Radera mapp';
-$labels['managefolders'] = 'Hantera mappar';
+$labels['renamefolder'] = 'Byt katalognamn';
+$labels['deletefolder'] = 'Radera katalog';
+$labels['managefolders'] = 'Hantera kataloger';
+$labels['specialfolders'] = 'Speciella kataloger';
+
$labels['sortby'] = 'Sortera på';
$labels['sortasc'] = 'Sortera stigande';
$labels['sortdesc'] = 'Sortera fallande';
+// units
+$labels['B'] = 'B';
+$labels['KB'] = 'KB';
+$labels['MB'] = 'MB';
+$labels['GB'] = 'GB';
+
?>
/*
+-----------------------------------------------------------------------+
- | language/se/messages.inc |
+ | language/sv_SE/messages.inc |
| |
| Language file of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Author: Fredrik Nygren <f.nygren@gmail.com> |
- | Andreas Henriksson <andreas@fatal.se> |
- | Jonas Näsholm <hostmaster@bitfuse.net> |
+ | Andreas Henriksson <andreas@fatal.se> |
+ | Jonas Nasholm <info@bitfuse.net> |
+-----------------------------------------------------------------------+
- @version $Id: messages.inc 1143 2008-02-26 20:50:10Z yllar $
+ @version $Id: messages.inc 2215 2009-01-05 11:23:03Z alec $
*/
$messages['imaperror'] = 'Kontakt med IMAP-servern misslyckades';
$messages['nomessagesfound'] = 'Inga meddelanden';
$messages['loggedout'] = 'Du är utloggad. Välkommen åter!';
-$messages['mailboxempty'] = 'Mappen är tom';
+$messages['mailboxempty'] = 'Katalogen är tom';
$messages['loading'] = 'Laddar...';
$messages['loadingdata'] = 'Laddar data...';
$messages['checkingmail'] = 'Letar efter nya meddelanden...';
$messages['messagesent'] = 'Meddelandet har skickats';
$messages['savingmessage'] = 'Sparar meddelande...';
$messages['messagesaved'] = 'Meddelande sparades till utkast';
-$messages['successfullysaved'] = 'Sparat';
+$messages['successfullysaved'] = 'Informationen har sparats';
$messages['addedsuccessfully'] = 'Kontakten har lagts till i adressboken';
$messages['contactexists'] = 'En kontakt med den här adressen finns redan';
-$messages['blockedimages'] = 'För att skydda dig är bilder blockerade.';
+$messages['blockedimages'] = 'Externt länkade bilder i meddelandet har blockerats.';
$messages['encryptedmessage'] = 'Meddelandet är krypterat och kan tyvärr inte visas.';
$messages['nocontactsfound'] = 'Inga kontakter hittades';
$messages['contactnotfound'] = 'Den efterfrågade kontanten hittades inte';
$messages['sendingfailed'] = 'Meddelandet kunde inte skickas';
-$messages['errorsaving'] = 'Ett fel uppstod när meddelandet sparades';
+$messages['senttooquickly'] = 'Vänta ytterligare $sec sekunder med att skicka meddelandet';
+$messages['errorsavingsent'] = 'Ett fel inträffade när det skickade meddelandet sparades';
+$messages['errorsaving'] = 'Meddelandet kunde inte sparads';
$messages['errormoving'] = 'Meddelandet kunde inte flyttas';
$messages['errordeleting'] = 'Meddelandet kunde inte raderas';
$messages['deletecontactconfirm'] = 'Vill du verkligen radera valda kontakter?';
$messages['deletemessagesconfirm'] = 'Vill du verkligen ta bort valda meddelanden?';
-$messages['deletefolderconfirm'] = 'Vill du verkligen radera den här mappen?';
-$messages['purgefolderconfirm'] = 'Vill du verkligen radera alla meddelanden i den här mappen?';
+$messages['deletefolderconfirm'] = 'Vill du verkligen radera den här katalogen?';
+$messages['purgefolderconfirm'] = 'Vill du verkligen radera alla meddelanden i den här katalogen?';
+$messages['foldercreating'] = 'Skapar katalog...';
+$messages['folderdeleting'] = 'Raderar katalog...';
+$messages['folderrenaming'] = 'Namnändrar katalog...';
+$messages['foldermoving'] = 'Flyttar katalog...';
$messages['formincomplete'] = 'Formuläret var inte ifyllt i sin helhet';
$messages['noemailwarning'] = 'Vänligen ange en giltig adress';
$messages['nonamewarning'] = 'Vänligen ange ett namn';
$messages['nopagesizewarning'] = 'Vänligen ange en sidstorlek';
+$messages['nosenderwarning'] = 'Vänligen ange en avsändaradress';
$messages['norecipientwarning'] = 'Vänligen ange minst en mottagare';
$messages['nosubjectwarning'] = 'Ämnesfältet är tomt. Vill du lägga till något nu?';
$messages['nobodywarning'] = 'Skicka det här meddelandet utan text?';
$messages['searching'] = 'Söker...';
$messages['checking'] = 'Kontrollerar...';
$messages['nospellerrors'] = 'Inget stavfel hittades';
-$messages['folderdeleted'] = 'Mappen raderades';
+$messages['folderdeleted'] = 'Katalogen raderades';
$messages['deletedsuccessfully'] = 'Lyckad borttagning';
$messages['converting'] = 'Tar bort formatering från meddelande...';
$messages['messageopenerror'] = 'Kunde inte ladda meddelande från servern';
$messages['copysuccess'] = 'Lyckad kopiering av $nr adresser';
$messages['copyerror'] = 'Kunde inte kopiera några adresser';
$messages['sourceisreadonly'] = 'Denna adresskälla är skrivskyddad';
-$messages['errorsavingcontact'] = 'Kunde inte spara kontakt-adressen';
+$messages['errorsavingcontact'] = 'Kunde inte spara kontaktadressen';
$messages['movingmessage'] = 'Flyttar meddelande...';
-$messages['receiptsent'] = 'Ett läskvitto har skickats';
-$messages['errorsendingreceipt'] = 'Kunde inte skicka läskvittot';
+$messages['receiptsent'] = 'Mottagarkvitto har skickats';
+$messages['errorsendingreceipt'] = 'Kunde inte skicka mottagarkvitto';
$messages['nodeletelastidentity'] = 'Du kan inte radera den här identiteten, det är din sista.';
-$messages['addsubfolderhint'] = 'Den här mappen kommer att skapas som en underkatalog till den valda';
+$messages['addsubfolderhint'] = 'Den här katalogen kommer att skapas som en underkatalog till den valda';
+$messages['forbiddencharacter'] = 'Katalognamnet innehåller otillåtna tecken';
+$messages['selectimportfile'] = 'Välj en fil att ladda upp';
+$messages['addresswriterror'] = 'Angiven adressbok är skrivskyddad';
+$messages['importwait'] = 'Importerar, var god vänta...';
+$messages['importerror'] = 'Importen misslyckades! Filen är inte i vCard-format.';
+$messages['importconfirm'] = '<b>Lyckad import av $inserted kontakter, $skipped dubbletter har ignorerats:</b><p><em>$names</em></p>';
+$messages['opnotpermitted'] = 'Otillåten operation!';
+$messages['nofromaddress'] = 'Adressen saknas i den valda identiteten';
+$messages['editorwarning'] = 'Genom att växla till text-läge går formateringen förlorad. Vill du fortsätta?';
?>
\ No newline at end of file
| language/th_TH/labels.inc |
| |
| Language file of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| language/th_TH/messages.inc |
| |
| Language file of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| language/tr/labels.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Author: Gökdeniz Karadağ <gokdenizk@gmail.com> |
+-----------------------------------------------------------------------+
-@version $Id: labels.inc 2194 2008-12-29 18:26:51Z alec $
+@version $Id: labels.inc 2237 2009-01-17 01:55:39Z till $
*/
| language/tr/messages.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Author: Gökdeniz Karadağ <gokdenizk@gmail.com> |
+-----------------------------------------------------------------------+
-@version $Id: messages.inc 2184 2008-12-21 09:30:25Z yllar $
+@version $Id: messages.inc 2237 2009-01-17 01:55:39Z till $
*/
/*
- +-----------------------------------------------------------------------+
- | language/uk/labels.inc |
- | |
- | Language file of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
- | Licensed under the GNU GPL |
- | |
- +-----------------------------------------------------------------------+
- | Author: Natali Stasyuk <natali@onlineua.net> |
- +-----------------------------------------------------------------------+
++-----------------------------------------------------------------------+
+| language/uk/labels.inc |
+| |
+| Language file of the RoundCube Webmail client |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
+| Licensed under the GNU GPL |
+| |
++-----------------------------------------------------------------------+
+| Author: Natali Stasyuk <natali@onlineua.net> |
++-----------------------------------------------------------------------+
- @version $Id$
+@version $Id$
*/
$labels['thursday'] = 'Четвер';
$labels['friday'] = 'П`ятниця';
$labels['saturday'] = 'Субота';
+$labels['jan'] = 'січ';
+$labels['feb'] = 'лют';
+$labels['mar'] = 'бер';
+$labels['apr'] = 'квіт';
+$labels['may'] = 'тр';
+$labels['jun'] = 'чер';
+$labels['jul'] = 'лип';
+$labels['aug'] = 'сер';
+$labels['sep'] = 'вер';
+$labels['oct'] = 'жов';
+$labels['nov'] = 'лис';
+$labels['dec'] = 'гр';
+$labels['longjan'] = 'січень';
+$labels['longfeb'] = 'лютий';
+$labels['longmar'] = 'березень';
+$labels['longapr'] = 'квітень';
+$labels['longmay'] = 'травень';
+$labels['longjun'] = 'червень';
+$labels['longjul'] = 'липень';
+$labels['longaug'] = 'серпень';
+$labels['longsep'] = 'вересень';
+$labels['longoct'] = 'жовтень';
+$labels['longnov'] = 'листопад';
+$labels['longdec'] = 'грудень';
$labels['today'] = 'Сьогодні';
$labels['checkmail'] = 'Перевірити пошту';
$labels['writenewmessage'] = 'Нове повідомлення';
$labels['lastmessages'] = 'Остання сторінка повідомлень';
$labels['backtolist'] = 'До переліку повідомлень';
$labels['viewsource'] = 'Вихідний текст';
+$labels['markmessages'] = 'скасувати повідомлення';
+$labels['markread'] = 'як прочитані';
+$labels['markunread'] = 'як непрочитане';
+$labels['markflagged'] = 'як позначені';
+$labels['markunflagged'] = 'як не позначені';
$labels['select'] = 'Вибрати';
$labels['all'] = 'Все';
$labels['none'] = 'Нічого';
$labels['unread'] = 'Непрочитані';
+$labels['flagged'] = 'прапорець';
+$labels['unanswered'] = 'Без відповіді';
+$labels['filter'] = 'фильтер';
$labels['compact'] = 'Стиснути';
$labels['empty'] = 'Спустошити';
$labels['purge'] = 'Очистити';
$labels['unlimited'] = 'без обмеження';
$labels['quicksearch'] = 'Швидкий пошук';
$labels['resetsearch'] = 'Очистити пошук';
+$labels['openinextwin'] = 'Відкрити в новому вікні';
$labels['compose'] = 'Написати повідомлення';
$labels['savemessage'] = 'Зберегти чернетку';
$labels['sendmessage'] = 'Відіслати зараз';
$labels['highest'] = 'Найвищий';
$labels['nosubject'] = '(без теми)';
$labels['showimages'] = 'Показати зображення';
+$labels['alwaysshow'] = 'Завжди показувати зображення ';
$labels['htmltoggle'] = 'HTML';
$labels['plaintoggle'] = 'Звичайний текст';
+$labels['savesentmessagein'] = 'зберегти в';
+$labels['dontsave'] = 'не зберігати';
+$labels['maxuploadsize'] = 'максимальний розмір файла';
$labels['addcc'] = 'Додати Cc';
$labels['addbcc'] = 'Додати Bcc';
$labels['addreplyto'] = 'Додати Reply-To';
+$labels['mdnrequest'] = 'Відправник цього повідомлення запросив повідомлення про прочитання. Відправити повідомлення?';
+$labels['receiptread'] = 'Повідомлення про прочитання';
+$labels['yourmessage'] = 'повідомлення про прочитання вашого повідомлення';
+$labels['receiptnote'] = 'Це повідомлення означає тільки, що повідомлення було відкрито одержувачем, і не гарантує того, що воно було прочитано';
$labels['name'] = 'Відображуване ім`я';
$labels['firstname'] = 'Ім`я';
$labels['surname'] = 'Прізвище';
$labels['contactsfromto'] = 'Контакти з $from по $to з $count';
$labels['print'] = 'Друкувати';
$labels['export'] = 'Експортувати';
+$labels['exportvcards'] = 'Експортувати контакти у формат vcard';
$labels['previouspage'] = 'Показати попередній';
$labels['firstpage'] = 'Показати перший';
$labels['nextpage'] = 'Показати наступний';
$labels['lastpage'] = 'Показати останній';
$labels['groups'] = 'Групи';
$labels['personaladrbook'] = 'Персональні адреси';
+$labels['import'] = 'імпорт';
+$labels['importcontacts'] = 'Імпортувати контакти';
+$labels['importfromfile'] = 'Імпортувати з файлу';
+$labels['importreplace'] = 'Замінити всю записну книжку';
+$labels['importtext'] = 'Ви можете завантажити контакти з існуючої адресної книги. На даний момент підтримується завантаження у форматі vcard';
+$labels['done'] = 'Завершене';
$labels['settingsfor'] = 'Налаштування для';
-$labels['preferences'] = 'УподобаннÑ\8f';
-$labels['userpreferences'] = 'УподобаннÑ\8f користувача';
-$labels['editpreferences'] = 'Редагувати уподобання користувача';
+$labels['preferences'] = 'влаÑ\81Ñ\82ивоÑ\81Ñ\82Ñ\96';
+$labels['userpreferences'] = 'влаÑ\81Ñ\82ивоÑ\81Ñ\82Ñ\96 користувача';
+$labels['editpreferences'] = 'Редагувати властивостікористувача';
$labels['identities'] = 'Профілі';
$labels['manageidentities'] = 'Керування профілями';
$labels['newidentity'] = 'Новий профіль';
$labels['newitem'] = 'Новий';
$labels['edititem'] = 'Правка';
$labels['setdefault'] = 'Використовувати типово';
+$labels['autodetect'] = 'Визначати автоматично';
$labels['language'] = 'Мова';
$labels['timezone'] = 'Часовий пояс';
$labels['pagesize'] = 'Рядків на сторінці';
$labels['htmleditor'] = 'Створювати повідомлення в HTML';
$labels['htmlsignature'] = 'Підпис в HTML';
$labels['previewpane'] = 'Показати панель перегляду';
+$labels['skin'] = 'стиль інтерфейсу';
+$labels['logoutclear'] = 'видалити карзину ';
+$labels['logoutcompact'] = 'стиснути вхідні дані';
+$labels['uisettings'] = 'інтерфейс користувача';
+$labels['serversettings'] = 'настроювання сервера';
+$labels['mailboxview'] = 'Вид інтерфейсу';
+$labels['mdnrequests'] = 'Повідомлення про прочитання';
+$labels['askuser'] = 'запитати перед відправленням';
+$labels['autosend'] = 'автоматично відправляти';
+$labels['ignore'] = 'ігнорувати';
+$labels['readwhendeleted'] = 'Позначати як прочитане при видаленні';
+$labels['flagfordeletion'] = 'Позначати для видалення замість видалення';
+$labels['skipdeleted'] = 'Не показувати видаленні повідомлення';
+$labels['showremoteimages'] = 'Показувати видаленні зображення';
+$labels['fromknownsenders'] = 'від відомих відправників';
+$labels['always'] = 'завжди';
+$labels['showinlineimages'] = 'Показувати вкладені зображення внизу повідомлення';
$labels['autosavedraft'] = 'Автозбереження чернетки';
$labels['everynminutes'] = 'кожні $n хвилин';
+$labels['keepaliveevery'] = 'кожні $n хвилин';
+$labels['keepalive'] = 'Перевірка нових повідомлень';
$labels['never'] = 'ніколи';
-$labels['folder'] = 'Тека';
-$labels['folders'] = 'Теки';
-$labels['foldername'] = 'Назва теки';
+$labels['messagesdisplaying'] = 'Відображення повідомлень';
+$labels['messagescomposition'] = 'Створення повідомлень';
+$labels['mimeparamfolding'] = 'Імена вкладень';
+$labels['2231folding'] = 'Повний RFC 2231 (тільки для новітніх програм)';
+$labels['miscfolding'] = 'RFC 2047/2231 (найбільша сумісність)';
+$labels['2047folding'] = 'RFC 2047 (для старих програм)';
+$labels['advancedoptions'] = 'Додаткові настроювання';
+$labels['focusonnewmessage'] = 'Фокусувати вікно браузера при новому повідомленні';
+$labels['checkallfolders'] = 'Перевіряти нові повідомлення у всіх папках';
+$labels['folder'] = 'папка';
+$labels['folders'] = 'папки';
+$labels['foldername'] = 'назва папки';
$labels['subscribed'] = 'Підписані';
+$labels['messagecount'] = 'повідомлення';
$labels['create'] = 'Створити';
$labels['createfolder'] = 'Створити нову теку';
$labels['rename'] = 'Перейменувати';
$labels['renamefolder'] = 'Перейменувати теку';
$labels['deletefolder'] = 'Видалити теку';
$labels['managefolders'] = 'Керування теками';
+$labels['specialfolders'] = 'Особливі папки';
$labels['sortby'] = 'Відсортувати за';
$labels['sortasc'] = 'Сортувати за зростанням';
$labels['sortdesc'] = 'Сортувати за спаданням';
+$labels['B'] = 'Б';
+$labels['KB'] = 'КБ';
+$labels['MB'] = 'МБ';
+$labels['GB'] = 'ГБ';
-?>
\ No newline at end of file
+?>
/*
- +-----------------------------------------------------------------------+
- | language/uk/messages.inc |
- | |
- | Language file of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
- | Licensed under the GNU GPL |
- | |
- +-----------------------------------------------------------------------+
- | Author: Natali Stasyuk <natali@onlineua.net> |
- +-----------------------------------------------------------------------+
++-----------------------------------------------------------------------+
+| language/uk/messages.inc |
+| |
+| Language file of the RoundCube Webmail client |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
+| Licensed under the GNU GPL |
+| |
++-----------------------------------------------------------------------+
+| Author: Natali Stasyuk <natali@onlineua.net> |
++-----------------------------------------------------------------------+
- @version $Id$
+@version $Id$
*/
$messages['nocontactsfound'] = 'Контакти не знайдені';
$messages['contactnotfound'] = 'Запитаний контакт не знайдений';
$messages['sendingfailed'] = 'Не вдалося відправити повідомлення';
+$messages['senttooquickly'] = 'Ви повинні почекати $sec сек. для відправлення повідомлення';
+$messages['errorsavingsent'] = 'Відбулася помилка при збереженні відправленого повідомлення';
$messages['errorsaving'] = 'У процесі збереження трапилася помилка';
$messages['errormoving'] = 'Не вдалося перемістити повідомлення';
$messages['errordeleting'] = 'Не вдалося видалити повідомлення';
$messages['deletemessagesconfirm'] = 'Ви дійстно бажаєте видалити вибрані повідомлення?';
$messages['deletefolderconfirm'] = 'Ви дійстно бажаєте видалити цю теку?';
$messages['purgefolderconfirm'] = 'Ви дійстно бажаєте видалити всі повідомлення у цій теці?';
+$messages['foldercreating'] = 'Створення папки';
+$messages['folderdeleting'] = 'Видалити папку';
+$messages['folderrenaming'] = 'Перейменування папки';
+$messages['foldermoving'] = 'Переміщення папки';
$messages['formincomplete'] = 'Заповнені не усі поля';
$messages['noemailwarning'] = 'Будь ласка, введіть коректну адресу електронної пошти';
$messages['nonamewarning'] = 'Будь ласка, введіть ім`я';
$messages['nopagesizewarning'] = 'Будь ласка, введіть розмір сторінки';
+$messages['nosenderwarning'] = 'Будь ласка, уведіть адресу електронної пошти відправника';
$messages['norecipientwarning'] = 'Будь ласка, введіть ім`я отримувача';
$messages['nosubjectwarning'] = 'Поле "Тема" не заповнено. Бажаєте заповнити його зараз?';
$messages['nobodywarning'] = 'Відправити повідомлення без тексту?';
$messages['sourceisreadonly'] = 'Дане джерело адрес лише для читання';
$messages['errorsavingcontact'] = 'Неможливо зберегти адресу контакта';
$messages['movingmessage'] = 'Переміщую повідомлення...';
+$messages['receiptsent'] = 'Повідомлення про прочитання відправлене';
+$messages['errorsendingreceipt'] = 'Повідомлення про прочитання не відправлене';
+$messages['nodeletelastidentity'] = 'ви не можете вилучити цей профіль, він у вас останній';
+$messages['addsubfolderhint'] = 'Ця папка буде створена як підпапка в поточній папці';
+$messages['forbiddencharacter'] = 'Ім\'я папки містить неприпустимі символи';
+$messages['selectimportfile'] = 'Виберіть файл для завантаження';
+$messages['addresswriterror'] = 'Обрана адресна книга недоступна для запису';
+$messages['importwait'] = 'Імпортування, будь ласка, почекайте';
+$messages['importerror'] = 'Імпорт завершився невдало! Завантажений файл не є правильним файлом vcard';
+$messages['importconfirm'] = 'Успішно імпортованих $inserted контактів, пропущене $skipped існуючих';
+$messages['opnotpermitted'] = 'Дія заборонена!';
+$messages['nofromaddress'] = 'В обраному профілі не вистачає адреси електронної пошти';
+$messages['editorwarning'] = 'При перемиканні в редактор простого тексту все форматування буде загублено. Продовжити?';
-?>
\ No newline at end of file
+?>
| language/vn/labels.inc |\r
| |\r
| Language file of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |\r
+-----------------------------------------------------------------------+\r
| language/vn/messages.inc |\r
| |\r
| Language file of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |\r
+-----------------------------------------------------------------------+\r
| localization/zh_CN/labels.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Zhang Huang bin <michaelbibby@gmail.com> |
+-----------------------------------------------------------------------+
-@version $Id: labels.inc 2151 2008-12-14 21:37:19Z yllar $
+@version $Id: labels.inc 2237 2009-01-17 01:55:39Z till $
*/
| localization/zh_CN/messages.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Zhang Huang bin <michaelbibby@gmail.com> |
+-----------------------------------------------------------------------+
-@version $Id: messages.inc 2136 2008-12-08 20:44:46Z yllar $
+@version $Id: messages.inc 2237 2009-01-17 01:55:39Z till $
*/
| localization/zh_TW/labels.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Ting-Hung Chiu <earrl@mmlab.cse.yzu.edu.tw> |
+-----------------------------------------------------------------------+
-@version $Id: labels.inc 2115 2008-12-04 10:21:34Z alec $
+@version $Id: labels.inc 2237 2009-01-17 01:55:39Z till $
*/
| localization/zh_TW/messages.inc |
| |
| Language file of the RoundCube Webmail client |
-| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+| Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Ting-Hung Chiu <earrl@mmlab.cse.yzu.edu.tw> |
+-----------------------------------------------------------------------+
-@version $Id: messages.inc 1886 2008-09-24 08:41:27Z tomekp $
+@version $Id: messages.inc 2237 2009-01-17 01:55:39Z till $
*/
| program/steps/addressbook/export.inc |
| |
| This file is part of the RoundCube Webmail client |
- | Copyright (C) 2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2008-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
| program/steps/addressbook/import.inc |
| |
| This file is part of the RoundCube Webmail client |
- | Copyright (C) 2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2008-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
| program/steps/addressbook/show.inc |
| |
| This file is part of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
| Author: Thomas Bruederli <roundcube@gmail.com> |
+-----------------------------------------------------------------------+
- $Id: show.inc 1615 2008-07-29 12:32:19Z thomasb $
+ $Id: show.inc 2237 2009-01-17 01:55:39Z till $
*/
| program/steps/error.inc |
| |
| This file is part of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
| Author: Thomas Bruederli <roundcube@gmail.com> |
+-----------------------------------------------------------------------+
- $Id: error.inc 1946 2008-10-06 18:59:22Z alec $
+ $Id: error.inc 2237 2009-01-17 01:55:39Z till $
*/
| program/steps/mail/attachments.inc |
| |
| This file is part of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
$id = count($_SESSION['compose']['attachments']);
$_SESSION['compose']['attachments'][] = array(
'name' => $_FILES['_attachments']['name'][$i],
- 'mimetype' => rc_mime_content_type($tmpfname, $_FILES['_attachments']['type'][$i]),
+ 'mimetype' => rc_mime_content_type($tmpfname, $_FILES['_attachments']['name'][$i], $_FILES['_attachments']['type'][$i]),
'path' => $tmpfname,
);
| program/steps/mail/autocomplete.inc |
| |
| This file is part of the RoundCube Webmail client |
- | Copyright (C) 2008, RoundCube Dev Team |
+ | Copyright (C) 2008-2009, RoundCube Dev Team |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
$MAXNUM = 15; // same limit as in app.js
$contacts = array();
+$book_types = (array) $RCMAIL->config->get('autocomplete_addressbooks', 'sql');
-if ($search = get_input_value('_search', RCUBE_INPUT_POST)) {
+if ($book_types && $search = get_input_value('_search', RCUBE_INPUT_POST)) {
- foreach ($RCMAIL->config->get('autocomplete_addressbooks', array('sql')) as $id) {
+ foreach ($book_types as $id) {
$abook = $RCMAIL->get_address_book($id);
$abook->set_pagesize($MAXNUM);
sort($contacts);
}
-$OUTPUT->command('ksearch_query_results', $contacts);
+$OUTPUT->command('ksearch_query_results', $contacts, $search);
$OUTPUT->send();
?>
\ No newline at end of file
| program/steps/mail/check_recent.inc |
| |
| This file is part of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
if ($mbox_name == $IMAP->get_mailbox_name()) {
if ($recent_count = $IMAP->messagecount(NULL, 'RECENT', TRUE)) {
// refresh saved search set
- if (($search_request = get_input_value('_search', RCUBE_INPUT_GPC)) && $IMAP->search_set)
+ if (($search_request = get_input_value('_search', RCUBE_INPUT_GPC)) && isset($_SESSION['search'][$search_request])) {
$_SESSION['search'][$search_request] = $IMAP->refresh_search();
-
- $count_all = $IMAP->messagecount(NULL, 'ALL', TRUE);
+ $all_count = $IMAP->messagecount();
+ } else {
+ $all_count = $IMAP->messagecount(NULL, 'ALL', TRUE);
+ }
+
$unread_count = $IMAP->messagecount(NULL, 'UNSEEN', TRUE);
- $OUTPUT->set_env('messagecount', $IMAP->messagecount());
+ $OUTPUT->set_env('messagecount', $all_count);
$OUTPUT->set_env('pagesize', $IMAP->page_size);
- $OUTPUT->set_env('pagecount', ceil($IMAP->messagecount()/$IMAP->page_size));
+ $OUTPUT->set_env('pagecount', ceil($all_count/$IMAP->page_size));
$OUTPUT->command('set_unread_count', $mbox_name, $unread_count, ($mbox_name == 'INBOX'));
- $OUTPUT->command('set_rowcount', rcmail_get_messagecount_text());
- $OUTPUT->command('set_quota', rcmail_quota_content($IMAP->get_quota()));
+ $OUTPUT->command('set_rowcount', rcmail_get_messagecount_text($all_count));
if (rcmail::get_instance()->config->get('focus_on_new_message',true))
$OUTPUT->command('new_message_focus');
- // add new message headers to list
- $a_headers = array();
- for ($i=$recent_count, $id=$count_all-$recent_count+1; $i>0; $i--, $id++)
- {
- // skip message if it does not match the current search
- if (!$IMAP->in_searchset($id))
- continue;
-
- $header = $IMAP->get_headers($id, NULL, FALSE);
- if ($header->recent)
- $a_headers[] = $header;
- }
+ if (!empty($_GET['_quota']))
+ $OUTPUT->command('set_quota', rcmail_quota_content($IMAP->get_quota()));
+
+ // "No-list" mode, don't get messages
+ if (empty($_GET['_list']))
+ continue;
- rcmail_js_message_list($a_headers, TRUE);
+ // use SEARCH/SORT to find recent messages
+ $search_str = 'RECENT';
+ if ($search_request)
+ $search_str .= ' '.$IMAP->search_string;
+
+ $result = $IMAP->search($mbox_name, $search_str, NULL, 'date');
+
+ if ($result) {
+ // get the headers
+ $result_h = $IMAP->list_headers($mbox_name, 1, 'date', 'DESC');
+ // add to the list
+ rcmail_js_message_list($result_h, TRUE);
+ }
}
}
- else if ($IMAP->messagecount($mbox_name, 'RECENT', $check_all)) {
- $OUTPUT->command('set_unread_count', $mbox_name, $IMAP->messagecount($mbox_name, 'UNSEEN', $check_all));
+ else if ($unseen = $IMAP->messagecount($mbox_name, 'UNSEEN', $check_all)) {
+ $OUTPUT->command('set_unread_count', $mbox_name, $unseen);
}
}
| program/steps/mail/compose.inc |
| |
| This file is part of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
| Author: Thomas Bruederli <roundcube@gmail.com> |
+-----------------------------------------------------------------------+
- $Id: compose.inc 2161 2008-12-16 17:01:50Z thomasb $
+ $Id: compose.inc 2301 2009-02-18 19:15:36Z alec $
*/
// load draft message body
else if ($compose_mode == RCUBE_COMPOSE_DRAFT)
$body = rcmail_create_draft_body($body, $isHtml);
-
- if ($isHtml) {
- // replace cid with href in inline images links
- foreach ((array)$_SESSION['compose']['attachments'] as $pid => $attachment) {
- if ($attachment['content_id']) {
- $body = str_replace('cid:'. $attachment['content_id'],
- $OUTPUT->app->comm_path.'&_action=display-attachment&_file=rcmfile'.$pid, $body);
- }
- }
- }
}
else if (!empty($_SESSION['compose']['param']['_body']))
{
}
else
{
+ // save inline images to files
+ $cid_map = rcmail_write_inline_attachments($MESSAGE);
+ // set is_safe flag (we need this for html body washing)
+ rcmail_check_safe($MESSAGE);
+ // clean up html tags
+ $body = rcmail_wash_html($body, array('safe' => $MESSAGE->is_safe), $cid_map);
+
+ // build reply (quote content)
$prefix = sprintf("On %s, %s wrote:<br />\n",
$MESSAGE->headers->date,
htmlspecialchars(Q($MESSAGE->get_header('from'), 'replace'), ENT_COMPAT, $OUTPUT->get_charset()));
$prefix .= '<blockquote type="cite" style="padding-left:5px; border-left:#1010ff 2px solid; margin-left:5px; width:100%">';
$suffix = "</blockquote><p></p>";
-
- rcmail_write_inline_attachments($MESSAGE);
}
return $prefix.$body.$suffix;
{
global $IMAP, $MESSAGE, $OUTPUT;
+ // add attachments
+ if (!isset($_SESSION['compose']['forward_attachments']) && is_array($MESSAGE->mime_parts))
+ $cid_map = rcmail_write_compose_attachments($MESSAGE, $bodyIsHtml);
+
if (!$bodyIsHtml)
{
$prefix = "\n\n\n-------- Original Message --------\n";
}
else
{
+ // set is_safe flag (we need this for html body washing)
+ rcmail_check_safe($MESSAGE);
+ // clean up html tags
+ $body = rcmail_wash_html($body, array('safe' => $MESSAGE->is_safe), $cid_map);
+
$prefix = sprintf(
"<br><br>-------- Original Message --------" .
"<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tbody>" .
$prefix .= "</tbody></table><br>";
}
-
- // add attachments
- if (!isset($_SESSION['compose']['forward_attachments']) && is_array($MESSAGE->mime_parts))
- rcmail_write_compose_attachments($MESSAGE, $bodyIsHtml);
return $prefix.$body;
}
function rcmail_create_draft_body($body, $bodyIsHtml)
{
- global $MESSAGE;
+ global $MESSAGE, $OUTPUT;
/**
* add attachments
if (!isset($_SESSION['compose']['forward_attachments'])
&& is_array($MESSAGE->mime_parts)
&& count($MESSAGE->mime_parts) > 0)
- rcmail_write_compose_attachments($MESSAGE, $bodyIsHtml);
+ {
+ $cid_map = rcmail_write_compose_attachments($MESSAGE, $bodyIsHtml);
+ // replace cid with href in inline images links
+ if ($cid_map)
+ $body = str_replace(array_keys($cid_map), array_values($cid_map), $body);
+ }
+
return $body;
}
function rcmail_write_compose_attachments(&$message, $bodyIsHtml)
{
+ global $OUTPUT;
+
+ $cid_map = array();
+ $id = 0;
+
foreach ((array)$message->mime_parts as $pid => $part)
{
if (($part->ctype_primary != 'message' || !$bodyIsHtml) &&
($part->disposition=='attachment' || $part->disposition=='inline' || $part->headers['content-id']
|| (empty($part->disposition) && $part->filename)))
{
- if ($attachment = rcmail_save_attachment($message, $pid))
- $_SESSION['compose']['attachments'][] = $attachment;
+ if ($attachment = rcmail_save_attachment($message, $pid)) {
+ $_SESSION['compose']['attachments'][$id] = $attachment;
+ if ($bodyIsHtml && $part->filename && $part->content_id) {
+ $cid_map['cid:'.$part->content_id] =
+ $OUTPUT->app->comm_path.'&_action=display-attachment&_file=rcmfile'.$id;
+ }
+ $id++;
+ }
}
}
$_SESSION['compose']['forward_attachments'] = true;
+
+ return $cid_map;
}
function rcmail_write_inline_attachments(&$message)
{
- foreach ((array)$message->mime_parts as $pid => $part)
- {
- if ($part->content_id && $part->filename)
- {
- if ($attachment = rcmail_save_attachment($message, $pid))
- $_SESSION['compose']['attachments'][] = $attachment;
+ global $OUTPUT;
+
+ $cid_map = array();
+ $id = 0;
+
+ foreach ((array)$message->mime_parts as $pid => $part) {
+ if ($part->content_id && $part->filename) {
+ if ($attachment = rcmail_save_attachment($message, $pid)) {
+ $_SESSION['compose']['attachments'][$id] = $attachment;
+ $cid_map['cid:'.$part->content_id] =
+ $OUTPUT->app->comm_path.'&_action=display-attachment&_file=rcmfile'.$id;
+ $id++;
+ }
}
}
+
+ return $cid_map;
}
function rcmail_save_attachment(&$message, $pid)
| program/steps/mail/func.inc |
| |
| This file is part of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
| Author: Thomas Bruederli <roundcube@gmail.com> |
+-----------------------------------------------------------------------+
- $Id: func.inc 2197 2008-12-30 13:30:20Z thomasb $
+ $Id: func.inc 2324 2009-03-02 17:34:18Z thomasb $
*/
-require_once('lib/enriched.inc');
require_once('include/rcube_smtp.inc');
-$EMAIL_ADDRESS_PATTERN = '/([a-z0-9][a-z0-9\-\.\+\_]*@[a-z0-9]([a-z0-9\-][.]?)*[a-z0-9]\\.[a-z]{2,5})/i';
+$EMAIL_ADDRESS_PATTERN = '([a-z0-9][a-z0-9\-\.\+\_]*@[a-z0-9]([a-z0-9\-][.]?)*[a-z0-9]\\.[a-z]{2,5})';
// actions that do not require imap connection
$NOIMAP_ACTIONS = array('spell', 'addcontact', 'autocomplete', 'upload', 'display-attachment', 'remove-attachment');
$out .= sprintf("<td class=\"icon\">%s</td>\n", $message_icon ? sprintf($image_tag, $skin_path, $message_icon, '') : '');
- if (!empty($header->charset))
- $IMAP->set_charset($header->charset);
+ $IMAP->set_charset(!empty($header->charset) ? $header->charset : $CONFIG['default_charset']);
// format each col
foreach ($a_show_cols as $col)
if (empty($header))
continue;
- if (!empty($header->charset))
- $IMAP->set_charset($header->charset);
+ $IMAP->set_charset(!empty($header->charset) ? $header->charset : $CONFIG['default_charset']);
// remove 'attachment' and 'flag' columns, we don't need them here
if(($key = array_search('attachment', $a_show_cols)) !== FALSE)
return rcmail_localize_foldername($RCMAIL->imap->get_mailbox_name());
}
+/**
+ * Sets message is_safe flag according to 'show_images' option value
+ *
+ * @param object rcube_message Message
+ */
+function rcmail_check_safe(&$message)
+{
+ global $RCMAIL;
+
+ $show_images = $RCMAIL->config->get('show_images');
+ if (!$message->is_safe
+ && !empty($show_images)
+ && $message->has_html_part())
+ {
+ switch($show_images) {
+ case '1': // known senders only
+ $CONTACTS = new rcube_contacts($RCMAIL->db, $_SESSION['user_id']);
+ if ($CONTACTS->search('email', $message->sender['mailto'], true, false)->count) {
+ $message->set_safe(true);
+ }
+ break;
+ case '2': // always
+ $message->set_safe(true);
+ break;
+ }
+ }
+}
+
+/**
+ * Cleans up the given message HTML Body (for displaying)
+ *
+ * @param string HTML
+ * @param array Display parameters
+ * @param array CID map replaces (inline images)
+ * @return string Clean HTML
+ */
+function rcmail_wash_html($html, $p = array(), $cid_replaces)
+{
+ global $REMOTE_OBJECTS;
+
+ $p += array('safe' => false, 'inline_html' => true);
+
+ // special replacements (not properly handled by washtml class)
+ $html_search = array(
+ '/(<\/nobr>)(\s+)(<nobr>)/i', // space(s) between <NOBR>
+ '/(<[\/]*st1:[^>]+>)/i', // Microsoft's Smart Tags <ST1>
+ '/<\/?rte_text>/i', // Rich Text Editor tags (#1485647)
+ '/<title>.*<\/title>/i', // PHP bug #32547 workaround: remove title tag
+ '/<html[^>]*>/im', // malformed html: remove html tags (#1485139)
+ '/<\/html>/i', // malformed html: remove html tags (#1485139)
+ '/^[\xFE\xFF\xBB\xBF\x00]+((?:<\!doctype|\<html))/im', // remove byte-order mark (only outlook?)
+ );
+ $html_replace = array(
+ '\\1'.' '.'\\3',
+ '',
+ '',
+ '',
+ '',
+ '',
+ '\\1',
+ );
+ $html = preg_replace($html_search, $html_replace, $html);
+
+ // charset was converted to UTF-8 in rcube_imap::get_message_part() -> change charset specification in HTML accordingly
+ $charset_pattern = '/(\s+content=[\'"]?\w+\/\w+;\s*charset)=([a-z0-9-_]+)/i';
+ if (preg_match($charset_pattern, $html)) {
+ $html = preg_replace($charset_pattern, '\\1='.RCMAIL_CHARSET, $html);
+ }
+ else {
+ // add head for malformed messages, washtml cannot work without that
+ if (!preg_match('/<head[^>]*>(.*)<\/head>/Uims', $html))
+ $html = '<head></head>'. $html;
+ $html = substr_replace($html, '<meta http-equiv="content-type" content="text/html; charset='.RCMAIL_CHARSET.'" />', intval(stripos($html, '<head>')+6), 0);
+ }
+
+ // turn relative into absolute urls
+ $html = rcmail_resolve_base($html);
+
+ // clean HTML with washhtml by Frederic Motte
+ $wash_opts = array(
+ 'show_washed' => false,
+ 'allow_remote' => $p['safe'],
+ 'blocked_src' => "./program/blocked.gif",
+ 'charset' => RCMAIL_CHARSET,
+ 'cid_map' => $cid_replaces,
+ 'html_elements' => array('body'),
+ );
+
+ if (!$p['inline_html']) {
+ $wash_opts['html_elements'] = array('html','head','title','body');
+ }
+ if ($p['safe']) {
+ $wash_opts['html_elements'][] = 'link';
+ $wash_opts['html_attribs'] = array('rel','type');
+ }
+
+ $washer = new washtml($wash_opts);
+ $washer->add_callback('form', 'rcmail_washtml_callback');
+
+ if ($p['safe']) { // allow CSS styles, will be sanitized by rcmail_washtml_callback()
+ $washer->add_callback('style', 'rcmail_washtml_callback');
+ }
+
+ $html = $washer->wash($html);
+ $REMOTE_OBJECTS = $washer->extlinks;
+
+ return $html;
+}
+
/**
* Convert the given message part to proper HTML
* which can be displayed the message view
*
* @param object rcube_message_part Message part
- * @param bool True if external objects (ie. images ) are allowed
- * @param bool True if part should be converted to plaintext
+ * @param array Display parameters array
* @return string Formatted HTML string
*/
function rcmail_print_body($part, $p = array())
{
- global $REMOTE_OBJECTS;
-
$p += array('safe' => false, 'plain' => false, 'inline_html' => true);
-
+
// convert html to text/plain
if ($part->ctype_secondary == 'html' && $p['plain']) {
$txt = new html2text($part->body, false, true);
}
// text/html
else if ($part->ctype_secondary == 'html') {
- $html = $part->body;
-
- // special replacements (not properly handled by washtml class)
- $html_search = array(
- '/(<\/nobr>)(\s+)(<nobr>)/i', // space(s) between <NOBR>
- '/(<[\/]*st1:[^>]+>)/i', // Microsoft's Smart Tags <ST1>
- '/<\/?rte_text>/i', // Rich Text Editor tags (#1485647)
- '/<title>.*<\/title>/i', // PHP bug #32547 workaround: remove title tag
- '/<html[^>]*>/im', // malformed html: remove html tags (#1485139)
- '/<\/html>/i', // malformed html: remove html tags (#1485139)
- '/^[\xFE\xFF\xBB\xBF\x00]+((?:<\!doctype|\<html))/im', // remove byte-order mark (only outlook?)
- );
- $html_replace = array(
- '\\1'.' '.'\\3',
- '',
- '',
- '',
- '',
- '',
- '\\1',
- );
- $html = preg_replace($html_search, $html_replace, $html);
-
- // charset was converted to UTF-8 in rcube_imap::get_message_part() -> change charset specification in HTML accordingly
- $charset_pattern = '/(\s+content=[\'"]?\w+\/\w+;\s*charset)=([a-z0-9-_]+)/i';
- if (preg_match($charset_pattern, $html)) {
- $html = preg_replace($charset_pattern, '\\1='.RCMAIL_CHARSET, $html);
- }
- else {
- // add head for malformed messages, washtml cannot work without that
- if (!preg_match('/<head[^>]*>(.*)<\/head>/Uims', $html))
- $html = '<head></head>'. $html;
- $html = substr_replace($html, '<meta http-equiv="content-type" content="text/html; charset='.RCMAIL_CHARSET.'" />', intval(stripos($html, '<head>')+6), 0);
- }
-
- // clean HTML with washhtml by Frederic Motte
- $wash_opts = array(
- 'show_washed' => false,
- 'allow_remote' => $p['safe'],
- 'blocked_src' => "./program/blocked.gif",
- 'charset' => RCMAIL_CHARSET,
- 'cid_map' => $part->replaces,
- 'html_elements' => array('body'),
- );
-
- if (!$p['inline_html']) {
- $wash_opts['html_elements'] = array('html','head','title','body');
- }
-
- $washer = new washtml($wash_opts);
- $washer->add_callback('form', 'rcmail_washtml_callback');
-
- if ($p['safe']) { // allow CSS styles, will be sanitized by rcmail_washtml_callback()
- $washer->add_callback('style', 'rcmail_washtml_callback');
- }
-
- $body = $washer->wash($html);
- $REMOTE_OBJECTS = $washer->extlinks;
-
- return $body;
+ return rcmail_wash_html($part->body, $p, $part->replaces);
}
// text/enriched
else if ($part->ctype_secondary=='enriched') {
$part->ctype_secondary = 'html';
+ require_once('lib/enriched.inc');
return Q(enriched_to_html($part->body), 'show');
}
else
/**** assert plaintext ****/
// make links and email-addresses clickable
- $convert_patterns = $convert_replaces = $replace_strings = array();
+ $replacements = new rcube_string_replacer;
$url_chars = 'a-z0-9_\-\+\*\$\/&%=@#:;';
$url_chars_within = '\?\.~,!';
-
- $convert_patterns[] = "/([\w]+):\/\/([a-z0-9\-\.]+[a-z]{2,4}([$url_chars$url_chars_within]*[$url_chars])?)/ie";
- $convert_replaces[] = "rcmail_str_replacement('<a href=\"\\1://\\2\" target=\"_blank\">\\1://\\2</a>', \$replace_strings)";
-
- $convert_patterns[] = "/([^\/:]|\s)(www\.)([a-z0-9\-]{2,}[a-z]{2,4}([$url_chars$url_chars_within]*[$url_chars])?)/ie";
- $convert_replaces[] = "rcmail_str_replacement('\\1<a href=\"http://\\2\\3\" target=\"_blank\">\\2\\3</a>', \$replace_strings)";
-
- $convert_patterns[] = '/([a-z0-9][a-z0-9\-\.\+\_]*@[a-z0-9]([a-z0-9\-][.]?)*[a-z0-9]\\.[a-z]{2,5})/ie';
- $convert_replaces[] = "rcmail_str_replacement('<a href=\"mailto:\\1\" onclick=\"return ".JS_OBJECT_NAME.".command(\'compose\',\'\\1\',this)\">\\1</a>', \$replace_strings)";
// search for patterns like links and e-mail addresses
- $body = preg_replace($convert_patterns, $convert_replaces, $body);
+ $body = preg_replace_callback("/([\w]+):\/\/([a-z0-9\-\.]+[a-z]{2,4}([$url_chars$url_chars_within]*[$url_chars])?)/i", array($replacements, 'link_callback'), $body);
+ $body = preg_replace_callback("/([^\/:]|\s)(www\.)([a-z0-9\-]{2,}[a-z]{2,4}([$url_chars$url_chars_within]*[$url_chars])?)/i", array($replacements, 'link_callback'), $body);
+ $body = preg_replace_callback('/([a-z0-9][a-z0-9\-\.\+\_]*@[a-z0-9]([a-z0-9\-][.]?)*[a-z0-9]\\.[a-z]{2,5})/i', array($replacements, 'mailto_callback'), $body);
// split body into single lines
$a_lines = preg_split('/\r?\n/', $body);
}
// insert the links for urls and mailtos
- $body = preg_replace("/##string_replacement\{([0-9]+)\}##/e", "\$replace_strings[\\1]", join("\n", $a_lines));
+ $body = $replacements->resolve(join("\n", $a_lines));
return html::tag('pre', array(), $body);
}
+
/**
* add a string to the replacement array and return a replacement string
*/
}
+/**
+ * Convert all relative URLs according to a <base> in HTML
+ */
+function rcmail_resolve_base($body)
+{
+ // check for <base href=...>
+ if (preg_match('!(<base.*href=["\']?)([hftps]{3,5}://[a-z0-9/.%-]+)!i', $body, $regs)) {
+ $replacer = new rcube_base_replacer($regs[2]);
+
+ // replace all relative paths
+ $body = preg_replace_callback('/(src|background|href)=(["\']?)([\.\/]+[^"\'\s]+)(\2|\s|>)/Ui', array($replacer, 'callback'), $body);
+ $body = preg_replace_callback('/(url\s*\()(["\']?)([\.\/]+[^"\'\)\s]+)(\2)\)/Ui', array($replacer, 'callback'), $body);
+ }
+
+ return $body;
+}
/**
* modify a HTML message that it can be displayed inside a HTML page
*/
function rcmail_html4inline($body, $container_id)
{
- $base_url = "";
$last_style_pos = 0;
$body_lc = strtolower($body);
- // check for <base href>
- if (preg_match(($base_reg = '/(<base.*href=["\']?)([hftps]{3,5}:\/{2}[^"\'\s]+)([^<]*>)/i'), $body, $base_regs))
- $base_url = $base_regs[2];
-
// find STYLE tags
while (($pos = strpos($body_lc, '<style', $last_style_pos)) && ($pos2 = strpos($body_lc, '</style>', $pos)))
{
$pos = strpos($body_lc, '>', $pos)+1;
// replace all css definitions with #container [def]
- $styles = rcmail_mod_css_styles(substr($body, $pos, $pos2-$pos), $container_id, $base_url);
+ $styles = rcmail_mod_css_styles(substr($body, $pos, $pos2-$pos), $container_id);
$body = substr($body, 0, $pos) . $styles . substr($body, $pos2);
$body_lc = strtolower($body);
$last_style_pos = $pos2;
}
- // resolve <base href>
- if ($base_url)
- {
- $body = preg_replace('/(src|background|href)=(["\']?)([\.\/]+[^"\'\s]+)(\2|\s|>)/Uie', "'\\1=\"'.make_absolute_url('\\3', '$base_url').'\"'", $body);
- $body = preg_replace('/(url\s*\()(["\']?)([\.\/]+[^"\'\)\s]+)(\2)\)/Uie', "'\\1\''.make_absolute_url('\\3', '$base_url').'\')'", $body);
- $body = preg_replace($base_reg, '', $body);
- }
-
// modify HTML links to open a new window if clicked
- $body = preg_replace('/<(a|link)\s+([^>]+)>/Uie', "rcmail_alter_html_link('\\1','\\2', '$container_id');", $body);
+ $GLOBALS['rcmail_html_container_id'] = $container_id;
+ $body = preg_replace_callback('/<(a|link)\s+([^>]+)>/Ui', 'rcmail_alter_html_link', $body);
+ unset($GLOBALS['rcmail_html_container_id']);
// add comments arround html and other tags
$out = preg_replace(array(
/**
* parse link attributes and set correct target
*/
-function rcmail_alter_html_link($tag, $attrs, $container_id)
+function rcmail_alter_html_link($matches)
{
- $attrib = parse_attrib_string($attrs);
+ global $EMAIL_ADDRESS_PATTERN;
+
+ $tag = $matches[1];
+ $attrib = parse_attrib_string($matches[2]);
$end = '>';
if ($tag == 'link' && preg_match('/^https?:\/\//i', $attrib['href'])) {
- $attrib['href'] = "./bin/modcss.php?u=" . urlencode($attrib['href']) . "&c=" . urlencode($container_id);
+ $attrib['href'] = "./bin/modcss.php?u=" . urlencode($attrib['href']) . "&c=" . urlencode($GLOBALS['rcmail_html_container_id']);
$end = ' />';
}
- else if (stristr((string)$attrib['href'], 'mailto:')) {
+ else if (preg_match("/^mailto:$EMAIL_ADDRESS_PATTERN/i", $attrib['href'], $mailto)) {
+ $attrib['href'] = $mailto[0];
$attrib['onclick'] = sprintf(
"return %s.command('compose','%s',this)",
JS_OBJECT_NAME,
- JQ(substr($attrib['href'], 7)));
+ JQ($mailto[1]));
}
else if (!empty($attrib['href']) && $attrib['href'][0] != '#') {
$attrib['target'] = '_blank';
if ($PRINT_MODE) {
$out .= sprintf('%s <%s>', Q($part['name']), $part['mailto']);
}
- else if (preg_match($EMAIL_ADDRESS_PATTERN, $part['mailto'])) {
+ else if (preg_match("/$EMAIL_ADDRESS_PATTERN/i", $part['mailto'])) {
if ($linked) {
$out .= html::a(array(
'href' => 'mailto:'.$part['mailto'],
$message = new rcube_message($uid);
- if ($message->headers->mdn_to && !$message->headers->mdn_sent && $IMAP->check_permflag('MDNSENT'))
+ if ($message->headers->mdn_to && !$message->headers->mdn_sent &&
+ ($IMAP->check_permflag('MDNSENT') || $IMAP->check_permflag('*')))
{
$identity = $RCMAIL->user->get_identity();
$sender = format_email_recipient($identity['email'], $identity['name']);
| program/steps/mail/get.inc |
| |
| This file is part of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
| Author: Thomas Bruederli <roundcube@gmail.com> |
+-----------------------------------------------------------------------+
- $Id: get.inc 2182 2008-12-19 07:20:50Z alec $
+ $Id: get.inc 2282 2009-02-08 20:38:54Z thomasb $
*/
-require_once('Mail/mimeDecode.php');
-
// show loading page
if (!empty($_GET['_preload'])) {
}
else if ($pid = get_input_value('_part', RCUBE_INPUT_GET)) {
+ // TNEF encoded attachment part
+ if (preg_match('/^winmail\.([0-9.]+)\.([0-9]+)$/', $pid, $nt)) {
+ $pid = $nt[1]; $i = $nt[2];
+ if ($part = $MESSAGE->mime_parts[$pid]) {
+ $tnef_arr = $IMAP->tnef_decode($part, $MESSAGE->uid);
+ if (is_a($tnef_arr[$i], 'rcube_message_part'))
+ $MESSAGE->mime_parts[$pid] = $tnef_arr[$i];
+ }
+ }
+
if ($part = $MESSAGE->mime_parts[$pid]) {
$ctype_primary = strtolower($part->ctype_primary);
$ctype_secondary = strtolower($part->ctype_secondary);
$disposition = !empty($_GET['_download']) ? 'attachment' : 'inline';
header("Content-Disposition: $disposition; filename=\"$filename\"");
-
+
// turn off output buffering and print part content
- $IMAP->get_message_part($MESSAGE->uid, $part->mime_id, $part, true);
+ if ($part->body)
+ echo $part->body;
+ else
+ $IMAP->get_message_part($MESSAGE->uid, $part->mime_id, $part, true);
}
exit;
| Author: Sjon Hortensius <sjon@hortensius.net> |
+-----------------------------------------------------------------------+
- $Id: rss.inc 931 2007-11-25 19:45:38Z thomasb $
+ $Id: rss.inc 2223 2009-01-08 14:12:00Z alec $
*/
-require_once('Mail/mimeDecode.php');
-
function rss_encode($string){
$string = rep_specialchars_output($string, 'xml');
}
-
$REMOTE_REQUEST = TRUE;
$OUTPUT_TYPE = 'rss';
$subject = "HEADER FROM";
$search = trim($srch);
}
-else if (preg_match("/^to.*:/i", $str))
+else if (preg_match("/^to:.*/i", $str))
{
list(,$srch) = explode(":", $str);
$subject = "HEADER TO";
if (!is_array($_SESSION['search']))
$_SESSION['search'] = array();
+if ($search_str) {
+ $_SESSION['search'][$search_request] = $IMAP->get_search_set();
+ $_SESSION['last_text_search'] = $str;
+}
+
// Make sure we got the headers
if (!empty($result_h))
{
rcmail_js_message_list($result_h);
- if ($search_str) {
- $_SESSION['search'][$search_request] = $IMAP->get_search_set();
- $_SESSION['last_text_search'] = $str;
+ if ($search_str)
$OUTPUT->show_message('searchsuccessful', 'confirmation', array('nr' => $count));
- }
}
else
{
| program/steps/mail/sendmail.inc |
| |
| This file is part of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
| Author: Thomas Bruederli <roundcube@gmail.com> |
+-----------------------------------------------------------------------+
- $Id: sendmail.inc 2193 2008-12-29 14:43:45Z alec $
+ $Id: sendmail.inc 2320 2009-03-01 07:55:39Z alec $
*/
/****** checks ********/
if (!isset($_SESSION['compose']['id'])) {
- raise_error(array('code' => 500, 'file' => __FILE__, 'message' => "Invalid compose ID"), true, false);
+ raise_error(array('code' => 500, 'type' => 'smtp', 'file' => __FILE__, 'message' => "Invalid compose ID"), true, false);
console("Sendmail error", $_SESSION['compose']);
$OUTPUT->show_message("An internal error occured. Please try again.", 'error');
$OUTPUT->send('iframe');
{
global $CONFIG;
- $htmlContents = $mime_message->getHtmlBody();
+ $body = $mime_message->getHtmlBody();
// remove any null-byte characters before parsing
- $body = preg_replace('/\x00/', '', $htmlContents);
+ $body = preg_replace('/\x00/', '', $body);
- $last_img_pos = 0;
$searchstr = 'program/js/tiny_mce/plugins/emotions/img/';
- $path_len = strlen(INSTALL_PATH . '/');
+ $offset = 0;
// keep track of added images, so they're only added once
$included_images = array();
- // find emoticon image tags
- while ($pos = strpos($body, $searchstr, $last_img_pos))
- {
- $pos2 = strpos($body, '"', $pos);
- $body_pre = substr($body, 0, $pos);
- $body_post = substr($body, $pos2);
-
- $image_name = substr($body,
- $pos + strlen($searchstr),
- $pos2 - ($pos + strlen($searchstr)));
-
- // sanitize image name so resulting attachment doesn't leave images dir
- $image_name = preg_replace('/[^a-zA-Z0-9_\.\-]/i','',$image_name);
- $img_file = INSTALL_PATH . '/' . $searchstr . $image_name;
-
- if (! in_array($image_name, $included_images))
- {
- // add the image to the MIME message
- if(! $mime_message->addHTMLImage($img_file, 'image/gif', '', true, $image_name))
- $OUTPUT->show_message("emoticonerror", 'error');
- array_push($included_images, $image_name);
+ if (preg_match_all('# src=[\'"]([^\'"]+)#', $body, $matches, PREG_OFFSET_CAPTURE)) {
+ foreach ($matches[1] as $m) {
+ // find emoticon image tags
+ if (preg_match('#'.$searchstr.'(.*)$#', $m[0], $imatches)) {
+ $image_name = $imatches[1];
+
+ // sanitize image name so resulting attachment doesn't leave images dir
+ $image_name = preg_replace('/[^a-zA-Z0-9_\.\-]/i', '', $image_name);
+ $img_file = INSTALL_PATH . '/' . $searchstr . $image_name;
+
+ if (! in_array($image_name, $included_images)) {
+ // add the image to the MIME message
+ if(! $mime_message->addHTMLImage($img_file, 'image/gif', '', true, $image_name))
+ $OUTPUT->show_message("emoticonerror", 'error');
+ array_push($included_images, $image_name);
+ }
+
+ $body = substr_replace($body, $img_file, $m[1] + $offset, strlen($m[0]));
+ $offset += strlen($img_file) - strlen($m[0]);
}
-
- $body = $body_pre . $img_file . $body_post;
-
- $last_img_pos = $pos2 + $path_len;
}
+ }
$mime_message->setHTMLBody($body);
+
+ return $body;
}
+// parse email address input
+function rcmail_mailto_format($mailto)
+{
+ $regexp = array('/[,;]\s*[\r\n]+/', '/[\r\n]+/', '/[,;]\s*$/m', '/;/', '/(\S{1})(<\S+@\S+>)/U');
+ $replace = array(', ', ', ', '', ',', '\\1 \\2');
+
+ // replace new lines and strip ending ', ', make address input more valid
+ $mailto = trim(preg_replace($regexp, $replace, $mailto));
+
+ $result = array();
+ $items = rcube_explode_quoted_string(',', $mailto);
+
+ foreach($items as $item) {
+ $item = trim($item);
+ // address in brackets without name (do nothing)
+ if (preg_match('/^<\S+@\S+>$/', $item)) {
+ $result[] = $item;
+ // address without brackets and without name (add brackets)
+ } else if (preg_match('/^\S+@\S+$/', $item)) {
+ $result[] = '<'.$item.'>';
+ // address with name (handle name)
+ } else if (preg_match('/\S+@\S+>*$/', $item, $matches)) {
+ $address = $matches[0];
+ $name = str_replace($address, '', $item);
+ $name = trim($name);
+ if ($name && ($name[0] != '"' || $name[strlen($name)-1] != '"')
+ && preg_match('/[\(\)\<\>\\\.\[\]@,;:"]/', $name)) {
+ $name = '"'.addcslashes($name, '"').'"';
+ }
+ if (!preg_match('/^<\S+@\S+>$/', $address))
+ $address = '<'.$address.'>';
+
+ $result[] = $name.' '.$address;
+ } else if (trim($item)) {
+ // @TODO: handle errors
+ }
+ }
+
+ return implode(', ', $result);
+}
/****** compose message ********/
$input_charset = $OUTPUT->get_charset();
$message_charset = isset($_POST['_charset']) ? $_POST['_charset'] : $input_charset;
-$mailto_regexp = array('/[,;]\s*[\r\n]+/', '/[\r\n]+/', '/[,;]\s*$/m', '/;/', '/(\S{1})(<\S+@\S+>)/U');
-$mailto_replace = array(', ', ', ', '', ',', '\\1 \\2');
-
-// replace new lines and strip ending ', ', make address strings more valid also
-$mailto = preg_replace($mailto_regexp, $mailto_replace, get_input_value('_to', RCUBE_INPUT_POST, TRUE, $message_charset));
-$mailcc = preg_replace($mailto_regexp, $mailto_replace, get_input_value('_cc', RCUBE_INPUT_POST, TRUE, $message_charset));
-$mailbcc = preg_replace($mailto_regexp, $mailto_replace, get_input_value('_bcc', RCUBE_INPUT_POST, TRUE, $message_charset));
+$mailto = rcmail_mailto_format(get_input_value('_to', RCUBE_INPUT_POST, TRUE, $message_charset));
+$mailcc = rcmail_mailto_format(get_input_value('_cc', RCUBE_INPUT_POST, TRUE, $message_charset));
+$mailbcc = rcmail_mailto_format(get_input_value('_bcc', RCUBE_INPUT_POST, TRUE, $message_charset));
if (empty($mailto) && !empty($mailcc)) {
$mailto = $mailcc;
$headers['Organization'] = $identity_arr['organization'];
if (!empty($_POST['_replyto']))
- $headers['Reply-To'] = preg_replace($mailto_regexp, $mailto_replace, get_input_value('_replyto', RCUBE_INPUT_POST, TRUE, $message_charset));
+ $headers['Reply-To'] = rcmail_mailto_format(get_input_value('_replyto', RCUBE_INPUT_POST, TRUE, $message_charset));
else if (!empty($identity_arr['reply-to']))
$headers['Reply-To'] = $identity_arr['reply-to'];
// fetch message body
$message_body = get_input_value('_message', RCUBE_INPUT_POST, TRUE, $message_charset);
-// remove signature's div ID
-if (!$savedraft && $isHtml)
- $message_body = preg_replace('/\s*id="_rc_sig"/', '', $message_body);
-
-// append generic footer to all messages
-if (!$savedraft && !empty($CONFIG['generic_message_footer']) && ($footer = file_get_contents(realpath($CONFIG['generic_message_footer']))))
- $message_body .= "\r\n" . rcube_charset_convert($footer, 'UTF-8', $message_charset);
+if (!$savedraft) {
+ // remove signature's div ID
+ if ($isHtml)
+ $message_body = preg_replace('/\s*id="_rc_sig"/', '', $message_body);
+
+ // generic footer for all messages
+ if (!empty($CONFIG['generic_message_footer'])) {
+ $footer = file_get_contents(realpath($CONFIG['generic_message_footer']));
+ $footer = rcube_charset_convert($footer, 'UTF-8', $message_charset);
+ }
+}
// create extended PEAR::Mail_mime instance
$MAIL_MIME = new rcube_mail_mime($RCMAIL->config->header_delimiter());
if ($isHtml)
{
- $MAIL_MIME->setHTMLBody($message_body);
+ $MAIL_MIME->setHTMLBody($message_body . ($footer ? "\r\n<pre>".$footer.'</pre>' : ''));
// add a plain text version of the e-mail as an alternative part.
$h2t = new html2text($message_body);
- $plainTextPart = wordwrap($h2t->get_text(), 998, "\r\n", true);
+ $plainTextPart = $h2t->get_text() . ($footer ? "\r\n".$footer : '');
+ $plainTextPart = wordwrap($plainTextPart, 998, "\r\n", true);
if (!strlen($plainTextPart))
{
// empty message body breaks attachment handling in drafts
$MAIL_MIME->setTXTBody($plainTextPart);
// look for "emoticon" images from TinyMCE and copy into message as attachments
- rcmail_attach_emoticons($MAIL_MIME);
+ $message_body = rcmail_attach_emoticons($MAIL_MIME);
}
else
{
$message_body = wordwrap($message_body, 75, "\r\n");
+ if ($footer)
+ $message_body .= "\r\n" . $footer;
$message_body = wordwrap($message_body, 998, "\r\n", true);
if (!strlen($message_body))
{
if (is_array($_SESSION['compose']['attachments']))
foreach ($_SESSION['compose']['attachments'] as $id => $attachment)
{
- $dispurl = '/\ssrc\s*=\s*[\'"]?\S+display-attachment\S+file=rcmfile' . $id . '[\'"]?/';
- $match = preg_match($dispurl, $message_body);
+ $dispurl = '/\ssrc\s*=\s*[\'"]*\S+display-attachment\S+file=rcmfile' . $id . '[\s\'"]\s*/';
+ $match = preg_match($dispurl, $message_body, $matches);
if ($isHtml && ($match > 0))
{
- $message_body = preg_replace($dispurl, ' src="'.$attachment['name'].'"', $message_body);
- $MAIL_MIME->setHTMLBody($message_body);
+ $message_body = preg_replace($dispurl, ' src="'.$attachment['name'].'" ', $message_body);
+ $MAIL_MIME->setHTMLBody($message_body. ($footer ? "\r\n<pre>".$footer.'</pre>' : ''));
$MAIL_MIME->addHTMLImage($attachment['path'], $attachment['mimetype'], $attachment['name']);
}
else
| program/steps/mail/sendmdn.inc |
| |
| This file is part of the RoundCube Webmail client |
- | Copyright (C) 2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2008-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
| program/steps/mail/show.inc |
| |
| This file is part of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
| Author: Thomas Bruederli <roundcube@gmail.com> |
+-----------------------------------------------------------------------+
- $Id: show.inc 2115 2008-12-04 10:21:34Z alec $
+ $Id: show.inc 2301 2009-02-18 19:15:36Z alec $
*/
$mbox_name = $IMAP->get_mailbox_name();
// show images?
- $show_images = $RCMAIL->config->get('show_images');
- if(!$MESSAGE->is_safe
- && !empty($show_images)
- && $MESSAGE->has_html_part())
- {
- switch($show_images) {
- case '1': // known senders only
- $CONTACTS = new rcube_contacts($DB, $_SESSION['user_id']);
- if ($CONTACTS->search('email', $MESSAGE->sender['mailto'], true, false)->count) {
- $MESSAGE->set_safe(true);
- }
- break;
- case '2': // always
- $MESSAGE->set_safe(true);
- break;
- }
- }
+ rcmail_check_safe($MESSAGE);
// calculate Etag for this request
$etag = md5($MESSAGE->uid.$mbox_name.session_id()
// check for unset disposition notification
if ($MESSAGE->headers->mdn_to &&
!$MESSAGE->headers->mdn_sent && !$MESSAGE->headers->seen &&
- $IMAP->check_permflag('MDNSENT') &&
+ ($IMAP->check_permflag('MDNSENT') || $IMAP->check_permflag('*')) &&
$mbox_name != $CONFIG['drafts_mbox'] &&
$mbox_name != $CONFIG['sent_mbox'])
{
if (!extension_loaded('pspell')) {
raise_error(array(
'code' => 500,
+ 'type' => 'php',
'file' => __FILE__,
'message' => "Pspell extension not available"), true, false);
$left = strpos($data, '<text>');
$right = strrpos($data, '</text>');
$text = substr($data, $left+6, $right-($left+6));
+$text = html_entity_decode($text, ENT_QUOTES, RCMAIL_CHARSET);
// tokenize
$words = preg_split('/[ !"#$%&()*+\\,-.\/\n:;<=>?@\[\]^_{|}]+/', $text, NULL, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_OFFSET_CAPTURE );
// init spellchecker
-$plink = pspell_new(get_input_value('lang', RCUBE_INPUT_GET), null, null, 'utf-8', PSPELL_FAST);
+$plink = pspell_new(get_input_value('lang', RCUBE_INPUT_GET), null, null, RCMAIL_CHARSET, PSPELL_FAST);
// send output
$out = '<?xml version="1.0" encoding="UTF-8"?><spellresult charschecked="'.rc_strlen($text).'">';
| program/steps/mail/viewsource.inc |
| |
| This file is part of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
| Author: Thomas Bruederli <roundcube@gmail.com> |
+-----------------------------------------------------------------------+
- $Id: viewsource.inc 1195 2008-03-21 11:45:46Z thomasb $
+ $Id: viewsource.inc 2237 2009-01-17 01:55:39Z till $
*/
| Author: Thomas Bruederli <roundcube@gmail.com> |
+-----------------------------------------------------------------------+
- $Id: func.inc 2164 2008-12-16 19:05:50Z thomasb $
+ $Id: func.inc 2206 2008-12-31 17:52:55Z yllar $
*/
$select_timezone->add('(GMT -1:00) Azores, Cape Verde Islands', '-1');
$select_timezone->add('(GMT) Western Europe, London, Lisbon, Casablanca', '0');
$select_timezone->add('(GMT +1:00) Central European Time', '1');
- $select_timezone->add('(GMT +2:00) EET: Kaliningrad, South Africa', '2');
+ $select_timezone->add('(GMT +2:00) EET: Tallinn, Helsinki, Kaliningrad, South Africa', '2');
$select_timezone->add('(GMT +3:00) Baghdad, Kuwait, Riyadh, Moscow, Nairobi', '3');
$select_timezone->add('(GMT +3:30) Tehran', '3.5');
$select_timezone->add('(GMT +4:00) Abu Dhabi, Muscat, Baku, Tbilisi', '4');
| program/steps/settings/manage_folders.inc |
| |
| This file is part of the RoundCube Webmail client |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
| Author: Thomas Bruederli <roundcube@gmail.com> |
+-----------------------------------------------------------------------+
- $Id: manage_folders.inc 2175 2008-12-18 17:51:50Z alec $
+ $Id: manage_folders.inc 2256 2009-01-23 10:29:51Z alec $
*/
if (!empty($_POST['_name']))
{
$name = trim(get_input_value('_name', RCUBE_INPUT_POST, FALSE, 'UTF-7'));
- // #1485036 (RFC3501, 5.1.3) TODO: it should be done on read not on write
- $name = str_replace('&-', '&', $name);
$create = $IMAP->create_mailbox($name, TRUE);
}
$name = rcube_charset_convert($name_utf8, 'UTF-8', 'UTF-7');
$oldname = rcube_charset_convert($oldname_utf8, 'UTF-8', 'UTF-7');
- // #1485036 (RFC3501, 5.1.3) TODO: it should be done on read not on write
- $name = str_replace('&-', '&', $name);
-
$rename = $IMAP->rename_mailbox($oldname, $name);
}
$a_subscribed = $IMAP->list_mailboxes();
$delimiter = $IMAP->get_hierarchy_delimiter();
$a_js_folders = $seen_folders = $list_folders = array();
-
+
// pre-process folders list
foreach ($a_unsubscribed as $i => $folder) {
$foldersplit = explode($delimiter, $folder);
$name = rcube_charset_convert(array_pop($foldersplit), 'UTF-7');
$parent_folder = join($delimiter, $foldersplit);
$level = count($foldersplit);
-
+
// add any necessary "virtual" parent folders
if ($parent_folder && !$seen[$parent_folder]) {
for ($i=1; $i<=$level; $i++) {
position: absolute;
right: 18px;
top: 8px;
- width: 240px;
text-align: right;
}
{
float: left;
margin-right: 14px;
- width: 520px;
+ min-width: 520px;
+ /* css hack for IE */
+ width: expression(Math.min(520, parseInt(document.documentElement.clientWidth))+'px');
+}
+
+#rcmfd_timezone
+{
+ width: 300px;
}
#identities-list,
</head>
<body>
-<div id="header"><img src="/images/roundcube_logo.png" width="165" height="55" alt="RoundCube Webmail" /></div>
+<div id="header"><img src="/images/roundcube_logo.png" alt="RoundCube Webmail" /></div>
<div style="width:400px; margin:60px auto;">
$__page_content