From 5077a0ec5c3185fcdb7f6fd39b685a5fe9b0bf2c Mon Sep 17 00:00:00 2001 From: Yarik Date: Wed, 16 Mar 2016 18:06:03 +0200 Subject: [PATCH] test --- common/models/User.php | 116 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------- frontend/controllers/BookmarksController.php | 110 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- frontend/views/layouts/company.php | 25 ++++++++++++++++++++++--- frontend/views/site/forms-modal-fav.php | 19 +++++++++++++------ frontend/web/css/style.css | 3 +++ frontend/web/js/forms.js | 380 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------------------------------------------------------------- frontend/web/js/script.js | 1860 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 7 files changed, 1550 insertions(+), 963 deletions(-) diff --git a/common/models/User.php b/common/models/User.php index 58b3888..bc43e82 100755 --- a/common/models/User.php +++ b/common/models/User.php @@ -17,44 +17,44 @@ /** * User model - * @property integer $id - * @property string $username - * @property string $password_hash - * @property string $password_reset_token - * @property string $email - * @property string $auth_key - * @property integer $status - * @property integer $created_at - * @property integer $updated_at - * @property string $password write-only password - * @property string $type - * @property UserInfo $userInfo - * @property string $userName - * @property array[] $roles - * @property CompanyInfo $companyInfo - * @property array[] $phones - * @property array[] $site - * @property string $address - * @property string $liveTime - * @property Payment[] $payments - * @property integer[] $paymentInput - * @property Specialization[] $specializations - * @property integer[] $specializationInput - * @property Blog[] $blog - * @property Job[] $jobs - * @property Job $currentJob - * @property Portfolio[] $portfolios - * @property Project[] $projects - * @property Team[] $teams - * @property Vacancy[] $vacancies - * @property Gallery[] $galleries + * @property integer $id + * @property string $username + * @property string $password_hash + * @property string $password_reset_token + * @property string $email + * @property string $auth_key + * @property integer $status + * @property integer $created_at + * @property integer $updated_at + * @property string $password write-only password + * @property string $type + * @property UserInfo $userInfo + * @property string $userName + * @property array[] $roles + * @property CompanyInfo $companyInfo + * @property array[] $phones + * @property array[] $site + * @property string $address + * @property string $liveTime + * @property Payment[] $payments + * @property integer[] $paymentInput + * @property Specialization[] $specializations + * @property integer[] $specializationInput + * @property Blog[] $blog + * @property Job[] $jobs + * @property Job $currentJob + * @property Portfolio[] $portfolios + * @property Project[] $projects + * @property Team[] $teams + * @property Vacancy[] $vacancies + * @property Gallery[] $galleries * @property UserInfo|CompanyInfo $owner - * @property string $name - * @property Comment[] $comments - * @property Rating[] $commentRating - * @property int $ratingPG - * @property string $lastVisit - * @property string $link + * @property string $name + * @property Comment[] $comments + * @property Rating[] $commentRating + * @property int $ratingPG + * @property string $lastVisit + * @property string $link */ class User extends ActiveRecord implements IdentityInterface, UserRbacInterface { @@ -587,7 +587,6 @@ /** * Return all user's galleries - * * @return ActiveQuery */ public function getGalleries() @@ -597,7 +596,6 @@ /** * Return company info or user info according to user type - * * @return ActiveQuery */ public function getOwner() @@ -611,7 +609,6 @@ /** * Return company name or user firstname and lastname according to user type - * * @return string */ public function getName() @@ -625,7 +622,6 @@ /** * Return all comments to user - * * @return ActiveQuery */ public function getComments() @@ -640,7 +636,6 @@ /** * Return all ratings to user - * * @return ActiveQuery */ public function getCommentRating() @@ -655,7 +650,6 @@ /** * Return user's rating
* Available only for PostgreSQL - * * @return int * @throws InvalidConfigException */ @@ -665,7 +659,7 @@ throw new InvalidConfigException('This method is available only in PostgreSQL'); } return $this->getCommentRating() - ->select(['rating' => 'ROUND(SUM("rating"."value")/COUNT("rating"."rating_id")::numeric, 2)']) + ->select([ 'rating' => 'ROUND(SUM("rating"."value")/COUNT("rating"."rating_id")::numeric, 2)' ]) ->andWhere([ 'not', [ 'rating.value' => NULL ], @@ -675,11 +669,8 @@ /** * Recalculate rating and write it to db. - * * Only for PostgreSQL - * * @see \common\models\User::getRatingPG() - * * @throws InvalidConfigException */ public function updateRating() @@ -697,15 +688,40 @@ /** * Return link to user personal page according to user type - * * @return string */ public function getLink($page = 'common') { if($this->type == 2) { - return Url::to(['company/'.$page, 'company_id' => $this->id]); + return Url::to([ + 'company/' . $page, + 'company_id' => $this->id, + ]); } else { - return Url::to(['performer/'.$page, 'performer_id' => $this->id]); + return Url::to([ + 'performer/' . $page, + 'performer_id' => $this->id, + ]); + } + } + + public function getIsBookmarked($type = Bookmark::TYPE_PERFORMER) + { + if(!empty( \Yii::$app->user->identity )) { + if(!empty( $this->hasOne(Bookmark::className(), [ 'model_id' => 'id' ]) + ->andWhere([ + 'model' => $this->className(), + 'user_id' => \Yii::$app->user->getId(), + 'type' => $type, + ]) + ->one() ) + ) { + return true; + } else { + return false; + } + } else { + return false; } } diff --git a/frontend/controllers/BookmarksController.php b/frontend/controllers/BookmarksController.php index dd6feec..01947e0 100644 --- a/frontend/controllers/BookmarksController.php +++ b/frontend/controllers/BookmarksController.php @@ -1,8 +1,12 @@ AccessControl::className(), 'rules' => [ [ - //'actions' => ['cabinet','change-password', 'bookmarks', 'projects'], 'allow' => true, 'roles' => [ '@' ], ], ], ], + 'verbs' => [ + 'class' => VerbFilter::className(), + 'actions' => [ + 'add-performer' => [ 'post' ], + 'add-customer' => [ 'post' ], + 'add-project' => [ 'post' ], + 'add-vacancy' => [ 'post' ], + 'remove-performer' => [ 'post' ], + 'remove-customer' => [ 'post' ], + 'remove-project' => [ 'post' ], + 'remove-vacancy' => [ 'post' ], + ], + ], ]; } @@ -31,4 +47,96 @@ return $this->render('bookmarks'); } + public function actionAddPerformer() + { + $response = \Yii::$app->response; + $response->format = Response::FORMAT_JSON; + $model_id = \Yii::$app->request->post('id'); + if(empty( $model_id )) { + return [ 'error' => 'Ошибка добавления. Отсутствует id исполнителя' ]; + } + $user = User::findOne($model_id); + if(empty( $user )) { + return [ 'error' => 'Ошибка добавления. Исполнитель не найден.' ]; + } + $model = $user->className(); + $user_id = \Yii::$app->user->getId(); + $type = Bookmark::TYPE_PERFORMER; + if(Bookmark::findOne([ + 'model' => $model, + 'model_id' => $model_id, + 'user_id' => $user_id, + 'type' => $type, + ]) + ) { + return [ 'error' => 'Ошибка добавления. Исполнитель уже добавлен.' ]; + } + $bookmark = new Bookmark([ + 'model' => $model, + 'model_id' => $model_id, + 'user_id' => $user_id, + 'type' => $type, + ]); + if($bookmark->save()) { + $result = $this->renderAjax('//site/forms-modal-fav', [ + 'message' => 'Добавлено в закладки.', + 'image' => $user->userInfo->image, + 'name' => $user->name, + ]); + return [ 'result' => $result ]; + } else { + return [ 'error' => 'Ошибка добавления.' ]; + } + } + + public function actionAddCustomer($id) + { + + } + + public function actionAddProject($id) + { + + } + + public function actionAddVacancy($id) + { + + } + + public function actionRemovePerformer() + { + $response = \Yii::$app->response; + $response->format = Response::FORMAT_JSON; + $model_id = \Yii::$app->request->post('id'); + if(empty( $model_id )) { + return [ 'error' => 'Ошибка удаления. Отсутствует id исполнителя' ]; + } + $user = User::findOne($model_id); + if(empty( $user )) { + return [ 'error' => 'Ошибка добавления. Исполнитель не найден.' ]; + } + $model = $user->className(); + $user_id = \Yii::$app->user->getId(); + $type = Bookmark::TYPE_PERFORMER; + /** + * @var Bookmark $bookmark + */ + $bookmark = Bookmark::findOne([ + 'model' => $model, + 'model_id' => $model_id, + 'user_id' => $user_id, + 'type' => $type, + ]); + if(!empty($bookmark)) { + if($bookmark->delete()) { + return ['message' => 'Закладка успешно удалена']; + } else { + return ['error' => 'Ошибка при удалении']; + } + } else { + return ['error' => 'Закладка не найдена']; + } + } + } diff --git a/frontend/views/layouts/company.php b/frontend/views/layouts/company.php index bfc3205..3e771cb 100755 --- a/frontend/views/layouts/company.php +++ b/frontend/views/layouts/company.php @@ -11,7 +11,6 @@ $this->beginContent('@app/views/layouts/main.php'); ?> -
@@ -35,7 +34,27 @@
Гарантируем конфидециальность
-
+ user->identity )) { + ?> +
+ params[ 'company' ]->isBookmarked) { + echo Html::a('', [ '#' ], [ + 'class' => 'artbox_bookmark_remove_performer', + 'data-id' => $this->params[ 'company' ]->id, + ]); + } else { + echo Html::a('', [ '#' ], [ + 'class' => 'artbox_bookmark_add_performer', + 'data-id' => $this->params[ 'company' ]->id, + ]); + } + ?> +
+
@@ -110,7 +129,7 @@
-
Познякижилстрой
+
params[ 'company' ]->name ?>
  • diff --git a/frontend/views/site/forms-modal-fav.php b/frontend/views/site/forms-modal-fav.php index 31b9d3b..aae9657 100644 --- a/frontend/views/site/forms-modal-fav.php +++ b/frontend/views/site/forms-modal-fav.php @@ -1,16 +1,23 @@ \ No newline at end of file diff --git a/frontend/web/css/style.css b/frontend/web/css/style.css index a5233ed..25ce3de 100755 --- a/frontend/web/css/style.css +++ b/frontend/web/css/style.css @@ -1568,6 +1568,9 @@ input[type=file]::-webkit-file-upload-button { display: block; transition: 0.3s; } +.performance-vacancy-add-favorite a.artbox_bookmark_remove_performer{ + background: url("/images/button_add_fav_01.png") no-repeat; +} .performance-vacancy-add-favorite a:hover{opacity: 0.95} .menu-content-wr { height: 43px; diff --git a/frontend/web/js/forms.js b/frontend/web/js/forms.js index f5c407f..1f7a1bd 100755 --- a/frontend/web/js/forms.js +++ b/frontend/web/js/forms.js @@ -1,126 +1,274 @@ -$(document).ready(function(){ - function addRemoveBlocks(){ - $('#overlay, .forms-modal-hide').remove(); - $('body').append('
    ').append('
    '); - } +$(document).ready( + function() + { + function addRemoveBlocks() + { + $('#overlay, .forms-modal-hide').remove(); + $('body').append('
    ').append('
    '); + } - function addToLogin(){ - $.post("/site/forms-modal-login", function (data) { - $('.forms-modal-hide').append(data) - }) - .fail(function(){ - $('#overlay, .forms-modal-hide').remove(); - alert(txtErrorModal) - }) - .done(function() { - var newMarg = $(window).scrollTop(); - $('#overlay').fadeIn(400, - function(){ - $('.forms-modal-hide>div') - .css({display:'block', marginTop:-230+newMarg}) - .animate({opacity: 1, top: '50%'}, 200); - }); - }) - } + function addToLogin() + { + $.post( + "/site/forms-modal-login", function(data) + { + $('.forms-modal-hide').append(data) + } + ) + .fail( + function() + { + $('#overlay, .forms-modal-hide').remove(); + alert(txtErrorModal) + } + ) + .done( + function() + { + var newMarg = $(window).scrollTop(); + $('#overlay').fadeIn( + 400, function() + { + $('.forms-modal-hide>div') + .css({display : 'block', marginTop : -230 + newMarg}) + .animate({opacity : 1, top : '50%'}, 200); + } + ); + } + ) + } - function addToFavorites(){ - $.post("/site/forms-modal-fav", function (data) { - $('.forms-modal-hide').append(data) - }) - .fail(function(){ - $('#overlay, .forms-modal-hide').remove(); - alert(txtErrorModal) - }) - .done(function() { - var newMarg = $(window).scrollTop(); - $('#overlay').fadeIn(400, - function(){ - $('.forms-modal-hide>div') - .css({display:'block', marginTop:-230+newMarg}) - .animate({opacity: 1, top: '50%'}, 200); - }); - }) - } + function addToFavorites() + { + $.post( + "/site/forms-modal-fav", function(data) + { + $('.forms-modal-hide').append(data) + } + ) + .fail( + function() + { + $('#overlay, .forms-modal-hide').remove(); + alert(txtErrorModal) + } + ) + .done( + function() + { + var newMarg = $(window).scrollTop(); + $('#overlay').fadeIn( + 400, function() + { + $('.forms-modal-hide>div') + .css({display : 'block', marginTop : -230 + newMarg}) + .animate({opacity : 1, top : '50%'}, 200); + } + ); + } + ) + } - function addToOffer(){ - $.post("/site/forms-modal-offer", function (data) { - $('.forms-modal-hide').append(data) - }) - .fail(function(){ - $('#overlay, .forms-modal-hide').remove(); - alert(txtErrorModal) - }) - .done(function() { - var newMarg = $(window).scrollTop(); - $('#overlay').fadeIn(400, - function(){ - $('body').css({overflowY:'hidden'}) - $('.forms-modal-hide>div') - .css({display:'block', marginTop:-230+newMarg}) - .animate({opacity: 1, top: '50%'}, 200); - }); - }) - } + function addToOffer() + { + $.post( + "/site/forms-modal-offer", function(data) + { + $('.forms-modal-hide').append(data) + } + ) + .fail( + function() + { + $('#overlay, .forms-modal-hide').remove(); + alert(txtErrorModal) + } + ) + .done( + function() + { + var newMarg = $(window).scrollTop(); + $('#overlay').fadeIn( + 400, function() + { + $('body').css({overflowY : 'hidden'}) + $('.forms-modal-hide>div') + .css({display : 'block', marginTop : -230 + newMarg}) + .animate({opacity : 1, top : '50%'}, 200); + } + ); + } + ) + } - function addContacts() { - $.post("/site/forms-modal-contacts", function (data) { - $('.forms-modal-hide').append(data) - }) - .fail(function(){ - $('#overlay, .forms-modal-hide').remove(); - alert(txtErrorModal) - }) - .done(function() { - var newMarg = $(window).scrollTop(); - $('#overlay').fadeIn(400, - function(){ - $('.forms-modal-hide>div') - .css({display:'block', marginTop:-230+newMarg}) - .animate({opacity: 1, top: '50%'}, 200); - }); - }) - } + function addContacts() + { + $.post( + "/site/forms-modal-contacts", function(data) + { + $('.forms-modal-hide').append(data) + } + ) + .fail( + function() + { + $('#overlay, .forms-modal-hide').remove(); + alert(txtErrorModal) + } + ) + .done( + function() + { + var newMarg = $(window).scrollTop(); + $('#overlay').fadeIn( + 400, function() + { + $('.forms-modal-hide>div') + .css({display : 'block', marginTop : -230 + newMarg}) + .animate({opacity : 1, top : '50%'}, 200); + } + ); + } + ) + } + + //login + $('a.loginLinkModal').click( + function(e) + { + e.preventDefault() + addRemoveBlocks() + addToLogin() + } + ) + //contacts + $('a.contactsLinkModalFirst').click( + function(e) + { + e.preventDefault() + addRemoveBlocks() + addContacts() + } + ) + //bookmarks - //login - $('a.loginLinkModal').click(function(e){ - e.preventDefault() - addRemoveBlocks() - addToLogin() - }) - //contacts - $('a.contactsLinkModalFirst').click(function(e){ - e.preventDefault() - addRemoveBlocks() - addContacts() - }) - //bookmarks - $('.get-list, .performance-vacancy-add-favorite a, .blog-buttons-add-favorite').click(function(e){ - e.preventDefault() - addRemoveBlocks() - addToFavorites() - }) - //offer - $('a.get-project, .blog-buttons-offer').click(function(e){ - e.preventDefault() - addRemoveBlocks() - addToOffer() - }) + //Performer bookmark add + $(document).on('click', '.artbox_bookmark_add_performer', function(e) { + e.preventDefault(); + var id = $(this).data('id'); + addRemoveBlocks(); + $.post('/bookmarks/add-performer', {id: id}, function(data) { + if(data.error) { + $('#overlay, .forms-modal-hide').remove(); + alert(data.error); + } else { + $('.artbox_bookmark_add_performer').removeClass('artbox_bookmark_add_performer').addClass('artbox_bookmark_remove_performer'); + $('.forms-modal-hide').append(data.result); + } + }, 'json').fail( + function() + { + $('#overlay, .forms-modal-hide').remove(); + alert(txtErrorModal); + } + ) + .done( + function() + { + var newMarg = $(window).scrollTop(); + $('#overlay').fadeIn( + 400, function() + { + $('.forms-modal-hide>div') + .css({display : 'block', marginTop : -230 + newMarg}) + .animate({opacity : 1, top : '50%'}, 200); + } + ); + } + ) + }); + //Performer bookmark remove + $(document).on('click', '.artbox_bookmark_remove_performer', function(e) { + e.preventDefault(); + var id = $(this).data('id'); + var link = $(this); + addRemoveBlocks(); + $.post('/bookmarks/remove-performer', {id: id}, function(data) { + if(data.error) { + $('#overlay, .forms-modal-hide').remove(); + alert(data.error); + } else { + $('.artbox_bookmark_remove_performer').removeClass('artbox_bookmark_remove_performer').addClass('artbox_bookmark_add_performer'); + $('#overlay, .forms-modal-hide').remove(); + alert(data.message); + } + }, 'json').fail( + function() + { + $('#overlay, .forms-modal-hide').remove(); + alert(txtErrorModal); + } + ) + .done( + function() + { + var newMarg = $(window).scrollTop(); + $('#overlay').fadeIn( + 400, function() + { + $('.forms-modal-hide>div') + .css({display : 'block', marginTop : -230 + newMarg}) + .animate({opacity : 1, top : '50%'}, 200); + } + ); + } + ) + }); + + $('.get-list, .performance-vacancy-add-favorite a, .blog-buttons-add-favorite').click( + function(e) + { + e.preventDefault() +// addRemoveBlocks() +// addToFavorites() + } + ) + //offer + $('a.get-project, .blog-buttons-offer').click( + function(e) + { + e.preventDefault() + addRemoveBlocks() + addToOffer() + } + ) + + var txtErrorModal = 'ВОЗНИКЛА ОШИБКА, ПОПРОБУЙТЕ ЕЩЕ РАЗ ПОЗЖЕ!'; - var txtErrorModal = 'ВОЗНИКЛА ОШИБКА, ПОПРОБУЙТЕ ЕЩЕ РАЗ ПОЗЖЕ!'; + clocseModalForms() + function clocseModalForms() + { + $('body').on( + 'click', '.closed-form, #overlay', function() + { + $('body').css({overflowY : 'visible'}) + $('.forms-modal-hide>div') + .animate( + {opacity : 0, top : '30%'}, 200, function() + { + $(this).css('display', 'none') + $('#overlay').fadeOut( + 400, function() + { + $('#overlay, .forms-modal-hide').remove() + } + ) + } + ) - clocseModalForms() - function clocseModalForms(){ - $('body').on('click','.closed-form, #overlay', function(){ - $('body').css({overflowY:'visible'}) - $('.forms-modal-hide>div') - .animate({opacity: 0, top: '30%'}, 200, - function(){ - $(this).css('display', 'none') - $('#overlay').fadeOut(400,function(){$('#overlay, .forms-modal-hide').remove()}) } - ) + ); + } - }); } - -}) \ No newline at end of file +) \ No newline at end of file diff --git a/frontend/web/js/script.js b/frontend/web/js/script.js index eebcd64..b067cfc 100755 --- a/frontend/web/js/script.js +++ b/frontend/web/js/script.js @@ -1,861 +1,1147 @@ -$(document).ready(function(){ - var checkscroll = []; - for(var ch=0;ch<2;ch++) { - checkscroll[checkscroll.length] = false; - } - contentHeight(); - resizeWindow(); - scrolling(); - menuBg(); - projectAllMenu(); - mapLoad(); - federationHome(); - //validationForms(); - //menuContent(); - jobClick(); - box15Height(); - formRezume(); - fileVal(); - newMenuMap(); - seeAllComm(); - gallerPage(); - selectAfter(); - tagPortfolio(); - seeAllProfile(); - featuresTags(); - inputNumber(); - videoFull(); - function resizeWindow(){ - $(window).resize(function(){ - contentHeight(); - }); - } - function contentHeight(){ - //прижимаем футер - var headerHeight = document.getElementsByClassName('section-box header'); - var menuHeight = document.getElementsByClassName('section-box menu-header-all'); - var contentHeight = document.getElementsByClassName('section-box content'); - var footerHeight = document.getElementsByClassName('section-box footer'); - $(contentHeight).css({minHeight:($(window).height())-($(footerHeight).height())-($(headerHeight).height())-($(menuHeight).height())}); - } - function scrolling(){ - //проверка браузера - var sUsrAg = navigator.userAgent; - if(sUsrAg.indexOf("Chrome") > -1) { - } else if (sUsrAg.indexOf("Safari") > -1) { - $('body').css({fontFamily:'arial'}); +$(document).ready( + function() + { + var checkscroll = []; + for(var ch = 0; ch < 2; ch++) + { + checkscroll[checkscroll.length] = false; } - var _browser = navigator.userAgent; - _browser = _browser.indexOf("WebKit"); - //scroll - var tempScrollTop = 0; - var currentScrollTop = 0; - - $(window).scroll(function(){ - if (_browser>=0) { - currentScrollTop = $('body').scrollTop(); - } else { - currentScrollTop = $('html').scrollTop(); - } - if (tempScrollTop < currentScrollTop ){ - if (currentScrollTop>=114) { - $('.menu-header-all').css({position:'fixed', zIndex:9990}); - $('.section-box.content').css({marginTop:41}); + contentHeight(); + resizeWindow(); + scrolling(); + menuBg(); + projectAllMenu(); + mapLoad(); + federationHome(); + //validationForms(); + //menuContent(); + jobClick(); + box15Height(); + formRezume(); + fileVal(); + newMenuMap(); + seeAllComm(); + gallerPage(); + selectAfter(); + tagPortfolio(); + seeAllProfile(); + featuresTags(); + inputNumber(); + videoFull(); + function resizeWindow() + { + $(window).resize( + function() + { + contentHeight(); } + ); + } - if($('.section-box-6').hasClass('section-box-6')) { - if (currentScrollTop>offsetSect6 && !checkscroll[0]) { - checkscroll[0]=true; - landingAnimation(); + function contentHeight() + { + //прижимаем футер + var headerHeight = document.getElementsByClassName('section-box header'); + var menuHeight = document.getElementsByClassName('section-box menu-header-all'); + var contentHeight = document.getElementsByClassName('section-box content'); + var footerHeight = document.getElementsByClassName('section-box footer'); + $(contentHeight).css({minHeight : ($(window).height()) - ($(footerHeight).height()) - ($(headerHeight).height()) - ($(menuHeight).height())}); + } + + function scrolling() + { + //проверка браузера + var sUsrAg = navigator.userAgent; + if(sUsrAg.indexOf("Chrome") > -1) + { + } else if(sUsrAg.indexOf("Safari") > -1) + { + $('body').css({fontFamily : 'arial'}); + } + var _browser = navigator.userAgent; + _browser = _browser.indexOf("WebKit"); + //scroll + var tempScrollTop = 0; + var currentScrollTop = 0; + + $(window).scroll( + function() + { + if(_browser >= 0) + { + currentScrollTop = $('body').scrollTop(); + } else + { + currentScrollTop = $('html').scrollTop(); } - } + if(tempScrollTop < currentScrollTop) + { + if(currentScrollTop >= 114) + { + $('.menu-header-all').css({position : 'fixed', zIndex : 9990}); + $('.section-box.content').css({marginTop : 41}); + } + + if($('.section-box-6').hasClass('section-box-6')) + { + if(currentScrollTop > offsetSect6 && !checkscroll[0]) + { + checkscroll[0] = true; + landingAnimation(); + } + } - if($('.section-box-8').hasClass('section-box-8')) { - if (currentScrollTop>offsetSect8 && !checkscroll[1]) { - checkscroll[1]=true; - landingAnimationWhyWork(); + if($('.section-box-8').hasClass('section-box-8')) + { + if(currentScrollTop > offsetSect8 && !checkscroll[1]) + { + checkscroll[1] = true; + landingAnimationWhyWork(); + } + if(currentScrollTop > (offsetSect8 + 300) && !checkscroll[2]) + { + checkscroll[2] = true; + landingAnimationWhyWorkTwo(); + + } + } } - if (currentScrollTop>(offsetSect8+300) && !checkscroll[2]) { - checkscroll[2]=true; - landingAnimationWhyWorkTwo(); + + else if(tempScrollTop > currentScrollTop) + { + //console.log('вверх'); + if(currentScrollTop <= 114) + { + $('.menu-header-all').css({position : 'relative'}); + $('.section-box.content').css({marginTop : 0}); + } } + tempScrollTop = currentScrollTop; } - } + ); + } - else if (tempScrollTop > currentScrollTop ){ - //console.log('вверх'); - if (currentScrollTop<=114) { - $('.menu-header-all').css({position:'relative'}); - $('.section-box.content').css({marginTop:0}); + function menuBg() + { + + var heightUlTwoMenu = $('ul.content-menu-first').height(); + $('.menu-two-wrapp').css({height : heightUlTwoMenu - 1}); + + $('ul.content-menu-first').hover( + function() + { + + }, function() + { + $('.content-menu-first li').css({backgroundColor : '#fff'}); } + ); + $('.content-menu-first li').hover( + function() + { + var dataMenuBg = $(this).find('span').attr('data-menu-bg'); + + $('.content-menu-first li').css({backgroundColor : '#fff'}); + $('.content-menu-first li a').css({color : '#333333'}); + + $(this).css({backgroundColor : dataMenuBg}).find('ul li').css({backgroundColor : dataMenuBg}); + $('.content-menu-first li >ul li').mouseover( + function() + { + $(this).parent().parent().css({backgroundColor : dataMenuBg}); + $('.content-menu-first li >ul li').css({backgroundColor : dataMenuBg}); + $('.content-menu-first li >ul li').removeClass('hov-arrow'); + $(this).addClass('hov-arrow'); + } + ) + }, function() + { + $('.hov-arrow').removeClass('hov-arrow'); + } + ); + var thirdUlMenu = $('ul.content-menu-first li ul li ul'); + thirdUlMenu.addClass('third-ul-menu'); + if(thirdUlMenu.hasClass('third-ul-menu')) + { + thirdUlMenu.parent().find('a').addClass('remove-link'); + $('.third-ul-menu li a').removeClass('remove-link'); + $('.remove-link').parent().addClass('yes-after'); + + var remLink = $('.remove-link'); + for(var ixx = 0; ixx < remLink.length; ixx++) + { + $(remLink[ixx]).html($(remLink[ixx]).text() + '
    ') + } } - tempScrollTop = currentScrollTop; - }); - } - function menuBg(){ - - var heightUlTwoMenu = $('ul.content-menu-first').height(); - $('.menu-two-wrapp').css({height:heightUlTwoMenu-1}); - - $('ul.content-menu-first').hover(function(){ - - },function(){ - $('.content-menu-first li').css({backgroundColor:'#fff'}); - }); - $('.content-menu-first li').hover(function(){ - var dataMenuBg = $(this).find('span').attr('data-menu-bg'); - - $('.content-menu-first li').css({backgroundColor:'#fff'}); - $('.content-menu-first li a').css({color:'#333333'}); - - $(this).css({backgroundColor:dataMenuBg}).find('ul li').css({backgroundColor:dataMenuBg}); - $('.content-menu-first li >ul li').mouseover(function(){ - $(this).parent().parent().css({backgroundColor:dataMenuBg}); - $('.content-menu-first li >ul li').css({backgroundColor:dataMenuBg}); - $('.content-menu-first li >ul li').removeClass('hov-arrow'); - $(this).addClass('hov-arrow'); - }) - - },function(){ - $('.hov-arrow').removeClass('hov-arrow'); - }); - var thirdUlMenu = $('ul.content-menu-first li ul li ul'); - thirdUlMenu.addClass('third-ul-menu'); - if( thirdUlMenu.hasClass('third-ul-menu') ) { - thirdUlMenu.parent().find('a').addClass('remove-link'); - $('.third-ul-menu li a').removeClass('remove-link'); - $('.remove-link').parent().addClass('yes-after'); - - var remLink = $('.remove-link'); - for (var ixx=0;ixx
') + $('ul.content-menu-first li ul li ul li ul').removeClass('third-ul-menu').addClass('last-ul-menu'); + var lastUlMenu = $('ul.content-menu-first li ul li ul li ul'); + if(lastUlMenu.hasClass('last-ul-menu')) + { + lastUlMenu.parent().find('a').addClass('remove-link-two'); + $('.remove-link-two').parent().addClass('yes-after yes-after-two'); + + var remLastLink = $('ul.content-menu-first li ul li ul li.yes-after-two ul'); + remLastLink.find('li').removeClass('yes-after yes-after-two'); + remLastLink.find('a').removeClass('.remove-link-two'); + + var remLinkT = $('.remove-link-two'); + $('.last-ul-menu .remove-link-two').removeClass('remove-link-two') + for(var ixx = 0; ixx < remLinkT.length; ixx++) + { + $(remLinkT[ixx]).html($(remLinkT[ixx]).text() + '
') + $('.last-ul-menu .hack-arrow').removeClass('hack-arrow') + } } + + $('ul.last-ul-menu').find('a').removeClass('remove-link-two'); + $('.remove-link, .remove-link-two').click( + function(e) + { + e.preventDefault(); + } + ); + + $('ul.content-menu-first > li').hover( + function() + { + var dataImgThis = $(this).attr('data-img'); + $('.menu-two-wrapp').css({backgroundImage : 'url(' + dataImgThis + ')'}) + } + ); } - $('ul.content-menu-first li ul li ul li ul').removeClass('third-ul-menu').addClass('last-ul-menu'); - var lastUlMenu = $('ul.content-menu-first li ul li ul li ul'); - if( lastUlMenu.hasClass('last-ul-menu') ) { - lastUlMenu.parent().find('a').addClass('remove-link-two'); - $('.remove-link-two').parent().addClass('yes-after yes-after-two'); - - var remLastLink = $('ul.content-menu-first li ul li ul li.yes-after-two ul'); - remLastLink.find('li').removeClass('yes-after yes-after-two'); - remLastLink.find('a').removeClass('.remove-link-two'); - - var remLinkT = $('.remove-link-two'); - $('.last-ul-menu .remove-link-two').removeClass('remove-link-two') - for (var ixx=0;ixx
') - $('.last-ul-menu .hack-arrow').removeClass('hack-arrow') - } + function newMenuMap() + { + $('.company-performer-map-menu .content-menu-first>li>ul').addClass('content-menu-map-first'); + $('.company-performer-map-menu .content-menu-first>li>ul>li').addClass('content-menu-map-second'); + $('.company-performer-map-menu .content-menu-first>li').addClass('old-content-menu-map-zero'); + $('.company-performer-map-menu .content-menu-map-first').parent().removeClass('old-content-menu-map-zero').addClass('content-menu-map-zero'); + $('.company-performer-map-menu .content-menu-map-zero').click( + function(e) + { + e.preventDefault(); + } + ); + $('.company-performer-map-menu .content-menu-map-second, .company-performer-map-menu .old-content-menu-map-zero').click( + function(e) + { + e.preventDefault() + $.post( + "maps/maps.php", function(data) + { + $("#map_cloud").empty(); + $("#map_cloud").append(data); + initialize(); + } + ); + } + ); } + function projectAllMenu() + { + $('.all-project-home-title_menu li').click( + function() + { + $('.all-project-home-title_menu li').removeClass('project-home-active') + $(this).addClass('project-home-active') + } + ) + } - $('ul.last-ul-menu').find('a').removeClass('remove-link-two'); - $('.remove-link, .remove-link-two').click(function(e){ - e.preventDefault(); - }); + function mapLoad() + { + $('.settings-map-ul ul li a').click( + function(e) + { + e.preventDefault(); + $('.settings-map-ul ul li a').removeClass('active') + $(this).addClass('active') + $.post( + "maps/maps.php", function(data) + { + $("#map_cloud").empty(); + $("#map_cloud").append(data); + initialize(); + } + ); + } + ); + } - $('ul.content-menu-first > li').hover(function(){ - var dataImgThis = $(this).attr('data-img'); - $('.menu-two-wrapp').css({backgroundImage:'url('+dataImgThis+')'}) - }); - } + mapLoadNewMenus() + function mapLoadNewMenus() + { + $('.all-project-home-title_menu ul li').click( + function() + { + $.post( + "maps/maps.php", function(data) + { + $("#map_cloud").empty(); + $("#map_cloud").append(data); + initialize(); + } + ); + } + ); + } - function newMenuMap(){ - $('.company-performer-map-menu .content-menu-first>li>ul').addClass('content-menu-map-first'); - $('.company-performer-map-menu .content-menu-first>li>ul>li').addClass('content-menu-map-second'); - $('.company-performer-map-menu .content-menu-first>li').addClass('old-content-menu-map-zero'); - $('.company-performer-map-menu .content-menu-map-first').parent().removeClass('old-content-menu-map-zero').addClass('content-menu-map-zero'); - $('.company-performer-map-menu .content-menu-map-zero').click(function(e){ - e.preventDefault(); - }); - $('.company-performer-map-menu .content-menu-map-second, .company-performer-map-menu .old-content-menu-map-zero').click(function(e){ - e.preventDefault() - $.post("maps/maps.php", function (data) { - $("#map_cloud").empty(); - $("#map_cloud").append(data); - initialize(); - }); - }); - } + function federationHome() + { + var menu_width = 0; + $('.federation-home-list li').each( + function() + { + menu_width = menu_width + $(this).outerWidth() + 9 + } + ); + $('.federation-home-list').css({width : menu_width}); + + $('.federation-home-list li').click( + function() + { + $('.federation-home-list li').removeClass('federation-home-list-active') + $(this).addClass('federation-home-list-active') + var fedTisIndex = $(this).index() + var fedBlocks = $('.federation-home-blocks-wr-blocks') + $(fedBlocks).css({display : 'none'}) + $(fedBlocks[fedTisIndex]).css({display : 'block'}) + } + ); + } - function projectAllMenu() { - $('.all-project-home-title_menu li').click(function(){ - $('.all-project-home-title_menu li').removeClass('project-home-active') - $(this).addClass('project-home-active') - }) - } + if($('.section-box-6').hasClass('section-box-6')) + { + var offsetSect6 = $('.section-box-6').offset().top; + offsetSect6 = offsetSect6 - ($(window).height() / 2); + } + $('.lan_yo_buis_txt, .lan_yo_buis_img, .lan_yo_buis_arr').css({opacity : 0}) + function landingAnimation() + { + + var animBlockLand = $('.landing-your-buisnes-blocks'); + var animBlockLandArrow = $('.lan_yo_buis_arr'); + $(animBlockLand[0]).css({transform : 'rotateY(0deg)'}).find('.lan_yo_buis_img ').css({transition : '2s', opacity : 1}); + $(animBlockLand[0]).find('.lan_yo_buis_txt').css({transition : '2s', opacity : 1}); + setTimeout( + function() + { + $(animBlockLand[1]).css({transform : 'rotateY(0deg)'}).find('.lan_yo_buis_img ').css({transition : '2s', opacity : 1}); + $(animBlockLand[1]).find('.lan_yo_buis_txt').css({transition : '2s', opacity : 1}); + }, 500 + ) + setTimeout( + function() + { + $(animBlockLand[2]).css({transform : 'rotateY(0deg)'}).find('.lan_yo_buis_img ').css({transition : '2s', opacity : 1}); + $(animBlockLand[2]).find('.lan_yo_buis_txt').css({transition : '2s', opacity : 1}); + }, 1000 + ) + setTimeout( + function() + { + $(animBlockLand[5]).css({transform : 'rotateY(0deg)'}).find('.lan_yo_buis_img ').css({transition : '2s', opacity : 1}); + $(animBlockLand[5]).find('.lan_yo_buis_txt').css({transition : '2s', opacity : 1}); + }, 1500 + ) + setTimeout( + function() + { + $(animBlockLand[4]).css({transform : 'rotateY(0deg)'}).find('.lan_yo_buis_img ').css({transition : '2s', opacity : 1}); + $(animBlockLand[4]).find('.lan_yo_buis_txt').css({transition : '2s', opacity : 1}); + }, 2000 + ) + setTimeout( + function() + { + $(animBlockLand[3]).css({transform : 'rotateY(0deg)'}).find('.lan_yo_buis_img ').css({transition : '2s', opacity : 1}); + $(animBlockLand[3]).find('.lan_yo_buis_txt').css({transition : '2s', opacity : 1}); + }, 2500 + ) + setTimeout( + function() + { + $(animBlockLandArrow[0]).css({transition : '1s', opacity : 1}); + }, 300 + ); + setTimeout( + function() + { + $(animBlockLandArrow[1]).css({transition : '1s', opacity : 1}); + }, 650 + ); + setTimeout( + function() + { + $(animBlockLandArrow[4]).css({transition : '1s', opacity : 1}); + }, 1300 + ); + setTimeout( + function() + { + $(animBlockLandArrow[2]).css({transition : '1s', opacity : 1}); + }, 1950 + ); + setTimeout( + function() + { + $(animBlockLandArrow[3]).css({transition : '1s', opacity : 1}); + }, 2600 + ); + } - function mapLoad(){ - $('.settings-map-ul ul li a').click(function (e) { - e.preventDefault(); - $('.settings-map-ul ul li a').removeClass('active') - $(this).addClass('active') - $.post("maps/maps.php", function (data) { - $("#map_cloud").empty(); - $("#map_cloud").append(data); - initialize(); - }); - }); - } - mapLoadNewMenus() - function mapLoadNewMenus(){ - $('.all-project-home-title_menu ul li').click(function () { - $.post("maps/maps.php", function (data) { - $("#map_cloud").empty(); - $("#map_cloud").append(data); - initialize(); - }); - }); - } + if($('.section-box-8').hasClass('section-box-8')) + { + var offsetSect8 = $('.section-box-8').offset().top; + offsetSect8 = offsetSect8 - (($(window).height()) - 264); + } + var whyWorkImg = $('.landing-work-our-img-text'); + var whyWorkText = $('.landing-work-our-img p'); + whyWorkImg.css({marginTop : 155, opacity : 0}); + whyWorkText.css({display : 'none'}); + + function landingAnimationWhyWork() + { + whyWorkImg.css({transition : '0.8s'}); + + $(whyWorkImg[0]).css({marginTop : 0, opacity : 1}); + $(whyWorkText[0]).delay(600).fadeIn(350); + + setTimeout( + function() + { + $(whyWorkImg[1]).css({marginTop : 0, opacity : 1}); + $(whyWorkText[1]).delay(600).fadeIn(350) + }, 250 + ); - function federationHome(){ - var menu_width = 0; - $('.federation-home-list li').each(function(){ menu_width = menu_width + $(this).outerWidth()+9 }); - $('.federation-home-list').css({width:menu_width}); - - $('.federation-home-list li').click(function(){ - $('.federation-home-list li').removeClass('federation-home-list-active') - $(this).addClass('federation-home-list-active') - var fedTisIndex = $(this).index() - var fedBlocks = $('.federation-home-blocks-wr-blocks') - $(fedBlocks).css({display:'none'}) - $(fedBlocks[fedTisIndex]).css({display:'block'}) - }); - } + setTimeout( + function() + { + $(whyWorkImg[2]).css({marginTop : 0, opacity : 1}); + $(whyWorkText[2]).delay(600).fadeIn(350) + }, 500 + ); + } - if($('.section-box-6').hasClass('section-box-6')) { - var offsetSect6 = $('.section-box-6').offset().top; - offsetSect6 = offsetSect6-($(window).height()/2); - } - $('.lan_yo_buis_txt, .lan_yo_buis_img, .lan_yo_buis_arr').css({opacity:0}) - function landingAnimation(){ - - var animBlockLand = $('.landing-your-buisnes-blocks'); - var animBlockLandArrow = $('.lan_yo_buis_arr'); - $(animBlockLand[0]).css({transform:'rotateY(0deg)'}).find('.lan_yo_buis_img ').css({transition:'2s', opacity:1}); - $(animBlockLand[0]).find('.lan_yo_buis_txt').css({transition:'2s', opacity:1}); - setTimeout(function(){ - $(animBlockLand[1]).css({transform:'rotateY(0deg)'}).find('.lan_yo_buis_img ').css({transition:'2s', opacity:1}); - $(animBlockLand[1]).find('.lan_yo_buis_txt').css({transition:'2s', opacity:1}); - },500) - setTimeout(function(){ - $(animBlockLand[2]).css({transform:'rotateY(0deg)'}).find('.lan_yo_buis_img ').css({transition:'2s', opacity:1}); - $(animBlockLand[2]).find('.lan_yo_buis_txt').css({transition:'2s', opacity:1}); - },1000) - setTimeout(function(){ - $(animBlockLand[5]).css({transform:'rotateY(0deg)'}).find('.lan_yo_buis_img ').css({transition:'2s', opacity:1}); - $(animBlockLand[5]).find('.lan_yo_buis_txt').css({transition:'2s', opacity:1}); - },1500) - setTimeout(function(){ - $(animBlockLand[4]).css({transform:'rotateY(0deg)'}).find('.lan_yo_buis_img ').css({transition:'2s', opacity:1}); - $(animBlockLand[4]).find('.lan_yo_buis_txt').css({transition:'2s', opacity:1}); - },2000) - setTimeout(function(){ - $(animBlockLand[3]).css({transform:'rotateY(0deg)'}).find('.lan_yo_buis_img ').css({transition:'2s', opacity:1}); - $(animBlockLand[3]).find('.lan_yo_buis_txt').css({transition:'2s', opacity:1}); - },2500) - setTimeout(function(){ - $(animBlockLandArrow[0]).css({transition:'1s', opacity:1}); - },300); - setTimeout(function(){ - $(animBlockLandArrow[1]).css({transition:'1s', opacity:1}); - },650); - setTimeout(function(){ - $(animBlockLandArrow[4]).css({transition:'1s', opacity:1}); - },1300); - setTimeout(function(){ - $(animBlockLandArrow[2]).css({transition:'1s', opacity:1}); - },1950); - setTimeout(function(){ - $(animBlockLandArrow[3]).css({transition:'1s', opacity:1}); - },2600); - } + function landingAnimationWhyWorkTwo() + { + $(whyWorkImg[3]).css({marginTop : 0, opacity : 1}); + $(whyWorkText[3]).delay(600).fadeIn(350); + + setTimeout( + function() + { + $(whyWorkImg[4]).css({marginTop : 0, opacity : 1}); + $(whyWorkText[4]).delay(600).fadeIn(350) + }, 250 + ); - if($('.section-box-8').hasClass('section-box-8')) { - var offsetSect8 = $('.section-box-8').offset().top; - offsetSect8 = offsetSect8-(($(window).height())-264); - } - var whyWorkImg = $('.landing-work-our-img-text'); - var whyWorkText = $('.landing-work-our-img p'); - whyWorkImg.css({marginTop:155, opacity:0}); - whyWorkText.css({display:'none'}); - - function landingAnimationWhyWork(){ - whyWorkImg.css({transition:'0.8s'}); - - $(whyWorkImg[0]).css({marginTop:0, opacity:1}); - $(whyWorkText[0]).delay(600).fadeIn(350); - - setTimeout(function(){ - $(whyWorkImg[1]).css({marginTop:0, opacity:1}); - $(whyWorkText[1]).delay(600).fadeIn(350) - },250); - - setTimeout(function(){ - $(whyWorkImg[2]).css({marginTop:0, opacity:1}); - $(whyWorkText[2]).delay(600).fadeIn(350) - },500); - } + setTimeout( + function() + { + $(whyWorkImg[5]).css({marginTop : 0, opacity : 1}); + $(whyWorkText[5]).delay(600).fadeIn(350) + }, 500 + ); + } - function landingAnimationWhyWorkTwo(){ - $(whyWorkImg[3]).css({marginTop:0, opacity:1}); - $(whyWorkText[3]).delay(600).fadeIn(350); + // function validationForms(){ + // var jVal_two = { + // + // 'comments' : function() { + // var ele = $('#comments_two'); + // if(ele.val().length < 6) { + // jVal_two.errors = true; + // ele.removeClass('normal').addClass('wrong'); + // } else { + // ele.removeClass('wrong').addClass('normal'); + // } + // }, + // 'phone' : function (){ + // var ele = $('#phone_two'); + // var patt = /[0-9]/g; + // if(!patt.test(ele.val())) { + // jVal_two.errors = true; + // ele.removeClass('normal').addClass('wrong'); + // } else { + // ele.removeClass('wrong').addClass('normal'); + // } + // }, + // + // 'email' : function() { + // var ele = $('#email_two'); + // var patt = /^.+@.+[.].{2,}$/i; + // if(!patt.test(ele.val())) { + // jVal_two.errors = true; + // ele.removeClass('normal').addClass('wrong'); + // } else { + // ele.removeClass('wrong').addClass('normal'); + // } + // }, + // + // 'sendIt' : function (){ + // if(!jVal_two.errors) { + // $('.form-questions').submit(); + // } + // } + // }; + //// ====================================================== // + // $('#send_two').click(function (){ + // var obj = $('body, html'); + // obj.animate({ scrollTop: $('.form-questions').offset().top-151 }, 750, function (){ + // jVal_two.errors = false; + // jVal_two.comments(); + // jVal_two.phone(); + // jVal_two.email(); + // jVal_two.sendIt(); + // }); + // return false; + // }); + // + // $('#comments_two').focusout(function(){ + // jVal_two.comments(); + // }); + // $('#phone_two').focusout(function(){ + // jVal_two.phone(); + // }); + // $('#email_two').focusout(function(){ + // jVal_two.email(); + // }); + // + // var jVal_cb = { + // + // 'cbName' : function() { + // var ele = $('#callbac_name'); + // if(ele.val().length < 2) { + // jVal_cb.errors = true; + // ele.removeClass('normal').addClass('wrong'); + // } else { + // ele.removeClass('wrong').addClass('normal'); + // } + // }, + // 'cbPhone' : function (){ + // var ele = $('#callbac_phone'); + // var patt = /[0-9]/g; + // if(!patt.test(ele.val())) { + // jVal_cb.errors = true; + // ele.removeClass('normal').addClass('wrong'); + // } else { + // ele.removeClass('wrong').addClass('normal'); + // } + // }, + // 'cbSendIt' : function (){ + // if(!jVal_cb.errors) { + // $('.callback').submit(); + // } + // } + // }; + //// ====================================================== // + // $('#callbac_submit').click(function (){ + // var obj = $('body, html'); + // obj.animate({ scrollTop: $('.callback').offset().top-151 }, 750, function (){ + // jVal_cb.errors = false; + // jVal_cb.cbName(); + // jVal_cb.cbPhone(); + // jVal_cb.cbSendIt(); + // }); + // return false; + // }); + // $('#callbac_name').focusout(function(){ + // jVal_cb.cbName(); + // }); + // $('#callbac_phone').focusout(function(){ + // jVal_cb.cbPhone(); + // }); + // + // var jVal_res = { + // 'resNsme' : function() { + // var ele = $('#res_name'); + // if(ele.val().length < 2) { + // jVal_res.errors = true; + // ele.removeClass('normal').addClass('wrong'); + // } else { + // ele.removeClass('wrong').addClass('normal'); + // } + // }, + // 'resPhone' : function (){ + // var ele = $('#res_phone'); + // var patt = /[0-9]/g; + // if(!patt.test(ele.val())) { + // jVal_res.errors = true; + // ele.removeClass('normal').addClass('wrong'); + // } else { + // ele.removeClass('wrong').addClass('normal'); + // } + // }, + // 'resComm' : function() { + // var ele = $('#res_text'); + // if(ele.val().length < 6) { + // jVal_res.errors = true; + // ele.removeClass('normal').addClass('wrong'); + // } else { + // ele.removeClass('wrong').addClass('normal'); + // } + // }, + // 'resSendIt' : function (){ + // if(!jVal_res.errors) { + // $('.resforms').submit(); + // } + // } + // }; + //// ====================================================== // + // $('#res_submit').click(function (){ + // jVal_res.errors = false; + // jVal_res.resNsme(); + // jVal_res.resPhone(); + // jVal_res.resComm(); + // jVal_res.resSendIt(); + // return false; + // }); + // + // $('#res_name').focusout(function(){ + // jVal_res.resNsme(); + // }); + // $('#res_phone').focusout(function(){ + // jVal_res.resPhone(); + // }); + // $('#res_text').focusout(function(){ + // jVal_res.resComm(); + // }); + // } + + //function menuContent(){ + // $('.menu-content li a').click(function(e){ + // e.preventDefault() + // $('.menu-content li').removeClass('active-menu-content') + // $(this).parent().addClass('active-menu-content') + // }); + //} + + function jobClick() + { + + var container = $('.search-worker-sort-wr'); + var sort = $(container).find('.activejob a[data-sort-name]').data('sort-name'); + var active = $(container).find('ul.sorter a[data-sort=' + sort + ']').clone(); + $(container).find('.activejob a[data-sort-name]').replaceWith(active); + + $('.activejob>a').click( + function(e) + { + e.preventDefault(); + } + ); - setTimeout(function(){ - $(whyWorkImg[4]).css({marginTop:0, opacity:1}); - $(whyWorkText[4]).delay(600).fadeIn(350) - },250); + $('.activejob a').click( + function(e) + { + $('.sidebar-droped-wr').toggleClass('act') + $('.performance-vacancy-sidebar-company-job>ul').addClass('active-dropped-ul') + if(!($('.sidebar-droped-wr').hasClass('act'))) + { + $('.performance-vacancy-sidebar-company-job>ul').removeClass('active-dropped-ul') + } + } + ); - setTimeout(function(){ - $(whyWorkImg[5]).css({marginTop:0, opacity:1}); - $(whyWorkText[5]).delay(600).fadeIn(350) - },500); - } + $('.sidebar-droped-wr li').click( + function() + { + if($('.sidebar-droped-wr').hasClass('act')) + { + $('.sidebar-droped-wr').removeClass('act') + } + $('.performance-vacancy-sidebar-company-job>ul').removeClass('active-dropped-ul') + $('.sidebar-droped-wr li').css({display : 'block'}) + $(this).css({display : 'none'}) + var thisTxtSidebar = $(this).text() + $('.activejob>a').text(thisTxtSidebar); + } + ); + } -// function validationForms(){ -// var jVal_two = { -// -// 'comments' : function() { -// var ele = $('#comments_two'); -// if(ele.val().length < 6) { -// jVal_two.errors = true; -// ele.removeClass('normal').addClass('wrong'); -// } else { -// ele.removeClass('wrong').addClass('normal'); -// } -// }, -// 'phone' : function (){ -// var ele = $('#phone_two'); -// var patt = /[0-9]/g; -// if(!patt.test(ele.val())) { -// jVal_two.errors = true; -// ele.removeClass('normal').addClass('wrong'); -// } else { -// ele.removeClass('wrong').addClass('normal'); -// } -// }, -// -// 'email' : function() { -// var ele = $('#email_two'); -// var patt = /^.+@.+[.].{2,}$/i; -// if(!patt.test(ele.val())) { -// jVal_two.errors = true; -// ele.removeClass('normal').addClass('wrong'); -// } else { -// ele.removeClass('wrong').addClass('normal'); -// } -// }, -// -// 'sendIt' : function (){ -// if(!jVal_two.errors) { -// $('.form-questions').submit(); -// } -// } -// }; -//// ====================================================== // -// $('#send_two').click(function (){ -// var obj = $('body, html'); -// obj.animate({ scrollTop: $('.form-questions').offset().top-151 }, 750, function (){ -// jVal_two.errors = false; -// jVal_two.comments(); -// jVal_two.phone(); -// jVal_two.email(); -// jVal_two.sendIt(); -// }); -// return false; -// }); -// -// $('#comments_two').focusout(function(){ -// jVal_two.comments(); -// }); -// $('#phone_two').focusout(function(){ -// jVal_two.phone(); -// }); -// $('#email_two').focusout(function(){ -// jVal_two.email(); -// }); -// -// var jVal_cb = { -// -// 'cbName' : function() { -// var ele = $('#callbac_name'); -// if(ele.val().length < 2) { -// jVal_cb.errors = true; -// ele.removeClass('normal').addClass('wrong'); -// } else { -// ele.removeClass('wrong').addClass('normal'); -// } -// }, -// 'cbPhone' : function (){ -// var ele = $('#callbac_phone'); -// var patt = /[0-9]/g; -// if(!patt.test(ele.val())) { -// jVal_cb.errors = true; -// ele.removeClass('normal').addClass('wrong'); -// } else { -// ele.removeClass('wrong').addClass('normal'); -// } -// }, -// 'cbSendIt' : function (){ -// if(!jVal_cb.errors) { -// $('.callback').submit(); -// } -// } -// }; -//// ====================================================== // -// $('#callbac_submit').click(function (){ -// var obj = $('body, html'); -// obj.animate({ scrollTop: $('.callback').offset().top-151 }, 750, function (){ -// jVal_cb.errors = false; -// jVal_cb.cbName(); -// jVal_cb.cbPhone(); -// jVal_cb.cbSendIt(); -// }); -// return false; -// }); -// $('#callbac_name').focusout(function(){ -// jVal_cb.cbName(); -// }); -// $('#callbac_phone').focusout(function(){ -// jVal_cb.cbPhone(); -// }); -// -// var jVal_res = { -// 'resNsme' : function() { -// var ele = $('#res_name'); -// if(ele.val().length < 2) { -// jVal_res.errors = true; -// ele.removeClass('normal').addClass('wrong'); -// } else { -// ele.removeClass('wrong').addClass('normal'); -// } -// }, -// 'resPhone' : function (){ -// var ele = $('#res_phone'); -// var patt = /[0-9]/g; -// if(!patt.test(ele.val())) { -// jVal_res.errors = true; -// ele.removeClass('normal').addClass('wrong'); -// } else { -// ele.removeClass('wrong').addClass('normal'); -// } -// }, -// 'resComm' : function() { -// var ele = $('#res_text'); -// if(ele.val().length < 6) { -// jVal_res.errors = true; -// ele.removeClass('normal').addClass('wrong'); -// } else { -// ele.removeClass('wrong').addClass('normal'); -// } -// }, -// 'resSendIt' : function (){ -// if(!jVal_res.errors) { -// $('.resforms').submit(); -// } -// } -// }; -//// ====================================================== // -// $('#res_submit').click(function (){ -// jVal_res.errors = false; -// jVal_res.resNsme(); -// jVal_res.resPhone(); -// jVal_res.resComm(); -// jVal_res.resSendIt(); -// return false; -// }); -// -// $('#res_name').focusout(function(){ -// jVal_res.resNsme(); -// }); -// $('#res_phone').focusout(function(){ -// jVal_res.resPhone(); -// }); -// $('#res_text').focusout(function(){ -// jVal_res.resComm(); -// }); -// } - - //function menuContent(){ - // $('.menu-content li a').click(function(e){ - // e.preventDefault() - // $('.menu-content li').removeClass('active-menu-content') - // $(this).parent().addClass('active-menu-content') - // }); - //} - - function jobClick(){ - - var container = $('.search-worker-sort-wr'); - var sort = $(container).find('.activejob a[data-sort-name]').data('sort-name'); - var active = $(container).find('ul.sorter a[data-sort='+sort+']').clone(); - $(container).find('.activejob a[data-sort-name]').replaceWith(active); - - $('.activejob>a').click(function(e) { - e.preventDefault(); - }); - - $('.activejob a').click(function(e){ - $('.sidebar-droped-wr').toggleClass('act') - $('.performance-vacancy-sidebar-company-job>ul').addClass('active-dropped-ul') - if( !($('.sidebar-droped-wr').hasClass('act')) ) { - $('.performance-vacancy-sidebar-company-job>ul').removeClass('active-dropped-ul') - } - }); + function box15Height() + { + $('.section-box-15').css({minHeight : ($('.performer-vacancy-sidebar-views ul').height() - 50)}) + $('.section-box-17').css({minHeight : ($('.performer-vacancy-sidebar-left').height()) - 164}) + } - $('.sidebar-droped-wr li').click(function(){ - if( $('.sidebar-droped-wr').hasClass('act') ) { - $('.sidebar-droped-wr').removeClass('act') - } - $('.performance-vacancy-sidebar-company-job>ul').removeClass('active-dropped-ul') - $('.sidebar-droped-wr li').css({display:'block'}) - $(this).css({display:'none'}) - var thisTxtSidebar = $(this).text() - $('.activejob>a').text(thisTxtSidebar); - }); - } - function box15Height(){ - $('.section-box-15').css({minHeight:($('.performer-vacancy-sidebar-views ul').height()-50) }) - $('.section-box-17').css({minHeight:($('.performer-vacancy-sidebar-left').height())-164 }) - } + function formRezume() + { + $('.performance-vacancy-desc-form a').click( + function(e) + { + e.preventDefault(); + $('#overlay').fadeIn( + 400, function() + { + $('#modal_form') + .css('display', 'block') + .animate({opacity : 1, top : '50%'}, 200); + } + ); + } + ); - function formRezume(){ - $('.performance-vacancy-desc-form a').click(function(e){ - e.preventDefault(); - $('#overlay').fadeIn(400, - function(){ + $('.closed-form, #overlay').on( + 'click', function() + { $('#modal_form') - .css('display', 'block') - .animate({opacity: 1, top: '50%'}, 200); - }); - }); - - $('.closed-form, #overlay').on('click', function(){ - $('#modal_form') - .animate({opacity: 0, top: '30%'}, 200, - function(){ - $(this).css('display', 'none'); - $('#overlay').fadeOut(400); + .animate( + {opacity : 0, top : '30%'}, 200, function() + { + $(this).css('display', 'none'); + $('#overlay').fadeOut(400); + } + ); } ); - }); - } - function fileVal(){ - $('#res_file').change(function(){ - var fileVal = $(this).val(); - if(fileVal.indexOf('C:\\fakepath\\')+1) - fileVal = fileVal.substr(12); - var e = $(this).next().find('.fake_file_input'); - e.val(t); - $('.res-wrapper-mb p').text(fileVal) - }); - $('.label-file a').click(function(e){ - e.preventDefault() - }) - } - fileValMulti(); - function fileValMulti(){ - $('.tender-file-wr input[type="file"]').change(function(){ - $('.max-size').css({marginTop:20}) - }) - if($('.tender-file-wr input[type="file"]').val==0) { - alert('fdg') - } - var txtMulti = $('.MultiFile-title').text() - $('.tender-file-wr a').click(function(e){ - e.preventDefault() - }) - } - $('.tender-form-buttons-wr a').click(function(e){ - e.preventDefault() - window.location.reload() - }) - - - function seeAllComm(){ - var comNum = $('.company-performer-comments-bl').length; - var strComm = document.getElementsByClassName('company-performer-comments-txt'); - for(var azz=0; azz
') - } - - function tagPortfolio(){ - $('.portfolio-project-tags a').click(function(){ - $('.portfolio-project-tags a').removeClass('active-tag') - $(this).addClass('active-tag') - }) - $('.portfolio-project-tags a.active-tag').click(function(e){ - e.preventDefault(); - }) - } - function seeAllProfile() { - $('.proektant-profile-hidden-txt').css({height:306}); - var txtLenght = $('.proektant-profile-hidden-txt p').text().length; - - var profileSee = $('.profile-see-all'); - var expand = 'Развернуть'; - var rolUp = 'Свернуть'; - if(txtLenght>=1000) { - profileSee.text(expand).css({display:'block'}) - profileSee.click(function(e){ + $('.tender-form-buttons-wr a').click( + function(e) + { e.preventDefault() - $(this).toggleClass('profile-txt-big'); - if($(this).hasClass('profile-txt-big')) { - $(this).text(rolUp) - $('.proektant-profile-hidden-txt').css({height:'auto'}) - } else { - $(this).text(expand); - $('.proektant-profile-hidden-txt').css({height:306}) - } - }) - } - } - - function featuresTags(){ - - if($('.features-tags-profile').hasClass('features-tags-profile')) { - var replaceLast = $('.features-tags span:last-child').html() - var newReplaceLast = replaceLast.replace(/,(?![^,]*,)/m, '') - $('.features-tags span:last-child').empty().html(newReplaceLast) - - var featuresTags = $('.features-tags span') - var featuresTagsLangth = featuresTags.length - var featuresTagsLeft = featuresTagsLangth-6 - featuresTagsDisplay() - function featuresTagsDisplay(){ - for(var i = 6; i<=featuresTagsLangth+1; i++) { - $(featuresTags[i]).addClass('features-tags-display') + window.location.reload() + } + ) + + function seeAllComm() + { + var comNum = $('.company-performer-comments-bl').length; + var strComm = document.getElementsByClassName('company-performer-comments-txt'); + for(var azz = 0; azz < comNum; azz++) + { + var comLenght = ($(strComm[azz]).text().length); + if(comLenght < 220) + { + $(strComm[azz]).next().css({display : 'none'}) } } - $(featuresTags[6]).after('еще '+ featuresTagsLeft +'') - $('.features-tags-left').click(function(e){ - e.preventDefault() - featuresTags.removeClass('features-tags-display') - $('.features-tags-left').remove() - }) + $('.company-comm-see-all').click( + function(e) + { + e.preventDefault(); + var expandFirst = $(this).prev(); + expandFirst.toggleClass('auto-height-blog-post'); + $(this).toggleClass('company-comm-expand'); + var expand = 'Развернуть'; + var rolUp = 'Свернуть'; + var seeAllBlogSpan = $(this).find('span'); + if(expandFirst.hasClass('auto-height-blog-post')) + { + seeAllBlogSpan.text(rolUp); + } else + { + seeAllBlogSpan.text(expand) + } + } + ) } - if($('.features-tags-company').hasClass('features-tags-company')) { - var replaceLastTwo = $('.features-tags-company'); - - for(var i=0; iеще '+ repLenghtLeftTwo +'') - for(var iq = 6; iq<=repLenghtLenTwo+1; iq++) { - $(repLenghtTwo[iq]).addClass('features-tags-display') + function gallerPage() + { + var galBlocks = $('.gallery-box'); + for(var i = 1; i < galBlocks.length; i++) + { + if(!(i % 4)) + { + $(galBlocks[i - 1]).css({marginLeft : 34}) } - } + } - $('.features-tags-left').click(function(e){ - e.preventDefault() - var newClickTags = $(this).parent().parent().parent().parent(); - newClickTags.find('.features-tags-left').remove(); - newClickTags.find('.features-tags-display').removeClass('features-tags-display') - }) + function selectAfter() + { + $('.search-work-form select').after('
') } - } - function include(url) { - var script = document.createElement('script'); - script.src = url; - document.getElementsByTagName('head')[0].appendChild(script); - } - include("/js/forms.js"); - include("/js/jmousewhell.js"); - include("/js/jscroll.js"); - - function inputNumber(){ - $('.form-price-wr input').keypress(function(e) { - if (!(e.which==8 ||(e.which>47 && e.which<58))) return false; - }); - } + function tagPortfolio() + { + $('.portfolio-project-tags a').click( + function() + { + $('.portfolio-project-tags a').removeClass('active-tag') + $(this).addClass('active-tag') + } + ) - $('.min_markers li').click(function(){ - $('.min_markers li').removeClass('active_m'); - $(this).addClass('active_m'); - $('.min_markers_two li').removeClass('active_m'); - }); - $('.min_markers_two li').click(function(){ - $('.min_markers li').removeClass('active_m'); - $('.min_markers_two li').removeClass('active_m'); - $(this).addClass('active_m'); - }) -//подгрузка карты - $('.min_markers li, .min_markers_two li').click(function () { - $.post("maps/maps-all-markers.php", function (data) { - $("#map_cloud").empty(); - $("#map_cloud").append(data); - initialize(); - $('#demo5 ul').empty(); - var slider_append = $('.slider_for_maps').children(); - $('#demo5 ul').append(slider_append) - }); - }); - messagePage(); - function messagePage(){ - $(".input_file").change(function(){ - var filename = $(".input_file").val().replace(/.+[\\\/]/, ""); - if (filename == ""){var filename = "Максимальный размер файла 5 МБ";} - $(".input_file_text").text(filename); - }); - if($('.comments_block').hasClass('comments_block')) { - $(function(){ - $('.comments_block').jScrollPane({showArrows: true, scrollbarWidth: 20, arrowSize: 20}); - }); + $('.portfolio-project-tags a.active-tag').click( + function(e) + { + e.preventDefault(); + } + ) } - } - $('.main-menu').hover(function(){ - $('select').blur() - }) + function seeAllProfile() + { + $('.proektant-profile-hidden-txt').css({height : 306}); + var txtLenght = $('.proektant-profile-hidden-txt p').text().length; - if($('.section-box-tender-tags-wr').hasClass('section-box-tender-tags-wr')) { - var lastTagTender = $('.section-box-tender-tags span') - var lastTagTenderLenght = lastTagTender.length - var lastTagTenderHtml = $(lastTagTender[lastTagTenderLenght-1]).html() - $(lastTagTender[lastTagTenderLenght-1]).empty().html(lastTagTenderHtml.replace(/,(?![^,]*,)/m, '.')) - } + var profileSee = $('.profile-see-all'); + var expand = 'Развернуть'; + var rolUp = 'Свернуть'; + if(txtLenght >= 1000) + { + profileSee.text(expand).css({display : 'block'}) + profileSee.click( + function(e) + { + e.preventDefault() + $(this).toggleClass('profile-txt-big'); + if($(this).hasClass('profile-txt-big')) + { + $(this).text(rolUp) + $('.proektant-profile-hidden-txt').css({height : 'auto'}) + } else + { + $(this).text(expand); + $('.proektant-profile-hidden-txt').css({height : 306}) + } + } + ) + } + } + + function featuresTags() + { + + if($('.features-tags-profile').hasClass('features-tags-profile')) + { + var replaceLast = $('.features-tags span:last-child').html() + var newReplaceLast = replaceLast.replace(/,(?![^,]*,)/m, '') + $('.features-tags span:last-child').empty().html(newReplaceLast) + + var featuresTags = $('.features-tags span') + var featuresTagsLangth = featuresTags.length + var featuresTagsLeft = featuresTagsLangth - 6 + featuresTagsDisplay() + function featuresTagsDisplay() + { + for(var i = 6; i <= featuresTagsLangth + 1; i++) + { + $(featuresTags[i]).addClass('features-tags-display') + } + } - var jVal_res_f = { + $(featuresTags[6]).after('еще ' + featuresTagsLeft + '') - 'resComm' : function() { - var ele = $('#res_f_text'); - if(ele.val().length < 2) { - jVal_res_f.errors = true; - ele.removeClass('normal').addClass('wrong'); - } else { - ele.removeClass('wrong').addClass('normal'); + $('.features-tags-left').click( + function(e) + { + e.preventDefault() + featuresTags.removeClass('features-tags-display') + $('.features-tags-left').remove() + } + ) } - }, - 'resSendItF' : function (){ - if(!jVal_res_f.errors) { - $('.resformsfile').submit(); + if($('.features-tags-company').hasClass('features-tags-company')) + { + var replaceLastTwo = $('.features-tags-company'); + + for(var i = 0; i < replaceLastTwo.length; i++) + { + var repTwo = $(replaceLastTwo[i]).find('span:last-child').html() + $(replaceLastTwo[i]).find('span:last-child').empty().html(repTwo.replace(/,(?![^,]*,)/m, '')) + var repLenghtTwo = $(replaceLastTwo[i]).find('span') + var repLenghtLenTwo = repLenghtTwo.length + var repLenghtLeftTwo = repLenghtLenTwo - 6 + + $(repLenghtTwo[6 - 1]).after('еще ' + repLenghtLeftTwo + '') + + for(var iq = 6; iq <= repLenghtLenTwo + 1; iq++) + { + $(repLenghtTwo[iq]).addClass('features-tags-display') + } + + } + + $('.features-tags-left').click( + function(e) + { + e.preventDefault() + var newClickTags = $(this).parent().parent().parent().parent(); + newClickTags.find('.features-tags-left').remove(); + newClickTags.find('.features-tags-display').removeClass('features-tags-display') + } + ) } } - }; -// ====================================================== // - $('#res_f_submit').click(function (){ - jVal_res_f.errors = false; - jVal_res_f.resComm(); - jVal_res_f.resSendItF(); - return false; - }); - $('#res_f_submit2').click(function (){ - jVal_res_f.errors = false; - jVal_res_f.resComm(); - jVal_res_f.resSendItF(); - return false; - }); - - $('#res_f_text').focusout(function(){ - jVal_res_f.resComm(); - }); - - var video_slider = $('.video-slider li').length; - $('.video-slider ul').css({width:(video_slider*220)-20}) - - function videoFull(){ - if($('.scroll-img').hasClass('video-slider')) { - $("body").append('
'); - $('.video-slider ul li').click(function(e){ - $('.video-full').append('
') - e.preventDefault() - $('#overlay').fadeIn(400, - function(){ - $('.video-full') - .css('display', 'block') - .animate({opacity: 1, top: '50%'}, 200); - }); - - var thisIframe = $(this).find('.iframe-video').html(); - - $('.video-full').append('
') - $('.video-full-iframe').append(thisIframe) - var iframeSrc = $('.video-full-iframe iframe').attr('src') - iframeSrc = iframeSrc.replace('showinfo=0','showinfo=1') - $('.video-full-iframe').empty() - $('.video-full-iframe').append('') - - $('.closed-form, #overlay').on('click', function(){ - $('#overlay').fadeOut(400) - $('.video-full') - .animate({opacity: 0, top: '30%'}, 200, - function(){ - $(this).css('display', 'none'); - $(this).empty(); - } - ); - }); - }) - } - } + function include(url) + { + var script = document.createElement('script'); + script.src = url; + document.getElementsByTagName('head')[0].appendChild(script); + } + include("/js/forms.js"); + include("/js/jmousewhell.js"); + include("/js/jscroll.js"); + + function inputNumber() + { + $('.form-price-wr input').keypress( + function(e) + { + if(!(e.which == 8 || (e.which > 47 && e.which < 58))) + { + return false; + } + } + ); + } - $('.search-list span').click(function(){ - if($('.search-ul').hasClass('active')) { - $('.search-list ul').removeClass('active'); - $('.search-main-menu form input').focus() - } else { - $('.search-list ul').addClass('active'); + $('.min_markers li').click( + function() + { + $('.min_markers li').removeClass('active_m'); + $(this).addClass('active_m'); + $('.min_markers_two li').removeClass('active_m'); + } + ); + $('.min_markers_two li').click( + function() + { + $('.min_markers li').removeClass('active_m'); + $('.min_markers_two li').removeClass('active_m'); + $(this).addClass('active_m'); + } + ) + //подгрузка карты + $('.min_markers li, .min_markers_two li').click( + function() + { + $.post( + "maps/maps-all-markers.php", function(data) + { + $("#map_cloud").empty(); + $("#map_cloud").append(data); + initialize(); + $('#demo5 ul').empty(); + var slider_append = $('.slider_for_maps').children(); + $('#demo5 ul').append(slider_append) + } + ); + } + ); + messagePage(); + function messagePage() + { + $(".input_file").change( + function() + { + var filename = $(".input_file").val().replace(/.+[\\\/]/, ""); + if(filename == "") + { + var filename = "Максимальный размер файла 5 МБ"; + } + $(".input_file_text").text(filename); + } + ); + if($('.comments_block').hasClass('comments_block')) + { + $( + function() + { + $('.comments_block').jScrollPane({showArrows : true, scrollbarWidth : 20, arrowSize : 20}); + } + ); + } + } + $('.main-menu').hover( + function() + { + $('select').blur() } - $('.search-list ul.active li').click(function(){ - $('.search-list ul').removeClass('active'); - $('.search-list span').html($(this).text()) - var searchListIndex = $(this).index() - searchListIndex = searchListIndex+1 - $('.search-main-menu form input[type="hidden"]').val(searchListIndex) - $('.search-main-menu form input').focus() - }) + ) + + if($('.section-box-tender-tags-wr').hasClass('section-box-tender-tags-wr')) + { + var lastTagTender = $('.section-box-tender-tags span') + var lastTagTenderLenght = lastTagTender.length + var lastTagTenderHtml = $(lastTagTender[lastTagTenderLenght - 1]).html() + $(lastTagTender[lastTagTenderLenght - 1]).empty().html(lastTagTenderHtml.replace(/,(?![^,]*,)/m, '.')) + } + var jVal_res_f = { + + 'resComm' : function() + { + var ele = $('#res_f_text'); + if(ele.val().length < 2) + { + jVal_res_f.errors = true; + ele.removeClass('normal').addClass('wrong'); + } else + { + ele.removeClass('wrong').addClass('normal'); + } + }, 'resSendItF' : function() + { + if(!jVal_res_f.errors) + { + $('.resformsfile').submit(); + } + } + }; + // ====================================================== // + $('#res_f_submit').click( + function() + { + jVal_res_f.errors = false; + jVal_res_f.resComm(); + jVal_res_f.resSendItF(); + return false; + } + ); + $('#res_f_submit2').click( + function() + { + jVal_res_f.errors = false; + jVal_res_f.resComm(); + jVal_res_f.resSendItF(); + return false; + } + ); + $('#res_f_text').focusout( + function() + { + jVal_res_f.resComm(); + } + ); + + var video_slider = $('.video-slider li').length; + $('.video-slider ul').css({width : (video_slider * 220) - 20}) + + function videoFull() + { + if($('.scroll-img').hasClass('video-slider')) + { + $("body").append('
'); + $('.video-slider ul li').click( + function(e) + { + $('.video-full').append('
') + e.preventDefault() + $('#overlay').fadeIn( + 400, function() + { + $('.video-full') + .css('display', 'block') + .animate({opacity : 1, top : '50%'}, 200); + } + ); + + var thisIframe = $(this).find('.iframe-video').html(); + + $('.video-full').append('
') + $('.video-full-iframe').append(thisIframe) + var iframeSrc = $('.video-full-iframe iframe').attr('src') + iframeSrc = iframeSrc.replace('showinfo=0', 'showinfo=1') + $('.video-full-iframe').empty() + $('.video-full-iframe').append('') + + $('.closed-form, #overlay').on( + 'click', function() + { + $('#overlay').fadeOut(400) + $('.video-full') + .animate( + {opacity : 0, top : '30%'}, 200, function() + { + $(this).css('display', 'none'); + $(this).empty(); + } + ); + } + ); + } + ) + } + } - }) + $('.search-list span').click( + function() + { + if($('.search-ul').hasClass('active')) + { + $('.search-list ul').removeClass('active'); + $('.search-main-menu form input').focus() + } else + { + $('.search-list ul').addClass('active'); + } + $('.search-list ul.active li').click( + function() + { + $('.search-list ul').removeClass('active'); + $('.search-list span').html($(this).text()) + var searchListIndex = $(this).index() + searchListIndex = searchListIndex + 1 + $('.search-main-menu form input[type="hidden"]').val(searchListIndex) + $('.search-main-menu form input').focus() + } + ) + } + ) -}); \ No newline at end of file + } +); \ No newline at end of file -- libgit2 0.21.4