mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-25 13:44:05 -08:00
Replace handlebars with the simpler and saner mustache library.
This commit is contained in:
parent
0a6972b6a3
commit
fe83ea511f
9
NOTICE
9
NOTICE
|
@ -39,9 +39,12 @@ https://github.com/shutterstock/rickshaw
|
||||||
Copyright 2011-2014 by Shutterstock Images, LLC
|
Copyright 2011-2014 by Shutterstock Images, LLC
|
||||||
See https://github.com/shutterstock/rickshaw/blob/master/LICENSE for license details
|
See https://github.com/shutterstock/rickshaw/blob/master/LICENSE for license details
|
||||||
|
|
||||||
handlebars.js
|
mustache.js
|
||||||
Copyright 2011 by Yehuda Katz
|
https://github.com/janl/mustache.js
|
||||||
See web/static/vendor/js/handlebars.js for license details
|
Copyright 2009 Chris Wanstrath (Ruby)
|
||||||
|
Copyright 2010-2014 Jan Lehnardt (JavaScript)
|
||||||
|
Copyright 2010-2015 The mustache.js community
|
||||||
|
Licensed under the MIT License
|
||||||
|
|
||||||
jQuery
|
jQuery
|
||||||
https://jquery.org
|
https://jquery.org
|
||||||
|
|
|
@ -3,8 +3,6 @@ var graphTemplate;
|
||||||
|
|
||||||
var SECOND = 1000;
|
var SECOND = 1000;
|
||||||
|
|
||||||
Handlebars.registerHelper('pathPrefix', function() { return PATH_PREFIX; });
|
|
||||||
|
|
||||||
Prometheus.Graph = function(element, options, handleChange, handleRemove) {
|
Prometheus.Graph = function(element, options, handleChange, handleRemove) {
|
||||||
this.el = element;
|
this.el = element;
|
||||||
this.graphHTML = null;
|
this.graphHTML = null;
|
||||||
|
@ -48,7 +46,9 @@ Prometheus.Graph.prototype.initialize = function() {
|
||||||
|
|
||||||
// Draw graph controls and container from Handlebars template.
|
// Draw graph controls and container from Handlebars template.
|
||||||
|
|
||||||
self.graphHTML = $(graphTemplate(self.options));
|
var options = {'pathPrefix': PATH_PREFIX};
|
||||||
|
jQuery.extend(options, self.options);
|
||||||
|
self.graphHTML = $(Mustache.render(graphTemplate, options));
|
||||||
self.el.append(self.graphHTML);
|
self.el.append(self.graphHTML);
|
||||||
|
|
||||||
// Get references to all the interesting elements in the graph container and
|
// Get references to all the interesting elements in the graph container and
|
||||||
|
@ -822,7 +822,9 @@ function init() {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: PATH_PREFIX + "/static/js/graph_template.handlebar",
|
url: PATH_PREFIX + "/static/js/graph_template.handlebar",
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
graphTemplate = Handlebars.compile(data);
|
|
||||||
|
graphTemplate = data;
|
||||||
|
Mustache.parse(data);
|
||||||
if (isDeprecatedGraphURL()) {
|
if (isDeprecatedGraphURL()) {
|
||||||
redirectToMigratedURL();
|
redirectToMigratedURL();
|
||||||
} else {
|
} else {
|
||||||
|
|
2014
web/ui/static/vendor/js/handlebars.js
vendored
2014
web/ui/static/vendor/js/handlebars.js
vendored
File diff suppressed because it is too large
Load diff
1
web/ui/static/vendor/mustache/mustache.min.js
vendored
Normal file
1
web/ui/static/vendor/mustache/mustache.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
|
@ -12,7 +12,7 @@
|
||||||
<script src="{{ pathPrefix }}/static/vendor/bootstrap3-typeahead/bootstrap3-typeahead.min.js"></script>
|
<script src="{{ pathPrefix }}/static/vendor/bootstrap3-typeahead/bootstrap3-typeahead.min.js"></script>
|
||||||
<script src="{{ pathPrefix }}/static/vendor/fuzzy.js"></script>
|
<script src="{{ pathPrefix }}/static/vendor/fuzzy.js"></script>
|
||||||
|
|
||||||
<script src="{{ pathPrefix }}/static/vendor/js/handlebars.js"></script>
|
<script src="{{ pathPrefix }}/static/vendor/mustache/mustache.min.js"></script>
|
||||||
<script src="{{ pathPrefix }}/static/vendor/js/jquery.selection.js"></script>
|
<script src="{{ pathPrefix }}/static/vendor/js/jquery.selection.js"></script>
|
||||||
<script src="{{ pathPrefix }}/static/vendor/js/jquery.hotkeys.js"></script>
|
<script src="{{ pathPrefix }}/static/vendor/js/jquery.hotkeys.js"></script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue