Skip to content

Commit

Permalink
Merge pull request #198 from JoomJunk/development
Browse files Browse the repository at this point in the history
Merge Update v6.0.3
  • Loading branch information
C-Lodder committed Oct 6, 2015
2 parents 9828646 + b0d2358 commit 9d84484
Show file tree
Hide file tree
Showing 8 changed files with 282 additions and 17 deletions.
5 changes: 5 additions & 0 deletions changelog.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
- -> Removed
! -> Note

Version 6.0.3
+ Allow inline images
# Fixed smiley dropdown position for UIKit
# Fixed dropdown and modal when no framework used

Version 6.0.2
+ Added option to hide history

Expand Down
15 changes: 11 additions & 4 deletions mod_shoutbox/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -379,10 +379,17 @@ public function postFiltering($shout, $user, $swearCounter, $swearNumber, $displ

$ip = $_SERVER['REMOTE_ADDR'];

// Sanity check on the contents of the user fields
$filter = JFilterInput::getInstance();
$name = $filter->clean($name, 'string');
$message = $filter->clean($message, 'string');
// The name field will have all html stripped
$nameFilter = JFilterInput::getInstance();

// We allow image and header tags in the message.
$acceptedtags = array('img','h1','h2','h3', 'h4', 'h5', 'h6');
$acceptedAttribs = array('src','href','rel','title','class','id','itemprop','itemtype','itemscope');
$messageFilter = JFilterInput::getInstance($acceptedtags,$acceptedAttribs);

// Do the filtering
$name = $nameFilter->clean($name, 'string');
$message = $messageFilter->clean($message, 'string');

if ($swearCounter == 0 || $swearCounter == 1 && (($nameSwears + $messageSwears) <= $swearNumber))
{
Expand Down
239 changes: 239 additions & 0 deletions mod_shoutbox/media/css/mod_shoutbox_bs.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,239 @@
/**
* @package JJ_Shoutbox
* @copyright Copyright (C) 2011 - 2015 JoomJunk. All rights reserved.
* @license GPL v3.0 or later http://www.gnu.org/licenses/gpl-3.0.html
*/


/** Button **/
.jj_fallback .btn {
display: inline-block;
padding: 4px 12px;
margin-bottom: 0;
font-size: 13px;
line-height: 18px;
text-align: center;
vertical-align: middle;
cursor: pointer;
color: #333;
text-shadow: 0 1px 1px rgba(255,255,255,0.75);
background-color: #f5f5f5;
background-image: -moz-linear-gradient(top,#fff,#e6e6e6);
background-image: -webkit-gradient(linear,0 0,0 100%,from(#fff),to(#e6e6e6));
background-image: linear-gradient(to bottom,#fff,#e6e6e6);
background-repeat: repeat-x;
border-color: #e6e6e6 #e6e6e6 #bfbfbf;
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
border: 1px solid #bbb;
border-bottom-color: #a2a2a2;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);
-moz-box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);
box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);
}
.jj_fallback .btn:hover,
.jj_fallback .btn:focus,
.jj_fallback .btn:active,
.jj_fallback .btn[disabled] {
color: #333;
background-color: #e6e6e6;
}
.jj_fallback .btn-small {
padding: 2px 10px;
font-size: 12px;
border-radius: 3px;
}
.jj_fallback .btn-group > .btn-small {
font-size: 12px;
}
.jj_fallback .btn-group {
position: relative;
display: inline-block;
font-size: 0;
vertical-align: middle;
white-space: nowrap;
}
.jj_fallback .btn-group + .btn-group {
margin-left: 5px;
}


/** Modal **/
.jj_fallback .hide {
display: none;
}
.jj_fallback .fade.in {
opacity: 1;
display: block;
}
.modal-backdrop {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1040;
background-color: #000;
}
.modal-backdrop.fade {
opacity: 0;
}
.modal-backdrop,
.modal-backdrop.fade.in {
opacity: 0.8;
filter: alpha(opacity=80);
}
.jj_fallback .modal-header {
padding: 9px 15px;
border-bottom: 1px solid #eee;
}
.jj_fallback .modal-header .close {
margin-top: 2px;
}
.jj_fallback .modal-header h3 {
margin: 0;
line-height: 30px;
}
.jj_fallback .modal-body {
width: 98%;
position: relative;
max-height: 400px;
padding: 1%;
}
@media (max-width: 480px) {
.jj_fallback .modal-header .close {
padding: 10px;
margin: -10px;
}
}
body.modal {
padding-top: 0;
}
.jj_fallback .modal {
position: fixed;
top: 5%;
left: 50%;
z-index: 1050;
width: 80%;
margin-left: -40%;
background-color: #fff;
border: 1px solid #999;
border: 1px solid rgba(0,0,0,0.3);
border-radius: 6px;
-webkit-box-shadow: 0 3px 7px rgba(0,0,0,0.3);
-moz-box-shadow: 0 3px 7px rgba(0,0,0,0.3);
box-shadow: 0 3px 7px rgba(0,0,0,0.3);
-webkit-background-clip: padding-box;
-moz-background-clip: padding-box;
background-clip: padding-box;
outline: none;
}
.jj_fallback .modal.fade {
-webkit-transition: opacity .3s linear, top .3s ease-out;
-moz-transition: opacity .3s linear, top .3s ease-out;
transition: opacity .3s linear, top .3s ease-out;
top: 20%;
}
.jj_fallback .modal.fade.in {
top: 5%;
}
.jj_fallback .modal-batch {
overflow-y: visible;
}
@media (max-width: 767px) {
.jj_fallback .modal {
position: fixed;
top: 20px;
left: 20px;
right: 20px;
width: auto;
margin: 0;
}
.jj_fallback .modal.fade {
top: -100px;
}
.jj_fallback .modal.fade.in {
top: 20px;
}
}
@media (max-width: 480px) {
.jj_fallback .modal {
top: 10px;
left: 10px;
right: 10px;
}
}
@media (max-width: 768px) {
.jj_fallback .modal.fade {
top: -100%;
}
}
body.modal-open {
overflow: hidden;
-ms-overflow-style: none;
}
.jj_fallback .close {
float: right;
font-size: 20px;
font-weight: bold;
line-height: 18px;
color: #000;
text-shadow: 0 1px 0 #ffffff;
opacity: 0.2;
filter: alpha(opacity=20);
}
.jj_fallback .close:hover,
.jj_fallback .close:focus {
color: #000;
text-decoration: none;
cursor: pointer;
opacity: 0.4;
filter: alpha(opacity=40);
}
.jj_fallback .button.close {
padding: 3;
cursor: pointer;
background: transparent;
border: 0;
-webkit-appearance: none;
}


/** Dropdown **/
.jj_fallback .dropdown {
position: relative;
}
.jj_fallback .dropdown-menu {
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
display: none;
float: left;
min-width: 160px;
padding: 5px 0;
margin: 2px 0 0;
list-style: none;
background-color: #fff;
border: 1px solid #ccc;
border: 1px solid rgba(0,0,0,0.2);
border-radius: 6px;
-webkit-box-shadow: 0 5px 10px rgba(0,0,0,0.2);
-moz-box-shadow: 0 5px 10px rgba(0,0,0,0.2);
box-shadow: 0 5px 10px rgba(0,0,0,0.2);
-webkit-background-clip: padding-box;
-moz-background-clip: padding;
background-clip: padding-box;
}
.jj_fallback .dropdown-menu > li > a {
display: block;
padding: 3px 20px;
clear: both;
font-weight: normal;
line-height: 18px;
color: #333;
white-space: nowrap;
}
.jj_fallback .open > .dropdown-menu {
display: block;
}
20 changes: 12 additions & 8 deletions mod_shoutbox/mod_shoutbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
$clearfix = ' uk-clearfix';
$modal = ' uk-modal';
$modal_img = null;
$jj_class = null;
break;

case 'bootstrap':
Expand All @@ -87,6 +88,7 @@
$clearfix = ' clearfix';
$modal = ' modal hide fade';
$modal_img = null;
$jj_class = null;
break;

case 'bootstrap3':
Expand All @@ -101,20 +103,22 @@
$clearfix = ' clearfix';
$modal = ' modal fade';
$modal_img = ' img-responsive';
$jj_class = null;
break;

default:
$form = null;
$button_group = null;
$button = null;
$button_small = null;
$button_danger = null;
$button_prim = null;
$button_group = ' btn-group';
$button = ' btn';
$button_small = ' btn-small';
$button_danger = ' btn-danger';
$button_prim = ' btn-primary';
$input_txtarea = null;
$form_row = null;
$form_row = ' form-group';
$clearfix = ' clearfix';
$modal = ' modal hide fade';
$modal_img = null;
$jj_class = 'jj_fallback';
break;
}

Expand All @@ -130,8 +134,8 @@

$dataerror = JText::_('SHOUT_DATABASEERRORSHOUT');

// Import JLog class
jimport('joomla.log.log');
// Load JLog class
JLoader::register('JLog', JPATH_LIBRARIES . '/joomla/log/log.php');

// Log mod_shoutbox errors to specific file.
JLog::addLogger(
Expand Down
2 changes: 1 addition & 1 deletion mod_shoutbox/mod_shoutbox.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<license>http://www.gnu.org/licenses/gpl-3.0.html</license>
<authorEmail>[email protected]</authorEmail>
<authorUrl>http://www.joomjunk.co.uk</authorUrl>
<version>6.0.2</version>
<version>6.0.3</version>
<description>JJSHOUTBOX_DESCRIPTION</description>

<install>
Expand Down
1 change: 1 addition & 0 deletions mod_shoutbox/sql/mysql/updates/6.0.3.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Placeholder file for database changes for version 6.0.3
1 change: 1 addition & 0 deletions mod_shoutbox/sql/postgresql/updates/6.0.3.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Placeholder file for database changes for version 6.0.3
16 changes: 12 additions & 4 deletions mod_shoutbox/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,17 @@
}';
}

// Import Bootstrap framework and stylesheet for fallback styling
if ($framework == 'none')
{
JHtml::_('stylesheet', 'mod_shoutbox/mod_shoutbox_bs.css', array(), true);
JHtml::_('bootstrap.framework');
JHtml::_('behavior.modal');
}

// Prevent the image overlapping on Bootstrap 2 modal
if ($framework == 'bootstrap')
{
{
$style .= '
#jjshoutboxform .modal-body > img {
float: left;
Expand Down Expand Up @@ -64,7 +72,7 @@
JText::script('SHOUT_BBCODE_INSERT_URL');
?>

<div id="<?php echo $uniqueIdentifier; ?>" class="jjshoutbox">
<div id="<?php echo $uniqueIdentifier; ?>" class="jjshoutbox <?php echo $jj_class; ?>">

<div id="jjshoutboxoutput">
<div class="jj-shout-new"></div>
Expand Down Expand Up @@ -189,10 +197,10 @@ class="<?php echo $input_txtarea; ?>"
<button type="button" class="<?php echo $button . $button_small; ?> bbcode-button jj-link jj-trigger-insert" data-bbcode-type="url"><?php echo JText::_('SHOUT_BBCODE_LINK'); ?></button>
<?php if ($framework == 'uikit') : ?>
<div class="uk-button-dropdown" data-uk-dropdown>
<button class="uk-button uk-button-small">
<button class="uk-button uk-button-small" type="button">
<img src="<?php echo JUri::root(); ?>images/mod_shoutbox/icon_e_smile.gif" alt="&#9786;" />
</button>
<ul class="uk-dropdown">
<ul class="uk-dropdown uk-dropdown-flip">
<?php echo $helper->smileyshow(); ?>
</ul>
</div>
Expand Down

0 comments on commit 9d84484

Please sign in to comment.