1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2024-10-31 14:10:08 +00:00

Edited copyright, moved JavaScript to head, fixed logPage

This commit is contained in:
max-m 2013-01-27 15:16:29 +01:00
parent 991f46973c
commit dc75c38b3f
10 changed files with 124 additions and 113 deletions

View File

@ -29,6 +29,8 @@ class CopyrightPage extends \wcf\page\AbstractPage {
*/
public $request = null;
public $templateName = '__copyright';
/**
* Disallows direct access.
*

View File

@ -106,7 +106,7 @@ public function readData() {
$this->room = $cache[$this->roomID];
if (!$this->room->canEnter()) throw new \wcf\system\exception\PermissionDeniedException();
$ph = new \wcf\system\chat\permission\ChatPermissionHandler();
$ph = new \chat\system\permission\PermissionHandler();
if (!$ph->getPermission($this->room, 'mod.canReadLog')) throw new \wcf\system\exception\PermissionDeniedException();
// TODO: actually read the correct messages

View File

@ -302,7 +302,7 @@
}
#timsChatCopyrightDialog {
background-position: right 45px;
background-position: right center;
background-repeat: no-repeat;
min-height: 50%;
}

View File

@ -66,7 +66,7 @@ Hinweis: Setzen Sie diese Einstellung nur, wenn Sie wissen, was sie bewirkt. Die
<item name="chat.general.rooms"><![CDATA[Räume]]></item>
<item name="chat.general.users"><![CDATA[Nutzer]]></item>
<item name="chat.general.copyright"><![CDATA[<a href="http://tims.bastelstu.be">Chat: <strong>Tims Chat</strong>{if CHAT_SHOW_VERSION && $chatVersion|isset} {$chatVersion}{/if}, entwickelt von <strong>TimWolla</strong></a>]]></item>
<item name="chat.general.copyright"><![CDATA[<a href="http://tims.bastelstu.be"><strong>Tims Chat</strong>{if CHAT_SHOW_VERSION && $chatVersion|isset} {$chatVersion}{/if}, entwickelt in <strong>Tims Bastelstube</strong></a>]]></item>
<item name="chat.general.copyright.leader"><![CDATA[Projektleiter]]></item>
<item name="chat.general.copyright.developer"><![CDATA[Entwickler]]></item>
<item name="chat.general.copyright.graphics"><![CDATA[Grafisches]]></item>

View File

@ -29,6 +29,7 @@
<instruction type="sql">install.sql</instruction>
<instruction type="objectType">objectType.xml</instruction>
<instruction type="option">option.xml</instruction>
<instruction type="templateListener">templateListener.xml</instruction>
<instruction type="pageMenu">pagemenu.xml</instruction>
<instruction type="eventListener">eventListener.xml</instruction>
<instruction type="aclOption">acloptions.xml</instruction>
@ -45,6 +46,7 @@
<instruction type="acpTemplate">acptemplate.tar</instruction>
<instruction type="objectType">objectType.xml</instruction>
<instruction type="option">option.xml</instruction>
<instruction type="templateListener">templateListener.xml</instruction>
<instruction type="pageMenu">pagemenu.xml</instruction>
<instruction type="eventListener">eventListener.xml</instruction>
<instruction type="aclOption">acloptions.xml</instruction>

47
template/__copyright.tpl Normal file
View File

@ -0,0 +1,47 @@
{if $__chat->isActiveApplication()}
{if $templateName != '__copyright'}<address id="timsChatCopyright" class="copyright marginTop">{lang}chat.general.copyright{/lang}</address>
{elseif $templateName == '__copyright'}
<dl>
<dt>{lang}chat.general.copyright.leader{/lang}</dt>
<dd>
<ul>
<li><a href="http://tims.bastelstu.be/">Tim Düsterhus</a></li>
</ul>
</dd>
</dl>
<dl>
<dt>{lang}chat.general.copyright.developer{/lang}</dt>
<dd>
<ul>
<li><a href="http://tims.bastelstu.be/">Tim Düsterhus</a></li>
<li><a href="https://github.com/max-m">Maximilian Mader</a></li>
</ul>
</dd>
</dl>
<dl>
<dt>{lang}chat.general.copyright.graphics{/lang}</dt>
<dd>
<ul>
<li><a href="http://www.cls-design.com/">Tom</a></li>
</ul>
</dd>
</dl>
{*<dl>
<dt>{lang}chat.general.copyright.translation{/lang}</dt>
<dd>
</dd>
</dl>*}
<dl>
<dt>{lang}chat.general.copyright.thanks{/lang}</dt>
<dd>
<ul>
<li><a href="http://www.wbbaddons.de/user/2020-noone/">-noone-</a></li>
<li>Gabi</li>
<li><a href="https://github.com/Leon-">Stefan Hahn</a></li>
<li><a href="http://www.wbbaddons.de">Martin Schwendowius</a></li>
</ul>
</dd>
</dl>
{/if}
{/if}

View File

@ -4,6 +4,63 @@
<title>{$room} - {lang}chat.general.title{/lang} - {PAGE_TITLE|language}</title>
{include file='headInclude' sandbox=false}
{include file='javascriptInclude'}
<script type="text/javascript">
//<![CDATA[
var chat;
(function ($, window) {
$(function(){
WCF.Language.addObject({
'chat.general.query': '{lang}chat.general.query{/lang}',
'chat.general.kick': '{lang}chat.general.kick{/lang}',
'chat.general.ban': '{lang}chat.general.ban{/lang}',
'chat.general.profile': '{lang}chat.general.profile{/lang}',
'chat.general.notify.title': '{lang}chat.general.notify.title{/lang}'
});
{event name='shouldInit'}
// Boot the chat
WCF.TabMenu.init();
new WCF.Message.Smilies();
{capture assign='messageTemplate'}{include application='chat' file='message'}{/capture}
chat = new be.bastelstu.Chat({
reloadTime: {@CHAT_RELOADTIME},
unloadURL: '{link controller="Chat" action="Leave"}{/link}',
messageURL: '{link controller="Chat" action="Message"}{/link}',
socketIOPath: '{@CHAT_SOCKET_IO_PATH|encodeJS}'
}, (new WCF.Template('{ldelim}$title} - {'chat.general.title'|language|encodeJS} - {PAGE_TITLE|language|encodeJS}')).compile(), (new WCF.Template('{@$messageTemplate|encodeJS}')).compile());
{event name='didInit'}
// show the last X messages
chat.handleMessages([
{implode from=$newestMessages item='message'}{@$message->jsonify()}{/implode}
]);
// enable user-interface
$('#timsChatInput').enable().jCounter().focus();
$('#timsChatCopyright').click(function (event) {
event.preventDefault();
if ($.wcfIsset('timsChatCopyrightDialog')) return WCF.showDialog('timsChatCopyrightDialog', { title: 'Tims Chat{if CHAT_SHOW_VERSION && $chatVersion|isset} {$chatVersion}{/if}' });
var container = $('<fieldset id="timsChatCopyrightDialog"></fieldset>');
container.load('{link application='chat' controller='Chat' action='Copyright'}{/link}', function() {
$('body').append(container);
WCF.showDialog('timsChatCopyrightDialog', { title: 'Tims Chat{if CHAT_SHOW_VERSION && $chatVersion|isset} {$chatVersion}{/if}' });
});
});
$('#chatLogLink').click(function (event) {
event.preventDefault();
be.bastelstu.Chat.Log.loadOverlay();
});
});
})(jQuery, this)
//]]>
</script>
<style type="text/css">
#timsChatCopyrightDialog {
background-image: url("{link application='chat' controller='Chat' action='Copyright' sheep=1}{/link}");
@ -44,8 +101,8 @@
<div id="timsChatTopic" class="container"{if $room->topic|language === ''} style="display: none;"{/if}>{$room->topic|language}</div>
<fieldset>
<div id="timsChatMessageContainer" class="timsChatMessageContainer container box shadow1">
<noscript><p class="error">{lang}chat.general.noJs{/lang}</p></noscript>
<ul>
<li class="error">{lang}chat.general.noJs{/lang}</li>
</ul>
</div>
</fieldset>
@ -118,65 +175,7 @@
</ul>
</nav>
</div>
{include file='copyright'}
</div>
{include file='javascriptInclude'}
<script type="text/javascript">
//<![CDATA[
var chat;
(function ($, window) {
// remove noscript message
$('.timsChatMessageContainer .error').remove();
WCF.Language.addObject({
'chat.general.query': '{lang}chat.general.query{/lang}',
'chat.general.kick': '{lang}chat.general.kick{/lang}',
'chat.general.ban': '{lang}chat.general.ban{/lang}',
'chat.general.profile': '{lang}chat.general.profile{/lang}',
'chat.general.notify.title': '{lang}chat.general.notify.title{/lang}'
});
{event name='shouldInit'}
// Boot the chat
WCF.TabMenu.init();
new WCF.Message.Smilies();{*
*}{capture assign='messageTemplate'}{include application='chat' file='message'}{/capture}
chat = new be.bastelstu.Chat({
reloadTime: {@CHAT_RELOADTIME},
unloadURL: '{link controller="Chat" action="Leave"}{/link}',
messageURL: '{link controller="Chat" action="Message"}{/link}',
socketIOPath: '{@CHAT_SOCKET_IO_PATH|encodeJS}'
}, (new WCF.Template('{ldelim}$title} - {'chat.general.title'|language|encodeJS} - {PAGE_TITLE|language|encodeJS}')).compile(), (new WCF.Template('{@$messageTemplate|encodeJS}')).compile());
{event name='didInit'}
// show the last X messages
chat.handleMessages([
{implode from=$newestMessages item='message'}{@$message->jsonify()}{/implode}
]);
// enable user-interface
$('#timsChatInput').enable().jCounter().focus();
$('#timsChatCopyright').click(function (event) {
event.preventDefault();
if ($.wcfIsset('timsChatCopyrightDialog')) return WCF.showDialog('timsChatCopyrightDialog', { title: 'Tims Chat{if CHAT_SHOW_VERSION && $chatVersion|isset} {$chatVersion}{/if}' });
var container = $('<fieldset id="timsChatCopyrightDialog"></fieldset>');
container.load('{link application='chat' controller='Chat' action='Copyright'}{/link}', function() {
$('body').append(container);
WCF.showDialog('timsChatCopyrightDialog', { title: 'Tims Chat{if CHAT_SHOW_VERSION && $chatVersion|isset} {$chatVersion}{/if}' });
});
});
$('#chatLogLink').click(function (event) {
event.preventDefault();
be.bastelstu.WCF.Chat.Log.loadOverlay();
});
})(jQuery, this)
//]]>
</script>
{include file='footer' sandbox=false}
</body>
</html>

View File

@ -1,50 +0,0 @@
{if $templateName == 'chat'}<address id="timsChatCopyright" class="copyright">{lang}chat.general.copyright{/lang}</address>
{elseif $templateName == 'copyright'}
<dl>
<dt>{lang}chat.general.copyright.leader{/lang}</dt>
<dd>
<ul>
<li><a href="http://tims.bastelstu.be/">Tim Düsterhus</a></li>
</ul>
</dd>
</dl>
<dl>
<dt>{lang}chat.general.copyright.developer{/lang}</dt>
<dd>
<ul>
<li><a href="http://tims.bastelstu.be/">Tim Düsterhus</a></li>
<li><a href="https://github.com/max-m">Maximilian Mader</a></li>
</ul>
</dd>
</dl>
<dl>
<dt>{lang}chat.general.copyright.graphics{/lang}</dt>
<dd>
<ul>
<li><a href="http://www.cls-design.com/">Tom</a></li>
</ul>
</dd>
</dl>
<dl>
<dt>{lang}chat.general.copyright.translation{/lang}</dt>
<dd>
<ul>
<li>Riccardo Vianello (it)</li>
</ul>
</dd>
</dl>
<dl>
<dt>{lang}chat.general.copyright.thanks{/lang}</dt>
<dd>
<ul>
<li><a href="http://www.wbbaddons.de/user/2020-noone/">-noone-</a></li>
<li><a href="https://github.com/dtdesign">Alexander Ebert</a></li>
<li>Gabi</li>
<li><a href="https://github.com/Leon-">Stefan Hahn</a></li>
<li><a href="http://packageforge.de">Oliver Kliebisch</a></li>
<li>Christian Kubandt</li>
<li><a href="http://www.wbbaddons.de">Martin Schwendowius</a></li>
</ul>
</dd>
</dl>
{/if}

View File

@ -6,7 +6,7 @@
</div>
<script type="text/javascript">
//<![CDATA[
var log = new be.bastelstu.WCF.Chat.Log(chat);
var log = new be.bastelstu.Chat.Log(chat);
log.handleMessages([
{implode from=$messages item='message'}
{@$message->jsonify()}

11
templateListener.xml Normal file
View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<data xmlns="http://www.woltlab.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.woltlab.com http://www.woltlab.com/XSD/templateListener.xsd">
<import>
<templatelistener name="copyright">
<environment>user</environment>
<templatename>footer</templatename>
<eventname>copyright</eventname>
<templatecode><![CDATA[{include file='__copyright' application='chat'}]]></templatecode>
</templatelistener>
</import>
</data>