Budget.php.init-budget.js 1.0 KB

1234567891011121314151617181920212223242526272829
  1. if (!HTML_ID) throw "Missing HTML_ID"; // 'widget-budget'
  2. if (!year) throw "Missing year"; // '2018'
  3. if (!today) throw "Missing today"; // date('Y-m-d')
  4. if (!projectPathsOrder) throw "Missing projectPathsOrder";
  5. if (!projectPathsMap) throw "Missing projectPathsMap";
  6. if (!projectInfo) throw "Missing projectInfo";
  7. if (!costs) throw "Missing costs";
  8. if (!plan) throw "Missing plan";
  9. var DBG = DBG || false;
  10. if (!window.p5VendorJs) throw "Missing window.p5VendorJs - load static/vendor.js";
  11. const createReactClass = window.p5VendorJs.createReactClass;
  12. const h = window.p5VendorJs.React.createElement;
  13. const React = window.p5VendorJs.React;
  14. const ReactDOM = window.p5VendorJs.ReactDOM;
  15. if (!window.p5VendorJs.p5UI__Budget) throw "Missing p5UI__Budget - load budget.js";
  16. var p5UI__Budget = window.p5VendorJs.p5UI__Budget;
  17. ReactDOM.render(h(p5UI__Budget, {
  18. year: year,
  19. today: today,
  20. projectPathsOrder: projectPathsOrder,
  21. projectPathsMap: projectPathsMap,
  22. projectInfo: projectInfo,
  23. costs: costs,
  24. plan: plan,
  25. DBG: DBG
  26. }), document.getElementById(HTML_ID));