new pisilinux web sites
This commit is contained in:
@@ -0,0 +1,255 @@
|
||||
$(function(){
|
||||
|
||||
$('[data-bs-toggle="tooltip"]').tooltip();
|
||||
//if (document.cookie('popup')=='1') {
|
||||
//$("#duyuru").modal({ backdrop: 'static', keyboard: false, show: true });
|
||||
//}
|
||||
|
||||
//$('#bugs').DataTable();
|
||||
|
||||
$("#popupKapat").click(function(){
|
||||
Cookies.set('popup', 'off', { expires: 7 })
|
||||
})//popupKapat
|
||||
|
||||
$(".download").click(function(){
|
||||
var id = $(this).data("id");
|
||||
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: 'download/counter',
|
||||
data: {id:id},
|
||||
})
|
||||
|
||||
})//download
|
||||
|
||||
$("#contact").click(function(e){
|
||||
// Sayfayı blur yap
|
||||
|
||||
|
||||
$.post('/contact/send', {
|
||||
name: $('#name').val(),
|
||||
email: $('#email').val(),
|
||||
message: $('#message').val(),
|
||||
token: $('#token').val()
|
||||
}, function(data){
|
||||
// Blur'ı kaldır
|
||||
|
||||
data = data.split('&');
|
||||
|
||||
if(data[0] == 1){
|
||||
|
||||
swal.fire({
|
||||
text: data[1],
|
||||
icon: "success",
|
||||
didOpen:() => {
|
||||
$('.swal2-modal').css('filter', 'none');
|
||||
$('.container').css('filter', 'blur(5px)');
|
||||
},
|
||||
willClose:() => {
|
||||
$('.container').css('filter', 'none');
|
||||
window.location.href = '/';
|
||||
}
|
||||
});
|
||||
}else{
|
||||
swal.fire({
|
||||
title: "Doğrulama hatası",
|
||||
text: "Lütfen doğrulama kodunu doğru girin",
|
||||
icon: "error",
|
||||
didOpen:() => {
|
||||
$('.swal2-modal').css('filter', 'none');
|
||||
$('.container').css('filter', 'blur(5px)');
|
||||
|
||||
},
|
||||
willClose:() => {
|
||||
$('.container').css('filter', 'none');
|
||||
setTimeout(() => {
|
||||
$('#token').val('').focus();
|
||||
}, 300);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// üye kayıt sayfasının ajax kontrol
|
||||
$('#registerSubmit').click(function(e){
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
var username = $("#username").val();
|
||||
var surname = $("#surname").val();
|
||||
var email = $("#email").val();
|
||||
var password = $("#password").val();
|
||||
var password2 = $("#password2").val();
|
||||
//var token = $("#token").val();
|
||||
//var cookie = Cookies.get('secret');
|
||||
|
||||
|
||||
if(username.length <= 2){
|
||||
$('#username').val('').focus().attr("placeholder", 'En az 3 karakter olmalıdır').addClass('error');
|
||||
}else if(surname.length <= 2){
|
||||
$("#username").removeClass('error');
|
||||
$('#surname').val('').focus().attr("placeholder", 'En az 3 karakter olmalıdır').addClass('error');
|
||||
}else if(email == ''){
|
||||
$("#surname").removeClass('error');
|
||||
$('#email').val('').focus().attr("placeholder", 'Geçerli bir e-posta adresi girin').addClass('error');
|
||||
}else if(!emailControl(email)){
|
||||
$('#email').val('').focus().attr("placeholder", 'Geçerli bir e-posta adresi girin').addClass('error');
|
||||
}else if(password == ''){
|
||||
$("#email").removeClass('error');
|
||||
$('#password').val('').focus().attr("placeholder", 'Şifre alanı boş olamaz').addClass('error');
|
||||
}else if(password.length <= 5){
|
||||
$('#password').val('').focus().attr("placeholder", 'Şifre en az 6 karakter olmalıdır').addClass('error');
|
||||
}else if(password2 == ''){
|
||||
$("#password").removeClass('error');
|
||||
$('#password2').val('').focus().attr("placeholder", 'Şifre alanı boş olamaz').addClass('error');
|
||||
}else if(password != password2){
|
||||
$('#password2').val('').focus().attr("placeholder", 'Şifreler eşleşmiyor').addClass('error');
|
||||
}
|
||||
|
||||
$.post("/member/emailcontrol", {email1:email} ,function( data ) {
|
||||
if(data == 1 ){
|
||||
$('#email').val('').focus().attr("placeholder", 'Bu e-posta adresi zaten kullanılıyor').addClass('error');
|
||||
}else{
|
||||
$('#registerSubmit').hide();
|
||||
$.post( "/member/new_user", $( "#registerForm" ).serialize(),function( data ) {
|
||||
|
||||
if(data == 1){
|
||||
swal.fire('', 'Kayıt işleminiz başarıyla tamamlandı. Hesabınızı aktif etmek için lütfen e-posta adresinizi kontrol edin.', 'success').then(() => {window.location.replace("/");});
|
||||
}else{
|
||||
swal.fire('', 'Kayıt sırasında bir hata oluştu, lütfen daha sonra tekrar deneyin', 'error');
|
||||
}
|
||||
//swal.fire('', 'Kayıt başarılı!', 'success').then(() => {window.location.replace("/");});
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
});//registerSubmit
|
||||
|
||||
|
||||
$(window).show(500);
|
||||
$("img").addClass("img-fluid");
|
||||
$("div.carousel-item:first").addClass('active');
|
||||
$('#submit').attr("disabled", "disabled");
|
||||
$('#gorev').click(function(){
|
||||
window.location.replace("https://pisilinux.org/bugs/addtask");
|
||||
});//gorev
|
||||
|
||||
// forum ekran seçme (kaldırıldı)
|
||||
$('#gorunum').change(function(){
|
||||
var val = $(this).val();
|
||||
if (val == 1) {}
|
||||
if (val == 2) {window.location.replace("/question_answer");}
|
||||
});
|
||||
// /forum ekran seçme (kaldırıldı)
|
||||
|
||||
|
||||
$('#task').change(function(){
|
||||
var val = $(this).val();
|
||||
if (val == 1) {
|
||||
$('#sistem1').show(500);
|
||||
}else{
|
||||
$('#sistem1').hide(500);
|
||||
}
|
||||
});
|
||||
|
||||
$('.nav-link').on('click', function (e) {
|
||||
localStorage.setItem('activeLink', $(this).attr('href'));
|
||||
});
|
||||
|
||||
// read hash from page load and change tab
|
||||
var activeTab = localStorage.getItem('activeLink');
|
||||
if(activeTab){$('li.nav-item').find('a[href="'+activeTab+'"]').parent().addClass('active');}
|
||||
|
||||
$(window).scroll(function(){
|
||||
var scrolltop=$(this).scrollTop();
|
||||
if(scrolltop>=50){
|
||||
$(".imgup").show(500);
|
||||
}else{
|
||||
$(".imgup").hide(500);
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click', '.flags', function(e) {
|
||||
e.preventDefault();
|
||||
var flags = $(this).data("id");
|
||||
|
||||
document.cookie = "country=" + flags;
|
||||
location.reload();
|
||||
});
|
||||
|
||||
// Bugs page functions start
|
||||
$("#bugsnew" ).submit(function( event ){
|
||||
if ($(".details").val() == "" ) {
|
||||
$(".detayUyari").css('color', 'red');
|
||||
$( ".detayUyari" ).text( "( Detaylar alanı boş bırakılamaz...)" ).show().fadeOut( 5000 );
|
||||
return false;
|
||||
}else{
|
||||
return
|
||||
}
|
||||
});//bugsnew
|
||||
|
||||
$('.bugsClose').click(function(){
|
||||
var bugsId = $(this).attr('data-id');
|
||||
var bugsStatus = $(this).attr('data-status');
|
||||
|
||||
$.post( "/bugs/bugsClose", {id:bugsId,status:bugsStatus}, function(message){
|
||||
// alert(message);
|
||||
location.reload();
|
||||
});
|
||||
|
||||
|
||||
});//bugsClose
|
||||
|
||||
// Bugs page functions end
|
||||
|
||||
function emailControl(email){
|
||||
var kontrol = new RegExp(/^[^0-9][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[@][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[.][a-zA-Z]{2,4}$/i);
|
||||
return kontrol.test(email);
|
||||
}
|
||||
|
||||
var username = document.getElementById('username');
|
||||
username.addEventListener("keyup",function(){
|
||||
if (username.value.match(/[^a-zA-Z' 'wığüşöçĞÜŞÖÇİ]/g)){
|
||||
username.value = this.value.replace(/[^a-zA-ZwığüşöçĞÜŞÖÇİ]/g,'');
|
||||
}
|
||||
})
|
||||
|
||||
var surname = document.getElementById('surname');
|
||||
surname.addEventListener("keyup",function(){
|
||||
if (surname.value.match(/[^a-zA-Z' 'wığüşöçĞÜŞÖÇİ]/g)){
|
||||
surname.value = this.value.replace(/[^a-zA-ZwığüşöçĞÜŞÖÇİ]/g,'');
|
||||
}
|
||||
})
|
||||
|
||||
function customURLConverter(url, node, on_save, name)
|
||||
{
|
||||
var checkURL;
|
||||
var urlPrefix;
|
||||
|
||||
// Get the first 7 characters of the string
|
||||
checkURL = url.substring(0, 7);
|
||||
|
||||
// Determine if those characters are coming from the image uploader
|
||||
if(checkURL === "/system")
|
||||
{
|
||||
// prefix the incoming URL with my domain
|
||||
urlPrefix = 'https://pisilinux.org';
|
||||
url = urlPrefix.concat(url);
|
||||
}
|
||||
|
||||
// Return URL
|
||||
return url;
|
||||
}
|
||||
|
||||
});// jquery sonu
|
||||
|
||||
Reference in New Issue
Block a user