2014-08-14 Miguel de Dios <miguel.dedios@artica.es>

* include/functions_clippy.php,
	include/help/clippy/godmode_agentes_modificar_agente.php,
	include/help/clippy/homepage.php,
	include/help/clippy/module_unknow.php,
	include/help/clippy/godmode_agentes_configurar_agente.php,
	include/javascript/intro.js: some fixes and improves in the clippy.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10422 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2014-08-14 09:26:04 +00:00
parent 2468e5469a
commit 98d9f97bb6
7 changed files with 250 additions and 122 deletions

View File

@ -1,3 +1,12 @@
2014-08-14 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_clippy.php,
include/help/clippy/godmode_agentes_modificar_agente.php,
include/help/clippy/homepage.php,
include/help/clippy/module_unknow.php,
include/help/clippy/godmode_agentes_configurar_agente.php,
include/javascript/intro.js: some fixes and improves in the clippy.
2014-08-14 Koichiro Kikuchi <koichiro@rworks.jp>
* pandora_console_install: Refactored code and added "fakeroot"

View File

@ -32,16 +32,21 @@ function clippy_start($sec2) {
if (is_file("include/help/clippy/" . $sec2 . ".php")) {
require("include/help/clippy/" . $sec2 . ".php");
clippy_start_page();
$tours = clippy_start_page();
clippy_write_javascript_helps_steps($tours);
}
//Add homepage for all pages for to show the "task sugestions"
require("include/help/clippy/homepage.php");
clippy_start_page_homepage();
$tours = clippy_start_page_homepage();
clippy_write_javascript_helps_steps($tours);
}
else {
require("include/help/clippy/homepage.php");
clippy_start_page_homepage();
$tours = clippy_start_page_homepage();
clippy_write_javascript_helps_steps($tours);
}
}
@ -49,38 +54,66 @@ function clippy_clean_help() {
set_cookie('clippy', null);
}
function clippy_write_javascript_helps_steps($helps,
$force_first_step_by_default = true) {
function clippy_write_javascript_helps_steps($tours) {
global $config;
$first_step_by_default = false;
if (isset($tours['first_step_by_default']))
$first_step_by_default = $tours['first_step_by_default'];
//For the help context instead the clippy
$help_context = false;
if (isset($tours['help_context']))
$help_context = $tours['help_context'];
if ($help_context) {
$name_obj_js_tour = '{clippy_obj}';
}
else {
$name_obj_js_tour = 'intro';
}
$clippy = get_cookie('clippy', false);
set_cookie('clippy', null);
//Get the help steps from a task
$steps = $helps[$clippy]['steps'];
if ($force_first_step_by_default) {
$steps = $tours['tours'][$clippy]['steps'];
if ($first_step_by_default) {
if (empty($steps)) {
//Get the first by default
$temp = reset($helps);
$temp = reset($tours['tours']);
$steps = $temp['steps'];
}
}
$conf = $helps[$clippy]['conf'];
if ($force_first_step_by_default) {
if ($help_context) {
foreach ($steps as $iterator => $step) {
$init_step_context = false;
if (isset($step['init_step_context']))
$init_step_context = $step['init_step_context'];
if ($init_step_context) {
unset($steps[$iterator]['init_step_context']);
$steps[$iterator]['element'] = '{clippy}';
}
}
}
$conf = $tours['tours'][$clippy]['conf'];
if ($first_step_by_default) {
if (empty($conf)) {
//Get the first by default
$temp = reset($helps);
$temp = reset($tours['tours']);
$conf = $temp['conf'];
}
}
if (!empty($steps)) {
$name_obj_tour = 'intro';
if (!empty($conf['name_obj_tour'])) {
$name_obj_tour = $conf['name_obj_tour'];
if (!empty($conf['name_obj_js_tour'])) {
$name_obj_js_tour = $conf['name_obj_js_tour'];
}
$autostart = true;
@ -93,17 +126,36 @@ function clippy_write_javascript_helps_steps($helps,
$other_js = $conf['other_js'];
}
$exit_js = '';
if (!empty($conf['exit_js'])) {
$exit_js = $conf['exit_js'];
}
$complete_js = '';
if (!empty($conf['complete_js'])) {
$complete_js = $conf['complete_js'];
}
$show_bullets = 0;
if (!empty($conf['show_bullets'])) {
$show_bullets = (int)$conf['show_bullets'];
}
$show_step_numbers = 0;
if (!empty($conf['show_step_numbers'])) {
$show_step_numbers = (int)$conf['show_step_numbers'];
}
$help_context = false;
?>
<script type="text/javascript">
var <?php echo $name_obj_tour; ?> = null;
var <?php echo $name_obj_js_tour; ?> = null;
$(document).ready(function() {
<?php echo $name_obj_tour; ?> = introJs();
<?php echo $name_obj_js_tour; ?> = introJs();
<?php echo $name_obj_tour; ?>.setOptions({
<?php echo $name_obj_js_tour; ?>.setOptions({
steps: <?php echo json_encode($steps); ?>,
showBullets: <?php echo json_encode($conf['showBullets']); ?>,
showStepNumbers: <?php echo json_encode($conf['showStepNumbers']); ?>,
showBullets: <?php echo $show_bullets; ?>,
showStepNumbers: <?php echo $show_step_numbers; ?>,
nextLabel: "<?php echo __('Next &rarr;'); ?>",
prevLabel: "<?php echo __('&larr; Back'); ?>",
skipLabel: "<?php echo __('Skip'); ?>",
@ -111,7 +163,12 @@ function clippy_write_javascript_helps_steps($helps,
exitOnOverlayClick: false,
exitOnEsc: true, //false,
})
.oncomplete(function(value) {
<?php echo $complete_js; ?>;
})
.onexit(function(value) {
<?php echo $exit_js; ?>;
exit = confirm("<?php echo __("Do you want to exit the help tour?"); ?>");
return exit;
});
@ -127,7 +184,7 @@ function clippy_write_javascript_helps_steps($helps,
<?php
if ($autostart) {
?>
<?php echo $name_obj_tour; ?>.start();
<?php echo $name_obj_js_tour; ?>.start();
<?php
}
?>
@ -148,23 +205,45 @@ function clippy_context_help($help = null) {
ob_start();
$function = "clippy_" . $help;
$function();
$tours = $function();
clippy_write_javascript_helps_steps($tours);
$code = ob_get_clean();
$code = str_replace('{clippy}', '#' . $id, $code); html_debug_print($code, true);
$code = str_replace('{clippy_obj}', 'intro_' . $id, $code); html_debug_print($code, true);
$code = str_replace('{clippy}', '#' . $id, $code);
$code = str_replace('{clippy_obj}', 'intro_' . $id, $code);
$return = $code .
'<div id="' . $id . '" style="display: inline;">' .
'<a onclick="intro_' . $id . '.start();" href="javascript: return false;" >' .
'<a onclick="show_' . $id . '();" href="javascript: void(0);" >' .
html_print_image(
"images/clippy_icon.png",
true) .
'</a>' .
'</div>
<script type="text/javascript">
function show_' . $id . '() {
if (intro_' . $id . '.started()) {
started = 1;
}
else {
started = 0;
}
if (started == 0)
intro_' . $id . '.start();
}
$(document).ready(function() {
$("#' . $id . ' img").pulsate ();
(function pulse_' . $id . '(){
$("#' . $id . ' img")
.delay(100)
.animate({\'opacity\': 1})
.delay(400)
.animate({\'opacity\': 0}, pulse_' . $id . ');
})();
//$("#' . $id . ' img").pulsate ();
});
</script>
';

View File

@ -20,107 +20,109 @@
*/
function clippy_start_page() {
$helps = array();
$return_tours = array();
$return_tours['first_step_by_default'] = false;
$return_tours['tours'] = array();
//==================================================================
//Help tour about the monitoring with a ping (step 3)
//------------------------------------------------------------------
$helps['monitoring_server_step_3'] = array();
$helps['monitoring_server_step_3']['steps'] = array();
$helps['monitoring_server_step_3']['steps'][] = array(
$return_tours['tours']['monitoring_server_step_3'] = array();
$return_tours['tours']['monitoring_server_step_3']['steps'] = array();
$return_tours['tours']['monitoring_server_step_3']['steps'][] = array(
'element'=> '#clippy',
'intro' => __('Now you must go to modules, don\'t worry I teach you.')
);
$helps['monitoring_server_step_3']['steps'][] = array(
$return_tours['tours']['monitoring_server_step_3']['steps'][] = array(
'element'=> "img[alt='Modules']",
'intro' => __('Please click in this tab.')
);
$helps['monitoring_server_step_3']['conf'] = array();
$helps['monitoring_server_step_3']['conf']['showBullets'] = 0;
$helps['monitoring_server_step_3']['conf']['showStepNumbers'] = 0;
$helps['monitoring_server_step_3']['conf']['next_help'] = 'monitoring_server_step_4';
$return_tours['tours']['monitoring_server_step_3']['conf'] = array();
$return_tours['tours']['monitoring_server_step_3']['conf']['show_bullets'] = 0;
$return_tours['tours']['monitoring_server_step_3']['conf']['show_step_numbers'] = 0;
$return_tours['tours']['monitoring_server_step_3']['conf']['next_help'] = 'monitoring_server_step_4';
//==================================================================
//==================================================================
//Help tour about the monitoring with a ping (step 4)
//------------------------------------------------------------------
$helps['monitoring_server_step_4'] = array();
$helps['monitoring_server_step_4']['steps'] = array();
$helps['monitoring_server_step_4']['steps'][] = array(
$return_tours['tours']['monitoring_server_step_4'] = array();
$return_tours['tours']['monitoring_server_step_4']['steps'] = array();
$return_tours['tours']['monitoring_server_step_4']['steps'][] = array(
'element'=> '#clippy',
'intro' => __('Now you must create the module, don\'t worry I teach you.')
);
$helps['monitoring_server_step_4']['steps'][] = array(
$return_tours['tours']['monitoring_server_step_4']['steps'][] = array(
'element'=> "#moduletype",
'intro' => __('Choose the network server module.')
);
$helps['monitoring_server_step_4']['steps'][] = array(
$return_tours['tours']['monitoring_server_step_4']['steps'][] = array(
'element'=> "input[name='updbutton']",
'intro' => __('And click in this button.')
);
$helps['monitoring_server_step_4']['conf'] = array();
$helps['monitoring_server_step_4']['conf']['showBullets'] = 0;
$helps['monitoring_server_step_4']['conf']['showStepNumbers'] = 0;
$helps['monitoring_server_step_4']['conf']['next_help'] = 'monitoring_server_step_5';
$return_tours['tours']['monitoring_server_step_4']['conf'] = array();
$return_tours['tours']['monitoring_server_step_4']['conf']['show_bullets'] = 0;
$return_tours['tours']['monitoring_server_step_4']['conf']['show_step_numbers'] = 0;
$return_tours['tours']['monitoring_server_step_4']['conf']['next_help'] = 'monitoring_server_step_5';
//==================================================================
//==================================================================
//Help tour about the monitoring with a ping (step 5)
//------------------------------------------------------------------
$helps['monitoring_server_step_5'] = array();
$helps['monitoring_server_step_5']['steps'] = array();
$helps['monitoring_server_step_5']['steps'][] = array(
$return_tours['tours']['monitoring_server_step_5'] = array();
$return_tours['tours']['monitoring_server_step_5']['steps'] = array();
$return_tours['tours']['monitoring_server_step_5']['steps'][] = array(
'element'=> '#clippy',
'intro' => __('Now you must create the module, don\'t worry I teach you.')
);
$helps['monitoring_server_step_5']['steps'][] = array(
$return_tours['tours']['monitoring_server_step_5']['steps'][] = array(
'element'=> '#clippy',
'intro' => __('We are going to fill the form.')
);
$helps['monitoring_server_step_5']['steps'][] = array(
$return_tours['tours']['monitoring_server_step_5']['steps'][] = array(
'element'=> "#network_component_group",
'intro' => __('Please choose the Network Management.')
);
$helps['monitoring_server_step_5']['steps'][] = array(
$return_tours['tours']['monitoring_server_step_5']['steps'][] = array(
'element'=> "#network_component",
'intro' => __('And choose the component with the name "Host Alive".')
);
$helps['monitoring_server_step_5']['steps'][] = array(
$return_tours['tours']['monitoring_server_step_5']['steps'][] = array(
'element'=> "input[name='name']",
'intro' => __('You can change the name.')
);
$helps['monitoring_server_step_5']['steps'][] = array(
$return_tours['tours']['monitoring_server_step_5']['steps'][] = array(
'element'=> "input[name='ip_target']",
'intro' => __('Check if this IP is the address of your machine.')
);
$helps['monitoring_server_step_5']['steps'][] = array(
$return_tours['tours']['monitoring_server_step_5']['steps'][] = array(
'element'=> "input[name='crtbutton']",
'intro' => __('And only to finish it is clicking this button.')
);
$helps['monitoring_server_step_5']['conf'] = array();
$helps['monitoring_server_step_5']['conf']['showBullets'] = 0;
$helps['monitoring_server_step_5']['conf']['showStepNumbers'] = 0;
$helps['monitoring_server_step_5']['conf']['next_help'] = 'monitoring_server_step_6';
$return_tours['tours']['monitoring_server_step_5']['conf'] = array();
$return_tours['tours']['monitoring_server_step_5']['conf']['show_bullets'] = 0;
$return_tours['tours']['monitoring_server_step_5']['conf']['show_step_numbers'] = 0;
$return_tours['tours']['monitoring_server_step_5']['conf']['next_help'] = 'monitoring_server_step_6';
//==================================================================
//==================================================================
//Help tour about the monitoring with a ping (step 6)
//------------------------------------------------------------------
$helps['monitoring_server_step_6'] = array();
$helps['monitoring_server_step_6']['steps'] = array();
$helps['monitoring_server_step_6']['steps'][] = array(
$return_tours['tours']['monitoring_server_step_6'] = array();
$return_tours['tours']['monitoring_server_step_6']['steps'] = array();
$return_tours['tours']['monitoring_server_step_6']['steps'][] = array(
'element'=> '#clippy',
'intro' => __('Now, your module is just created.<br/> And the status color is <b>blue</b>.<br/>This meaning of blue status is the module is not executed for first time.<br/>In the next seconds if there is not a problem, the status color will change to red or green.')
);
$helps['monitoring_server_step_6']['conf'] = array();
$helps['monitoring_server_step_6']['conf']['showBullets'] = 0;
$helps['monitoring_server_step_6']['conf']['showStepNumbers'] = 0;
$return_tours['tours']['monitoring_server_step_6']['conf'] = array();
$return_tours['tours']['monitoring_server_step_6']['conf']['show_bullets'] = 0;
$return_tours['tours']['monitoring_server_step_6']['conf']['show_step_numbers'] = 0;
//==================================================================
clippy_write_javascript_helps_steps($helps, false);
return $return_tours;
}
?>

View File

@ -21,51 +21,53 @@
function clippy_start_page() {
$helps = array();
$return_tours = array();
$return_tours['first_step_by_default'] = false;
$return_tours['tours'] = array();
//==================================================================
//Help tour about the monitoring with a ping (step 1)
//------------------------------------------------------------------
$helps['monitoring_server_step_1'] = array();
$helps['monitoring_server_step_1']['steps'] = array();
$helps['monitoring_server_step_1']['steps'][] = array(
$return_tours['tours']['monitoring_server_step_1'] = array();
$return_tours['tours']['monitoring_server_step_1']['steps'] = array();
$return_tours['tours']['monitoring_server_step_1']['steps'][] = array(
'element'=> '#clippy',
'intro' => __('I show how to monitoring a server.')
'intro' => __('I show how to ping a server.')
);
$helps['monitoring_server_step_1']['steps'][] = array(
$return_tours['tours']['monitoring_server_step_1']['steps'][] = array(
'element'=> 'input[name="search"]',
'intro' => __('Please type a agent to save the modules for monitoring a server.')
);
$helps['monitoring_server_step_1']['steps'][] = array(
$return_tours['tours']['monitoring_server_step_1']['steps'][] = array(
'element'=> 'input[name="srcbutton"]',
'intro' => __('Maybe if you typped correctly the name, you can see the agent.')
);
$helps['monitoring_server_step_1']['conf'] = array();
$helps['monitoring_server_step_1']['conf']['showBullets'] = 0;
$helps['monitoring_server_step_1']['conf']['showStepNumbers'] = 1;
$helps['monitoring_server_step_1']['conf']['next_help'] = 'monitoring_server_step_2';
$return_tours['tours']['monitoring_server_step_1']['conf'] = array();
$return_tours['tours']['monitoring_server_step_1']['conf']['show_bullets'] = 0;
$return_tours['tours']['monitoring_server_step_1']['conf']['show_step_numbers'] = 1;
$return_tours['tours']['monitoring_server_step_1']['conf']['next_help'] = 'monitoring_server_step_2';
//==================================================================
//==================================================================
//Help tour about the monitoring with a ping (step 2)
//------------------------------------------------------------------
$helps['monitoring_server_step_2'] = array();
$helps['monitoring_server_step_2']['steps'] = array();
$helps['monitoring_server_step_2']['steps'][] = array(
$return_tours['tours']['monitoring_server_step_2'] = array();
$return_tours['tours']['monitoring_server_step_2']['steps'] = array();
$return_tours['tours']['monitoring_server_step_2']['steps'][] = array(
'element'=> '#clippy',
'intro' => __('Please choose the agent that you have searched.')
);
$helps['monitoring_server_step_2']['steps'][] = array(
$return_tours['tours']['monitoring_server_step_2']['steps'][] = array(
'element'=> '#agent_list',
'intro' => __('Choose the agent, please click in the name.')
);
$helps['monitoring_server_step_2']['conf'] = array();
$helps['monitoring_server_step_2']['conf']['showBullets'] = 0;
$helps['monitoring_server_step_2']['conf']['showStepNumbers'] = 0;
$helps['monitoring_server_step_2']['conf']['next_help'] = 'monitoring_server_step_3';
$return_tours['tours']['monitoring_server_step_2']['conf'] = array();
$return_tours['tours']['monitoring_server_step_2']['conf']['show_bullets'] = 0;
$return_tours['tours']['monitoring_server_step_2']['conf']['show_step_numbers'] = 0;
$return_tours['tours']['monitoring_server_step_2']['conf']['next_help'] = 'monitoring_server_step_3';
//==================================================================
clippy_write_javascript_helps_steps($helps, false);
return $return_tours;
}
?>

View File

@ -26,49 +26,62 @@ function clippy_start_page_homepage() {
clippy_clean_help();
$helps = array();
$return_tours = array();
$return_tours['first_step_by_default'] = true;
$return_tours['tours'] = array();
//==================================================================
//Help tour with the some task for to help the user.
//------------------------------------------------------------------
$helps['homepage'] = array();
$helps['homepage']['steps'] = array();
$helps['homepage']['steps'][] = array(
$return_tours['tours']['homepage'] = array();
$return_tours['tours']['homepage']['steps'] = array();
$return_tours['tours']['homepage']['steps'][] = array(
'element'=> '#clippy',
'intro' => __('Could I help you?<br/><br/>I am Pandorin, the annoying clippy for Pandora. You could follow my advices for to make common and basic tasks in Pandora.') .
'<div style="text-align: left;">'.
html_print_checkbox_extended
('clippy_is_annoying', 1, $clippy_is_annoying, false,
'set_clippy_annoying()', '', true) .
__('Please the clippy is annoying, I don\'t want see.') .
'</div>' .
'<div style="position:relative;">
<div id="pandorin" style="display: block; position: absolute; left: -100px; top: 20px;">' .
html_print_image('images/pandorin.png', true) .
'</div>
</div>'
);
$helps['homepage']['steps'][] = array(
$return_tours['tours']['homepage']['steps'][] = array(
'element'=> '#clippy',
'intro' => __('What task do you want to do?') . '<br/><br/>' .
'<ul style="text-align: left; margin-left: 3px; list-style-type: disc;">' .
'<li>' .
"<a href='javascript: clippy_go_link_show_help(\"index.php?sec=gagente&sec2=godmode/agentes/modificar_agente\", \"monitoring_server_step_1\");'>" .
//'<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&clippy=monitoring_server">' .
__('Monitoring a server Linux/Windows with a pandora agent') .
__('Ping to a server Linux/Windows with a pandora agent') .
'</a>' .
'</li>' .
'<li>' . __('Monitoring a switch with remote SNMP') . '</li>' .
'<li>' . __('Monitoring a Windows server with remote WMI ') . '</li>' .
'</ul>' .
'<div style="text-align: left;">'.
html_print_checkbox_extended
('clippy_is_annoying', 1, $clippy_is_annoying, false,
'set_clippy_annoying()', '', true) .
__('Please the clippy is annoying, I don\'t want see.') .
'</div>'
'<li>' . __('Monitoring a Windows server with remote WMI') . '</li>' .
'</ul>'
);
$helps['homepage']['conf'] = array();
$helps['homepage']['conf']['showBullets'] = 0;
$helps['homepage']['conf']['showStepNumbers'] = 0;
$helps['homepage']['conf']['name_obj_tour'] = 'intro_homepage';
$helps['homepage']['conf']['other_js'] = "
$return_tours['tours']['homepage']['conf'] = array();
$return_tours['tours']['homepage']['conf']['show_bullets'] = 0;
$return_tours['tours']['homepage']['conf']['show_step_numbers'] = 0;
$return_tours['tours']['homepage']['conf']['name_obj_js_tour'] = 'intro_homepage';
$return_tours['tours']['homepage']['conf']['other_js'] = "
var started = 0;
function show_clippy() {
intro_homepage.start();
if (intro_homepage.started()) {
started = 1;
}
else {
started = 0;
}
if (started == 0)
intro_homepage.start();
}
function set_clippy_annoying() {
@ -84,22 +97,22 @@ function clippy_start_page_homepage() {
}
";
if ($config['logged']) {
$helps['homepage']['conf']['autostart'] = true;
$return_tours['tours']['homepage']['conf']['autostart'] = true;
}
else {
$helps['homepage']['conf']['autostart'] = false;
$return_tours['tours']['homepage']['conf']['autostart'] = false;
}
if ($config["tutorial_mode"] == 'on_demand') {
$helps['homepage']['conf']['autostart'] = false;
$return_tours['tours']['homepage']['conf']['autostart'] = false;
}
if ($clippy_is_annoying === 1) {
$helps['homepage']['conf']['autostart'] = false;
$return_tours['tours']['homepage']['conf']['autostart'] = false;
}
//==================================================================
clippy_write_javascript_helps_steps($helps);
return $return_tours;
}
?>

View File

@ -20,15 +20,19 @@
*/
function clippy_module_unknow() {
$helps = array();
$return_tours = array();
$return_tours['first_step_by_default'] = true;
$return_tours['help_context'] = true;
$return_tours['tours'] = array();
//==================================================================
//Help tour about the monitoring with a ping (step 3)
//------------------------------------------------------------------
$helps['module_unknow'] = array();
$helps['module_unknow']['steps'] = array();
$helps['module_unknow']['steps'][] = array(
'element'=> '{clippy}', //The template to replace with the autogenerate id
$return_tours['tours']['module_unknow'] = array();
$return_tours['tours']['module_unknow']['steps'] = array();
$return_tours['tours']['module_unknow']['steps'][] = array(
'init_step_context' => true,
'intro' => '<table>' .
'<tr>' .
'<td class="context_help_title">' .
@ -43,13 +47,12 @@ function clippy_module_unknow() {
'</tr>' .
'</table>'
);
$helps['module_unknow']['conf'] = array();
$helps['module_unknow']['conf']['autostart'] = false;
$helps['module_unknow']['conf']['showBullets'] = 0;
$helps['module_unknow']['conf']['showStepNumbers'] = 0;
$helps['module_unknow']['conf']['name_obj_tour'] = '{clippy_obj}';
$return_tours['tours']['module_unknow']['conf'] = array();
$return_tours['tours']['module_unknow']['conf']['autostart'] = false;
$return_tours['tours']['module_unknow']['conf']['show_bullets'] = 0;
$return_tours['tours']['module_unknow']['conf']['show_step_numbers'] = 0;
//==================================================================
clippy_write_javascript_helps_steps($helps, true);
return $return_tours;
}
?>

View File

@ -57,7 +57,9 @@
/* Scroll to highlighted element? */
scrollToElement: true,
/* Set the overlay opacity */
overlayOpacity: 0.8
overlayOpacity: 0.8,
/* Set the flag of status of intro js*/
flag_started: false,
};
}
@ -372,7 +374,9 @@
} else if (document.detachEvent) { //IE
document.detachEvent('onkeydown', this._onKeyDown);
}
this._options['flag_started'] = false;
//set the step to zero
this._currentStep = undefined;
}
@ -980,6 +984,11 @@
return this;
},
start: function () {
this._options['flag_started'] = true;
if (this._introStartCallback != undefined)
this._introStartCallback.call(this);
_introForElement.call(this, this._targetElement);
return this;
},
@ -1034,6 +1043,14 @@
}
return this;
},
onstart: function(providedCallback) {
if (typeof (providedCallback) === 'function') {
this._introStartCallback = providedCallback;
} else {
throw new Error('Provided callback for onstart was not a function.');
}
return this;
},
onexit: function(providedCallback) {
if (typeof (providedCallback) === 'function') {
this._introExitCallback = providedCallback;
@ -1041,6 +1058,9 @@
throw new Error('Provided callback for onexit was not a function.');
}
return this;
},
started: function() {
return this._options['flag_started'];
}
};