1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-25 07:21:03 +02:00

Added option for themes to load only the css or js portion of a library via theme.xml attribute. See bootstrap5/theme.xml for an example.

Empty comments in glyphs removed due to conflict with Fontawesome JS. Tests updated.
This commit is contained in:
Cameron
2021-10-11 12:33:59 -07:00
parent da219c31ae
commit 7755dd1743
14 changed files with 217 additions and 92 deletions

View File

@@ -2035,24 +2035,24 @@ while($row = $sql->fetch())
$this->tp->setFontAwesome(4);
$result = $this->tp->toGlyph('fa-envelope.glyph');
$expected = "<i class='fa fa-envelope' ><!-- --></i> ";
$expected = "<i class='fa fa-envelope' ></i> ";
$this->assertEquals($expected,$result);
$this->tp->setFontAwesome(5);
$result = $this->tp->toGlyph('fa-mailchimp');
$expected = "<i class='fab fa-mailchimp' ><!-- --></i> ";
$expected = "<i class='fab fa-mailchimp' ></i> ";
$this->assertEquals($expected, $result);
$this->tp->setFontAwesome(4);
$result = $this->tp->toGlyph('fab-mailchimp'); // spefific call
$expected = "<i class='fab fa-mailchimp' ><!-- --></i> ";
$expected = "<i class='fab fa-mailchimp' ></i> ";
$this->assertEquals($expected, $result);
$result = $this->tp->toGlyph('fas-camera'); // spefific call
$this->assertSame( "<i class='fas fa-camera' ><!-- --></i> ", $result);
$this->assertSame( "<i class='fas fa-camera' ></i> ", $result);
// test core, shims and old identifiers with FontAwesome 5 installed.
$this->tp->setFontAwesome(5);
@@ -2060,17 +2060,17 @@ while(&#036;row = &#036;sql-&gt;fetch())
$tests = array(
'e-database-16' => "<i class='S16 e-database-16'></i>",
'e-database-32' => "<i class='S32 e-database-32'></i>",
'fa-sun-o' => "<i class='far fa-sun' ><!-- --></i> ",
'fa-comments-o' => "<i class='far fa-comments' ><!-- --></i> ",
'fa-file-text-o' => "<i class='far fa-file-alt' ><!-- --></i> ",
'fa-bank' => "<i class='fa fa-university' ><!-- --></i> ",
'fa-warning' => "<i class='fa fa-exclamation-triangle' ><!-- --></i> ",
'glyphicon-star' => "<i class='fas fa-star' ><!-- --></i> ",
'icon-star' => "<i class='fas fa-star' ><!-- --></i> ",
'floppy-disk' => "<i class='glyphicon glyphicon-floppy-disk' ><!-- --></i> ",
'icon-user' => "<i class='fas fa-user' ><!-- --></i> ",
'user' => "<i class='fas fa-user' ><!-- --></i> ",
'flag' => "<i class='fas fa-flag' ><!-- --></i> ",
'fa-sun-o' => "<i class='far fa-sun' ></i> ",
'fa-comments-o' => "<i class='far fa-comments' ></i> ",
'fa-file-text-o' => "<i class='far fa-file-alt' ></i> ",
'fa-bank' => "<i class='fa fa-university' ></i> ",
'fa-warning' => "<i class='fa fa-exclamation-triangle' ></i> ",
'glyphicon-star' => "<i class='fas fa-star' ></i> ",
'icon-star' => "<i class='fas fa-star' ></i> ",
'floppy-disk' => "<i class='glyphicon glyphicon-floppy-disk' ></i> ",
'icon-user' => "<i class='fas fa-user' ></i> ",
'user' => "<i class='fas fa-user' ></i> ",
'flag' => "<i class='fas fa-flag' ></i> ",
'fa-' => null,
);
@@ -2088,17 +2088,17 @@ while(&#036;row = &#036;sql-&gt;fetch())
$tests = array(
'e-database-16' => "<i class='S16 e-database-16'></i>",
'e-database-32' => "<i class='S32 e-database-32'></i>",
'fa-sun-o' => "<i class='fa fa-sun-o' ><!-- --></i> ",
'fa-comments-o' => "<i class='fa fa-comments-o' ><!-- --></i> ",
'fa-file-text-o' => "<i class='fa fa-file-text-o' ><!-- --></i> ",
'fa-bank' => "<i class='fa fa-bank' ><!-- --></i> ",
'fa-warning' => "<i class='fa fa-warning' ><!-- --></i> ",
'glyphicon-star' => "<i class='fa fa-star' ><!-- --></i> ",
'icon-star' => "<i class='fa fa-star' ><!-- --></i> ",
'floppy-disk' => "<i class='glyphicon glyphicon-floppy-disk' ><!-- --></i> ",
'icon-user' => "<i class='fa fa-user' ><!-- --></i> ",
'user' => "<i class='glyphicon glyphicon-user' ><!-- --></i> ",
'flag' => "<i class='glyphicon glyphicon-flag' ><!-- --></i> ",
'fa-sun-o' => "<i class='fa fa-sun-o' ></i> ",
'fa-comments-o' => "<i class='fa fa-comments-o' ></i> ",
'fa-file-text-o' => "<i class='fa fa-file-text-o' ></i> ",
'fa-bank' => "<i class='fa fa-bank' ></i> ",
'fa-warning' => "<i class='fa fa-warning' ></i> ",
'glyphicon-star' => "<i class='fa fa-star' ></i> ",
'icon-star' => "<i class='fa fa-star' ></i> ",
'floppy-disk' => "<i class='glyphicon glyphicon-floppy-disk' ></i> ",
'icon-user' => "<i class='fa fa-user' ></i> ",
'user' => "<i class='glyphicon glyphicon-user' ></i> ",
'flag' => "<i class='glyphicon glyphicon-flag' ></i> ",
'fa-' => null,
);
@@ -2118,7 +2118,7 @@ while(&#036;row = &#036;sql-&gt;fetch())
{
$this->tp->setFontAwesome(5);
$result = $this->tp->toGlyph('fa-paypal.glyph');
$this->assertSame("<i class='fab fa-paypal' ><!-- --></i> ", $result);
$this->assertSame("<i class='fab fa-paypal' ></i> ", $result);
}
/*
public function testToBadge()
@@ -2448,7 +2448,7 @@ Your browser does not support the audio tag.
// -----
$result = $tp->makeClickable($email, 'email', array('sub' => 'fa-envelope.glyph'));
$this->assertStringContainsString("fa-envelope' ><!-- --></i></a>", $result);
$this->assertStringContainsString("fa-envelope' ></i></a>", $result);
// links standard.
$tests = array(