Reset
This commit is contained in:
160
templates/moko-cassiopeia/html/mod_gabble/default.php
Normal file
160
templates/moko-cassiopeia/html/mod_gabble/default.php
Normal file
@@ -0,0 +1,160 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Tabaoca.Component.Gabble.Site
|
||||
* @subpackage mod_gabble
|
||||
* @copyright (C) 2023 Jonatas C. Ferreira
|
||||
* @license GNU/AGPL v3 (see licence.txt)
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
|
||||
$currentuser = Factory::getuser();
|
||||
$app = Factory::getApplication();
|
||||
$session = $app->getSession();
|
||||
$config = $app->getParams('com_gabble');
|
||||
$document = Factory::getDocument();
|
||||
$document->addStyleSheet('media/com_gabble/css/gabble.css');
|
||||
$document->addStyleSheet('media/templates/site/cassiopeia_meaewellness/css/gable.css');
|
||||
$lang = Factory::getLanguage();
|
||||
$lang->load('com_gabble');
|
||||
|
||||
Text::script('COM_GABBLE_TIMEOUT');
|
||||
|
||||
if ( !$currentuser->get("id")){
|
||||
|
||||
echo '<div class="content">
|
||||
<div id="mod_gable">
|
||||
<div id="mod_lists_gabble">
|
||||
<div class="taba-user-on"><div class="taba-user"><i class="icon-joomla"></i> '. Text::_('COM_GABBLE_LOGGEDIN') . '</div></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
$input = $app->input;
|
||||
|
||||
if ($input->get('option') == 'com_gabble') {
|
||||
|
||||
echo '<div class="content">
|
||||
<div id="mod_gabble">
|
||||
<div id="mod_lists_gabble">
|
||||
<button id="btn_gabble" class="button_list" onclick="window.location.href = "' . Uri::root() . '";"><i class="icon-home"></i></button>
|
||||
<div class="taba-user-on"><div class="taba-user"><i class="icon-joomla"></i> '. Text::_('COM_GABBLE_GABBLE_CHAT') . '</div></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
$document->addScript('media/com_gabble/js/gabble_com.js');
|
||||
//$document->addScript('media/templates/site/cassiopeia_meaewellness/js/mod_gabblegabble_com.js');
|
||||
?>
|
||||
|
||||
<div class="content">
|
||||
|
||||
<div id="mod_gabble">
|
||||
|
||||
<div id="list_windows" class="list-windows"></div>
|
||||
<div id="main_windows" class="main-windows"></div>
|
||||
|
||||
<div id="lists_gabble">
|
||||
|
||||
<div id="select_list" class="row">
|
||||
|
||||
<div class="col-md-4 notifications" title="<?php echo Text::_('COM_GABBLE_CHATS'); ?>">
|
||||
<button id="list_chats" class="button_list" title="Chats" onclick="select_list(1);"><i class="icon-comments-2"></i></button>
|
||||
<div id="n_notifications" class="n-notifications" title="Users" hidden=""></div>
|
||||
</div>
|
||||
<div class="col-md-4" title="<?php echo Text::_('COM_GABBLE_USERS'); ?>">
|
||||
<button id="list_users" class="button_list" onclick="select_list(2);"><i class="icon-users"></i></button>
|
||||
</div>
|
||||
<div class="col-md-4" title="<?php echo Text::_('COM_GABBLE_GABBLE_CHAT'); ?>">
|
||||
<button id="btn_gabble" class="button_list" onclick="window.location.href = "<?php echo Uri::root().'index.php?option=com_gabble&view=gabble'; ?>";"><i class="icon-expand-2"></i></button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="options_list" hidden="">
|
||||
<select id="users_list" name="users_list" onchange="select_list(2);">
|
||||
<option value="0"><?php echo Text::_('COM_GABBLE_USERS_ON'); ?></option>
|
||||
<option value="1"><?php echo Text::_('COM_GABBLE_USERS_ALL'); ?></option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div id="frame_list">
|
||||
<iframe
|
||||
id="users_frame"
|
||||
class="iframe_list"
|
||||
srcdoc="<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="<?php echo Uri::root().'media/com_gabble/css/gabble.css'; ?>" type="text/css"/>
|
||||
</head>
|
||||
<body class="taba-content">
|
||||
</body>
|
||||
</html>"
|
||||
marginwidth="0"
|
||||
marginheight="0"
|
||||
onload="setup_com();"
|
||||
hidden="">
|
||||
</iframe>
|
||||
<iframe
|
||||
id="users_on_frame"
|
||||
class="iframe_list"
|
||||
srcdoc="<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="<?php echo Uri::root().'media/com_gabble/css/gabble.css'; ?>" type="text/css"/>
|
||||
</head>
|
||||
<body class="taba-content">
|
||||
</body>
|
||||
</html>"
|
||||
marginwidth="0"
|
||||
marginheight="0"
|
||||
hidden="">
|
||||
</iframe>
|
||||
<iframe
|
||||
id="feeds_frame"
|
||||
class="iframe_list"
|
||||
srcdoc="<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="<?php echo Uri::root().'media/com_gabble/css/gabble.css'; ?>" type="text/css"/>
|
||||
</head>
|
||||
<body class="taba-content">
|
||||
</body>
|
||||
</html>"
|
||||
marginwidth="0"
|
||||
marginheight="0"
|
||||
hidden="">
|
||||
</iframe>
|
||||
</div>
|
||||
|
||||
<div id="openai_btn" title="OpenAi GPT" onclick="open_user(0); event.stopPropagation();">
|
||||
<img src="<?php echo Uri::root() . "media/com_gabble/images/logo_openai.png"; ?>" alt="OpenAI GPT">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<input type="hidden" id="gabble_type" value="mod">
|
||||
<input type="hidden" id="uri_root" value="<?php echo Uri::root(); ?>">
|
||||
<input type="hidden" id="token" value="<?php echo $session->getFormToken(); ?>">
|
||||
<input type="hidden" id="user_id" value="<?php echo $currentuser->get("id"); ?>">
|
||||
|
||||
<input type="hidden" id="openai_gpt" value="<?php echo $config->get('openai_gpt'); ?>">
|
||||
<input type="hidden" id="openai_gpt_name" value="<?php echo $config->get('openai_gpt_name'); ?>">
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<p style="text-align:right;" ><?php echo Text::_('COM_GABBLE_POWERED');?> <a href="https://tabaoca.org">Tabaoca</a></p>
|
||||
|
||||
118
templates/moko-cassiopeia/html/mod_gabble/index.html
Normal file
118
templates/moko-cassiopeia/html/mod_gabble/index.html
Normal file
@@ -0,0 +1,118 @@
|
||||
<!--
|
||||
* Copyright (C) 2025 Moko Consulting <jmiller@mokoconsulting.tech>
|
||||
*
|
||||
* This file is part of a Moko Consulting project.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<!--FILE INFORMATION
|
||||
* DEFGROUP: Joomla.Site
|
||||
* INGROUP: Templates.Moko-Cassiopeia
|
||||
* FILE: index.html
|
||||
* BRIEF: Security redirect page to block folder access and forward to site root.
|
||||
-->
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Redirecting…</title>
|
||||
|
||||
<!-- Search engines: do not index this placeholder redirect page -->
|
||||
<meta name="robots" content="noindex, nofollow, noarchive" />
|
||||
|
||||
<!-- Instant redirect fallback even if JavaScript is disabled -->
|
||||
<meta http-equiv="refresh" content="0; url=/" />
|
||||
|
||||
<!-- Canonical root reference -->
|
||||
<link rel="canonical" href="/" />
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
|
||||
<script>
|
||||
/**
|
||||
* @defgroup Dolibarr
|
||||
* @file index.html (embedded script)
|
||||
* @version 1.0.0
|
||||
* @brief Security redirect logic. Replaces the current history entry with the site root.
|
||||
* @details This script computes the absolute root URL using `location.origin` and
|
||||
* forwards the user immediately. It prevents leaving the protected folder
|
||||
* in the browser history by default.
|
||||
*
|
||||
* @section VARIABLES
|
||||
* @var {Object} opts Configuration options for the redirect behavior.
|
||||
* @var {string} opts.fallbackPath Path used when `location.origin` cannot be determined.
|
||||
* @var {number} opts.delayMs Optional delay in milliseconds before redirecting.
|
||||
* @var {"replace"|"assign"} opts.behavior Navigation method used for the redirect.
|
||||
*
|
||||
* @section OPTIONS
|
||||
* - opts.fallbackPath: default "/" (root path)
|
||||
* - opts.delayMs: default 0 (immediate)
|
||||
* - opts.behavior: one of
|
||||
* * "replace" — calls `location.replace(url)`; does not keep the folder page in history.
|
||||
* * "assign" — calls `location.assign(url)`; keeps an extra history entry.
|
||||
*/
|
||||
(function redirectToRoot() {
|
||||
// Configuration object with safe defaults.
|
||||
var opts = {
|
||||
fallbackPath: "/", // string: fallback destination if origin is unavailable
|
||||
delayMs: 0, // number: delay before redirect in ms (0 = immediate)
|
||||
behavior: "replace" // enum: "replace" | "assign"
|
||||
};
|
||||
|
||||
// Determine absolute origin in all mainstream browsers.
|
||||
var origin = (typeof location.origin === "string" && location.origin)
|
||||
|| (location.protocol + "//" + location.host);
|
||||
|
||||
// Final destination: absolute root of the current site, or fallback path.
|
||||
var destination = origin ? origin + "/" : opts.fallbackPath;
|
||||
|
||||
function go() {
|
||||
if (opts.behavior === "assign") {
|
||||
location.assign(destination);
|
||||
} else {
|
||||
location.replace(destination);
|
||||
}
|
||||
}
|
||||
|
||||
// Execute redirect, optionally after a short delay.
|
||||
if (opts.delayMs > 0) {
|
||||
setTimeout(go, opts.delayMs);
|
||||
} else {
|
||||
go();
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
|
||||
<!--
|
||||
Secondary meta-refresh for no-JS environments is already set above.
|
||||
Some very old crawlers may ignore JS; the meta refresh ensures coverage.
|
||||
-->
|
||||
|
||||
<noscript>
|
||||
<!-- Extra defense-in-depth: if JS is disabled, meta refresh (above) handles redirect. -->
|
||||
<style>
|
||||
html, body { height:100%; }
|
||||
body { display:flex; align-items:center; justify-content:center; margin:0; font: 16px/1.4 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }
|
||||
.msg { opacity: .75; text-align: center; }
|
||||
</style>
|
||||
</noscript>
|
||||
</head>
|
||||
<body>
|
||||
<div class="msg">Redirecting to the site root… If you are not redirected, <a href="/">click here</a>.</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user