This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.copyLink').click( function(e) { | |
let currenturl = 'http://'; //your domain | |
let userid = $('html').find('.profileImage a').attr('href'); //get user ID | |
let postid = $(e.target).parent().attr('id'); //get post ID | |
let urlcopy = currenturl + userid + '#' + postid; //get the full link | |
let $temp = $("<input>"); //create fake input | |
$("body").append($temp); //add fake input to HTML | |
$temp.val(urlcopy).select(); //insert full link to fake input | |
document.execCommand("copy"); //copy full link from fake input to clipboard | |
$temp.remove(); //remove fake input from HTML |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).mouseup(function(e) { | |
let container = $(".js-postOptionsMenu"); //insert container selector, multiple selectors for different containers will work fine | |
if (!container.is(e.target) && container.has(e.target).length === 0) { | |
container.fadeOut();//you can replace .fadeOut() with any other way to hide your container | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#pickAgeStart').on('keyup keydown click change', function(e) { | |
if ($(this).val() > 65 && e.keyCode !== 46 && e.keyCode !== 8) { //insert your value and < or > | |
e.preventDefault(); | |
$(this).val(65); //insert maximum/minimum value here | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('input[id="pick_period2"]').daterangepicker({ | |
singleDatePicker: true, | |
showDropdowns: false, | |
minDate: moment(today).add(1, 'days'), | |
maxDate: moment(today).add(45, 'days'), | |
//add locale to your daterangepicker call function | |
locale: { | |
format: 'DD-MM-YYYY', | |
applyLabel: 'Принять', | |
cancelLabel: 'Отмена', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#pick_period').on('apply.daterangepicker', (ev, picker) => { | |
//insert your action here | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.js-startBannerCamp').click(function () { | |
window.location.href = "/advert/"; //insert yor link here | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.js-checkWeb').click(function () { | |
if ($('#banner_link').val() === '') { //check if value is empty | |
$('#banner_link').val('your message here').css('color', 'red'); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#banner_link').inputmask("url", { | |
mask: "https://www.*{1,20}[.*{1,20}]", | |
greedy: false, | |
clearMaskOnLostFocus: false, | |
clearIncomplete: false, | |
definitions: { | |
'*': { | |
validator: "[0-9A-Za-z!#$%&'*+/=?^_`{|}~\-]", | |
cardinality: 1, | |
casing: "lower" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("input[id=pickAgeStart]").on('keyup click change', function () { | |
$('.ageStart').html($(this).val()); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#price_per_item, #price_per_item2').length) { | |
$('#price_per_item, #price_per_item2').mask('000 000 000,00₴', {reverse: true} | |
); | |
}); |
OlderNewer