Userlist javascript side... not yet ready but a start

parent e23c7d37
<html>
<html debug=true>
<head>
<title>SkyliveX 0.1.0</title>
<script type="text/javascript" src="https://getfirebug.com/firebug-lite.js"></script>
<script type="text/javascript" src="jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="SkyliveX.js"></script>
<script type="text/javascript">
function sendMsg()
......@@ -16,7 +18,6 @@
sendMsg();
}
}
</script>
<style>
......@@ -175,13 +176,41 @@
</div>
<div id="userlist" class="cssuserlist">
<p>ivan_staff</p>
<p>nextime</p>
<ul id="admins">
<li>ivan_staff</li>
<li>nextime</li>
</ul>
</div>
<form name="messagesend" onSubmit="return false;" >
<textarea id="chatinput" class="csschatinput" name="msginput" onKeyDown="msgInputKey(event);" >
</textarea>
</form>
<script type="text/javascript" >
function updateUserlist()
{
var d = new Date();
$.get("http://live1.skylive.name/tele1/userlist.txt?"+d.getTime(), function(data) {
var ad=$("#admins");
ad.empty();
var uarr = data.split("\n");
$.each(uarr, function(i) {
if(uarr[i].length > 2)
{
var t="<li>"+uarr[i]+"</li>";
ad.append(t);
//alert(uarr[i]);
}
});
});
}
document.addEventListener('DOMContentLoaded',function(){
//setTimeout(function() { SkyliveX.resizeWin(636, 420); }, 500);
updateUserlist();
setInterval(updateUserlist, 5000);
});
</script>
</body>
</html>
This diff is collapsed.
<html debug="true">
<head>
<title>SkyliveX 0.1.0</title>
<script type="text/javascript" src="jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="SkyliveX.js"></script>
<style>
......@@ -93,22 +94,11 @@
</div>
<script type="text/javascript" >
function showLiveImage(img)
{
if(img.complete)
{
document.getElementById("liveimg").src=img.src;
} else {
setTimeout(function(){showLiveImage(img);}, 250);
}
}
function updateLiveImage()
{
var tele=document.getElementById("numtele").options[document.getElementById("numtele").selectedIndex].value;
var newImage = new Image();
newImage.src="http://live1.skylive.name/tele"+tele+"live640.jpg?"+new Date().getTime();
var d = new Date();
var tele=document.getElementById("telsel").options[document.getElementById("telsel").selectedIndex].value;
$("#liveimg").attr("src", "http://live1.skylive.name/tele"+tele+"/live640.jpg?"+d.getTime());
}
document.addEventListener('DOMContentLoaded',function(){
SkyliveX.open_window("chatgui.html", false);
......
......@@ -82,6 +82,8 @@ WebWin::WebWin(QString &htmlfile)
settings()->setAttribute(QWebSettings::JavascriptCanCloseWindows, true);
settings()->setAttribute(QWebSettings::JavascriptCanAccessClipboard, true);
settings()->setAttribute(QWebSettings::PluginsEnabled, true);
settings()->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls, true);
settings()->setAttribute(QWebSettings::LocalContentCanAccessFileUrls, true);
QPalette pal = palette();
pal.setBrush(QPalette::Base, Qt::transparent);
......@@ -107,6 +109,8 @@ WebWin::WebWin()
settings()->setAttribute(QWebSettings::JavascriptCanCloseWindows, true);
settings()->setAttribute(QWebSettings::JavascriptCanAccessClipboard, true);
settings()->setAttribute(QWebSettings::PluginsEnabled, true);
settings()->setAttribute(QWebSettings::LocalContentCanAccessFileUrls, true);
settings()->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls, true);
msgsender = SENDER;
}
......@@ -147,6 +151,8 @@ QWebView* WebWin::createWindow(QWebPage::WebWindowType type)
// Assure plugin and js support also for this window.
wv->settings()->setAttribute(QWebSettings::PluginsEnabled, true);
wv->settings()->setAttribute(QWebSettings::JavascriptEnabled, true);
wv->settings()->setAttribute(QWebSettings::LocalContentCanAccessFileUrls, true);
wv->settings()->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls, true);
SKMessage msg("newwindow", qobject_cast<SkylivexWin *>(wv));
sendMessage(msg);
......@@ -310,10 +316,12 @@ SkylivexWin* SkylivexWin::createSkyliveWindow(QString url, QWebPage::WebWindowTy
// Assure plugin and js support also for this window.
wv->settings()->setAttribute(QWebSettings::PluginsEnabled, true);
wv->settings()->setAttribute(QWebSettings::JavascriptEnabled, true);
wv->setPage(newWeb);
wv->setAttribute(Qt::WA_DeleteOnClose, true);
wv->settings()->setAttribute(QWebSettings::LocalContentCanAccessFileUrls, true);
wv->settings()->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls, true);
if (type == QWebPage::WebModalDialog)
wv->setWindowModality(Qt::ApplicationModal);
QList<QString> urilist = url.split("://");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment