<commit_before>// main loading
angular.module('app', ['ui.router', 'ngMaterial'])
.constant('KeyNames',{'domain': 'http://wechat.qianmi.com'})
.config(['$httpProvider', '$stateProvider', '$urlRouterProvider', 'KeyNames',
function($httpProvider, $stateProvider, $urlRouterProvider, KeyNames) {
  // $httpProvider.interceptors.push('errorRecoverer');
  // $urlRouterProvider.otherwise("/home");
  $stateProvider
    .state('index', {
      url: "",
      controller: 'IndexCtrl',
      templateUrl: 'template/index.html'
  });
  //   .state('home', {
  //     url: "/home",
  //     views: {
  //       "mainview": {templateUrl: "template/home.html"},
  //       "naviview": { templateUrl: 'template/navi.logon.html' }
  //     }
  //   })
  //   .state('setting', {
  //     url: "/setting",
  //     views: {
  //       "mainview": {templateUrl: "template/setting.html"},
  //       "naviview": { templateUrl: 'template/navi.logon.html' }
  //     }
  //   })
  //   .state('search', {
  //     url: "/search",
  //     views: {
  //       "mainview": {templateUrl: "template/search.html"},
  //       "naviview": { templateUrl: 'template/navi.logon.html' }
  //     }
  //   })
  //   .state('profile', {
  //     url: "/profile",
  //     views: {
  //       "mainview": {templateUrl: "template/profile.html"},
  //       "naviview": {templateUrl: "template/navi.logon.html"}
  //     }
  //   })
  //   .state('error', {
  //     url: '/error/:type',
  //     views: {
  //       'mainview': {
  //         templateUrl: 'template/error.html',
  //         // controller: function($scope,$stateParams) {
  //         //   $scope.error = 404;
  //         // }
  //         controllerProvider: function($stateParams) {
  //           var ctrl = function(){};
  //         }
  //       },
  //       'naviview': {templateUrl: 'template/navi.logon.html'}
  //     }
  // });
}])
.controller('IndexCtrl',['$scope', '$http', 'KeyNames', '$mdDialog',
function($scope, $http, KeyNames, $mdDialog){
    // $http.get('www.baidu.com');
    var DialogController = function($scope, $http, $mdDialog) {
        $http.get(KeyNames.domain + '/oauth/req')
        .then(function(authLink){
            $scope.authLink = authLink;
            // window.open('http://wechat.qianmi.com/oauth/req');
        });
        $scope.hide = function() {
            $mdDialog.hide();
        };
        $scope.cancel = function() {
            $mdDialog.cancel();
        };
        $scope.answer = function(answer) {
            $mdDialog.hide(answer);
        };
    };
    $scope.showAuthDialog = function(ev) {
        $mdDialog.show({
          controller: DialogController,
          templateUrl: 'template/auth.pop.html',
          parent: angular.element(document.body),<commit_msg>json解析<commit_after>// main loading
angular.module('app', ['ui.router', 'ngMaterial'])
.constant('KeyNames',{'domain': 'http://wechat.qianmi.com'})
.config(['$httpProvider', '$stateProvider', '$urlRouterProvider', 'KeyNames',
function($httpProvider, $stateProvider, $urlRouterProvider, KeyNames) {
  // $httpProvider.interceptors.push('errorRecoverer');
  // $urlRouterProvider.otherwise("/home");
  $stateProvider
    .state('index', {
      url: "",
      controller: 'IndexCtrl',
      templateUrl: 'template/index.html'
  });
  //   .state('home', {
  //     url: "/home",
  //     views: {
  //       "mainview": {templateUrl: "template/home.html"},
  //       "naviview": { templateUrl: 'template/navi.logon.html' }
  //     }
  //   })
  //   .state('setting', {
  //     url: "/setting",
  //     views: {
  //       "mainview": {templateUrl: "template/setting.html"},
  //       "naviview": { templateUrl: 'template/navi.logon.html' }
  //     }
  //   })
  //   .state('search', {
  //     url: "/search",
  //     views: {
  //       "mainview": {templateUrl: "template/search.html"},
  //       "naviview": { templateUrl: 'template/navi.logon.html' }
  //     }
  //   })
  //   .state('profile', {
  //     url: "/profile",
  //     views: {
  //       "mainview": {templateUrl: "template/profile.html"},
  //       "naviview": {templateUrl: "template/navi.logon.html"}
  //     }
  //   })
  //   .state('error', {
  //     url: '/error/:type',
  //     views: {
  //       'mainview': {
  //         templateUrl: 'template/error.html',
  //         // controller: function($scope,$stateParams) {
  //         //   $scope.error = 404;
  //         // }
  //         controllerProvider: function($stateParams) {
  //           var ctrl = function(){};
  //         }
  //       },
  //       'naviview': {templateUrl: 'template/navi.logon.html'}
  //     }
  // });
}])
.controller('IndexCtrl',['$scope', '$http', 'KeyNames', '$mdDialog',
function($scope, $http, KeyNames, $mdDialog){
    // $http.get('www.baidu.com');
    var DialogController = function($scope, $http, $mdDialog) {
        $http.get(KeyNames.domain + '/oauth/req')
        .then(function(authLink){
            $scope.authLink = authLink.url;
            // window.open('http://wechat.qianmi.com/oauth/req');
        });
        $scope.hide = function() {
            $mdDialog.hide();
        };
        $scope.cancel = function() {
            $mdDialog.cancel();
        };
        $scope.answer = function(answer) {
            $mdDialog.hide(answer);
        };
    };
    $scope.showAuthDialog = function(ev) {
        $mdDialog.show({
          controller: DialogController,
          templateUrl: 'template/auth.pop.html',
          parent: angular.element(document.body),
{'fraction_non_alphanumeric': 0.2075266871720644, 'fraction_numerical': 0.001085579880586213, 'mean_word_length': 2.0108932461873636, 'pattern_counts': {'":': 16, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5348791', 'n_tokens_mistral': 1803, 'n_tokens_neox': 1795, 'n_words': 243}