Commit 6d34dbf16ffc30fdcdadaea68cc6cc5e91b9229d

Authored by Виталий
1 parent b70239a0

tokar commit

frontend/assets/AppAsset.php
@@ -22,6 +22,7 @@ class AppAsset extends AssetBundle @@ -22,6 +22,7 @@ class AppAsset extends AssetBundle
22 'https://fonts.googleapis.com/css?family=Roboto:400,700&subset=cyrillic,latin', 22 'https://fonts.googleapis.com/css?family=Roboto:400,700&subset=cyrillic,latin',
23 ]; 23 ];
24 public $js = [ 24 public $js = [
  25 + 'http://code.jquery.com/jquery-2.1.4.min.js',
25 '/js/script.js', 26 '/js/script.js',
26 //'http://maps.google.com/maps/api/js?sensor=false', 27 //'http://maps.google.com/maps/api/js?sensor=false',
27 '/js/markerclusterer.js', 28 '/js/markerclusterer.js',
@@ -33,11 +34,10 @@ class AppAsset extends AssetBundle @@ -33,11 +34,10 @@ class AppAsset extends AssetBundle
33 '/js/autoresize.jquery.js', 34 '/js/autoresize.jquery.js',
34 '/js/jquery.MultiFile.js', 35 '/js/jquery.MultiFile.js',
35 '/js/myGallery_min.js', 36 '/js/myGallery_min.js',
36 -// '/js/forms.js',  
37 'js/fieldWidget.js' 37 'js/fieldWidget.js'
38 ]; 38 ];
39 public $depends = [ 39 public $depends = [
40 - 'yii\web\YiiAsset', 40 +// 'yii\web\YiiAsset',
41 'backend\assets\FileUploadAsset', 41 'backend\assets\FileUploadAsset',
42 ]; 42 ];
43 public $jsOptions = array( 43 public $jsOptions = array(
frontend/views/site/forms-modal-fav.php
  1 +<?php
  2 +use yii\helpers\Html;
  3 +?>
1 <div id="modal_form_favorite"> 4 <div id="modal_form_favorite">
2 <div class="closed-form"></div> 5 <div class="closed-form"></div>
3 <div class="form-resume-wr"> 6 <div class="form-resume-wr">
4 <div class="form-resume-sub style">Добавлено в закладки</div> 7 <div class="form-resume-sub style">Добавлено в закладки</div>
5 <div class="favorite-user-wr"> 8 <div class="favorite-user-wr">
6 - <img src="images/ded-ico.png" alt=""/> 9 + <img src="/images/ded-ico.png" alt=""/>
7 <div class="favorite-user-profile">Петер Цумторь</div> 10 <div class="favorite-user-profile">Петер Цумторь</div>
8 - <div class="favorite-user-profile-add"><img src="images/sidebar-ico/ico-16.png" alt=""/><span>Добавлен</span></div> 11 + <div class="favorite-user-profile-add"><img src="/images/sidebar-ico/ico-16.png" alt=""/><span>Добавлен</span></div>
9 </div> 12 </div>
10 <div class="res_form_line"></div> 13 <div class="res_form_line"></div>
11 - <div class="page-favorite"><a href="#" >Перейти на страницу закладок</a></div> 14 + <div class="page-favorite"><?= Html::a('Перейти на страницу закладок',['/accounts/bookmarks'])?></div>
12 </div> 15 </div>
13 </div> 16 </div>
14 \ No newline at end of file 17 \ No newline at end of file
frontend/web/js/forms.js
1 $(document).ready(function(){ 1 $(document).ready(function(){
2 - //if($('a.contactsLinkModal, .blog-buttons-add-favorite, .performance-vacancy-add-favorite a, .get-list, .blog-buttons-offer, .get-project, .main-menu-icons-home, .main-menu-icons-copy').length>0) {  
3 - //  
4 - // $('.forms-modal-hide').remove();  
5 - // $("#overlay").remove();  
6 - // $("body").append('<div class="forms-modal-hide"></div>');  
7 - // $("body").append('<div id="overlay"></div>');  
8 - //  
9 - // $.post("site/forms-modal", function (data) {  
10 - //  
11 - // $(".forms-modal-hide").append(data);  
12 - //  
13 - // }).complete(function() {  
14 - // $('body').on('click','.closed-form, #overlay', function(){  
15 - // $('#modal_form_favorite, #modal_form_offer, #modal_form_question')  
16 - // .animate({opacity: 0, top: '30%'}, 200,  
17 - // function(){  
18 - // $(this).css('display', 'none');  
19 - // $('#overlay').fadeOut(400);  
20 - // $('.forms-modal-hide').empty();  
21 - // }  
22 - // );  
23 - // });  
24 - // });  
25 - //}  
26 -  
27 -  
28 function addRemoveBlocks(){ 2 function addRemoveBlocks(){
29 $('#overlay, .forms-modal-hide').remove(); 3 $('#overlay, .forms-modal-hide').remove();
30 $('body').append('<div id="overlay"></div>').append('<div class="forms-modal-hide"></div>'); 4 $('body').append('<div id="overlay"></div>').append('<div class="forms-modal-hide"></div>');
31 } 5 }
32 - addToFavorites();  
33 - addToOffer();  
34 -  
35 6
36 function addToFavorites(){ 7 function addToFavorites(){
37 - $('.blog-buttons-add-favorite, .performance-vacancy-add-favorite a, .get-list/*, .main-menu-icons-copy*/').click(function(e){  
38 - var newMarg = $(window).scrollTop();  
39 - e.preventDefault()  
40 - $('#overlay').fadeIn(400,  
41 - function(){  
42 - $('#modal_form_favorite')  
43 - .css({display:'block', marginTop:-230+newMarg})  
44 - .animate({opacity: 1, top: '50%'}, 200);  
45 - }); 8 + $.post("/site/forms-modal-fav", function (data) {
  9 + $('.forms-modal-hide').append(data)
46 }) 10 })
  11 + .fail(function(){
  12 + $('#overlay, .forms-modal-hide').remove();
  13 + alert(txtErrorModal)
  14 + })
  15 + .done(function() {
  16 + var newMarg = $(window).scrollTop();
  17 + $('#overlay').fadeIn(400,
  18 + function(){
  19 + $('.forms-modal-hide>div')
  20 + .css({display:'block', marginTop:-230+newMarg})
  21 + .animate({opacity: 1, top: '50%'}, 200);
  22 + });
  23 + })
47 } 24 }
48 25
49 function addToOffer(){ 26 function addToOffer(){
50 - $('.blog-buttons-offer, .get-project/*,.main-menu-icons-home*/').click(function(e){  
51 - var newMarg = $(window).scrollTop();  
52 - e.preventDefault()  
53 - $('#overlay').fadeIn(400,  
54 - function(){  
55 - $('#modal_form_offer')  
56 - .css({display:'block', marginTop:-313+newMarg})  
57 - .animate({opacity: 1, top: '50%'}, 200);  
58 - }); 27 + $.post("/site/forms-modal-offer", function (data) {
  28 + $('.forms-modal-hide').append(data)
59 }) 29 })
  30 + .fail(function(){
  31 + $('#overlay, .forms-modal-hide').remove();
  32 + alert(txtErrorModal)
  33 + })
  34 + .done(function() {
  35 + var newMarg = $(window).scrollTop();
  36 + $('#overlay').fadeIn(400,
  37 + function(){
  38 + $('.forms-modal-hide>div')
  39 + .css({display:'block', marginTop:-230+newMarg})
  40 + .animate({opacity: 1, top: '50%'}, 200);
  41 + });
  42 + })
60 } 43 }
61 44
62 -  
63 -  
64 -  
65 -  
66 -  
67 -  
68 -  
69 -  
70 function addContacts() { 45 function addContacts() {
71 $.post("/site/forms-modal-contacts", function (data) { 46 $.post("/site/forms-modal-contacts", function (data) {
72 $('.forms-modal-hide').append(data) 47 $('.forms-modal-hide').append(data)
73 }) 48 })
74 .fail(function(){ 49 .fail(function(){
75 - addRemoveBlocks()  
76 - alert('ВОЗНИКЛА ОШИБКА, ПОПРОБУЙТЕ ЕЩЕ РАЗ ПОЗЖЕ!') 50 + $('#overlay, .forms-modal-hide').remove();
  51 + alert(txtErrorModal)
77 }) 52 })
78 .done(function() { 53 .done(function() {
79 var newMarg = $(window).scrollTop(); 54 var newMarg = $(window).scrollTop();
@@ -86,13 +61,27 @@ $(document).ready(function(){ @@ -86,13 +61,27 @@ $(document).ready(function(){
86 }) 61 })
87 } 62 }
88 63
89 - 64 + //contacts
90 $('a.contactsLinkModalFirst').click(function(e){ 65 $('a.contactsLinkModalFirst').click(function(e){
91 e.preventDefault() 66 e.preventDefault()
92 addRemoveBlocks() 67 addRemoveBlocks()
93 - addContacts(); 68 + addContacts()
  69 + })
  70 + //bookmarks
  71 + $('.get-list, .performance-vacancy-add-favorite a, .blog-buttons-add-favorite').click(function(e){
  72 + e.preventDefault()
  73 + addRemoveBlocks()
  74 + addToFavorites()
  75 + })
  76 + //offer
  77 + $('a.get-project, .blog-buttons-offer').click(function(e){
  78 + e.preventDefault()
  79 + addRemoveBlocks()
  80 + addToOffer()
94 }) 81 })
95 82
  83 + var txtErrorModal = 'ВОЗНИКЛА ОШИБКА, ПОПРОБУЙТЕ ЕЩЕ РАЗ ПОЗЖЕ!';
  84 +
96 clocseModalForms() 85 clocseModalForms()
97 function clocseModalForms(){ 86 function clocseModalForms(){
98 $('body').on('click','.closed-form, #overlay', function(){ 87 $('body').on('click','.closed-form, #overlay', function(){
@@ -107,5 +96,4 @@ $(document).ready(function(){ @@ -107,5 +96,4 @@ $(document).ready(function(){
107 }); 96 });
108 } 97 }
109 98
110 -  
111 }) 99 })
112 \ No newline at end of file 100 \ No newline at end of file