Skip to content

Commit

Permalink
Merge pull request #184 from iMattPro/font-icon-stuff
Browse files Browse the repository at this point in the history
Update font icon swapping
  • Loading branch information
iMattPro authored Sep 1, 2024
2 parents 3a44f8f + 3306b0c commit 1deee23
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -364,17 +364,17 @@ jobs:
db: "mcr.microsoft.com/mssql/server:2017-latest"
db_alias: 'MSSQL 2017'
- php: '8.1'
db: "mcr.microsoft.com/mssql/server:2019-latest"
db: "mcr.microsoft.com/mssql/server:2019-CU27-ubuntu-20.04"
db_alias: 'MSSQL 2019'
- php: '8.1'
db: "mcr.microsoft.com/mssql/server:2022-latest"
db: "mcr.microsoft.com/mssql/server:2022-CU13-ubuntu-22.04"
db_alias: 'MSSQL 2022'

name: PHP ${{ matrix.php }} - ${{ matrix.db_alias != '' && matrix.db_alias || matrix.db }}

services:
mssql:
image: ${{ matrix.db != 'mcr.microsoft.com/mssql/server:2017-latest' && matrix.db != 'mcr.microsoft.com/mssql/server:2019-latest' && matrix.db != 'mcr.microsoft.com/mssql/server:2022-latest' && 'mcr.microsoft.com/mssql/server:2017-latest' || matrix.db }}
image: ${{ matrix.db != 'mcr.microsoft.com/mssql/server:2017-latest' && matrix.db != 'mcr.microsoft.com/mssql/server:2019-CU27-ubuntu-20.04' && matrix.db != 'mcr.microsoft.com/mssql/server:2022-CU13-ubuntu-22.04' && 'mcr.microsoft.com/mssql/server:2017-latest' || matrix.db }}
env:
SA_PASSWORD: "Pssw0rd_12"
ACCEPT_EULA: "y"
Expand Down Expand Up @@ -414,7 +414,7 @@ jobs:
env:
MATRIX_DB: ${{ matrix.db }}
run: |
if [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2017-latest' ] || [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2019-latest' ] || [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2022-latest' ]
if [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2017-latest' ] || [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2019-CU27-ubuntu-20.04' ] || [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2022-CU13-ubuntu-22.04' ]
then
db='mssql'
else
Expand Down
2 changes: 1 addition & 1 deletion adm/style/manage_pages.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ <h3>{{ lang('WARNING') }}</h3>
</dl>
<dl>
<dt><label for="page_icon_font">{{ lang('ACP_PAGES_FORM_ICON_FONT') ~ lang('COLON') }}</label><br /><span>{{ lang('ACP_PAGES_FORM_ICON_FONT_EXPLAIN', 'https://fontawesome.com/v6/search?o=r&m=free') }}</span></dt>
<dd><input name="page_icon_font" id="page_icon_font" type="text" size="15" maxlength="255" value="{{ PAGES_ICON_FONT }}" placeholder="file-lines" /> {{ Icon('font', PAGES_ICON_FONT, '', true, 'acp-icon') }}</dd>
<dd><input name="page_icon_font" id="page_icon_font" type="text" size="15" maxlength="255" value="{{ PAGES_ICON_FONT }}" placeholder="file-lines" /> {{ Icon('font', PAGES_ICON_FONT ? PAGES_ICON_FONT : 'file-lines', '', true, 'acp-icon') }}</dd>
</dl>
<dl>
<dt><label for="page_display">{{ lang('ACP_PAGES_FORM_DISPLAY') ~ lang('COLON') }}</label><br /><span>{{ lang('ACP_PAGES_FORM_DISPLAY_EXPLAIN') }}</span></dt>
Expand Down
10 changes: 4 additions & 6 deletions adm/style/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,10 @@ document.addEventListener('DOMContentLoaded', function() {
}

// Page Icon Previews
const updateClasses = (element, newClass) => {

const classesToKeep = ['o-icon', 'o-icon-font', 'fa-fw', 'fas', 'acp-icon'];
const updateIconClass = (element, newClass) => {

element.classList.forEach(className => {
if (!classesToKeep.includes(className)) {
if (className.startsWith('fa-') && className !== 'fa-fw') {
element.classList.remove(className);
}
});
Expand All @@ -59,11 +57,11 @@ document.addEventListener('DOMContentLoaded', function() {
const pageIconFont = document.getElementById('page_icon_font');

pageIconFont.addEventListener('keyup', function() {
updateClasses(this.nextElementSibling, this.value);
updateIconClass(this.nextElementSibling, this.value);
});

pageIconFont.addEventListener('blur', function() {
updateClasses(this.nextElementSibling, this.value);
updateIconClass(this.nextElementSibling, this.value);
});

});

0 comments on commit 1deee23

Please sign in to comment.