diff --git a/cmake/platforms/emscripten.cmake b/cmake/platforms/emscripten.cmake index bbb0897..c7e55fe 100644 --- a/cmake/platforms/emscripten.cmake +++ b/cmake/platforms/emscripten.cmake @@ -43,6 +43,7 @@ endfunction() function(set_platform_puzzle_target_properties NAME TARGET) em_link_pre_js(${TARGET} ${CMAKE_SOURCE_DIR}/emccpre.js) em_link_js_library(${TARGET} ${CMAKE_SOURCE_DIR}/emcclib.js) + em_link_post_js(${TARGET} ${CMAKE_SOURCE_DIR}/emccpost.js) endfunction() function(build_platform_extras) diff --git a/emccpost.js b/emccpost.js new file mode 100644 index 0000000..b12b0af --- /dev/null +++ b/emccpost.js @@ -0,0 +1 @@ +initPuzzle(); diff --git a/emccpre.js b/emccpre.js index 1579ead..310c465 100644 --- a/emccpre.js +++ b/emccpre.js @@ -35,6 +35,51 @@ var update_xmin, update_xmax, update_ymin, update_ymax; // our own init stuff first), and that when main() returns nothing // will get cleaned up so we remain able to call the puzzle's various // callbacks. +// +// +// Page loading order: +// +// 1. The browser starts reading *.html (which comes from jspage.pl) +// 2. It finds the + -
+