mirror of
https://github.com/Mibew/mibew.git
synced 2025-06-25 17:28:38 +03:00
Compare commits
233 Commits
Author | SHA1 | Date | |
---|---|---|---|
320d814df4 | |||
8953017b9d | |||
874e896178 | |||
973632b4ae | |||
5fa9663d99 | |||
1ed31ad638 | |||
da94f781b3 | |||
d4640219a6 | |||
1fc048fec9 | |||
d6d5477022 | |||
691bcfa061 | |||
3148db54b5 | |||
|
58ee240c80 | ||
ca090638da | |||
4f05231b04 | |||
730577b4a4 | |||
51f2c41b31 | |||
|
2de3ac9044 | ||
|
09f632cc6d | ||
339da62a23 | |||
5a4d3d420f | |||
cd1e8adce3 | |||
|
e676ca47dc | ||
637758c13e | |||
6a0c067cef | |||
a956f85fc7 | |||
1a137bb683 | |||
57eacfb953 | |||
88247f0de3 | |||
eb0bc9ae5c | |||
7f133f17f7 | |||
944b0fe6c5 | |||
eae2b3df81 | |||
3b3abe615d | |||
756014d568 | |||
6d4c438d62 | |||
5c2743c01a | |||
eeb660293c | |||
01261f8c92 | |||
06078cc8e7 | |||
a37ea34670 | |||
56418b1551 | |||
dc9f128b79 | |||
2533b362ab | |||
0c416c7d7c | |||
fd94b0108c | |||
99fb30b0ec | |||
81e2e345a7 | |||
ce5071c3e3 | |||
1210561448 | |||
9294697d58 | |||
3a92a54cd5 | |||
b6a70659b1 | |||
cd22f3e9d8 | |||
8aba48a1d2 | |||
|
423ef8d36f | ||
098abccde7 | |||
|
75aaaf21b7 | ||
622027302f | |||
5b999eff2d | |||
562eeceac2 | |||
f9e0755b23 | |||
74b9faf7af | |||
|
9978074fbc | ||
2df50d9096 | |||
14aba49194 | |||
17df9c8dbc | |||
6dae66540d | |||
0317979c92 | |||
a4b3824a42 | |||
f1200c4999 | |||
d7365d719f | |||
42f5c1a20a | |||
74e69aa520 | |||
20da5d2f36 | |||
fe951ad050 | |||
|
8edcc7e57f | ||
|
62ad932aa7 | ||
33fb35bd34 | |||
|
003f98b18c | ||
6e3720f8e4 | |||
|
4f3d0a57f9 | ||
|
f28659a025 | ||
|
026b463fb7 | ||
bfe0065f1c | |||
91a1b1872c | |||
cf67b11295 | |||
dd4169f815 | |||
dbe04bb342 | |||
98f2b68560 | |||
805bb610a5 | |||
3148d0eb2a | |||
67439317c4 | |||
5e90541918 | |||
704862faad | |||
c8df65baee | |||
49d86a55be | |||
de3db5527b | |||
d115befab9 | |||
6b20d0c8b6 | |||
b296525e39 | |||
7a16536341 | |||
aa94e21602 | |||
bb932e5b9c | |||
a9ca845c80 | |||
b8bad36510 | |||
1c3d9c98b4 | |||
dc9577ff6a | |||
2336e406f4 | |||
84f5bca0a9 | |||
fb35d4fff9 | |||
ace1423a13 | |||
3b9a8e5456 | |||
c60b247ef7 | |||
89f0f5c688 | |||
7bdf01d344 | |||
c0d9a461af | |||
1844d91893 | |||
1a3594311b | |||
8b6dcf4db0 | |||
9d8e057410 | |||
8a2586d01b | |||
be5d5d182b | |||
38b653d075 | |||
88a1b978ce | |||
a2946bd67d | |||
410b925b8d | |||
4f9b48135c | |||
5bc4698520 | |||
0f64ad3674 | |||
93f949d914 | |||
b971d2d85c | |||
edd279ca8e | |||
525b7de7e2 | |||
b6bfc39cbf | |||
3f4420181c | |||
94eaed0b2c | |||
|
d747568575 | ||
2cda0cbb66 | |||
d41db57211 | |||
bc99761b7a | |||
fc2c9d791a | |||
f9b6eeb92c | |||
2d60df2417 | |||
6dc0bc8d34 | |||
110322ab47 | |||
e40be770c3 | |||
d32f9c02ce | |||
83185a6b32 | |||
a9644ddec1 | |||
e9b29737c9 | |||
4f03a73f9a | |||
647bd84995 | |||
eb60d6b39f | |||
4d038b0777 | |||
67b0a6005e | |||
d605c80332 | |||
98954281d5 | |||
58e0ddc952 | |||
f1030c0298 | |||
9cb71e62c1 | |||
60ff2c853c | |||
6c4e883a8a | |||
25a4a3db40 | |||
5f2aab1501 | |||
8a2fbc6f38 | |||
2b6779af8f | |||
efa1372cdc | |||
|
64e902c5a1 | ||
ee97a2f932 | |||
4960397655 | |||
da03edb665 | |||
712117dfc4 | |||
048e2dd3f0 | |||
3beed6b2ec | |||
c62a98b22a | |||
20d97e5bce | |||
2581119295 | |||
95c55aa931 | |||
059bc5ac39 | |||
324a85fb7f | |||
28e968b15f | |||
9d2c4404c0 | |||
d61b142e40 | |||
d1a1f51bf0 | |||
0cf963ac5e | |||
5921115af0 | |||
87d7478864 | |||
3179d5b669 | |||
8ced21fe86 | |||
84e4de1e7a | |||
39309d1914 | |||
194b396788 | |||
7dd32257d1 | |||
6de62a6929 | |||
1c6433eb73 | |||
762998cd4b | |||
73abafebac | |||
81cd6f75fe | |||
42f28a72da | |||
69916d8f6d | |||
ec2e29083b | |||
98a5570ef6 | |||
3ec1610fff | |||
bc39c22c29 | |||
2e3b718fe2 | |||
be8182ffcc | |||
dfaaffcff4 | |||
de782c7fea | |||
3ea37e0e11 | |||
0f1407682e | |||
e40e821b5f | |||
31ad9138ef | |||
9cd07fe829 | |||
4dec01bdaa | |||
e64670e5aa | |||
7c07d7f3e2 | |||
f9c5d4dbaf | |||
52f203b43d | |||
35d80bdcee | |||
a6b7367002 | |||
75c04cae38 | |||
915b6786d9 | |||
b561f7eec8 | |||
89556ae68f | |||
33149aafb9 | |||
edf8850952 | |||
393bf21f30 | |||
03a2051ad7 | |||
51ad3e70d3 | |||
9417960281 | |||
a312bc5e8f | |||
a617eebeec |
18
.gitignore
vendored
18
.gitignore
vendored
@ -1,6 +1,11 @@
|
|||||||
|
# IDE folders
|
||||||
|
.idea
|
||||||
|
|
||||||
src/mibew/install/package
|
src/mibew/install/package
|
||||||
src/absent_*
|
src/absent_*
|
||||||
src/release*
|
src/release*
|
||||||
|
src/upload*
|
||||||
|
src/*.po
|
||||||
|
|
||||||
# Do not index actual configuration files
|
# Do not index actual configuration files
|
||||||
src/mibew/configs/config.yml
|
src/mibew/configs/config.yml
|
||||||
@ -33,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
|
||||||
|
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[submodule "src/i18n"]
|
||||||
|
path = src/i18n
|
||||||
|
url = git@github.com:Mibew/i18n.git
|
12
ISSUE_TEMPLATE.md
Normal file
12
ISSUE_TEMPLATE.md
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
### Environment
|
||||||
|
* Mibew Messenger version:
|
||||||
|
* OS:
|
||||||
|
* Web server:
|
||||||
|
* PHP:
|
||||||
|
* PHP extensions:
|
||||||
|
* MySQL:
|
||||||
|
### Expected behavior
|
||||||
|
|
||||||
|
### Actual behavior
|
||||||
|
|
||||||
|
### Steps to reproduce the behavior
|
8
PULL_REQUEST_TEMPLATE.md
Normal file
8
PULL_REQUEST_TEMPLATE.md
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
Fixes # .
|
||||||
|
|
||||||
|
Changes proposed in this pull request:
|
||||||
|
-
|
||||||
|
-
|
||||||
|
-
|
||||||
|
|
||||||
|
@Mibew/core-developers
|
33
README.md
33
README.md
@ -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.3.3 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
|
||||||
@ -47,16 +47,25 @@ Mibew Messenger is licensed under the terms of [Apache License, Version 2.0](htt
|
|||||||
1. [Mibew Boilerplate plugin](https://github.com/Mibew/boilerplate-plugin) - a template for a real plugin
|
1. [Mibew Boilerplate plugin](https://github.com/Mibew/boilerplate-plugin) - a template for a real plugin
|
||||||
|
|
||||||
#### Ready for production use
|
#### Ready for production use
|
||||||
1. [Mibew Emoji plugin](https://github.com/Mibew/emoji-plugin)
|
|
||||||
2. [Mibew Geo IP plugin](https://github.com/Mibew/geo-ip-plugin)
|
1. [Mibew Advanced Button plugin](https://github.com/Mibew/advanced-button-plugin)
|
||||||
3. [Mibew Google Maps plugin](https://github.com/Mibew/google-maps-plugin)
|
2. [Mibew Auto Invite plugin](https://github.com/Mibew/auto-invite-plugin)
|
||||||
4. [Mibew Operator Status plugin](https://github.com/Mibew/mibew-operator-status-plugin)
|
3. [Mibew Auto Reply plugin](https://github.com/Mibew/auto-reply-plugin)
|
||||||
5. [Mibew Purge History plugin](https://github.com/Mibew/purge-history-plugin)
|
4. [Mibew Broadcast plugin](https://github.com/Mibew/broadcast-plugin)
|
||||||
6. [Mibew Real Ban plugin](https://github.com/Mibew/real-ban-plugin)
|
5. [Mibew Bulk Logs Operations plugin](https://github.com/Mibew/bulk-logs-operations-plugin)
|
||||||
7. [Mibew Slack plugin](https://github.com/Mibew/mibew_slack)
|
6. [Mibew Button Refresh plugin](https://github.com/Mibew/button-refresh-plugin)
|
||||||
8. [Mibew Title Notification plugin](https://github.com/Mibew/title-notification-plugin)
|
7. [Mibew Emoji plugin](https://github.com/Mibew/emoji-plugin)
|
||||||
|
8. [Mibew Filter Visitors By Operator Code plugin](https://github.com/Mibew/filter-visitors-by-operator-code-plugin)
|
||||||
|
9. [Mibew First Message plugin](https://github.com/Mibew/first-message-plugin)
|
||||||
|
10. [Mibew Geo IP plugin](https://github.com/Mibew/geo-ip-plugin)
|
||||||
|
11. [Mibew Google Maps plugin](https://github.com/Mibew/google-maps-plugin)
|
||||||
|
12. [Mibew Open Street Map plugin](https://github.com/Mibew/open-street-map-plugin)
|
||||||
|
13. [Mibew Operator Status plugin](https://github.com/Mibew/mibew-operator-status-plugin)
|
||||||
|
14. [Mibew Purge History plugin](https://github.com/Mibew/purge-history-plugin)
|
||||||
|
15. [Mibew Real Ban plugin](https://github.com/Mibew/real-ban-plugin)
|
||||||
|
16. [Mibew Slack plugin](https://github.com/Mibew/mibew_slack)
|
||||||
|
17. [Mibew Title Notification plugin](https://github.com/Mibew/title-notification-plugin)
|
||||||
|
|
||||||
#### Not ready for production use (not stable, broken, obsolete, etc.)
|
#### Not ready for production use (not stable, broken, obsolete, etc.)
|
||||||
1. [Mibew Button Refresh plugin](https://github.com/Mibew/button-refresh-plugin)
|
|
||||||
2. [Mibew External API plugin](https://github.com/Mibew/external-api-plugin)
|
1. [Mibew External API plugin](https://github.com/Mibew/external-api-plugin)
|
||||||
3. [Mibew First Message plugin](https://github.com/Mibew/first-message-plugin)
|
|
||||||
|
@ -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": "3.0.3",
|
"handlebars": "4.3.0",
|
||||||
"vex": "2.3.2",
|
"vex": "2.3.2",
|
||||||
"validator-js": "3.40.0"
|
"validator-js": "3.40.0"
|
||||||
},
|
},
|
||||||
|
@ -1,41 +1,51 @@
|
|||||||
{
|
{
|
||||||
"name": "mibew/mibew",
|
"name": "mibew/mibew",
|
||||||
"version": "2.2.2",
|
"version": "3.6.0",
|
||||||
"description": "Mibew Messenger - open-source live support application",
|
"description": "Mibew Messenger - open-source live support application",
|
||||||
"type": "project",
|
"type": "project",
|
||||||
"homepage": "http://mibew.org",
|
"homepage": "https://mibew.org",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "Mibew Messenger Project",
|
"name": "Mibew Messenger Project",
|
||||||
"homepage": "http://mibew.org/credits"
|
"homepage": "https://mibew.org/credits"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"email": "support@mibew.org",
|
"email": "support@mibew.org",
|
||||||
"issues": "https://github.com/mibew/mibew/issues",
|
"issues": "https://github.com/mibew/mibew/issues",
|
||||||
"forum": "http://mibew.org/forums",
|
"forum": "https://mibew.org/forums",
|
||||||
"source": "https://github.com/mibew/mibew"
|
"source": "https://github.com/mibew/mibew"
|
||||||
},
|
},
|
||||||
|
"repositories": [
|
||||||
|
{
|
||||||
|
"type": "vcs",
|
||||||
|
"url": "https://github.com/mibew/handlebars.php"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "vcs",
|
||||||
|
"url": "https://github.com/mibew/handlebars.php-helpers"
|
||||||
|
}
|
||||||
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"xamin/handlebars.php": "~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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
460
src/gulpfile.js
460
src/gulpfile.js
@ -1,8 +1,9 @@
|
|||||||
|
// Initialize requirements
|
||||||
var fs = require('fs'),
|
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'),
|
||||||
@ -25,9 +26,11 @@ var fs = require('fs'),
|
|||||||
xgettext = require('gulp-xgettext'),
|
xgettext = require('gulp-xgettext'),
|
||||||
concatPo = require('gulp-concat-po'),
|
concatPo = require('gulp-concat-po'),
|
||||||
rename = require('gulp-rename'),
|
rename = require('gulp-rename'),
|
||||||
eslint = require('gulp-eslint');
|
eslint = require('gulp-eslint'),
|
||||||
|
removeDuplicateHeaders = require('mibew-gulp-greh'),
|
||||||
|
mkdirp = require('mkdirp');
|
||||||
|
|
||||||
// Set global configs.
|
// Set global configuration
|
||||||
var config = {
|
var config = {
|
||||||
mibewPath: 'mibew',
|
mibewPath: 'mibew',
|
||||||
configsPath: 'mibew/configs',
|
configsPath: 'mibew/configs',
|
||||||
@ -39,17 +42,25 @@ var config = {
|
|||||||
jsPath: 'mibew/js',
|
jsPath: 'mibew/js',
|
||||||
chatStylesPath: 'mibew/styles/chats',
|
chatStylesPath: 'mibew/styles/chats',
|
||||||
pageStylesPath: 'mibew/styles/pages',
|
pageStylesPath: 'mibew/styles/pages',
|
||||||
|
i18nPath: 'i18n',
|
||||||
|
i18nPrefix: 'mibew-i18n-',
|
||||||
|
releasePath: 'release',
|
||||||
|
uploadPath: 'upload',
|
||||||
compiledTemplatesHeader: fs.readFileSync('tools/compiled_templates_header.txt'),
|
compiledTemplatesHeader: fs.readFileSync('tools/compiled_templates_header.txt'),
|
||||||
getComposerUrl: 'https://getcomposer.org/installer',
|
getComposerUrl: 'https://getcomposer.org/installer',
|
||||||
phpBin: 'php -d "suhosin.executor.include.whitelist = phar"',
|
phpBin: 'php -d "suhosin.executor.include.whitelist = phar" -d "memory_limit=512M"',
|
||||||
package: require('./composer.json')
|
package: require('./composer.json'),
|
||||||
|
msginit: 'msginit',
|
||||||
|
msgcat: 'msgcat'
|
||||||
}
|
}
|
||||||
|
config.i18nSuffix = '-' + config.package.version + '-' + strftime('%Y%m%d');
|
||||||
|
|
||||||
|
// Tasks for cleaning //////////////////
|
||||||
|
|
||||||
// Cleans all built files
|
// Cleans all built files
|
||||||
gulp.task('clean', function(callback) {
|
gulp.task('clean', function(callback) {
|
||||||
del([
|
return del([
|
||||||
'release',
|
config.releasePath,
|
||||||
'composer.lock',
|
'composer.lock',
|
||||||
config.phpVendorPath,
|
config.phpVendorPath,
|
||||||
config.jsVendorPath,
|
config.jsVendorPath,
|
||||||
@ -61,47 +72,53 @@ gulp.task('clean', function(callback) {
|
|||||||
], callback);
|
], callback);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Checks all PHP files with PHP Code Sniffer.
|
// Cleans temporary English translation in the release dir
|
||||||
gulp.task('phpcs', ['composer-install-dev'], function() {
|
gulp.task('clean-tmp-po', function(callback) {
|
||||||
return gulp.src([
|
return del([config.releasePath + '/translation.po'], callback);
|
||||||
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.
|
// Cleans temporary files of translations in the release dir
|
||||||
gulp.task('eslint', function() {
|
gulp.task('clean-tmp-i18n-files', function(callback) {
|
||||||
return gulp.src(config.jsPath + '/source/**/*.js')
|
return del([
|
||||||
.pipe(eslint())
|
config.releasePath + '/**/*',
|
||||||
.pipe(eslint.format())
|
'!' + config.releasePath + '/*.zip',
|
||||||
.pipe(eslint.failAfterError());
|
'!' + config.releasePath + '/*.tar.gz',
|
||||||
|
'!' + config.releasePath + '/*.pot'
|
||||||
|
], callback);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Cleans all files prepared for uploading to CDN
|
||||||
|
gulp.task('clean-upload', function(callback) {
|
||||||
|
return del([config.uploadPath], callback);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Cleans everything
|
||||||
|
gulp.task('clean-all', function(callback) {
|
||||||
|
runSequence( ['clean', 'clean-upload'],
|
||||||
|
callback );
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// Watcher tasks ///////////////////////
|
||||||
|
|
||||||
|
// Watch styles
|
||||||
|
gulp.task('watch', function() {
|
||||||
|
gulp.watch(config.pageStylesPath + '/**/*.handlebars', gulp.series('page-styles'));
|
||||||
|
gulp.watch(config.chatStylesPath + '/**/js/source/**/*.js', gulp.series('chat-styles-js'));
|
||||||
|
gulp.watch(config.chatStylesPath + '/**/*.handlebars', gulp.series('chat-styles-handlebars'));
|
||||||
|
});
|
||||||
|
|
||||||
|
// Service tasks //////////////////
|
||||||
|
|
||||||
// Get and install PHP Composer
|
// Get and install PHP Composer
|
||||||
gulp.task('get-composer', function(callback) {
|
gulp.task('get-composer', function(callback) {
|
||||||
// Check if Composer already in place
|
// Check whether Composer is already in place
|
||||||
if (fs.existsSync('./composer.phar')) {
|
if (fs.existsSync('./composer.phar')) {
|
||||||
callback(null);
|
callback(null);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get installer from the internet
|
// Get installer from the Internet
|
||||||
https.get(config.getComposerUrl, function(response) {
|
https.get(config.getComposerUrl, function(response) {
|
||||||
// Run PHP to install Composer
|
// Run PHP to install Composer
|
||||||
var php = exec(config.phpBin, function(error, stdout, stderr) {
|
var php = exec(config.phpBin, function(error, stdout, stderr) {
|
||||||
@ -113,18 +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', function(error, stdout, stderr) {
|
exec(config.phpBin + ' composer.phar install --no-dev',
|
||||||
callback(error ? stderr : null);
|
function(error, stdout, stderr) {
|
||||||
});
|
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', function(error, stdout, stderr) {
|
exec(config.phpBin + ' composer.phar install',
|
||||||
callback(error ? stderr : null);
|
function(error, stdout, stderr) {
|
||||||
});
|
callback(error ? stderr : null);
|
||||||
});
|
});
|
||||||
|
}));
|
||||||
|
|
||||||
// Installs bower dependencies
|
// Installs bower dependencies
|
||||||
gulp.task('bower-install', function(callback) {
|
gulp.task('bower-install', function(callback) {
|
||||||
@ -134,14 +153,15 @@ gulp.task('bower-install', function(callback) {
|
|||||||
})
|
})
|
||||||
.on('end', function() {
|
.on('end', function() {
|
||||||
// We should manually minify JavaScript files that was not minified
|
// We should manually minify JavaScript files that was not minified
|
||||||
// by bower packages' authors.
|
// by bower packages' authors
|
||||||
// TODO: This is a temproary workaround and should be removed once
|
// TODO: This is a temproary workaround and should be removed once
|
||||||
// the packages will be fixed.
|
// the packages will be fixed
|
||||||
var stream = eventStream.merge(
|
var stream = eventStream.merge(
|
||||||
gulp.src(config.jsVendorPath + '/backbone/backbone.js', {base: config.jsVendorPath})
|
gulp.src(config.jsVendorPath + '/backbone/backbone.js',
|
||||||
|
{base: config.jsVendorPath})
|
||||||
.pipe(uglify({preserveComments: 'some'}))
|
.pipe(uglify({preserveComments: 'some'}))
|
||||||
// There are neither "@license" tag nor "!preserve" in the
|
// There are neither "@license" tag nor "!preserve" in the
|
||||||
// header. Add the header manually.
|
// header. Add the header manually
|
||||||
.pipe(header(
|
.pipe(header(
|
||||||
"// Backbone.js 1.1.2\n"
|
"// Backbone.js 1.1.2\n"
|
||||||
+ "// (c) 2010-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n"
|
+ "// (c) 2010-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n"
|
||||||
@ -150,10 +170,11 @@ gulp.task('bower-install', function(callback) {
|
|||||||
+ "// http://backbonejs.org\n"
|
+ "// http://backbonejs.org\n"
|
||||||
))
|
))
|
||||||
.pipe(rename('backbone/backbone-min.js')),
|
.pipe(rename('backbone/backbone-min.js')),
|
||||||
gulp.src(config.jsVendorPath + '/json/json2.js', {base: config.jsVendorPath})
|
gulp.src(config.jsVendorPath + '/json/json2.js',
|
||||||
|
{base: config.jsVendorPath})
|
||||||
.pipe(uglify({preserveComments: 'some'}))
|
.pipe(uglify({preserveComments: 'some'}))
|
||||||
// There are neither "@license" tag nor "!preserve" in the
|
// There are neither "@license" tag nor "!preserve" in the
|
||||||
// header. Add the header manually.
|
// header, add the header manually
|
||||||
.pipe(header("// json2.js. Public Domain. See http://www.JSON.org/js.html\n"))
|
.pipe(header("// json2.js. Public Domain. See http://www.JSON.org/js.html\n"))
|
||||||
.pipe(rename('json/json2.min.js'))
|
.pipe(rename('json/json2.min.js'))
|
||||||
)
|
)
|
||||||
@ -165,7 +186,51 @@ gulp.task('bower-install', function(callback) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Compile all JavaScript files of the Mibew Core
|
// Tasks for checking //////////////////
|
||||||
|
|
||||||
|
// Checks all PHP files with PHP Code Sniffer
|
||||||
|
gulp.task('phpcs', gulp.series('composer-install-dev', function() {
|
||||||
|
return gulp.src([
|
||||||
|
config.mibewPath + '/**/*.php',
|
||||||
|
'!' + config.phpVendorPath + '/**/*.*',
|
||||||
|
'!' + config.pluginsPath + '/**/*.*',
|
||||||
|
'!' + config.cachePath + '/**/*.*'
|
||||||
|
], {
|
||||||
|
// Content of the cache directory is readable only for webserver.
|
||||||
|
// Thus we must to set "strict" option to false to prevent "EACCES"
|
||||||
|
// errors. At the same we need to see all errors that take place.
|
||||||
|
strict: false,
|
||||||
|
silent: false
|
||||||
|
})
|
||||||
|
.pipe(phpcs({
|
||||||
|
bin: config.phpVendorPath + '/bin/phpcs',
|
||||||
|
standard: 'PSR2',
|
||||||
|
warningSeverity: 0
|
||||||
|
}))
|
||||||
|
.pipe(phpcs.reporter('log'))
|
||||||
|
.pipe(phpcs.reporter('fail'));
|
||||||
|
}));
|
||||||
|
|
||||||
|
// Checks all JavaScript Source files with ESLint
|
||||||
|
gulp.task('eslint', function() {
|
||||||
|
return gulp.src(config.jsPath + '/source/**/*.js')
|
||||||
|
.pipe(eslint())
|
||||||
|
.pipe(eslint.format())
|
||||||
|
.pipe(eslint.failAfterError());
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// Restore empty English translation in the source code
|
||||||
|
gulp.task('post-pack-cleanup', function(callback) {
|
||||||
|
gulp.src('translation.po')
|
||||||
|
.pipe(gulp.dest(config.mibewPath + '/locales/en/'));
|
||||||
|
|
||||||
|
del(['translation.po', config.releasePath + '/translation.po'], callback);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Tasks of compiling //////////////////
|
||||||
|
|
||||||
|
// Compile all JavaScript files of the Mibew Messenger Core
|
||||||
gulp.task('js', function() {
|
gulp.task('js', function() {
|
||||||
return eventStream.merge(
|
return eventStream.merge(
|
||||||
getClientSideApp('default'),
|
getClientSideApp('default'),
|
||||||
@ -175,22 +240,18 @@ gulp.task('js', function() {
|
|||||||
gulp.src(config.jsPath + '/source/**/*.js')
|
gulp.src(config.jsPath + '/source/**/*.js')
|
||||||
)
|
)
|
||||||
.pipe(uglify({preserveComments: 'some'}))
|
.pipe(uglify({preserveComments: 'some'}))
|
||||||
|
.pipe(removeDuplicateHeaders())
|
||||||
.pipe(gulp.dest(config.jsPath + '/compiled'));
|
.pipe(gulp.dest(config.jsPath + '/compiled'));
|
||||||
});
|
});
|
||||||
|
|
||||||
// Performs all job related with chat styles.
|
// Compile and concatenate Handlebars templates for all chat styles
|
||||||
gulp.task('chat-styles', ['chat-styles-handlebars', 'chat-styles-js'], function() {
|
|
||||||
// This task is just a combination of other tasks. That is why there is no
|
|
||||||
// real code.
|
|
||||||
});
|
|
||||||
|
|
||||||
// Compile and concatenate handlebars files for all chat styles.
|
|
||||||
gulp.task('chat-styles-handlebars', function() {
|
gulp.task('chat-styles-handlebars', function() {
|
||||||
return getChildDirs(config.chatStylesPath)
|
return getChildDirs(config.chatStylesPath)
|
||||||
.then(function (dirs) {
|
.then(function (dirs) {
|
||||||
return Promise.all(dirs.map(function (dir) {
|
return Promise.all(dirs.map(function (dir) {
|
||||||
return new Promise(function(resolve, reject){
|
return new Promise(function(resolve, reject) {
|
||||||
gulp.src(config.chatStylesPath + '/' + dir + '/templates_src/client_side/**/*.handlebars')
|
gulp.src(config.chatStylesPath + '/' + dir
|
||||||
|
+ '/templates_src/client_side/**/*.handlebars')
|
||||||
.pipe(handlebars({
|
.pipe(handlebars({
|
||||||
// Use specific version of Handlebars.js
|
// Use specific version of Handlebars.js
|
||||||
handlebars: handlebarsEngine
|
handlebars: handlebarsEngine
|
||||||
@ -199,7 +260,8 @@ gulp.task('chat-styles-handlebars', function() {
|
|||||||
.pipe(concat('templates.js'))
|
.pipe(concat('templates.js'))
|
||||||
.pipe(uglify({preserveComments: 'some'}))
|
.pipe(uglify({preserveComments: 'some'}))
|
||||||
.pipe(header(config.compiledTemplatesHeader))
|
.pipe(header(config.compiledTemplatesHeader))
|
||||||
.pipe(gulp.dest(config.chatStylesPath + '/' + dir + '/templates_compiled/client_side'))
|
.pipe(gulp.dest(config.chatStylesPath + '/' + dir
|
||||||
|
+ '/templates_compiled/client_side'))
|
||||||
.on('end', resolve)
|
.on('end', resolve)
|
||||||
.on('error', reject);
|
.on('error', reject);
|
||||||
});
|
});
|
||||||
@ -207,16 +269,18 @@ gulp.task('chat-styles-handlebars', function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Compile and concatenate js files for all chat styles.
|
// Compile and concatenate js files for all chat styles
|
||||||
gulp.task('chat-styles-js', function() {
|
gulp.task('chat-styles-js', function() {
|
||||||
return getChildDirs(config.chatStylesPath)
|
return getChildDirs(config.chatStylesPath)
|
||||||
.then(function (dirs) {
|
.then(function (dirs) {
|
||||||
return Promise.all(dirs.map(function (dir) {
|
return Promise.all(dirs.map(function (dir) {
|
||||||
return new Promise(function(resolve, reject){
|
return new Promise(function(resolve, reject) {
|
||||||
gulp.src(config.chatStylesPath + '/' + dir + '/js/source/**/*.js')
|
gulp.src(config.chatStylesPath + '/' + dir
|
||||||
|
+ '/js/source/**/*.js')
|
||||||
.pipe(concat('scripts.js'))
|
.pipe(concat('scripts.js'))
|
||||||
.pipe(uglify({preserveComments: 'some'}))
|
.pipe(uglify({preserveComments: 'some'}))
|
||||||
.pipe(gulp.dest(config.chatStylesPath + '/' + dir + '/js/compiled'))
|
.pipe(gulp.dest(config.chatStylesPath + '/' + dir
|
||||||
|
+ '/js/compiled'))
|
||||||
.on('end', resolve)
|
.on('end', resolve)
|
||||||
.on('error', reject);
|
.on('error', reject);
|
||||||
});
|
});
|
||||||
@ -224,13 +288,14 @@ gulp.task('chat-styles-js', function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Performs all job related with pages styles.
|
// Performs all job related to pages styles
|
||||||
gulp.task('page-styles', function() {
|
gulp.task('page-styles', function() {
|
||||||
return getChildDirs(config.pageStylesPath)
|
return getChildDirs(config.pageStylesPath)
|
||||||
.then(function (dirs) {
|
.then(function (dirs) {
|
||||||
return Promise.all(dirs.map(function (dir) {
|
return Promise.all(dirs.map(function (dir) {
|
||||||
return new Promise(function(resolve, reject){
|
return new Promise(function(resolve, reject){
|
||||||
gulp.src(config.pageStylesPath + '/' + dir + '/templates_src/client_side/**/*.handlebars')
|
gulp.src(config.pageStylesPath + '/' + dir
|
||||||
|
+ '/templates_src/client_side/**/*.handlebars')
|
||||||
.pipe(handlebars({
|
.pipe(handlebars({
|
||||||
// Use specific version of Handlebars.js
|
// Use specific version of Handlebars.js
|
||||||
handlebars: handlebarsEngine
|
handlebars: handlebarsEngine
|
||||||
@ -239,7 +304,8 @@ gulp.task('page-styles', function() {
|
|||||||
.pipe(concat('templates.js'))
|
.pipe(concat('templates.js'))
|
||||||
.pipe(uglify({preserveComments: 'some'}))
|
.pipe(uglify({preserveComments: 'some'}))
|
||||||
.pipe(header(config.compiledTemplatesHeader))
|
.pipe(header(config.compiledTemplatesHeader))
|
||||||
.pipe(gulp.dest(config.pageStylesPath + '/' + dir + '/templates_compiled/client_side'))
|
.pipe(gulp.dest(config.pageStylesPath + '/' + dir
|
||||||
|
+ '/templates_compiled/client_side'))
|
||||||
.on('end', resolve)
|
.on('end', resolve)
|
||||||
.on('error', reject);
|
.on('error', reject);
|
||||||
});
|
});
|
||||||
@ -247,28 +313,38 @@ gulp.task('page-styles', function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Watch styles
|
// Performs all job related to chat styles
|
||||||
gulp.task('watch', [], function(){
|
gulp.task('chat-styles', gulp.series('chat-styles-handlebars', 'chat-styles-js'));
|
||||||
gulp.watch(config.pageStylesPath + '/**/*.handlebars', ['page-styles']);
|
|
||||||
gulp.watch(config.chatStylesPath + '/**/js/source/**/*.js', ['chat-styles-js']);
|
// Prepares ready to use development version of Mibew Messenger without
|
||||||
gulp.watch(config.chatStylesPath + '/**/*.handlebars', ['chat-styles-handlebars']);
|
// packing or validating it
|
||||||
|
gulp.task('rebuild', function(callback) {
|
||||||
|
runSequence(
|
||||||
|
'clean',
|
||||||
|
['js', 'chat-styles', 'page-styles', 'composer-install',
|
||||||
|
'bower-install'],
|
||||||
|
callback
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Generate .pot files based on the sources
|
// Tasks for localization issues ///////
|
||||||
|
|
||||||
|
// Generate POT-file based upon the source code
|
||||||
gulp.task('generate-pot', function() {
|
gulp.task('generate-pot', function() {
|
||||||
return eventStream.merge(
|
return eventStream.merge(
|
||||||
gulp.src([
|
gulp.src([
|
||||||
config.mibewPath + '/**/*.php',
|
config.mibewPath + '/**/*.php',
|
||||||
'!' + config.phpVendorPath + '/**/*.*',
|
'!' + config.phpVendorPath + '/**/*.*',
|
||||||
'!' + config.pluginsPath + '/**/*.*',
|
'!' + config.pluginsPath + '/**/*.*',
|
||||||
'!' + config.cachePath + '/**/*.*'
|
'!' + config.cachePath + '/**/*.*'
|
||||||
], {
|
], {
|
||||||
// Content of the cache directory is readable only for webserver.
|
// Content of the cache directory is readable only for
|
||||||
// Thus we must to set "strict" option to false to prevent "EACCES"
|
// webserver. Thus we must to set "strict" option to false
|
||||||
// errors. At the same we need to see all errors that take place.
|
// to prevent "EACCES" errors. At the same we need to see all
|
||||||
strict: false,
|
// errors that take place.
|
||||||
silent: false
|
strict: false,
|
||||||
})
|
silent: false
|
||||||
|
})
|
||||||
.pipe(xgettext({
|
.pipe(xgettext({
|
||||||
language: 'PHP',
|
language: 'PHP',
|
||||||
keywords: [
|
keywords: [
|
||||||
@ -286,27 +362,88 @@ gulp.task('generate-pot', function() {
|
|||||||
]
|
]
|
||||||
})),
|
})),
|
||||||
gulp.src([
|
gulp.src([
|
||||||
config.chatStylesPath + '/default/templates_src/**/*.handlebars',
|
config.chatStylesPath + '/default/templates_src/**/*.handlebars',
|
||||||
config.pageStylesPath + '/default/templates_src/**/*.handlebars'
|
config.pageStylesPath + '/default/templates_src/**/*.handlebars'
|
||||||
], {base: config.mibewPath})
|
], {base: config.mibewPath})
|
||||||
.pipe(xgettextHandlebars())
|
.pipe(xgettextHandlebars())
|
||||||
)
|
)
|
||||||
.pipe(concatPo('translation.pot', {
|
.pipe(concatPo(config.i18nPrefix + 'translation'
|
||||||
headers: {
|
+ config.i18nSuffix + '.pot',
|
||||||
'Project-Id-Version': 'Mibew Messenger ' + config.package.version,
|
{
|
||||||
'Report-Msgid-Bugs-To': config.package.support.email,
|
headers: {
|
||||||
'POT-Creation-Date': strftime('%Y-%m-%d %H:%M%z'),
|
'Project-Id-Version': 'Mibew Messenger '
|
||||||
'PO-Revision-Date': '',
|
+ config.package.version,
|
||||||
'Last-Translator': '',
|
'Report-Msgid-Bugs-To': config.package.support.email,
|
||||||
'Language-Team': '',
|
'POT-Creation-Date': strftime('%Y-%m-%d %H:%M%z'),
|
||||||
'Content-Type': 'text/plain; charset=UTF-8'
|
'PO-Revision-Date': '',
|
||||||
}
|
'Last-Translator': '',
|
||||||
}))
|
'Language-Team': '',
|
||||||
.pipe(gulp.dest('release'));
|
'Content-Type': 'text/plain; charset=UTF-8'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
)
|
||||||
|
.pipe(gulp.dest(config.releasePath));
|
||||||
});
|
});
|
||||||
|
|
||||||
// Pack sources to .zip and .tar.gz archives.
|
// Generate temporary English translation to be used in the release
|
||||||
gulp.task('pack-sources', ['composer-install', 'bower-install'], function() {
|
gulp.task('generate-tmp-po', gulp.series('generate-pot', function(callback) {
|
||||||
|
return exec(config.msginit + ' --no-translator --no-wrap -i '
|
||||||
|
+ config.releasePath + '/' + config.i18nPrefix + 'translation'
|
||||||
|
+ config.i18nSuffix + '.pot' + ' -l en -o '
|
||||||
|
+ config.releasePath + '/translation.po',
|
||||||
|
function(error, stdout, stderr) {
|
||||||
|
callback(error ? stderr : null);
|
||||||
|
});
|
||||||
|
}));
|
||||||
|
|
||||||
|
// Generate complete translations (that includes missed strings) to be used
|
||||||
|
// in the release
|
||||||
|
gulp.task('generate-pos', gulp.series('generate-tmp-po', function(callback) {
|
||||||
|
|
||||||
|
return getChildDirs(config.i18nPath + '/translations')
|
||||||
|
.then(function (dirs) {
|
||||||
|
return Promise.all(dirs.map(function (dir) {
|
||||||
|
return new Promise(function(resolve, reject) {
|
||||||
|
mkdirp(config.releasePath + '/' + dir, function (error) {
|
||||||
|
if (error) {
|
||||||
|
reject(error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
exec(config.msgcat + ' ' + config.i18nPath + '/translations/'
|
||||||
|
+ dir + '/translation.po ' + config.releasePath
|
||||||
|
+ '/translation.po --no-location --no-wrap --use-first'
|
||||||
|
+ ' -o ' + config.releasePath + '/' + dir
|
||||||
|
+ '/translation.po',
|
||||||
|
function(error, stdout, stderr) {
|
||||||
|
if (error) {
|
||||||
|
reject(error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var sources = [
|
||||||
|
config.i18nPath + '/translations/' + dir + '/**/*',
|
||||||
|
'!' + config.i18nPath + '/translations/' + dir
|
||||||
|
+ '/translation.po'
|
||||||
|
];
|
||||||
|
|
||||||
|
gulp.src(sources)
|
||||||
|
.pipe(gulp.dest(config.releasePath + '/' + dir))
|
||||||
|
.on('error', reject)
|
||||||
|
.on('end', resolve);
|
||||||
|
});
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
}));
|
||||||
|
|
||||||
|
// Packaging tasks /////////////////////
|
||||||
|
|
||||||
|
// Pack sources for release as .zip and .tar.gz archives
|
||||||
|
gulp.task('pack-sources', gulp.series('composer-install', 'bower-install', function() {
|
||||||
|
gulp.src(config.mibewPath + '/locales/en/translation.po')
|
||||||
|
.pipe(gulp.dest('.'));
|
||||||
|
gulp.src(config.releasePath + '/translation.po')
|
||||||
|
.pipe(gulp.dest(config.mibewPath + '/locales/en/'));
|
||||||
|
|
||||||
var sources = [
|
var sources = [
|
||||||
config.mibewPath + '/**/*',
|
config.mibewPath + '/**/*',
|
||||||
// Exclude user's config
|
// Exclude user's config
|
||||||
@ -349,13 +486,15 @@ gulp.task('pack-sources', ['composer-install', 'bower-install'], function() {
|
|||||||
'!' + config.jsVendorPath + '/vex/coffee{,/**}'
|
'!' + config.jsVendorPath + '/vex/coffee{,/**}'
|
||||||
];
|
];
|
||||||
var srcOptions = {
|
var srcOptions = {
|
||||||
// Dot files (.htaccess, .keep, etc.) must be included in the package.
|
// Dot files (.htaccess, .keep, etc.) must be included in the package
|
||||||
dot: true,
|
dot: true,
|
||||||
// Content of the cache directory is readable only for webserver. Thus
|
// Content of the cache directory is readable only for webserver. Thus
|
||||||
// we must to set "strict" option to false to prevent "EACCES" errors.
|
// we must to set "strict" option to false to prevent "EACCES" errors.
|
||||||
// At the same we need to see all errors that take place.
|
// At the same we need to see all errors that take place.
|
||||||
strict: false,
|
strict: false,
|
||||||
silent: false
|
silent: false,
|
||||||
|
// Preserve root directory name (i.e. 'mibew/')
|
||||||
|
base: '.'
|
||||||
}
|
}
|
||||||
var version = config.package.version;
|
var version = config.package.version;
|
||||||
|
|
||||||
@ -367,45 +506,110 @@ gulp.task('pack-sources', ['composer-install', 'bower-install'], function() {
|
|||||||
.pipe(gzip())
|
.pipe(gzip())
|
||||||
)
|
)
|
||||||
.pipe(chmod(644))
|
.pipe(chmod(644))
|
||||||
.pipe(gulp.dest('release'));
|
.pipe(gulp.dest(config.releasePath));
|
||||||
|
}));
|
||||||
|
|
||||||
|
// Pack translations for release as .zip and .tar.gz archives
|
||||||
|
gulp.task('pack-i18n', function(callback) {
|
||||||
|
return getChildDirs(config.i18nPath + '/translations')
|
||||||
|
.then(function (dirs) {
|
||||||
|
return Promise.all(dirs.map(function (dir) {
|
||||||
|
return new Promise(function(resolve, reject) {
|
||||||
|
|
||||||
|
var srcOptions = {
|
||||||
|
base: config.releasePath
|
||||||
|
};
|
||||||
|
|
||||||
|
eventStream.merge(
|
||||||
|
gulp.src(config.releasePath + '/' + dir
|
||||||
|
+ '/**/*', srcOptions)
|
||||||
|
.pipe(zip(config.i18nPrefix + dir
|
||||||
|
+ config.i18nSuffix + '.zip')),
|
||||||
|
gulp.src(config.releasePath + '/' + dir
|
||||||
|
+ '/**/*', srcOptions)
|
||||||
|
.pipe(tar(config.i18nPrefix + dir
|
||||||
|
+ config.i18nSuffix + '.tar'))
|
||||||
|
.pipe(gzip())
|
||||||
|
)
|
||||||
|
.pipe(chmod(644))
|
||||||
|
.pipe(gulp.dest(config.releasePath))
|
||||||
|
.on('error', reject)
|
||||||
|
.on('end', resolve);
|
||||||
|
|
||||||
|
});
|
||||||
|
}));
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Performs all tasks in the correct order.
|
// Tasks of releasing //////////////////
|
||||||
|
|
||||||
|
// Prepare release of Mibew Messenger
|
||||||
gulp.task('prepare-release', function(callback) {
|
gulp.task('prepare-release', function(callback) {
|
||||||
runSequence(
|
runSequence(
|
||||||
'clean',
|
'clean',
|
||||||
['phpcs', 'js', 'chat-styles', 'page-styles', 'generate-pot'],
|
['phpcs', 'js', 'chat-styles', 'page-styles', 'generate-pot',
|
||||||
|
'generate-tmp-po'],
|
||||||
'pack-sources',
|
'pack-sources',
|
||||||
|
'post-pack-cleanup',
|
||||||
callback
|
callback
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Prepares ready to use development version of Mibew without packing or
|
// Prepare releases of translations for Mibew Messenger
|
||||||
// validating it.
|
gulp.task('prepare-i18n-release', function(callback) {
|
||||||
gulp.task('rebuild', function(callback) {
|
runSequence( 'clean-tmp-po',
|
||||||
runSequence(
|
'generate-pos',
|
||||||
'clean',
|
'pack-i18n',
|
||||||
['js', 'chat-styles', 'page-styles', 'composer-install', 'bower-install'],
|
'clean-tmp-i18n-files',
|
||||||
callback
|
callback
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Builds the sources
|
// Mirror prepared releases of Mibew Messenger and its translations in a form
|
||||||
|
// intended for uploading into the CDN
|
||||||
|
gulp.task('prepare-for-upload', function(callback) {
|
||||||
|
gulp.src(config.releasePath + '/mibew-' + config.package.version + '.*')
|
||||||
|
.pipe(gulp.dest(config.uploadPath + '/core/' + config.package.version + '/'));
|
||||||
|
|
||||||
|
gulp.src(config.releasePath + '/mibew-i18n-translation-' + config.package.version + '-*.pot')
|
||||||
|
.pipe(gulp.dest(config.uploadPath + '/i18n/_pot/' + config.package.version + '/'));
|
||||||
|
|
||||||
|
return getChildDirs(config.i18nPath + '/translations')
|
||||||
|
.then(function (dirs) {
|
||||||
|
return Promise.all(dirs.map(function (dir) {
|
||||||
|
return new Promise(function(resolve, reject) {
|
||||||
|
gulp.src(config.releasePath + '/mibew-i18n-' + dir + '-' + config.package.version + '-*.*')
|
||||||
|
.pipe(gulp.dest(config.uploadPath + '/i18n/' + dir + '/' + config.package.version + '/'))
|
||||||
|
.on('error', reject)
|
||||||
|
.on('end', resolve);
|
||||||
|
});
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// Perform all preparations before uploading the release of Mibew Messenger and
|
||||||
|
// its translations into the CDN
|
||||||
|
gulp.task('prepare-all', function(callback) {
|
||||||
|
runSequence('clean-all', 'prepare-release', 'prepare-i18n-release',
|
||||||
|
'prepare-for-upload', callback);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Prepare release archives of the development version of Mibew Messenger
|
||||||
gulp.task('default', function(callback) {
|
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', 'clean-tmp-po'],
|
||||||
callback
|
callback
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads and prepare js file for a client side application with the specified
|
* Loads and prepare js file for a client side application with the specified
|
||||||
* name.
|
* name.
|
||||||
*
|
*
|
||||||
* @param {String} name Application name
|
* @param {String} name Application name.
|
||||||
* @returns A files stream that can be piped to any gulp plugin.
|
* @returns A files stream that can be piped to any gulp plugin.
|
||||||
*/
|
*/
|
||||||
var getClientSideApp = function(name) {
|
var getClientSideApp = function(name) {
|
||||||
@ -475,7 +679,7 @@ var xgettextHandlebars = function() {
|
|||||||
contents = file.contents.toString();
|
contents = file.contents.toString();
|
||||||
|
|
||||||
while (match = helperRegExp.exec(contents)) {
|
while (match = helperRegExp.exec(contents)) {
|
||||||
// Try to find item in the .po file by its name.
|
// Try to find item in the .po file by its name
|
||||||
var item = lodash.find(po.items, function(item) {
|
var item = lodash.find(po.items, function(item) {
|
||||||
return match[2] === item.msgid;
|
return match[2] === item.msgid;
|
||||||
});
|
});
|
||||||
@ -483,7 +687,7 @@ var xgettextHandlebars = function() {
|
|||||||
var line = contents.substr(0, match.index).split(/\r?\n|\r/g).length;
|
var line = contents.substr(0, match.index).split(/\r?\n|\r/g).length;
|
||||||
|
|
||||||
if (!item) {
|
if (!item) {
|
||||||
// There is no such item. Create new one.
|
// There is no such item, create new one
|
||||||
item = new PoFile.Item();
|
item = new PoFile.Item();
|
||||||
item.msgid = match[2].replace(/\\'/g, "'").replace(/\\"/g, '"');
|
item.msgid = match[2].replace(/\\'/g, "'").replace(/\\"/g, '"');
|
||||||
po.items.push(item);
|
po.items.push(item);
|
||||||
@ -494,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();
|
||||||
@ -504,7 +708,7 @@ var xgettextHandlebars = function() {
|
|||||||
/**
|
/**
|
||||||
* Retrieves list of all dirs which are placed in the specified one.
|
* Retrieves list of all dirs which are placed in the specified one.
|
||||||
*
|
*
|
||||||
* @param {String} srcDir A dir where to search.
|
* @param {String} srcDir A dir to search.
|
||||||
* @returns Promise A promise which will be resolved with list of child dirs or
|
* @returns Promise A promise which will be resolved with list of child dirs or
|
||||||
* rejected with the occured error.
|
* rejected with the occured error.
|
||||||
*/
|
*/
|
||||||
@ -518,10 +722,10 @@ var getChildDirs = function(srcDir) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
})).then(function (files) {
|
})).then(function (files) {
|
||||||
// Replace all the files that are not a directory with nulls.
|
// Replace all files that are not a directory with nulls.
|
||||||
return Promise.all(files.map(function (file) {
|
return Promise.all(files.map(function (file) {
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
fs.lstat(config.chatStylesPath + '/' + file, function (err, stat) {
|
fs.lstat(srcDir + '/' + file, function (err, stat) {
|
||||||
if (err) {
|
if (err) {
|
||||||
reject(err);
|
reject(err);
|
||||||
} else {
|
} else {
|
||||||
@ -531,7 +735,7 @@ var getChildDirs = function(srcDir) {
|
|||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
}).then(function(dirs) {
|
}).then(function(dirs) {
|
||||||
// Remove all the nulls from the array.
|
// Remove all nulls from the array.
|
||||||
return dirs.filter(function (dir) {
|
return dirs.filter(function (dir) {
|
||||||
return null !== dir;
|
return null !== dir;
|
||||||
});
|
});
|
||||||
|
1
src/i18n
Submodule
1
src/i18n
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit 55868d9973f531c3550575481bde4233cc625b91
|
@ -46,9 +46,10 @@ Options +FollowSymLinks
|
|||||||
</IfModule>
|
</IfModule>
|
||||||
|
|
||||||
<IfModule !mod_rewrite.c>
|
<IfModule !mod_rewrite.c>
|
||||||
# There is no mod_rewrite in the system. For the root Mibew directory
|
# There is no mod_rewrite in the system. For the root Mibew Messenger
|
||||||
# index_fallback.php should be loaded first to activate old-fashioned URLs.
|
# directory index_fallback.php should be loaded first to activate
|
||||||
# For all other directories index.php is just a directory index file.
|
# old-fashioned URLs. For all other directories index.php is just a
|
||||||
|
# directory index file.
|
||||||
DirectoryIndex index_fallback.php index.php
|
DirectoryIndex index_fallback.php index.php
|
||||||
</IfModule>
|
</IfModule>
|
||||||
|
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
Mibew Messenger
|
Mibew Messenger
|
||||||
Copyright 2005-2017 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.3.3 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
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
Mibew/2.2.2
|
Mibew/3.6.0
|
@ -72,7 +72,7 @@ thread:
|
|||||||
useragent: "varchar(255)"
|
useragent: "varchar(255)"
|
||||||
# Total count of user's messages related with the thread.
|
# Total count of user's messages related with the thread.
|
||||||
messagecount: "varchar(16)"
|
messagecount: "varchar(16)"
|
||||||
# ID of the group at Mibew side related with the thread.
|
# ID of the group at Mibew Messenger side related with the thread.
|
||||||
groupid: "int references {opgroup}(groupid)"
|
groupid: "int references {opgroup}(groupid)"
|
||||||
|
|
||||||
# Contains "by thread" statistics
|
# Contains "by thread" statistics
|
||||||
@ -104,7 +104,7 @@ requestcallback:
|
|||||||
fields:
|
fields:
|
||||||
callbackid: "int NOT NULL auto_increment PRIMARY KEY"
|
callbackid: "int NOT NULL auto_increment PRIMARY KEY"
|
||||||
token: "varchar(64) NOT NULL DEFAULT ''"
|
token: "varchar(64) NOT NULL DEFAULT ''"
|
||||||
function: "varchar(64) NOT NULL"
|
func: "varchar(64) NOT NULL"
|
||||||
arguments: "varchar(1024)"
|
arguments: "varchar(1024)"
|
||||||
indexes:
|
indexes:
|
||||||
token: [token]
|
token: [token]
|
||||||
@ -226,7 +226,7 @@ operatorstatistics:
|
|||||||
|
|
||||||
revision:
|
revision:
|
||||||
fields:
|
fields:
|
||||||
id: "INT NOT NULL"
|
id: "INT NOT NULL PRIMARY KEY"
|
||||||
|
|
||||||
# Contains relations between operators and groups
|
# Contains relations between operators and groups
|
||||||
operatortoopgroup:
|
operatortoopgroup:
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# IMPORTANT: Before install mibew copy this file to config.yml and fill it with
|
# IMPORTANT: Before install Mibew Messenger copy this file to config.yml and
|
||||||
# your own settings!
|
# fill it with your own settings!
|
||||||
|
|
||||||
|
|
||||||
# MySQL Database parameters
|
# MySQL Database parameters
|
||||||
@ -13,7 +13,7 @@ database:
|
|||||||
use_persistent_connection: false
|
use_persistent_connection: false
|
||||||
|
|
||||||
# Mail
|
# Mail
|
||||||
## This value will be used as sender address in all e-mails Mibew send.
|
## This value will be used as sender address in all e-mails Mibew Messenger send.
|
||||||
mailbox: mibew@yourdomain.com
|
mailbox: mibew@yourdomain.com
|
||||||
|
|
||||||
## Mailer parameters
|
## Mailer parameters
|
||||||
@ -77,8 +77,8 @@ default_locale: en
|
|||||||
# http://php.net/manual/en/timezones.php
|
# http://php.net/manual/en/timezones.php
|
||||||
timezone: ""
|
timezone: ""
|
||||||
|
|
||||||
# List of proxy's IP Mibew should trust. You should set this option if you use
|
# List of proxy's IP Mibew Messenger should trust. You should set this option
|
||||||
# Mibew with a load balancer or behind a proxy.
|
# if you use Mibew Messenger with a load balancer or behind a proxy.
|
||||||
trusted_proxies: []
|
trusted_proxies: []
|
||||||
# Here is an example of what values this option can take:
|
# Here is an example of what values this option can take:
|
||||||
# trusted_proxies:
|
# trusted_proxies:
|
||||||
@ -89,7 +89,7 @@ trusted_proxies: []
|
|||||||
# Plugins
|
# Plugins
|
||||||
plugins: []
|
plugins: []
|
||||||
|
|
||||||
## Exapmle of plugins configuration
|
## Example of plugins configuration
|
||||||
# plugins:
|
# plugins:
|
||||||
# "VendorName:PluginName":
|
# "VendorName:PluginName":
|
||||||
# weight: 100
|
# weight: 100
|
||||||
|
@ -49,6 +49,14 @@ chat_user:
|
|||||||
thread_id: \d{1,10}
|
thread_id: \d{1,10}
|
||||||
token: \d{1,10}
|
token: \d{1,10}
|
||||||
|
|
||||||
|
chat_user_check:
|
||||||
|
path: /chat/{thread_id}/{token}/check
|
||||||
|
defaults:
|
||||||
|
_controller: Mibew\Controller\Chat\UserChatController::checkAction
|
||||||
|
requirements:
|
||||||
|
thread_id: \d{1,10}
|
||||||
|
token: \d{1,10}
|
||||||
|
|
||||||
chat_user_invitation:
|
chat_user_invitation:
|
||||||
path: /chat/invitation
|
path: /chat/invitation
|
||||||
defaults:
|
defaults:
|
||||||
@ -80,11 +88,25 @@ chat_user_popup_style:
|
|||||||
requirements:
|
requirements:
|
||||||
style: "[0-9A-Za-z_]*"
|
style: "[0-9A-Za-z_]*"
|
||||||
|
|
||||||
|
chat_user_popup_style_force_secure:
|
||||||
|
path: /chat/style/popup/{style}/force_secure
|
||||||
|
defaults:
|
||||||
|
_controller: Mibew\Controller\Chat\StyleController::loadPopupStyleAction
|
||||||
|
style: ""
|
||||||
|
force_secure: on
|
||||||
|
requirements:
|
||||||
|
style: "[0-9A-Za-z_]*"
|
||||||
|
|
||||||
chat_user_start:
|
chat_user_start:
|
||||||
path: /chat
|
path: /chat
|
||||||
defaults:
|
defaults:
|
||||||
_controller: Mibew\Controller\Chat\UserChatController::startAction
|
_controller: Mibew\Controller\Chat\UserChatController::startAction
|
||||||
|
|
||||||
|
chat_user_cookie_set_permission:
|
||||||
|
path: /chat/cookies-set-permission
|
||||||
|
defaults:
|
||||||
|
_controller: Mibew\Controller\Chat\UserChatController::cookieSetPermissionAction
|
||||||
|
|
||||||
# Pages that are available for all users
|
# Pages that are available for all users
|
||||||
button:
|
button:
|
||||||
path: /b
|
path: /b
|
||||||
@ -178,21 +200,24 @@ canned_message_add:
|
|||||||
path: /operator/canned-message/add
|
path: /operator/canned-message/add
|
||||||
defaults:
|
defaults:
|
||||||
_controller: Mibew\Controller\CannedMessageController::showEditFormAction
|
_controller: Mibew\Controller\CannedMessageController::showEditFormAction
|
||||||
_access_check: Mibew\AccessControl\Check\LoggedInCheck
|
_access_check: Mibew\AccessControl\Check\PermissionsCheck
|
||||||
|
_access_permissions: [CAN_ADMINISTRATE]
|
||||||
methods: [GET]
|
methods: [GET]
|
||||||
|
|
||||||
canned_message_add_save:
|
canned_message_add_save:
|
||||||
path: /operator/canned-message/add
|
path: /operator/canned-message/add
|
||||||
defaults:
|
defaults:
|
||||||
_controller: Mibew\Controller\CannedMessageController::submitEditFormAction
|
_controller: Mibew\Controller\CannedMessageController::submitEditFormAction
|
||||||
_access_check: Mibew\AccessControl\Check\LoggedInCheck
|
_access_check: Mibew\AccessControl\Check\PermissionsCheck
|
||||||
|
_access_permissions: [CAN_ADMINISTRATE]
|
||||||
methods: [POST]
|
methods: [POST]
|
||||||
|
|
||||||
canned_message_delete:
|
canned_message_delete:
|
||||||
path: /operator/canned-message/{message_id}/delete
|
path: /operator/canned-message/{message_id}/delete
|
||||||
defaults:
|
defaults:
|
||||||
_controller: Mibew\Controller\CannedMessageController::deleteAction
|
_controller: Mibew\Controller\CannedMessageController::deleteAction
|
||||||
_access_check: Mibew\AccessControl\Check\LoggedInCheck
|
_access_check: Mibew\AccessControl\Check\PermissionsCheck
|
||||||
|
_access_permissions: [CAN_ADMINISTRATE]
|
||||||
requirements:
|
requirements:
|
||||||
message_id: \d{1,10}
|
message_id: \d{1,10}
|
||||||
|
|
||||||
@ -200,7 +225,8 @@ canned_message_edit:
|
|||||||
path: /operator/canned-message/{message_id}/edit
|
path: /operator/canned-message/{message_id}/edit
|
||||||
defaults:
|
defaults:
|
||||||
_controller: Mibew\Controller\CannedMessageController::showEditFormAction
|
_controller: Mibew\Controller\CannedMessageController::showEditFormAction
|
||||||
_access_check: Mibew\AccessControl\Check\LoggedInCheck
|
_access_check: Mibew\AccessControl\Check\PermissionsCheck
|
||||||
|
_access_permissions: [CAN_ADMINISTRATE]
|
||||||
requirements:
|
requirements:
|
||||||
message_id: \d{1,10}
|
message_id: \d{1,10}
|
||||||
methods: [GET]
|
methods: [GET]
|
||||||
@ -209,7 +235,8 @@ canned_message_edit_save:
|
|||||||
path: /operator/canned-message/{message_id}/edit
|
path: /operator/canned-message/{message_id}/edit
|
||||||
defaults:
|
defaults:
|
||||||
_controller: Mibew\Controller\CannedMessageController::submitEditFormAction
|
_controller: Mibew\Controller\CannedMessageController::submitEditFormAction
|
||||||
_access_check: Mibew\AccessControl\Check\LoggedInCheck
|
_access_check: Mibew\AccessControl\Check\PermissionsCheck
|
||||||
|
_access_permissions: [CAN_ADMINISTRATE]
|
||||||
requirements:
|
requirements:
|
||||||
message_id: \d{1,10}
|
message_id: \d{1,10}
|
||||||
methods: [POST]
|
methods: [POST]
|
||||||
@ -218,7 +245,8 @@ canned_messages:
|
|||||||
path: /operator/canned-message
|
path: /operator/canned-message
|
||||||
defaults:
|
defaults:
|
||||||
_controller: Mibew\Controller\CannedMessageController::indexAction
|
_controller: Mibew\Controller\CannedMessageController::indexAction
|
||||||
_access_check: Mibew\AccessControl\Check\LoggedInCheck
|
_access_check: Mibew\AccessControl\Check\PermissionsCheck
|
||||||
|
_access_permissions: [CAN_ADMINISTRATE]
|
||||||
|
|
||||||
## Groups
|
## Groups
|
||||||
group_add:
|
group_add:
|
||||||
@ -349,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
|
||||||
@ -358,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:
|
||||||
@ -368,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:
|
||||||
@ -378,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
|
||||||
@ -670,7 +698,8 @@ statistics:
|
|||||||
defaults:
|
defaults:
|
||||||
type: "by-date"
|
type: "by-date"
|
||||||
_controller: Mibew\Controller\StatisticsController::indexAction
|
_controller: Mibew\Controller\StatisticsController::indexAction
|
||||||
_access_check: Mibew\AccessControl\Check\LoggedInCheck
|
_access_check: Mibew\AccessControl\Check\PermissionsCheck
|
||||||
|
_access_permissions: [CAN_VIEWSTATISTICS]
|
||||||
requirements:
|
requirements:
|
||||||
type: by-date|by-operator|by-page
|
type: by-date|by-operator|by-page
|
||||||
|
|
||||||
@ -692,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:
|
||||||
@ -702,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:
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
@ -20,4 +20,4 @@
|
|||||||
// Force the user to specify the entry point. This should be done only when
|
// Force the user to specify the entry point. This should be done only when
|
||||||
// mod_rewrite is not used by apache.
|
// mod_rewrite is not used by apache.
|
||||||
header('HTTP/1.0 301 Moved Permanently');
|
header('HTTP/1.0 301 Moved Permanently');
|
||||||
header('Location: index.php/');
|
header('Location: index.php');
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
26
src/mibew/js/source/button_code.js
Normal file
26
src/mibew/js/source/button_code.js
Normal 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);
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
@ -49,7 +49,7 @@
|
|||||||
*/
|
*/
|
||||||
closeThread: function() {
|
closeThread: function() {
|
||||||
// Show confirmation message if can
|
// Show confirmation message if can
|
||||||
var confirmMessage = Mibew.Localization.trans('Are you sure want to leave chat?'),
|
var confirmMessage = Mibew.Localization.trans('Are you sure that you want to leave the chat?'),
|
||||||
context = this;
|
context = this;
|
||||||
if (confirmMessage !== false) {
|
if (confirmMessage !== false) {
|
||||||
Mibew.Utils.confirm(confirmMessage, function(value) {
|
Mibew.Utils.confirm(confirmMessage, function(value) {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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(/\&\;/g, '&')
|
window.location.href = link.replace(/\&\;/g, '&')
|
||||||
+ (style ? ('&style=' + style) : '');
|
+ (style ? ((link.indexOf('?') > -1 ? '&' : '?')
|
||||||
|
+ 'style=' + style) : '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
})(Mibew, Handlebars, _);
|
})(Mibew, Handlebars, _);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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
|
||||||
*/
|
*/
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -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, _);
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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"]',
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
63
src/mibew/js/source/chat/models/controls/tracked_path.js
Normal file
63
src/mibew/js/source/chat/models/controls/tracked_path.js
Normal 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, _);
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @namespace Holds all Mibew functionality
|
* @namespace Holds all Mibew Messenger functionality
|
||||||
*/
|
*/
|
||||||
var Mibew = Mibew || {};
|
var Mibew = Mibew || {};
|
||||||
|
|
||||||
@ -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);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -203,7 +219,6 @@ var Mibew = Mibew || {};
|
|||||||
Mibew.ChatPopup.init = function(options) {
|
Mibew.ChatPopup.init = function(options) {
|
||||||
var canUseIFrame = (window.postMessage && options.preferIFrame),
|
var canUseIFrame = (window.postMessage && options.preferIFrame),
|
||||||
Popup = canUseIFrame ? Mibew.ChatPopup.IFrame : Mibew.ChatPopup.Window;
|
Popup = canUseIFrame ? Mibew.ChatPopup.IFrame : Mibew.ChatPopup.Window;
|
||||||
|
|
||||||
Mibew.Objects.ChatPopups[options.id] = new Popup(options);
|
Mibew.Objects.ChatPopups[options.id] = new Popup(options);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -260,6 +275,13 @@ var Mibew = Mibew || {};
|
|||||||
* @type {Boolean}
|
* @type {Boolean}
|
||||||
*/
|
*/
|
||||||
this.modSecurity = options.modSecurity || false;
|
this.modSecurity = options.modSecurity || false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Chat style
|
||||||
|
* @type {String}
|
||||||
|
*/
|
||||||
|
this.styleName = options.style;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -292,6 +314,18 @@ 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.
|
||||||
|
* @type {Node}
|
||||||
|
*/
|
||||||
|
this.wrapperDiv = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Popup iframe DOM Element.
|
* Popup iframe DOM Element.
|
||||||
* @type {Node}
|
* @type {Node}
|
||||||
@ -316,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();
|
||||||
@ -327,13 +367,20 @@ var Mibew = Mibew || {};
|
|||||||
if (openedChatUrl) {
|
if (openedChatUrl) {
|
||||||
// The chat was not closed so the popup should be reopened when a
|
// The chat was not closed so the popup should be reopened when a
|
||||||
// new page is visited.
|
// new page is visited.
|
||||||
this.open(openedChatUrl);
|
this.safeOpen(openedChatUrl);
|
||||||
// Check minification status of the popup and toggle it if needed.
|
|
||||||
var minifiedPopup = Mibew.Utils.readCookie('mibew-chat-frame-minified-' + this.id);
|
|
||||||
if (minifiedPopup === 'true') {
|
|
||||||
this.toggle();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check 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.
|
||||||
@ -384,20 +431,31 @@ var Mibew = Mibew || {};
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.iframe) {
|
if (this.cookiesBlocked) {
|
||||||
// Create new iframe.
|
// Last resort. Replace this iframe-based popup with window-based popup
|
||||||
|
// and try to open a chat in a separate window.
|
||||||
|
Mibew.Objects.ChatPopups[this.id] = new Mibew.ChatPopup.Window(this.options);
|
||||||
|
Mibew.Objects.ChatPopups[this.id].open(url);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this.wrapperDiv) {
|
||||||
|
// Create new iframe and its wrapper.
|
||||||
// There is a bug in IE <= 7 that make "name" attribute unchangeble
|
// There is a bug in IE <= 7 that make "name" attribute unchangeble
|
||||||
// for elements that already exist. Thus a temporary div is used
|
// for elements that already exist. Thus a temporary div is used
|
||||||
// here as a workaround.
|
// here as a workaround.
|
||||||
var tmpDiv = document.createElement('div');
|
this.wrapperDiv = document.createElement('div');
|
||||||
tmpDiv.innerHTML = '<iframe name="mibewChat' + this.id + '"></iframe>';
|
this.wrapperDiv.className = 'mibew-chat-wrapper';
|
||||||
|
this.wrapperDiv.setAttribute('id', 'mibew-chat-wrapper-' + this.id);
|
||||||
|
this.wrapperDiv.style.display = 'none';
|
||||||
|
this.wrapperDiv.innerHTML = '<iframe name="mibewChat' + this.id + '"></iframe>';
|
||||||
|
|
||||||
this.iframe = tmpDiv.getElementsByTagName('iframe')[0];
|
this.iframe = this.wrapperDiv.getElementsByTagName('iframe')[0];
|
||||||
this.iframe.setAttribute('id', 'mibew-chat-frame-' + this.id);
|
this.iframe.setAttribute('id', 'mibew-chat-frame-' + this.id);
|
||||||
this.iframe.className = 'mibew-chat-frame';
|
this.iframe.className = 'mibew-chat-frame';
|
||||||
this.iframe.setAttribute('frameBorder', 0);
|
this.iframe.setAttribute('frameBorder', 0);
|
||||||
this.iframe.style.display = 'none';
|
|
||||||
document.getElementsByTagName('body')[0].appendChild(this.iframe);
|
document.getElementsByTagName('body')[0].appendChild(this.wrapperDiv);
|
||||||
|
|
||||||
// Setup toggle element. As it's not a part of the iframe, it should be
|
// Setup toggle element. As it's not a part of the iframe, it should be
|
||||||
// treated separately.
|
// treated separately.
|
||||||
@ -406,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();
|
||||||
@ -415,9 +473,38 @@ var Mibew = Mibew || {};
|
|||||||
document.getElementsByTagName('body')[0].appendChild(this.toggleDiv);
|
document.getElementsByTagName('body')[0].appendChild(this.toggleDiv);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.iframe.style.display = 'block';
|
this.wrapperDiv.style.display = 'block';
|
||||||
|
this.toggleDiv.style.display = 'block';
|
||||||
this.iframe.src = url || this.buildChatUrl();
|
this.iframe.src = url || this.buildChatUrl();
|
||||||
this.isOpened = true;
|
this.isOpened = true;
|
||||||
|
|
||||||
|
// Store style name in case we need it during iframe reopening
|
||||||
|
Mibew.Utils.createCookie('mibew-chat-frame-style-' + this.id, this.styleName);
|
||||||
|
|
||||||
|
// Check minification status of the popup and toggle it if needed.
|
||||||
|
var minifiedPopup = Mibew.Utils.readCookie('mibew-chat-frame-minified-' + this.id);
|
||||||
|
if (minifiedPopup === 'true') {
|
||||||
|
this.toggle();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check chat URL via special request, open the chat if check passes,
|
||||||
|
* close the popup if the check fails.
|
||||||
|
*
|
||||||
|
* @param {String} [url] The URL to open in the popup
|
||||||
|
*/
|
||||||
|
Mibew.ChatPopup.IFrame.prototype.safeOpen = function(url) {
|
||||||
|
var check = Mibew.Utils.loadScript(url + '/check', 'mibew-check-iframe-' + this.id);
|
||||||
|
check.popup = this;
|
||||||
|
check.url = url;
|
||||||
|
var style = Mibew.Utils.readCookie('mibew-chat-frame-style-' + this.id);
|
||||||
|
check.onload = function() {
|
||||||
|
this.popup.open(this.url + (style ? '?style=' + style : ''));
|
||||||
|
};
|
||||||
|
check.onerror = function() {
|
||||||
|
this.popup.close();
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -429,19 +516,19 @@ var Mibew = Mibew || {};
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.iframe.style.display = 'none';
|
this.wrapperDiv.style.display = 'none';
|
||||||
this.iframe.src = '';
|
this.iframe.src = '';
|
||||||
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);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Toggles the popup.
|
* Toggles the popup.
|
||||||
*/
|
*/
|
||||||
Mibew.ChatPopup.IFrame.prototype.toggle = function() {
|
Mibew.ChatPopup.IFrame.prototype.toggle = function() {
|
||||||
this.iframe.style.display = this.isMinified ? "block" : "none";
|
this.wrapperDiv.style.display = this.isMinified ? "block" : "none";
|
||||||
this.isMinified = !this.isMinified;
|
this.isMinified = !this.isMinified;
|
||||||
this.toggleDiv.className = 'mibew-chat-frame-toggle mibew-chat-frame-toggle-'
|
this.toggleDiv.className = 'mibew-chat-frame-toggle mibew-chat-frame-toggle-'
|
||||||
+ (this.isMinified ? 'off' : 'on');
|
+ (this.isMinified ? 'off' : 'on');
|
||||||
@ -471,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,
|
||||||
@ -519,7 +610,6 @@ var Mibew = Mibew || {};
|
|||||||
// which is opened in iframe popup.
|
// which is opened in iframe popup.
|
||||||
Mibew.Utils.addEventListener(window, 'message', function(event) {
|
Mibew.Utils.addEventListener(window, 'message', function(event) {
|
||||||
var matches = /^mibew-chat-started\:mibewChat([0-9A-Za-z]+)\:(.*)$/.exec(event.data);
|
var matches = /^mibew-chat-started\:mibewChat([0-9A-Za-z]+)\:(.*)$/.exec(event.data);
|
||||||
|
|
||||||
if (matches) {
|
if (matches) {
|
||||||
Mibew.Utils.createCookie('mibew-chat-frame-' + matches[1], matches[2]);
|
Mibew.Utils.createCookie('mibew-chat-frame-' + matches[1], matches[2]);
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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(
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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, "&")
|
||||||
|
.replace(/</g, "<")
|
||||||
|
.replace(/>/g, ">")
|
||||||
|
.replace(/"/g, """)
|
||||||
|
.replace(/'/g, "'");
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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);
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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();
|
||||||
@ -49,7 +57,18 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updatePrivacyPolicy() {
|
||||||
|
if ($("#enable-privacy-policy").is(":checked")) {
|
||||||
|
$(".under-privacy-policy").show();
|
||||||
|
} else {
|
||||||
|
$(".under-privacy-policy").hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
|
$("#user-can-send-email").change(function() {
|
||||||
|
updateSendEmail();
|
||||||
|
});
|
||||||
$("#enable-presurvey").change(function() {
|
$("#enable-presurvey").change(function() {
|
||||||
updateSurvey();
|
updateSurvey();
|
||||||
});
|
});
|
||||||
@ -62,9 +81,14 @@
|
|||||||
$("#enable-tracking").change(function() {
|
$("#enable-tracking").change(function() {
|
||||||
updateTracking();
|
updateTracking();
|
||||||
});
|
});
|
||||||
|
$("#enable-privacy-policy").change(function() {
|
||||||
|
updatePrivacyPolicy();
|
||||||
|
});
|
||||||
|
updateSendEmail();
|
||||||
updateSurvey();
|
updateSurvey();
|
||||||
updateSSL();
|
updateSSL();
|
||||||
updateGroups();
|
updateGroups();
|
||||||
updateTracking();
|
updateTracking();
|
||||||
|
updatePrivacyPolicy();
|
||||||
});
|
});
|
||||||
})(jQuery);
|
})(jQuery);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* This file is a part of Mibew Messenger.
|
* This file is a part of Mibew Messenger.
|
||||||
*
|
*
|
||||||
* Copyright 2005-2017 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.
|
||||||
@ -26,7 +26,7 @@
|
|||||||
function MibewAPI(interaction) {
|
function MibewAPI(interaction) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Version of the MIBEW API protocol implemented by the object
|
* Version of the Mibew API protocol implemented by the object
|
||||||
*/
|
*/
|
||||||
this.protocolVersion = "1.0";
|
this.protocolVersion = "1.0";
|
||||||
|
|
||||||
@ -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;
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user