Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
2ac7b9da
Commit
2ac7b9da
authored
Jun 30, 2014
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:Akeru/grafana into Akeru-master
parents
505f0f65
c100054d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
5 deletions
+26
-5
src/app/panels/text/module.html
+3
-4
src/app/panels/text/module.js
+23
-1
No files found.
src/app/panels/text/module.html
View file @
2ac7b9da
<div
ng-controller=
'text'
ng-init=
"init()"
style=
"min-height:{{panel.height || row.height}}"
ng-dblclick=
"openEditor()"
>
<!--<p ng-style="panel.style" ng-bind-html-unsafe="panel.content | striphtml | newlines"></p>-->
<markdown
ng-show=
"ready && panel.mode == 'markdown'"
>
{{panel.content}}
<markdown
ng-show=
"ready && panel.mode == 'markdown'"
ng-bind-html-unsafe=
"panel.content | applymarkdown | applytemplate"
>
</markdown>
<p
ng-show=
"panel.mode == 'text'"
ng-style=
'panel.style'
ng-bind-html-unsafe=
"panel.content | striphtml | newlines"
>
<p
ng-show=
"panel.mode == 'text'"
ng-style=
'panel.style'
ng-bind-html-unsafe=
"panel.content | striphtml | newlines
| applytemplate
"
>
</p>
<p
ng-show=
"panel.mode == 'html'"
ng-bind-html-unsafe=
"panel.content"
>
<p
ng-show=
"panel.mode == 'html'"
ng-bind-html-unsafe=
"panel.content
| applytemplate
"
>
</p>
</div>
src/app/panels/text/module.js
View file @
2ac7b9da
...
...
@@ -14,7 +14,8 @@ define([
'angular'
,
'app'
,
'underscore'
,
'require'
'require'
,
'services/filterSrv'
],
function
(
angular
,
app
,
_
,
require
)
{
'use strict'
;
...
...
@@ -98,4 +99,25 @@ function (angular, app, _, require) {
.
replace
(
/</g
,
'<'
);
};
});
module
.
filter
(
'applytemplate'
,
function
(
filterSrv
)
{
return
function
(
input
)
{
return
filterSrv
.
applyTemplateToTarget
(
input
);
};
});
module
.
filter
(
'applymarkdown'
,
function
()
{
return
function
(
input
)
{
if
(
require
.
defined
(
'./lib/showdown'
))
{
var
Showdown
=
require
(
'./lib/showdown'
);
var
converter
=
new
Showdown
.
converter
();
var
text
=
input
.
replace
(
/&/g
,
'&'
)
.
replace
(
/>/g
,
'>'
)
.
replace
(
/</g
,
'<'
);
return
converter
.
makeHtml
(
text
);
}
else
{
return
input
;
}
};
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment