If on a subreddit, remember it and head back to the front page.
        If this was pressed on the front page, go back to the last subreddit.
169914
def show_frontpage(self):
        

        if self.content.name != '/r/front':
            target = '/r/front'
            self.toggled_subreddit = self.content.name
        else:
            target = self.toggled_subreddit

        # target still may be empty string if this command hasn't yet been used
        if target is not None:
            self.refresh_content(order='ignore', name=target)
1023778
def next_page(self):
        """"""
        if self.history.position < self.history.size and self.history.bottom:
            mid = min(len(self.history.bottom),
                      int(math.ceil(self.lines * self.history.ratio)))

            self.history.top.extend(self.buffer[y] for y in range(mid))
            self.history = self.history \
                ._replace(position=self.history.position + mid)

            for y in range(self.lines - mid):
                self.buffer[y] = self.buffer[y + mid]
            for y in range(self.lines - mid, self.lines):
                self.buffer[y] = self.history.bottom.popleft()

            self.dirty = set(range(self.lines))
1055080
def fetch_top_submissions(self, top):
        
        for submission in self.subreddit.top(limit=None, time_filter=top):
            self.submissions[submission.id] = MiniSubmission(submission)
833280
protected function userWentBackToPreviousStep()
    {
        return !$this->isAfterLastPage() && !$this->isFirstRequest() && $this->currentPage->getIndex() < $this->lastDisplayedPage->getIndex();
    }
1211794
def OnBackView(self, event):
        """"""
        self.historyIndex -= 1
        try:
            self.RestoreHistory(self.history[self.historyIndex])
        except IndexError, err:
            self.SetStatusText(_('No further history available'))
274424
function checkScroll() {
            if (window.pageXOffset != scroll.left) {
                scroll.top = window.pageYOffset;
                scroll.left = window.pageXOffset;
    
                Stickyfill.refreshAll();
            } else if (window.pageYOffset != scroll.top) {
                scroll.top = window.pageYOffset;
                scroll.left = window.pageXOffset;
    
                // recalc position for all stickies
                stickies.forEach(function (sticky) {
                    return sticky._recalcPosition();
                });
            }
        }
717736
def add_subreddit(self, subreddit, _delete=False, *args, **kwargs):
        
        subreddit = six.text_type(subreddit)
        url = self.reddit_session.config['multireddit_add'].format(
            user=self._author, multi=self.name, subreddit=subreddit)
        method = 'DELETE' if _delete else 'PUT'
        # The modhash isn't necessary for OAuth requests
        if not self.reddit_session._use_oauth:
            self.reddit_session.http.headers['x-modhash'] = \
                self.reddit_session.modhash
        data = {'model': dumps({'name': subreddit})}
        try:
            self.reddit_session.request(url, data=data, method=method,
                                        *args, **kwargs)
        finally:
            # The modhash isn't necessary for OAuth requests
            if not self.reddit_session._use_oauth:
                del self.reddit_session.http.headers['x-modhash']
1209258
protected function displayPrev()
    {
        if ($this->prev_page > 0) {
            $link = $this->getLink();

            $anchor = new SwatHtmlTag('a');
            $anchor->href = sprintf($link, (string) $this->prev_page);
            // this is a non-breaking space
            $anchor->setContent($this->previous_label);
            $anchor->class = 'swat-pagination-nextprev';
            $anchor->display();
        } else {
            $span = new SwatHtmlTag('span');
            $span->class = 'swat-pagination-nextprev';
            $span->setContent($this->previous_label);
            $span->display();
        }
    }
367560
protected void pushFrontEntry(T e) {
        e.setPrev(null);
        e.setNext(head);
        if (head != null) {
            head.setPrev(e);
        } else {
            last = e;
        }
        head = e;
        size++;
    }
13669
public void maybeDoOffset(){
    long seen = tuplesSeen;
    if (offsetCommitInterval > 0 && seen % offsetCommitInterval == 0 && offsetStorage != null && fp.supportsOffsetManagement()){
      doOffsetInternal();
    }
  }
584857
public void goBack() {
        String action = "Going back one page";
        String expected = "Previous page from browser history is loaded";
        try {
            driver.navigate().back();
        } catch (Exception e) {
            reporter.fail(action, expected, "Browser was unable to go back one page. " + e.getMessage());
            log.warn(e);
            return;
        }
        reporter.pass(action, expected, expected);
    }
1260298
private function mforeach()
	{
		$this->__cached = preg_replace($this->usingDirective('foreach', true), '<?php foreach ($1) : ?>', $this->__cached);
		$this->__cached = preg_replace($this->usingDirective('endforeach'), '<?php endforeach ;?>', $this->__cached);
	}
185399
public function refreshLastPostedDiscussion()
    {
        if ($lastPostedDiscussion = $this->discussions()->latest('last_posted_at')->first()) {
            $this->setLastPostedDiscussion($lastPostedDiscussion);
        }

        return $this;
    }
368101
def move_to(self, target, position='first-child'):
        """"""

        # Invalidate both in case position matters,
        # otherwise only target is needed.
        self.invalidate()
        target.invalidate()
        super(Page, self).move_to(target, position=position)
528379
function _movePrev() {
        var $context, $prev;

        $context = $currentContext || $("#mrof-container #mrof-list > li.highlight");
        if ($context.length > 0) {
            $prev = $context.prev();
            if ($prev.length === 0) {
                $prev = $("#mrof-container #mrof-list > li").last();
            }
            if ($prev.length > 0) {
                $currentContext = $prev;
                $prev.find("a.mroitem").trigger("focus");
            }
        } else {
            //WTF! (Worse than failure). We should not get here.
            $("#mrof-container #mrof-list > li > a.mroitem:visited").last().trigger("focus");
        }
    }
853261
def focus_last_reply(self):
        """"""
        mid = self.get_selected_mid()
        newpos = self._tree.last_child_position(mid)
        if newpos is not None:
            newpos = self._sanitize_position((newpos,))
            self.body.set_focus(newpos)
720006
public function forward()
    {
        if ($this->position > count($this->stack) - 2) {
            throw new \LogicException('You are already on the last page.');
        }

        return clone $this->stack[++$this->position];
    }