Tweak to allowed in editable wiki extensions
Tweak to allowed in editable wiki extensions
/**
* SeekQuarry/Yioop --
* Open Source Pure PHP Search Engine, Crawler, and Indexer
*
* Copyright (C) 2009 - 2024 Chris Pollett chris@pollett.org
*
* LICENSE:
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* END LICENSE
*
* @author Chris Pollett chris@pollett.org
* @license https://www.gnu.org/licenses/ GPL3
* @link https://www.seekquarry.com/
* @copyright 2009 - 2024
* @filesource
*/
/*
* Code for the user messages portion of Yioop
*/
function conversationUpdate()
{
let conversation_obj = elt('conversation');
let conversation_time = (conversation_obj) ?
parseInt(conversation_obj.getAttribute('data-time')) : 0;
getPage(null, start_url + conversation_time, function(text) {
conversation_obj.style.backgroundColor = "#EEE";
let tmp_container = document.createElement("div");
tmp_container.innerHTML = text;
let new_conversation_obj = tmp_container.getElementsByClassName(
'conversation')[0];
let update_time =
new_conversation_obj.getAttribute('data-time');
if (update_time) {
conversation_obj.setAttribute('data-time', update_time);
}
conversation_obj.innerHTML = new_conversation_obj.innerHTML +
conversation_obj.innerHTML;
setTimeout("resetBackground()", 0.5 * sec);
});
}
function clearUpdate()
{
clearInterval(conversation_update_id);
elt('conversation').innerHTML= "<h2 class='red'>" +
tl['social_component_no_longer_update'] + '</h2>';
}
function resetBackground()
{
elt('conversation').style.backgroundColor = "#FFF";
}
function doUpdate()
{
var sec = 1000;
var minute = 60 * sec;
conversation_update_time = 15;
conversation_update_id = setInterval("conversationUpdate()",
conversation_update_time * sec);
setTimeout("clearUpdate()", 20 * minute + sec);
}