Skip to content

Commit

Permalink
Update Handlebars library
Browse files Browse the repository at this point in the history
  • Loading branch information
John-Magne Bredal committed May 2, 2017
1 parent 250869c commit aaea543
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 1,562 deletions.
1,579 changes: 29 additions & 1,550 deletions htdocs/static/js/libs/handlebars.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion htdocs/static/js/src/netmap/graph_info_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ define([
'libs/handlebars',
'libs/backbone',
'libs/jquery-ui.min'
], function (Collections, NetmapExtras ,NodeTemplate, LinkTemplate, VlanTemplate) {
], function (Collections, NetmapExtras ,NodeTemplate, LinkTemplate, VlanTemplate, Handlebars) {

/**
* View for rendering a modal with detailed node-/link-info
Expand Down
13 changes: 9 additions & 4 deletions htdocs/static/js/src/plugins/network_tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ define([
'libs-amd/text!resources/networkexplorer/swport.html',
'libs-amd/text!resources/networkexplorer/switch.html',
'libs-amd/text!resources/networkexplorer/swport_leaf.html',
'libs/handlebars',
'libs/backbone',
'libs/backbone-eventbroker',
'libs/handlebars'], function (routerTemplate,
'libs/backbone-eventbroker'
], function (routerTemplate,
gwportTemplate,
swportTemplate,
switchTemplate,
leafTemplate) {
leafTemplate,
Handlebars
) {


Handlebars.registerHelper('equal', function(lvalue, rvalue, options) {
Expand Down Expand Up @@ -327,7 +330,9 @@ define([
break;
}

this.template = Handlebars.compile(template);
if (template) {
this.template = Handlebars.compile(template);
}
Backbone.EventBroker.register(this);

this.listenTo(this.model.getChildren(), 'error', this.handleError);
Expand Down
2 changes: 1 addition & 1 deletion htdocs/static/js/src/plugins/rickshaw_graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ define([
'libs/urijs/URI',
'rickshaw-utils',
'libs/handlebars'
], function (Rickshaw, Template, URI, RickshawUtils) {
], function (Rickshaw, Template, URI, RickshawUtils, Handlebars) {

var template = Handlebars.compile(Template);
var resizeTimeout = 250; // resize throttled at resizeTimeout ms
Expand Down
2 changes: 1 addition & 1 deletion htdocs/static/js/src/plugins/seeddb_hstore.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ define([
"libs-amd/text!resources/seeddb/hstore_row.html",
'libs/handlebars'
],
function (hstore_container_source, hstore_row_source) {
function (hstore_container_source, hstore_row_source, Handlebars) {
/*
An HStore field displays in the form of a textarea with a dict in it.
This module parses the dict, and presents a form to the user for editing
Expand Down
3 changes: 2 additions & 1 deletion htdocs/static/js/src/plugins/sensors_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ define([
"libs-amd/text!resources/room/sensor.html",
"libs-amd/text!resources/room/detail.html",
"libs-amd/text!resources/room/counter.html",
"libs/handlebars",
"plugins/sensor_controller"],
function (sensorTemplate, detailTemplate, counterTemplate, SensorController) {
function (sensorTemplate, detailTemplate, counterTemplate, Handlebars, SensorController) {

function SensorsController($sensors) {
var templates = {
Expand Down
2 changes: 1 addition & 1 deletion htdocs/static/js/src/status2/handlebars-helpers.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require(['moment', 'libs/handlebars'], function (moment) {
require(['moment', 'libs/handlebars'], function (moment, Handlebars) {

// format an ISO date using Moment.js
// http://momentjs.com/
Expand Down
6 changes: 3 additions & 3 deletions htdocs/static/js/src/status2/views.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ define([
'status/collections',
'libs-amd/text!resources/status2/event_template.hbs',
'moment',
'libs/handlebars',
'status/handlebars-helpers',
'libs/backbone',
'libs/backbone-eventbroker',
'libs/handlebars'
], function (Collections, EventTemplate, moment) {
'libs/backbone-eventbroker'
], function (Collections, EventTemplate, moment, Handlebars) {

// This collection contains all the event-models that are to be cleared/acknowledged etc.
var alertsToChange = new Collections.ChangeCollection();
Expand Down

0 comments on commit aaea543

Please sign in to comment.