Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit d1ac286

Browse files
author
Nick Litwin
committed
Require images from javascript
1 parent c5f1a6b commit d1ac286

File tree

4 files changed

+34
-31
lines changed

4 files changed

+34
-31
lines changed

app/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ requireContextFiles(require.context('./', true, /^(?:(?!\.spec\.js$).)*\.js$/igm
5757
// Require all SCSS files
5858
// requireContextFiles(require.context('../assets/css/', true, /^(.*\.(scss$))[^.]*$/igm))
5959

60+
// Require all images
61+
// requireContextFiles(require.context('../assets/images/', true, /^\.\/(images)\/[^\/]+\.(svg|png|jpg|jpeg|gif)/igm))
62+
6063
// Some ordering is needed for right cascading of styles
6164
// TODO: each module requires the CSS it needs and we delete this list
6265
require('../assets/css/vendors/introjs.scss')

app/layout/header/header.controller.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ import _ from 'lodash'
4949
vm.userHandle = UserService.getUserIdentity().handle
5050

5151
vm.userMenu = [
52-
{ 'sref': 'dashboard', 'text': 'DASHBOARD', 'icon': '../../../assets/images/nav/dashboard.svg' },
53-
{ 'sref': 'profile.about', 'srefParams': { 'userHandle': vm.userHandle }, 'text': 'MY PROFILE', 'icon': '../../../assets/images/nav/profile.svg' },
54-
{ 'href': vm.constants.COMMUNITY_URL + '/PactsMemberServlet?module=PaymentHistory&full_list=false', 'text': 'PAYMENTS', 'icon': '../../../assets/images/nav/wallet.svg' },
55-
{ 'sref': 'settings.profile', 'text': 'SETTINGS', 'icon': '../../../assets/images/nav/settings.svg' }
52+
{ 'sref': 'dashboard', 'text': 'DASHBOARD', 'icon': require('../../../assets/images/nav/dashboard.svg') },
53+
{ 'sref': 'profile.about', 'srefParams': { 'userHandle': vm.userHandle }, 'text': 'MY PROFILE', 'icon': require('../../../assets/images/nav/profile.svg') },
54+
{ 'href': vm.constants.COMMUNITY_URL + '/PactsMemberServlet?module=PaymentHistory&full_list=false', 'text': 'PAYMENTS', 'icon': require('../../../assets/images/nav/wallet.svg') },
55+
{ 'sref': 'settings.profile', 'text': 'SETTINGS', 'icon': require('../../../assets/images/nav/settings.svg') }
5656
]
5757

5858
ProfileService.getUserProfile(vm.userHandle)

app/services/introduction.service.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -81,43 +81,43 @@ import _ from 'lodash'
8181
about: {
8282
steps: [
8383
{
84-
intro: '<img src="../../../assets/images/introjs/profile-skills.svg" /><h1>Member Profile</h1><p>Welcome to the new Topcoder Profile. It’s been reimagined as the premier place to showcase your experience, with three main sections.</p>'
84+
intro: '<img src="' + require('../../assets/images/introjs/profile-skills.svg') + '" /><h1>Member Profile</h1><p>Welcome to the new Topcoder Profile. It’s been reimagined as the premier place to showcase your experience, with three main sections.</p>'
8585
},
8686
{
8787
// element: '#skills',
88-
intro: '<img src="../../../assets/images/introjs/profile-skills.svg" /><h1>Skills</h1><p>A quick way to understand your strengths. Skills include languages, environments, frameworks, libraries, platforms, tools, and any other technologies that you know well.</p>',
88+
intro: '<img src="' + require('../../assets/images/introjs/profile-skills.svg') + '" /><h1>Skills</h1><p>A quick way to understand your strengths. Skills include languages, environments, frameworks, libraries, platforms, tools, and any other technologies that you know well.</p>',
8989
position: 'top'
9090
},
9191
{
9292
// element: '#tcActivity',
93-
intro: '<img src="../../../assets/images/introjs/profile-tc-activity.svg" /><h1>Activity on Topcoder</h1><p>See your active sub-track ratings and explore detailed statistics and past challenges</p>',
93+
intro: '<img src="' + require('../../assets/images/introjs/profile-tc-activity.svg') + '" /><h1>Activity on Topcoder</h1><p>See your active sub-track ratings and explore detailed statistics and past challenges</p>',
9494
position: 'top'
9595
},
9696
{
9797
// element: '#externalLinks',
98-
intro: '<img src="../../../assets/images/introjs/profile-web-activity.svg" /><h1>Activity across the web</h1><p>Show off the best of your work and experience outside of Topcoder by connecting external accounts or adding links.</p>',
98+
intro: '<img src="' + require('../../assets/images/introjs/profile-web-activity.svg') + '" /><h1>Activity across the web</h1><p>Show off the best of your work and experience outside of Topcoder by connecting external accounts or adding links.</p>',
9999
position: 'top'
100100
}
101101
]
102102
},
103103
subtrack: {
104104
steps: [
105105
{
106-
intro: '<img src="../../../assets/images/introjs/subtrack-metrics.svg" /><h1>Subtrack Details</h1><p>Welcome to the new Sub-track Details page. This page summarizes your activity in a particular sub-track and has detailed historical metrics.</p>'
106+
intro: '<img src="' + require('../../assets/images/introjs/subtrack-metrics.svg') + '" /><h1>Subtrack Details</h1><p>Welcome to the new Sub-track Details page. This page summarizes your activity in a particular sub-track and has detailed historical metrics.</p>'
107107
},
108108
{
109109
// element: '#subtrack-stats',
110-
intro: '<img src="../../../assets/images/introjs/subtrack-metrics.svg" /><h1>Basic metrics</h1><p>Understand your performance at a glance.</p>',
110+
intro: '<img src="' + require('../../assets/images/introjs/subtrack-metrics.svg') + '" /><h1>Basic metrics</h1><p>Understand your performance at a glance.</p>',
111111
position: 'bottom'
112112
},
113113
{
114114
// element: '#challenges-tab',
115-
intro: '<img src="../../../assets/images/introjs/subtrack-challenges.svg" /><h1>Charts & in-depth statistics</h1><p>View charts and comprehensive metrics to get a granular understanding of the activity in this sub-track.</p>',
115+
intro: '<img src="' + require('../../assets/images/introjs/subtrack-challenges.svg') + '" /><h1>Charts & in-depth statistics</h1><p>View charts and comprehensive metrics to get a granular understanding of the activity in this sub-track.</p>',
116116
position: 'top'
117117
},
118118
{
119119
// element: '#challenges-tab',
120-
intro: '<img src="../../../assets/images/introjs/subtrack-statistics.svg" /><h1>Completed challenges</h1><p>View all the challenges you’ve successfully completed in this sub-track.</p>',
120+
intro: '<img src="' + require('../../assets/images/introjs/subtrack-statistics.svg') + '" /><h1>Completed challenges</h1><p>View all the challenges you’ve successfully completed in this sub-track.</p>',
121121
position: 'top'
122122
}
123123
]
@@ -126,21 +126,21 @@ import _ from 'lodash'
126126
dashboard: {
127127
steps: [
128128
{
129-
intro: '<img src="../../../assets/images/introjs/dashboard-challenges.svg" /><h1>Topcoder Dashboard</h1><p>Welcome to your new Topcoder Dashboard. It’s been revamped to bring your most-needed information to the fore. Let’s walk through some of the new sections.</p>'
129+
intro: '<img src="' + require('../../assets/images/introjs/dashboard-challenges.svg') + '" /><h1>Topcoder Dashboard</h1><p>Welcome to your new Topcoder Dashboard. It’s been revamped to bring your most-needed information to the fore. Let’s walk through some of the new sections.</p>'
130130
},
131131
{
132132
// element: '#challenges',
133-
intro: '<img src="../../../assets/images/introjs/dashboard-challenges.svg" /><h1>Your challenges</h1><p>See your active challenges in a grid or list. Find the main challenge information, such as phase or action required, and click to go to the challenge details.</p>',
133+
intro: '<img src="' + require('../../assets/images/introjs/dashboard-challenges.svg') + '" /><h1>Your challenges</h1><p>See your active challenges in a grid or list. Find the main challenge information, such as phase or action required, and click to go to the challenge details.</p>',
134134
position: 'top'
135135
},
136136
{
137137
// element: '#srms',
138-
intro: '<img src="../../../assets/images/introjs/dashboard-srms.svg" /><h1>Single round matches</h1><p>Keep track of upcoming Single Round Matches and easily find links to past problems, match editorials, and the Arena.</p>',
138+
intro: '<img src="' + require('../../assets/images/introjs/dashboard-srms.svg') + '" /><h1>Single round matches</h1><p>Keep track of upcoming Single Round Matches and easily find links to past problems, match editorials, and the Arena.</p>',
139139
position: 'top'
140140
},
141141
{
142142
// element: '#community',
143-
intro: '<img src="../../../assets/images/introjs/dashboard-community.svg" /><h1>Community updates</h1><p>Don’t miss the latest happenings in our community. Events, member programs, fun challenges, and more!</p>',
143+
intro: '<img src="' + require('../../assets/images/introjs/dashboard-community.svg') + '" /><h1>Community updates</h1><p>Don’t miss the latest happenings in our community. Events, member programs, fun challenges, and more!</p>',
144144
position: 'top'
145145
}
146146
]

app/services/nav.service.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,25 @@ import angular from 'angular'
1616

1717
service.menuLinks = {
1818
'compete': [
19-
{ 'href': '/challenges/design/active/?pageIndex=1', 'text': 'DESIGN CHALLENGES', 'icon': '../../../assets/images/nav/track-design.svg' },
20-
{ 'href': '/challenges/develop/active/?pageIndex=1', 'text': 'DEVELOPMENT CHALLENGES', 'icon': '../../../assets/images/nav/track-develop.svg' },
21-
{ 'href': '/challenges/data/active/?pageIndex=1', 'text': 'DATA SCIENCE CHALLENGES', 'icon': '../../../assets/images/nav/track-data.svg' },
22-
{ 'href': CONSTANTS.ARENA_URL, 'text': 'COMPETITIVE PROGRAMMING', 'icon': '../../../assets/images/nav/track-cp.svg', 'target': '_blank' }
19+
{ 'href': '/challenges/design/active/?pageIndex=1', 'text': 'DESIGN CHALLENGES', 'icon': require('../../assets/images/nav/track-design.svg') },
20+
{ 'href': '/challenges/develop/active/?pageIndex=1', 'text': 'DEVELOPMENT CHALLENGES', 'icon': require('../../assets/images/nav/track-develop.svg') },
21+
{ 'href': '/challenges/data/active/?pageIndex=1', 'text': 'DATA SCIENCE CHALLENGES', 'icon': require('../../assets/images/nav/track-data.svg') },
22+
{ 'href': CONSTANTS.ARENA_URL, 'text': 'COMPETITIVE PROGRAMMING', 'icon': require('../../assets/images/nav/track-cp.svg'), 'target': '_blank' }
2323
],
2424
'learn': [
25-
{ 'href': '/getting-started/', 'text': 'GETTING STARTED', 'icon': '../../../assets/images/nav/rocket.svg' },
26-
{ 'href': '/community/design/', 'text': 'DESIGN', 'icon': '../../../assets/images/nav/book-design.svg' },
27-
{ 'href': '/community/development/', 'text': 'DEVELOPMENT', 'icon': '../../../assets/images/nav/book-develop.svg' },
28-
{ 'href': '/community/data-science/', 'text': 'DATA SCIENCE', 'icon': '../../../assets/images/nav/book-data.svg' },
29-
{ 'href': '/community/competitive%20programming/', 'text': 'COMPETITIVE PROGRAMMING', 'icon': '../../../assets/images/nav/book-cp.svg' }
25+
{ 'href': '/getting-started/', 'text': 'GETTING STARTED', 'icon': require('../../assets/images/nav/rocket.svg') },
26+
{ 'href': '/community/design/', 'text': 'DESIGN', 'icon': require('../../assets/images/nav/book-design.svg') },
27+
{ 'href': '/community/development/', 'text': 'DEVELOPMENT', 'icon': require('../../assets/images/nav/book-develop.svg') },
28+
{ 'href': '/community/data-science/', 'text': 'DATA SCIENCE', 'icon': require('../../assets/images/nav/book-data.svg') },
29+
{ 'href': '/community/competitive%20programming/', 'text': 'COMPETITIVE PROGRAMMING', 'icon': require('../../assets/images/nav/book-cp.svg') }
3030
],
3131
'community': [
32-
{ 'sref': 'community.members', 'text': 'OVERVIEW', 'icon': '../../../assets/images/nav/members.svg' },
33-
{ 'href': '/community/member-programs/', 'text': 'PROGRAMS', 'icon': '../../../assets/images/nav/programs.svg' },
34-
{ 'href': CONSTANTS.FORUMS_APP_URL, 'text': 'FORUMS', 'icon': '../../../assets/images/nav/forums.svg' },
35-
{ 'sref': 'community.statistics', 'text': 'STATISTICS', 'icon': '../../../assets/images/nav/statistics.svg' },
36-
{ 'href': '/community/events/', 'text': 'EVENTS', 'icon': '../../../assets/images/nav/events.svg' },
37-
{ 'href': '/blog/', 'text': 'BLOG', 'icon': '../../../assets/images/nav/blog.svg' }
32+
{ 'sref': 'community.members', 'text': 'OVERVIEW', 'icon': require('../../assets/images/nav/members.svg') },
33+
{ 'href': '/community/member-programs/', 'text': 'PROGRAMS', 'icon': require('../../assets/images/nav/programs.svg') },
34+
{ 'href': CONSTANTS.FORUMS_APP_URL, 'text': 'FORUMS', 'icon': require('../../assets/images/nav/forums.svg') },
35+
{ 'sref': 'community.statistics', 'text': 'STATISTICS', 'icon': require('../../assets/images/nav/statistics.svg') },
36+
{ 'href': '/community/events/', 'text': 'EVENTS', 'icon': require('../../assets/images/nav/events.svg') },
37+
{ 'href': '/blog/', 'text': 'BLOG', 'icon': require('../../assets/images/nav/blog.svg') }
3838
]
3939
}
4040

0 commit comments

Comments
 (0)