Popravki v temi
This commit is contained in:
parent
6f63a6ac50
commit
d2bfbff9b1
@ -1,55 +1,32 @@
|
|||||||
/**
|
/**
|
||||||
* JS povezani s prijavo in registracijo
|
* JS povezani s prijavo in registracijo
|
||||||
*/
|
*/
|
||||||
(function ($, Drupal, window, document) {
|
(function ($) {
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
|
||||||
// To understand behaviors, see https://drupal.org/node/756722#behaviors
|
// To understand behaviors, see https://drupal.org/node/756722#behaviors
|
||||||
Drupal.behaviors.prijavaInRegistracija = {
|
/* Drupal.behaviors.prijavaInRegistracija = {
|
||||||
attach: function (context, settings) {
|
attach: function (context, settings) {
|
||||||
|
}
|
||||||
|
};*/
|
||||||
|
|
||||||
jQuery(document).ready(function () {
|
jQuery(document).ready(function () {
|
||||||
|
|
||||||
// Drupal nova prijava
|
// Drupal nova prijava
|
||||||
jQuery('.submit-prijava').on('click', function(){
|
jQuery('.submit-prijava').on('click', function(){
|
||||||
// ODstranimo vse napake
|
izvediPrijavoUporabnika();
|
||||||
jQuery('.error-field').removeClass('error-field');
|
});
|
||||||
|
jQuery('.prijava-password-input').keyup(function(e){
|
||||||
|
if(e.keyCode == 13){
|
||||||
jQuery(':input[required]:visible').each(function () {
|
izvediPrijavoUporabnika();
|
||||||
if (jQuery(this).val() == '') {
|
|
||||||
jQuery(this).addClass('error-field');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if( jQuery('.error-field').length > 0){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
jQuery('#prijava-1ka .error-message').empty().hide();
|
|
||||||
|
|
||||||
var sendVariables = jQuery('#forma-prijava :input').serialize();
|
|
||||||
var url = jQuery('#forma-prijava').attr('action');
|
|
||||||
|
|
||||||
jQuery.post(url, sendVariables, function (data) {
|
|
||||||
var response = JSON.parse(data);
|
|
||||||
|
|
||||||
if(response.type == 'success'){
|
|
||||||
|
|
||||||
return window.location = response.data.url;
|
|
||||||
|
|
||||||
} else if(response.type == 'error') {
|
|
||||||
|
|
||||||
let sporocilo = vrniBesediloNapake(response.data);
|
|
||||||
|
|
||||||
jQuery('#prijava-1ka .error-message').append(sporocilo).show();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Odpremo drop down menu za uporabnika
|
||||||
|
jQuery('#user-login-menu').on('click', function () {
|
||||||
|
jQuery('#user-menu').toggle();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Obnovitev gesla
|
// Obnovitev gesla
|
||||||
@ -165,12 +142,47 @@
|
|||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
})(jQuery);
|
||||||
|
|
||||||
|
function izvediPrijavoUporabnika()
|
||||||
|
{
|
||||||
|
// ODstranimo vse napake
|
||||||
|
jQuery('.error-field').removeClass('error-field');
|
||||||
|
|
||||||
|
|
||||||
|
jQuery(':input[required]:visible').each(function () {
|
||||||
|
if (jQuery(this).val() == '') {
|
||||||
|
jQuery(this).addClass('error-field');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if( jQuery('.error-field').length > 0){
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
};
|
jQuery('#prijava-1ka .error-message').empty().hide();
|
||||||
|
|
||||||
})(jQuery, Drupal, this, this.document);
|
var sendVariables = jQuery('#forma-prijava :input').serialize();
|
||||||
|
var url = jQuery('#forma-prijava').attr('action');
|
||||||
|
|
||||||
|
jQuery.post(url, sendVariables, function (data) {
|
||||||
|
var response = JSON.parse(data);
|
||||||
|
|
||||||
|
if(response.type == 'success'){
|
||||||
|
|
||||||
|
return window.location = response.data.url;
|
||||||
|
|
||||||
|
} else if(response.type == 'error') {
|
||||||
|
|
||||||
|
let sporocilo = vrniBesediloNapake(response.data);
|
||||||
|
|
||||||
|
jQuery('#prijava-1ka .error-message').append(sporocilo).show();
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function pridobiJezik(){
|
function pridobiJezik(){
|
||||||
|
|
||||||
|
@ -1,75 +1,44 @@
|
|||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* A JavaScript file for the theme.
|
* A JavaScript file for the theme.
|
||||||
*
|
|
||||||
* In order for this JavaScript to be loaded on pages, see the instructions in
|
|
||||||
* the README.txt next to this file.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// JavaScript should be made compatible with libraries other than jQuery by
|
(function ($) {
|
||||||
// wrapping it with an "anonymous closure". See:
|
|
||||||
// - https://drupal.org/node/1446420
|
|
||||||
// - http://www.adequatelygood.com/2010/3/JavaScript-Module-Pattern-In-Depth
|
|
||||||
(function ($, Drupal, window, document) {
|
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
|
||||||
// To understand behaviors, see https://drupal.org/node/756722#behaviors
|
// To understand behaviors, see https://drupal.org/node/756722#behaviors
|
||||||
Drupal.behaviors.my_custom_behavior = {
|
/* Drupal.behaviors.my_custom_behavior = {
|
||||||
attach: function (context, settings) {
|
attach: function (context, settings) {
|
||||||
var adminMenu = '';
|
var adminMenu = '';
|
||||||
if (jQuery('#admin-menu').length > 0) {
|
if (jQuery('#admin-menu').length > 0) {
|
||||||
adminMenu = 'fixed-admin';
|
adminMenu = 'fixed-admin';
|
||||||
}
|
}*/
|
||||||
|
|
||||||
jQuery(document).ready(function () {
|
jQuery(document).ready(function () {
|
||||||
|
// Prikaži polje za iskanje
|
||||||
|
jQuery('.searchbutton').on('click', function(){
|
||||||
|
jQuery('.searchform').css('transform', 'translate3d(0px, 0px, 0px)');
|
||||||
|
});
|
||||||
|
|
||||||
// Drupal nova prijava
|
jQuery('.hide-search').on('click', function(){
|
||||||
// jQuery('.submit-prijava').on('click', function(){
|
jQuery('.searchform').css('transform', 'translate3d(0px, -100%, 0px)');
|
||||||
// // ODstranimo vse napake
|
});
|
||||||
// jQuery('.error-field').removeClass('error-field');
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// jQuery(':input[required]:visible').each(function () {
|
|
||||||
// if (jQuery(this).val() == '') {
|
|
||||||
// jQuery(this).addClass('error-field');
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
//
|
|
||||||
// if( jQuery('.error-field').length > 0){
|
|
||||||
// return false;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// jQuery('#prijava-1ka error-message').append('').hide();
|
|
||||||
//
|
|
||||||
// var sendVariables = jQuery('#forma-prijava :input').serialize()
|
|
||||||
// var url = jQuery('#forma-prijava').attr('action')
|
|
||||||
//
|
|
||||||
// jQuery.post(url, sendVariables, function (data) {
|
|
||||||
// var response = JSON.parse(data)
|
|
||||||
//
|
|
||||||
// if(response.type == 'success'){
|
|
||||||
//
|
|
||||||
// return window.location = response.data.url
|
|
||||||
//
|
|
||||||
// } else if(response.type == 'error') {
|
|
||||||
//
|
|
||||||
// jQuery('#prijava-1ka error-message').append(response.message).show();
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// });
|
|
||||||
|
|
||||||
|
|
||||||
|
// ISKANJE
|
||||||
|
jQuery('#forma-iskanje').keyup(function(event){
|
||||||
|
if (event.keyCode == 13) {
|
||||||
|
var iskaniNiz = jQuery('#iskanje-input').val();
|
||||||
|
|
||||||
|
var action = jQuery('#forma-iskanje').attr('data-action');
|
||||||
|
|
||||||
|
window.location.href = action + '/search/vsebina?keys=' +iskaniNiz;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Odjava v Drupalu
|
// Odjava v Drupalu
|
||||||
jQuery('#poslji-odjavo').on('click', function(e){
|
jQuery('#poslji-odjavo').on('click', function(e){
|
||||||
console.log('klik odjava')
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
jQuery('[name="odjava"]').submit();
|
jQuery('[name="odjava"]').submit();
|
||||||
|
|
||||||
@ -78,45 +47,13 @@
|
|||||||
}, 500);
|
}, 500);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Odpremo drop down menu za uporabnika
|
|
||||||
jQuery('#submenu-login').on('click', function () {
|
|
||||||
jQuery('#user-menu').toggle();
|
|
||||||
});
|
|
||||||
|
|
||||||
// JEZIK pustimo samo 3 črke
|
// JEZIK pustimo samo 3 črke
|
||||||
//var jezikText = jQuery('.language-link').text().substring(0, 4);
|
var jezikText = jQuery('.language-link:not(.is-active)').text().substring(0, 3);
|
||||||
//jQuery('.language-link').text(jezikText);
|
jQuery('.language-link').text(jezikText);
|
||||||
|
|
||||||
// Iskalnik v navbaru
|
|
||||||
// Zapremo iskalnik
|
|
||||||
jQuery(document).on('click', '.search-close', function () {
|
|
||||||
jQuery('#iskanje').show('fast');
|
|
||||||
jQuery('#iskanje-form').hide('fast');
|
|
||||||
jQuery('.burger').css('z-index', '');
|
|
||||||
});
|
|
||||||
|
|
||||||
//Odpremo iskalnik
|
|
||||||
jQuery('#iskanje').on('click', function () {
|
|
||||||
jQuery('#iskanje-form').show('fast');
|
|
||||||
jQuery('#iskanje').hide('fast');
|
|
||||||
jQuery('.burger').css('z-index', '-99');
|
|
||||||
});
|
|
||||||
|
|
||||||
// Preusmerimo na url za iskanje, ko uporabnik pritisne enter
|
|
||||||
jQuery('#iskanje-input').on('keyup', function (event) {
|
|
||||||
if (event.keyCode == 13) {
|
|
||||||
var iskaniNiz = jQuery('#iskanje-input').val();
|
|
||||||
|
|
||||||
var action = jQuery('#iskanje-form').attr('data-action');
|
|
||||||
|
|
||||||
window.location.href = action + iskaniNiz;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// if (window.location.pathname.indexOf('/iskanje/') > -1) {
|
|
||||||
// jQuery('.container-sidenav h1').hide();
|
|
||||||
// }
|
|
||||||
// END Iskalnik
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1286,12 +1223,12 @@
|
|||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
};
|
//};
|
||||||
|
|
||||||
})(jQuery, Drupal, this, this.document);
|
})(jQuery);
|
||||||
|
|
||||||
function CheckEmail(text) {
|
function CheckEmail(text) {
|
||||||
jQuery('#modal-registration .w-form-fail').html('').hide();
|
jQuery('#modal-registration .w-form-fail').html('').hide();
|
||||||
|
@ -0,0 +1,5 @@
|
|||||||
|
#block-languageswitcher ul {
|
||||||
|
list-style: none;
|
||||||
|
text-transform: uppercase;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
@ -3,22 +3,17 @@
|
|||||||
{#{% endif %}#}
|
{#{% endif %}#}
|
||||||
|
|
||||||
{# Forma za iskanje#}
|
{# Forma za iskanje#}
|
||||||
<div class="searchform" style="display: block; transform: translate3d(0px, -100%, 0px) scale3d(1, 1, 1) rotateX(0deg) rotateY(0deg) rotateZ(0deg) skew(0deg, 0deg); transform-style: preserve-3d;">
|
{% set site_url = url("<front>") %}
|
||||||
|
<div class="searchform" style="display: flex; transform: translate3d(0px, -100%, 0px) scale3d(1, 1, 1) rotateX(0deg) rotateY(0deg) rotateZ(0deg) skew(0deg, 0deg); transform-style: preserve-3d;">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="vrstica">
|
<div class="vrstica">
|
||||||
<div class="w-form">
|
<div class="w-form">
|
||||||
<form id="email-form" name="email-form" data-name="Email Form" class="form-2">
|
<form id="forma-iskanje" data-action="{{ site_url }}" style="display: flex;">
|
||||||
<input type="text" class="text-field-2 w-input" maxlength="256" name="name-2" data-name="Name 2" placeholder="Kaj iščete?" id="name-2">
|
<input type="text" class="text-field-2 w-input" maxlength="256" name="iskanje-input" placeholder="Kaj iščete?" id="iskanje-input">
|
||||||
<input type="submit" value="" data-wait="Please wait..." class="submit-button-2 w-button">
|
<input type="submit" value="" data-wait="Please wait..." class="submit-button-2 w-button">
|
||||||
<img src="/tema1ka/svg/icons-x.svg" loading="lazy" alt="" class="hide-search">
|
<img src="/tema1ka/svg/icons-x.svg" loading="lazy" alt="" class="hide-search">
|
||||||
</form>
|
</form>
|
||||||
<div class="w-form-done">
|
|
||||||
<div>Iskanje rezultatov..</div>
|
|
||||||
</div>
|
|
||||||
<div class="w-form-fail">
|
|
||||||
<div>Pri iskranju je prišlo do napale!</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -53,10 +48,10 @@
|
|||||||
|
|
||||||
{% if uporabnik %}
|
{% if uporabnik %}
|
||||||
<div class="usem-menu">
|
<div class="usem-menu">
|
||||||
<a href="#" class="login">
|
<a href="#" class="login" id="user-login-menu">
|
||||||
{{ uporabnik }} <span class="arrow-down"></span>
|
{{ uporabnik }} <span class="arrow-down"></span>
|
||||||
</a>
|
</a>
|
||||||
<div id="user-menu">
|
<div id="user-menu" style="display: none;">
|
||||||
<div name="odjava" method="post" action="/frontend/api/api.php?action=logout">
|
<div name="odjava" method="post" action="/frontend/api/api.php?action=logout">
|
||||||
<ul class="user-menu-link">
|
<ul class="user-menu-link">
|
||||||
<li>
|
<li>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user