mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-08 04:47:22 +08:00
Fixed tutorial step numbers and changed getting next page reference on protocols page.
This commit is contained in:
parent
92d990a715
commit
c8eb82cc85
11 changed files with 39 additions and 61 deletions
|
@ -125,13 +125,18 @@ function initTutorial() {
|
||||||
var steps = [{
|
var steps = [{
|
||||||
intro: $("[data-role='tutorial-data']")
|
intro: $("[data-role='tutorial-data']")
|
||||||
.attr('data-module-protocols-step-text')
|
.attr('data-module-protocols-step-text')
|
||||||
|
}, {
|
||||||
|
element: $('#protocol-copy-to-repository')[0],
|
||||||
|
intro: $("[data-role='tutorial-data']")
|
||||||
|
.attr('data-module-protocols-save-step-text'),
|
||||||
|
position: 'right'
|
||||||
}, {
|
}, {
|
||||||
element: resultsTab[0],
|
element: resultsTab[0],
|
||||||
intro: $("[data-role='tutorial-data']")
|
intro: $("[data-role='tutorial-data']")
|
||||||
.attr('data-module-protocols-click-results-step-text'),
|
.attr('data-module-protocols-click-results-step-text'),
|
||||||
position: 'right'
|
position: 'right'
|
||||||
}];
|
}];
|
||||||
initPageTutorialSteps(12, 13, nextPage, function() {}, function() {}, steps);
|
initPageTutorialSteps(12, 14, nextPage, function() {}, function() {}, steps);
|
||||||
}
|
}
|
||||||
|
|
||||||
function initCopyToRepository() {
|
function initCopyToRepository() {
|
||||||
|
|
|
@ -135,7 +135,7 @@ function initTutorial() {
|
||||||
.attr('data-module-protocols-click-samples-step-text'),
|
.attr('data-module-protocols-click-samples-step-text'),
|
||||||
position: 'left'
|
position: 'left'
|
||||||
}];
|
}];
|
||||||
initPageTutorialSteps(14, 15, nextPage, function() {}, function() {}, steps);
|
initPageTutorialSteps(15, 16, nextPage, function() {}, function() {}, steps);
|
||||||
}
|
}
|
||||||
|
|
||||||
var ResultTypeEnum = Object.freeze({
|
var ResultTypeEnum = Object.freeze({
|
||||||
|
|
|
@ -354,7 +354,7 @@
|
||||||
$('#' + demoProjectId + '-project-canvas-link').attr('href');
|
$('#' + demoProjectId + '-project-canvas-link').attr('href');
|
||||||
initPageTutorialSteps(1, 3, nextPage, tutorialBeforeCb,
|
initPageTutorialSteps(1, 3, nextPage, tutorialBeforeCb,
|
||||||
tutorialAfterCb);
|
tutorialAfterCb);
|
||||||
} else if (stepNum >= 21 && stepNum <= 22) {
|
} else if (stepNum >= 24 && stepNum <= 25) {
|
||||||
var demoProject = $('#' + demoProjectId);
|
var demoProject = $('#' + demoProjectId);
|
||||||
var firstStepPos = 'right';
|
var firstStepPos = 'right';
|
||||||
if (demoProject.offset().left > window.innerWidth / 2 ||
|
if (demoProject.offset().left > window.innerWidth / 2 ||
|
||||||
|
@ -369,7 +369,7 @@
|
||||||
|
|
||||||
var nextPage = $('#new-report-btn').attr('href');
|
var nextPage = $('#new-report-btn').attr('href');
|
||||||
var steps = [{
|
var steps = [{
|
||||||
element: $(demoProjectId)[0],
|
element: $('#' + demoProjectId)[0],
|
||||||
intro: $('#projects-toolbar')
|
intro: $('#projects-toolbar')
|
||||||
.attr('data-archive-project-step-text'),
|
.attr('data-archive-project-step-text'),
|
||||||
position: firstStepPos
|
position: firstStepPos
|
||||||
|
@ -378,7 +378,7 @@
|
||||||
intro: $('#projects-toolbar').attr('data-goodbye-tutorial'),
|
intro: $('#projects-toolbar').attr('data-goodbye-tutorial'),
|
||||||
position: 'left'
|
position: 'left'
|
||||||
}];
|
}];
|
||||||
initPageTutorialSteps(21, 22, nextPage, function() {}, function() {},
|
initPageTutorialSteps(24, 25, nextPage, function() {}, function() {},
|
||||||
steps);
|
steps);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,21 @@ var protocolsTableEl = null;
|
||||||
var protocolsDatatable = null;
|
var protocolsDatatable = null;
|
||||||
var repositoryType;
|
var repositoryType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initializes page
|
||||||
|
*/
|
||||||
|
function init() {
|
||||||
|
updateButtons();
|
||||||
|
initProtocolsTable();
|
||||||
|
initRowSelection();
|
||||||
|
initKeywordFiltering();
|
||||||
|
initLinkedChildrenModal();
|
||||||
|
initCreateNewModal();
|
||||||
|
initModals();
|
||||||
|
initImport();
|
||||||
|
initTutorial();
|
||||||
|
}
|
||||||
|
|
||||||
// Initialize protocols DataTable
|
// Initialize protocols DataTable
|
||||||
function initProtocolsTable() {
|
function initProtocolsTable() {
|
||||||
protocolsTableEl = $("#protocols-table");
|
protocolsTableEl = $("#protocols-table");
|
||||||
|
@ -698,54 +713,12 @@ function initImport() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initilize first-time tutorial if needed */
|
/**
|
||||||
|
* Initializes tutorial
|
||||||
|
*/
|
||||||
function initTutorial() {
|
function initTutorial() {
|
||||||
var currentStep = Cookies.get('current_tutorial_step');
|
var nextPage = $('.navbar-brand').attr('href');
|
||||||
var protocolButtons = $('.nav-tab .nav-settings').get(0);
|
initPageTutorialSteps(22, 23, nextPage, function() {}, function() {});
|
||||||
if (currentStep && (currentStep > 20 && currentStep < 23)) {
|
|
||||||
introJs()
|
|
||||||
.setOptions({
|
|
||||||
overlayOpacity: '0.1',
|
|
||||||
nextLabel: 'Next',
|
|
||||||
doneLabel: 'End tutorial',
|
|
||||||
skipLabel: 'End tutorial',
|
|
||||||
showBullets: false,
|
|
||||||
showStepNumbers: false,
|
|
||||||
exitOnOverlayClick: false,
|
|
||||||
exitOnEsc: false,
|
|
||||||
tooltipClass: 'custom'
|
|
||||||
})
|
|
||||||
.onafterchange(function() {
|
|
||||||
Cookies.set('current_tutorial_step', this._currentStep + 22);
|
|
||||||
|
|
||||||
if (this._currentStep === 1) {
|
|
||||||
Cookies.set('current_tutorial_step', this._currentStep + 22);
|
|
||||||
setTimeout(function() {
|
|
||||||
$('.introjs-tooltipbuttons a.introjs-nextbutton')
|
|
||||||
.removeClass('introjs-disabled')
|
|
||||||
.attr('href', '/');
|
|
||||||
}, 500);
|
|
||||||
}
|
|
||||||
}).start();
|
|
||||||
|
|
||||||
// Destroy first-time tutorial cookies when skip tutorial
|
|
||||||
// or end tutorial is clicked
|
|
||||||
$('.introjs-skipbutton').each(function() {
|
|
||||||
$(this).click(function() {
|
|
||||||
Cookies.remove('tutorial_data');
|
|
||||||
Cookies.remove('current_tutorial_step');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize everything
|
init();
|
||||||
updateButtons();
|
|
||||||
initProtocolsTable();
|
|
||||||
initRowSelection();
|
|
||||||
initKeywordFiltering();
|
|
||||||
initLinkedChildrenModal();
|
|
||||||
initCreateNewModal();
|
|
||||||
initModals();
|
|
||||||
initImport();
|
|
||||||
initTutorial();
|
|
||||||
|
|
|
@ -173,7 +173,7 @@
|
||||||
intro: $('#content').attr('data-reports-click-new-report-step-text'),
|
intro: $('#content').attr('data-reports-click-new-report-step-text'),
|
||||||
position: 'right'
|
position: 'right'
|
||||||
}];
|
}];
|
||||||
initPageTutorialSteps(18, 18, nextPage, function() {}, function() {},
|
initPageTutorialSteps(19, 19, nextPage, function() {}, function() {},
|
||||||
steps);
|
steps);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1149,8 +1149,8 @@ function initializeReportSidebartruncation() {
|
||||||
function initTutorial() {
|
function initTutorial() {
|
||||||
ignoreUnsavedWorkAlert = true;
|
ignoreUnsavedWorkAlert = true;
|
||||||
|
|
||||||
var nextPage = $('#organization-link').attr('href');
|
var nextPage = $('#protocol-link').attr('href');
|
||||||
initPageTutorialSteps(19, 20, nextPage, function() {}, function() {
|
initPageTutorialSteps(20, 21, nextPage, function() {}, function() {
|
||||||
ignoreUnsavedWorkAlert = false;
|
ignoreUnsavedWorkAlert = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -167,7 +167,7 @@ function initTutorial() {
|
||||||
element: $('#secondary-menu')[0],
|
element: $('#secondary-menu')[0],
|
||||||
intro: $('#samples-toolbar').attr('data-breadcrumbs-step-text')
|
intro: $('#samples-toolbar').attr('data-breadcrumbs-step-text')
|
||||||
}];
|
}];
|
||||||
initPageTutorialSteps(16, 17, nextPage, function() {}, function() {}, steps);
|
initPageTutorialSteps(17, 18, nextPage, function() {}, function() {}, steps);
|
||||||
}
|
}
|
||||||
|
|
||||||
initTutorial();
|
initTutorial();
|
||||||
|
|
|
@ -26,7 +26,7 @@ $.fn.onAjaxComplete = function (cb) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
var TUTORIAL_STEPS_CNT = 22;
|
var TUTORIAL_STEPS_CNT = 25;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes tutorial steps for the current page.
|
* Initializes tutorial steps for the current page.
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<% if !defined? initial then initial = false end %>
|
<% if !defined? initial then initial = false end %>
|
||||||
<div class="new-element <%= "hidden" if hide %> <%= "initial" if initial %>" data-ts="ignore" data-type="new" title="<%=t "projects.reports.elements.new_element.title" %>"
|
<div class="new-element <%= "hidden" if hide %> <%= "initial" if initial %>" data-ts="ignore" data-type="new" title="<%=t "projects.reports.elements.new_element.title" %>"
|
||||||
<% if initial %>
|
<% if initial %>
|
||||||
data-step="19"
|
data-step="20"
|
||||||
data-position="left"
|
data-position="left"
|
||||||
data-intro="<%=t 'tutorial.new_report_html' %>"
|
data-intro="<%=t 'tutorial.new_report_html' %>"
|
||||||
<% end %>>
|
<% end %>>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<ul class="breadcrumb" style="margin-left: 15px;">
|
<ul class="breadcrumb" style="margin-left: 15px;">
|
||||||
<li>
|
<li>
|
||||||
<% if can_view_projects(@project.organization) %>
|
<% if can_view_projects(@project.organization) %>
|
||||||
<a id="organization-link" href="<%= projects_path :organization => @project.organization.id %>" data-intro="<%=t 'tutorial.new_report_click_org_html', private_org: @project.organization.name %>" data-step="20">
|
<a id="organization-link" href="<%= projects_path :organization => @project.organization.id %>" data-intro="<%=t 'tutorial.new_report_click_org_html', private_org: @project.organization.name %>" data-step="21" data-position="left">
|
||||||
<% end %>
|
<% end %>
|
||||||
<span class="hidden-sm hidden-md hidden-lg">Org</span>
|
<span class="hidden-sm hidden-md hidden-lg">Org</span>
|
||||||
<span class="hidden-xs"><%= @project.organization.name %></span>
|
<span class="hidden-xs"><%= @project.organization.name %></span>
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="<%= protocols_path %>">
|
<a id="protocol-link" href="<%= protocols_path %>">
|
||||||
<span class="glyphicon glyphicon-list-alt"></span>
|
<span class="glyphicon glyphicon-list-alt"></span>
|
||||||
<span class="visible-xs-inline visible-sm-inline"><%= t('nav.label.protocols') %></span>
|
<span class="visible-xs-inline visible-sm-inline"><%= t('nav.label.protocols') %></span>
|
||||||
</a>
|
</a>
|
||||||
|
|
Loading…
Add table
Reference in a new issue