<commit_before>annoCtrl.controller('BookCtrl', ['$scope', '$routeParams', '$modal', '$timeout', 'UserService', 'SerializeService', 'TranslateService', 'FileSystemService', function($scope, $routeParams, $modal, $timeout, UserService, SerializeService, TranslateService, FileSystemService) {

  var books, book, notes
    , uid = $routeParams.uid
    , bid = $routeParams.bid
  UserService.login().then(function(user) {
    $scope.user = user
  })
  UserService.getUser(uid).then(function(user) {
    // retrieve book
    $scope.dominateColor = {
      background: '#fff',
      foreground: '#000'
    }
    $scope.author = user
    SerializeService.fetchBook(user.id, bid).then(function(book) {
      $scope.$emit('page:change', 'book', (user.name? '<a link="/' + user.uid + '">' + user.name + '的书架</a> ❯ ' : '') + book.title)
      $scope.book = book
      $scope.order = 'time'
      $scope.reverse = true
      $scope.book_cover = book.images.large
    })


    $scope.book_opened = 0
    $scope.openBook = function() {
      $scope.book_opened = 1
    }<commit_msg>add breadcrumb for one's own book page<commit_after>annoCtrl.controller('BookCtrl', ['$scope', '$routeParams', '$modal', '$timeout', 'UserService', 'SerializeService', 'TranslateService', 'FileSystemService', function($scope, $routeParams, $modal, $timeout, UserService, SerializeService, TranslateService, FileSystemService) {

  var books, book, notes
    , uid = $routeParams.uid
    , bid = $routeParams.bid
  UserService.login().then(function(user) {
    $scope.user = user
  })
  UserService.getUser(uid).then(function(user) {
    // retrieve book
    $scope.dominateColor = {
      background: '#fff',
      foreground: '#000'
    }
    $scope.author = user
    SerializeService.fetchBook(user.id, bid).then(function(book) {
      $scope.$emit('page:change', 'book', (user.is_self? '<a link="/">我的书架 ❯ </a>': '<a link="/' + user.uid + '">' + user.name + '的书架</a> ❯ ') + book.title)
      $scope.book = book
      $scope.order = 'time'
      $scope.reverse = true
      $scope.book_cover = book.images.large
    })


    $scope.book_opened = 0
    $scope.openBook = function() {
      $scope.book_opened = 1
    }
{'fraction_non_alphanumeric': 0.17413162705667276, 'fraction_numerical': 0.004570383912248629, 'mean_word_length': 3.550935550935551, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4871035', 'n_tokens_mistral': 734, 'n_tokens_neox': 718, 'n_words': 138}