Compare commits

..

No commits in common. "master" and "v3.1.0" have entirely different histories.

538 changed files with 720 additions and 8415 deletions

16
.gitignore vendored
View File

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

View File

@ -11,7 +11,7 @@ This repository contains the core of Mibew Messenger application.
## Server requirements
1. A webserver or web hosting account running on any major Operating System
2. PHP (7.2.5 and above) with PDO, pdo_mysql, cURL, mbstring and gd extensions
2. PHP (5.4 and above) with PDO, pdo_mysql, cURL, mbstring and gd extensions
3. MySQL 5.0 and above
## Build from sources
@ -47,25 +47,16 @@ 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
#### Ready for production use
1. [Mibew Advanced Button plugin](https://github.com/Mibew/advanced-button-plugin)
2. [Mibew Auto Invite plugin](https://github.com/Mibew/auto-invite-plugin)
3. [Mibew Auto Reply plugin](https://github.com/Mibew/auto-reply-plugin)
4. [Mibew Broadcast plugin](https://github.com/Mibew/broadcast-plugin)
5. [Mibew Bulk Logs Operations plugin](https://github.com/Mibew/bulk-logs-operations-plugin)
6. [Mibew Button Refresh plugin](https://github.com/Mibew/button-refresh-plugin)
7. [Mibew Emoji plugin](https://github.com/Mibew/emoji-plugin)
8. [Mibew Filter Visitors By Operator Code plugin](https://github.com/Mibew/filter-visitors-by-operator-code-plugin)
9. [Mibew First Message plugin](https://github.com/Mibew/first-message-plugin)
10. [Mibew Geo IP plugin](https://github.com/Mibew/geo-ip-plugin)
11. [Mibew Google Maps plugin](https://github.com/Mibew/google-maps-plugin)
12. [Mibew Open Street Map plugin](https://github.com/Mibew/open-street-map-plugin)
13. [Mibew Operator Status plugin](https://github.com/Mibew/mibew-operator-status-plugin)
14. [Mibew Purge History plugin](https://github.com/Mibew/purge-history-plugin)
15. [Mibew Real Ban plugin](https://github.com/Mibew/real-ban-plugin)
16. [Mibew Slack plugin](https://github.com/Mibew/mibew_slack)
17. [Mibew Title Notification plugin](https://github.com/Mibew/title-notification-plugin)
1. [Mibew Emoji plugin](https://github.com/Mibew/emoji-plugin)
2. [Mibew Geo IP plugin](https://github.com/Mibew/geo-ip-plugin)
3. [Mibew Google Maps plugin](https://github.com/Mibew/google-maps-plugin)
4. [Mibew Operator Status plugin](https://github.com/Mibew/mibew-operator-status-plugin)
5. [Mibew Purge History plugin](https://github.com/Mibew/purge-history-plugin)
6. [Mibew Real Ban plugin](https://github.com/Mibew/real-ban-plugin)
7. [Mibew Slack plugin](https://github.com/Mibew/mibew_slack)
8. [Mibew Title Notification plugin](https://github.com/Mibew/title-notification-plugin)
#### Not ready for production use (not stable, broken, obsolete, etc.)
1. [Mibew External API plugin](https://github.com/Mibew/external-api-plugin)
1. [Mibew Button Refresh plugin](https://github.com/Mibew/button-refresh-plugin)
2. [Mibew External API plugin](https://github.com/Mibew/external-api-plugin)
3. [Mibew First Message plugin](https://github.com/Mibew/first-message-plugin)

View File

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

View File

@ -1,6 +1,6 @@
{
"name": "mibew/mibew",
"version": "3.6.0",
"version": "3.1.0",
"description": "Mibew Messenger - open-source live support application",
"type": "project",
"homepage": "https://mibew.org",
@ -17,35 +17,25 @@
"forum": "https://mibew.org/forums",
"source": "https://github.com/mibew/mibew"
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/mibew/handlebars.php"
},
{
"type": "vcs",
"url": "https://github.com/mibew/handlebars.php-helpers"
}
],
"require": {
"mibew/handlebars.php": "~0.10.5",
"mibew/handlebars.php-helpers": "1.*",
"symfony/http-foundation": "4.4.*",
"symfony/routing": "4.4.*",
"symfony/config": "4.4.*",
"symfony/yaml": "^5.2",
"xamin/handlebars.php": "~0.10.3",
"justblackbird/handlebars.php-helpers": "1.*",
"symfony/http-foundation": "2.6.*",
"symfony/routing": "2.6.*",
"symfony/config": "2.6.*",
"symfony/yaml": "2.6.*",
"symfony/translation": "2.6.*",
"tedivm/stash": "0.12.*",
"mibew/html5": "1.1.*",
"canteen/html5": "1.1.*",
"vierbergenlars/php-semver": "3.0.*",
"swiftmailer/swiftmailer": "~5.4.0",
"ua-parser/uap-php": "^3.9",
"ua-parser/uap-php": "~3.4.1",
"true/punycode": "~1.1"
},
"require-dev": {
"squizlabs/php_codesniffer": "3.*"
"squizlabs/php_codesniffer": "~2.3.3"
},
"config": {
"vendor-dir": "mibew/vendor"
}
}
}

View File

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

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

View File

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

View File

@ -1 +1 @@
Mibew/3.6.0
Mibew/3.0.0

View File

@ -104,7 +104,7 @@ requestcallback:
fields:
callbackid: "int NOT NULL auto_increment PRIMARY KEY"
token: "varchar(64) NOT NULL DEFAULT ''"
func: "varchar(64) NOT NULL"
function: "varchar(64) NOT NULL"
arguments: "varchar(1024)"
indexes:
token: [token]

View File

@ -49,14 +49,6 @@ chat_user:
thread_id: \d{1,10}
token: \d{1,10}
chat_user_check:
path: /chat/{thread_id}/{token}/check
defaults:
_controller: Mibew\Controller\Chat\UserChatController::checkAction
requirements:
thread_id: \d{1,10}
token: \d{1,10}
chat_user_invitation:
path: /chat/invitation
defaults:
@ -102,11 +94,6 @@ chat_user_start:
defaults:
_controller: Mibew\Controller\Chat\UserChatController::startAction
chat_user_cookie_set_permission:
path: /chat/cookies-set-permission
defaults:
_controller: Mibew\Controller\Chat\UserChatController::cookieSetPermissionAction
# Pages that are available for all users
button:
path: /b
@ -377,7 +364,7 @@ locale_disable:
_access_check: Mibew\AccessControl\Check\PermissionsCheck
_access_permissions: [CAN_ADMINISTRATE]
requirements:
locale: "[a-z\\-]{2,5}"
locale: "[a-z\-]{2,5}"
locale_edit:
path: /operator/locale/{locale}/edit
@ -386,7 +373,7 @@ locale_edit:
_access_check: Mibew\AccessControl\Check\PermissionsCheck
_access_permissions: [CAN_ADMINISTRATE]
requirements:
locale: "[a-z\\-]{2,5}"
locale: "[a-z\-]{2,5}"
methods: [GET]
locale_edit_save:
@ -396,7 +383,7 @@ locale_edit_save:
_access_check: Mibew\AccessControl\Check\PermissionsCheck
_access_permissions: [CAN_ADMINISTRATE]
requirements:
locale: "[a-z\\-]{2,5}"
locale: "[a-z\-]{2,5}"
methods: [POST]
locale_enable:
@ -406,7 +393,7 @@ locale_enable:
_access_check: Mibew\AccessControl\Check\PermissionsCheck
_access_permissions: [CAN_ADMINISTRATE]
requirements:
locale: "[a-z\\-]{2,5}"
locale: "[a-z\-]{2,5}"
locales:
path: /operator/locale
@ -721,7 +708,7 @@ translation_edit:
_access_check: Mibew\AccessControl\Check\PermissionsCheck
_access_permissions: [CAN_ADMINISTRATE]
requirements:
string_id: "\\d{1,10}"
string_id: "\d{1,10}"
methods: [GET]
translation_edit_save:
@ -731,7 +718,7 @@ translation_edit_save:
_access_check: Mibew\AccessControl\Check\PermissionsCheck
_access_permissions: [CAN_ADMINISTRATE]
requirements:
string_id: "\\d{1,10}"
string_id: "\d{1,10}"
methods: [POST]
translation_export:

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2023 the original author or authors.
* Copyright 2005-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -101,15 +101,6 @@
windowParams: options.windowsParams.history
});
ctrlsCollection.add(controls.history);
if (options.links.tracked) {
controls.tracked_path = new Mibew.Models.TrackedPathControl({
weight: 170,
link: options.links.tracked,
windowParams: options.windowsParams.trackedPath
});
ctrlsCollection.add(controls.tracked_path);
}
}
// Create toggle sound button

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2023 the original author or authors.
* Copyright 2005-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -57,27 +57,11 @@ var Mibew = Mibew || {};
* omitted a session cookie will be created.
*/
Mibew.Utils.createCookie = function(name, value, expires) {
if (navigator.cookieEnabled) {
var domain_parts = document.location.hostname.split('.').reverse();
var domain = domain_parts[0];
var position = 0;
do {
document.cookie = "" + name + "=" + value + "; "
+ "path=/; "
+ (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);
}
var domain = /([^\.]+\.[^\.]+)$/.exec(document.location.hostname);
document.cookie = "" + name + "=" + value + "; "
+ "path=/; "
+ (domain ? ("domain=" + domain[1] + "; ") : '')
+ (expires ? ('expires=' + expires.toUTCString() + '; ') : '');
};
/**
@ -219,6 +203,7 @@ var Mibew = Mibew || {};
Mibew.ChatPopup.init = function(options) {
var canUseIFrame = (window.postMessage && options.preferIFrame),
Popup = canUseIFrame ? Mibew.ChatPopup.IFrame : Mibew.ChatPopup.Window;
Mibew.Objects.ChatPopups[options.id] = new Popup(options);
};
@ -275,13 +260,6 @@ var Mibew = Mibew || {};
* @type {Boolean}
*/
this.modSecurity = options.modSecurity || false;
/**
* Chat style
* @type {String}
*/
this.styleName = options.style;
};
/**
@ -314,12 +292,6 @@ var Mibew = Mibew || {};
// Call parent constructor.
BasePopup.call(this, options);
/**
* Store options in case we need some of them later.
* @type {Object}
*/
this.options = options;
/**
* Wrapper for popup iframe DOM Element.
* @type {Node}
@ -350,12 +322,6 @@ var Mibew = Mibew || {};
*/
this.isMinified = false;
/**
* Indicates if cookies are blocked.
* @type {Boolean}
*/
this.cookiesBlocked = false;
// Load default styles. These styles hide the popup while real styles
// are loading.
this.attachDefaultStyles();
@ -367,20 +333,13 @@ var Mibew = Mibew || {};
if (openedChatUrl) {
// The chat was not closed so the popup should be reopened when a
// new page is visited.
this.safeOpen(openedChatUrl);
this.open(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.
@ -431,14 +390,6 @@ var Mibew = Mibew || {};
return;
}
if (this.cookiesBlocked) {
// Last resort. Replace this iframe-based popup with window-based popup
// and try to open a chat in a separate window.
Mibew.Objects.ChatPopups[this.id] = new Mibew.ChatPopup.Window(this.options);
Mibew.Objects.ChatPopups[this.id].open(url);
return;
}
if (!this.wrapperDiv) {
// Create new iframe and its wrapper.
// There is a bug in IE <= 7 that make "name" attribute unchangeble
@ -464,7 +415,7 @@ var Mibew = Mibew || {};
this.toggleDiv.className = 'mibew-chat-frame-toggle mibew-chat-frame-toggle-on';
Mibew.Utils.addEventListener(this.toggleDiv, 'click', function(event) {
var popups = Mibew.Objects.ChatPopups,
matches = /^mibew-chat-frame-toggle-([0-9A-Za-z]+)$/.exec(this.id);
matches = /^mibew-chat-frame-toggle-([0-9A-Za-z]+)$/.exec(this.id);
if (matches && popups[matches[1]]) {
popups[matches[1]].toggle();
@ -477,34 +428,6 @@ var Mibew = Mibew || {};
this.toggleDiv.style.display = 'block';
this.iframe.src = url || this.buildChatUrl();
this.isOpened = true;
// Store style name in case we need it during iframe reopening
Mibew.Utils.createCookie('mibew-chat-frame-style-' + this.id, this.styleName);
// Check minification status of the popup and toggle it if needed.
var minifiedPopup = Mibew.Utils.readCookie('mibew-chat-frame-minified-' + this.id);
if (minifiedPopup === 'true') {
this.toggle();
}
};
/**
* Check chat URL via special request, open the chat if check passes,
* close the popup if the check fails.
*
* @param {String} [url] The URL to open in the popup
*/
Mibew.ChatPopup.IFrame.prototype.safeOpen = function(url) {
var check = Mibew.Utils.loadScript(url + '/check', 'mibew-check-iframe-' + this.id);
check.popup = this;
check.url = url;
var style = Mibew.Utils.readCookie('mibew-chat-frame-style-' + this.id);
check.onload = function() {
this.popup.open(this.url + (style ? '?style=' + style : ''));
};
check.onerror = function() {
this.popup.close();
};
};
/**
@ -521,7 +444,7 @@ var Mibew = Mibew || {};
this.isOpened = false;
this.toggleDiv.style.display = 'none';
Mibew.Utils.deleteCookie('mibew-chat-frame-' + this.id);
Mibew.Utils.deleteCookie('mibew-chat-frame-minified-' + this.id);
Mibew.Utils.deleteCookie('mibew-chat-frame-minified' + this.id);
};
/**
@ -558,10 +481,6 @@ var Mibew = Mibew || {};
* value is omitted, the chat initialization URL will be loaded.
*/
Mibew.ChatPopup.Window.prototype.open = function(url) {
// Windows is already opened, nothing to do.
if (this.window != null && !this.window.closed) {
return;
}
this.window = window.open(
url || this.buildChatUrl(),
'mibewChat' + this.id,
@ -610,6 +529,7 @@ var Mibew = Mibew || {};
// which is opened in iframe popup.
Mibew.Utils.addEventListener(window, 'message', function(event) {
var matches = /^mibew-chat-started\:mibewChat([0-9A-Za-z]+)\:(.*)$/.exec(event.data);
if (matches) {
Mibew.Utils.createCookie('mibew-chat-frame-' + matches[1], matches[2]);
}

View File

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

View File

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

View File

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

View File

@ -1,7 +1,7 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2023 the original author or authors.
* Copyright 2005-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -41,7 +41,7 @@
/**
* Register 'urlReplace' Handlebars helper.
*
* This helper seeks URLs and replaces them by 'a' tag
* This helper serch URLs and replace them by 'a' tag
*/
Handlebars.registerHelper('urlReplace', function(text) {
return new Handlebars.SafeString(

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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