module.js 624 B

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