2018-01-12 01:29:51 -06:00
|
|
|
define([
|
|
|
|
'underscore', 'jquery', 'backbone', 'sources/pgadmin', 'pgadmin.browser',
|
2018-02-27 05:18:36 -06:00
|
|
|
'sources/gettext', 'sources/utils',
|
|
|
|
], function(_, $, Backbone, pgAdmin, pgBrowser, gettext, commonUtils) {
|
2016-04-13 10:11:43 -05:00
|
|
|
|
2018-01-12 01:29:51 -06:00
|
|
|
var wcDocker = window.wcDocker;
|
2016-04-13 10:11:43 -05:00
|
|
|
|
|
|
|
/* Wizard individual Page Model */
|
2018-01-12 01:29:51 -06:00
|
|
|
pgBrowser.WizardPage = Backbone.Model.extend({
|
2016-04-13 10:11:43 -05:00
|
|
|
defaults: {
|
2018-01-12 01:29:51 -06:00
|
|
|
id: undefined,
|
|
|
|
/* Id */
|
|
|
|
page_title: undefined,
|
|
|
|
/* Page Title */
|
|
|
|
view: undefined,
|
|
|
|
/* A Backbone View */
|
|
|
|
html: undefined,
|
|
|
|
/* HTML tags to be rendered */
|
|
|
|
image: undefined,
|
|
|
|
/* Left hand side image */
|
|
|
|
disable_prev: false,
|
|
|
|
/* Previous Button Flag */
|
|
|
|
disable_next: false,
|
|
|
|
/* Next Button Flag */
|
|
|
|
disable_cancel: false,
|
|
|
|
/* Cancel Button Flag */
|
2016-04-13 10:11:43 -05:00
|
|
|
show_progress_bar: '',
|
|
|
|
/* Callback for OnLoad */
|
|
|
|
onLoad: function() {
|
|
|
|
return true;
|
|
|
|
},
|
|
|
|
/* Callback for before Next */
|
|
|
|
beforeNext: function() {
|
|
|
|
return true;
|
|
|
|
},
|
2018-01-12 01:29:51 -06:00
|
|
|
onNext: function() {},
|
2016-04-13 10:11:43 -05:00
|
|
|
onBefore: function() {},
|
|
|
|
/* Callback for before Previous */
|
|
|
|
beforePrev: function() {
|
|
|
|
return true;
|
2018-01-12 01:29:51 -06:00
|
|
|
},
|
|
|
|
},
|
2016-04-13 10:11:43 -05:00
|
|
|
});
|
|
|
|
|
2018-01-12 01:29:51 -06:00
|
|
|
pgBrowser.Wizard = Backbone.View.extend({
|
2016-04-13 10:11:43 -05:00
|
|
|
options: {
|
2018-01-12 01:29:51 -06:00
|
|
|
title: 'Wizard',
|
|
|
|
/* Main Wizard Title */
|
|
|
|
image: 'left_panel.png',
|
|
|
|
/* TODO:: We can use default image here */
|
|
|
|
curr_page: 0,
|
|
|
|
/* Current Page to Load */
|
2016-04-13 10:11:43 -05:00
|
|
|
disable_next: false,
|
|
|
|
disable_prev: false,
|
|
|
|
disable_finish: false,
|
|
|
|
disable_cancel: false,
|
2018-01-12 01:29:51 -06:00
|
|
|
show_header_cancel_btn: false,
|
|
|
|
/* show cancel button at wizard header */
|
|
|
|
show_header_maximize_btn: false,
|
|
|
|
/* show maximize button at wizard header */
|
2017-01-08 04:35:34 -06:00
|
|
|
dialog_api: null,
|
2016-04-13 10:11:43 -05:00
|
|
|
height: 400,
|
|
|
|
width: 650,
|
2016-06-08 08:08:12 -05:00
|
|
|
show_left_panel: true,
|
2018-01-12 01:29:51 -06:00
|
|
|
wizard_help: '',
|
2016-04-13 10:11:43 -05:00
|
|
|
},
|
|
|
|
tmpl: _.template(
|
2018-01-12 01:29:51 -06:00
|
|
|
' <div class="pgadmin-wizard" style="height: <%= this.options.height %>px;' +
|
|
|
|
' width: <%= this.options.width %>px">' +
|
|
|
|
' <div class="wizard-header wizard-badge">' +
|
Improvement in the look and feel of the whole application
Changed the SCSS/CSS for the below third party libraries to adopt the
new look 'n' feel:
- wcDocker
- Alertify dialogs, and notifications
- AciTree
- Bootstrap Navbar
- Bootstrap Tabs
- Bootstrap Drop-Down menu
- Backgrid
- Select2
Adopated the new the look 'n' feel for the dialogs, wizard, properties,
tab panels, tabs, fieldset, subnode control, spinner control, HTML
table, and other form controls.
- Font is changed to Roboto
- Using SCSS variables to define the look 'n' feel
- Designer background images for the Login, and Forget password pages in
'web' mode
- Improved the look 'n' feel for the key selection in the preferences
dialog
- Table classes consistency changes across the application
- File Open and Save dialog list view changes
Author(s): Aditya Toshniwal & Khushboo Vashi
2018-12-21 05:44:55 -06:00
|
|
|
' <div class="d-flex">' +
|
|
|
|
' <div>' +
|
2018-01-12 01:29:51 -06:00
|
|
|
' <h3><span id="main-title"><%= this.options.title %></span> -' +
|
|
|
|
' <span id="step-title"><%= page_title %></span></h3>' +
|
|
|
|
' </div>' +
|
|
|
|
' <% if (this.options.show_header_cancel_btn) { %>' +
|
Improvement in the look and feel of the whole application
Changed the SCSS/CSS for the below third party libraries to adopt the
new look 'n' feel:
- wcDocker
- Alertify dialogs, and notifications
- AciTree
- Bootstrap Navbar
- Bootstrap Tabs
- Bootstrap Drop-Down menu
- Backgrid
- Select2
Adopated the new the look 'n' feel for the dialogs, wizard, properties,
tab panels, tabs, fieldset, subnode control, spinner control, HTML
table, and other form controls.
- Font is changed to Roboto
- Using SCSS variables to define the look 'n' feel
- Designer background images for the Login, and Forget password pages in
'web' mode
- Improved the look 'n' feel for the key selection in the preferences
dialog
- Table classes consistency changes across the application
- File Open and Save dialog list view changes
Author(s): Aditya Toshniwal & Khushboo Vashi
2018-12-21 05:44:55 -06:00
|
|
|
' <div class="ml-auto">' +
|
2018-01-12 01:29:51 -06:00
|
|
|
' <button class="ajs-close wizard-cancel-event pull-right"' +
|
|
|
|
' title="' + gettext('Close') + '></button>' +
|
|
|
|
' <% if (this.options.show_header_maximize_btn) { %>' +
|
|
|
|
' <button class="ajs-maximize wizard-maximize-event pull-right' +
|
|
|
|
' title="' + gettext('Maximize') + '"></button>' +
|
|
|
|
' <% } %>' +
|
|
|
|
' </div>' +
|
|
|
|
' <% } %>' +
|
|
|
|
' </div>' +
|
|
|
|
' </div>' +
|
Improvement in the look and feel of the whole application
Changed the SCSS/CSS for the below third party libraries to adopt the
new look 'n' feel:
- wcDocker
- Alertify dialogs, and notifications
- AciTree
- Bootstrap Navbar
- Bootstrap Tabs
- Bootstrap Drop-Down menu
- Backgrid
- Select2
Adopated the new the look 'n' feel for the dialogs, wizard, properties,
tab panels, tabs, fieldset, subnode control, spinner control, HTML
table, and other form controls.
- Font is changed to Roboto
- Using SCSS variables to define the look 'n' feel
- Designer background images for the Login, and Forget password pages in
'web' mode
- Improved the look 'n' feel for the key selection in the preferences
dialog
- Table classes consistency changes across the application
- File Open and Save dialog list view changes
Author(s): Aditya Toshniwal & Khushboo Vashi
2018-12-21 05:44:55 -06:00
|
|
|
' <div class="wizard-content row m-0">' +
|
2018-01-12 01:29:51 -06:00
|
|
|
' <% if (this.options.show_left_panel) { %>' +
|
|
|
|
' <div class="col-sm-3 wizard-left-panel">' +
|
|
|
|
' <img src="<%= this.options.image %>"' +
|
|
|
|
' alt="' + gettext('Left panel logo') + '"></div>' +
|
|
|
|
' <% } %>' +
|
|
|
|
' <div class="col-sm-<% if (this.options.show_left_panel) { %>9<% }' +
|
|
|
|
' else { %>12<% } %> wizard-right-panel">' +
|
|
|
|
' <% if ( typeof show_description != "undefined"){ %>' +
|
|
|
|
' <div class="wizard-description">' +
|
|
|
|
' <%= show_description %>' +
|
|
|
|
' </div>' +
|
|
|
|
' <% } %>' +
|
|
|
|
' <div class="wizard-progress-bar"><% if (show_progress_bar) { %>' +
|
|
|
|
' <p class="alert alert-info col-sm-12"><%= show_progress_bar %></p><% } %>' +
|
|
|
|
' </div>' +
|
Improvement in the look and feel of the whole application
Changed the SCSS/CSS for the below third party libraries to adopt the
new look 'n' feel:
- wcDocker
- Alertify dialogs, and notifications
- AciTree
- Bootstrap Navbar
- Bootstrap Tabs
- Bootstrap Drop-Down menu
- Backgrid
- Select2
Adopated the new the look 'n' feel for the dialogs, wizard, properties,
tab panels, tabs, fieldset, subnode control, spinner control, HTML
table, and other form controls.
- Font is changed to Roboto
- Using SCSS variables to define the look 'n' feel
- Designer background images for the Login, and Forget password pages in
'web' mode
- Improved the look 'n' feel for the key selection in the preferences
dialog
- Table classes consistency changes across the application
- File Open and Save dialog list view changes
Author(s): Aditya Toshniwal & Khushboo Vashi
2018-12-21 05:44:55 -06:00
|
|
|
' <div class="wizard-right-panel_content">' +
|
2018-01-12 01:29:51 -06:00
|
|
|
' </div>' +
|
|
|
|
' </div>' +
|
|
|
|
' </div>' +
|
Improvement in the look and feel of the whole application
Changed the SCSS/CSS for the below third party libraries to adopt the
new look 'n' feel:
- wcDocker
- Alertify dialogs, and notifications
- AciTree
- Bootstrap Navbar
- Bootstrap Tabs
- Bootstrap Drop-Down menu
- Backgrid
- Select2
Adopated the new the look 'n' feel for the dialogs, wizard, properties,
tab panels, tabs, fieldset, subnode control, spinner control, HTML
table, and other form controls.
- Font is changed to Roboto
- Using SCSS variables to define the look 'n' feel
- Designer background images for the Login, and Forget password pages in
'web' mode
- Improved the look 'n' feel for the key selection in the preferences
dialog
- Table classes consistency changes across the application
- File Open and Save dialog list view changes
Author(s): Aditya Toshniwal & Khushboo Vashi
2018-12-21 05:44:55 -06:00
|
|
|
' <div class="wizard-footer pg-prop-footer">' +
|
2019-01-02 03:35:15 -06:00
|
|
|
' <div class="pg-prop-status-bar" style="visibility:hidden">' +
|
|
|
|
' <div class="error-in-footer"> ' +
|
|
|
|
' <div class="d-flex px-2 py-1"> ' +
|
|
|
|
' <div class="pr-2"> ' +
|
|
|
|
' <i class="fa fa-exclamation-triangle text-danger" aria-hidden="true"></i> ' +
|
|
|
|
' </div> ' +
|
|
|
|
' <div class="alert-text"></div> ' +
|
|
|
|
' <div class="ml-auto close-error-bar"> ' +
|
|
|
|
' <a class="close-error fa fa-times text-danger"></a> ' +
|
|
|
|
' </div> ' +
|
|
|
|
' </div> ' +
|
|
|
|
' </div> ' +
|
|
|
|
' </div>' +
|
Improvement in the look and feel of the whole application
Changed the SCSS/CSS for the below third party libraries to adopt the
new look 'n' feel:
- wcDocker
- Alertify dialogs, and notifications
- AciTree
- Bootstrap Navbar
- Bootstrap Tabs
- Bootstrap Drop-Down menu
- Backgrid
- Select2
Adopated the new the look 'n' feel for the dialogs, wizard, properties,
tab panels, tabs, fieldset, subnode control, spinner control, HTML
table, and other form controls.
- Font is changed to Roboto
- Using SCSS variables to define the look 'n' feel
- Designer background images for the Login, and Forget password pages in
'web' mode
- Improved the look 'n' feel for the key selection in the preferences
dialog
- Table classes consistency changes across the application
- File Open and Save dialog list view changes
Author(s): Aditya Toshniwal & Khushboo Vashi
2018-12-21 05:44:55 -06:00
|
|
|
' <div class="wizard-buttons d-flex">' +
|
|
|
|
' <div>' +
|
2018-01-12 01:29:51 -06:00
|
|
|
' <button title = "' + gettext('Help for this dialog.') + '"' +
|
Improvement in the look and feel of the whole application
Changed the SCSS/CSS for the below third party libraries to adopt the
new look 'n' feel:
- wcDocker
- Alertify dialogs, and notifications
- AciTree
- Bootstrap Navbar
- Bootstrap Tabs
- Bootstrap Drop-Down menu
- Backgrid
- Select2
Adopated the new the look 'n' feel for the dialogs, wizard, properties,
tab panels, tabs, fieldset, subnode control, spinner control, HTML
table, and other form controls.
- Font is changed to Roboto
- Using SCSS variables to define the look 'n' feel
- Designer background images for the Login, and Forget password pages in
'web' mode
- Improved the look 'n' feel for the key selection in the preferences
dialog
- Table classes consistency changes across the application
- File Open and Save dialog list view changes
Author(s): Aditya Toshniwal & Khushboo Vashi
2018-12-21 05:44:55 -06:00
|
|
|
' class="btn btn-secondary pull-left wizard-help" <%=this.options.wizard_help ? "" : "disabled" %>>' +
|
2018-01-12 01:29:51 -06:00
|
|
|
' <span class="fa fa-lg fa-question"></span></button>' +
|
|
|
|
' </div>' +
|
Improvement in the look and feel of the whole application
Changed the SCSS/CSS for the below third party libraries to adopt the
new look 'n' feel:
- wcDocker
- Alertify dialogs, and notifications
- AciTree
- Bootstrap Navbar
- Bootstrap Tabs
- Bootstrap Drop-Down menu
- Backgrid
- Select2
Adopated the new the look 'n' feel for the dialogs, wizard, properties,
tab panels, tabs, fieldset, subnode control, spinner control, HTML
table, and other form controls.
- Font is changed to Roboto
- Using SCSS variables to define the look 'n' feel
- Designer background images for the Login, and Forget password pages in
'web' mode
- Improved the look 'n' feel for the key selection in the preferences
dialog
- Table classes consistency changes across the application
- File Open and Save dialog list view changes
Author(s): Aditya Toshniwal & Khushboo Vashi
2018-12-21 05:44:55 -06:00
|
|
|
' <div class="ml-auto">' +
|
|
|
|
' <button class="btn btn-secondary wizard-cancel" <%=this.options.disable_cancel ? "disabled" : ""%>>' +
|
2019-01-02 03:35:15 -06:00
|
|
|
' <i class="fa fa-close"></i> ' + gettext('Cancel') + '</button>' +
|
Improvement in the look and feel of the whole application
Changed the SCSS/CSS for the below third party libraries to adopt the
new look 'n' feel:
- wcDocker
- Alertify dialogs, and notifications
- AciTree
- Bootstrap Navbar
- Bootstrap Tabs
- Bootstrap Drop-Down menu
- Backgrid
- Select2
Adopated the new the look 'n' feel for the dialogs, wizard, properties,
tab panels, tabs, fieldset, subnode control, spinner control, HTML
table, and other form controls.
- Font is changed to Roboto
- Using SCSS variables to define the look 'n' feel
- Designer background images for the Login, and Forget password pages in
'web' mode
- Improved the look 'n' feel for the key selection in the preferences
dialog
- Table classes consistency changes across the application
- File Open and Save dialog list view changes
Author(s): Aditya Toshniwal & Khushboo Vashi
2018-12-21 05:44:55 -06:00
|
|
|
' <button class="btn btn-secondary wizard-back" <%=this.options.disable_prev ? "disabled" : ""%>>' +
|
2019-01-02 03:35:15 -06:00
|
|
|
' <i class="fa fa-backward"></i> ' + gettext('Back') + '</button>' +
|
Improvement in the look and feel of the whole application
Changed the SCSS/CSS for the below third party libraries to adopt the
new look 'n' feel:
- wcDocker
- Alertify dialogs, and notifications
- AciTree
- Bootstrap Navbar
- Bootstrap Tabs
- Bootstrap Drop-Down menu
- Backgrid
- Select2
Adopated the new the look 'n' feel for the dialogs, wizard, properties,
tab panels, tabs, fieldset, subnode control, spinner control, HTML
table, and other form controls.
- Font is changed to Roboto
- Using SCSS variables to define the look 'n' feel
- Designer background images for the Login, and Forget password pages in
'web' mode
- Improved the look 'n' feel for the key selection in the preferences
dialog
- Table classes consistency changes across the application
- File Open and Save dialog list view changes
Author(s): Aditya Toshniwal & Khushboo Vashi
2018-12-21 05:44:55 -06:00
|
|
|
' <button class="btn btn-secondary wizard-next" <%=this.options.disable_next ? "disabled" : ""%>>' +
|
2018-01-12 01:29:51 -06:00
|
|
|
' ' + gettext('Next') +
|
2019-01-02 03:35:15 -06:00
|
|
|
' <i class="fa fa-forward"></i></button>' +
|
2018-01-12 01:29:51 -06:00
|
|
|
' <button class="btn btn-primary wizard-finish" <%=this.options.disable_finish ? "disabled" : ""%>>' +
|
2019-01-02 03:35:15 -06:00
|
|
|
' <i class="fa fa-check"></i> ' + gettext('Finish') + '</button>' +
|
2018-01-12 01:29:51 -06:00
|
|
|
' </div>' +
|
|
|
|
' </div>' +
|
|
|
|
' </div>' +
|
|
|
|
' </div>'),
|
2016-04-13 10:11:43 -05:00
|
|
|
events: {
|
2018-01-12 01:29:51 -06:00
|
|
|
'click button.wizard-next': 'nextPage',
|
|
|
|
'click button.wizard-back': 'prevPage',
|
|
|
|
'click button.wizard-cancel': 'onCancel',
|
|
|
|
'click button.wizard-cancel-event': 'onCancel',
|
|
|
|
'click button.wizard-maximize-event': 'onMaximize',
|
|
|
|
'click button.wizard-finish': 'finishWizard',
|
|
|
|
'click button.wizard-help': 'onDialogHelp',
|
|
|
|
'click a.close-error': 'closeErrorMsg',
|
2016-04-13 10:11:43 -05:00
|
|
|
},
|
|
|
|
initialize: function(options) {
|
|
|
|
this.options = _.extend({}, this.options, options.options);
|
|
|
|
this.currPage = this.collection.at(this.options.curr_page).toJSON();
|
|
|
|
},
|
|
|
|
render: function() {
|
2018-02-27 05:18:36 -06:00
|
|
|
var self = this,
|
|
|
|
data = this.currPage;
|
2016-04-13 10:11:43 -05:00
|
|
|
|
|
|
|
/* Check Status of the buttons */
|
|
|
|
this.options.disable_next = (this.options.disable_next ? true : this.evalASFunc(this.currPage.disable_next));
|
|
|
|
this.options.disable_prev = (this.options.disable_prev ? true : this.evalASFunc(this.currPage.disable_prev));
|
|
|
|
this.options.disable_cancel = (this.currPage.canCancel ? true : this.evalASFunc(this.currPage.disable_cancel));
|
|
|
|
|
|
|
|
/* HTML Content */
|
2018-01-12 01:29:51 -06:00
|
|
|
if (data.html) {
|
|
|
|
data.content = data.html;
|
|
|
|
}
|
2016-04-13 10:11:43 -05:00
|
|
|
/* Backbone View */
|
2018-01-12 01:29:51 -06:00
|
|
|
else if (data.view) {
|
|
|
|
data.content = data.view.render().el;
|
|
|
|
}
|
2016-04-13 10:11:43 -05:00
|
|
|
|
|
|
|
$(this.el).html(this.tmpl(data));
|
2018-01-12 01:29:51 -06:00
|
|
|
$(this.el).find('.wizard-right-panel_content').html(data.content);
|
2016-04-13 10:11:43 -05:00
|
|
|
|
|
|
|
/* OnLoad Callback */
|
|
|
|
this.onLoad();
|
|
|
|
|
2018-02-27 05:18:36 -06:00
|
|
|
setTimeout(function() {
|
|
|
|
var container = $(self.el);
|
|
|
|
commonUtils.findAndSetFocus(container);
|
|
|
|
}, 100);
|
|
|
|
|
2016-04-13 10:11:43 -05:00
|
|
|
return this;
|
|
|
|
},
|
|
|
|
nextPage: function() {
|
2018-01-12 01:29:51 -06:00
|
|
|
if (!this.beforeNext()) {
|
|
|
|
return false;
|
|
|
|
}
|
2016-04-13 10:11:43 -05:00
|
|
|
|
2017-07-18 09:13:16 -05:00
|
|
|
var page_id = this.onNext();
|
2016-04-13 10:11:43 -05:00
|
|
|
|
2018-01-12 01:29:51 -06:00
|
|
|
if (page_id) {
|
2016-04-13 10:11:43 -05:00
|
|
|
this.currPage = this.collection.get(page_id).toJSON();
|
|
|
|
this.options.curr_page = this.collection.indexOf(this.collection.get(page_id));
|
2018-01-12 01:29:51 -06:00
|
|
|
} else if (this.options.curr_page < (this.collection.length - 1)) {
|
2016-04-13 10:11:43 -05:00
|
|
|
this.options.curr_page = this.options.curr_page + 1;
|
|
|
|
this.currPage = this.collection.at(this.options.curr_page).toJSON();
|
|
|
|
}
|
|
|
|
|
|
|
|
this.enableDisableNext();
|
|
|
|
this.enableDisablePrev();
|
|
|
|
|
|
|
|
return this.render();
|
|
|
|
},
|
|
|
|
prevPage: function() {
|
2018-01-12 01:29:51 -06:00
|
|
|
if (!this.beforePrev()) {
|
|
|
|
return false;
|
|
|
|
}
|
2016-04-13 10:11:43 -05:00
|
|
|
|
2017-07-18 09:13:16 -05:00
|
|
|
var page_id = this.onPrev();
|
2016-04-13 10:11:43 -05:00
|
|
|
|
2018-01-12 01:29:51 -06:00
|
|
|
if (page_id) {
|
2016-04-13 10:11:43 -05:00
|
|
|
this.currPage = this.collection.get(page_id).toJSON();
|
|
|
|
this.options.curr_page = this.collection.indexOf(this.collection.get(page_id));
|
2018-01-12 01:29:51 -06:00
|
|
|
} else if (this.options.curr_page > 0) {
|
2016-04-13 10:11:43 -05:00
|
|
|
this.options.curr_page = this.options.curr_page - 1;
|
|
|
|
this.currPage = this.collection.at(this.options.curr_page).toJSON();
|
|
|
|
}
|
|
|
|
|
|
|
|
this.enableDisableNext();
|
|
|
|
this.enableDisablePrev();
|
|
|
|
|
|
|
|
return this.render();
|
|
|
|
},
|
|
|
|
finishWizard: function() {
|
|
|
|
this.onFinish();
|
|
|
|
this.remove(); // Remove view from DOM
|
2018-07-10 04:59:53 -05:00
|
|
|
this.off(); // Unbind all local event bindings
|
2016-04-13 10:11:43 -05:00
|
|
|
delete this.$el; // Delete the jQuery wrapped object variable
|
|
|
|
delete this.el; // Delete the variable reference to this node
|
|
|
|
return true;
|
|
|
|
},
|
|
|
|
enableDisableNext: function(disable) {
|
2018-01-12 01:29:51 -06:00
|
|
|
if (typeof(disable) != 'undefined') {
|
|
|
|
this.options.disable_next = disable;
|
|
|
|
} else if (this.options.curr_page >= (this.collection.length - 1)) {
|
|
|
|
this.options.disable_next = true;
|
|
|
|
} else {
|
|
|
|
this.options.disable_next = false;
|
|
|
|
}
|
2016-04-13 10:11:43 -05:00
|
|
|
},
|
|
|
|
enableDisablePrev: function(disable) {
|
2018-01-12 01:29:51 -06:00
|
|
|
if (typeof(disable) != 'undefined') {
|
|
|
|
this.options.disable_prev = disable;
|
|
|
|
} else if (this.options.curr_page <= 0) {
|
|
|
|
this.options.disable_prev = true;
|
|
|
|
} else {
|
|
|
|
this.options.disable_prev = false;
|
|
|
|
}
|
2016-04-13 10:11:43 -05:00
|
|
|
},
|
2017-11-28 08:10:12 -06:00
|
|
|
closeErrorMsg: function() {
|
|
|
|
$(this.el).find('.pg-prop-status-bar .alert-text').empty();
|
2018-01-12 01:29:51 -06:00
|
|
|
$(this.el).find('.pg-prop-status-bar').css('visibility', 'hidden');
|
2017-11-28 08:10:12 -06:00
|
|
|
},
|
2018-01-12 01:29:51 -06:00
|
|
|
beforeNext: function() {
|
2016-04-13 10:11:43 -05:00
|
|
|
return this.evalASFunc(this.currPage.beforeNext);
|
|
|
|
},
|
2018-01-12 01:29:51 -06:00
|
|
|
beforePrev: function() {
|
2016-04-13 10:11:43 -05:00
|
|
|
return this.evalASFunc(this.currPage.beforePrev);
|
|
|
|
},
|
2018-01-12 01:29:51 -06:00
|
|
|
onPrev: function() {
|
2016-04-13 10:11:43 -05:00
|
|
|
return this.evalASFunc(this.currPage.onPrev);
|
|
|
|
},
|
2018-01-12 01:29:51 -06:00
|
|
|
onNext: function() {
|
2016-04-13 10:11:43 -05:00
|
|
|
return this.evalASFunc(this.currPage.onNext);
|
|
|
|
},
|
|
|
|
onLoad: function() {
|
|
|
|
return this.evalASFunc(this.currPage.onLoad);
|
|
|
|
},
|
|
|
|
onFinish: function() {
|
|
|
|
return true;
|
|
|
|
},
|
|
|
|
onCancel: function() {
|
|
|
|
this.$el.remove();
|
|
|
|
return true;
|
|
|
|
},
|
2017-01-08 04:35:34 -06:00
|
|
|
onMaximize: function() {
|
|
|
|
var dialog_api = this.options.dialog_api,
|
2018-01-12 01:29:51 -06:00
|
|
|
_el = this.$el.find('.wizard-maximize-event');
|
2017-01-08 04:35:34 -06:00
|
|
|
|
|
|
|
// If no dialog api found then return
|
2018-01-12 01:29:51 -06:00
|
|
|
if (!dialog_api) return;
|
2017-01-08 04:35:34 -06:00
|
|
|
|
2018-01-12 01:29:51 -06:00
|
|
|
if (dialog_api.isMaximized()) {
|
2017-01-08 04:35:34 -06:00
|
|
|
// toggle the icon
|
|
|
|
_el.removeClass('ajs-maximized');
|
|
|
|
dialog_api.restore();
|
|
|
|
} else {
|
|
|
|
// toggle the icon
|
|
|
|
_el.addClass('ajs-maximized ' + _el.attr('class'));
|
|
|
|
dialog_api.maximize();
|
|
|
|
}
|
|
|
|
},
|
2016-04-13 10:11:43 -05:00
|
|
|
evalASFunc: function(func, ctx) {
|
|
|
|
var self = this;
|
|
|
|
ctx = ctx || self.currPage;
|
|
|
|
|
|
|
|
return (_.isFunction(func) ? func.apply(ctx, [self]) : func);
|
2016-06-08 08:08:12 -05:00
|
|
|
},
|
|
|
|
onDialogHelp: function() {
|
|
|
|
// See if we can find an existing panel, if not, create one
|
2017-07-18 09:13:16 -05:00
|
|
|
var pnlDialogHelp = pgBrowser.docker.findPanels('pnl_online_help')[0];
|
2016-06-08 08:08:12 -05:00
|
|
|
|
|
|
|
if (pnlDialogHelp == null) {
|
2017-07-18 09:13:16 -05:00
|
|
|
var pnlProperties = pgBrowser.docker.findPanels('properties')[0];
|
2016-06-08 08:08:12 -05:00
|
|
|
pgBrowser.docker.addPanel('pnl_online_help', wcDocker.DOCK.STACKED, pnlProperties);
|
|
|
|
pnlDialogHelp = pgBrowser.docker.findPanels('pnl_online_help')[0];
|
|
|
|
}
|
|
|
|
|
|
|
|
// Update the panel
|
2017-07-18 09:13:16 -05:00
|
|
|
var iframe = $(pnlDialogHelp).data('embeddedFrame');
|
2016-06-08 08:08:12 -05:00
|
|
|
|
|
|
|
pnlDialogHelp.focus();
|
|
|
|
iframe.openURL(this.options.wizard_help);
|
2018-01-12 01:29:51 -06:00
|
|
|
},
|
2016-04-13 10:11:43 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
return pgBrowser;
|
|
|
|
|
|
|
|
});
|