File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -825,6 +825,27 @@ let show_translation_for_text = function(text) {
825
825
} ;
826
826
827
827
828
+ // Get all the word ids on the current page, open new tab with just those terms.
829
+ function open_term_list_for_current_page ( ) {
830
+ const ids = new Set ( ) ;
831
+ $ ( 'span.word' ) . each ( function ( ) {
832
+ ids . add ( $ ( this ) . data ( "wid" ) ) ;
833
+ } ) ;
834
+ if ( ids . length == 0 )
835
+ return ; // Nothing to do.
836
+
837
+ const idarray = Array . from ( ids ) ;
838
+ const idlist = idarray . join ( '+' ) ;
839
+
840
+ // console.log('passing ids:');
841
+ // console.log(idlist);
842
+ // let msg = idlist;
843
+ // window.alert(msg);
844
+ const url = `/term/index?termids=${ idlist } ` ;
845
+ window . open ( url ) ;
846
+ }
847
+
848
+
828
849
/** Show the translation using the next dictionary. */
829
850
function handle_translate ( span_attribute ) {
830
851
const tis = get_textitems_spans ( span_attribute ) ;
Original file line number Diff line number Diff line change 91
91
</ ul >
92
92
</ div >
93
93
</ li >
94
+ < li >
95
+ < a id ="listTermsOnCurrentPage " class ="reading-menu-item " href ="" onclick ="open_term_list_for_current_page(); return false; ">
96
+ Term list
97
+ </ a >
98
+ </ li >
94
99
< li >
95
100
<!-- mobile users need this link, since they don't have keyboard shortcuts. -->
96
101
< a id ="translateSentence " class ="reading-menu-item " href ="" onclick ="handle_translate('sentence-id'); return false; ">
You can’t perform that action at this time.
0 commit comments