Skip to content

Commit

Permalink
Backport PR #7568
Browse files Browse the repository at this point in the history
---------

**Commit 1:**
[fix] Fixed scripting issues due to improperly encoded kibana payload.

* Original sha: 08a6f40
* Authored by Nicolás Bevacqua <[email protected]> on 2016-06-28T19:44:18Z

**Commit 2:**
[fix] Switch to attribute-encoding

* Original sha: 2cdb0f9
* Authored by Nicolás Bevacqua <[email protected]> on 2016-06-28T20:46:50Z

**Commit 3:**
[fix] Get rid of <meta> in favor of directive-style element.

* Original sha: e33fa40
* Authored by Nicolás Bevacqua <[email protected]> on 2016-06-28T20:53:25Z
  • Loading branch information
elastic-jasper committed Jun 28, 2016
1 parent dea1cac commit f654378
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
8 changes: 3 additions & 5 deletions src/ui/public/metadata.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import $ from 'jquery';
import _ from 'lodash';
// singleton for immutable copy of window.__KBN__

if (!_.has(window, '__KBN__')) {
throw new Error('window.__KBN__ must be set for metadata');
}
const state = $('kbn-initial-state').attr('data');
const kbn = window.__KBN__ = JSON.parse(state);

const kbn = _.cloneDeep(window.__KBN__ || {});
export default deepFreeze(kbn);

function deepFreeze(object) {
Expand Down
6 changes: 3 additions & 3 deletions src/ui/views/chrome.jade
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- var j = function (o) { return JSON.stringify(o); }
- var appName = 'kibana';
-
var appName = 'kibana';
block vars

Expand All @@ -12,5 +12,5 @@ html(lang='en')
title Kibana
block head
body(kbn-chrome, id='#{appName}-body')
script window.__KBN__ = !{j(kibanaPayload)};
kbn-initial-state(data=JSON.stringify(kibanaPayload))
block content

0 comments on commit f654378

Please sign in to comment.