Template:autoPreviousNext

  • Revision slug: Template:autoPreviousNext
  • Revision title: Template:autoPreviousNext
  • Revision id: 32918
  • Created:
  • Creator: user01
  • Is current revision? No
  • Comment 25 words added, 11 words removed

Revision Content

var chapterList = string.deserialize(JSGChapters());
var i = list.indexOf(chapterList, $0);
if (i != -1){
  switch (i){
    case 0:
      next(getRelativeURL(chapterList1[1], true));
      break;
    case (#chapterList) - 1:
      previous(getRelativeURL(chapterList[(#chapterList) - 2], true));
      break;
    default:
      previousNext(getRelativeURL(chapterList[i - 1], true), getRelativeURL(chapterList[i + 1], true));
  }
}

Revision Source

<p><span class="script"> var chapterList = string.deserialize(JSGChapters());<br />
var i = list.indexOf(chapterList, $0);<br />
if (i != -1){<br />
  switch (i){<br />
    case 0:<br />
      next(getRelativeURL(chapterList1[1], true));<br />
      break;<br />
    case (#chapterList) - 1:<br />
      previous(getRelativeURL(chapterList[(#chapterList) - 2], true));<br />
      break;<br />
    default:<br />
      previousNext(getRelativeURL(chapterList[i - 1], true), getRelativeURL(chapterList[i + 1], true));<br />
  }<br />
}</span></p>
Revert to this revision