|
@@ -1,130 +1,8 @@
|
|
|
-function topic_list_load(topic_num, s_num, where) {
|
|
|
|
|
- var url = "/api/thread/" + String(topic_num) + "?render=1&num=" + String(s_num);
|
|
|
|
|
- var n_data = "";
|
|
|
|
|
-
|
|
|
|
|
- var xhr = new XMLHttpRequest();
|
|
|
|
|
- xhr.open("GET", url, true);
|
|
|
|
|
- xhr.send(null);
|
|
|
|
|
-
|
|
|
|
|
- xhr.onreadystatechange = function() {
|
|
|
|
|
- if(this.readyState === 4 && this.status === 200) {
|
|
|
|
|
- var t_data = JSON.parse(this.responseText);
|
|
|
|
|
- var t_plus_data = '';
|
|
|
|
|
-
|
|
|
|
|
- for(key in t_data) {
|
|
|
|
|
- n_data += t_data[key]['data'];
|
|
|
|
|
- t_plus_data += t_data[key]['plus_data'];
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- document.getElementById(where).innerHTML = n_data;
|
|
|
|
|
- eval(t_plus_data);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-function topic_plus_load(topic_num, num) {
|
|
|
|
|
- var test = setInterval(function() {
|
|
|
|
|
- var url = "/api/thread/" + String(topic_num) + "?num=" + num + "&render=1";
|
|
|
|
|
- var n_data = '';
|
|
|
|
|
- var n_num = 1;
|
|
|
|
|
-
|
|
|
|
|
- var xhr = new XMLHttpRequest();
|
|
|
|
|
- xhr.open("GET", url, true);
|
|
|
|
|
- xhr.send(null);
|
|
|
|
|
-
|
|
|
|
|
- xhr.onreadystatechange = function() {
|
|
|
|
|
- if(this.readyState === 4 && this.status === 200 && this.responseText !== '{}\n') {
|
|
|
|
|
- var t_data = JSON.parse(this.responseText);
|
|
|
|
|
- var t_plus_data = '';
|
|
|
|
|
-
|
|
|
|
|
- for(key in t_data) {
|
|
|
|
|
- n_data += t_data[key]['data'];
|
|
|
|
|
- n_num = key;
|
|
|
|
|
-
|
|
|
|
|
- t_plus_data += t_data[key]['plus_data'];
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- document.getElementById("plus_topic").innerHTML += n_data;
|
|
|
|
|
- eval(t_plus_data);
|
|
|
|
|
-
|
|
|
|
|
- topic_plus_load(topic_num, String(Number(num) + 1));
|
|
|
|
|
- clearInterval(test);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }, 5000);
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-function topic_main_load(topic_num, s_num) {
|
|
|
|
|
- if(s_num) {
|
|
|
|
|
- var url = "/api/thread/" + String(topic_num) + "?render=1&num=" + s_num;
|
|
|
|
|
- } else {
|
|
|
|
|
- var url = "/api/thread/" + String(topic_num) + "?render=1";
|
|
|
|
|
- }
|
|
|
|
|
- var n_data = "";
|
|
|
|
|
- var num = 1;
|
|
|
|
|
-
|
|
|
|
|
- var xhr = new XMLHttpRequest();
|
|
|
|
|
- xhr.open("GET", url, true);
|
|
|
|
|
- xhr.send(null);
|
|
|
|
|
-
|
|
|
|
|
- xhr.onreadystatechange = function() {
|
|
|
|
|
- if(this.readyState === 4 && this.status === 200) {
|
|
|
|
|
- var t_data = JSON.parse(this.responseText);
|
|
|
|
|
- var t_plus_data = '';
|
|
|
|
|
-
|
|
|
|
|
- for(var key in t_data) {
|
|
|
|
|
- n_data += t_data[key]['data'];
|
|
|
|
|
- num = key;
|
|
|
|
|
-
|
|
|
|
|
- t_plus_data += t_data[key]['plus_data'];
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- document.getElementById('main_topic').innerHTML = n_data;
|
|
|
|
|
- eval(t_plus_data);
|
|
|
|
|
-
|
|
|
|
|
- if(window.location.hash) {
|
|
|
|
|
- document.getElementById(window.location.hash.replace(/^#/, '')).focus();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if(!s_num) {
|
|
|
|
|
- topic_plus_load(topic_num, String(Number(num) + 1));
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-function topic_top_load(topic_num) {
|
|
|
|
|
- var url = "/api/thread/" + String(topic_num) + "?top=1&render=1";
|
|
|
|
|
- var n_data = "";
|
|
|
|
|
- var num = 1;
|
|
|
|
|
-
|
|
|
|
|
- var xhr = new XMLHttpRequest();
|
|
|
|
|
- xhr.open("GET", url, true);
|
|
|
|
|
- xhr.send(null);
|
|
|
|
|
-
|
|
|
|
|
- xhr.onreadystatechange = function() {
|
|
|
|
|
- if(this.readyState === 4 && this.status === 200) {
|
|
|
|
|
- var t_data = JSON.parse(this.responseText);
|
|
|
|
|
- var t_plus_data = '';
|
|
|
|
|
-
|
|
|
|
|
- for(var key in t_data) {
|
|
|
|
|
- n_data += t_data[key]['data'];
|
|
|
|
|
- num = key;
|
|
|
|
|
-
|
|
|
|
|
- t_plus_data += t_data[key]['plus_data'];
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- document.getElementById('top_topic').innerHTML = n_data;
|
|
|
|
|
- eval(t_plus_data);
|
|
|
|
|
-
|
|
|
|
|
- topic_main_load(topic_num, null);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-function new_topic_load(topic_num, con = 1, type_do = 0, some = '', where = 'top_topic') {
|
|
|
|
|
- if(type_do === 0) {
|
|
|
|
|
|
|
+function new_topic_load(topic_num, type_do = 'top', some = '', where = 'top_topic') {
|
|
|
|
|
+ if(type_do === 'top') {
|
|
|
var url = "/api/thread/" + topic_num + "?top=1";
|
|
var url = "/api/thread/" + topic_num + "?top=1";
|
|
|
|
|
+ } else if(type_do === 'main') {
|
|
|
|
|
+ var url = "/api/thread/" + topic_num;
|
|
|
} else {
|
|
} else {
|
|
|
var url = "/api/thread/" + topic_num + some;
|
|
var url = "/api/thread/" + topic_num + some;
|
|
|
}
|
|
}
|
|
@@ -137,13 +15,14 @@ function new_topic_load(topic_num, con = 1, type_do = 0, some = '', where = 'top
|
|
|
if(this.readyState === 4 && this.status === 200) {
|
|
if(this.readyState === 4 && this.status === 200) {
|
|
|
var data_t = JSON.parse(this.responseText);
|
|
var data_t = JSON.parse(this.responseText);
|
|
|
var start = 0;
|
|
var start = 0;
|
|
|
|
|
+ var key_v = '?num=1';
|
|
|
|
|
|
|
|
for(var key in data_t) {
|
|
for(var key in data_t) {
|
|
|
var data_a = '';
|
|
var data_a = '';
|
|
|
if(start === 0) {
|
|
if(start === 0) {
|
|
|
var admin = data_t['data_main']['admin'];
|
|
var admin = data_t['data_main']['admin'];
|
|
|
var ip_first = data_t['data_main']['ip_first'];
|
|
var ip_first = data_t['data_main']['ip_first'];
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
start = 1;
|
|
start = 1;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -151,6 +30,8 @@ function new_topic_load(topic_num, con = 1, type_do = 0, some = '', where = 'top
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ key_v = '?num=' + String(Number(key) + 1);
|
|
|
|
|
+
|
|
|
var color_b = '';
|
|
var color_b = '';
|
|
|
var color_t = '';
|
|
var color_t = '';
|
|
|
|
|
|
|
@@ -191,7 +72,6 @@ function new_topic_load(topic_num, con = 1, type_do = 0, some = '', where = 'top
|
|
|
color_t = 'toron_color';
|
|
color_t = 'toron_color';
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- console.log(data_t[key])
|
|
|
|
|
data_a += '' +
|
|
data_a += '' +
|
|
|
'<table id="toron">' +
|
|
'<table id="toron">' +
|
|
|
'<tr>' +
|
|
'<tr>' +
|
|
@@ -214,8 +94,25 @@ function new_topic_load(topic_num, con = 1, type_do = 0, some = '', where = 'top
|
|
|
eval(data_t[key]['data_pas'][1]);
|
|
eval(data_t[key]['data_pas'][1]);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if(con === 1) {
|
|
|
|
|
- new_topic_load(topic_num, 0, type_do + 1, '', where);
|
|
|
|
|
|
|
+ if(type_do === 'top') {
|
|
|
|
|
+ new_topic_load(topic_num, 'main', '', 'main_topic');
|
|
|
|
|
+ } else if(type_do === 'main') {
|
|
|
|
|
+ data_url_v = window.location.href.split('#');
|
|
|
|
|
+ if(data_url_v.length !== 0) {
|
|
|
|
|
+ if(document.getElementById(data_url_v[1])) {
|
|
|
|
|
+ document.getElementById(data_url_v[1]).focus();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ new_topic_load(topic_num, 're', key_v, where);
|
|
|
|
|
+ } else if(type_do === 're') {
|
|
|
|
|
+ setTimeout(function() {
|
|
|
|
|
+ if(start === 0) {
|
|
|
|
|
+ new_topic_load(topic_num, 're', some, where);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ new_topic_load(topic_num, 're', key_v, where);
|
|
|
|
|
+ }
|
|
|
|
|
+ }, 2000);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|