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

* include/functions_clippy.php: changed to modal version.
	
	* include/javascript/intro.js: added feature to avoid the exit, and
	the pull request to original repository is solicited too
	(https://github.com/usablica/intro.js/pull/311).




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10405 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2014-08-12 10:20:53 +00:00
parent 761a9b3924
commit 5d032c72fc
3 changed files with 32 additions and 14 deletions

View File

@ -1,3 +1,11 @@
2014-08-12 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_clippy.php: changed to modal version.
* include/javascript/intro.js: added feature to avoid the exit, and
the pull request to original repository is solicited too
(https://github.com/usablica/intro.js/pull/311).
2014-08-12 Miguel de Dios <miguel.dedios@artica.es>
* general/header.php, godmode/setup/setup_general.php,

View File

@ -105,12 +105,8 @@ function clippy_write_javascript_helps_steps($helps) {
exitOnEsc: true, //false,
})
.onexit(function(value) {
console.log("onexit");
return false;
})
.oncomplete(function(value) {
console.log("oncomplete");
exit = confirm("<?php echo __("Do you want to exit the help tour?"); ?>");
return exit;
});
<?php

View File

@ -184,12 +184,19 @@
self._onKeyDown = function(e) {
if (e.keyCode === 27 && self._options.exitOnEsc == true) {
//escape key pressed, exit the intro
_exitIntro.call(self, targetElm);
propagate_exit = true;
//check if any callback is defined
if (self._introExitCallback != undefined) {
self._introExitCallback.call(self);
propagate_exit = self._introExitCallback.call(self);
if (typeof(propagate_exit) == "undefined")
propagate_exit = true;
}
//escape key pressed, exit the intro
if (propagate_exit)
_exitIntro.call(self, targetElm);
} else if(e.keyCode === 37) {
//left arrow
_previousStep.call(self);
@ -676,15 +683,22 @@
skipTooltipButton.innerHTML = this._options.skipLabel;
skipTooltipButton.onclick = function() {
propagate_exit = true;
if (self._introItems.length - 1 == self._currentStep && typeof (self._introCompleteCallback) === 'function') {
self._introCompleteCallback.call(self);
propagate_exit = self._introCompleteCallback.call(self);
if (typeof(propagate_exit) == "undefined")
propagate_exit = true;
}
if (self._introItems.length - 1 != self._currentStep && typeof (self._introExitCallback) === 'function') {
self._introExitCallback.call(self);
propagate_exit = self._introExitCallback.call(self);
if (typeof(propagate_exit) == "undefined")
propagate_exit = true;
}
_exitIntro.call(self, self._targetElement);
if (propagate_exit)
_exitIntro.call(self, self._targetElement);
};
buttonsLayer.appendChild(skipTooltipButton);