Skip to content

Commit 48f3a92

Browse files
author
Sky Dev
committed
git ignore and theme2 css
0 parents  commit 48f3a92

File tree

2 files changed

+168
-0
lines changed

2 files changed

+168
-0
lines changed

.gitignore

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
/dist
5+
/tmp
6+
7+
# dependencies
8+
/node_modules
9+
/bower_components
10+
11+
# IDEs and editors
12+
/.idea
13+
.project
14+
.classpath
15+
*.launch
16+
.settings/
17+
.vs/
18+
obj/
19+
bin/
20+
21+
# misc
22+
/.sass-cache
23+
/connect.lock
24+
/coverage/*
25+
/libpeerconnection.log
26+
npm-debug.log
27+
yarn-error.log
28+
testem.log
29+
/typings
30+
package-lock
31+
32+
# e2e
33+
/e2e/*.js
34+
/e2e/*.map
35+
36+
#System Files
37+
.DS_Store
38+
Thumbs.db
39+
40+
# VS files
41+
project.lock.json
42+
Properties/launchSettings.json
43+
/src/assets/common/styles/**/*.min.*
44+
45+
src/assets/metronic/themes/**/css/*.min.css
46+
!src/assets/metronic/themes/**/css/pages/
47+
48+
src/assets/primeng/datatable/css/*.min.css
49+
50+
src/assets/metronic/themes/**/css/*.min.css
51+
!src/assets/metronic/themes/**/css/pages/
52+
53+
src/assets/fonts/*min.css
54+
55+
src/assets/metronic/themes/default/css/skins/**/*.min.css
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
import { AppConsts } from '@shared/AppConsts';
2+
import * as rtlDetect from 'rtl-detect';
3+
import { StyleLoaderService } from '@shared/utils/style-loader.service';
4+
import { Theme8ThemeAssetContributor } from '@app/shared/layout/themes/theme8/Theme8ThemeAssetContributor';
5+
import { Theme2ThemeAssetContributor } from '@app/shared/layout/themes/theme2/Theme2ThemeAssetContributor';
6+
import { Theme3ThemeAssetContributor } from '@app/shared/layout/themes/theme3/Theme3ThemeAssetContributor';
7+
import { Theme4ThemeAssetContributor } from '@app/shared/layout/themes/theme4/Theme4ThemeAssetContributor';
8+
import { Theme5ThemeAssetContributor } from '@app/shared/layout/themes/theme5/Theme5ThemeAssetContributor';
9+
import { Theme6ThemeAssetContributor } from '@app/shared/layout/themes/theme6/Theme6ThemeAssetContributor';
10+
import { Theme9ThemeAssetContributor } from '@app/shared/layout/themes/theme9/Theme9ThemeAssetContributor';
11+
import { Theme7ThemeAssetContributor } from '@app/shared/layout/themes/theme7/Theme7ThemeAssetContributor';
12+
import { Theme10ThemeAssetContributor } from '@app/shared/layout/themes/theme10/Theme10ThemeAssetContributor';
13+
import { Theme11ThemeAssetContributor } from '@app/shared/layout/themes/theme11/Theme11ThemeAssetContributor';
14+
import { Theme12ThemeAssetContributor } from '@app/shared/layout/themes/theme12/Theme12ThemeAssetContributor';
15+
import { DefaultThemeAssetContributor } from '@app/shared/layout/themes/default/DefaultThemeAssetContributor';
16+
import { ThemeHelper } from '@app/shared/layout/themes/ThemeHelper';
17+
import * as _ from 'lodash';
18+
19+
export class DynamicResourcesHelper {
20+
21+
static loadResources(callback: () => void): void {
22+
Promise.all([DynamicResourcesHelper.loadStlyes()])
23+
.then(() => {
24+
callback();
25+
});
26+
}
27+
28+
static loadStlyes(): Promise<any> {
29+
let theme = "theme2"; // always set theme2 for this project
30+
//let theme = ThemeHelper.getTheme();
31+
32+
const isRtl = rtlDetect.isRtlLang(abp.localization.currentLanguage.name);
33+
34+
if (isRtl) {
35+
document.documentElement.setAttribute('dir', 'rtl');
36+
}
37+
38+
const cssPostfix = isRtl ? '-rtl' : '';
39+
const styleLoaderService = new StyleLoaderService();
40+
41+
let styleUrls = [
42+
AppConsts.appBaseUrl + '/assets/metronic/themes/' + theme + '/css/style.bundle' + cssPostfix.replace('-', '.') + '.min.css',
43+
AppConsts.appBaseUrl + '/assets/primeng/datatable/css/primeng.datatable' + cssPostfix + '.min.css',
44+
AppConsts.appBaseUrl + '/assets/common/styles/metronic-customize.min.css',
45+
AppConsts.appBaseUrl + '/assets/common/styles/themes/' + theme + '/metronic-customize.min.css',
46+
AppConsts.appBaseUrl + '/assets/common/styles/metronic-customize-angular.min.css'
47+
].concat(DynamicResourcesHelper.getAdditionalThemeAssets());
48+
49+
styleLoaderService.loadArray(styleUrls);
50+
51+
if (isRtl) {
52+
styleLoaderService.load(
53+
AppConsts.appBaseUrl + '/assets/common/styles/abp-zero-template-rtl.min.css'
54+
);
55+
}
56+
57+
return Promise.resolve(true);
58+
}
59+
60+
static getAdditionalThemeAssets(): string[] {
61+
let theme = ThemeHelper.getTheme();
62+
63+
if (theme === 'default') {
64+
return new DefaultThemeAssetContributor().getAssetUrls();
65+
}
66+
67+
if (theme === 'theme8') {
68+
return new Theme8ThemeAssetContributor().getAssetUrls();
69+
}
70+
71+
if (theme === 'theme2') {
72+
return new Theme2ThemeAssetContributor().getAssetUrls();
73+
}
74+
75+
if (theme === 'theme3') {
76+
return new Theme3ThemeAssetContributor().getAssetUrls();
77+
}
78+
79+
if (theme === 'theme4') {
80+
return new Theme4ThemeAssetContributor().getAssetUrls();
81+
}
82+
83+
if (theme === 'theme5') {
84+
return new Theme5ThemeAssetContributor().getAssetUrls();
85+
}
86+
87+
if (theme === 'theme6') {
88+
return new Theme6ThemeAssetContributor().getAssetUrls();
89+
}
90+
91+
if (theme === 'theme7') {
92+
return new Theme7ThemeAssetContributor().getAssetUrls();
93+
}
94+
95+
if (theme === 'theme9') {
96+
return new Theme9ThemeAssetContributor().getAssetUrls();
97+
}
98+
99+
if (theme === 'theme10') {
100+
return new Theme10ThemeAssetContributor().getAssetUrls();
101+
}
102+
103+
if (theme === 'theme11') {
104+
return new Theme11ThemeAssetContributor().getAssetUrls();
105+
}
106+
107+
if (theme === 'theme12') {
108+
return new Theme12ThemeAssetContributor().getAssetUrls();
109+
}
110+
111+
return [];
112+
}
113+
}

0 commit comments

Comments
 (0)