Default method used to render the final js links for the rendered webpage. Override this method in a sub-classed controller to change the output.
(self, js_files: Iterable[str])
| 923 | return self.finish(html) |
| 924 | |
| 925 | def render_linked_js(self, js_files: Iterable[str]) -> str: |
| 926 | """Default method used to render the final js links for the |
| 927 | rendered webpage. |
| 928 | |
| 929 | Override this method in a sub-classed controller to change the output. |
| 930 | """ |
| 931 | paths = [] |
| 932 | unique_paths = set() # type: Set[str] |
| 933 | |
| 934 | for path in js_files: |
| 935 | if not is_absolute(path): |
| 936 | path = self.static_url(path) |
| 937 | if path not in unique_paths: |
| 938 | paths.append(path) |
| 939 | unique_paths.add(path) |
| 940 | |
| 941 | return "".join( |
| 942 | '<script src="' |
| 943 | + escape.xhtml_escape(p) |
| 944 | + '" type="text/javascript"></script>' |
| 945 | for p in paths |
| 946 | ) |
| 947 | |
| 948 | def render_embed_js(self, js_embed: Iterable[bytes]) -> bytes: |
| 949 | """Default method used to render the final embedded js for the |
no test coverage detected