MCPcopy Index your code
hub / github.com/TruthHun/BookStack / pre_and_next_link

Function pre_and_next_link

static/js/bookstack.js:176–196  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

174}
175
176function pre_and_next_link(){
177 //上一篇和下一篇的链接
178 var links=$(".article-menu a"),link_active=location.pathname,l=links.length;
179 for(var i=0;i<l;i++){
180 if (encodeURI($(links[i]).attr("href"))==link_active){
181 $(".hung-read-link .col-xs-12").hide();
182 var link_pre=$(links[i-1]),link_next=$(links[i+1]);
183 if(link_pre && link_pre.text()){
184 $(".hung-pre a").attr("href",link_pre.attr("href"));
185 $(".hung-pre a").text(link_pre.text());
186 $(".hung-pre").show();
187 }
188 if(link_next && link_next.text()){
189 $(".hung-next a").attr("href",link_next.attr("href"));
190 $(".hung-next a").text(link_next.text());
191 $(".hung-next").show();
192 }
193 i=l;
194 }
195 }
196}
197
198function disableRightClick(){
199 $('body').on('contextmenu','audio,video', function(e) {

Callers 2

load_docFunction · 0.85
bookstack.jsFile · 0.85

Calls 2

textMethod · 0.80
$Function · 0.50

Tested by

no test coverage detected