refactor roi calc js into modular files
This commit is contained in:
parent
51d80364c0
commit
afe3817395
11 changed files with 1611 additions and 1144 deletions
105
hub/services/static/js/roi-calculator-modular.js
Normal file
105
hub/services/static/js/roi-calculator-modular.js
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
/**
|
||||
* ROI Calculator - Modular Version
|
||||
* This file loads all modules and provides global function wrappers for backward compatibility
|
||||
*/
|
||||
|
||||
// Global function wrappers for backward compatibility with existing HTML
|
||||
function updateCalculations() {
|
||||
if (window.ROICalculatorApp) {
|
||||
window.ROICalculatorApp.updateCalculations();
|
||||
}
|
||||
}
|
||||
|
||||
function exportToPDF() {
|
||||
if (window.ROICalculatorApp) {
|
||||
window.ROICalculatorApp.exportToPDF();
|
||||
}
|
||||
}
|
||||
|
||||
function exportToCSV() {
|
||||
if (window.ROICalculatorApp) {
|
||||
window.ROICalculatorApp.exportToCSV();
|
||||
}
|
||||
}
|
||||
|
||||
function handleInvestmentAmountInput(input) {
|
||||
InputUtils.handleInvestmentAmountInput(input);
|
||||
}
|
||||
|
||||
function updateInvestmentAmount(value) {
|
||||
if (window.ROICalculatorApp) {
|
||||
window.ROICalculatorApp.updateInvestmentAmount(value);
|
||||
}
|
||||
}
|
||||
|
||||
function updateRevenuePerInstance(value) {
|
||||
if (window.ROICalculatorApp) {
|
||||
window.ROICalculatorApp.updateRevenuePerInstance(value);
|
||||
}
|
||||
}
|
||||
|
||||
function updateServalaShare(value) {
|
||||
if (window.ROICalculatorApp) {
|
||||
window.ROICalculatorApp.updateServalaShare(value);
|
||||
}
|
||||
}
|
||||
|
||||
function updateGracePeriod(value) {
|
||||
if (window.ROICalculatorApp) {
|
||||
window.ROICalculatorApp.updateGracePeriod(value);
|
||||
}
|
||||
}
|
||||
|
||||
function updateLoanRate(value) {
|
||||
if (window.ROICalculatorApp) {
|
||||
window.ROICalculatorApp.updateLoanRate(value);
|
||||
}
|
||||
}
|
||||
|
||||
function updateScenarioChurn(scenarioKey, churnRate) {
|
||||
if (window.ROICalculatorApp) {
|
||||
window.ROICalculatorApp.updateScenarioChurn(scenarioKey, churnRate);
|
||||
}
|
||||
}
|
||||
|
||||
function updateScenarioPhase(scenarioKey, phaseIndex, newInstancesPerMonth) {
|
||||
if (window.ROICalculatorApp) {
|
||||
window.ROICalculatorApp.updateScenarioPhase(scenarioKey, phaseIndex, newInstancesPerMonth);
|
||||
}
|
||||
}
|
||||
|
||||
function resetAdvancedParameters() {
|
||||
if (window.ROICalculatorApp) {
|
||||
window.ROICalculatorApp.resetAdvancedParameters();
|
||||
}
|
||||
}
|
||||
|
||||
function toggleScenario(scenarioKey) {
|
||||
if (window.ROICalculatorApp) {
|
||||
window.ROICalculatorApp.toggleScenario(scenarioKey);
|
||||
}
|
||||
}
|
||||
|
||||
function toggleCollapsible(elementId) {
|
||||
if (window.ROICalculatorApp) {
|
||||
window.ROICalculatorApp.toggleCollapsible(elementId);
|
||||
}
|
||||
}
|
||||
|
||||
function resetCalculator() {
|
||||
if (window.ROICalculatorApp) {
|
||||
window.ROICalculatorApp.resetCalculator();
|
||||
}
|
||||
}
|
||||
|
||||
function toggleInvestmentModel() {
|
||||
if (window.ROICalculatorApp) {
|
||||
window.ROICalculatorApp.toggleInvestmentModel();
|
||||
}
|
||||
}
|
||||
|
||||
function logout() {
|
||||
if (window.ROICalculatorApp) {
|
||||
window.ROICalculatorApp.logout();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue