Skip to content

Commit

Permalink
webpack.config.js: OZ_main.html -> OZentry.html
Browse files Browse the repository at this point in the history
Having one include contain both entrypoints and the other only
including one is confusing. Replace OZ_main with explicit OZentry/OZui
include files.

Add support for multiple includes to partial_install, so we can add
both includes to minlife.html.
  • Loading branch information
lentinj committed Apr 23, 2024
1 parent a2cd450 commit b9ab0f5
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 10 deletions.
9 changes: 5 additions & 4 deletions OZprivate/ServerScripts/Utilities/partial_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@
# the local version, in static/
m = re.match('\s*<div id="OZ_js_modules" data-include="([^>]+)">', line)
if m:
include_path = os.path.join(os.path.dirname(fileinput.filename()), m.group(1))
with open(include_path) as include_file:
for inc_line in include_file:
line += inc_line
for include_path in m.group(1).split(" "):
include_path = os.path.join(os.path.dirname(fileinput.filename()), include_path)
with open(include_path) as include_file:
for inc_line in include_file:
line += inc_line
skip_lines = True
elif line.strip() == '</div>':
skip_lines = False
Expand Down
3 changes: 2 additions & 1 deletion views/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
<!-- Treeviewer code for search / embedded view -->
{{if is_testing:}}<script>window.is_testing = true;</script>{{pass}}
<script>var OZstrings={{include 'treeviewer/js_strings.json'}};</script>
{{include '../static/OZTreeModule/dist/OZ_main.html'}} <!--includes OZui-->
{{include '../static/OZTreeModule/dist/OZentry.html'}}
{{include '../static/OZTreeModule/dist/OZui.html'}}
{{include 'treeviewer/server_urls.html' }}

{{block head}}{{end}}
Expand Down
2 changes: 1 addition & 1 deletion views/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<!-- All JavaScript at the bottom, except for Modernizr which enables
HTML5 elements & feature detects -->
<script src="{{=URL('static','js/modernizr-2.8.3.min.js')}}"></script>
{{include '../static/OZTreeModule/dist/OZui.html' # Don't need the full OZ_main (tree view) capability in a popup}}
{{include '../static/OZTreeModule/dist/OZui.html' # NB: Not including OZentry.html }}
{{include 'treeviewer/server_urls.html' }}
{{block head}}{{end}}
</head>
Expand Down
5 changes: 3 additions & 2 deletions views/treeviewer/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@
<link rel="stylesheet" type="text/css" href="{{=URL('static', 'css/OZ_shared.css')}}" />
{{if is_testing:}}<script>window.is_testing = true;</script>{{pass}}
<!-- do not change the next line in any way. The exact format is used for partial installs -->
<div id="OZ_js_modules" data-include="../static/OZTreeModule/dist/OZ_main.html">
{{include "../static/OZTreeModule/dist/OZ_main.html"}}
<div id="OZ_js_modules" data-include="../static/OZTreeModule/dist/OZentry.html ../static/OZTreeModule/dist/OZui.html">
{{include '../static/OZTreeModule/dist/OZentry.html'}}
{{include '../static/OZTreeModule/dist/OZui.html'}}
</div>

<!-- treeviewer constants -->
Expand Down
3 changes: 2 additions & 1 deletion views/uikit_layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
{{include 'web2py.html'}}

{{if is_testing:}}<script>window.is_testing = true;</script>{{pass}}
{{include '../static/OZTreeModule/dist/OZ_main.html' # Include the tree viewer for use on the front page}}
{{include '../static/OZTreeModule/dist/OZentry.html'}}
{{include '../static/OZTreeModule/dist/OZui.html'}}
<script>var OZstrings={{include 'treeviewer/js_strings.json'}}</script>
{{include 'treeviewer/server_urls.html' }}
</head>
Expand Down
3 changes: 2 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ var config = {
plugins: [
new HtmlWebpackPlugin({
scriptLoading: 'blocking',
filename: 'OZ_main.html',
filename: 'OZentry.html',
chunks: ['OZentry'],
// This template contains the script tags refering to the js files generated by
// the webpack compile command
template: OZTreeModule_src('OZ_script_template.html')
Expand Down

0 comments on commit b9ab0f5

Please sign in to comment.