Commit 6aad2a5b by Torkel Ödegaard

tech: cleanup and fixed build issue

parent f0e0e618
...@@ -9,6 +9,8 @@ import 'angular-sanitize'; ...@@ -9,6 +9,8 @@ import 'angular-sanitize';
import 'angular-dragdrop'; import 'angular-dragdrop';
import 'angular-bindonce'; import 'angular-bindonce';
import 'angular-ui'; import 'angular-ui';
import 'react';
import 'react-dom';
import 'ngreact'; import 'ngreact';
import $ from 'jquery'; import $ from 'jquery';
......
import * as React from 'react'; import * as React from 'react';
import 'react-dom';
import coreModule from '../core_module'; import coreModule from '../core_module';
export interface IProps { export interface IProps {
......
...@@ -8,7 +8,6 @@ import "./directives/dropdown_typeahead"; ...@@ -8,7 +8,6 @@ import "./directives/dropdown_typeahead";
import "./directives/metric_segment"; import "./directives/metric_segment";
import "./directives/misc"; import "./directives/misc";
import "./directives/ng_model_on_blur"; import "./directives/ng_model_on_blur";
import "./directives/password_strength";
import "./directives/spectrum_picker"; import "./directives/spectrum_picker";
import "./directives/tags"; import "./directives/tags";
import "./directives/value_select_dropdown"; import "./directives/value_select_dropdown";
......
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);
}
};
});
});
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
deps: ['jquery'], deps: ['jquery'],
exports: 'angular', exports: 'angular',
}, },
'vendor/angular-mocks/angular-mocks.js': { 'vendor/npm/angular-mocks/angular-mocks.js': {
format: 'global', format: 'global',
deps: ['angular'], deps: ['angular'],
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment