Skip to content

Commit

Permalink
Merge pull request #289 from JoomJunk/development
Browse files Browse the repository at this point in the history
Update to v8.1.13
  • Loading branch information
C-Lodder authored Mar 1, 2017
2 parents cce7b56 + cac1f7c commit 013acb2
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 17 deletions.
3 changes: 3 additions & 0 deletions changelog.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
- -> Removed
! -> Note

Version 8.1.13
^ Improved layout for RTL languages

Version 8.1.12
* Prevent access via the 'window.opener' object with submitted links
^ Fix smiley being shown multiple times for the same image if there are multiple shortcuts
Expand Down
21 changes: 21 additions & 0 deletions mod_shoutbox/media/css/mod_shoutbox.css
Original file line number Diff line number Diff line change
Expand Up @@ -286,3 +286,24 @@ BBCode
.jj-underline {
text-decoration: underline !important;
}

/**
RTL
**/
html[dir="rtl"] .jjshoutboxoutput .shout-header {
padding: 0 5px 0 35px;
}
html[dir="rtl"] .jjshoutbox .btn-group .btn {
min-width: 26px;
margin-bottom: 5px;
}
html[dir="rtl"] .jjshoutboxoutput div p {
text-align: right;
padding: 0 5px 0 0;
}
html[dir="rtl"] .jjshoutboxoutput .shout-actions {
position: absolute;
top: 0;
left: 3px;
right: auto;
}
20 changes: 14 additions & 6 deletions mod_shoutbox/media/js/mod_shoutbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,15 +210,23 @@ JJShoutbox.getRandomArbitrary = function(min, max)
/**
* Draw the maths question using a canvas
*/
JJShoutbox.drawMathsQuestion = function(number1, number2)
{
var c = document.getElementById('mathscanvas');
var ctx = c.getContext('2d');
JJShoutbox.drawMathsQuestion = function(number1, number2, rtl)
{
var c = document.getElementById('mathscanvas'),
ctx = c.getContext('2d');

ctx.clearRect(0, 0, c.width, c.height);
ctx.font = '14px Arial';
ctx.fillStyle = 'grey';
ctx.fillText(number1 + ' + ' + number2 + ' = ', 10, 20);

if (rtl == 1)
{
ctx.fillText(parseInt(number1) + ' + ' + parseInt(number2) + ' = ', 70, 20);
}
else
{
ctx.fillText(number1 + ' + ' + number2 + ' = ', 10, 20);
}
}


Expand Down Expand Up @@ -621,7 +629,7 @@ jQuery(document).ready(function($) {
params.instance.find('input[name="jjshout[sum2]"]').val(val2);
params.instance.find('label[for="math_output"]').text(val1 + ' + ' + val2);
params.instance.find('input[name="jjshout[human]"]').val('');
JJShoutbox.drawMathsQuestion(val1, val2);
JJShoutbox.drawMathsQuestion(val1, val2, params.rtl);
}

return false;
Expand Down
1 change: 1 addition & 0 deletions mod_shoutbox/mod_shoutbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
$editowntime = $params->get('editown-time', 5);
$history = $params->get('history', 1);
$remainingLength = JText::_('SHOUT_REMAINING');
$rtl = JFactory::getLanguage()->isRTL();

// Assemble the factory variables needed
$doc = JFactory::getDocument();
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>8.1.12</version>
<version>8.1.13</version>
<description>JJSHOUTBOX_DESCRIPTION</description>

<install>
Expand Down
1 change: 1 addition & 0 deletions mod_shoutbox/sql/mysql/updates/8.1.13.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Placeholder file for database changes for version 8.1.13
1 change: 1 addition & 0 deletions mod_shoutbox/sql/postgresql/updates/8.1.13.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Placeholder file for database changes for version 8.1.13
26 changes: 16 additions & 10 deletions mod_shoutbox/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,22 +203,22 @@ class="<?php echo $input_txtarea; ?>"
<?php if ($framework == 'uikit') : ?>
<div class="uk-button-dropdown" data-uk-dropdown>
<button class="uk-button uk-button-small" type="button">
<img src="<?php echo JUri::root(); ?>images/mod_shoutbox/icon_e_smile.gif" alt="&#9786;" />
<img src="<?php echo JUri::root(); ?>images/mod_shoutbox/icon_e_smile.gif" alt="&#9786;">
</button>
<ul class="uk-dropdown uk-dropdown-flip">
<?php echo $helper->smileyshow(); ?>
</ul>
</div>
<?php elseif ($framework == 'bootstrap') : ?>
<button type="button" class="<?php echo $button . $button_small; ?> dropdown-toggle" data-toggle="dropdown">
<img src="<?php echo JUri::root(); ?>images/mod_shoutbox/icon_e_smile.gif" alt="&#9786;" />
<img src="<?php echo JUri::root(); ?>images/mod_shoutbox/icon_e_smile.gif" alt="&#9786;">
</button>
<ul class="dropdown-menu inline unstyled">
<?php echo $helper->smileyshow(); ?>
</ul>
<?php else : ?>
<button type="button" class="<?php echo $button . $button_small; ?> dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
<img src="<?php echo JUri::root(); ?>images/mod_shoutbox/icon_e_smile.gif" alt="&#9786;" />
<img src="<?php echo JUri::root(); ?>images/mod_shoutbox/icon_e_smile.gif" alt="&#9786;">
</button>
<ul class="dropdown-menu list-inline list-unstyled">
<?php echo $helper->smileyshow(); ?>
Expand Down Expand Up @@ -262,10 +262,15 @@ class="<?php echo $input_txtarea; ?>"
<?php $que_number1 = $helper->randomnumber(1); ?>
<?php $que_number2 = $helper->randomnumber(1); ?>
<div class="form-inline <?php echo $form_row; ?>">
<canvas id="mathscanvas" width="80" height="30">Your browser does not support the HTML5 canvas tag.</canvas>
<input type="hidden" name="jjshout[sum1]" value="<?php echo $que_number1; ?>" />
<input type="hidden" name="jjshout[sum2]" value="<?php echo $que_number2; ?>" />
<input class="<?php echo $input_txtarea; ?> fullwidth" id="math_output" type="text" name="jjshout[human]" />
<?php if ($rtl) : ?>
<input class="<?php echo $input_txtarea; ?> fullwidth" id="math_output" type="text" name="jjshout[human]">
<canvas style="float:right" id="mathscanvas" width="80" height="30">Your browser does not support the HTML5 canvas tag.</canvas>
<?php else : ?>
<canvas id="mathscanvas" width="80" height="30">Your browser does not support the HTML5 canvas tag.</canvas>
<input class="<?php echo $input_txtarea; ?> fullwidth" id="math_output" type="text" name="jjshout[human]">
<?php endif; ?>
<input type="hidden" name="jjshout[sum1]" value="<?php echo $que_number1; ?>">
<input type="hidden" name="jjshout[sum2]" value="<?php echo $que_number2; ?>">
</div>
<?php
}
Expand All @@ -277,7 +282,7 @@ class="<?php echo $input_txtarea; ?>"
<input id="shout-submit-type" type="hidden" data-shout-id="0" data-submit-type="insert" />

<?php if ($entersubmit == 0) : ?>
<input name="jjshout[shout]" id="shoutbox-submit" class="<?php echo $button; ?> fullwidth" type="submit" value="<?php echo JText::_('SHOUT_SUBMITTEXT'); ?>" <?php if (($securitytype == 1 && !$siteKey) || ($securitytype == 1 && !$secretKey)) { echo 'disabled="disabled"'; }?> />
<input name="jjshout[shout]" id="shoutbox-submit" class="<?php echo $button; ?> fullwidth" type="submit" value="<?php echo JText::_('SHOUT_SUBMITTEXT'); ?>" <?php if (($securitytype == 1 && !$siteKey) || ($securitytype == 1 && !$secretKey)) { echo 'disabled="disabled"'; }?>>
<?php endif; ?>

</form>
Expand All @@ -287,7 +292,7 @@ class="<?php echo $input_txtarea; ?>"
{
?>
<form method="post" <?php echo 'class="' . $form . '"'; ?>>
<input type="hidden" name="jjshout[max]" value="<?php echo $count; ?>" />
<input type="hidden" name="jjshout[max]" value="<?php echo $count; ?>">

<div class="mass_delete">
<?php $style = ($framework == 'bootstrap3') ? 'style="display:inline-block"' : ''; ?>
Expand Down Expand Up @@ -330,7 +335,7 @@ class="<?php echo $input_txtarea; ?>"

<?php if ($securitytype == 2) {
if ($securityHide == 0 || ($user->guest && $securityHide == 1)) { ?>
JJShoutbox.drawMathsQuestion(<?php echo $que_number1; ?>, <?php echo $que_number2; ?>);
JJShoutbox.drawMathsQuestion(<?php echo $que_number1; ?>, <?php echo $que_number2; ?>, <?php echo $rtl; ?>);
<?php } } ?>

var JJ_frameworkType = '<?php echo $framework; ?>';
Expand Down Expand Up @@ -422,6 +427,7 @@ class="<?php echo $input_txtarea; ?>"
instance : JJ_instance,
history : JJ_history,
session : '<?php echo JFactory::getSession()->getState(); ?>',
rtl : '<?php echo $rtl; ?>',
};

JJShoutbox.submitPost(JJ_ShoutPostParams);
Expand Down

0 comments on commit 013acb2

Please sign in to comment.