diff options
author | Alexander_Kabui | 2024-08-13 11:11:22 +0300 |
---|---|---|
committer | BonfaceKilz | 2024-08-29 18:58:56 +0300 |
commit | 495c6e926b86e71a7a8a62b3df0c7e691ab66ac8 (patch) | |
tree | 76acf5c6d2852a9372fe995c72ebfee490de2c01 /gn2/wqflask/templates/gn_editor_commit.html | |
parent | 1d9e79d08c28369147ba52809fc1456e9aafcee6 (diff) | |
download | genenetwork2-495c6e926b86e71a7a8a62b3df0c7e691ab66ac8.tar.gz |
Show diff for edited files.
Diffstat (limited to 'gn2/wqflask/templates/gn_editor_commit.html')
-rw-r--r-- | gn2/wqflask/templates/gn_editor_commit.html | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/gn2/wqflask/templates/gn_editor_commit.html b/gn2/wqflask/templates/gn_editor_commit.html index 0ea20adb..8fd1547b 100644 --- a/gn2/wqflask/templates/gn_editor_commit.html +++ b/gn2/wqflask/templates/gn_editor_commit.html @@ -9,41 +9,50 @@ <div> <div class="row"> <label class="col-sm-4" for="message"> <i>*Commit Message*</i></label> - </div> <br> <div class="row"> <textarea rows="12" class="col-sm-12" name="message" required id="commit-message"> </textarea> - </div> </div> <br> <br> <div class="row"> <button id="btn-commit" - class="btn btn-primary col-sm-2 col-sm-offset-1"> + class="btn btn-primary col-sm-2 col-sm-offset-1"> Commit </button> + <button id="btn-diff" + class="btn col-sm-2 col-sm-offset-1"> + Show Diff + </button> </div> <br> - + <div id="diff_page"> + </div> </div> </section> {% block js %} - - <script> +<script> htmx.on("#btn-commit", "click", function(event){ let msg = htmx.find("#commit-message").value.trim() if (msg != ""){ - //fire custom event here re - htmx.find("#output").dispatchEvent( - new CustomEvent("commitEvent", { + htmx.find("#output").dispatchEvent( + new CustomEvent("commitEvent", { + bubbles: true, + detail: {action: 'didInitialize', payload: msg}, + }), + ); + } + }) + htmx.on("#btn-diff", "click", function(event){ + htmx.find("#output").dispatchEvent( + new CustomEvent("diffEvent", { bubbles: true, - detail: {action: 'didInitialize', payload: msg}, + detail: {}, }), ); - } }) </script> {% endblock %} |