updates page

git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@419 c66351dc-e62f-0410-b875-e3a5c0b9693f
This commit is contained in:
Evgeny Gryaznov 2009-03-16 23:53:28 +00:00
parent d65956f59e
commit 4a50f1b346
3 changed files with 67 additions and 6 deletions

View File

@ -734,3 +734,16 @@ table.awaiting td.visitor {
color: #A1A1A1; color: #A1A1A1;
font-size: 11px; font-size: 11px;
} }
/* updates */
#news {
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 11px;
margin-bottom:15px;
padding:4px;
}
.newstext {
margin-bottom:1em;
}

View File

@ -0,0 +1,33 @@
function loadNews() {
if (typeof(window.webimNews) == "undefined" || typeof(window.webimNews.length) == "undefined")
return;
var str = "<div>";
for (var i = 0; i < window.webimNews.length; i++) {
str += "<div class=\"newstitle\"><a hre" + "f=\"" + window.webimNews[i].link + "\">" + window.webimNews[i].title + "</a>, <span class=\"small\">" + window.webimNews[i].date + "</span></div>";
str += "<div class=\"newstext\">" + window.webimNews[i].message+"</div>";
}
$("#news").html(str + "</div>");
}
function loadVersion() {
if(typeof(window.webimLatest) == "undefined" || typeof(window.webimLatest.version) == "undefined")
return;
var current = $("#cver").html();
if(current != window.webimLatest.version) {
if(current < window.webimLatest.version) {
$("#cver").css("color","red");
}
$("#lver").html(window.webimLatest.version+", Download <a href=\""+window.webimLatest.download+"\">"+window.webimLatest.title+"</a>");
} else {
$("#cver").css("color","green");
$("#lver").html(window.webimLatest.version);
}
}
$(function(){
loadNews();
loadVersion();
});

View File

@ -16,6 +16,14 @@ require_once("inc_menu.php");
$page['title'] = getlocal("updates.title"); $page['title'] = getlocal("updates.title");
$page['menuid'] = "settings"; $page['menuid'] = "settings";
function tpl_header() { global $page, $webimroot;
?>
<script type="text/javascript" language="javascript" src="<?php echo $webimroot ?>/js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" language="javascript" src="http://openwebim.org/latestWebim.js"></script>
<script type="text/javascript" language="javascript" src="<?php echo $webimroot ?>/js/update.js"></script>
<?php
}
function tpl_content() { global $page, $webimroot; function tpl_content() { global $page, $webimroot;
?> ?>
@ -33,11 +41,20 @@ function tpl_content() { global $page, $webimroot;
</ul> </ul>
<?php } ?> <?php } ?>
<div class="mform"><div class="formtop"><div class="formtopi"></div></div><div class="forminner"> <div class="mform"><div class="formtop"><div class="formtopi"></div></div><div class="forminner">
News:<br/>
<div id="news">
</div>
You are using:<br/> You are using:<br/>
&laquo;<span style="color:#bb5500;">Open</span> Web Messenger&raquo; <?php echo $page['version'] ?> <div id="cver"><?php echo $page['version'] ?></div>
<br/><br/> <br/>
Latest version:
<div id="lver"></div>
<br/>
Installed localizations:<br/> Installed localizations:<br/>
<?php foreach( $page['localizations'] as $loc ) { ?> <?php foreach( $page['localizations'] as $loc ) { ?>
@ -48,9 +65,7 @@ function tpl_content() { global $page, $webimroot;
Environment:<br/> Environment:<br/>
PHP <?php echo $page['phpVersion'] ?> PHP <?php echo $page['phpVersion'] ?>
<br/>
</div><div class="formbottom"><div class="formbottomi"></div></div></div> </div><div class="formbottom"><div class="formbottomi"></div></div></div>
</div> </div>