|
@@ -199,7 +199,7 @@ ${ require.config() }
|
|
|
|
|
|
|
|
|
|
|
|
|
% if mode == 'editor':
|
|
% if mode == 'editor':
|
|
|
- <a class="btn" href="${ url('notebook:editor') }?type=${ editor_type }" title="${ _('New %s Query') % editor_type.title() }" rel="tooltip" data-placement="bottom">
|
|
|
|
|
|
|
+ <a class="btn" href="${ url('notebook:editor') }?type=${ editor_type }&new=true" title="${ _('New %s Query') % editor_type.title() }" rel="tooltip" data-placement="bottom">
|
|
|
<i class="fa fa-file-o"></i>
|
|
<i class="fa fa-file-o"></i>
|
|
|
</a>
|
|
</a>
|
|
|
% else:
|
|
% else:
|
|
@@ -599,6 +599,7 @@ ${ require.config() }
|
|
|
snippet: $data,
|
|
snippet: $data,
|
|
|
openIt: '${ _ko("Alt or Ctrl + Click to open it") }',
|
|
openIt: '${ _ko("Alt or Ctrl + Click to open it") }',
|
|
|
expandStar: '${ _ko("Alt or Ctrl + Click to replace with all columns") }',
|
|
expandStar: '${ _ko("Alt or Ctrl + Click to replace with all columns") }',
|
|
|
|
|
+ onBlur: saveTemporarySnippet,
|
|
|
aceOptions: {
|
|
aceOptions: {
|
|
|
showLineNumbers: $root.editorMode,
|
|
showLineNumbers: $root.editorMode,
|
|
|
showGutter: $root.editorMode,
|
|
showGutter: $root.editorMode,
|
|
@@ -1657,6 +1658,12 @@ ${ require.config() }
|
|
|
return _datum;
|
|
return _datum;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ function saveTemporarySnippet($element, value) {
|
|
|
|
|
+ if ($element.data('last-active-editor')) {
|
|
|
|
|
+ $.totalStorage('hue.notebook.lastWrittenSnippet', value);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
require([
|
|
require([
|
|
|
"knockout",
|
|
"knockout",
|
|
|
"ko.charts",
|
|
"ko.charts",
|
|
@@ -1998,6 +2005,11 @@ ${ require.config() }
|
|
|
ko.applyBindings(viewModel);
|
|
ko.applyBindings(viewModel);
|
|
|
viewModel.init();
|
|
viewModel.init();
|
|
|
|
|
|
|
|
|
|
+ if (viewModel.editorMode && window.location.getParameter('editor') == '' && window.location.getParameter('new') == '') {
|
|
|
|
|
+ viewModel.selectedNotebook().snippets()[0].statement_raw($.totalStorage('hue.notebook.lastWrittenSnippet'));
|
|
|
|
|
+ $.totalStorage('hue.notebook.lastWrittenSnippet', '');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (location.getParameter("github_status") != "") {
|
|
if (location.getParameter("github_status") != "") {
|
|
|
if (location.getParameter("github_status") == "0") {
|
|
if (location.getParameter("github_status") == "0") {
|
|
|
$.jHueNotify.info("${ _('User successfully authenticated to GitHub.') }");
|
|
$.jHueNotify.info("${ _('User successfully authenticated to GitHub.') }");
|