Moved placeholder page html to code generator and ejs template.

This commit is contained in:
emizzle 2018-05-23 09:33:05 +10:00
parent db9fbef140
commit ab738c05f9
3 changed files with 43 additions and 32 deletions

View File

@ -14,7 +14,8 @@ const Templates = {
define_web3_simple: require('./code_templates/define-web3-simple.js.ejs'),
web3_connector: require('./code_templates/web3-connector.js.ejs'),
do_when_loaded: require('./code_templates/do-when-loaded.js.ejs'),
exec_when_env_loaded: require('./code_templates/exec-when-env-loaded.js.ejs')
exec_when_env_loaded: require('./code_templates/exec-when-env-loaded.js.ejs'),
embark_building_placeholder: require('./code_templates/embark-building-placeholder.html.ejs')
};
class CodeGenerator {
@ -101,11 +102,15 @@ class CodeGenerator {
self.buildWeb3JS(cb);
});
self.events.setCommandHandler('code-generator:contract', (contractName, cb) => {
this.events.setCommandHandler('code-generator:contract', (contractName, cb) => {
let contract = self.contractsManager.contracts[contractName];
self.buildContractJS(contractName, self.generateContractJSON(contractName, contract), cb);
});
this.events.setCommandHandler('embark-building-placeholder', (cb) => {
this.buildPlaceholderPage(cb);
});
}
generateContext() {
@ -384,6 +389,11 @@ class CodeGenerator {
], cb);
}
buildPlaceholderPage(cb) {
let html = Templates.embark_building_placeholder({buildingMsg: __('Embark is building, please wait...')});
cb(html);
}
}
module.exports = CodeGenerator;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long