diff options
author | Andrew Dolgov <[email protected]> | 2018-02-02 13:47:04 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2018-02-02 13:47:04 +0300 |
commit | fa6a735fe5e1d4b995d9ef5db23f9dcc411237d9 (patch) | |
tree | 7b78fdd50f000b62f8ca29535791764ce320ead4 | |
parent | 10149818546d048bc0121e7e09570bcc028d2d25 (diff) |
add search button to dict result dialog (uses google for now)
-rw-r--r-- | js/read.js | 1 | ||||
-rw-r--r-- | read.html | 9 |
2 files changed, 9 insertions, 1 deletions
@@ -267,6 +267,7 @@ function dict_lookup(word, callback) { if (data) { $(".dict_result").html(data.result.join("<br/>")); + $(".dict_query").val(word); $("#dict-modal").modal('show'); if (callback) callback(); @@ -137,11 +137,13 @@ <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> <h4 class="modal-title">Dictionary Lookup</h4> </div> + <input type="hidden" class="dict_query" value=""/> <div class="modal-body"> <div class="dict_result"> </div> </div> <div class="modal-footer"> - <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> + <button type="button" class="dict_search_btn btn-default btn">Google</button> + <button type="button" class="btn btn-primary" data-dismiss="modal">Close</button> </div> </div> </div> @@ -539,8 +541,13 @@ $('#dict-modal').on('shown.bs.modal', function() { $(".dict_result").scrollTop(0); + }) + $(".dict_search_btn").on("click", function() { + $("#dict-modal").modal('hide'); + window.open("https://google.com/search?q=" + $(".dict_query").val()); + }); $('#toc-modal').on('shown.bs.modal', function() { function process_toc_sublist(row, list, nest) { |