Merge branch 'zd_SCI_271' of https://github.com/ZmagoD/scinote-web into ZmagoD-zd_SCI_271

This commit is contained in:
zmagod 2016-08-17 09:58:29 +02:00
commit 4293f9c267
4 changed files with 114 additions and 6 deletions

View file

@ -146,6 +146,7 @@ jsPlumb.ready(function () {
initializeGraph(".diagram .module-large");
initializeFullZoom();
initializeTutorial(false);
canvas_tutorial_helper();
});
//************************************
@ -3090,6 +3091,7 @@ function initializeTutorial(isEditMode) {
$(this).click(function (){
Cookies.remove('tutorial_data');
Cookies.remove('current_tutorial_step');
restore_after_tutorial();
});
});
} else if (!isEditMode && currentStep > 5 || currentStep < 10) {
@ -3145,11 +3147,61 @@ function initializeTutorial(isEditMode) {
$(this).click(function (){
Cookies.remove('tutorial_data');
Cookies.remove('current_tutorial_step');
restore_after_tutorial();
});
});
}
}
function canvas_tutorial_helper(){
$(document).ready(function(){
if( $('div').hasClass('introjs-showElement') ){
$('#slide-panel')
.css({'pointer-events': 'none'});
$.each( $('.panel-default'), function(i, el){
$(el)
.find('.tab-pane')
.css({'pointer-events': 'none'});
$(el)
.find('.edit-tags-link')
.css({'pointer-events': 'none'});
$(el)
.find('.panel-heading')
.css({'pointer-events': 'none'});
});
}
});
$( document ).ajaxComplete(function() {
if( $('div').hasClass('introjs-showElement') ){
$('#canvas-new-module')
.css({'pointer-events': 'none'});
}
});
}
function restore_after_tutorial(){
$('#canvas-new-module')
.css({'pointer-events': 'auto'});
$('#slide-panel')
.css({'pointer-events': 'auto'});
$.each( $('.panel-default'), function(i, el){
$(el)
.find('.tab-pane')
.css({'pointer-events': 'auto'});
$(el)
.find('.edit-tags-link')
.css({'pointer-events': 'auto'});
$(el)
.find('.panel-heading')
.css({'pointer-events': 'auto'});
});
}
function showTutorial() {
if (Cookies.get('tutorial_data'))
tutorialData = JSON.parse(Cookies.get('tutorial_data'));

View file

@ -422,7 +422,8 @@
exitOnOverlayClick: false,
exitOnEsc: false,
disableInteraction: true,
tooltipClass: 'custom'
tooltipClass: 'custom',
tooltipPosition: 'right'
})
.goToStep(goToStep)
.onafterchange(function (tarEl) {
@ -448,6 +449,7 @@
$(this).click(function (){
Cookies.remove('tutorial_data');
Cookies.remove('current_tutorial_step');
restore_after_tutorial();
});
});
@ -488,6 +490,7 @@
.oncomplete(function () {
Cookies.remove('tutorial_data');
Cookies.remove('current_tutorial_step');
restore_after_tutorial();
})
.start();
@ -504,6 +507,42 @@
}
}
init();
function project_tutorial_helper(){
$(document).ready(function(){
if( $('div').hasClass('introjs-overlay')){
$.each($('.panel'), function(i, el){
$(el)
.find('.panel-title')
.css({ 'pointer-events': 'none' });
$(el)
.find('.tab-content')
.css({ 'pointer-events': 'none' });
$(el)
.find('.form-submit-link')
.css({
'pointer-events': 'none',
'color': '#d2d2d2'});
});
}
});
}
}());
function restore_after_tutorial(){
$('.introjs-showElement')
.find('.form-submit-link')
.css({
'pointer-events': 'auto',
'color': '#262626'});
$.each($('.panel'), function(i, el){
$(el)
.find('.tab-content')
.css({ 'pointer-events': 'auto' });
});
}
init();
project_tutorial_helper();
}());

View file

@ -195,6 +195,7 @@ function initTutorial() {
$(this).click(function (){
Cookies.remove('tutorial_data');
Cookies.remove('current_tutorial_step');
restore_after_tutorial();
});
});
}
@ -231,5 +232,21 @@ function showTutorial() {
return tutorialModuleId == currentModuleId;
}
function samples_tutorial_helper(){
$(document).ready(function(){
if( $('div').hasClass('introjs-showElement') ){
$('#secondary-menu')
.find('a')
.css({ 'pointer-events': 'none' });
}
});
}
function restore_after_tutorial(){
$('#secondary-menu')
.find('a')
.css({ 'pointer-events': 'auto' });
}
// Initialize first-time tutorial
initTutorial();
samples_tutorial_helper();

View file

@ -176,9 +176,9 @@ module FirstTimeDataGenerator
created_at: generate_random_time(6.days.ago),
due_date: Time.now + (2 * i + 1).weeks,
description: i == 5 ? qpcr_module_description : nil,
x: i < 4 ? i % 4 : 7 - i,
y: i/4,
experiment: experiment,
x: (i < 4 ? i % 4 : 7 - i) * 32,
y: (i / 4) * 16,
project: project,
workflow_order: i,
my_module_group: my_module_group
)