six-two/mkdocs-placeholder-plugin

PlaceholderPlugin.reload_page is not a function

Closed this issue · 3 comments

Hi!

The plugin is really great :-)

Unfortunately the "Apply new values" button doesn't work anymore:

(index):810 Uncaught TypeError: PlaceholderPlugin.reload_page is not a function
at HTMLButtonElement.onclick ((index):810:141)

Example page: https://mkdocs-placeholder-plugin.six-two.dev/tests/input-tables/ ;-)

Greetings

Erik

Hi Erik,

well spotted, the entire JS code was rewritten, which caused this breakage. The apply button(s) will be removed in a future version, since they introduce too many edge cases and updating placeholder values does not (always) need a page refresh anymore. But I may re-expose the reload function, since it seems useful.

Since I am traveling for up to two more weeks it may take some time till I can fix it.

Thanks for reporting,
six-two

Hm I looked into the issue,

to keep placeholder values sane when multiple text boxes exist for the same placeholder, values are no longer updated when you type. Instead you need to confirm them with the enter key.

This means simply reloading the page will now reset the changed values instead of applying them. Since implementing the proper behaviour is hard and I will remove them soon anyways, I will make a small release which makes it so that the buttons will not be added to tables anymore. Then you won't have a useless/broken button on the page anymore.

BR
six-two

Released 0.3.1