Compare commits

...

839 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
Dmitriy Simushev
a3f68852ce Fix broken avatar URL in invitation 2015-03-24 15:29:18 +00:00
Dmitriy Simushev
2031d82600 Bump version 2015-03-24 15:05:05 +00:00
Dmitriy Simushev
31b09570f9 Allow to use multiple memcached servers for caching 2015-03-24 15:01:39 +00:00
Dmitriy Simushev
b18aef404a Use bower for managing client side dependencies
Fixes #117
2015-03-23 16:42:32 +00:00
Dmitriy Simushev
6fb71835bf Update Handlebars.js to v3.0.0 2015-03-23 10:05:40 +00:00
Dmitriy Simushev
22aaedd3be Add support of memcached storage for caching 2015-03-20 15:26:15 +00:00
Dmitriy Simushev
758203b6d3 Encapsulate cache pool instantiation in CacheFactory 2015-03-20 14:59:11 +00:00
Dmitriy Simushev
57182b0589 Forbid access to cache files 2015-03-20 13:24:34 +00:00
Dmitriy Simushev
0f44076e48 Use unexpired cache for routes by default 2015-03-20 13:15:32 +00:00
Dmitriy Simushev
094139dead Add routes caching 2015-03-20 13:08:04 +00:00
Dmitriy Simushev
30fd4bad7c Add HTTP caching headers to translations.js
Fixes #70
2015-03-19 12:04:42 +00:00
Dmitriy Simushev
9fef4b2871 Simplify working with Asset Manager in Handlebars helpers 2015-03-19 09:55:58 +00:00
Dmitriy Simushev
db702e43c9 Simplify working with Router in Handlebars helpers 2015-03-19 09:34:16 +00:00
Dmitriy Simushev
93c5cb995a Update Vex.js to v2.3.2 2015-03-18 13:15:41 +00:00
Dmitriy Simushev
5fada43676 Update Marionette.js to v2.4.1 2015-03-18 13:07:26 +00:00
Dmitriy Simushev
adac8fb3fd Update Underscore.js to v1.8.2 2015-03-18 12:57:56 +00:00
Dmitriy Simushev
0eef94a164 Update composer dependencies 2015-03-18 12:50:09 +00:00
Dmitriy Simushev
3c0c880661 Add CSRF protection for password recovery forms 2015-03-17 14:41:31 +00:00
Dmitriy Simushev
e122d020eb Add CSRF protection to login form 2015-03-17 14:22:32 +00:00
Dmitriy Simushev
a8629df5ec Use "encodeURIComponent" instead of "escape" in popup windows JS
This also fixes passing client's URL for IDN domains to the server.
2015-03-17 13:47:23 +00:00
Dmitriy Simushev
415005e2f6 Fix validation for empty emails 2015-03-17 13:25:00 +00:00
Dmitriy Simushev
6e78c45c67 Allow using email with IDN domains at the server side 2015-03-17 12:25:25 +00:00
Dmitriy Simushev
6ac77e629a Improve email validation at the client side 2015-03-17 12:24:21 +00:00
Dmitriy Simushev
313e854723 Move email validation function to Mibew\Mail\Utils class 2015-03-17 10:36:45 +00:00
Dmitriy Simushev
4332d9c205 Use third-party library to validate email at client side 2015-03-17 10:31:37 +00:00
Dmitriy Simushev
833d2a9096 Use PHP's filter_var function for email validation 2015-03-16 15:58:34 +00:00
Dmitriy Simushev
6e71f0542b Store relative avatar path in database
Also it fixes #114
2015-03-16 12:56:36 +00:00
f6fe379a54 Add information on cron job into README 2015-03-10 18:18:22 +03:00
Dmitriy Simushev
cc5adc17b2 Use correct field to pass operator's requests frequency to client side
Fixes #112
2015-03-04 09:56:37 +00:00
284318a287 Update version 2015-02-24 18:21:20 +03:00
Dmitriy Simushev
edcd348bca Fix bug with single popup window openning 2015-02-20 14:22:59 +00:00
Dmitriy Simushev
21ae86958d Remove unused AbstractGenerator::getChatUrlForJs method 2015-02-03 16:20:39 +00:00
Dmitriy Simushev
0dca0bb57d Build correct URLs for chat popups 2015-02-03 16:19:01 +00:00
Dmitriy Simushev
933ced4575 Do not use HTML entities inside script tag
Fixes #107
2015-02-03 16:17:52 +00:00
Dmitriy Simushev
232d69cf72 Use Vex.js for alert, confirm and prompt 2015-02-03 14:23:32 +00:00
Dmitriy Simushev
c1850f0bb3 Use async notice for alert, confirm and prompt functions 2015-02-03 14:08:52 +00:00
Dmitriy Simushev
ebd6684d4a Switch to PHPCS 2.x 2015-02-03 09:49:00 +00:00
Dmitriy Simushev
62f958622c Use stable version of UA parser 2015-02-03 09:46:07 +00:00
Dmitriy Simushev
626145340e Fix setting current database version in the Updater 2015-01-26 12:17:52 +00:00
Dmitriy Simushev
84b0d891e0 Update dependencies of the build system 2015-01-23 11:47:12 +00:00
Dmitriy Simushev
ef98d5056a Make the project buildable on windows 2015-01-23 11:34:24 +00:00
Dmitriy Simushev
ea0b6a0cd5 Add "widgetResponseAlter" event 2015-01-22 12:58:53 +00:00
Dmitriy Simushev
f015b5b820 Pass an instance of Request Processor to *_FUNCTION_CALL events 2015-01-22 11:41:35 +00:00
Dmitriy Simushev
6d3810b7ba Improve Mibew.Utils.toDashFormat JS function 2015-01-21 11:49:27 +00:00
Dmitriy Simushev
e273b04dab Remove unneded condition from profile controller 2015-01-21 11:48:40 +00:00
Dmitriy Simushev
9799fb5e3f Fix "empty password" notification 2015-01-21 11:28:13 +00:00
Dmitriy Simushev
c27a0e1aea Use correct login to generate password hash when it is changed 2015-01-21 11:22:12 +00:00
47ee6edaad Update copyright notices 2015-01-21 14:04:29 +03:00
b8d2af4c67 Update version 2015-01-21 13:05:41 +03:00
Dmitriy Simushev
8faa0d9f4e Hide iframe popup while its real styles are loading 2015-01-21 09:49:50 +00:00
Dmitriy Simushev
9ef0739b80 Show ajax loader while chat iframe is loading 2015-01-20 14:45:41 +00:00
Dmitriy Simushev
ad7f3d6167 Do not define widget code twice 2015-01-20 14:44:21 +00:00
Dmitriy S. Simushev
78dfb230ed Merge pull request #102 from Mibew/dashboard
Dashboard
2015-01-20 16:58:05 +03:00
Dmitriy Simushev
854a4ca010 Switch to dev version of UAParser 2015-01-20 13:55:50 +00:00
Dmitriy Simushev
7fde2eb9cd Add ability to use mibew in an iframe
Fixes #63
2015-01-20 13:48:28 +00:00
8c6d98ddbd Remove useless attribute 2015-01-19 13:39:12 +03:00
c2229a6c79 Improve dashboard look'n'feel 2015-01-17 15:16:10 +03:00
Dmitriy Simushev
120abce028 Fix invitation window params 2015-01-16 10:40:06 +00:00
Dmitriy Simushev
a6d6f2bea2 Add Mibew.Utils.deleteCookie function to widget.js 2015-01-15 13:31:50 +00:00
Dmitriy Simushev
3f6a95f7a6 Use human-readable way to define visitor track window params 2015-01-14 14:37:30 +00:00
Dmitriy Simushev
090f650ac1 Use human-readable way to define user track window params 2015-01-14 14:25:51 +00:00
Dmitriy Simushev
06109eb0c4 Use human-readable way to define ban window params 2015-01-14 14:20:15 +00:00
Dmitriy Simushev
f6938b2f13 Remove unused configs from default page style 2015-01-14 14:12:57 +00:00
Dmitriy Simushev
9467525dac Remove unneeded default configs from ChatStyle 2015-01-14 13:50:32 +00:00
Dmitriy Simushev
1914b23c74 Use human-readable way to define history window params 2015-01-14 13:38:39 +00:00
Dmitriy Simushev
e333ff3d27 Rename Mibew.Utils.buildWindowOptions to buildWindowParams 2015-01-14 12:56:24 +00:00
Dmitriy Simushev
a5b7002239 Use human-readable way to define send mail window params 2015-01-14 12:51:38 +00:00
Dmitriy Simushev
9faf346634 Use human-readable way to define chat window params 2015-01-14 12:25:25 +00:00
Dmitriy Simushev
67a0db5349 Add JS "buildWindowOptions" utility method 2015-01-14 12:14:49 +00:00
Dmitriy Simushev
e5b8c84736 Allow plugins depend on environment
Fixes #98
2015-01-13 11:32:33 +00:00
Dmitriy Simushev
090383bc95 Use UA Parser from packagist.org instead of GitHub repo 2015-01-12 11:21:27 +00:00
Dmitriy S. Simushev
52107afc1a Merge pull request #100 from Mibew/invitations_fix
Prevent use of undefined values on display of chat invitation
2015-01-12 11:46:15 +03:00
Dmitriy S. Simushev
3b9ded0b29 Merge pull request #101 from Mibew/missed_constant
Replace old localization constant with a valid string
2015-01-06 21:58:56 +03:00
c51a3ee5a1 Replace old localization constant with a valid string 2015-01-06 20:32:31 +03:00
ba9c01b82c Prevent use of undefined values on display of chat invitation 2015-01-03 03:13:19 +03:00
Dmitriy Simushev
132ca02cdf Allow to use any browser for chat
There are too many browsers in the world thus we cannot really say
is the current browser is fully supported or not. Give a chance to
all browsers.
2014-12-29 15:39:13 +00:00
Dmitriy Simushev
9cd082b878 Use third party library to detect user's browser 2014-12-29 15:04:24 +00:00
Dmitriy Simushev
efbf92b012 Use multi-level style configs 2014-12-29 11:30:33 +00:00
Dmitriy Simushev
ff1940cdc5 Mibew does not use "iconv" library anymore 2014-12-29 09:29:13 +00:00
Dmitriy Simushev
6a17db4e04 Operators can post messages only to own threads 2014-12-25 15:28:47 +00:00
Dmitriy Simushev
5a2e48eeef Fix ID style in operator's code field 2014-12-25 13:36:11 +00:00
Dmitriy Simushev
b9fd28f20f Do not show "visitor navigate" message if the page is not changed 2014-12-25 12:42:03 +00:00
Dmitriy Simushev
1a8f50adb0 Move "about" link to "Others" section 2014-12-24 16:00:50 +00:00
Dmitriy Simushev
31d602986e Move link to profile to operator's name in the top right corner
Fixes #93
2014-12-24 15:31:13 +00:00
Dmitriy Simushev
fb83027a1e Truncate operator's avatar in invitation
Fixes #96
2014-12-24 13:44:27 +00:00
Dmitriy Simushev
19edc91dfd Add warning sign to "run update wizard" notice 2014-12-24 12:59:26 +00:00
Dmitriy Simushev
27a23f68c0 Remove unneeded versions
Fixes #97
2014-12-24 12:50:27 +00:00
Dmitriy Simushev
1306efd380 Move header logo's styles to css 2014-12-24 12:08:53 +00:00
Dmitriy Simushev
b19473f658 Add link to dashboard to mibew logo
Fixes #94
2014-12-24 12:03:41 +00:00
Dmitriy Simushev
53c60eed76 Exclude JS sources from release package 2014-12-23 14:48:26 +00:00
Dmitriy Simushev
1fae58c350 Remove separate license page 2014-12-23 14:45:14 +00:00
Dmitriy Simushev
0c00a697ec Update build dependencies 2014-12-23 14:36:59 +00:00
Dmitriy Simushev
7e8ea1cdbf Update copyright notice at the about page 2014-12-23 14:32:46 +00:00
Dmitriy Simushev
a39d0fa6cf Fix typo at the about page 2014-12-23 13:55:36 +00:00
Dmitriy Simushev
b40e1deb89 Remove latest version placeholder from about page 2014-12-23 13:52:11 +00:00
Dmitriy Simushev
ee751b471d Use new gateway for latest version info 2014-12-23 13:46:43 +00:00
Dmitriy Simushev
782e9895e5 Show another info on the about page 2014-12-23 13:33:27 +00:00
Dmitriy Simushev
8552881f7d Move system info to about page 2014-12-23 12:51:40 +00:00
Dmitriy Simushev
9bfd6a29fb Use new icon for add group, operator, etc. buttons. 2014-12-23 10:48:53 +00:00
Dmitriy Simushev
f5c80e7b5c Add about page
Fixes #53
2014-12-23 10:22:22 +00:00
Dmitriy Simushev
d7a5c1d9c1 Use new dashboard icons
The icons are taken from http://www.icojam.com/blog/?p=259
2014-12-22 15:44:57 +00:00
Dmitriy Simushev
e66e0c1452 Update jQuery to v1.11.2 2014-12-22 10:16:59 +00:00
Dmitriy Simushev
21daf749f0 Allow markup in leave message page description 2014-12-19 13:50:40 +00:00
Dmitriy Simushev
1e46d6fabd Add notice about statistics aggregation 2014-12-19 13:24:07 +00:00
Dmitriy Simushev
8b34ca34c7 Remove statistics_aggregation_interval setting 2014-12-19 12:36:41 +00:00
Dmitriy Simushev
964e917f4a Provide easy way to override views in JS application 2014-12-18 14:42:11 +00:00
Dmitriy Simushev
210e82e798 Use correct ID for dynamically loaded scripts 2014-12-18 14:05:32 +00:00
Dmitriy Simushev
243fa1a1d9 Remane "mibewAgentButton" id to "mibew-agent-button" 2014-12-18 13:54:46 +00:00
Dmitriy Simushev
506425a9e1 Clean up JS in the default page style 2014-12-18 13:20:35 +00:00
Dmitriy Simushev
a72a602120 Update Marionette.js to v2.3.0 2014-12-18 12:57:44 +00:00
Dmitriy S. Simushev
bcd2bb9242 Merge pull request #89 from Mibew/remove_link
Remove useless link from popup window with a thread history
2014-12-17 20:35:10 +03:00
Dmitriy S. Simushev
a6e6993a65 Merge pull request #88 from Mibew/layout_fix
Fix layout on plugins page
2014-12-17 20:34:40 +03:00
054133e013 Remove useless link from popup window with a thread history 2014-12-17 19:31:28 +03:00
2d875ba623 Fix layout on plugins page 2014-12-17 19:15:25 +03:00
Dmitriy S. Simushev
e6f6fd7d38 Merge pull request #87 from Mibew/issue73
Beautify stylesheets and fix #73
2014-12-17 16:50:46 +03:00
792acd7b17 Beautify stylesheets and fix #73 2014-12-17 15:38:52 +03:00
Dmitriy Simushev
30d884b699 Use static file for license during installation 2014-12-17 11:42:05 +00:00
Dmitriy Simushev
bc14d1f0ef Let the system work without mailer configs 2014-12-17 10:46:42 +00:00
Dmitriy S. Simushev
062a4c1090 Merge pull request #86 from Mibew/fix_typo
Fix typo in string constant
2014-12-17 13:09:26 +03:00
134bbb9984 Fix typo in string constant 2014-12-17 00:04:01 +03:00
Dmitriy Simushev
a441bed2a2 Move common helpers to a separate composer package 2014-12-16 16:00:20 +00:00
Dmitriy Simushev
f5ee6448e4 Store project meta info only in composer.json 2014-12-11 14:21:20 +00:00
Dmitriy Simushev
3e77eddb33 Exclude vendor binaries from release package 2014-12-11 14:06:15 +00:00
Dmitriy Simushev
ad8c815b3c Use SESSION_PREFIX everywhere 2014-12-11 13:56:22 +00:00
Dmitriy Simushev
96724464e2 Create missed templates at "operator/mail-template" page 2014-12-11 13:20:20 +00:00
Dmitriy Simushev
8f346ae0b7 Do not die if "leave_message" mail template cannot be loaded 2014-12-11 13:07:17 +00:00
Dmitriy Simushev
8a47afef58 Do not die if "user_history" mail template cannot be loaded 2014-12-11 13:04:25 +00:00
Dmitriy Simushev
6768fe96c2 Use "en" locale as a fallback for MailTemplate 2014-12-11 12:48:53 +00:00
Dmitriy Simushev
c4a47928a8 Add warning about uncaught exception to AbstractProcessor 2014-12-11 11:57:57 +00:00
Dmitriy Simushev
ec06357535 Use stable version of Handlebars.php 2014-12-11 11:26:29 +00:00
Dmitriy Simushev
bb1b6c377c Log error when "Internal Server Error" page is shown 2014-12-11 10:48:00 +00:00
Dmitriy Simushev
9c87fadb7d Clean up ImageGenerator::getWidgetCode method 2014-12-11 10:18:24 +00:00
Dmitriy S. Simushev
db7aa3d12a Merge pull request #84 from Mibew/button_fix
Fix button generation with disabled visitors tracking
2014-12-11 13:14:40 +03:00
304de4ab71 Fix button generation with disabled visitors tracking 2014-12-10 19:48:34 +03:00
Dmitriy S. Simushev
3e5f589972 Merge pull request #83 from Mibew/connection_timeout
Fixes #65
2014-12-10 19:32:15 +03:00
Dmitriy Simushev
6fbee71173 Add an ability to use SMTP mail transport 2014-12-10 16:21:59 +00:00
07c015856e Fixes #65 2014-12-10 19:09:04 +03:00
Dmitriy Simushev
17b7bf6757 Use Object-Oriented approach for mail templates 2014-12-10 11:50:57 +00:00
Dmitriy Simushev
e0716bbeb2 Fix bug with "plugin" table fields sizes 2014-12-10 11:15:23 +00:00
Dmitriy Simushev
4e4f0adfd6 Use SwiftMailer to send emails 2014-12-09 14:40:16 +00:00
Dmitriy Simushev
a66e23fe9b Remove unneeded TODO from HomeController 2014-12-09 11:55:35 +00:00
80565efefb Update README 2014-12-08 16:18:34 +03:00
3a325ecc6c Update info on system requirements 2014-12-08 15:12:24 +03:00
Dmitriy Simushev
aa28272dbd Update Symfony Components 2014-12-05 15:53:18 +00:00
Dmitriy Simushev
097ec6ef1a Add info about current plugin state 2014-11-28 15:18:48 +00:00
Dmitriy Simushev
2bdfebc428 Add PluginManager::hasPlugin method 2014-11-28 15:02:16 +00:00
Dmitriy Simushev
5282e789ba Use PluginInfo::needsUpdate instead of checking versions directly 2014-11-28 14:38:54 +00:00
Dmitriy Simushev
b0aa66c7cf Fix issue with sprintf arguments in PluginManager 2014-11-28 14:25:07 +00:00
Dmitriy Simushev
772aa904d9 Add plugins update stuff 2014-11-28 14:20:47 +00:00
Dmitriy Simushev
459f75727a Provide an ability to use static methods as updates 2014-11-28 13:34:37 +00:00
Dmitriy Simushev
e2d4ab3715 Recognize alpha and rc versions in updates names 2014-11-28 11:46:27 +00:00
Dmitriy Simushev
80f5873d9a Move getUpdates to Maintenance\Utils class 2014-11-28 11:02:55 +00:00
Dmitriy Simushev
abdfa54f36 Update Handlebars.php 2014-11-27 15:42:30 +00:00
Dmitriy Simushev
361e424acd Merge two localization constants in plugins template 2014-11-27 15:08:52 +00:00
Dmitriy Simushev
7ac85ac412 Check that all needed PHP extensions are loaded before install 2014-11-27 13:01:25 +00:00
Dmitriy Simushev
80077be185 Implement new plugin management system 2014-11-27 11:42:23 +00:00
014a7fabcb Merge pull request #80 from Mibew/issue61
Fix setting of tracking cookie for TLDs
2014-11-27 13:37:26 +03:00
a2fee28bba Fix setting of tracking cookie for TLDs
Fixes #61
2014-11-26 20:02:15 +03:00
Dmitriy Simushev
f7434502b7 Add PluginInfo::getInstance method 2014-11-25 12:22:49 +00:00
Dmitriy Simushev
a4361fe8ce Create plugin info wrapper 2014-11-24 10:37:08 +00:00
Dmitriy Simushev
48978fb060 Add a function to check if a plugin exists or it does not. 2014-11-24 10:13:51 +00:00
Dmitriy Simushev
03a8eab3d1 Fix undefined index in ThreadProcessor::processFunction 2014-11-21 15:49:03 +00:00
Dmitriy Simushev
428c592139 Statically cache results of Plugin\Utils::discoverPlugins 2014-11-21 13:06:44 +00:00
Dmitriy Simushev
dca7c2c520 Fix comments in Mibew\Ban class 2014-11-21 13:00:30 +00:00
Dmitriy Simushev
c9c1ffca4e Remove unused "use" statement 2014-11-20 10:06:30 +00:00
Dmitriy Simushev
ad5554bb52 Fix coding style in Mibew\Plugin\Utils 2014-11-20 09:50:32 +00:00
Dmitriy Simushev
bf7642dab3 Run plugins only after all libs are loaded 2014-11-20 09:26:03 +00:00
Dmitriy Simushev
a63f4ced3d Create a method for plugin class name building 2014-11-19 14:19:01 +00:00
Dmitriy Simushev
b896d43db7 Use more strict policy for plugin names 2014-11-19 14:06:19 +00:00
Dmitriy Simushev
f4b08ff0a3 Add plugins discovery means 2014-11-19 13:15:41 +00:00
Dmitriy Simushev
c70764dab2 Use regular singleton in Mibew\Plugin\PluginManager 2014-11-19 12:50:08 +00:00
Dmitriy Simushev
542b830577 Return false from PluginManager::getPlugin for unregistered plugins 2014-11-19 11:58:50 +00:00
Dmitriy Simushev
bfe902e062 Rename Mibew\Plugin\Manager to Mibew\Plugin\PluginManager 2014-11-19 11:55:16 +00:00
Dmitriy Simushev
c205c9ff94 Use versions range in plugin dependencies 2014-11-19 10:17:15 +00:00
Dmitriy Simushev
2d702f5542 Add versions check to plugins 2014-11-18 12:06:22 +00:00
Dmitriy Simushev
d68b0bdb0c Flush cache on update 2014-11-17 14:30:15 +00:00
Dmitriy Simushev
07b25a2fc3 Create Updater 2014-11-17 14:19:07 +00:00
Dmitriy Simushev
a43d46f5f5 Extract SessionAuthenticationManager 2014-11-13 11:19:53 +00:00
Dmitriy Simushev
47851c9ed2 Move "format_version_id" func to Maintenance\Utils class 2014-11-12 15:14:13 +00:00
Dmitriy Simushev
f82d42e729 Add "buttonGenerate" event 2014-11-12 10:58:21 +00:00
Dmitriy Simushev
c43fccf297 Use CanteenHTML5 for buttons generation 2014-11-12 10:24:40 +00:00
Dmitriy Simushev
d446b9a78f Replace INSTALLATION_IN_PROGRESS const with MAINTENANCE_MODE 2014-11-11 13:31:38 +00:00
Dmitriy Simushev
1deebaff20 Move Installer to a separated namespace 2014-11-11 13:14:37 +00:00
Dmitriy Simushev
df66227729 Remove unused "escape_with_cdata" function 2014-11-11 12:21:02 +00:00
Dmitriy Simushev
bcbb02f52f Fix trailing slash removing on installation 2014-11-11 10:49:13 +00:00
Dmitriy Simushev
f5470239e4 Use Symfony-compatible router 2014-11-11 10:34:04 +00:00
Dmitriy Simushev
f8909d5e8c Move Stash cache to separated directory 2014-11-11 10:31:51 +00:00
d27633fc28 Increase Mibew version 2014-11-10 21:41:12 +03:00
Dmitriy Simushev
6066b9312e Remove "is_secure_request" function 2014-11-07 12:39:19 +00:00
Dmitriy Simushev
fe0d2f2760 Check directories permissions on install
Fixes #76
2014-11-07 12:09:18 +00:00
Dmitriy Simushev
2c0d88c4d5 Use ephemeral cache during installation 2014-11-07 11:40:36 +00:00
Dmitriy Simushev
2c9a6830c8 Use lazy objects creation in Application class 2014-11-07 11:10:19 +00:00
Dmitriy Simushev
6b3b5d6fec Forbid users to post to closed threads
Fixes #72
2014-11-06 13:13:29 +00:00
Dmitriy Simushev
b4ab5d8cd1 Use "once" method instead of "on"/"off" in JS message form 2014-11-06 11:02:57 +00:00
Dmitriy Simushev
bffc2fd799 Restrict access to a thread for third-party users
Fixes #71
2014-11-06 10:45:38 +00:00
Dmitriy Simushev
3f36afc285 Fix comments for AbstractProcessor::processFunction method 2014-11-06 10:08:12 +00:00
Dmitriy Simushev
18e9cf7039 Remove "get_logged_in" function 2014-11-05 15:52:25 +00:00
Dmitriy Simushev
43f7df6c76 Remove Thread::setupAvatar method 2014-11-05 15:29:23 +00:00
Dmitriy Simushev
03328b9293 Use valid types for Thread fields 2014-11-05 14:40:19 +00:00
Dmitriy Simushev
3dd80070c7 Add "userId" and "agentId" fields to thread at client side 2014-11-05 14:25:02 +00:00
Dmitriy Simushev
3984c260b0 Use the correct backpath to redirect operator after login 2014-11-05 10:46:56 +00:00
Dmitriy Simushev
82a4d7a2a2 Use composer's autoloader
Funny, but it fixes #75 without classes changing
2014-10-31 14:13:49 +00:00
Dmitriy Simushev
3b43090bda Add "visitorDeleteOld" event 2014-10-31 11:51:08 +00:00
Dmitriy Simushev
f0c4299ba3 Remove old visitors in single process 2014-10-31 11:26:53 +00:00
Dmitriy Simushev
f10079497c Add "groupUpdateOperators" event 2014-10-31 09:59:44 +00:00
Dmitriy Simushev
07fc4a3666 Fix broken links at "operator/group/<id>/members" page 2014-10-30 13:53:47 +00:00
Dmitriy Simushev
38bc096444 Return IDs set from "get_operator_group_ids" function 2014-10-30 13:49:16 +00:00
Dmitriy Simushev
146c4b7ac1 Return IDs set from "get_group_members" function 2014-10-30 13:27:23 +00:00
Dmitriy Simushev
9d854e9642 Use regular "Thread::save" to close old invitations 2014-10-30 13:07:54 +00:00
Dmitriy Simushev
6e200bf956 Fix race condition in old invitation closing 2014-10-30 12:33:21 +00:00
Dmitriy Simushev
b3c9a02660 Encapsulate locks mechanics in "ProcessLock" class 2014-10-30 12:25:48 +00:00
Dmitriy Simushev
22699f1ed5 Add "threadGetMessagesAlter" event 2014-10-30 10:19:08 +00:00
Dmitriy Simushev
c0232e6fce Use regular tread save in "Thread::closeOldThreads" method 2014-10-29 16:03:38 +00:00
Dmitriy Simushev
96c9bf2a93 Prevent race condition in old threads closing 2014-10-29 15:12:05 +00:00
Dmitriy Simushev
b5020645be Remove Settings::update method
It was too slow
2014-10-29 15:02:55 +00:00
Dmitriy Simushev
bf483e4abc Fix bug with "Settings::update" method. 2014-10-29 14:35:40 +00:00
Dmitriy Simushev
a37018aab6 Add "default" argument to "Settings::get" method 2014-10-29 13:48:30 +00:00
Dmitriy Simushev
be7d49c0f5 Use Events class constant instead of raw event name in track.php 2014-10-29 12:39:59 +00:00
Dmitriy Simushev
336d8c1faa Add "threadCreate" event 2014-10-29 10:50:09 +00:00
Dmitriy Simushev
ab942731e6 Refactor Thread class 2014-10-29 10:45:35 +00:00
Dmitriy Simushev
168336a20b Document "threadFunctionCall" event 2014-10-28 13:04:31 +00:00
Dmitriy Simushev
297377b0fd Add "operatorUpdate" event 2014-10-28 12:43:40 +00:00
Dmitriy Simushev
65d7cb3823 Use "update_operator" func for operator modification everywhere 2014-10-28 12:26:14 +00:00
Dmitriy Simushev
1d9a837e37 Make operator's login unchangeable 2014-10-28 12:06:07 +00:00
Dmitriy Simushev
05f5a606d1 Refactor update_operator function 2014-10-28 11:45:36 +00:00
Dmitriy Simushev
614f02a108 Refactor "check_group_fields" function 2014-10-28 10:40:26 +00:00
Dmitriy Simushev
32a134f31a Remove unused class alias from libs/chat.php 2014-10-27 14:20:59 +00:00
Dmitriy Simushev
4ae850d529 Remove invalid link from Thread::postMessage docs 2014-10-27 14:19:08 +00:00
Dmitriy Simushev
3f27aea2ea Add "threadPostMessage" event 2014-10-27 13:18:12 +00:00
Dmitriy Simushev
30da4ae75e Add notice about triggering event to "update_group" function 2014-10-27 12:07:52 +00:00
Dmitriy Simushev
b7bf41a191 Create separate function for enable/disable operators 2014-10-27 11:55:29 +00:00
Dmitriy Simushev
38769615ac Fix notice about undefined variable in BanController 2014-10-27 10:57:43 +00:00
Dmitriy Simushev
6cc94bcb33 Reduce duplication in Ban class 2014-10-27 10:57:03 +00:00
Dmitriy Simushev
7f6a9c6513 Add "banUpdate" event 2014-10-27 10:40:45 +00:00
Dmitriy Simushev
7e371a20d9 Fix wrong group key in "update_group" function 2014-10-27 10:30:25 +00:00
Dmitriy Simushev
28270d7d18 Use named placeholders in "update_group" function 2014-10-27 10:27:37 +00:00
Dmitriy Simushev
d6084f035f Pass regular group array to "create_group" and "update_group" functions 2014-10-27 10:19:21 +00:00
Dmitriy Simushev
816323a154 Add one more group parameter to check 2014-10-27 10:01:40 +00:00
Dmitriy Simushev
0a3207e879 Add "groupUpdate" event 2014-10-27 10:00:27 +00:00
Dmitriy Simushev
7af300b8f5 Move group related functions to libs/groups.php 2014-10-23 11:41:35 +00:00
Dmitriy Simushev
9753081407 Sent "Visitor closed chat window" message only if there was a chat 2014-10-22 14:34:06 +00:00
Dmitriy Simushev
c83fd59763 Remove unused "blockedcount" field of ban table 2014-10-22 14:17:38 +00:00
Dmitriy Simushev
445a5866ad Add "invitationIgnore" event 2014-10-22 14:15:05 +00:00
Dmitriy Simushev
f070a121fe Fix typo in widget.js code 2014-10-21 12:54:07 +00:00
Dmitriy Simushev
c2f0fb24c3 Describe "routesAlter" event in Events class 2014-10-21 12:37:07 +00:00
Dmitriy Simushev
7eea7c09d4 Add "banDelete" event 2014-10-21 11:51:19 +00:00
Dmitriy Simushev
6263f3a2f4 Add "banCreate" event 2014-10-21 11:43:10 +00:00
Dmitriy Simushev
ada83c629a Encapsulate work with bans in Ban class 2014-10-21 11:33:13 +00:00
Dmitriy Simushev
1dea407037 Add "invitationReject" event 2014-10-20 12:44:44 +00:00
Dmitriy Simushev
b83cb193f1 Add "invitationAccept" event 2014-10-20 12:36:44 +00:00
Dmitriy Simushev
5ad1044dc0 Add "invitationCreate" event 2014-10-20 12:27:10 +00:00
Dmitriy Simushev
09b3d77b19 Add "groupDelete" action 2014-10-20 12:21:59 +00:00
Dmitriy Simushev
7ce1add5dc Create delete_group function 2014-10-20 12:10:31 +00:00
Dmitriy Simushev
34341ef01c Refactor create_group function a little 2014-10-20 11:50:45 +00:00
Dmitriy Simushev
1aec37b6f6 Add "groupCreate" event 2014-10-20 11:17:56 +00:00
Dmitriy Simushev
9b05509ec4 Add "threadClose" event 2014-10-20 11:07:50 +00:00
Dmitriy Simushev
53450ea9d6 Create "threadDelete" event 2014-10-20 10:55:22 +00:00
Dmitriy Simushev
60bd21bf42 Move "threadUpdate" event to Events class 2014-10-20 10:17:34 +00:00
Dmitriy Simushev
d05fe335b8 Describe all "users" app related events in Events class 2014-10-20 10:12:55 +00:00
Dmitriy Simushev
55b1476139 Describe "cronRun" event in Events class 2014-10-17 14:42:39 +00:00
Dmitriy Simushev
de1d5d6d51 Create "visitorCreate" event 2014-10-17 14:37:01 +00:00
Dmitriy Simushev
e61b91dd5e Describe "visitorTrack" event in Events class 2014-10-17 14:10:20 +00:00
Dmitriy Simushev
1814298f4f Create "Resource not found" event 2014-10-17 13:47:57 +00:00
Dmitriy Simushev
5c52ec61da Describe "accessDenied" event in Events class 2014-10-17 13:36:20 +00:00
Dmitriy Simushev
86f6d6429e Move "pageAdd*" events description to Events class 2014-10-17 13:15:53 +00:00
Dmitriy Simushev
31c4afe751 Remove jabber operator field 2014-10-17 12:48:28 +00:00
Dmitriy Simushev
a34cb53e91 Add event on operator create 2014-10-17 11:09:10 +00:00
Dmitriy Simushev
2dca8f236e Describe operators' events in one place 2014-10-17 10:54:04 +00:00
Dmitriy Simushev
55b7b28eb1 Move EventDispatcher class to a separate namespace 2014-10-17 09:47:03 +00:00
Dmitriy Simushev
919c71a1c1 Fix misssed semicolon in js test 2014-10-14 14:39:52 +00:00
Dmitriy Simushev
2d5d4b0e46 Remove unused "append_query" function 2014-10-14 14:38:54 +00:00
Dmitriy Simushev
2703f72de8 Fix localization of unknown strings on client 2014-10-14 12:36:23 +00:00
Dmitriy Simushev
7f071cbe80 Increase Mibew version 2014-10-14 11:19:24 +00:00
Dmitriy Simushev
55587f67fe Remove unused "jsString" Handlebars.php helper 2014-10-14 11:18:39 +00:00
Dmitriy Simushev
ae7ee06031 Increase cache ttl for handlebars templates 2014-10-14 11:16:55 +00:00
Dmitriy Simushev
3fbc5fa262 Always set focus on message input after message sent
Fixes #66
2014-10-14 11:03:20 +00:00
Dmitriy Simushev
397786991d Simplify plugins' assets attachment 2014-10-14 10:57:01 +00:00
Dmitriy Simushev
1a82e11b5e Use 500 as default weight for plugins assets 2014-10-14 10:23:40 +00:00
Dmitriy Simushev
71d2b234c6 Create Asset/Package class to reduce code duplication 2014-10-14 09:36:55 +00:00
Dmitriy Simushev
f8d4d074d5 Rename "styles/dialogs" to "styles/chats" 2014-10-13 13:52:17 +00:00
Dmitriy Simushev
6ac121bc01 Remove unused value 2014-10-13 13:34:28 +00:00
Dmitriy Simushev
452446a375 Initialize chat js application from controller 2014-10-13 13:30:07 +00:00
Dmitriy Simushev
dcd17ed01c Attach js files to chat page in "_layout" template 2014-10-13 12:41:11 +00:00
Dmitriy Simushev
8eaf93a916 Remove unused templates from the default chat style 2014-10-13 11:34:44 +00:00
Dmitriy Simushev
0d1efa5a87 Use cache for Handlebars AST 2014-10-13 11:20:05 +00:00
Dmitriy Simushev
d92b88b65a Initialize "thread_log" client side app from controller 2014-10-13 09:52:06 +00:00
Dmitriy Simushev
aee1aa6904 Initialize "users" client side app from controller 2014-10-13 09:23:43 +00:00
Dmitriy Simushev
5dafbd2997 Add weights to asset manager 2014-10-13 09:07:07 +00:00
Dmitriy Simushev
54b4814389 Attach js on updates page via controller 2014-10-10 12:38:00 +00:00
Dmitriy Simushev
d01bd8a080 Move thread log app initialization to controller 2014-10-10 12:25:53 +00:00
Dmitriy Simushev
3081dcc8db Remove js working with features fields from style files 2014-10-10 12:14:37 +00:00
Dmitriy Simushev
c86d7569f3 Remove js working with group fields from style files 2014-10-10 11:59:23 +00:00
Dmitriy Simushev
e8b35a6971 Move js attaching from install_done template to controller 2014-10-10 11:44:13 +00:00
Dmitriy Simushev
3339153ad3 Remove js with operator delete comfirm from style files 2014-10-10 11:24:54 +00:00
Dmitriy Simushev
ed6252bb38 Remove js with group delete comfirm from style files 2014-10-10 11:10:28 +00:00
Dmitriy Simushev
01e2d8f2a7 Remove js with ban delete comfirm from style files 2014-10-10 10:57:00 +00:00
Dmitriy Simushev
dd71e6bc70 Attach js and css assets to every operator's page 2014-10-10 10:33:08 +00:00
Dmitriy Simushev
46ee9df63a Use relative URL for assets as default 2014-10-10 10:17:41 +00:00
Dmitriy Simushev
922edc96d7 Replace inline js in the default page style with files 2014-10-10 09:15:50 +00:00
Dmitriy Simushev
a671caeb79 Move js code which auto close a window in a sepate file 2014-10-10 09:01:15 +00:00
Dmitriy Simushev
3088481d6d Remove unused "brws.js" lib 2014-10-10 08:38:37 +00:00
Dmitriy Simushev
00bba6c05a Create a base class for jsAssets and cssAssets helpers 2014-10-10 08:17:36 +00:00
Dmitriy Simushev
5b09b3e52c Rename "additionalJs" helper to "jsAssets" 2014-10-09 14:31:26 +00:00
Dmitriy Simushev
3772274ca3 Rename "additionalCss" helper to "cssAssets" 2014-10-09 14:27:35 +00:00
Dmitriy Simushev
7ce4d812bd Rename "AssetManager::add*Asset" methods to "attach*" 2014-10-09 14:20:40 +00:00
Dmitriy Simushev
2ed44e874c Clean up docs for Assetmanager::triggerJsEvent a little 2014-10-09 14:01:38 +00:00
Dmitriy Simushev
9898fb0cbe Create "additionalCss" HBS helper 2014-10-09 13:51:37 +00:00
Dmitriy Simushev
bc45a6d3be Create "additionalJs" HBS helper 2014-10-09 13:25:17 +00:00
Dmitriy Simushev
e320dcd1bb Create AssetManager class 2014-10-08 14:14:43 +00:00
Dmitriy Simushev
54840e96ad Move default js libraries to _layout.hbs in pages style 2014-10-07 11:02:31 +00:00
Dmitriy Simushev
406e11a38e Simplify client side templates structure of pages style 2014-10-06 10:38:33 +00:00
Dmitriy Simushev
a61b48252c Move request preparation and finalization to special methods 2014-10-06 09:06:11 +00:00
Dmitriy Simushev
952ebf8b9d Remove unneeded files from release archive
Fixes #67
2014-09-26 13:18:42 +00:00
Dmitriy Simushev
b6d472d62f Fix some typos in js 2014-09-26 09:24:49 +00:00
Dmitriy Simushev
0cd01e2c03 Remove unneeded "pageAddLocalizedStrings" event 2014-09-25 12:40:46 +00:00
Dmitriy Simushev
c3956be558 Move send shortcut string generation to the client side 2014-09-25 12:33:30 +00:00
Dmitriy Simushev
6e6920851d Remove almost all pseudo-localization strings 2014-09-25 11:51:04 +00:00
Dmitriy Simushev
022fe7d6f4 Purge cache on cron 2014-09-25 10:38:31 +00:00
Dmitriy Simushev
ba103d5636 Pass all localized string to a client side application 2014-09-25 10:30:19 +00:00
Dmitriy Simushev
a2e2f1b194 Use Stash as a cache system 2014-09-24 13:04:37 +00:00
Dmitriy Simushev
e514b1590b Pass AssetUrlGenerator via constructor to ControllerResolver 2014-09-23 13:10:35 +00:00
Dmitriy Simushev
2bb6899c33 Move translation logic from js helper to localization object 2014-09-19 13:51:59 +00:00
Dmitriy Simushev
cb4bd3acaa Add inheritance helpers to Handlebars.js 2014-09-18 15:00:57 +00:00
Dmitriy Simushev
fa615bc2e0 Add placeholders to HBS.js "l10n" helper 2014-09-18 10:35:08 +00:00
Dmitriy Simushev
957e67686a Refactor HelpersSet class 2014-09-18 09:42:50 +00:00
Dmitriy Simushev
911487871d Generate offline message in the template 2014-09-18 08:32:16 +00:00
Dmitriy Simushev
c397a953a1 Update Handlebars.php version 2014-09-17 14:54:04 +00:00
Dmitriy Simushev
e7b0201e0a Update Handlebars.js to v2.0.0 2014-09-15 14:32:34 +00:00
Dmitriy Simushev
340c0f9213 Update jQuery to v1.11.1 2014-09-12 13:14:20 +00:00
Dmitriy Simushev
db4e8ee0db Update Underscore.js to v1.7.0 2014-09-12 12:50:49 +00:00
Dmitriy Simushev
95caad6b59 Use "replace" helper instead of "nl2br" in HBS.js templates 2014-09-12 11:12:34 +00:00
Dmitriy Simushev
ae9de7aa92 Sanitize messages at server side 2014-09-12 10:59:56 +00:00
Dmitriy Simushev
ce6761755e Enforce HTML sanitization 2014-09-11 14:53:03 +00:00
Dmitriy Simushev
6154992f4f Remove "apply" Handlebars.js helper 2014-09-11 12:30:11 +00:00
Dmitriy Simushev
0b9fdeceb8 Fix number arguments in "allowTags" Handlebars.js helper 2014-09-11 12:15:19 +00:00
Dmitriy Simushev
34017d54db Fix number arguments in "urlReplace" Handlebars.js helper 2014-09-11 11:24:33 +00:00
Dmitriy Simushev
aa12eceeea Fix number arguments in "nl2br" Handlebars.js helper 2014-09-11 11:23:02 +00:00
Dmitriy Simushev
9805b4bb18 Add "replace" Handlebars.js helper 2014-09-11 11:08:34 +00:00
Dmitriy Simushev
333f769a16 Add "cutString" Handlebars.js helper 2014-09-11 10:09:14 +00:00
Dmitriy Simushev
75276ab2da Add "repeat" Handlebars.js helper 2014-09-11 10:06:30 +00:00
Dmitriy Simushev
814869ec77 Add tests for "ifEven" and "ifOdd" Handlebars.js helpers 2014-09-11 09:36:33 +00:00
Dmitriy Simushev
3f3abb4255 Add "ifEqual" Handlebars.js helper 2014-09-11 09:29:36 +00:00
Dmitriy Simushev
55a33cf012 Add "ifAny" Handlebars.js helper 2014-09-11 09:19:51 +00:00
Dmitriy Simushev
accfbe0acd Merge branch 'fix_comment' 2014-09-10 15:04:20 +00:00
94c1859a01 Fix comment for generated text link 2014-09-10 18:59:43 +04:00
Dmitriy Simushev
bbf1cec98c Remove unused "use" statement in the "ifOdd" helper 2014-09-10 14:15:14 +00:00
Dmitriy Simushev
ff72960382 Throw an exception if a HBS helper receives wrong arguments set 2014-09-10 14:13:16 +00:00
Dmitriy Simushev
61ee2d0af6 Fix invitation popup 2014-09-10 11:26:09 +00:00
Dmitriy Simushev
933d03e45a Increase Mibew version 2014-09-10 11:07:54 +00:00
Dmitriy Simushev
86085a0c31 Force Mibew to work without mod_rewrite 2014-09-10 10:56:06 +00:00
Dmitriy Simushev
7c969e495e Add RTL support to the default chat style
Fixes #64
2014-09-10 10:16:30 +00:00
Dmitriy Simushev
97ab17ce7a Update Symfony components version 2014-09-10 09:40:27 +00:00
Dmitriy Simushev
58959cf866 Fix problems with installation script 2014-09-09 10:07:43 +00:00
Dmitriy Simushev
7201dfd113 Remove MIBEW_WEB_ROOT constant 2014-09-08 14:08:44 +00:00
Dmitriy Simushev
a314bca69b Move "go online link" generation to Controller 2014-09-08 14:01:41 +00:00
Dmitriy Simushev
cb98a6fc94 Fix typo in comment 2014-09-08 12:39:09 +00:00
Dmitriy Simushev
f107ae4556 Configure plugins data with a request instead of a page name 2014-09-08 12:29:30 +00:00
Dmitriy Simushev
3a3b7f362b Add "asset" helper to the repository. 2014-09-08 09:54:53 +00:00
Dmitriy Simushev
ff917b25ad Do not use MIBEW_WEB_ROOT in Style classes 2014-09-05 10:59:48 +00:00
Dmitriy Simushev
dfbbc11cfb Apply asset helper to chat templates 2014-09-05 10:50:36 +00:00
Dmitriy Simushev
7c1e123ad6 Do not use style path for pagination generation 2014-09-05 10:26:47 +00:00
Dmitriy Simushev
84094ad38b Use divs instead of images for pagination arrows 2014-09-05 10:06:26 +00:00
Dmitriy Simushev
5a3a4d959f Use asset helper in pages style 2014-09-05 09:13:11 +00:00
Dmitriy Simushev
83f6c31dd6 Fix styles screeenshots 2014-09-04 15:11:52 +00:00
Dmitriy Simushev
e5031f9987 Use "mibewRoot" only in file paths 2014-09-04 12:53:13 +00:00
Dmitriy Simushev
0253f8e67e Remove unused use statement 2014-09-04 12:43:08 +00:00
Dmitriy Simushev
c207f0507d Use "route" helper to generate URLs in chat style 2014-09-04 12:26:18 +00:00
Dmitriy Simushev
6ceecb42aa Generate links for Users JS App in the controller 2014-09-04 12:12:30 +00:00
Dmitriy Simushev
f8bd639f39 Use stylePath variable instead of tplRoot in chat templates 2014-09-04 10:52:57 +00:00
Dmitriy Simushev
cf6e7f625a Fix URL for ban edit page 2014-09-04 10:38:17 +00:00
Dmitriy Simushev
cbc119382b Create a helper to generatate URLs with CSRF protection 2014-09-04 10:23:38 +00:00
Dmitriy Simushev
c08ab3a456 Use "route" helper in pages style 2014-09-03 15:19:27 +00:00
Dmitriy Simushev
09c7b15656 Move protected AbstractController::getStyle method to the end of the class 2014-09-03 11:56:53 +00:00
Dmitriy Simushev
5ee217accb Create "route" Handlebars.php helper 2014-09-03 11:52:37 +00:00
Dmitriy Simushev
eba2eadaca Reduce code duplication in Handlebars powered styles 2014-09-03 11:27:43 +00:00
Dmitriy Simushev
7021cb983e Move takeover confirmation page template to chat style 2014-08-29 12:55:41 +00:00
Dmitriy Simushev
37cc5cb178 Move Handlebars.php helpers to separate classes 2014-08-29 11:42:15 +00:00
Dmitriy Simushev
a5d7c6ccd4 Don't use MIBEW_WEB_ROOT in get_current_locale func 2014-08-28 12:15:59 +00:00
Dmitriy Simushev
766be1f051 Remove unused function "get_app_location" 2014-08-28 10:23:58 +00:00
Dmitriy Simushev
f61ef23e3f Don't use global environment in "setup_chatview_for_user" func 2014-08-28 10:22:17 +00:00
Dmitriy Simushev
896e0d924b Don't rely on internal Router structure 2014-08-28 09:52:48 +00:00
Dmitriy Simushev
1c1d479474 Don't use global environment in "setup_chatview_for_operator" func 2014-08-28 09:39:14 +00:00
Dmitriy Simushev
ee492a0c23 Extract release preparation stuff from default gulp task
Fixes #62
2014-08-28 08:40:08 +00:00
Dmitriy Simushev
da54de32b9 Remove unused "is_agent_opera95" function 2014-08-27 15:34:56 +00:00
Dmitriy Simushev
4ba7804b88 Make *Processor::handleRequest returns a Response 2014-08-27 13:44:01 +00:00
Dmitriy Simushev
928328f2b0 Set default value for Thread's agent ID when a thread is created 2014-08-27 13:28:01 +00:00
Dmitriy Simushev
730dd2f2df Make *Processor handles Symfony requests 2014-08-27 13:22:43 +00:00
Dmitriy Simushev
8b1b38dddc Set default operator's avatar
Fixes #60
2014-08-27 10:33:35 +00:00
Dmitriy Simushev
57770e76cf Remove unused needs_frame_src function 2014-08-26 14:53:21 +00:00
Dmitriy Simushev
aad2f6a34f Move button generating logic to separate classes 2014-08-26 12:03:58 +00:00
Dmitriy Simushev
3802e1bf0f Update Handlebars.php version 2014-08-26 09:39:14 +00:00
Dmitriy Simushev
c9e7971c41 Fix button size determination 2014-08-26 09:33:10 +00:00
Dmitriy Simushev
e97f3d1fbf Add secure URL generation for assets 2014-08-25 11:21:18 +00:00
Dmitriy Simushev
21c0ee9134 Move secure URL generation to the Router 2014-08-22 13:11:17 +00:00
Dmitriy Simushev
96df4dc857 Declare method visibility in ButtonCodeController 2014-08-21 11:38:45 +00:00
Dmitriy Simushev
c32628e2b2 Generate URLs from routes in HomeController 2014-08-21 11:37:17 +00:00
Dmitriy Simushev
df4b6f214e Add an easy way to generate assets URL 2014-08-21 11:33:38 +00:00
Dmitriy Simushev
f0f41cbfb6 Move all button generation logic to ButtonCodeController 2014-08-20 14:40:30 +00:00
Dmitriy Simushev
e9f480e3ef Add an ability to generate https routes 2014-08-20 13:00:03 +00:00
Dmitriy Simushev
82a3cb7dd5 Remove unused "verifyparam_groupid" function 2014-08-20 10:04:19 +00:00
Dmitriy Simushev
34a8a2eee4 Do not use MIBEW_WEB_ROOT in AvatarController 2014-08-20 09:50:39 +00:00
Dmitriy Simushev
e6b9635e22 Add project name to .pot file 2014-08-19 12:49:54 +00:00
Dmitriy Simushev
154e891cb4 Update Handlebars.php version 2014-08-18 14:40:24 +00:00
4fc223a6a6 Improve headers 2014-08-18 15:42:27 +04:00
Dmitriy Simushev
22a34c3315 Localize some strings related with files uploading 2014-08-18 09:46:26 +00:00
Dmitriy Simushev
51e076aafc Add more PHP's localization functions 2014-08-18 09:42:08 +00:00
Dmitriy Simushev
46a8345de2 Extract localization strings from js files 2014-08-18 09:23:15 +00:00
Dmitriy Simushev
17d7014da9 Rename Localization.get method on the client side 2014-08-18 09:11:40 +00:00
Dmitriy Simushev
7128870ef6 Fix notice about undefined "visitorid" in UserChatController 2014-08-13 14:09:35 +00:00
Dmitriy Simushev
48408c6547 Remove unused console scripts 2014-08-13 12:51:17 +00:00
Dmitriy Simushev
3ca9395d69 Search localization strings in .handlebars files 2014-08-13 12:14:35 +00:00
Dmitriy Simushev
95d2593b28 Update version of gulp-phpcs plugin 2014-08-13 11:03:03 +00:00
Dmitriy Simushev
02874adbd0 Do not include GIT repos of third-party libs to build 2014-08-13 09:04:44 +00:00
Dmitriy Simushev
f583aa6439 Add gulp task for .pot file generation 2014-08-13 08:40:42 +00:00
Dmitriy Simushev
547cd5abb6 Fix suhosin problems during build process 2014-08-12 10:35:57 +00:00
Dmitriy Simushev
51fcdcd1a5 Update JavaScript headers 2014-08-08 12:34:04 +00:00
Dmitriy Simushev
58aec22fc3 Remove compiled files from the reository 2014-08-08 12:20:44 +00:00
Dmitriy Simushev
ac55ecc545 Minify js/source/update.js file 2014-08-08 11:51:38 +00:00
Dmitriy Simushev
f8b5cdafa2 Move JavaScript files related with style to style 2014-08-08 11:49:26 +00:00
Dmitriy Simushev
5feb4535d6 Fix automatic set of online status 2014-08-08 10:26:42 +00:00
Dmitriy Simushev
6d90246bbe Do not override "getFilesPath" method in the Abstract style class
Fixes #56
2014-08-08 10:15:12 +00:00
Dmitriy Simushev
c086ba176f Add info about building process 2014-08-07 11:25:37 +00:00
Dmitriy Simushev
c2aeeb07f9 Add gulp task for build the sources 2014-08-07 11:04:45 +00:00
Dmitriy Simushev
a9cd400834 Add a Gulp tasks for composer dependancies installation 2014-08-06 12:08:19 +00:00
Dmitriy Simushev
4594619a4a Provide an ability to export translations
Fixes #45
2014-08-06 08:52:12 +00:00
Dmitriy Simushev
668e724a01 Add option to override strings during import
Fixes #47
2014-08-05 14:15:02 +00:00
Dmitriy Simushev
cabdaed21d A user cannot start chat if all groups offline
Revert changes made in 324f5bf94e
2014-08-05 12:50:09 +00:00
Dmitriy Simushev
38bdf1318f Remove unused legacy code 2014-08-05 12:32:34 +00:00
Dmitriy Simushev
4ccd67e28a Do not work directly with session in "notify_operator_alive" func
Fixes #57
2014-08-05 11:39:44 +00:00
Dmitriy Simushev
6cdfb4a7bc Get operator from AuthenticationManager in UsersProcessor 2014-08-05 11:26:33 +00:00
Dmitriy Simushev
a99a839998 Add support for ".png" buttons
Fixes #48
2014-08-04 15:33:19 +00:00
Dmitriy Simushev
ef5c919803 Add timezone option to the config file
Fixes #55
2014-08-04 14:18:43 +00:00
Dmitriy Simushev
fdfb945ed0 Remove unneeded "check_coding_style" shell script 2014-08-04 13:59:13 +00:00
Dmitriy Simushev
bee65e50f7 Use Gulp.js instead of Ant for building 2014-08-04 13:53:18 +00:00
Dmitriy Simushev
324f5bf94e Treat operators online even if they don't belong to any groups
Fixes #51
2014-07-29 14:55:22 +00:00
Dmitriy Simushev
a8e98c1e08 Always use absolute URL for an invitation thread
Fixes 52
2014-07-29 14:09:23 +00:00
9e08c6f2a5 Fix typo in comment 2014-07-28 15:32:12 +04:00
Dmitriy Simushev
074f4652d1 Fix caching in localized strings saving
Fixes #49
2014-07-28 10:33:20 +00:00
Dmitriy Simushev
650faf25f6 Localize permission descriptions in "permission_descriptions" func 2014-07-28 10:12:12 +00:00
Dmitriy Simushev
4670851505 Localize permission descriptions
Fixes #50
2014-07-28 09:32:15 +00:00
Dmitriy Simushev
48bcea8f65 Use client-side templates names according to directory structure 2014-07-24 13:46:24 +00:00
Dmitriy Simushev
2ddae8e300 Clarify description for "Track operators" feature 2014-07-23 14:01:58 +00:00
Dmitriy Simushev
d04f703f35 Add option to track operators like any other visitors.
Fixes #46
2014-07-23 13:28:35 +00:00
Dmitriy Simushev
86f8cb5100 Display installation errors on a step page 2014-07-23 12:56:38 +00:00
Dmitriy Simushev
c4592d242a Fix error displaying on installation pages 2014-07-23 12:31:59 +00:00
Dmitriy Simushev
6a1ac9ada4 Update after installation login link 2014-07-23 12:25:18 +00:00
Dmitriy Simushev
62b8b3ceff Override "home" route in the installer routes 2014-07-23 11:50:27 +00:00
854 changed files with 28697 additions and 10973 deletions

29
.gitignore vendored
View File

@ -1,6 +1,11 @@
# IDE folders
.idea
src/mibew/install/package src/mibew/install/package
src/absent_* src/absent_*
src/release* src/release*
src/upload*
src/*.po
# Do not index actual configuration files # Do not index actual configuration files
src/mibew/configs/config.yml src/mibew/configs/config.yml
@ -10,6 +15,11 @@ src/tests/server_side/mibew/libs/config.php
src/mibew/files/avatar/* src/mibew/files/avatar/*
!src/mibew/files/avatar/.keep !src/mibew/files/avatar/.keep
# Do not index cache files
src/mibew/cache/*
!src/mibew/cache/.keep
!src/mibew/cache/.htaccess
# Do not index plugins # Do not index plugins
src/mibew/plugins/* src/mibew/plugins/*
!src/mibew/plugins/.keep !src/mibew/plugins/.keep
@ -24,3 +34,22 @@ src/composer.lock
# Do not index third-party libraries # Do not index third-party libraries
src/mibew/vendor src/mibew/vendor
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/*/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/*/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,16 +11,61 @@ This repository contains the core of Mibew Messenger application.
## Server requirements ## Server requirements
1. A webserver or web hosting account running on any major Operating System 1. A webserver or web hosting account running on any major Operating System
2. PHP (5.3.3 and above) with MySQL support 2. PHP (7.2.5 and above) with PDO, pdo_mysql, cURL, mbstring and gd extensions
3. MySQL 5.0 and above 3. MySQL 5.0 and above
## Build from sources
There are several actions one should do before use the latest version of Mibew from the repository:
1. Obtain a copy of the repository using `git clone`, download button, or another way.
2. Install [node.js](http://nodejs.org/) and [npm](https://www.npmjs.org/).
3. Install [Gulp](http://gulpjs.com/).
4. Navigate to `src/` directory of the local copy of the repository.
5. Install npm dependencies using `npm install`.
6. Run Gulp to build Mibew using `gulp default`.
Finally `.tar.gz` and `.zip` archives of the ready-to-use Mibew will be available in `src/release` directory.
## Terms of Use ## Terms of Use
Mibew Messenger is licensed under the terms of [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0). Mibew Messenger is licensed under the terms of [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0).
## Other repositories of the Mibew project ## Other repositories of the Mibew project
### Actual
1. [Mibew Messenger i18n repository](https://github.com/Mibew/i18n) 1. [Mibew Messenger i18n repository](https://github.com/Mibew/i18n)
2. [Mibew Messenger design repository](https://github.com/Mibew/design) 2. [Mibew Messenger design repository](https://github.com/Mibew/design)
3. [Mibew Java applications repository](https://github.com/Mibew/java) 3. [Mibew documentation repository](https://github.com/Mibew/docs.mibew.org)
4. [Mibew Tray repository](https://github.com/Mibew/tray)
### 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)

4
src/.bowerrc Normal file
View File

@ -0,0 +1,4 @@
{
"directory": "./mibew/js/vendor",
"analytics": false
}

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
}
}

17
src/bower.json Normal file
View File

@ -0,0 +1,17 @@
{
"name": "mibew",
"private": true,
"dependencies": {
"underscore": "1.8.2",
"json": "https://github.com/douglascrockford/JSON-js.git#c98948ae1944a28e2e8ebc3717894e580aeaaa05",
"jquery": "1.11.3",
"backbone": "1.1.2",
"marionette": "2.4.1",
"handlebars": "4.3.0",
"vex": "2.3.2",
"validator-js": "3.40.0"
},
"resolutions": {
"underscore": "1.8.2"
}
}

View File

@ -1,427 +0,0 @@
<project name="mibew messenger" default="all">
<property name="mibew_path" value="mibew" />
<property name="closure.c" value="/opt/closure/compiler.jar" />
<property name="handlebars" value="handlebars" />
<property name="dialogs_styles_path" value="${mibew_path}/styles/dialogs" />
<property name="pages_styles_path" value="${mibew_path}/styles/pages" />
<property name="js_path" value="${mibew_path}/js" />
<!-- Compile Handlebars templates for dialogs styles -->
<target name="dialogs_handlebars" description="Compile Handlebars templates for dialogs styles">
<echo>Flatten templates directory structure</echo>
<!-- Use system 'mkdir' instead of ant 'mkdir' task because it do not
work with dirsets -->
<apply executable="mkdir" addsourcefile="false">
<targetfile />
<dirset dir=".">
<include name="${dialogs_styles_path}/*/templates_src/client_side" />
</dirset>
<mapper type="glob" from="*/templates_src/client_side" to="*/templates_compiled/client_side_tmp" />
</apply>
<!-- Flatten templates directory structure -->
<apply executable="tools/flat_cp" force="true">
<srcfile />
<targetfile />
<arg value="client_side" />
<fileset dir=".">
<include name="${dialogs_styles_path}/*/templates_src/client_side/**/*.handlebars" />
</fileset>
<mapper type="regexp" from="^(.*)/templates_src/client_side/(.*)$$" to="\1/templates_compiled/client_side_tmp" />
</apply>
<echo>Compile templates</echo>
<!-- Compile templates -->
<apply executable="${handlebars}">
<arg value="-f"/>
<targetfile />
<dirset dir=".">
<include name="${dialogs_styles_path}/*/templates_compiled/client_side_tmp" />
</dirset>
<mapper type="glob" from="*/client_side_tmp" to="*/client_side/templates_tmp.js" />
</apply>
<!-- Use closule compiler instead of handlebars minifyer (-m flag)
because of handlebars does not insert line breaks.
Very long lines are cutted by ant and this brings problems -->
<apply executable="java">
<arg value="-jar" />
<arg value="${closure.c}" />
<arg value="--js" />
<srcfile />
<arg value="--js_output_file" />
<targetfile />
<fileset dir=".">
<include name="${dialogs_styles_path}/*/templates_compiled/client_side/templates_tmp.js" />
</fileset>
<mapper type="glob" from="*_tmp.js" to="*_tmp.c.js" />
</apply>
<!-- Add license info. Use move because of it is the best way to append
some info to files -->
<move todir="${dialogs_styles_path}" overwrite="true">
<fileset dir="${dialogs_styles_path}"/>
<mapper type="glob" from="*/templates_compiled/client_side/templates_tmp.c.js" to="*/templates_compiled/client_side/templates.js"/>
<filterchain>
<!-- Add header -->
<concatfilter prepend="tools/compiled_templates_header.txt" />
<!-- Skip empty lines -->
<linecontainsregexp negate="true">
<regexp pattern="^\s+$$" />
</linecontainsregexp>
</filterchain>
</move>
<!-- Remove all temporary files -->
<!-- Use system 'rm' instead of ant
'delete' task because it does not work with dirsets -->
<echo>Remove temporary files</echo>
<apply executable="rm">
<arg value="-r" />
<arg value="-f" />
<dirset dir=".">
<include name="${dialogs_styles_path}/*/templates_compiled/client_side_tmp" />
</dirset>
</apply>
<delete>
<fileset dir=".">
<include name="${dialogs_styles_path}/*/templates_compiled/client_side/templates_tmp.js" />
</fileset>
</delete>
<echo>Done</echo>
</target>
<!-- Compile Handlebars templates for pages styles -->
<target name="pages_handlebars" description="Compile Handlebars templates for pages styles">
<!-- Compile applications templates -->
<apply executable="${handlebars}">
<arg value="-f"/>
<targetfile />
<dirset dir=".">
<include name="${pages_styles_path}/*/templates_src/client_side/*" />
</dirset>
<mapper
type="regexp"
from="^(.*)/templates_src/client_side/(.*)$$"
to="\1/templates_compiled/client_side/\2_app_tmp.tpl.js"
/>
</apply>
<!-- Use closule compiler instead of handlebars minifyer (-m flag)
because of handlebars does not insert line breaks.
Very long lines are cutted by ant and this brings problems -->
<apply executable="java">
<arg value="-jar" />
<arg value="${closure.c}" />
<arg value="--js" />
<srcfile />
<arg value="--js_output_file" />
<targetfile />
<fileset dir=".">
<include name="${pages_styles_path}/*/templates_compiled/client_side/*_app_tmp.tpl.js" />
</fileset>
<mapper type="glob" from="*_app_tmp.tpl.js" to="*_app_tmp.c.tpl.js" />
</apply>
<!-- Add license info. Use move because of it is the best way to append
some info to files -->
<move todir="${pages_styles_path}" overwrite="true">
<fileset dir="${pages_styles_path}">
<include name="*/templates_compiled/client_side/*_tmp.c.tpl.js" />
</fileset>
<!--<mapper type="glob" from="*/templates_compiled/client_side/*_tmp.c.tpl.js" to="*.tpl.js"/>-->
<mapper type="glob" from="*_tmp.c.tpl.js" to="*.tpl.js"/>
<filterchain>
<!-- Add header -->
<concatfilter prepend="tools/compiled_templates_header.txt" />
<!-- Skip empty lines -->
<linecontainsregexp negate="true">
<regexp pattern="^\s+$$" />
</linecontainsregexp>
</filterchain>
</move>
<!-- Remove all temporary files. -->
<delete>
<fileset dir="${pages_styles_path}">
<include name="*/templates_compiled/client_side/*_tmp.tpl.js" />
</fileset>
</delete>
<echo>Done</echo>
</target>
<!-- Compile Handlebars templates for all styles (both dialogs and pages) -->
<target name="styles_handlebars" depends="pages_handlebars,dialogs_handlebars" description="Compile Handlebars templates for all styles">
<echo>Handlebars templates from all styles are built.</echo>
</target>
<!-- Compile and concatenate JavaScript files for dialog styles -->
<target name="styles_js" description="Compile JavaScript files for all dialogs styles">
<echo>Compile and concatenate JavaScript files for dialogs styles:</echo>
<!-- Create temporary directories for compiled JavaScript files -->
<echo>Create temporary directories</echo>
<apply executable="mkdir" addsourcefile="false">
<targetfile />
<dirset dir=".">
<include name="${dialogs_styles_path}/*/js/source" />
</dirset>
<mapper type="glob" from="*/source" to="*/tmp" />
</apply>
<!-- Compile JavaScript files -->
<echo>Compile JavaScript files</echo>
<apply executable="java">
<arg value="-jar" />
<arg value="${closure.c}" />
<arg value="--js" />
<srcfile />
<arg value="--js_output_file" />
<targetfile />
<fileset dir=".">
<include name="${dialogs_styles_path}/*/js/source/*.js" />
</fileset>
<mapper type="regexp" from="^(.+)/source/(.+)$$" to="\1/tmp/\2" />
</apply>
<!-- Concatenate all scripts in one file. Use special script for
expanding wildcards. -->
<echo>Concatenate JavaScript files</echo>
<apply executable="tools/cat">
<srcfile suffix="/*.js"/>
<targetfile />
<dirset dir=".">
<include name="${dialogs_styles_path}/*/js/tmp" />
</dirset>
<mapper type="glob" from="*/tmp" to="*/compiled/scripts.js" />
</apply>
<!-- Remove temporary directories -->
<echo>Remove temporary directories</echo>
<apply executable="rm">
<arg value="-r" />
<arg value="-f" />
<dirset dir=".">
<include name="${dialogs_styles_path}/*/js/tmp" />
</dirset>
</apply>
<echo>Done</echo>
</target>
<!-- Build all stuff related to dialogs styles -->
<target name="styles_all" depends="styles_handlebars,styles_js" description="Run styles_handlebars and styles_js targets">
<echo>Styles built.</echo>
</target>
<!-- Compile all JavaScript files of the Mibew Core -->
<target name="core_js">
<echo>Compile JavaScript files of the Mibew Core</echo>
<!-- Copy directory tree from source to compiled -->
<echo>Copy directory tree</echo>
<copy todir="${js_path}/compiled">
<dirset dir="${js_path}/source">
<include name="**" />
</dirset>
</copy>
<!-- Compile JavaScript files -->
<echo>Compile JavaScript files</echo>
<apply executable="java">
<arg value="-jar" />
<arg value="${closure.c}" />
<arg value="--js" />
<srcfile />
<arg value="--js_output_file" />
<targetfile />
<fileset dir=".">
<include name="${js_path}/source/**/*.js" />
</fileset>
<mapper type="regexp" from="^(.+)/source/(.+)$$" to="\1/compiled/\2" />
</apply>
<echo>Done</echo>
</target>
<!-- Build JavaScript application -->
<target name="app_js">
<echo>Build "${app_name}" JavaScript application</echo>
<!-- Remove old application file -->
<delete file="${js_path}/compiled/${app_name}_app.js" />
<!-- Append application files to the result file -->
<concat destfile="${js_path}/compiled/${app_name}_app.js" eol="lf">
<!-- Append application static initialization code -->
<filelist dir="${js_path}/compiled/${app_name}" files="init.js" />
<!-- Include files from ${js_path}/compiled/${app_name}/ -->
<fileset dir="${js_path}/compiled/${app_name}">
<include name="*.js" />
<exclude name="init.js" />
<exclude name="app.js" />
</fileset>
<!-- Include models files -->
<fileset dir="${js_path}/compiled/${app_name}">
<include name="models/**/base*.js" />
</fileset>
<fileset dir="${js_path}/compiled/${app_name}">
<include name="models/**/*.js" />
<!-- Exclude base files -->
<exclude name="models/**/base*.js" />
</fileset>
<!-- Include collections files -->
<fileset dir="${js_path}/compiled/${app_name}">
<include name="collections/**/base*.js" />
</fileset>
<fileset dir="${js_path}/compiled/${app_name}">
<include name="collections/**/*.js" />
<!-- Exclude base files -->
<exclude name="collections/**/base*.js" />
</fileset>
<!-- Include models views files -->
<fileset dir="${js_path}/compiled/${app_name}">
<include name="model_views/**/base*.js" />
</fileset>
<fileset dir="${js_path}/compiled/${app_name}">
<include name="model_views/**/*.js" />
<!-- Exclude base files -->
<exclude name="model_views/**/base*.js" />
</fileset>
<!-- Include collections views files -->
<fileset dir="${js_path}/compiled/${app_name}">
<include name="collection_views/**/base*.js" />
</fileset>
<fileset dir="${js_path}/compiled/${app_name}">
<include name="collection_views/**/*.js" />
<!-- Exclude base files -->
<exclude name="collection_views/**/base*.js" />
</fileset>
<!-- Include regions files -->
<fileset dir="${js_path}/compiled/${app_name}">
<include name="regions/**/base*.js" />
</fileset>
<fileset dir="${js_path}/compiled/${app_name}">
<include name="regions/**/*.js" />
<!-- Exclude base files -->
<exclude name="regions/**/base*.js" />
</fileset>
<!-- Include layouts files -->
<fileset dir="${js_path}/compiled/${app_name}">
<include name="layouts/**/base*.js" />
</fileset>
<fileset dir="${js_path}/compiled/${app_name}">
<include name="layouts/**/*.js" />
<!-- Exclude base files -->
<exclude name="layouts/**/base*.js" />
</fileset>
<!-- Include all other files -->
<fileset dir="${js_path}/compiled/${app_name}">
<include name="**/base*.js" />
<exclude name="models/**/base*.js" />
<exclude name="collections/**/base*.js" />
<exclude name="model_views/**/base*.js" />
<exclude name="collection_views/**/base*.js" />
<exclude name="regions/**/base*.js" />
<exclude name="layouts/**/base*.js" />
</fileset>
<fileset dir="${js_path}/compiled/${app_name}">
<include name="**/*.js" />
<!-- Exclude files from ${js_path}/compiled/${app_name}/ -->
<exclude name="*.js" />
<!-- Exclude models, collections, views, regions and layouts
files -->
<exclude name="models/**/*.js" />
<exclude name="collections/**/*.js" />
<exclude name="model_views/**/*.js" />
<exclude name="collection_views/**/*.js" />
<exclude name="regions/**/*.js" />
<exclude name="layouts/**/*.js" />
<!-- Exclude base files -->
<exclude name="**/base*.js" />
</fileset>
<fileset dir="${js_path}/compiled/${app_name}">
<include name="app.js" />
</fileset>
<!-- Apply filters -->
<filterchain>
<!-- Skip empty lines -->
<linecontainsregexp negate="true">
<regexp pattern="^\s+$$" />
</linecontainsregexp>
</filterchain>
</concat>
<echo>Done</echo>
</target>
<!-- Build JavaScript files related to default application -->
<target name="default_app_js" depends="core_js" description="Build JavaScript files related to default application">
<antcall target="app_js">
<param name="app_name" value="default" />
</antcall>
<echo>Default JavaScript application built.</echo>
</target>
<!-- Compile and concatenate JavaScript files related to chat application -->
<target name="chat_app_js" depends="default_app_js" description="Build JavaScript files related to chat application">
<antcall target="app_js">
<param name="app_name" value="chat" />
</antcall>
<echo>Chat JavaScript application built.</echo>
</target>
<!-- Compile and concatenate JavaScript files related to users application -->
<target name="users_app_js" depends="default_app_js" description="Build JavaScript files related to users application">
<antcall target="app_js">
<param name="app_name" value="users" />
</antcall>
<echo>Users JavaScript application built.</echo>
</target>
<!-- Compile and concatenate JavaScript files related to thread log application -->
<target name="thread_log_app_js" depends="default_app_js" description="Build JavaScript files related to thread log application">
<antcall target="app_js">
<param name="app_name" value="thread_log" />
</antcall>
<echo>Thread log JavaScript application built.</echo>
</target>
<!-- Build all project -->
<target name="all" depends="chat_app_js,thread_log_app_js,users_app_js,styles_all" description="Build everything">
<echo>Mibew Messenger built.</echo>
</target>
</project>

View File

@ -1,3 +0,0 @@
#!/bin/sh
mibew/vendor/bin/phpcs --standard="PSR2" --extensions="php" --ignore="mibew/vendor/,mibew/plugins" -n mibew/

View File

@ -1,56 +0,0 @@
#!/usr/bin/perl
sub read_transl($) {
my($from) = @_;
my %translation = ();
open(IN, "mibew/locales/$from/properties");
while(<IN>) {
chomp;
if(/^([\w\.]+)=(.*)$/) {
if($1 ne "encoding" && $1 ne "output_charset" && $1 ne "output_encoding") {
$translation{$1} = $2;
}
} else {
die "wrong line in $from: $_\n";
}
}
close(IN);
return %translation;
}
%tr_en = read_transl("en");
@all_keys = keys %tr_en;
sub check_transl($%) {
my($name,%tr) = @_;
print "checking $name...\n";
my @totransl = ();
for $key (@all_keys) {
unless(exists $tr{$key}) {
push @totransl, "$key=".$tr_en{$key};
}
}
for $key(keys %tr) {
unless(exists $tr_en{$key}) {
print "unknown key in $name: $key\n";
}
}
if($#totransl >= 0) {
print "@{[$#totransl+1]} lines absent in locales/$name/properties\n";
open(OUT, "> absent_$name");
for(sort @totransl) {
print OUT "$_\n";
}
close(OUT);
}
}
check_transl("ru", read_transl("ru"));
check_transl("fr", read_transl("fr"));
check_transl("de", read_transl("de"));
check_transl("sp", read_transl("sp"));
check_transl("it", read_transl("it"));
check_transl("pl", read_transl("pl"));
check_transl("zh-tw", read_transl("zh-tw"));

View File

@ -1,34 +1,51 @@
{ {
"name": "mibew/mibew", "name": "mibew/mibew",
"version": "2.0-dev", "version": "3.6.0",
"description": "Mibew Messenger - open-source live support application", "description": "Mibew Messenger - open-source live support application",
"type": "project", "type": "project",
"homepage": "http://mibew.org", "homepage": "https://mibew.org",
"license": "Apache-2.0", "license": "Apache-2.0",
"authors": [ "authors": [
{ {
"name": "Mibew Messenger Project", "name": "Mibew Messenger Project",
"homepage": "http://mibew.org/credits" "homepage": "https://mibew.org/credits"
} }
], ],
"support": { "support": {
"email": "support@mibew.org", "email": "support@mibew.org",
"issues": "https://github.com/mibew/mibew/issues", "issues": "https://github.com/mibew/mibew/issues",
"forum": "http://mibew.org/forums", "forum": "https://mibew.org/forums",
"source": "https://github.com/mibew/mibew" "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": { "require": {
"xamin/handlebars.php": "dev-master#cd8cec42a048ba0d8c7dd0bfde39b973b6a14b3f", "mibew/handlebars.php": "~0.10.5",
"symfony/http-foundation": "2.4.*", "mibew/handlebars.php-helpers": "1.*",
"symfony/routing": "2.4.*", "symfony/http-foundation": "4.4.*",
"symfony/config": "2.4.*", "symfony/routing": "4.4.*",
"symfony/yaml": "2.4.*", "symfony/config": "4.4.*",
"symfony/translation": "2.4.*" "symfony/yaml": "^5.2",
"symfony/translation": "2.6.*",
"tedivm/stash": "0.12.*",
"mibew/html5": "1.1.*",
"vierbergenlars/php-semver": "3.0.*",
"swiftmailer/swiftmailer": "~5.4.0",
"ua-parser/uap-php": "^3.9",
"true/punycode": "~1.1"
}, },
"require-dev": { "require-dev": {
"squizlabs/php_codesniffer": "1.*" "squizlabs/php_codesniffer": "3.*"
}, },
"config": { "config": {
"vendor-dir": "mibew/vendor" "vendor-dir": "mibew/vendor"
} }
} }

View File

@ -1,245 +0,0 @@
#!/usr/bin/perl
use Digest::MD5 qw(md5 md5_hex md5_base64);
@rules = (
["redirect(ed)?\\.tpl", 1],
["\\.tpl", 0],
["view/license.php", 0],
["view/themes.php", 2],
["view/translate.php", 2],
["view/translatelist.php", 2],
["view/settings.php", 2],
["view/updates.php", 2],
["view/features.php", 2],
["view/performance.php", 2],
["view/avatar.php", 2],
["view/permissions.php", 2],
["view/agent.php", 2],
["view/agents.php", 2],
["view/group.php", 2],
["view/groupmembers.php", 2],
["view/groups.php", 2],
["view/operator_groups.php", 2],
["view/gen_button.php", 2],
["view/install_err.php", 2],
["view/install_index.php", 2],
["view/.*\\.php", 1],
["install/.*\\.php", 2],
["operator/themes.php", 2],
["operator/translate.php", 2],
["operator/settings.php", 2],
["operator/updates.php", 2],
["operator/features.php", 2],
["operator/performance.php", 2],
["operator/avatar.php", 2],
["operator/permissions.php", 2],
["operator/operator.php", 2],
["operator/operators.php", 2],
["operator/group.php", 2],
["operator/groupmembers.php", 2],
["operator/groups.php", 2],
["operator/opgroups.php", 2],
["operator/getcode.php", 2],
["operator/.*\\.php", 1],
["mibew/client.php", 0],
["mibew/leavemessage.php", 0],
["mibew/captcha.php", 0],
["mibew/license.php", 0],
["mibew/mail.php", 0],
["libs/operator_settings.php", 2],
["mibew/libs/chat.php", 0],
["libs/pagination.php", 1],
["libs/settings.php", 2],
["libs/groups.php", 2],
["libs/demothread.php", 2],
["mibew/thread.php", 0],
["mibew/b.php", 0],
["mibew/button.php", 0],
["mibew/index.php", 0],
["mibew/libs/.*\\.php", 1],
);
%messagekeys = (
"localeid" => 0,
"output_charset" => 0,
"output_encoding" => 0,
"harderrors.header" => 0,
"errors.required" => 0,
"errors.wrong_field" => 0,
"errors.file.move.error" => 2,
"errors.invalid.file.type" => 2,
"errors.file.size.exceeded" => 2,
"permission.admin" => 1,
"permission.takeover" => 1,
"permission.viewthreads" => 1,
"chat.thread.state_chatting_with_agent" => 1,
"chat.thread.state_closed" => 1,
"chat.thread.state_loading" => 1,
"chat.thread.state_wait" => 1,
"chat.thread.state_wait_for_another_agent" => 1,
"clients.queue.chat" => 1,
"clients.queue.prio" => 1,
"clients.queue.wait" => 1,
);
$mibewPath = "mibew";
%urls = ();
%usermessages = ();
%operatormessages = ();
$current_level = 0;
sub usemsg($) {
my ($m) = @_;
$messagekeys{$m} = exists $messagekeys{$m} && $messagekeys{$m} < $current_level ? $messagekeys{$m} : $current_level;
if($current_level == -1) {
print " .. $m\n";
}
}
sub file_content($) {
my $input = $_[0];
open( IN1, "< $input" ) or die "cannot find file $input";
my $oldslash = $/;
$/ = EOI;
$content = <IN1>;
close( IN1 );
if($content =~ s/\r//g) {
open( OUT1, "> $input") or die "cannot fix $input";
print OUT1 $content;
close(OUT1);
}
$/ = $oldslash;
return $content;
}
sub process_tpl($) {
my ($filename) = @_;
my $m = file_content($filename);
while( $m =~ /\${msg:([\w\.]+)(,[\w\.]+)?}/g ) {
usemsg($1);
}
while( $m =~ /\${url:([\w\.]+)(,[\w\.]+)?}/g ) {
usemsg($1);
$urls{"%$1"} = 1;
}
}
sub process_php($) {
my ($source) = @_;
my $content = file_content($source);
$content =~ s/<\?xml version=\\"1\.0\\" encoding=\\"UTF-8\\"\?>//;
while( $content =~ s/<\?(?!xml)(.*?)\?>//s ) {
my $inner = $1;
while($inner =~ s/(getlocal|no_field)2?_?\((.*?)[,\)]//s) {
my $firstarg = $2;
if( $firstarg =~ /^["']([\w\.]+)['"]$/) {
usemsg($1);
} elsif($firstarg =~ /^\$\w+$/ || $firstarg eq '"$var.header"' || $firstarg eq '"permission.$permid"' || $firstarg eq '$threadstate_key[$thread[\'istate\']]') {
# skip
} else {
print "> unknown: $firstarg\n";
}
}
}
}
sub file_checksum($) {
my ($source) = @_;
if($source =~ /\.(png|gif|jpg|ico|wav)$/ || $source =~ /config\.php$/) {
return "-";
}
my $content = file_content($source);
return md5_hex($content);
}
@allsources = ();
sub process_one($) {
my($source) = @_;
push @allsources, $source unless $source =~ /$mibewPath\/locales/ && $source !~ /$mibewPath\/locales\/(en|names)/ || $source =~ /\/package$/;
if($source !~ /\.(php|tpl)$/) {
return;
}
$current_level = -1;
A: foreach $rule (@rules) {
my $key = $$rule[0];
if($source =~ /$key/) {
$current_level = $$rule[1];
last A;
}
}
if($current_level < 0 || $current_level > 2) {
print "not detected for: $source\n";
$current_level = 0;
}
if($source =~ /\.php$/) {
# print "$source ($current_level)\n";
process_php($source);
} elsif($source =~ /\.tpl$/) {
process_tpl($source);
} else {
#print ". $source\n";
}
}
sub process_files($) {
my($from) = @_;
opendir(DIR, $from) || die "can't opendir $from: $!";
my @content = readdir(DIR);
closedir DIR;
for(grep { -f "$from/$_" && ($_ !~ /^\./ || $_ eq ".htaccess") } @content) {
process_one("$from/$_");
}
for(grep { -d "$from/$_" && $_ !~ /^\./ } @content) {
process_files("$from/$_");
}
}
process_files($mibewPath);
# fix
$messagekeys{'page.analysis.userhistory.title'} = 1;
$messagekeys{'errors.failed.uploading.file'} = 2;
open( OUT, "> $mibewPath/locales/names/level1") or die "cannot write file, $!";
for $key(sort grep { $messagekeys{$_} == 0 } keys %messagekeys) {
print OUT "$key\n";
}
close( OUT );
open( OUT, "> $mibewPath/locales/names/level2") or die "cannot write file, $!";
for $key(sort grep { $messagekeys{$_} == 1 } keys %messagekeys) {
print OUT "$key\n";
}
close( OUT );
open( OUT, "> $mibewPath/install/package") or die "cannot write file, $!";
for $key(sort @allsources) {
$digest = file_checksum($key);
$key =~ s/$mibewPath\///;
print OUT "$key $digest\n";
}
close( OUT );

743
src/gulpfile.js Normal file
View File

@ -0,0 +1,743 @@
// Initialize requirements
var fs = require('fs'),
https = require('https'),
exec = require('child_process').exec,
eventStream = require('event-stream'),
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'),
concat = require('gulp-concat'),
phpcs = require('gulp-phpcs'),
order = require('gulp-order'),
handlebars = require('gulp-handlebars'),
handlebarsEngine = require('handlebars'),
defineModule = require('gulp-define-module'),
header = require('gulp-header'),
zip = require('gulp-zip'),
tar = require('gulp-tar'),
gzip = require('gulp-gzip'),
chmod = require('gulp-chmod'),
xgettext = require('gulp-xgettext'),
concatPo = require('gulp-concat-po'),
rename = require('gulp-rename'),
eslint = require('gulp-eslint'),
removeDuplicateHeaders = require('mibew-gulp-greh'),
mkdirp = require('mkdirp');
// Set global configuration
var config = {
mibewPath: 'mibew',
configsPath: 'mibew/configs',
phpVendorPath: 'mibew/vendor',
jsVendorPath: 'mibew/js/vendor',
pluginsPath: 'mibew/plugins',
avatarsPath: 'mibew/files/avatar',
cachePath: 'mibew/cache',
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" -d "memory_limit=512M"',
package: require('./composer.json'),
msginit: 'msginit',
msgcat: 'msgcat'
}
config.i18nSuffix = '-' + config.package.version + '-' + strftime('%Y%m%d');
// Tasks for cleaning //////////////////
// 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 whether Composer is already in place
if (fs.existsSync('./composer.phar')) {
callback(null);
return;
}
// 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) {
callback(error ? stderr : null);
});
// Pass installer code to PHP via STDIN
response.pipe(php.stdin);
});
});
// Install Composer dependencies excluding development ones
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', 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) {
bower.commands.install([], {}, {})
.on('error', function(error) {
callback(error);
})
.on('end', function() {
// We should manually minify JavaScript files that was not minified
// by bower packages' authors
// TODO: This is a temproary workaround and should be removed once
// the packages will be fixed
var stream = eventStream.merge(
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
.pipe(header(
"// Backbone.js 1.1.2\n"
+ "// (c) 2010-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n"
+ "// Backbone may be freely distributed under the MIT license.\n"
+ "// For all details and documentation:\n"
+ "// http://backbonejs.org\n"
))
.pipe(rename('backbone/backbone-min.js')),
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
.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
.on('error', callback)
.on('end', callback);
});
});
// 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'),
getClientSideApp('chat'),
getClientSideApp('thread_log'),
getClientSideApp('users'),
gulp.src(config.jsPath + '/source/**/*.js')
)
.pipe(uglify({preserveComments: 'some'}))
.pipe(removeDuplicateHeaders())
.pipe(gulp.dest(config.jsPath + '/compiled'));
});
// Compile and concatenate Handlebars templates for all chat styles
gulp.task('chat-styles-handlebars', function() {
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
}))
.pipe(wrapHandlebarsTemplate())
.pipe(concat('templates.js'))
.pipe(uglify({preserveComments: 'some'}))
.pipe(header(config.compiledTemplatesHeader))
.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
gulp.task('chat-styles-js', function() {
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(config.chatStylesPath + '/' + dir
+ '/js/compiled'))
.on('end', resolve)
.on('error', reject);
});
}));
});
});
// Performs all job related to pages styles
gulp.task('page-styles', function() {
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
}))
.pipe(wrapHandlebarsTemplate())
.pipe(concat('templates.js'))
.pipe(uglify({preserveComments: 'some'}))
.pipe(header(config.compiledTemplatesHeader))
.pipe(gulp.dest(config.pageStylesPath + '/' + dir
+ '/templates_compiled/client_side'))
.on('end', resolve)
.on('error', reject);
});
}));
});
});
// 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([
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(xgettext({
language: 'PHP',
keywords: [
{name: 'getlocal'},
{name: 'no_field'},
{name: 'wrong_field'},
{name: 'failed_uploading_file', singular: 2}
]
})),
gulp.src(config.jsPath + '/source/**/*.js', {base: config.mibewPath})
.pipe(xgettext({
language: 'JavaScript',
keywords: [
{name: 'trans'}
]
})),
gulp.src([
config.chatStylesPath + '/default/templates_src/**/*.handlebars',
config.pageStylesPath + '/default/templates_src/**/*.handlebars'
], {base: config.mibewPath})
.pipe(xgettextHandlebars())
)
.pipe(concatPo(config.i18nPrefix + 'translation'
+ config.i18nSuffix + '.pot',
{
headers: {
'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': '',
'Last-Translator': '',
'Language-Team': '',
'Content-Type': 'text/plain; charset=UTF-8'
}
})
)
.pipe(gulp.dest(config.releasePath));
});
// 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
'!' + config.configsPath + '/config.yml',
// Exclude cache files but not the ".keep" file.
'!' + config.cachePath + '/**/!(.keep)',
// Exclude avatars but not the ".keep" file.
'!' + config.avatarsPath + '/!(.keep)',
// Exclude plugins but not the ".keep" file.
'!' + config.pluginsPath + '/!(.keep)',
'!' + config.pluginsPath + '/*/**/*',
// Exclude Git repositories that can be shipped with third-party libs
'!' + config.phpVendorPath + '/**/.git',
'!' + config.phpVendorPath + '/**/.git/**/*',
// Exclude vendors binaries
'!' + config.phpVendorPath + '/bin/**/*',
// Exclude JavaScript sources
'!' + config.jsPath + '/source/**/*',
// Actually we does not need backbone.babysitter and backbone.wreqr
// dependencies because they embed into marionette.js. So we exclude
// "backbone.babysitter" and "backbone.wreqr" directories and all their
// contents.
'!' + config.jsVendorPath + '/backbone.babysitter{,/**}',
'!' + config.jsVendorPath + '/backbone.wreqr{,/**}',
// Exclude dot files within third-party JS libraries.
'!' + config.jsVendorPath + '/**/.*',
// Exclude config files of various package systems
'!' + config.jsVendorPath + '/**/{bower,component,package,composer}.json',
// Exclude config files of various build systems
'!' + config.jsVendorPath + '/**/Gruntfile.*',
'!' + config.jsVendorPath + '/**/gulpfile.*',
'!' + config.jsVendorPath + '/**/Makefile',
// Exclude HTML files from third-party JS libraries. Such files can be
// used for docs or for tests, we need none of them.
'!' + config.jsVendorPath + '/**/*.html',
// There are too many useless files in Vex.js library. Exclude them.
'!' + config.jsVendorPath + '/vex/sass{,/**}',
'!' + config.jsVendorPath + '/vex/docs{,/**}',
'!' + config.jsVendorPath + '/vex/docs{,/**}',
'!' + config.jsVendorPath + '/vex/coffee{,/**}'
];
var srcOptions = {
// 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,
// Preserve root directory name (i.e. 'mibew/')
base: '.'
}
var version = config.package.version;
return eventStream.merge(
gulp.src(sources, srcOptions)
.pipe(zip('mibew-' + version + '.zip')),
gulp.src(sources, srcOptions)
.pipe(tar('mibew-' + version + '.tar'))
.pipe(gzip())
)
.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);
});
}));
});
});
// Tasks of releasing //////////////////
// Prepare release of Mibew Messenger
gulp.task('prepare-release', function(callback) {
runSequence(
'clean',
['phpcs', 'js', 'chat-styles', 'page-styles', 'generate-pot',
'generate-tmp-po'],
'pack-sources',
'post-pack-cleanup',
callback
);
});
// 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(
'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.
* @returns A files stream that can be piped to any gulp plugin.
*/
var getClientSideApp = function(name) {
var appSource = config.jsPath + '/source/' + name;
return gulp.src(appSource + '/**/*.js')
.pipe(order(
[
appSource + '/init.js',
// The following line is equivalent to
// gulp.src([appSource + '/*.js', '!' + appSource + '/app.js']);
appSource + '/!(app).js',
appSource + '/models/**/base*.js',
appSource + '/models/**/*.js',
appSource + '/collections/**/base*.js',
appSource + '/collections/**/*.js',
appSource + '/model_views/**/base*.js',
appSource + '/model_views/**/*.js',
appSource + '/collection_views/**/base*.js',
appSource + '/collection_views/**/*.js',
appSource + '/regions/**/base*.js',
appSource + '/regions/**/*.js',
appSource + '/layouts/**/base*.js',
appSource + '/layouts/**/*.js',
appSource + '/**/base*.js',
// The following line is equivalent to
// gulp.src([appSource + '/**/*.js', '!' + appSource + '/app.js']);
'!' + appSource + '/app.js',
appSource + '/app.js'
],
{base: process.cwd()}
))
.pipe(concat(name + '_app.js'));
}
/**
* Wraps a handlebars template with a function and attach it to the
* Handlebars.templates object.
*
* @returns {Function} A function that can be used in pipe() method of a file
* stream right after gulp-handlebars plugin.
*/
var wrapHandlebarsTemplate = function() {
return defineModule('plain', {
wrapper: '(function() {\n'
+ 'var templates = Handlebars.templates = Handlebars.templates || {};\n'
+ 'Handlebars.templates["<%= relative %>"] = <%= handlebars %>;\n'
+ '})()',
context: function(context) {
return {relative: context.file.relative.replace(/\.js$/, '').replace(/\\/g, '/')};
}
});
}
/**
* Extracts gettext messages from handlebars templates.
*
* @returns {Function} A function that can be used in pipe() method of a file
* stream.
*/
var xgettextHandlebars = function() {
var helperRegExp = /\{{2}l10n\s*('|")(.*?[^\\])\1.*?\}{2}/g;
return through.obj(function (file, enc, callback) {
var po = new PoFile();
match = false,
contents = file.contents.toString();
while (match = helperRegExp.exec(contents)) {
// Try to find item in the .po file by its name
var item = lodash.find(po.items, function(item) {
return match[2] === item.msgid;
});
var line = contents.substr(0, match.index).split(/\r?\n|\r/g).length;
if (!item) {
// There is no such item, create new one
item = new PoFile.Item();
item.msgid = match[2].replace(/\\'/g, "'").replace(/\\"/g, '"');
po.items.push(item);
}
// Add new reference
item.references.push(file.relative + ':' + line);
}
// Update file contents
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

@ -1,12 +1,14 @@
# Set default handler for incoming requests
DirectoryIndex index.php
# Disable directory listing # Disable directory listing
Options -Indexes Options -Indexes
# Follow symbolic links in the directory # Follow symbolic links in the directory
Options +FollowSymLinks Options +FollowSymLinks
<IfModule mod_negotiation.c>
# Forbid apache to guess file extensions
Options -MultiViews
</IfModule>
# Disable mod_security for Apache 1.x # Disable mod_security for Apache 1.x
<IfModule mod_security.c> <IfModule mod_security.c>
SecFilterEngine Off SecFilterEngine Off
@ -26,12 +28,15 @@ Options +FollowSymLinks
# Redirect requests to the front controller # Redirect requests to the front controller
<IfModule mod_rewrite.c> <IfModule mod_rewrite.c>
# Use the front controller as a default handler
DirectoryIndex index.php
RewriteEngine On RewriteEngine On
# Use separate front controller for the system installator # Use separate front controller for the system installator
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d 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 # Rewrite all other requests for files and directories that do not exist to
# the main front controller # the main front controller
@ -40,7 +45,20 @@ Options +FollowSymLinks
RewriteRule ^(.*)$ index.php [QSA,L] RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule> </IfModule>
<IfModule !mod_rewrite.c>
# 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>
# Deny access to internal system files # Deny access to internal system files
<FilesMatch "\.(yml|po|ini|handlebars|keep)$"> <FilesMatch "\.(yml|po|ini|handlebars|keep)$">
Deny from all Deny from all
</FilesMatch> </FilesMatch>
# Deny access to CLI cron worker from the outside
<Files "cron.php">
Deny from all
</Files>

View File

@ -1,17 +1,19 @@
Mibew Messenger Mibew Messenger
Copyright 2005-2014 the original author or authors. Copyright 2005-2023 the original author or authors.
REQUIREMENTS REQUIREMENTS
* Apache web server 1.3.34 or above * 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 * MySQL database 5.0 or above
* PHP 5.3.3 or above with MySQL support * PHP 7.2.5 or above with PDO, pdo_mysql, cURL, mbstring and gd extensions
INSTALLATION INSTALLATION
1. Create folder with name 'mibew' in the root of your website. 1. Create folder with name 'mibew' in the root of your website.
2. Upload all the files contained in this archive (retaining the directory structure) into created folder. 2. Upload all the files contained in this archive (retaining the directory
Be sure to chmod the mibew folder to 755. structure) into created folder.
Be sure to chmod the mibew folder to 0755.
3. Add a MySQL database with the name 'mibew' 3. Add a MySQL database with the name 'mibew'
4. Copy /mibew/configs/default_config.yml to /mibew/configs/config.yml 4. Copy /mibew/configs/default_config.yml to /mibew/configs/config.yml
5. Edit /mibew/configs/config.yml to the information needed to connect to the database 5. Edit /mibew/configs/config.yml to the information needed to connect to the database
@ -22,10 +24,33 @@ INSTALLATION
user: admin user: admin
password: <your password> password: <your password>
9. Get button code and setup it on your site. 9. Get button code and setup it on your site.
10. Change your name. 10. Configure periodically running tasks by setting up an automated
11. Wait for your visitors on 'Pending users' page. process to visit the page http://<yourdomain>/cron?cron_key=<key>
The full URL including the secret "cron key" used to protect against
unauthorized access can be seen on the 'General' tab at the 'Settings' page.
11. Change your name.
12. Wait for your visitors on 'Pending users' page.
On unix/linux platforms change the owner of /mibew/files/avatar and
/mibew/cache folders to the user, under which the web server is running
(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.
On unix/linux platforms change the owner of /mibew/files/avatar folder
to the user, under which the web server is running (for instance, www).
The owner should have all rights on the folder /mibew/files/avatar
(chmod 700 /mibew/files/avatar).

View File

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

0
src/mibew/cache/.keep vendored Normal file
View File

View File

@ -72,7 +72,7 @@ thread:
useragent: "varchar(255)" useragent: "varchar(255)"
# Total count of user's messages related with the thread. # Total count of user's messages related with the thread.
messagecount: "varchar(16)" 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)" groupid: "int references {opgroup}(groupid)"
# Contains "by thread" statistics # Contains "by thread" statistics
@ -104,7 +104,7 @@ requestcallback:
fields: fields:
callbackid: "int NOT NULL auto_increment PRIMARY KEY" callbackid: "int NOT NULL auto_increment PRIMARY KEY"
token: "varchar(64) NOT NULL DEFAULT ''" token: "varchar(64) NOT NULL DEFAULT ''"
function: "varchar(64) NOT NULL" func: "varchar(64) NOT NULL"
arguments: "varchar(1024)" arguments: "varchar(1024)"
indexes: indexes:
token: [token] token: [token]
@ -129,12 +129,23 @@ translation:
# Contains locales info # Contains locales info
locale: locale:
fields: fields:
# Artificial primary key # Artificial primary key.
localeid: "int NOT NULL auto_increment PRIMARY KEY" localeid: "int NOT NULL auto_increment PRIMARY KEY"
# Locale code # Locale code
code: "varchar(5) NOT NULL" 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" 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 # Contains localized mail templates
mailtemplate: mailtemplate:
@ -190,7 +201,6 @@ operator:
istatus: "int DEFAULT 0" istatus: "int DEFAULT 0"
idisabled: "int DEFAULT 0" idisabled: "int DEFAULT 0"
vcavatar: "varchar(255)" vcavatar: "varchar(255)"
vcjabbername: "varchar(255)"
# Operators privileges bitmask. # Operators privileges bitmask.
iperm: "int DEFAULT 0" iperm: "int DEFAULT 0"
dtmrestore: "int NOT NULL DEFAULT 0" dtmrestore: "int NOT NULL DEFAULT 0"
@ -216,7 +226,7 @@ operatorstatistics:
revision: revision:
fields: fields:
id: "INT NOT NULL" id: "INT NOT NULL PRIMARY KEY"
# Contains relations between operators and groups # Contains relations between operators and groups
operatortoopgroup: operatortoopgroup:
@ -235,7 +245,6 @@ ban:
dtmtill: "int NOT NULL DEFAULT 0" dtmtill: "int NOT NULL DEFAULT 0"
address: "varchar(255)" address: "varchar(255)"
comment: "varchar(255)" comment: "varchar(255)"
blockedcount: "int DEFAULT 0"
# Contains dynamic configs # Contains dynamic configs
config: config:
@ -291,3 +300,37 @@ visitedpagestatistics:
acceptedinvitations: "int NOT NULL DEFAULT 0" acceptedinvitations: "int NOT NULL DEFAULT 0"
rejectedinvitations: "int NOT NULL DEFAULT 0" rejectedinvitations: "int NOT NULL DEFAULT 0"
ignoredinvitations: "int NOT NULL DEFAULT 0" ignoredinvitations: "int NOT NULL DEFAULT 0"
# Contains info about installed plugins
plugin:
fields:
# Artificial ID
id: "INT NOT NULL auto_increment PRIMARY KEY"
# Plugin name in "<Vendor>:<Name>" format.
name: "varchar(255) NOT NULL"
# Installed version of the plugin.
version: "varchar(255) NOT NULL"
# Indicates if the plugin is installed or not.
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 # IMPORTANT: Before install Mibew Messenger copy this file to config.yml and
# your own settings! # fill it with your own settings!
# MySQL Database parameters # MySQL Database parameters
@ -12,26 +12,87 @@ database:
tables_prefix: "" tables_prefix: ""
use_persistent_connection: false use_persistent_connection: false
# Mailbox # Mail
## This value will be used as sender address in all e-mails Mibew Messenger send.
mailbox: mibew@yourdomain.com mailbox: mibew@yourdomain.com
## Mailer parameters
mailer:
# This value determines what kind of mailer will be used. Possible values
# are "mail" and "smtp".
#
# To use standard PHP mail function just set this option to "mail". No
# additional configs are required in this case.
#
# To use SMTP-based solution set this option "smtp". This approach require
# some extra configuration to be done (see below).
transport: mail
# The lines below represents default SMTP mailer configurations. They will
# be used only if the "transport" option is set to "smtp".
host: localhost
port: 25
user: user
pass: ""
# The following option determines what kind of encryption should be used.
# false means no encyption at all. Another values once can use are "ssl" and
# "tls".
encryption: false
# Cache subsystem
cache:
# This value determines where the cached data will be stored. Possible
# values are "none", "file_system" and "memcached".
#
# If "none" is used the caching will be disabled. This option should be used
# only if none of the other options works.
#
# If "file_system" is used the cached data will be stored in files within
# the "cache/" directory. Notice, that the file system storage does not work
# on NFS systems bucause exclusive file locks are not supported where.
#
# If "memcached" is used the cached data will be stored in Memcached
# storage. Before using this kind of storage make sure PHP's memcached
# extension is installed and enabled.
storage: file_system
# The lines below represents default Memcached server configurations. They
# will be used only if the "storage" option is set to "memcached".
memcached_servers:
- host: localhost
port: 11211
# 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.
# Locales # Locales
## Native name will be used in this locale ## Native name will be used in this locale
home_locale: en home_locale: en
## If user does not provide known lang ## If user does not provide known lang
default_locale: en default_locale: en
# A timezone to use. Leave this value empty to use the default timezone from the
# system settings. For the details about available timezones see
# 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
plugins: [] plugins: []
## Exapmle of plugins configuration ## Example of plugins configuration
# plugins: # plugins:
# - # "VendorName:PluginName":
# name: "VendorName:PluginName" # weight: 100
# config: # some_configurable_value: value
# weight: 100 # "VendorName:AnotherPluginName":
# some_configurable_value: value # very_important_value: "$3.50"
# -
# name: "VendorName:AnotherPluginName"
# config:
# very_important_value: "$3.50"

View File

@ -49,6 +49,14 @@ chat_user:
thread_id: \d{1,10} thread_id: \d{1,10}
token: \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: chat_user_invitation:
path: /chat/invitation path: /chat/invitation
defaults: defaults:
@ -72,11 +80,33 @@ chat_user_mail_send:
token: \d{1,10} token: \d{1,10}
methods: [POST] methods: [POST]
chat_user_popup_style:
path: /chat/style/popup/{style}
defaults:
_controller: Mibew\Controller\Chat\StyleController::loadPopupStyleAction
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: chat_user_start:
path: /chat path: /chat
defaults: defaults:
_controller: Mibew\Controller\Chat\UserChatController::startAction _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 # Pages that are available for all users
button: button:
path: /b path: /b
@ -90,9 +120,12 @@ cron:
path: /cron path: /cron
defaults: { _controller: Mibew\Controller\CronController::runAction } defaults: { _controller: Mibew\Controller\CronController::runAction }
license: # A set of localization constants for the client side applications is generated
path: /license # dynamically
defaults: { _controller: Mibew\Controller\LicenseController::indexAction } js_translation:
path: /locales/{locale}/translation.js
defaults:
_controller: Mibew\Controller\Localization\JsTranslationController::indexAction
widget_gateway: widget_gateway:
path: /widget path: /widget
@ -100,6 +133,13 @@ widget_gateway:
# Operators' pages # Operators' pages
## About page
about:
path: /operator/about
defaults:
_controller: Mibew\Controller\AboutController::indexAction
_access_check: Mibew\AccessControl\Check\LoggedInCheck
## Banned visitors ## Banned visitors
ban_add: ban_add:
path: /operator/ban/add path: /operator/ban/add
@ -160,21 +200,24 @@ canned_message_add:
path: /operator/canned-message/add path: /operator/canned-message/add
defaults: defaults:
_controller: Mibew\Controller\CannedMessageController::showEditFormAction _controller: Mibew\Controller\CannedMessageController::showEditFormAction
_access_check: Mibew\AccessControl\Check\LoggedInCheck _access_check: Mibew\AccessControl\Check\PermissionsCheck
_access_permissions: [CAN_ADMINISTRATE]
methods: [GET] methods: [GET]
canned_message_add_save: canned_message_add_save:
path: /operator/canned-message/add path: /operator/canned-message/add
defaults: defaults:
_controller: Mibew\Controller\CannedMessageController::submitEditFormAction _controller: Mibew\Controller\CannedMessageController::submitEditFormAction
_access_check: Mibew\AccessControl\Check\LoggedInCheck _access_check: Mibew\AccessControl\Check\PermissionsCheck
_access_permissions: [CAN_ADMINISTRATE]
methods: [POST] methods: [POST]
canned_message_delete: canned_message_delete:
path: /operator/canned-message/{message_id}/delete path: /operator/canned-message/{message_id}/delete
defaults: defaults:
_controller: Mibew\Controller\CannedMessageController::deleteAction _controller: Mibew\Controller\CannedMessageController::deleteAction
_access_check: Mibew\AccessControl\Check\LoggedInCheck _access_check: Mibew\AccessControl\Check\PermissionsCheck
_access_permissions: [CAN_ADMINISTRATE]
requirements: requirements:
message_id: \d{1,10} message_id: \d{1,10}
@ -182,7 +225,8 @@ canned_message_edit:
path: /operator/canned-message/{message_id}/edit path: /operator/canned-message/{message_id}/edit
defaults: defaults:
_controller: Mibew\Controller\CannedMessageController::showEditFormAction _controller: Mibew\Controller\CannedMessageController::showEditFormAction
_access_check: Mibew\AccessControl\Check\LoggedInCheck _access_check: Mibew\AccessControl\Check\PermissionsCheck
_access_permissions: [CAN_ADMINISTRATE]
requirements: requirements:
message_id: \d{1,10} message_id: \d{1,10}
methods: [GET] methods: [GET]
@ -191,7 +235,8 @@ canned_message_edit_save:
path: /operator/canned-message/{message_id}/edit path: /operator/canned-message/{message_id}/edit
defaults: defaults:
_controller: Mibew\Controller\CannedMessageController::submitEditFormAction _controller: Mibew\Controller\CannedMessageController::submitEditFormAction
_access_check: Mibew\AccessControl\Check\LoggedInCheck _access_check: Mibew\AccessControl\Check\PermissionsCheck
_access_permissions: [CAN_ADMINISTRATE]
requirements: requirements:
message_id: \d{1,10} message_id: \d{1,10}
methods: [POST] methods: [POST]
@ -200,7 +245,8 @@ canned_messages:
path: /operator/canned-message path: /operator/canned-message
defaults: defaults:
_controller: Mibew\Controller\CannedMessageController::indexAction _controller: Mibew\Controller\CannedMessageController::indexAction
_access_check: Mibew\AccessControl\Check\LoggedInCheck _access_check: Mibew\AccessControl\Check\PermissionsCheck
_access_permissions: [CAN_ADMINISTRATE]
## Groups ## Groups
group_add: group_add:
@ -331,7 +377,27 @@ locale_disable:
_access_check: Mibew\AccessControl\Check\PermissionsCheck _access_check: Mibew\AccessControl\Check\PermissionsCheck
_access_permissions: [CAN_ADMINISTRATE] _access_permissions: [CAN_ADMINISTRATE]
requirements: 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: locale_enable:
path: /operator/locale/{locale}/enable path: /operator/locale/{locale}/enable
@ -340,7 +406,7 @@ locale_enable:
_access_check: Mibew\AccessControl\Check\PermissionsCheck _access_check: Mibew\AccessControl\Check\PermissionsCheck
_access_permissions: [CAN_ADMINISTRATE] _access_permissions: [CAN_ADMINISTRATE]
requirements: requirements:
locale: "[a-z\-]{2,5}" locale: "[a-z\\-]{2,5}"
locales: locales:
path: /operator/locale path: /operator/locale
@ -541,6 +607,42 @@ password_recovery_reset:
defaults: defaults:
_controller: Mibew\Controller\PasswordRecoveryController::resetAction _controller: Mibew\Controller\PasswordRecoveryController::resetAction
## Plugins
plugin_enable:
path: /operator/plugin/{plugin_name}/enable
defaults:
_controller: Mibew\Controller\PluginController::enableAction
_access_check: Mibew\AccessControl\Check\PermissionsCheck
_access_permissions: [CAN_ADMINISTRATE]
plugin_disable:
path: /operator/plugin/{plugin_name}/disable
defaults:
_controller: Mibew\Controller\PluginController::disableAction
_access_check: Mibew\AccessControl\Check\PermissionsCheck
_access_permissions: [CAN_ADMINISTRATE]
plugin_uninstall:
path: /operator/plugin/{plugin_name}/uninstall
defaults:
_controller: Mibew\Controller\PluginController::uninstallAction
_access_check: Mibew\AccessControl\Check\PermissionsCheck
_access_permissions: [CAN_ADMINISTRATE]
plugin_update:
path: /operator/plugin/{plugin_name}/update
defaults:
_controller: Mibew\Controller\PluginController::updateAction
_access_check: Mibew\AccessControl\Check\PermissionsCheck
_access_permissions: [CAN_ADMINISTRATE]
plugins:
path: /operator/plugin
defaults:
_controller: Mibew\Controller\PluginController::indexAction
_access_check: Mibew\AccessControl\Check\PermissionsCheck
_access_permissions: [CAN_ADMINISTRATE]
## Settings ## Settings
settings_common: settings_common:
path: /operator/settings path: /operator/settings
@ -596,7 +698,8 @@ statistics:
defaults: defaults:
type: "by-date" type: "by-date"
_controller: Mibew\Controller\StatisticsController::indexAction _controller: Mibew\Controller\StatisticsController::indexAction
_access_check: Mibew\AccessControl\Check\LoggedInCheck _access_check: Mibew\AccessControl\Check\PermissionsCheck
_access_permissions: [CAN_VIEWSTATISTICS]
requirements: requirements:
type: by-date|by-operator|by-page type: by-date|by-operator|by-page
@ -618,7 +721,7 @@ translation_edit:
_access_check: Mibew\AccessControl\Check\PermissionsCheck _access_check: Mibew\AccessControl\Check\PermissionsCheck
_access_permissions: [CAN_ADMINISTRATE] _access_permissions: [CAN_ADMINISTRATE]
requirements: requirements:
string_id: "\d{1,10}" string_id: "\\d{1,10}"
methods: [GET] methods: [GET]
translation_edit_save: translation_edit_save:
@ -628,7 +731,23 @@ translation_edit_save:
_access_check: Mibew\AccessControl\Check\PermissionsCheck _access_check: Mibew\AccessControl\Check\PermissionsCheck
_access_permissions: [CAN_ADMINISTRATE] _access_permissions: [CAN_ADMINISTRATE]
requirements: requirements:
string_id: "\d{1,10}" string_id: "\\d{1,10}"
methods: [POST]
translation_export:
path: /operator/translation/export
defaults:
_controller: Mibew\Controller\Localization\TranslationExportController::showFormAction
_access_check: Mibew\AccessControl\Check\PermissionsCheck
_access_permissions: [CAN_ADMINISTRATE]
methods: [GET]
translation_export_process:
path: /operator/translation/export
defaults:
_controller: Mibew\Controller\Localization\TranslationExportController::submitFormAction
_access_check: Mibew\AccessControl\Check\PermissionsCheck
_access_permissions: [CAN_ADMINISTRATE]
methods: [POST] methods: [POST]
translation_import: translation_import:
@ -655,11 +774,26 @@ translations:
_access_permissions: [CAN_ADMINISTRATE] _access_permissions: [CAN_ADMINISTRATE]
## Updates ## Updates
updates: update:
path: /operator/updates path: /update
defaults: defaults:
_controller: Mibew\Controller\UpdatesController::indexAction _controller: Mibew\Controller\UpdateController::indexAction
_access_check: Mibew\AccessControl\Check\LoggedInCheck _access_check: Mibew\AccessControl\Check\PermissionsCheck
_access_permissions: [CAN_ADMINISTRATE]
update_run:
path: /update/run
defaults:
_controller: Mibew\Controller\UpdateController::runUpdateAction
_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 (visitors avaiting page)
users: users:
@ -674,7 +808,17 @@ users_update:
_controller: Mibew\Controller\UsersController::updateAction _controller: Mibew\Controller\UsersController::updateAction
_access_check: Mibew\AccessControl\Check\LoggedInCheck _access_check: Mibew\AccessControl\Check\LoggedInCheck
# Remove trailing slashe. This route is the last one because previous rotes can # System routes and includes
# The following route is a fake and is used only to load plugins routes. It can
# have any unique name.
_include_pluign_routes:
# Resource name has no meaning and can be any value.
resource: .
# The type actually indicates that plugins routes should be included.
type: plugin
# Remove trailing slashes. This route is the last one because previous rotes can
# (but definitely should not) have trailing slashes. # (but definitely should not) have trailing slashes.
remove_trailing_slash: remove_trailing_slash:
path: /{url} path: /{url}

View File

@ -1,3 +1,16 @@
# The following route is a fake and is used only to load routes of the core. It
# can have any unique name.
_include_core_routes:
resource: routing.yml
type: yaml
# Override the home route to allow users use <mibew root>/install.php path to
# the installer.
home:
path: /
defaults:
_controller: Mibew\Controller\InstallController::indexAction
install: install:
path: /install path: /install
defaults: defaults:

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

@ -1,6 +1,8 @@
<?php <?php
/* /*
* Copyright 2005-2014 the original author or authors. * 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -20,24 +22,53 @@ require_once(dirname(__FILE__) . '/libs/init.php');
use Mibew\Application; use Mibew\Application;
use Mibew\Authentication\AuthenticationManager; use Mibew\Authentication\AuthenticationManager;
use Mibew\Routing\RouteCollectionLoader; use Mibew\Cache\CacheFactory;
use Mibew\Mail\MailerFactory;
use Mibew\Plugin\PluginManager;
use Mibew\Routing\Router; use Mibew\Routing\Router;
use Symfony\Component\HttpFoundation\Request; use Mibew\Routing\Loader\CacheLoader;
use Mibew\Routing\Loader\PluginLoader;
use Symfony\Component\Config\FileLocator; use Symfony\Component\Config\FileLocator;
use Symfony\Component\Config\Loader\LoaderResolver;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Loader\YamlFileLoader;
$file_locator = new FileLocator(array(MIBEW_FS_ROOT)); $configs = load_system_configs();
$router = new Router(new RouteCollectionLoader($file_locator));
$router->setOption( // Prepare the cache
'route_collection', $cache_factory = new CacheFactory($configs['cache']);
RouteCollectionLoader::ROUTES_CORE | RouteCollectionLoader::ROUTES_PLUGINS // For now directory for cache files cannot be changed via the configs file.
); // 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());
// Real loaders are attached via the resolver.
$loader_resolver = new LoaderResolver(array(
$route_loader,
new YamlFileLoader(new FileLocator(array(MIBEW_FS_ROOT))),
new PluginLoader(),
));
$router = new Router($route_loader, 'configs/routing.yml');
$application = new Application($router, new AuthenticationManager()); $application = new Application($router, new AuthenticationManager());
$application->setCache($cache_factory->getCache());
// Use custom config-dependent mailer factory
$application->setMailerFactory(new MailerFactory($configs['mailer']));
// Process request // Process request
$request = Request::createFromGlobals(); $request = Request::createFromGlobals();
$response = $application->handleRequest($request); $response = $application->handleRequest($request);
// Send response to the user // Send response to the user
$response->prepare($request);
$response->send(); $response->send();

View File

@ -0,0 +1,23 @@
<?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.
*/
// 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');

View File

@ -1,6 +1,8 @@
<?php <?php
/* /*
* Copyright 2005-2014 the original author or authors. * 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -15,24 +17,28 @@
* limitations under the License. * limitations under the License.
*/ */
define('INSTALLATION_IN_PROGRESS', true); define('MAINTENANCE_MODE', 'install');
// Initialize libraries // Initialize libraries
require_once(dirname(__FILE__) . '/libs/init.php'); require_once(dirname(__FILE__) . '/libs/init.php');
use Mibew\Application; use Mibew\Application;
use Mibew\Authentication\DummyAuthenticationManager; use Mibew\Authentication\DummyAuthenticationManager;
use Mibew\Routing\RouteCollectionLoader; use Mibew\Routing\Loader\DummyPluginLoader;
use Mibew\Routing\Router; use Mibew\Routing\Router;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Config\FileLocator; use Symfony\Component\Config\FileLocator;
use Symfony\Component\Config\Loader\LoaderResolver;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Loader\YamlFileLoader;
// Prepare router
$file_locator = new FileLocator(array(MIBEW_FS_ROOT)); $file_locator = new FileLocator(array(MIBEW_FS_ROOT));
$router = new Router(new RouteCollectionLoader($file_locator)); $route_loader = new YamlFileLoader($file_locator);
$router->setOption( $loader_resolver = new LoaderResolver(array(
'route_collection', $route_loader,
RouteCollectionLoader::ROUTES_CORE | RouteCollectionLoader::ROUTES_INSTALLATION new DummyPluginLoader(),
); ));
$router = new Router($route_loader, 'configs/routing_install.yml');
$application = new Application($router, new DummyAuthenticationManager()); $application = new Application($router, new DummyAuthenticationManager());
@ -41,5 +47,4 @@ $request = Request::createFromGlobals();
$response = $application->handleRequest($request); $response = $application->handleRequest($request);
// Send response to the user // Send response to the user
$response->prepare($request);
$response->send(); $response->send();

View File

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
var myAgent="",myVer=0,myRealAgent="";function detectAgent(){for(var a="opera msie safari firefox netscape mozilla".split(" "),d=navigator.userAgent.toLowerCase(),b=0;b<a.length;b++){var c=a[b];if(-1!=d.indexOf(c)){myAgent=c;if(!window.RegExp)break;null!=RegExp(c+"[ /]?([0-9]+(.[0-9]+)?)").exec(d)&&(myVer=parseFloat(RegExp.$1));break}}myRealAgent=myAgent;"Gecko"==navigator.product&&(myAgent="moz")}detectAgent();function getEl(a){return document.getElementById(a)};

View File

@ -1,9 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(b,d){var c=b.Application;c.addRegions({mainRegion:"#main-region"});c.addInitializer(function(a){b.PluginOptions=a.plugins||{};b.Objects.server=new b.Server(d.extend({interactionType:MibewAPIChatInteraction},a.server));b.Objects.Models.page=new b.Models.Page(a.page);switch(a.startFrom){case "chat":c.Chat.start(a.chatOptions);break;case "survey":c.Survey.start(a.surveyOptions);break;case "leaveMessage":c.LeaveMessage.start(a.leaveMessageOptions);break;case "invitation":c.Invitation.start(a.invitationOptions);
break;default:throw Error("Dont know how to start!");}});c.on("start",function(){b.Objects.server.runUpdater()})})(Mibew,_);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a){a.Views.MessagesCollection=a.Views.CollectionBase.extend({itemView:a.Views.Message,className:"messages-collection"})})(Mibew);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a){a.Views.StatusCollection=a.Views.CollectionBase.extend({itemView:a.Views.Status,className:"status-collection"})})(Mibew);

View File

@ -1,10 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(b,d,j){b.Collections.Messages=d.Collection.extend({model:b.Models.Message,initialize:function(){this.periodicallyCalled=[];this.periodicallyCalled.push(b.Objects.server.callFunctionsPeriodically(j.bind(this.updateMessagesFunctionBuilder,this),j.bind(this.updateMessages,this)))},finalize:function(){for(var a=0;a<this.periodicallyCalled.length;a++)b.Objects.server.stopCallFunctionsPeriodically(this.periodicallyCalled[a])},updateMessages:function(a){a.lastId&&b.Objects.Models.thread.set({lastId:a.lastId});
for(var k=b.Models.Message.prototype.KIND_PLUGIN,g=[],c,f,e,h=0,d=a.messages.length;h<d;h++)c=a.messages[h],c.kind!=k?g.push(new b.Models.Message(c)):"object"!=typeof c.data||null===c.data||(f=c.plugin||!1,f="process:"+(!1!==f?f+":":"")+"plugin:message",e={messageData:c,model:!1},this.trigger(f,e),e.model&&(e.model.get("id")||e.model.set({id:c.id}),g.push(e.model)));0<g.length&&this.add(g)},updateMessagesFunctionBuilder:function(){var a=b.Objects.Models.thread,d=b.Objects.Models.user;return[{"function":"updateMessages",
arguments:{"return":{messages:"messages",lastId:"lastId"},references:{},threadId:a.get("id"),token:a.get("token"),lastId:a.get("lastId"),user:!d.get("isAgent")}}]},add:function(){var a=Array.prototype.slice.apply(arguments),a=d.Collection.prototype.add.apply(this,a);this.trigger("multiple:add");return a}})})(Mibew,Backbone,_);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,b){a.Collections.Status=b.Collection.extend({comparator:function(a){return a.get("weight")}})})(Mibew,Backbone);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a){a.Regions={};a.Layouts={};a.Application=new Backbone.Marionette.Application})(Mibew);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,c){a.Layouts.Chat=c.Marionette.Layout.extend({template:Handlebars.templates.chat_layout,regions:{controlsRegion:"#controls-region",avatarRegion:"#avatar-region",messagesRegion:{selector:"#messages-region",regionType:a.Regions.Messages},statusRegion:"#status-region",messageFormRegion:"#message-form-region"},serializeData:function(){var b=a.Objects.Models;return{page:b.page.toJSON(),user:b.user.toJSON()}}})})(Mibew,Backbone);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,b){a.Layouts.Invitation=b.Marionette.Layout.extend({template:Handlebars.templates.invitation_layout,regions:{messagesRegion:{selector:"#invitation-messages-region",regionType:a.Regions.Messages}}})})(Mibew,Backbone);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,b){a.Layouts.LeaveMessage=b.Marionette.Layout.extend({template:Handlebars.templates.leave_message_layout,regions:{leaveMessageFormRegion:"#content-wrapper",descriptionRegion:"#description-region"},serializeData:function(){return{page:a.Objects.Models.page.toJSON()}}})})(Mibew,Backbone);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,b){a.Layouts.Survey=b.Marionette.Layout.extend({template:Handlebars.templates.survey_layout,regions:{surveyFormRegion:"#content-wrapper"},serializeData:function(){return{page:a.Objects.Models.page.toJSON()}}})})(Mibew,Backbone);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
MibewAPIChatInteraction=function(){this.mandatoryArguments=function(){return{"*":{threadId:null,token:null,"return":{},references:{}},result:{errorCode:0}}};this.getReservedFunctionsNames=function(){return["result"]}};MibewAPIChatInteraction.prototype=new MibewAPIInteraction;

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,b,c){a.Views.Avatar=b.Marionette.ItemView.extend({template:c.templates.chat_avatar,className:"avatar",modelEvents:{change:"render"}})})(Mibew,Backbone,Handlebars);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,c,d){a.Views.CloseControl=a.Views.Control.extend({template:c.templates.chat_controls_close,events:d.extend({},a.Views.Control.prototype.events,{click:"closeThread"}),closeThread:function(){var b=a.Localization.get("Are you sure want to leave chat?");(!1===b||confirm(b))&&this.model.closeThread()}})})(Mibew,Handlebars,_);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(b,d,e){b.Views.HistoryControl=b.Views.Control.extend({template:d.templates.chat_controls_history,events:e.extend({},b.Views.Control.prototype.events,{click:"showHistory"}),showHistory:function(){var c=b.Objects.Models.user,a=this.model.get("link");c.get("isAgent")&&a&&(c=this.model.get("windowParams"),a=a.replace("&amp;","&","g"),a=window.open(a,"UserHistory",c),null!==a&&(a.focus(),a.opener=window))}})})(Mibew,Handlebars,_);

View File

@ -1,9 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(b,e,f){b.Views.RedirectControl=b.Views.Control.extend({template:e.templates.chat_controls_redirect,events:f.extend({},b.Views.Control.prototype.events,{click:"redirect"}),initialize:function(){b.Objects.Models.user.on("change",this.render,this)},serializeData:function(){var a=this.model.toJSON();a.user=b.Objects.Models.user.toJSON();return a},redirect:function(){var a=b.Objects.Models.user;if(a.get("isAgent")&&a.get("canPost")&&(a=this.model.get("link"))){var c=b.Objects.Models.page.get("style"),
d="";c&&(d=(-1===a.indexOf("?")?"?":"&")+"style="+c);window.location.href=a.replace(/\&amp\;/g,"&")+d}}})})(Mibew,Handlebars,_);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,b,c){a.Views.RefreshControl=a.Views.Control.extend({template:b.templates.chat_controls_refresh,events:c.extend({},a.Views.Control.prototype.events,{click:"refresh"}),refresh:function(){this.model.refresh()}})})(Mibew,Handlebars,_);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,d,e){a.Views.SecureModeControl=a.Views.Control.extend({template:d.templates.chat_controls_secure_mode,events:e.extend({},a.Views.Control.prototype.events,{click:"secure"}),secure:function(){var b=this.model.get("link");if(b){var c=a.Objects.Models.page.get("style");window.location.href=b.replace(/\&amp\;/g,"&")+(c?"&style="+c:"")}}})})(Mibew,Handlebars,_);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(b,d,f){b.Views.SendMailControl=b.Views.Control.extend({template:d.templates.chat_controls_send_mail,events:f.extend({},b.Views.Control.prototype.events,{click:"sendMail"}),sendMail:function(){var a=this.model.get("link"),c=b.Objects.Models.page;if(a){var d=this.model.get("windowParams"),c=c.get("style"),e="";c&&(e=(-1===a.indexOf("?")?"?":"&")+"style="+c);a=a.replace(/\&amp\;/g,"&")+e;a=window.open(a,"ForwardMail",d);null!==a&&(a.focus(),a.opener=window)}}})})(Mibew,Handlebars,_);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,b,c){a.Views.SoundControl=a.Views.Control.extend({template:b.templates.chat_controls_sound,events:c.extend({},a.Views.Control.prototype.events,{click:"toggle"}),toggle:function(){this.model.toggle()}})})(Mibew,Handlebars,_);

View File

@ -1,9 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(b,c,d){b.Views.UserNameControl=b.Views.Control.extend({template:c.templates.chat_controls_user_name,events:d.extend({},b.Views.Control.prototype.events,{"click .user-name-control-set":"changeName","click .user-name-control-change":"showNameInput","keydown #user-name-control-input":"inputKeyDown"}),ui:{nameInput:"#user-name-control-input"},initialize:function(){b.Objects.Models.user.on("change:name",this.hideNameInput,this);this.nameInput=b.Objects.Models.user.get("defaultName")},serializeData:function(){var a=
this.model.toJSON();a.user=b.Objects.Models.user.toJSON();a.nameInput=this.nameInput;return a},inputKeyDown:function(a){a=a.which;(13==a||10==a)&&this.changeName()},hideNameInput:function(){this.nameInput=!1;this.render()},showNameInput:function(){this.nameInput=!0;this.render()},changeName:function(){var a=this.ui.nameInput.val();this.model.changeName(a)}})})(Mibew,Handlebars,_);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,b,c){a.Views.LeaveMessageDescription=b.Marionette.ItemView.extend({template:c.templates.leave_message_description,serializeData:function(){return{page:a.Objects.Models.page.toJSON()}}})})(Mibew,Backbone,Handlebars);

View File

@ -1,9 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(d,e,b){var c=d.Views.BaseSurveyForm;d.Views.LeaveMessageForm=c.extend({template:e.templates.leave_message_form,events:b.extend({},c.prototype.events,{"click #send-message":"submitForm"}),ui:b.extend({},c.prototype.ui,{captcha:'input[name="captcha"]',captchaImg:"#captcha-img"}),modelEvents:b.extend({},c.prototype.modelEvents,{"submit:error":"hideAjaxLoader showError submitError"}),submitForm:function(){this.showAjaxLoader();var a={};this.model.get("groups")&&(a.groupId=this.ui.groupSelect.val());
a.name=this.ui.name.val()||"";a.email=this.ui.email.val()||"";a.message=this.ui.message.val()||"";this.model.get("showCaptcha")&&(a.captcha=this.ui.captcha.val()||"");this.model.set(a,{validate:!0});this.model.submit()},submitError:function(a,c){if(c.code==a.ERROR_WRONG_CAPTCHA&&a.get("showCaptcha")){var b=this.ui.captchaImg.attr("src"),b=b.replace(/\?d\=[0-9]+/,"");this.ui.captchaImg.attr("src",b+"?d="+(new Date).getTime())}}})})(Mibew,Handlebars,_);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,b,c){a.Views.LeaveMessageSentDescription=b.Marionette.ItemView.extend({template:c.templates.leave_message_sent_description,serializeData:function(){return{page:a.Objects.Models.page.toJSON()}}})})(Mibew,Backbone,Handlebars);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,b){a.Views.Message=a.Views.Message.extend({template:b.templates.chat_message})})(Mibew,Handlebars);

View File

@ -1,11 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(b,d,e){b.Views.MessageForm=d.Marionette.ItemView.extend({template:e.templates.chat_message_form,events:{"click #send-message":"postMessage","keydown #message-input":"messageKeyDown","keyup #message-input":"checkUserTyping","change #message-input":"checkUserTyping","change #predefined":"selectPredefinedAnswer","focus #message-input":"setFocus","blur #message-input":"dropFocus"},modelEvents:{change:"render"},ui:{message:"#message-input",send:"#send-message",predefinedAnswer:"#predefined"},
initialize:function(){b.Objects.Models.user.on("change:canPost",this.render,this)},serializeData:function(){var a=this.model.toJSON();a.user=b.Objects.Models.user.toJSON();return a},postMessage:function(){var a=this.ui.message.val();""!=a&&(this.disableInput(),this.model.postMessage(a));b.Objects.Collections.messages.on("multiple:add",this.postMessageComplete,this)},messageKeyDown:function(a){var c=a.which;a=a.ctrlKey;(13==c&&(a||this.model.get("ignoreCtrl"))||10==c)&&this.postMessage()},enableInput:function(){this.ui.message.removeAttr("disabled")},
disableInput:function(){this.ui.message.attr("disabled","disabled")},clearInput:function(){this.ui.message.val("").change()},postMessageComplete:function(){this.clearInput();this.enableInput();this.focused&&this.ui.focus();b.Objects.Collections.messages.off("multiple:add",this.postMessageComplete,this)},selectPredefinedAnswer:function(){var a=this.ui.message,c=this.ui.predefinedAnswer,b=c.get(0).selectedIndex;b&&(a.val(this.model.get("predefinedAnswers")[b-1].full).change(),a.focus(),c.get(0).selectedIndex=
0)},checkUserTyping:function(){var a=b.Objects.Models.user,c=""!=this.ui.message.val();c!=a.get("typing")&&a.set({typing:c})},setFocus:function(){this.focused=!0},dropFocus:function(){this.focused=!1}})})(Mibew,Backbone,Handlebars);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,b,c){a.Views.Status=b.Marionette.ItemView.extend({template:c.templates.chat_status_base,className:"status",modelEvents:{change:"render"},onBeforeRender:function(){this.model.get("visible")?this.$el.show():this.$el.hide()}})})(Mibew,Backbone,Handlebars);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,b){a.Views.StatusMessage=a.Views.Status.extend({template:b.templates.chat_status_message})})(Mibew,Handlebars);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,b){a.Views.StatusTyping=a.Views.Status.extend({template:b.templates.chat_status_typing})})(Mibew,Handlebars);

View File

@ -1,9 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(c,d){c.Views.BaseSurveyForm=d.Marionette.ItemView.extend({events:{'change select[name="group"]':"changeGroupDescription","submit form":"preventSubmit"},ui:{groupSelect:'select[name="group"]',groupDescription:"#groupDescription",name:'input[name="name"]',email:'input[name="email"]',message:'textarea[name="message"]',errors:".errors",ajaxLoader:"#ajax-loader"},modelEvents:{invalid:"hideAjaxLoader showError","submit:error":"hideAjaxLoader showError"},preventSubmit:function(a){a.preventDefault()},
changeGroupDescription:function(){var a=this.ui.groupSelect.prop("selectedIndex"),a=this.model.get("groups")[a].description||"";this.ui.groupDescription.text(a)},showError:function(a,b){this.ui.errors.html("string"==typeof b?b:b.message)},serializeData:function(){var a=this.model.toJSON();a.page=c.Objects.Models.page.toJSON();return a},showAjaxLoader:function(){this.ui.ajaxLoader.show()},hideAjaxLoader:function(){this.ui.ajaxLoader.hide()}})})(Mibew,Backbone);

View File

@ -1,9 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(b,d,e){var c=b.Views.BaseSurveyForm;b.Views.SurveyForm=c.extend({template:d.templates.survey_form,events:e.extend({},c.prototype.events,{"click #submit-survey":"submitForm"}),submitForm:function(){this.showAjaxLoader();var a={};this.model.get("groups")&&(a.groupId=this.ui.groupSelect.val());this.model.get("canChangeName")&&(a.name=this.ui.name.val()||"");this.model.get("showEmail")&&(a.email=this.ui.email.val()||"");this.model.get("showMessage")&&(a.message=this.ui.message.val()||"");this.model.set(a,
{validate:!0});this.model.submit()}})})(Mibew,Handlebars,_);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(b,c){b.Models.Avatar=b.Models.Base.extend({defaults:{imageLink:!1},initialize:function(){this.registeredFunctions=[];this.registeredFunctions.push(b.Objects.server.registerFunction("setupAvatar",c.bind(this.apiSetupAvatar,this)))},finalize:function(){for(var a=0;a<this.registeredFunctions.length;a++)b.Objects.server.unregisterFunction(this.registeredFunctions[a])},apiSetupAvatar:function(a){a.imageLink&&this.set({imageLink:a.imageLink})}})})(Mibew,_);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,b){a.Models.ChatUser=a.Models.User.extend({defaults:b.extend({},a.Models.User.prototype.defaults,{canPost:!0,typing:!1,canChangeName:!1,dafaultName:!0})})})(Mibew,_);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a){a.Models.CloseControl=a.Models.Control.extend({getModelType:function(){return"CloseControl"},closeThread:function(){var b=a.Objects.Models.thread,c=a.Objects.Models.user;a.Objects.server.callFunctions([{"function":"close",arguments:{references:{},"return":{closed:"closed"},threadId:b.get("id"),token:b.get("token"),lastId:b.get("lastId"),user:!c.get("isAgent")}}],function(b){b.closed?window.close():a.Objects.Models.Status.message.setMessage(b.errorMessage||"Cannot close")},!0)}})})(Mibew);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,b){a.Models.HistoryControl=a.Models.Control.extend({defaults:b.extend({},a.Models.Control.prototype.defaults,{link:!1,windowParams:""}),getModelType:function(){return"HistoryControl"}})})(Mibew,_);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,b){a.Models.RedirectControl=a.Models.Control.extend({defaults:b.extend({},a.Models.Control.prototype.defaults,{link:!1}),getModelType:function(){return"RedirectControl"}})})(Mibew,_);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a){a.Models.RefreshControl=a.Models.Control.extend({getModelType:function(){return"RefreshControl"},refresh:function(){a.Objects.server.restartUpdater()}})})(Mibew);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,b){a.Models.SecureModeControl=a.Models.Control.extend({defaults:b.extend({},a.Models.Control.prototype.defaults,{link:!1}),getModelType:function(){return"SecureModeControl"}})})(Mibew,_);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,b){a.Models.SendMailControl=a.Models.Control.extend({defaults:b.extend({},a.Models.Control.prototype.defaults,{link:!1,windowParams:""}),getModelType:function(){return"SendMailControl"}})})(Mibew,_);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,c){a.Models.SoundControl=a.Models.Control.extend({defaults:c.extend({},a.Models.Control.prototype.defaults,{enabled:!0}),toggle:function(){var b=!this.get("enabled");a.Objects.Models.soundManager.set({enabled:b});this.set({enabled:b})},getModelType:function(){return"SoundControl"}})})(Mibew,_);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(b){b.Models.UserNameControl=b.Models.Control.extend({getModelType:function(){return"UserNameControl"},changeName:function(a){var c=b.Objects.Models.user,d=b.Objects.Models.thread,e=c.get("name");a&&e!=a&&(b.Objects.server.callFunctions([{"function":"rename",arguments:{references:{},"return":{},threadId:d.get("id"),token:d.get("token"),name:a}}],function(a){a.errorCode&&(b.Objects.Models.Status.message.setMessage(a.errorMessage||"Cannot rename"),c.set({name:e}))},!0),c.set({name:a}))}})})(Mibew);

View File

@ -1,10 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(c,e){var d=c.Models.BaseSurveyForm;c.Models.LeaveMessageForm=d.extend({defaults:e.extend({},d.prototype.defaults,{showCaptcha:!1,captcha:""}),validate:function(a){var b=c.Localization;if("undefined"!=typeof a.email){if(!a.email)return b.get("leavemessage.error.email.required");if(!c.Utils.checkEmail(a.email))return b.get("leavemessage.error.wrong.email")}if("undefined"!=typeof a.name&&!a.name)return b.get("leavemessage.error.name.required");if("undefined"!=typeof a.message&&!a.message)return b.get("leavemessage.error.message.required");
if(this.get("showCaptcha")&&"undefined"!=typeof a.captcha&&!a.captcha)return b.get("The letters you typed don't match the letters that were shown in the picture.")},submit:function(){if(!this.validate(this.attributes)){var a=this;c.Objects.server.callFunctions([{"function":"processLeaveMessage",arguments:{references:{},"return":{},groupId:a.get("groupId"),name:a.get("name"),info:a.get("info"),email:a.get("email"),message:a.get("message"),referrer:a.get("referrer"),captcha:a.get("captcha"),threadId:null,token:null}}],function(b){0==b.errorCode?a.trigger("submit:complete",
a):a.trigger("submit:error",a,{code:b.errorCode,message:b.errorMessage||""})},!0)}},ERROR_WRONG_CAPTCHA:10})})(Mibew,_);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a){a.Models.MessageForm=a.Models.Base.extend({defaults:{predefinedAnswers:[],ignoreCtrl:!1},postMessage:function(e){var b=a.Objects.Models.thread,c=a.Objects.Models.user;if(c.get("canPost")){this.trigger("before:post",this);var d=this;a.Objects.server.callFunctions([{"function":"post",arguments:{references:{},"return":{},message:e,threadId:b.get("id"),token:b.get("token"),user:!c.get("isAgent")}}],function(){d.trigger("after:post",d)},!0)}}})})(Mibew);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(b,a){b.Models.BaseSoundManager=a.Model.extend({defaults:{enabled:!0},play:function(a){this.get("enabled")&&b.Utils.playSound(a)}})})(Mibew,Backbone);

View File

@ -1,9 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,c){a.Models.ChatSoundManager=a.Models.BaseSoundManager.extend({defaults:c.extend({},a.Models.BaseSoundManager.prototype.defaults,{skipNextMessageSound:!1}),initialize:function(){var b=a.Objects,c=this;b.Collections.messages.on("multiple:add",this.playNewMessageSound,this);b.Models.messageForm.on("before:post",function(){c.set({skipNextMessageSound:!0})})},playNewMessageSound:function(){if(!this.get("skipNextMessageSound")){var b=a.Objects.Models.page.get("mibewRoot");"undefined"!==typeof b&&
this.play(b+"/sounds/new_message")}this.set({skipNextMessageSound:!1})}})})(Mibew,_);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(b,c){b.Models.Status=b.Models.Base.extend({defaults:{visible:!0,weight:0,hideTimeout:4E3,title:""},initialize:function(){this.hideTimer=null},autoHide:function(a){a=a||this.get("hideTimeout");this.hideTimer&&clearTimeout(this.hideTimer);this.hideTimer=setTimeout(c.bind(function(){this.set({visible:!1})},this),a)}})})(Mibew,_);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,b){a.Models.StatusMessage=a.Models.Status.extend({defaults:b.extend({},a.Models.Status.prototype.defaults,{message:"",visible:!1}),getModelType:function(){return"StatusMessage"},setMessage:function(a){this.set({message:a,visible:!0});this.autoHide()}})})(Mibew,_);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,b){a.Models.StatusTyping=a.Models.Status.extend({defaults:b.extend({},a.Models.Status.prototype.defaults,{visible:!1,hideTimeout:2E3}),getModelType:function(){return"StatusTyping"},show:function(){this.set({visible:!0});this.autoHide()}})})(Mibew,_);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a){a.Models.BaseSurveyForm=a.Models.Base.extend({defaults:{name:"",email:"",message:"",info:"",referrer:"",groupId:null,groups:null}})})(Mibew);

View File

@ -1,10 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(b,e){var d=b.Models.BaseSurveyForm;b.Models.SurveyForm=d.extend({defaults:e.extend({},d.prototype.defaults,{showEmail:!1,showMessage:!1,canChangeName:!1}),validate:function(a){if(this.get("showEmail")&&"undefined"!=typeof a.email&&!b.Utils.checkEmail(a.email))return b.Localization.get("Wrong email address.")},submit:function(){if(!this.validate(this.attributes)){var a=this;b.Objects.server.callFunctions([{"function":"processSurvey",arguments:{references:{},"return":{next:"next",options:"options"},
groupId:a.get("groupId"),name:a.get("name"),info:a.get("info"),email:a.get("email"),message:a.get("message"),referrer:a.get("referrer"),threadId:null,token:null}}],function(c){if(0==c.errorCode)switch(a.trigger("submit:complete",a),b.Application.Survey.stop(),c.next){case "chat":b.Application.Chat.start(c.options);break;case "leaveMessage":b.Application.LeaveMessage.start(c.options);break;default:throw Error("Do not know how to continue!");}else a.trigger("submit:error",a,{code:c.errorCode,message:c.errorMessage||
""})},!0)}}})})(Mibew,_);

View File

@ -1,14 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a){a.Objects.Models.Controls={};a.Objects.Models.Status={};var j=[],l=a.Application,k=l.module("Chat",{startWithParent:!1});k.addInitializer(function(b){var f=a.Objects,d=a.Objects.Models,c=a.Objects.Models.Controls,h=a.Objects.Models.Status;b.page&&d.page.set(b.page);d.thread=new a.Models.Thread(b.thread);d.user=new a.Models.ChatUser(b.user);var g=new a.Layouts.Chat;f.chatLayout=g;l.mainRegion.show(g);var e=new a.Collections.Controls;d.user.get("isAgent")||(c.userName=new a.Models.UserNameControl({weight:220}),
e.add(c.userName),c.sendMail=new a.Models.SendMailControl({weight:200,link:b.links.mail,windowParams:b.windowsParams.mail}),e.add(c.sendMail));d.user.get("isAgent")&&(c.redirect=new a.Models.RedirectControl({weight:200,link:b.links.redirect}),e.add(c.redirect),c.history=new a.Models.HistoryControl({weight:180,link:b.links.history,windowParams:b.windowsParams.history}),e.add(c.history));c.sound=new a.Models.SoundControl({weight:160});e.add(c.sound);c.refresh=new a.Models.RefreshControl({weight:140});
e.add(c.refresh);b.links.ssl&&(c.secureMode=new a.Models.SecureModeControl({weight:120,link:b.links.ssl}),e.add(c.secureMode));c.close=new a.Models.CloseControl({weight:100});e.add(c.close);f.Collections.controls=e;g.controlsRegion.show(new a.Views.ControlsCollection({collection:e}));h.message=new a.Models.StatusMessage({hideTimeout:5E3});h.typing=new a.Models.StatusTyping({hideTimeout:5E3});f.Collections.status=new a.Collections.Status([h.message,h.typing]);g.statusRegion.show(new a.Views.StatusCollection({collection:f.Collections.status}));
d.user.get("isAgent")||(d.avatar=new a.Models.Avatar,g.avatarRegion.show(new a.Views.Avatar({model:d.avatar})));f.Collections.messages=new a.Collections.Messages;d.messageForm=new a.Models.MessageForm(b.messageForm);g.messageFormRegion.show(new a.Views.MessageForm({model:d.messageForm}));g.messagesRegion.show(new a.Views.MessagesCollection({collection:f.Collections.messages}));d.soundManager=new a.Models.ChatSoundManager;j.push(f.server.callFunctionsPeriodically(function(){var b=a.Objects.Models.thread,
c=a.Objects.Models.user;return[{"function":"update",arguments:{"return":{typing:"typing",canPost:"canPost"},references:{},threadId:b.get("id"),token:b.get("token"),lastId:b.get("lastId"),typed:c.get("typing"),user:!c.get("isAgent")}}]},function(b){b.errorCode?a.Objects.Models.Status.message.setMessage(b.errorMessage||"refresh failed"):(b.typing&&a.Objects.Models.Status.typing.show(),a.Objects.Models.user.set({canPost:b.canPost||!1}))}))});k.on("start",function(){a.Objects.server.restartUpdater()});
k.addFinalizer(function(){a.Objects.chatLayout.close();for(var b=0;b<j.length;b++)a.Objects.server.stopCallFunctionsPeriodically(j[b]);"undefined"!=typeof a.Objects.Models.avatar&&a.Objects.Models.avatar.finalize();a.Objects.Collections.messages.finalize();delete a.Objects.chatLayout;delete a.Objects.Models.thread;delete a.Objects.Models.user;delete a.Objects.Models.page;delete a.Objects.Models.avatar;delete a.Objects.Models.messageForm;delete a.Objects.Models.Controls;delete a.Objects.Models.Status;
delete a.Objects.Collections.messages;delete a.Objects.Collections.controls;delete a.Objects.Collections.status})})(Mibew);

View File

@ -1,10 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a){var d=[],e=a.Application,b=e.module("Invitation",{startWithParent:!1});b.addInitializer(function(f){var c=a.Objects,b=a.Objects.Models;b.thread=new a.Models.Thread(f.thread);b.user=new a.Models.ChatUser(f.user);c.invitationLayout=new a.Layouts.Invitation;e.mainRegion.show(c.invitationLayout);c.Collections.messages=new a.Collections.Messages;c.invitationLayout.messagesRegion.show(new a.Views.MessagesCollection({collection:c.Collections.messages}));d.push(c.server.callFunctionsPeriodically(function(){var b=
a.Objects.Models.thread;return[{"function":"update",arguments:{"return":{},references:{},threadId:b.get("id"),token:b.get("token"),lastId:b.get("lastId"),typed:!1,user:!0}}]},function(){}))});b.on("start",function(){a.Objects.server.restartUpdater()});b.addFinalizer(function(){a.Objects.invitationLayout.close();for(var b=0;b<d.length;b++)a.Objects.server.stopCallFunctionsPeriodically(d[b]);a.Objects.Collections.messages.finalize();delete a.Objects.invitationLayout;delete a.Objects.Models.thread;delete a.Objects.Models.user;
delete a.Objects.Collections.messages})})(Mibew);

View File

@ -1,9 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a){var e=a.Application,f=e.module("LeaveMessage",{startWithParent:!1});f.addInitializer(function(d){var b=a.Objects,c=a.Objects.Models;d.page&&c.page.set(d.page);b.leaveMessageLayout=new a.Layouts.LeaveMessage;e.mainRegion.show(b.leaveMessageLayout);c.leaveMessageForm=new a.Models.LeaveMessageForm(d.leaveMessageForm);b.leaveMessageLayout.leaveMessageFormRegion.show(new a.Views.LeaveMessageForm({model:c.leaveMessageForm}));b.leaveMessageLayout.descriptionRegion.show(new a.Views.LeaveMessageDescription);
c.leaveMessageForm.on("submit:complete",function(){b.leaveMessageLayout.leaveMessageFormRegion.close();b.leaveMessageLayout.descriptionRegion.close();b.leaveMessageLayout.descriptionRegion.show(new a.Views.LeaveMessageSentDescription)})});f.addFinalizer(function(){a.Objects.leaveMessageLayout.close();delete a.Objects.Models.leaveMessageForm})})(Mibew);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a){var d=a.Application,b=d.module("Survey",{startWithParent:!1});b.addInitializer(function(b){var c=a.Objects,e=a.Objects.Models;c.surveyLayout=new a.Layouts.Survey;d.mainRegion.show(c.surveyLayout);e.surveyForm=new a.Models.SurveyForm(b.surveyForm);c.surveyLayout.surveyFormRegion.show(new a.Views.SurveyForm({model:e.surveyForm}))});b.addFinalizer(function(){a.Objects.surveyLayout.close();delete a.Objects.Models.surveyForm})})(Mibew);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,b){a.Regions.Messages=b.Marionette.Region.extend({onShow:function(a){a.on("after:item:added",this.scrollToBottom,this)},scrollToBottom:function(){this.$el.scrollTop(this.$el.prop("scrollHeight"))}})})(Mibew,Backbone);

View File

@ -1,403 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a){a.Regions={};a.Layouts={};a.Application=new Backbone.Marionette.Application})(Mibew);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
MibewAPIChatInteraction=function(){this.mandatoryArguments=function(){return{"*":{threadId:null,token:null,"return":{},references:{}},result:{errorCode:0}}};this.getReservedFunctionsNames=function(){return["result"]}};MibewAPIChatInteraction.prototype=new MibewAPIInteraction;
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(b,a){b.Models.BaseSoundManager=a.Model.extend({defaults:{enabled:!0},play:function(a){this.get("enabled")&&b.Utils.playSound(a)}})})(Mibew,Backbone);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(b,c){b.Models.Status=b.Models.Base.extend({defaults:{visible:!0,weight:0,hideTimeout:4E3,title:""},initialize:function(){this.hideTimer=null},autoHide:function(a){a=a||this.get("hideTimeout");this.hideTimer&&clearTimeout(this.hideTimer);this.hideTimer=setTimeout(c.bind(function(){this.set({visible:!1})},this),a)}})})(Mibew,_);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a){a.Models.BaseSurveyForm=a.Models.Base.extend({defaults:{name:"",email:"",message:"",info:"",referrer:"",groupId:null,groups:null}})})(Mibew);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(b,c){b.Models.Avatar=b.Models.Base.extend({defaults:{imageLink:!1},initialize:function(){this.registeredFunctions=[];this.registeredFunctions.push(b.Objects.server.registerFunction("setupAvatar",c.bind(this.apiSetupAvatar,this)))},finalize:function(){for(var a=0;a<this.registeredFunctions.length;a++)b.Objects.server.unregisterFunction(this.registeredFunctions[a])},apiSetupAvatar:function(a){a.imageLink&&this.set({imageLink:a.imageLink})}})})(Mibew,_);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,b){a.Models.ChatUser=a.Models.User.extend({defaults:b.extend({},a.Models.User.prototype.defaults,{canPost:!0,typing:!1,canChangeName:!1,dafaultName:!0})})})(Mibew,_);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a){a.Models.CloseControl=a.Models.Control.extend({getModelType:function(){return"CloseControl"},closeThread:function(){var b=a.Objects.Models.thread,c=a.Objects.Models.user;a.Objects.server.callFunctions([{"function":"close",arguments:{references:{},"return":{closed:"closed"},threadId:b.get("id"),token:b.get("token"),lastId:b.get("lastId"),user:!c.get("isAgent")}}],function(b){b.closed?window.close():a.Objects.Models.Status.message.setMessage(b.errorMessage||"Cannot close")},!0)}})})(Mibew);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,b){a.Models.HistoryControl=a.Models.Control.extend({defaults:b.extend({},a.Models.Control.prototype.defaults,{link:!1,windowParams:""}),getModelType:function(){return"HistoryControl"}})})(Mibew,_);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,b){a.Models.RedirectControl=a.Models.Control.extend({defaults:b.extend({},a.Models.Control.prototype.defaults,{link:!1}),getModelType:function(){return"RedirectControl"}})})(Mibew,_);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a){a.Models.RefreshControl=a.Models.Control.extend({getModelType:function(){return"RefreshControl"},refresh:function(){a.Objects.server.restartUpdater()}})})(Mibew);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,b){a.Models.SecureModeControl=a.Models.Control.extend({defaults:b.extend({},a.Models.Control.prototype.defaults,{link:!1}),getModelType:function(){return"SecureModeControl"}})})(Mibew,_);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,b){a.Models.SendMailControl=a.Models.Control.extend({defaults:b.extend({},a.Models.Control.prototype.defaults,{link:!1,windowParams:""}),getModelType:function(){return"SendMailControl"}})})(Mibew,_);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,c){a.Models.SoundControl=a.Models.Control.extend({defaults:c.extend({},a.Models.Control.prototype.defaults,{enabled:!0}),toggle:function(){var b=!this.get("enabled");a.Objects.Models.soundManager.set({enabled:b});this.set({enabled:b})},getModelType:function(){return"SoundControl"}})})(Mibew,_);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(b){b.Models.UserNameControl=b.Models.Control.extend({getModelType:function(){return"UserNameControl"},changeName:function(a){var c=b.Objects.Models.user,d=b.Objects.Models.thread,e=c.get("name");a&&e!=a&&(b.Objects.server.callFunctions([{"function":"rename",arguments:{references:{},"return":{},threadId:d.get("id"),token:d.get("token"),name:a}}],function(a){a.errorCode&&(b.Objects.Models.Status.message.setMessage(a.errorMessage||"Cannot rename"),c.set({name:e}))},!0),c.set({name:a}))}})})(Mibew);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(c,e){var d=c.Models.BaseSurveyForm;c.Models.LeaveMessageForm=d.extend({defaults:e.extend({},d.prototype.defaults,{showCaptcha:!1,captcha:""}),validate:function(a){var b=c.Localization;if("undefined"!=typeof a.email){if(!a.email)return b.get("leavemessage.error.email.required");if(!c.Utils.checkEmail(a.email))return b.get("leavemessage.error.wrong.email")}if("undefined"!=typeof a.name&&!a.name)return b.get("leavemessage.error.name.required");if("undefined"!=typeof a.message&&!a.message)return b.get("leavemessage.error.message.required");
if(this.get("showCaptcha")&&"undefined"!=typeof a.captcha&&!a.captcha)return b.get("The letters you typed don't match the letters that were shown in the picture.")},submit:function(){if(!this.validate(this.attributes)){var a=this;c.Objects.server.callFunctions([{"function":"processLeaveMessage",arguments:{references:{},"return":{},groupId:a.get("groupId"),name:a.get("name"),info:a.get("info"),email:a.get("email"),message:a.get("message"),referrer:a.get("referrer"),captcha:a.get("captcha"),threadId:null,token:null}}],function(b){0==b.errorCode?a.trigger("submit:complete",
a):a.trigger("submit:error",a,{code:b.errorCode,message:b.errorMessage||""})},!0)}},ERROR_WRONG_CAPTCHA:10})})(Mibew,_);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a){a.Models.MessageForm=a.Models.Base.extend({defaults:{predefinedAnswers:[],ignoreCtrl:!1},postMessage:function(e){var b=a.Objects.Models.thread,c=a.Objects.Models.user;if(c.get("canPost")){this.trigger("before:post",this);var d=this;a.Objects.server.callFunctions([{"function":"post",arguments:{references:{},"return":{},message:e,threadId:b.get("id"),token:b.get("token"),user:!c.get("isAgent")}}],function(){d.trigger("after:post",d)},!0)}}})})(Mibew);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,c){a.Models.ChatSoundManager=a.Models.BaseSoundManager.extend({defaults:c.extend({},a.Models.BaseSoundManager.prototype.defaults,{skipNextMessageSound:!1}),initialize:function(){var b=a.Objects,c=this;b.Collections.messages.on("multiple:add",this.playNewMessageSound,this);b.Models.messageForm.on("before:post",function(){c.set({skipNextMessageSound:!0})})},playNewMessageSound:function(){if(!this.get("skipNextMessageSound")){var b=a.Objects.Models.page.get("mibewRoot");"undefined"!==typeof b&&
this.play(b+"/sounds/new_message")}this.set({skipNextMessageSound:!1})}})})(Mibew,_);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,b){a.Models.StatusMessage=a.Models.Status.extend({defaults:b.extend({},a.Models.Status.prototype.defaults,{message:"",visible:!1}),getModelType:function(){return"StatusMessage"},setMessage:function(a){this.set({message:a,visible:!0});this.autoHide()}})})(Mibew,_);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,b){a.Models.StatusTyping=a.Models.Status.extend({defaults:b.extend({},a.Models.Status.prototype.defaults,{visible:!1,hideTimeout:2E3}),getModelType:function(){return"StatusTyping"},show:function(){this.set({visible:!0});this.autoHide()}})})(Mibew,_);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(b,e){var d=b.Models.BaseSurveyForm;b.Models.SurveyForm=d.extend({defaults:e.extend({},d.prototype.defaults,{showEmail:!1,showMessage:!1,canChangeName:!1}),validate:function(a){if(this.get("showEmail")&&"undefined"!=typeof a.email&&!b.Utils.checkEmail(a.email))return b.Localization.get("Wrong email address.")},submit:function(){if(!this.validate(this.attributes)){var a=this;b.Objects.server.callFunctions([{"function":"processSurvey",arguments:{references:{},"return":{next:"next",options:"options"},
groupId:a.get("groupId"),name:a.get("name"),info:a.get("info"),email:a.get("email"),message:a.get("message"),referrer:a.get("referrer"),threadId:null,token:null}}],function(c){if(0==c.errorCode)switch(a.trigger("submit:complete",a),b.Application.Survey.stop(),c.next){case "chat":b.Application.Chat.start(c.options);break;case "leaveMessage":b.Application.LeaveMessage.start(c.options);break;default:throw Error("Do not know how to continue!");}else a.trigger("submit:error",a,{code:c.errorCode,message:c.errorMessage||
""})},!0)}}})})(Mibew,_);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(b,d,j){b.Collections.Messages=d.Collection.extend({model:b.Models.Message,initialize:function(){this.periodicallyCalled=[];this.periodicallyCalled.push(b.Objects.server.callFunctionsPeriodically(j.bind(this.updateMessagesFunctionBuilder,this),j.bind(this.updateMessages,this)))},finalize:function(){for(var a=0;a<this.periodicallyCalled.length;a++)b.Objects.server.stopCallFunctionsPeriodically(this.periodicallyCalled[a])},updateMessages:function(a){a.lastId&&b.Objects.Models.thread.set({lastId:a.lastId});
for(var k=b.Models.Message.prototype.KIND_PLUGIN,g=[],c,f,e,h=0,d=a.messages.length;h<d;h++)c=a.messages[h],c.kind!=k?g.push(new b.Models.Message(c)):"object"!=typeof c.data||null===c.data||(f=c.plugin||!1,f="process:"+(!1!==f?f+":":"")+"plugin:message",e={messageData:c,model:!1},this.trigger(f,e),e.model&&(e.model.get("id")||e.model.set({id:c.id}),g.push(e.model)));0<g.length&&this.add(g)},updateMessagesFunctionBuilder:function(){var a=b.Objects.Models.thread,d=b.Objects.Models.user;return[{"function":"updateMessages",
arguments:{"return":{messages:"messages",lastId:"lastId"},references:{},threadId:a.get("id"),token:a.get("token"),lastId:a.get("lastId"),user:!d.get("isAgent")}}]},add:function(){var a=Array.prototype.slice.apply(arguments),a=d.Collection.prototype.add.apply(this,a);this.trigger("multiple:add");return a}})})(Mibew,Backbone,_);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,b){a.Collections.Status=b.Collection.extend({comparator:function(a){return a.get("weight")}})})(Mibew,Backbone);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,b,c){a.Views.Status=b.Marionette.ItemView.extend({template:c.templates.chat_status_base,className:"status",modelEvents:{change:"render"},onBeforeRender:function(){this.model.get("visible")?this.$el.show():this.$el.hide()}})})(Mibew,Backbone,Handlebars);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(c,d){c.Views.BaseSurveyForm=d.Marionette.ItemView.extend({events:{'change select[name="group"]':"changeGroupDescription","submit form":"preventSubmit"},ui:{groupSelect:'select[name="group"]',groupDescription:"#groupDescription",name:'input[name="name"]',email:'input[name="email"]',message:'textarea[name="message"]',errors:".errors",ajaxLoader:"#ajax-loader"},modelEvents:{invalid:"hideAjaxLoader showError","submit:error":"hideAjaxLoader showError"},preventSubmit:function(a){a.preventDefault()},
changeGroupDescription:function(){var a=this.ui.groupSelect.prop("selectedIndex"),a=this.model.get("groups")[a].description||"";this.ui.groupDescription.text(a)},showError:function(a,b){this.ui.errors.html("string"==typeof b?b:b.message)},serializeData:function(){var a=this.model.toJSON();a.page=c.Objects.Models.page.toJSON();return a},showAjaxLoader:function(){this.ui.ajaxLoader.show()},hideAjaxLoader:function(){this.ui.ajaxLoader.hide()}})})(Mibew,Backbone);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,b,c){a.Views.Avatar=b.Marionette.ItemView.extend({template:c.templates.chat_avatar,className:"avatar",modelEvents:{change:"render"}})})(Mibew,Backbone,Handlebars);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,c,d){a.Views.CloseControl=a.Views.Control.extend({template:c.templates.chat_controls_close,events:d.extend({},a.Views.Control.prototype.events,{click:"closeThread"}),closeThread:function(){var b=a.Localization.get("Are you sure want to leave chat?");(!1===b||confirm(b))&&this.model.closeThread()}})})(Mibew,Handlebars,_);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(b,d,e){b.Views.HistoryControl=b.Views.Control.extend({template:d.templates.chat_controls_history,events:e.extend({},b.Views.Control.prototype.events,{click:"showHistory"}),showHistory:function(){var c=b.Objects.Models.user,a=this.model.get("link");c.get("isAgent")&&a&&(c=this.model.get("windowParams"),a=a.replace("&amp;","&","g"),a=window.open(a,"UserHistory",c),null!==a&&(a.focus(),a.opener=window))}})})(Mibew,Handlebars,_);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(b,e,f){b.Views.RedirectControl=b.Views.Control.extend({template:e.templates.chat_controls_redirect,events:f.extend({},b.Views.Control.prototype.events,{click:"redirect"}),initialize:function(){b.Objects.Models.user.on("change",this.render,this)},serializeData:function(){var a=this.model.toJSON();a.user=b.Objects.Models.user.toJSON();return a},redirect:function(){var a=b.Objects.Models.user;if(a.get("isAgent")&&a.get("canPost")&&(a=this.model.get("link"))){var c=b.Objects.Models.page.get("style"),
d="";c&&(d=(-1===a.indexOf("?")?"?":"&")+"style="+c);window.location.href=a.replace(/\&amp\;/g,"&")+d}}})})(Mibew,Handlebars,_);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,b,c){a.Views.RefreshControl=a.Views.Control.extend({template:b.templates.chat_controls_refresh,events:c.extend({},a.Views.Control.prototype.events,{click:"refresh"}),refresh:function(){this.model.refresh()}})})(Mibew,Handlebars,_);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,d,e){a.Views.SecureModeControl=a.Views.Control.extend({template:d.templates.chat_controls_secure_mode,events:e.extend({},a.Views.Control.prototype.events,{click:"secure"}),secure:function(){var b=this.model.get("link");if(b){var c=a.Objects.Models.page.get("style");window.location.href=b.replace(/\&amp\;/g,"&")+(c?"&style="+c:"")}}})})(Mibew,Handlebars,_);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(b,d,f){b.Views.SendMailControl=b.Views.Control.extend({template:d.templates.chat_controls_send_mail,events:f.extend({},b.Views.Control.prototype.events,{click:"sendMail"}),sendMail:function(){var a=this.model.get("link"),c=b.Objects.Models.page;if(a){var d=this.model.get("windowParams"),c=c.get("style"),e="";c&&(e=(-1===a.indexOf("?")?"?":"&")+"style="+c);a=a.replace(/\&amp\;/g,"&")+e;a=window.open(a,"ForwardMail",d);null!==a&&(a.focus(),a.opener=window)}}})})(Mibew,Handlebars,_);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,b,c){a.Views.SoundControl=a.Views.Control.extend({template:b.templates.chat_controls_sound,events:c.extend({},a.Views.Control.prototype.events,{click:"toggle"}),toggle:function(){this.model.toggle()}})})(Mibew,Handlebars,_);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(b,c,d){b.Views.UserNameControl=b.Views.Control.extend({template:c.templates.chat_controls_user_name,events:d.extend({},b.Views.Control.prototype.events,{"click .user-name-control-set":"changeName","click .user-name-control-change":"showNameInput","keydown #user-name-control-input":"inputKeyDown"}),ui:{nameInput:"#user-name-control-input"},initialize:function(){b.Objects.Models.user.on("change:name",this.hideNameInput,this);this.nameInput=b.Objects.Models.user.get("defaultName")},serializeData:function(){var a=
this.model.toJSON();a.user=b.Objects.Models.user.toJSON();a.nameInput=this.nameInput;return a},inputKeyDown:function(a){a=a.which;(13==a||10==a)&&this.changeName()},hideNameInput:function(){this.nameInput=!1;this.render()},showNameInput:function(){this.nameInput=!0;this.render()},changeName:function(){var a=this.ui.nameInput.val();this.model.changeName(a)}})})(Mibew,Handlebars,_);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,b,c){a.Views.LeaveMessageDescription=b.Marionette.ItemView.extend({template:c.templates.leave_message_description,serializeData:function(){return{page:a.Objects.Models.page.toJSON()}}})})(Mibew,Backbone,Handlebars);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(d,e,b){var c=d.Views.BaseSurveyForm;d.Views.LeaveMessageForm=c.extend({template:e.templates.leave_message_form,events:b.extend({},c.prototype.events,{"click #send-message":"submitForm"}),ui:b.extend({},c.prototype.ui,{captcha:'input[name="captcha"]',captchaImg:"#captcha-img"}),modelEvents:b.extend({},c.prototype.modelEvents,{"submit:error":"hideAjaxLoader showError submitError"}),submitForm:function(){this.showAjaxLoader();var a={};this.model.get("groups")&&(a.groupId=this.ui.groupSelect.val());
a.name=this.ui.name.val()||"";a.email=this.ui.email.val()||"";a.message=this.ui.message.val()||"";this.model.get("showCaptcha")&&(a.captcha=this.ui.captcha.val()||"");this.model.set(a,{validate:!0});this.model.submit()},submitError:function(a,c){if(c.code==a.ERROR_WRONG_CAPTCHA&&a.get("showCaptcha")){var b=this.ui.captchaImg.attr("src"),b=b.replace(/\?d\=[0-9]+/,"");this.ui.captchaImg.attr("src",b+"?d="+(new Date).getTime())}}})})(Mibew,Handlebars,_);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,b,c){a.Views.LeaveMessageSentDescription=b.Marionette.ItemView.extend({template:c.templates.leave_message_sent_description,serializeData:function(){return{page:a.Objects.Models.page.toJSON()}}})})(Mibew,Backbone,Handlebars);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,b){a.Views.Message=a.Views.Message.extend({template:b.templates.chat_message})})(Mibew,Handlebars);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(b,d,e){b.Views.MessageForm=d.Marionette.ItemView.extend({template:e.templates.chat_message_form,events:{"click #send-message":"postMessage","keydown #message-input":"messageKeyDown","keyup #message-input":"checkUserTyping","change #message-input":"checkUserTyping","change #predefined":"selectPredefinedAnswer","focus #message-input":"setFocus","blur #message-input":"dropFocus"},modelEvents:{change:"render"},ui:{message:"#message-input",send:"#send-message",predefinedAnswer:"#predefined"},
initialize:function(){b.Objects.Models.user.on("change:canPost",this.render,this)},serializeData:function(){var a=this.model.toJSON();a.user=b.Objects.Models.user.toJSON();return a},postMessage:function(){var a=this.ui.message.val();""!=a&&(this.disableInput(),this.model.postMessage(a));b.Objects.Collections.messages.on("multiple:add",this.postMessageComplete,this)},messageKeyDown:function(a){var c=a.which;a=a.ctrlKey;(13==c&&(a||this.model.get("ignoreCtrl"))||10==c)&&this.postMessage()},enableInput:function(){this.ui.message.removeAttr("disabled")},
disableInput:function(){this.ui.message.attr("disabled","disabled")},clearInput:function(){this.ui.message.val("").change()},postMessageComplete:function(){this.clearInput();this.enableInput();this.focused&&this.ui.focus();b.Objects.Collections.messages.off("multiple:add",this.postMessageComplete,this)},selectPredefinedAnswer:function(){var a=this.ui.message,c=this.ui.predefinedAnswer,b=c.get(0).selectedIndex;b&&(a.val(this.model.get("predefinedAnswers")[b-1].full).change(),a.focus(),c.get(0).selectedIndex=
0)},checkUserTyping:function(){var a=b.Objects.Models.user,c=""!=this.ui.message.val();c!=a.get("typing")&&a.set({typing:c})},setFocus:function(){this.focused=!0},dropFocus:function(){this.focused=!1}})})(Mibew,Backbone,Handlebars);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,b){a.Views.StatusMessage=a.Views.Status.extend({template:b.templates.chat_status_message})})(Mibew,Handlebars);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,b){a.Views.StatusTyping=a.Views.Status.extend({template:b.templates.chat_status_typing})})(Mibew,Handlebars);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(b,d,e){var c=b.Views.BaseSurveyForm;b.Views.SurveyForm=c.extend({template:d.templates.survey_form,events:e.extend({},c.prototype.events,{"click #submit-survey":"submitForm"}),submitForm:function(){this.showAjaxLoader();var a={};this.model.get("groups")&&(a.groupId=this.ui.groupSelect.val());this.model.get("canChangeName")&&(a.name=this.ui.name.val()||"");this.model.get("showEmail")&&(a.email=this.ui.email.val()||"");this.model.get("showMessage")&&(a.message=this.ui.message.val()||"");this.model.set(a,
{validate:!0});this.model.submit()}})})(Mibew,Handlebars,_);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a){a.Views.MessagesCollection=a.Views.CollectionBase.extend({itemView:a.Views.Message,className:"messages-collection"})})(Mibew);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a){a.Views.StatusCollection=a.Views.CollectionBase.extend({itemView:a.Views.Status,className:"status-collection"})})(Mibew);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,b){a.Regions.Messages=b.Marionette.Region.extend({onShow:function(a){a.on("after:item:added",this.scrollToBottom,this)},scrollToBottom:function(){this.$el.scrollTop(this.$el.prop("scrollHeight"))}})})(Mibew,Backbone);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,c){a.Layouts.Chat=c.Marionette.Layout.extend({template:Handlebars.templates.chat_layout,regions:{controlsRegion:"#controls-region",avatarRegion:"#avatar-region",messagesRegion:{selector:"#messages-region",regionType:a.Regions.Messages},statusRegion:"#status-region",messageFormRegion:"#message-form-region"},serializeData:function(){var b=a.Objects.Models;return{page:b.page.toJSON(),user:b.user.toJSON()}}})})(Mibew,Backbone);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,b){a.Layouts.Invitation=b.Marionette.Layout.extend({template:Handlebars.templates.invitation_layout,regions:{messagesRegion:{selector:"#invitation-messages-region",regionType:a.Regions.Messages}}})})(Mibew,Backbone);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,b){a.Layouts.LeaveMessage=b.Marionette.Layout.extend({template:Handlebars.templates.leave_message_layout,regions:{leaveMessageFormRegion:"#content-wrapper",descriptionRegion:"#description-region"},serializeData:function(){return{page:a.Objects.Models.page.toJSON()}}})})(Mibew,Backbone);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,b){a.Layouts.Survey=b.Marionette.Layout.extend({template:Handlebars.templates.survey_layout,regions:{surveyFormRegion:"#content-wrapper"},serializeData:function(){return{page:a.Objects.Models.page.toJSON()}}})})(Mibew,Backbone);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a){a.Objects.Models.Controls={};a.Objects.Models.Status={};var j=[],l=a.Application,k=l.module("Chat",{startWithParent:!1});k.addInitializer(function(b){var f=a.Objects,d=a.Objects.Models,c=a.Objects.Models.Controls,h=a.Objects.Models.Status;b.page&&d.page.set(b.page);d.thread=new a.Models.Thread(b.thread);d.user=new a.Models.ChatUser(b.user);var g=new a.Layouts.Chat;f.chatLayout=g;l.mainRegion.show(g);var e=new a.Collections.Controls;d.user.get("isAgent")||(c.userName=new a.Models.UserNameControl({weight:220}),
e.add(c.userName),c.sendMail=new a.Models.SendMailControl({weight:200,link:b.links.mail,windowParams:b.windowsParams.mail}),e.add(c.sendMail));d.user.get("isAgent")&&(c.redirect=new a.Models.RedirectControl({weight:200,link:b.links.redirect}),e.add(c.redirect),c.history=new a.Models.HistoryControl({weight:180,link:b.links.history,windowParams:b.windowsParams.history}),e.add(c.history));c.sound=new a.Models.SoundControl({weight:160});e.add(c.sound);c.refresh=new a.Models.RefreshControl({weight:140});
e.add(c.refresh);b.links.ssl&&(c.secureMode=new a.Models.SecureModeControl({weight:120,link:b.links.ssl}),e.add(c.secureMode));c.close=new a.Models.CloseControl({weight:100});e.add(c.close);f.Collections.controls=e;g.controlsRegion.show(new a.Views.ControlsCollection({collection:e}));h.message=new a.Models.StatusMessage({hideTimeout:5E3});h.typing=new a.Models.StatusTyping({hideTimeout:5E3});f.Collections.status=new a.Collections.Status([h.message,h.typing]);g.statusRegion.show(new a.Views.StatusCollection({collection:f.Collections.status}));
d.user.get("isAgent")||(d.avatar=new a.Models.Avatar,g.avatarRegion.show(new a.Views.Avatar({model:d.avatar})));f.Collections.messages=new a.Collections.Messages;d.messageForm=new a.Models.MessageForm(b.messageForm);g.messageFormRegion.show(new a.Views.MessageForm({model:d.messageForm}));g.messagesRegion.show(new a.Views.MessagesCollection({collection:f.Collections.messages}));d.soundManager=new a.Models.ChatSoundManager;j.push(f.server.callFunctionsPeriodically(function(){var b=a.Objects.Models.thread,
c=a.Objects.Models.user;return[{"function":"update",arguments:{"return":{typing:"typing",canPost:"canPost"},references:{},threadId:b.get("id"),token:b.get("token"),lastId:b.get("lastId"),typed:c.get("typing"),user:!c.get("isAgent")}}]},function(b){b.errorCode?a.Objects.Models.Status.message.setMessage(b.errorMessage||"refresh failed"):(b.typing&&a.Objects.Models.Status.typing.show(),a.Objects.Models.user.set({canPost:b.canPost||!1}))}))});k.on("start",function(){a.Objects.server.restartUpdater()});
k.addFinalizer(function(){a.Objects.chatLayout.close();for(var b=0;b<j.length;b++)a.Objects.server.stopCallFunctionsPeriodically(j[b]);"undefined"!=typeof a.Objects.Models.avatar&&a.Objects.Models.avatar.finalize();a.Objects.Collections.messages.finalize();delete a.Objects.chatLayout;delete a.Objects.Models.thread;delete a.Objects.Models.user;delete a.Objects.Models.page;delete a.Objects.Models.avatar;delete a.Objects.Models.messageForm;delete a.Objects.Models.Controls;delete a.Objects.Models.Status;
delete a.Objects.Collections.messages;delete a.Objects.Collections.controls;delete a.Objects.Collections.status})})(Mibew);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a){var d=[],e=a.Application,b=e.module("Invitation",{startWithParent:!1});b.addInitializer(function(f){var c=a.Objects,b=a.Objects.Models;b.thread=new a.Models.Thread(f.thread);b.user=new a.Models.ChatUser(f.user);c.invitationLayout=new a.Layouts.Invitation;e.mainRegion.show(c.invitationLayout);c.Collections.messages=new a.Collections.Messages;c.invitationLayout.messagesRegion.show(new a.Views.MessagesCollection({collection:c.Collections.messages}));d.push(c.server.callFunctionsPeriodically(function(){var b=
a.Objects.Models.thread;return[{"function":"update",arguments:{"return":{},references:{},threadId:b.get("id"),token:b.get("token"),lastId:b.get("lastId"),typed:!1,user:!0}}]},function(){}))});b.on("start",function(){a.Objects.server.restartUpdater()});b.addFinalizer(function(){a.Objects.invitationLayout.close();for(var b=0;b<d.length;b++)a.Objects.server.stopCallFunctionsPeriodically(d[b]);a.Objects.Collections.messages.finalize();delete a.Objects.invitationLayout;delete a.Objects.Models.thread;delete a.Objects.Models.user;
delete a.Objects.Collections.messages})})(Mibew);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a){var e=a.Application,f=e.module("LeaveMessage",{startWithParent:!1});f.addInitializer(function(d){var b=a.Objects,c=a.Objects.Models;d.page&&c.page.set(d.page);b.leaveMessageLayout=new a.Layouts.LeaveMessage;e.mainRegion.show(b.leaveMessageLayout);c.leaveMessageForm=new a.Models.LeaveMessageForm(d.leaveMessageForm);b.leaveMessageLayout.leaveMessageFormRegion.show(new a.Views.LeaveMessageForm({model:c.leaveMessageForm}));b.leaveMessageLayout.descriptionRegion.show(new a.Views.LeaveMessageDescription);
c.leaveMessageForm.on("submit:complete",function(){b.leaveMessageLayout.leaveMessageFormRegion.close();b.leaveMessageLayout.descriptionRegion.close();b.leaveMessageLayout.descriptionRegion.show(new a.Views.LeaveMessageSentDescription)})});f.addFinalizer(function(){a.Objects.leaveMessageLayout.close();delete a.Objects.Models.leaveMessageForm})})(Mibew);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a){var d=a.Application,b=d.module("Survey",{startWithParent:!1});b.addInitializer(function(b){var c=a.Objects,e=a.Objects.Models;c.surveyLayout=new a.Layouts.Survey;d.mainRegion.show(c.surveyLayout);e.surveyForm=new a.Models.SurveyForm(b.surveyForm);c.surveyLayout.surveyFormRegion.show(new a.Views.SurveyForm({model:e.surveyForm}))});b.addFinalizer(function(){a.Objects.surveyLayout.close();delete a.Objects.Models.surveyForm})})(Mibew);
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(b,d){var c=b.Application;c.addRegions({mainRegion:"#main-region"});c.addInitializer(function(a){b.PluginOptions=a.plugins||{};b.Objects.server=new b.Server(d.extend({interactionType:MibewAPIChatInteraction},a.server));b.Objects.Models.page=new b.Models.Page(a.page);switch(a.startFrom){case "chat":c.Chat.start(a.chatOptions);break;case "survey":c.Survey.start(a.surveyOptions);break;case "leaveMessage":c.LeaveMessage.start(a.leaveMessageOptions);break;case "invitation":c.Invitation.start(a.invitationOptions);
break;default:throw Error("Dont know how to start!");}});c.on("start",function(){b.Objects.server.runUpdater()})})(Mibew,_);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(d,a,f){var e=function(b,a,c){c=f.extend({model:b},c);return"function"!=typeof b.getModelType?new a(c):(b=b.getModelType())&&d.Views[b]?new d.Views[b](c):new a(c)};d.Views.CollectionBase=a.Marionette.CollectionView.extend({itemView:a.Marionette.ItemView,buildItemView:e});d.Views.CompositeBase=a.Marionette.CompositeView.extend({buildItemView:e})})(Mibew,Backbone,_);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a){a.Views.ControlsCollection=a.Views.CollectionBase.extend({itemView:a.Views.Control,className:"controls-collection"})})(Mibew);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,b){a.Collections.Controls=b.Collection.extend({comparator:function(a){return a.get("weight")}})})(Mibew,Backbone);

View File

@ -1,10 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(e,c){c.registerHelper("apply",function(a,b){var f=a,e=/^[0-9A-z_]+$/;b=b.split(/\s*,\s*/);for(var d in b)if(b.hasOwnProperty(d)&&e.test(b[d])){if("function"!=typeof c.helpers[b[d]])throw Error("Unregistered helper '"+b[d]+"'!");f=c.helpers[b[d]](f).toString()}return new c.SafeString(f)});c.registerHelper("allowTags",function(a){a=a.replace(/&lt;(span|strong)&gt;(.*?)&lt;\/\1&gt;/g,"<$1>$2</$1>");a=a.replace(/&lt;span class=&quot;(.*?)&quot;&gt;(.*?)&lt;\/span&gt;/g,'<span class="$1">$2</span>');
return new c.SafeString(a)});c.registerHelper("formatTime",function(a){var b=new Date(1E3*a);a=b.getHours().toString();var c=b.getMinutes().toString(),b=b.getSeconds().toString();return(10>a?"0"+a:a)+":"+(10>c?"0"+c:c)+":"+(10>b?"0"+b:b)});c.registerHelper("urlReplace",function(a){return new c.SafeString(a.replace(/((?:https?|ftp):\/\/\S*)/g,'<a href="$1" target="_blank">$1</a>'))});c.registerHelper("nl2br",function(a){return new c.SafeString(a.replace(/\n/g,"<br/>"))});c.registerHelper("l10n",function(a){return e.Localization.get(a)||
""});c.registerHelper("ifEven",function(a,b){return 0===a%2?b.fn(this):b.inverse(this)});c.registerHelper("ifOdd",function(a,b){return 0!==a%2?b.fn(this):b.inverse(this)})})(Mibew,Handlebars);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
var Mibew={};(function(a,d,b){d.Marionette.TemplateCache.prototype.compileTemplate=function(a){return b.compile(a)};for(var c in b.templates)b.templates.hasOwnProperty(c)&&b.registerPartial(c,b.templates[c]);a.Models={};a.Collections={};a.Views={};a.Objects={};a.Objects.Models={};a.Objects.Collections={}})(Mibew,Backbone,Handlebars);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(b,d){b.Localization={};var c={};b.Localization.get=function(a){return!c.hasOwnProperty(a)?!1:c[a]};b.Localization.set=function(a){d.extend(c,a)}})(Mibew,_);

View File

@ -1,9 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(b,c,d){b.Views.Control=c.Marionette.ItemView.extend({template:d.templates.default_control,modelEvents:{change:"render"},events:{mouseover:"mouseOver",mouseleave:"mouseLeave"},attributes:function(){var a=[];a.push("control");this.className&&(a.push(this.className),this.className="");var b=this.getDashedControlType();b&&a.push(b);return{"class":a.join(" ")}},mouseOver:function(){var a=this.getDashedControlType();this.$el.addClass("active"+(a?"-"+a:""))},mouseLeave:function(){var a=this.getDashedControlType();
this.$el.removeClass("active"+(a?"-"+a:""))},getDashedControlType:function(){"undefined"==typeof this.dashedControlType&&(this.dashedControlType=b.Utils.toDashFormat(this.model.getModelType())||"");return this.dashedControlType}})})(Mibew,Backbone,Handlebars);

View File

@ -1,9 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(c,d,e){var f={"<":"&lt;",">":"&gt;","&":"&amp;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},g=/[&<>'"`]/g;c.Views.Message=d.Marionette.ItemView.extend({template:e.templates.message,className:"message",modelEvents:{change:"render"},serializeData:function(){var a=this.model.toJSON(),b=this.model.get("kind");a.allowFormatting=b!=this.model.KIND_USER&&b!=this.model.KIND_AGENT;a.kindName=this.kindToString(b);a.message=this.escapeString(a.message);return a},kindToString:function(a){return a==this.model.KIND_USER?
"user":a==this.model.KIND_AGENT?"agent":a==this.model.KIND_FOR_AGENT?"hidden":a==this.model.KIND_INFO?"inf":a==this.model.KIND_CONN?"conn":a==this.model.KIND_EVENTS?"event":a==this.model.KIND_PLUGIN?"plugin":""},escapeString:function(a){return a.replace(g,function(a){return f[a]||"&amp;"})}})})(Mibew,Backbone,Handlebars);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,b){a.Models.Base=b.Model.extend({getModelType:function(){return""}})})(Mibew,Backbone);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a){a.Models.Control=a.Models.Base.extend({defaults:{title:"",weight:0}})})(Mibew);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a){a.Models.Message=a.Models.Base.extend({defaults:{kind:null,created:0,name:"",message:"",plugin:"",data:{}},KIND_USER:1,KIND_AGENT:2,KIND_FOR_AGENT:3,KIND_INFO:4,KIND_CONN:5,KIND_EVENTS:6,KIND_PLUGIN:7})})(Mibew);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a,b){a.Models.Page=b.Model.extend()})(Mibew,Backbone);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a){a.Models.Thread=a.Models.Base.extend({defaults:{id:0,token:0,lastId:0,state:null},STATE_QUEUE:0,STATE_WAITING:1,STATE_CHATTING:2,STATE_CLOSED:3,STATE_LOADING:4,STATE_LEFT:5,STATE_INVITED:6})})(Mibew);

View File

@ -1,8 +0,0 @@
/*
Copyright 2005-2014 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
(function(a){a.Models.User=a.Models.Base.extend({defaults:{isAgent:!1,name:""}})})(Mibew);

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