File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -68,11 +68,12 @@ document.getElementById('lang').addEventListener('change',(event)=>{
6868 } ) ;
6969 } ) ;
7070
71+ set_permalink ( ) ;
7172 event . preventDefault ( ) ;
7273 return false ;
7374} )
7475
75- // Change language select menu based on query string
76+ // Change language select menu based on query string.
7677var nav_lang = qd [ "lang" ]
7778if ( nav_lang != undefined ) {
7879 var lang_sel = document . getElementById ( "lang" ) ;
@@ -100,6 +101,22 @@ if (t_dir == "r2s") {
100101}
101102
102103
104+ // Change paermalink based on current language and options.
105+ function set_permalink ( ) {
106+ document . getElementById ( "permalink" ) . setAttribute (
107+ "href" ,
108+ window . location . origin +
109+ "?lang=" + document . getElementById ( "lang" ) . value +
110+ "&dir=" + ( document . getElementById ( "opt_s2r" ) . checked ? "s2r" : "r2s" )
111+ ) ;
112+ }
113+
114+
115+ document . querySelectorAll ( 'input[name="t_dir"]' ) . forEach ( el => {
116+ el . addEventListener ( 'change' , set_permalink ) ;
117+ } ) ;
118+
119+
103120document . getElementById ( 'transliterate' ) . addEventListener ( 'submit' , ( event ) => {
104121
105122 if ( fb_active ) {
@@ -161,6 +178,7 @@ document.getElementById('transliterate').addEventListener('submit',(event)=>{
161178
162179} )
163180
181+ // Submit feedback form.
164182if ( fb_active ) {
165183 document . getElementById ( 'feedback_btn' ) . addEventListener ( 'click' , ( event ) => {
166184 document . getElementById ( 'lang_fb_input' ) . value = document . getElementById ( 'lang' ) . value ;
Original file line number Diff line number Diff line change 5050 margin-right : .4em ;
5151 }
5252
53+ .comment {font-size : 90% ; }
54+
5355 </ style >
5456
5557
@@ -123,6 +125,19 @@ <h3>General Options</h3>
123125 </ fieldset >
124126 {% endif %}
125127 </ form >
128+ < section id ="permalink_sec ">
129+ < p > < a id ="permalink " class ="button button-outline " href ="# ">
130+ Permalink
131+ </ a > </ p >
132+ < p class ="comment ">
133+ You can right-click on the permalink button, copy it to the
134+ clipboard, and/or bookmark it if you use the current
135+ language/direction often. The bookmark will take you back to the
136+ interface set to the options you chose. < strong > Note:</ strong > At the
137+ moment, only language and direction are saved. Other options are
138+ always reset when the page is reloaded.
139+ </ p >
140+ </ section >
126141
127142 {% if feedback_form %}
128143 < div id ="feedback_cont " class ="hidden ">
You can’t perform that action at this time.
0 commit comments