Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
bg-az-counter
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
azbyka_bg
bg-az-counter
Commits
0e8c96ab
Commit
0e8c96ab
authored
Nov 05, 2019
by
Vadim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Version 2.6.2
1. Исправлена ошибка с прокруткой 2. Увеличен таймаут для ReconnectingWebSocket до 10 сек.
parent
b62314f2
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
6 deletions
+10
-6
bg_az-counter.php
bg_az-counter.php
+2
-2
counter.js
js/counter.js
+6
-3
rating.js
js/rating.js
+2
-1
No files found.
bg_az-counter.php
View file @
0e8c96ab
...
...
@@ -3,7 +3,7 @@
Plugin Name: Bg Az-Counter
Plugin URI: https://bogaiskov.ru
Description: Подсчет количества посещений страниц на базе stat.azbyka.ru
Version: 2.6.
1
Version: 2.6.
2
Author: VBog
Author URI: https://bogaiskov.ru
License: GPL2
...
...
@@ -38,7 +38,7 @@
if
(
!
defined
(
'ABSPATH'
)
)
{
die
(
'Sorry, you are not allowed to access this page directly.'
);
}
define
(
'BG_COUNTER_VERSION'
,
'2.6.
1
'
);
define
(
'BG_COUNTER_VERSION'
,
'2.6.
2
'
);
define
(
'BG_COUNTER_LOG'
,
dirname
(
__FILE__
)
.
'/bg_counter.log'
);
define
(
'BG_COUNTER_STAT_COUNTERS'
,
'https://stat.azbyka.ru/counters'
);
...
...
js/counter.js
View file @
0e8c96ab
...
...
@@ -9,7 +9,8 @@ jQuery( document ).ready(function() {
// для переподключения сокета при разрыве соединения.
// Вместо: var socket = new WebSocket(request);
// используем вызов:
var
socket
=
new
ReconnectingWebSocket
(
request
);
// var socket = new ReconnectingWebSocket(request);
var
socket
=
new
ReconnectingWebSocket
(
request
,
null
,
{
timeoutInterval
:
10000
});
socket
.
onopen
=
function
()
{
if
(
bg_counter
.
debug
)
console
.
log
(
" Соединение установлено: "
+
request
);
GetAllCounters
();
...
...
@@ -70,7 +71,8 @@ jQuery( document ).ready(function() {
var
json
=
JSON
.
stringify
(
data
);
var
request
=
bg_counter
.
updatesocket
+
(
bg_counter
.
updatetime
?(
'?time='
+
bg_counter
.
updatetime
):
''
);
// Создаем сокет
var
updatesocket
=
new
ReconnectingWebSocket
(
request
);
// var updatesocket = new ReconnectingWebSocket(request);
var
updatesocket
=
new
ReconnectingWebSocket
(
request
,
null
,
{
timeoutInterval
:
10000
});
// Отправляем данные, как только сокет будет подключен
updatesocket
.
onopen
=
function
()
{
if
(
bg_counter
.
debug
)
{
...
...
@@ -190,7 +192,7 @@ function GetAllCounters() {
jQuery
(
'span.bg-az-counter'
).
each
(
function
()
{
var
el
=
jQuery
(
this
);
bg_counter_elements
=
el
.
length
;
//
bg_counter_elements = el.length;
var
type
=
el
.
attr
(
'data-type'
);
var
id
=
el
.
attr
(
'data-ID'
);
var
project
=
el
.
attr
(
'data-project'
);
...
...
@@ -291,6 +293,7 @@ function bg_counter_elements_reloaded_on_scroll() {
return
;
}
if
(
elem
.
length
>
bg_counter_elements
)
{
bg_counter_elements
=
elem
.
length
;
GetAllCounters
();
// getAllRates();
}
...
...
js/rating.js
View file @
0e8c96ab
...
...
@@ -132,7 +132,7 @@ function getAllRates() {
jQuery
(
'span.bg-az-counter'
).
each
(
function
()
{
var
el
=
jQuery
(
this
);
bg_counter_ratings
=
el
.
length
;
//
bg_counter_ratings = el.length;
var
type
=
el
.
attr
(
'data-type'
);
var
id
=
el
.
attr
(
'data-ID'
);
var
project
=
el
.
attr
(
'data-project'
);
...
...
@@ -239,6 +239,7 @@ function bg_counter_ratings_reloaded_on_scroll() {
return
;
}
if
(
elem
.
length
>
bg_counter_ratings
)
{
bg_counter_ratings
=
elem
.
length
;
getAllRates
();
}
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment