module.js 597 B

12345678910111213141516171819202122232425262728
  1. angular.module('kibana.text', [])
  2. .controller('text', function($scope, $rootScope) {
  3. // Set and populate defaults
  4. var _d = {
  5. group : "default",
  6. content : "",
  7. style: {},
  8. }
  9. _.defaults($scope.panel,_d);
  10. $scope.init = function() {
  11. }
  12. $scope.init();
  13. })
  14. .filter('newlines', function(){
  15. return function (input) {
  16. return input.replace(/\n/g, '<br/>');
  17. }
  18. })
  19. .filter('striphtml', function () {
  20. return function(text) {
  21. return text
  22. .replace(/&/g, '&amp;')
  23. .replace(/>/g, '&gt;')
  24. .replace(/</g, '&lt;');
  25. }
  26. });