|
@@ -84,7 +84,6 @@ from notebook.conf import ENABLE_QUERY_BUILDER, ENABLE_QUERY_SCHEDULING, ENABLE_
|
|
|
<script src="${ static('desktop/js/queryBuilder.js') }"></script>
|
|
<script src="${ static('desktop/js/queryBuilder.js') }"></script>
|
|
|
<script>
|
|
<script>
|
|
|
|
|
|
|
|
-
|
|
|
|
|
// query-builder-menu is the class to use
|
|
// query-builder-menu is the class to use
|
|
|
// Callback will run after each rule add, just focus to the queryBuilder tab
|
|
// Callback will run after each rule add, just focus to the queryBuilder tab
|
|
|
QueryBuilder.bindMenu('.query-builder-menu', function () {
|
|
QueryBuilder.bindMenu('.query-builder-menu', function () {
|
|
@@ -109,7 +108,7 @@ from notebook.conf import ENABLE_QUERY_BUILDER, ENABLE_QUERY_SCHEDULING, ENABLE_
|
|
|
$('#queryBuilder').hide();
|
|
$('#queryBuilder').hide();
|
|
|
$('#queryBuilderAlert').show();
|
|
$('#queryBuilderAlert').show();
|
|
|
}
|
|
}
|
|
|
- }, 500, 'editor');
|
|
|
|
|
|
|
+ }, 500, 'editor' + (window.location.getParameter('type') ? '-' + window.location.getParameter('type') : ''));
|
|
|
|
|
|
|
|
</script>
|
|
</script>
|
|
|
<!-- End query builder imports -->
|
|
<!-- End query builder imports -->
|
|
@@ -1976,14 +1975,18 @@ from notebook.conf import ENABLE_QUERY_BUILDER, ENABLE_QUERY_SCHEDULING, ENABLE_
|
|
|
<script type="text/javascript">
|
|
<script type="text/javascript">
|
|
|
% if is_embeddable:
|
|
% if is_embeddable:
|
|
|
var MAIN_SCROLLABLE = '.page-content';
|
|
var MAIN_SCROLLABLE = '.page-content';
|
|
|
|
|
+ var HUE_PUB_SUB_AFFIX = (window.location.getParameter('type') ? '-' + window.location.getParameter('type') : '');
|
|
|
% else:
|
|
% else:
|
|
|
var MAIN_SCROLLABLE = '.content-panel';
|
|
var MAIN_SCROLLABLE = '.content-panel';
|
|
|
|
|
+ var HUE_PUB_SUB_AFFIX = '';
|
|
|
% endif
|
|
% endif
|
|
|
|
|
|
|
|
|
|
+ var HUE_PUB_SUB_APP = 'editor' + HUE_PUB_SUB_AFFIX;
|
|
|
|
|
+
|
|
|
var isLeftNavOpen = false;
|
|
var isLeftNavOpen = false;
|
|
|
huePubSub.subscribe('left.nav.open.toggle', function(val) {
|
|
huePubSub.subscribe('left.nav.open.toggle', function(val) {
|
|
|
isLeftNavOpen = val;
|
|
isLeftNavOpen = val;
|
|
|
- }, 'editor');
|
|
|
|
|
|
|
+ }, HUE_PUB_SUB_APP);
|
|
|
|
|
|
|
|
var showHoverMsg = function (e) {
|
|
var showHoverMsg = function (e) {
|
|
|
var dt = null;
|
|
var dt = null;
|
|
@@ -2841,28 +2844,28 @@ from notebook.conf import ENABLE_QUERY_BUILDER, ENABLE_QUERY_SCHEDULING, ENABLE_
|
|
|
splitDraggableTimeout = window.setTimeout(function () {
|
|
splitDraggableTimeout = window.setTimeout(function () {
|
|
|
redrawFixedHeaders(100);
|
|
redrawFixedHeaders(100);
|
|
|
}, 200);
|
|
}, 200);
|
|
|
- }, 'editor');
|
|
|
|
|
|
|
+ }, HUE_PUB_SUB_APP);
|
|
|
|
|
|
|
|
huePubSub.subscribe('redraw.fixed.headers', function () {
|
|
huePubSub.subscribe('redraw.fixed.headers', function () {
|
|
|
hideFixedHeaders();
|
|
hideFixedHeaders();
|
|
|
redrawFixedHeaders(200);
|
|
redrawFixedHeaders(200);
|
|
|
- }, 'editor');
|
|
|
|
|
|
|
+ }, HUE_PUB_SUB_APP);
|
|
|
|
|
|
|
|
huePubSub.subscribe('app.gained.focus', function (app) {
|
|
huePubSub.subscribe('app.gained.focus', function (app) {
|
|
|
if (app === 'editor') {
|
|
if (app === 'editor') {
|
|
|
huePubSub.publish('redraw.fixed.headers');
|
|
huePubSub.publish('redraw.fixed.headers');
|
|
|
}
|
|
}
|
|
|
- }, 'editor');
|
|
|
|
|
|
|
+ }, HUE_PUB_SUB_APP);
|
|
|
|
|
|
|
|
huePubSub.subscribe('show.saveToFile.modal', function () {
|
|
huePubSub.subscribe('show.saveToFile.modal', function () {
|
|
|
$('#saveToFileModal').modal('show');
|
|
$('#saveToFileModal').modal('show');
|
|
|
- }, 'editor');
|
|
|
|
|
|
|
+ }, HUE_PUB_SUB_APP);
|
|
|
|
|
|
|
|
huePubSub.subscribe('tab.switched', function (tab) {
|
|
huePubSub.subscribe('tab.switched', function (tab) {
|
|
|
if (tab !== 'queryResults') {
|
|
if (tab !== 'queryResults') {
|
|
|
$('.hue-datatable-search').hide();
|
|
$('.hue-datatable-search').hide();
|
|
|
}
|
|
}
|
|
|
- }, 'editor');
|
|
|
|
|
|
|
+ }, HUE_PUB_SUB_APP);
|
|
|
|
|
|
|
|
huePubSub.subscribe('detach.scrolls', function (snippet) {
|
|
huePubSub.subscribe('detach.scrolls', function (snippet) {
|
|
|
var scrollElement = $('#snippet_' + snippet.id()).find('.dataTables_wrapper');
|
|
var scrollElement = $('#snippet_' + snippet.id()).find('.dataTables_wrapper');
|
|
@@ -2872,7 +2875,7 @@ from notebook.conf import ENABLE_QUERY_BUILDER, ENABLE_QUERY_SCHEDULING, ENABLE_
|
|
|
if (scrollElement.data('scrollFnDt')) {
|
|
if (scrollElement.data('scrollFnDt')) {
|
|
|
scrollElement.off('scroll', scrollElement.data('scrollFnDt'));
|
|
scrollElement.off('scroll', scrollElement.data('scrollFnDt'));
|
|
|
}
|
|
}
|
|
|
- }, 'editor');
|
|
|
|
|
|
|
+ }, HUE_PUB_SUB_APP);
|
|
|
|
|
|
|
|
huePubSub.subscribe('table.row.dblclick', function(data){
|
|
huePubSub.subscribe('table.row.dblclick', function(data){
|
|
|
var $el = $(data.table);
|
|
var $el = $(data.table);
|
|
@@ -2892,7 +2895,7 @@ from notebook.conf import ENABLE_QUERY_BUILDER, ENABLE_QUERY_SCHEDULING, ENABLE_
|
|
|
|
|
|
|
|
$('#detailsModal').modal('show');
|
|
$('#detailsModal').modal('show');
|
|
|
|
|
|
|
|
- }, 'editor');
|
|
|
|
|
|
|
+ }, HUE_PUB_SUB_APP);
|
|
|
|
|
|
|
|
window.redrawFixedHeaders = redrawFixedHeaders;
|
|
window.redrawFixedHeaders = redrawFixedHeaders;
|
|
|
|
|
|
|
@@ -3104,15 +3107,15 @@ from notebook.conf import ENABLE_QUERY_BUILDER, ENABLE_QUERY_SCHEDULING, ENABLE_
|
|
|
|
|
|
|
|
huePubSub.subscribe('editor.upload.table.stats', function (options) {
|
|
huePubSub.subscribe('editor.upload.table.stats', function (options) {
|
|
|
viewModel.selectedNotebook().snippets()[0].uploadTableStats(options);
|
|
viewModel.selectedNotebook().snippets()[0].uploadTableStats(options);
|
|
|
- });
|
|
|
|
|
|
|
+ }, HUE_PUB_SUB_APP);
|
|
|
|
|
|
|
|
huePubSub.subscribe("editor.upload.history", function () {
|
|
huePubSub.subscribe("editor.upload.history", function () {
|
|
|
viewModel.selectedNotebook().snippets()[0].uploadQueryHistory(5);
|
|
viewModel.selectedNotebook().snippets()[0].uploadQueryHistory(5);
|
|
|
- });
|
|
|
|
|
|
|
+ }, HUE_PUB_SUB_APP);
|
|
|
|
|
|
|
|
huePubSub.subscribe("editor.upload.query", function (query_id) {
|
|
huePubSub.subscribe("editor.upload.query", function (query_id) {
|
|
|
viewModel.selectedNotebook().snippets()[0].uploadQuery(query_id);
|
|
viewModel.selectedNotebook().snippets()[0].uploadQuery(query_id);
|
|
|
- });
|
|
|
|
|
|
|
+ }, HUE_PUB_SUB_APP);
|
|
|
|
|
|
|
|
huePubSub.subscribe('editor.active.statement.changed', function (statementDetails) {
|
|
huePubSub.subscribe('editor.active.statement.changed', function (statementDetails) {
|
|
|
if (statementDetails.activeStatement) {
|
|
if (statementDetails.activeStatement) {
|
|
@@ -3120,7 +3123,7 @@ from notebook.conf import ENABLE_QUERY_BUILDER, ENABLE_QUERY_SCHEDULING, ENABLE_
|
|
|
} else {
|
|
} else {
|
|
|
viewModel.selectedNotebook().snippets()[0].positionStatement('');
|
|
viewModel.selectedNotebook().snippets()[0].positionStatement('');
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
|
|
+ }, HUE_PUB_SUB_APP);
|
|
|
|
|
|
|
|
viewModel.selectedNotebook.subscribe(function (newVal) {
|
|
viewModel.selectedNotebook.subscribe(function (newVal) {
|
|
|
huePubSub.publish('selected.notebook.changed', newVal);
|
|
huePubSub.publish('selected.notebook.changed', newVal);
|
|
@@ -3128,7 +3131,7 @@ from notebook.conf import ENABLE_QUERY_BUILDER, ENABLE_QUERY_SCHEDULING, ENABLE_
|
|
|
|
|
|
|
|
huePubSub.subscribe('get.selected.notebook', function () {
|
|
huePubSub.subscribe('get.selected.notebook', function () {
|
|
|
huePubSub.publish('set.selected.notebook', viewModel.selectedNotebook());
|
|
huePubSub.publish('set.selected.notebook', viewModel.selectedNotebook());
|
|
|
- });
|
|
|
|
|
|
|
+ }, HUE_PUB_SUB_APP);
|
|
|
|
|
|
|
|
|
|
|
|
|
var isAssistAvailable = viewModel.assistAvailable();
|
|
var isAssistAvailable = viewModel.assistAvailable();
|
|
@@ -3172,7 +3175,7 @@ from notebook.conf import ENABLE_QUERY_BUILDER, ENABLE_QUERY_SCHEDULING, ENABLE_
|
|
|
|
|
|
|
|
huePubSub.subscribe('assist.set.manual.visibility', function () {
|
|
huePubSub.subscribe('assist.set.manual.visibility', function () {
|
|
|
wasAssistVisible = viewModel.isLeftPanelVisible();
|
|
wasAssistVisible = viewModel.isLeftPanelVisible();
|
|
|
- }, 'editor');
|
|
|
|
|
|
|
+ }, HUE_PUB_SUB_APP);
|
|
|
|
|
|
|
|
viewModel.isLeftPanelVisible.subscribe(function (value) {
|
|
viewModel.isLeftPanelVisible.subscribe(function (value) {
|
|
|
redrawFixedHeaders(200);
|
|
redrawFixedHeaders(200);
|
|
@@ -3197,11 +3200,11 @@ from notebook.conf import ENABLE_QUERY_BUILDER, ENABLE_QUERY_SCHEDULING, ENABLE_
|
|
|
|
|
|
|
|
huePubSub.subscribe('show.retry.modal', function (data) {
|
|
huePubSub.subscribe('show.retry.modal', function (data) {
|
|
|
$('#retryModal').modal('show');
|
|
$('#retryModal').modal('show');
|
|
|
- }, 'editor');
|
|
|
|
|
|
|
+ }, HUE_PUB_SUB_APP);
|
|
|
|
|
|
|
|
huePubSub.subscribe('hide.retry.modal', function (data) {
|
|
huePubSub.subscribe('hide.retry.modal', function (data) {
|
|
|
$('#retryModal').modal('hide');
|
|
$('#retryModal').modal('hide');
|
|
|
- }, 'editor');
|
|
|
|
|
|
|
+ }, HUE_PUB_SUB_APP);
|
|
|
|
|
|
|
|
// Close the notebook snippets when leaving the page
|
|
// Close the notebook snippets when leaving the page
|
|
|
window.onbeforeunload = function (e) {
|
|
window.onbeforeunload = function (e) {
|
|
@@ -3228,7 +3231,7 @@ from notebook.conf import ENABLE_QUERY_BUILDER, ENABLE_QUERY_SCHEDULING, ENABLE_
|
|
|
return false;
|
|
return false;
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- huePubSub.subscribe('editor.save', saveKeyHandler, 'editor');
|
|
|
|
|
|
|
+ huePubSub.subscribe('editor.save', saveKeyHandler, HUE_PUB_SUB_APP);
|
|
|
|
|
|
|
|
$(document).bind('keyup', function (e) {
|
|
$(document).bind('keyup', function (e) {
|
|
|
if (e.keyCode == 191 && e.shiftKey && !$(e.target).is('input') && !$(e.target).is('textarea')) {
|
|
if (e.keyCode == 191 && e.shiftKey && !$(e.target).is('input') && !$(e.target).is('textarea')) {
|
|
@@ -3260,7 +3263,7 @@ from notebook.conf import ENABLE_QUERY_BUILDER, ENABLE_QUERY_SCHEDULING, ENABLE_
|
|
|
return false;
|
|
return false;
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- huePubSub.subscribe('editor.create.new', newKeyHandler, 'editor');
|
|
|
|
|
|
|
+ huePubSub.subscribe('editor.create.new', newKeyHandler, HUE_PUB_SUB_APP);
|
|
|
|
|
|
|
|
var initialResizePosition = 100;
|
|
var initialResizePosition = 100;
|
|
|
|
|
|
|
@@ -3472,7 +3475,7 @@ from notebook.conf import ENABLE_QUERY_BUILDER, ENABLE_QUERY_SCHEDULING, ENABLE_
|
|
|
$snippet.find(".dataTables_wrapper .fixed-header-row").css({opacity: '0'});
|
|
$snippet.find(".dataTables_wrapper .fixed-header-row").css({opacity: '0'});
|
|
|
$snippet.find(".dataTables_wrapper .fixed-first-cell").css({opacity: '0'});
|
|
$snippet.find(".dataTables_wrapper .fixed-first-cell").css({opacity: '0'});
|
|
|
$snippet.find(".dataTables_wrapper .resultTable").css({opacity: '0.55'});
|
|
$snippet.find(".dataTables_wrapper .resultTable").css({opacity: '0.55'});
|
|
|
- }, 'editor');
|
|
|
|
|
|
|
+ }, HUE_PUB_SUB_APP);
|
|
|
|
|
|
|
|
huePubSub.subscribe('editor.snippet.result.normal', function (snippet) {
|
|
huePubSub.subscribe('editor.snippet.result.normal', function (snippet) {
|
|
|
var $snippet = $("#snippet_" + snippet.id());
|
|
var $snippet = $("#snippet_" + snippet.id());
|
|
@@ -3480,11 +3483,11 @@ from notebook.conf import ENABLE_QUERY_BUILDER, ENABLE_QUERY_SCHEDULING, ENABLE_
|
|
|
$snippet.find(".dataTables_wrapper .fixed-header-row").css({opacity: '1'});
|
|
$snippet.find(".dataTables_wrapper .fixed-header-row").css({opacity: '1'});
|
|
|
$snippet.find(".dataTables_wrapper .fixed-first-cell").css({opacity: '1'});
|
|
$snippet.find(".dataTables_wrapper .fixed-first-cell").css({opacity: '1'});
|
|
|
$snippet.find(".dataTables_wrapper .resultTable").css({opacity: '1'});
|
|
$snippet.find(".dataTables_wrapper .resultTable").css({opacity: '1'});
|
|
|
- }, 'editor');
|
|
|
|
|
|
|
+ }, HUE_PUB_SUB_APP);
|
|
|
|
|
|
|
|
$(document).on("renderDataError", function (e, options) {
|
|
$(document).on("renderDataError", function (e, options) {
|
|
|
huePubSub.publish('editor.snippet.result.normal', options.snippet);
|
|
huePubSub.publish('editor.snippet.result.normal', options.snippet);
|
|
|
- }, 'editor');
|
|
|
|
|
|
|
+ });
|
|
|
|
|
|
|
|
$(document).on("progress", function (e, options) {
|
|
$(document).on("progress", function (e, options) {
|
|
|
if (options.data == 100) {
|
|
if (options.data == 100) {
|
|
@@ -3503,7 +3506,7 @@ from notebook.conf import ENABLE_QUERY_BUILDER, ENABLE_QUERY_SCHEDULING, ENABLE_
|
|
|
if (typeof renderJqCron !== 'undefined'){
|
|
if (typeof renderJqCron !== 'undefined'){
|
|
|
renderJqCron();
|
|
renderJqCron();
|
|
|
}
|
|
}
|
|
|
- }, 'editor');
|
|
|
|
|
|
|
+ }, HUE_PUB_SUB_APP);
|
|
|
|
|
|
|
|
huePubSub.subscribe('submit.popup.return', function (data) {
|
|
huePubSub.subscribe('submit.popup.return', function (data) {
|
|
|
viewModel.selectedNotebook().viewSchedulerId(data.job_id);
|
|
viewModel.selectedNotebook().viewSchedulerId(data.job_id);
|
|
@@ -3511,7 +3514,7 @@ from notebook.conf import ENABLE_QUERY_BUILDER, ENABLE_QUERY_SCHEDULING, ENABLE_
|
|
|
$('.submit-modal').modal('hide');
|
|
$('.submit-modal').modal('hide');
|
|
|
|
|
|
|
|
$('a[href=\'#scheduledJobsTab\']').click();
|
|
$('a[href=\'#scheduledJobsTab\']').click();
|
|
|
- }, 'editor');
|
|
|
|
|
|
|
+ }, HUE_PUB_SUB_APP);
|
|
|
|
|
|
|
|
huePubSub.subscribe('jobbrowser.data', function (jobs) {
|
|
huePubSub.subscribe('jobbrowser.data', function (jobs) {
|
|
|
if (jobs.length > 0) {
|
|
if (jobs.length > 0) {
|
|
@@ -3533,7 +3536,7 @@ from notebook.conf import ENABLE_QUERY_BUILDER, ENABLE_QUERY_SCHEDULING, ENABLE_
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- }, 'editor');
|
|
|
|
|
|
|
+ }, HUE_PUB_SUB_APP);
|
|
|
|
|
|
|
|
$(document).on("gridShown", function (e, snippet) {
|
|
$(document).on("gridShown", function (e, snippet) {
|
|
|
window.setTimeout(function () {
|
|
window.setTimeout(function () {
|