init commit

This commit is contained in:
Boris Bilc 2025-02-23 20:52:25 +01:00
parent 5b272d6536
commit 9971cd719b
1719 changed files with 281982 additions and 2 deletions

@ -1,3 +1,4 @@
# roundcube-multibox
# Roundcube @ MultiBox
Plugins, skins, configuration, and other things for Roundcube.
Plugins, skins, configuration, and other things for Roundcube

7
config/.htaccess Normal file

@ -0,0 +1,7 @@
# deny webserver access to this directory
<ifModule mod_authz_core.c>
Require all denied
</ifModule>
<ifModule !mod_authz_core.c>
Deny from all
</ifModule>

202
config/config.inc.php Normal file

@ -0,0 +1,202 @@
<?php
/*
+-----------------------------------------------------------------------+
| Local configuration for the Roundcube Webmail installation. |
| |
| This is a sample configuration file only containing the minimum |
| setup required for a functional installation. Copy more options |
| from defaults.inc.php to this file to override the defaults. |
| |
| This file is part of the Roundcube Webmail client |
| Copyright (C) The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
| See the README file for a full license statement. |
+-----------------------------------------------------------------------+
*/
// Retrieve YunoHost main domain
$main_domain = exec('cat /etc/yunohost/current_host');
$config = array();
// Database connection string (DSN) for read+write operations
// Format (compatible with PEAR MDB2): db_provider://user:password@host/database
// Currently supported db_providers: mysql, pgsql, sqlite, mssql, sqlsrv, oracle
// For examples see http://pear.php.net/manual/en/package.database.mdb2.intro-dsn.php
// NOTE: for SQLite use absolute path (Linux): 'sqlite:////full/path/to/sqlite.db?mode=0646'
// or (Windows): 'sqlite:///C:/full/path/to/sqlite.db'
$config['db_dsnw'] = 'mysql://roundcube:4528eb3ed21f5c35473152a9@localhost/roundcube';
// The IMAP host chosen to perform the log-in.
// Leave blank to show a textbox at login, give a list of hosts
// to display a pulldown menu or set one host as string.
// Enter hostname with prefix ssl:// to use Implicit TLS, or use
// prefix tls:// to use STARTTLS.
// Supported replacement variables:
// %n - hostname ($_SERVER['SERVER_NAME'])
// %t - hostname without the first part
// %d - domain (http hostname $_SERVER['HTTP_HOST'] without the first part)
// %s - domain name after the '@' from e-mail address provided at login screen
// For example %n = mail.domain.tld, %t = domain.tld
$config['imap_host'] = 'localhost:143';
// SMTP server host (for sending mails).
// Enter hostname with prefix ssl:// to use Implicit TLS, or use
// prefix tls:// to use STARTTLS.
// Supported replacement variables:
// %h - user's IMAP hostname
// %n - hostname ($_SERVER['SERVER_NAME'])
// %t - hostname without the first part
// %d - domain (http hostname $_SERVER['HTTP_HOST'] without the first part)
// %z - IMAP domain (IMAP hostname without the first part)
// For example %n = mail.domain.tld, %t = domain.tld
// To specify different SMTP servers for different IMAP hosts provide an array
// of IMAP host (no prefix or port) and SMTP server e.g. ['imap.example.com' => 'smtp.example.net']
$config['smtp_host'] = 'tls://' . $main_domain;
// SMTP username (if required) if you use %u as the username Roundcube
// will use the current username for login
$config['smtp_user'] = '%u';
// SMTP password (if required) if you use %p as the password Roundcube
// will use the current user's password for login
$config['smtp_pass'] = '%p';
// SMTP socket context options
// See http://php.net/manual/en/context.ssl.php
// The server certificate validation is disabled, since the server is local
// and the communication should be safe. Note that it can be enabled as
// needed, just uncomment lines and set 'verify_peer' to true.
$config['smtp_conn_options'] = array(
'ssl' => array(
'verify_peer' => false,
// 'verify_depth' => 3,
// 'cafile' => '/etc/yunohost/certs/' . $main_domain . '/ca.pem',
),
);
// provide an URL where a user can get support for this Roundcube installation
// PLEASE DO NOT LINK TO THE ROUNDCUBE.NET WEBSITE HERE!
$config['support_url'] = 'https://forum.yunohost.org/t/roundcube-a-webmail/3965';
// Name your service. This is displayed on the login screen and in the window title
$config['product_name'] = 'MultiBox Webmail';
// This key is used to encrypt the users imap password which is stored
// in the session record. For the default cipher method it must be
// exactly 24 characters long.
// YOUR KEY MUST BE DIFFERENT THAN THE SAMPLE VALUE FOR SECURITY REASONS
$config['des_key'] = 'jybvdIgYeTxiEx61YQ5VUkm0';
// ----------------------------------
// USER INTERFACE
// ----------------------------------
// the default locale setting (leave empty for auto-detection)
// RFC1766 formatted language name like en_US, de_DE, de_CH, fr_FR, pt_BR
$config['language'] = 'en_GB';
// use this format for date display (date or strftime format)
$config['date_format'] = 'd.m.Y';
// Make use of the built-in spell checker. It is based on GoogieSpell.
$config['enable_spellcheck'] = false;
// Enable YunoHost users search in the address book.
$config['ldap_public']['yunohost'] = array(
'name' => 'YunoHost Users',
'hosts' => array('localhost:389'),
'user_specific' => false,
'base_dn' => 'ou=users,dc=yunohost,dc=org',
'scope' => 'list',
'filter' => '(objectClass=mailAccount)',
'hidden' => false,
'search_fields' => array(
'uid',
'mail',
'cn'
),
'fieldmap' => array(
'uid' => 'uid',
'name' => 'cn',
'surname' => 'sn',
'firstname' => 'givenName',
'email' => 'mail:*',
),
);
$config['license_key'] = 'RCP-zxM5wAi4xnpx';
// List of active plugins (in plugins/ directory)
$config['plugins'] = [
'xskin',
'archive',
'zipdownload',
'http_authentication',
'managesieve',
'markasjunk',
'new_user_dialog',
'new_user_identity',
'newmail_notifier',
'enigma',
'contextmenu',
'automatic_addressbook',
'carddav',
'message_highlight',
'identity_switch',
];
// ----------------------------------
// PLUGINS
// ----------------------------------
// -- new_user_identity
// The id of the address book to use to automatically set a
// user's full name in their new identity.
$config['new_user_identity_addressbook'] = 'yunohost';
$config['new_user_identity_match'] = 'uid';
$config['new_user_identity_onlogin'] = true;
// -- http_authentication
// Redirect the client to this URL after logout.
$config['logout_url'] = 'https://' . $main_domain . '/yunohost/sso/?action=logout';
// -- managesieve
// Enables separate management interface for vacation responses (out-of-office)
$config['managesieve_vacation'] = 1;
// -- ldapAliasSync
$config['ldapAliasSync'] = array(
// Mail parameters
'mail' => array(
'dovecot_separator' => '+',
),
// LDAP parameters
'ldap' => array(
'bind_dn' => '',
),
# 'user_search' holds all config variables for the user search
'user_search' => array(
'base_dn' => 'uid=%local,ou=users,dc=yunohost,dc=org',
'filter' => '(objectClass=mailAccount)',
'mail_by' => 'attribute',
'attr_mail' => 'mail',
'attr_name' => 'cn',
),
# 'alias_search' holds all config variables for the alias search
'alias_search' => array(
'base_dn' => 'uid=%local,ou=users,dc=yunohost,dc=org',
'filter' => '(objectClass=mailAccount)',
'mail_by' => 'attribute',
'attr_mail' => 'mailalias',
'attr_name' => 'cn',
),
);
// skin name: folder from skins/
$config['skin'] = 'litecube-f';

@ -0,0 +1,66 @@
<?php
/*
+-----------------------------------------------------------------------+
| Local configuration for the Roundcube Webmail installation. |
| |
| This is a sample configuration file only containing the minimum |
| setup required for a functional installation. Copy more options |
| from defaults.inc.php to this file to override the defaults. |
| |
| This file is part of the Roundcube Webmail client |
| Copyright (C) The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
| See the README file for a full license statement. |
+-----------------------------------------------------------------------+
*/
$config = [];
// Database connection string (DSN) for read+write operations
// Format (compatible with PEAR MDB2): db_provider://user:password@host/database
// Currently supported db_providers: mysql, pgsql, sqlite, mssql, sqlsrv, oracle
// For examples see http://pear.php.net/manual/en/package.database.mdb2.intro-dsn.php
// NOTE: for SQLite use absolute path (Linux): 'sqlite:////full/path/to/sqlite.db?mode=0646'
// or (Windows): 'sqlite:///C:/full/path/to/sqlite.db'
$config['db_dsnw'] = 'mysql://roundcube:pass@localhost/roundcubemail';
// IMAP host chosen to perform the log-in.
// See defaults.inc.php for the option description.
$config['imap_host'] = 'localhost:143';
// SMTP server host (for sending mails).
// See defaults.inc.php for the option description.
$config['smtp_host'] = 'localhost:587';
// SMTP username (if required) if you use %u as the username Roundcube
// will use the current username for login
$config['smtp_user'] = '%u';
// SMTP password (if required) if you use %p as the password Roundcube
// will use the current user's password for login
$config['smtp_pass'] = '%p';
// provide an URL where a user can get support for this Roundcube installation
// PLEASE DO NOT LINK TO THE ROUNDCUBE.NET WEBSITE HERE!
$config['support_url'] = '';
// Name your service. This is displayed on the login screen and in the window title
$config['product_name'] = 'Roundcube Webmail';
// This key is used to encrypt the users imap password which is stored
// in the session record. For the default cipher method it must be
// exactly 24 characters long.
// YOUR KEY MUST BE DIFFERENT THAN THE SAMPLE VALUE FOR SECURITY REASONS
$config['des_key'] = 'rcmail-!24ByteDESkey*Str';
// List of active plugins (in plugins/ directory)
$config['plugins'] = [
'archive',
'zipdownload',
];
// skin name: folder from skins/
$config['skin'] = 'elastic';

1482
config/defaults.inc.php Normal file

File diff suppressed because it is too large Load Diff

44
config/local.inc.php Normal file

@ -0,0 +1,44 @@
<?php
// Name your service. This is displayed on the login screen and in the window title
$config['product_name'] = 'MultiBox Webmail';
// This key is used to encrypt the users imap password which is stored
// in the session record. For the default cipher method it must be
// exactly 24 characters long.
// YOUR KEY MUST BE DIFFERENT THAN THE SAMPLE VALUE FOR SECURITY REASONS
$config['des_key'] = 'jybvdIgYeTxiEx61YQ5VUkm0';
// ----------------------------------
// USER INTERFACE
// ----------------------------------
// the default locale setting (leave empty for auto-detection)
// RFC1766 formatted language name like en_US, de_DE, de_CH, fr_FR, pt_BR
$config['language'] = 'en_GB';
// use this format for date display (date or strftime format)
$config['date_format'] = 'd.m.Y';
$config['license_key'] = 'RCP-zxM5wAi4xnpx';
// List of active plugins (in plugins/ directory)
$config['plugins'] = [
'xskin',
'archive',
'zipdownload',
'http_authentication',
'managesieve',
'markasjunk',
'new_user_dialog',
'new_user_identity',
'newmail_notifier',
'enigma',
'contextmenu',
'automatic_addressbook',
'carddav',
'message_highlight',
];
// skin name: folder from skins/
$config['skin'] = 'litecube-f';

56
config/mimetypes.php Normal file

@ -0,0 +1,56 @@
<?php
/**
* Local mapping file to specify mime-types based on common file-name extensions
*
* Please note that this mapping takes precedence over the content-based mime-type detection
* and should only contain mappings which cannot be detected properly from the file contents.
*/
return [
'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',
'pdf' => 'application/pdf',
'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',
'7z' => 'application/x-7z-compressed',
's7z' => 'application/x-7z-compressed',
'vcf' => 'text/vcard',
'ics' => 'text/calendar',
];

@ -0,0 +1,8 @@
* text=auto
*.sql text
*.php text
*.inc text
*.js text
*.md text
*.php.dist text

@ -0,0 +1,276 @@
# Changelog identity switch plugin
## Release 1.1.12
- Added: Additional interegre cast when loading parameter "refresh_interval" from RC
- Chaged: Removing # of unread mail from selected identity when switching
## Release 1.1.11
- Changed: Active identity is now also show in list of selctable identities
## Release 1.1.10
- Changed: Updates to menu bar
## Release 1.1.9
- Fixed: Typo in identity_switch_newmails.php:88
## Release 1.1.8
- Fixed: Typo in identity_switch_newmails.php:88
- Added: Object check in identity_switch.php:523
- Added: Sleep() call to create_menu() - was too fast
## Release 1.1.7
- Update: Mariadb version 10.6.19 support
## Release 1.1.6
- Fixed: Typo in identity_switch.php
## Release 1.1.5
- Added: Debug section in README.MD
- Added: Configuration parameter 'wait'
## Release 1.1.4
- Fixed: Closing stream error
- Added: Update of unseen couter from leaving identity
- Added: Cast 'newmail_check' variable to integer
## Release 1.1.3
- Changed: Updating newmail count on identity switch improved
## Release 1.1.2
- Fixed: Typo in catch_newmails()
## Release 1.1.1
- Added: Possibility to create/edit default identity label for drop down menu
- Fixed: Saving notification mode for default identity
## Release 1.1.0
- Changed: README.MD
- Changed: SQL scripts
## Release 1.1
- Changed: Preconfiguration of identity settings modified
- Fixed: Disabled identities now ignored
- Fixed: Unseen count sometimes wrong, when switching identity
- Fixed: Some typos in code
- Changed renamed from identy_switch to identity_switch
- Fixed: Modification / deletion of default identity in setting handled properly
## Release 1.0.45
- Fixed: 'Delay' not set in identity_switch_newmail.php
## Release 1.0.44
- Added: New mail check delay configuration parameter
- Fixed: Logging in identity_switch_newmail.php
## Release 1.0.43
- Fixed: php8.1-fpm.sock break down resulting in missing return records
## Release 1.0.41
- Fixed: PHP warning regarding missing special folders
## Release 1.0.40
- Fixed: PHP warning regarding missing special folders
## Release 1.0.39
- Fixed: PHP warning regarding missing special folders
## Release 1.0.38
- Fixed: Unssen counter return from catch casted to integer.
## Release 1.0.37
- Fixed: INSTALL_PATH in identity_switch_newmails.php
## Release 1.0.36
- Fixed: In classic skin, selection list of identities was not in foreground
## Release 1.0.35
- Fixed: INSTALL_PATH in identity_switch_newmails.php
- Changed: Position of dropdown in classic skin
## Release 1.0.34
- Added: Some more comments in config.inc.php.dist
- Fixed: In some cases "special folders" were empty. Fix will handle.
## Release 1.0.33
- Fixed: PHP Warning in identity_switch.php:363
## Release 1.0.32
- Changed: "imap_pwd" now 128 bytes long
## Release 1.0.31
- Fixed: Hostname instead of identity label in desktop test notification shown
## Release 1.0.30
- Added: Debug support extended
- Added: New mail check now waiting for data file
## Release 1.0.29
- Fixed: Loop error in ident_switch_newmail.php
- Fixed: Usage of special characters '%' for SMTP hosts in config/config.inc.php
## Release 1.0.28
- Added: Mentioning limitiations in README.md
## Release 1.0.27
- Fixed: 'interval' not loaded when creating new identity
- Fixed: Some config.php.dist parameter not set as default for identity
## Release 1.0.26
- Added: IMAP folder delimiter configuration parameter
- Added: Wildcard for domain in configuration parameter
- Fixed: Typo in README.md
## Release 1.0.25
- French translation provided by @rglemaire
## Release 1.0.24
- Fixed: Bug in preferences (identity edit)
- Fixed: Bug when trying to send mails with default identity
## Release 1.0.23
- Skipped
## Release 1.0.22
- Skipped
## Release 1.0.21
- Fixed: Minor bug in refresh interval
- Added: Debug configuration option
## Release 1.0.20
- Fixed: Special folder handling
- Fxied: "Check all folders" flag not accepted
## Release 1.0.19
- Fixed isse #14: Bug in composer.json
## Release 1.0.18
- Fixed issue #8: CodeShakingSheep pull request merged to fix MySQL DB table creation for migration from ident_switch plugin
- Fixed issue #9: Protocol selection for SMTP now possible
- Fixed issue #10: CodeShakingSheep pull request merged to fix ident_switch migration DB INSERT statement
- Fixed issue #13: PHP 8.1 warnings for 'show_real_foldernames'
- Fixed issue #13: PHP 8.1 warnings for unknown special folder names
## Release 1.0.17
- identityswitch menu is now automatically closed if user clicks somewhere on screen
## Release 1.0.15
- Bug fixed for 'show_real_foldernames'.
- Special message before record has been created added.
## Release 1.0.14
- Error message prefixed by "idsw".
- If identity is set as default, hen disable identity_switch handling.
- If a new record is created, it is not possible to return any error message due to RoundCube design.
- Fixed some error messages.
## Release 1.0.13
- Thank to https://github.com/HLFH .
- type 'tsl' fixed to 'tls'.
- some README.MD types fixed.
- support for SMTP array in config.inc.php ($config['smtp_host']).
## Release 1.0.12
- 'dont_override' option documented.
- Bug fixed when changing standard identity name.
- Some bugs fixed when trying to edit identity record.
## Release 1.0.11
- Some typos fixed.
## Release 1.0.10
- When switching identity unseen counter update is forced.
## Release 1.0.9
- Notification handling slightly modified.
## Release 1.0.8
- Some fixes to README.md.
## Release 1.0.7
- Unseen count on active account moved to identity_switch_do_switch().
## Release 1.0.6
- Fixing some unread counter problems.
- Bug in SQlite and postgres SQL files.
## Release 1.0.5
- Some more changes to CSS file.
- Changed CSS and JS compressor.
- Creation of identity selection menu restricted to mail template.
## Release 1.0.4
- Function create_menu() moved back to identity_switch.php.
## Release 1.0.3
- Updates to CSS files.
## Release 1.0.2
- Updates to CSS files.
## Release 1.0.1
- SMTP not working properly for default account.
## Release 1.0.0
- Code completly rewritten.
- New-mail check added.
- Ntification about new mail added.

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

@ -0,0 +1,127 @@
# identity switch plugin for Roundcube
![](https://img.shields.io/packagist/v/toteph42/identity_switch.svg)
![](https://img.shields.io/packagist/l/toteph42/identity_switch.svg)
![](https://img.shields.io/packagist/dt/toteph42/identity_switch.svg)
This plugin is based on the [ident_switch](https://github.com/dougluce/ident_switch "ident_switch") plugin. It is completly rewritten and additional features have been added.
This plugin allows users to switch between different accounts in a single Roundcube session like this:
![Screenshot example](./assets/Pic01.png "Identity selection")
### Where to start ###
* In settings interface create new identity.
* For all identities except default you will see new section of settings - "Data of your identity" (see screenshot below). Enter data required to connect to remote server. Don't forget to check **Enabled** check box.
* After you have created at least one identity with active plugin you will see combobox in the top right corner instead of plain text field with account name. It will allows you to switch to another account.
### Settings ###
![Plugin settings](./assets/Pic02.png "Connection settings")
* **Enabled** - Enables plugin (i.e. account switching) for this identity.
* **Label** - Text that will be displayed in drop down list for this identity.
* **IMAP**
* **Server host name** - Host name for imap server. If left blank 'localhost' will be used.
* **Encryption** - Connection security (None, SSL or TLS).
* **Port** - Port on server to connect to. If left blank 143 will be used.
* **Username** - Login used *for IMAP and SMTP servers*.
* **Password** - Password used *for IMAP and SMTP servers*. It's stored encrypted in database.
* **Delimiter** - IMAP folder delimiter.
* **SMTP**
* **Server host name** - Host name for imap server. If left blank 'localhost' will be used.
* **Encryption** - Connection security (None, SSL or TLS).
* **Port** - Port on server to connect to. If left blank 25 will be used.
### Settings for active identity ###
![Plugin settings](./assets/Pic04.png "New mail checking")
If you've selected an identity (or use the default identity), you may change settings for new-mail check cycle in `Settings` -> `Preference` -> `User Interface`.
![Plugin settings](./assets/Pic05.png "Notification settings")
If you've selected an identity (or use the default identity), you may change settings for notification settings in `Settings` -> `Preference` -> `Mailbox view`.
### Additional settings ###
![Plugin settings](./assets/Pic03.png "Notification settings")
* **Check all folders...** - Select this option, if you want all folders to be check for new mails.
* **Display browser notification...** - Select this option, if you want to get a changed icon for this site. Please be aware, that the icon will change only one time, even if there a new mails for multiple identities available (until next new-mail check-cycle is started).
* **Display desktop notification...** - Select this option, if you want to get a desktop notification about how many new mails were available. Please be aware, you need to allow your mail server site in your browser configuration to send notifications to your desktop.
* **Close desktop notification** - Specify how many seconds should be visible before it is automatically been closed.
* **Play sound...** - Select this option, if you want a sound notification. Please be aware, that only sound will be played one time only, even if there are new mails for multiple identities available (until next new-mail check cycle is started). If you hear no sound playing, please check your browser settings, if auto-play of sound files is enabled.
* **Refresh...** - Specify the new-mail check cycle in minutes.
![Plugin settings](./assets/Pic06.png "E-Mail notification")
If you receive new mails, the number of new mails will be shown in identity selection menue.
### Configuration ###
There is a file `config.inc.php.dist` in the plugin directory available with mutiple configuration parameters. This file can be used to specify some configuration settings. Please copy file to `config.inc.php` and change there your settings.
If you want to change sound, icon or desktop icon, please checkout `alert.mp3`, `alert.ico` and `alert.gif` in sub-directory `assets`.
### Locking configuration ###
You may use the `dont_override` configuration option in your **RoundCube** configuration file `config/config.inc.php` to lock some options from being overriden. This plugins supports the following options to be protected:
* `draft_mbox`, `sent_mbox`, `junk_mbox`, `trash_mbox` - User cannot override preconfigured special folder name.
* `check_all_folders` - User cannot override preconfigured flag to check all folders.
* `newmail_notifier_basic`, `newmail_notifier_desktop`, `newmail_notifier_sound` - User cannot override preconfigured notification setting.
### Performance ###
New mail checking is performed in background asynchronously. This has the effect that the new mail counter is not always updated immediately after login - it may take some time before this has been performed. It heavily depends on the number of identities you're using.
If you've select **Check all folders**, this has a huge impact on the time new-mail checking need to collect information. If you have hundreds of folders in your mail box, each of the boxes will be check for new mails.
Please don't forget to set `Special Folders` in `Settings` -> `Preferences`. All folders specified there (and their sub-folders) will be excluded from new-mail checking.
### Version compatibility ###
* Versions 1.x - for Roundcube v1.6. Requires PHP version >= 8.0.0.
### Limitations ###
This plugin only supports `Classic`, `Elatic`, `Larry` and `Hivemail` skin. If you wan't to get another skin to be supoorted, then please contact me. I can add support for other skin if you buy for it.
### Migration from ident_switch plugin ###
If you've installed the `ident_switch` plugin, there is a migration file available in `SQL` subdirectory which copies the content of the old table to the new table and deletes the `ident_switch` table. To make this happen, you should first install this plugin (during installation a table `identity_switch` will automatically be created) and then you should appy `SQL/migrate.sql`.
### Upgrade ###
If you want to upgrade to this plugin, please be aware, the name of the data base table has changed. In subdirectoy `SQL` ther
are scrpst avaibale to ugrade your installation. These scriüps must called manually (look for `20241122.sql`). This script must be called after installation of `identity_switch` plugin, but before removing `identy_switch` plugin.
### License ###
This plugin is released under the [GNU General Public License v3.0](./LICENSE).
### Debugging ###
If you encounter problems with plugin, take a look at the option available in `config.inc.php`.
If you encounter **connection problems**, it is a good idea to enable **RoundCube** available debugging options:
```php
// Log IMAP conversation to <log_dir>/imap.log or to syslog
$config['imap_debug'] = true;
// Log sent messages to <log_dir>/sendmail.log or to syslog
$config['smtp_log'] = true;
// Log SMTP conversation to <log_dir>/smtp or to syslog
$config['smtp_debug'] = true;
```
Then switch to the identity which does not work as expected. In log files you'll see how **RoundCube** is trying to establish connection.
### Donation ###
If you like this software and you want support my work, feel free to send me a donation:
<a href="https://www.paypal.com/donate/?hosted_button_id=DS6VK49NAFHEQ" target="_blank" rel="noopener"> <img src="https://www.paypalobjects.com/en_US/DK/i/btn/btn_donateCC_LG.gif" alt="Donate with PayPal"/> </a>
[[List of changes](./Changes.md)]

@ -0,0 +1,46 @@
--
-- Identity switch RoundCube Bundle
--
-- @copyright (c) 2024 Forian Daeumling, Germany. All right reserved
-- @license https://github.com/toteph42/identity_switch/blob/master/LICENSE
--
-- Created with phpmyadmin
INSERT INTO identity_switch(
`id`,
`user_id`,
`iid`,
`label`,
`flags`,
`imap_user`,
`imap_pwd`,
`imap_host`,
`imap_port`,
`imap_delim`,
`smtp_host`,
`smtp_port`,
`drafts`,
`sent`,
`junk`,
`trash`
)
SELECT
`id`,
`user_id`,
`iid`,
`label`,
`flags`,
`username`,
`password`,
`imap_host`,
`imap_port`,
`imap_delimiter`,
`smtp_host`,
`smtp_port`,
`drafts_mbox`,
`sent_mbox`,
`junk_mbox`,
`trash_mbox`
FROM
ident_switch;
DROP TABLE IF EXISTS ident_switch;

@ -0,0 +1,42 @@
--
-- Identity switch RoundCube Bundle
--
-- @copyright (c) 2024 Forian Daeumling, Germany. All right reserved
-- @license https://github.com/toteph42/identity_switch/blob/master/LICENSE
--
-- Created with phpmyadmin
CREATE TABLE IF NOT EXISTS `identity_switch`(
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`user_id` INT(10) UNSIGNED NOT NULL,
`iid` INT(10) UNSIGNED NOT NULL,
`label` VARCHAR(32) NOT NULL,
`flags` INT NOT NULL DEFAULT 0,
`imap_user` VARCHAR(64),
`imap_pwd` VARCHAR(128),
`imap_host` VARCHAR(64),
`imap_port` SMALLINT DEFAULT NULL,
`imap_delim` CHAR(1),
`newmail_check` SMALLINT DEFAULT 300,
`notify_timeout` SMALLINT DEFAULT 10,
`smtp_host` VARCHAR(64),
`smtp_port` SMALLINT DEFAULT NULL,
`drafts` VARCHAR(64) DEFAULT '',
`sent` VARCHAR(64) DEFAULT '',
`junk` VARCHAR(64) DEFAULT '',
`trash` VARCHAR(64) DEFAULT '',
UNIQUE `user_id_label`(`user_id`, `label`),
CONSTRAINT `fk_identity_user_id`
FOREIGN KEY(`user_id`)
REFERENCES `users`(`user_id`)
ON DELETE CASCADE
ON UPDATE CASCADE,
CONSTRAINT `fk_identity_identity_id`
FOREIGN KEY(`iid`)
REFERENCES `identities`(`identity_id`)
ON DELETE CASCADE
ON UPDATE CASCADE,
PRIMARY KEY(`id`),
INDEX `IX_identity_switch_user_id`(`user_id`),
INDEX `IX_identity_switch_iid`(`iid`)
);

@ -0,0 +1,12 @@
--
-- Identity switch RoundCube Bundle
--
-- @copyright (c) 2024 Forian Daeumling, Germany. All right reserved
-- @license https://github.com/toteph42/identity_switch/blob/master/LICENSE
--
-- Created with phpmyadmin
DROP TABLE IF EXISTS `identity_switch`;
RENAME TABLE
`identy_switch` TO `identity_switch`;

@ -0,0 +1,35 @@
--
-- Identity switch RoundCube Bundle
--
-- @copyright (c) 2024 Forian Daeumling, Germany. All right reserved
-- @license https://github.com/toteph42/identity_switch/blob/master/LICENSE
--
-- Created with: https://sqliteonline.com/
CREATE TABLE IF NOT EXISTS identity_switch(
id SERIAL PRIMARY KEY,
user_id INTEGER NOT NULL
REFERENCES users(user_id)
ON DELETE CASCADE ON UPDATE CASCADE,
iid INTEGER NOT NULL
REFERENCES identities(identity_id)
ON DELETE CASCADE ON UPDATE CASCADE UNIQUE,
label VARCHAR(32),
flags INTEGER NOT NULL DEFAULT 0,
imap_user VARCHAR(64),
imap_pwd VARCHAR(128),
imap_host VARCHAR(64),
imap_port SMALLINT DEFAULT 0,
imap_delim CHAR(1),
newmail_check SMALLINT DEFAULT 300,
notify_timeout SMALLINT DEFAULT 10,
smtp_host VARCHAR(64),
smtp_port SMALLINT DEFAULT 0,
drafts VARCHAR(64) DEFAULT '',
sent VARCHAR(64) DEFAULT '',
junk VARCHAR(64) DEFAULT '',
trash VARCHAR(64) DEFAULT '',
UNIQUE (user_id, label)
);
CREATE INDEX IX_identity_switch_user_id ON identity_switch(user_id);

@ -0,0 +1,12 @@
--
-- Identity switch RoundCube Bundle
--
-- @copyright (c) 2024 Forian Daeumling, Germany. All right reserved
-- @license https://github.com/toteph42/identity_switch/blob/master/LICENSE
--
-- Created with: https://sqliteonline.com/
DROP TABLE IF EXISTS identity_switch;
ALTER TABLE
identy_switch
RENAME TO identity_switch;

@ -0,0 +1,36 @@
--
-- Identity switch RoundCube Bundle
--
-- @copyright (c) 2024 Forian Daeumling, Germany. All right reserved
-- @license https://github.com/toteph42/identity_switch/blob/master/LICENSE
--
-- Created with: https://sqliteonline.com/
CREATE TABLE IF NOT EXISTS `identity_switch`(
`id` INTEGER NOT NULL ,
`user_id` INTEGER NOT NULL
REFERENCES users(user_id)
ON DELETE CASCADE ON UPDATE CASCADE,
`iid` INTEGER NOT NULL
REFERENCES identities(identity_id)
ON DELETE CASCADE ON UPDATE CASCADE UNIQUE,
`label` TEXT,
`flags` INT NOT NULL DEFAULT 0,
`imap_user` TEXT,
`imap_pwd` TEXT,
`imap_host` TEXT,
`imap_port` SMALLINT DEFAULT 0,
`imap_delim` CHAR(1),
`newmail_check` SMALLINT DEFAULT 300,
`notify_timeout` SMALLINT DEFAULT 10,
`smtp_host` TEXT,
`smtp_port` SMALLINT DEFAULT 0,
`drafts` TEXT DEFAULT '',
`sent` TEXT DEFAULT '',
`junk` TEXT DEFAULT '',
`trash` TEXT DEFAULT '',
UNIQUE (user_id, label)
);
CREATE INDEX IX_identity_switch_user_id ON identity_switch(user_id);
CREATE INDEX IX_identity_switch_iid on identity_switch(iid);

@ -0,0 +1,12 @@
--
-- Identity switch RoundCube Bundle
--
-- @copyright (c) 2024 Forian Daeumling, Germany. All right reserved
-- @license https://github.com/toteph42/identity_switch/blob/master/LICENSE
--
-- Created with: https://sqliteonline.com/
DROP TABLE IF EXISTS `identity_switch`;
ALTER TABLE
`identy_switch` RENAME TO `identity_switch`;

Binary file not shown.

After

(image error) Size: 14 KiB

Binary file not shown.

After

(image error) Size: 27 KiB

Binary file not shown.

After

(image error) Size: 29 KiB

Binary file not shown.

After

(image error) Size: 7.2 KiB

Binary file not shown.

After

(image error) Size: 40 KiB

Binary file not shown.

After

(image error) Size: 15 KiB

Binary file not shown.

After

(image error) Size: 56 KiB

Binary file not shown.

After

(image error) Size: 4.2 KiB

Binary file not shown.

@ -0,0 +1,71 @@
/*
* Identity switch RoundCube Bundle
*
* @copyright (c) 2024 Forian Daeumling, Germany. All right reserved
* @license https://github.com/toteph42/identity_switch/blob/master/LICENSE
*/
$(function() {
// Reformat tables
var fld = $('table[class="propform"]');
fld.attr('class', 'propform cols-sm-6-6');
var fld = $('td[class="title col-sm-4"]');
fld.attr('class', 'title col-sm-6');
var fld = $('td[class="col-sm-8"]');
fld.attr('class', 'col-sm-6');
var fld = $('input[name="_enabled"]');
if (fld.prop('value') == 0)
fld.prop('checked', false);
identity_switch_enabled();
});
function identity_switch_enabled() {
var fld = $('input[name="_enabled"]');
if (fld.prop('value') == undefined)
return;
if (!fld.is(':checked')) {
var val = 0;
var dis = true;
} else {
var val = 1;
var dis = false;
}
fld.prop('value', val);
$('input[name="_label"]').attr('disabled', dis);
$('input[name="_imap_host"]').attr('disabled', dis);
$('input[name="_imap_port"]').attr('disabled', dis);
$('select[name="_imap_auth"]').attr('disabled', dis);
$('input[name="_imap_user"]').attr('disabled', dis);
$('input[name="_imap_pwd"]').attr('disabled', dis);
$('input[name="_imap_delim"]').attr('disabled', dis);
$('input[name="_smtp_host"]').attr('disabled', dis);
$('input[name="_smtp_port"]').attr('disabled', dis);
$('select[name="_smtp_auth"]').attr('disabled', dis);
$('input[name="_check_all_folder"]').attr('disabled', dis);
$('input[name="_notify_basic"]').attr('disabled', dis);
$('input[name="_notify_desktop"]').attr('disabled', dis);
$('select[name="_notify_timeout"]').attr('disabled', dis);
$('input[name="_notify_sound"]').attr('disabled', dis);
$('select[name="_refresh_interval"]').attr('disabled', dis);
// Disable all links
$('a[name^="_notify"]').each(function(i, obj) {
if (dis) {
obj.setAttribute('save', obj.getAttribute('onclick'));
obj.removeAttribute('href');
obj.removeAttribute('onclick');
} else {
if (obj.getAttribute('save'))
obj.setAttribute('onclick', obj.getAttribute('save'));
obj.setAttribute('href', '#');
}
});
}

@ -0,0 +1,2 @@
$(function(){var fld=$('table[class="propform"]');fld.attr('class','propform cols-sm-6-6');var fld=$('td[class="title col-sm-4"]');fld.attr('class','title col-sm-6');var fld=$('td[class="col-sm-8"]');fld.attr('class','col-sm-6');var fld=$('input[name="_enabled"]');if(fld.prop('value')==0)fld.prop('checked',false);identity_switch_enabled();});function identity_switch_enabled(){var fld=$('input[name="_enabled"]');if(fld.prop('value')==undefined)return;if(!fld.is(':checked')){var val=0;var dis=true;}else{var val=1;var dis=false;}fld.prop('value',val);$('input[name="_label"]').attr('disabled',dis);$('input[name="_imap_host"]').attr('disabled',dis);$('input[name="_imap_port"]').attr('disabled',dis);$('select[name="_imap_auth"]').attr('disabled',dis);$('input[name="_imap_user"]').attr('disabled',dis);$('input[name="_imap_pwd"]').attr('disabled',dis);$('input[name="_imap_delim"]').attr('disabled',dis);$('input[name="_smtp_host"]').attr('disabled',dis);$('input[name="_smtp_port"]').attr('disabled',dis);$('select[name="_smtp_auth"]').attr('disabled',dis);$('input[name="_check_all_folder"]').attr('disabled',dis);$('input[name="_notify_basic"]').attr('disabled',dis);$('input[name="_notify_desktop"]').attr('disabled',dis);$('select[name="_notify_timeout"]').attr('disabled',dis);$('input[name="_notify_sound"]').attr('disabled',dis);$('select[name="_refresh_interval"]').attr('disabled',dis);$('a[name^="_notify"]').each(function(i,obj){if(dis){obj.setAttribute('save',obj.getAttribute('onclick'));obj.removeAttribute('href');obj.removeAttribute('onclick');}else{if(obj.getAttribute('save'))obj.setAttribute('onclick',obj.getAttribute('save'));obj.setAttribute('href','#');}});}

@ -0,0 +1,131 @@
/*
* Identity switch RoundCube Bundle
*
* @copyright (c) 2024 Forian Daeumling, Germany. All right reserved
* @license https://github.com/toteph42/identity_switch/blob/master/LICENSE
*/
#identity_switch_menu {
margin-right: 0px;
overflow: hidden;
text-overflow: ellipsis;
margin-top: -65px;
font-weight: bold;
padding-left: 2rem;
text-align: left;
width: 240px;
border: 1px solid #ccc !important;
border-radius: .4em;
background: #fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat left .75rem center/8px 10px;
top: 10px;
left: 200px;
position: relative;
float: inline-start;
}
#identity_switch_dropdown {
position: fixed;
z-index: 1;
padding: 0 .5rem 0 0;
min-width: 240px;
max-width: 240px;
will-change: transform;
top: 0;
left: 168px;
margin-left: 0;
margin-top: 18px;
width: 240px;
transform: translate3d(63px, 49px, 0px);
border-bottom-color: rgb(212, 219, 222);
box-shadow: 3px 3px 5px #414141;
max-height: 150px;
overflow-x: hidden;
color: #212529;
display: none;
margin-left: -.5rem;
border-color: #d4dbde;
border-radius: .4rem;
border-bottom: 1px solid #f7f7f7;
background-color: rgba(255, 255, 255);
font-weight: 400;
line-height: 35px;
}
#identity_switch_dropdown ul {
list-style: none;
margin: 0;
padding: 0;
}
#identity_switch_dropdown li {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
position: relative;
left: 0px;
width: 220px;
}
#identity_switch_dropdown a {
padding: 0 .5rem;
white-space: nowrap;
color: #2c363a;
background: none;
}
#identity_switch_dropdown li:hover {
background-color: rgb(236, 236, 236);
}
#identity_switch_dropdown a:hover {
text-decoration: none;
}
#identity_switch_dropdown .unseen {
position: absolute;
top: 0;
right: 0;
min-width: 2em;
line-height: 1.4rem;
margin: 7.7px 0px 7.7px 0px;
padding: 0 .3em;
border-radius: .4em;
background: #37beff;
color: #fff;
text-align: center;
font-weight: 700;
}
html.dark-mode #identity_switch_menu {
margin-right: 0px;
overflow: hidden;
text-overflow: ellipsis;
margin-top: 5px;
font-weight: bold;
padding-left: 2rem;
text-align: left;
width: 240px;
border: 1px solid #ccc !important;
border-radius: .4em;
background: #fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='beige' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat left .75rem center/8px 10px;
top: 10px;
left: inherit;
position: relative;
float: inline-start;
}
html.dark-mode #identity_switch_dropdown {
background-color: #343a40;
border-color: #4d6066;
box-shadow: 3px 3px 5px #374549;
}
html.dark-mode #identity_switch_dropdown a {
color: #c5d1d3;
}
html.dark-mode #identity_switch_dropdown li:hover {
background-color: #374549;
}

@ -0,0 +1,241 @@
/*
* Identity switch RoundCube Bundle
*
* @copyright (c) 2024 Forian Daeumling, Germany. All right reserved
* @license https://github.com/toteph42/identity_switch/blob/master/LICENSE
*/
$(function() {
$sw = $('#identity_switch_menu');
isOk = false;
switch (rcmail.env['skin']) {
case 'larry':
isOk = identity_switch_addCbLarry($sw);
break;
case 'classic':
isOk = identity_switch_addCbClassic($sw);
break;
case 'elastic':
case 'hivemail':
isOk = identity_switch_addCbElastic($sw);
default:
break;
}
if (isOk)
$sw.show();
});
// Catch all mouse clicks
$(document).click(function(event) {
// Check for left button
if (event.button == 0) {
var id = event.target.id;
var d = $('#identity_switch_dropdown');
if (id != 'identity_switch_menu' && !d.is(':hidden'))
d.hide();
}
});
// Plugin initialization
function identity_switch_init() {
rcmail.addEventListener('plugin.identity_switch_notify', identity_switch_notify)
.addEventListener('init', function() {
// Bind to messages list select event, so favicon will be reverted on message preview too
if (rcmail.message_list)
rcmail.message_list.addEventListener('select', identity_switch_stop_notify);
});
}
// Set menu position
function identity_switch_addCbLarry($sw) {
var $truName = $('.topright .username');
if ($truName.length > 0) {
if ($sw.length > 0) {
$sw.prependTo('#taskbar');
$truName.hide();
// Move our selection menu a bit to the right
$('#identity_switch_menu').css('padding-top', '4px').css('padding-bottom', '4px');
$('#identity_switch_dropdown').css('margin-left', '-92px');
return true;
}
}
return false;
}
// Set menu position
function identity_switch_addCbClassic($sw) {
var $taskBar = $('#taskbar');
if ($taskBar.length > 0) {
$taskBar.prepend($sw);
// Move our selection menu a bit to the right
$('#identity_switch_menu').css('left', '-10px')
.css('top', '-5px');
$('#identity_switch_dropdown')
.css('left', '190px')
.css('top', '-40px');
return true;
}
return false;
}
// Set menu position
function identity_switch_addCbElastic($sw) {
var $taskBar = $('.header-title.username');
$sw.css('background-color', 'transparent').css('padding','4px 0 0 2rem');
if ($taskBar.length > 0) {
$taskBar.prepend($sw);
$taskBar.css('margin-left', '20px');
// Remove text from <span>
var $node = $('.header-title.username');
var newNode = $('<' + $node[0].nodeName + '/>');
$.each( $node[0].attributes, function ( i, attribute ) {
newNode.attr(attribute.name, attribute.value);
});
$node.children().each(function(){
newNode.append(this);
});
$node.replaceWith(newNode);
// Move our selection menu a bit to the bottom
$('#identity_switch_menu')
.css('height', '30px')
.css('width', '180px');
$('#identity_switch_dropdown')
.css('left', '9px')
.css('margin-top', '0');
return true;
}
return false;
}
// Change userid in composer window to select proper identity
function identity_switch_fixIdent(iid) {
if (parseInt(iid) > 0)
$("#_from").val(iid);
}
// Open/close menu
function identity_switch_toggle_menu() {
var d = $('#identity_switch_dropdown');
if (d.is(':hidden')) {
// reload window to show new mail counter in menu
d.load(location.href + ' #identity_switch_dropdown > *', '');
d.show();
$('#messagelist-fixedcopy').css('z-index', 'auto');
} else
d.hide();
}
// Switch identity
function identity_switch_run(iid) {
rcmail.env.unread_counts = {};
rcmail.http_post('plugin.identity_switch_do', { 'identity_switch_iid': iid });
}
// Perform notification
function identity_switch_notify(ctl) {
var autoplay = decodeURI(ctl[0].autoplay);
var notification = decodeURI(ctl[0].notification);
var title = decodeURI(ctl[0].title);
for (var i = 1; i < ctl.length; i++) {
var e = $('#identity_switch_opt_' + ctl[i].iid);
if (ctl[i].unseen == '0')
e.text('');
else
e.text(ctl[i].unseen);
if (ctl[i].basic !== undefined)
identity_switch_basic();
if (ctl[i].desktop !== undefined)
identity_switch_desktop(title, ctl[i].desktop.text, ctl[i].desktop.timeout, notification);
if (ctl[i].sound !== undefined)
identity_switch_sound(autoplay);
}
}
// Stop notification
function identity_switch_stop_notify(prop)
{
// Revert original favicon
if (rcmail.env.favicon_href && rcmail.env.favicon_changed && (!prop || prop.action != 'check-recent')) {
$('<link rel="shortcut icon" href="'+rcmail.env.favicon_href+'"/>').replaceAll('link[rel="shortcut icon"]');
rcmail.env.favicon_changed = 0;
}
}
// Browser notification: window.focus and favicon change
function identity_switch_basic()
{
var w = rcmail.is_framed() ? window.parent : window;
w.focus();
var src = rcmail.assets_path('plugins/identity_switch/assets');
// We cannot simply change a href attribute, we must to replace the link element (at least in FF)
var link = $('<link rel="shortcut icon">').attr('href', src + '/alert.ico');
var olink = $('link[rel="shortcut icon"]', w.document);
if (!rcmail.env.favicon_href)
rcmail.env.favicon_href = olink.attr('href');
rcmail.env.favicon_changed = 1;
link.replaceAll(olink);
}
// Desktop notification
// - Require window.Notification API support (Chrome 22+ or Firefox 22+)
function identity_switch_desktop(title, msg, timeout, errmsg)
{
if (!('Notification' in window) || window.Notification.permission !== "granted") {
alert(decodeURIComponent(errmsg));
window.Notification.requestPermission();
return;
}
var popup = new window.Notification(decodeURIComponent(title), {
dir: "auto",
lang: "",
body: decodeURIComponent(msg),
icon: rcmail.assets_path('plugins/identity_switch/assets/alert.gif')
});
popup.onclick = function() { this.close(); };
setTimeout(function() { popup.close(); }, timeout * 1000);
}
// Sound notification
function identity_switch_sound(errmsg) {
var src = rcmail.assets_path('plugins/identity_switch/assets/alert');
if (!('Notification' in window) || window.Notification.silent) {
alert(decodeURIComponent(errmsg));
return;
}
if (!('Navigator' in window) && window.Navigator.getAutoplayPolicy &&
window.Navigator.getAutoplayPolicy('mediaelement') != 'allowed') {
alert(decodeURIComponent(errmsg));
window.Notification.requestPermission();
return;
}
new Audio(src + '.mp3').play();
}

@ -0,0 +1,123 @@
#identity_switch_menu {
margin-right: 0;
overflow: hidden;
text-overflow: ellipsis;
margin-top: 5px;
font-weight: 700;
padding-left: 2rem;
text-align: left;
width: 240px;
height: 21px;
border: 1px solid #ccc !important;
border-radius: .4em;
background: #fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat left .75rem center/8px 10px;
top: -65px;
left: 240px;
position: relative;
float: inline-start
}
#identity_switch_dropdown {
position: fixed;
z-index: 1;
padding: 0 .5rem 0 0;
/* min-width: 250px; */
max-width: 260px;
width: 260px;
will-change: transform;
top: 14px;
left: 178px;
margin-left: 0;
margin-top: 0;
transform: translate3d(63px, 49px, 0);
border-bottom-color: #78b3cc;
box-shadow: 0px 3px 5px #414141a1 !important;
max-height: 150px;
overflow-x: hidden;
color: #212529;
display: none;
border-color: #d4dbde;
border-radius: .4rem;
border-bottom: 1px solid #f7f7f7;
background-color: rgba(255, 255, 255);
font-weight: 400;
line-height: 35px
}
#identity_switch_dropdown ul {
list-style: none;
margin: 0;
padding: 0
}
#identity_switch_dropdown li {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
position: relative;
left: 0;
width: 100%
}
#identity_switch_dropdown a {
padding: 0 .5rem;
white-space: nowrap;
color: #2c363a;
background: 0 0;
text-decoration: none;
}
#identity_switch_dropdown li:hover {
background-color: #bbe6f8
}
#identity_switch_dropdown a:hover {
text-decoration: none
}
#identity_switch_dropdown .unseen {
position: absolute;
top: 0;
right: 0;
min-width: 2em;
line-height: 1.4rem;
margin: 7.7px 0 7.7px 0;
padding: 0 .3em;
border-radius: .4em;
background: #37beff;
color: #fff;
text-align: center;
font-weight: 700
}
html.dark-mode #identity_switch_menu {
margin-right: 0;
overflow: hidden;
text-overflow: ellipsis;
margin-top: 5px;
font-weight: 700;
padding-left: 2rem;
text-align: left;
width: 240px;
border: 1px solid #ccc !important;
border-radius: .4em;
background: #fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='beige' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat left .75rem center/8px 10px;
top: 10px;
left: inherit;
position: relative;
float: inline-start
}
html.dark-mode #identity_switch_dropdown {
background-color: #343a40;
border-color: #4d6066;
box-shadow: 3px 3px 5px #374549
}
html.dark-mode #identity_switch_dropdown a {
color: #c5d1d3
}
html.dark-mode #identity_switch_dropdown li:hover {
background-color: #374549
}

@ -0,0 +1,4 @@
$(function(){$sw=$('#identity_switch_menu');isOk=false;switch(rcmail.env['skin']){case'larry':isOk=identity_switch_addCbLarry($sw);break;case'classic':isOk=identity_switch_addCbClassic($sw);break;case'elastic':case'hivemail':isOk=identity_switch_addCbElastic($sw);default:break;}if(isOk)$sw.show();});$(document).click(function(event){if(event.button==0){var id=event.target.id;var d=$('#identity_switch_dropdown');if(id!='identity_switch_menu'&&!d.is(':hidden'))d.hide();}});function identity_switch_init(){rcmail.addEventListener('plugin.identity_switch_notify',identity_switch_notify).addEventListener('init',function(){if(rcmail.message_list)rcmail.message_list.addEventListener('select',identity_switch_stop_notify);});}function identity_switch_addCbLarry($sw){var $truName=$('.topright .username');if($truName.length>0){if($sw.length>0){$sw.prependTo('#taskbar');$truName.hide();$('#identity_switch_menu').css('padding-top','4px').css('padding-bottom','4px');$('#identity_switch_dropdown').css('margin-left','-92px');return true;}}return false;}function identity_switch_addCbClassic($sw){var $taskBar=$('#taskbar');if($taskBar.length>0){$taskBar.prepend($sw);$('#identity_switch_menu').css('left','-10px').css('top','-5px');$('#identity_switch_dropdown').css('left','190px').css('top','-40px');return true;}return false;}function identity_switch_addCbElastic($sw){var $taskBar=$('.header-title.username');$sw.css('background-color','transparent').css('padding','4px 0 0 2rem');if($taskBar.length>0){$taskBar.prepend($sw);$taskBar.css('margin-left','20px');var $node=$('.header-title.username');var newNode=$('<'+$node[0].nodeName+'/>');$.each($node[0].attributes,function(i,attribute){newNode.attr(attribute.name,attribute.value);});$node.children().each(function(){newNode.append(this);});$node.replaceWith(newNode);$('#identity_switch_menu').css('height','30px').css('width','180px');$('#identity_switch_dropdown').css('left','9px').css('margin-top','0');return true;}return false;}function identity_switch_fixIdent(iid){if(parseInt(iid)>0)$("#_from").val(iid);}function identity_switch_toggle_menu(){var d=$('#identity_switch_dropdown');if(d.is(':hidden')){d.load(location.href+' #identity_switch_dropdown > *','');d.show();$('#messagelist-fixedcopy').css('z-index','auto');}else
d.hide();}function identity_switch_run(iid){rcmail.env.unread_counts={};rcmail.http_post('plugin.identity_switch_do',{'identity_switch_iid':iid});}function identity_switch_notify(ctl){var autoplay=decodeURI(ctl[0].autoplay);var notification=decodeURI(ctl[0].notification);var title=decodeURI(ctl[0].title);for(var i=1;i<ctl.length;i++){var e=$('#identity_switch_opt_'+ctl[i].iid);if(ctl[i].unseen=='0')e.text('');else
e.text(ctl[i].unseen);if(ctl[i].basic!==undefined)identity_switch_basic();if(ctl[i].desktop!==undefined)identity_switch_desktop(title,ctl[i].desktop.text,ctl[i].desktop.timeout,notification);if(ctl[i].sound!==undefined)identity_switch_sound(autoplay);}}function identity_switch_stop_notify(prop){if(rcmail.env.favicon_href&&rcmail.env.favicon_changed&&(!prop||prop.action!='check-recent')){$('<link rel="shortcut icon" href="'+rcmail.env.favicon_href+'"/>').replaceAll('link[rel="shortcut icon"]');rcmail.env.favicon_changed=0;}}function identity_switch_basic(){var w=rcmail.is_framed()?window.parent:window;w.focus();var src=rcmail.assets_path('plugins/identity_switch/assets');var link=$('<link rel="shortcut icon">').attr('href',src+'/alert.ico');var olink=$('link[rel="shortcut icon"]',w.document);if(!rcmail.env.favicon_href)rcmail.env.favicon_href=olink.attr('href');rcmail.env.favicon_changed=1;link.replaceAll(olink);}function identity_switch_desktop(title,msg,timeout,errmsg){if(!('Notification'in window)||window.Notification.permission!=="granted"){alert(decodeURIComponent(errmsg));window.Notification.requestPermission();return;}var popup=new window.Notification(decodeURIComponent(title),{dir:"auto",lang:"",body:decodeURIComponent(msg),icon:rcmail.assets_path('plugins/identity_switch/assets/alert.gif')});popup.onclick=function(){this.close();};setTimeout(function(){popup.close();},timeout*1000);}function identity_switch_sound(errmsg){var src=rcmail.assets_path('plugins/identity_switch/assets/alert');if(!('Notification'in window)||window.Notification.silent){alert(decodeURIComponent(errmsg));return;}if(!('Navigator'in window)&&window.Navigator.getAutoplayPolicy&&window.Navigator.getAutoplayPolicy('mediaelement')!='allowed'){alert(decodeURIComponent(errmsg));window.Notification.requestPermission();return;}new Audio(src+'.mp3').play();}

@ -0,0 +1,51 @@
{
"name" : "toteph42/identity_switch",
"type" : "roundcube-plugin",
"description" : "This plugin allows users to switch between different accounts (and check for new mails) in a single Roundcube session.",
"homepage" : "https://github.com/totep42/identity_switch",
"keywords" : [
"identity",
"select identity",
"imap",
"smtp",
"mail",
"switch",
"new mail check",
"notify new mail"
],
"license" : "GPL-3.0+",
"authors" : [{
"name" : "Florian Däumling",
"email" : "toteph42@github.com",
"role" : "Developer"
}
],
"repositories" : [{
"type" : "composer",
"url" : "https://plugins.roundcube.net"
}
],
"require" : {
"php" : ">=8.0.0",
"roundcube/plugin-installer" : ">=0.1.3",
"ext-ctype" : "*"
},
"conflict" : {
"elm/identity_smtp" : "*",
"dougluce/ident_switch" : "*"
},
"support" : {
"issues" : "https://github.com/totep42/identity_switch/issues"
},
"extra" : {
"roundcube" : {
"min-version" : "1.6",
"sql-dir" : "SQL"
}
},
"config": {
"allow-plugins": {
"roundcube/plugin-installer": true
}
}
}

@ -0,0 +1,81 @@
<?php
/*
* Identity switch RoundCube Bundle
*
* @copyright (c) 2024 Forian Daeumling, Germany. All right reserved
* @license https://github.com/toteph42/identity_switch/blob/master/LICENSE
*/
$config['identity_switch.config'] = [
// Preconfigured settings for different mail domains.
// Appropriate set of values is searched by mapping domain of email (from identity) to array key.
// Please note:
// - Using config.inc.php is only done, when you enter identity_switch configuration panel!
// - On Startup of RoundCube all configuration parameters were loaded from data base, so changes to this
// configuration file does not apply.
// Domain part of email address
// If you use '*' as wild card, the domain and tld of the identity is used
'domain.tld' => [
// IMAP host name, use ssl:// or tls:// notation if needed, for no security use imap://
// Must always start with scheme.
// If you use '*' as wild card, the domain and tld of the identity is used
// Defaults to 'not specified'
'imap' => 'imap://imap.domain.tld:447',
// Folder delimiter
// Defaults to 'not specified'
'delimiter' => '.',
// Login name, can be 'email' (full address from identity), 'mbox' (only mailbox part).
// Any other value is treated as 'not specified' (default).
'user' => 'email',
// SMTP host name, use ssl:// or tls:// notation if needed, for no security use imap://
// Must always start with scheme.
// If you use '*' as wild card, the domain and tld of the identity is used
// Defaults to 'not specified'
'smtp' => 'imap://smtp.domain.tld:130',
],
// 'another.tld' => [
// 'imap' => 'tls://imap.another.tld',
// 'smtp' => 'tls://smtp.another.tld',
// 'user' => 'mbox',
// ],
// Catch all (if you specify multiple 'catch all', then only first one is used)
//
// '*' => [
// 'imap' => 'ssl://imap.*',
// 'smtp' => 'tls://smtp.*',
// 'delimiter' => '/',
// ],
// Allow logging to 'logs/identity_switch.log'. Default is false.
'logging' => false,
// Allow new mail checking. Default is true.
'check' => true,
// Specify interval for checking of new mails. Default is 5 min. (5 * 60 sec.)
'interval' => 300,
// Specify number of microseconds between each new mail check. Default is 0 micoseconds.
// If value is greater than 1000000 (1 second) delay time is rounded to seconds.
'delay' => 0,
// Specify no. of retries for reading data from mail server. Default is 10 times.
'retries' => 10,
// Max. number of seconds to wait for response from identity_switch_newmails.php
// Defaults to 60 seconds
'wait' => 60,
// Enable some debugging messges saved in log file. Default is false
'debug' => false,
];

@ -0,0 +1,81 @@
<?php
/*
* Identity switch RoundCube Bundle
*
* @copyright (c) 2024 Forian Daeumling, Germany. All right reserved
* @license https://github.com/toteph42/identity_switch/blob/master/LICENSE
*/
$config['identity_switch.config'] = [
// Preconfigured settings for different mail domains.
// Appropriate set of values is searched by mapping domain of email (from identity) to array key.
// Please note:
// - Using config.inc.php is only done, when you enter identity_switch configuration panel!
// - On Startup of RoundCube all configuration parameters were loaded from data base, so changes to this
// configuration file does not apply.
// Domain part of email address
// If you use '*' as wild card, the domain and tld of the identity is used
'domain.tld' => [
// IMAP host name, use ssl:// or tls:// notation if needed, for no security use imap://
// Must always start with scheme.
// If you use '*' as wild card, the domain and tld of the identity is used
// Defaults to 'not specified'
'imap' => 'imap://imap.domain.tld:447',
// Folder delimiter
// Defaults to 'not specified'
'delimiter' => '.',
// Login name, can be 'email' (full address from identity), 'mbox' (only mailbox part).
// Any other value is treated as 'not specified' (default).
'user' => 'email',
// SMTP host name, use ssl:// or tls:// notation if needed, for no security use imap://
// Must always start with scheme.
// If you use '*' as wild card, the domain and tld of the identity is used
// Defaults to 'not specified'
'smtp' => 'imap://smtp.domain.tld:130',
],
// 'another.tld' => [
// 'imap' => 'tls://imap.another.tld',
// 'smtp' => 'tls://smtp.another.tld',
// 'user' => 'mbox',
// ],
// Catch all (if you specify multiple 'catch all', then only first one is used)
//
// '*' => [
// 'imap' => 'ssl://imap.*',
// 'smtp' => 'tls://smtp.*',
// 'delimiter' => '/',
// ],
// Allow logging to 'logs/identity_switch.log'. Default is false.
'logging' => false,
// Allow new mail checking. Default is true.
'check' => true,
// Specify interval for checking of new mails. Default is 5 min. (5 * 60 sec.)
'interval' => 300,
// Specify number of microseconds between each new mail check. Default is 0 micoseconds.
// If value is greater than 1000000 (1 second) delay time is rounded to seconds.
'delay' => 0,
// Specify no. of retries for reading data from mail server. Default is 10 times.
'retries' => 10,
// Max. number of seconds to wait for response from identity_switch_newmails.php
// Defaults to 60 seconds
'wait' => 60,
// Enable some debugging messges saved in log file. Default is false
'debug' => false,
];

@ -0,0 +1,655 @@
<?php
declare(strict_types=1);
/*
* Identity switch RoundCube Bundle
*
* @copyright (c) 2024 Forian Daeumling, Germany. All right reserved
* @license https://github.com/toteph42/identity_switch/blob/master/LICENSE
*/
/**
*
* Data structure
*
* config configuration data
* logging allow logging to 'logs/identity_switch.log'
* debug log debug message to 'logs/identity_switch.log'
* check allow new mail checking
* interval specify interval for checking of new mails
* delay delay between each new mail check
* retries specify no. of retries for reading data from mail server
* wait max. number of seconds to wait for response from identity_switch_newmails.php
* language language used
* cache all session variables used by identity switch
* data unseen exchange data file
* fp file pointer
* iid active identity
* lock lock all activities
* [n] cached identity data
* label label
* flags glags
* imap_user IMAP user
* imap_pwd IMAP password
* imap_host IMAP host
* imap_delim golder delimiter
* imap_port IMAP port
* smtp_host SMTP host
* smtp_port SMTP port
* notify_timeout notification timeout
* newmail_check new mail check interval
* folders special folder name array
* unseen # of unseen messages
* checked_last last time checked
* notify notify user flag
*
*/
require_once INSTALL_PATH.'plugins/identity_switch/identity_switch_prefs.php';
require_once INSTALL_PATH.'plugins/identity_switch/identity_switch_newmails.php';
class identity_switch extends identity_switch_prefs
{
/**
* Initialize Plugin
*
* {@inheritDoc}
* @see rcube_plugin::init()
*/
function init(): void
{
$rc = rcmail::get_instance();
// identity switch hooks and actions
$this->add_hook('startup', [ $this, 'on_startup' ]);
$this->add_hook('render_page', [ $this, 'on_render_page' ]);
$this->add_hook('smtp_connect', [ $this, 'on_smtp_connect' ]);
$this->add_hook('template_object_composeheaders', [ $this, 'on_object_composeheaders' ]);
$this->register_action('identity_switch_do', [ $this, 'identity_switch_do_switch' ]);
// preference hooks and actions
parent::init();
// notification hooks and action
if ($rc->output instanceof rcmail_output_html) {
$rc->output->add_script('identity_switch_init();', 'head_top');
$rc->output->include_script('../../plugins/identity_switch/assets/identity_switch.js');
}
// new mail hooks and action
$this->add_hook('new_messages', [ $this, 'catch_newmails' ]);
$this->add_hook('refresh', [ $this, 'check_newmails' ]);
$this->add_hook('ready', [ $this, 'check_newmails' ]);
// LDAP hooks
if ($rc->config->get('ldapAliasSync', null))
$this->add_hook('storage_connect', [ $this, 'override_ldap_password' ]);
$this->include_stylesheet('assets/identity_switch.css');
}
/**
* Startup script
*
* @param array $args
* @return array
*/
function on_startup(array $args): array
{
$rc = rcmail::get_instance();
// not default user?
if (isset($_SESSION['username']) && strcasecmp($rc->user->data['username'], $_SESSION['username']) !== 0)
{
// we are impersonating
$rc->config->set('imap_cache', null);
$rc->config->set('messages_cache', false);
if ($args['task'] == 'mail')
{
$this->add_texts('localization/');
$rc->config->set('create_default_folders', false);
}
}
return $args;
}
/**
* Dispatch action
*
* @param array $args
* @return array
*/
function on_render_page(array $args): array
{
$rc = rcmail::get_instance();
switch ($rc->task)
{
case 'mail':
$this->add_texts('localization');
if (self::get('iid') > 0)
{
if ($args['template'] == 'mail')
{
while (self::get('lock'))
usleep(100);
self::create_menu();
}
break;
}
$iid = $rc->user->get_identity();
$iid = $iid['identity_id'];
// create defaults for default user
self::get($iid);
// set default user number
self::set('iid', $iid);
// collect data for default identity
$i = $rc->user->get_identity();
self::set($iid, 'label', $i['name']);
self::set($iid, 'flags', self::ENABLED);
// swap IMAP data
self::set($iid, 'imap_user', $_SESSION['username']);
self::set($iid, 'imap_pwd', $_SESSION['password']);
self::set($iid, 'imap_host', $_SESSION['storage_host']);
self::set($iid, 'imap_port', $_SESSION['storage_port']);
if ($_SESSION['storage_ssl'] == 'ssl')
self::set($iid, 'flags', self::get($iid, 'flags') | self::IMAP_SSL);
if ($_SESSION['storage_ssl'] == 'tls')
self::set($iid, 'flags', self::get($iid, 'flags') | self::IMAP_TLS);
self::set($iid, 'imap_delim', $_SESSION['imap_delimiter']);
// Sswap SMTP data
$hosts = $rc->config->get('smtp_host');
if (!is_array ($hosts))
$hosts = [ $_SESSION['storage_host'] => $hosts ];
$host = null;
foreach ($hosts as $imap => $smtp)
{
if (!strcmp($imap, $_SESSION['storage_host']))
{
$host = $smtp;
break;
}
}
if (!$host)
{
self::write_log('Cannot discover associated SMTP host to IMAP server "'.$_SESSION['storage_host'].'" '.
'- substituting with "localhost"');
$host = 'localhost';
}
// parse host name for special characters
$host = rcube_utils::parse_host($host);
if (substr($host, 3, 1) == ':')
{
if (strtolower(substr($host, 0, 3)) == 'ssl')
{
self::set($iid, 'flags', self::get($iid, 'flags') | self::SMTP_SSL);
$host = substr($host, 6);
self::set($iid, 'smtp_port', 465);
}
elseif (strtolower(substr($host, 0, 3)) == 'tls')
{
self::set($iid, 'flags', self::get($iid, 'flags') | self::SMTP_TLS);
$host = substr($host, 6);
self::set($iid, 'smtp_port', 587);
}
// Unknown protocoll
if (($p = strpos($host, ':')) !== false)
{
self::set($iid, 'smtp_port', substr($host, $p + 1));
$host = substr($host, 0, $p);
}
}
self::set($iid, 'smtp_host', $host);
$prefs = $rc->user->get_prefs();
// swap nofication data
$p = 'newmail_notifier_';
if (isset($prefs['check_all_folders']) && $prefs['check_all_folders'])
self::set($iid, 'flags', self::get($iid, 'flags') | self::CHECK_ALLFOLDER);
foreach ([ 'basic' => self::NOTIFY_BASIC,
'desktop' => self::NOTIFY_DESKTOP,
'sound' => self::NOTIFY_SOUND] as $k => $v)
{
if (isset($prefs[$p.$k]) && $prefs[$p.$k] == 1)
self::set($iid, 'flags', self::get($iid, 'flags') | $v);
}
if (isset($prefs[$p.'_desktop_timeout']))
self::set($iid, 'notify_timeout', $prefs[$p.'_desktop_timeout']);
// swap new mail check interval
self::set($iid, 'newmail_check', (int)(isset($prefs['refresh_interval']) ? $prefs['refresh_interval'] :
$rc->config->get('refresh_interval')));
// swap special folder names
$box = [];
foreach (rcube_storage::$folder_types as $mbox)
$box[$mbox] = isset($prefs[$mbox.'_mbox']) ? $prefs[$mbox.'_mbox'] : '';
self::set($iid, 'folders', $box);
if (isset($prefs['show_real_foldernames']) && $prefs['show_real_foldernames'] == 'true')
self::set($iid, 'flags', self::get($iid, 'flags') | self::SHOW_REAL_FOLDER);
self::set($iid, 'flags', self::get($iid, 'flags') | (isset($prefs['lock_special_folders']) &&
$prefs['lock_special_folders'] == true ? self::LOCK_SPECIAL_FOLDER : 0));
// swap data of alternate accounts
$sql = 'SELECT isw.* '.
'FROM '.$rc->db->table_name(self::TABLE).' isw '.
'INNER JOIN '.$rc->db->table_name('identities').' ii ON isw.iid=ii.identity_id '.
'WHERE isw.user_id = ?';
$q = $rc->db->query($sql, $rc->user->data['user_id']);
while ($r = $rc->db->fetch_assoc($q))
{
// is it default identity?
if ($iid == $r['iid'])
self::set($iid, 'label', $r['label']);
else {
// load default settings
self::get($r['iid']);
// swap saved data
foreach ($r as $k => $v)
{
// skip some fields
if ($k == 'id' || $k == 'user_id' || $k == 'iid')
continue;
if ($k == 'folders')
$v = is_null($v) ? [] : json_decode($v);
self::set($r['iid'], $k, $v);
}
}
}
if ($args['template'] == 'mail')
self::create_menu();
break;
case 'settings':
$this->include_script('assets/identity_switch-form.js');
break;
}
return $args;
}
/**
* Create selection menu
*/
protected function create_menu(): void
{
// build identity table
$acc = [];
foreach (self::get() as $iid => $rec)
{
// identity switch enabled?
if (is_numeric($iid) && is_array($rec) && ($rec['flags'] & self::ENABLED))
$acc[rcube::Q($rec['label'])] = [ 'iid' => $iid, 'unseen' => $rec['unseen'] ];
}
// sort identities
ksort($acc);
// render UI if user has extra accounts
if (count($acc) > 1)
{
$iid = self::get('iid');
$div = '<div id="identity_switch_menu" '.
'class="form-control" '.
'onclick="identity_switch_toggle_menu()">'.
rcube::Q(self::get($iid, 'label')).
'<div id="identity_switch_dropdown"><ul>';
foreach ($acc as $name => $rec)
$div .= '<li onclick="identity_switch_run('.$rec['iid'].');"><a href="#">'.$name.
'<span id="identity_switch_opt_'.$rec['iid'].'" class="unseen">'.
($rec['iid'] == $iid ? 0 : ($rec['unseen'] > 0 ? $rec['unseen'] : '')).'</span></a></li>';
rcmail::get_instance()->output->add_footer($div.'</ul></div></div>');
}
}
/**
* Perform identity switch
*/
function identity_switch_do_switch(): void
{
$rc = rcmail::get_instance();
$rc->session->remove('folders');
$rc->session->remove('unseen_count');
// update current unseen counter
self::set('lock', 1);
$iid = self::get('iid');
$folders = [ 'INBOX' ];
$storage = $rc->get_storage();
if (self::get($iid, 'flags') & identity_switch_prefs::CHECK_ALLFOLDER)
$folders += $storage->list_folders_subscribed('', '*'. null, null, true);
$unseen = 0;
foreach ($folders as $mbox)
$unseen += $storage->count($mbox, 'UNSEEN', true, false);
self::set($iid, 'unseen', $unseen);
self::set($iid, 'checked_last', time());
// get new account
$rec = self::get($iid = rcube_utils::get_input_value('identity_switch_iid', rcube_utils::INPUT_POST));
// swap data
self::swap($iid, $rec);
self::set('lock', 0);
$this->write_log('Switching to identity "'.$rec['imap_user'].'"');
$rc->output->redirect(
[
'_task' => 'mail',
'_mbox' => 'INBOX',
]
);
}
/**
* Send mail
*
* @param array $args
* @return array
*/
function on_smtp_connect(array $args): array
{
$rc = rcmail::get_instance();
$rec = self::get(self::get('iid'));
$args['smtp_user'] = $rec['imap_user'];
$args['smtp_pass'] = $rec['imap_pwd'] && ($rec['flags'] & (self::SMTP_SSL|self::SMTP_TLS)) ?
$rc->decrypt($rec['imap_pwd']) : '';
$args['smtp_host'] = $rec['smtp_host'].':'.$rec['smtp_port'];
if ($rec['flags'] & (self::SMTP_SSL|self::SMTP_TLS))
$args['smtp_host'] = ($rec['flags'] & self::SMTP_SSL ? 'ssl' : 'tls').'://'.$args['smtp_host'];
return $args;
}
/**
* Change userid in composer window to select proper identity
*
* @param array $args
*/
function on_object_composeheaders(array $args): void
{
if ($args['id'] == '_from')
{
$rc = rcmail::get_instance();
if (strcasecmp($_SESSION['username'], $rc->user->data['username']) !== 0)
$rc->output->add_script('identity_switch_fixIdent('.self::get('iid').');', 'docready');
}
}
/**
* Override LDAP password
*
* @param array $args
* @return array
*/
function override_ldap_password(array $args): array
{
$rc = rcmail::get_instance();
// do not do anything for default identity
if (strcasecmp($args['user'], $rc->user->data['username']) === 0)
return $args;
$sql = 'SELECT imap_pwd FROM '.$rc->db->table_name(self::TABLE).' WHERE imap_user = ?';
$q = $rc->db->query($sql, $args['user']);
$r = $rc->db->fetch_assoc($q);
if(is_array($r))
{
if($r['imap_pwd'])
{
$this->write_log('Override IMAP password for user "' .$args['user'].'"');
// replace 'password' with the password you want to use
$args['pass'] = $rc->decrypt($r['imap_pwd']);
}
}
return $args;
}
/**
* Catch new mail notification for default user
*/
function catch_newmails(array $args): array
{
// unexpected input?
if (empty($args['diff']['new']))
return $args;
$iid = self::get('iid');
$n = 0;
foreach (explode(':', $args['diff']['new']) as $id)
if (strlen($id) > 1)
$n++;
self::set($iid, 'unseen', (int)(self::get($iid, 'unseen')) + $n);
self::set($iid, 'checked_last', time());
self::set($iid, 'notify', true);
self::do_notify();
return $args;
}
/**
* Check for number of new mails
*/
function check_newmails($args) {
// get configuration
if(!is_array($cfg = self::get('config')))
return $args;
// new mail check disabled?
if (!self::get('config', 'check'))
{
self::write_log('New mail check disabled - stop checking', true);
return $args;
}
// only allow call under special conditions
if (!isset($args['action']) || ($args['action'] != 'refresh' && $args['action'] != 'getunread'))
return $args;
self::write_log('Starting new mail check with arguments "'.serialize($args).'"."', true);
self::write_log('Configuration loaded "'.serialize($cfg).'".', true);
// make a copy of our cached data
$cache = self::get();
// check if we're outside waiting window
$chk = 0;
foreach ($cache as $iid => $rec)
{
if (!is_integer($iid))
continue;
if ((int)$rec['flags'] & identity_switch_prefs::ENABLED && (int)$rec['checked_last'] + $cfg['interval'] < time())
$chk++;
else
unset($cache[$iid]);
}
if (!$chk)
{
if (!$chk)
self::write_log('No accounts to check - stop checking', true);
return $args;
}
self::write_log('Check allowed for '.$chk.' account(s)', true);
if ($chk && !file_exists($cfg['cache']))
{
// The host, we want to reach out
if (!is_resource($cfg['fp']))
{
$host = ($_SERVER['SERVER_PORT'] != '80' ? 'ssl://' : '').$_SERVER['HTTP_HOST'].':'.$_SERVER['SERVER_PORT'];
self::set('config', 'fp', $cfg['fp'] = new identity_switch_rpc());
if (is_string($cfg['fp']->open($host)))
{
$this->write_log('Cannot open connection - '.$cfg['fp'].' for '.$host.' - stop checking');
return $args;
}
self::write_log('Host "'.$host.'" connected', true);
}
// save data for background sharing
file_put_contents($cfg['cache'], serialize($cache));
self::write_log('Cache file "'.$cfg['cache'].'" created');
// prepare request (no fopen() usage because "allow_url_fopen=FALSE" may be set in PHP.INI)
$req = '/plugins/identity_switch/identity_switch_newmails.php?iid=0&cache='.urlencode($cfg['cache']);
if (!$cfg['fp']->write($req))
{
if (is_resource($cfg['fp']))
fclose($cfg['fp']);
self::set('config', 'fp', $cfg['fp'] = 0);
$this->write_log('Cannot write to "'.$host.'" Request: "'.$req.'" - stop checking');
return $args;
}
self::write_log('Starting request "'.$req.'"', true);
}
// check for data file
$n = 0;
while (!file_exists($cfg['data']))
{
if ($n++ > self::get('wait'))
{
self::write_log('No data file exist - stop checking', true);
return $args;
}
sleep (1);
}
// load data file
self::write_log('Loading and deleting data file', true);
$wrk = file_get_contents($cfg['data']);
@unlink($cfg['data']);
// process data lines
if (is_string($wrk))
{
foreach (explode('###', $wrk) as $line)
{
if (!$line)
continue;
$r = explode('##', $line);
// #35 bad formatted returned string
if (!is_array($r))
continue;
// Check for error message
if (!$r[1] && isset($r[2]))
{
$this->write_log('NewMail error: '.$r[2]);
continue;
}
$rec = &self::get($r[1]);
if ($r[2] != $rec['unseen'])
{
if ($r[2] > $rec['unseen'])
{
// Allow to notify
if (!($rec['flags'] & self::UNSEEN))
self::set($r[1], 'notify', true);
else
self::set($r[1], 'flags', $rec['flags'] & ~self::UNSEEN);
}
self::set($r[1], 'unseen', $r[2]);
}
self::set($r[1], 'checked_last', $r[0]);
}
self::write_log('Starting notification.', true);
self::do_notify();
}
return $args;
}
/**
* Do notification
*/
function do_notify(): void
{
$rc = rcmail::get_instance();
$this->add_texts('localization');
// control array
$ctl = [];
$ctl[0] = [
'autoplay' => rawurlencode($this->gettext('notify.err.autoplay')),
'notification' => rawurlencode($this->gettext('notify.err.notification')),
'title' => rawurlencode($this->gettext('notify.title')),
];
$cnt = 1;
$sound = false;
$basic = false;
foreach (self::get() as $iid => $rec)
{
// skip unwanted entries
if (!is_numeric($iid))
continue;
// set unseen to provide to browser
$ctl[$cnt]['iid'] = $iid;
$ctl[$cnt]['unseen'] = $rec['unseen'];
// should we notify?
if ($rec['notify'])
{
self::set($iid, 'notify', false);
if ($rec['flags'] & self::NOTIFY_BASIC && !$basic)
{
$basic = true;
$ctl[$cnt]['basic'] = 1;
}
if ($rec['flags'] & self::NOTIFY_DESKTOP)
$ctl[$cnt]['desktop'] = [
'text' => rawurlencode(sprintf($this->gettext('notify.msg'), $rec['unseen'],
$rec['label'])),
'timeout' => $rec['notify_timeout'],
];
if ($rec['flags'] & self::NOTIFY_SOUND && !$sound)
{
$sound = true;
$ctl[$cnt]['sound'] = 1;
}
}
$cnt++;
}
$rc->output->command('plugin.identity_switch_notify', $ctl);
}
}

@ -0,0 +1,224 @@
<?php
declare(strict_types=1);
/*
* Identity switch RoundCube Bundle
*
* @copyright (c) 2024 Forian Daeumling, Germany. All right reserved
* @license https://github.com/toteph42/identity_switch/blob/master/LICENSE
*/
// include environment
if (!defined('INSTALL_PATH'))
define('INSTALL_PATH', strpos($_SERVER['DOCUMENT_ROOT'], 'public_html') ?
realpath(__DIR__.'/../..').'/' : $_SERVER['DOCUMENT_ROOT'].'/');
require_once INSTALL_PATH.'program/include/iniset.php';
require_once INSTALL_PATH.'plugins/identity_switch/identity_switch_rpc.php';
require_once INSTALL_PATH.'plugins/identity_switch/identity_switch_prefs.php';
class identity_switch_newmails extends identity_switch_rpc {
private $file;
private $cache;
private $fp;
/**
* Run the controller.
*/
public function run(): void
{
$rc = rcmail::get_instance();
// get Identity id
if (is_null($iid = rcube_utils::get_input_value('iid', rcube_utils::INPUT_GET)))
{
identity_switch_prefs::write_log('Cannot load identity id - stop checking', true);
return;
}
// get cache file name
if (is_null($this->file = rcube_utils::get_input_value('cache', rcube_utils::INPUT_GET)))
{
identity_switch_prefs::write_log('Cannot get cache file name - stop checking');
return;
} else
identity_switch_prefs::write_log('Cache file name "'.$this->file.'"', true);
// get cached data
if (!file_exists($this->file))
{
identity_switch_prefs::write_log('Cache file "'.$this->file.'" does not exists - stop checking');
return;
} else
identity_switch_prefs::write_log('Cache file loaded', true);
// storage initialization hook
$rc->plugins->register_hook('storage_init', [ $this, 'set_language' ]);
$this->cache = unserialize(file_get_contents($this->file));
// save logging configuration
$_SESSION[identity_switch_prefs::TABLE]['config'] = [
'logging' => $this->cache['config']['logging'],
'debug' => $this->cache['config']['debug'],
];
if (!$iid)
{
$res = [];
foreach ($this->cache as $iid => $rec)
{
if (!is_numeric($iid))
continue;
$host = ($_SERVER['SERVER_PORT'] != '80' ? 'ssl://' : '').$_SERVER['HTTP_HOST'].
':'.$_SERVER['SERVER_PORT'];
$res[$iid] = new identity_switch_rpc();
if (!$res[$iid]->open($host))
{
self::write_data($iid.'##'.$res[$iid]);
identity_switch_prefs::write_log('Cannot open host "'.$host.'" - stop checking', true);
return;
}
// prepare request (no fopen() usage because "allow_url_fopen=FALSE" may be set in PHP.INI)
$req = '/plugins/identity_switch/identity_switch_newmails.php?iid='.$iid.
'&cache='.urlencode($this->file);
if (!$res[$iid]->write($req))
{
if (is_resource($res[$iid]))
fclose($res[$iid]);
self::write_data('0##Identity: '.$iid.' Cannot write to "'.$host.'" Request: "'.$req.'" - stop checking');
return;
}
// delay execution?
if (count($this->cache) > 1 && isset($this->cache['config']['delay']) && $this->cache['config']['delay'] > 0)
{
if ($this->cache['config']['delay'] > 1000000)
{
identity_switch_prefs::write_log('Delay execution by "'.$this->cache['config']['delay'].'" seconds', true);
sleep ($this->cache['config']['delay'] / 1000000);
}
else
{
identity_switch_prefs::write_log('Delay execution by "'.$this->cache['config']['delay'].'" microseconds', true);
usleep ($this->cache['config']['delay']);
}
}
}
// collect data
$cnt = 0;
while (count($res) && $cnt++ < $this->cache['config']['retries'])
{
foreach ($res as $iid => $obj)
{
if ($wrk = $res[$iid]->read())
self::write_data('0##'.$wrk);
unset($res[$iid]);
$cnt = 0;
}
$obj; // Disable Eclipse warning
}
if ($cnt >= $this->cache['config']['retries'])
self::write_data('0##Number of retries exceeded for identity '.$iid.' - stop checking');
// delete cache data
@unlink($this->file);
identity_switch_prefs::write_log('Cache file "'.$this->file.'" deleted', true);
return;
} else {
$rec = $this->cache[$iid];
// must delete storage object, to get SSL status reset
$rc->storage = null;
// connect
$storage = $rc->get_storage();
if (substr($rec['imap_host'], 4, 1) == ':')
$rec['imap_enc'] = '';
else
$rec['imap_enc'] = $rec['flags'] & identity_switch_prefs::IMAP_SSL ? 'ssl' :
($rec['flags'] & identity_switch_prefs::IMAP_TLS ? 'tls' : '');
if (!$storage->connect($rec['imap_host'], $rec['imap_user'],
$rc->decrypt($rec['imap_pwd']), $rec['imap_port'], $rec['imap_enc']))
{
self::write_data('0##Identity '.$iid.': Cannot connect to "'.($rec['imap_enc'] ?
$rec['imap_enc'].'://' : '').$rec['imap_host'].':'.$rec['imap_port'].
'" for user "'.$rec['imap_user'].'" - stop checking');
return;
}
// get list of all subscribed folders
$storage = $rc->get_storage();
$folders = [ 'INBOX' ];
if ($rec['flags'] & identity_switch_prefs::CHECK_ALLFOLDER)
$folders += $storage->list_folders_subscribed('', '*'. null, null, true);
// drop exception folders (and their subfolders)
foreach ($rec['folders'] as $val)
if (($k = array_search($val, $folders)) !== false)
unset($folders[$k]);
// count unseen
$unseen = 0;
foreach($folders as $mbox)
{
unset($storage->conn->data['STATUS:'.$mbox]);
$unseen += $storage->count($mbox, 'UNSEEN', true, false);
}
$storage->close();
self::write_data($iid.'##'.$unseen);
identity_switch_prefs::write_log('Setting unseen count to '.$unseen.' for identity id '.$iid, true);
return;
}
}
/**
* Set language for IMAP connection
*
* @param array $args
* @return array
*/
function set_language (array $args): array
{
$args['language'] = $this->cache['config']['language'];
return $args;
}
/**
* Write record to data file
*
* @param string $msg
* @return bool
*/
private function write_data (string $msg): bool
{
if (!$this->fp || fwrite($this->fp, $msg) === false)
{
if (is_resource($this->fp))
fclose($this->fp);
// open output file
if (!($this->fp = @fopen($this->cache['config']['data'], 'a')))
{
identity_switch_prefs::write_log('Error opening data file "'.$this->cache['config']['data'].'"');
return false;
}
return fwrite($this->fp, time().'##'.$msg.'###') !== false ? true : false;
}
return true;
}
}
$obj = new identity_switch_newmails();
$obj->run();

File diff suppressed because it is too large Load Diff

@ -0,0 +1,93 @@
<?php
declare(strict_types=1);
/*
* Identity switch RoundCube Bundle
*
* @copyright (c) 2024 Forian Daeumling, Germany. All right reserved
* @license https://github.com/toteph42/identity_switch/blob/master/LICENSE
*/
class identity_switch_rpc {
private $host = null;
private $req = null;
private $fp = null;
/**
* Open asynchronous communication channel
*
* @param string $host
* @return string|resource
*/
function open(string $host): mixed
{
$errno = $errmsg = null;
$ctx = stream_context_create([
'ssl' => [
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => false,
],
]);
// open async connection
if (!($this->fp = stream_socket_client($host, $errno, $errmsg, 30,STREAM_CLIENT_ASYNC_CONNECT, $ctx)))
return 'Cannot connect to "'.$host.'" - ['.$errno.'] '.$errmsg;
// set timeout
stream_set_timeout($this->fp, 30);
// save host name
if ($p = strpos($host, '://'))
$host = substr($host, 3 + $p);
if ($p = strpos($host, ':'))
$host = substr($host, 0, $p);
$this->host = $host;
return $this->fp;
}
/**
* Write to asynchroneous communication channel
*
* @param string $req
* @return bool
*/
function write(string $req): bool
{
$this->req = $req;
// finalize request
$req = 'GET '.$req." HTTP/1.0\r\nHost: ".$this->host."\r\n\r\n";
return (bool)fwrite($this->fp, $req);
}
/**
* Read from asynchroneous communication channel
*
* @return string
*/
function read(): string
{
if (!($wrk = fread($this->fp, 8192)))
return 'Errror reading from "'.$this->host.'" Request: "'.$this->req.'"';
$head = explode("\r\n", substr($wrk, 0, $pos = strpos($wrk, "\r\n\r\n")));
$wrk = substr($wrk, $pos + 4);
// we use this approach to get "HTTP/1.0 200 OK" as well as "HTTP/1.1 200 OK"
if (count($head) && strpos($head[0], '200 OK') === false)
return '"'.$head[0].'" for "'.$this->host.'" Request: "'.$this->req.'"';
else {
if (is_string($wrk) && strlen($wrk) > 1)
return $wrk;
}
return $wrk;
}
}

@ -0,0 +1,61 @@
<?php
declare(strict_types=1);
/*
* Identity switch RoundCube Bundle
*
* @copyright (c) 2024 Forian Daeumling, Germany. All right reserved
* @license https://github.com/toteph42/identity_switch/blob/master/LICENSE
*/
$labels = [];
$labels['idsw.common.caption'] = 'Daten der Identität';
$labels['idsw.common.noedit'] = 'Informationen zur Identität können vor dem ersten Speichern nicht eingegeben werden';
$labels['idsw.common.enabled'] = 'Aktiviert';
$labels['idsw.common.label'] = 'Bezeichnung';
$labels['idsw.imap.caption'] = 'IMAP';
$labels['idsw.imap.host'] = 'Servername';
$labels['idsw.imap.auth'] = 'Verschlüsselung';
$labels['idsw.imap.auth.none'] = 'Keine';
$labels['idsw.imap.auth.ssl'] = 'SSL';
$labels['idsw.imap.auth.tls'] = 'TLS';
$labels['idsw.imap.port'] = 'Port';
$labels['idsw.imap.delim'] = 'Verzeichnistrenner';
$labels['idsw.imap.user'] = 'Benutzername';
$labels['idsw.imap.pwd'] = 'Passwort';
$labels['idsw.smtp.caption'] = 'SMTP';
$labels['idsw.smtp.host'] = 'Servername';
$labels['idsw.smtp.tls'] = 'Sichere Verbindung (TLS)';
$labels['idsw.smtp.port'] = 'Port';
$labels['idsw.smtp.auth'] = 'Verschlüsselung';
$labels['idsw.smtp.auth.none'] = 'Keine';
$labels['idsw.smtp.auth.ssl'] = 'SSL';
$labels['idsw.smtp.auth.tls'] = 'TLS';
$labels['idsw.notify.caption'] = 'Neue Nachrichten';
$labels['idsw.notify.allfolder'] = 'Alle Ordner auf neue Nachrichten prüfen';
$labels['idsw.notify.basic'] = 'Benachrichtigung im Browser bei neuer Nachricht';
$labels['idsw.notify.desktop'] = 'Desktop-Benachrichtigung bei neuer Nachricht';
$labels['idsw.notify.timeout'] = 'Desktop-Benachrichtigung schließen';
$labels['idsw.notify.sound'] = 'Akustische Meldung bei neuer Nachricht';
$labels['idsw.notify.test'] = 'Test';
$labels['idsw.err.imap.host.miss'] = 'Der Wert im Feld \'IMAP Server host name\' fehlt.';
$labels['idsw.err.imap.port.num'] = 'Der Wert in \'IMAP Port\' muss eine Zahl sein.';
$labels['idsw.err.imap.port.range'] = 'Der Wert in \'IMAP Port\' muss zwischen 1 und 65535 liegen.';
$labels['idsw.err.imap.delim.miss'] = 'Der Wert im Feld \'IMAP Verzeichnistrenner\' fehlt.';
$labels['idsw.err.imap.user.miss'] = 'Der Wert im Feld \'IMAP Benutzername\' fehlt.';
$labels['idsw.err.imap.pwd.miss'] = 'Der Wert im Feld \'IMAP Password\' fehlt.';
$labels['idsw.err.smtp.host.miss'] = 'Der Wert im Feld \'SMTP Servername\' fehlt.';
$labels['idsw.err.smtp.port.num'] = 'Der Wert in \'SMTP Port\' muss eine Zahl sein.';
$labels['idsw.err.smtp.port.range'] = 'Der Wert in \'SMTP Port\' muss zwischen 1 und 65535 liegen.';
$labels['identity'] = 'Identität';
$labels['notify.title'] = 'Neue E-Mails';
$labels['notify.msg'] = '%d für %s';
$labels['notify.err.autoplay'] = 'Kann Musik nicht abspielen!'."\r\n".
'Bitte überprüfen Sie die Einstellungen der "Automatische Wiedergabe" für diese Seite in Ihrem Browser.';
$labels['notify.err.notification'] = 'Kann Benachrichtigung nicht senden!.'."\r\n".
'Bitte überprüfen Sie die Einstellungen der "Benachrichtigungen" für diese Seite in Ihrem Browser.';

@ -0,0 +1,62 @@
<?php
declare(strict_types=1);
/*
* Identity switch RoundCube Bundle
*
* @copyright (c) 2024 Forian Daeumling, Germany. All right reserved
* @license https://github.com/toteph42/identity_switch/blob/master/LICENSE
*/
$labels = [];
$labels['idsw.common.caption'] = 'Data of your identity';
$labels['idsw.common.noedit'] = 'Informationen about identity cannot being entered until record has been saved the first time';
$labels['idsw.common.enabled'] = 'Enabled';
$labels['idsw.common.label'] = 'Label';
$labels['idsw.imap.caption'] = 'IMAP';
$labels['idsw.imap.host'] = 'Server host name';
$labels['idsw.imap.port'] = 'Port';
$labels['idsw.imap.auth'] = 'Encryption';
$labels['idsw.imap.auth.none'] = 'None';
$labels['idsw.imap.auth.ssl'] = 'SSL';
$labels['idsw.imap.auth.tls'] = 'TLS';
$labels['idsw.imap.delim'] = 'Folder hierarchy delimiter';
$labels['idsw.imap.user'] = 'Username';
$labels['idsw.imap.pwd'] = 'Password';
$labels['idsw.smtp.caption'] = 'SMTP';
$labels['idsw.smtp.host'] = 'Server host name';
$labels['idsw.smtp.tls'] = 'Secure connection (TLS)';
$labels['idsw.smtp.port'] = 'Port';
$labels['idsw.smtp.auth'] = 'Encryption';
$labels['idsw.smtp.auth.none'] = 'None';
$labels['idsw.smtp.auth.ssl'] = 'SSL';
$labels['idsw.smtp.auth.tls'] = 'TLS';
$labels['idsw.notify.caption'] = 'New messages';
$labels['idsw.notify.allfolder'] = 'Check all folders for new messages';
$labels['idsw.notify.basic'] = 'Display browser notifications on new message';
$labels['idsw.notify.desktop'] = 'Display desktop notifications on new message';
$labels['idsw.notify.timeout'] = 'Close desktop notification';
$labels['idsw.notify.sound'] = 'Play sound on new message';
$labels['idsw.notify.test'] = 'Test';
$labels['idsw.err.imap.host.miss'] = 'Value in \'IMAP Server host name\' missing.';
$labels['idsw.err.imap.port.num'] = 'Value in \'IMAP Port\' field must be a number.';
$labels['idsw.err.imap.port.range'] = 'Value in \'IMAP Port\' field must be between 1 and 65535.';
$labels['idsw.err.imap.delim.miss'] = 'Value in \'IMAP Folder hierarchy delimiter\' missing.';
$labels['idsw.err.imap.user.miss'] = 'Value in \'IMAP User name\' missing.';
$labels['idsw.err.imap.pwd.miss'] = 'Value in \'IMAP Password\' missing.';
$labels['idsw.err.smtp.host.miss'] = 'Value in \'SMTP Server host name\' missing.';
$labels['idsw.err.smtp.port.num'] = 'Value in \'SMTP Port\' field must be a number.';
$labels['idsw.err.smtp.port.range'] = 'Value in \'SMTP Port\' field must be between 1 and 65535.';
$labels['identity'] = 'Identity';
$labels['notify.title'] = 'New Emails';
$labels['notify.msg'] = '%d for %s';
$labels['notify.err.autoplay'] = 'Cannot play sound file!'."\r\n".
'Please check your "Autoplay" settings for this page in your browser.';
$labels['notify.err.notification'] = 'Cannot send notification!'."\r\n".
'Please check your "Notification" settings for this page in your browser.';

@ -0,0 +1,62 @@
<?php
declare(strict_types=1);
/*
* Identity switch RoundCube Bundle
*
* @copyright (c) 2024 Forian Daeumling, Germany. All right reserved
* @license https://github.com/toteph42/identity_switch/blob/master/LICENSE
*/
$labels = [];
$labels['idsw.common.caption'] = 'Données de votre identité';
$labels['idsw.common.noedit'] = 'Les informations liées à l\'identité ne peuvent être saisies qu\'après le premier enregistrement';
$labels['idsw.common.enabled'] = 'Activer';
$labels['idsw.common.label'] = 'Nom à afficher';
$labels['idsw.imap.caption'] = 'IMAP';
$labels['idsw.imap.host'] = 'Nom du serveur IMAP';
$labels['idsw.imap.port'] = 'Port IMAP';
$labels['idsw.imap.auth'] = 'Chiffrement';
$labels['idsw.imap.auth.none'] = 'None';
$labels['idsw.imap.auth.ssl'] = 'SSL';
$labels['idsw.imap.auth.tls'] = 'TLS';
$labels['idsw.imap.delim'] = 'Séparateur de dossier';
$labels['idsw.imap.user'] = 'Nom d\'utilisateur';
$labels['idsw.imap.pwd'] = 'Mot de passe';
$labels['idsw.smtp.caption'] = 'SMTP';
$labels['idsw.smtp.host'] = 'Nom du serveur SMTP';
$labels['idsw.smtp.tls'] = 'Connexion sécurisée (TLS)';
$labels['idsw.smtp.port'] = 'Port SMTP';
$labels['idsw.smtp.auth'] = 'Encryption';
$labels['idsw.smtp.auth.none'] = 'None';
$labels['idsw.smtp.auth.ssl'] = 'SSL';
$labels['idsw.smtp.auth.tls'] = 'TLS';
$labels['idsw.notify.caption'] = 'Nouveaux messages';
$labels['idsw.notify.allfolder'] = 'Vérifier la présence de nouveaux messages dans tous les dossiers';
$labels['idsw.notify.basic'] = 'Afficher les notifications du navigateur en cas de nouveau message';
$labels['idsw.notify.desktop'] = 'Afficher les notifications sur le bureau en cas de nouveau message';
$labels['idsw.notify.timeout'] = 'Fermeture de la notification du bureau';
$labels['idsw.notify.sound'] = 'Diffusion d\'un son lors de la réception d\'un nouveau message';
$labels['idsw.notify.test'] = 'Test';
$labels['idsw.err.imap.host.miss'] = 'La valeur du champ "Serveur IMAP" est manquante.';
$labels['idsw.err.imap.port.num'] = 'La valeur du champ "Port IMAP" doit être un nombre.';
$labels['idsw.err.imap.port.range'] = 'La valeur du champ "Port IMAP" doit être comprise entre 1 et 65535.';
$labels['idsw.err.imap.delim.miss'] = 'La valeur du champ "Séparateur de dossier" est manquante.';
$labels['idsw.err.imap.user.miss'] = 'La valeur du champ "Nom d\'utilisateur" est manquante.';
$labels['idsw.err.imap.pwd.miss'] = 'La valeur du champ "Mot de passe" est manquante.';
$labels['idsw.err.smtp.host.miss'] = 'La valeur du champ "Serveur SMTP" est manquante.';
$labels['idsw.err.smtp.port.num'] = 'La valeur du champ "Port SMTP" doit être un nombre.';
$labels['idsw.err.smtp.port.range'] = 'La valeur du champ "Port SMTP" doit être comprise entre 1 et 65535.';
$labels['identity'] = 'Identité';
$labels['notify.title'] = 'Nouveaux messages';
$labels['notify.msg'] = '%d pour %s';
$labels['notify.err.autoplay'] = 'Le fichier son ne peut pas être joué !'."\r\n".
'Vérifier vos paramètres "Autoplay" pour cette page de votre navigateur.';
$labels['notify.err.notification'] = 'La notification ne peut être envoyée !'."\r\n".
'Vérifier vos paramètres "Notification" pour cette page de votre navigateur.';

@ -0,0 +1,62 @@
<?php
declare(strict_types=1);
/*
* Identity switch RoundCube Bundle
*
* @copyright (c) 2024 Forian Daeumling, Germany. All right reserved
* @license https://github.com/toteph42/identity_switch/blob/master/LICENSE
*/
$labels = [];
$labels['idsw.common.caption'] = 'Ваши идентификационные данные';
$labels['idsw.common.noedit'] = 'Идентификационные данные нельзя ввести, пока запись не будет сначала сохранена';
$labels['idsw.common.enabled'] = 'Включено';
$labels['idsw.common.label'] = 'Метка';
$labels['idsw.imap.caption'] = 'IMAP';
$labels['idsw.imap.host'] = 'Имя сервера';
$labels['idsw.imap.port'] = 'Порт';
$labels['idsw.imap.auth'] = 'Шифрование';
$labels['idsw.imap.auth.none'] = 'Нет';
$labels['idsw.imap.auth.ssl'] = 'SSL';
$labels['idsw.imap.auth.tls'] = 'TLS';
$labels['idsw.imap.delim'] = 'Разделитель папок';
$labels['idsw.imap.user'] = 'Имя пользователя';
$labels['idsw.imap.pwd'] = 'Пароль';
$labels['idsw.smtp.caption'] = 'SMTP';
$labels['idsw.smtp.host'] = 'Имя сервера';
$labels['idsw.smtp.tls'] = 'Защищенное соединение (TLS)';
$labels['idsw.smtp.port'] = 'Порт';
$labels['idsw.smtp.auth'] = 'Шифрование';
$labels['idsw.smtp.auth.none'] = 'Нет';
$labels['idsw.smtp.auth.ssl'] = 'SSL';
$labels['idsw.smtp.auth.tls'] = 'TLS';
$labels['idsw.notify.caption'] = 'Новые письма';
$labels['idsw.notify.allfolder'] = 'Проверить все папки на новые письма';
$labels['idsw.notify.basic'] = 'Показывать уведомления в браузере при новом письме';
$labels['idsw.notify.desktop'] = 'Показывать уведомления на рабочем столе при новом письме';
$labels['idsw.notify.timeout'] = 'Закрыть уведомление на рабочем столе';
$labels['idsw.notify.sound'] = 'Проиграть звук при новом письме';
$labels['idsw.notify.test'] = 'Тест';
$labels['idsw.err.imap.host.miss'] = 'Значение в \'IMAP Server host name\' отсутствует.';
$labels['idsw.err.imap.port.num'] = 'Значение в \'IMAP Port\' должно быть числом.';
$labels['idsw.err.imap.port.range'] = 'Значение в \'IMAP Port\' должно быть между 1 и 65535.';
$labels['idsw.err.imap.delim.miss'] = 'Значение в \'IMAP Folder hierarchy delimiter\' отсутствует.';
$labels['idsw.err.imap.user.miss'] = 'Значение в \'IMAP User name\' отсутствует.';
$labels['idsw.err.imap.pwd.miss'] = 'Значение в \'IMAP Password\' отсутствует.';
$labels['idsw.err.smtp.host.miss'] = 'Значение в \'SMTP Server host name\' отсутствует.';
$labels['idsw.err.smtp.port.num'] = 'Значение в \'SMTP Port\' должно быть числом.';
$labels['idsw.err.smtp.port.range'] = 'Значение в \'SMTP Port\' должно быть между 1 и 65535.';
$labels['identity'] = 'Личность';
$labels['notify.title'] = 'Новые письма';
$labels['notify.msg'] = '%d для %s';
$labels['notify.err.autoplay'] = 'Не могу проиграть звуковой файл!'."\r\n".
'Пожалуйста, проверьте настройки "Автовоспроизведение" для этой страницы в вашем браузере.';
$labels['notify.err.notification'] = 'Не могу отправить уведомление!'."\r\n".
'Пожалуйста, проверьте настройки "Уведомление" для этой страницы в вашем браузере.';

@ -0,0 +1,559 @@
2.0.3 (2024-11-08)
==================
- fixed upload functionality used by cloud plugins
- added Arabic translation
- added Bulgarian translation
- added Chinese (Simplified) translation
- added Chinese (Traditional) translation
- added Estonian translation
- added Greek translation
- added Hungarian translation
- added Japanese translation
- added Korean translation
- added Latvian translation
- added Portuguese (Portugal) translation
- added Slovak translation
- added Swedish translation
- updated license agreement
2.0.2 (2024-07-15)
==================
- changed the minimum required PHP version to 7.4
- discontinued Internet Explorer support
- added password show/hide toggle functionality
- added carddav plugin settings icon
- updated spinner animations
- fixed ajax incompatibilities with http 1.1
- fixed potential problems with internal url functions
2.0.1 (2024-04-02)
==================
- fixed the UI text color values
- updated the geo database
- optimized some internal functions
2.0 (2024-01-31)
================
- re-designed the icon sub-system for better performance and usability
- updated the geo database
- updated the common UI
1.9.9 (2023-09-16)
==================
- fixed a mismatched composer package version that required php 8
- updated the ajax error return method
1.9.8 (2023-09-13)
==================
- changed the minimum PHP version to 7.2
- upgraded the composer libraries
- eliminated GeoIP PHP deprecation warnings on PHP 8
- updated the GeoIP database
1.9.7 (2023-05-15)
==================
- modified the icon font to fix the chevron and checkbox icons
- fixed the menu icons on smaller screens
1.9.6 (2023-05-09)
==================
- added the woff2 version of the icon font
- changed the icon for the "Empty folder" action
- updated the translations to include the AI Assistant plugin
- added Norwegian translation
- centralized the controller api call interception
1.9.5 (2023-04-24)
==================
- updated the add_to_apps_menu config functionality to allow usage without $image
- updated settings functions to improve validation
1.9.4 (2023-04-18)
==================
- changed the outlined icon set
- added support for the xai plugin
- updated the common dialog code
1.9.3 (2023-03-14)
==================
- improved settings elements UI
1.9.2 (2023-02-27)
==================
- fixed the skin inheritance recognition
- fixed the download errors for cloud plugins
1.9.1 (2023-02-17)
==================
- changed the IPTools library version to fix PHP compatibility issues
1.9 (2023-02-15)
================
- upgraded svg_sanitizer to eliminate a security vulnerability
- upgraded geoip2 and the dependencies
- replaced the unmaintained tgalopin/html-sanitizer package with inbuilt function
- made the plugin fully compatible with PHP 8.2
- removed code providing RC 1.3 compatibility
- added the S1lentium/IPTools library
- added Danish translation
- added Dutch translation
- added Finnish translation
- added Indonesian translation
- added Lithuanian translation
- added Portuguese translation
- added Romanian translation
- added Slovenian translation
- added Spanish translation
- added Turkish translation
1.8.9 (2022-12-16)
==================
- fixed potential errors if the 'allowed_skins' config value is set to an incorrect value
1.8.8 (2022-11-01)
==================
- fixed svg support in the image upload function
- fixed the view loader function
- updated the xwebdav icon styles
1.8.7 (2022-10-12)
==================
- fixed problems with xsidebar config options being the wrong type
1.8.6 (2022-06-20)
==================
- standardized the minimum required PHP version across all plugins to 7.1
- added the HtmlSanitizer library
- replaced some icons to make the UI more uniform
- added icons for the carddav plugin
- fixed list icon positioning on the elastic-based skins
1.8.5 (2022-05-30)
==================
- restructured html insertions to prevent compatibility issues with third party plugins
- added settings icon for the Thunderbird Labels plugin
1.8.4 (2022-04-06)
==================
- fixed some potential html encoding problems
1.8.3 (2022-02-28)
==================
- added xwebdav icons and translations
- fixed select and save cloud button rendering
1.8.2 (2022-02-15)
==================
- icon modifications
- cloud class and css modifications
1.8.1 (2022-01-31)
==================
- fixed a PHP warning generated by the sidebar on RC 1.5.2
1.8 (2022-01-11)
================
- disabled the apps menu on cPanel due to popup positioning issues
- added the Italian translation
- removed promo support
- fixed user language loading
- fixed flatpickr styling
- fixed flatpickr language settings
- fixed csrf warning
- fixed checkbox display in dark mode
- changed the minimum required Roundcube version to 1.4
- upgraded the PHP code syntax
- eliminated several PHP warnings
1.7.9 (2021-09-08)
==================
- updated the cloud functions
1.7.8 (2021-09-01)
==================
- fixed the apps menu display when no apps present
- code upgrades to support the upgraded xskin
- modified settings/tools icons
- added modal dialog UI code
- added icon for xwebdav
- fixed outline icons in the icon font
- fixed icon size and positioning on buttons
- fixed button spacing
- fixed managesieve plugin icons
- fixed insert user compose icon
- fixed button icon position and size
- fixed the cloud attachment progress untranslated label
- fixed interface popup on larry-based mobile
- updated the cloud attach process to include the load link and file size
- updated the cloud attach process to be compatible with RC 1.5
1.7.7 (2021-08-05)
==================
- enabled support for svg image upload
1.7.6 (2021-07-21)
==================
- upgraded the icons in the icon font
- changed the apps menu to display apps in rows instead of columns
- added Google Drive and Dropbox icons to compose buttons
- updated the Polish translation
1.7.5 (2021-07-15)
==================
- updated the translations
1.7.4 (2021-06-02)
==================
- extended the functionality of hide_about_link to apply to all skins
1.7.3 (2021-05-25)
==================
- fixed and updated the icon font
- added support for dark mode
- removed gif loader images
- improved the database update functions
- internal input token function upgrades
- added support for the skins_allowed config option
- upgraded javascript libraries
- enabled sending system emails from the user identity email instead of the login email
- enhanced the function that returns the current url
- added icons for mailvelope
1.7.2 (2021-02-08)
==================
- fixed the managesieve plugin settings icons
1.7.1 (2021-01-21)
==================
- added icons for x2fa
1.7 (2021-01-11)
================
- added settings icons for x2fa and twofactor_gauthenticator
1.6.9 (2020-11-11)
==================
- updated the German translation
1.6.8 (2020-10-19)
==================
- reduced the size of the roundcube_plus_icon fonts
- added xcalendar mobile new functionality icons
1.6.7 (2020-09-14)
==================
- replaced the datetime picker component with flatpickr
1.6.6 (2020-06-23)
==================
- fixed potential ajax request errors due to ob_clean in sendResponse and Cloud attachment download
1.6.5 (2020-04-29)
==================
- fixed the issue with switching the language to Spanish (Latin America); saving the invalid es_419 as es_ES
1.6.4 (2020-03-12)
==================
- fixed missing scrollbars in full-screen message view (caused by the imported Google Drive js)
- updated icon font
- added function Format::stringToTimeWithFormat() that properly handles decoding d/m/y formats
1.6.3 (2020-03-02)
==================
- fixed the default sidebar visibility state on Elastic-based skins
1.6.2 (2020-02-21)
==================
- fixed an error in getUrl during CalDAV requests
1.6.1 (2020-02-14)
==================
- fixed problems with popover scrollbars on Elastic-based skins
- removed a potential problem with url trailing slashes
1.6 (2020-02-10)
================
- cleaned up and improved javascript and PHP code
- added an config overwrite for the url where Roundcube currently runs (overwrite_roundcube_url)
- fixed the problem select menus getting hidden when using their scroll bars on Elastic-based skins
1.5.9 (2020-01-08)
==================
- added cPanel icon for the return_to_webmail cPanel plugin
1.5.8 (2020-01-02)
==================
- improved xsidebar UI
- added optional attachments to sendHtmlEmail()
- fixed 'hack attempt' log warning when reordering sidebar
1.5.7 (2019-12-17)
==================
- fixed incorrect skin detection on logout (RC 1.4)
- fixed database quoting
- fixed some utils functions
1.5.6 (2019-12-04)
==================
- improved support for SQLite
- improved api functions
1.5.5 (2019-11-25)
==================
- fixed issues with the disable_apps_menu config option
- improved api functions
1.5.4 (2019-11-07)
==================
- fixed Google Drive image attachment save buttons
- added settings links to sidebar titles
- added larry to the quick skin change select
- fixed formatting of plugin links in app menu
- fixed apps menu select UI
- fixed sidebar show/hide button icon
- fixed apps menu text UI
- upgraded the plugin to be compatible with Roundcube 1.4 RC2
1.5.3 (2019-10-10)
==================
- fixed popup menus that randomly didn't execute angular actions (e.g. calendar event preview)
- added new debugging functions
1.5.2 (2019-09-04)
==================
- optimized and improved the image upload function
1.5.1 (2019-09-02)
==================
- added customer config support for multi-client systems (config_ini_file and config_ini_allowed_settings)
- improved api security
- removed phpunit vendor package
- updated mobiledetect
- updated maxmind-db reader
- added a function for resaving and resizing uploaded images
1.5 (2019-07-17)
================
- fixed problems with remote analytics loading
1.4.9 (2019-07-11)
==================
- translated to French
1.4.8 (2019-06-11)
==================
- added crc function
1.4.7 (2019-06-05)
==================
- updated mobile formatting
- fixed sidebar open/close button icons
1.4.6 (2019-05-22)
==================
- upgraded to work with Roundcube 1.4 RC1
- fixed icon placement in icon font
- added 'solid' icon set in icon font
- added forwarded/replied icon in icon font
1.4.5 (2019-03-08)
==================
- fixed 32-bit platform compatibility
1.4.4 (2018-08-01)
==================
- updated geo definitions
- updated mobile detect
- updated docs
- fixed minor code problems
1.4.3 (2018-07-03)
==================
- changed ajax response functions
- added database error logging
- changed lastInsertId function to be fully compatible with Postgres
1.4.2 (2018-06-14)
==================
- fixed javascript time formatting
1.4.1 (2018-06-04)
==================
- added support for the thunderbird labels plugin
- added a config option to set default visibility of the sidebar (xsidebar_visible)
- fixed charset problem in sendHtmlEmail()
1.4 (2018-04-04)
================
- upgraded the plugin to be compatible with Elastic beta
1.3.2 (2017-12-11)
==================
- implemented multi-domain config functionality for all the plugins
1.3.1 (2017-12-06)
==================
- fixed sidebar settings page UI on mobile devices
- added new icons for the junk and not-junk buttons
1.3 (2017-11-09)
================
- upgraded vendor/maxmind to version 2.7
- upgraded geolite database to version 20171107
- upgraded Mobile_Detect to version 2.8.26
- added geo data session caching
1.2.9 (2017-11-01)
==================
- fixed markasjunk2 icons
- fixed analytics
1.2.8 (2017-09-04)
==================
- fixed port handling in Plugin::getUrl()
- fixed message list hover flag icon in widescreen view
1.2.7 (2017-08-18)
==================
- fixed the unsupported provider error in plugins that don't require db access
1.2.6 (2017-07-05)
==================
- fixed errors in Format.php when running /bin scripts
1.2.5 (2017-06-28)
==================
- moved the mobile layout setting functions to xskin
1.2.4 (2017-06-07)
==================
- made sidebar compatible with RC 1.3
- made the cloud plugin platform compatible with RC 1.3
- updated getUrl()
1.2.3 (2017-05-10)
==================
- upgraded the deprecated function rcube_idn_to_ascii()
- added a function to recognize cPanel in XFramework\Plugin
- fixed cloud-based plugin class
- fixed cloud-based attachment save function
- fixed cloud-based plugin UI
1.2.2 (2017-03-22)
==================
- changed the way of recognizing if Roundcube runs under cPanel
1.2.1 (2017-03-17)
==================
- fixed some 32-bit server incompatibility problems
- changed the rc+ watermark file location
1.2 (2017-03-07)
==================
- fixed a translation problem in Geo
- added Polish translation
1.1.9 (2017-03-01)
==================
- added a function for recognizing if running under cPanel
1.1.8 (2017-02-20)
==================
- included howler.js
1.1.7 (2017-02-15)
==================
- fixed toolbar icon size
- standardized translation files
1.1.6 (2017-02-07)
==================
- removed support for geoiplocation database
- set sidebar to be visible by default for new users
- changed the apps menu to include icons
- placed the apps menu behind settings on the menu bar
- changed saving collapsed sidebar items from cookie to user preferences
- moved rc+ font from xskin
- added German translation
1.1.5 (2017-01-16)
==================
- added config options add_to_apps_menu, remove_from_apps_menu
- described config options in the readme file
1.1.4 (2017-01-10)
==================
- made the plugin compatible with SQLite
1.1.3 (2017-01-04)
==================
- added the option of reordering sidebar items
- improved internal functions
1.1.2 (2016-12-19)
==================
- upgraded javascript libraries
- fixed redirection problems on IE
- fixed sidebar problems on IE
- fixed errors when running cleandb.sh
1.1.2 (2016-12-13)
==================
- fixed errors when using quick language change menu
1.1.1 (2016-12-09)
==================
- made plugin compatible with xactivate
- updated license agreement
1.1 (2016-11-30)
==================
- updated the maxmind database
- updated test class
- added unit tests
- added support for license key
- optimized the plugin code
- changed asl url
1.0.9 (2016-11-16)
==================
- made plugin compatible with db_prefix
- removed references to legacy functions
1.0.8 (2016-11-07)
==================
- added an function to create setting help popups
1.0.7 (2016-10-11)
==================
- fixed adding scripts and stylesheets so they don't use full url
1.0.6 (2016-09-27)
==================
- enabled setting skin via a url parameter
1.0.5 (2016-09-20)
==================
- changed the url function to recognize proxy addresses
- fixed the database functions to properly format bool values before saving
1.0.4 (2016-09-06)
==================
- added the Apps button on the toolbar for easy access to Roundcube Plus plugins
1.0.3 (2016-08-15)
==================
- fixed the Geo::getCountryName() warning
1.0.2 (2016-08-08)
==================
- upgraded to be compatible with RC 1.2.1
- upgraded to be compatible with mysql 5.7
1.0.1 (2016-07-04)
==================
- fixed problems with sorting the message list and changing the order of message columns
1.0 (2016-06-01)
================
- initial release

@ -0,0 +1,98 @@
LICENSE AGREEMENT
This License Agreement ("Agreement") is a legal agreement between you and Tecorama LLC ("Tecorama"). By installing the
Software (as defined below), you agree to all of the terms of this Agreement. If you do not agree with all of the terms
of this Agreement, you must not install, access, or otherwise use the Software.
1. Software Definition
The Software covered by this Agreement constitutes the Roundcube Plus Framework plugin (xframework) created and released
by Tecorama, including any source code and any associated media, printed materials and electronic documentation provided
by Tecorama. However, certain components of the Software, including but not limited to third-party integrations, and
media, may be subject to separate licenses provided by the respective third-party licensors. You are responsible for
ensuring your compliance with the applicable third-party license terms.
2. Terms of Use
The Software is distributed under a commercial license. In order to use the Software, you must first purchase the
license from Tecorama. Purchasing the license grants you a non-exclusive, non-transferable, limited license to install
and use the Software in accordance with this Agreement and the specifications of the license.
2.a. License Duration and Renewal
The license granted under this Agreement is valid for a period of one (1) year from the date of purchase. To maintain an
active license and continue using the Software, you must renew your license prior or on the expiration of the current
term. Tecorama reserves the right to adjust the renewal fees at its discretion. Failure to renew the license will result
in the termination of the license and right to use the Software.
3. Intellectual Property Rights
The Software is licensed, not sold. Tecorama retains all rights, title, and interest, including all intellectual
property rights, in and to the Software. You acknowledge that no title or ownership to the Software is transferred to
you under this Agreement.
4. Software Modification
You are allowed to modify or adapt the Software for use in accordance with the specifications of the license you
purchased, except to the extent expressly permitted by applicable law. You may not distribute the modified versions of
the Software. If the Software is modified, Tecorama is not obligated to, provide updates or support for the Software.
Tecorama will not provide any technical support for altered versions of the Software.
5. Support and Updates
Tecorama may, but is not obligated to, provide updates or support for the Software. If support is provided, it will be
subject to Tecoramas support policies in effect at the time. This Agreement does not entitle you to any future updates
or upgrades to the Software unless such updates are expressly provided with the license purchased.
6. Resale
You are not allowed to resell, lease, sub-license, or otherwise transfer rights to the Software without obtaining
prior written permission from Tecorama.
7. Warranty Disclaimer
The Software is provided "AS IS" without any warranty of any kind, express or implied, including but not limited to the
implied warranties of merchantability, fitness for a particular purpose, and non-infringement. Tecorama does not warrant
that the Software will be uninterrupted or error-free, that defects will be corrected, or that the Software is free of
viruses or other harmful components.
You agree to use the Software in compliance with all applicable data privacy and security laws and regulations. Tecorama
makes no representation regarding the Software's compliance with any specific data protection or privacy laws, and you
are solely responsible for ensuring that your use of the Software complies with such laws.
8. Compliance with Laws
You agree to comply with all applicable local, state, national, and international laws and regulations in connection
with your use of the Software.
9. Anonymous Statistics
The Software gathers general settings for the purpose of statistical analysis and improvement. This data includes
aggregated, non-personal information such as the selected skin, language, country, version of Roundcube, PHP,
xFramework, server operating system name, active plugins. Additionally, the software gathers hashed identifiers,
including the Roundcube user ID and username. No personal or identifiable information is stored. This process is
seamless, does not affect performance, and remains fully anonymous. For more information, please refer to our Privacy
Policy.
10. Indemnification
You agree to indemnify, defend, and hold harmless Tecorama and its officers, directors, employees, and agents from and
against any claims, damages, losses, liabilities, costs, and expenses (including reasonable attorneys' fees) arising out
of or related to your use of the Software, any violation of this Agreement, or any violation of applicable laws or
regulations.
11. Termination
You may terminate the Agreement at any time by uninstalling and discontinuing the usage of the Software.
Tecorama may terminate the Agreement at any time if you are in breach of any of the terms and conditions of this
Agreement. Upon termination, you must immediately uninstall and discontinue all use of the Software. The Agreement will
also automatically terminate at the end of the one (1) year license period unless you renew your license for an
additional term.
12. Governing Law
This Agreement shall be governed, construed, and enforced in accordance with the laws of the State of Florida, U.S.A.,
without regard to its conflict of law principles. You agree that any legal action or proceeding arising under this
Agreement shall be brought exclusively in the courts located in Florida, and you consent to the jurisdiction of such
courts.

122
plugins/xframework/README Normal file

@ -0,0 +1,122 @@
ROUNDCUBE PLUS FRAMEWORK PLUGIN
===============================
This plugin provides a common framework for all the Roundcube Plus plugins.
REQUIREMENTS
------------
- Roundcube: 1.5, 1.6
- PHP: 7.4 or higher
- PHP Extensions: bcmath (for Geo IP to country functions)
INSTALLATION
------------
This plugin does not need to be installed. It simply needs to be present in the <roundcube>/plugins directory.
Don't add this plugin to the plugins array in the Roundcube config file.
COMPATIBILITY
-------------
This plugin has been created for the standard version of Roundcube as provided on the Roundcube website:
https://roundcube.net. It might not work properly with customized versions of Roundcube including the version
provided as part of the Kolab system. Please note that we cannot provide any technical support for the plugin
deployed on a non-standard version of Roundcube.
CONFIGURATION
-------------
This plugin does not have its own configuration file. But it offers some configuration options that can be added to
the main Roundcube config file: <roundcube>/config/config.inc.php.
**** LICENSE KEY (REQUIRED)
This option is required for the plugins and skins to function. The license key can be obtained from the customer area
of the website where you purchased the skins or plugins. Add the license key to the config file this way:
$config['license_key'] = 'your_license_key';
**** SHOW/HIDE SIDEBAR
Some Roundcube Plus plugins (for example, xcalendar, xlast_login, xnews_feed) add content to the sidebar that appears on
the left side of the screen. The sidebar will be visible by default; if you want to change this behavior and hide the
sidebar to begin with, add this to the config file:
$config['xsidebar_visible'] = false;
**** COLLAPSE/EXPAND SIDEBAR ITEMS
By default, all the items in the sidebar are expanded. If you want to change this default and collapse some items
to begin with, use this config option:
$config['xsidebar_collapsed'] = array('xcalendar', 'xquote');
In the example above, the items added by the calendar and the quote plugins will be collapsed while all the other items
will be expanded.
**** REORDER SIDEBAR
The items are added to the sidebar following the order in which the plugins are added to the plugins array. If you want
to change the default order of the sidebar items, change the order of the plugins in the plugins array.
**** ADD TO APPS MENU
Using this setting you can add your own, personalized items to the Apps menu. The items should be in the format:
url => array(title, image)
For example:
$config['add_to_apps_menu'] = array(
"?_task=your_plugin" => array("title" => "Your plugin", "image" => "http://path_to_image.png"),
);
**** REMOVE FROM APPS MENU
Using this setting you can remove items from the Apps menu. Reference the items by their url, for example:
$config['remove_from_apps_menu'] = array(
'?_task=settings&_action=preferences&_section=xcalendar',
);
**** DISABLE APPS MENU
If you'd like to remove the Apps button from the Roundcube header menu, use this setting:
$config['disable_apps_menu'] = true;
**** REMOVE VENDOR BRANDING
If you'd like to remove the Roundcube Plus branding from the login screen, add this to the config file:
$config['remove_vendor_branding'] = true;
**** CHANGE $_SERVER['REMOTE_ADDR']
If the user IP on your server is not stored under $_SERVER['REMOTE_ADDR'], you can use this setting to tell the
xframework plugin which $_SERVER variable to retrieve it from. For example:
$config['remote_addr_key'] = 'HTTP_CLIENT_IP';
In this case, the plugin will retrieve the user IP from $_SERVER['HTTP_CLIENT_IP'].
The user IP is used by some plugins that rely on xframework, for example xlast_login.
**** OVERWRITE ROUNDCUBE URL
The Roundcube Plus plugins use the variables from the $_SERVER array to construct the URL through which Roundcube can be
accessed. In some cases, the $_SERVER variables don't provide the right values and the constructed URL is incorrect.
If this is true in your case, you can bypass the xframework functions that construct the URL from the $_SERVER variables
and specify the Roundcube URL directly using this setting:
$config['overwrite_roundcube_url'] = "https://my-roundcube-is-here.com";
ATTRIBUTION
-----------
This product includes GeoLite2 data created by MaxMind, available from http://www.maxmind.com.
LICENSE
-------
This plugin is distributed under a commercial license. In order to use the plugin, you must purchase the license
from Tecorama LLC. See the LICENSE file for details.
COPYRIGHT
---------
Copyright (c) 2024, Tecorama LLC

@ -0,0 +1 @@
2.0.3 (2024-11-08)

@ -0,0 +1,26 @@
{
"name": "xcalendar",
"version": "1.0.0",
"authors": [
"chris <nomail@nomail.com>"
],
"license": "Commercial",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"angular": "~1.8",
"angular-animate": "~1.8",
"angular-jquery-timepicker": "~0.13",
"angular-minicolors": "~0.0.11",
"jquery-form": "~3.46.0",
"ngclipboard": "^1.1.1",
"moment": "~2.29",
"howler.js": "howler#^2.0.2",
"js-cookie": "~2.2"
}
}

@ -0,0 +1,20 @@
{
"name": "angular-animate",
"version": "1.8.2",
"license": "MIT",
"main": "./angular-animate.js",
"ignore": [],
"dependencies": {
"angular": "1.8.2"
},
"homepage": "https://github.com/angular/bower-angular-animate",
"_release": "1.8.2",
"_resolution": {
"type": "version",
"tag": "v1.8.2",
"commit": "9ad6bb07b8f364654552afe7cfd028efc4fce30d"
},
"_source": "https://github.com/angular/bower-angular-animate.git",
"_target": "~1.8",
"_originalSource": "angular-animate"
}

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2016 Angular
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

@ -0,0 +1,68 @@
# packaged angular-animate
This repo is for distribution on `npm` and `bower`. The source for this module is in the
[main AngularJS repo](https://github.com/angular/angular.js/tree/master/src/ngAnimate).
Please file issues and pull requests against that repo.
## Install
You can install this package either with `npm` or with `bower`.
### npm
```shell
npm install angular-animate
```
Then add `ngAnimate` as a dependency for your app:
```javascript
angular.module('myApp', [require('angular-animate')]);
```
### bower
```shell
bower install angular-animate
```
Then add a `<script>` to your `index.html`:
```html
<script src="/bower_components/angular-animate/angular-animate.js"></script>
```
Then add `ngAnimate` as a dependency for your app:
```javascript
angular.module('myApp', ['ngAnimate']);
```
## Documentation
Documentation is available on the
[AngularJS docs site](http://docs.angularjs.org/api/ngAnimate).
## License
The MIT License
Copyright (c) 2010-2015 Google, Inc. http://angularjs.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

@ -0,0 +1,59 @@
/*
AngularJS v1.8.2
(c) 2010-2020 Google LLC. http://angularjs.org
License: MIT
*/
(function(Y,z){'use strict';function Fa(a,b,c){if(!a)throw Pa("areq",b||"?",c||"required");return a}function Ga(a,b){if(!a&&!b)return"";if(!a)return b;if(!b)return a;Z(a)&&(a=a.join(" "));Z(b)&&(b=b.join(" "));return a+" "+b}function Qa(a){var b={};a&&(a.to||a.from)&&(b.to=a.to,b.from=a.from);return b}function $(a,b,c){var d="";a=Z(a)?a:a&&G(a)&&a.length?a.split(/\s+/):[];s(a,function(a,k){a&&0<a.length&&(d+=0<k?" ":"",d+=c?b+a:a+b)});return d}function Ha(a){if(a instanceof A)switch(a.length){case 0:return a;
case 1:if(1===a[0].nodeType)return a;break;default:return A(va(a))}if(1===a.nodeType)return A(a)}function va(a){if(!a[0])return a;for(var b=0;b<a.length;b++){var c=a[b];if(1===c.nodeType)return c}}function Ra(a,b,c){s(b,function(b){a.addClass(b,c)})}function Sa(a,b,c){s(b,function(b){a.removeClass(b,c)})}function aa(a){return function(b,c){c.addClass&&(Ra(a,b,c.addClass),c.addClass=null);c.removeClass&&(Sa(a,b,c.removeClass),c.removeClass=null)}}function pa(a){a=a||{};if(!a.$$prepared){var b=a.domOperation||
N;a.domOperation=function(){a.$$domOperationFired=!0;b();b=N};a.$$prepared=!0}return a}function ha(a,b){Ia(a,b);Ja(a,b)}function Ia(a,b){b.from&&(a.css(b.from),b.from=null)}function Ja(a,b){b.to&&(a.css(b.to),b.to=null)}function T(a,b,c){var d=b.options||{};c=c.options||{};var f=(d.addClass||"")+" "+(c.addClass||""),k=(d.removeClass||"")+" "+(c.removeClass||"");a=Ta(a.attr("class"),f,k);c.preparationClasses&&(d.preparationClasses=ba(c.preparationClasses,d.preparationClasses),delete c.preparationClasses);
f=d.domOperation!==N?d.domOperation:null;wa(d,c);f&&(d.domOperation=f);d.addClass=a.addClass?a.addClass:null;d.removeClass=a.removeClass?a.removeClass:null;b.addClass=d.addClass;b.removeClass=d.removeClass;return d}function Ta(a,b,c){function d(a){G(a)&&(a=a.split(" "));var c={};s(a,function(a){a.length&&(c[a]=!0)});return c}var f={};a=d(a);b=d(b);s(b,function(a,c){f[c]=1});c=d(c);s(c,function(a,c){f[c]=1===f[c]?null:-1});var k={addClass:"",removeClass:""};s(f,function(c,b){var d,f;1===c?(d="addClass",
f=!a[b]||a[b+"-remove"]):-1===c&&(d="removeClass",f=a[b]||a[b+"-add"]);f&&(k[d].length&&(k[d]+=" "),k[d]+=b)});return k}function K(a){return a instanceof A?a[0]:a}function Ua(a,b,c,d){a="";c&&(a=$(c,"ng-",!0));d.addClass&&(a=ba(a,$(d.addClass,"-add")));d.removeClass&&(a=ba(a,$(d.removeClass,"-remove")));a.length&&(d.preparationClasses=a,b.addClass(a))}function xa(a,b){var c=b?"paused":"",d=ca+"PlayState";ma(a,[d,c]);return[d,c]}function ma(a,b){a.style[b[0]]=b[1]}function ba(a,b){return a?b?a+" "+
b:a:b}function Ka(a,b,c){var d=Object.create(null),f=a.getComputedStyle(b)||{};s(c,function(a,c){var b=f[a];if(b){var L=b.charAt(0);if("-"===L||"+"===L||0<=L)b=Va(b);0===b&&(b=null);d[c]=b}});return d}function Va(a){var b=0;a=a.split(/\s*,\s*/);s(a,function(a){"s"===a.charAt(a.length-1)&&(a=a.substring(0,a.length-1));a=parseFloat(a)||0;b=b?Math.max(a,b):a});return b}function ya(a){return 0===a||null!=a}function La(a,b){var c=M,d=a+"s";b?c+="Duration":d+=" linear all";return[c,d]}function Ma(a,b,c){s(c,
function(c){a[c]=za(a[c])?a[c]:b.style.getPropertyValue(c)})}var M,Aa,ca,Ba;void 0===Y.ontransitionend&&void 0!==Y.onwebkittransitionend?(M="WebkitTransition",Aa="webkitTransitionEnd transitionend"):(M="transition",Aa="transitionend");void 0===Y.onanimationend&&void 0!==Y.onwebkitanimationend?(ca="WebkitAnimation",Ba="webkitAnimationEnd animationend"):(ca="animation",Ba="animationend");var qa=ca+"Delay",Ca=ca+"Duration",na=M+"Delay",Na=M+"Duration",Pa=z.$$minErr("ng"),ra={blockTransitions:function(a,
b){var c=b?"-"+b+"s":"";ma(a,[na,c]);return[na,c]}},Wa={transitionDuration:Na,transitionDelay:na,transitionProperty:M+"Property",animationDuration:Ca,animationDelay:qa,animationIterationCount:ca+"IterationCount"},Xa={transitionDuration:Na,transitionDelay:na,animationDuration:Ca,animationDelay:qa},Da,wa,s,Z,za,sa,Ea,ta,G,R,A,N;z.module("ngAnimate",[],function(){N=z.noop;Da=z.copy;wa=z.extend;A=z.element;s=z.forEach;Z=z.isArray;G=z.isString;ta=z.isObject;R=z.isUndefined;za=z.isDefined;Ea=z.isFunction;
sa=z.isElement}).info({angularVersion:"1.8.2"}).directive("ngAnimateSwap",["$animate",function(a){return{restrict:"A",transclude:"element",terminal:!0,priority:550,link:function(b,c,d,f,k){var e,Q;b.$watchCollection(d.ngAnimateSwap||d["for"],function(b){e&&a.leave(e);Q&&(Q.$destroy(),Q=null);(b||0===b)&&k(function(b,d){e=b;Q=d;a.enter(b,null,c)})})}}}]).directive("ngAnimateChildren",["$interpolate",function(a){return{link:function(b,c,d){function f(a){c.data("$$ngAnimateChildren","on"===a||"true"===
a)}var k=d.ngAnimateChildren;G(k)&&0===k.length?c.data("$$ngAnimateChildren",!0):(f(a(k)(b)),d.$observe("ngAnimateChildren",f))}}}]).factory("$$rAFScheduler",["$$rAF",function(a){function b(a){d=d.concat(a);c()}function c(){if(d.length){for(var b=d.shift(),e=0;e<b.length;e++)b[e]();f||a(function(){f||c()})}}var d,f;d=b.queue=[];b.waitUntilQuiet=function(b){f&&f();f=a(function(){f=null;b();c()})};return b}]).provider("$$animateQueue",["$animateProvider",function(a){function b(a){return{addClass:a.addClass,
removeClass:a.removeClass,from:a.from,to:a.to}}function c(a){if(!a)return null;a=a.split(" ");var b=Object.create(null);s(a,function(a){b[a]=!0});return b}function d(a,b){if(a&&b){var d=c(b);return a.split(" ").some(function(a){return d[a]})}}function f(a,b,c){return e[a].some(function(a){return a(b,c)})}function k(a,b){var c=0<(a.addClass||"").length,d=0<(a.removeClass||"").length;return b?c&&d:c||d}var e=this.rules={skip:[],cancel:[],join:[]};e.join.push(function(a,b){return!a.structural&&k(a)});
e.skip.push(function(a,b){return!a.structural&&!k(a)});e.skip.push(function(a,b){return"leave"===b.event&&a.structural});e.skip.push(function(a,b){return b.structural&&2===b.state&&!a.structural});e.cancel.push(function(a,b){return b.structural&&a.structural});e.cancel.push(function(a,b){return 2===b.state&&a.structural});e.cancel.push(function(a,b){if(b.structural)return!1;var c=a.addClass,f=a.removeClass,k=b.addClass,e=b.removeClass;return R(c)&&R(f)||R(k)&&R(e)?!1:d(c,e)||d(f,k)});this.$get=["$$rAF",
"$rootScope","$rootElement","$document","$$Map","$$animation","$$AnimateRunner","$templateRequest","$$jqLite","$$forceReflow","$$isDocumentHidden",function(c,d,e,C,U,oa,H,u,t,I,da){function ia(a){O.delete(a.target)}function v(){var a=!1;return function(b){a?b():d.$$postDigest(function(){a=!0;b()})}}function ua(a,b,c){var g=[],l=m[c];l&&s(l,function(l){Oa.call(l.node,b)?g.push(l.callback):"leave"===c&&Oa.call(l.node,a)&&g.push(l.callback)});return g}function h(a,b,c){var l=va(b);return a.filter(function(a){return!(a.node===
l&&(!c||a.callback===c))})}function q(a,J,w){function e(a,b,l,g){u(function(){var a=ua(ia,m,b);a.length?c(function(){s(a,function(a){a(h,l,g)});"close"!==l||m.parentNode||D.off(m)}):"close"!==l||m.parentNode||D.off(m)});a.progress(b,l,g)}function I(a){var b=h,c=n;c.preparationClasses&&(b.removeClass(c.preparationClasses),c.preparationClasses=null);c.activeClasses&&(b.removeClass(c.activeClasses),c.activeClasses=null);W(h,n);ha(h,n);n.domOperation();q.complete(!a)}var n=Da(w),h=Ha(a),m=K(h),ia=m&&
m.parentNode,n=pa(n),q=new H,u=v();Z(n.addClass)&&(n.addClass=n.addClass.join(" "));n.addClass&&!G(n.addClass)&&(n.addClass=null);Z(n.removeClass)&&(n.removeClass=n.removeClass.join(" "));n.removeClass&&!G(n.removeClass)&&(n.removeClass=null);n.from&&!ta(n.from)&&(n.from=null);n.to&&!ta(n.to)&&(n.to=null);if(!(B&&m&&fa(m,J,w)&&Ya(m,n)))return I(),q;var x=0<=["enter","move","leave"].indexOf(J),r=da(),P=r||O.get(m);w=!P&&y.get(m)||{};var p=!!w.state;P||p&&1===w.state||(P=!E(m,ia,J));if(P)return r&&
e(q,J,"start",b(n)),I(),r&&e(q,J,"close",b(n)),q;x&&F(m);r={structural:x,element:h,event:J,addClass:n.addClass,removeClass:n.removeClass,close:I,options:n,runner:q};if(p){if(f("skip",r,w)){if(2===w.state)return I(),q;T(h,w,r);return w.runner}if(f("cancel",r,w))if(2===w.state)w.runner.end();else if(w.structural)w.close();else return T(h,w,r),w.runner;else if(f("join",r,w))if(2===w.state)T(h,r,{});else return Ua(t,h,x?J:null,n),J=r.event=w.event,n=T(h,w,r),w.runner}else T(h,r,{});(p=r.structural)||
(p="animate"===r.event&&0<Object.keys(r.options.to||{}).length||k(r));if(!p)return I(),g(m),q;var C=(w.counter||0)+1;r.counter=C;l(m,1,r);d.$$postDigest(function(){h=Ha(a);var c=y.get(m),d=!c,c=c||{},t=0<(h.parent()||[]).length&&("animate"===c.event||c.structural||k(c));if(d||c.counter!==C||!t){d&&(W(h,n),ha(h,n));if(d||x&&c.event!==J)n.domOperation(),q.end();t||g(m)}else J=!c.structural&&k(c,!0)?"setClass":c.event,l(m,2),c=oa(h,J,c.options),q.setHost(c),e(q,J,"start",b(n)),c.done(function(a){I(!a);
(a=y.get(m))&&a.counter===C&&g(m);e(q,J,"close",b(n))})});return q}function F(a){a=a.querySelectorAll("[data-ng-animate]");s(a,function(a){var b=parseInt(a.getAttribute("data-ng-animate"),10),c=y.get(a);if(c)switch(b){case 2:c.runner.end();case 1:y.delete(a)}})}function g(a){a.removeAttribute("data-ng-animate");y.delete(a)}function E(a,b,c){c=C[0].body;var l=K(e),g=a===c||"HTML"===a.nodeName,d=a===l,t=!1,m=O.get(a),h;for((a=A.data(a,"$ngAnimatePin"))&&(b=K(a));b;){d||(d=b===l);if(1!==b.nodeType)break;
a=y.get(b)||{};if(!t){var f=O.get(b);if(!0===f&&!1!==m){m=!0;break}else!1===f&&(m=!1);t=a.structural}if(R(h)||!0===h)a=A.data(b,"$$ngAnimateChildren"),za(a)&&(h=a);if(t&&!1===h)break;g||(g=b===c);if(g&&d)break;if(!d&&(a=A.data(b,"$ngAnimatePin"))){b=K(a);continue}b=b.parentNode}return(!t||h)&&!0!==m&&d&&g}function l(a,b,c){c=c||{};c.state=b;a.setAttribute("data-ng-animate",b);c=(b=y.get(a))?wa(b,c):c;y.set(a,c)}var y=new U,O=new U,B=null,P=d.$watch(function(){return 0===u.totalPendingRequests},function(a){a&&
(P(),d.$$postDigest(function(){d.$$postDigest(function(){null===B&&(B=!0)})}))}),m=Object.create(null);U=a.customFilter();var la=a.classNameFilter();I=function(){return!0};var fa=U||I,Ya=la?function(a,b){var c=[a.getAttribute("class"),b.addClass,b.removeClass].join(" ");return la.test(c)}:I,W=aa(t),Oa=Y.Node.prototype.contains||function(a){return this===a||!!(this.compareDocumentPosition(a)&16)},D={on:function(a,b,c){var l=va(b);m[a]=m[a]||[];m[a].push({node:l,callback:c});A(b).on("$destroy",function(){y.get(l)||
D.off(a,b,c)})},off:function(a,b,c){if(1!==arguments.length||G(arguments[0])){var l=m[a];l&&(m[a]=1===arguments.length?null:h(l,b,c))}else for(l in b=arguments[0],m)m[l]=h(m[l],b)},pin:function(a,b){Fa(sa(a),"element","not an element");Fa(sa(b),"parentElement","not an element");a.data("$ngAnimatePin",b)},push:function(a,b,c,l){c=c||{};c.domOperation=l;return q(a,b,c)},enabled:function(a,b){var c=arguments.length;if(0===c)b=!!B;else if(sa(a)){var l=K(a);if(1===c)b=!O.get(l);else{if(!O.has(l))A(a).on("$destroy",
ia);O.set(l,!b)}}else b=B=!!a;return b}};return D}]}]).provider("$$animateCache",function(){var a=0,b=Object.create(null);this.$get=[function(){return{cacheKey:function(b,d,f,k){var e=b.parentNode;b=[e.$$ngAnimateParentKey||(e.$$ngAnimateParentKey=++a),d,b.getAttribute("class")];f&&b.push(f);k&&b.push(k);return b.join(" ")},containsCachedAnimationWithoutDuration:function(a){return(a=b[a])&&!a.isValid||!1},flush:function(){b=Object.create(null)},count:function(a){return(a=b[a])?a.total:0},get:function(a){return(a=
b[a])&&a.value},put:function(a,d,f){b[a]?(b[a].total++,b[a].value=d):b[a]={total:1,value:d,isValid:f}}}}]}).provider("$$animation",["$animateProvider",function(a){var b=this.drivers=[];this.$get=["$$jqLite","$rootScope","$injector","$$AnimateRunner","$$Map","$$rAFScheduler","$$animateCache",function(a,d,f,k,e,Q,L){function x(a){function b(a){if(a.processed)return a;a.processed=!0;var d=a.domNode,t=d.parentNode;f.set(d,a);for(var h;t;){if(h=f.get(t)){h.processed||(h=b(h));break}t=t.parentNode}(h||
c).children.push(a);return a}var c={children:[]},d,f=new e;for(d=0;d<a.length;d++){var da=a[d];f.set(da.domNode,a[d]={domNode:da.domNode,element:da.element,fn:da.fn,children:[]})}for(d=0;d<a.length;d++)b(a[d]);return function(a){var b=[],c=[],d;for(d=0;d<a.children.length;d++)c.push(a.children[d]);a=c.length;var t=0,f=[];for(d=0;d<c.length;d++){var g=c[d];0>=a&&(a=t,t=0,b.push(f),f=[]);f.push(g);g.children.forEach(function(a){t++;c.push(a)});a--}f.length&&b.push(f);return b}(c)}var C=[],U=aa(a);return function(e,
H,u){function t(a){a=a.hasAttribute("ng-animate-ref")?[a]:a.querySelectorAll("[ng-animate-ref]");var b=[];s(a,function(a){var c=a.getAttribute("ng-animate-ref");c&&c.length&&b.push(a)});return b}function I(a){var b=[],c={};s(a,function(a,d){var l=K(a.element),g=0<=["enter","move"].indexOf(a.event),l=a.structural?t(l):[];if(l.length){var f=g?"to":"from";s(l,function(a){var b=a.getAttribute("ng-animate-ref");c[b]=c[b]||{};c[b][f]={animationID:d,element:A(a)}})}else b.push(a)});var d={},g={};s(c,function(c,
t){var f=c.from,e=c.to;if(f&&e){var h=a[f.animationID],k=a[e.animationID],E=f.animationID.toString();if(!g[E]){var I=g[E]={structural:!0,beforeStart:function(){h.beforeStart();k.beforeStart()},close:function(){h.close();k.close()},classes:da(h.classes,k.classes),from:h,to:k,anchors:[]};I.classes.length?b.push(I):(b.push(h),b.push(k))}g[E].anchors.push({out:f.element,"in":e.element})}else f=f?f.animationID:e.animationID,e=f.toString(),d[e]||(d[e]=!0,b.push(a[f]))});return b}function da(a,b){a=a.split(" ");
b=b.split(" ");for(var c=[],d=0;d<a.length;d++){var g=a[d];if("ng-"!==g.substring(0,3))for(var t=0;t<b.length;t++)if(g===b[t]){c.push(g);break}}return c.join(" ")}function ia(a){for(var c=b.length-1;0<=c;c--){var d=f.get(b[c])(a);if(d)return d}}function v(a,b){function c(a){(a=a.data("$$animationRunner"))&&a.setHost(b)}a.from&&a.to?(c(a.from.element),c(a.to.element)):c(a.element)}function ua(){var a=e.data("$$animationRunner");!a||"leave"===H&&u.$$domOperationFired||a.end()}function h(b){e.off("$destroy",
ua);e.removeData("$$animationRunner");U(e,u);ha(e,u);u.domOperation();E&&a.removeClass(e,E);F.complete(!b)}u=pa(u);var q=0<=["enter","move","leave"].indexOf(H),F=new k({end:function(){h()},cancel:function(){h(!0)}});if(!b.length)return h(),F;var g=Ga(e.attr("class"),Ga(u.addClass,u.removeClass)),E=u.tempClasses;E&&(g+=" "+E,u.tempClasses=null);q&&e.data("$$animatePrepareClasses","ng-"+H+"-prepare");e.data("$$animationRunner",F);C.push({element:e,classes:g,event:H,structural:q,options:u,beforeStart:function(){E=
(E?E+" ":"")+"ng-animate";a.addClass(e,E);var b=e.data("$$animatePrepareClasses");b&&a.removeClass(e,b)},close:h});e.on("$destroy",ua);if(1<C.length)return F;d.$$postDigest(function(){var b=[];s(C,function(a){a.element.data("$$animationRunner")?b.push(a):a.close()});C.length=0;var d=I(b),g=[];s(d,function(a){var b=a.from?a.from.element:a.element,c=u.addClass,d=L.cacheKey(b[0],a.event,(c?c+" ":"")+"ng-animate",u.removeClass);g.push({element:b,domNode:K(b),fn:function(){var b,c=a.close;if(L.containsCachedAnimationWithoutDuration(d))c();
else{a.beforeStart();if((a.anchors?a.from.element||a.to.element:a.element).data("$$animationRunner")){var g=ia(a);g&&(b=g.start)}b?(b=b(),b.done(function(a){c(!a)}),v(a,b)):c()}}})});for(var d=x(g),t=0;t<d.length;t++)for(var f=d[t],e=0;e<f.length;e++){var h=f[e],k=h.element;d[t][e]=h.fn;0===t?k.removeData("$$animatePrepareClasses"):(h=k.data("$$animatePrepareClasses"))&&a.addClass(k,h)}Q(d)});return F}}]}]).provider("$animateCss",["$animateProvider",function(a){this.$get=["$window","$$jqLite","$$AnimateRunner",
"$timeout","$$animateCache","$$forceReflow","$sniffer","$$rAFScheduler","$$animateQueue",function(a,c,d,f,k,e,Q,L,x){function C(d,f,e,x){var v,s="stagger-"+e;0<k.count(e)&&(v=k.get(s),v||(f=$(f,"-stagger"),c.addClass(d,f),v=Ka(a,d,x),v.animationDuration=Math.max(v.animationDuration,0),v.transitionDuration=Math.max(v.transitionDuration,0),c.removeClass(d,f),k.put(s,v,!0)));return v||{}}function U(a){u.push(a);L.waitUntilQuiet(function(){k.flush();for(var a=e(),b=0;b<u.length;b++)u[b](a);u.length=0})}
function z(c,d,f,e){d=k.get(f);d||(d=Ka(a,c,Wa),"infinite"===d.animationIterationCount&&(d.animationIterationCount=1));k.put(f,d,e||0<d.transitionDuration||0<d.animationDuration);c=d;f=c.animationDelay;e=c.transitionDelay;c.maxDelay=f&&e?Math.max(f,e):f||e;c.maxDuration=Math.max(c.animationDuration*c.animationIterationCount,c.transitionDuration);return c}var H=aa(c),u=[];return function(a,b){function e(){v()}function L(){v(!0)}function v(b){if(!(P||la&&m)){P=!0;m=!1;V&&!g.$$skipPreparationClasses&&
c.removeClass(a,V);ba&&c.removeClass(a,ba);xa(l,!1);ra.blockTransitions(l,!1);s(y,function(a){l.style[a[0]]=""});H(a,g);ha(a,g);Object.keys(E).length&&s(E,function(a,b){a?l.style.setProperty(b,a):l.style.removeProperty(b)});if(g.onDone)g.onDone();w&&w.length&&a.off(w.join(" "),q);var d=a.data("$$animateCss");d&&(f.cancel(d[0].timer),a.removeData("$$animateCss"));fa&&fa.complete(!b)}}function u(a){p.blockTransition&&ra.blockTransitions(l,a);p.blockKeyframeAnimation&&xa(l,!!a)}function h(){fa=new d({end:e,
cancel:L});U(N);v();return{$$willAnimate:!1,start:function(){return fa},end:e}}function q(a){a.stopPropagation();var b=a.originalEvent||a;b.target===l&&(a=b.$manualTimeStamp||Date.now(),b=parseFloat(b.elapsedTime.toFixed(3)),Math.max(a-J,0)>=G&&b>=D&&(la=!0,v()))}function F(){function b(){if(!P){u(!1);s(y,function(a){l.style[a[0]]=a[1]});H(a,g);c.addClass(a,ba);if(p.recalculateTimingStyles){T=l.getAttribute("class")+" "+V;ka=k.cacheKey(l,ja,g.addClass,g.removeClass);r=z(l,T,ka,!1);ga=r.maxDelay;W=
Math.max(ga,0);D=r.maxDuration;if(0===D){v();return}p.hasTransitions=0<r.transitionDuration;p.hasAnimations=0<r.animationDuration}p.applyAnimationDelay&&(ga="boolean"!==typeof g.delay&&ya(g.delay)?parseFloat(g.delay):ga,W=Math.max(ga,0),r.animationDelay=ga,ea=[qa,ga+"s"],y.push(ea),l.style[ea[0]]=ea[1]);G=1E3*W;R=1E3*D;if(g.easing){var e,h=g.easing;p.hasTransitions&&(e=M+"TimingFunction",y.push([e,h]),l.style[e]=h);p.hasAnimations&&(e=ca+"TimingFunction",y.push([e,h]),l.style[e]=h)}r.transitionDuration&&
w.push(Aa);r.animationDuration&&w.push(Ba);J=Date.now();var m=G+1.5*R;e=J+m;var h=a.data("$$animateCss")||[],F=!0;if(h.length){var n=h[0];(F=e>n.expectedEndTime)?f.cancel(n.timer):h.push(v)}F&&(m=f(d,m,!1),h[0]={timer:m,expectedEndTime:e},h.push(v),a.data("$$animateCss",h));if(w.length)a.on(w.join(" "),q);g.to&&(g.cleanupStyles&&Ma(E,l,Object.keys(g.to)),Ja(a,g))}}function d(){var b=a.data("$$animateCss");if(b){for(var c=1;c<b.length;c++)b[c]();a.removeData("$$animateCss")}}if(!P)if(l.parentNode){var e=
function(a){if(la)m&&a&&(m=!1,v());else if(m=!a,r.animationDuration)if(a=xa(l,m),m)y.push(a);else{var b=y,c=b.indexOf(a);0<=a&&b.splice(c,1)}},h=0<aa&&(r.transitionDuration&&0===X.transitionDuration||r.animationDuration&&0===X.animationDuration)&&Math.max(X.animationDelay,X.transitionDelay);h?f(b,Math.floor(h*aa*1E3),!1):b();A.resume=function(){e(!0)};A.pause=function(){e(!1)}}else v()}var g=b||{};g.$$prepared||(g=pa(Da(g)));var E={},l=K(a);if(!l||!l.parentNode||!x.enabled())return h();var y=[],O=
a.attr("class"),B=Qa(g),P,m,la,fa,A,W,G,D,R,J,w=[];if(0===g.duration||!Q.animations&&!Q.transitions)return h();var ja=g.event&&Z(g.event)?g.event.join(" "):g.event,Y=ja&&g.structural,n="",S="";Y?n=$(ja,"ng-",!0):ja&&(n=ja);g.addClass&&(S+=$(g.addClass,"-add"));g.removeClass&&(S.length&&(S+=" "),S+=$(g.removeClass,"-remove"));g.applyClassesEarly&&S.length&&H(a,g);var V=[n,S].join(" ").trim(),T=O+" "+V,O=B.to&&0<Object.keys(B.to).length;if(!(0<(g.keyframeStyle||"").length||O||V))return h();var X,ka=
k.cacheKey(l,ja,g.addClass,g.removeClass);if(k.containsCachedAnimationWithoutDuration(ka))return V=null,h();0<g.stagger?(B=parseFloat(g.stagger),X={transitionDelay:B,animationDelay:B,transitionDuration:0,animationDuration:0}):X=C(l,V,ka,Xa);g.$$skipPreparationClasses||c.addClass(a,V);g.transitionStyle&&(B=[M,g.transitionStyle],ma(l,B),y.push(B));0<=g.duration&&(B=0<l.style[M].length,B=La(g.duration,B),ma(l,B),y.push(B));g.keyframeStyle&&(B=[ca,g.keyframeStyle],ma(l,B),y.push(B));var aa=X?0<=g.staggerIndex?
g.staggerIndex:k.count(ka):0;(n=0===aa)&&!g.skipBlocking&&ra.blockTransitions(l,9999);var r=z(l,T,ka,!Y),ga=r.maxDelay;W=Math.max(ga,0);D=r.maxDuration;var p={};p.hasTransitions=0<r.transitionDuration;p.hasAnimations=0<r.animationDuration;p.hasTransitionAll=p.hasTransitions&&"all"===r.transitionProperty;p.applyTransitionDuration=O&&(p.hasTransitions&&!p.hasTransitionAll||p.hasAnimations&&!p.hasTransitions);p.applyAnimationDuration=g.duration&&p.hasAnimations;p.applyTransitionDelay=ya(g.delay)&&(p.applyTransitionDuration||
p.hasTransitions);p.applyAnimationDelay=ya(g.delay)&&p.hasAnimations;p.recalculateTimingStyles=0<S.length;if(p.applyTransitionDuration||p.applyAnimationDuration)D=g.duration?parseFloat(g.duration):D,p.applyTransitionDuration&&(p.hasTransitions=!0,r.transitionDuration=D,B=0<l.style[M+"Property"].length,y.push(La(D,B))),p.applyAnimationDuration&&(p.hasAnimations=!0,r.animationDuration=D,y.push([Ca,D+"s"]));if(0===D&&!p.recalculateTimingStyles)return h();var ba=$(V,"-active");if(null!=g.delay){var ea;
"boolean"!==typeof g.delay&&(ea=parseFloat(g.delay),W=Math.max(ea,0));p.applyTransitionDelay&&y.push([na,ea+"s"]);p.applyAnimationDelay&&y.push([qa,ea+"s"])}null==g.duration&&0<r.transitionDuration&&(p.recalculateTimingStyles=p.recalculateTimingStyles||n);G=1E3*W;R=1E3*D;g.skipBlocking||(p.blockTransition=0<r.transitionDuration,p.blockKeyframeAnimation=0<r.animationDuration&&0<X.animationDelay&&0===X.animationDuration);g.from&&(g.cleanupStyles&&Ma(E,l,Object.keys(g.from)),Ia(a,g));p.blockTransition||
p.blockKeyframeAnimation?u(D):g.skipBlocking||ra.blockTransitions(l,!1);return{$$willAnimate:!0,end:e,start:function(){if(!P)return A={end:e,cancel:L,resume:null,pause:null},fa=new d(A),U(F),fa}}}}]}]).provider("$$animateCssDriver",["$$animationProvider",function(a){a.drivers.push("$$animateCssDriver");this.$get=["$animateCss","$rootScope","$$AnimateRunner","$rootElement","$sniffer","$$jqLite","$document",function(a,c,d,f,k,e,Q){function L(a){return a.replace(/\bng-\S+\b/g,"")}function x(a,b){G(a)&&
(a=a.split(" "));G(b)&&(b=b.split(" "));return a.filter(function(a){return-1===b.indexOf(a)}).join(" ")}function C(c,e,f){function k(a){var b={},c=K(a).getBoundingClientRect();s(["width","height","top","left"],function(a){var d=c[a];switch(a){case "top":d+=H.scrollTop;break;case "left":d+=H.scrollLeft}b[a]=Math.floor(d)+"px"});return b}function v(){var c=L(f.attr("class")||""),d=x(c,q),c=x(q,c),d=a(h,{to:k(f),addClass:"ng-anchor-in "+d,removeClass:"ng-anchor-out "+c,delay:!0});return d.$$willAnimate?
d:null}function C(){h.remove();e.removeClass("ng-animate-shim");f.removeClass("ng-animate-shim")}var h=A(K(e).cloneNode(!0)),q=L(h.attr("class")||"");e.addClass("ng-animate-shim");f.addClass("ng-animate-shim");h.addClass("ng-anchor");u.append(h);var F;c=function(){var c=a(h,{addClass:"ng-anchor-out",delay:!0,from:k(e)});return c.$$willAnimate?c:null}();if(!c&&(F=v(),!F))return C();var g=c||F;return{start:function(){function a(){c&&c.end()}var b,c=g.start();c.done(function(){c=null;if(!F&&(F=v()))return c=
F.start(),c.done(function(){c=null;C();b.complete()}),c;C();b.complete()});return b=new d({end:a,cancel:a})}}}function z(a,b,c,e){var f=oa(a,N),k=oa(b,N),h=[];s(e,function(a){(a=C(c,a.out,a["in"]))&&h.push(a)});if(f||k||0!==h.length)return{start:function(){function a(){s(b,function(a){a.end()})}var b=[];f&&b.push(f.start());k&&b.push(k.start());s(h,function(a){b.push(a.start())});var c=new d({end:a,cancel:a});d.all(b,function(a){c.complete(a)});return c}}}function oa(c){var d=c.element,e=c.options||
{};c.structural&&(e.event=c.event,e.structural=!0,e.applyClassesEarly=!0,"leave"===c.event&&(e.onDone=e.domOperation));e.preparationClasses&&(e.event=ba(e.event,e.preparationClasses));c=a(d,e);return c.$$willAnimate?c:null}if(!k.animations&&!k.transitions)return N;var H=Q[0].body;c=K(f);var u=A(c.parentNode&&11===c.parentNode.nodeType||H.contains(c)?c:H);return function(a){return a.from&&a.to?z(a.from,a.to,a.classes,a.anchors):oa(a)}}]}]).provider("$$animateJs",["$animateProvider",function(a){this.$get=
["$injector","$$AnimateRunner","$$jqLite",function(b,c,d){function f(c){c=Z(c)?c:c.split(" ");for(var d=[],f={},k=0;k<c.length;k++){var s=c[k],z=a.$$registeredAnimations[s];z&&!f[s]&&(d.push(b.get(z)),f[s]=!0)}return d}var k=aa(d);return function(a,b,d,x){function C(){x.domOperation();k(a,x)}function z(a,b,d,f,e){switch(d){case "animate":b=[b,f.from,f.to,e];break;case "setClass":b=[b,t,I,e];break;case "addClass":b=[b,t,e];break;case "removeClass":b=[b,I,e];break;default:b=[b,e]}b.push(f);if(a=a.apply(a,
b))if(Ea(a.start)&&(a=a.start()),a instanceof c)a.done(e);else if(Ea(a))return a;return N}function A(a,b,d,e,f){var h=[];s(e,function(e){var l=e[f];l&&h.push(function(){var e,f,h=!1,k=function(a){h||(h=!0,(f||N)(a),e.complete(!a))};e=new c({end:function(){k()},cancel:function(){k(!0)}});f=z(l,a,b,d,function(a){k(!1===a)});return e})});return h}function H(a,b,d,e,f){var h=A(a,b,d,e,f);if(0===h.length){var k,q;"beforeSetClass"===f?(k=A(a,"removeClass",d,e,"beforeRemoveClass"),q=A(a,"addClass",d,e,"beforeAddClass")):
"setClass"===f&&(k=A(a,"removeClass",d,e,"removeClass"),q=A(a,"addClass",d,e,"addClass"));k&&(h=h.concat(k));q&&(h=h.concat(q))}if(0!==h.length)return function(a){var b=[];h.length&&s(h,function(a){b.push(a())});b.length?c.all(b,a):a();return function(a){s(b,function(b){a?b.cancel():b.end()})}}}var u=!1;3===arguments.length&&ta(d)&&(x=d,d=null);x=pa(x);d||(d=a.attr("class")||"",x.addClass&&(d+=" "+x.addClass),x.removeClass&&(d+=" "+x.removeClass));var t=x.addClass,I=x.removeClass,G=f(d),K,v;if(G.length){var M,
h;"leave"===b?(h="leave",M="afterLeave"):(h="before"+b.charAt(0).toUpperCase()+b.substr(1),M=b);"enter"!==b&&"move"!==b&&(K=H(a,b,x,G,h));v=H(a,b,x,G,M)}if(K||v){var q;return{$$willAnimate:!0,end:function(){q?q.end():(u=!0,C(),ha(a,x),q=new c,q.complete(!0));return q},start:function(){function b(c){u=!0;C();ha(a,x);q.complete(c)}if(q)return q;q=new c;var d,f=[];K&&f.push(function(a){d=K(a)});f.length?f.push(function(a){C();a(!0)}):C();v&&f.push(function(a){d=v(a)});q.setHost({end:function(){u||((d||
N)(void 0),b(void 0))},cancel:function(){u||((d||N)(!0),b(!0))}});c.chain(f,b);return q}}}}}]}]).provider("$$animateJsDriver",["$$animationProvider",function(a){a.drivers.push("$$animateJsDriver");this.$get=["$$animateJs","$$AnimateRunner",function(a,c){function d(c){return a(c.element,c.event,c.classes,c.options)}return function(a){if(a.from&&a.to){var b=d(a.from),e=d(a.to);if(b||e)return{start:function(){function a(){return function(){s(d,function(a){a.end()})}}var d=[];b&&d.push(b.start());e&&
d.push(e.start());c.all(d,function(a){f.complete(a)});var f=new c({end:a(),cancel:a()});return f}}}else return d(a)}}]}])})(window,window.angular);
//# sourceMappingURL=angular-animate.min.js.map

@ -0,0 +1,10 @@
{
"name": "angular-animate",
"version": "1.8.2",
"license": "MIT",
"main": "./angular-animate.js",
"ignore": [],
"dependencies": {
"angular": "1.8.2"
}
}

@ -0,0 +1,33 @@
{
"name": "angular-animate",
"version": "1.8.2",
"description": "AngularJS module for animations",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/angular/angular.js.git"
},
"keywords": [
"angular",
"framework",
"browser",
"animation",
"client-side"
],
"author": "Angular Core Team <angular-core+npm@google.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/angular/angular.js/issues"
},
"homepage": "http://angularjs.org",
"jspm": {
"shim": {
"angular-animate": {
"deps": ["angular"]
}
}
}
}

@ -0,0 +1,35 @@
{
"name": "angular-jquery-timepicker",
"version": "0.13.1",
"homepage": "https://github.com/Recras/angular-jquery-timepicker",
"description": "An AngularJS directive for jQuery Timepicker",
"main": "./src/timepickerdirective.js",
"authors": [
"https://github.com/Recras/angular-jquery-timepicker/graphs/contributors"
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"angular": ">= 1.3",
"jquery-timepicker-jt": "1.2 - 1.8"
},
"devDependencies": {
"angular-mocks": "~1.x",
"moment": "~2.9.0"
},
"_release": "0.13.1",
"_resolution": {
"type": "version",
"tag": "0.13.1",
"commit": "bd97ee88e11614e32d37c0510893a8c98ceef701"
},
"_source": "https://github.com/Recras/angular-jquery-timepicker.git",
"_target": "~0.13",
"_originalSource": "angular-jquery-timepicker"
}

@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2014 Recras
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

@ -0,0 +1,53 @@
angular-jquery-timepicker [![Build Status](https://travis-ci.org/Recras/angular-jquery-timepicker.png?branch=master)](https://travis-ci.org/Recras/angular-jquery-timepicker)
=====================
An AngularJS directive for [jquery-timepicker](https://github.com/jonthornton/jquery-timepicker)
[See a demo here](http://recras.github.io/angular-jquery-timepicker/)
# Requirements
- AngularJS
- JQuery
- [jquery-timepicker](https://github.com/jonthornton/jquery-timepicker)
# Usage
You can use Bower or NPM to install this directive.
bower install angular-jquery-timepicker
or for NPM:
npm install angular-jquery-timepicker
Add the timepicker module as a dependency to your applicatin module:
var myAppModule = angular.module('MyApp', ['ui.timepicker'])
Apply the directive to your form elements. This directive expects ng-model to be a valid javascript Date object (or null).
<input ui-timepicker ng-model="someDateObject">
You can specify a base-date that will be used to initialize the ng-model when it is null
<input ui-timepicker ng-model="someNullObject" base-date"someDateObject">
Configure timepicker at a global level. Use the 'asMoment' to use moment.js instead of Date as the ng-model. Note: moment.js timezones will be discarded.
angular.module('ui.timepicker').value('uiTimepickerConfig',{
step: 5,
asMoment: true
});
Adding custom options to timepicker.
$scope.timePickerOptions = {
step: 20,
timeFormat: 'g:ia',
appendTo: 'body'
};
<input ui-timepicker="timePickerOptions" ng-model="someDateObject">

@ -0,0 +1,26 @@
{
"name": "angular-jquery-timepicker",
"version": "0.13.1",
"homepage": "https://github.com/Recras/angular-jquery-timepicker",
"description": "An AngularJS directive for jQuery Timepicker",
"main": "./src/timepickerdirective.js",
"authors": [
"https://github.com/Recras/angular-jquery-timepicker/graphs/contributors"
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"angular": ">= 1.3",
"jquery-timepicker-jt": "1.2 - 1.8"
},
"devDependencies": {
"angular-mocks": "~1.x",
"moment": "~2.9.0"
}
}

@ -0,0 +1,48 @@
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
// Default task.
grunt.registerTask('default', ['jshint', 'uglify', 'karma']);
var testConfig = function(configFile, customOptions) {
var options = { configFile: configFile, keepalive: true };
var travisOptions = process.env.TRAVIS && { browsers: ['Firefox'], reporters: 'dots' };
return grunt.util._.extend(options, customOptions, travisOptions);
};
// Project configuration.
grunt.initConfig({
karma: {
unit: {
options: testConfig('test/test.conf.js')
}
},
jshint:{
files:['src/timepickerdirective.js', 'test/**/*.js'],
options:{
curly:true,
eqeqeq:true,
immed:true,
latedef:true,
newcap:true,
noarg:true,
sub:true,
boss:true,
eqnull:true,
globals:{}
}
},
uglify: {
dist: {
files: {
'src/timepickerdirective.min.js': ['src/timepickerdirective.js']
}
}
}
});
};

@ -0,0 +1,26 @@
{
"name": "angular-jquery-timepicker",
"version": "0.13.1",
"description": "An AngularJS directive for jQuery Timepicker",
"main": "./src/timepickerdirective.js",
"devDependencies": {
"grunt": "~0.4.2",
"grunt-contrib-jshint": "~0.8.0",
"grunt-contrib-uglify": "~0.3.3",
"grunt-karma": "~0.6.2"
},
"dependencies": {},
"scripts": {
"test": "grunt karma"
},
"repository": {
"type": "git",
"url": "git@github.com:Recras/angular-jquery-timepicker.git"
},
"author": "https://github.com/Recras/angular-jquery-timepicker/graphs/contributors",
"license": "MIT",
"bugs": {
"url": "https://github.com/Recras/angular-jquery-timepicker/issues"
},
"homepage": "https://github.com/Recras/angular-jquery-timepicker"
}

@ -0,0 +1,126 @@
/*global angular */
/*
Directive for jQuery UI timepicker (http://jonthornton.github.io/jquery-timepicker/)
*/
var m = angular.module('ui.timepicker', []);
m.value('uiTimepickerConfig', {
'step': 15
});
m.directive('uiTimepicker', ['uiTimepickerConfig', '$parse', '$window', function(uiTimepickerConfig, $parse, $window) {
var moment = $window.moment;
var isAMoment = function(date) {
return moment !== undefined && moment.isMoment(date) && date.isValid();
};
var isDateOrMoment = function(date) {
return date !== null && (angular.isDate(date) || isAMoment(date));
};
return {
restrict: 'A',
require: 'ngModel',
scope: {
ngModel: '=',
baseDate: '=',
uiTimepicker: '=',
},
priority: 1,
link: function(scope, element, attrs, ngModel) {
'use strict';
var config = angular.copy(uiTimepickerConfig);
var asMoment = config.asMoment || false;
delete config.asMoment;
ngModel.$render = function() {
var date = ngModel.$modelValue;
if (!angular.isDefined(date)) {
return;
}
if (date !== null && date !== '' && !isDateOrMoment(date)) {
throw new Error('ng-Model value must be a Date or Moment object - currently it is a ' + typeof date + '.');
}
if (isAMoment(date)) {
date = date.toDate();
}
if (!element.is(':focus') && !invalidInput()) {
element.timepicker('setTime', date);
}
if(date === null){
resetInput();
}
};
scope.$watch('ngModel', function() {
ngModel.$render();
}, true);
scope.$watch('uiTimepicker', function() {
element.timepicker(
'option',
angular.extend(
config, scope.uiTimepicker ?
scope.uiTimepicker :
{}
)
);
ngModel.$render();
}, true);
config.appendTo = config.appendTo || element.parent();
element.timepicker(
angular.extend(
config, scope.uiTimepicker ?
scope.uiTimepicker :
{}
)
);
var resetInput = function(){
element.timepicker('setTime', null);
};
var userInput = function() {
return element.val().trim();
};
var invalidInput = function() {
return userInput() && ngModel.$modelValue === null;
};
element.on('$destroy', function() {
element.timepicker('remove');
});
var asDate = function() {
var baseDate = ngModel.$modelValue ? ngModel.$modelValue : scope.baseDate;
return isAMoment(baseDate) ? baseDate.toDate() : baseDate;
};
var asMomentOrDate = function(date) {
return asMoment ? moment(date) : date;
};
if (element.is('input')) {
ngModel.$parsers.unshift(function(viewValue) {
var date = element.timepicker('getTime', asDate());
return date ? asMomentOrDate(date) : date;
});
ngModel.$validators.time = function(modelValue) {
return (!attrs.required && !userInput()) ? true : isDateOrMoment(modelValue);
};
} else {
element.on('changeTime', function() {
scope.$evalAsync(function() {
var date = element.timepicker('getTime', asDate());
ngModel.$setViewValue(date);
});
});
}
}
};
}]);

@ -0,0 +1 @@
var m=angular.module("ui.timepicker",[]);m.value("uiTimepickerConfig",{step:15}),m.directive("uiTimepicker",["uiTimepickerConfig","$parse","$window",function(a,b,c){var d=c.moment,e=function(a){return void 0!==d&&d.isMoment(a)&&a.isValid()},f=function(a){return null!==a&&(angular.isDate(a)||e(a))};return{restrict:"A",require:"ngModel",scope:{ngModel:"=",baseDate:"=",uiTimepicker:"="},priority:1,link:function(b,c,g,h){"use strict";var i=angular.copy(a),j=i.asMoment||!1;delete i.asMoment,h.$render=function(){var a=h.$modelValue;if(angular.isDefined(a)){if(null!==a&&""!==a&&!f(a))throw new Error("ng-Model value must be a Date or Moment object - currently it is a "+typeof a+".");e(a)&&(a=a.toDate()),c.is(":focus")||m()||c.timepicker("setTime",a),null===a&&k()}},b.$watch("ngModel",function(){h.$render()},!0),b.$watch("uiTimepicker",function(){c.timepicker("option",angular.extend(i,b.uiTimepicker?b.uiTimepicker:{})),h.$render()},!0),i.appendTo=i.appendTo||c.parent(),c.timepicker(angular.extend(i,b.uiTimepicker?b.uiTimepicker:{}));var k=function(){c.timepicker("setTime",null)},l=function(){return c.val().trim()},m=function(){return l()&&null===h.$modelValue};c.on("$destroy",function(){c.timepicker("remove")});var n=function(){var a=h.$modelValue?h.$modelValue:b.baseDate;return e(a)?a.toDate():a},o=function(a){return j?d(a):a};c.is("input")?(h.$parsers.unshift(function(a){var b=c.timepicker("getTime",n());return b?o(b):b}),h.$validators.time=function(a){return g.required||l()?f(a):!0}):c.on("changeTime",function(){b.$evalAsync(function(){var a=c.timepicker("getTime",n());h.$setViewValue(a)})})}}}]);

@ -0,0 +1,38 @@
{
"name": "angular-minicolors",
"version": "0.0.11",
"homepage": "https://github.com/kaihenzler/angular-minicolors",
"authors": [
"Kai Henzler <kai.henzler@gmx.de>"
],
"description": "A wrapper around JQuery MiniColors by Cory LaViska",
"keywords": [
"angular",
"minicolors",
"colorpicker",
"color-picker",
"color",
"picker"
],
"main": "angular-minicolors.js",
"dependencies": {
"jquery-minicolors": "2.1.7"
},
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"_release": "0.0.11",
"_resolution": {
"type": "version",
"tag": "0.0.11",
"commit": "74a40b5fbd56ac4898ded1c4111303329e4debf8"
},
"_source": "https://github.com/kaihenzler/angular-minicolors.git",
"_target": "~0.0.11",
"_originalSource": "angular-minicolors"
}

@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2013 Kai Henzler
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

@ -0,0 +1,117 @@
angular-minicolors
==================
## General
My first try of wrtiting a wrapper-directive around JQuery MiniColors by [Cory LaViska ](https://github.com/claviska) [https://github.com/claviska/jquery-minicolors](https://github.com/claviska/jquery-minicolors)
Works with Bootstrap 3 and works fine with mobile browsers such as Safari on iPad.
##[DEMO and API](https://kaihenzler.github.io/angular-minicolors)
## How To Install
1. Install by typing `bower install angular-minicolors` consider using the `--save` option to save the dependency to your own bower.json file
## How To Use
1. Include the JQuery MiniColors Files from the bower_components folder (bower_components/jquery-minicolors/) in your project.
The files you need are: `jquery-minicolors.js` `jquery-minicolors.css` and `jquery-minicolors.png` and of course JQuery itself
2. Add the dependency to your app definition `angular.module('myApp', ['minicolors'])`
3. Append `minicolors` attribute to any input-field. If you want to pass in a settings object, do it like this: `minicolors="MySettingsObject"`. Below you can see a usage example with bootstrap classes. The directive should be wrapped inside a div to preserve correct styling.
```html
<div class="form-group">
<label for="color-input" class="form-control">Color:</label>
<input
minicolors="customSettings"
id="color-input"
class="form-control"
type="text"
ng-model="input.color">
</div>
<script type="text/javascript">
//using for example these settings inside your controller
$scope.customSettings = {
control: 'brightness',
theme: 'bootstrap',
position: 'top left'
};
</script>
```
angular-minicolors is planned to be API compatible with: [http://labs.abeautifulsite.net/jquery-minicolors/](http://labs.abeautifulsite.net/jquery-minicolors/)
keep in mind, that this is my first public angular-directive and it is by far not finished.
## default config
the default config is as follows:
```js
theme: 'bootstrap',
position: 'top left',
defaultValue: '',
animationSpeed: 50,
animationEasing: 'swing',
change: null,
changeDelay: 0,
control: 'hue',
hide: null,
hideSpeed: 100,
inline: false,
letterCase: 'lowercase',
opacity: false,
show: null,
showSpeed: 100
```
## app-wide config
a Provider is now exposed and you can edit the global config like this:
```js
angular.module('my-app').config(function (minicolorsProvider) {
angular.extend(minicolorsProvider.defaults, {
control: 'hue',
position: 'top left'
});
});
```
## TODO
- wrap the original events in angular events
- add protection against false color values
## Found an issue?
Please report the issue and feel free to submit a pull request
## Copyright and license
The MIT License (MIT)
Copyright (c) 2013 Kai Henzler
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

@ -0,0 +1,155 @@
'format cjs';
'use strict';
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
define(['angular', 'jquery-minicolors'], factory);
} else if (typeof exports === 'object') {
module.exports = factory(require('angular'), require('jquery-minicolors'));
module.exports = 'minicolors';
} else {
root.angularMinicolors = factory(root.angular, root.jqueryMinicolors);
}
})(this, function(angular) {
angular.module('minicolors', []);
angular.module('minicolors').provider('minicolors', function() {
this.defaults = {
theme: 'bootstrap',
position: 'top left',
defaultValue: '',
animationSpeed: 50,
animationEasing: 'swing',
change: null,
changeDelay: 0,
control: 'hue',
hide: null,
hideSpeed: 100,
inline: false,
letterCase: 'lowercase',
opacity: false,
show: null,
showSpeed: 100
};
this.$get = function() {
return this;
};
});
angular.module('minicolors').directive('minicolors', ['minicolors', '$timeout', function(minicolors, $timeout) {
return {
require: '?ngModel',
restrict: 'A',
priority: 1, //since we bind on an input element, we have to set a higher priority than angular-default input
link: function(scope, element, attrs, ngModel) {
var inititalized = false;
//gets the settings object
var getSettings = function() {
var config = angular.extend({}, minicolors.defaults, scope.$eval(attrs.minicolors));
return config;
};
/**
* check if value is valid color value
* e.g.#fff000 or #fff
* @param color
*/
function isValidColor(color) {
return /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(color);
}
function canSetValue() {
return (element.data('minicolors-settings') != null)
}
/**
* set color value as minicolors internal color value
* @param color
*/
function setMinicolorsValue(color) {
if (isValidColor(color) && canSetValue()) {
element.minicolors('value', color);
}
}
//what to do if the value changed
ngModel.$render = function() {
//we are in digest or apply, and therefore call a timeout function
$timeout(function() {
var color = ngModel.$viewValue;
setMinicolorsValue(color);
}, 0, false);
};
//init method
var initMinicolors = function() {
if (!ngModel) {
return;
}
var settings = getSettings();
settings.change = function(hex) {
scope.$apply(function() {
if (isValidColor(hex))
ngModel.$setViewValue(hex);
});
};
//destroy the old colorpicker if one already exists
if (element.hasClass('minicolors-input')) {
element.minicolors('destroy');
element.off('blur', onBlur);
}
// Create the new minicolors widget
element.minicolors(settings);
// hook up into the jquery-minicolors onBlur event.
element.on('blur', onBlur);
// are we inititalized yet ?
//needs to be wrapped in $timeout, to prevent $apply / $digest errors
//$scope.$apply will be called by $timeout, so we don't have to handle that case
if (!inititalized) {
$timeout(function() {
var color = ngModel.$viewValue;
setMinicolorsValue(color);
}, 0);
inititalized = true;
return;
}
function onBlur(e) {
scope.$apply(function() {
var color = element.minicolors('value');
if (isValidColor(color))
ngModel.$setViewValue(color);
});
}
};
initMinicolors();
//initital call
// Watch for changes to the directives options and then call init method again
var unbindWatch = scope.$watch(getSettings, initMinicolors, true);
scope.$on('$destroy', function () {
if (element.hasClass('minicolors-input')) {
element.minicolors('destroy');
element.remove();
}
if (unbindWatch) unbindWatch();
});
}
};
}]);
});

@ -0,0 +1,29 @@
{
"name": "angular-minicolors",
"version": "0.0.11",
"homepage": "https://github.com/kaihenzler/angular-minicolors",
"authors": [
"Kai Henzler <kai.henzler@gmx.de>"
],
"description": "A wrapper around JQuery MiniColors by Cory LaViska",
"keywords": [
"angular",
"minicolors",
"colorpicker",
"color-picker",
"color",
"picker"
],
"main": "angular-minicolors.js",
"dependencies": {
"jquery-minicolors": "2.1.7"
},
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
]
}

@ -0,0 +1,31 @@
{
"name": "angular-minicolors",
"version": "0.0.11",
"description": "A wrapper around JQuery MiniColors by Cory LaViska",
"main": "angular-minicolors.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/kaihenzler/angular-minicolors.git"
},
"keywords": [
"angular",
"minicolors",
"colorpicker",
"color-picker",
"color",
"picker"
],
"author": "Kai Henzler <kai.henzler@gmx.de>",
"license": "MIT",
"bugs": {
"url": "https://github.com/kaihenzler/angular-minicolors/issues"
},
"homepage": "https://github.com/kaihenzler/angular-minicolors#readme",
"peerDependencies": {
"jquery-minicolors": "^2.1.10",
"angular": "^1.4.0"
}
}

@ -0,0 +1,18 @@
{
"name": "angular",
"version": "1.8.2",
"license": "MIT",
"main": "./angular.js",
"ignore": [],
"dependencies": {},
"homepage": "https://github.com/angular/bower-angular",
"_release": "1.8.2",
"_resolution": {
"type": "version",
"tag": "v1.8.2",
"commit": "87e966dfdca26321553d6d289a3cff337865058e"
},
"_source": "https://github.com/angular/bower-angular.git",
"_target": "1.8.2",
"_originalSource": "angular"
}

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2016 Angular
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

@ -0,0 +1,64 @@
# packaged angular
This repo is for distribution on `npm` and `bower`. The source for this module is in the
[main AngularJS repo](https://github.com/angular/angular.js).
Please file issues and pull requests against that repo.
## Install
You can install this package either with `npm` or with `bower`.
### npm
```shell
npm install angular
```
Then add a `<script>` to your `index.html`:
```html
<script src="/node_modules/angular/angular.js"></script>
```
Or `require('angular')` from your code.
### bower
```shell
bower install angular
```
Then add a `<script>` to your `index.html`:
```html
<script src="/bower_components/angular/angular.js"></script>
```
## Documentation
Documentation is available on the
[AngularJS docs site](http://docs.angularjs.org/).
## License
The MIT License
Copyright (c) 2010-2015 Google, Inc. http://angularjs.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

@ -0,0 +1,25 @@
/* Include this file in your html if you are using the CSP mode. */
@charset "UTF-8";
[ng\:cloak],
[ng-cloak],
[data-ng-cloak],
[x-ng-cloak],
.ng-cloak,
.x-ng-cloak,
.ng-hide:not(.ng-hide-animate) {
display: none !important;
}
ng\:form {
display: block;
}
.ng-animate-shim {
visibility:hidden;
}
.ng-anchor {
position:absolute;
}

File diff suppressed because one or more lines are too long

@ -0,0 +1,9 @@
{
"name": "angular",
"version": "1.8.2",
"license": "MIT",
"main": "./angular.js",
"ignore": [],
"dependencies": {
}
}

@ -0,0 +1,2 @@
require('./angular');
module.exports = angular;

@ -0,0 +1,25 @@
{
"name": "angular",
"version": "1.8.2",
"description": "HTML enhanced for web apps",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/angular/angular.js.git"
},
"keywords": [
"angular",
"framework",
"browser",
"client-side"
],
"author": "Angular Core Team <angular-core+npm@google.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/angular/angular.js/issues"
},
"homepage": "http://angularjs.org"
}

@ -0,0 +1,32 @@
{
"name": "clipboard",
"version": "1.5.16",
"description": "Modern copy to clipboard. No Flash. Just 2kb",
"license": "MIT",
"main": "dist/clipboard.js",
"ignore": [
"/.*/",
"/demo/",
"/test/",
"/.*",
"/bower.json",
"/karma.conf.js",
"/src",
"/lib"
],
"keywords": [
"clipboard",
"copy",
"cut"
],
"homepage": "https://github.com/zenorocha/clipboard.js",
"_release": "1.5.16",
"_resolution": {
"type": "version",
"tag": "v1.5.16",
"commit": "402c9ee17bed6f273bcbc7efa81874fd9a50b84c"
},
"_source": "https://github.com/zenorocha/clipboard.js.git",
"_target": "~1.5.5",
"_originalSource": "clipboard"
}

@ -0,0 +1,22 @@
{
"name": "clipboard",
"version": "1.5.16",
"description": "Modern copy to clipboard. No Flash. Just 2kb",
"license": "MIT",
"main": "dist/clipboard.js",
"ignore": [
"/.*/",
"/demo/",
"/test/",
"/.*",
"/bower.json",
"/karma.conf.js",
"/src",
"/lib"
],
"keywords": [
"clipboard",
"copy",
"cut"
]
}

@ -0,0 +1,28 @@
# Contributing guide
Want to contribute to Clipboard.js? Awesome!
There are many ways you can contribute, see below.
## Opening issues
Open an issue to report bugs or to propose new features.
- Reporting bugs: describe the bug as clearly as you can, including steps to reproduce, what happened and what you were expecting to happen. Also include browser version, OS and other related software's (npm, Node.js, etc) versions when applicable.
- Proposing features: explain the proposed feature, what it should do, why it is useful, how users should use it. Give us as much info as possible so it will be easier to discuss, access and implement the proposed feature. When you're unsure about a certain aspect of the feature, feel free to leave it open for others to discuss and find an appropriate solution.
## Proposing pull requests
Pull requests are very welcome. Note that if you are going to propose drastic changes, be sure to open an issue for discussion first, to make sure that your PR will be accepted before you spend effort coding it.
Fork the Clipboard.js repository, clone it locally and create a branch for your proposed bug fix or new feature. Avoid working directly on the master branch.
Implement your bug fix or feature, write tests to cover it and make sure all tests are passing (run a final `npm test` to make sure everything is correct). Then commit your changes, push your bug fix/feature branch to the origin (your forked repo) and open a pull request to the upstream (the repository you originally forked)'s master branch.
## Documentation
Documentation is extremely important and takes a fair deal of time and effort to write and keep updated. Please submit any and all improvements you can make to the repository's docs.
## Known issues
If you're using npm@3 you'll probably face some issues related to peerDependencies.
https://github.com/npm/npm/issues/9204

@ -0,0 +1,755 @@
/*!
* clipboard.js v1.5.16
* https://zenorocha.github.io/clipboard.js
*
* Licensed MIT © Zeno Rocha
*/
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Clipboard = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
var DOCUMENT_NODE_TYPE = 9;
/**
* A polyfill for Element.matches()
*/
if (Element && !Element.prototype.matches) {
var proto = Element.prototype;
proto.matches = proto.matchesSelector ||
proto.mozMatchesSelector ||
proto.msMatchesSelector ||
proto.oMatchesSelector ||
proto.webkitMatchesSelector;
}
/**
* Finds the closest parent that matches a selector.
*
* @param {Element} element
* @param {String} selector
* @return {Function}
*/
function closest (element, selector) {
while (element && element.nodeType !== DOCUMENT_NODE_TYPE) {
if (element.matches(selector)) return element;
element = element.parentNode;
}
}
module.exports = closest;
},{}],2:[function(require,module,exports){
var closest = require('./closest');
/**
* Delegates event to a selector.
*
* @param {Element} element
* @param {String} selector
* @param {String} type
* @param {Function} callback
* @param {Boolean} useCapture
* @return {Object}
*/
function delegate(element, selector, type, callback, useCapture) {
var listenerFn = listener.apply(this, arguments);
element.addEventListener(type, listenerFn, useCapture);
return {
destroy: function() {
element.removeEventListener(type, listenerFn, useCapture);
}
}
}
/**
* Finds closest match and invokes callback.
*
* @param {Element} element
* @param {String} selector
* @param {String} type
* @param {Function} callback
* @return {Function}
*/
function listener(element, selector, type, callback) {
return function(e) {
e.delegateTarget = closest(e.target, selector);
if (e.delegateTarget) {
callback.call(element, e);
}
}
}
module.exports = delegate;
},{"./closest":1}],3:[function(require,module,exports){
/**
* Check if argument is a HTML element.
*
* @param {Object} value
* @return {Boolean}
*/
exports.node = function(value) {
return value !== undefined
&& value instanceof HTMLElement
&& value.nodeType === 1;
};
/**
* Check if argument is a list of HTML elements.
*
* @param {Object} value
* @return {Boolean}
*/
exports.nodeList = function(value) {
var type = Object.prototype.toString.call(value);
return value !== undefined
&& (type === '[object NodeList]' || type === '[object HTMLCollection]')
&& ('length' in value)
&& (value.length === 0 || exports.node(value[0]));
};
/**
* Check if argument is a string.
*
* @param {Object} value
* @return {Boolean}
*/
exports.string = function(value) {
return typeof value === 'string'
|| value instanceof String;
};
/**
* Check if argument is a function.
*
* @param {Object} value
* @return {Boolean}
*/
exports.fn = function(value) {
var type = Object.prototype.toString.call(value);
return type === '[object Function]';
};
},{}],4:[function(require,module,exports){
var is = require('./is');
var delegate = require('delegate');
/**
* Validates all params and calls the right
* listener function based on its target type.
*
* @param {String|HTMLElement|HTMLCollection|NodeList} target
* @param {String} type
* @param {Function} callback
* @return {Object}
*/
function listen(target, type, callback) {
if (!target && !type && !callback) {
throw new Error('Missing required arguments');
}
if (!is.string(type)) {
throw new TypeError('Second argument must be a String');
}
if (!is.fn(callback)) {
throw new TypeError('Third argument must be a Function');
}
if (is.node(target)) {
return listenNode(target, type, callback);
}
else if (is.nodeList(target)) {
return listenNodeList(target, type, callback);
}
else if (is.string(target)) {
return listenSelector(target, type, callback);
}
else {
throw new TypeError('First argument must be a String, HTMLElement, HTMLCollection, or NodeList');
}
}
/**
* Adds an event listener to a HTML element
* and returns a remove listener function.
*
* @param {HTMLElement} node
* @param {String} type
* @param {Function} callback
* @return {Object}
*/
function listenNode(node, type, callback) {
node.addEventListener(type, callback);
return {
destroy: function() {
node.removeEventListener(type, callback);
}
}
}
/**
* Add an event listener to a list of HTML elements
* and returns a remove listener function.
*
* @param {NodeList|HTMLCollection} nodeList
* @param {String} type
* @param {Function} callback
* @return {Object}
*/
function listenNodeList(nodeList, type, callback) {
Array.prototype.forEach.call(nodeList, function(node) {
node.addEventListener(type, callback);
});
return {
destroy: function() {
Array.prototype.forEach.call(nodeList, function(node) {
node.removeEventListener(type, callback);
});
}
}
}
/**
* Add an event listener to a selector
* and returns a remove listener function.
*
* @param {String} selector
* @param {String} type
* @param {Function} callback
* @return {Object}
*/
function listenSelector(selector, type, callback) {
return delegate(document.body, selector, type, callback);
}
module.exports = listen;
},{"./is":3,"delegate":2}],5:[function(require,module,exports){
function select(element) {
var selectedText;
if (element.nodeName === 'SELECT') {
element.focus();
selectedText = element.value;
}
else if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') {
element.focus();
element.setSelectionRange(0, element.value.length);
selectedText = element.value;
}
else {
if (element.hasAttribute('contenteditable')) {
element.focus();
}
var selection = window.getSelection();
var range = document.createRange();
range.selectNodeContents(element);
selection.removeAllRanges();
selection.addRange(range);
selectedText = selection.toString();
}
return selectedText;
}
module.exports = select;
},{}],6:[function(require,module,exports){
function E () {
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
}
E.prototype = {
on: function (name, callback, ctx) {
var e = this.e || (this.e = {});
(e[name] || (e[name] = [])).push({
fn: callback,
ctx: ctx
});
return this;
},
once: function (name, callback, ctx) {
var self = this;
function listener () {
self.off(name, listener);
callback.apply(ctx, arguments);
};
listener._ = callback
return this.on(name, listener, ctx);
},
emit: function (name) {
var data = [].slice.call(arguments, 1);
var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
var i = 0;
var len = evtArr.length;
for (i; i < len; i++) {
evtArr[i].fn.apply(evtArr[i].ctx, data);
}
return this;
},
off: function (name, callback) {
var e = this.e || (this.e = {});
var evts = e[name];
var liveEvents = [];
if (evts && callback) {
for (var i = 0, len = evts.length; i < len; i++) {
if (evts[i].fn !== callback && evts[i].fn._ !== callback)
liveEvents.push(evts[i]);
}
}
// Remove event from queue to prevent memory leak
// Suggested by https://github.com/lazd
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
(liveEvents.length)
? e[name] = liveEvents
: delete e[name];
return this;
}
};
module.exports = E;
},{}],7:[function(require,module,exports){
(function (global, factory) {
if (typeof define === "function" && define.amd) {
define(['module', 'select'], factory);
} else if (typeof exports !== "undefined") {
factory(module, require('select'));
} else {
var mod = {
exports: {}
};
factory(mod, global.select);
global.clipboardAction = mod.exports;
}
})(this, function (module, _select) {
'use strict';
var _select2 = _interopRequireDefault(_select);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
return typeof obj;
} : function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
var _createClass = function () {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function (Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
var ClipboardAction = function () {
/**
* @param {Object} options
*/
function ClipboardAction(options) {
_classCallCheck(this, ClipboardAction);
this.resolveOptions(options);
this.initSelection();
}
/**
* Defines base properties passed from constructor.
* @param {Object} options
*/
_createClass(ClipboardAction, [{
key: 'resolveOptions',
value: function resolveOptions() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
this.action = options.action;
this.emitter = options.emitter;
this.target = options.target;
this.text = options.text;
this.trigger = options.trigger;
this.selectedText = '';
}
}, {
key: 'initSelection',
value: function initSelection() {
if (this.text) {
this.selectFake();
} else if (this.target) {
this.selectTarget();
}
}
}, {
key: 'selectFake',
value: function selectFake() {
var _this = this;
var isRTL = document.documentElement.getAttribute('dir') == 'rtl';
this.removeFake();
this.fakeHandlerCallback = function () {
return _this.removeFake();
};
this.fakeHandler = document.body.addEventListener('click', this.fakeHandlerCallback) || true;
this.fakeElem = document.createElement('textarea');
// Prevent zooming on iOS
this.fakeElem.style.fontSize = '12pt';
// Reset box model
this.fakeElem.style.border = '0';
this.fakeElem.style.padding = '0';
this.fakeElem.style.margin = '0';
// Move element out of screen horizontally
this.fakeElem.style.position = 'absolute';
this.fakeElem.style[isRTL ? 'right' : 'left'] = '-9999px';
// Move element to the same position vertically
var yPosition = window.pageYOffset || document.documentElement.scrollTop;
this.fakeElem.addEventListener('focus', window.scrollTo(0, yPosition));
this.fakeElem.style.top = yPosition + 'px';
this.fakeElem.setAttribute('readonly', '');
this.fakeElem.value = this.text;
document.body.appendChild(this.fakeElem);
this.selectedText = (0, _select2.default)(this.fakeElem);
this.copyText();
}
}, {
key: 'removeFake',
value: function removeFake() {
if (this.fakeHandler) {
document.body.removeEventListener('click', this.fakeHandlerCallback);
this.fakeHandler = null;
this.fakeHandlerCallback = null;
}
if (this.fakeElem) {
document.body.removeChild(this.fakeElem);
this.fakeElem = null;
}
}
}, {
key: 'selectTarget',
value: function selectTarget() {
this.selectedText = (0, _select2.default)(this.target);
this.copyText();
}
}, {
key: 'copyText',
value: function copyText() {
var succeeded = void 0;
try {
succeeded = document.execCommand(this.action);
} catch (err) {
succeeded = false;
}
this.handleResult(succeeded);
}
}, {
key: 'handleResult',
value: function handleResult(succeeded) {
this.emitter.emit(succeeded ? 'success' : 'error', {
action: this.action,
text: this.selectedText,
trigger: this.trigger,
clearSelection: this.clearSelection.bind(this)
});
}
}, {
key: 'clearSelection',
value: function clearSelection() {
if (this.target) {
this.target.blur();
}
window.getSelection().removeAllRanges();
}
}, {
key: 'destroy',
value: function destroy() {
this.removeFake();
}
}, {
key: 'action',
set: function set() {
var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'copy';
this._action = action;
if (this._action !== 'copy' && this._action !== 'cut') {
throw new Error('Invalid "action" value, use either "copy" or "cut"');
}
},
get: function get() {
return this._action;
}
}, {
key: 'target',
set: function set(target) {
if (target !== undefined) {
if (target && (typeof target === 'undefined' ? 'undefined' : _typeof(target)) === 'object' && target.nodeType === 1) {
if (this.action === 'copy' && target.hasAttribute('disabled')) {
throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');
}
if (this.action === 'cut' && (target.hasAttribute('readonly') || target.hasAttribute('disabled'))) {
throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');
}
this._target = target;
} else {
throw new Error('Invalid "target" value, use a valid Element');
}
}
},
get: function get() {
return this._target;
}
}]);
return ClipboardAction;
}();
module.exports = ClipboardAction;
});
},{"select":5}],8:[function(require,module,exports){
(function (global, factory) {
if (typeof define === "function" && define.amd) {
define(['module', './clipboard-action', 'tiny-emitter', 'good-listener'], factory);
} else if (typeof exports !== "undefined") {
factory(module, require('./clipboard-action'), require('tiny-emitter'), require('good-listener'));
} else {
var mod = {
exports: {}
};
factory(mod, global.clipboardAction, global.tinyEmitter, global.goodListener);
global.clipboard = mod.exports;
}
})(this, function (module, _clipboardAction, _tinyEmitter, _goodListener) {
'use strict';
var _clipboardAction2 = _interopRequireDefault(_clipboardAction);
var _tinyEmitter2 = _interopRequireDefault(_tinyEmitter);
var _goodListener2 = _interopRequireDefault(_goodListener);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
var _createClass = function () {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function (Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
var Clipboard = function (_Emitter) {
_inherits(Clipboard, _Emitter);
/**
* @param {String|HTMLElement|HTMLCollection|NodeList} trigger
* @param {Object} options
*/
function Clipboard(trigger, options) {
_classCallCheck(this, Clipboard);
var _this = _possibleConstructorReturn(this, (Clipboard.__proto__ || Object.getPrototypeOf(Clipboard)).call(this));
_this.resolveOptions(options);
_this.listenClick(trigger);
return _this;
}
/**
* Defines if attributes would be resolved using internal setter functions
* or custom functions that were passed in the constructor.
* @param {Object} options
*/
_createClass(Clipboard, [{
key: 'resolveOptions',
value: function resolveOptions() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
this.action = typeof options.action === 'function' ? options.action : this.defaultAction;
this.target = typeof options.target === 'function' ? options.target : this.defaultTarget;
this.text = typeof options.text === 'function' ? options.text : this.defaultText;
}
}, {
key: 'listenClick',
value: function listenClick(trigger) {
var _this2 = this;
this.listener = (0, _goodListener2.default)(trigger, 'click', function (e) {
return _this2.onClick(e);
});
}
}, {
key: 'onClick',
value: function onClick(e) {
var trigger = e.delegateTarget || e.currentTarget;
if (this.clipboardAction) {
this.clipboardAction = null;
}
this.clipboardAction = new _clipboardAction2.default({
action: this.action(trigger),
target: this.target(trigger),
text: this.text(trigger),
trigger: trigger,
emitter: this
});
}
}, {
key: 'defaultAction',
value: function defaultAction(trigger) {
return getAttributeValue('action', trigger);
}
}, {
key: 'defaultTarget',
value: function defaultTarget(trigger) {
var selector = getAttributeValue('target', trigger);
if (selector) {
return document.querySelector(selector);
}
}
}, {
key: 'defaultText',
value: function defaultText(trigger) {
return getAttributeValue('text', trigger);
}
}, {
key: 'destroy',
value: function destroy() {
this.listener.destroy();
if (this.clipboardAction) {
this.clipboardAction.destroy();
this.clipboardAction = null;
}
}
}]);
return Clipboard;
}(_tinyEmitter2.default);
/**
* Helper function to retrieve attribute value.
* @param {String} suffix
* @param {Element} element
*/
function getAttributeValue(suffix, element) {
var attribute = 'data-clipboard-' + suffix;
if (!element.hasAttribute(attribute)) {
return;
}
return element.getAttribute(attribute);
}
module.exports = Clipboard;
});
},{"./clipboard-action":7,"good-listener":4,"tiny-emitter":6}]},{},[8])(8)
});

File diff suppressed because one or more lines are too long

@ -0,0 +1,12 @@
// Package metadata for Meteor.js.
Package.describe({
name: "zenorocha:clipboard",
summary: "Modern copy to clipboard. No Flash. Just 2kb.",
version: "1.5.16",
git: "https://github.com/zenorocha/clipboard.js"
});
Package.onUse(function(api) {
api.addFiles("dist/clipboard.js", "client");
});

@ -0,0 +1,48 @@
{
"name": "clipboard",
"version": "1.5.16",
"description": "Modern copy to clipboard. No Flash. Just 2kb",
"repository": "zenorocha/clipboard.js",
"license": "MIT",
"main": "lib/clipboard.js",
"keywords": [
"clipboard",
"copy",
"cut"
],
"dependencies": {
"good-listener": "^1.2.0",
"select": "^1.0.6",
"tiny-emitter": "^1.0.0"
},
"devDependencies": {
"babel-cli": "^6.5.1",
"babel-core": "^6.5.2",
"babel-plugin-transform-es2015-modules-umd": "^6.5.0",
"babel-preset-es2015": "^6.5.0",
"babelify": "^7.2.0",
"bannerify": "Vekat/bannerify#feature-option",
"browserify": "^13.0.0",
"chai": "^3.4.1",
"install": "^0.8.1",
"karma": "^1.3.0",
"karma-browserify": "^5.0.1",
"karma-chai": "^0.1.0",
"karma-mocha": "^1.2.0",
"karma-phantomjs-launcher": "^1.0.0",
"karma-sinon": "^1.0.4",
"mocha": "^3.1.2",
"phantomjs-prebuilt": "^2.1.4",
"sinon": "^1.17.2",
"uglify-js": "^2.4.24",
"watchify": "^3.4.0"
},
"scripts": {
"build": "npm run build-debug && npm run build-min",
"build-debug": "browserify src/clipboard.js -s Clipboard -t [babelify] -p [bannerify --file .banner ] -o dist/clipboard.js",
"build-min": "uglifyjs dist/clipboard.js --comments '/!/' -m screw_ie8=true -c screw_ie8=true,unused=false -o dist/clipboard.min.js",
"build-watch": "watchify src/clipboard.js -s Clipboard -t [babelify] -o dist/clipboard.js -v",
"test": "karma start --single-run",
"prepublish": "babel src --out-dir lib"
}
}

@ -0,0 +1,173 @@
# clipboard.js
[![Build Status](http://img.shields.io/travis/zenorocha/clipboard.js/master.svg?style=flat)](https://travis-ci.org/zenorocha/clipboard.js)
![Killing Flash](https://img.shields.io/badge/killing-flash-brightgreen.svg?style=flat)
> Modern copy to clipboard. No Flash. Just 3kb gzipped.
<a href="https://clipboardjs.com/"><img width="728" src="https://cloud.githubusercontent.com/assets/398893/16165747/a0f6fc46-349a-11e6-8c9b-c5fd58d9099c.png" alt="Demo"></a>
## Why
Copying text to the clipboard shouldn't be hard. It shouldn't require dozens of steps to configure or hundreds of KBs to load. But most of all, it shouldn't depend on Flash or any bloated framework.
That's why clipboard.js exists.
## Install
You can get it on npm.
```
npm install clipboard --save
```
Or bower, too.
```
bower install clipboard --save
```
If you're not into package management, just [download a ZIP](https://github.com/zenorocha/clipboard.js/archive/master.zip) file.
## Setup
First, include the script located on the `dist` folder or load it from [a third-party CDN provider](https://github.com/zenorocha/clipboard.js/wiki/CDN-Providers).
```html
<script src="dist/clipboard.min.js"></script>
```
Now, you need to instantiate it by [passing a DOM selector](https://github.com/zenorocha/clipboard.js/blob/master/demo/constructor-selector.html#L18), [HTML element](https://github.com/zenorocha/clipboard.js/blob/master/demo/constructor-node.html#L16-L17), or [list of HTML elements](https://github.com/zenorocha/clipboard.js/blob/master/demo/constructor-nodelist.html#L18-L19).
```js
new Clipboard('.btn');
```
Internally, we need to fetch all elements that matches with your selector and attach event listeners for each one. But guess what? If you have hundreds of matches, this operation can consume a lot of memory.
For this reason we use [event delegation](http://stackoverflow.com/questions/1687296/what-is-dom-event-delegation) which replaces multiple event listeners with just a single listener. After all, [#perfmatters](https://twitter.com/hashtag/perfmatters).
# Usage
We're living a _declarative renaissance_, that's why we decided to take advantage of [HTML5 data attributes](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Using_data_attributes) for better usability.
### Copy text from another element
A pretty common use case is to copy content from another element. You can do that by adding a `data-clipboard-target` attribute in your trigger element.
The value you include on this attribute needs to match another's element selector.
<a href="https://clipboardjs.com/#example-target"><img width="473" alt="example-2" src="https://cloud.githubusercontent.com/assets/398893/9983467/a4946aaa-5fb1-11e5-9780-f09fcd7ca6c8.png"></a>
```html
<!-- Target -->
<input id="foo" value="https://github.com/zenorocha/clipboard.js.git">
<!-- Trigger -->
<button class="btn" data-clipboard-target="#foo">
<img src="assets/clippy.svg" alt="Copy to clipboard">
</button>
```
### Cut text from another element
Additionally, you can define a `data-clipboard-action` attribute to specify if you want to either `copy` or `cut` content.
If you omit this attribute, `copy` will be used by default.
<a href="https://clipboardjs.com/#example-action"><img width="473" alt="example-3" src="https://cloud.githubusercontent.com/assets/398893/10000358/7df57b9c-6050-11e5-9cd1-fbc51d2fd0a7.png"></a>
```html
<!-- Target -->
<textarea id="bar">Mussum ipsum cacilds...</textarea>
<!-- Trigger -->
<button class="btn" data-clipboard-action="cut" data-clipboard-target="#bar">
Cut to clipboard
</button>
```
As you may expect, the `cut` action only works on `<input>` or `<textarea>` elements.
### Copy text from attribute
Truth is, you don't even need another element to copy its content from. You can just include a `data-clipboard-text` attribute in your trigger element.
<a href="https://clipboardjs.com/#example-text"><img width="147" alt="example-1" src="https://cloud.githubusercontent.com/assets/398893/10000347/6e16cf8c-6050-11e5-9883-1c5681f9ec45.png"></a>
```html
<!-- Trigger -->
<button class="btn" data-clipboard-text="Just because you can doesn't mean you should — clipboard.js">
Copy to clipboard
</button>
```
## Events
There are cases where you'd like to show some user feedback or capture what has been selected after a copy/cut operation.
That's why we fire custom events such as `success` and `error` for you to listen and implement your custom logic.
```js
var clipboard = new Clipboard('.btn');
clipboard.on('success', function(e) {
console.info('Action:', e.action);
console.info('Text:', e.text);
console.info('Trigger:', e.trigger);
e.clearSelection();
});
clipboard.on('error', function(e) {
console.error('Action:', e.action);
console.error('Trigger:', e.trigger);
});
```
For a live demonstration, open this [site](https://clipboardjs.com/) and just your console :)
## Advanced Options
If you don't want to modify your HTML, there's a pretty handy imperative API for you to use. All you need to do is declare a function, do your thing, and return a value.
For instance, if you want to dynamically set a `target`, you'll need to return a Node.
```js
new Clipboard('.btn', {
target: function(trigger) {
return trigger.nextElementSibling;
}
});
```
If you want to dynamically set a `text`, you'll return a String.
```js
new Clipboard('.btn', {
text: function(trigger) {
return trigger.getAttribute('aria-label');
}
});
```
Also, if you are working with single page apps, you may want to manage the lifecycle of the DOM more precisely. Here's how you clean up the events and objects that we create.
```js
var clipboard = new Clipboard('.btn');
clipboard.destroy();
```
## Browser Support
This library relies on both [Selection](https://developer.mozilla.org/en-US/docs/Web/API/Selection) and [execCommand](https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand) APIs. The first one is [supported by all browsers](http://caniuse.com/#search=selection) while the second one is supported in the following browsers.
| <img src="https://clipboardjs.com/assets/images/chrome.png" width="48px" height="48px" alt="Chrome logo"> | <img src="https://clipboardjs.com/assets/images/edge.png" width="48px" height="48px" alt="Edge logo"> | <img src="https://clipboardjs.com/assets/images/firefox.png" width="48px" height="48px" alt="Firefox logo"> | <img src="https://clipboardjs.com/assets/images/ie.png" width="48px" height="48px" alt="Internet Explorer logo"> | <img src="https://clipboardjs.com/assets/images/opera.png" width="48px" height="48px" alt="Opera logo"> | <img src="https://clipboardjs.com/assets/images/safari.png" width="48px" height="48px" alt="Safari logo"> |
|:---:|:---:|:---:|:---:|:---:|:---:|
| 42+ ✔ | 12+ ✔ | 41+ ✔ | 9+ ✔ | 29+ ✔ | 10+ ✔ |
The good news is that clipboard.js gracefully degrades if you need to support older browsers. All you have to do is show a tooltip saying `Copied!` when `success` event is called and `Press Ctrl+C to copy` when `error` event is called because the text is already selected.
## License
[MIT License](http://zenorocha.mit-license.org/) © Zeno Rocha

@ -0,0 +1,4 @@
This directory is not managed by bower. There's no bower version of flatpickr that we can use directly, so these files
are downloaded from the CDN and placed here manually.
https://cdnjs.com/libraries/flatpickr

@ -0,0 +1 @@
.flatpickr-confirm{height:40px;max-height:0;visibility:hidden;display:flex;justify-content:center;align-items:center;cursor:pointer;background:rgba(0,0,0,.06)}.flatpickr-confirm svg path{fill:inherit}.flatpickr-confirm.darkTheme{color:#fff;fill:#fff}.flatpickr-confirm.visible{max-height:40px;visibility:visible}

@ -0,0 +1 @@
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e=e||self).confirmDatePlugin=n()}(this,function(){"use strict";var t=function(){return(t=Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)};var i={confirmIcon:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='17' height='17' viewBox='0 0 17 17'> <g> </g> <path d='M15.418 1.774l-8.833 13.485-4.918-4.386 0.666-0.746 4.051 3.614 8.198-12.515 0.836 0.548z' fill='#000000' /> </svg>",confirmText:"OK ",showAlways:!1,theme:"light"};return function(e){var a,n=t(t({},i),e),o="flatpickr-confirm";return function(r){return r.config.noCalendar||r.isMobile?{}:t({onKeyDown:function(e,n,t,i){var o=function(n){try{return"function"!=typeof n.composedPath?n.target:n.composedPath()[0]}catch(e){return n.target}}(i);r.config.enableTime&&"Tab"===i.key&&o===r.amPM?(i.preventDefault(),a.focus()):"Enter"===i.key&&o===a&&r.close()},onReady:function(){(a=r._createElement("div",o+" "+(n.showAlways?"visible":"")+" "+n.theme+"Theme",n.confirmText)).tabIndex=-1,a.innerHTML+=n.confirmIcon,a.addEventListener("click",r.close),r.calendarContainer.appendChild(a),r.loadedPlugins.push("confirmDate")}},n.showAlways?{}:{onChange:function(e,n){var t=r.config.enableTime||"multiple"===r.config.mode||-1!==r.loadedPlugins.indexOf("monthSelect"),i=r.calendarContainer.querySelector("."+o);if(i)return n&&!r.config.inline&&t&&i?i.classList.add("visible"):void i.classList.remove("visible")}})}}});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -0,0 +1 @@
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e=e||self).ar={})}(this,function(e){"use strict";var n="undefined"!=typeof window&&void 0!==window.flatpickr?window.flatpickr:{l10ns:{}},o={weekdays:{shorthand:["أحد","اثنين","ثلاثاء","أربعاء","خميس","جمعة","سبت"],longhand:["الأحد","الاثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"]},months:{shorthand:["1","2","3","4","5","6","7","8","9","10","11","12"],longhand:["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"]},rangeSeparator:" - "};n.l10ns.ar=o;var t=n.l10ns;e.Arabic=o,e.default=t,Object.defineProperty(e,"__esModule",{value:!0})});

@ -0,0 +1 @@
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e=e||self).at={})}(this,function(e){"use strict";var n="undefined"!=typeof window&&void 0!==window.flatpickr?window.flatpickr:{l10ns:{}},t={weekdays:{shorthand:["So","Mo","Di","Mi","Do","Fr","Sa"],longhand:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"]},months:{shorthand:["Jän","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],longhand:["Jänner","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"]},firstDayOfWeek:1,weekAbbreviation:"KW",rangeSeparator:" bis ",scrollTitle:"Zum Ändern scrollen",toggleTitle:"Zum Umschalten klicken"};n.l10ns.at=t;var o=n.l10ns;e.Austria=t,e.default=o,Object.defineProperty(e,"__esModule",{value:!0})});

@ -0,0 +1 @@
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?a(exports):"function"==typeof define&&define.amd?define(["exports"],a):a((e=e||self).az={})}(this,function(e){"use strict";var a="undefined"!=typeof window&&void 0!==window.flatpickr?window.flatpickr:{l10ns:{}},n={weekdays:{shorthand:["B.","B.e.","Ç.a.","Ç.","C.a.","C.","Ş."],longhand:["Bazar","Bazar ertəsi","Çərşənbə axşamı","Çərşənbə","Cümə axşamı","Cümə","Şənbə"]},months:{shorthand:["Yan","Fev","Mar","Apr","May","İyn","İyl","Avq","Sen","Okt","Noy","Dek"],longhand:["Yanvar","Fevral","Mart","Aprel","May","İyun","İyul","Avqust","Sentyabr","Oktyabr","Noyabr","Dekabr"]},firstDayOfWeek:1,ordinal:function(){return"."},rangeSeparator:" - ",weekAbbreviation:"Hf",scrollTitle:"Artırmaq üçün sürüşdürün",toggleTitle:"Aç / Bağla",amPM:["GƏ","GS"],time_24hr:!0};a.l10ns.az=n;var r=a.l10ns;e.Azerbaijan=n,e.default=r,Object.defineProperty(e,"__esModule",{value:!0})});

@ -0,0 +1 @@
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e=e||self).be={})}(this,function(e){"use strict";var n="undefined"!=typeof window&&void 0!==window.flatpickr?window.flatpickr:{l10ns:{}},t={weekdays:{shorthand:["Нд","Пн","Аў","Ср","Чц","Пт","Сб"],longhand:["Нядзеля","Панядзелак","Аўторак","Серада","Чацвер","Пятніца","Субота"]},months:{shorthand:["Сту","Лют","Сак","Кра","Тра","Чэр","Ліп","Жні","Вер","Кас","Ліс","Сне"],longhand:["Студзень","Люты","Сакавік","Красавік","Травень","Чэрвень","Ліпень","Жнівень","Верасень","Кастрычнік","Лістапад","Снежань"]},firstDayOfWeek:1,ordinal:function(){return""},rangeSeparator:" — ",weekAbbreviation:"Тыд.",scrollTitle:"Пракруціце для павелічэння",toggleTitle:"Націсніце для пераключэння",amPM:["ДП","ПП"],yearAriaLabel:"Год",time_24hr:!0};n.l10ns.be=t;var o=n.l10ns;e.Belarusian=t,e.default=o,Object.defineProperty(e,"__esModule",{value:!0})});

@ -0,0 +1 @@
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e=e||self).bg={})}(this,function(e){"use strict";var n="undefined"!=typeof window&&void 0!==window.flatpickr?window.flatpickr:{l10ns:{}},t={weekdays:{shorthand:["Нд","Пн","Вт","Ср","Чт","Пт","Сб"],longhand:["Неделя","Понеделник","Вторник","Сряда","Четвъртък","Петък","Събота"]},months:{shorthand:["Яну","Фев","Март","Апр","Май","Юни","Юли","Авг","Сеп","Окт","Ное","Дек"],longhand:["Януари","Февруари","Март","Април","Май","Юни","Юли","Август","Септември","Октомври","Ноември","Декември"]},time_24hr:!0,firstDayOfWeek:1};n.l10ns.bg=t;var o=n.l10ns;e.Bulgarian=t,e.default=o,Object.defineProperty(e,"__esModule",{value:!0})});

@ -0,0 +1 @@
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e=e||self).bn={})}(this,function(e){"use strict";var n="undefined"!=typeof window&&void 0!==window.flatpickr?window.flatpickr:{l10ns:{}},o={weekdays:{shorthand:["রবি","সোম","মঙ্গল","বুধ","বৃহস্পতি","শুক্র","শনি"],longhand:["রবিবার","সোমবার","মঙ্গলবার","বুধবার","বৃহস্পতিবার","শুক্রবার","শনিবার"]},months:{shorthand:["জানু","ফেব্রু","মার্চ","এপ্রিল","মে","জুন","জুলাই","আগ","সেপ্টে","অক্টো","নভে","ডিসে"],longhand:["জানুয়ারী","ফেব্রুয়ারী","মার্চ","এপ্রিল","মে","জুন","জুলাই","আগস্ট","সেপ্টেম্বর","অক্টোবর","নভেম্বর","ডিসেম্বর"]}};n.l10ns.bn=o;var t=n.l10ns;e.Bangla=o,e.default=t,Object.defineProperty(e,"__esModule",{value:!0})});

@ -0,0 +1 @@
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).bs={})}(this,function(e){"use strict";var t="undefined"!=typeof window&&void 0!==window.flatpickr?window.flatpickr:{l10ns:{}},n={firstDayOfWeek:1,weekdays:{shorthand:["Ned","Pon","Uto","Sri","Čet","Pet","Sub"],longhand:["Nedjelja","Ponedjeljak","Utorak","Srijeda","Četvrtak","Petak","Subota"]},months:{shorthand:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Avg","Sep","Okt","Nov","Dec"],longhand:["Januar","Februar","Mart","April","Maj","Juni","Juli","Avgust","Septembar","Oktobar","Novembar","Decembar"]},time_24hr:!0};t.l10ns.bs=n;var a=t.l10ns;e.Bosnian=n,e.default=a,Object.defineProperty(e,"__esModule",{value:!0})});

@ -0,0 +1 @@
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e=e||self).cat={})}(this,function(e){"use strict";var n="undefined"!=typeof window&&void 0!==window.flatpickr?window.flatpickr:{l10ns:{}},r={weekdays:{shorthand:["Dg","Dl","Dt","Dc","Dj","Dv","Ds"],longhand:["Diumenge","Dilluns","Dimarts","Dimecres","Dijous","Divendres","Dissabte"]},months:{shorthand:["Gen","Febr","Març","Abr","Maig","Juny","Jul","Ag","Set","Oct","Nov","Des"],longhand:["Gener","Febrer","Març","Abril","Maig","Juny","Juliol","Agost","Setembre","Octubre","Novembre","Desembre"]},ordinal:function(e){var n=e%100;if(3<n&&n<21)return"è";switch(n%10){case 1:return"r";case 2:return"n";case 3:return"r";case 4:return"t";default:return"è"}},firstDayOfWeek:1,time_24hr:!0};n.l10ns.cat=n.l10ns.ca=r;var t=n.l10ns;e.Catalan=r,e.default=t,Object.defineProperty(e,"__esModule",{value:!0})});

@ -0,0 +1 @@
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e=e||self).cs={})}(this,function(e){"use strict";var n="undefined"!=typeof window&&void 0!==window.flatpickr?window.flatpickr:{l10ns:{}},o={weekdays:{shorthand:["Ne","Po","Út","St","Čt","Pá","So"],longhand:["Neděle","Pondělí","Úterý","Středa","Čtvrtek","Pátek","Sobota"]},months:{shorthand:["Led","Ún","Bře","Dub","Kvě","Čer","Čvc","Srp","Zář","Říj","Lis","Pro"],longhand:["Leden","Únor","Březen","Duben","Květen","Červen","Červenec","Srpen","Září","Říjen","Listopad","Prosinec"]},firstDayOfWeek:1,ordinal:function(){return"."},rangeSeparator:" do ",weekAbbreviation:"Týd.",scrollTitle:"Rolujte pro změnu",toggleTitle:"Přepnout dopoledne/odpoledne",amPM:["dop.","odp."],yearAriaLabel:"Rok",time_24hr:!0};n.l10ns.cs=o;var t=n.l10ns;e.Czech=o,e.default=t,Object.defineProperty(e,"__esModule",{value:!0})});

@ -0,0 +1 @@
!function(e,d){"object"==typeof exports&&"undefined"!=typeof module?d(exports):"function"==typeof define&&define.amd?define(["exports"],d):d((e=e||self).cy={})}(this,function(e){"use strict";var d="undefined"!=typeof window&&void 0!==window.flatpickr?window.flatpickr:{l10ns:{}},n={weekdays:{shorthand:["Sul","Llun","Maw","Mer","Iau","Gwe","Sad"],longhand:["Dydd Sul","Dydd Llun","Dydd Mawrth","Dydd Mercher","Dydd Iau","Dydd Gwener","Dydd Sadwrn"]},months:{shorthand:["Ion","Chwef","Maw","Ebr","Mai","Meh","Gorff","Awst","Medi","Hyd","Tach","Rhag"],longhand:["Ionawr","Chwefror","Mawrth","Ebrill","Mai","Mehefin","Gorffennaf","Awst","Medi","Hydref","Tachwedd","Rhagfyr"]},firstDayOfWeek:1,ordinal:function(e){return 1===e?"af":2===e?"ail":3===e||4===e?"ydd":5===e||6===e?"ed":7<=e&&e<=10||12==e||15==e||18==e||20==e?"fed":11==e||13==e||14==e||16==e||17==e||19==e?"eg":21<=e&&e<=39?"ain":""},time_24hr:!0};d.l10ns.cy=n;var a=d.l10ns;e.Welsh=n,e.default=a,Object.defineProperty(e,"__esModule",{value:!0})});

Some files were not shown because too many files have changed in this diff Show More