Browse Source

tech: cleanup and fixed build issue

Torkel Ödegaard 8 năm trước cách đây
mục cha
commit
6aad2a5b2d

+ 2 - 0
public/app/app.ts

@@ -9,6 +9,8 @@ import 'angular-sanitize';
 import 'angular-dragdrop';
 import 'angular-bindonce';
 import 'angular-ui';
+import 'react';
+import 'react-dom';
 import 'ngreact';
 
 import $ from 'jquery';

+ 0 - 1
public/app/core/components/PasswordStrength.tsx

@@ -1,5 +1,4 @@
 import * as React from 'react';
-import 'react-dom';
 import coreModule from '../core_module';
 
 export interface IProps {

+ 0 - 1
public/app/core/core.ts

@@ -8,7 +8,6 @@ import "./directives/dropdown_typeahead";
 import "./directives/metric_segment";
 import "./directives/misc";
 import "./directives/ng_model_on_blur";
-import "./directives/password_strength";
 import "./directives/spectrum_picker";
 import "./directives/tags";
 import "./directives/value_select_dropdown";

+ 0 - 45
public/app/core/directives/password_strength.js

@@ -1,45 +0,0 @@
-define([
-  '../core_module',
-],
-function (coreModule) {
-  'use strict';
-
-  coreModule.default.directive('passwordStrength2', function() {
-    var template = '<div class="password-strength small" ng-if="!loginMode" ng-class="strengthClass">' +
-      '<em>{{strengthText}}</em>' +
-      '</div>';
-    return {
-      template: template,
-      scope: {
-        password: "=",
-      },
-      link: function($scope) {
-
-        $scope.strengthClass = '';
-
-        function passwordChanged(newValue) {
-          if (!newValue) {
-            $scope.strengthText = "";
-            $scope.strengthClass = "hidden";
-            return;
-          }
-          if (newValue.length < 4) {
-            $scope.strengthText = "strength: weak sauce.";
-            $scope.strengthClass = "password-strength-bad";
-            return;
-          }
-          if (newValue.length <= 8) {
-            $scope.strengthText = "strength: you can do better.";
-            $scope.strengthClass = "password-strength-ok";
-            return;
-          }
-
-          $scope.strengthText = "strength: strong like a bull.";
-          $scope.strengthClass = "password-strength-good";
-        }
-
-        $scope.$watch("password", passwordChanged);
-      }
-    };
-  });
-});

+ 1 - 1
public/test/test-main.js

@@ -65,7 +65,7 @@
         deps: ['jquery'],
         exports: 'angular',
       },
-      'vendor/angular-mocks/angular-mocks.js': {
+      'vendor/npm/angular-mocks/angular-mocks.js': {
         format: 'global',
         deps: ['angular'],
       },