Skip to content

Commit

Permalink
Merge pull request #785 from AlaaN-Smadi/commonIcons
Browse files Browse the repository at this point in the history
Common icons
  • Loading branch information
bkalaldeh authored Aug 28, 2023
2 parents da3d496 + c289468 commit 3821e89
Show file tree
Hide file tree
Showing 25 changed files with 2,972 additions and 843 deletions.
2 changes: 1 addition & 1 deletion pluginTester/scripts/framework/app.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pluginTester/scripts/framework/web.min.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions pluginTester/styles/material-icons.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
font-style: normal;
font-weight: 400;
src: url('../fonticons/MaterialIcons-Regular.eot');
src: url('../fonticons/Material Icons') format('embedded-opentype'),
url('../fonticonsMaterialIcons-Regular') format('embedded-opentype'),
src: url('../fonticons/Material Icons') format('embedded-opentype'),
url('../fonticons/MaterialIcons-Regular') format('embedded-opentype'),
url('../fonticons/MaterialIcons-Regular.woff2') format('woff2'),
url('../fonticons/MaterialIcons-Regular.woff') format('woff'),
url('../fonticons/MaterialIcons-Regular.ttf') format('truetype'),
url('../fonticons/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
url('../../styles/icons/[email protected]/fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
}

.material-icons {
Expand All @@ -34,4 +34,4 @@

/* Support for IE. */
font-feature-settings: 'liga';
}
}
2 changes: 1 addition & 1 deletion scripts/_bundles/buildfire_lightcarousel.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion scripts/_bundles/buildfire_lightcarousel.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion scripts/_bundles/jquery_angular_buildfire_smartcrop.min.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

39 changes: 37 additions & 2 deletions scripts/buildfire.js
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,7 @@ var buildfire = {
var disableBootstrap = (buildfire.options && buildfire.options.disableBootstrap) ? buildfire.options.disableBootstrap : false;
var disableTheme = (buildfire.options && buildfire.options.disableTheme) ? buildfire.options.disableTheme : false;
var enableMDTheme = (buildfire.options && buildfire.options.enableMDTheme) ? buildfire.options.enableMDTheme : false;
var disableFontIcons = (buildfire.options && buildfire.options.disableFontIcons) ? buildfire.options.disableFontIcons : false;

if (!disableTheme && !enableMDTheme) {
if(!disableTheme && !disableBootstrap){
Expand Down Expand Up @@ -901,6 +902,33 @@ var buildfire = {
}
}

const attachFontIcons = function(theme) {
const fontIconLinkId = 'bfFontIcons';

let iconPack;
if (theme && theme.icons && theme.icons.iconPack) {
iconPack = theme.icons.iconPack;
} else {
iconPack = 'glyph';
}

let fontFilePath = '';

switch (iconPack) {
case 'bootstrap':
fontFilePath = '/styles/icons/[email protected]/bf-bootstrap-icons.css';
break;
default:
fontFilePath = '/styles/icons/[email protected]/bf-glyph-icons.css';
break;
}

if (fontFilePath) {
buildfire.appearance._attachAppCSSFiles(fontFilePath, fontIconLinkId);
}
};


buildfire.appearance.getWidgetTheme(function(err, theme) {
if (err) return console.error(err);
var bfWidgetTheme = document.createElement('style');
Expand All @@ -909,6 +937,13 @@ var buildfire = {
bfWidgetTheme.innerHTML = buildfire.appearance._getCommonCss(theme);
(document.head || document.body).appendChild(bfWidgetTheme);
files.push('styles/bfUIElements.css');

if (!disableFontIcons &&
((window.location.pathname.indexOf('/widget/') >= 0 && (disableTheme || enableMDTheme))
|| window.location.pathname.indexOf('/control/'))) {
// if appTheme.css is loaded, common css will be referenced already
attachFontIcons(theme);
}
});

if (enableMDTheme) {
Expand Down Expand Up @@ -1093,7 +1128,7 @@ var buildfire = {
FastClick.attach(element);
}
, attachAppThemeCSSFiles: function (appId, liveMode, appHost) {
const cssUrl = `${appHost}/api/app/styles/appTheme.css?appId=${appId}&liveMode=${liveMode}&v=${buildfire.appearance.CSSBusterCounter}`;
const cssUrl = `${appHost}/api/app/styles/appTheme.css?appId=${appId}&liveMode=${liveMode}&v=${buildfire.appearance.CSSBusterCounter}&isWeb=true`;
this._attachAppCSSFiles(cssUrl, 'appThemeCSS');
}
, attachLocalAppThemeCSSFiles: function (appId) {
Expand Down Expand Up @@ -4078,7 +4113,7 @@ var buildfire = {
if (typeof tinymce !== 'undefined' && tinymce.init && tinymce.isBuildfire) {
var appContext = buildfire.getContext();
if (appContext && appContext.endPoints) {
var appTheme = appContext.endPoints.appHost + '/api/app/styles/appTheme.css?appId=' + appContext.appId + '&liveMode=' + appContext.liveMode;
var appTheme = appContext.endPoints.appHost + '/api/app/styles/appTheme.css?appId=' + appContext.appId + '&liveMode=' + appContext.liveMode + '&isWeb=true';
var originalTinymceInit = tinymce.init.bind(tinymce);

tinymce.init = function(options) {
Expand Down
2 changes: 1 addition & 1 deletion scripts/buildfire.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion scripts/buildfire.min.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions styles/appStyle.css
Original file line number Diff line number Diff line change
Expand Up @@ -1145,6 +1145,8 @@ html[buildfire] body.no-scroll .scrollable{
width:100% !important;
}

/* End Icons Pack Settings */

/* 767px Screen */
@media(max-width: 767px){

Expand Down
Loading

0 comments on commit 3821e89

Please sign in to comment.