1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-27 12:36:14 +01:00

require all templates for in-line html

This commit is contained in:
Kyle Spearrin 2017-11-07 16:59:21 -05:00
parent e43d4fe5c6
commit 44eedc8b1d
5 changed files with 44 additions and 41 deletions

View File

@ -86,7 +86,7 @@
<div class="content"> <div class="content">
<div class="two-factor-key-page"> <div class="two-factor-key-page">
<p>{{i18n.insertYubiKey}}</p> <p>{{i18n.insertYubiKey}}</p>
<img src="../images/two-factor/yubikey.jpg" alt="" class="img-rounded img-responsive" /> <img src="../../../../images/two-factor/yubikey.jpg" alt="" class="img-rounded img-responsive" />
</div> </div>
<div class="list"> <div class="list">
<div class="list-section"> <div class="list-section">
@ -125,7 +125,7 @@
<p ng-if="!u2fReady">Loading...</p> <p ng-if="!u2fReady">Loading...</p>
<div ng-if="u2fReady"> <div ng-if="u2fReady">
<p>{{i18n.insertU2f}}</p> <p>{{i18n.insertU2f}}</p>
<img src="../images/two-factor/u2fkey.jpg" alt="" class="img-rounded img-responsive" /> <img src="../../../../images/two-factor/u2fkey.jpg" alt="" class="img-rounded img-responsive" />
</div> </div>
</div> </div>
<div class="list"> <div class="list">

View File

@ -46,21 +46,21 @@ angular
.state('splash', { .state('splash', {
url: '/splash', url: '/splash',
controller: 'baseController', controller: 'baseController',
templateUrl: 'app/global/splash.html', template: require('./global/splash.html'),
data: { authorize: false }, data: { authorize: false },
params: { animation: null } params: { animation: null }
}) })
.state('privateMode', { .state('privateMode', {
url: '/private-mode', url: '/private-mode',
controller: 'privateModeController', controller: 'privateModeController',
templateUrl: 'app/global/privateMode.html', template: require('./global/privateMode.html'),
data: { authorize: false }, data: { authorize: false },
params: { animation: null } params: { animation: null }
}) })
.state('home', { .state('home', {
url: '/home', url: '/home',
controller: 'baseController', controller: 'baseController',
templateUrl: 'app/global/home.html', template: require('./global/home.html'),
data: { authorize: false }, data: { authorize: false },
params: { animation: null } params: { animation: null }
}) })
@ -68,35 +68,35 @@ angular
.state('login', { .state('login', {
url: '/login', url: '/login',
controller: 'accountsLoginController', controller: 'accountsLoginController',
templateUrl: 'app/accounts/views/accountsLogin.html', template: require('./accounts/views/accountsLogin.html'),
data: { authorize: false }, data: { authorize: false },
params: { animation: null, email: null } params: { animation: null, email: null }
}) })
.state('hint', { .state('hint', {
url: '/hint', url: '/hint',
controller: 'accountsHintController', controller: 'accountsHintController',
templateUrl: 'app/accounts/views/accountsHint.html', template: require('./accounts/views/accountsHint.html'),
data: { authorize: false }, data: { authorize: false },
params: { animation: null } params: { animation: null }
}) })
.state('twoFactor', { .state('twoFactor', {
url: '/two-factor', url: '/two-factor',
controller: 'accountsLoginTwoFactorController', controller: 'accountsLoginTwoFactorController',
templateUrl: 'app/accounts/views/accountsLoginTwoFactor.html', template: require('./accounts/views/accountsLoginTwoFactor.html'),
data: { authorize: false }, data: { authorize: false },
params: { animation: null, email: null, masterPassword: null, providers: null, provider: null } params: { animation: null, email: null, masterPassword: null, providers: null, provider: null }
}) })
.state('twoFactorMethods', { .state('twoFactorMethods', {
url: '/two-factor-methods', url: '/two-factor-methods',
controller: 'accountsTwoFactorMethodsController', controller: 'accountsTwoFactorMethodsController',
templateUrl: 'app/accounts/views/accountsTwoFactorMethods.html', template: require('./accounts/views/accountsTwoFactorMethods.html'),
data: { authorize: false }, data: { authorize: false },
params: { animation: null, email: null, masterPassword: null, providers: null, provider: null } params: { animation: null, email: null, masterPassword: null, providers: null, provider: null }
}) })
.state('register', { .state('register', {
url: '/register', url: '/register',
controller: 'accountsRegisterController', controller: 'accountsRegisterController',
templateUrl: 'app/accounts/views/accountsRegister.html', template: require('./accounts/views/accountsRegister.html'),
data: { authorize: false }, data: { authorize: false },
params: { animation: null } params: { animation: null }
}) })
@ -104,24 +104,24 @@ angular
.state('tabs', { .state('tabs', {
url: '/tab', url: '/tab',
abstract: true, abstract: true,
templateUrl: 'app/global/tabs.html', template: require('./global/tabs.html'),
data: { authorize: true }, data: { authorize: true },
params: { animation: null } params: { animation: null }
}) })
.state('tabs.current', { .state('tabs.current', {
url: '/current', url: '/current',
templateUrl: 'app/current/views/current.html', template: require('./current/views/current.html'),
controller: 'currentController' controller: 'currentController'
}) })
.state('tabs.vault', { .state('tabs.vault', {
url: '/vault', url: '/vault',
templateUrl: 'app/vault/views/vault.html', template: require('./vault/views/vault.html'),
controller: 'vaultController', controller: 'vaultController',
params: { syncOnLoad: false, searchText: null } params: { syncOnLoad: false, searchText: null }
}) })
.state('tabs.settings', { .state('tabs.settings', {
url: '/settings', url: '/settings',
templateUrl: 'app/settings/views/settings.html', template: require('./settings/views/settings.html'),
controller: 'settingsController' controller: 'settingsController'
}) })
.state('tabs.tools', { .state('tabs.tools', {
@ -131,35 +131,35 @@ angular
.state('viewFolder', { .state('viewFolder', {
url: '/view-folder?folderId', url: '/view-folder?folderId',
templateUrl: 'app/vault/views/vaultViewFolder.html', template: require('./vault/views/vaultViewFolder.html'),
controller: 'vaultViewFolderController', controller: 'vaultViewFolderController',
data: { authorize: true }, data: { authorize: true },
params: { animation: null, from: 'vault' } params: { animation: null, from: 'vault' }
}) })
.state('viewCipher', { .state('viewCipher', {
url: '/view-cipher?cipherId', url: '/view-cipher?cipherId',
templateUrl: 'app/vault/views/vaultViewCipher.html', template: require('./vault/views/vaultViewCipher.html'),
controller: 'vaultViewCipherController', controller: 'vaultViewCipherController',
data: { authorize: true }, data: { authorize: true },
params: { animation: null, from: 'vault' } params: { animation: null, from: 'vault' }
}) })
.state('addCipher', { .state('addCipher', {
url: '/add-cipher', url: '/add-cipher',
templateUrl: 'app/vault/views/vaultAddCipher.html', template: require('./vault/views/vaultAddCipher.html'),
controller: 'vaultAddCipherController', controller: 'vaultAddCipherController',
data: { authorize: true }, data: { authorize: true },
params: { animation: null, name: null, uri: null, folderId: null, cipher: null, from: 'vault' } params: { animation: null, name: null, uri: null, folderId: null, cipher: null, from: 'vault' }
}) })
.state('editCipher', { .state('editCipher', {
url: '/edit-cipher?cipherId', url: '/edit-cipher?cipherId',
templateUrl: 'app/vault/views/vaultEditCipher.html', template: require('./vault/views/vaultEditCipher.html'),
controller: 'vaultEditCipherController', controller: 'vaultEditCipherController',
data: { authorize: true }, data: { authorize: true },
params: { animation: null, fromView: true, cipher: null, from: 'vault' } params: { animation: null, fromView: true, cipher: null, from: 'vault' }
}) })
.state('attachments', { .state('attachments', {
url: '/attachments?id', url: '/attachments?id',
templateUrl: 'app/vault/views/vaultAttachments.html', template: require('./vault/views/vaultAttachments.html'),
controller: 'vaultAttachmentsController', controller: 'vaultAttachmentsController',
data: { authorize: true }, data: { authorize: true },
params: { animation: null, fromView: true, from: 'vault' } params: { animation: null, fromView: true, from: 'vault' }
@ -167,21 +167,21 @@ angular
.state('passwordGenerator', { .state('passwordGenerator', {
url: '/password-generator', url: '/password-generator',
templateUrl: 'app/tools/views/toolsPasswordGenerator.html', template: require('./tools/views/toolsPasswordGenerator.html'),
controller: 'toolsPasswordGeneratorController', controller: 'toolsPasswordGeneratorController',
data: { authorize: true }, data: { authorize: true },
params: { animation: null, addState: null, editState: null } params: { animation: null, addState: null, editState: null }
}) })
.state('passwordGeneratorHistory', { .state('passwordGeneratorHistory', {
url: '/history', url: '/history',
templateUrl: 'app/tools/views/toolsPasswordGeneratorHistory.html', template: require('./tools/views/toolsPasswordGeneratorHistory.html'),
controller: 'toolsPasswordGeneratorHistoryController', controller: 'toolsPasswordGeneratorHistoryController',
data: { authorize: true }, data: { authorize: true },
params: { animation: null, addState: null, editState: null } params: { animation: null, addState: null, editState: null }
}) })
.state('export', { .state('export', {
url: '/export', url: '/export',
templateUrl: 'app/tools/views/toolsExport.html', template: require('./tools/views/toolsExport.html'),
controller: 'toolsExportController', controller: 'toolsExportController',
data: { authorize: true }, data: { authorize: true },
params: { animation: null } params: { animation: null }
@ -189,42 +189,42 @@ angular
.state('about', { .state('about', {
url: '/about', url: '/about',
templateUrl: 'app/settings/views/settingsAbout.html', template: require('./settings/views/settingsAbout.html'),
controller: 'settingsAboutController', controller: 'settingsAboutController',
data: { authorize: true }, data: { authorize: true },
params: { animation: null } params: { animation: null }
}) })
.state('credits', { .state('credits', {
url: '/credits', url: '/credits',
templateUrl: 'app/settings/views/settingsCredits.html', template: require('./settings/views/settingsCredits.html'),
controller: 'settingsCreditsController', controller: 'settingsCreditsController',
data: { authorize: true }, data: { authorize: true },
params: { animation: null } params: { animation: null }
}) })
.state('features', { .state('features', {
url: '/features', url: '/features',
templateUrl: 'app/settings/views/settingsFeatures.html', template: require('./settings/views/settingsFeatures.html'),
controller: 'settingsFeaturesController', controller: 'settingsFeaturesController',
data: { authorize: true }, data: { authorize: true },
params: { animation: null } params: { animation: null }
}) })
.state('help', { .state('help', {
url: '/help', url: '/help',
templateUrl: 'app/settings/views/settingsHelp.html', template: require('./settings/views/settingsHelp.html'),
controller: 'settingsHelpController', controller: 'settingsHelpController',
data: { authorize: true }, data: { authorize: true },
params: { animation: null } params: { animation: null }
}) })
.state('sync', { .state('sync', {
url: '/sync', url: '/sync',
templateUrl: 'app/settings/views/settingsSync.html', template: require('./settings/views/settingsSync.html'),
controller: 'settingsSyncController', controller: 'settingsSyncController',
data: { authorize: true }, data: { authorize: true },
params: { animation: null } params: { animation: null }
}) })
.state('premium', { .state('premium', {
url: '/premium', url: '/premium',
templateUrl: 'app/settings/views/settingsPremium.html', template: require('./settings/views/settingsPremium.html'),
controller: 'settingsPremiumController', controller: 'settingsPremiumController',
data: { authorize: true }, data: { authorize: true },
params: { animation: null } params: { animation: null }
@ -232,28 +232,28 @@ angular
.state('folders', { .state('folders', {
url: '/folders', url: '/folders',
templateUrl: 'app/settings/views/settingsFolders.html', template: require('./settings/views/settingsFolders.html'),
controller: 'settingsFoldersController', controller: 'settingsFoldersController',
data: { authorize: true }, data: { authorize: true },
params: { animation: null } params: { animation: null }
}) })
.state('addFolder', { .state('addFolder', {
url: '/addFolder', url: '/addFolder',
templateUrl: 'app/settings/views/settingsAddFolder.html', template: require('./settings/views/settingsAddFolder.html'),
controller: 'settingsAddFolderController', controller: 'settingsAddFolderController',
data: { authorize: true }, data: { authorize: true },
params: { animation: null } params: { animation: null }
}) })
.state('editFolder', { .state('editFolder', {
url: '/editFolder?folderId', url: '/editFolder?folderId',
templateUrl: 'app/settings/views/settingsEditFolder.html', template: require('./settings/views/settingsEditFolder.html'),
controller: 'settingsEditFolderController', controller: 'settingsEditFolderController',
data: { authorize: true }, data: { authorize: true },
params: { animation: null } params: { animation: null }
}) })
.state('environment', { .state('environment', {
url: '/environment', url: '/environment',
templateUrl: 'app/settings/views/settingsEnvironment.html', template: require('./settings/views/settingsEnvironment.html'),
controller: 'settingsEnvironmentController', controller: 'settingsEnvironmentController',
data: { authorize: false }, data: { authorize: false },
params: { animation: null } params: { animation: null }

View File

@ -2,7 +2,7 @@
<a ui-sref="environment({animation: 'in-slide-up'})" class="settings-icon"> <a ui-sref="environment({animation: 'in-slide-up'})" class="settings-icon">
<i class="fa fa-cog fa-lg"></i><span>&nbsp;Settings</span> <i class="fa fa-cog fa-lg"></i><span>&nbsp;Settings</span>
</a> </a>
<img src="../../../../images/logo@2x.png" alt="bitwarden" /> <img src="../../../images/logo@2x.png" alt="bitwarden" />
<p>{{i18n.loginOrCreateNewAccount}}</p> <p>{{i18n.loginOrCreateNewAccount}}</p>
<div class="bottom-buttons"> <div class="bottom-buttons">
<a class="btn btn-lg btn-primary btn-block" ui-sref="register({animation: 'in-slide-up'})" <a class="btn btn-lg btn-primary btn-block" ui-sref="register({animation: 'in-slide-up'})"

View File

@ -1,5 +1,5 @@
<div class="content"> <div class="content">
<div class="splash-page"> <div class="splash-page">
<img src="../../../../images/logo@3x.png" alt="bitwarden" /> <img src="../../../images/logo@3x.png" alt="bitwarden" />
</div> </div>
</div> </div>

View File

@ -39,6 +39,16 @@ module.exports = {
publicPath: '/' publicPath: '/'
} }
}] }]
},
{
test: /\.(jpe?g|png|gif|svg)$/i,
use: [{
loader: 'file-loader',
options: {
name: '[name].[ext]',
useRelativePath: true
}
}]
} }
] ]
}, },
@ -76,13 +86,6 @@ module.exports = {
chunks: ['notification/bar'] chunks: ['notification/bar']
}), }),
new CopyWebpackPlugin([ new CopyWebpackPlugin([
// Temporarily copy the whole app folder, can be removed once
// the templates uses template rather than using templateUrl.
{
context: 'src/popup/app',
from: '**/*.html',
to: 'popup/app'
},
'./src/manifest.json', './src/manifest.json',
{ from: './src/_locales', to: '_locales' }, { from: './src/_locales', to: '_locales' },
{ from: './src/edge', to: 'edge' }, { from: './src/edge', to: 'edge' },