Compare commits

...

132 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
536 changed files with 8121 additions and 675 deletions

16
.gitignore vendored
View File

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

View File

@ -11,7 +11,7 @@ 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.4 and above) with PDO, pdo_mysql, cURL, mbstring and gd extensions 2. PHP (7.2.5 and above) with PDO, pdo_mysql, cURL, mbstring and gd extensions
3. MySQL 5.0 and above 3. MySQL 5.0 and above
## Build from sources ## Build from sources

View File

@ -7,7 +7,7 @@
"jquery": "1.11.3", "jquery": "1.11.3",
"backbone": "1.1.2", "backbone": "1.1.2",
"marionette": "2.4.1", "marionette": "2.4.1",
"handlebars": "4.0.11", "handlebars": "4.3.0",
"vex": "2.3.2", "vex": "2.3.2",
"validator-js": "3.40.0" "validator-js": "3.40.0"
}, },

View File

@ -1,6 +1,6 @@
{ {
"name": "mibew/mibew", "name": "mibew/mibew",
"version": "3.2.1", "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": "https://mibew.org", "homepage": "https://mibew.org",
@ -17,25 +17,35 @@
"forum": "https://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": "~0.10.3", "mibew/handlebars.php": "~0.10.5",
"justblackbird/handlebars.php-helpers": "1.*", "mibew/handlebars.php-helpers": "1.*",
"symfony/http-foundation": "2.6.*", "symfony/http-foundation": "4.4.*",
"symfony/routing": "2.6.*", "symfony/routing": "4.4.*",
"symfony/config": "2.6.*", "symfony/config": "4.4.*",
"symfony/yaml": "2.6.*", "symfony/yaml": "^5.2",
"symfony/translation": "2.6.*", "symfony/translation": "2.6.*",
"tedivm/stash": "0.12.*", "tedivm/stash": "0.12.*",
"canteen/html5": "1.1.*", "mibew/html5": "1.1.*",
"vierbergenlars/php-semver": "3.0.*", "vierbergenlars/php-semver": "3.0.*",
"swiftmailer/swiftmailer": "~5.4.0", "swiftmailer/swiftmailer": "~5.4.0",
"ua-parser/uap-php": "~3.4.1", "ua-parser/uap-php": "^3.9",
"true/punycode": "~1.1" "true/punycode": "~1.1"
}, },
"require-dev": { "require-dev": {
"squizlabs/php_codesniffer": "~2.3.3" "squizlabs/php_codesniffer": "3.*"
}, },
"config": { "config": {
"vendor-dir": "mibew/vendor" "vendor-dir": "mibew/vendor"
} }
} }

View File

@ -3,7 +3,7 @@ var fs = require('fs'),
https = require('https'), https = require('https'),
exec = require('child_process').exec, exec = require('child_process').exec,
eventStream = require('event-stream'), eventStream = require('event-stream'),
runSequence = require('run-sequence'), runSequence = require('gulp4-run-sequence'),
through = require('through2'), through = require('through2'),
lodash = require('lodash'), lodash = require('lodash'),
PoFile = require('pofile'), PoFile = require('pofile'),
@ -59,7 +59,7 @@ config.i18nSuffix = '-' + config.package.version + '-' + strftime('%Y%m%d');
// Cleans all built files // Cleans all built files
gulp.task('clean', function(callback) { gulp.task('clean', function(callback) {
del([ return del([
config.releasePath, config.releasePath,
'composer.lock', 'composer.lock',
config.phpVendorPath, config.phpVendorPath,
@ -73,18 +73,18 @@ gulp.task('clean', function(callback) {
}); });
// Cleans temporary English translation in the release dir // Cleans temporary English translation in the release dir
gulp.task('clean-tmp-po', function() { gulp.task('clean-tmp-po', function(callback) {
return del([config.releasePath + '/translation.po']); return del([config.releasePath + '/translation.po'], callback);
}); });
// Cleans temporary files of translations in the release dir // Cleans temporary files of translations in the release dir
gulp.task('clean-tmp-i18n-files', function() { gulp.task('clean-tmp-i18n-files', function(callback) {
return del([ return del([
config.releasePath + '/**/*', config.releasePath + '/**/*',
'!' + config.releasePath + '/*.zip', '!' + config.releasePath + '/*.zip',
'!' + config.releasePath + '/*.tar.gz', '!' + config.releasePath + '/*.tar.gz',
'!' + config.releasePath + '/*.pot' '!' + config.releasePath + '/*.pot'
]); ], callback);
}); });
// Cleans all files prepared for uploading to CDN // Cleans all files prepared for uploading to CDN
@ -98,46 +98,14 @@ gulp.task('clean-all', function(callback) {
callback ); callback );
}); });
// Tasks for checking //////////////////
// Checks all PHP files with PHP Code Sniffer
gulp.task('phpcs', ['composer-install-dev'], function() {
return gulp.src([
config.mibewPath + '/**/*.php',
'!' + config.phpVendorPath + '/**/*.*',
'!' + config.pluginsPath + '/**/*.*',
'!' + config.cachePath + '/**/*.*'
], {
// Content of the cache directory is readable only for webserver.
// Thus we must to set "strict" option to false to prevent "EACCES"
// errors. At the same we need to see all errors that take place.
strict: false,
silent: false
})
.pipe(phpcs({
bin: config.phpVendorPath + '/bin/phpcs',
standard: 'PSR2',
warningSeverity: 0
}))
.pipe(phpcs.reporter('log'))
.pipe(phpcs.reporter('fail'));
});
// 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());
});
// Watcher tasks /////////////////////// // Watcher tasks ///////////////////////
// Watch styles // Watch styles
gulp.task('watch', [], function(){ gulp.task('watch', function() {
gulp.watch(config.pageStylesPath + '/**/*.handlebars', ['page-styles']); gulp.watch(config.pageStylesPath + '/**/*.handlebars', gulp.series('page-styles'));
gulp.watch(config.chatStylesPath + '/**/js/source/**/*.js', ['chat-styles-js']); gulp.watch(config.chatStylesPath + '/**/js/source/**/*.js', gulp.series('chat-styles-js'));
gulp.watch(config.chatStylesPath + '/**/*.handlebars', ['chat-styles-handlebars']); gulp.watch(config.chatStylesPath + '/**/*.handlebars', gulp.series('chat-styles-handlebars'));
}); });
// Service tasks ////////////////// // Service tasks //////////////////
@ -162,20 +130,20 @@ gulp.task('get-composer', function(callback) {
}); });
// Install Composer dependencies excluding development ones // Install Composer dependencies excluding development ones
gulp.task('composer-install', ['get-composer'], function(callback) { gulp.task('composer-install', gulp.series('get-composer', function(callback) {
exec(config.phpBin + ' composer.phar install --no-dev', exec(config.phpBin + ' composer.phar install --no-dev',
function(error, stdout, stderr) { function(error, stdout, stderr) {
callback(error ? stderr : null); callback(error ? stderr : null);
}); });
}); }));
// Install all Composer dependencies // Install all Composer dependencies
gulp.task('composer-install-dev', ['get-composer'], function(callback) { gulp.task('composer-install-dev', gulp.series('get-composer', function(callback) {
exec(config.phpBin + ' composer.phar install', exec(config.phpBin + ' composer.phar install',
function(error, stdout, stderr) { function(error, stdout, stderr) {
callback(error ? stderr : null); callback(error ? stderr : null);
}); });
}); }));
// Installs bower dependencies // Installs bower dependencies
gulp.task('bower-install', function(callback) { gulp.task('bower-install', function(callback) {
@ -218,6 +186,40 @@ gulp.task('bower-install', function(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 // Restore empty English translation in the source code
gulp.task('post-pack-cleanup', function(callback) { gulp.task('post-pack-cleanup', function(callback) {
gulp.src('translation.po') gulp.src('translation.po')
@ -312,9 +314,7 @@ gulp.task('page-styles', function() {
}); });
// Performs all job related to chat styles // Performs all job related to chat styles
gulp.task('chat-styles', ['chat-styles-handlebars', 'chat-styles-js'], function() { gulp.task('chat-styles', gulp.series('chat-styles-handlebars', 'chat-styles-js'));
// This task is just a combination of other tasks, there is no real code.
});
// Prepares ready to use development version of Mibew Messenger without // Prepares ready to use development version of Mibew Messenger without
// packing or validating it // packing or validating it
@ -386,7 +386,7 @@ gulp.task('generate-pot', function() {
}); });
// Generate temporary English translation to be used in the release // Generate temporary English translation to be used in the release
gulp.task('generate-tmp-po', ['generate-pot'], function(callback) { gulp.task('generate-tmp-po', gulp.series('generate-pot', function(callback) {
return exec(config.msginit + ' --no-translator --no-wrap -i ' return exec(config.msginit + ' --no-translator --no-wrap -i '
+ config.releasePath + '/' + config.i18nPrefix + 'translation' + config.releasePath + '/' + config.i18nPrefix + 'translation'
+ config.i18nSuffix + '.pot' + ' -l en -o ' + config.i18nSuffix + '.pot' + ' -l en -o '
@ -394,11 +394,11 @@ gulp.task('generate-tmp-po', ['generate-pot'], function(callback) {
function(error, stdout, stderr) { function(error, stdout, stderr) {
callback(error ? stderr : null); callback(error ? stderr : null);
}); });
}); }));
// Generate complete translations (that includes missed strings) to be used // Generate complete translations (that includes missed strings) to be used
// in the release // in the release
gulp.task('generate-pos', ['generate-tmp-po'], function(callback) { gulp.task('generate-pos', gulp.series('generate-tmp-po', function(callback) {
return getChildDirs(config.i18nPath + '/translations') return getChildDirs(config.i18nPath + '/translations')
.then(function (dirs) { .then(function (dirs) {
@ -433,12 +433,12 @@ gulp.task('generate-pos', ['generate-tmp-po'], function(callback) {
}); });
})); }));
}); });
}); }));
// Packaging tasks ///////////////////// // Packaging tasks /////////////////////
// Pack sources for release as .zip and .tar.gz archives // Pack sources for release as .zip and .tar.gz archives
gulp.task('pack-sources', ['composer-install', 'bower-install'], function() { gulp.task('pack-sources', gulp.series('composer-install', 'bower-install', function() {
gulp.src(config.mibewPath + '/locales/en/translation.po') gulp.src(config.mibewPath + '/locales/en/translation.po')
.pipe(gulp.dest('.')); .pipe(gulp.dest('.'));
gulp.src(config.releasePath + '/translation.po') gulp.src(config.releasePath + '/translation.po')
@ -507,7 +507,7 @@ gulp.task('pack-sources', ['composer-install', 'bower-install'], function() {
) )
.pipe(chmod(644)) .pipe(chmod(644))
.pipe(gulp.dest(config.releasePath)); .pipe(gulp.dest(config.releasePath));
}); }));
// Pack translations for release as .zip and .tar.gz archives // Pack translations for release as .zip and .tar.gz archives
gulp.task('pack-i18n', function(callback) { gulp.task('pack-i18n', function(callback) {
@ -598,9 +598,9 @@ gulp.task('prepare-all', function(callback) {
gulp.task('default', function(callback) { gulp.task('default', function(callback) {
runSequence( runSequence(
'clean', 'clean',
['js', 'chat-styles', 'page-styles'], ['js', 'chat-styles', 'page-styles', 'generate-tmp-po'],
'pack-sources', 'pack-sources',
'post-pack-cleanup', ['post-pack-cleanup', 'clean-tmp-po'],
callback callback
); );
}); });
@ -698,7 +698,7 @@ var xgettextHandlebars = function() {
} }
// Update file contents // Update file contents
file.contents = new Buffer(po.toString()); file.contents = Buffer.from(po.toString());
this.push(file); this.push(file);
callback(); callback();

@ -1 +1 @@
Subproject commit f8684c36a26beec315bb774ae57f91564bbd8905 Subproject commit 55868d9973f531c3550575481bde4233cc625b91

View File

@ -1,12 +1,12 @@
Mibew Messenger Mibew Messenger
Copyright 2005-2018 the original author or authors. Copyright 2005-2023 the original author or authors.
REQUIREMENTS REQUIREMENTS
* Apache web server 1.3.34 or above with the ability to use local .htaccess * Apache web server 1.3.34 or above with the ability to use local .htaccess
files (mod_rewrite module is optional, but recommended) files (mod_rewrite module is optional, but recommended)
* MySQL database 5.0 or above * MySQL database 5.0 or above
* PHP 5.4 or above with PDO, pdo_mysql, cURL, mbstring and gd extensions * PHP 7.2.5 or above with PDO, pdo_mysql, cURL, mbstring and gd extensions
INSTALLATION INSTALLATION

View File

@ -1 +1 @@
Mibew/3.2.1 Mibew/3.6.0

View File

@ -102,6 +102,11 @@ chat_user_start:
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
@ -372,7 +377,7 @@ 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: locale_edit:
path: /operator/locale/{locale}/edit path: /operator/locale/{locale}/edit
@ -381,7 +386,7 @@ locale_edit:
_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}"
methods: [GET] methods: [GET]
locale_edit_save: locale_edit_save:
@ -391,7 +396,7 @@ locale_edit_save:
_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}"
methods: [POST] methods: [POST]
locale_enable: locale_enable:
@ -401,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
@ -716,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:
@ -726,7 +731,7 @@ 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] methods: [POST]
translation_export: translation_export:

View File

@ -2,7 +2,7 @@
/* /*
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -2,7 +2,7 @@
/* /*
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -2,7 +2,7 @@
/* /*
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -2,7 +2,7 @@
/* /*
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

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

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.
@ -45,7 +45,7 @@
), ),
/** /**
* Dispalay history window * Display history window
*/ */
showHistory: function() { showHistory: function() {
var user = Mibew.Objects.Models.user; var user = Mibew.Objects.Models.user;

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.
@ -48,14 +48,18 @@
* Move to secure chat * Move to secure chat
*/ */
secure: function() { secure: function() {
if (window.location.protocol == 'https:') {
return;
}
var link = this.model.get('link'); var link = this.model.get('link');
if (link) { if (link) {
var style = Mibew.Objects.Models.page.get('style'); var style = Mibew.Objects.Models.page.get('style');
window.location.href = link.replace(/\&amp\;/g, '&') window.location.href = link.replace(/\&amp\;/g, '&')
+ (style ? ('&style=' + style) : ''); + (style ? ((link.indexOf('?') > -1 ? '&' : '?')
+ 'style=' + style) : '');
} }
} }
} }
); );
})(Mibew, Handlebars, _); })(Mibew, Handlebars, _);

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.
@ -44,6 +44,17 @@
} }
), ),
/**
* Override Backbone.Marionette.ItemView.serializeData to pass some
* extra fields to template.
* @returns {Object} Template data
*/
serializeData: function() {
var data = this.model.toJSON();
data.user = Mibew.Objects.Models.user.toJSON();
return data;
},
/** /**
* Load and display send mail window * Load and display send mail window
*/ */

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

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

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.
@ -39,7 +39,7 @@
*/ */
ui: { ui: {
groupSelect: 'select[name="group"]', groupSelect: 'select[name="group"]',
groupDescription: '#groupDescription', groupDescription: '#group-description',
name: 'input[name="name"]', name: 'input[name="name"]',
email: 'input[name="email"]', email: 'input[name="email"]',
message: 'textarea[name="message"]', message: 'textarea[name="message"]',

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.
@ -57,7 +57,7 @@
* Not applicable for agents. * Not applicable for agents.
* @type Boolean * @type Boolean
*/ */
dafaultName: true defaultName: true
} }
) )
} }

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

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

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.
@ -101,6 +101,15 @@
windowParams: options.windowsParams.history windowParams: options.windowsParams.history
}); });
ctrlsCollection.add(controls.history); ctrlsCollection.add(controls.history);
if (options.links.tracked) {
controls.tracked_path = new Mibew.Models.TrackedPathControl({
weight: 170,
link: options.links.tracked,
windowParams: options.windowsParams.trackedPath
});
ctrlsCollection.add(controls.tracked_path);
}
} }
// Create toggle sound button // Create toggle sound button

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.
@ -57,11 +57,27 @@ var Mibew = Mibew || {};
* omitted a session cookie will be created. * omitted a session cookie will be created.
*/ */
Mibew.Utils.createCookie = function(name, value, expires) { Mibew.Utils.createCookie = function(name, value, expires) {
var domain = /([^\.]+\.[^\.]+)$/.exec(document.location.hostname); if (navigator.cookieEnabled) {
document.cookie = "" + name + "=" + value + "; " var domain_parts = document.location.hostname.split('.').reverse();
+ "path=/; " var domain = domain_parts[0];
+ (domain ? ("domain=" + domain[1] + "; ") : '') var position = 0;
+ (expires ? ('expires=' + expires.toUTCString() + '; ') : ''); do {
document.cookie = "" + name + "=" + value + "; "
+ "path=/; "
+ (document.location.protocol == 'https:' ? "SameSite=None; secure; " : '')
+ "domain=" + (Mibew.Utils.cookiesDomain || domain) + "; "
+ (expires ? ('expires=' + expires.toUTCString() + '; ') : '');
if (Mibew.Utils.readCookie(name) == value) {
if (!Mibew.Utils.cookiesDomain) {
Mibew.Utils.cookiesDomain = domain;
}
}
else {
position++;
domain = domain_parts[position] + '.' + domain;
}
} while((position < domain_parts.length) && !Mibew.Utils.cookiesDomain);
}
}; };
/** /**
@ -298,6 +314,12 @@ var Mibew = Mibew || {};
// Call parent constructor. // Call parent constructor.
BasePopup.call(this, options); BasePopup.call(this, options);
/**
* Store options in case we need some of them later.
* @type {Object}
*/
this.options = options;
/** /**
* Wrapper for popup iframe DOM Element. * Wrapper for popup iframe DOM Element.
* @type {Node} * @type {Node}
@ -328,6 +350,12 @@ var Mibew = Mibew || {};
*/ */
this.isMinified = false; this.isMinified = false;
/**
* Indicates if cookies are blocked.
* @type {Boolean}
*/
this.cookiesBlocked = false;
// Load default styles. These styles hide the popup while real styles // Load default styles. These styles hide the popup while real styles
// are loading. // are loading.
this.attachDefaultStyles(); this.attachDefaultStyles();
@ -341,6 +369,18 @@ var Mibew = Mibew || {};
// new page is visited. // new page is visited.
this.safeOpen(openedChatUrl); this.safeOpen(openedChatUrl);
} }
// Check if it's possible to set cookies at all
var rnd = Math.random();
Mibew.Utils.createCookie('mibewCheckToken', rnd);
var checkCookiesBlock = Mibew.Utils.loadScript(options.url.split('?')[0] + '/cookies-set-permission' + '?rnd=' + rnd);
checkCookiesBlock.popup = this;
checkCookiesBlock.onload = function() {
this.popup.cookiesBlocked = false;
};
checkCookiesBlock.onerror = function() {
this.popup.cookiesBlocked = true;
};
}; };
// Set correct prototype chain for IFrame popup. // Set correct prototype chain for IFrame popup.
@ -391,6 +431,14 @@ var Mibew = Mibew || {};
return; return;
} }
if (this.cookiesBlocked) {
// Last resort. Replace this iframe-based popup with window-based popup
// and try to open a chat in a separate window.
Mibew.Objects.ChatPopups[this.id] = new Mibew.ChatPopup.Window(this.options);
Mibew.Objects.ChatPopups[this.id].open(url);
return;
}
if (!this.wrapperDiv) { if (!this.wrapperDiv) {
// Create new iframe and its wrapper. // Create new iframe and its wrapper.
// There is a bug in IE <= 7 that make "name" attribute unchangeble // There is a bug in IE <= 7 that make "name" attribute unchangeble
@ -416,7 +464,7 @@ var Mibew = Mibew || {};
this.toggleDiv.className = 'mibew-chat-frame-toggle mibew-chat-frame-toggle-on'; this.toggleDiv.className = 'mibew-chat-frame-toggle mibew-chat-frame-toggle-on';
Mibew.Utils.addEventListener(this.toggleDiv, 'click', function(event) { Mibew.Utils.addEventListener(this.toggleDiv, 'click', function(event) {
var popups = Mibew.Objects.ChatPopups, var popups = Mibew.Objects.ChatPopups,
matches = /^mibew-chat-frame-toggle-([0-9A-Za-z]+)$/.exec(this.id); matches = /^mibew-chat-frame-toggle-([0-9A-Za-z]+)$/.exec(this.id);
if (matches && popups[matches[1]]) { if (matches && popups[matches[1]]) {
popups[matches[1]].toggle(); popups[matches[1]].toggle();
@ -473,7 +521,7 @@ var Mibew = Mibew || {};
this.isOpened = false; this.isOpened = false;
this.toggleDiv.style.display = 'none'; this.toggleDiv.style.display = 'none';
Mibew.Utils.deleteCookie('mibew-chat-frame-' + this.id); Mibew.Utils.deleteCookie('mibew-chat-frame-' + this.id);
Mibew.Utils.deleteCookie('mibew-chat-frame-minified' + this.id); Mibew.Utils.deleteCookie('mibew-chat-frame-minified-' + this.id);
}; };
/** /**
@ -510,6 +558,10 @@ var Mibew = Mibew || {};
* value is omitted, the chat initialization URL will be loaded. * value is omitted, the chat initialization URL will be loaded.
*/ */
Mibew.ChatPopup.Window.prototype.open = function(url) { Mibew.ChatPopup.Window.prototype.open = function(url) {
// Windows is already opened, nothing to do.
if (this.window != null && !this.window.closed) {
return;
}
this.window = window.open( this.window = window.open(
url || this.buildChatUrl(), url || this.buildChatUrl(),
'mibewChat' + this.id, 'mibewChat' + this.id,

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.
@ -41,7 +41,7 @@
/** /**
* Register 'urlReplace' Handlebars helper. * Register 'urlReplace' Handlebars helper.
* *
* This helper serch URLs and replace them by 'a' tag * This helper seeks URLs and replaces them by 'a' tag
*/ */
Handlebars.registerHelper('urlReplace', function(text) { Handlebars.registerHelper('urlReplace', function(text) {
return new Handlebars.SafeString( return new Handlebars.SafeString(

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.
@ -41,6 +41,8 @@
// Pause before restarting updater using Server.restartUpdater // Pause before restarting updater using Server.restartUpdater
// function (in seconds) // function (in seconds)
reconnectPause: 1, reconnectPause: 1,
// Call on successful response
onReceiveResponse: function() {},
// Call on request timeout // Call on request timeout
onTimeout: function() {}, onTimeout: function() {},
// Call when transport error was caught // Call when transport error was caught
@ -371,6 +373,8 @@
* @private * @private
*/ */
Mibew.Server.prototype.receiveResponse = function(data, textStatus, jqXHR) { Mibew.Server.prototype.receiveResponse = function(data, textStatus, jqXHR) {
// Call hook on successful request
this.options.onReceiveResponse();
// Do not parse empty responses // Do not parse empty responses
if (data == '') { if (data == '') {
this.updateAfter(this.options.requestsFrequency); this.updateAfter(this.options.requestsFrequency);

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.
@ -102,7 +102,7 @@
}; };
/** /**
* Play .wav or .mp3 sound file * Play .wav, or .mp3, or .ogg sound file
* @param {String} file File path (without extension) * @param {String} file File path (without extension)
*/ */
Mibew.Utils.playSound = function (file) { Mibew.Utils.playSound = function (file) {
@ -114,6 +114,7 @@
var audioTag = $("<audio>", {autoplay: true, style: "display: none"}).append( var audioTag = $("<audio>", {autoplay: true, style: "display: none"}).append(
'<source src="' + file + '.wav" type="audio/x-wav" />' + '<source src="' + file + '.wav" type="audio/x-wav" />' +
'<source src="' + file + '.mp3" type="audio/mpeg" codecs="mp3" />' + '<source src="' + file + '.mp3" type="audio/mpeg" codecs="mp3" />' +
'<source src="' + file + '.ogg" type="audio/ogg" codecs="vorbis" />' +
'<embed src="' + file + '.wav" type="audio/x-wav" hidden="true" autostart="true" loop="false" />' '<embed src="' + file + '.wav" type="audio/x-wav" hidden="true" autostart="true" loop="false" />'
); );
$('body').append(audioTag); $('body').append(audioTag);
@ -172,6 +173,21 @@
return (vex.getAllVexes().length > 0); return (vex.getAllVexes().length > 0);
}; };
/**
* Sanitize message used in Vex dialog
* @type {Function}
* @param {String} message A message to sanitize.
* @returns {String}
*/
var sanitizeMessage = function(message) {
return message.replace(/&/g, "&amp;")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/"/g, "&quot;")
.replace(/'/g, "&#039;");
};
/** /**
* Alerts a message. * Alerts a message.
* @param {String} message A message that should be displayed. * @param {String} message A message that should be displayed.
@ -182,7 +198,7 @@
// Do not open alert if one already opened. // Do not open alert if one already opened.
return; return;
} }
vex.dialog.alert({message: message}); return vex.dialog.alert({message: sanitizeMessage(message)});
}; };
/** /**
@ -195,7 +211,7 @@
Mibew.Utils.confirm = function(message, callback) { Mibew.Utils.confirm = function(message, callback) {
setVexDefaults(); setVexDefaults();
vex.dialog.confirm({ vex.dialog.confirm({
message: message, message: sanitizeMessage(message),
callback: callback callback: callback
}); });
}; };
@ -210,9 +226,17 @@
Mibew.Utils.prompt = function(message, callback) { Mibew.Utils.prompt = function(message, callback) {
setVexDefaults(); setVexDefaults();
vex.dialog.prompt({ vex.dialog.prompt({
message: message, message: sanitizeMessage(message),
callback: callback callback: callback
}); });
}; };
/**
* Close alert.
* @param {Object} alert instance.
*/
Mibew.Utils.closeAlert = function(alertInstance) {
var res = vex.close(alertInstance.id);
};
})(Mibew, jQuery, _, vex, validator); })(Mibew, jQuery, _, vex, validator);

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.
@ -17,6 +17,14 @@
*/ */
(function($) { (function($) {
function updateSendEmail() {
if ($("#user-can-send-email").is(":checked")) {
$(".under-user-can-send-email").show();
} else {
$(".under-user-can-send-email").hide();
}
}
function updateSurvey() { function updateSurvey() {
if ($("#enable-presurvey").is(":checked")) { if ($("#enable-presurvey").is(":checked")) {
$(".under-survey").show(); $(".under-survey").show();
@ -58,6 +66,9 @@
} }
$(function() { $(function() {
$("#user-can-send-email").change(function() {
updateSendEmail();
});
$("#enable-presurvey").change(function() { $("#enable-presurvey").change(function() {
updateSurvey(); updateSurvey();
}); });
@ -73,6 +84,7 @@
$("#enable-privacy-policy").change(function() { $("#enable-privacy-policy").change(function() {
updatePrivacyPolicy(); updatePrivacyPolicy();
}); });
updateSendEmail();
updateSurvey(); updateSurvey();
updateSSL(); updateSSL();
updateGroups(); updateGroups();

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.
@ -91,7 +91,7 @@ MibewAPI.prototype.checkFunction = function(functionObject, filterReservedFuncti
// Work with own properties only. // Work with own properties only.
continue; continue;
} }
for (var i = 0; i < mandatoryArgumentsList.length; i++) { for (i = 0; i < mandatoryArgumentsList.length; i++) {
if (argName == mandatoryArgumentsList[i]) { if (argName == mandatoryArgumentsList[i]) {
mandatoryArgumentsCount++; mandatoryArgumentsCount++;
continue argumentsLoop; continue argumentsLoop;
@ -358,7 +358,7 @@ MibewAPIInteraction.prototype.getMandatoryArguments = function(functionName) {
} }
// Add mandatory arguments for given function // Add mandatory arguments for given function
if (typeof allMandatoryArguments[functionName] == 'object') { if (typeof allMandatoryArguments[functionName] == 'object') {
for (var arg in allMandatoryArguments[functionName]) { for (arg in allMandatoryArguments[functionName]) {
if (! allMandatoryArguments[functionName].hasOwnProperty(arg)) { if (! allMandatoryArguments[functionName].hasOwnProperty(arg)) {
continue; continue;
} }
@ -389,7 +389,7 @@ MibewAPIInteraction.prototype.getMandatoryArgumentsDefaults = function(functionN
} }
// Add mandatory arguments for given function // Add mandatory arguments for given function
if (typeof allMandatoryArguments[functionName] == 'object') { if (typeof allMandatoryArguments[functionName] == 'object') {
for (var arg in allMandatoryArguments[functionName]) { for (arg in allMandatoryArguments[functionName]) {
if (! allMandatoryArguments[functionName].hasOwnProperty(arg)) { if (! allMandatoryArguments[functionName].hasOwnProperty(arg)) {
continue; continue;
} }

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.
@ -21,7 +21,7 @@
$('#permissionsForm').submit(function(e){ $('#permissionsForm').submit(function(e){
if (!$('#permissionsadmin').is(":checked")) { if (!$('#permissionsadmin').is(":checked")) {
e.preventDefault(); e.preventDefault();
message = Mibew.Localization.trans( var message = Mibew.Localization.trans(
'This action is irreversible, proceed anyway?' 'This action is irreversible, proceed anyway?'
); );
Mibew.Utils.confirm(message, function(value) { Mibew.Utils.confirm(message, function(value) {

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.
@ -18,12 +18,17 @@
(function(Mibew, $) { (function(Mibew, $) {
$(document).ready(function() { $(document).ready(function() {
var basePath = window.location.href.replace(/install\.php\/install\/done$/, 'install/done');
$('#check-new-visitor').click(function(){ $('#check-new-visitor').click(function(){
Mibew.Utils.playSound('../sounds/new_user'); Mibew.Utils.playSound(basePath + '/../../sounds/new_user');
}); });
$('#check-new-message').click(function() { $('#check-new-message').click(function() {
Mibew.Utils.playSound('../sounds/new_message'); Mibew.Utils.playSound(basePath + '/../../sounds/new_message');
});
$('#check-invitation').click(function() {
Mibew.Utils.playSound(basePath + '/../../sounds/invite');
}); });
}); });
})(Mibew, jQuery); })(Mibew, jQuery);

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

View File

@ -1,7 +1,7 @@
/*! /*!
* This file is a part of Mibew Messenger. * This file is a part of Mibew Messenger.
* *
* Copyright 2005-2018 the original author or authors. * 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.

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