gnc:html-foo-include: Use gnc-resolve-file-path.

This commit is contained in:
John Ralls 2021-12-27 09:44:00 -08:00
parent b57f900401
commit ff75ad7043
3 changed files with 7 additions and 8 deletions

View File

@ -69,15 +69,15 @@ gchar * gnc_path_get_localedir(void);
%newobject gnc_path_get_stdreportsdir;
gchar * gnc_path_get_stdreportsdir(void);
%newobject gnc_path_find_localized_html_file;
gchar * gnc_path_find_localized_html_file(const gchar *);
%newobject gnc_build_userdata_path;
gchar * gnc_build_userdata_path(const gchar *);
%newobject gnc_file_path_absolute;
gchar *gnc_file_path_absolute (const gchar *, const gchar *);
%newobject gnc_resolve_file_path;
gchar *gnc_resolve_file_path (const gchar *);
%newobject gnc_build_scm_path;
gchar * gnc_build_scm_path(const gchar *);

View File

@ -444,8 +444,7 @@ document.getElementById(chartid).onclick = function(evt) {
;; clashing on multi-column reports
(id (symbol->string (gensym "chart"))))
(push (gnc:html-js-include
(gnc-path-find-localized-html-file "chartjs/Chart.bundle.min.js")))
(push (gnc:html-js-include "chartjs/Chart.bundle.min.js"))
;; the following hidden h3 is used to query style and copy onto chartjs
(push "<h3 style='display:none'></h3>")

View File

@ -425,12 +425,12 @@
(define (gnc:html-js-include file)
(format #f
"<script language=\"javascript\" type=\"text/javascript\" src=~s></script>\n"
(make-uri (gnc-path-find-localized-html-file file))))
(make-uri (gnc-resolve-file-path file))))
(define (gnc:html-css-include file)
(format #f
"<link rel=\"stylesheet\" type=\"text/css\" href=\"file:///~a\" />\n"
(gnc-path-find-localized-html-file file)))
"<link rel=\"stylesheet\" type=\"text/css\" href=~s />\n"
(make-uri (gnc-resolve-file-path file))))