mirror of
https://github.com/e107inc/e107.git
synced 2025-03-17 10:59:49 +01:00
Backward compatibility fixes.
This commit is contained in:
parent
8ac7f1fdf1
commit
0f2ab37d47
@ -210,6 +210,7 @@ if (/*!defined("PREVIEWTHEME") && */! (isset($no_core_css) && $no_core_css !==tr
|
||||
if(THEME_LEGACY === true || !deftrue('BOOTSTRAP'))
|
||||
{
|
||||
$e_js->otherCSS('{e_WEB_CSS}backcompat.css');
|
||||
$e_js->footerFile('{e_WEB_JS}core/backcompat.js');
|
||||
}
|
||||
|
||||
|
||||
|
@ -1605,6 +1605,12 @@ class e_parse extends e_parser
|
||||
{
|
||||
$opts['nobreak'] = true;
|
||||
$text = trim($text);
|
||||
|
||||
if(strpos($text,'[center]') === 0) // quick bc fix TODO Find a better solution. [center][/center] containing HTML.
|
||||
{
|
||||
$text = str_replace("[center]","<div style='text-align:center'>",$text);
|
||||
$text = str_replace("[/center]","</div>",$text);
|
||||
}
|
||||
}
|
||||
|
||||
$fromadmin = $opts['fromadmin'];
|
||||
|
@ -1607,9 +1607,9 @@ class news_front
|
||||
|
||||
require_once(THEME."news_template.php");
|
||||
|
||||
if(empty($ALTERNATECLASS1))
|
||||
if(!empty($ALTERNATECLASS1))
|
||||
{
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
$newscolumns = (isset($NEWSCOLUMNS) ? $NEWSCOLUMNS : 1);
|
||||
@ -1618,7 +1618,9 @@ class news_front
|
||||
$loop = 1;
|
||||
$param = array();
|
||||
$param['current_action'] = $action;
|
||||
foreach($newsAr as $news) {
|
||||
|
||||
foreach($newsAr as $news)
|
||||
{
|
||||
|
||||
if(is_array($ALTERNATECLASSES))
|
||||
{
|
||||
@ -1630,7 +1632,8 @@ class news_front
|
||||
$newsdata[$loop] .= $this->ix->render_newsitem($news, 'return', '', '', $param);
|
||||
}
|
||||
$loop ++;
|
||||
if($loop > $newscolumns) {
|
||||
if($loop > $newscolumns)
|
||||
{
|
||||
$loop = 1;
|
||||
}
|
||||
}
|
||||
|
@ -65,6 +65,39 @@ TMP;
|
||||
$expected = "<div class='bbcode-center' style='text-align:center'><img src='".e_HTTP."e107_images/generic/blank_avatar.jpg' width='' alt='Blank Avatar' title='Blank Avatar' class='img-rounded rounded bbcode bbcode-img' /></div>";
|
||||
|
||||
$this->assertEquals($expected, $actual, "BBcode parsing failed on [img]");
|
||||
|
||||
|
||||
$src = <<<SRC
|
||||
[center]<script type="text/javascript"><!--
|
||||
google_ad_client = "12345678";
|
||||
/* vertical */
|
||||
google_ad_slot = "12345";
|
||||
google_ad_width = 160;
|
||||
google_ad_height = 600;
|
||||
//-->
|
||||
</script>
|
||||
<script type="text/javascript"
|
||||
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
|
||||
</script>[/center]
|
||||
SRC;
|
||||
|
||||
$expected = <<<EXPECTED
|
||||
<div style='text-align:center'><script type="text/javascript"><!--
|
||||
google_ad_client = "12345678";
|
||||
/* vertical */
|
||||
google_ad_slot = "12345";
|
||||
google_ad_width = 160;
|
||||
google_ad_height = 600;
|
||||
//-->
|
||||
</script>
|
||||
<script type="text/javascript"
|
||||
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
|
||||
</script></div>
|
||||
EXPECTED;
|
||||
|
||||
$actual = $this->tp->toHTML($src,true);
|
||||
$this->assertEquals($expected,$actual);
|
||||
|
||||
/*
|
||||
$src = "[html]
|
||||
<pre>$sql = e107::getDb();
|
||||
|
@ -65,6 +65,9 @@ table.table { width: 100% }
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
.s-message a.close { cursor: pointer }
|
||||
|
||||
|
||||
/* Bootstrap classes that hide content for all devices except screen readers (accessibility) */
|
||||
.sr-only {
|
||||
position: absolute;
|
||||
|
13
e107_web/js/core/backcompat.js
Normal file
13
e107_web/js/core/backcompat.js
Normal file
@ -0,0 +1,13 @@
|
||||
|
||||
/* Legacy Theme v1.x compat when bootstrap not in use */
|
||||
|
||||
// (function ($)
|
||||
|
||||
|
||||
$('.s-message a.close').on('click', function ()
|
||||
{
|
||||
|
||||
$(this).parent('.s-message').hide('slow');
|
||||
}
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user