const start = new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate(), 0, 0, 0, 1);
setInterval(() => {
const arr = String((parseInt((new Date - start) / 1000))).split("");
const length = arr.length;
let html = `<div id="counter"><div id="counter-on-site">Сейчас на сайте</div><div id="counter-digits"><div id="counter-digits-tab-1" class="counter-digits-tabs" style="display: block;">`;
for (let i = 0; i < length; i += 1) {
html += `<span class="digit-${i}">${arr[i]}</span>`;
}
html += "</div></div><div id=\"counter-digits-tabs-triggers\"><a href=\"#counter-digits-tab-1\" class=\"active\">Организаций</a><div class=\"clear\"></div></div></div>";
document.body.innerHTML = html;
}, 1000);
<div id="counter">
<div id="counter-on-site">Сейчас на сайте</div>
<div id="counter-digits">
<div id="counter-digits-tab-1" class="counter-digits-tabs" style="display: block;">
<script type="text/javascript">
const today = new Date();
const start = new Date(today.getFullYear(), today.getMonth(), today.getDate(), 0, 0, 0, 1);
const result = document.createElement("div");
result.id = "txt";
setInterval(() => {
const value = (parseInt((new Date - start) / 1000));
const arr = String(value).split("");
const length = arr.length;
let html = "";
for (let i = 0; i < length; i += 1) {
html += `<span class="digit-${i}">${arr[i]}</span><br>`;
}
document.body.innerHTML = html;
}, 1000);
</script>
</div>
</div>
<div id="counter-digits-tabs-triggers">
<a href="#counter-digits-tab-1" class="active">Организаций</a>
<div class="clear"></div>
</div>
</div>
$(function(){
var filterSearch = decodeURIComponent(location.href).slice(1).split('/');
for(var i = 0; i < filterSearch.length; i++){
filterSearch[i] = filterSearch[i].split('=');
filterSearch[i][0] = filterSearch[i][0].replace(/\+/g, " ");
if(filterSearch[i][1])
filterSearch[i][1] = filterSearch[i][1].replace(/\+/g, " ");
}
if(filterSearch.length != 0){
$('[data-filtertriger=fieldseacrh] input[type="text"]').each(function(i){
for(var i = 0; i < filterSearch.length; i++){
if($(this).attr('name') != undefined)
{
if($(this).attr('name') == filterSearch[i][0]){
if($(this).attr('name').indexOf('r-') + 1)
{
var sliders = $(this).data("ionRangeSlider");
var data_slider = filterSearch[i][1].split(";");
sliders.update({
from: data_slider[0],
to: data_slider[1]
});
}
else
{
$(this).val(filterSearch[i][1]);
}
}
}
}
});
$('[data-filtertriger=fieldseacrh] input[type="hidden"]').each(function(i){
for(var i = 0; i < filterSearch.length; i++){
if($(this).attr('name') != undefined)
{
if($(this).attr('name') == filterSearch[i][0]){
$(this).val(filterSearch[i][1]);
}
}
}
});
$('[data-filtertriger=fieldseacrh] select').each(function(i){
for(var i = 0; i < filterSearch.length; i++){
if($(this).attr('name') != undefined)
{
if($(this).attr('name') == filterSearch[i][0]){
$(this).children('option').each(function(n){
if($(this).val() == filterSearch[i][1]){
$(this).attr('selected', true);
}
});
}
}
}
});
$('[data-filtertriger=fieldseacrh] input[type="radio"], [data-filtertriger=fieldseacrh] input[type="checkbox"]').each(function(i){
for(var i = 0; i < filterSearch.length; i++){
if($(this).attr('name') != undefined)
{
if($(this).attr('name') == filterSearch[i][0] && $(this).val() == filterSearch[i][1]){
$(this).attr('checked', 'checked');
}
}
}
});
}
});
/*
=====================================================
Field Search - Сортировка новостей пользователями по доп полям и не только
-----------------------------------------------------
Автор : Gameer
-----------------------------------------------------
Site : http://gameer.name/
-----------------------------------------------------
Copyright (c) 2016 Gameer
=====================================================
Данный код защищен авторскими правами
*/
var back_url = window.location.pathname;
var back_title = document.title;
var back_speedbar = document.getElementById("dle-speedbar");
$(function(){
$('body').on('click', '[data-fieldsearch=submit]', function() {
var $filter_field = $(this).closest('form').serialize();
window.history.replaceState(null, null, "/");
ShowLoading("Ищем... ищем... ищем...");
$.post(dle_root + "engine/ajax/field_search.php", { form_field : $filter_field }, function(data){
if(data)
{
window.history.replaceState(null, null, "/");
var content = jQuery.parseJSON( data );
$("#dle-content1").remove();
$("#dle-content").css("display", "none");
$("#dle-content").before("<div id=\"dle-content1\">" + content.content + "</div>");
window.history.replaceState(null, null, content.url);
}
});
HideLoading("");
return false;
});
$('body').on('click', '.field_search_nav > a', function() {
var $filter_field = $( this ).attr("href");
window.history.replaceState(null, null, "/");
ShowLoading("Ищем... ищем... ищем...");
$.post(dle_root + "engine/ajax/field_search.php", { form_field : $filter_field, filter_nav : 1 }, function(data){
if(data)
{
window.history.replaceState(null, null, "/");
var content = jQuery.parseJSON( data );
document.title = content.meta_title;
$("#dle-speedbar").html(content.speedbar);
$("#dle-content1").remove();
$("#dle-content").css("display", "none");
$("#dle-content").before("<div id=\"dle-content1\">" + content.content + "</div>");
window.history.replaceState(null, null, content.url);
}
});
HideLoading("");
return false;
});
$( "[data-filtertriger=fieldseacrh]" ).change(function() {
var $filter_field = $( this ).serialize();
window.history.replaceState(null, null, "/");
ShowLoading("Ищем... ищем... ищем...");
$.post(dle_root + "engine/ajax/field_search.php", { form_field : $filter_field }, function(data){
if(data)
{
window.history.replaceState(null, null, "/");
var content = jQuery.parseJSON( data );
$("#dle-content1").remove();
$("#dle-content").css("display", "none");
$("#dle-content").before("<div id=\"dle-content1\">" + content.content + "</div>");
window.history.replaceState(null, null, content.url);
}
});
HideLoading("");
});
$('body').on('click', '[data-fieldsearch="reset"]', function() {
window.history.replaceState(null, null, back_url);
ShowLoading("Секунду...");
document.title = back_title;
$("#dle-speedbar").html(back_speedbar);
$('[data-filtertriger=fieldseacrh] input[type="text"]').each(function(i){
if($(this).attr('name') != undefined)
{
if($(this).attr('name').indexOf('r-') + 1)
{
var slider = $(this).data("ionRangeSlider");
slider.update({
from: slider.options.min,
to: slider.options.max
});
}
else
{
$(this).val('');
}
}
});
$('[data-filtertriger=fieldseacrh] select').each(function(i){
$(this).children('option').each(function(n){
$(this).attr('selected', false);
});
});
$('[data-filtertriger=fieldseacrh] input[type="radio"], [data-filtertriger=fieldseacrh] input[type="checkbox"]').each(function(i){
$(this).attr('checked', false);
});
$("#dle-content1").remove();
$("#dle-content").css("display", "block");
HideLoading("");
return false;
});
});