diff --git a/.gitignore b/.gitignore index 7f9b38e5..e69de29b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +0,0 @@ -bin -src/messenger/.idea/workspace.xml -src/messenger/webim/install/package -src/messenger/absent_* -src/messenger/release* -src/mibewjava/.idea/workspace.xml -src/mibewjava/org.mibew.notifier/resources/ -mibew.ini -.DS_Store diff --git a/docs/design/abstract_button.psd b/docs/design/abstract_button.psd deleted file mode 100644 index 1e6589c1..00000000 Binary files a/docs/design/abstract_button.psd and /dev/null differ diff --git a/docs/design/abstract_button_narrow.psd b/docs/design/abstract_button_narrow.psd deleted file mode 100644 index c5da078e..00000000 Binary files a/docs/design/abstract_button_narrow.psd and /dev/null differ diff --git a/docs/design/abstract_rounded.psd b/docs/design/abstract_rounded.psd deleted file mode 100644 index 49e8568c..00000000 Binary files a/docs/design/abstract_rounded.psd and /dev/null differ diff --git a/docs/design/he/he_off.psd b/docs/design/he/he_off.psd deleted file mode 100644 index d1a95439..00000000 Binary files a/docs/design/he/he_off.psd and /dev/null differ diff --git a/docs/design/he/he_on.psd b/docs/design/he/he_on.psd deleted file mode 100644 index f816e2c5..00000000 Binary files a/docs/design/he/he_on.psd and /dev/null differ diff --git a/docs/design/logo.psd b/docs/design/logo.psd deleted file mode 100644 index f30d325b..00000000 Binary files a/docs/design/logo.psd and /dev/null differ diff --git a/docs/design/logo/16x16.gif b/docs/design/logo/16x16.gif deleted file mode 100644 index 869935e9..00000000 Binary files a/docs/design/logo/16x16.gif and /dev/null differ diff --git a/docs/design/logo/32x32.gif b/docs/design/logo/32x32.gif deleted file mode 100644 index 315d547a..00000000 Binary files a/docs/design/logo/32x32.gif and /dev/null differ diff --git a/docs/design/logo/64x64.gif b/docs/design/logo/64x64.gif deleted file mode 100644 index a78219c4..00000000 Binary files a/docs/design/logo/64x64.gif and /dev/null differ diff --git a/docs/design/message_history.psd b/docs/design/message_history.psd deleted file mode 100644 index 625b1740..00000000 Binary files a/docs/design/message_history.psd and /dev/null differ diff --git a/docs/design/shablon-knopka_en.psd b/docs/design/shablon-knopka_en.psd deleted file mode 100644 index bc509121..00000000 Binary files a/docs/design/shablon-knopka_en.psd and /dev/null differ diff --git a/src/messenger/.idea/.name b/src/messenger/.idea/.name deleted file mode 100644 index 4c926610..00000000 --- a/src/messenger/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -messenger \ No newline at end of file diff --git a/src/messenger/.idea/codeStyleSettings.xml b/src/messenger/.idea/codeStyleSettings.xml deleted file mode 100644 index de6382eb..00000000 --- a/src/messenger/.idea/codeStyleSettings.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - diff --git a/src/messenger/.idea/encodings.xml b/src/messenger/.idea/encodings.xml deleted file mode 100644 index 55374710..00000000 --- a/src/messenger/.idea/encodings.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/src/messenger/.idea/inspectionProfiles/Project_Default.xml b/src/messenger/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index c66df003..00000000 --- a/src/messenger/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/messenger/.idea/inspectionProfiles/profiles_settings.xml b/src/messenger/.idea/inspectionProfiles/profiles_settings.xml deleted file mode 100644 index 3b312839..00000000 --- a/src/messenger/.idea/inspectionProfiles/profiles_settings.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/messenger/.idea/messenger.iml b/src/messenger/.idea/messenger.iml deleted file mode 100644 index 54192b37..00000000 --- a/src/messenger/.idea/messenger.iml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/src/messenger/.idea/misc.xml b/src/messenger/.idea/misc.xml deleted file mode 100644 index 11e74ae4..00000000 --- a/src/messenger/.idea/misc.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - http://www.w3.org/1999/xhtml - - - - diff --git a/src/messenger/.idea/modules.xml b/src/messenger/.idea/modules.xml deleted file mode 100644 index 3160e9b9..00000000 --- a/src/messenger/.idea/modules.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/src/messenger/.idea/projectCodeStyle.xml b/src/messenger/.idea/projectCodeStyle.xml deleted file mode 100644 index 596456e4..00000000 --- a/src/messenger/.idea/projectCodeStyle.xml +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - diff --git a/src/messenger/.idea/scopes/scope_settings.xml b/src/messenger/.idea/scopes/scope_settings.xml deleted file mode 100644 index 922003b8..00000000 --- a/src/messenger/.idea/scopes/scope_settings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/messenger/.idea/vcs.xml b/src/messenger/.idea/vcs.xml deleted file mode 100644 index 9ab281ac..00000000 --- a/src/messenger/.idea/vcs.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/src/messenger/check_translation.pl b/src/messenger/check_translation.pl deleted file mode 100755 index 1212e8e8..00000000 --- a/src/messenger/check_translation.pl +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/perl - -sub read_transl($) { - my($from) = @_; - my %translation = (); - open(IN, "webim/locales/$from/properties"); - while() { - chomp; - if(/^([\w\.]+)=(.*)$/) { - if($1 ne "encoding" && $1 ne "output_charset" && $1 ne "output_encoding") { - $translation{$1} = $2; - } - } else { - die "wrong line in $from: $_\n"; - } - } - close(IN); - return %translation; -} - -%tr_en = read_transl("en"); - -@all_keys = keys %tr_en; - -sub check_transl($%) { - my($name,%tr) = @_; - print "checking $name...\n"; - my @totransl = (); - for $key (@all_keys) { - unless(exists $tr{$key}) { - push @totransl, "$key=".$tr_en{$key}; - } - } - for $key(keys %tr) { - unless(exists $tr_en{$key}) { - print "unknown key in $name: $key\n"; - } - } - if($#totransl >= 0) { - print "@{[$#totransl+1]} lines absent in locales/$name/properties\n"; - open(OUT, "> absent_$name"); - for(sort @totransl) { - print OUT "$_\n"; - } - close(OUT); - } -} - -check_transl("ru", read_transl("ru")); -check_transl("fr", read_transl("fr")); -check_transl("de", read_transl("de")); -check_transl("sp", read_transl("sp")); -check_transl("it", read_transl("it")); -check_transl("pl", read_transl("pl")); -check_transl("zh-tw", read_transl("zh-tw")); - diff --git a/src/messenger/compile_js b/src/messenger/compile_js deleted file mode 100755 index 79b63a56..00000000 --- a/src/messenger/compile_js +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -cd webim/js/source -ant -rm -rf bin diff --git a/src/messenger/compute_resources.pl b/src/messenger/compute_resources.pl deleted file mode 100755 index 01d53f06..00000000 --- a/src/messenger/compute_resources.pl +++ /dev/null @@ -1,245 +0,0 @@ -#!/usr/bin/perl - -use Digest::MD5 qw(md5 md5_hex md5_base64); - -@rules = ( - ["redirect(ed)?\\.tpl", 1], - ["\\.tpl", 0], - - ["view/license.php", 0], - ["view/themes.php", 2], - ["view/translate.php", 2], - ["view/translatelist.php", 2], - ["view/settings.php", 2], - ["view/updates.php", 2], - ["view/features.php", 2], - ["view/performance.php", 2], - ["view/avatar.php", 2], - ["view/permissions.php", 2], - ["view/agent.php", 2], - ["view/agents.php", 2], - ["view/group.php", 2], - ["view/groupmembers.php", 2], - ["view/groups.php", 2], - ["view/operator_groups.php", 2], - ["view/gen_button.php", 2], - ["view/install_err.php", 2], - ["view/install_index.php", 2], - ["view/.*\\.php", 1], - - ["install/.*\\.php", 2], - - ["operator/themes.php", 2], - ["operator/translate.php", 2], - ["operator/settings.php", 2], - ["operator/updates.php", 2], - ["operator/features.php", 2], - ["operator/performance.php", 2], - ["operator/avatar.php", 2], - ["operator/permissions.php", 2], - ["operator/operator.php", 2], - ["operator/operators.php", 2], - ["operator/group.php", 2], - ["operator/groupmembers.php", 2], - ["operator/groups.php", 2], - ["operator/opgroups.php", 2], - ["operator/getcode.php", 2], - ["operator/.*\\.php", 1], - - ["webim/client.php", 0], - ["webim/leavemessage.php", 0], - ["webim/captcha.php", 0], - ["webim/license.php", 0], - ["webim/mail.php", 0], - - ["libs/operator_settings.php", 2], - ["webim/libs/chat.php", 0], - ["libs/pagination.php", 1], - ["libs/settings.php", 2], - ["libs/groups.php", 2], - ["libs/demothread.php", 2], - - ["webim/thread.php", 0], - ["webim/b.php", 0], - ["webim/button.php", 0], - ["webim/index.php", 0], - - ["webim/libs/.*\\.php", 1], -); - -%messagekeys = ( - "localeid" => 0, - "output_charset" => 0, - "output_encoding" => 0, - "harderrors.header" => 0, - - "errors.required" => 0, - "errors.wrong_field" => 0, - "errors.file.move.error" => 2, - "errors.invalid.file.type" => 2, - "errors.file.size.exceeded" => 2, - - "permission.admin" => 1, - "permission.takeover" => 1, - "permission.viewthreads" => 1, - - "chat.thread.state_chatting_with_agent" => 1, - "chat.thread.state_closed" => 1, - "chat.thread.state_loading" => 1, - "chat.thread.state_wait" => 1, - "chat.thread.state_wait_for_another_agent" => 1, - - "clients.queue.chat" => 1, - "clients.queue.prio" => 1, - "clients.queue.wait" => 1, -); - - -$webimPath = "webim"; - -%urls = (); - -%usermessages = (); -%operatormessages = (); -$current_level = 0; - -sub usemsg($) { - my ($m) = @_; - $messagekeys{$m} = exists $messagekeys{$m} && $messagekeys{$m} < $current_level ? $messagekeys{$m} : $current_level; - if($current_level == -1) { - print " .. $m\n"; - } -} - -sub file_content($) { - my $input = $_[0]; - open( IN1, "< $input" ) or die "cannot find file $input"; - my $oldslash = $/; - $/ = EOI; - $content = ; - close( IN1 ); - if($content =~ s/\r//g) { - open( OUT1, "> $input") or die "cannot fix $input"; - print OUT1 $content; - close(OUT1); - } - $/ = $oldslash; - return $content; -} - -sub process_tpl($) { - my ($filename) = @_; - my $m = file_content($filename); - while( $m =~ /\${msg:([\w\.]+)(,[\w\.]+)?}/g ) { - usemsg($1); - } - while( $m =~ /\${url:([\w\.]+)(,[\w\.]+)?}/g ) { - usemsg($1); - $urls{"%$1"} = 1; - } -} - -sub process_php($) { - my ($source) = @_; - my $content = file_content($source); - $content =~ s/<\?xml version=\\"1\.0\\" encoding=\\"UTF-8\\"\?>//; - - while( $content =~ s/<\?(?!xml)(.*?)\?>//s ) { - my $inner = $1; - while($inner =~ s/(getlocal|getstring|no_field)2?_?\((.*?)[,\)]//s) { - my $firstarg = $2; - if( $firstarg =~ /^["']([\w\.]+)['"]$/) { - usemsg($1); - } elsif($firstarg =~ /^\$\w+$/ || $firstarg eq '"$var.header"' || $firstarg eq '"permission.$permid"' || $firstarg eq '$threadstate_key[$thread[\'istate\']]') { - # skip - } else { - print "> unknown: $firstarg\n"; - } - } - } -} - -sub file_checksum($) { - my ($source) = @_; - if($source =~ /\.(png|gif|jpg|ico|wav)$/ || $source =~ /config\.php$/) { - return "-"; - } - - my $content = file_content($source); - return md5_hex($content); -} - -@allsources = (); - -sub process_one($) { - my($source) = @_; - push @allsources, $source unless $source =~ /$webimPath\/locales/ && $source !~ /$webimPath\/locales\/(en|names)/ || $source =~ /\/package$/; - - if($source !~ /\.(php|tpl)$/) { - return; - } - - $current_level = -1; - - A: foreach $rule (@rules) { - my $key = $$rule[0]; - if($source =~ /$key/) { - $current_level = $$rule[1]; - last A; - } - } - if($current_level < 0 || $current_level > 2) { - print "not detected for: $source\n"; - $current_level = 0; - } - - if($source =~ /\.php$/) { - # print "$source ($current_level)\n"; - process_php($source); - } elsif($source =~ /\.tpl$/) { - process_tpl($source); - } else { - #print ". $source\n"; - } -} - -sub process_files($) { - my($from) = @_; - opendir(DIR, $from) || die "can't opendir $from: $!"; - my @content = readdir(DIR); - closedir DIR; - - for(grep { -f "$from/$_" && ($_ !~ /^\./ || $_ eq ".htaccess") } @content) { - process_one("$from/$_"); - } - for(grep { -d "$from/$_" && $_ !~ /^\./ } @content) { - process_files("$from/$_"); - } -} - -process_files($webimPath); - -# fix -$messagekeys{'page.analysis.userhistory.title'} = 1; -$messagekeys{'errors.failed.uploading.file'} = 2; - - -open( OUT, "> $webimPath/locales/names/level1") or die "cannot write file, $!"; -for $key(sort grep { $messagekeys{$_} == 0 } keys %messagekeys) { - print OUT "$key\n"; -} -close( OUT ); - -open( OUT, "> $webimPath/locales/names/level2") or die "cannot write file, $!"; -for $key(sort grep { $messagekeys{$_} == 1 } keys %messagekeys) { - print OUT "$key\n"; -} -close( OUT ); - -open( OUT, "> $webimPath/install/package") or die "cannot write file, $!"; -for $key(sort @allsources) { - $digest = file_checksum($key); - $key =~ s/$webimPath\///; - print OUT "$key $digest\n"; -} -close( OUT ); diff --git a/src/messenger/pack.pl b/src/messenger/pack.pl deleted file mode 100755 index ef3754da..00000000 --- a/src/messenger/pack.pl +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/perl - -################################################################## -# Arguments -################################################################## - -$targetFolder = "deploy"; -$suffix = "167"; - -################################################################## -# Copies tree into target folder, preprocess .phps -################################################################## - -sub process_dir($$) { - my ($from,$to) = @_; - opendir(DIR, $from) || die "can't opendir $from: $!"; - my @content = readdir(DIR); - closedir DIR; - mkdir $to; - - for(grep { -f "$from/$_" && ($_ !~ /^\./ || $_ eq ".htaccess" || $_ eq ".keep") } @content) { - my ($source,$target) = ("$from/$_","$to/$_"); - - open (IN,"$source"); - binmode(IN); - open (OUT,">$target"); - binmode(OUT); - print OUT $buffer while (read (IN,$buffer,65536)); - } - - for(grep { -d "$from/$_" && $_ !~ /^\./ } @content) { - process_dir("$from/$_","$to/$_"); - } -} - -################################################################## -# Main -################################################################## - -`rm -rf $targetFolder`; -die "Target folder exists: $targetFolder" if -e $targetFolder; - -process_dir("./webim", $targetFolder); - -`rm -rf release$suffix`; -die "release folder exists: release$suffix" if -e "release$suffix"; -mkdir "release$suffix"; - -chdir "$targetFolder"; - -`zip -r ../release$suffix/mibew${suffix}_all.zip * .htaccess`; - -chdir "locales"; - -foreach $locale qw ( ar be bg ca cs da de el fa fi fr he hr hu id it ka lv nl pl pt-br pt-pt ro ru sp sv th tr ua zh-cn zh-tw ) { - - `zip -r ../../release$suffix/mibew${suffix}_$locale.zip $locale`; - `rm -rf $locale`; - -} - -chdir ".."; -`zip -r ../release$suffix/mibew$suffix.zip * .htaccess`; - -chdir ".."; -`rm -rf $targetFolder`; diff --git a/src/messenger/tools/header.txt b/src/messenger/tools/header.txt deleted file mode 100644 index 1c735e25..00000000 --- a/src/messenger/tools/header.txt +++ /dev/null @@ -1,13 +0,0 @@ -Copyright 2005-2013 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. diff --git a/src/messenger/tools/header_update.pl b/src/messenger/tools/header_update.pl deleted file mode 100755 index 044298c2..00000000 --- a/src/messenger/tools/header_update.pl +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/perl - -$sourceFolder = "../webim"; - -sub file_content($) { - my $input = $_[0]; - open( IN1, "< $input" ) or die "cannot find file $input"; - $/ = EOI; - $content = ; - $content =~ s/\r//g; - close( IN1 ); - return $content; -} - -$php_header = file_content("header.txt"); -$php_header =~ s/\s+$//; - -@allfiles = (); - -sub process_folder($) { - my($from) = @_; - - opendir(DIR, $from) || die "can't opendir $from: $!"; - my @content = readdir(DIR); - closedir DIR; - - for(grep { -f "$from/$_" && ($_ !~ /^\./ || $_ eq ".htaccess") } @content) { - push @allfiles, "$from/$_"; - } - for(grep { -d "$from/$_" && $_ !~ /^\./ } @content) { - process_folder("$from/$_"); - } -} - -process_folder($sourceFolder); - -P: for $phpfile (grep { /\.php$/ } @allfiles) { - $content = file_content($phpfile); - $content =~ s/\s+$//g; - die "not a php: $phpfile" unless $content =~ /^<\?php\n(\/\*.*?\*\/)?/s; - die "no comment in $phpfile" unless defined($1); - $comment = $1; - if($comment =~ /\[external\]/) { - next P; - }; - $newcomment = "$php_header"; - $newcomment =~ s/^/ * /gm; - $newcomment =~ s/\s+$//gm; - $newcomment = "/*\n$newcomment\n */"; - - $content =~ s/^(<\?php\n)\/\*.*?\*\//$1$newcomment/s; - - open( OUT, "> $phpfile" ) or die "cannot write file: $phpfile\n"; - print OUT $content; - close( OUT ); -} diff --git a/src/messenger/tools/sortit.pl b/src/messenger/tools/sortit.pl deleted file mode 100755 index 7d9e68f7..00000000 --- a/src/messenger/tools/sortit.pl +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/perl - -sub sort_transl($) { - my($from) = @_; - my @translation = (); - my $header = ""; - open(IN, "$from"); - while() { - chomp; - my $curr = $_; - if(/^([\w\.]+)=(.*)$/) { - if($1 ne "encoding" && $1 ne "output_charset" && $1 ne "output_encoding") { - push @translation, $curr; - } else { - $header .= "$curr\n"; - } - } else { - die "wrong line in $from: $curr\n"; - } - } - close(IN); - open(OUT, "> $from"); - print OUT $header; - for$line(sort @translation) { - print OUT "$line\n"; - } - close(OUT); -} - -die "no parameter\n" if $#ARGV < 0; -die "doesn't exists\n" unless -e $ARGV[0]; - -sort_transl($ARGV[0]); diff --git a/src/messenger/webim/.htaccess b/src/messenger/webim/.htaccess deleted file mode 100644 index 4a3ca54e..00000000 --- a/src/messenger/webim/.htaccess +++ /dev/null @@ -1,4 +0,0 @@ - -SecFilterEngine Off -SecFilterScanPOST Off - diff --git a/src/messenger/webim/LICENSE b/src/messenger/webim/LICENSE deleted file mode 100644 index d6456956..00000000 --- a/src/messenger/webim/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/src/messenger/webim/README b/src/messenger/webim/README deleted file mode 100644 index 123e94f1..00000000 --- a/src/messenger/webim/README +++ /dev/null @@ -1,41 +0,0 @@ -Mibew Messenger -Copyright 2005-2013 the original author or authors. - -REQUIREMENTS - - * Apache web server 1.3.34 or above - * MySQL database 5.0 or above - * PHP 4.x or above with MySQL support - -INSTALLATION - -1. Create folder with name 'mibew' in the root of your website. -2. Upload all the files contained in this archive (retaining the directory structure) into created folder. - Be sure to chromo the mibew folder to 755 and the install folder to 644. -3. Add a MySQL database with the name 'mibew' -4. Edit /mibew/libs/config.php to the information needed to connect to the database -5. Using your web browser visit http:///mibew/install/ and - hit 'Create tables' -6. Remove /mibew/install/ directory from your server -7. Logon as - user: admin - password: -8. Get button code and setup it on your site. -9. Change your password and name. -10. Wait for your visitors on 'Pending users' page. - -On unix/linux platforms change the owner of /mibew/images/avatar folder -to the user, under which the web server is running (for instance, www). -The owner should have all rights on the folder /mibew/images/avatar -(chmod 700 /mibew/images/avatar). - -UPDATE - -1. Backup your /mibew/libs/config.php -2. Backup your /mibew/images/avatar folder. -3. Delete the items in the mibew folder on the server. -4. Upload all the files contained in the downloaded archive (retaining the directory structure) into mibew folder. -5. Re-edit the MySQL database settings you config.php -6. Visit http:///mibew/install/ and follow the instructions to update database (if needed). -7. Remove /mibew/install/ directory from your server -8. Restore contents of /mibew/images/avatar folder. \ No newline at end of file diff --git a/src/messenger/webim/VERSION b/src/messenger/webim/VERSION deleted file mode 100644 index 86c3e337..00000000 --- a/src/messenger/webim/VERSION +++ /dev/null @@ -1 +0,0 @@ -Mibew/1.6.7 \ No newline at end of file diff --git a/src/messenger/webim/b.php b/src/messenger/webim/b.php deleted file mode 100644 index f541651f..00000000 --- a/src/messenger/webim/b.php +++ /dev/null @@ -1,74 +0,0 @@ - \ No newline at end of file diff --git a/src/messenger/webim/button.php b/src/messenger/webim/button.php deleted file mode 100644 index 83e4ab4d..00000000 --- a/src/messenger/webim/button.php +++ /dev/null @@ -1,20 +0,0 @@ - \ No newline at end of file diff --git a/src/messenger/webim/captcha.php b/src/messenger/webim/captcha.php deleted file mode 100644 index 960b55a3..00000000 --- a/src/messenger/webim/captcha.php +++ /dev/null @@ -1,26 +0,0 @@ - \ No newline at end of file diff --git a/src/messenger/webim/client.php b/src/messenger/webim/client.php deleted file mode 100644 index 9451ea65..00000000 --- a/src/messenger/webim/client.php +++ /dev/null @@ -1,180 +0,0 @@ - intval($postedid)), $link); - } - notify_operators($thread, $firstmessage, $link); - mysql_close($link); - } - $threadid = $thread['threadid']; - $token = $thread['ltoken']; - $level = get_remote_level($_SERVER['HTTP_USER_AGENT']); - $chatstyle = verifyparam( "style", "/^\w+$/", ""); - header("Location: $mibewroot/client.php?thread=$threadid&token=$token&level=$level".($chatstyle ? "&style=$chatstyle" : "")); - exit; -} - -$token = verifyparam( "token", "/^\d{1,10}$/"); -$threadid = verifyparam( "thread", "/^\d{1,10}$/"); -$level = verifyparam( "level", "/^(ajaxed|simple|old)$/"); - -$thread = thread_by_id($threadid); -if( !$thread || !isset($thread['ltoken']) || $token != $thread['ltoken'] ) { - die("wrong thread"); -} - -setup_chatview_for_user($thread, $level); - -$pparam = verifyparam( "act", "/^(mailthread)$/", "default"); -if( $pparam == "mailthread" ) { - expand("styles", getchatstyle(), "mail.tpl"); -} else if( $level == "ajaxed" ) { - expand("styles", getchatstyle(), "chat.tpl"); -} else if( $level == "simple" ) { - expand("styles", getchatstyle(), "chatsimple.tpl"); -} else if( $level == "old" ) { - expand("styles", getchatstyle(), "nochat.tpl"); -} - -?> \ No newline at end of file diff --git a/src/messenger/webim/default.css b/src/messenger/webim/default.css deleted file mode 100644 index 87ccbc2f..00000000 --- a/src/messenger/webim/default.css +++ /dev/null @@ -1,917 +0,0 @@ -/* - * Copyright 2005-2013 Evgeny Gryaznov - * - * 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. - */ - -/* reset all */ - -html, body, div, h1, h2, h3, h4, h5, h6, ul, ol, dl, li, dt, dd, p, blockquote, pre, form, fieldset, table, th, td { margin: 0; padding: 0; } -table { border-collapse:collapse; border-spacing:0; } -fieldset,img { border:0; } -ol,ul { list-style:none; } -h1,h2,h3,h4,h5,h6 { font-size:100%; font-weight:normal; } -q:before,q:after { content:''; } - -body { - background: #FFFFFF url(images/header.gif) repeat-x; - font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; - font-size: 0.8em; - line-height: 140%; - color: #333333; -} - -/* 100% height with footer, 200 px sidebar */ - -html, body { - height: 100%; -} - -body { - min-width: 750px; -} - -a { - color: #2f7599; -} - -#wrap400, #wrap700, #fixedwrap { - position:relative; - margin: 0px auto -41px; - height:auto !important; - height:100%; - min-height:100%; -} - -#wrap400 { - width: 100%; - min-width:450px; -} - -#wrap700 { - width: 100%; - min-width:750px; -} - -#fixedwrap { - width: 750px; -} - -.contentdiv { - float:left; - width: 100%; -} - -.contentinner { - margin-right: 210px; - padding: 10px 60px 10px 20px; - overflow: hidden; -} - -.contentnomenu { - padding: 10px 60px 10px 20px; -} - -.empty_inner { - height:40px; -} - -#footer { - background: white url(images/footer.gif) bottom repeat-x; - font-size:11px; - position:relative; - - min-height: 40px; - height:40px; - vertical-align:middle; - - width:100%; - text-align: center; -} - -#legal { - clear: both; - line-height: 30px; - padding-top:10px; - text-align: center; - color: #375C69; - margin-bottom: 0px; -} - -#footer .flink { - color: #2f7599; - text-decoration: underline; -} - -#togglediv { - float:right; - padding-right:10px; -} - -/* Header */ - -#header { - width: 100%; - height: 32px; - margin: 0px -2px 10px 0px; - padding-top: 10px; - padding-bottom: 5px; - background: url(images/graydot.gif) repeat-x left bottom; - display: block; -} - -#header { - float: left; -} - -img.left { - float: left; - margin-right: 15px; -} - -#header h1 { - font-size: 2em; - line-height: 32px; - color: #494949; - margin-left: 40px; -} - -#header h1 a { - color: #494949; -} - -#header a { - text-decoration: none; -} - -#title { - float: left; - display: inline; -} - -#path { - float: right; - padding: 10px 20px 0px 0px; - line-height: 22px; - display: inline; -} - -/* Sidebar */ - -#sidebar { - float: left; - width: 185px; - margin-left: -210px; - margin-top: 20px; - position:relative; - line-height: 180% -} - -#sidebar ul { - margin: 0; - padding: 0; - list-style: none; -} - -#sidebar li { - margin-bottom: 20px; -} - -#sidebar li ul { -} - -#sidebar li li { - margin: 0; -} - -#sidebar h2 { - text-transform: lowercase; - margin-bottom: 10px; - background: url(images/graydot.gif) repeat-x left bottom; - font-size: 1.3em; - font-weight: bold; -} - -.locales a { - color: #2f7599; - font-size: 1em; - text-decoration: none; -} - -.locales .active a { - color: #555; -} - -.locales a:hover { - text-decoration: underline; -} - -.submenu a { - padding-left: 15px; - color: #2f7599; - font-size: 1em; - text-decoration: none; -} - -.submenu a.inner { padding-left: 0px; } -.submenu span.small { font-size: 80%; padding-left: 5px; } - -.submenu .active a { - background: url(images/li.gif) no-repeat left 1px; - color: #555; -} - -.submenu .active a.inner { - background: none; -} - -.submenu a:hover { - text-decoration: underline; -} - -/* form, tabbed form */ - -.mform { - background: url(images/loginbg.gif); - clear: both; - width: 100%; -} - -.tabs { - float: right; - margin-left: 15px; - display: inline; - margin-right: 15px; -} - -.tabs li { - display: inline; -} - -.tabs a { - display: block; - float: left; - padding: 2px 9px 3px 9px; - font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; - font-size: 11px; - color: #2f7599; -} - -.tabs li.active a { - background: url(images/loginbg.gif); - border-left:1px solid #bbbbbb;border-top:1px solid #bbbbbb;border-right:1px solid #bbbbbb; - color: #000; - text-decoration: none; -} - -.formtop, .formbottom, .formtopi, .formbottomi { height: 15px;} -.formtop { background: url(images/logincrnrt.gif) no-repeat top right;} -.formtopi { background: url(images/logincrnlt.gif) no-repeat top left; } -.formbottom { background: url(images/logincrnrb.gif) no-repeat bottom right; } -.formbottomi { background: url(images/logincrnlb.gif) no-repeat bottom left; } -.forminner { margin: 0px 15px;} -.forminner p { margin-bottom: 1em; } - -/* fieldForm */ - -.fieldForm { - font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; - font-size: 11px; - width: 100%; -} - -.packedFormField { - font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; - font-size: 11px; - float:left; - margin-right:25px; - margin-bottom:8px; -} - -.packedFormField select { - min-width: 130px; -} - -div.errinfo { - color: #c13030; -} - -.field { - width: 100%; - margin-top: 5px; -} - -.flabel { - position: relative; - margin: 8px auto 2px; - color: black; -} - -.fleftlabel { - float: left; - width: 11em; -} - -.flabel span.required { - font-size:8.0pt; - color:red; - font-weight: bold; -} - -.field .subfield { - padding-left: 30px; - background: url(images/subitem.gif) no-repeat 10px 2px; -} - -.fieldinrow { - min-width: 300px; - display: inline; - float:left; - width: 45%; -} - -.fvalue { - float: left; -} - -.fvaluewithta { - float: left; - width: 67%; -} - -.fvaluewithta textarea { - width: 100%; -} - -.fvaluenodesc { -} - -.fvalueframe { - overflow: auto; - width: 100%; -} - -.fvalueframe iframe { - border: solid 1px #999; -} - -.fdescr { - float:left; - padding-left:10px; - color: #676767; - font-size: 10px; - min-width: 200px; -} - -.fbutton { - background: url(images/formline.gif) repeat-x; - margin-top: 20px; - padding-top: 10px; -} - -.fbutton .links { - float: right; - margin-top: 5px; -} - -.fbutton .submitbutton { - float: left; -} - -.formauth { -} - -textarea.wide { - border:1px solid #878787; - overflow:auto; - width: 95%; -} - -input.formauth { - border: 1px solid #878787; - color: #333; - margin-right:15px; - padding-right: 0px; -} - -#formmessage { - border: 1px solid #4C96D4; - background-color: #E7F1F9; - padding: 8px 11px; - font-size: 0.85em; - font-weight:bold; - max-width: 700px; - margin: -10px 2px 10px; - color: #515151; -} - -#offwarn { - border: 1px solid #4CD496; - background-color: #E7F9F1; - color: #515151; - padding: 8px 11px; - font-size: 0.85em; - font-weight:bold; - line-height: 140%; - margin: 0px; -} - -#offwarn img { - margin-top: .4em; - float: left; - padding-right: 10px; -} - -.asterisk { - padding: 10px 20px; -} - -/* tables */ - -.tabletool { - float: right; -} - -.tabletool a { - color: #296685; - vertical-align: top; - padding-left: 4px; -} - -.tabletitle { - background: url(images/graydot.gif) repeat-x left bottom; - font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif; - font-size: 1.4em; - margin: 10px 0px 20px; - padding-bottom: 10px; - color: #1D485E; - font-weight: bold; -} - -table.list, table.translate, table.statistics { - font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif; - background: #fff; - width: 100%; - border-collapse: collapse; - text-align: left; -} - -table.list th, table.translate th, table.statistics th { - font-size: 1.2em; - font-weight: normal; - padding: 10px 8px; - border-bottom: 2px solid #2F7598; -} - -table.list th, table.translate th { color: #1D485E; } -table.statistics th { color: #2F7598; } - -table.list td, table.statistics td { - color: #2f7599; - padding: 10px 8px; - border-bottom: 1px solid #ccc; -} - -table.translate td { - font-family: Arial, Helvetica, sans-serif; - font-size: 12px; - color: #515151; - padding: 2px 8px; - border-bottom: 1px solid #ccc; -} - -table.list td a.man { - background: url(images/tbliclogin.gif) no-repeat left center; - padding-left: 15px; -} - -table.list td a.mail { - background: url(images/mail.png) no-repeat left center; - padding-left: 24px; -} - -table.list td a.xmpp { - background: url(images/xmpp.png) no-repeat left center; - padding-left: 24px; -} - -table.list tbody tr:hover td, table.list tbody tr:hover td a, table.statistics tbody tr:hover td { - color: #1D485E; -} - -/* awaiting */ - -table.awaiting { - font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif; - background: #fff; - width: 100%; - border-collapse: collapse; - text-align: left; -} - -table.awaiting th { - font-size: 1.2em; - font-weight: normal; - color: #1D485E; - padding: 10px 8px; - border-bottom: 2px solid #2F7598; - text-align: center; -} - -table.awaiting th.first { - text-align: left; -} - -table.awaiting table.inner { - border: none; - width: 100%; -} - -table.awaiting table.inner .icon { - width: 30px; - text-align: center; -} - -table.awaiting td.visitor { - color: #296685; - border-bottom: 1px solid #ccc; - padding: 10px 8px; - margin: 0px; -} - -.awaiting .visitor a { color: #296685; } -.awaiting tr:hover .visitor, .awaiting tr:hover .visitor a { color: #1D485E; } - -.awaiting tr.ban .visitor, .awaiting tr.ban .visitor a { color: #9AC8E0; } -.awaiting tr.ban:hover .visitor, .awaiting tr.ban:hover .visitor a { color: #4C9CC8; } - -.awaiting tr.inwait .visitor, .awaiting tr.inwait a { font-weight: bold; } -.awaiting tr.inprio .visitor, .awaiting tr.inprio a { font-weight: bold; font-size: 1.05em; } -.awaiting tr.inchat .visitor, .awaiting tr.inchat .visitor a { color: #777; } -.awaiting tr.inchat:hover .visitor, .awaiting tr.inchat:hover .visitor a { color: #444; } -.awaiting tr.inchat a { text-decoration: none; } - -.firstmessage { - text-align: right; - font-size: 0.8em; - padding-right: 10px; -} - -.firstmessage a { - text-decoration: none; -} - -.firstmessage a:hover { - text-decoration: underline; -} - -#connstatus { - float:right; - margin: 10px 10px; -} - -#connlinks { - margin: 10px 10px; -} - -#connlinks a { - color: #777; - text-decoration: none; -} - -#connlinks a:hover { - text-decoration: underline; -} - -/* online operators */ - -#onlineoperators { - padding-right: 10px; - float: right; -} - -/* search */ - -#searchtext { - float:left; - display: inline; - margin:7px 20px 5px 0px; - width:75%; - padding-right:5px; -} - -.searchctrl { - float: left; - margin:7px 20px 5px 0px; - padding-right:5px; - display: inline; -} - -#searchtext input { - width: 100%; - margin: 0px; -} - -#searchbutton { - float:left; -} - -/* login */ - -#loginsmallpane { - float: right; - padding: 10px 15px 0px 0px; - margin-right: 0px; - line-height: 22px; - display: inline; -} - -#loginsmallpane input { - margin: 0px 3px; - padding: 0px 2px; -} - -#loginsmallpane .butt { - height: 1.3em; - border: 0px; - background: none; -} - -#loginsmallpane .butt:hover { - background: #aaa; -} - -#loginintro { - width: 400px; - margin: 10px 30px; -} - -#loginpane { - width: 400px; - margin: 30px 30px; -} - -#loginpane .header h2 { - font-size: 2em; - margin-bottom: 0.9em; - padding-bottom: 0.8em; - border-bottom: 2px solid #2F7598; -} - -/* nice button */ - -#confirmpane { - width:450px; - margin:0px auto 5px; - padding-top: 70px; -} - -.nicebutton { - border: none; - float: left; - margin-left: 30px; -} - -.submit a { - font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; - font-size: 11px; - line-height: 35px; - color: #000000; - text-decoration: none; -} - -.submit { - background: url(images/submitbg.gif) repeat-x; - vertical-align: top; -} - - -/* thread log */ - -.logpane { - margin: 10px 0px; - line-height: 150%; -} - -.logpane .header { - padding-bottom: 0.8em; - border-bottom: 2px solid #2F7598; -} - -.logpane .wlabel { - width: 10em; - float: left; - margin-right:10px; -} - -.logpane .wvalue { - float: left; -} - -/* dashboard */ - -#dashboard { - width: 100%; -} - -.dashitem { - width:33%; - margin: 0px 2em 5em 0px; - padding: 5px 2em 5em; - vertical-align: top; -} - -.dashitem:hover { -} - -.dashitem a { - padding-top:2px; - padding-bottom: 10px; - display: block; -} - -.dashitem img, #dashlocalesPopup h2 img { - float: left; - padding-right:10px; - width: 24px; - height: 24px; -} - -#dashlocalesPopup h2 img { - margin-top: -3px; -} - -#dashlocalesPopup .locales { - line-height: 180%; - margin-left:10px; -} - -#dashlocalesPopup h2 { - font-size: 1.5em; - margin-bottom: 0.9em; - padding: 5px 30px 0.8em 0px; - border-bottom: 2px solid #2F7598; -} - -#dashlocalesPopupClose { - float: right; - position:absolute; - right:5px; - top:5px; -} - -#dashlocalesPopup { - display:none; - position:fixed; - _position:absolute; /* ie6*/ - background:#FFFFFF; - border:2px solid #2F7598; - z-index:110; - padding:1em 1em; - font-size:1em; -} - -#backgroundPopup{ - display:none; - position:fixed; - _position:absolute; /* ie6*/ - height:100%; - opacity: .5; - width:100%; - top:0; - left:0; - background:#000000; - border:1px solid #cecece; - z-index:101; -} - -/* install */ - -#install li { - list-style-type: circle; - list-style-position: inside; - margin-left: 2em; -} - -#check-nv, #check-nm { - color: #2f7599; - text-decoration: none; -} - -#check-nv:hover, #check-nm:hover { - text-decoration: underline; -} - - -/* chat */ - -.message { - font-family: Arial, Helvetica, sans-serif; - font-size: 12px; - color: #4F4F4F; - padding: 15px 0px 0px 0px; - line-height: 17px; -} - -.message span.time { - color: #000000; -} - -.message span.nuser { - color: #B11E23; - font-weight: bold; -} - -.message span.nagent { - font-weight: bold; -} - -.message span.minf { - color: #1E48B1; - font-size: 11px; -} - -.message span.mevent { - color: #A1A1A1; - font-size: 11px; -} - -.message span.mhidden { - color: #A1A1A1; - font-size: 11px; -} - -.message span.mconn { - color: #A1A1A1; - font-size: 11px; -} - -/* updates */ - -#news { - font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; - font-size: 11px; - margin-bottom:15px; - padding:4px; -} - -.newstext { - margin-bottom:1em; -} - -/* rtl rules */ - -.lrtl .dashitem img, .lrtl #dashlocalesPopup h2 img, .lrtl #offwarn img { - float: right; - padding-right:0px; - padding-left:10px; -} - -.lrtl .fleftlabel { - float: right; - width: 11em; -} - -.lrtl .fdescr { - float:right; - padding-right:10px; -} - - -.lrtl .field .subfield { - padding-right: 30px; - background: url(images/subitem_rtl.gif) no-repeat 99% 2px; -} - - -.lrtl .fvalue { - float: right; -} - -.lrtl .logpane .wlabel { - float: right; - margin-left:10px; -} - -.lrtl .logpane .wvalue { - float: right; -} - -.lrtl .fvaluewithta { - float: right; -} - -.lrtl #togglediv { - float:left; - padding-left:10px; -} diff --git a/src/messenger/webim/images/avatar/.keep b/src/messenger/webim/images/avatar/.keep deleted file mode 100644 index e69de29b..00000000 diff --git a/src/messenger/webim/images/ban.gif b/src/messenger/webim/images/ban.gif deleted file mode 100644 index d11165bf..00000000 Binary files a/src/messenger/webim/images/ban.gif and /dev/null differ diff --git a/src/messenger/webim/images/blank.html b/src/messenger/webim/images/blank.html deleted file mode 100644 index 62eedaaf..00000000 --- a/src/messenger/webim/images/blank.html +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/src/messenger/webim/images/buttons/createagent.gif b/src/messenger/webim/images/buttons/createagent.gif deleted file mode 100644 index 9d9bd88e..00000000 Binary files a/src/messenger/webim/images/buttons/createagent.gif and /dev/null differ diff --git a/src/messenger/webim/images/buttons/createban.gif b/src/messenger/webim/images/buttons/createban.gif deleted file mode 100644 index 540e33c0..00000000 Binary files a/src/messenger/webim/images/buttons/createban.gif and /dev/null differ diff --git a/src/messenger/webim/images/buttons/createdep.gif b/src/messenger/webim/images/buttons/createdep.gif deleted file mode 100644 index 138e2000..00000000 Binary files a/src/messenger/webim/images/buttons/createdep.gif and /dev/null differ diff --git a/src/messenger/webim/images/dash/blocked.gif b/src/messenger/webim/images/dash/blocked.gif deleted file mode 100644 index 4fc2d1df..00000000 Binary files a/src/messenger/webim/images/dash/blocked.gif and /dev/null differ diff --git a/src/messenger/webim/images/dash/canned.gif b/src/messenger/webim/images/dash/canned.gif deleted file mode 100644 index 0a50ded4..00000000 Binary files a/src/messenger/webim/images/dash/canned.gif and /dev/null differ diff --git a/src/messenger/webim/images/dash/close.gif b/src/messenger/webim/images/dash/close.gif deleted file mode 100644 index 177a9092..00000000 Binary files a/src/messenger/webim/images/dash/close.gif and /dev/null differ diff --git a/src/messenger/webim/images/dash/dep.gif b/src/messenger/webim/images/dash/dep.gif deleted file mode 100644 index d43fe879..00000000 Binary files a/src/messenger/webim/images/dash/dep.gif and /dev/null differ diff --git a/src/messenger/webim/images/dash/exit.gif b/src/messenger/webim/images/dash/exit.gif deleted file mode 100644 index 7f8fc0e6..00000000 Binary files a/src/messenger/webim/images/dash/exit.gif and /dev/null differ diff --git a/src/messenger/webim/images/dash/getcode.gif b/src/messenger/webim/images/dash/getcode.gif deleted file mode 100644 index 877dcc8a..00000000 Binary files a/src/messenger/webim/images/dash/getcode.gif and /dev/null differ diff --git a/src/messenger/webim/images/dash/history.gif b/src/messenger/webim/images/dash/history.gif deleted file mode 100644 index 675d7497..00000000 Binary files a/src/messenger/webim/images/dash/history.gif and /dev/null differ diff --git a/src/messenger/webim/images/dash/locale.gif b/src/messenger/webim/images/dash/locale.gif deleted file mode 100644 index b9c768c3..00000000 Binary files a/src/messenger/webim/images/dash/locale.gif and /dev/null differ diff --git a/src/messenger/webim/images/dash/notifications.gif b/src/messenger/webim/images/dash/notifications.gif deleted file mode 100644 index d52e47cc..00000000 Binary files a/src/messenger/webim/images/dash/notifications.gif and /dev/null differ diff --git a/src/messenger/webim/images/dash/operators.gif b/src/messenger/webim/images/dash/operators.gif deleted file mode 100644 index 50d2d567..00000000 Binary files a/src/messenger/webim/images/dash/operators.gif and /dev/null differ diff --git a/src/messenger/webim/images/dash/profile.gif b/src/messenger/webim/images/dash/profile.gif deleted file mode 100644 index 8f9bf9b5..00000000 Binary files a/src/messenger/webim/images/dash/profile.gif and /dev/null differ diff --git a/src/messenger/webim/images/dash/readme.txt b/src/messenger/webim/images/dash/readme.txt deleted file mode 100644 index 165a5a1f..00000000 --- a/src/messenger/webim/images/dash/readme.txt +++ /dev/null @@ -1,19 +0,0 @@ -"34aL volume 3.1" icons set - -Ammount of icons: -60 - -Colors: -Colored, grey - -Icon Sizes: -24x24 - -File Types: -.ico (RGBA, 256 color, 16 color), -.tiff (RGBA) -.gif (indexed) -.bmp (RGB - 1 color background), -.png (RGBA) - -Note: These icons are free for use. \ No newline at end of file diff --git a/src/messenger/webim/images/dash/settings.gif b/src/messenger/webim/images/dash/settings.gif deleted file mode 100644 index 2401ab76..00000000 Binary files a/src/messenger/webim/images/dash/settings.gif and /dev/null differ diff --git a/src/messenger/webim/images/dash/stat.gif b/src/messenger/webim/images/dash/stat.gif deleted file mode 100644 index 9594d59b..00000000 Binary files a/src/messenger/webim/images/dash/stat.gif and /dev/null differ diff --git a/src/messenger/webim/images/dash/updates.gif b/src/messenger/webim/images/dash/updates.gif deleted file mode 100644 index 42bdb915..00000000 Binary files a/src/messenger/webim/images/dash/updates.gif and /dev/null differ diff --git a/src/messenger/webim/images/dash/visitors.gif b/src/messenger/webim/images/dash/visitors.gif deleted file mode 100644 index e6e56b1f..00000000 Binary files a/src/messenger/webim/images/dash/visitors.gif and /dev/null differ diff --git a/src/messenger/webim/images/dash/warn.gif b/src/messenger/webim/images/dash/warn.gif deleted file mode 100644 index a775a52d..00000000 Binary files a/src/messenger/webim/images/dash/warn.gif and /dev/null differ diff --git a/src/messenger/webim/images/favicon.ico b/src/messenger/webim/images/favicon.ico deleted file mode 100644 index ca59e49c..00000000 Binary files a/src/messenger/webim/images/favicon.ico and /dev/null differ diff --git a/src/messenger/webim/images/footer.gif b/src/messenger/webim/images/footer.gif deleted file mode 100644 index ba2b1a33..00000000 Binary files a/src/messenger/webim/images/footer.gif and /dev/null differ diff --git a/src/messenger/webim/images/formline.gif b/src/messenger/webim/images/formline.gif deleted file mode 100644 index 4c0d1554..00000000 Binary files a/src/messenger/webim/images/formline.gif and /dev/null differ diff --git a/src/messenger/webim/images/free.gif b/src/messenger/webim/images/free.gif deleted file mode 100644 index 1fb63de6..00000000 Binary files a/src/messenger/webim/images/free.gif and /dev/null differ diff --git a/src/messenger/webim/images/graydot.gif b/src/messenger/webim/images/graydot.gif deleted file mode 100644 index 51c0ef82..00000000 Binary files a/src/messenger/webim/images/graydot.gif and /dev/null differ diff --git a/src/messenger/webim/images/header.gif b/src/messenger/webim/images/header.gif deleted file mode 100644 index 43c4bfe5..00000000 Binary files a/src/messenger/webim/images/header.gif and /dev/null differ diff --git a/src/messenger/webim/images/icon_err.gif b/src/messenger/webim/images/icon_err.gif deleted file mode 100644 index 6d7791de..00000000 Binary files a/src/messenger/webim/images/icon_err.gif and /dev/null differ diff --git a/src/messenger/webim/images/li.gif b/src/messenger/webim/images/li.gif deleted file mode 100644 index 29e03266..00000000 Binary files a/src/messenger/webim/images/li.gif and /dev/null differ diff --git a/src/messenger/webim/images/lidiv.gif b/src/messenger/webim/images/lidiv.gif deleted file mode 100644 index 83cabba5..00000000 Binary files a/src/messenger/webim/images/lidiv.gif and /dev/null differ diff --git a/src/messenger/webim/images/loginbg.gif b/src/messenger/webim/images/loginbg.gif deleted file mode 100644 index fbf2f932..00000000 Binary files a/src/messenger/webim/images/loginbg.gif and /dev/null differ diff --git a/src/messenger/webim/images/logincrnlb.gif b/src/messenger/webim/images/logincrnlb.gif deleted file mode 100644 index 584fa6fe..00000000 Binary files a/src/messenger/webim/images/logincrnlb.gif and /dev/null differ diff --git a/src/messenger/webim/images/logincrnlt.gif b/src/messenger/webim/images/logincrnlt.gif deleted file mode 100644 index afe30460..00000000 Binary files a/src/messenger/webim/images/logincrnlt.gif and /dev/null differ diff --git a/src/messenger/webim/images/logincrnrb.gif b/src/messenger/webim/images/logincrnrb.gif deleted file mode 100644 index 39f82e8b..00000000 Binary files a/src/messenger/webim/images/logincrnrb.gif and /dev/null differ diff --git a/src/messenger/webim/images/logincrnrt.gif b/src/messenger/webim/images/logincrnrt.gif deleted file mode 100644 index 2406eb6d..00000000 Binary files a/src/messenger/webim/images/logincrnrt.gif and /dev/null differ diff --git a/src/messenger/webim/images/logo.gif b/src/messenger/webim/images/logo.gif deleted file mode 100644 index 315d547a..00000000 Binary files a/src/messenger/webim/images/logo.gif and /dev/null differ diff --git a/src/messenger/webim/images/mail.png b/src/messenger/webim/images/mail.png deleted file mode 100644 index 18b512db..00000000 Binary files a/src/messenger/webim/images/mail.png and /dev/null differ diff --git a/src/messenger/webim/images/mibewlogo.gif b/src/messenger/webim/images/mibewlogo.gif deleted file mode 100644 index edd7d31b..00000000 Binary files a/src/messenger/webim/images/mibewlogo.gif and /dev/null differ diff --git a/src/messenger/webim/images/nextpage.gif b/src/messenger/webim/images/nextpage.gif deleted file mode 100644 index 8da5c630..00000000 Binary files a/src/messenger/webim/images/nextpage.gif and /dev/null differ diff --git a/src/messenger/webim/images/opaway.gif b/src/messenger/webim/images/opaway.gif deleted file mode 100644 index e45ad55d..00000000 Binary files a/src/messenger/webim/images/opaway.gif and /dev/null differ diff --git a/src/messenger/webim/images/oponline.gif b/src/messenger/webim/images/oponline.gif deleted file mode 100644 index d91cc875..00000000 Binary files a/src/messenger/webim/images/oponline.gif and /dev/null differ diff --git a/src/messenger/webim/images/prevpage.gif b/src/messenger/webim/images/prevpage.gif deleted file mode 100644 index e5479366..00000000 Binary files a/src/messenger/webim/images/prevpage.gif and /dev/null differ diff --git a/src/messenger/webim/images/subitem.gif b/src/messenger/webim/images/subitem.gif deleted file mode 100644 index 5c77ad12..00000000 Binary files a/src/messenger/webim/images/subitem.gif and /dev/null differ diff --git a/src/messenger/webim/images/subitem_rtl.gif b/src/messenger/webim/images/subitem_rtl.gif deleted file mode 100644 index 11d36ac1..00000000 Binary files a/src/messenger/webim/images/subitem_rtl.gif and /dev/null differ diff --git a/src/messenger/webim/images/submit.gif b/src/messenger/webim/images/submit.gif deleted file mode 100644 index 07b59ae0..00000000 Binary files a/src/messenger/webim/images/submit.gif and /dev/null differ diff --git a/src/messenger/webim/images/submitbg.gif b/src/messenger/webim/images/submitbg.gif deleted file mode 100644 index 2fa3527a..00000000 Binary files a/src/messenger/webim/images/submitbg.gif and /dev/null differ diff --git a/src/messenger/webim/images/submitrest.gif b/src/messenger/webim/images/submitrest.gif deleted file mode 100644 index aa56788a..00000000 Binary files a/src/messenger/webim/images/submitrest.gif and /dev/null differ diff --git a/src/messenger/webim/images/tablediv3.gif b/src/messenger/webim/images/tablediv3.gif deleted file mode 100644 index 246607e3..00000000 Binary files a/src/messenger/webim/images/tablediv3.gif and /dev/null differ diff --git a/src/messenger/webim/images/tbliclogin.gif b/src/messenger/webim/images/tbliclogin.gif deleted file mode 100644 index bfd9f7ea..00000000 Binary files a/src/messenger/webim/images/tbliclogin.gif and /dev/null differ diff --git a/src/messenger/webim/images/tbliclread.gif b/src/messenger/webim/images/tbliclread.gif deleted file mode 100644 index 87a69519..00000000 Binary files a/src/messenger/webim/images/tbliclread.gif and /dev/null differ diff --git a/src/messenger/webim/images/tbliclspeak.gif b/src/messenger/webim/images/tbliclspeak.gif deleted file mode 100644 index 1c5636aa..00000000 Binary files a/src/messenger/webim/images/tbliclspeak.gif and /dev/null differ diff --git a/src/messenger/webim/images/tblicusers.gif b/src/messenger/webim/images/tblicusers.gif deleted file mode 100644 index e6123274..00000000 Binary files a/src/messenger/webim/images/tblicusers.gif and /dev/null differ diff --git a/src/messenger/webim/images/tblicusers2.gif b/src/messenger/webim/images/tblicusers2.gif deleted file mode 100644 index 66649574..00000000 Binary files a/src/messenger/webim/images/tblicusers2.gif and /dev/null differ diff --git a/src/messenger/webim/images/tblicusers3.gif b/src/messenger/webim/images/tblicusers3.gif deleted file mode 100644 index f8eceb1b..00000000 Binary files a/src/messenger/webim/images/tblicusers3.gif and /dev/null differ diff --git a/src/messenger/webim/images/tbllabyel.gif b/src/messenger/webim/images/tbllabyel.gif deleted file mode 100644 index 7fa88aab..00000000 Binary files a/src/messenger/webim/images/tbllabyel.gif and /dev/null differ diff --git a/src/messenger/webim/images/topdiv.gif b/src/messenger/webim/images/topdiv.gif deleted file mode 100644 index 167fbda5..00000000 Binary files a/src/messenger/webim/images/topdiv.gif and /dev/null differ diff --git a/src/messenger/webim/images/xmpp.png b/src/messenger/webim/images/xmpp.png deleted file mode 100644 index 869ca91a..00000000 Binary files a/src/messenger/webim/images/xmpp.png and /dev/null differ diff --git a/src/messenger/webim/index.php b/src/messenger/webim/index.php deleted file mode 100644 index d50d3251..00000000 --- a/src/messenger/webim/index.php +++ /dev/null @@ -1,21 +0,0 @@ - \ No newline at end of file diff --git a/src/messenger/webim/install/dbinfo.php b/src/messenger/webim/install/dbinfo.php deleted file mode 100644 index d72bccb3..00000000 --- a/src/messenger/webim/install/dbinfo.php +++ /dev/null @@ -1,229 +0,0 @@ - array( - "groupid" => "int NOT NULL auto_increment PRIMARY KEY", - "vcemail" => "varchar(64)", - "vclocalname" => "varchar(64) NOT NULL", - "vccommonname" => "varchar(64) NOT NULL", - "vclocaldescription" => "varchar(1024) NOT NULL", - "vccommondescription" => "varchar(1024) NOT NULL", - ), - - "${mysqlprefix}chatthread" => array( - "threadid" => "int NOT NULL auto_increment PRIMARY KEY", - "userName" => "varchar(64) NOT NULL", - "userid" => "varchar(255)", - "agentName" => "varchar(64)", - "agentId" => "int NOT NULL DEFAULT 0", - "dtmcreated" => "datetime DEFAULT 0", - "dtmmodified" => "datetime DEFAULT 0", - "lrevision" => "int NOT NULL DEFAULT 0", - "istate" => "int NOT NULL DEFAULT 0", - "ltoken" => "int NOT NULL", - "remote" => "varchar(255)", - "referer" => "text", - "nextagent" => "int NOT NULL DEFAULT 0", - "locale" => "varchar(8)", - "lastpinguser" => "datetime DEFAULT 0", - "lastpingagent" => "datetime DEFAULT 0", - "userTyping" => "int DEFAULT 0", - "agentTyping" => "int DEFAULT 0", - "shownmessageid" => "int NOT NULL DEFAULT 0", - "userAgent" => "varchar(255)", - "messageCount" => "varchar(16)", - "groupid" => "int references ${mysqlprefix}chatgroup(groupid)", - ), - - "${mysqlprefix}chatmessage" => array( - "messageid" => "int NOT NULL auto_increment PRIMARY KEY", - "threadid" => "int NOT NULL references ${mysqlprefix}chatthread(threadid)", - "ikind" => "int NOT NULL", - "agentId" => "int NOT NULL DEFAULT 0", - "tmessage" => "text NOT NULL", - "dtmcreated" => "datetime DEFAULT 0", - "tname" => "varchar(64)" - ), - - "${mysqlprefix}chatoperator" => array( - "operatorid" => "int NOT NULL auto_increment PRIMARY KEY", - "vclogin" => "varchar(64) NOT NULL", - "vcpassword" => "varchar(64) NOT NULL", - "vclocalename" => "varchar(64) NOT NULL", - "vccommonname" => "varchar(64) NOT NULL", - "vcemail" => "varchar(64)", - "dtmlastvisited" => "datetime DEFAULT 0", - "istatus" => "int DEFAULT 0", /* 0 - online, 1 - away */ - "vcavatar" => "varchar(255)", - "vcjabbername" => "varchar(255)", - "iperm" => "int DEFAULT 65535", - "inotify" => "int DEFAULT 0", /* 0 - none, 1 - jabber */ - "dtmrestore" => "datetime DEFAULT 0", - "vcrestoretoken" => "varchar(64)", - ), - - "${mysqlprefix}chatrevision" => array( - "id" => "INT NOT NULL" - ), - - "${mysqlprefix}chatgroupoperator" => array( - "groupid" => "int NOT NULL references ${mysqlprefix}chatgroup(groupid)", - "operatorid" => "int NOT NULL references ${mysqlprefix}chatoperator(operatorid)", - ), - - "${mysqlprefix}chatban" => array( - "banid" => "INT NOT NULL auto_increment PRIMARY KEY", - "dtmcreated" => "datetime DEFAULT 0", - "dtmtill" => "datetime DEFAULT 0", - "address" => "varchar(255)", - "comment" => "varchar(255)", - "blockedCount" => "int DEFAULT 0" - ), - - "${mysqlprefix}chatconfig" => array( - "id" => "INT NOT NULL auto_increment PRIMARY KEY", - "vckey" => "varchar(255)", - "vcvalue" => "varchar(255)", - ), - - "${mysqlprefix}chatresponses" => array( - "id" => "INT NOT NULL auto_increment PRIMARY KEY", - "locale" => "varchar(8)", - "groupid" => "int references ${mysqlprefix}chatgroup(groupid)", - "vcvalue" => "varchar(1024) NOT NULL", - ), - - "${mysqlprefix}chatnotification" => array( - "id" => "INT NOT NULL auto_increment PRIMARY KEY", - "locale" => "varchar(8)", - "vckind" => "varchar(16)", - "vcto" => "varchar(256)", - "dtmcreated" => "datetime DEFAULT 0", - "vcsubject" => "varchar(256)", - "tmessage" => "text NOT NULL", - "refoperator" => "int NOT NULL references ${mysqlprefix}chatoperator(operatorid)", - ), -); - -$dbtables_indexes = array( - "${mysqlprefix}chatmessage" => array( - "idx_agentid" => "agentid" - ) -); - -$memtables = array(); - -$dbtables_can_update = array( - "${mysqlprefix}chatthread" => array("agentId", "userTyping", "agentTyping", "messageCount", "nextagent", "shownmessageid", "userid", "userAgent", "groupid"), - "${mysqlprefix}chatmessage" => array("agentId"), - "${mysqlprefix}chatoperator" => array("vcavatar", "vcjabbername", "iperm", "istatus", "vcemail", "dtmrestore", "vcrestoretoken", "inotify"), - "${mysqlprefix}chatban" => array(), - "${mysqlprefix}chatgroup" => array("vcemail"), - "${mysqlprefix}chatgroupoperator" => array(), - "${mysqlprefix}chatresponses" => array(), - "${mysqlprefix}chatnotification" => array(), -); - -function show_install_err($text) -{ - global $page, $version, $errors, $mibewroot; - $page = array( - 'version' => $version, - 'localeLinks' => get_locale_links("$mibewroot/install/index.php") - ); - $errors = array($text); - start_html_output(); - require('../view/install_err.php'); - exit; -} - -function create_table($id, $link) -{ - global $dbtables, $dbtables_indexes, $memtables, $dbencoding, $mysqlprefix; - - if (!isset($dbtables[$id])) { - show_install_err("Unknown table: $id, " . mysql_error($link)); - } - - $query = - "CREATE TABLE $id\n" . - "(\n"; - foreach ($dbtables[$id] as $k => $v) { - $query .= " $k $v,\n"; - } - - if (isset($dbtables_indexes[$id])) { - foreach ($dbtables_indexes[$id] as $k => $v) { - $query .= " INDEX $k ($v),\n"; - } - } - - $query = preg_replace("/,\n$/", "", $query); - $query .= ") charset $dbencoding"; - if (in_array($id, $memtables)) { - $query .= " ENGINE=MEMORY"; - } else { - $query .= " ENGINE=InnoDb"; - } - - mysql_query($query, $link) or show_install_err(' Query failed: ' . mysql_error($link)); - - if ($id == "${mysqlprefix}chatoperator") { - create_operator_("admin", "", "", "", "Administrator", "Administrator", 0, "", $link); - } else if ($id == "${mysqlprefix}chatrevision") { - perform_query("INSERT INTO ${mysqlprefix}chatrevision VALUES (1)", $link); - } -} - -function get_tables($link) -{ - global $mysqldb, $errors; - $result = mysql_query("SHOW TABLES FROM `$mysqldb`", $link); - if ($result) { - $arr = array(); - while ($row = mysql_fetch_array($result, MYSQL_NUM)) { - $arr[] = $row[0]; - } - mysql_free_result($result); - return $arr; - - } else { - $errors[] = "Cannot get tables from database. Error: " . mysql_error($link); - return false; - } -} - -function get_columns($tablename, $link) -{ - global $errors; - $result = mysql_query("SHOW COLUMNS FROM $tablename", $link); - if ($result) { - $arr = array(); - while ($row = mysql_fetch_array($result, MYSQL_NUM)) { - $arr[] = $row[0]; - } - mysql_free_result($result); - return $arr; - - } else { - $errors[] = "Cannot get columns from table \"$tablename\". Error: " . mysql_error($link); - return false; - } -} - -?> \ No newline at end of file diff --git a/src/messenger/webim/install/dbperform.php b/src/messenger/webim/install/dbperform.php deleted file mode 100644 index 1f566104..00000000 --- a/src/messenger/webim/install/dbperform.php +++ /dev/null @@ -1,168 +0,0 @@ - $columns) { - $curr_columns = get_columns($id, $link); - if ($curr_columns === false) { - show_install_err($errors[0]); - } - $tocreate = array_diff(array_keys($columns), $curr_columns); - foreach ($tocreate as $v) { - $absent[] = "$id.$v"; - } - } - - if (in_array("${mysqlprefix}chatmessage.agentId", $absent)) { - runsql("ALTER TABLE ${mysqlprefix}chatmessage ADD agentId int NOT NULL DEFAULT 0 AFTER ikind", $link); - runsql("update ${mysqlprefix}chatmessage, ${mysqlprefix}chatoperator set agentId = operatorid where agentId = 0 AND ikind = 2 AND (vclocalename = tname OR vccommonname = tname)", $link); - } - - if (in_array("${mysqlprefix}chatthread.agentId", $absent)) { - runsql("ALTER TABLE ${mysqlprefix}chatthread ADD agentId int NOT NULL DEFAULT 0 AFTER agentName", $link); - runsql("update ${mysqlprefix}chatthread, ${mysqlprefix}chatoperator set agentId = operatorid where agentId = 0 AND (vclocalename = agentName OR vccommonname = agentName)", $link); - } - - if (in_array("${mysqlprefix}chatthread.agentTyping", $absent)) { - runsql("ALTER TABLE ${mysqlprefix}chatthread ADD agentTyping int DEFAULT 0", $link); - } - - if (in_array("${mysqlprefix}chatthread.userTyping", $absent)) { - runsql("ALTER TABLE ${mysqlprefix}chatthread ADD userTyping int DEFAULT 0", $link); - } - - if (in_array("${mysqlprefix}chatthread.messageCount", $absent)) { - runsql("ALTER TABLE ${mysqlprefix}chatthread ADD messageCount varchar(16)", $link); - runsql("ALTER TABLE ${mysqlprefix}chatmessage ADD INDEX idx_threadid_ikind (threadid, ikind)", $link); - runsql("UPDATE ${mysqlprefix}chatthread t SET t.messageCount = (SELECT COUNT(*) FROM ${mysqlprefix}chatmessage WHERE ${mysqlprefix}chatmessage.threadid = t.threadid AND ikind = 1)", $link); - runsql("ALTER TABLE ${mysqlprefix}chatmessage DROP INDEX idx_threadid_ikind", $link); - } - - if (in_array("${mysqlprefix}chatthread.nextagent", $absent)) { - runsql("ALTER TABLE ${mysqlprefix}chatthread ADD nextagent int NOT NULL DEFAULT 0", $link); - } - - if (in_array("${mysqlprefix}chatthread.shownmessageid", $absent)) { - runsql("ALTER TABLE ${mysqlprefix}chatthread ADD shownmessageid int NOT NULL DEFAULT 0", $link); - } - - if (in_array("${mysqlprefix}chatthread.userid", $absent)) { - runsql("ALTER TABLE ${mysqlprefix}chatthread ADD userid varchar(255) DEFAULT \"\"", $link); - } - - if (in_array("${mysqlprefix}chatoperator.iperm", $absent)) { - runsql("ALTER TABLE ${mysqlprefix}chatoperator ADD iperm int DEFAULT 65535", $link); - } - - if (in_array("${mysqlprefix}chatoperator.istatus", $absent)) { - runsql("ALTER TABLE ${mysqlprefix}chatoperator ADD istatus int DEFAULT 0", $link); - } - - if (in_array("${mysqlprefix}chatoperator.inotify", $absent)) { - runsql("ALTER TABLE ${mysqlprefix}chatoperator ADD inotify int DEFAULT 0", $link); - } - - if (in_array("${mysqlprefix}chatoperator.vcavatar", $absent)) { - runsql("ALTER TABLE ${mysqlprefix}chatoperator ADD vcavatar varchar(255)", $link); - } - - if (in_array("${mysqlprefix}chatoperator.vcjabbername", $absent)) { - runsql("ALTER TABLE ${mysqlprefix}chatoperator ADD vcjabbername varchar(255)", $link); - } - - if (in_array("${mysqlprefix}chatoperator.vcemail", $absent)) { - runsql("ALTER TABLE ${mysqlprefix}chatoperator ADD vcemail varchar(64)", $link); - } - - if (in_array("${mysqlprefix}chatoperator.dtmrestore", $absent)) { - runsql("ALTER TABLE ${mysqlprefix}chatoperator ADD dtmrestore datetime DEFAULT 0", $link); - } - - if (in_array("${mysqlprefix}chatoperator.vcrestoretoken", $absent)) { - runsql("ALTER TABLE ${mysqlprefix}chatoperator ADD vcrestoretoken varchar(64)", $link); - } - - if (in_array("${mysqlprefix}chatthread.groupid", $absent)) { - runsql("ALTER TABLE ${mysqlprefix}chatthread ADD groupid int references ${mysqlprefix}chatgroup(groupid)", $link); - } - - if (in_array("${mysqlprefix}chatthread.userAgent", $absent)) { - runsql("ALTER TABLE ${mysqlprefix}chatthread ADD userAgent varchar(255)", $link); - } - - if (in_array("${mysqlprefix}chatgroup.vcemail", $absent)) { - runsql("ALTER TABLE ${mysqlprefix}chatgroup ADD vcemail varchar(64)", $link); - } - - $res = mysql_query("select null from information_schema.statistics where table_schema = '$mysqldb' and table_name = '${mysqlprefix}chatmessage' and index_name = 'idx_agentid'", $link); - if ($res && mysql_num_rows($res) == 0) { - runsql("ALTER TABLE ${mysqlprefix}chatmessage ADD INDEX idx_agentid (agentid)", $link); - } - } -} - -mysql_close($link); -header("Location: $mibewroot/install/index.php"); -exit; -?> diff --git a/src/messenger/webim/install/index.php b/src/messenger/webim/install/index.php deleted file mode 100644 index 197b6630..00000000 --- a/src/messenger/webim/install/index.php +++ /dev/null @@ -1,312 +0,0 @@ - $version, - 'localeLinks' => get_locale_links("$mibewroot/install/index.php") -); - -$page['done'] = array(); -$page['nextstep'] = false; -$page['nextnotice'] = false; -$page['soundcheck'] = false; -$errors = array(); - -function check_mibewroot() -{ - global $page, $errors, $mibewroot; - $requestUri = $_SERVER["REQUEST_URI"]; - if (!preg_match('/^(.*)\\/install(\\/[^\\/\\\\]*)?$/', $requestUri, $matches)) { - $errors[] = "Cannot detect application location: $requestUri"; - return false; - } - $applocation = $matches[1]; - - if ($applocation != $mibewroot) { - $errors[] = "Please, check file ${applocation}/libs/config.php
Wrong value of \$mibewroot variable, should be \"$applocation\""; - $mibewroot = $applocation; - return false; - } - - $page['done'][] = getlocal2("install.0.app", array($applocation)); - return true; -} - -function fpermissions($file) -{ - $perms = fileperms($file); - if (($perms & 0x8000) == 0x8000) { - $info = '-'; - } elseif (($perms & 0x4000) == 0x4000) { - $info = 'd'; - } else { - $info = '?'; - } - - // Owner - $info .= (($perms & 0x0100) ? 'r' : '-'); - $info .= (($perms & 0x0080) ? 'w' : '-'); - $info .= (($perms & 0x0040) ? - (($perms & 0x0800) ? 's' : 'x') : - (($perms & 0x0800) ? 'S' : '-')); - - // Group - $info .= (($perms & 0x0020) ? 'r' : '-'); - $info .= (($perms & 0x0010) ? 'w' : '-'); - $info .= (($perms & 0x0008) ? - (($perms & 0x0400) ? 's' : 'x') : - (($perms & 0x0400) ? 'S' : '-')); - - // World - $info .= (($perms & 0x0004) ? 'r' : '-'); - $info .= (($perms & 0x0002) ? 'w' : '-'); - $info .= (($perms & 0x0001) ? - (($perms & 0x0200) ? 't' : 'x') : - (($perms & 0x0200) ? 'T' : '-')); - - return $info; -} - -function check_files() -{ - global $page, $errors, $mibewroot; - - $packageFile = dirname(__FILE__) . "/package"; - $fp = @fopen($packageFile, "r"); - if ($fp === FALSE) { - $errors[] = getlocal2("install.cannot_read", array("$mibewroot/install/package")); - if (file_exists($packageFile)) { - $errors[] = getlocal2("install.check_permissions", array(fpermissions($packageFile))); - } - return false; - } - - $knownFiles = array(); - while (!feof($fp)) { - $line = fgets($fp, 4096); - $keyval = preg_split("/ /", $line, 2); - if (isset($keyval[1])) { - $knownFiles[$keyval[0]] = trim($keyval[1]); - } - } - fclose($fp); - - foreach ($knownFiles as $file => $sum) { - $relativeName = dirname(__FILE__) . "/../$file"; - if (!is_readable($relativeName)) { - if (file_exists($relativeName)) { - $errors[] = getlocal2("install.cannot_read", array("$mibewroot/$file")); - $errors[] = getlocal2("install.check_permissions", array(fpermissions($relativeName))); - } else { - $errors[] = getlocal2("install.no_file", array("$mibewroot/$file")); - } - return false; - } - if ($sum != "-") { - $result = md5_file($relativeName); - if ($result != $sum) { - // try without \r - $result = md5(str_replace("\r", "", file_get_contents($relativeName))); - } - if ($result != $sum) { - $errors[] = getlocal2("install.bad_checksum", array("$mibewroot/$file")); - $errors[] = getlocal("install.check_files"); - return false; - } - } - } - - $page['done'][] = getlocal("install.0.package"); - return true; -} - -function check_connection() -{ - global $mysqlhost, $mysqllogin, $mysqlpass, $page, $errors, $mibewroot; - $link = @mysql_connect($mysqlhost, $mysqllogin, $mysqlpass); - if ($link) { - $result = mysql_query("SELECT VERSION() as c", $link); - if ($result && $ver = mysql_fetch_array($result, MYSQL_ASSOC)) { - $page['done'][] = getlocal2("install.1.connected", array($ver['c'])); - mysql_free_result($result); - } else { - $errors[] = "Version of your SQL server is unknown. Please check. Error: " . mysql_error($link); - mysql_close($link); - return null; - } - return $link; - } else { - $errors[] = getlocal2("install.connection.error", array(mysql_error())); - return null; - } -} - -function check_database($link) -{ - global $mysqldb, $force_charset_in_connection, $dbencoding, $page, $mibewroot; - if (mysql_select_db($mysqldb, $link)) { - $page['done'][] = getlocal2("install.2.db_exists", array($mysqldb)); - if ($force_charset_in_connection) { - mysql_query("SET character set $dbencoding", $link); - } - return true; - } else { - $page['nextstep'] = getlocal2("install.2.create", array($mysqldb)); - $page['nextnotice'] = getlocal("install.2.notice"); - $page['nextstepurl'] = "$mibewroot/install/dbperform.php?act=createdb"; - } - return false; -} - -function check_tables($link) -{ - global $dbtables, $page, $mibewroot; - $curr_tables = get_tables($link); - if ($curr_tables !== false) { - $tocreate = array_diff(array_keys($dbtables), $curr_tables); - if (count($tocreate) == 0) { - $page['done'][] = getlocal("install.3.tables_exist"); - return true; - } else { - $page['nextstep'] = getlocal("install.3.create"); - $page['nextstepurl'] = "$mibewroot/install/dbperform.php?act=ct"; - } - } - return false; -} - -function check_columns($link) -{ - global $dbtables, $dbtables_can_update, $errors, $page, $mibewroot; - - $need_to_create_columns = false; - foreach ($dbtables as $id => $columns) { - $curr_columns = get_columns($id, $link); - if ($curr_columns === false) { - return false; - } - $tocreate = array_diff(array_keys($columns), $curr_columns); - if (count($tocreate) != 0) { - $cannot_update = array_diff($tocreate, $dbtables_can_update[$id]); - if (count($cannot_update) != 0) { - $errors[] = "Key columns are absent in table `$id'. Unable to continue installation."; - $page['nextstep'] = getlocal("install.kill_tables"); - $page['nextstepurl'] = "$mibewroot/install/dbperform.php?act=dt"; - $page['nextnotice'] = getlocal("install.kill_tables.notice"); - return false; - } - $need_to_create_columns = true; - } - } - - if ($need_to_create_columns) { - $page['nextstep'] = getlocal("install.4.create"); - $page['nextstepurl'] = "$mibewroot/install/dbperform.php?act=addcolumns"; - $page['nextnotice'] = getlocal("install.4.notice"); - return false; - } - - $page['done'][] = getlocal("install.4.done"); - return true; -} - -function check_sound() -{ - global $page; - - $page['soundcheck'] = true; - $page['done'][] = getlocal2("install.5.text", array( - "" . getlocal("install.5.newvisitor") . "", - "" . getlocal("install.5.newmessage") . "" - )); -} - -function check_admin($link) -{ - global $mysqlprefix; - $result = mysql_query("select * from ${mysqlprefix}chatoperator where vclogin = 'admin'", $link); - if ($result) { - $line = mysql_fetch_array($result, MYSQL_ASSOC); - mysql_free_result($result); - return $line['vcpassword'] != md5(''); - } - - return false; -} - -function check_status() -{ - global $page, $mibewroot, $settings, $dbversion; - - $page['done'][] = getlocal2("install.0.php", array(phpversion())); - - if (!check_mibewroot()) { - return; - } - - if (!check_files()) { - return; - } - - $link = check_connection(); - if (!$link) { - return; - } - - if (!check_database($link)) { - mysql_close($link); - return; - } - - if (!check_tables($link)) { - mysql_close($link); - return; - } - - if (!check_columns($link)) { - mysql_close($link); - return; - } - - check_sound(); - - $page['done'][] = getlocal("installed.message"); - - if (!check_admin($link)) { - $page['nextstep'] = getlocal("installed.login_link"); - $page['nextnotice'] = getlocal2("installed.notice", array("${mibewroot}/install/")); - $page['nextstepurl'] = "$mibewroot/operator/login.php?login=admin"; - } - - $page['show_small_login'] = true; - - mysql_close($link); - - loadsettings(); - $settings['dbversion'] = $dbversion; - update_settings(); -} - -check_status(); - -start_html_output(); -require('../view/install_index.php'); -?> \ No newline at end of file diff --git a/src/messenger/webim/install/whatsnew.txt b/src/messenger/webim/install/whatsnew.txt deleted file mode 100644 index 10ec6514..00000000 --- a/src/messenger/webim/install/whatsnew.txt +++ /dev/null @@ -1,204 +0,0 @@ - 1.6.7 - ----- - [+] add https links highlighting (thanks to falcon) - [!] fix several bugs related to specific environments - - 1.6.6 - ----- - [+] add captcha image to pre-chat survey - [+] improve localization (add new constants) - [!] completely abandon old application name (i.e. webim) - [!] switch to more safe hashing alrgorithms for passwords and tokens - [!] switch to more safe generation of user IDs - [!] make important cookies more safe - [!] multiple XSS fixes - [!] multiple SQL Injection fixes - [!] multiple file path manipulation fixes - [!] CSRF fixes - - 1.6.5 - ----- - [+] Apache 2 license - [+] switched to google closure compiler for Javascript compression, jQuery 1.4.2 - [+] improve database schema (add indexes, fix compatibility with MySQL 5.5) - [+] silver skin (thanks to Alekin Pavel) - [+] informational banner on empty password of administrator - [!] CSRF fixes - [!] close old threads by timeout - - 1.6.4 - ----- - [+] core UI improvements, "you are offline" and "new features" notification panels - [+] online/away operators list (on "awaiting visitors" page) by Andrew Armstrong - [+] several instances of mibew in one DB ($mysqlprefix variable) - [+] ability to override notification email for group - [!] various compatibility fixes: button image, captcha, check webimroot variable (installation) - [!] check file permissions/checksum (installation) - [!] fix speed of history search, fix redirection to groups - [!] fix sound issues in windows - - 1.6.3 - ----- - [+] password restore functionality for agent - [+] new Blue logo; new buttons: mgreen, mblue - [!] fixed: button code conflicts with spam filters and mod_security - [!] workarounds if some functions are disabled in php - [!] compatibility with PHP 5.3.0 - [+] new domain: mibew.org - - 1.6.2 - ----- - [+] bi-licensed: EPL / GPL - [+] operator is away status, show status on redirect/survey/operators pages - [+] Captcha - Leave Message - [+] groups page: last active column - [+] pre-chat survey, redirect page: show group status - online/offline/away - [!] do not show empty groups in redirect/survey - [!] compatibility with the latest mod_security rules - [+] performance options in settings: update intervals, operator online time threshold - [+] information messages: visitor navigated to ... - [!] html code in templates, better appearance in Safari - - 1.6.1 - ----- - [!] 404 installation problem - [+] new permission: "Ability to modify profile" - [+] new project name: Mibew Messenger - [!] fixed localization of dates for all languages, nice formatting: Today/Yesterday - [!] fixed online/offline image for groups - [+] ability to delete operators, confirmation dialog when deleting group/operator/blocked address - [+] Information about last activity for operators: Online, Today at 22, 01 Jan.., or Never - [+] new theme: simplicity (by Sheldmandu) - [!] chat templates are fixed according to html standards - - 1.6.0 - ----- - [+] completely new layout of all administrator pages, XHTML 1.0 - [+] New awaiting users and chat log pages - [+] right menu, show/hide menu on awaiting users page, nice locale chooser - [+] main page: warning if database is outdated (after install) - [+] "Updates": news, link to the latest version - [+] Operator's profile page - [+] Configurable pre-chat survey - [+] Create/edit/remove groups - [+] Canned messages page - [+] Statistics page - [+] Popup dialog notification of the new visitor (turned off by default) - [+] Send message option: enter vs ctrl-enter - [!] Slow loading of awating visitors page - - 1.5.2 - ----- - [+] Ability to disable sound notifications for chat (toolbar button) - [+] Switch to SSL in chat (should be enabled in "Settings -> Optional Services") - [!] lost query parameters after login redirect - [+] added referrer into button code - [+] ability to add text for operator into button code, define visitor's name and email - [!] geolocation on IPs in history - [!] Translation UI: added sorting, filters, fixed several problems - [+] New chat buttons - - 1.5.1 - ----- - [!] significant optimization of chat window (both themes), reduced number of images and their sizes - [+] tabs in settings: Optional Services, Themes preview - [+] better French and Spanish translations, additional languages are stored separately - [+] detect Chrome browser, show its version - [!] reverted order in title, removed available_locales variable from config.php (detect automatically) - [!] return English message by default (when translation for other language is absent) - [!] problems with styles, fixed error messages in avatar uploading - [+] nice confirmation when form is saved - - 1.5.0 - ----- - [!] sound notifications: FF (mac,win), Opera (mac,win), IE, Safari (mac,win) - [+] chat styles support: selectors in button generation and in settings - [+] styles are applied as set of page templates - [+] added styles preview page (the link from settings page) with "fake" chat - [+] 2 styles are included: original (old one) and default (new green scheme) - [+] new options in settings: user can change name, presentable name pattern - [+] customizable geolocation link for IPs on pending users page - [+] permissions support: Agents -> some agent -> Permissions - [+] New permissions: - [x] System administration: settings, operators management, button generation - [x] Take over chat thread - [x] View another operator's chat thread - - 1.4.2 - ----- - - [+] Operators photos (appears in users chat window) - [+] pending users: show first user message (below the name) - [+] pending users: show visitors's browser name and version - [+] mark user with unique id to be able to see its dialogs later - [+] special button in operator's thread to browse previous chats - [+] Spam Blocking - - 1.4.1 - ----- - - [+] redirect visitor to another operator - [+] predefined answers (without proper management yet) - [+] play notification sounds (new message, new visitor) - [+] confirmation when trying to intercept another operator's visitor - [+] ability to view threads without taking - - 1.4.0 - ----- - - [+] introduce messenger settings page, persist several options in DB instead of config.php - [+] improve history search speed - [+] do not show typing notification for disconnected remote - [!] monitor connection status, show reconnecing message when connection is low (pendings users and chat window) - [!] support lang & language args in button code, create correct code for link - [!] fix safari, opera 9.5+ (+ several others compatibility fixes) - - 1.0.10 - ------ - - [+] Number of messages from visitor in history - [+] State "loading" (means user is still loading his window) - [+] Timers on peding users page are ticking now - [!] Company logo link target is now an option in config - [!] Mail encoding fixed (separate option) - [!] Operator/user locale is stored in cookie - [!] localized dates - [!] fixed installing on DB with numeric name - [!] empty and double messages - [!] #1983764 - - 1.0.9 - ----- - - [+] typing notifications in chat window - [!] completly new encoding handling, default is utf-8, page encoding is set in resources - [!] fixed user name storage in cookie (now utf8 in base64) - [!] some fixes for Opera - [!] force utf-8 for xml - - 1.0.8 - ----- - - [+] install/update wizard, can create database and update it if needed - [+] leave message form when no operator is available - [!] location of web application can be other than /webim (see config.php) - [!] locale-specific resources extracted into /locales - [!] some fixes for Safari browser - [!] email validation in forms - - 1.0.7 - ----- - - [+] history search with pagination - [+] advanced button generation: secure link, include hostname, choosing images - [+] post referer into thread as a message (visible only for agent) - [+] new config options: user can change name, company name, logo - [+] notify operator if user closed his window - [+] notify visitor if operator has connection problems and move it into priority queue - [+] automatically take visitor if operator connection restored - [!] encoding problems in Internet Explorer - [!] quotes in messages & user names - [!] do not reopen closed threads - [!] some fixes in handling thread locale - [!] version in menu, locales chooser in menu - diff --git a/src/messenger/webim/js/167/brws.js b/src/messenger/webim/js/167/brws.js deleted file mode 100644 index c4c0de99..00000000 --- a/src/messenger/webim/js/167/brws.js +++ /dev/null @@ -1 +0,0 @@ -var myAgent="",myVer=0,myRealAgent="";function detectAgent(){for(var a="opera msie safari firefox netscape mozilla".split(" "),b=navigator.userAgent.toLowerCase(),c=0;c");b.write('');b.write('');b.write('
'); -b.write("");b.close();a.onload=function(){a.myHtml&&(FrameUtils.getDocument(a).getElementById("content").innerHTML+=a.myHtml,FrameUtils.scrollDown(a))}},insertIntoFrame:function(a,b){var c=this.getDocument(a).getElementById("content");null==c?(a.myHtml||(a.myHtml=""),a.myHtml+=b):c.innerHTML+=b},scrollDown:function(a){var b=this.getDocument(a).getElementById("bottom");if("opera"==myAgent)try{a.contentWindow.scrollTo(0,this.getDocument(a).getElementById("content").clientHeight)}catch(c){}b&& -b.scrollIntoView(!1)}};Ajax.ChatThreadUpdater=Class.create(); -Class.inherit(Ajax.ChatThreadUpdater,Ajax.Base,{initialize:function(a){this.setOptions(a);this._options.onComplete=this.requestComplete.bind(this);this._options.onException=this.handleException.bind(this);this._options.onTimeout=this.handleTimeout.bind(this);this._options.timeout=5E3;this.updater={};this.frequency=this._options.frequency||2;this.lastupdate=0;this.focused=this.skipNextsound=this.cansend=!0;this.ownThread=null!=this._options.message;FrameUtils.initFrame(this._options.container);this._options.message&& -(this._options.message.onkeydown=this.handleKeyDown.bind(this),this._options.message.onfocus=function(){this.focused=!0}.bind(this),this._options.message.onblur=function(){this.focused=!1}.bind(this));this.update()},handleException:function(a,b){this.setStatus("offline, reconnecting");this.stopUpdate();this.timer=setTimeout(this.update.bind(this),1E3)},handleTimeout:function(a){this.setStatus("timeout, reconnecting");this.stopUpdate();this.timer=setTimeout(this.update.bind(this),1E3)},updateOptions:function(a){this._options.parameters= -"act="+a+"&thread="+(this._options.threadid||0)+"&token="+(this._options.token||0)+"&lastid="+(this._options.lastid||0);this._options.user&&(this._options.parameters+="&user=true");"refresh"==a&&(this._options.message&&""!=this._options.message.value)&&(this._options.parameters+="&typed=1")},enableInput:function(a){this._options.message&&(this._options.message.disabled=!a)},stopUpdate:function(){this.enableInput(!0);this.updater._options&&(this.updater._options.onComplete=void 0);clearTimeout(this.timer)}, -update:function(){this.updateOptions("refresh");this.updater=new Ajax.Request(this._options.servl,this._options)},requestComplete:function(a){try{this.enableInput(!0);this.cansend=!0;var b=Ajax.getXml(a);b&&"thread"==b.tagName?this.updateContent(b):this.handleError(a,b,"refresh messages failed")}catch(c){}this.skipNextsound=!1;this.timer=setTimeout(this.update.bind(this),1E3*this.frequency)},postMessage:function(a){if(""!=a&&this.cansend){this.cansend=!1;this.stopUpdate();this.skipNextsound=!0;this.updateOptions("post"); -var b={}.extend(this._options);b.parameters+="&message="+encodeURIComponent(a);b.onComplete=function(a){this.requestComplete(a);this._options.message&&(this._options.message.value="",this._options.message.focus())}.bind(this);"opera"!=myRealAgent&&this.enableInput(!1);this.updater=new Ajax.Request(this._options.servl,b)}},changeName:function(a){this.skipNextsound=!0;new Ajax.Request(this._options.servl,{parameters:"act=rename&thread="+(this._options.threadid||0)+"&token="+(this._options.token||0)+ -"&name="+encodeURIComponent(a)})},onThreadClosed:function(a){var b=Ajax.getXml(a);b&&"closed"==b.tagName?setTimeout("window.close()",2E3):this.handleError(a,b,"cannot close")},closeThread:function(){var a="act=close&thread="+(this._options.threadid||0)+"&token="+(this._options.token||0);this._options.user&&(a+="&user=true");new Ajax.Request(this._options.servl,{parameters:a,onComplete:this.onThreadClosed.bind(this)})},processMessage:function(a,b){var c=NodeUtils.getNodeText(b);FrameUtils.insertIntoFrame(a, -c)},showTyping:function(a){$("typingdiv")&&($("typingdiv").style.display=a?"inline":"none")},setupAvatar:function(a){a=NodeUtils.getNodeText(a);this._options.avatar&&this._options.user&&(this._options.avatar.innerHTML=""!=a?'':"")},updateContent:function(a){var b=!1,c=this._options.container,d=NodeUtils.getAttrValue(a,"lastid");d&&(this._options.lastid=d);(d=NodeUtils.getAttrValue(a, -"typing"))&&this.showTyping("1"==d);(d=NodeUtils.getAttrValue(a,"canpost"))&&("1"==d&&!this.ownThread||this.ownThread&&"1"!=d)&&(window.location.href=window.location.href);for(d=0;dthis?"0"+a:a};var Try={these:function(){for(var a,b=0;ba.status&&(a=a.responseXML)&&a.documentElement?a.documentElement:null},getError:function(a){return a.statusText||"connection error N"+a.status},emptyFunction:function(){},Base:function(){}}; -Ajax.Base.prototype={setOptions:function(a){this._options={_method:"post",asynchronous:!0,parameters:""}.extend(a||{})},getStatus:function(){try{return this.transport.status||0}catch(a){return 0}},responseIsSuccess:function(){var a=this.getStatus();return!a||200<=a&&300>a},responseIsFailure:function(){return!this.responseIsSuccess()}};Ajax.Request=Class.create();Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"]; -Class.inherit(Ajax.Request,Ajax.Base,{initialize:function(a,b){this.transport=Ajax.getTransport();this.setOptions(b);this.transportTimer={};this.finished=!1;this.request(a)},request:function(a){var b=this._options.parameters||"";0(navigator.userAgent.match("/Gecko/(d{4})/")|| -[0,2005])[1]&&a.push("Connection","close"));this._options.requestHeaders&&a.push.apply(a,this._options.requestHeaders);for(var b=0;b'}function htmlescape(a){return a.replace("&","&").replace("<","<").replace(">",">").replace('"',""")}; diff --git a/src/messenger/webim/js/167/ie.js b/src/messenger/webim/js/167/ie.js deleted file mode 100644 index 3ca1172a..00000000 --- a/src/messenger/webim/js/167/ie.js +++ /dev/null @@ -1,11 +0,0 @@ -window.attachEvent('onload', mkwidth); -window.attachEvent('onresize', mkwidth); - -function mkwidth(){ - if(document.getElementById("wrap700")) { - document.getElementById("wrap700").style.width = document.documentElement.clientWidth < 750 ? "750px" : "100%"; - } - if(document.getElementById("wrap400")) { - document.getElementById("wrap400").style.width = document.documentElement.clientWidth < 450 ? "450px" : "100%"; - } -}; \ No newline at end of file diff --git a/src/messenger/webim/js/167/locale.js b/src/messenger/webim/js/167/locale.js deleted file mode 100644 index c94fffcc..00000000 --- a/src/messenger/webim/js/167/locale.js +++ /dev/null @@ -1,61 +0,0 @@ -var popupStatus = 0; - -function loadPopup(){ - if(popupStatus==0){ - $("#backgroundPopup").css({ - "opacity": "0.7" - }); - $("#backgroundPopup").fadeIn("slow"); - $("#dashlocalesPopup").fadeIn("slow"); - popupStatus = 1; - } -} -function disablePopup(){ - if(popupStatus==1){ - $("#backgroundPopup").fadeOut("slow"); - $("#dashlocalesPopup").fadeOut("slow"); - popupStatus = 0; - } -} - -function normpos(a) { - if(a < 10) { - return 10; - } - return a; -} - -function centerPopup(){ - var windowWidth = document.documentElement.clientWidth; - var windowHeight = document.documentElement.clientHeight; - var popupHeight = $("#dashlocalesPopup").height(); - var popupWidth = $("#dashlocalesPopup").width(); - $("#dashlocalesPopup").css({ - "position": "absolute", - "top": normpos((windowHeight-popupHeight) * 0.2), - "left": normpos(windowWidth/2-popupWidth/2) - }); - $("#backgroundPopup").css({ - "height": windowHeight - }); -} - -$(function(){ - $("#changelang").click(function(){ - centerPopup(); - loadPopup(); - return false; - }); - $("#dashlocalesPopupClose").click(function(){ - disablePopup(); - return false; - }); - $("#backgroundPopup").click(function(){ - disablePopup(); - }); - $(document).keypress(function(e){ - if(e.keyCode==27 && popupStatus==1){ - disablePopup(); - } - }); -}); diff --git a/src/messenger/webim/js/167/soundcheck.js b/src/messenger/webim/js/167/soundcheck.js deleted file mode 100644 index 8a487619..00000000 --- a/src/messenger/webim/js/167/soundcheck.js +++ /dev/null @@ -1 +0,0 @@ -Behaviour.register({"a#check-nv":function(a){a.onclick=function(){playSound(wroot+"/sounds/new_user.wav")}},"a#check-nm":function(a){a.onclick=function(){playSound(wroot+"/sounds/new_message.wav")}}}); diff --git a/src/messenger/webim/js/167/update.js b/src/messenger/webim/js/167/update.js deleted file mode 100644 index a5eae88d..00000000 --- a/src/messenger/webim/js/167/update.js +++ /dev/null @@ -1,33 +0,0 @@ -function loadNews() { - if (typeof(window.mibewNews) == "undefined" || typeof(window.mibewNews.length) == "undefined") - return; - - var str = "
"; - for (var i = 0; i < window.mibewNews.length; i++) { - str += "
" + window.mibewNews[i].title + ", " + window.mibewNews[i].date + "
"; - str += "
" + window.mibewNews[i].message+"
"; - } - $("#news").html(str + "
"); -} - -function loadVersion() { - if(typeof(window.mibewLatest) == "undefined" || typeof(window.mibewLatest.version) == "undefined") - return; - - var current = $("#cver").html(); - - if(current != window.mibewLatest.version) { - if(current < window.mibewLatest.version) { - $("#cver").css("color","red"); - } - $("#lver").html(window.mibewLatest.version+", Download "+window.mibewLatest.title+""); - } else { - $("#cver").css("color","green"); - $("#lver").html(window.mibewLatest.version); - } -} - -$(function(){ - loadNews(); - loadVersion(); -}); \ No newline at end of file diff --git a/src/messenger/webim/js/167/users.js b/src/messenger/webim/js/167/users.js deleted file mode 100644 index 7ececf67..00000000 --- a/src/messenger/webim/js/167/users.js +++ /dev/null @@ -1,27 +0,0 @@ -/* - This file is part of Mibew Messenger project. - http://mibew.org - - Copyright (c) 2005-2013 Mibew Messenger Community - License: http://mibew.org/license.php -*/ -Ajax.PeriodicalUpdater=Class.create(); -Class.inherit(Ajax.PeriodicalUpdater,Ajax.Base,{initialize:function(a){this.setOptions(a);this._options.onComplete=this.requestComplete.bind(this);this._options.onException=this.handleException.bind(this);this._options.onTimeout=this.handleTimeout.bind(this);this._options.timeout=5E3;this.frequency=this._options.frequency||2;this.updater={};this.update()},handleException:function(a,b){this._options.handleError&&this._options.handleError("offline, reconnecting");this.stopUpdate();this.timer=setTimeout(this.update.bind(this), -1E3)},handleTimeout:function(a){this._options.handleError&&this._options.handleError("timeout, reconnecting");this.stopUpdate();this.timer=setTimeout(this.update.bind(this),1E3)},stopUpdate:function(){this.updater._options&&(this.updater._options.onComplete=void 0);clearTimeout(this.timer)},update:function(){this._options.updateParams&&(this._options.parameters=this._options.updateParams());this.updater=new Ajax.Request(this._options.url,this._options)},requestComplete:function(a){try{var b=Ajax.getXml(a); -b?(this._options.updateContent||Ajax.emptyFunction)(b):this._options.handleError&&this._options.handleError("reconnecting")}catch(c){}this.timer=setTimeout(this.update.bind(this),1E3*this.frequency)}}); -var HtmlGenerationUtils={popupLink:function(a,b,c,d,e,m,l){return'"+d+""},generateOneRowTable:function(a){return''+a+"
"},viewOpenCell:function(a,b,c,d,e,m,l,p){m= -2;b=b+"?thread="+c;var f="",f=e||d?f+HtmlGenerationUtils.popupLink(p||!d?b:b+"&viewonly=true",localized[e?0:1],"ImCenter"+c,a,640,480,null):f+(''+a+""),f=f+"";e&&(f=f+''+HtmlGenerationUtils.popupLink(b,localized[0],"ImCenter"+c,''+localized[0]+'',640,480,null),f+="",m++);d&&(f+='',f+=HtmlGenerationUtils.popupLink(b+"&viewonly=true",localized[1],"ImCenter"+ -c,''+localized[1]+'',640,480,null),f+="",m++);""!=l&&(f+='',f+=30");return HtmlGenerationUtils.generateOneRowTable(f)},banCell:function(a,b){return''+HtmlGenerationUtils.popupLink(mibewRoot+"/operator/ban.php?"+ -(b?"id="+b:"thread="+a),localized[2],"ban"+a,''+localized[2]+'',720,480,null)+""}};Ajax.ThreadListUpdater=Class.create(); -Class.inherit(Ajax.ThreadListUpdater,Ajax.Base,{initialize:function(a){this.setOptions(a);this._options.updateParams=this.updateParams.bind(this);this._options.handleError=this.handleError.bind(this);this._options.updateContent=this.updateContent.bind(this);this._options.lastrevision=0;this.threadTimers={};this.delta=0;this.t=this._options.table;this.periodicalUpdater=new Ajax.PeriodicalUpdater(this._options)},updateParams:function(){return"since="+this._options.lastrevision+"&status="+this._options.istatus+ -(this._options.showonline?"&showonline=1":"")},setStatus:function(a){this._options.status.innerHTML=a},handleError:function(a){this.setStatus(a)},updateThread:function(a){function b(a,b,c,d){if(a=CommonUtils.getCell(c,b,a))a.innerHTML=d}for(var c,d,e,m=!1,l=!1,p=!1,f=null,q=null,g=0;g"+NodeUtils.getNodeValue(a,"useragent")+"";null!=f&&(r=""+NodeUtils.getNodeValue(a, -"reason")+"");p&&(r+=HtmlGenerationUtils.banCell(c,q));r=HtmlGenerationUtils.generateOneRowTable(r);a=CommonUtils.getRow("t"+d,this.t);p=CommonUtils.getRow("t"+d+"end",this.t);null!=g&&(g.rowIndex<=a.rowIndex||g.rowIndex>=p.rowIndex)&&(this.t.deleteRow(g.rowIndex),g=this.threadTimers[c]=null);if(null==g){if(g=this.t.insertRow(a.rowIndex+1),g.className="blocked"==f&&"chat"!=d?"ban":"in"+d,g.id="thr"+c,this.threadTimers[c]=[s,t,d],CommonUtils.insertCell(g,"name","visitor",null,null,HtmlGenerationUtils.viewOpenCell(n, -this._options.agentservl,c,m,l,f,w,"chat"!=d)),CommonUtils.insertCell(g,"contid","visitor","center",null,u),CommonUtils.insertCell(g,"state","visitor","center",null,e),CommonUtils.insertCell(g,"op","visitor","center",null,v),CommonUtils.insertCell(g,"time","visitor","center",null,this.getTimeSince(s)),CommonUtils.insertCell(g,"wait","visitor","center",null,"chat"!=d?this.getTimeSince(t):"-"),CommonUtils.insertCell(g,"etc","visitor","center",null,r),"wait"==d||"prio"==d)return!0}else this.threadTimers[c]= -[s,t,d],g.className="blocked"==f&&"chat"!=d?"ban":"in"+d,b(this.t,g,"name",HtmlGenerationUtils.viewOpenCell(n,this._options.agentservl,c,m,l,f,w,"chat"!=d)),b(this.t,g,"contid",u),b(this.t,g,"state",e),b(this.t,g,"op",v),b(this.t,g,"time",this.getTimeSince(s)),b(this.t,g,"wait","chat"!=d?this.getTimeSince(t):"-"),b(this.t,g,"etc",r);return!1}},updateQueueMessages:function(){function a(a,b){var c=$(b),l=$(b+"end");return null==c||null==l?!1:c.rowIndex+1a&&(a="0"+a);60<=b&&(c=Math.floor(b/60),b%=60,10>b&&(b="0"+b),c+=":");return c+b+":"+a},updateTimers:function(){for(var a in this.threadTimers)if(null!=this.threadTimers[a]){var b=this.threadTimers[a],c=CommonUtils.getRow("thr"+a,this.t);if(null!=c){var d=this.getTimeSince(b[0]), -e=CommonUtils.getCell("time",c,this.t);e&&(e.innerHTML=d);b="chat"!=b[2]?this.getTimeSince(b[1]):"-";if(c=CommonUtils.getCell("wait",c,this.t))c.innerHTML=b}}},updateThreads:function(a){var b=!1,c=NodeUtils.getAttrValue(a,"time"),d=NodeUtils.getAttrValue(a,"revision");c&&(this.delta=(new Date).getTime()-c);d&&(this._options.lastrevision=d);for(c=0;c '+m}}b.innerHTML= -c.join(", ")}},updateContent:function(a){if("update"==a.tagName)for(var b=0;b)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/, -Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&& -(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this, -a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b=== -"find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this, -function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b
a"; -var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected, -parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent= -false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n= -s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true, -applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando]; -else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this, -a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b=== -w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i, -cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected= -c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed"); -a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g, -function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split("."); -k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a), -C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B=0){a.type= -e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&& -f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive; -if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data", -e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a, -"_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a, -d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, -e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift(); -t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D|| -g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()}, -CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m, -g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)}, -text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}}, -setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return hl[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h= -h[3];l=0;for(m=h.length;l=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m=== -"="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g, -h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&& -q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML=""; -if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="

";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}(); -(function(){var g=s.createElement("div");g.innerHTML="
";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}: -function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f0)for(var j=d;j0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j= -{},i;if(f&&a.length){e=0;for(var o=a.length;e-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a=== -"string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode", -d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")? -a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType=== -1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/"},F={option:[1,""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div
","
"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d= -c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, -wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})}, -prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b, -this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild); -return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja, -""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]); -return this}else{e=0;for(var j=d.length;e0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["", -""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]===""&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e= -c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]? -c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja= -function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter= -Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a, -"border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f= -a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b= -a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=//gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!== -"string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("
").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this}, -serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), -function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href, -global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&& -e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)? -"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache=== -false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B= -false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since", -c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E|| -d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x); -g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status=== -1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b=== -"json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional; -if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration=== -"number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]|| -c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start; -this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now= -this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem, -e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b
"; -a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b); -c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a, -d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top- -f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset": -"pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in -e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window); diff --git a/src/messenger/webim/js/source/.htaccess b/src/messenger/webim/js/source/.htaccess deleted file mode 100644 index 14249c50..00000000 --- a/src/messenger/webim/js/source/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all \ No newline at end of file diff --git a/src/messenger/webim/js/source/brws.js b/src/messenger/webim/js/source/brws.js deleted file mode 100644 index 9a895eb0..00000000 --- a/src/messenger/webim/js/source/brws.js +++ /dev/null @@ -1,30 +0,0 @@ -var myAgent = ""; -var myVer = 0; -var myRealAgent = ""; - -function detectAgent() { - var AGENTS = ["opera","msie","safari","firefox","netscape","mozilla"]; - var agent = navigator.userAgent.toLowerCase(); - for (var i = 0; i < AGENTS.length; i++) { - var agentStr = AGENTS[i]; - if (agent.indexOf(agentStr) != -1) { - myAgent = agentStr; - if (!window.RegExp) - break; - - var versionExpr = new RegExp(agentStr + "[ \/]?([0-9]+(\.[0-9]+)?)"); - if (versionExpr.exec(agent) != null) { - myVer = parseFloat(RegExp.$1); - } - break; - } - } - myRealAgent = myAgent; - if( navigator.product == "Gecko") - myAgent = "moz"; -} -detectAgent(); - -function getEl(name) { - return document.getElementById(name); -} diff --git a/src/messenger/webim/js/source/build.xml b/src/messenger/webim/js/source/build.xml deleted file mode 100644 index 59093f12..00000000 --- a/src/messenger/webim/js/source/build.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/messenger/webim/js/source/chat.js b/src/messenger/webim/js/source/chat.js deleted file mode 100644 index f78cb3e3..00000000 --- a/src/messenger/webim/js/source/chat.js +++ /dev/null @@ -1,400 +0,0 @@ -/** - * @preserve This file is part of Mibew Messenger project. - * http://mibew.org - * - * Copyright (c) 2005-2013 Mibew Messenger Community - * License: http://mibew.org/license.php - */ - -var FrameUtils = { - getDocument: function(frm) { - if (frm.contentDocument) { - return frm.contentDocument; - } else if (frm.contentWindow) { - return frm.contentWindow.document; - } else if (frm.document) { - return frm.document; - } else { - return null; - } - }, - - initFrame: function(frm) { - var doc = this.getDocument(frm); - doc.open(); - doc.write(""); - doc.write(""); - doc.write(""); - doc.write("
"); - doc.write(""); - doc.close(); - frm.onload = function() { - if( frm.myHtml ) { - FrameUtils.getDocument(frm).getElementById('content').innerHTML += frm.myHtml; - FrameUtils.scrollDown(frm); - } - }; - }, - - insertIntoFrame: function(frm, htmlcontent) { - var vcontent = this.getDocument(frm).getElementById('content'); - if( vcontent == null ) { - if( !frm.myHtml ) frm.myHtml = ""; - frm.myHtml += htmlcontent; - } else { - vcontent.innerHTML += htmlcontent; - } - }, - - scrollDown: function(frm) { - var vbottom = this.getDocument(frm).getElementById('bottom'); - if( myAgent == 'opera' ) { - try { - frm.contentWindow.scrollTo(0,this.getDocument(frm).getElementById('content').clientHeight); - } catch(e) {} - } - if( vbottom ) { - vbottom.scrollIntoView(false); - } - } -}; - -Ajax.ChatThreadUpdater = Class.create(); -Class.inherit( Ajax.ChatThreadUpdater, Ajax.Base, { - - initialize: function(_options) { - this.setOptions(_options); - this._options.onComplete = this.requestComplete.bind(this); - this._options.onException = this.handleException.bind(this); - this._options.onTimeout = this.handleTimeout.bind(this); - this._options.timeout = 5000; - this.updater = {}; - this.frequency = (this._options.frequency || 2); - this.lastupdate = 0; - this.cansend = true; - this.skipNextsound = true; - this.focused = true; - this.ownThread = this._options.message != null; - FrameUtils.initFrame(this._options.container); - if( this._options.message ) { - this._options.message.onkeydown = this.handleKeyDown.bind(this); - this._options.message.onfocus = (function() { this.focused = true; }).bind(this); - this._options.message.onblur = (function() { this.focused = false; }).bind(this) - } - this.update(); - }, - - handleException: function(_request, ex) { - this.setStatus("offline, reconnecting"); - this.stopUpdate(); - this.timer = setTimeout(this.update.bind(this), 1000); - }, - - handleTimeout: function(_request) { - this.setStatus("timeout, reconnecting"); - this.stopUpdate(); - this.timer = setTimeout(this.update.bind(this), 1000); - }, - - updateOptions: function(act) { - this._options.parameters = 'act='+act+'&thread=' + (this._options.threadid || 0) + - '&token=' + (this._options.token || 0)+ - '&lastid=' + (this._options.lastid || 0); - if( this._options.user ) - this._options.parameters += "&user=true"; - if( act == 'refresh' && this._options.message && this._options.message.value != '' ) - this._options.parameters += "&typed=1"; - }, - - enableInput: function(val) { - if( this._options.message ) - this._options.message.disabled = !val; - }, - - stopUpdate: function() { - this.enableInput(true); - if( this.updater._options ) - this.updater._options.onComplete = undefined; - clearTimeout(this.timer); - }, - - update: function() { - this.updateOptions("refresh"); - this.updater = new Ajax.Request(this._options.servl, this._options); - }, - - requestComplete: function(_response) { - try { - this.enableInput(true); - this.cansend = true; - var xmlRoot = Ajax.getXml(_response); - if( xmlRoot && xmlRoot.tagName == 'thread' ) { - this.updateContent( xmlRoot ); - } else { - this.handleError(_response, xmlRoot, 'refresh messages failed'); - } - } catch (e) { - } - this.skipNextsound = false; - this.timer = setTimeout(this.update.bind(this), this.frequency * 1000); - }, - - postMessage: function(msg) { - if( msg == "" || !this.cansend) { - return; - } - this.cansend = false; - this.stopUpdate(); - this.skipNextsound = true; - this.updateOptions("post"); - var postOptions = {}.extend(this._options); - postOptions.parameters += "&message=" + encodeURIComponent(msg); - postOptions.onComplete = (function(presponse) { - this.requestComplete( presponse ); - if( this._options.message ) { - this._options.message.value = ''; - this._options.message.focus(); - } - }).bind(this); - if( myRealAgent != 'opera' ) - this.enableInput(false); - this.updater = new Ajax.Request(this._options.servl, postOptions); - }, - - changeName: function(newname) { - this.skipNextsound = true; - new Ajax.Request(this._options.servl, {parameters:'act=rename&thread=' + (this._options.threadid || 0) + - '&token=' + (this._options.token || 0) + '&name=' + encodeURIComponent(newname)}); - - }, - - onThreadClosed: function(_response) { - var xmlRoot = Ajax.getXml(_response); - if( xmlRoot && xmlRoot.tagName == 'closed' ) { - setTimeout('window.close()', 2000); - } else { - this.handleError(_response, xmlRoot, 'cannot close'); - } - }, - - closeThread: function() { - var _params = 'act=close&thread=' + (this._options.threadid || 0) + '&token=' + (this._options.token || 0); - if( this._options.user ) - _params += "&user=true"; - new Ajax.Request(this._options.servl, {parameters:_params, onComplete: this.onThreadClosed.bind(this)}); - }, - - processMessage: function(_target, message) { - var destHtml = NodeUtils.getNodeText(message); - FrameUtils.insertIntoFrame(_target, destHtml ); - }, - - showTyping: function(istyping) { - if( $("typingdiv") ) { - $("typingdiv").style.display=istyping ? 'inline' : 'none'; - } - }, - - setupAvatar: function(avatar) { - var imageLink = NodeUtils.getNodeText(avatar); - if( this._options.avatar && this._options.user ) { - this._options.avatar.innerHTML = imageLink != "" - ? "\"\"\"\"/" - : ""; - } - }, - - updateContent: function(xmlRoot) { - var haveMessage = false; - - var result_div = this._options.container; - var _lastid = NodeUtils.getAttrValue(xmlRoot, "lastid"); - if( _lastid ) { - this._options.lastid = _lastid; - } - - var typing = NodeUtils.getAttrValue(xmlRoot, "typing"); - if( typing ) { - this.showTyping(typing == '1'); - } - - var canpost = NodeUtils.getAttrValue(xmlRoot, "canpost"); - if( canpost ) { - if( canpost == '1' && !this.ownThread || this.ownThread && canpost != '1' ) { - window.location.href = window.location.href; - } - } - - for( var i = 0; i < xmlRoot.childNodes.length; i++ ) { - var node = xmlRoot.childNodes[i]; - if( node.tagName == 'message' ) { - haveMessage = true; - this.processMessage(result_div, node); - } else if( node.tagName == 'avatar' ) { - this.setupAvatar(node); - } - } - if(window.location.search.indexOf('trace=on')>=0) { - var val = "updated"; - if(this.lastupdate > 0) { - var seconds = ((new Date()).getTime() - this.lastupdate)/1000; - val = val + ", " + seconds + " secs"; - if(seconds > 10) { - alert(val); - } - } - this.lastupdate = (new Date()).getTime(); - this.setStatus(val); - } else { - this.clearStatus(); - } - if( haveMessage ) { - FrameUtils.scrollDown(this._options.container); - if(!this.skipNextsound) { - var tsound = $('soundimg'); - if(tsound == null || tsound.className.match(new RegExp("\\bisound\\b")) ) { - playSound(Chat.mibewRoot+'/sounds/new_message.wav'); - } - } - if( !this.focused ) { - window.focus(); - } - } - }, - - isSendkey: function(ctrlpressed, key) { - return ((key==13 && (ctrlpressed || this._options.ignorectrl)) || (key==10)); - }, - - handleKeyDown: function(k) { - if( k ){ ctrl=k.ctrlKey;k=k.which; } else { k=event.keyCode;ctrl=event.ctrlKey; } - if( this._options.message && this.isSendkey(ctrl, k) ) { - var mmsg = this._options.message.value; - if( this._options.ignorectrl ) { - mmsg = mmsg.replace(/[\r\n]+$/,''); - } - this.postMessage( mmsg ); - return false; - } - return true; - }, - - handleError: function(_response, xmlRoot, _action) { - if( xmlRoot && xmlRoot.tagName == 'error' ) { - this.setStatus(NodeUtils.getNodeValue(xmlRoot,"descr")); - } else { - this.setStatus("reconnecting"); - } - }, - - showStatusDiv: function(k) { - if( $("engineinfo") ) { - $("engineinfo").style.display='inline'; - $("engineinfo").innerHTML = k; - } - }, - - setStatus: function(k) { - if( this.statusTimeout ) - clearTimeout(this.statusTimeout); - this.showStatusDiv(k); - this.statusTimeout = setTimeout(this.clearStatus.bind(this), 4000); - }, - - clearStatus: function() { - $("engineinfo").style.display='none'; - } -}); - - -var Chat = { - threadUpdater : {}, - - applyName: function() { - if ( !$('uname').value.match(/^\s*$/) ) { - Chat.threadUpdater.changeName($('uname').value); - $('changename1').style.display='none'; - $('changename2').style.display='inline'; - $('unamelink').innerHTML = htmlescape($('uname').value); - } - }, - - showNameField: function() { - $('changename1').style.display='inline'; - $('changename2').style.display='none'; - } -}; - -Behaviour.register({ - '#postmessage a' : function(el) { - el.onclick = function() { - var message = $('msgwnd'); - if( message ) - Chat.threadUpdater.postMessage(message.value); - }; - }, - 'select#predefined' : function(el) { - el.onchange = function() { - var message = $('msgwnd'); - if(this.selectedIndex!=0) { - message.value = this.options[this.selectedIndex].innerText || this.options[this.selectedIndex].innerHTML; - } - this.selectedIndex = 0; - message.focus(); - }; - }, - 'div#changename2 a' : function(el) { - el.onclick = function() { - Chat.showNameField(); - return false; - }; - }, - 'div#changename1 a' : function(el) { - el.onclick = function() { - Chat.applyName(); - return false; - }; - }, - 'div#changename1 input#uname' : function(el) { - el.onkeydown = function(e) { - var ev = e || event; - if( ev.keyCode == 13 ) { - Chat.applyName(); - } - }; - }, - 'a#refresh' : function(el) { - el.onclick = function() { - Chat.threadUpdater.stopUpdate(); - Chat.threadUpdater.update(); - }; - }, - 'a#togglesound' : function(el) { - el.onclick = function() { - var tsound = $('soundimg'); - if(!tsound) { - return; - } - if(tsound.className.match(new RegExp("\\bisound\\b"))) { - tsound.className = "tplimage inosound"; - } else { - tsound.className = "tplimage isound"; - } - var messagePane = $('msgwnd'); - if(messagePane) - messagePane.focus(); - }; - }, - 'a.closethread' : function(el) { - el.onclick = function() { - Chat.threadUpdater.closeThread(); - }; - } -}); - -EventHelper.register(window, 'onload', function(){ - Chat.mibewRoot = threadParams.wroot; - Chat.cssfile = threadParams.cssfile; - Chat.threadUpdater = new Ajax.ChatThreadUpdater(({ignorectrl:-1,container:myRealAgent=='safari'?self.frames[0]:$("chatwnd"),avatar:$("avatarwnd"),message:$("msgwnd")}).extend( threadParams || {} )); -}); \ No newline at end of file diff --git a/src/messenger/webim/js/source/common.js b/src/messenger/webim/js/source/common.js deleted file mode 100644 index b155f22f..00000000 --- a/src/messenger/webim/js/source/common.js +++ /dev/null @@ -1,521 +0,0 @@ -/** - * @preserve This file is part of Mibew Messenger project. - * http://mibew.org - * - * Copyright (c) 2005-2013 Mibew Messenger Community - * License: http://mibew.org/license.php - */ - -/* - * common.js Based on Prototype JavaScript framework, version 1.3.1 - * http://prototype.conio.net/ (c) 2005 Sam Stephenson - */ - -//- getEl, myAgent, myRealAgent - -//- localized - -//- onComplete, showonline -//- threadParams, servl, frequency, user, threadid, token, cssfile -//- updaterOptions, url, company, agentservl, noclients, wroot, havemenu, showpopup, ignorectrl, istatus - - -var Class = { - create: function() { - return function() { - this.initialize.apply(this, arguments); - }; - }, - - inherit: function(child,parent,body) { - Object.extend(Object.extend(child.prototype, parent.prototype), body ); - } -}; - -Object.extend = function(destination, source) { - for (property in source) { - destination[property] = source[property]; - } - return destination; -}; - -Object.prototype.extend = function(_object) { - return Object.extend.apply(this, [this, _object]); -}; - -Function.prototype.bind = function(_object) { - var __method = this; - return function() { - return __method.apply(_object, arguments); - } -}; - -Function.prototype.bindAsEventListener = function(_object) { - var __method = this; - return function(event) { - __method.call(_object, event || window.event); - } -}; - -Number.prototype.toColorPart = function() { - var digits = this.toString(16); - if (this < 16) return '0' + digits; - return digits; -}; - -var Try = { - these: function() { - var returnValue; - - for (var i = 0; i < arguments.length; i++) { - var lambda = arguments[i]; - try { - returnValue = lambda(); - break; - } catch (e) {} - } - - return returnValue; - } -}; - -/*--------------------------------------------------------------------------*/ - -var PeriodicalExecuter = Class.create(); -PeriodicalExecuter.prototype = { - initialize: function(callback, frequency) { - this.callback = callback; - this.frequency = frequency; - this.currentlyExecuting = false; - - this.registerCallback(); - }, - - registerCallback: function() { - setInterval(this.onTimerEvent.bind(this), this.frequency * 1000); - }, - - onTimerEvent: function() { - if (!this.currentlyExecuting) { - try { - this.currentlyExecuting = true; - this.callback(); - } finally { - this.currentlyExecuting = false; - } - } - } -}; - -/*--------------------------------------------------------------------------*/ - -function findObj( id ) -{ - var x; - if( !( x = document[ id ] ) && document.all ) x = document.all[ id ]; - if( !x && document.getElementById ) x = document.getElementById( id ); - if( !x && !document.all && document.getElementsByName ) - { - x = document.getElementsByName( id ); - if( x.length == 0 ) return null; - if( x.length == 1 ) return x[ 0 ]; - } - - return x; -} - -if (!Array.prototype.push) { - Array.prototype.push = function() { - var startLength = this.length; - for (var i = 0; i < arguments.length; i++) - this[startLength + i] = arguments[i]; - return this.length; - }; -} - -function $() { - var elems = new Array(); - - for (var i = 0; i < arguments.length; i++) { - var elem = arguments[i]; - if (typeof elem == 'string') - elem = findObj(elem); - - if (arguments.length == 1) - return elem; - - elems.push(elem); - } - - return elems; -} - -var Ajax = { - getTransport: function() { - return Try.these( - function() {return new ActiveXObject('Msxml2.XMLHTTP')}, - function() {return new ActiveXObject('Microsoft.XMLHTTP')}, - function() {return new XMLHttpRequest()} - ) || false; - }, - - getXml: function(_response) { - if( _response && - _response.status >= 200 && - _response.status < 300 ) { - var xmlDoc = _response.responseXML; - if( xmlDoc && xmlDoc.documentElement ) - return xmlDoc.documentElement; - } - return null; - }, - - getError: function(_response) { - return _response.statusText || "connection error N" + _response.status; - }, - - emptyFunction: function() {} -}; - -Ajax.Base = function() {}; -Ajax.Base.prototype = { - setOptions: function(_options) { - this._options = { - _method: 'post', - asynchronous: true, - parameters: '' - }.extend(_options || {}); - }, - - getStatus: function() { - try { - return this.transport.status || 0; - } catch (e) { return 0 } - }, - - responseIsSuccess: function() { - var status = this.getStatus(); - return !status || (status >= 200 && status < 300); - }, - - responseIsFailure: function() { - return !this.responseIsSuccess(); - } -}; - -Ajax.Request = Class.create(); -Ajax.Request.Events = - ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete']; - -Class.inherit( Ajax.Request, Ajax.Base, { - initialize: function(url, _options) { - this.transport = Ajax.getTransport(); - this.setOptions(_options); - this.transportTimer = {}; - this.finished = false; - this.request(url); - }, - - request: function(url) { - var parameters = this._options.parameters || ''; - if (parameters.length > 0) parameters += '&_='; - - try { - if (this._options._method == 'get' && parameters.length > 0) - url += '?' + parameters; - - this.transport.open(this._options._method.toUpperCase(), url, this._options.asynchronous); - - if (this._options.asynchronous) { - this.transport.onreadystatechange = this.onStateChange.bind(this); - if(this._options.timeout) { - this.transportTimer = setTimeout(this.handleTimeout.bind(this), this._options.timeout); - } - } - - this.setRequestHeaders(); - - var pbody = this._options.postBody ? this._options.postBody : parameters; - this.transport.send(this._options._method == 'post' ? pbody : null); - - } catch (e) { - this.dispatchException(e); - } - }, - - setRequestHeaders: function() { - var requestHeaders = - ['X-Requested-With', 'XMLHttpRequest']; - - if (this._options._method == 'post') { - requestHeaders.push('Content-type', - 'application/x-www-form-urlencoded'); - - /* Force "Connection: close" for older Mozilla browsers to work - * around a bug where XMLHttpRequest sends an incorrect - * Content-length header. See Mozilla Bugzilla #246651. - */ - if (this.transport.overrideMimeType && - (navigator.userAgent.match("/Gecko\/(\d{4})/") || [0,2005])[1] < 2005) - requestHeaders.push('Connection', 'close'); - } - - if (this._options.requestHeaders) - requestHeaders.push.apply(requestHeaders, this._options.requestHeaders); - - for (var i = 0; i < requestHeaders.length; i += 2) - this.transport.setRequestHeader(requestHeaders[i], requestHeaders[i+1]); - }, - - onStateChange: function() { - var readystate = this.transport.readyState; - if (readystate != 1) - this.respondToReadyState(this.transport.readyState); - }, - - handleTimeout: function() { - if(this.finished) { return; } - this.finished = true; - (this._options.onTimeout || Ajax.emptyFunction)(this); - }, - - respondToReadyState: function(readystate) { - var event = Ajax.Request.Events[readystate]; - - if (event == 'Complete') { - try { - if(!this.finished) { - this.finished = true; - if(this._options.timeout) { clearTimeout(this.transportTimer); } - (this._options.onComplete || Ajax.emptyFunction)(this.transport); - } - } catch (e) { - this.dispatchException(e); - } - - /* Avoid memory leak in MSIE: clean up the oncomplete event handler */ - this.transport.onreadystatechange = Ajax.emptyFunction; - } - }, - - dispatchException: function(exception) { - (this._options.onException || Ajax.emptyFunction)(this, exception); - } -}); - -var EventHelper = { - register : function(obj, ev,func){ - var oldev = obj[ev]; - - if (typeof oldev != 'function') { - obj[ev] = func; - } else { - obj[ev] = function() { - oldev(); - func(); - } - } - } -}; - -/* - Behaviour v1.1 by Ben Nolan, June 2005. Based largely on the work - of Simon Willison (see comments by Simon below). - http://ripcord.co.nz/behaviour/ -*/ - -var Behaviour = { - list : new Array, - - register : function(sheet){ - Behaviour.list.push(sheet); - }, - - init : function(){ - EventHelper.register(window, 'onload', function(){ - Behaviour.apply(); - }); - }, - - apply : function(){ - for (h=0;sheet=Behaviour.list[h];h++){ - for (selector in sheet) { - list = document.getElementsBySelector(selector); - if (!list) - continue; - for( i = 0; element = list[i]; i++ ) { - sheet[selector]( element ); - } - } - } - } -}; - -Behaviour.init(); - -function getAllChildren(e) { - // Returns all children of element. Workaround required for IE5/Windows. Ugh. - return e.all ? e.all : e.getElementsByTagName('*'); -} - -document.getElementsBySelector = function(selector) { - // Attempt to fail gracefully in lesser browsers - if (!document.getElementsByTagName) { - return new Array(); - } - // Split selector in to tokens - var tokens = selector.split(' '); - var currentContext = new Array(document); - for (var i = 0; i < tokens.length; i++) { - token = tokens[i].replace(/^\s+/,'').replace(/\s+$/,'');; - if (token.indexOf('#') > -1) { - // Token is an ID selector - var bits = token.split('#'); - var tag_name = bits[0]; - var id = bits[1]; - var element = document.getElementById(id); - if (element == null || tag_name && element.nodeName.toLowerCase() != tag_name ) { - // tag with that ID not found, return false - return new Array(); - } - // Set currentContext to contain just this element - currentContext = new Array(element); - continue; // Skip to next token - } - if (token.indexOf('.') > -1) { - // Token contains a class selector - var bits = token.split('.'); - var tag_name = bits[0]; - var class_name = bits[1]; - if (!tag_name) { - tag_name = '*'; - } - // Get elements matching tag, filter them for class selector - var found = new Array; - var foundCount = 0; - for (var h = 0; h < currentContext.length; h++) { - var elements; - if (tag_name == '*') { - elements = getAllChildren(currentContext[h]); - } else { - elements = currentContext[h].getElementsByTagName(tag_name); - } - if( elements == null ) - continue; - for (var j = 0; j < elements.length; j++) { - found[foundCount++] = elements[j]; - } - } - currentContext = new Array; - var currentContextIndex = 0; - for (var k = 0; k < found.length; k++) { - if (found[k].className && found[k].className.match(new RegExp("\\b"+class_name+"\\b"))) { - currentContext[currentContextIndex++] = found[k]; - } - } - continue; // Skip to next token - } - - // [evgeny] code for attribute selection is removed... - - if (!currentContext[0]){ - return; - } - - // If we get here, token is JUST an element (not a class or ID selector) - tag_name = token; - var found = new Array; - var foundCount = 0; - for (var h = 0; h < currentContext.length; h++) { - var elements = currentContext[h].getElementsByTagName(tag_name); - for (var j = 0; j < elements.length; j++) { - found[foundCount++] = elements[j]; - } - } - currentContext = found; - } - return currentContext; -}; - -var NodeUtils = { - - getNodeValue: function(parent,name) { - var nodes = parent.getElementsByTagName( name ); - if( nodes.length == 0 ) - return ""; - nodes = nodes[0].childNodes; - var reslt = ""; - for( i = 0; i < nodes.length; i++ ) - reslt += nodes[i].nodeValue; - return reslt; - }, - - getNodeText: function(_node) { - var _nodes = _node.childNodes; - var _text = ""; - for( i = 0; i < _nodes.length; i++ ) - _text += _nodes[i].nodeValue; - return _text; - }, - - getAttrValue: function(parent,name) { - for( k=0; k < parent.attributes.length; k++ ) - if( parent.attributes[k].nodeName == name ) - return parent.attributes[k].nodeValue; - return null; - } -}; - -var CommonUtils = { - getRow: function(_id,_table) { - var _row = _table.rows[_id]; - if( _row != null ) - return _row; - if( _table.rows['head'] != null ) - return null; - - for( k=0; k < _table.rows.length; k++ ) { - if( _table.rows[k].id == _id ) - return _table.rows[k]; - } - return null; - }, - - getCell: function(_id,_row,_table) { - var _cell = _row.cells[_id]; - if( _cell != null ) - return _cell; - if( _table.rows['head'] != null ) - return null; - for( k=0; k < _row.cells.length; k++ ) { - if( _row.cells[k].id == _id ) - return _row.cells[k]; - } - return null; - }, - - insertCell: function(_row,_id,_className,_align,_height, _inner) { - var cell = _row.insertCell(-1); - cell.id = _id; - if(_align) - cell.align = _align; - cell.className = _className; - if(_height) - cell.height = _height; - cell.innerHTML = _inner; - } -}; - -function playSound(wav_file) { - var player = document.createElement("div"); - var agt = navigator.userAgent.toLowerCase(); - if(agt.indexOf('opera') != -1) { - player.style = "position: absolute; left: 0px; top: -200px;"; - } - document.body.appendChild(player); - player.innerHTML = ''; -} - -function htmlescape(str) { - return str.replace('&','&').replace('<','<').replace('>','>').replace('"','"'); -} \ No newline at end of file diff --git a/src/messenger/webim/js/source/soundcheck.js b/src/messenger/webim/js/source/soundcheck.js deleted file mode 100644 index 34c41582..00000000 --- a/src/messenger/webim/js/source/soundcheck.js +++ /dev/null @@ -1,12 +0,0 @@ -Behaviour.register({ - 'a#check-nv' : function(el) { - el.onclick = function() { - playSound(wroot + '/sounds/new_user.wav'); - }; - }, - 'a#check-nm' : function(el) { - el.onclick = function() { - playSound(wroot + '/sounds/new_message.wav') - }; - } -}); diff --git a/src/messenger/webim/js/source/users.js b/src/messenger/webim/js/source/users.js deleted file mode 100644 index a729058a..00000000 --- a/src/messenger/webim/js/source/users.js +++ /dev/null @@ -1,384 +0,0 @@ -/** - * @preserve This file is part of Mibew Messenger project. - * http://mibew.org - * - * Copyright (c) 2005-2013 Mibew Messenger Community - * License: http://mibew.org/license.php - */ - -Ajax.PeriodicalUpdater = Class.create(); -Class.inherit( Ajax.PeriodicalUpdater, Ajax.Base, { - - initialize: function(_options) { - this.setOptions(_options); - this._options.onComplete = this.requestComplete.bind(this); - this._options.onException = this.handleException.bind(this); - this._options.onTimeout = this.handleTimeout.bind(this); - this._options.timeout = 5000; - this.frequency = (this._options.frequency || 2); - this.updater = {}; - this.update(); - }, - - handleException: function(_request, ex) { - if( this._options.handleError ) - this._options.handleError("offline, reconnecting"); - this.stopUpdate(); - this.timer = setTimeout(this.update.bind(this), 1000); - }, - - handleTimeout: function(_request) { - if( this._options.handleError ) - this._options.handleError("timeout, reconnecting"); - this.stopUpdate(); - this.timer = setTimeout(this.update.bind(this), 1000); - }, - - stopUpdate: function() { - if( this.updater._options ) - this.updater._options.onComplete = undefined; - clearTimeout(this.timer); - }, - - update: function() { - if( this._options.updateParams ) - this._options.parameters = (this._options.updateParams)(); - this.updater = new Ajax.Request(this._options.url, this._options); - }, - - requestComplete: function(presponse) { - try { - var xmlRoot = Ajax.getXml(presponse); - if( xmlRoot ) { - (this._options.updateContent || Ajax.emptyFunction)( xmlRoot ); - } else { - if( this._options.handleError ) - this._options.handleError("reconnecting"); - } - } catch(e) { - } - this.timer = setTimeout(this.update.bind(this), this.frequency * 1000); - } -}); - -var HtmlGenerationUtils = { - - popupLink: function(link, title, wndid, inner, width, height,linkclass) { - return ''+ - inner+''; - }, - - generateOneRowTable: function(content) { - return '' + content + '
'; - }, - - viewOpenCell: function(username,servlet,id,canview,canopen,ban,message,cantakenow) { - var cellsCount = 2; - var link = servlet+"?thread="+id; - var gen = ''; - if(canopen || canview ) { - gen += HtmlGenerationUtils.popupLink( (cantakenow||!canview) ? link : link+"&viewonly=true", localized[canopen ? 0 : 1], "ImCenter"+id, username, 640, 480, null); - } else { - gen += '' + username + ''; - } - gen += ''; - if( canopen ) { - gen += ''; - gen += HtmlGenerationUtils.popupLink( link, localized[0], "ImCenter"+id, ''+localized[0]+'', 640, 480, null); - gen += ''; - cellsCount++; - } - if( canview ) { - gen += ''; - gen += HtmlGenerationUtils.popupLink( link+"&viewonly=true", localized[1], "ImCenter"+id, ''+localized[1]+'', 640, 480, null); - gen += ''; - cellsCount++; - } - if( message != "" ) { - gen += ''; - gen += message.length > 30 ? message.substring(0,30) + '...' : message; - gen += ''; - } - return HtmlGenerationUtils.generateOneRowTable(gen); - }, - banCell: function(id,banid){ - return ''+ - HtmlGenerationUtils.popupLink( mibewRoot+'/operator/ban.php?'+(banid ? 'id='+banid : 'thread='+id), localized[2], "ban"+id, ''+localized[2]+'', 720, 480, null)+ - ''; - } -}; - -Ajax.ThreadListUpdater = Class.create(); -Class.inherit( Ajax.ThreadListUpdater, Ajax.Base, { - - initialize: function(_options) { - this.setOptions(_options); - this._options.updateParams = this.updateParams.bind(this); - this._options.handleError = this.handleError.bind(this); - this._options.updateContent = this.updateContent.bind(this); - this._options.lastrevision = 0; - this.threadTimers = new Object(); - this.delta = 0; - this.t = this._options.table; - this.periodicalUpdater = new Ajax.PeriodicalUpdater(this._options); - }, - - updateParams: function() { - return "since=" + this._options.lastrevision + "&status=" + this._options.istatus + (this._options.showonline ? "&showonline=1" : ""); - }, - - setStatus: function(msg) { - this._options.status.innerHTML = msg; - }, - - handleError: function(s) { - this.setStatus( s ); - }, - - updateThread: function(node) { - var id, stateid, vstate, canview = false, canopen = false, canban = false, ban = null, banid = null; - - for( var i = 0; i < node.attributes.length; i++ ) { - var attr = node.attributes[i]; - if( attr.nodeName == "id" ) - id = attr.nodeValue; - else if( attr.nodeName == "stateid" ) - stateid = attr.nodeValue; - else if( attr.nodeName == "state" ) - vstate = attr.nodeValue; - else if( attr.nodeName == "canopen" ) - canopen = true; - else if( attr.nodeName == "canview" ) - canview = true; - else if( attr.nodeName == "canban" ) - canban = true; - else if( attr.nodeName == "ban" ) - ban = attr.nodeValue; - else if( attr.nodeName == "banid" ) - banid = attr.nodeValue; - } - - function setcell(_table, row,id,pcontent) { - var cell = CommonUtils.getCell( id, row, _table ); - if( cell ) - cell.innerHTML = pcontent; - } - - var row = CommonUtils.getRow("thr"+id, this.t); - if( stateid == "closed" ) { - if( row ) { - this.t.deleteRow(row.rowIndex); - } - this.threadTimers[id] = null; - return; - } - - var vname = NodeUtils.getNodeValue(node,"name"); - var vaddr = NodeUtils.getNodeValue(node,"addr"); - var vtime = NodeUtils.getNodeValue(node,"time"); - var agent = NodeUtils.getNodeValue(node,"agent"); - var modified = NodeUtils.getNodeValue(node,"modified"); - var message = NodeUtils.getNodeValue(node,"message"); - var etc = ''+NodeUtils.getNodeValue(node,"useragent")+''; - - if(ban != null) { - etc = ''+NodeUtils.getNodeValue(node,"reason")+''; - } - - if(canban) { - etc += HtmlGenerationUtils.banCell(id,banid); - } - etc = HtmlGenerationUtils.generateOneRowTable(etc); - - var startRow = CommonUtils.getRow("t"+stateid, this.t); - var endRow = CommonUtils.getRow("t"+stateid+"end", this.t); - - if( row != null && (row.rowIndex <= startRow.rowIndex || row.rowIndex >= endRow.rowIndex ) ) { - this.t.deleteRow(row.rowIndex); - this.threadTimers[id] = null; - row = null; - } - if( row == null ) { - row = this.t.insertRow(startRow.rowIndex+1); - row.className = (ban == "blocked" && stateid != "chat") ? "ban" : "in"+stateid; - row.id = "thr"+id; - this.threadTimers[id] = new Array(vtime,modified,stateid); - CommonUtils.insertCell(row, "name", "visitor", null, null, HtmlGenerationUtils.viewOpenCell(vname,this._options.agentservl,id,canview,canopen,ban,message,stateid!='chat')); - CommonUtils.insertCell(row, "contid", "visitor", "center", null, vaddr ); - CommonUtils.insertCell(row, "state", "visitor", "center", null, vstate ); - CommonUtils.insertCell(row, "op", "visitor", "center", null, agent ); - CommonUtils.insertCell(row, "time", "visitor", "center", null, this.getTimeSince(vtime) ); - CommonUtils.insertCell(row, "wait", "visitor", "center", null, (stateid!='chat' ? this.getTimeSince(modified) : '-') ); - CommonUtils.insertCell(row, "etc", "visitor", "center", null, etc ); - - if( stateid == 'wait' || stateid == 'prio' ) - return true; - } else { - this.threadTimers[id] = new Array(vtime,modified,stateid); - row.className = (ban == "blocked" && stateid != "chat") ? "ban" : "in"+stateid; - setcell(this.t, row,"name",HtmlGenerationUtils.viewOpenCell(vname,this._options.agentservl,id,canview,canopen,ban,message,stateid!='chat')); - setcell(this.t, row,"contid",vaddr); - setcell(this.t, row,"state",vstate); - setcell(this.t, row,"op",agent); - setcell(this.t, row,"time",this.getTimeSince(vtime)); - setcell(this.t, row,"wait",(stateid!='chat' ? this.getTimeSince(modified) : '-')); - setcell(this.t, row,"etc",etc); - } - return false; - }, - - updateQueueMessages: function() { - function queueNotEmpty(t,id) { - var startRow = $(id); - var endRow = $(id+"end"); - if( startRow == null || endRow == null ) { - return false; - } - return startRow.rowIndex+1 < endRow.rowIndex; - } - var _status = $("statustd"); - if( _status) { - var notempty = queueNotEmpty(this.t, "twait") || queueNotEmpty(this.t, "tprio") || queueNotEmpty(this.t, "tchat"); - _status.innerHTML = notempty ? "" : this._options.noclients; - _status.height = notempty ? 5 : 30; - } - }, - - getTimeSince: function(srvtime) { - var secs = Math.floor(((new Date()).getTime()-srvtime-this.delta)/1000); - var minutes = Math.floor(secs/60); - var prefix = ""; - secs = secs % 60; - if( secs < 10 ) - secs = "0" + secs; - if( minutes >= 60 ) { - var hours = Math.floor(minutes/60); - minutes = minutes % 60; - if( minutes < 10 ) - minutes = "0" + minutes; - prefix = hours + ":"; - } - - return prefix + minutes+":"+secs; - }, - - updateTimers: function() { - for (var i in this.threadTimers) { - if (this.threadTimers[i] != null) { - var value = this.threadTimers[i]; - var row = CommonUtils.getRow("thr"+i, this.t); - if( row != null ) { - function setcell(_table, row,id,pcontent) { - var cell = CommonUtils.getCell( id, row, _table ); - if( cell ) - cell.innerHTML = pcontent; - } - setcell(this.t, row,"time",this.getTimeSince(value[0])); - setcell(this.t, row,"wait",(value[2]!='chat' ? this.getTimeSince(value[1]) : '-')); - } - } - } - }, - - updateThreads: function(root) { - var newAdded = false; - var _time = NodeUtils.getAttrValue(root, "time"); - var _revision = NodeUtils.getAttrValue(root, "revision" ); - - if( _time ) - this.delta = (new Date()).getTime() - _time; - if( _revision ) - this._options.lastrevision = _revision; - - for( var i = 0; i < root.childNodes.length; i++ ) { - var node = root.childNodes[i]; - if( node.tagName == 'thread' ) - if( this.updateThread(node) ) - newAdded = true; - } - this.updateQueueMessages(); - this.updateTimers(); - this.setStatus(this._options.istatus ? "Away" : "Up to date"); - if( newAdded ) { - playSound(mibewRoot+'/sounds/new_user.wav'); - window.focus(); - if(updaterOptions.showpopup) { - alert(localized[5]); - } - } - }, - - updateOperators: function(root) { - var div = $('onlineoperators'); - if (!div) - return; - - var names = []; - - for( var i = 0; i < root.childNodes.length; i++ ) { - var node = root.childNodes[i]; - if(node.tagName != 'operator') - continue; - - var name = NodeUtils.getAttrValue(node, 'name'); - var isAway = NodeUtils.getAttrValue(node, 'away') != null; - - names[names.length] = - ''+localized[1]+' '+ name; - } - - div.innerHTML = names.join(', '); - }, - - updateContent: function(root) { - if( root.tagName == 'update' ) { - for( var i = 0; i < root.childNodes.length; i++ ) { - var node = root.childNodes[i]; - - if (node.tagName == 'threads') { - this.updateThreads(node); - } else if (node.tagName == 'operators') { - this.updateOperators(node); - } - } - } else if( root.tagName == 'error' ) { - this.setStatus(NodeUtils.getNodeValue(root,"descr") ); - } else { - this.setStatus( "reconnecting" ); - } - } -}); - -function togglemenu() { -if($("sidebar") && $("wcontent") && $("togglemenu")) { - if($("wcontent").className == "contentnomenu") { - $("sidebar").style.display = "block"; - $("wcontent").className = "contentinner"; - $("togglemenu").innerHTML = localized[4]; - } else { - $("sidebar").style.display = "none"; - $("wcontent").className = "contentnomenu"; - $("togglemenu").innerHTML = localized[3]; - } -} -} - -var mibewRoot = ""; - -Behaviour.register({ - '#togglemenu' : function(el) { - el.onclick = function() { - togglemenu(); - }; - } -}); - -EventHelper.register(window, 'onload', function(){ - mibewRoot = updaterOptions.wroot; - new Ajax.ThreadListUpdater(({table:$("threadlist"),status:$("connstatus"),istatus:0}).extend(updaterOptions || {})); - if(!updaterOptions.havemenu) { - togglemenu(); - } -}); diff --git a/src/messenger/webim/leavemessage.php b/src/messenger/webim/leavemessage.php deleted file mode 100644 index 67dd8172..00000000 --- a/src/messenger/webim/leavemessage.php +++ /dev/null @@ -1,122 +0,0 @@ - 0 ) { - setup_leavemessage($visitor_name,$email,$message,$groupid,$groupname,$info,$referrer,can_show_captcha()); - setup_logo(); - expand("styles", getchatstyle(), "leavemessage.tpl"); - exit; -} - -$message_locale = $settings['left_messages_locale']; -if(!locale_exists($message_locale)) { - $message_locale = $home_locale; -} - -store_message($visitor_name, $email, $info, $message, $groupid, $referrer); - -$subject = getstring2_("leavemail.subject", array($visitor_name), $message_locale,true); -$body = getstring2_("leavemail.body", array($visitor_name,$email,$message,$info ? "$info\n" : ""), $message_locale,true); - -if (isset($group) && !empty($group['vcemail'])) { - $inbox_mail = $group['vcemail']; -} else { - $inbox_mail = $settings['email']; -} - -if($inbox_mail) { - $link = connect(); - mibew_mail($inbox_mail, $email, $subject, $body, $link); - mysql_close($link); -} - -setup_logo(); -expand("styles", getchatstyle(), "leavemessagesent.tpl"); -?> \ No newline at end of file diff --git a/src/messenger/webim/libs/.htaccess b/src/messenger/webim/libs/.htaccess deleted file mode 100644 index 14249c50..00000000 --- a/src/messenger/webim/libs/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all \ No newline at end of file diff --git a/src/messenger/webim/libs/captcha.php b/src/messenger/webim/libs/captcha.php deleted file mode 100644 index 9fbffc12..00000000 --- a/src/messenger/webim/libs/captcha.php +++ /dev/null @@ -1,75 +0,0 @@ - \ No newline at end of file diff --git a/src/messenger/webim/libs/chat.php b/src/messenger/webim/libs/chat.php deleted file mode 100644 index e086c448..00000000 --- a/src/messenger/webim/libs/chat.php +++ /dev/null @@ -1,793 +0,0 @@ - "user", $kind_agent => "agent", $kind_for_agent => "hidden", - $kind_info => "inf", $kind_conn => "conn", $kind_events => "event", $kind_avatar => "avatar"); - -function next_token() -{ - if (function_exists('openssl_random_pseudo_bytes')) { - $token_arr = unpack('N', "\x0" . openssl_random_pseudo_bytes(3)); - $token = $token_arr[1]; - } - else { - $token = mt_rand(99999, 99999999); - } - return $token; -} - -function next_revision($link) -{ - global $mysqlprefix; - perform_query("update ${mysqlprefix}chatrevision set id=LAST_INSERT_ID(id+1)", $link); - $val = mysql_insert_id($link); - return $val; -} - -function post_message_($threadid, $kind, $message, $link, $from = null, $utime = null, $opid = null) -{ - global $mysqlprefix; - $query = sprintf( - "insert into ${mysqlprefix}chatmessage (threadid,ikind,tmessage,tname,agentId,dtmcreated) values (%s,%s,'%s',%s,%s,%s)", - intval($threadid), - intval($kind), - mysql_real_escape_string($message, $link), - $from ? "'" . mysql_real_escape_string($from, $link) . "'" : "null", - $opid ? intval($opid) : "0", - $utime ? "FROM_UNIXTIME(" . intval($utime) . ")" : "CURRENT_TIMESTAMP"); - - perform_query($query, $link); - return mysql_insert_id($link); -} - -function post_message($threadid, $kind, $message, $from = null, $agentid = null) -{ - $link = connect(); - $id = post_message_($threadid, $kind, $message, $link, $from, null, $agentid); - mysql_close($link); - return $id; -} - -function prepare_html_message($text) -{ - $escaped_text = safe_htmlspecialchars($text); - $text_w_links = preg_replace('/(https?|ftp):\/\/\S*/i', '$0', $escaped_text); - $multiline = str_replace("\n", "
", $text_w_links); - return $multiline; -} - -function message_to_html($msg) -{ - global $kind_to_string, $kind_avatar; - if ($msg['ikind'] == $kind_avatar) return ""; - $message = "" . date("H:i:s", $msg['created']) . " "; - $kind = $kind_to_string{$msg['ikind']}; - if ($msg['tname']) - $message .= "" . safe_htmlspecialchars($msg['tname']) . ": "; - $message .= "" . prepare_html_message($msg['tmessage']) . "
"; - return $message; -} - -function message_to_text($msg) -{ - global $kind_user, $kind_agent, $kind_info, $kind_avatar; - if ($msg['ikind'] == $kind_avatar) return ""; - $message_time = date("H:i:s ", $msg['created']); - if ($msg['ikind'] == $kind_user || $msg['ikind'] == $kind_agent) { - if ($msg['tname']) - return $message_time . $msg['tname'] . ": " . $msg['tmessage'] . "\n"; - else - return $message_time . $msg['tmessage'] . "\n"; - } else if ($msg['ikind'] == $kind_info) { - return $message_time . $msg['tmessage'] . "\n"; - } else { - return $message_time . "[" . $msg['tmessage'] . "]\n"; - } -} - -function get_messages($threadid, $meth, $isuser, &$lastid) -{ - global $kind_for_agent, $kind_avatar, $mibew_encoding, $mysqlprefix; - $link = connect(); - - $query = sprintf( - "select messageid,ikind,unix_timestamp(dtmcreated) as created,tname,tmessage from ${mysqlprefix}chatmessage " . - "where threadid = %s and messageid > %s %s order by messageid", - intval($threadid), intval($lastid), $isuser ? "and ikind <> " . intval($kind_for_agent) : ""); - - $messages = array(); - $msgs = select_multi_assoc($query, $link); - foreach ($msgs as $msg) { - $message = ""; - if ($meth == 'xml') { - switch ($msg['ikind']) { - case $kind_avatar: - $message = "" . myiconv($mibew_encoding, "utf-8", escape_with_cdata($msg['tmessage'])) . ""; - break; - default: - $message = "" . myiconv($mibew_encoding, "utf-8", escape_with_cdata(message_to_html($msg))) . "\n"; - } - } else { - if ($msg['ikind'] != $kind_avatar) { - $message = (($meth == 'text') ? message_to_text($msg) : topage(message_to_html($msg))); - } - } - - $messages[] = $message; - if ($msg['messageid'] > $lastid) { - $lastid = $msg['messageid']; - } - } - - mysql_close($link); - return $messages; -} - -function print_thread_messages($thread, $token, $lastid, $isuser, $format, $agentid = null) -{ - global $mibew_encoding, $mibewroot, $connection_timeout, $settings; - $threadid = $thread['threadid']; - $istyping = abs($thread['current'] - $thread[$isuser ? "lpagent" : "lpuser"]) < $connection_timeout - && $thread[$isuser ? "agentTyping" : "userTyping"] == "1" ? "1" : "0"; - - if ($format == "xml") { - $output = get_messages($threadid, "xml", $isuser, $lastid); - - start_xml_output(); - print(""); - foreach ($output as $msg) { - print $msg; - } - print(""); - } else if ($format == "html") { - loadsettings(); - $output = get_messages($threadid, "html", $isuser, $lastid); - - start_html_output(); - $url = "$mibewroot/thread.php?act=refresh&thread=" . safe_htmlspecialchars($threadid) . "&token=" . safe_htmlspecialchars($token) . "&html=on&user=" . ($isuser ? "true" : "false"); - - print( - "" . - "\n\n" . - "\n" . - "\n" . - "\n" . - "chat\n" . - "\n" . - "" . - "
"); - - foreach ($output as $msg) { - print $msg; - } - - print( - "
" . - ""); - } -} - -function get_user_name($username, $addr, $id) -{ - global $settings; - loadsettings(); - return str_replace("{addr}", $addr, - str_replace("{id}", $id, - str_replace("{name}", $username, $settings['usernamepattern']))); -} - -function is_ajax_browser($browserid, $ver, $useragent) -{ - if ($browserid == "opera") - return $ver >= 8.02; - if ($browserid == "safari") - return $ver >= 125; - if ($browserid == "msie") - return $ver >= 5.5 && !strstr($useragent, "powerpc"); - if ($browserid == "netscape") - return $ver >= 7.1; - if ($browserid == "mozilla") - return $ver >= 1.4; - if ($browserid == "firefox") - return $ver >= 1.0; - if ($browserid == "chrome") - return true; - - return false; -} - -function is_old_browser($browserid, $ver) -{ - if ($browserid == "opera") - return $ver < 7.0; - if ($browserid == "msie") - return $ver < 5.0; - return false; -} - -$knownAgents = array("opera", "msie", "chrome", "safari", "firefox", "netscape", "mozilla"); - -function get_remote_level($useragent) -{ - global $knownAgents; - $useragent = strtolower($useragent); - foreach ($knownAgents as $agent) { - if (strstr($useragent, $agent)) { - if (preg_match("/" . $agent . "[\\s\/]?(\\d+(\\.\\d+)?)/", $useragent, $matches)) { - $ver = $matches[1]; - - if (is_ajax_browser($agent, $ver, $useragent)) - return "ajaxed"; - else if (is_old_browser($agent, $ver)) - return "old"; - - return "simple"; - } - } - } - return "simple"; -} - -function is_agent_opera95() -{ - $useragent = strtolower($_SERVER['HTTP_USER_AGENT']); - if (strstr($useragent, "opera")) { - if (preg_match("/opera[\\s\/]?(\\d+(\\.\\d+)?)/", $useragent, $matches)) { - $ver = $matches[1]; - - if ($ver >= "9.5") - return true; - } - } - return false; -} - -function is_mac_opera() -{ - $useragent = strtolower($_SERVER['HTTP_USER_AGENT']); - return strstr($useragent, "opera") && strstr($useragent, "mac"); -} - -function needsFramesrc() -{ - $useragent = strtolower($_SERVER['HTTP_USER_AGENT']); - return strstr($useragent, "safari/"); -} - -function setup_logo() -{ - global $page, $settings; - loadsettings(); - $page['ct.company.name'] = safe_htmlspecialchars(topage($settings['title'])); - $page['ct.company.chatLogoURL'] = safe_htmlspecialchars(topage($settings['logo'])); - $page['mibewHost'] = safe_htmlspecialchars(topage($settings['hosturl'])); -} - -function setup_leavemessage($name, $email, $message, $groupid, $groupname, $info, $referrer, $canshowcaptcha) -{ - global $settings, $page; - $page['formname'] = topage($name); - $page['formemail'] = topage($email); - $page['formmessage'] = $message ? topage($message) : ""; - $page['showcaptcha'] = $settings["enablecaptcha"] == "1" && $canshowcaptcha ? "1" : ""; - $page['formgroupid'] = $groupid; - $page['formgroupname'] = $groupname; - $page['forminfo'] = topage($info); - $page['referrer'] = urlencode(topage($referrer)); -} - -function setup_survey($name, $email, $groupid, $info, $referrer, $canshowcaptcha) -{ - global $settings, $page; - - $page['formname'] = topage($name); - $page['formemail'] = topage($email); - $page['formgroupid'] = $groupid; - $page['forminfo'] = topage($info); - $page['referrer'] = urlencode(topage($referrer)); - $page['showcaptcha'] = ($settings["surveyaskcaptcha"] == "1" && $canshowcaptcha) ? "1" : ""; - - if ($settings['enablegroups'] == '1' && $settings["surveyaskgroup"] == "1") { - $link = connect(); - $allgroups = get_groups($link, false); - mysql_close($link); - $val = ""; - foreach ($allgroups as $k) { - $groupname = $k['vclocalname']; - if ($k['inumofagents'] == 0) { - continue; - } - if ($k['ilastseen'] !== NULL && $k['ilastseen'] < $settings['online_timeout']) { - if (!$groupid) { - $groupid = $k['groupid']; // select first online group - } - } else { - $groupname .= " (offline)"; - } - $isselected = $k['groupid'] == $groupid; - $val .= ""; - } - $page['groups'] = $val; - } - - $page['showemail'] = $settings["surveyaskmail"] == "1" ? "1" : ""; - $page['showmessage'] = $settings["surveyaskmessage"] == "1" ? "1" : ""; - $page['showname'] = $settings['usercanchangename'] == "1" ? "1" : ""; -} - -function setup_chatview_for_user($thread, $level) -{ - global $page, $mibewroot, $settings; - loadsettings(); - $page = array(); - $page['agent'] = false; - $page['user'] = true; - $page['canpost'] = true; - $nameisset = getstring("chat.default.username") != $thread['userName']; - $page['displ1'] = $nameisset ? "none" : "inline"; - $page['displ2'] = $nameisset ? "inline" : "none"; - $page['level'] = $level; - $page['ct.chatThreadId'] = safe_htmlspecialchars($thread['threadid']); - $page['ct.token'] = safe_htmlspecialchars($thread['ltoken']); - $page['ct.user.name'] = safe_htmlspecialchars(topage($thread['userName'])); - $page['canChangeName'] = $settings['usercanchangename'] == "1"; - $page['chat.title'] = safe_htmlspecialchars(topage($settings['chattitle'])); - - setup_logo(); - if ($settings['sendmessagekey'] == 'enter') { - $page['send_shortcut'] = "Enter"; - $page['ignorectrl'] = 1; - } else { - $page['send_shortcut'] = is_mac_opera() ? "⌘-Enter" : "Ctrl-Enter"; - $page['ignorectrl'] = 0; - } - - $params = "thread=" . $thread['threadid'] . "&token=" . $thread['ltoken']; - $page['mailLink'] = safe_htmlspecialchars("$mibewroot/client.php?" . $params . "&level=$level&act=mailthread"); - - if ($settings['enablessl'] == "1" && !is_secure_request()) { - $page['sslLink'] = safe_htmlspecialchars(get_app_location(true, true) . "/client.php?" . $params . "&level=$level"); - } - - $page['isOpera95'] = is_agent_opera95(); - $page['neediframesrc'] = needsFramesrc(); - - $page['frequency'] = $settings['updatefrequency_chat']; -} - -function load_canned_messages($locale, $groupid) -{ - global $mysqlprefix; - $link = connect(); - $result = select_multi_assoc( - "select vcvalue from ${mysqlprefix}chatresponses where locale = '" . mysql_real_escape_string($locale, $link) . "' " . - "AND (groupid is NULL OR groupid = 0) order by vcvalue", $link); - if (count($result) == 0) { - foreach (explode("\n", getstring_('chat.predefined_answers', $locale)) as $answer) { - $result[] = array('vcvalue' => $answer); - } - } - if ($groupid) { - $result2 = select_multi_assoc( - "select vcvalue from ${mysqlprefix}chatresponses where locale = '" . mysql_real_escape_string($locale, $link) . "' " . - "AND groupid = " . intval($groupid) . " order by vcvalue", $link); - foreach ($result as $r) { - $result2[] = $r; - } - $result = $result2; - } - mysql_close($link); - return $result; -} - -function setup_chatview_for_operator($thread, $operator) -{ - global $page, $mibewroot, $company_logo_link, $company_name, $settings; - loadsettings(); - $page = array(); - $page['agent'] = true; - $page['user'] = false; - $page['canpost'] = $thread['agentId'] == $operator['operatorid']; - $page['ct.chatThreadId'] = safe_htmlspecialchars($thread['threadid']); - $page['ct.token'] = safe_htmlspecialchars($thread['ltoken']); - $page['ct.user.name'] = safe_htmlspecialchars(topage(get_user_name($thread['userName'], $thread['remote'], $thread['userid']))); - $page['chat.title'] = safe_htmlspecialchars(topage($settings['chattitle'])); - - setup_logo(); - if ($settings['sendmessagekey'] == 'enter') { - $page['send_shortcut'] = "Enter"; - $page['ignorectrl'] = 1; - } else { - $page['send_shortcut'] = is_mac_opera() ? "⌘-Enter" : "Ctrl-Enter"; - $page['ignorectrl'] = 0; - } - - if ($settings['enablessl'] == "1" && !is_secure_request()) { - $page['sslLink'] = safe_htmlspecialchars(get_app_location(true, true) . "/operator/agent.php?thread=" . $thread['threadid'] . "&token=" . $thread['ltoken']); - } - $page['isOpera95'] = is_agent_opera95(); - $page['neediframesrc'] = needsFramesrc(); - $page['historyParams'] = array("userid" => "" . $thread['userid']); - $page['historyParamsLink'] = safe_htmlspecialchars(add_params($mibewroot . "/operator/userhistory.php", $page['historyParams'])); - $predefinedres = ""; - $canned_messages = load_canned_messages($thread['locale'], $thread['groupid']); - foreach ($canned_messages as $answer) { - $predefinedres .= ""; - } - $page['predefinedAnswers'] = $predefinedres; - $params = "thread=" . $thread['threadid'] . "&token=" . $thread['ltoken']; - $page['redirectLink'] = safe_htmlspecialchars("$mibewroot/operator/agent.php?" . $params . "&act=redirect"); - - $page['namePostfix'] = ""; - $page['frequency'] = $settings['updatefrequency_chat']; -} - -function update_thread_access($threadid, $params, $link) -{ - global $mysqlprefix; - $clause = ""; - foreach ($params as $k => $v) { - if (strlen($clause) > 0) - $clause .= ", "; - $clause .= "`" . mysql_real_escape_string($k, $link) . "`=" . $v; - } - perform_query( - "update ${mysqlprefix}chatthread set $clause " . - "where threadid = " . intval($threadid), $link); -} - -function ping_thread($thread, $isuser, $istyping) -{ - global $kind_for_agent, $state_queue, $state_loading, $state_chatting, $state_waiting, $kind_conn, $connection_timeout; - $link = connect(); - $params = array(($isuser ? "lastpinguser" : "lastpingagent") => "CURRENT_TIMESTAMP", - ($isuser ? "userTyping" : "agentTyping") => ($istyping ? "1" : "0")); - - $lastping = $thread[$isuser ? "lpagent" : "lpuser"]; - $current = $thread['current']; - - if ($thread['istate'] == $state_loading && $isuser) { - $params['istate'] = intval($state_queue); - commit_thread($thread['threadid'], $params, $link); - mysql_close($link); - return; - } - - if ($lastping > 0 && abs($current - $lastping) > $connection_timeout) { - $params[$isuser ? "lastpingagent" : "lastpinguser"] = "0"; - if (!$isuser) { - $message_to_post = getstring_("chat.status.user.dead", $thread['locale']); - post_message_($thread['threadid'], $kind_for_agent, $message_to_post, $link, null, $lastping + $connection_timeout); - } else if ($thread['istate'] == $state_chatting) { - - $message_to_post = getstring_("chat.status.operator.dead", $thread['locale']); - post_message_($thread['threadid'], $kind_conn, $message_to_post, $link, null, $lastping + $connection_timeout); - $params['istate'] = intval($state_waiting); - $params['nextagent'] = 0; - commit_thread($thread['threadid'], $params, $link); - mysql_close($link); - return; - } - } - - update_thread_access($thread['threadid'], $params, $link); - mysql_close($link); -} - -function commit_thread($threadid, $params, $link) -{ - global $mysqlprefix; - $query = "update ${mysqlprefix}chatthread t set lrevision = " . intval(next_revision($link)) . ", dtmmodified = CURRENT_TIMESTAMP"; - foreach ($params as $k => $v) { - $query .= ", `" . mysql_real_escape_string($k, $link) . "`=" . $v; - } - $query .= " where threadid = " . intval($threadid); - - perform_query($query, $link); -} - -function rename_user($thread, $newname) -{ - global $kind_events; - - $link = connect(); - commit_thread($thread['threadid'], array('userName' => "'" . mysql_real_escape_string($newname, $link) . "'"), $link); - - if ($thread['userName'] != $newname) { - post_message_($thread['threadid'], $kind_events, - getstring2_("chat.status.user.changedname", array($thread['userName'], $newname), $thread['locale'], true), $link); - } - mysql_close($link); -} - -function close_thread($thread, $isuser) -{ - global $state_closed, $kind_events, $mysqlprefix; - - $link = connect(); - if ($thread['istate'] != $state_closed) { - commit_thread($thread['threadid'], array( 'istate' => intval($state_closed), - 'messageCount' => "(SELECT COUNT(*) FROM ${mysqlprefix}chatmessage WHERE ${mysqlprefix}chatmessage.threadid = t.threadid AND ikind = 1)" ), $link); - } - - $message = $isuser ? getstring2_("chat.status.user.left", array($thread['userName']), $thread['locale'], true) - : getstring2_("chat.status.operator.left", array($thread['agentName']), $thread['locale'], true); - post_message_($thread['threadid'], $kind_events, $message, $link); - mysql_close($link); -} - -function close_old_threads($link) -{ - global $state_closed, $state_left, $state_chatting, $mysqlprefix, $settings; - if ($settings['thread_lifetime'] == 0) { - return; - } - $next_revision = next_revision($link); - $query = sprintf("update ${mysqlprefix}chatthread set lrevision = %s, dtmmodified = CURRENT_TIMESTAMP, istate = %s " . - "where istate <> %s and istate <> %s and lastpingagent <> 0 and lastpinguser <> 0 and " . - "(ABS(UNIX_TIMESTAMP(CURRENT_TIMESTAMP) - UNIX_TIMESTAMP(lastpinguser)) > %s and " . - "ABS(UNIX_TIMESTAMP(CURRENT_TIMESTAMP) - UNIX_TIMESTAMP(lastpingagent)) > %s)", - intval($next_revision), - intval($state_closed), - intval($state_closed), - intval($state_left), - intval($settings['thread_lifetime']), - intval($settings['thread_lifetime'])); - - perform_query($query, $link); -} - -function thread_by_id_($id, $link) -{ - global $mysqlprefix; - return select_one_row("select threadid,userName,agentName,agentId,lrevision,istate,ltoken,userTyping,agentTyping" . - ",unix_timestamp(dtmmodified) as modified, unix_timestamp(dtmcreated) as created" . - ",remote,referer,locale,unix_timestamp(lastpinguser) as lpuser,unix_timestamp(lastpingagent) as lpagent, unix_timestamp(CURRENT_TIMESTAMP) as current,nextagent,shownmessageid,userid,userAgent,groupid" . - " from ${mysqlprefix}chatthread where threadid = " . intval($id), $link); -} - -function ban_for_addr_($addr, $link) -{ - global $mysqlprefix; - return select_one_row("select banid,comment from ${mysqlprefix}chatban where unix_timestamp(dtmtill) > unix_timestamp(CURRENT_TIMESTAMP) AND address = '" . mysql_real_escape_string($addr, $link) . "'", $link); -} - -function thread_by_id($id) -{ - $link = connect(); - $thread = thread_by_id_($id, $link); - mysql_close($link); - return $thread; -} - -function create_thread($groupid, $username, $remoteHost, $referer, $lang, $userid, $userbrowser, $initialState, $link) -{ - global $mysqlprefix; - $query = sprintf( - "insert into ${mysqlprefix}chatthread (userName,userid,ltoken,remote,referer,lrevision,locale,userAgent,dtmcreated,dtmmodified,istate" . ($groupid ? ",groupid" : "") . ") values " . - "('%s','%s',%s,'%s','%s',%s,'%s','%s',CURRENT_TIMESTAMP,CURRENT_TIMESTAMP,%s" . ($groupid ? "," . intval($groupid) : "") . ")", - mysql_real_escape_string($username, $link), - mysql_real_escape_string($userid, $link), - intval(next_token()), - mysql_real_escape_string($remoteHost, $link), - mysql_real_escape_string($referer, $link), - intval(next_revision($link)), - mysql_real_escape_string($lang, $link), - mysql_real_escape_string($userbrowser, $link), - intval($initialState)); - - perform_query($query, $link); - $id = mysql_insert_id($link); - - $newthread = thread_by_id_($id, $link); - return $newthread; -} - -function do_take_thread($threadid, $operatorId, $operatorName) -{ - global $state_chatting; - $link = connect(); - commit_thread($threadid, - array("istate" => intval($state_chatting), - "nextagent" => 0, - "agentId" => intval($operatorId), - "agentName" => "'" . mysql_real_escape_string($operatorName, $link) . "'"), $link); - mysql_close($link); -} - -function reopen_thread($threadid) -{ - global $state_queue, $state_loading, $state_waiting, $state_chatting, $state_closed, $state_left, $kind_events, $settings; - $link = connect(); - - $thread = thread_by_id_($threadid, $link); - - if (!$thread) - return FALSE; - - if ($settings['thread_lifetime'] != 0 && abs($thread['lpuser'] - time()) > $settings['thread_lifetime'] && abs($thread['lpagent'] - time()) > $settings['thread_lifetime']) { - return FALSE; - } - - if ($thread['istate'] == $state_closed || $thread['istate'] == $state_left) - return FALSE; - - if ($thread['istate'] != $state_chatting && $thread['istate'] != $state_queue && $thread['istate'] != $state_loading) { - commit_thread($threadid, - array("istate" => intval($state_waiting), "nextagent" => 0), $link); - } - - post_message_($thread['threadid'], $kind_events, getstring_("chat.status.user.reopenedthread", $thread['locale'], true), $link); - mysql_close($link); - return $thread; -} - -function take_thread($thread, $operator) -{ - global $state_queue, $state_loading, $state_waiting, $state_chatting, $kind_events, $kind_avatar, $home_locale; - - $state = $thread['istate']; - $threadid = $thread['threadid']; - $message_to_post = ""; - - $operatorName = ($thread['locale'] == $home_locale) ? $operator['vclocalename'] : $operator['vccommonname']; - - if ($state == $state_queue || $state == $state_waiting || $state == $state_loading) { - do_take_thread($threadid, $operator['operatorid'], $operatorName); - - if ($state == $state_waiting) { - if ($operatorName != $thread['agentName']) { - $message_to_post = getstring2_("chat.status.operator.changed", array($operatorName, $thread['agentName']), $thread['locale'], true); - } else { - $message_to_post = getstring2_("chat.status.operator.returned", array($operatorName), $thread['locale'], true); - } - } else { - $message_to_post = getstring2_("chat.status.operator.joined", array($operatorName), $thread['locale'], true); - } - } else if ($state == $state_chatting) { - if ($operator['operatorid'] != $thread['agentId']) { - do_take_thread($threadid, $operator['operatorid'], $operatorName); - $message_to_post = getstring2_("chat.status.operator.changed", array($operatorName, $thread['agentName']), $thread['locale'], true); - } - } else { - die("cannot take thread"); - } - - if ($message_to_post) { - post_message($threadid, $kind_events, $message_to_post); - post_message($threadid, $kind_avatar, $operator['vcavatar'] ? $operator['vcavatar'] : ""); - } -} - -function check_for_reassign($thread, $operator) -{ - global $state_waiting, $home_locale, $kind_events, $kind_avatar; - $operatorName = ($thread['locale'] == $home_locale) ? $operator['vclocalename'] : $operator['vccommonname']; - if ($thread['istate'] == $state_waiting && - ($thread['nextagent'] == $operator['operatorid'] - || $thread['agentId'] == $operator['operatorid'])) { - do_take_thread($thread['threadid'], $operator['operatorid'], $operatorName); - if ($operatorName != $thread['agentName']) { - $message_to_post = getstring2_("chat.status.operator.changed", array($operatorName, $thread['agentName']), $thread['locale'], true); - } else { - $message_to_post = getstring2_("chat.status.operator.returned", array($operatorName), $thread['locale'], true); - } - - post_message($thread['threadid'], $kind_events, $message_to_post); - post_message($thread['threadid'], $kind_avatar, $operator['vcavatar'] ? $operator['vcavatar'] : ""); - } -} - -function notify_operators($thread, $firstmessage, $link) -{ - global $settings, $mysqlprefix; - if ($settings['enablejabber'] == 1) { - $groupid = $thread['groupid']; - $query = "select ${mysqlprefix}chatoperator.operatorid as opid, inotify, vcjabbername, vcemail, (unix_timestamp(CURRENT_TIMESTAMP)-unix_timestamp(dtmlastvisited)) as time from ${mysqlprefix}chatoperator"; - if ($groupid) { - $query .= ", ${mysqlprefix}chatgroupoperator where groupid = " . intval($groupid) . " and ${mysqlprefix}chatoperator.operatorid = ${mysqlprefix}chatgroupoperator.operatorid and istatus = 0"; - } else { - $query .= " where istatus = 0"; - } - $query .= " and inotify = 1"; - $result = select_multi_assoc($query, $link); - $text = getstring2_("notify.new.text", array( - get_app_location(true, $settings['enablessl'] == '1' && $settings['forcessl'] == '1') . "/operator/agent.php?thread=" . $thread['threadid'], - $thread['userName'] - ), $thread['locale'], true); - if ($firstmessage) { - $text .= "\n$firstmessage"; - } - foreach ($result as $op) { - if ($op['time'] < $settings['online_timeout'] && is_valid_email($op['vcjabbername'])) { - mibew_xmpp($op['vcjabbername'], getstring2("notify.new.subject", array($thread['userName']), true), $text, $link); - } - } - } -} - -function check_connections_from_remote($remote, $link) -{ - global $settings, $state_closed, $state_left, $mysqlprefix; - if ($settings['max_connections_from_one_host'] == 0) { - return true; - } - $result = select_one_row( - "select count(*) as opened from ${mysqlprefix}chatthread " . - "where remote = '" . mysql_real_escape_string($remote, $link) . "' AND istate <> " . intval($state_closed) . " AND istate <> " . intval($state_left), $link); - if ($result && isset($result['opened'])) { - return $result['opened'] < $settings['max_connections_from_one_host']; - } - return true; -} - -function visitor_from_request() -{ - global $namecookie, $mibew_encoding, $usercookie; - $defaultName = getstring("chat.default.username"); - $userName = $defaultName; - if (isset($_COOKIE[$namecookie])) { - $data = base64_decode(strtr($_COOKIE[$namecookie], '-_,', '+/=')); - if (strlen($data) > 0) { - $userName = myiconv("utf-8", $mibew_encoding, $data); - } - } - - if ($userName == $defaultName) { - $userName = getgetparam('name', $userName); - } - - if (isset($_COOKIE[$usercookie])) { - $userId = $_COOKIE[$usercookie]; - } else { - $userId = uniqid('', TRUE); - setcookie($usercookie, $userId, time() + 60 * 60 * 24 * 365); - } - return array('id' => $userId, 'name' => $userName); -} - -function get_remote_host() -{ - $extAddr = $_SERVER['REMOTE_ADDR']; - if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && - $_SERVER['HTTP_X_FORWARDED_FOR'] != $_SERVER['REMOTE_ADDR']) { - $extAddr = $_SERVER['REMOTE_ADDR'] . ' (' . $_SERVER['HTTP_X_FORWARDED_FOR'] . ')'; - } - return isset($_SERVER['REMOTE_HOST']) ? $_SERVER['REMOTE_HOST'] : $extAddr; -} - -?> diff --git a/src/messenger/webim/libs/common.php b/src/messenger/webim/libs/common.php deleted file mode 100644 index c73cb383..00000000 --- a/src/messenger/webim/libs/common.php +++ /dev/null @@ -1,856 +0,0 @@ -Wrong parameter used or absent: " . safe_htmlspecialchars($name) . ""; - exit; -} - -function debugexit_print($var) -{ - echo "
";
-	print_r($var);
-	echo "
"; - exit; -} - -function locale_exists($locale) -{ - return file_exists(dirname(__FILE__) . "/../locales/$locale/properties"); -} - -function locale_pattern_check($locale) -{ - $locale_pattern = "/^[\w-]{2,5}$/"; - return preg_match($locale_pattern, $locale) && $locale != 'names'; -} - -function get_available_locales() -{ - $list = array(); - $folder = dirname(__FILE__) . "/../locales"; - if ($handle = opendir($folder)) { - while (false !== ($file = readdir($handle))) { - if (locale_pattern_check($file) && is_dir("$folder/$file")) { - $list[] = $file; - } - } - closedir($handle); - } - sort($list); - return $list; -} - -function get_user_locale() -{ - global $default_locale, $locale_cookie_name; - - if (isset($_COOKIE[$locale_cookie_name])) { - $requested_lang = $_COOKIE[$locale_cookie_name]; - if (locale_pattern_check($requested_lang) && locale_exists($requested_lang)) - return $requested_lang; - } - - if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { - $requested_langs = explode(",", $_SERVER['HTTP_ACCEPT_LANGUAGE']); - foreach ($requested_langs as $requested_lang) { - if (strlen($requested_lang) > 2) - $requested_lang = substr($requested_lang, 0, 2); - - if (locale_pattern_check($requested_lang) && locale_exists($requested_lang)) - return $requested_lang; - } - } - - if (locale_pattern_check($default_locale) && locale_exists($default_locale)) - return $default_locale; - - return 'en'; -} - -function get_locale() -{ - global $mibewroot, $locale_cookie_name; - - $locale = verifyparam("locale", "/./", ""); - - if ($locale && locale_pattern_check($locale) && locale_exists($locale)) { - $_SESSION['locale'] = $locale; - } - else if (isset($_SESSION['locale']) && locale_pattern_check($_SESSION['locale']) && locale_exists($_SESSION['locale'])) { - $locale = $_SESSION['locale']; - } - else { - $locale = get_user_locale(); - } - - setcookie($locale_cookie_name, $locale, time() + 60 * 60 * 24 * 1000, "$mibewroot/"); - return $locale; -} - -$current_locale = get_locale(); -$messages = array(); -$output_encoding = array(); - -if (function_exists("date_default_timezone_set")) { - // TODO try to get timezone from config.php/session etc. - // autodetect timezone - @date_default_timezone_set(function_exists("date_default_timezone_get") ? @date_default_timezone_get() : "GMT"); -} - -function get_locale_links($href) -{ - global $current_locale; - $localeLinks = array(); - $allLocales = get_available_locales(); - if (count($allLocales) < 2) { - return null; - } - foreach ($allLocales as $k) { - $localeLinks[$k] = getlocal_($k, "names"); - } - return $localeLinks; -} - -function load_messages($locale) -{ - global $messages, $mibew_encoding, $output_encoding; - $hash = array(); - $current_encoding = $mibew_encoding; - - $fp = fopen(dirname(__FILE__) . "/../locales/$locale/properties", "r"); - if ($fp === FALSE) { - die("unable to open properties for locale $locale"); - } - while (!feof($fp)) { - $line = fgets($fp, 4096); - $keyval = preg_split("/=/", $line, 2); - if (isset($keyval[1])) { - if ($keyval[0] == 'encoding') { - $current_encoding = trim($keyval[1]); - } else if ($keyval[0] == 'output_encoding') { - $output_encoding[$locale] = trim($keyval[1]); - } else if ($current_encoding == $mibew_encoding) { - $hash[$keyval[0]] = str_replace("\\n", "\n", trim($keyval[1])); - } else { - $hash[$keyval[0]] = myiconv($current_encoding, $mibew_encoding, str_replace("\\n", "\n", trim($keyval[1]))); - } - } - } - fclose($fp); - $messages[$locale] = $hash; -} - -function getoutputenc() -{ - global $current_locale, $output_encoding, $mibew_encoding, $messages; - if (!isset($messages[$current_locale])) - load_messages($current_locale); - return isset($output_encoding[$current_locale]) ? $output_encoding[$current_locale] : $mibew_encoding; -} - -function getstring_($text, $locale, $raw = false) -{ - global $messages; - if (!isset($messages[$locale])) - load_messages($locale); - - $localized = $messages[$locale]; - if (isset($localized[$text])) - return $raw ? $localized[$text] : sanitize_string($localized[$text], 'low', 'moderate'); - if ($locale != 'en') { - return getstring_($text, 'en', $raw); - } - - return "!" . ($raw ? $text : sanitize_string($text, 'low', 'moderate')); -} - -function getstring($text, $raw = false) -{ - global $current_locale; - $string = getstring_($text, $current_locale, true); - return $raw ? $string : sanitize_string($string, 'low', 'moderate'); -} - -function getlocal($text, $raw = false) -{ - global $current_locale, $mibew_encoding; - $string = myiconv($mibew_encoding, getoutputenc(), getstring_($text, $current_locale, true)); - return $raw ? $string : sanitize_string($string, 'low', 'moderate'); -} - -function getlocal_($text, $locale, $raw = false) -{ - global $mibew_encoding; - $string = myiconv($mibew_encoding, getoutputenc(), getstring_($text, $locale, true)); - return $raw ? $string : sanitize_string($string, 'low', 'moderate'); -} - -function topage($text) -{ - global $mibew_encoding; - return myiconv($mibew_encoding, getoutputenc(), $text); -} - -function getstring2_($text, $params, $locale, $raw = false) -{ - $string = getstring_($text, $locale, true); - for ($i = 0; $i < count($params); $i++) { - $string = str_replace("{" . $i . "}", $params[$i], $string); - } - return $raw ? $string : sanitize_string($string, 'low', 'moderate'); -} - -function getstring2($text, $params, $raw = false) -{ - global $current_locale; - $string = getstring2_($text, $params, $current_locale, true); - return $raw ? $string : sanitize_string($string, 'low', 'moderate'); -} - -function getlocal2($text, $params, $raw = false) -{ - global $current_locale, $mibew_encoding; - $string = myiconv($mibew_encoding, getoutputenc(), getstring_($text, $current_locale, true)); - for ($i = 0; $i < count($params); $i++) { - $string = str_replace("{" . $i . "}", $params[$i], $string); - } - return $raw ? $string : sanitize_string($string, 'low', 'moderate'); -} - -/* prepares for Javascript string */ -function getlocalforJS($text, $params) -{ - global $current_locale, $mibew_encoding; - $string = myiconv($mibew_encoding, getoutputenc(), getstring_($text, $current_locale, true)); - $string = str_replace("\"", "\\\"", str_replace("\n", "\\n", $string)); - for ($i = 0; $i < count($params); $i++) { - $string = str_replace("{" . $i . "}", $params[$i], $string); - } - return sanitize_string($string, 'low', 'moderate'); -} - -/* ajax server actions use utf-8 */ -function getrawparam($name) -{ - global $mibew_encoding; - if (isset($_POST[$name])) { - $value = myiconv("utf-8", $mibew_encoding, $_POST[$name]); - if (get_magic_quotes_gpc()) { - $value = stripslashes($value); - } - return $value; - } - die("no " . $name . " parameter"); -} - -/* form processors use current Output encoding */ -function getparam($name) -{ - global $mibew_encoding; - if (isset($_POST[$name])) { - $value = myiconv(getoutputenc(), $mibew_encoding, $_POST[$name]); - if (get_magic_quotes_gpc()) { - $value = stripslashes($value); - } - return $value; - } - die("no " . $name . " parameter"); -} - -function unicode_urldecode($url) -{ - preg_match_all('/%u([[:alnum:]]{4})/', $url, $a); - - foreach ($a[1] as $uniord) { - $dec = hexdec($uniord); - $utf = ''; - - if ($dec < 128) { - $utf = chr($dec); - } else if ($dec < 2048) { - $utf = chr(192 + (($dec - ($dec % 64)) / 64)); - $utf .= chr(128 + ($dec % 64)); - } else { - $utf = chr(224 + (($dec - ($dec % 4096)) / 4096)); - $utf .= chr(128 + ((($dec % 4096) - ($dec % 64)) / 64)); - $utf .= chr(128 + ($dec % 64)); - } - $url = str_replace('%u' . $uniord, $utf, $url); - } - return urldecode($url); -} - -function getgetparam($name, $default = '') -{ - global $mibew_encoding; - if (!isset($_GET[$name]) || !$_GET[$name]) { - return $default; - } - $value = myiconv("utf-8", $mibew_encoding, unicode_urldecode($_GET[$name])); - if (get_magic_quotes_gpc()) { - $value = stripslashes($value); - } - return $value; -} - -function connect() -{ - global $mysqlhost, $mysqllogin, $mysqlpass, $mysqldb, $dbencoding, $force_charset_in_connection; - if (!extension_loaded("mysql")) { - die('Mysql extension is not loaded'); - } - $link = @mysql_connect($mysqlhost, $mysqllogin, $mysqlpass) - or die('Could not connect: ' . mysql_error()); - mysql_select_db($mysqldb, $link) or die('Could not select database'); - if ($force_charset_in_connection) { - mysql_query("SET NAMES '" . mysql_real_escape_string($dbencoding, $link) . "'", $link); - } - return $link; -} - -function perform_query($query, $link) -{ - mysql_query($query, $link) or die(' Query failed: ' . mysql_error($link)); -} - -function select_one_row($query, $link) -{ - $result = mysql_query($query, $link) or die(' Query failed: ' . mysql_error($link)); - $line = mysql_fetch_array($result, MYSQL_ASSOC); - mysql_free_result($result); - return $line; -} - -function select_multi_assoc($query, $link) -{ - $sqlresult = mysql_query($query, $link) or die(' Query failed: ' . mysql_error($link)); - - $result = array(); - while ($row = mysql_fetch_array($sqlresult, MYSQL_ASSOC)) { - $result[] = $row; - } - mysql_free_result($sqlresult); - return $result; -} - -function db_build_select($fields, $table, $conditions, $orderandgroup) -{ - $condition = count($conditions) > 0 ? " where " . implode(" and ", $conditions) : ""; - if ($orderandgroup) $orderandgroup = " " . $orderandgroup; - return "select $fields from $table$condition$orderandgroup"; -} - -function db_rows_count($table, $conditions, $countfields, $link) -{ - $result = mysql_query(db_build_select("count(" . ($countfields ? $countfields : "*") . ")", $table, $conditions, ""), $link) - or die(' Count query failed: ' . mysql_error($link)); - $line = mysql_fetch_array($result, MYSQL_NUM); - mysql_free_result($result); - return $line[0]; -} - -function start_xml_output() -{ - header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); - header("Cache-Control: no-store, no-cache, must-revalidate"); - header("Pragma: no-cache"); - header("Content-type: text/xml; charset=utf-8"); - echo ""; -} - -function start_html_output() -{ - $charset = getstring("output_charset"); - header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); - header("Cache-Control: no-store, no-cache, must-revalidate"); - header("Pragma: no-cache"); - header("Content-type: text/html" . (isset($charset) ? "; charset=" . $charset : "")); -} - -function escape_with_cdata($text) -{ - return "", "]]>]]>"; -} - -function form_value($key) -{ - global $page; - if (isset($page) && isset($page["form$key"])) - return safe_htmlspecialchars($page["form$key"]); - return ""; -} - -function form_value_cb($key) -{ - global $page; - if (isset($page) && isset($page["form$key"])) - return $page["form$key"] === true; - return false; -} - -function form_value_mb($key, $id) -{ - global $page; - if (isset($page) && isset($page["form$key"]) && is_array($page["form$key"])) { - return in_array($id, $page["form$key"]); - } - return false; -} - -function no_field($key) -{ - return getlocal2("errors.required", array(getlocal($key))); -} - -function failed_uploading_file($filename, $key) -{ - return getlocal2("errors.failed.uploading.file", - array(safe_htmlspecialchars($filename), getlocal($key))); -} - -function wrong_field($key) -{ - return getlocal2("errors.wrong_field", array(getlocal($key))); -} - -function get_popup($href, $jshref, $message, $title, $wndName, $options) -{ - if (!$jshref) { - $jshref = "'$href'"; - } - return "$message"; -} - -function get_image($href, $width, $height) -{ - if ($width != 0 && $height != 0) - return "\"\"/"; - return "\"\"/"; -} - -function get_gifimage_size($filename) -{ - if (function_exists('gd_info')) { - $info = gd_info(); - if (isset($info['GIF Read Support']) && $info['GIF Read Support']) { - $img = @imagecreatefromgif($filename); - if ($img) { - $height = imagesy($img); - $width = imagesx($img); - imagedestroy($img); - return array($width, $height); - } - } - } - return array(0, 0); -} - -function add_params($servlet, $params) -{ - $infix = '?'; - if (strstr($servlet, $infix) !== FALSE) - $infix = '&'; - foreach ($params as $k => $v) { - $servlet .= $infix . $k . "=" . $v; - $infix = '&'; - } - return $servlet; -} - -function div($a, $b) -{ - return ($a - ($a % $b)) / $b; -} - -function date_diff_to_text($seconds) -{ - $minutes = div($seconds, 60); - $seconds = $seconds % 60; - if ($minutes < 60) { - return sprintf("%02d:%02d", $minutes, $seconds); - } else { - $hours = div($minutes, 60); - $minutes = $minutes % 60; - return sprintf("%02d:%02d:%02d", $hours, $minutes, $seconds); - } -} - -function is_valid_email($email) -{ - return preg_match("/^[^@]+@[^\.]+(\.[^\.]+)*$/", $email); -} - -function get_app_location($showhost, $issecure) -{ - global $mibewroot; - if ($showhost) { - return ($issecure ? "https://" : "http://") . $_SERVER['HTTP_HOST'] . $mibewroot; - } else { - return $mibewroot; - } -} - -function is_secure_request() -{ - return - isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == '443' - || isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on" - || isset($_SERVER["HTTP_HTTPS"]) && $_SERVER["HTTP_HTTPS"] == "on"; -} - -function get_month_selection($fromtime, $totime) -{ - $start = getdate($fromtime); - $month = $start['mon']; - $year = $start['year']; - $result = array(); - do { - $current = mktime(0, 0, 0, $month, 1, $year); - $result[date("m.y", $current)] = strftime("%B, %Y", $current); - $month++; - if ($month > 12) { - $month = 1; - $year++; - } - } while ($current < $totime); - return $result; -} - -function get_form_date($day, $month) -{ - if (preg_match('/^(\d{2}).(\d{2})$/', $month, $matches)) { - return mktime(0, 0, 0, $matches[1], $day, $matches[2]); - } - return 0; -} - -function set_form_date($utime, $prefix) -{ - global $page; - $page["form${prefix}day"] = date("d", $utime); - $page["form${prefix}month"] = date("m.y", $utime); -} - -function date_to_text($unixtime) -{ - if ($unixtime < 60 * 60 * 24 * 30) - return getlocal("time.never"); - - $then = getdate($unixtime); - $now = getdate(); - - if ($then['yday'] == $now['yday'] && $then['year'] == $now['year']) { - $date_format = getlocal("time.today.at"); - } else if (($then['yday'] + 1) == $now['yday'] && $then['year'] == $now['year']) { - $date_format = getlocal("time.yesterday.at"); - } else { - $date_format = getlocal("time.dateformat"); - } - - return strftime($date_format . " " . getlocal("time.timeformat"), $unixtime); -} - -$dbversion = '1.6.6'; -$featuresversion = '1.6.6'; - -$settings = array( - 'dbversion' => 0, - 'featuresversion' => 0, - 'title' => 'Your Company', - 'hosturl' => 'http://mibew.org', - 'logo' => '', - 'usernamepattern' => '{name}', - 'chatstyle' => 'default', - 'chattitle' => 'Live Support', - 'geolink' => 'http://api.hostip.info/get_html.php?ip={ip}', - 'geolinkparams' => 'width=440,height=100,toolbar=0,scrollbars=0,location=0,status=1,menubar=0,resizable=1', - 'max_uploaded_file_size' => 100000, - 'max_connections_from_one_host' => 10, - 'thread_lifetime' => 600, - - 'email' => '', /* inbox for left messages */ - 'left_messages_locale' => $home_locale, - 'sendmessagekey' => 'center', - - 'enableban' => '0', - 'enablessl' => '0', - 'forcessl' => '0', - 'usercanchangename' => '1', - 'enablegroups' => '0', - 'enablestatistics' => '1', - 'enablejabber' => '0', - 'enablepresurvey' => '1', - 'surveyaskmail' => '0', - 'surveyaskgroup' => '1', - 'surveyaskmessage' => '0', - 'surveyaskcaptcha' => '0', - 'enablepopupnotification' => '0', - 'showonlineoperators' => '0', - 'enablecaptcha' => '0', - - 'online_timeout' => 30, /* Timeout (in seconds) when online operator becomes offline */ - 'updatefrequency_operator' => 2, - 'updatefrequency_chat' => 2, - 'updatefrequency_oldchat' => 7, -); -$settingsloaded = false; -$settings_in_db = array(); - -function loadsettings_($link) -{ - global $settingsloaded, $settings_in_db, $settings, $mysqlprefix; - if ($settingsloaded) { - return; - } - $settingsloaded = true; - - $sqlresult = mysql_query("select vckey,vcvalue from ${mysqlprefix}chatconfig", $link) or die(' Query failed: ' . mysql_error($link)); - - while ($row = mysql_fetch_array($sqlresult, MYSQL_ASSOC)) { - $name = $row['vckey']; - $settings[$name] = $row['vcvalue']; - $settings_in_db[$name] = true; - } - mysql_free_result($sqlresult); -} - -function loadsettings() -{ - global $settingsloaded; - if (!$settingsloaded) { - $link = connect(); - loadsettings_($link); - mysql_close($link); - } -} - -function getchatstyle() -{ - global $settings; - $chatstyle = verifyparam("style", "/^\w+$/", ""); - if ($chatstyle) { - return $chatstyle; - } - loadsettings(); - return $settings['chatstyle']; -} - -function jspath() -{ - global $jsver; - return "js/$jsver"; -} - -/* authorization token check for CSRF attack */ -function csrfchecktoken() -{ - setcsrftoken(); - - // check the turing code for post requests and del requests - if ($_SERVER['REQUEST_METHOD'] == 'POST') { - //if token match - if (!isset($_POST['csrf_token']) || ($_POST['csrf_token'] != $_SESSION['csrf_token'])) { - - die("CSRF failure"); - } - } else if (isset($_GET['act'])) { - if (($_GET['act'] == 'del' || $_GET['act'] == 'delete') && $_GET['csrf_token'] != $_SESSION['csrf_token']) { - - die("CSRF failure"); - } - } -} - -/* print csrf token as a hidden field*/ -function print_csrf_token_input() -{ - setcsrftoken(); - - echo "\n"; -} - -/* print csrf token in url format */ -function print_csrf_token_in_url() -{ - setcsrftoken(); - - echo "&csrf_token=" . $_SESSION['csrf_token']; -} - -/* set csrf token */ -function setcsrftoken() -{ - if (!isset($_SESSION['csrf_token'])) { - $_SESSION['csrf_token'] = sha1(session_id() . (function_exists('openssl_random_pseudo_bytes') ? openssl_random_pseudo_bytes(32) : (time() + microtime()) . mt_rand(0, 99999999))); - } -} - -/* simple HTML sanitation - * - * includes some code from the PHP Strip Attributes Class For XML and HTML - * Copyright 2009 David (semlabs.co.uk) - * Available under the MIT License. - * - * http://semlabs.co.uk/journal/php-strip-attributes-class-for-xml-and-html - * - */ - -function sanitize_string($string, $tags_level = 'high', $attr_level = 'high') -{ - $sanitize_tags = array( - 'high' => '', - 'moderate' => '
', - 'low' => '