From 71936e14d6cc8f5f9cbb88a802aca2d53536834c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Sun, 27 Jan 2013 22:10:37 +0100 Subject: [PATCH] Use PACKAGE_VERSION --- file/lib/page/ChatPage.class.php | 15 --------------- language/de.xml | 2 +- template/chat.tpl | 8 +++----- template/javascriptInclude.tpl | 4 ++-- 4 files changed, 6 insertions(+), 23 deletions(-) diff --git a/file/lib/page/ChatPage.class.php b/file/lib/page/ChatPage.class.php index 1fdde3c..5929d3d 100644 --- a/file/lib/page/ChatPage.class.php +++ b/file/lib/page/ChatPage.class.php @@ -14,13 +14,6 @@ * @subpackage page */ class ChatPage extends \wcf\page\AbstractPage { - /** - * The version of this installation of Tims Chat 3. - * - * @var string - */ - public $chatVersion = ''; - /** * @see wcf\page\AbstractPage::$loginRequired */ @@ -101,7 +94,6 @@ public function assignVariables() { parent::assignVariables(); WCF::getTPL()->assign(array( - 'chatVersion' => $this->chatVersion, 'newestMessages' => $this->newestMessages, 'room' => $this->room, 'roomID' => $this->roomID, @@ -113,13 +105,6 @@ public function assignVariables() { )); } - /** - * Reads chat-version. Used to avoid caching of JS-File when Tims Chat is updated. - */ - public function readChatVersion() { - return $this->chatVersion = \wcf\data\package\PackageCache::getInstance()->getPackage(\chat\util\ChatUtil::getPackageID())->packageVersion; - } - /** * @see \wcf\page\IPage::readData() */ diff --git a/language/de.xml b/language/de.xml index 3782994..5ac9154 100644 --- a/language/de.xml +++ b/language/de.xml @@ -66,7 +66,7 @@ Hinweis: Setzen Sie diese Einstellung nur, wenn Sie wissen, was sie bewirkt. Die - Tims Chat{if CHAT_SHOW_VERSION && $chatVersion|isset} {$chatVersion}{/if}, entwickelt in Tims Bastelstube]]> + Tims Chat{if SHOW_VERSION_NUMBER} {PACKAGE_VERSION}{/if}, entwickelt in Tims Bastelstube]]> diff --git a/template/chat.tpl b/template/chat.tpl index 56b6d21..0f4c40c 100644 --- a/template/chat.tpl +++ b/template/chat.tpl @@ -43,11 +43,9 @@ $('#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 = $('
'); - 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}' }); + if (!$.wcfIsset('timsChatCopyrightDialog')) $('
').appendTo('body'); + $('#timsChatCopyrightDialog').load('{link application='chat' controller='Chat' action='Copyright'}{/link}', function() { + WCF.showDialog('timsChatCopyrightDialog', { title: 'Tims Chat{if SHOW_VERSION_NUMBER} {PACKAGE_VERSION}{/if}' }); }); }); diff --git a/template/javascriptInclude.tpl b/template/javascriptInclude.tpl index 4c85af0..db03a05 100644 --- a/template/javascriptInclude.tpl +++ b/template/javascriptInclude.tpl @@ -1,5 +1,5 @@ - + {if CHAT_SOCKET_IO_PATH}{/if} - + {event name='javascript'} \ No newline at end of file