Compare commits

...

392 Commits

Author SHA1 Message Date
320d814df4 Bump version 2023-05-30 21:51:49 +03:00
8953017b9d Update copyright notice 2023-05-30 21:49:59 +03:00
874e896178 Fix post-installation sound check for a case with disabled mod_rewrite 2023-05-24 17:37:34 +03:00
973632b4ae Switch to a newer version of some Symfony components 2023-05-24 16:47:30 +03:00
5fa9663d99 Add check for null values for incoming params 2023-05-24 16:46:14 +03:00
1ed31ad638 Bump version 2022-10-22 01:06:02 +03:00
da94f781b3 Improve outlook for chat history items related to leaved messages 2022-10-21 01:43:23 +03:00
d4640219a6 Fix bug with invalid groups list setup for chat dialogs 2022-10-21 01:02:16 +03:00
1fc048fec9 Save correct number of a visitor's messages for threads related to offline messages 2022-10-15 01:26:11 +03:00
d6d5477022 Bump version 2022-06-28 18:56:47 +03:00
691bcfa061 Add button to show tracked path of a visitor into operator's chat window 2022-06-28 02:58:00 +03:00
3148db54b5 Fix typo in the comment 2022-06-28 02:56:45 +03:00
Fedor A. Fetisov
58ee240c80 Fix warning in login controller when checking non-existent login 2022-06-24 01:43:22 +03:00
ca090638da Fix PHP 8.1 compatibility issue with the inherited static variable 2022-06-17 01:59:30 +03:00
4f05231b04 Bump version 2022-05-06 23:55:36 +03:00
730577b4a4 Update copyright notices
Actualize the years
2022-05-06 23:54:45 +03:00
51f2c41b31
Merge pull request #264 from BFallert/temp_viewport_mobile
add viewport meta tag to control layout on mobile browsers
2022-01-25 17:01:20 +03:00
BFallert
2de3ac9044 viewport meta tag for mobile view for backend added 2022-01-17 12:07:50 +01:00
BFallert
09f632cc6d add viewport meta tag to control layout on mobile browsers 2022-01-17 10:53:36 +01:00
339da62a23 Bump version 2021-12-14 13:54:38 +03:00
5a4d3d420f Fix potential problem with some absent HTTP request headers 2021-12-03 20:25:25 +03:00
cd1e8adce3
Merge pull request #263 from jmechnich/check-user-agent
Check if HTTP_USER_AGENT is set, use empty string otherwise
2021-12-03 19:32:56 +03:00
jmechnich
e676ca47dc Check if HTTP_USER_AGENT is set, use empty string otherwise 2021-12-01 20:39:20 +01:00
637758c13e Bump version 2021-12-01 16:43:58 +03:00
6a0c067cef Fix issue with client-side detection of valid cookie domain
See https://mibew.org/forums/index.php/topic,192324.msg200169.html
2021-12-01 16:41:38 +03:00
a956f85fc7 Bump version 2021-11-04 17:11:32 +03:00
1a137bb683 Fix calculation of visitor's messages for old threads 2021-11-02 18:33:23 +03:00
57eacfb953 Remove redundant blank lines 2021-11-01 21:14:07 +03:00
88247f0de3 Switch to a new version of PHP_CodeSniffer 2021-11-01 21:13:52 +03:00
eb0bc9ae5c Bump version 2021-09-03 16:31:58 +03:00
7f133f17f7 Fix bug with tracking new visitors 2021-09-03 16:31:15 +03:00
944b0fe6c5 Bump version 2021-09-01 01:31:33 +03:00
eae2b3df81 Update i18n submodule 2021-09-01 01:28:19 +03:00
3b3abe615d Fix default value for samesite cookies property 2021-08-30 19:06:57 +03:00
756014d568 Add invitation sound check into the installation process 2021-08-29 23:36:35 +03:00
6d4c438d62 Add unique sound for invitations 2021-08-29 23:34:21 +03:00
5c2743c01a Add ogg/vorbis option for audio files 2021-08-29 23:02:41 +03:00
eeb660293c Style copy code button 2021-08-28 03:46:11 +03:00
01261f8c92 Implement simple button code copying 2021-08-28 03:40:34 +03:00
06078cc8e7 Implement sound notification on invitation to chat 2021-08-28 03:09:23 +03:00
a37ea34670 Merge branch 'cookies' into test 2021-08-28 01:13:07 +03:00
56418b1551 Mark all necessary cookies as SameSite=None if possible 2021-08-28 01:12:40 +03:00
dc9f128b79 Fix code style 2021-08-28 00:40:29 +03:00
2533b362ab Fallback to window-based chat in case of blocked third parties cookies
Also affects #261.
2021-08-27 23:10:41 +03:00
0c416c7d7c Add handler for exceptions on thread update related to cookies block (see also #258) 2021-08-27 15:00:22 +03:00
fd94b0108c Remove redundant legacy code 2021-08-27 13:04:57 +03:00
99fb30b0ec Remove redundant legacy code 2021-08-27 13:04:34 +03:00
81e2e345a7 Fix invalid behavior of invitations in case of blocked cookies 2021-08-27 03:24:06 +03:00
ce5071c3e3 Fix typo 2021-08-27 03:00:13 +03:00
1210561448 Implement prototype for invitation sound playback 2021-08-27 02:29:37 +03:00
9294697d58 Fix type 2021-08-27 02:21:58 +03:00
3a92a54cd5 Fix some real-world issues with invitation styles 2021-08-26 00:15:28 +03:00
b6a70659b1 Fix issue with invalid management of session cookies in some browsers leading to "attack of clones" 2021-08-24 22:41:20 +03:00
cd22f3e9d8 Fix damned cookies behaviour in modern chrome 2021-08-24 22:39:35 +03:00
8aba48a1d2 Remove obsolete code from init 2021-08-24 19:09:22 +03:00
Fedor A. Fetisov
423ef8d36f Set cookies on the client side as secure and safe to set as third party if possible 2021-08-24 17:26:28 +03:00
098abccde7 Fix code style 2021-08-24 17:21:09 +03:00
Fedor A. Fetisov
75aaaf21b7 Bump version 2021-07-13 14:07:10 +03:00
622027302f Switch to own PHP8 compatible fork of CanteenHTML5 2021-07-09 23:38:03 +03:00
5b999eff2d Fix warning in PHP 8.0 2021-07-09 01:39:50 +03:00
562eeceac2 Bump version 2021-07-08 23:52:07 +03:00
f9e0755b23 Fix typo in chat user model property 2021-06-15 01:09:18 +03:00
74b9faf7af
Merge pull request #259 from jmechnich/fix-ssl-icon-link
fix SSL lock icon link in chat
2021-06-15 01:07:04 +03:00
jmechnich
9978074fbc fix SSL lock icon link in chat 2021-06-11 21:42:17 +02:00
2df50d9096 Bump version 2021-05-18 18:00:17 +03:00
14aba49194 Update i18n submodule 2021-05-18 18:00:05 +03:00
17df9c8dbc Implement CAPTCHA for the form to send chat to email (fixes #255) 2021-05-18 15:28:44 +03:00
6dae66540d Make possible to disable sending a chat to email 2021-05-16 02:40:51 +03:00
0317979c92 Update i18n submodule 2021-04-23 13:49:22 +03:00
a4b3824a42 Fix typo in standard mail template 2021-04-15 22:01:23 +03:00
f1200c4999 Fix installer crash in absence of PDO and/or pdo_mysql extensions 2021-04-14 13:40:50 +03:00
d7365d719f Update i18n submodule 2021-04-14 12:32:43 +03:00
42f5c1a20a Fix issue with invitation to chat from inaccessible operator 2021-04-13 19:11:03 +03:00
74e69aa520 Fix issue with notices about non well formed numeric values 2021-04-09 16:45:46 +03:00
20da5d2f36 Fix possible type mismatch in track_visit_page func 2021-04-09 16:34:29 +03:00
fe951ad050 Update system requirements 2021-04-09 15:48:19 +03:00
Tsvetan Koshutanski
8edcc7e57f Update dependencies and routing.yml for PHP 7.4 2021-04-09 15:47:15 +03:00
Tsvetan Koshutanski
62ad932aa7 Properly check if variable is set before referencing it
For PHP 7.4
2021-04-09 15:24:01 +03:00
33fb35bd34 Fix returning value in get_group_email func 2021-04-09 15:05:16 +03:00
Tsvetan Koshutanski
003f98b18c Check if group is set
The actual value is possible to be null,
thus leading to PHP notice without the check.

For PHP7.4
2021-04-09 15:05:02 +03:00
6e3720f8e4 Bump version 2021-04-02 18:31:03 +03:00
Tsvetan Koshutanski
4f3d0a57f9 Change return type to empty string on bad incoming value 2021-03-29 17:24:50 +03:00
Tsvetan Koshutanski
f28659a025 Check variable is of type array before using it
For PHP 7.4
2021-03-29 17:24:29 +03:00
Tsvetan Koshutanski
026b463fb7 Ignore intellij folder 2021-03-29 17:22:46 +03:00
bfe0065f1c Bump version 2021-03-22 22:41:40 +03:00
91a1b1872c Fix style of generated operator code field 2021-03-22 22:41:35 +03:00
cf67b11295 Fix issue with double widget code in generated button 2021-03-22 22:41:26 +03:00
dd4169f815 Fix check of system requirements 2021-03-22 22:41:12 +03:00
dbe04bb342 Update system requirements 2021-03-18 18:42:33 +03:00
98f2b68560 Bump version 2021-03-18 16:53:01 +03:00
805bb610a5 Improve handle of network connection errors (fix #203) 2021-03-18 15:50:49 +03:00
3148d0eb2a Update i18n submodule 2021-03-18 02:45:19 +03:00
67439317c4 Make possible to switch tracking for each type of button (also, fix #239) 2021-03-18 02:38:19 +03:00
5e90541918 Fix minor style issue with survey button 2021-03-18 01:43:42 +03:00
704862faad Remove redundant required mark for avatar field 2021-03-17 15:50:49 +03:00
c8df65baee Add dark styles 2021-03-17 15:50:15 +03:00
49d86a55be Skip versioning for _all_ styles 2021-03-17 15:00:50 +03:00
de3db5527b Update copyright notices
Actualize the years
2021-01-29 21:39:18 +03:00
d115befab9 Improve cli tool for bulk update of headers 2021-01-29 21:38:39 +03:00
6b20d0c8b6 Upgrade several vulnerable build tools 2021-01-29 21:37:53 +03:00
b296525e39 Disable versioning for package-lock.json 2021-01-29 21:36:51 +03:00
7a16536341 Fix js code style 2021-01-29 19:55:51 +03:00
aa94e21602 Switch to a newer handlebars.js 2021-01-29 19:55:09 +03:00
bb932e5b9c Migrate build system to Gulp 4 2021-01-29 19:54:44 +03:00
a9ca845c80 Bump version 2020-12-25 23:59:54 +03:00
b8bad36510 Fix XSS in error message (thanks to Sharif aka Vincent Pentester) 2020-12-25 23:44:33 +03:00
1c3d9c98b4 Update i18n submodule 2020-10-25 16:01:08 +03:00
dc9577ff6a Bump version 2020-07-09 12:45:27 +03:00
2336e406f4 Fix XSS in vex messages 2020-07-09 12:45:04 +03:00
84f5bca0a9 Fix multiple XSS (thanks to adsec2s) 2020-07-09 11:16:53 +03:00
fb35d4fff9 Fix comment 2020-07-09 11:12:10 +03:00
ace1423a13 Bump version 2020-03-21 17:31:19 +03:00
3b9a8e5456
Merge pull request #247 from Mibew/debian_fix2
Remove possible tilda from a string of installed dependency.
2020-03-21 17:28:13 +03:00
c60b247ef7 Update copyright notices
Actualize the years
2020-03-21 17:01:34 +03:00
89f0f5c688 Remove possible tilda from a string of installed dependency.
Fix #246.
2020-03-19 18:56:12 +03:00
7bdf01d344 Bump version 2019-12-03 19:31:50 +03:00
c0d9a461af Switch to symfony/http-foundation ~2.8.52 (fix CVE-2019-18888) 2019-12-03 19:30:19 +03:00
1844d91893 Fix security issue in the build environment 2019-06-21 01:55:51 +03:00
1a3594311b Bump version 2019-06-02 22:56:17 +03:00
8b6dcf4db0 Fix typo in cookie name for minified popup state
Fixes #245
2019-05-27 18:23:07 +03:00
9d8e057410 Bump version 2019-04-19 13:38:16 +03:00
8a2586d01b Make possible to support PHP 7.3
Due to abandoned state of XaminProject/handlebars.php one had to switched to private repositories for stuff related to PHP implementation of Handlebars template engine
2019-04-17 18:36:50 +03:00
be5d5d182b Bump version 2019-02-19 16:22:34 +03:00
38b653d075 Fix bug with immutable group description in dialog forms
See https://mibew.org/forums/index.php/topic,192246.msg199920.html for details
2019-02-19 02:31:25 +03:00
88a1b978ce
Merge pull request #241 from Mibew/semver_fix
Loose down semantic versioning expressions
2019-01-23 10:34:07 +03:00
a2946bd67d Loose down semantic versioning expressions
See https://github.com/Mibew/geo-ip-plugin/issues/6 for details
2019-01-22 10:52:25 +03:00
410b925b8d Fix potential issue with incoming visitor name 2019-01-13 19:24:26 +03:00
4f9b48135c Update copyright notices
Actualize the years
2019-01-13 19:17:33 +03:00
5bc4698520 Get rid of get_get_param() function 2019-01-13 17:51:30 +03:00
0f64ad3674 Fix security issue in the build environment 2018-11-27 18:19:07 +03:00
93f949d914 Fix typo in comment 2018-11-26 22:00:13 +03:00
b971d2d85c Update i18n submodule 2018-11-19 19:48:41 +03:00
edd279ca8e Restore ability to reopen iframe with a standard style 2018-11-19 19:13:51 +03:00
525b7de7e2 Make possible to reopen iframe with a custom styled chat
Fixes #238
2018-11-19 19:02:48 +03:00
b6bfc39cbf Bump version 2018-11-19 16:46:52 +03:00
3f4420181c
Update list of official stable plugins in README 2018-11-17 00:49:16 +03:00
94eaed0b2c Update lodash dependency 2018-10-30 03:21:01 +03:00
Fedor A. Fetisov
d747568575 Update i18n submodule 2018-10-30 03:13:59 +03:00
2cda0cbb66 Update i18n submodule 2018-10-17 21:44:25 +03:00
d41db57211 Add link to privacy policy into the leaving message form 2018-10-17 21:41:02 +03:00
bc99761b7a Update i18n submodule 2018-10-17 19:46:20 +03:00
fc2c9d791a Add warnings about need for button regeneration 2018-10-17 19:35:51 +03:00
f9b6eeb92c Fix bug with misinterpretation of 0 as an operator code 2018-08-20 23:10:44 +03:00
2d60df2417 Bump version 2018-08-17 23:24:06 +03:00
6dc0bc8d34 Update i18n submodule 2018-08-17 19:27:23 +03:00
110322ab47 Fix invalid comment 2018-08-17 18:56:07 +03:00
e40be770c3
Merge pull request #235 from Mibew/gdpr
Add optional privacy link to pre-chat survey
2018-08-17 18:48:30 +03:00
d32f9c02ce Add optional privacy link to pre-chat survey
Fixes #227
2018-08-16 19:10:57 +03:00
83185a6b32 Fix invalid comment 2018-08-16 16:38:12 +03:00
a9644ddec1 Prepare database update for the next release 2018-08-16 16:37:08 +03:00
e9b29737c9
Merge pull request #234 from Mibew/mysql_fix
Add support for MySQL 8 (fixes #232)
2018-08-16 12:25:39 +03:00
4f03a73f9a Add support for MySQL 8 (fixes #232) 2018-08-09 16:04:31 +03:00
647bd84995 Update i18n submodule 2018-05-28 18:03:21 +03:00
eb60d6b39f Update i18n submodule 2018-05-28 17:54:28 +03:00
4d038b0777 Bump version 2018-05-25 13:19:55 +03:00
67b0a6005e
Add Mibew Open Street Map plugin to the list of official plugins 2018-05-23 18:25:11 +03:00
d605c80332 Update i18n submodule 2018-05-10 03:56:51 +03:00
98954281d5 Promote usage of Mibew:OpenStreetMap plugin instead of Mibew:GoogleMaps 2018-05-10 03:49:27 +03:00
58e0ddc952 Bump version 2018-04-19 22:30:33 +03:00
f1030c0298 Fix bug with the misbehaviour of the chat toggle
After minimizing the chat it was impossible to use it while browsing the site
2018-04-19 22:20:50 +03:00
9cb71e62c1 Bump version 2018-04-10 19:17:01 +03:00
60ff2c853c Update i18n submodule 2018-04-10 19:15:45 +03:00
6c4e883a8a Fix localization constant 2018-04-10 19:13:23 +03:00
25a4a3db40 Fix code style 2018-03-20 02:20:16 +03:00
5f2aab1501 Fix attempt to restore closed chat in popup 2018-03-20 02:17:14 +03:00
8a2fbc6f38 Fix coding style 2018-02-06 02:18:53 +03:00
2b6779af8f Fix handling of information on updates for absent plugins 2018-02-06 02:11:36 +03:00
efa1372cdc Fix handling of obsolete information on updates 2018-02-06 01:28:48 +03:00
Fedor A. Fetisov
64e902c5a1 Fix version number in VERSION.txt 2018-02-05 17:27:12 +03:00
ee97a2f932 Merge branch 'master' of github.com:Mibew/mibew 2018-02-05 16:42:14 +03:00
4960397655 Fix position of widget toggle element 2018-02-05 16:41:43 +03:00
da03edb665 Change all project related URLs to secure ones 2018-02-02 19:45:40 +03:00
712117dfc4 Update i18n submodule 2018-02-02 19:32:43 +03:00
048e2dd3f0 Update copyright notices
Actualize the years
2018-02-02 19:20:04 +03:00
3beed6b2ec
Merge pull request #221 from Mibew/responsive
Implement responsive design for mobile devices
2018-02-02 17:54:22 +03:00
c62a98b22a Make invitations to chat responsive 2018-01-27 00:57:10 +03:00
20d97e5bce Improve media query logic for responsive design
Fix footer width for mobile devices
2018-01-26 13:08:32 +03:00
2581119295 Restrict responsive design by media query 2018-01-24 18:18:57 +03:00
95c55aa931 Implement responsive design
See https://mibew.org/forums/index.php/topic,191515.msg199759.html for details
2018-01-23 17:45:48 +03:00
059bc5ac39 Update i18n submodule 2018-01-16 19:11:20 +03:00
324a85fb7f
Merge pull request #219 from Mibew/new_perms
New permissions
2018-01-16 18:33:46 +03:00
28e968b15f
Merge pull request #220 from Mibew/cluster_fix
Cluster fix
2018-01-16 18:32:56 +03:00
9d2c4404c0 Remove redundant blank line 2018-01-16 18:13:21 +03:00
d61b142e40 Add missed ids for all textareas 2018-01-16 17:26:28 +03:00
d1a1f51bf0 Wrap chat iframe into a div
This could help make the design responsive
2018-01-16 17:11:23 +03:00
0cf963ac5e Add primary key to revision database table
Fixes #218
2018-01-12 01:07:44 +03:00
5921115af0 Bump version 2018-01-12 01:07:03 +03:00
87d7478864 Fix min PHP version in installer 2018-01-12 01:00:09 +03:00
3179d5b669 Disable management of canned messages for all but admins 2018-01-12 00:32:18 +03:00
8ced21fe86 Hide system information from anyone but admins 2018-01-11 23:35:13 +03:00
84e4de1e7a Add new permission to control access to system statistics 2018-01-11 23:26:13 +03:00
39309d1914 Bump version 2017-11-29 16:46:58 +03:00
194b396788 Remove duplicate license headers from compiled js files 2017-11-28 17:14:46 +03:00
7dd32257d1 Add missed localization for installation steps list 2017-11-22 14:30:49 +03:00
6de62a6929 Don't attach translation.js when in the maintenance mode
Also not sure but maybe it has something to do with #207.
2017-11-22 14:28:37 +03:00
1c6433eb73 Switch to actual handlebars.js library 2017-11-22 14:22:06 +03:00
762998cd4b Update i18n submodule 2017-11-14 22:45:51 +03:00
73abafebac Fix typo in the message 2017-11-14 22:39:24 +03:00
81cd6f75fe Update i18n submodule 2017-11-14 22:24:31 +03:00
42f28a72da Update i18n submodule 2017-11-13 00:20:05 +03:00
69916d8f6d Update i18n submodule 2017-11-12 21:18:14 +03:00
ec2e29083b Bump version 2017-11-12 18:38:53 +03:00
98a5570ef6 Notify operator of potentially irreversible permissions change 2017-11-12 18:36:24 +03:00
3ec1610fff Make possible to remove first user (Fixes #210) 2017-11-12 17:59:50 +03:00
bc39c22c29 Disable versioning for CDN files 2017-11-12 04:39:03 +03:00
2e3b718fe2 Merge branch 'master' of github.com:Mibew/mibew 2017-11-12 04:11:07 +03:00
be8182ffcc Improve gulpfile
Add and fix comments, improve organization and code style
2017-11-12 03:59:14 +03:00
dfaaffcff4 Add new gulp tasks
New tasks intends to automate the process of release uploading to CDN
2017-11-12 02:21:02 +03:00
de782c7fea Automate i18n archives creation via gulp 2017-11-11 02:44:40 +03:00
3ea37e0e11 Create release archives with top-level dir 2017-11-10 18:17:12 +03:00
0f1407682e Fix bug in handle of dirs in gulp 2017-11-10 18:15:59 +03:00
e40e821b5f Add i18n repo as a submodule 2017-11-10 17:05:04 +03:00
31ad9138ef Fix typo in the default config 2017-11-06 02:28:52 +03:00
9cd07fe829 Merge branch 'master' of github.com:Mibew/mibew 2017-11-01 04:26:24 +03:00
4dec01bdaa Correct a bunch of incomplete names of Mibew Messenger 2017-11-01 04:26:08 +03:00
e64670e5aa Fix code style 2017-10-28 01:52:16 +03:00
7c07d7f3e2
Merge pull request #214 from Mibew/fs_fix
Make possible to force secure URLs for iframe styles
2017-10-27 23:23:44 +03:00
f9c5d4dbaf
Merge pull request #213 from Mibew/stats
Make statistics compatible with the default MySQL 5.7 settings
2017-10-27 23:23:26 +03:00
52f203b43d Fix typo in comment 2017-10-18 16:17:46 +03:00
35d80bdcee Fix code style 2017-10-13 19:44:23 +03:00
a6b7367002 Make possible to force secure URLs for iframe styles (Fixes #206) 2017-10-13 19:41:00 +03:00
75c04cae38 Fix potential issue with fallback front page 2017-10-11 16:27:16 +03:00
915b6786d9 Fix erroneous confirmation message 2017-10-11 15:26:18 +03:00
b561f7eec8 Make statistics compatible with the default MySQL 5.7 settings
See
https://mibew.org/forums/index.php/topic,192176.msg199690 for details
2017-10-05 11:38:43 +03:00
89556ae68f Create template for PRs 2017-10-03 19:34:22 +03:00
33149aafb9 Create template for issues 2017-10-03 19:28:35 +03:00
edf8850952 Make symbolic link to license relative 2017-10-03 18:47:56 +03:00
393bf21f30 Add license in Github-compatible way 2017-10-03 18:45:20 +03:00
03a2051ad7 Fix bug with disappearing toggle control (Fixes #209) 2017-10-03 01:41:57 +03:00
51ad3e70d3 Fix unhandled error in plugins list discovering 2017-09-22 17:27:34 +03:00
9417960281 Update the server requirements in README 2017-07-17 19:38:45 +03:00
a312bc5e8f Bump version 2017-07-06 16:10:15 +03:00
a617eebeec Prevent unauthorized access to chat history 2017-07-06 16:00:06 +03:00
38e53aaa6a Bump version 2017-06-27 14:50:02 +03:00
8b6d411d58 Merge pull request #204 from Mibew/styles_fix
Styles fix
2017-06-15 19:34:14 +03:00
1b436f9535 Fix setting of the invitation style 2017-06-15 19:28:47 +03:00
64fccc272c Fix typo in comment 2017-06-09 01:01:51 +03:00
ead790853e Fix setting of the chat style 2017-06-05 18:34:13 +03:00
Fedor A. Fetisov
47e7a81f6f Update year in visible copyright notices 2017-05-26 22:23:30 +03:00
Fedor A. Fetisov
73b11b48af Fix code style 2017-05-26 16:07:26 +03:00
Fedor A. Fetisov
5bb282b3bd Bump version 2017-05-26 16:03:08 +03:00
Fedor A. Fetisov
9608c5a83d Update copyright notice 2017-05-26 16:02:42 +03:00
568e539e49 Merge branch 'ipv6' 2017-05-26 15:42:18 +03:00
Fedor A. Fetisov
8c99b13e12 Improve algorithm in setting the value for a visitor's IP 2017-05-25 12:01:11 +03:00
35bbb22c56 Fix a typo 2017-05-24 16:52:30 +03:00
Fedor A. Fetisov
169b8d3b76 Fix clean task of Gulp
Task 'clean' now compatible with multiple styles (Fixes #200)
2017-05-23 17:12:42 +03:00
d8a63bc2cd Fix invalid algorithm in setting the value for a visitor's IP 2017-05-23 16:16:00 +03:00
f105a0b5d2 Fix inline doc for get_remote_host() 2017-05-22 02:03:29 +03:00
843a6e11ae Define correct remote IP for a visitor (with IPv6 support)
See #197
2017-05-22 02:02:31 +03:00
a5320b07d7 Add Mibew Operator Status to the list of official plugins 2017-03-21 15:31:49 +03:00
3eafe870bc Add Mibew Slack to the list of official plugins 2017-03-18 01:00:59 +03:00
82704cfbd6 Improve instruction for update (Fixes #189) 2017-03-18 00:57:05 +03:00
88ba0f148e Merge pull request #199 from Mibew/gulp_promise
Use promises to build all the styles
2017-03-18 00:49:54 +03:00
Dmitriy Simushev
19376e7f6c More promises to gulpfile.js! 2017-03-16 23:46:01 +03:00
Dmitriy Simushev
3ae6e5cdb4 Use promises to build all the styles 2017-03-13 14:29:16 +03:00
29c9d8dc7d Specify minimal version of Node.js in package.json 2017-03-10 18:07:17 +03:00
7c822661e6 Merge pull request #195 from Mibew/styles
Improve gulp file
2017-03-10 01:56:57 +03:00
3a85c9060b Add watch task (see #179) 2017-03-10 01:45:23 +03:00
834e75cdd6 Compile all styles (see #179) 2017-03-10 01:44:53 +03:00
6ea5f5af11 Merge pull request #194 from Mibew/trusted_proxies
Add "trusted_proxy" option
2017-03-10 00:00:18 +03:00
e2099735e1 Make existing configs backwards compatible with the trusted_proxies option 2017-03-09 23:58:13 +03:00
Dmitriy Simushev
8b1e218862 Add "trusted_proxy" option
Fixes #188
2017-03-09 13:34:57 +00:00
e718518698 Fix permissions for release archives 2017-02-08 10:41:35 +03:00
cc55a13151 Make handlebars cache adapter compatible with the new version of handlebars.php 2016-12-29 18:23:41 +03:00
0fc11b3885 Merge pull request #185 from Mibew/x 2016-12-29 17:50:08 +03:00
16b7297d19 Merge pull request #184 from Mibew/fix_143 2016-12-29 17:49:37 +03:00
1683b7c72a Fix invalid comment 2016-12-29 17:42:11 +03:00
f4ad0a2351 Prevent unnecessary increment of thread revision value
Fixes #149
2016-12-29 17:37:40 +03:00
7f6b193656 Clear routes from cache when a plugin becomes initialized or non-initialized for the first time
Fixes #143
2016-12-29 02:56:50 +03:00
15dbe153f5 Implement cache for Plugin Manager 2016-12-28 19:51:11 +03:00
547efb38e4 Load plugins after the cache initialization 2016-12-28 19:31:22 +03:00
f44ccdc4e1 Remove irrelevant comment 2016-12-28 19:19:44 +03:00
1549125665 Fix bug with failed initialization of plugins that does not need config at all 2016-12-28 19:18:46 +03:00
cf76dd744d Store plugin initialization status in the database 2016-12-28 17:30:33 +03:00
57afba72e8 Update database schema
Add into the plugins table a column to store last known initialization status
2016-12-28 03:55:18 +03:00
3f97ad09df Bump version 2016-12-28 03:53:39 +03:00
00213f806c Implement minification of the chat iframe
Fixes #153
2016-12-28 03:30:02 +03:00
d0f1c50f51 Implement toggle method for iframe-based chat popup 2016-12-27 19:39:11 +03:00
bc16b7c25f Update list of repos in README 2016-12-27 17:56:18 +03:00
5424424eaf Remove duplicate init for isOnline 2016-12-26 18:26:22 +03:00
7aed881f08 Fix naming for the new template variable 2016-12-26 18:22:51 +03:00
ca169c5bc7 Make possible to determine whether an operator is online at any page of the administrative interface
Fixes #181
2016-12-24 03:33:49 +03:00
7041adcdfb Remove built-in (and broken) geo location feature from the core
Fixes #173
2016-12-23 17:35:42 +03:00
ffcdb223cc Fix typos in comments 2016-12-23 15:33:49 +03:00
c70bdfcd90 Prevent system from using uninitialized values when configuration doesn't exists 2016-12-23 15:32:14 +03:00
d512573af8 Make sure that configuration file exist
Fixes #105
2016-12-23 15:21:13 +03:00
0527a9def1 Remove double escape of values in the tracked path of a visitor.
Fixes #137
2016-12-23 14:43:19 +03:00
09ef31e750 Update versions requirements for Gulp 2016-12-08 18:10:19 +03:00
9213453bc3 Merge pull request #176 from J-Fricke/php7
Implement PHP7 compatibility
2016-11-18 14:07:35 +03:00
Joshua Fricke
8c3cbf0489 feat: set min version for xamin/handlebars.php to ~0.10.3 2016-11-02 14:55:13 -07:00
Joshua Fricke
45ac4ec1ee feat: update justblackbird/handlebars.php-helpers dependency to v1
* update .../String namespace to .../Text in Handlebars/Helpers.php
2016-09-22 13:42:12 -07:00
e3123d7c45 Update forgotten version number 2016-08-10 18:02:42 +03:00
680059dece Fix code styling in the contributed code 2016-08-09 18:21:25 +03:00
e9526daf1c Bump version 2016-08-09 18:07:11 +03:00
a2774b8fb9 Merge pull request #171 from Mibew/nav666-patch-1
Try to initialize session only once
2016-08-09 18:01:02 +03:00
5618a334d9 Merge pull request #170 from Mibew/Silron88-patch-2
Fix possible duplicate messages on submit
2016-08-09 17:54:17 +03:00
Silron88
8b32bebdc2 fix: if click send and before message is sended click send again then message will be duplicated 2016-08-08 18:51:54 +03:00
788a18f7f1 Merge branch 'patch-1' of https://github.com/nav666/mibew into nav666-patch-1 2016-08-08 18:40:57 +03:00
ad186da482 Update copyright notices 2016-08-08 18:31:45 +03:00
345cb1748a Merge pull request #167 from candido1212/patch-1
Add missing localization constant
2016-08-08 17:25:12 +03:00
e8f07d27ef Merge pull request #168 from nav666/patch-2
Fix issue with invalid default weight for memcached server in config
2016-08-08 17:24:08 +03:00
e64fe1eb17 Bump version 2016-06-28 16:20:12 +03:00
Dmitriy Simushev
e6dfd1dfec Fix unused vars in JS code 2016-06-09 20:55:59 +00:00
Dmitriy Simushev
a56e775ab9 Make ES lint stop nagging about unused argument of catch statement 2016-06-08 18:20:00 +00:00
Dmitriy Simushev
ce3a59b13c Remove unreachable js code 2016-06-04 14:03:37 +00:00
Dmitriy Simushev
85d1acad5e Refer to jQuery as 'jQuery' and not '$' 2016-06-04 14:02:05 +00:00
Dmitriy Simushev
13dd999158 Add all missed semicolons to JS app
Yes, I know about ASI and that the simicolons are not actually
needed in most cases, but I belive the code looks better when
semicolons are in places.
2016-06-03 14:23:17 +00:00
Dmitriy Simushev
cb3bd91b76 Fix indent in JS app 2016-06-03 13:34:55 +00:00
Dmitriy Simushev
d5130ed655 Make sure all for-in loops works as expected 2016-06-02 23:20:24 +00:00
Dmitriy Simushev
199438285c Merge branch 'stweil-typos' 2016-06-02 12:09:21 +00:00
Stefan Weil
a149731c46 Fix some typos in variable names and strings
Most of them were found by codespell.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-05-30 23:00:08 +02:00
Dmitriy Simushev
2e629df611 Add gulp task for JavaScript files linting 2016-05-30 13:15:50 +00:00
Dmitriy Simushev
fcdc1021af Merge branch 'stweil-typos' 2016-05-28 10:11:03 +00:00
Stefan Weil
ce5cbaa850 Fix some typos in comments (most of them found by codespell)
Fix also an error string in Updater.php.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-05-28 12:02:30 +02:00
dcd243505d Merge pull request #155 from aburakovskiy/master
Add ability to ban forever
2016-05-04 20:05:11 +03:00
Alexander Burakovskiy
4d32e942a3 Add ability to ban forever 2016-05-04 13:14:10 +03:00
nav666
95909d7ed4 Update default_config.yml 2016-04-07 02:41:19 +03:00
nav666
fad8ca5854 Update init.php 2016-04-07 02:24:01 +03:00
Candido
cd3778ca0d Add translate to string "cannot load avatar" 2016-03-07 11:27:35 -03:00
Dmitriy Simushev
8fe1498847 Merge pull request #151 from aburakovskiy/master
Fix thread ban
2016-03-01 13:59:40 +03:00
Alexander Burakovskiy
0edc9657b4 Fix thread ban 2016-02-25 14:53:15 +02:00
9fe423db62 Fix syntax errors 2015-08-23 22:15:10 +03:00
Dmitriy Simushev
a9e7114375 Reduce duplication in get_operators_from_adjacent_groups function 2015-08-05 14:38:49 +00:00
Dmitriy Simushev
e150bd1d26 Mark get_all_groups_for_operator function as deprecated 2015-08-05 14:35:13 +00:00
Dmitriy Simushev
4c9f963aa7 Fix groups isolation
See #131 for details
2015-08-05 14:22:56 +00:00
Dmitriy Simushev
9d81661cfe Fix history for operator without colleagues whose threads he can view
Fixes #132
2015-08-05 13:48:42 +00:00
fcd3cacfbc Add brief update instruction into README 2015-07-24 13:23:42 +03:00
Dmitriy Simushev
3edc959096 Bump version 2015-07-14 11:38:49 +00:00
Dmitriy Simushev
d656d8fe38 Update PHPCode Sniffer 2015-07-08 10:07:11 +00:00
Dmitriy Simushev
eccbb59bcc Require PHP's mbstring extension
Fixes #125
2015-06-19 11:26:03 +00:00
Dmitriy Simushev
8457e51717 Add THREAD_USER_IS_READY event 2015-06-19 11:15:07 +00:00
Dmitriy Simushev
227c7a9410 Localize message about no available updates at the "About" page 2015-06-10 13:02:01 +00:00
Dmitriy Simushev
9c92fda11b Localize "Download" link caption at the "About" page 2015-06-10 12:54:34 +00:00
Dmitriy Simushev
896f090aba Show history for group's related threads when isolation is on 2015-06-10 08:37:54 +00:00
Dmitriy Simushev
5363698020 Make sure appropriate defaults for omitted configs are used 2015-06-08 14:20:45 +00:00
Dmitriy Simushev
aa0c213cc3 Deny access for another's history in groups isolation mode 2015-06-08 14:18:39 +00:00
Dmitriy Simushev
5009f51342 Deny access to history for operators without CAN_VIEWTHREADS permission 2015-06-08 10:08:27 +00:00
Dmitriy Simushev
b340206d3a Merge branch 'auto_update' 2015-06-05 14:47:12 +00:00
Dmitriy Simushev
2cbb0c4134 Set correct instance ID when checking updates manually 2015-06-05 14:38:18 +00:00
Dmitriy Simushev
8c574ec88c Update Updates Server URL one more time 2015-06-05 14:28:12 +00:00
Dmitriy Simushev
5af9f92102 Send instance ID to the updates server 2015-06-05 11:53:39 +00:00
Dmitriy Simushev
6bf331b355 Rename "available_update" table to "availableupdate"
This is needed to follow naming convention
2015-06-05 11:39:44 +00:00
Dmitriy Simushev
4b74ceb854 Fix "available_update" table schema 2015-06-05 11:34:13 +00:00
Dmitriy Simushev
25054c4e0f Add "_instance_id" setting 2015-06-05 11:33:19 +00:00
Dmitriy Simushev
fbe53e3b29 Create getter for update checker inside the cron worker 2015-06-05 09:45:25 +00:00
Dmitriy Simushev
5397f7014a Fix default URL of updates server 2015-06-04 10:16:51 +00:00
Dmitriy Simushev
ebb3cf8ab1 Use the latest version of JSON2 from Douglas Crockford's repository 2015-06-01 13:35:58 +00:00
Dmitriy Simushev
55e7dbe704 Update Bower dependencies
Backbone.js and Underscrore.js left untouched because of versions
conflict with Marionette.js
2015-06-01 13:28:07 +00:00
Dmitriy Simushev
f13d938bde Update build dependencies 2015-06-01 13:08:15 +00:00
Dmitriy Simushev
0ff5c7c28a Fix localization constant at locale edit page 2015-05-28 14:42:10 +00:00
Dmitriy Simushev
fc789e6ef9 Improve statistics aggregation algorithm a little 2015-05-28 13:49:42 +00:00
Dmitriy Simushev
9f3ce28877 Remove unused "use" statement 2015-05-28 13:22:46 +00:00
Dmitriy Simushev
4e7f9eac50 Provide a way to disable automatical updates checking 2015-05-26 14:45:34 +00:00
Dmitriy Simushev
2fc85b1068 Add "check for updates" button to "about" page 2015-05-26 14:19:09 +00:00
Dmitriy Simushev
930ea9a6ac Show info about cURL extension at "About" page 2015-05-26 13:54:39 +00:00
Dmitriy Simushev
d4ebd68052 Show list of available updates at "About" page 2015-05-26 13:53:22 +00:00
Dmitriy Simushev
e9d41c4869 Fix name of "available_update" table 2015-05-26 13:34:58 +00:00
Dmitriy Simushev
577c2be622 Create a way to automatically get info about available updates 2015-05-26 13:19:13 +00:00
Dmitriy Simushev
8e7fe6bcd7 Remove debug statements from CronWorker 2015-05-26 12:17:32 +00:00
Dmitriy Simushev
973cc5746e Remove unused "use" statement 2015-05-22 12:55:49 +00:00
Dmitriy Simushev
8326eb3ebf Merge branch 'editable_locales'
This allows to edit locales meta info using UI
2015-05-22 12:22:27 +00:00
Dmitriy Simushev
e9baceb039 Add an ability to change locale setting using UI
Fixes #99
2015-05-22 11:26:48 +00:00
Dmitriy Simushev
720b72f8e4 Use the latest version of PHPCS from the repository 2015-05-22 10:59:46 +00:00
a3ebe57f1f Bump version 2015-05-22 13:40:33 +03:00
Dmitriy Simushev
d9dc5e0ed7 Fix password form disapearing on installation 2015-05-21 14:09:28 +00:00
Dmitriy Simushev
bc024c3253 Fix layout for install and login pages 2015-05-21 13:58:54 +00:00
Dmitriy Simushev
137d92624e Store locales' meta info in the database 2015-05-21 12:39:36 +00:00
Dmitriy Simushev
5d13afd8f6 Make sure visitor name is not empty in prechat survey 2015-05-08 14:54:53 +00:00
Dmitriy Simushev
5628f42782 Make sure Thread::groupId is always integer
See https://mibew.org/forums/index.php/topic,191756.0.html for details
about why it's needed.
2015-05-08 12:46:50 +00:00
Dmitriy Simushev
eae5b8bb06 Make rewrite rules work with old Apache
See https://mibew.org/forums/index.php/topic,191761.0.html
2015-05-07 14:17:14 +00:00
Dmitriy Simushev
40fef4e360 Fix "replace" Handlebars.js helper 2015-05-07 13:23:53 +00:00
Dmitriy Simushev
ab35143e18 Add gulp "rebuild" task 2015-04-17 14:18:59 +00:00
Dmitriy Simushev
f176ac628b Use clean inside "default" gulp task 2015-04-17 13:07:25 +00:00
Dmitriy Simushev
7a09546198 Fix docs for EventDispatcher\Events::BUTTON_GENERATE const 2015-04-15 14:30:44 +00:00
Dmitriy Simushev
47672a5eb6 Fix gulp clean task 2015-04-14 11:43:56 +00:00
Dmitriy Simushev
3307ba01dc Fix bug with race condition on build 2015-04-14 11:39:33 +00:00
7d3558460b Bump version 2015-04-14 13:47:23 +03:00
Dmitriy Simushev
2fdb7e4525 Update copyrights in the default page style CSS file 2015-04-08 09:46:10 +00:00
Dmitriy Simushev
48d8805605 Add "Show menu" link at awaiting users page
Fixes #95
2015-04-08 09:44:05 +00:00
Dmitriy Simushev
e4a104f52e Add CLI cron worker 2015-04-01 15:28:10 +00:00
Dmitriy Simushev
ff09ea09cc Extract CronWorker from CronController 2015-04-01 15:24:51 +00:00
Dmitriy Simushev
a4ce7ffea7 Clean up before release preparation 2015-03-31 10:54:34 +00:00
0f8b5da18a Bump version 2015-03-30 14:10:55 +03:00
Dmitriy Simushev
1a358c2f09 Don't call set_csrf_token() function in controllers 2015-03-27 15:19:10 +00:00
Dmitriy Simushev
b56881bf01 Mark Database::throwExeptions method as deprecated
This is done because the method has a typo in the name.
2015-03-27 15:05:17 +00:00
Dmitriy Simushev
59de37a12b Automatically reject invitation when visitor goes to another page 2015-03-27 14:34:53 +00:00
Dmitriy Simushev
2a819b1b98 Allow using "?" and "*" wildcards for history search 2015-03-27 13:29:12 +00:00
Dmitriy Simushev
a9eb9f8cf2 Mark thread as chatting right after an invitation is accepted 2015-03-27 12:31:11 +00:00
Dmitriy Simushev
70f630d125 Rewrite Thread::take method to simplify it 2015-03-27 12:29:54 +00:00
Dmitriy Simushev
0075e2169c Add a function that loads online operators 2015-03-26 10:46:50 +00:00
Dmitriy Simushev
f47a67fd57 Notify operators only about threads that are waiting for the answer 2015-03-25 14:41:42 +00:00
Dmitriy Simushev
b2bb9cfb92 Do not show alert if another one is already shown 2015-03-25 14:28:03 +00:00
565 changed files with 11787 additions and 1590 deletions

18
.gitignore vendored
View File

@ -1,6 +1,11 @@
# IDE folders
.idea
src/mibew/install/package
src/absent_*
src/release*
src/upload*
src/*.po
# Do not index actual configuration files
src/mibew/configs/config.yml
@ -33,17 +38,18 @@ src/mibew/js/vendor
# Do not index node.js modules that are used for building
src/node_modules
src/package-lock.json
# Do not index compiled js files of the core
src/mibew/js/compiled/*
!src/mibew/js/compiled/.keep
# Do not index compiled files of chat styles
src/mibew/styles/chats/default/templates_compiled/client_side/*
!src/mibew/styles/chats/default/templates_compiled/client_side/.keep
src/mibew/styles/chats/default/js/compiled/*
!src/mibew/styles/chats/default/js/compiled/.keep
src/mibew/styles/chats/*/templates_compiled/client_side/*
!src/mibew/styles/chats/*/templates_compiled/client_side/.keep
src/mibew/styles/chats/*/js/compiled/*
!src/mibew/styles/chats/*/js/compiled/.keep
# Do not index compiled files of page styles
src/mibew/styles/pages/default/templates_compiled/client_side/*
!src/mibew/styles/pages/default/templates_compiled/client_side/.keep
src/mibew/styles/pages/*/templates_compiled/client_side/*
!src/mibew/styles/pages/*/templates_compiled/client_side/.keep

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "src/i18n"]
path = src/i18n
url = git@github.com:Mibew/i18n.git

12
ISSUE_TEMPLATE.md Normal file
View File

@ -0,0 +1,12 @@
### Environment
* Mibew Messenger version:
* OS:
* Web server:
* PHP:
* PHP extensions:
* MySQL:
### Expected behavior
### Actual behavior
### Steps to reproduce the behavior

1
LICENSE Symbolic link
View File

@ -0,0 +1 @@
./src/mibew/LICENSE.txt

8
PULL_REQUEST_TEMPLATE.md Normal file
View File

@ -0,0 +1,8 @@
Fixes # .
Changes proposed in this pull request:
-
-
-
@Mibew/core-developers

View File

@ -11,7 +11,7 @@ This repository contains the core of Mibew Messenger application.
## Server requirements
1. A webserver or web hosting account running on any major Operating System
2. PHP (5.3.3 and above) with PDO, pdo_mysql and gd extensions
2. PHP (7.2.5 and above) with PDO, pdo_mysql, cURL, mbstring and gd extensions
3. MySQL 5.0 and above
## Build from sources
@ -33,7 +33,39 @@ Mibew Messenger is licensed under the terms of [Apache License, Version 2.0](htt
## Other repositories of the Mibew project
### Actual
1. [Mibew Messenger i18n repository](https://github.com/Mibew/i18n)
2. [Mibew Messenger design repository](https://github.com/Mibew/design)
3. [Mibew Java applications repository](https://github.com/Mibew/java)
4. [Mibew Tray repository](https://github.com/Mibew/tray)
3. [Mibew documentation repository](https://github.com/Mibew/docs.mibew.org)
### Obsolete
1. [Mibew Java applications repository](https://github.com/Mibew/java)
2. [Mibew Tray repository](https://github.com/Mibew/tray)
### Plugins
1. [Mibew Boilerplate plugin](https://github.com/Mibew/boilerplate-plugin) - a template for a real plugin
#### Ready for production use
1. [Mibew Advanced Button plugin](https://github.com/Mibew/advanced-button-plugin)
2. [Mibew Auto Invite plugin](https://github.com/Mibew/auto-invite-plugin)
3. [Mibew Auto Reply plugin](https://github.com/Mibew/auto-reply-plugin)
4. [Mibew Broadcast plugin](https://github.com/Mibew/broadcast-plugin)
5. [Mibew Bulk Logs Operations plugin](https://github.com/Mibew/bulk-logs-operations-plugin)
6. [Mibew Button Refresh plugin](https://github.com/Mibew/button-refresh-plugin)
7. [Mibew Emoji plugin](https://github.com/Mibew/emoji-plugin)
8. [Mibew Filter Visitors By Operator Code plugin](https://github.com/Mibew/filter-visitors-by-operator-code-plugin)
9. [Mibew First Message plugin](https://github.com/Mibew/first-message-plugin)
10. [Mibew Geo IP plugin](https://github.com/Mibew/geo-ip-plugin)
11. [Mibew Google Maps plugin](https://github.com/Mibew/google-maps-plugin)
12. [Mibew Open Street Map plugin](https://github.com/Mibew/open-street-map-plugin)
13. [Mibew Operator Status plugin](https://github.com/Mibew/mibew-operator-status-plugin)
14. [Mibew Purge History plugin](https://github.com/Mibew/purge-history-plugin)
15. [Mibew Real Ban plugin](https://github.com/Mibew/real-ban-plugin)
16. [Mibew Slack plugin](https://github.com/Mibew/mibew_slack)
17. [Mibew Title Notification plugin](https://github.com/Mibew/title-notification-plugin)
#### Not ready for production use (not stable, broken, obsolete, etc.)
1. [Mibew External API plugin](https://github.com/Mibew/external-api-plugin)

27
src/.eslintrc Normal file
View File

@ -0,0 +1,27 @@
{
"extends": "eslint:recommended",
"rules": {
"indent": ["error", 4, {"SwitchCase": 1}],
"no-trailing-spaces": "error",
"semi": ["error", "always"],
"guard-for-in": "error",
"no-unused-vars": ["error", {"caughtErrors": "none", "args": "none"}]
},
"globals": {
"Mibew": true,
"MibewAPI": true,
"MibewAPIInteraction": true,
"MibewAPIChatInteraction": true,
"MibewAPIUsersInteraction": true,
"MibewAPIExecutionContext": true,
"Handlebars": true,
"_": true,
"Backbone": true,
"jQuery": true,
"vex": true,
"validator": true
},
"env":{
"browser": true
}
}

View File

@ -3,13 +3,13 @@
"private": true,
"dependencies": {
"underscore": "1.8.2",
"json": "2012.10.08",
"jquery": "1.11.2",
"json": "https://github.com/douglascrockford/JSON-js.git#c98948ae1944a28e2e8ebc3717894e580aeaaa05",
"jquery": "1.11.3",
"backbone": "1.1.2",
"marionette": "2.4.1",
"handlebars": "3.0.0",
"handlebars": "4.3.0",
"vex": "2.3.2",
"validator-js": "3.34.0"
"validator-js": "3.40.0"
},
"resolutions": {
"underscore": "1.8.2"

View File

@ -1,39 +1,49 @@
{
"name": "mibew/mibew",
"version": "2.0.0-beta.4",
"version": "3.6.0",
"description": "Mibew Messenger - open-source live support application",
"type": "project",
"homepage": "http://mibew.org",
"homepage": "https://mibew.org",
"license": "Apache-2.0",
"authors": [
{
"name": "Mibew Messenger Project",
"homepage": "http://mibew.org/credits"
"homepage": "https://mibew.org/credits"
}
],
"support": {
"email": "support@mibew.org",
"issues": "https://github.com/mibew/mibew/issues",
"forum": "http://mibew.org/forums",
"forum": "https://mibew.org/forums",
"source": "https://github.com/mibew/mibew"
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/mibew/handlebars.php"
},
{
"type": "vcs",
"url": "https://github.com/mibew/handlebars.php-helpers"
}
],
"require": {
"xamin/handlebars.php": "0.10.*",
"justblackbird/handlebars.php-helpers": "~0.2.1",
"symfony/http-foundation": "2.6.*",
"symfony/routing": "2.6.*",
"symfony/config": "2.6.*",
"symfony/yaml": "2.6.*",
"mibew/handlebars.php": "~0.10.5",
"mibew/handlebars.php-helpers": "1.*",
"symfony/http-foundation": "4.4.*",
"symfony/routing": "4.4.*",
"symfony/config": "4.4.*",
"symfony/yaml": "^5.2",
"symfony/translation": "2.6.*",
"tedivm/stash": "0.12.*",
"canteen/html5": "1.1.*",
"mibew/html5": "1.1.*",
"vierbergenlars/php-semver": "3.0.*",
"swiftmailer/swiftmailer": "~5.4.0",
"ua-parser/uap-php": "~3.4.1",
"ua-parser/uap-php": "^3.9",
"true/punycode": "~1.1"
},
"require-dev": {
"squizlabs/php_codesniffer": "2.*"
"squizlabs/php_codesniffer": "3.*"
},
"config": {
"vendor-dir": "mibew/vendor"

View File

@ -1,12 +1,14 @@
// Initialize requirements
var fs = require('fs'),
https = require('https'),
exec = require('child_process').exec,
eventStream = require('event-stream'),
runSequence = require('run-sequence'),
runSequence = require('gulp4-run-sequence'),
through = require('through2'),
lodash = require('lodash'),
PoFile = require('pofile'),
strftime = require('strftime'),
del = require('del'),
bower = require('bower'),
gulp = require('gulp'),
uglify = require('gulp-uglify'),
@ -23,9 +25,12 @@ var fs = require('fs'),
chmod = require('gulp-chmod'),
xgettext = require('gulp-xgettext'),
concatPo = require('gulp-concat-po'),
rename = require('gulp-rename');
rename = require('gulp-rename'),
eslint = require('gulp-eslint'),
removeDuplicateHeaders = require('mibew-gulp-greh'),
mkdirp = require('mkdirp');
// Set global configs.
// Set global configuration
var config = {
mibewPath: 'mibew',
configsPath: 'mibew/configs',
@ -37,46 +42,83 @@ var config = {
jsPath: 'mibew/js',
chatStylesPath: 'mibew/styles/chats',
pageStylesPath: 'mibew/styles/pages',
i18nPath: 'i18n',
i18nPrefix: 'mibew-i18n-',
releasePath: 'release',
uploadPath: 'upload',
compiledTemplatesHeader: fs.readFileSync('tools/compiled_templates_header.txt'),
getComposerUrl: 'https://getcomposer.org/installer',
phpBin: 'php -d "suhosin.executor.include.whitelist = phar"',
package: require('./composer.json')
phpBin: 'php -d "suhosin.executor.include.whitelist = phar" -d "memory_limit=512M"',
package: require('./composer.json'),
msginit: 'msginit',
msgcat: 'msgcat'
}
config.i18nSuffix = '-' + config.package.version + '-' + strftime('%Y%m%d');
// Tasks for cleaning //////////////////
// Checks all PHP files with PHP Code Sniffer.
gulp.task('phpcs', ['composer-install-dev'], function() {
return gulp.src([
config.mibewPath + '/**/*.php',
'!' + config.phpVendorPath + '/**/*.*',
'!' + config.pluginsPath + '/**/*.*',
'!' + config.cachePath + '/**/*.*'
], {
// Content of the cache directory is readable only for webserver. Thus
// we must to set "strict" option to false to prevent "EACCES" errors.
// At the same we need to see all errors that take place.
strict: false,
silent: false
})
.pipe(phpcs({
bin: config.phpVendorPath + '/bin/phpcs',
standard: 'PSR2',
warningSeverity: 0
}))
.pipe(phpcs.reporter('log'))
.pipe(phpcs.reporter('fail'));
// Cleans all built files
gulp.task('clean', function(callback) {
return del([
config.releasePath,
'composer.lock',
config.phpVendorPath,
config.jsVendorPath,
config.jsPath + '/compiled/**/*',
'!' + config.jsPath + '/compiled/.keep',
config.chatStylesPath + '/*/templates_compiled/client_side/*.js',
config.chatStylesPath + '/*/js/compiled/*.js',
config.pageStylesPath + '/*/templates_compiled/client_side/*.js'
], callback);
});
// Cleans temporary English translation in the release dir
gulp.task('clean-tmp-po', function(callback) {
return del([config.releasePath + '/translation.po'], callback);
});
// Cleans temporary files of translations in the release dir
gulp.task('clean-tmp-i18n-files', function(callback) {
return del([
config.releasePath + '/**/*',
'!' + config.releasePath + '/*.zip',
'!' + config.releasePath + '/*.tar.gz',
'!' + config.releasePath + '/*.pot'
], callback);
});
// Cleans all files prepared for uploading to CDN
gulp.task('clean-upload', function(callback) {
return del([config.uploadPath], callback);
});
// Cleans everything
gulp.task('clean-all', function(callback) {
runSequence( ['clean', 'clean-upload'],
callback );
});
// Watcher tasks ///////////////////////
// Watch styles
gulp.task('watch', function() {
gulp.watch(config.pageStylesPath + '/**/*.handlebars', gulp.series('page-styles'));
gulp.watch(config.chatStylesPath + '/**/js/source/**/*.js', gulp.series('chat-styles-js'));
gulp.watch(config.chatStylesPath + '/**/*.handlebars', gulp.series('chat-styles-handlebars'));
});
// Service tasks //////////////////
// Get and install PHP Composer
gulp.task('get-composer', function(callback) {
// Check if Composer already in place
// Check whether Composer is already in place
if (fs.existsSync('./composer.phar')) {
callback(null);
return;
}
// Get installer from the internet
// Get installer from the Internet
https.get(config.getComposerUrl, function(response) {
// Run PHP to install Composer
var php = exec(config.phpBin, function(error, stdout, stderr) {
@ -88,18 +130,20 @@ gulp.task('get-composer', function(callback) {
});
// Install Composer dependencies excluding development ones
gulp.task('composer-install', ['get-composer'], function(callback) {
exec(config.phpBin + ' composer.phar install --no-dev', function(error, stdout, stderr) {
gulp.task('composer-install', gulp.series('get-composer', function(callback) {
exec(config.phpBin + ' composer.phar install --no-dev',
function(error, stdout, stderr) {
callback(error ? stderr : null);
});
});
}));
// Install all Composer dependencies
gulp.task('composer-install-dev', ['get-composer'], function(callback) {
exec(config.phpBin + ' composer.phar install', function(error, stdout, stderr) {
gulp.task('composer-install-dev', gulp.series('get-composer', function(callback) {
exec(config.phpBin + ' composer.phar install',
function(error, stdout, stderr) {
callback(error ? stderr : null);
});
});
}));
// Installs bower dependencies
gulp.task('bower-install', function(callback) {
@ -109,14 +153,15 @@ gulp.task('bower-install', function(callback) {
})
.on('end', function() {
// We should manually minify JavaScript files that was not minified
// by bower packages' authors.
// by bower packages' authors
// TODO: This is a temproary workaround and should be removed once
// the packages will be fixed.
// the packages will be fixed
var stream = eventStream.merge(
gulp.src(config.jsVendorPath + '/backbone/backbone.js', {base: config.jsVendorPath})
gulp.src(config.jsVendorPath + '/backbone/backbone.js',
{base: config.jsVendorPath})
.pipe(uglify({preserveComments: 'some'}))
// There are neither "@license" tag nor "!preserve" in the
// header. Add the header manually.
// header. Add the header manually
.pipe(header(
"// Backbone.js 1.1.2\n"
+ "// (c) 2010-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n"
@ -125,22 +170,67 @@ gulp.task('bower-install', function(callback) {
+ "// http://backbonejs.org\n"
))
.pipe(rename('backbone/backbone-min.js')),
gulp.src(config.jsVendorPath + '/json/json2.js', {base: config.jsVendorPath})
gulp.src(config.jsVendorPath + '/json/json2.js',
{base: config.jsVendorPath})
.pipe(uglify({preserveComments: 'some'}))
// There are neither "@license" tag nor "!preserve" in the
// header. Add the header manually.
// header, add the header manually
.pipe(header("// json2.js. Public Domain. See http://www.JSON.org/js.html\n"))
.pipe(rename('json/json2.min.js'))
);
)
.pipe(gulp.dest(config.jsVendorPath));
stream.pipe(gulp.dest(config.jsVendorPath));
stream
.on('error', callback)
.on('end', callback);
});
});
// Compile all JavaScript files of the Mibew Core
// Tasks for checking //////////////////
// Checks all PHP files with PHP Code Sniffer
gulp.task('phpcs', gulp.series('composer-install-dev', function() {
return gulp.src([
config.mibewPath + '/**/*.php',
'!' + config.phpVendorPath + '/**/*.*',
'!' + config.pluginsPath + '/**/*.*',
'!' + config.cachePath + '/**/*.*'
], {
// Content of the cache directory is readable only for webserver.
// Thus we must to set "strict" option to false to prevent "EACCES"
// errors. At the same we need to see all errors that take place.
strict: false,
silent: false
})
.pipe(phpcs({
bin: config.phpVendorPath + '/bin/phpcs',
standard: 'PSR2',
warningSeverity: 0
}))
.pipe(phpcs.reporter('log'))
.pipe(phpcs.reporter('fail'));
}));
// Checks all JavaScript Source files with ESLint
gulp.task('eslint', function() {
return gulp.src(config.jsPath + '/source/**/*.js')
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});
// Restore empty English translation in the source code
gulp.task('post-pack-cleanup', function(callback) {
gulp.src('translation.po')
.pipe(gulp.dest(config.mibewPath + '/locales/en/'));
del(['translation.po', config.releasePath + '/translation.po'], callback);
});
// Tasks of compiling //////////////////
// Compile all JavaScript files of the Mibew Messenger Core
gulp.task('js', function() {
return eventStream.merge(
getClientSideApp('default'),
@ -150,21 +240,18 @@ gulp.task('js', function() {
gulp.src(config.jsPath + '/source/**/*.js')
)
.pipe(uglify({preserveComments: 'some'}))
.pipe(removeDuplicateHeaders())
.pipe(gulp.dest(config.jsPath + '/compiled'));
});
// Performs all job related with chat styles.
gulp.task('chat-styles', ['chat-styles-handlebars', 'chat-styles-js'], function() {
// This task is just a combination of other tasks. That is why there is no
// real code.
});
// Compile and concatenate handlebars files for all chat styles.
// Compile and concatenate Handlebars templates for all chat styles
gulp.task('chat-styles-handlebars', function() {
// TODO: Process all available styles, not only the default one.
var stylePath = config.chatStylesPath + '/default';
return gulp.src(stylePath + '/templates_src/client_side/**/*.handlebars')
return getChildDirs(config.chatStylesPath)
.then(function (dirs) {
return Promise.all(dirs.map(function (dir) {
return new Promise(function(resolve, reject) {
gulp.src(config.chatStylesPath + '/' + dir
+ '/templates_src/client_side/**/*.handlebars')
.pipe(handlebars({
// Use specific version of Handlebars.js
handlebars: handlebarsEngine
@ -173,26 +260,42 @@ gulp.task('chat-styles-handlebars', function() {
.pipe(concat('templates.js'))
.pipe(uglify({preserveComments: 'some'}))
.pipe(header(config.compiledTemplatesHeader))
.pipe(gulp.dest(stylePath + '/templates_compiled/client_side'));
.pipe(gulp.dest(config.chatStylesPath + '/' + dir
+ '/templates_compiled/client_side'))
.on('end', resolve)
.on('error', reject);
});
}));
});
});
// Compile and concatenate js files for all chat styles.
// Compile and concatenate js files for all chat styles
gulp.task('chat-styles-js', function() {
// TODO: Process all available styles, not only the default one.
var stylePath = config.chatStylesPath + '/default';
return gulp.src(stylePath + '/js/source/**/*.js')
return getChildDirs(config.chatStylesPath)
.then(function (dirs) {
return Promise.all(dirs.map(function (dir) {
return new Promise(function(resolve, reject) {
gulp.src(config.chatStylesPath + '/' + dir
+ '/js/source/**/*.js')
.pipe(concat('scripts.js'))
.pipe(uglify({preserveComments: 'some'}))
.pipe(gulp.dest(stylePath + '/js/compiled'));
.pipe(gulp.dest(config.chatStylesPath + '/' + dir
+ '/js/compiled'))
.on('end', resolve)
.on('error', reject);
});
}));
});
});
// Performs all job related with pages styles.
// Performs all job related to pages styles
gulp.task('page-styles', function() {
// TODO: Process all available styles, not only the default one.
var stylePath = config.pageStylesPath + '/default';
return gulp.src(stylePath + '/templates_src/client_side/**/*.handlebars')
return getChildDirs(config.pageStylesPath)
.then(function (dirs) {
return Promise.all(dirs.map(function (dir) {
return new Promise(function(resolve, reject){
gulp.src(config.pageStylesPath + '/' + dir
+ '/templates_src/client_side/**/*.handlebars')
.pipe(handlebars({
// Use specific version of Handlebars.js
handlebars: handlebarsEngine
@ -201,10 +304,32 @@ gulp.task('page-styles', function() {
.pipe(concat('templates.js'))
.pipe(uglify({preserveComments: 'some'}))
.pipe(header(config.compiledTemplatesHeader))
.pipe(gulp.dest(stylePath + '/templates_compiled/client_side'));
.pipe(gulp.dest(config.pageStylesPath + '/' + dir
+ '/templates_compiled/client_side'))
.on('end', resolve)
.on('error', reject);
});
}));
});
});
// Generate .pot files based on the sources
// Performs all job related to chat styles
gulp.task('chat-styles', gulp.series('chat-styles-handlebars', 'chat-styles-js'));
// Prepares ready to use development version of Mibew Messenger without
// packing or validating it
gulp.task('rebuild', function(callback) {
runSequence(
'clean',
['js', 'chat-styles', 'page-styles', 'composer-install',
'bower-install'],
callback
);
});
// Tasks for localization issues ///////
// Generate POT-file based upon the source code
gulp.task('generate-pot', function() {
return eventStream.merge(
gulp.src([
@ -213,9 +338,10 @@ gulp.task('generate-pot', function() {
'!' + config.pluginsPath + '/**/*.*',
'!' + config.cachePath + '/**/*.*'
], {
// Content of the cache directory is readable only for webserver.
// Thus we must to set "strict" option to false to prevent "EACCES"
// errors. At the same we need to see all errors that take place.
// Content of the cache directory is readable only for
// webserver. Thus we must to set "strict" option to false
// to prevent "EACCES" errors. At the same we need to see all
// errors that take place.
strict: false,
silent: false
})
@ -241,9 +367,12 @@ gulp.task('generate-pot', function() {
], {base: config.mibewPath})
.pipe(xgettextHandlebars())
)
.pipe(concatPo('translation.pot', {
.pipe(concatPo(config.i18nPrefix + 'translation'
+ config.i18nSuffix + '.pot',
{
headers: {
'Project-Id-Version': 'Mibew Messenger ' + config.package.version,
'Project-Id-Version': 'Mibew Messenger '
+ config.package.version,
'Report-Msgid-Bugs-To': config.package.support.email,
'POT-Creation-Date': strftime('%Y-%m-%d %H:%M%z'),
'PO-Revision-Date': '',
@ -251,12 +380,70 @@ gulp.task('generate-pot', function() {
'Language-Team': '',
'Content-Type': 'text/plain; charset=UTF-8'
}
}))
.pipe(gulp.dest('release'));
})
)
.pipe(gulp.dest(config.releasePath));
});
// Pack sources to .zip and .tar.gz archives.
gulp.task('pack-sources', ['composer-install', 'bower-install'], function() {
// Generate temporary English translation to be used in the release
gulp.task('generate-tmp-po', gulp.series('generate-pot', function(callback) {
return exec(config.msginit + ' --no-translator --no-wrap -i '
+ config.releasePath + '/' + config.i18nPrefix + 'translation'
+ config.i18nSuffix + '.pot' + ' -l en -o '
+ config.releasePath + '/translation.po',
function(error, stdout, stderr) {
callback(error ? stderr : null);
});
}));
// Generate complete translations (that includes missed strings) to be used
// in the release
gulp.task('generate-pos', gulp.series('generate-tmp-po', function(callback) {
return getChildDirs(config.i18nPath + '/translations')
.then(function (dirs) {
return Promise.all(dirs.map(function (dir) {
return new Promise(function(resolve, reject) {
mkdirp(config.releasePath + '/' + dir, function (error) {
if (error) {
reject(error);
}
});
exec(config.msgcat + ' ' + config.i18nPath + '/translations/'
+ dir + '/translation.po ' + config.releasePath
+ '/translation.po --no-location --no-wrap --use-first'
+ ' -o ' + config.releasePath + '/' + dir
+ '/translation.po',
function(error, stdout, stderr) {
if (error) {
reject(error);
}
});
var sources = [
config.i18nPath + '/translations/' + dir + '/**/*',
'!' + config.i18nPath + '/translations/' + dir
+ '/translation.po'
];
gulp.src(sources)
.pipe(gulp.dest(config.releasePath + '/' + dir))
.on('error', reject)
.on('end', resolve);
});
}));
});
}));
// Packaging tasks /////////////////////
// Pack sources for release as .zip and .tar.gz archives
gulp.task('pack-sources', gulp.series('composer-install', 'bower-install', function() {
gulp.src(config.mibewPath + '/locales/en/translation.po')
.pipe(gulp.dest('.'));
gulp.src(config.releasePath + '/translation.po')
.pipe(gulp.dest(config.mibewPath + '/locales/en/'));
var sources = [
config.mibewPath + '/**/*',
// Exclude user's config
@ -299,13 +486,15 @@ gulp.task('pack-sources', ['composer-install', 'bower-install'], function() {
'!' + config.jsVendorPath + '/vex/coffee{,/**}'
];
var srcOptions = {
// Dot files (.htaccess, .keep, etc.) must be included in the package.
// Dot files (.htaccess, .keep, etc.) must be included in the package
dot: true,
// Content of the cache directory is readable only for webserver. Thus
// we must to set "strict" option to false to prevent "EACCES" errors.
// At the same we need to see all errors that take place.
strict: false,
silent: false
silent: false,
// Preserve root directory name (i.e. 'mibew/')
base: '.'
}
var version = config.package.version;
@ -316,34 +505,111 @@ gulp.task('pack-sources', ['composer-install', 'bower-install'], function() {
.pipe(tar('mibew-' + version + '.tar'))
.pipe(gzip())
)
.pipe(chmod(0644))
.pipe(gulp.dest('release'));
.pipe(chmod(644))
.pipe(gulp.dest(config.releasePath));
}));
// Pack translations for release as .zip and .tar.gz archives
gulp.task('pack-i18n', function(callback) {
return getChildDirs(config.i18nPath + '/translations')
.then(function (dirs) {
return Promise.all(dirs.map(function (dir) {
return new Promise(function(resolve, reject) {
var srcOptions = {
base: config.releasePath
};
eventStream.merge(
gulp.src(config.releasePath + '/' + dir
+ '/**/*', srcOptions)
.pipe(zip(config.i18nPrefix + dir
+ config.i18nSuffix + '.zip')),
gulp.src(config.releasePath + '/' + dir
+ '/**/*', srcOptions)
.pipe(tar(config.i18nPrefix + dir
+ config.i18nSuffix + '.tar'))
.pipe(gzip())
)
.pipe(chmod(644))
.pipe(gulp.dest(config.releasePath))
.on('error', reject)
.on('end', resolve);
});
}));
});
});
// Performs all tasks in the correct order.
// Tasks of releasing //////////////////
// Prepare release of Mibew Messenger
gulp.task('prepare-release', function(callback) {
runSequence(
['phpcs', 'js', 'chat-styles', 'page-styles', 'generate-pot'],
'clean',
['phpcs', 'js', 'chat-styles', 'page-styles', 'generate-pot',
'generate-tmp-po'],
'pack-sources',
'post-pack-cleanup',
callback
);
});
// Builds the sources
// Prepare releases of translations for Mibew Messenger
gulp.task('prepare-i18n-release', function(callback) {
runSequence( 'clean-tmp-po',
'generate-pos',
'pack-i18n',
'clean-tmp-i18n-files',
callback
);
});
// Mirror prepared releases of Mibew Messenger and its translations in a form
// intended for uploading into the CDN
gulp.task('prepare-for-upload', function(callback) {
gulp.src(config.releasePath + '/mibew-' + config.package.version + '.*')
.pipe(gulp.dest(config.uploadPath + '/core/' + config.package.version + '/'));
gulp.src(config.releasePath + '/mibew-i18n-translation-' + config.package.version + '-*.pot')
.pipe(gulp.dest(config.uploadPath + '/i18n/_pot/' + config.package.version + '/'));
return getChildDirs(config.i18nPath + '/translations')
.then(function (dirs) {
return Promise.all(dirs.map(function (dir) {
return new Promise(function(resolve, reject) {
gulp.src(config.releasePath + '/mibew-i18n-' + dir + '-' + config.package.version + '-*.*')
.pipe(gulp.dest(config.uploadPath + '/i18n/' + dir + '/' + config.package.version + '/'))
.on('error', reject)
.on('end', resolve);
});
}));
});
});
// Perform all preparations before uploading the release of Mibew Messenger and
// its translations into the CDN
gulp.task('prepare-all', function(callback) {
runSequence('clean-all', 'prepare-release', 'prepare-i18n-release',
'prepare-for-upload', callback);
});
// Prepare release archives of the development version of Mibew Messenger
gulp.task('default', function(callback) {
runSequence(
['js', 'chat-styles', 'page-styles'],
'clean',
['js', 'chat-styles', 'page-styles', 'generate-tmp-po'],
'pack-sources',
['post-pack-cleanup', 'clean-tmp-po'],
callback
);
});
/**
* Loads and prepare js file for a client side application with the specified
* name.
*
* @param {String} name Application name
* @param {String} name Application name.
* @returns A files stream that can be piped to any gulp plugin.
*/
var getClientSideApp = function(name) {
@ -413,7 +679,7 @@ var xgettextHandlebars = function() {
contents = file.contents.toString();
while (match = helperRegExp.exec(contents)) {
// Try to find item in the .po file by its name.
// Try to find item in the .po file by its name
var item = lodash.find(po.items, function(item) {
return match[2] === item.msgid;
});
@ -421,7 +687,7 @@ var xgettextHandlebars = function() {
var line = contents.substr(0, match.index).split(/\r?\n|\r/g).length;
if (!item) {
// There is no such item. Create new one.
// There is no such item, create new one
item = new PoFile.Item();
item.msgid = match[2].replace(/\\'/g, "'").replace(/\\"/g, '"');
po.items.push(item);
@ -432,9 +698,46 @@ var xgettextHandlebars = function() {
}
// Update file contents
file.contents = new Buffer(po.toString());
file.contents = Buffer.from(po.toString());
this.push(file);
callback();
});
}
/**
* Retrieves list of all dirs which are placed in the specified one.
*
* @param {String} srcDir A dir to search.
* @returns Promise A promise which will be resolved with list of child dirs or
* rejected with the occured error.
*/
var getChildDirs = function(srcDir) {
return (new Promise(function(resolve, reject) {
fs.readdir(srcDir, function (err, files) {
if (err) {
reject(err);
} else {
resolve(files);
}
});
})).then(function (files) {
// Replace all files that are not a directory with nulls.
return Promise.all(files.map(function (file) {
return new Promise(function (resolve, reject) {
fs.lstat(srcDir + '/' + file, function (err, stat) {
if (err) {
reject(err);
} else {
resolve(stat.isDirectory() ? file : null);
}
});
});
}));
}).then(function(dirs) {
// Remove all nulls from the array.
return dirs.filter(function (dir) {
return null !== dir;
});
});
}

1
src/i18n Submodule

@ -0,0 +1 @@
Subproject commit 55868d9973f531c3550575481bde4233cc625b91

View File

@ -4,6 +4,11 @@ Options -Indexes
# Follow symbolic links in the directory
Options +FollowSymLinks
<IfModule mod_negotiation.c>
# Forbid apache to guess file extensions
Options -MultiViews
</IfModule>
# Disable mod_security for Apache 1.x
<IfModule mod_security.c>
SecFilterEngine Off
@ -31,7 +36,7 @@ Options +FollowSymLinks
# Use separate front controller for the system installator
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^install(|/(.*))$ install.php [QSA,L]
RewriteRule ^install(/(.*))?$ install.php [QSA,L]
# Rewrite all other requests for files and directories that do not exist to
# the main front controller
@ -41,9 +46,10 @@ Options +FollowSymLinks
</IfModule>
<IfModule !mod_rewrite.c>
# There is no mod_rewrite in the system. For the root Mibew directory
# index_fallback.php should be loaded first to activate old-fashioned URLs.
# For all other directories index.php is just a directory index file.
# There is no mod_rewrite in the system. For the root Mibew Messenger
# directory index_fallback.php should be loaded first to activate
# old-fashioned URLs. For all other directories index.php is just a
# directory index file.
DirectoryIndex index_fallback.php index.php
</IfModule>
@ -51,3 +57,8 @@ Options +FollowSymLinks
<FilesMatch "\.(yml|po|ini|handlebars|keep)$">
Deny from all
</FilesMatch>
# Deny access to CLI cron worker from the outside
<Files "cron.php">
Deny from all
</Files>

View File

@ -1,12 +1,12 @@
Mibew Messenger
Copyright 2005-2015 the original author or authors.
Copyright 2005-2023 the original author or authors.
REQUIREMENTS
* Apache web server 1.3.34 or above with the ability to use local .htaccess
files (mod_rewrite module is optional, but recommended)
* MySQL database 5.0 or above
* PHP 5.3.3 or above with PDO, pdo_mysql and gd extensions
* PHP 7.2.5 or above with PDO, pdo_mysql, cURL, mbstring and gd extensions
INSTALLATION
@ -37,3 +37,20 @@ On unix/linux platforms change the owner of /mibew/files/avatar and
(for instance, www). The owner should have all rights on the folders
/mibew/files/avatar and /mibew/cache
(chmod 0700 /mibew/files/avatar && chmod 0700 /mibew/cache).
UPDATE
1. Backup your actual installation (i.e. code and database).
2. Disable all plugins.
3. Delete all items in your Mibew Messenger directory on the server.
4. Unpack the archive with the official distrubition in that directory.
5. Remove install.php file.
6. Restore configuration (configs/ directory), plugins (plugins/ directory),
(maybe) custom styles (if you have any), (maybe) additional
locales (if you use any), and avatars (files/avatar/ directory) from the
backup you've made at the step 1.
7. Visit http://<yourdomain>/<path to your Mibew Messenger>/update and follow
the instructions to update the database tables (if needed).
8. Enable disabled plugins.

View File

@ -1 +1 @@
Mibew/2.0
Mibew/3.6.0

View File

@ -72,7 +72,7 @@ thread:
useragent: "varchar(255)"
# Total count of user's messages related with the thread.
messagecount: "varchar(16)"
# ID of the group at Mibew side related with the thread.
# ID of the group at Mibew Messenger side related with the thread.
groupid: "int references {opgroup}(groupid)"
# Contains "by thread" statistics
@ -104,7 +104,7 @@ requestcallback:
fields:
callbackid: "int NOT NULL auto_increment PRIMARY KEY"
token: "varchar(64) NOT NULL DEFAULT ''"
function: "varchar(64) NOT NULL"
func: "varchar(64) NOT NULL"
arguments: "varchar(1024)"
indexes:
token: [token]
@ -129,12 +129,23 @@ translation:
# Contains locales info
locale:
fields:
# Artificial primary key
# Artificial primary key.
localeid: "int NOT NULL auto_increment PRIMARY KEY"
# Locale code
code: "varchar(5) NOT NULL"
# Indicates if a locale is enabled or not.
# Human readable name of the locale.
name: "varchar(128) NOT NULL DEFAULT ''"
# Indicates if the locale is enabled or not.
enabled: "tinyint NOT NULL DEFAULT 0"
# Indicates if the locale uses RTL writing.
rtl: "tinyint NOT NULL DEFAULT 0"
# Name of the locale which is used with PHP's setlocale to format dates.
time_locale: "varchar(128) NOT NULL DEFAULT 'en_US'"
# Serialized array of various date formats.
date_format: "text"
unique_keys:
# Make sure locale code can be duplicated
code: [code]
# Contains localized mail templates
mailtemplate:
@ -215,7 +226,7 @@ operatorstatistics:
revision:
fields:
id: "INT NOT NULL"
id: "INT NOT NULL PRIMARY KEY"
# Contains relations between operators and groups
operatortoopgroup:
@ -303,5 +314,23 @@ plugin:
installed: "tinyint NOT NULL DEFAULT 0"
# Indicates if the plugin is enabled or not.
enabled: "tinyint NOT NULL DEFAULT 0"
# Indicates if the plugin is initialized or not.
initialized: "tinyint NOT NULL DEFAULT 0"
unique_keys:
name: [name]
# Contains info about all available updates
availableupdate:
fields:
# Artificial ID
id: "INT NOT NULL auto_increment PRIMARY KEY"
# Can be either "core" or fully qualified plugin's name
target: "varchar(255) NOT NULL"
# The latest available version of the plugin
version: "varchar(255) NOT NULL"
# A URL where the new version can be downloaded
url: "text"
# Description of the update
description: "text"
unique_keys:
target: [target]

View File

@ -1,5 +1,5 @@
# IMPORTANT: Before install mibew copy this file to config.yml and fill it with
# your own settings!
# IMPORTANT: Before install Mibew Messenger copy this file to config.yml and
# fill it with your own settings!
# MySQL Database parameters
@ -13,7 +13,7 @@ database:
use_persistent_connection: false
# Mail
## This value will be used as sender address in all e-mails Mibew send.
## This value will be used as sender address in all e-mails Mibew Messenger send.
mailbox: mibew@yourdomain.com
## Mailer parameters
@ -61,8 +61,8 @@ cache:
memcached_servers:
- host: localhost
port: 11211
# The "weight" field is optional and can be omitted.
weight: 0
# The "weight" field is optional and can be omitted and it's only positive int number.
weight: 1
# Actually, one can use any number of memcached servers he wants. Just
# add servers description like the one above.
@ -77,10 +77,19 @@ default_locale: en
# http://php.net/manual/en/timezones.php
timezone: ""
# List of proxy's IP Mibew Messenger should trust. You should set this option
# if you use Mibew Messenger with a load balancer or behind a proxy.
trusted_proxies: []
# Here is an example of what values this option can take:
# trusted_proxies:
# - 127.0.0.1
# - ::1
# - 10.0.0.0/8
# Plugins
plugins: []
## Exapmle of plugins configuration
## Example of plugins configuration
# plugins:
# "VendorName:PluginName":
# weight: 100

View File

@ -49,6 +49,14 @@ chat_user:
thread_id: \d{1,10}
token: \d{1,10}
chat_user_check:
path: /chat/{thread_id}/{token}/check
defaults:
_controller: Mibew\Controller\Chat\UserChatController::checkAction
requirements:
thread_id: \d{1,10}
token: \d{1,10}
chat_user_invitation:
path: /chat/invitation
defaults:
@ -80,11 +88,25 @@ chat_user_popup_style:
requirements:
style: "[0-9A-Za-z_]*"
chat_user_popup_style_force_secure:
path: /chat/style/popup/{style}/force_secure
defaults:
_controller: Mibew\Controller\Chat\StyleController::loadPopupStyleAction
style: ""
force_secure: on
requirements:
style: "[0-9A-Za-z_]*"
chat_user_start:
path: /chat
defaults:
_controller: Mibew\Controller\Chat\UserChatController::startAction
chat_user_cookie_set_permission:
path: /chat/cookies-set-permission
defaults:
_controller: Mibew\Controller\Chat\UserChatController::cookieSetPermissionAction
# Pages that are available for all users
button:
path: /b
@ -178,21 +200,24 @@ canned_message_add:
path: /operator/canned-message/add
defaults:
_controller: Mibew\Controller\CannedMessageController::showEditFormAction
_access_check: Mibew\AccessControl\Check\LoggedInCheck
_access_check: Mibew\AccessControl\Check\PermissionsCheck
_access_permissions: [CAN_ADMINISTRATE]
methods: [GET]
canned_message_add_save:
path: /operator/canned-message/add
defaults:
_controller: Mibew\Controller\CannedMessageController::submitEditFormAction
_access_check: Mibew\AccessControl\Check\LoggedInCheck
_access_check: Mibew\AccessControl\Check\PermissionsCheck
_access_permissions: [CAN_ADMINISTRATE]
methods: [POST]
canned_message_delete:
path: /operator/canned-message/{message_id}/delete
defaults:
_controller: Mibew\Controller\CannedMessageController::deleteAction
_access_check: Mibew\AccessControl\Check\LoggedInCheck
_access_check: Mibew\AccessControl\Check\PermissionsCheck
_access_permissions: [CAN_ADMINISTRATE]
requirements:
message_id: \d{1,10}
@ -200,7 +225,8 @@ canned_message_edit:
path: /operator/canned-message/{message_id}/edit
defaults:
_controller: Mibew\Controller\CannedMessageController::showEditFormAction
_access_check: Mibew\AccessControl\Check\LoggedInCheck
_access_check: Mibew\AccessControl\Check\PermissionsCheck
_access_permissions: [CAN_ADMINISTRATE]
requirements:
message_id: \d{1,10}
methods: [GET]
@ -209,7 +235,8 @@ canned_message_edit_save:
path: /operator/canned-message/{message_id}/edit
defaults:
_controller: Mibew\Controller\CannedMessageController::submitEditFormAction
_access_check: Mibew\AccessControl\Check\LoggedInCheck
_access_check: Mibew\AccessControl\Check\PermissionsCheck
_access_permissions: [CAN_ADMINISTRATE]
requirements:
message_id: \d{1,10}
methods: [POST]
@ -218,7 +245,8 @@ canned_messages:
path: /operator/canned-message
defaults:
_controller: Mibew\Controller\CannedMessageController::indexAction
_access_check: Mibew\AccessControl\Check\LoggedInCheck
_access_check: Mibew\AccessControl\Check\PermissionsCheck
_access_permissions: [CAN_ADMINISTRATE]
## Groups
group_add:
@ -349,7 +377,27 @@ locale_disable:
_access_check: Mibew\AccessControl\Check\PermissionsCheck
_access_permissions: [CAN_ADMINISTRATE]
requirements:
locale: "[a-z\-]{2,5}"
locale: "[a-z\\-]{2,5}"
locale_edit:
path: /operator/locale/{locale}/edit
defaults:
_controller: Mibew\Controller\Localization\LocaleController::showEditFormAction
_access_check: Mibew\AccessControl\Check\PermissionsCheck
_access_permissions: [CAN_ADMINISTRATE]
requirements:
locale: "[a-z\\-]{2,5}"
methods: [GET]
locale_edit_save:
path: /operator/locale/{locale}/edit
defaults:
_controller: Mibew\Controller\Localization\LocaleController::submitEditFormAction
_access_check: Mibew\AccessControl\Check\PermissionsCheck
_access_permissions: [CAN_ADMINISTRATE]
requirements:
locale: "[a-z\\-]{2,5}"
methods: [POST]
locale_enable:
path: /operator/locale/{locale}/enable
@ -358,7 +406,7 @@ locale_enable:
_access_check: Mibew\AccessControl\Check\PermissionsCheck
_access_permissions: [CAN_ADMINISTRATE]
requirements:
locale: "[a-z\-]{2,5}"
locale: "[a-z\\-]{2,5}"
locales:
path: /operator/locale
@ -650,7 +698,8 @@ statistics:
defaults:
type: "by-date"
_controller: Mibew\Controller\StatisticsController::indexAction
_access_check: Mibew\AccessControl\Check\LoggedInCheck
_access_check: Mibew\AccessControl\Check\PermissionsCheck
_access_permissions: [CAN_VIEWSTATISTICS]
requirements:
type: by-date|by-operator|by-page
@ -672,7 +721,7 @@ translation_edit:
_access_check: Mibew\AccessControl\Check\PermissionsCheck
_access_permissions: [CAN_ADMINISTRATE]
requirements:
string_id: "\d{1,10}"
string_id: "\\d{1,10}"
methods: [GET]
translation_edit_save:
@ -682,7 +731,7 @@ translation_edit_save:
_access_check: Mibew\AccessControl\Check\PermissionsCheck
_access_permissions: [CAN_ADMINISTRATE]
requirements:
string_id: "\d{1,10}"
string_id: "\\d{1,10}"
methods: [POST]
translation_export:
@ -739,6 +788,13 @@ update_run:
_access_check: Mibew\AccessControl\Check\PermissionsCheck
_access_permissions: [CAN_ADMINISTRATE]
update_check:
path: /update/check
defaults:
_controller: Mibew\Controller\UpdateController::checkUpdatesAction
_access_check: Mibew\AccessControl\Check\PermissionsCheck
_access_permissions: [CAN_ADMINISTRATE]
## Users (visitors avaiting page)
users:
path: /operator/users

52
src/mibew/cron.php Normal file
View File

@ -0,0 +1,52 @@
<?php
/*
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Initialize libraries
require_once(dirname(__FILE__) . '/libs/init.php');
use Mibew\Cache\CacheFactory;
use Mibew\Maintenance\CronWorker;
use Mibew\Plugin\PluginManager;
$configs = load_system_configs();
// Prepare the cache. It is initialized in the same way as in index.php
$cache_factory = new CacheFactory($configs['cache']);
// For now directory for cache files cannot be changed via the configs file.
$cache_factory->setOption('path', MIBEW_FS_ROOT . '/cache/stash');
// Run plugins
if (get_maintenance_mode() === false) {
$plugin_manager = PluginManager::getInstance();
$plugin_manager->setCache($cache_factory->getCache());
$plugin_manager->loadPlugins($configs['plugins']);
}
// Do the job.
$worker = new CronWorker($cache_factory->getCache());
$success = $worker->run();
if ($success) {
echo("All cron jobs done\n");
} else {
echo("Cron job failed. Here are the errors:\n");
foreach ($worker->getErrors() as $error) {
echo(' ' . $error . "\n");
}
}

View File

@ -2,7 +2,7 @@
/*
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -24,6 +24,7 @@ use Mibew\Application;
use Mibew\Authentication\AuthenticationManager;
use Mibew\Cache\CacheFactory;
use Mibew\Mail\MailerFactory;
use Mibew\Plugin\PluginManager;
use Mibew\Routing\Router;
use Mibew\Routing\Loader\CacheLoader;
use Mibew\Routing\Loader\PluginLoader;
@ -40,6 +41,13 @@ $cache_factory = new CacheFactory($configs['cache']);
// TODO: Evaluate possibility of using custom cache directory.
$cache_factory->setOption('path', MIBEW_FS_ROOT . '/cache/stash');
// Run plugins
if (get_maintenance_mode() === false) {
$plugin_manager = PluginManager::getInstance();
$plugin_manager->setCache($cache_factory->getCache());
$plugin_manager->loadPlugins($configs['plugins']);
}
// The main route loader which loads nothig but works as a cache proxy for other
// loaders.
$route_loader = new CacheLoader($cache_factory->getCache());

View File

@ -2,7 +2,7 @@
/*
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -20,4 +20,4 @@
// Force the user to specify the entry point. This should be done only when
// mod_rewrite is not used by apache.
header('HTTP/1.0 301 Moved Permanently');
header('Location: index.php/');
header('Location: index.php');

View File

@ -2,7 +2,7 @@
/*
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,40 +0,0 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
(function (Mibew, $) {
Mibew.updateVersion = function(data) {
if (!data.core || !data.core.stable) {
return;
}
$(document).ready(function() {
var currentVersion = $("#current-version").html(),
core = data.core.stable;
if (currentVersion != core.version) {
if (currentVersion < core.version) {
$("#current-version").css("color", "red");
}
$("#latest-version").html(core.version + ", Download <a href=\"" + core.download + "\">" + core.title + "</a>");
} else {
$("#current-version").css("color", "green");
$("#latest-version").html(core.version);
}
});
}
})(Mibew, jQuery);

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -0,0 +1,26 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
(function(Mibew, $) {
$(document).ready(function(){
$('#copy-button-code').click(function(e){
$("#button-code").select();
document.execCommand('copy');
});
});
})(Mibew, jQuery);

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -51,8 +51,7 @@
app.Invitation.start(options.invitationOptions);
break;
default:
throw new Error('Dont know how to start!');
break;
throw new Error("Don't know how to start!");
}
});

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -119,7 +119,7 @@
eventArgs = {
'messageData': messageData,
'model': false
}
};
// Trigger event. See description of eventName and eventArgs
// above.

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -59,7 +59,7 @@
return {
page: models.page.toJSON(),
user: models.user.toJSON()
}
};
}
}
);

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -51,7 +51,7 @@
serializeData: function() {
return {
page: Mibew.Objects.Models.page.toJSON()
}
};
}
}
);

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -50,7 +50,7 @@
serializeData: function() {
return {
page: Mibew.Objects.Models.page.toJSON()
}
};
}
}
);

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -40,6 +40,6 @@ MibewAPIChatInteraction = function() {
return [
'result'
];
}
}
};
};
MibewAPIChatInteraction.prototype = new MibewAPIInteraction();

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -49,7 +49,7 @@
*/
closeThread: function() {
// Show confirmation message if can
var confirmMessage = Mibew.Localization.trans('Are you sure want to leave chat?'),
var confirmMessage = Mibew.Localization.trans('Are you sure that you want to leave the chat?'),
context = this;
if (confirmMessage !== false) {
Mibew.Utils.confirm(confirmMessage, function(value) {

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -45,7 +45,7 @@
),
/**
* Dispalay history window
* Display history window
*/
showHistory: function() {
var user = Mibew.Objects.Models.user;

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -48,11 +48,15 @@
* Move to secure chat
*/
secure: function() {
var link = this.model.get('link')
if (window.location.protocol == 'https:') {
return;
}
var link = this.model.get('link');
if (link) {
var style = Mibew.Objects.Models.page.get('style');
window.location.href = link.replace(/\&amp\;/g, '&')
+ (style ? ('&style=' + style) : '');
+ (style ? ((link.indexOf('?') > -1 ? '&' : '?')
+ 'style=' + style) : '');
}
}
}

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -44,6 +44,17 @@
}
),
/**
* Override Backbone.Marionette.ItemView.serializeData to pass some
* extra fields to template.
* @returns {Object} Template data
*/
serializeData: function() {
var data = this.model.toJSON();
data.user = Mibew.Objects.Models.user.toJSON();
return data;
},
/**
* Load and display send mail window
*/

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -0,0 +1,68 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
(function(Mibew, Handlebars, _) {
/**
* @class Represents Tracked path control view
*/
Mibew.Views.TrackedPathControl = Mibew.Views.Control.extend(
/** @lends Mibew.Views.TrackedPathControl.prototype */
{
/**
* Template function
* @type Function
*/
template: Handlebars.templates['chat/controls/tracked_path'],
/**
* Map ui events to view methods
* The view inherits events from
* {@link Mibew.Views.Control.prototype.events}.
* @type Object
*/
events: _.extend(
{},
Mibew.Views.Control.prototype.events,
{
'click': 'showTrackedPath'
}
),
/**
* Display tracked path window
*/
showTrackedPath: function() {
var user = Mibew.Objects.Models.user;
var link = this.model.get('link');
if (user.get('isAgent') && link) {
var winParams = Mibew.Utils.buildWindowParams(this.model.get('windowParams'));
// TODO: Kill &amp; at the server side
link = link.replace('&amp;', '&', 'g');
var newWindow = window.open(link, 'UserTrackedPath', winParams);
if (newWindow !== null) {
newWindow.focus();
newWindow.opener=window;
}
}
}
}
);
})(Mibew, Handlebars, _);

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -42,7 +42,7 @@
serializeData: function() {
return {
page: Mibew.Objects.Models.page.toJSON()
}
};
}
}
);

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -81,7 +81,7 @@
// Update group id
if (this.model.get('groups')) {
values.groupId = this.ui.groupSelect.val()
values.groupId = this.ui.groupSelect.val();
}
// Update name

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -42,7 +42,7 @@
serializeData: function() {
return {
page: Mibew.Objects.Models.page.toJSON()
}
};
}
}
);

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -84,6 +84,9 @@
* Get, check and post message
*/
postMessage: function() {
if (this.isDisabledInput()){
return;
}
var msg = this.ui.message.val();
// TODO: Think about it
// Cut multiple line breaks
@ -129,6 +132,13 @@
},
/**
* Check is disabled message input area
*/
isDisabledInput: function() {
return this.ui.message.attr('disabled') == 'disabled';
},
/**svn
* Clear message input area
*/
clearInput: function() {

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -39,7 +39,7 @@
*/
ui: {
groupSelect: 'select[name="group"]',
groupDescription: '#groupDescription',
groupDescription: '#group-description',
name: 'input[name="name"]',
email: 'input[name="email"]',
message: 'textarea[name="message"]',

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -58,7 +58,7 @@
// Update group id
if (this.model.get('groups')) {
values.groupId = this.ui.groupSelect.val()
values.groupId = this.ui.groupSelect.val();
}
// Update name

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -57,7 +57,7 @@
* Not applicable for agents.
* @type Boolean
*/
dafaultName: true
defaultName: true
}
)
}

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -60,7 +60,7 @@
* @returns {String} Model type
*/
getModelType: function() {
return 'SoundControl'
return 'SoundControl';
}
}
);

View File

@ -0,0 +1,63 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
(function(Mibew, _){
/**
* @class Tracked path control model
*/
Mibew.Models.TrackedPathControl = Mibew.Models.Control.extend(
/** @lends Mibew.Models.TrackedPathControl.prototype */
{
/**
* A list of default model values.
*
* The model inherits defaults from
* {@link Mibew.Models.Control.prototype.defaults}.
* @type Object
*/
defaults: _.extend(
{},
Mibew.Models.Control.prototype.defaults,
{
/**
* An URL of the tracked path page or false by default.
* @type String|Boolean
*/
link: false,
/**
* Params string for tracked path popup window
* @type String
*/
windowParams: ''
}
),
/**
* Returns model type
* @returns {String} Model type
*/
getModelType: function() {
return 'TrackedPathControl';
}
}
);
})(Mibew, _);

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -53,7 +53,7 @@
* @returns {String} Model type
*/
getModelType: function() {
return 'StatusMessage'
return 'StatusMessage';
},
/**

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -55,7 +55,7 @@
* @returns {String} Model type
*/
getModelType: function() {
return 'StatusTyping'
return 'StatusTyping';
},
/**

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -61,6 +61,18 @@
* @param Object attributes Attributes hash for test
*/
validate: function(attributes) {
// Check visitor's name
if (this.get('canChangeName') && typeof attributes.name != 'undefined') {
var trimmedName = attributes.name
// Remove leading spaces from the name
.replace(/^\s+/, '')
// Remove trailing spaces from the name
.replace(/\s+$/, '');
if (trimmedName.length === 0) {
return Mibew.Localization.trans('Name is required.');
}
}
// Check email
if (this.get('showEmail')) {
if (typeof attributes.email != 'undefined') {

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -101,6 +101,15 @@
windowParams: options.windowsParams.history
});
ctrlsCollection.add(controls.history);
if (options.links.tracked) {
controls.tracked_path = new Mibew.Models.TrackedPathControl({
weight: 170,
link: options.links.tracked,
windowParams: options.windowsParams.trackedPath
});
ctrlsCollection.add(controls.tracked_path);
}
}
// Create toggle sound button
@ -225,7 +234,7 @@
"user": (! user.get('isAgent'))
}
}
]
];
},
function(args) {
// Check if there was an error
@ -258,7 +267,7 @@
// Restart server updater because module just started and there are no
// reasons to wait refresh time to get results of previous request
Mibew.Objects.server.restartUpdater();
})
});
// Add module finalizer
chat.addFinalizer(function() {

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -78,7 +78,7 @@
"user": true
}
}
]
];
},
function() {}
)
@ -90,7 +90,7 @@
// Restart server updater because module just started and there are no
// reasons to wait refresh time to get results of previous request
Mibew.Objects.server.restartUpdater();
})
});
// Add module finalizer
invitation.addFinalizer(function() {

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -38,6 +38,6 @@
// Just close the window.
window.close();
}
}
};
})(Mibew);

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -17,7 +17,7 @@
*/
/**
* @namespace Holds all Mibew functionality
* @namespace Holds all Mibew Messenger functionality
*/
var Mibew = Mibew || {};
@ -57,12 +57,28 @@ var Mibew = Mibew || {};
* omitted a session cookie will be created.
*/
Mibew.Utils.createCookie = function(name, value, expires) {
var domain = /([^\.]+\.[^\.]+)$/.exec(document.location.hostname);
if (navigator.cookieEnabled) {
var domain_parts = document.location.hostname.split('.').reverse();
var domain = domain_parts[0];
var position = 0;
do {
document.cookie = "" + name + "=" + value + "; "
+ "path=/; "
+ (domain ? ("domain=" + domain[1] + "; ") : '')
+ (document.location.protocol == 'https:' ? "SameSite=None; secure; " : '')
+ "domain=" + (Mibew.Utils.cookiesDomain || domain) + "; "
+ (expires ? ('expires=' + expires.toUTCString() + '; ') : '');
if (Mibew.Utils.readCookie(name) == value) {
if (!Mibew.Utils.cookiesDomain) {
Mibew.Utils.cookiesDomain = domain;
}
}
else {
position++;
domain = domain_parts[position] + '.' + domain;
}
} while((position < domain_parts.length) && !Mibew.Utils.cookiesDomain);
}
};
/**
* Try to read cookie.
@ -82,7 +98,7 @@ var Mibew = Mibew || {};
}
}
return value;
}
};
/**
* Deletes cookie.
@ -91,7 +107,7 @@ var Mibew = Mibew || {};
*/
Mibew.Utils.deleteCookie = function(name) {
Mibew.Utils.createCookie(name, '', (new Date(0)));
}
};
/**
* Sets correct prototypes chain.
@ -119,7 +135,7 @@ var Mibew = Mibew || {};
ctor.prototype = new Tmp();
Tmp.prototype = null;
ctor.prototype.constructor = ctor;
}
};
})();
/**
@ -169,7 +185,7 @@ var Mibew = Mibew || {};
document.getElementsByTagName('head')[0].appendChild(styleSheet);
return styleSheet;
}
};
/**
* Loads JavaScript file and attach it to DOM.
@ -189,7 +205,7 @@ var Mibew = Mibew || {};
document.getElementsByTagName('head')[0].appendChild(script);
return script;
}
};
/**
* Initialize a proper chat popup.
@ -203,9 +219,8 @@ var Mibew = Mibew || {};
Mibew.ChatPopup.init = function(options) {
var canUseIFrame = (window.postMessage && options.preferIFrame),
Popup = canUseIFrame ? Mibew.ChatPopup.IFrame : Mibew.ChatPopup.Window;
Mibew.Objects.ChatPopups[options.id] = new Popup(options);
}
};
/**
* A constructor for base (abstract) popup object.
@ -260,7 +275,14 @@ var Mibew = Mibew || {};
* @type {Boolean}
*/
this.modSecurity = options.modSecurity || false;
}
/**
* Chat style
* @type {String}
*/
this.styleName = options.style;
};
/**
* Builds an URL that initializes a chat.
@ -279,7 +301,7 @@ var Mibew = Mibew || {};
return this.url
+ ((this.url.indexOf('?') === -1) ? '?' : '&') + 'url=' + encodeURIComponent(href)
+ '&referrer=' + encodeURIComponent(referrer);
}
};
/**
* Constructs IFrame popup.
@ -292,18 +314,48 @@ var Mibew = Mibew || {};
// Call parent constructor.
BasePopup.call(this, options);
/**
* Store options in case we need some of them later.
* @type {Object}
*/
this.options = options;
/**
* Wrapper for popup iframe DOM Element.
* @type {Node}
*/
this.wrapperDiv = null;
/**
* Popup iframe DOM Element.
* @type {Node}
*/
this.iframe = null;
/**
* Toggle iframe DOM Element.
* @type {Node}
*/
this.toggleDiv = null;
/**
* Indicates if the popup is opened.
* @type {Boolean}
*/
this.isOpened = false;
/**
* Indicates if the popup is minified.
* @type {Boolean}
*/
this.isMinified = false;
/**
* Indicates if cookies are blocked.
* @type {Boolean}
*/
this.cookiesBlocked = false;
// Load default styles. These styles hide the popup while real styles
// are loading.
this.attachDefaultStyles();
@ -315,10 +367,22 @@ var Mibew = Mibew || {};
if (openedChatUrl) {
// The chat was not closed so the popup should be reopened when a
// new page is visited.
this.open(openedChatUrl);
}
this.safeOpen(openedChatUrl);
}
// Check if it's possible to set cookies at all
var rnd = Math.random();
Mibew.Utils.createCookie('mibewCheckToken', rnd);
var checkCookiesBlock = Mibew.Utils.loadScript(options.url.split('?')[0] + '/cookies-set-permission' + '?rnd=' + rnd);
checkCookiesBlock.popup = this;
checkCookiesBlock.onload = function() {
this.popup.cookiesBlocked = false;
};
checkCookiesBlock.onerror = function() {
this.popup.cookiesBlocked = true;
};
};
// Set correct prototype chain for IFrame popup.
Mibew.Utils.inherits(Mibew.ChatPopup.IFrame, BasePopup);
@ -367,26 +431,81 @@ var Mibew = Mibew || {};
return;
}
if (!this.iframe) {
// Create new iframe.
if (this.cookiesBlocked) {
// Last resort. Replace this iframe-based popup with window-based popup
// and try to open a chat in a separate window.
Mibew.Objects.ChatPopups[this.id] = new Mibew.ChatPopup.Window(this.options);
Mibew.Objects.ChatPopups[this.id].open(url);
return;
}
if (!this.wrapperDiv) {
// Create new iframe and its wrapper.
// There is a bug in IE <= 7 that make "name" attribute unchangeble
// for elements that already exist. Thus a temporary div is used
// here as a workaround.
var tmpDiv = document.createElement('div');
tmpDiv.innerHTML = '<iframe name="mibewChat' + this.id + '"></iframe>';
this.wrapperDiv = document.createElement('div');
this.wrapperDiv.className = 'mibew-chat-wrapper';
this.wrapperDiv.setAttribute('id', 'mibew-chat-wrapper-' + this.id);
this.wrapperDiv.style.display = 'none';
this.wrapperDiv.innerHTML = '<iframe name="mibewChat' + this.id + '"></iframe>';
this.iframe = tmpDiv.getElementsByTagName('iframe')[0];
this.iframe = this.wrapperDiv.getElementsByTagName('iframe')[0];
this.iframe.setAttribute('id', 'mibew-chat-frame-' + this.id);
this.iframe.className = 'mibew-chat-frame';
this.iframe.setAttribute('frameBorder', 0);
this.iframe.style.display = 'none';
document.getElementsByTagName('body')[0].appendChild(this.iframe);
document.getElementsByTagName('body')[0].appendChild(this.wrapperDiv);
// Setup toggle element. As it's not a part of the iframe, it should be
// treated separately.
this.toggleDiv = document.createElement('div');
this.toggleDiv.setAttribute('id', 'mibew-chat-frame-toggle-' + this.id);
this.toggleDiv.className = 'mibew-chat-frame-toggle mibew-chat-frame-toggle-on';
Mibew.Utils.addEventListener(this.toggleDiv, 'click', function(event) {
var popups = Mibew.Objects.ChatPopups,
matches = /^mibew-chat-frame-toggle-([0-9A-Za-z]+)$/.exec(this.id);
if (matches && popups[matches[1]]) {
popups[matches[1]].toggle();
}
});
document.getElementsByTagName('body')[0].appendChild(this.toggleDiv);
}
this.iframe.style.display = 'block';
this.wrapperDiv.style.display = 'block';
this.toggleDiv.style.display = 'block';
this.iframe.src = url || this.buildChatUrl();
this.isOpened = true;
// Store style name in case we need it during iframe reopening
Mibew.Utils.createCookie('mibew-chat-frame-style-' + this.id, this.styleName);
// Check minification status of the popup and toggle it if needed.
var minifiedPopup = Mibew.Utils.readCookie('mibew-chat-frame-minified-' + this.id);
if (minifiedPopup === 'true') {
this.toggle();
}
};
/**
* Check chat URL via special request, open the chat if check passes,
* close the popup if the check fails.
*
* @param {String} [url] The URL to open in the popup
*/
Mibew.ChatPopup.IFrame.prototype.safeOpen = function(url) {
var check = Mibew.Utils.loadScript(url + '/check', 'mibew-check-iframe-' + this.id);
check.popup = this;
check.url = url;
var style = Mibew.Utils.readCookie('mibew-chat-frame-style-' + this.id);
check.onload = function() {
this.popup.open(this.url + (style ? '?style=' + style : ''));
};
check.onerror = function() {
this.popup.close();
};
};
/**
* Closes the popup.
@ -397,11 +516,24 @@ var Mibew = Mibew || {};
return;
}
this.iframe.style.display = 'none';
this.wrapperDiv.style.display = 'none';
this.iframe.src = '';
this.isOpened = false;
this.toggleDiv.style.display = 'none';
Mibew.Utils.deleteCookie('mibew-chat-frame-' + this.id);
}
Mibew.Utils.deleteCookie('mibew-chat-frame-minified-' + this.id);
};
/**
* Toggles the popup.
*/
Mibew.ChatPopup.IFrame.prototype.toggle = function() {
this.wrapperDiv.style.display = this.isMinified ? "block" : "none";
this.isMinified = !this.isMinified;
this.toggleDiv.className = 'mibew-chat-frame-toggle mibew-chat-frame-toggle-'
+ (this.isMinified ? 'off' : 'on');
Mibew.Utils.createCookie('mibew-chat-frame-minified-' + this.id, this.isMinified);
};
/**
* Constructs Window popup.
@ -414,7 +546,7 @@ var Mibew = Mibew || {};
BasePopup.call(this, options);
this.window = null;
}
};
// Set correct prototype chain for Window popup.
Mibew.Utils.inherits(Mibew.ChatPopup.Window, BasePopup);
@ -426,6 +558,10 @@ var Mibew = Mibew || {};
* value is omitted, the chat initialization URL will be loaded.
*/
Mibew.ChatPopup.Window.prototype.open = function(url) {
// Windows is already opened, nothing to do.
if (this.window != null && !this.window.closed) {
return;
}
this.window = window.open(
url || this.buildChatUrl(),
'mibewChat' + this.id,
@ -433,7 +569,7 @@ var Mibew = Mibew || {};
);
this.window.focus();
this.window.opener = window;
}
};
/**
* Closes the popup.
@ -446,7 +582,7 @@ var Mibew = Mibew || {};
this.window.close();
this.window = null;
}
};
/**
* Builds window params string.
@ -468,13 +604,12 @@ var Mibew = Mibew || {};
'height=' + this.height.toString(),
'resizable=' + (this.resizable ? '1' : '0')
].join(',');
}
};
// Attach a listener to window's "message" event to get the url of the chat
// which is opened in iframe popup.
Mibew.Utils.addEventListener(window, 'message', function(event) {
var matches = /^mibew-chat-started\:mibewChat([0-9A-Za-z]+)\:(.*)$/.exec(event.data);
if (matches) {
Mibew.Utils.createCookie('mibew-chat-frame-' + matches[1], matches[2]);
}

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -41,7 +41,7 @@
} else {
return new ChildViewType(options);
}
}
};
/**
* @class Represents base collection view

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -41,7 +41,7 @@
/**
* Register 'urlReplace' Handlebars helper.
*
* This helper serch URLs and replace them by 'a' tag
* This helper seeks URLs and replaces them by 'a' tag
*/
Handlebars.registerHelper('urlReplace', function(text) {
return new Handlebars.SafeString(
@ -193,14 +193,17 @@
* </code>
*/
Handlebars.registerHelper('replace', function(search, replacement, options) {
// Convert serch value to string and escape special regexp characters
var searchPattern = search.toString().replace(
/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,
"\\$&"
),
re = new RegExp(searchPattern, 'g');
var unescapedSearch = search
// Allow using new line character
.replace(/\\n/g, '\n')
// Allow using tab character
.replace(/\\t/g, '\t')
// Allow using all UTF characters in \uXXX format.
.replace(/\\u([A-Za-z0-9])/g, function(match, code) {
return String.fromCharCode(parseInt(code, 16));
});
return options.fn(this).replace(re, replacement);
return options.fn(this).split(unescapedSearch).join(replacement);
});
/**
@ -287,7 +290,7 @@
* </code>
*/
Handlebars.registerHelper('override', function(name, options) {
// We need to provide unlimited inheritence level. Rendering is started
// We need to provide unlimited inheritance level. Rendering is started
// from the deepest level template. If the content is in the block
// storage it is related with the deepest level template. Thus we do not
// need to override it.

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -26,7 +26,7 @@ var Mibew = {};
// Use Backbone.Marionette with handlebars.js
Backbone.Marionette.TemplateCache.prototype.compileTemplate = function(rawTemplate) {
return Handlebars.compile(rawTemplate);
}
};
// Use all handlebars template as partials too
// We does not use Handlebars.partials property because of it can be changed

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -47,7 +47,7 @@
return localized.replace(/\{([0-9]+)\}/g, function(match, index) {
return placeholders[parseInt(index)] || '';
});
}
};
/**
* Store localization object. Can be call multiple times, localization
@ -56,6 +56,6 @@
*/
Mibew.Localization.set = function(strs) {
_.extend(localStrings, strs);
}
};
})(Mibew, _);

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -74,7 +74,7 @@
}
return {
'class': classes.join(' ')
}
};
},
/**

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -41,6 +41,8 @@
// Pause before restarting updater using Server.restartUpdater
// function (in seconds)
reconnectPause: 1,
// Call on successful response
onReceiveResponse: function() {},
// Call on request timeout
onTimeout: function() {},
// Call when transport error was caught
@ -92,7 +94,7 @@
* @type Object
* @private
*/
this.functions = {}
this.functions = {};
/**
* Id of the last registered function
@ -107,7 +109,7 @@
* @private
*/
this.mibewAPI = new MibewAPI(new this.options['interactionType']());
}
};
/**
* Make call to the server
@ -148,7 +150,7 @@
return false;
}
return true;
}
};
/**
* Call function at every request to build functions list
@ -165,7 +167,7 @@
callbackFunction: callbackFunction
};
return this.callPeriodicallyLastId;
}
};
/**
* Stop calling function at every request.
@ -177,7 +179,7 @@
if (id in this.callPeriodically) {
delete this.callPeriodically[id];
}
}
};
/**
* Generates unique request token
@ -195,7 +197,7 @@
// Check token uniqueness
} while(token in this.callbacks);
return token;
}
};
/**
* Process request
@ -236,7 +238,7 @@
delete this.callbacks[requestObject.token];
}
}
}
};
/**
* Process function
@ -266,7 +268,7 @@
// Add function results to the execution context
context.storeFunctionResults(functionObject, results);
}
};
/**
* Send the request to the server
@ -291,14 +293,14 @@
success: _.bind(self.receiveResponse, self),
error: _.bind(self.onError, self)
});
}
};
/**
* Start automatic updater
*/
Mibew.Server.prototype.runUpdater = function() {
this.update();
}
};
/**
* Call Mibew.Server.update after specified timeout
@ -310,7 +312,7 @@
_.bind(this.update, this),
time * 1000
);
}
};
/**
* Restarts the automatic updater
@ -326,7 +328,7 @@
}
// Restart updater. Try to reconnect after a while
this.updateAfter(this.options.reconnectPause);
}
};
/**
* Send request to server
@ -360,7 +362,7 @@
// Handle errors
this.options.onUpdateError(e);
}
}
};
/**
* Process response from the Server
@ -371,15 +373,15 @@
* @private
*/
Mibew.Server.prototype.receiveResponse = function(data, textStatus, jqXHR) {
// Call hook on successful request
this.options.onReceiveResponse();
// Do not parse empty responses
if (data == '') {
this.updateAfter(this.options.requestsFrequency);
}
try {
var packageObject = this.mibewAPI.decodePackage(data);
// TODO: Try to use 'for' loop instead of 'for in' loop
// or use hasOwnProperty method
for (var i in packageObject.requests) {
for (var i = 0, len = packageObject.requests.length; i < len; i++) {
this.processRequest(packageObject.requests[i]);
}
} catch (e) {
@ -387,7 +389,7 @@
} finally {
this.updateAfter(this.options.requestsFrequency);
}
}
};
/**
* Add function that can be called by the Server
@ -403,7 +405,7 @@
}
this.functions[functionName][this.functionsLastId] = handler;
return this.functionsLastId;
}
};
/**
* Remove function that can be called by Server
@ -423,7 +425,7 @@
delete this.functions[i];
}
}
},
};
/**
* Call on AJAX errors
@ -442,6 +444,6 @@
this.options.onTransportError();
}
}
}
};
})(Mibew, MibewAPI, $, _);
})(Mibew, MibewAPI, jQuery, _);

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -36,7 +36,7 @@
return str;
}
return str.substring(0, 1).toUpperCase() + str.substring(1);
}
};
/**
* Cast string in camel case to dash format.
@ -61,7 +61,7 @@
}
return parts.join('-');
}
};
/**
* Check if email address valid or not.
@ -99,10 +99,10 @@
// The regular exprassion is base on RFC 2822. It's not fully compatible
// with RFC but is sutabe for most real cases.
return /^(([a-zA-Z0-9!#$%&'*+\-/=?\^_`{|}~]+(\.[a-zA-Z0-9!#$%&'*+\-/=?\^_`{|}~]+)*)|(\".+\"))$/.test(localPart);
}
};
/**
* Play .wav or .mp3 sound file
* Play .wav, or .mp3, or .ogg sound file
* @param {String} file File path (without extension)
*/
Mibew.Utils.playSound = function (file) {
@ -114,6 +114,7 @@
var audioTag = $("<audio>", {autoplay: true, style: "display: none"}).append(
'<source src="' + file + '.wav" type="audio/x-wav" />' +
'<source src="' + file + '.mp3" type="audio/mpeg" codecs="mp3" />' +
'<source src="' + file + '.ogg" type="audio/ogg" codecs="vorbis" />' +
'<embed src="' + file + '.wav" type="audio/x-wav" hidden="true" autostart="true" loop="false" />'
);
$('body').append(audioTag);
@ -121,7 +122,7 @@
audioTag.attr('data-file', file);
}
}
}
};
/**
* Builds params string for window.open method.
@ -150,7 +151,7 @@
'height=' + allOptions.height,
'resizable=' + (allOptions.resizable ? '1' : '0')
].join(',');
}
};
/**
* Sets default options for Vex dialogs.
@ -164,14 +165,41 @@
vex.dialog.buttons.NO.text = Mibew.Localization.trans('Cancel');
});
/**
* Checks if vex dialog is already opened.
* @returns {Boolean}
*/
var isVexOpened = function () {
return (vex.getAllVexes().length > 0);
};
/**
* Sanitize message used in Vex dialog
* @type {Function}
* @param {String} message A message to sanitize.
* @returns {String}
*/
var sanitizeMessage = function(message) {
return message.replace(/&/g, "&amp;")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/"/g, "&quot;")
.replace(/'/g, "&#039;");
};
/**
* Alerts a message.
* @param {String} message A message that should be displayed.
*/
Mibew.Utils.alert = function(message) {
setVexDefaults();
vex.dialog.alert({message: message});
if (isVexOpened()) {
// Do not open alert if one already opened.
return;
}
return vex.dialog.alert({message: sanitizeMessage(message)});
};
/**
* Requires user confirmation.
@ -183,10 +211,10 @@
Mibew.Utils.confirm = function(message, callback) {
setVexDefaults();
vex.dialog.confirm({
message: message,
message: sanitizeMessage(message),
callback: callback
});
}
};
/**
* Requests some info from the user.
@ -198,9 +226,17 @@
Mibew.Utils.prompt = function(message, callback) {
setVexDefaults();
vex.dialog.prompt({
message: message,
message: sanitizeMessage(message),
callback: callback
});
}
};
/**
* Close alert.
* @param {Object} alert instance.
*/
Mibew.Utils.closeAlert = function(alertInstance) {
var res = vex.close(alertInstance.id);
};
})(Mibew, jQuery, _, vex, validator);

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -17,6 +17,14 @@
*/
(function($) {
function updateSendEmail() {
if ($("#user-can-send-email").is(":checked")) {
$(".under-user-can-send-email").show();
} else {
$(".under-user-can-send-email").hide();
}
}
function updateSurvey() {
if ($("#enable-presurvey").is(":checked")) {
$(".under-survey").show();
@ -49,7 +57,18 @@
}
}
function updatePrivacyPolicy() {
if ($("#enable-privacy-policy").is(":checked")) {
$(".under-privacy-policy").show();
} else {
$(".under-privacy-policy").hide();
}
}
$(function() {
$("#user-can-send-email").change(function() {
updateSendEmail();
});
$("#enable-presurvey").change(function() {
updateSurvey();
});
@ -62,9 +81,14 @@
$("#enable-tracking").change(function() {
updateTracking();
});
$("#enable-privacy-policy").change(function() {
updatePrivacyPolicy();
});
updateSendEmail();
updateSurvey();
updateSSL();
updateGroups();
updateTracking();
updatePrivacyPolicy();
});
})(jQuery);

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2015 the original author or authors.
* Copyright 2005-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

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