-
Notifications
You must be signed in to change notification settings - Fork 1
/
editor.php
70 lines (69 loc) · 2.94 KB
/
editor.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<!DOCTYPE HTML>
<html>
<head>
<meta name="description" content="Text to Chart API, convert graph description language to image. Support graphviz, markdown mindmap, asymptote, gnuplot, identicon, wkhtmltoimage,ditaa and mscgen. Usefull for wiki, bbs and blog." />
<meta name="keywords" content="graphviz,dot,markdown,mindmap,asymptote,gnuplot,identicon,ditaa,wkhtmltoimage,mscgen,blockdiag,book cover,Text to Chart,graph description language,Discuz,Wordpress,Dokuwiki,bbs,blog,wiki,API" />
<link href="//cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" media="screen">
<script src="//cdn.bootcss.com/ace/1.2.9/ace.js"></script>
<script src="//cdn.bootcss.com/ace/1.2.9/mode-dot.js"></script>
<script src="//cdn.bootcss.com/ace/1.2.9/mode-markdown.js"></script>
<script src="//cdn.bootcss.com/ace/1.2.9/mode-asciidoc.js"></script>
<script src="//cdn.bootcss.com/ace/1.2.9/theme-github.js"></script>
<script src="//cdn.bootcss.com/marked/0.3.7/marked.min.js"></script>
<script src="//cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/github-fork-ribbon-css/0.2.3/gh-fork-ribbon.min.css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=no" charset="utf-8">
<link rel="stylesheet" type="text/css" href="static/css/editor.css">
<title>Text to Chart Api Editor</title>
<?php
require 'config.php';
$clientId = $config['ad']['google'];
$googlead = <<<EOF
<script data-ad-client="ca-pub-$clientId" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
EOF;
if ($clientId != "") {
echo $googlead;
}
?>
</head>
<body>
<a class="github-fork-ribbon" href="https://github.com/annprog/chart" data-ribbon="Fork me on GitHub" title="Fork me on GitHub">Fork me on GitHub</a>
<div id="content">
<div id="title"><h1>Text to Chart API</h1></div>
<div id="demo" style="display:none"></div>
<div id="editor">
<form id="chart-editor" accept-charset="utf-8" name="editor" method="POST" action="
<?php echo $config['api'];?>
" enctype="application/x-www-form-urlencoded">
<textarea name="chl" id="chl"></textarea>
<br>
<select id="cht" name="cht"></select>
<label for="chof"> Format: </label>
<input type="" name="chof" value="" id="chof" size=5 placeholder="png">
<input type="button" id="submit" name="submit" value="Submit" onclick=preview();>
</form>
</div>
<div style="text-align:center; margin:0 auto;" id="preview">
<img id="imgpreview" style="max-width:95%;" src="static/error.png" alt="chart" title="chart"/>
</div>
</div>
<script src="static/js/editor.js"></script>
<?php
$baidu = $config['analytics']['baidu'];
$baiduScript = <<<EOF
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "//hm.baidu.com/hm.js?$baidu";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
EOF;
if ($baidu != "") {
echo $baiduScript;
}
?>
</body>
</html>