<commit_before>angular.module('paperworkNotes').controller('SidebarManageNotebooksController',
  function($scope, $rootScope, $location, $routeParams, NotebooksService) {
    $scope.modalList = [];

    $('#modalManageNotebooks').on('hidden.bs.modal', function(e) {
      //$scope.modalList = [];
      //$scope.$apply();    // Because not angular scope
    });

    //$('#modalManageNotebooks').on('show.bs.modal', function (e) {
    // Added watch to rebuild list when we add new element
    $rootScope.$watch('notebooks', function(newValue, oldValue) {
      // Remove 'All Notes' item
      var data = ($.isArray($rootScope.notebooks)) ? $rootScope.notebooks.slice() : [];
      for(var i in data) {
        if(data[i].id == 0) {
          data.splice(i, 1);
          break;
        }
      }
      $scope.modalList = data;
    });

    var buildShortcutChk = function(editable, newRow) {
      var shortcut = false;
      if(!newRow) {
        shortcut = !!NotebooksService.getShortcutByNotebookIdLocal(editable.options.pk);
      }

      editable.container.$form.find('.control-group').after(
        $('<div/>').addClass('checkbox shortcut-chk').append(
          $('<label/>').append(
            $('<input/>').attr({
              'type':  'checkbox',
              'name':  'shortcut',
              'value': '1'
            }).prop('checked', shortcut)
          ).append($rootScope.i18n.notebooks.add_shortcut)
        )
      );
    };

    var parseParams = function(params) {<commit_msg>Removed 'All Notes' entry from Manage Notebooks dialog<commit_after>angular.module('paperworkNotes').controller('SidebarManageNotebooksController',
  function($scope, $rootScope, $location, $routeParams, NotebooksService) {
    $scope.modalList = [];

    $('#modalManageNotebooks').on('hidden.bs.modal', function(e) {
      //$scope.modalList = [];
      //$scope.$apply();    // Because not angular scope
    });

    //$('#modalManageNotebooks').on('show.bs.modal', function (e) {
    // Added watch to rebuild list when we add new element
    $rootScope.$watch('notebooks', function(newValue, oldValue) {
      // Remove 'All Notes' item
      var data = ($.isArray($rootScope.notebooks)) ? $rootScope.notebooks.slice() : [];
      for(var i in data) {
        if(data[i].type == 2) {
          data.splice(i, 1);
          break;
        }
      }
      console.log(data);
      $scope.modalList = data;
    });

    var buildShortcutChk = function(editable, newRow) {
      var shortcut = false;
      if(!newRow) {
        shortcut = !!NotebooksService.getShortcutByNotebookIdLocal(editable.options.pk);
      }

      editable.container.$form.find('.control-group').after(
        $('<div/>').addClass('checkbox shortcut-chk').append(
          $('<label/>').append(
            $('<input/>').attr({
              'type':  'checkbox',
              'name':  'shortcut',
              'value': '1'
            }).prop('checked', shortcut)
          ).append($rootScope.i18n.notebooks.add_shortcut)
        )
      );
    };

    var parseParams = function(params) {
{'fraction_non_alphanumeric': 0.17035110533159947, 'fraction_numerical': 0.003250975292587776, 'mean_word_length': 2.4886621315192743, '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': '4939465', 'n_tokens_mistral': 956, 'n_tokens_neox': 926, 'n_words': 162}