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

parent e23c7d37
<html> <html debug=true>
<head> <head>
<title>SkyliveX 0.1.0</title> <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" src="SkyliveX.js"></script>
<script type="text/javascript"> <script type="text/javascript">
function sendMsg() function sendMsg()
...@@ -16,7 +18,6 @@ ...@@ -16,7 +18,6 @@
sendMsg(); sendMsg();
} }
} }
</script> </script>
<style> <style>
...@@ -175,13 +176,41 @@ ...@@ -175,13 +176,41 @@
</div> </div>
<div id="userlist" class="cssuserlist"> <div id="userlist" class="cssuserlist">
<p>ivan_staff</p> <ul id="admins">
<p>nextime</p> <li>ivan_staff</li>
<li>nextime</li>
</ul>
</div> </div>
<form name="messagesend" onSubmit="return false;" > <form name="messagesend" onSubmit="return false;" >
<textarea id="chatinput" class="csschatinput" name="msginput" onKeyDown="msgInputKey(event);" > <textarea id="chatinput" class="csschatinput" name="msginput" onKeyDown="msgInputKey(event);" >
</textarea> </textarea>
</form> </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> </body>
</html> </html>
This diff is collapsed.
<html debug="true"> <html debug="true">
<head> <head>
<title>SkyliveX 0.1.0</title> <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> <script type="text/javascript" src="SkyliveX.js"></script>
<style> <style>
...@@ -93,22 +94,11 @@ ...@@ -93,22 +94,11 @@
</div> </div>
<script type="text/javascript" > <script type="text/javascript" >
function showLiveImage(img)
{
if(img.complete)
{
document.getElementById("liveimg").src=img.src;
} else {
setTimeout(function(){showLiveImage(img);}, 250);
}
}
function updateLiveImage() function updateLiveImage()
{ {
var d = new Date();
var tele=document.getElementById("numtele").options[document.getElementById("numtele").selectedIndex].value; var tele=document.getElementById("telsel").options[document.getElementById("telsel").selectedIndex].value;
var newImage = new Image(); $("#liveimg").attr("src", "http://live1.skylive.name/tele"+tele+"/live640.jpg?"+d.getTime());
newImage.src="http://live1.skylive.name/tele"+tele+"live640.jpg?"+new Date().getTime();
} }
document.addEventListener('DOMContentLoaded',function(){ document.addEventListener('DOMContentLoaded',function(){
SkyliveX.open_window("chatgui.html", false); SkyliveX.open_window("chatgui.html", false);
......
...@@ -82,6 +82,8 @@ WebWin::WebWin(QString &htmlfile) ...@@ -82,6 +82,8 @@ WebWin::WebWin(QString &htmlfile)
settings()->setAttribute(QWebSettings::JavascriptCanCloseWindows, true); settings()->setAttribute(QWebSettings::JavascriptCanCloseWindows, true);
settings()->setAttribute(QWebSettings::JavascriptCanAccessClipboard, true); settings()->setAttribute(QWebSettings::JavascriptCanAccessClipboard, true);
settings()->setAttribute(QWebSettings::PluginsEnabled, true); settings()->setAttribute(QWebSettings::PluginsEnabled, true);
settings()->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls, true);
settings()->setAttribute(QWebSettings::LocalContentCanAccessFileUrls, true);
QPalette pal = palette(); QPalette pal = palette();
pal.setBrush(QPalette::Base, Qt::transparent); pal.setBrush(QPalette::Base, Qt::transparent);
...@@ -107,6 +109,8 @@ WebWin::WebWin() ...@@ -107,6 +109,8 @@ WebWin::WebWin()
settings()->setAttribute(QWebSettings::JavascriptCanCloseWindows, true); settings()->setAttribute(QWebSettings::JavascriptCanCloseWindows, true);
settings()->setAttribute(QWebSettings::JavascriptCanAccessClipboard, true); settings()->setAttribute(QWebSettings::JavascriptCanAccessClipboard, true);
settings()->setAttribute(QWebSettings::PluginsEnabled, true); settings()->setAttribute(QWebSettings::PluginsEnabled, true);
settings()->setAttribute(QWebSettings::LocalContentCanAccessFileUrls, true);
settings()->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls, true);
msgsender = SENDER; msgsender = SENDER;
} }
...@@ -147,6 +151,8 @@ QWebView* WebWin::createWindow(QWebPage::WebWindowType type) ...@@ -147,6 +151,8 @@ QWebView* WebWin::createWindow(QWebPage::WebWindowType type)
// Assure plugin and js support also for this window. // Assure plugin and js support also for this window.
wv->settings()->setAttribute(QWebSettings::PluginsEnabled, true); wv->settings()->setAttribute(QWebSettings::PluginsEnabled, true);
wv->settings()->setAttribute(QWebSettings::JavascriptEnabled, 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)); SKMessage msg("newwindow", qobject_cast<SkylivexWin *>(wv));
sendMessage(msg); sendMessage(msg);
...@@ -314,6 +320,8 @@ SkylivexWin* SkylivexWin::createSkyliveWindow(QString url, QWebPage::WebWindowTy ...@@ -314,6 +320,8 @@ SkylivexWin* SkylivexWin::createSkyliveWindow(QString url, QWebPage::WebWindowTy
wv->setPage(newWeb); wv->setPage(newWeb);
wv->setAttribute(Qt::WA_DeleteOnClose, true); wv->setAttribute(Qt::WA_DeleteOnClose, true);
wv->settings()->setAttribute(QWebSettings::LocalContentCanAccessFileUrls, true);
wv->settings()->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls, true);
if (type == QWebPage::WebModalDialog) if (type == QWebPage::WebModalDialog)
wv->setWindowModality(Qt::ApplicationModal); wv->setWindowModality(Qt::ApplicationModal);
QList<QString> urilist = url.split("://"); 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