Skip to content

Commit 013acb2

Browse files
authored
Merge pull request #289 from JoomJunk/development
Update to v8.1.13
2 parents cce7b56 + cac1f7c commit 013acb2

File tree

8 files changed

+58
-17
lines changed

8 files changed

+58
-17
lines changed

changelog.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
- -> Removed
1515
! -> Note
1616

17+
Version 8.1.13
18+
^ Improved layout for RTL languages
19+
1720
Version 8.1.12
1821
* Prevent access via the 'window.opener' object with submitted links
1922
^ Fix smiley being shown multiple times for the same image if there are multiple shortcuts

mod_shoutbox/media/css/mod_shoutbox.css

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,3 +286,24 @@ BBCode
286286
.jj-underline {
287287
text-decoration: underline !important;
288288
}
289+
290+
/**
291+
RTL
292+
**/
293+
html[dir="rtl"] .jjshoutboxoutput .shout-header {
294+
padding: 0 5px 0 35px;
295+
}
296+
html[dir="rtl"] .jjshoutbox .btn-group .btn {
297+
min-width: 26px;
298+
margin-bottom: 5px;
299+
}
300+
html[dir="rtl"] .jjshoutboxoutput div p {
301+
text-align: right;
302+
padding: 0 5px 0 0;
303+
}
304+
html[dir="rtl"] .jjshoutboxoutput .shout-actions {
305+
position: absolute;
306+
top: 0;
307+
left: 3px;
308+
right: auto;
309+
}

mod_shoutbox/media/js/mod_shoutbox.js

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -210,15 +210,23 @@ JJShoutbox.getRandomArbitrary = function(min, max)
210210
/**
211211
* Draw the maths question using a canvas
212212
*/
213-
JJShoutbox.drawMathsQuestion = function(number1, number2)
214-
{
215-
var c = document.getElementById('mathscanvas');
216-
var ctx = c.getContext('2d');
213+
JJShoutbox.drawMathsQuestion = function(number1, number2, rtl)
214+
{
215+
var c = document.getElementById('mathscanvas'),
216+
ctx = c.getContext('2d');
217217

218218
ctx.clearRect(0, 0, c.width, c.height);
219219
ctx.font = '14px Arial';
220220
ctx.fillStyle = 'grey';
221-
ctx.fillText(number1 + ' + ' + number2 + ' = ', 10, 20);
221+
222+
if (rtl == 1)
223+
{
224+
ctx.fillText(parseInt(number1) + ' + ' + parseInt(number2) + ' = ', 70, 20);
225+
}
226+
else
227+
{
228+
ctx.fillText(number1 + ' + ' + number2 + ' = ', 10, 20);
229+
}
222230
}
223231

224232

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

627635
return false;

mod_shoutbox/mod_shoutbox.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
$editowntime = $params->get('editown-time', 5);
5959
$history = $params->get('history', 1);
6060
$remainingLength = JText::_('SHOUT_REMAINING');
61+
$rtl = JFactory::getLanguage()->isRTL();
6162

6263
// Assemble the factory variables needed
6364
$doc = JFactory::getDocument();

mod_shoutbox/mod_shoutbox.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<license>http://www.gnu.org/licenses/gpl-3.0.html</license>
88
<authorEmail>admin@joomjunk.co.uk</authorEmail>
99
<authorUrl>http://www.joomjunk.co.uk</authorUrl>
10-
<version>8.1.12</version>
10+
<version>8.1.13</version>
1111
<description>JJSHOUTBOX_DESCRIPTION</description>
1212

1313
<install>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Placeholder file for database changes for version 8.1.13
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Placeholder file for database changes for version 8.1.13

mod_shoutbox/tmpl/default.php

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -203,22 +203,22 @@ class="<?php echo $input_txtarea; ?>"
203203
<?php if ($framework == 'uikit') : ?>
204204
<div class="uk-button-dropdown" data-uk-dropdown>
205205
<button class="uk-button uk-button-small" type="button">
206-
<img src="<?php echo JUri::root(); ?>images/mod_shoutbox/icon_e_smile.gif" alt="&#9786;" />
206+
<img src="<?php echo JUri::root(); ?>images/mod_shoutbox/icon_e_smile.gif" alt="&#9786;">
207207
</button>
208208
<ul class="uk-dropdown uk-dropdown-flip">
209209
<?php echo $helper->smileyshow(); ?>
210210
</ul>
211211
</div>
212212
<?php elseif ($framework == 'bootstrap') : ?>
213213
<button type="button" class="<?php echo $button . $button_small; ?> dropdown-toggle" data-toggle="dropdown">
214-
<img src="<?php echo JUri::root(); ?>images/mod_shoutbox/icon_e_smile.gif" alt="&#9786;" />
214+
<img src="<?php echo JUri::root(); ?>images/mod_shoutbox/icon_e_smile.gif" alt="&#9786;">
215215
</button>
216216
<ul class="dropdown-menu inline unstyled">
217217
<?php echo $helper->smileyshow(); ?>
218218
</ul>
219219
<?php else : ?>
220220
<button type="button" class="<?php echo $button . $button_small; ?> dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
221-
<img src="<?php echo JUri::root(); ?>images/mod_shoutbox/icon_e_smile.gif" alt="&#9786;" />
221+
<img src="<?php echo JUri::root(); ?>images/mod_shoutbox/icon_e_smile.gif" alt="&#9786;">
222222
</button>
223223
<ul class="dropdown-menu list-inline list-unstyled">
224224
<?php echo $helper->smileyshow(); ?>
@@ -262,10 +262,15 @@ class="<?php echo $input_txtarea; ?>"
262262
<?php $que_number1 = $helper->randomnumber(1); ?>
263263
<?php $que_number2 = $helper->randomnumber(1); ?>
264264
<div class="form-inline <?php echo $form_row; ?>">
265-
<canvas id="mathscanvas" width="80" height="30">Your browser does not support the HTML5 canvas tag.</canvas>
266-
<input type="hidden" name="jjshout[sum1]" value="<?php echo $que_number1; ?>" />
267-
<input type="hidden" name="jjshout[sum2]" value="<?php echo $que_number2; ?>" />
268-
<input class="<?php echo $input_txtarea; ?> fullwidth" id="math_output" type="text" name="jjshout[human]" />
265+
<?php if ($rtl) : ?>
266+
<input class="<?php echo $input_txtarea; ?> fullwidth" id="math_output" type="text" name="jjshout[human]">
267+
<canvas style="float:right" id="mathscanvas" width="80" height="30">Your browser does not support the HTML5 canvas tag.</canvas>
268+
<?php else : ?>
269+
<canvas id="mathscanvas" width="80" height="30">Your browser does not support the HTML5 canvas tag.</canvas>
270+
<input class="<?php echo $input_txtarea; ?> fullwidth" id="math_output" type="text" name="jjshout[human]">
271+
<?php endif; ?>
272+
<input type="hidden" name="jjshout[sum1]" value="<?php echo $que_number1; ?>">
273+
<input type="hidden" name="jjshout[sum2]" value="<?php echo $que_number2; ?>">
269274
</div>
270275
<?php
271276
}
@@ -277,7 +282,7 @@ class="<?php echo $input_txtarea; ?>"
277282
<input id="shout-submit-type" type="hidden" data-shout-id="0" data-submit-type="insert" />
278283

279284
<?php if ($entersubmit == 0) : ?>
280-
<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"'; }?> />
285+
<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"'; }?>>
281286
<?php endif; ?>
282287

283288
</form>
@@ -287,7 +292,7 @@ class="<?php echo $input_txtarea; ?>"
287292
{
288293
?>
289294
<form method="post" <?php echo 'class="' . $form . '"'; ?>>
290-
<input type="hidden" name="jjshout[max]" value="<?php echo $count; ?>" />
295+
<input type="hidden" name="jjshout[max]" value="<?php echo $count; ?>">
291296

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

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

336341
var JJ_frameworkType = '<?php echo $framework; ?>';
@@ -422,6 +427,7 @@ class="<?php echo $input_txtarea; ?>"
422427
instance : JJ_instance,
423428
history : JJ_history,
424429
session : '<?php echo JFactory::getSession()->getState(); ?>',
430+
rtl : '<?php echo $rtl; ?>',
425431
};
426432

427433
JJShoutbox.submitPost(JJ_ShoutPostParams);

0 commit comments

Comments
 (0)