From ee21730590f41a3879eea4f62f869d766c8c689c Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Tue, 2 Dec 2014 17:15:13 +0000 Subject: [PATCH] --- fluidbook/compile/_js/esapi.js | 6 ++-- fluidbook/compile/_js/fluidbook.js | 35 ++-------------------- inc/ws/Metier/class.ws.book.parametres.php | 5 +++- 3 files changed, 11 insertions(+), 35 deletions(-) diff --git a/fluidbook/compile/_js/esapi.js b/fluidbook/compile/_js/esapi.js index 82e0ffcde..95846c82e 100644 --- a/fluidbook/compile/_js/esapi.js +++ b/fluidbook/compile/_js/esapi.js @@ -558,12 +558,14 @@ org.owasp.esapi.HTTPUtilities = function () { getRequestParameter: function (sName) { var url = window.top.location.search.substring(1); var pIndex = url.indexOf(sName); - if (pIndex < 0) + if (pIndex < 0) { return null; + } pIndex = pIndex + sName.length; var lastIndex = url.indexOf("&", pIndex); - if (lastIndex < 0) + if (lastIndex < 0) { lastIndex = url.length; + } return unescape(url.substring(pIndex, lastIndex)); } }; diff --git a/fluidbook/compile/_js/fluidbook.js b/fluidbook/compile/_js/fluidbook.js index 1ad41eb2e..e1c72a2f1 100644 --- a/fluidbook/compile/_js/fluidbook.js +++ b/fluidbook/compile/_js/fluidbook.js @@ -54,7 +54,9 @@ function parseGet(res) { var couple = new Array(); for (var i = 0; i < couples.length; i++) { couple = couples[i].split('='); - res[couple[0]] = trim($ESAPI.httpUtilities().getRequestParameter(couple[0]), "="); + //res[couple[0]] = trim($ESAPI.httpUtilities().getRequestParameter(couple[0]), "="); + //res[couple[0]] = $ESAPI.httpUtilities().getRequestParameter(couple[0]); + res[couple[0]] = unescape(couple[1]); } return res; } @@ -112,22 +114,6 @@ function getCookie(nom) { var res = $ESAPI.httpUtilities().getCookie(nom); return res.getValue(); - - /*var arg = nom + "="; - var alen = arg.length; - var clen = document.cookie.length; - var i = 0; - while (i < clen) { - var j = i + alen; - if (document.cookie.substring(i, j) == arg) { - return getCookieVal(j); - } - i = document.cookie.indexOf(" ", i) + 1; - if (i == 0) { - break; - } - } - return null;*/ } function setCookie(nom, valeur) { @@ -137,21 +123,6 @@ function setCookie(nom, valeur) cookie.setSecure(window.top.location.protocol === 'https:'); return $ESAPI.httpUtilities().addCookie(cookie); - - /*date = new Date; - date.setFullYear(date.getFullYear() + 10); - - var argv = setCookie.arguments; - var argc = setCookie.arguments.length; - var expires = (argc > 2) ? argv[2] : date; - var path = (argc > 3) ? argv[3] : '/'; - var domain = (argc > 4) ? argv[4] : null; - var secure = (argc > 5) ? argv[5] : false; - document.cookie = nom + "=" + escape(valeur) + - ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + - ((path == null) ? "" : ("; path=/")) + - ((domain == null) ? "" : ("; domain=" + domain)) + - ((secure == true) ? "; secure" : "");*/ } function addThis(x) { addthis_offset_left = parseFloat(x); diff --git a/inc/ws/Metier/class.ws.book.parametres.php b/inc/ws/Metier/class.ws.book.parametres.php index c333be530..07378f070 100644 --- a/inc/ws/Metier/class.ws.book.parametres.php +++ b/inc/ws/Metier/class.ws.book.parametres.php @@ -166,8 +166,11 @@ class wsBookParametres extends wsParametres { $this->fields['soundOn'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __("Activer les effets sonores à l'ouverture")); $this->fields['ambientSound'] = array('type' => 'freefile', 'default' => '', 'editable' => true, 'label' => __('Ambiance sonore'), 'grade' => 3, 'fileFilter' => $soundFilter); + $this->fields['ambientSoundVolume'] = array('type' => 'integer', 'default' => 50, 'editable' => true, + 'label' => __("Volume de l'ambiance sonore"), + 'min' => 0, 'max' => 100); $this->forms['sound'] = array('label' => __('Effets sonores'), - 'fieldsnames' => array('soundTheme', 'soundOn', 'ambientSound')); + 'fieldsnames' => array('soundTheme', 'soundOn', '|', 'ambientSound', 'ambientSoundVolume')); // . $this->fields['pdf'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __("Activer les fonctions de téléchargement")); $this->fields['pdfName'] = array('type' => 'text', 'default' => 'document.pdf', 'editable' => true, 'label' => __("Nom du fichier PDF")); -- 2.39.5