5077a0ec
Yarik
test
|
1
2
3
4
5
6
7
8
|
$(document).ready(
function()
{
function addRemoveBlocks()
{
$('#overlay, .forms-modal-hide').remove();
$('body').append('<div id="overlay"></div>').append('<div class="forms-modal-hide"></div>');
}
|
eb7e82fb
Administrator
29.02.16
|
9
|
|
5077a0ec
Yarik
test
|
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
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);
}
);
}
)
}
|
eb7e82fb
Administrator
29.02.16
|
40
|
|
5077a0ec
Yarik
test
|
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
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);
}
);
}
)
}
|
eb7e82fb
Administrator
29.02.16
|
71
|
|
5077a0ec
Yarik
test
|
72
73
74
|
function addContacts()
{
$.post(
|
d0a19e42
Yarik
test
|
75
|
"/ajax/get-feedback", function(data)
|
5077a0ec
Yarik
test
|
76
|
{
|
d0a19e42
Yarik
test
|
77
78
79
|
$('.forms-modal-hide').append(data.result.form)
|
5077a0ec
Yarik
test
|
80
81
82
83
84
85
86
87
88
89
|
}
)
.fail(
function()
{
$('#overlay, .forms-modal-hide').remove();
alert(txtErrorModal)
}
)
.done(
|
d0a19e42
Yarik
test
|
90
|
|
5077a0ec
Yarik
test
|
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
|
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()
|
d0a19e42
Yarik
test
|
120
|
console.log('dsadasdaS');
|
5077a0ec
Yarik
test
|
121
122
123
124
125
|
addRemoveBlocks()
addContacts()
}
)
//bookmarks
|
eb7e82fb
Administrator
29.02.16
|
126
|
|
5077a0ec
Yarik
test
|
127
128
129
130
131
132
133
134
135
136
|
//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 {
|
3c618303
Yarik
test
|
137
138
|
$('.artbox_bookmark_add_performer[data-id='+id+']').removeClass('artbox_bookmark_add_performer').addClass('artbox_bookmark_remove_performer');
$('.get-list.artbox_bookmark_remove_performer[data-id='+id+']').text('Убрать из закладок');
|
5077a0ec
Yarik
test
|
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
|
$('.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 {
|
3c618303
Yarik
test
|
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
|
$('.artbox_bookmark_remove_performer[data-id='+id+']').removeClass('artbox_bookmark_remove_performer').addClass('artbox_bookmark_add_performer');
$('.get-list.artbox_bookmark_add_performer[data-id='+id+']').text('Добавить в закладки');
$('#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);
}
);
}
)
});
//Customerbookmark add
$(document).on('click', '.artbox_bookmark_add_customer', function(e) {
e.preventDefault();
var id = $(this).data('id');
addRemoveBlocks();
$.post('/bookmarks/add-customer', {id: id}, function(data) {
if(data.error) {
$('#overlay, .forms-modal-hide').remove();
alert(data.error);
} else {
$('.artbox_bookmark_add_customer[data-id='+id+']').removeClass('artbox_bookmark_add_customer').addClass('artbox_bookmark_remove_customer');
$('.get-list.artbox_bookmark_remove_customer[data-id='+id+']').text('Убрать из закладок');
$('.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);
}
);
}
)
});
//Customer bookmark remove
$(document).on('click', '.artbox_bookmark_remove_customer', function(e) {
e.preventDefault();
var id = $(this).data('id');
var link = $(this);
addRemoveBlocks();
$.post('/bookmarks/remove-customer', {id: id}, function(data) {
if(data.error) {
$('#overlay, .forms-modal-hide').remove();
alert(data.error);
} else {
$('.artbox_bookmark_remove_customer[data-id='+id+']').removeClass('artbox_bookmark_remove_customer').addClass('artbox_bookmark_add_customer');
$('.get-list.artbox_bookmark_add_customer[data-id='+id+']').text('Добавить в закладки');
$('#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);
}
);
}
)
});
//Project bookmark add
$(document).on('click', '.artbox_bookmark_add_project', function(e) {
e.preventDefault();
var id = $(this).data('id');
addRemoveBlocks();
$.post('/bookmarks/add-project', {id: id}, function(data) {
if(data.error) {
$('#overlay, .forms-modal-hide').remove();
alert(data.error);
} else {
$('.artbox_bookmark_add_project[data-id='+id+']').removeClass('artbox_bookmark_add_project').addClass('artbox_bookmark_remove_project');
$('.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);
}
);
}
)
});
//Project bookmark remove
$(document).on('click', '.artbox_bookmark_remove_project', function(e) {
e.preventDefault();
var id = $(this).data('id');
var link = $(this);
addRemoveBlocks();
$.post('/bookmarks/remove-project', {id: id}, function(data) {
if(data.error) {
$('#overlay, .forms-modal-hide').remove();
alert(data.error);
} else {
$('.artbox_bookmark_remove_project[data-id='+id+']').removeClass('artbox_bookmark_remove_project').addClass('artbox_bookmark_add_project');
|
5077a0ec
Yarik
test
|
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
|
$('#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()
}
)
|
38a6e1dd
Yarik
test
|
358
359
360
361
362
363
364
365
366
367
368
369
370
|
//project comment state
$(document).on('click', '.artbox_project_make_candidate', function(e) {
e.preventDefault();
var project_id = $(this).data('project-id');
var comment_id = $(this).data('comment-id');
var state = 2;
var link = $(this);
$.post('/tender/change-state', {project_id: project_id, comment_id: comment_id, state: state}, function(data) {
if(data.error) {
alert(data.error);
} else {
alert(data.message);
|
25bd78f8
Yarik
test
|
371
|
location.reload();
|
38a6e1dd
Yarik
test
|
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
|
}
}, 'json').fail(
function()
{
alert(txtErrorModal);
}
);
});
$(document).on('click', '.artbox_project_make_new', function(e) {
e.preventDefault();
var project_id = $(this).data('project-id');
var comment_id = $(this).data('comment-id');
var state = 1;
var link = $(this);
$.post('/tender/change-state', {project_id: project_id, comment_id: comment_id, state: state}, function(data) {
if(data.error) {
alert(data.error);
} else {
alert(data.message);
|
25bd78f8
Yarik
test
|
391
|
location.reload();
|
38a6e1dd
Yarik
test
|
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
|
}
}, 'json').fail(
function()
{
alert(txtErrorModal);
}
);
});
$(document).on('click', '.artbox_project_make_performer', function(e) {
e.preventDefault();
var project_id = $(this).data('project-id');
var comment_id = $(this).data('comment-id');
var state = 3;
var link = $(this);
$.post('/tender/change-state', {project_id: project_id, comment_id: comment_id, state: state}, function(data) {
if(data.error) {
alert(data.error);
} else {
alert(data.message);
|
25bd78f8
Yarik
test
|
411
|
location.reload();
|
38a6e1dd
Yarik
test
|
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
|
}
}, 'json').fail(
function()
{
alert(txtErrorModal);
}
);
});
$(document).on('click', '.artbox_project_make_deny', function(e) {
e.preventDefault();
var project_id = $(this).data('project-id');
var comment_id = $(this).data('comment-id');
var state = 4;
var link = $(this);
$.post('/tender/change-state', {project_id: project_id, comment_id: comment_id, state: state}, function(data) {
if(data.error) {
alert(data.error);
} else {
alert(data.message);
|
25bd78f8
Yarik
test
|
431
|
location.reload();
|
38a6e1dd
Yarik
test
|
432
433
434
435
436
437
438
439
|
}
}, 'json').fail(
function()
{
alert(txtErrorModal);
}
);
});
|
32ed90fd
Yarik
test
|
440
441
442
443
444
445
446
447
448
449
450
|
$(document).on('click', '.artbox_project_make_trash', function(e) {
e.preventDefault();
var project_id = $(this).data('project-id');
var comment_id = $(this).data('comment-id');
var state = 5;
var link = $(this);
$.post('/tender/change-state', {project_id: project_id, comment_id: comment_id, state: state}, function(data) {
if(data.error) {
alert(data.error);
} else {
alert(data.message);
|
25bd78f8
Yarik
test
|
451
|
location.reload();
|
32ed90fd
Yarik
test
|
452
453
454
455
456
457
458
459
|
}
}, 'json').fail(
function()
{
alert(txtErrorModal);
}
);
});
|
38a6e1dd
Yarik
test
|
460
461
|
|
5077a0ec
Yarik
test
|
462
|
//offer
|
7d705d85
Yarik
test
|
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
|
function offerCallback() {
$('.off_list').jScrollPane(
{
showArrows : true, autoReinitialise : true, autoReinitialiseDelay : 200,
scrollbarWidth : 25, arrowSize : 25
}
);
$('.off_list').hide();
$('.main_item, .arrow.up').click(
function()
{
$('.off_list').toggle()
}
);
var listOffer = $('.list-form-offer li');
var listOfferLength = listOffer.length;
$(listOffer[listOfferLength - 1]).addClass('act-offer-li');
function activeOf()
{
var title1 = $('.act-offer-li').find('.title1').text();
var title2 = $('.act-offer-li').find('.title2').text();
$('#off_value').val($('.act-offer-li').data('project-id'));
$('.main_item .pr_title').empty().text(title1)
$('.main_item span').empty().text(title2)
}
activeOf();
listOffer.click(
function()
{
var thisOfInd = $(this).index();
var actOfInd = $('.act-offer-li').index();
listOffer.removeClass('act-offer-li');
$(this).addClass('act-offer-li');
if(thisOfInd != actOfInd)
{
activeOf();
$('.off_list').hide();
}
}
);
}
|
50ed5626
Yarik
test
|
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
|
function addToOffer(performer_id)
{
$.post(
"/tender/offer-form",
{
performer_id: performer_id
} ,
function(data)
{
if(data.error) {
$('#overlay, .forms-modal-hide').remove();
alert(data.error);
} else {
$('.forms-modal-hide').append(data.message);
}
}
)
.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);
|
7d705d85
Yarik
test
|
546
|
offerCallback();
|
50ed5626
Yarik
test
|
547
548
549
550
551
|
}
);
}
)
}
|
5077a0ec
Yarik
test
|
552
553
554
|
$('a.get-project, .blog-buttons-offer').click(
function(e)
{
|
50ed5626
Yarik
test
|
555
556
557
558
559
560
561
562
563
|
e.preventDefault();
var performer_id;
performer_id = $(this).data('performer-id');
if(!performer_id) {
return false;
} else {
addRemoveBlocks();
addToOffer(performer_id);
}
|
5077a0ec
Yarik
test
|
564
565
566
567
|
}
)
var txtErrorModal = 'ВОЗНИКЛА ОШИБКА, ПОПРОБУЙТЕ ЕЩЕ РАЗ ПОЗЖЕ!';
|
eb7e82fb
Administrator
29.02.16
|
568
|
|
5077a0ec
Yarik
test
|
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
|
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()
}
)
}
)
|
eb7e82fb
Administrator
29.02.16
|
589
|
|
eb7e82fb
Administrator
29.02.16
|
590
|
}
|
5077a0ec
Yarik
test
|
591
592
|
);
}
|
eb7e82fb
Administrator
29.02.16
|
593
|
|
78ab7436
Yarik
test
|
594
595
596
597
598
599
|
// Remove error for no client validation fields
$(document).on('change', '.no-client-validation', function() {
console.log('debug');
$(this).parent().find('.help-block').hide();
});
|
d0a19e42
Yarik
test
|
600
601
602
603
604
605
606
607
|
$(document).on('submit', '.feedback_form', function(e) {
e.preventDefault();
console.log('event');
$.post('/ajax/post-feedback', $(this).serialize(), function(data) {
console.log(data);
});
});
|
eb7e82fb
Administrator
29.02.16
|
608
|
}
|
5077a0ec
Yarik
test
|
609
|
)
|