module.js 581 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. })
  13. .filter('newlines', function(){
  14. return function (input) {
  15. return input.replace(/\n/g, '<br/>');
  16. }
  17. })
  18. .filter('striphtml', function () {
  19. return function(text) {
  20. return text
  21. .replace(/&/g, '&amp;')
  22. .replace(/>/g, '&gt;')
  23. .replace(/</g, '&lt;');
  24. }
  25. });