Skip to content

Commit

Permalink
shorten a variable name
Browse files Browse the repository at this point in the history
optimize+refactor
  • Loading branch information
shlomif committed Jun 16, 2024
1 parent ea343de commit 76dc82a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 22 deletions.
6 changes: 2 additions & 4 deletions fc-solve/site/wml/src/js-fc-solve/expand-moves/index.html.tt2
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,10 @@ card solitaire game, and <a href="#other_games">several related solitaire games<
[% IF enable_jquery_ui %]
[% INCLUDE set_up_tabs %]
[% END %]
window.my_web_fc_solve_ui = expand_moves_ui;
expand_moves_ui.set_up(null);
web_ui.set_up(null);
[% IF enable_jquery_ui %]
$( "#output_tabs" ).tabs();
[% END %]
[% suffix %]
});
});
}
Expand All @@ -41,7 +39,7 @@ card solitaire game, and <a href="#other_games">several related solitaire games<
[% END %]

[% BLOCK run_emscripten_common %]
[% INCLUDE emscripten_common incs="require(['expand-moves-ui', ], function (expand_moves_ui) { window.expand_moves_ui = expand_moves_ui; expand_moves_ui.init_module((module_wrapper) =>" , subject="Moves Expander" , suffix='' %]
[% INCLUDE emscripten_common incs = "require(['expand-moves-ui', ], function (web_ui) { window.my_web_fc_solve_ui = web_ui; web_ui.init_module((module_wrapper) =>" , subject = "Moves Expander" , %]
[% END %]

[%- INCLUDE run_emscripten_common -%]
Expand Down
12 changes: 5 additions & 7 deletions fc-solve/site/wml/src/js-fc-solve/find-deal/index.html.tt2
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,22 @@ card solitaire game. <span class="enable_js">Please enable
[%- WRAPPER wrap_html -%]

[% BLOCK emscripten_common %]
[% INCLUDE emscripten_common__header subject=subject , %]
[% INCLUDE emscripten_common__header subject = subject , %]
<script>
[% INCLUDE set_up_requirejs %]
[% incs %] {
window.my_web_fc_solve_ui = web_fc_solve_ui;
web_fc_solve_ui.init_module((module_wrapper)=>{
web_fc_solve_ui.set_up(module_wrapper);

window.my_web_fc_solve_ui = web_ui;
web_ui.init_module((module_wrapper)=>{
web_ui.set_up(module_wrapper);
$(window._set_up_tabs);
;
});
});
</script>

[% END %]


[% INCLUDE emscripten_common incs="require(['find-fc-deal-ui'], function (web_fc_solve_ui)",subject="Deal Finder", %]
[% INCLUDE emscripten_common incs = "require(['find-fc-deal-ui'], function (web_ui)" , subject = "Deal Finder", %]

<div id="fc_solve_tabs" class="fc_solve_tabs">

Expand Down
12 changes: 6 additions & 6 deletions fc-solve/site/wml/src/js-fc-solve/text/gui-tests.xhtml.tt2
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ UI (User-Interface) Tests for the online Freecell Solvers (intended for develope
[% END %]

[%- BLOCK emscripten_common -%]
[% INCLUDE emscripten_common__header subject=subject , %]
[% INCLUDE emscripten_common__header subject = subject , %]
<script>
[% INCLUDE set_up_requirejs %]
require(["ui-tests-driver"], function (tests_runner) {
Expand All @@ -16,22 +16,22 @@ require(['./solver-freecell'], function (solver) {
[% IF enable_jquery_ui %]
[% INCLUDE set_up_tabs %]
[% END %]
window.my_web_fc_solve_ui = web_fc_solve_ui;
web_fc_solve_ui.set_up(module_wrapper, solver);
web_ui.set_up(module_wrapper, solver);
tests_runner.run_after_delay(tests_runner.run_tests);
[%- IF enable_jquery_ui -%]
$( "#output_tabs" ).tabs();
[% END %]
[% suffix %]
);
};
});
});
});
});
</script>

[% END %]

[%- BLOCK run_emscripten_common -%]
[% INCLUDE emscripten_common incs="require(['web-fc-solve-ui', 'solver-freecell', 'solitaire', 'auto-stack-clear', 'auto-turnover', 'statistics', 'autoplay', 'application', 'freecell',], function (web_fc_solve_ui, solver2, solitaire, auto_stack, auto_turn, statistics, autoplay, application, freecell) { window.my_web_fc_solve_ui = web_fc_solve_ui; web_fc_solve_ui.init_module((module_wrapper) => { " , subject="Solver", suffix="}; });}" %]
[% INCLUDE emscripten_common incs = "require(['web-fc-solve-ui', 'solver-freecell', 'solitaire', 'auto-stack-clear', 'auto-turnover', 'statistics', 'autoplay', 'application', 'freecell',], function (web_ui, solver2, solitaire, auto_stack, auto_turn, statistics, autoplay, application, freecell) { window.my_web_fc_solve_ui = web_ui; web_ui.init_module((module_wrapper) => { " , subject = "Solver" , %]
[% END %]
[%- BLOCK page_extra_head_elements -%]
<link rel="stylesheet" href="[% base_path %]css/qunit.css" />
Expand Down
8 changes: 3 additions & 5 deletions fc-solve/site/wml/src/js-fc-solve/text/index.html.tt2
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,18 @@ card solitaire game, and <a href="#other_games">several related solitaire games<
[%- WRAPPER wrap_html -%]

[% BLOCK emscripten_common %]
[% INCLUDE emscripten_common__header subject=subject , %]
[% INCLUDE emscripten_common__header subject = subject , %]
<script>
[% INCLUDE set_up_requirejs %]
require(['./solver-freecell'], function (solver) {
[% incs %] {
[% IF enable_jquery_ui %]
[% INCLUDE set_up_tabs %]
[% END %]
window.my_web_fc_solve_ui = web_fc_solve_ui;
web_fc_solve_ui.set_up(module_wrapper, solver);
web_ui.set_up(module_wrapper, solver);
[% IF enable_jquery_ui %]
$( "#output_tabs" ).tabs();
[% END %]
[% suffix %]
});
});
});
Expand All @@ -46,7 +44,7 @@ require(['./solver-freecell'], function (solver) {
[% END %]

[% BLOCK run_emscripten_common %]
[% INCLUDE emscripten_common incs="require(['web-fc-solve-ui', 'solver-freecell', 'solitaire', 'auto-stack-clear', 'auto-turnover', 'statistics', 'autoplay', 'application', 'freecell',], function (web_fc_solve_ui, solver2, solitaire, auto_stack, auto_turn, statistics, autoplay, application, freecell) { window.my_web_fc_solve_ui = web_fc_solve_ui; web_fc_solve_ui.init_module((module_wrapper) =>" , subject="Solver", suffix='' %]
[% INCLUDE emscripten_common incs = "require(['web-fc-solve-ui', 'solver-freecell', 'solitaire', 'auto-stack-clear', 'auto-turnover', 'statistics', 'autoplay', 'application', 'freecell',], function (web_ui, solver2, solitaire, auto_stack, auto_turn, statistics, autoplay, application, freecell) { window.my_web_fc_solve_ui = web_ui; web_ui.init_module((module_wrapper) =>" , subject = "Solver" , %]
[% END %]

[%- INCLUDE run_emscripten_common -%]
Expand Down

0 comments on commit 76dc82a

Please sign in to comment.