From 9e3514a993316d5c89677d5040197c5fc1b04cb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Thu, 14 Aug 2014 22:30:19 +0200 Subject: [PATCH] More small performance tweaks, trying to clean up watcher & scope counts --- src/app/panels/text/module.js | 34 ++++++++++++--------------- src/app/panels/timepicker/module.html | 3 +-- src/app/panels/timepicker/module.js | 14 +++++++++-- 3 files changed, 28 insertions(+), 23 deletions(-) diff --git a/src/app/panels/text/module.js b/src/app/panels/text/module.js index 60abc9a3186..575495dcbe2 100644 --- a/src/app/panels/text/module.js +++ b/src/app/panels/text/module.js @@ -1,15 +1,3 @@ -/** @scratch /panels/5 - * include::panels/text.asciidoc[] - */ - -/** @scratch /panels/text/0 - * == text - * Status: *Stable* - * - * The text panel is used for displaying static text formated as markdown, sanitized html or as plain - * text. - * - */ define([ 'angular', 'app', @@ -23,6 +11,8 @@ function (angular, app, _, require) { var module = angular.module('grafana.panels.text', []); app.useModule(module); + var converter; + module.controller('text', function($scope, filterSrv, $sce, panelSrv) { $scope.panelMeta = { @@ -68,15 +58,21 @@ function (angular, app, _, require) { }; $scope.renderMarkdown = function(content) { - require(['./lib/showdown'], function (Showdown) { - var converter = new Showdown.converter(); - var text = content - .replace(/&/g, '&') - .replace(/>/g, '>') - .replace(//g, '>') + .replace(/