[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 153/173: Improve scenario test
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 153/173: Improve scenario test |
Date: |
Mon, 22 Mar 2021 12:59:18 -0400 (EDT) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit 2ce39d8d7fc176579a99f1e07f7aef117f036feb
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Wed Mar 10 15:08:50 2021 +0100
Improve scenario test
---
html/test.php | 6 +++---
include/lib/icon_action.class.php | 17 +++++++++--------
include/lib/input_checkbox.class.php | 5 +++--
scenario/HtmlInput.test.php | 14 ++++++++++----
4 files changed, 25 insertions(+), 17 deletions(-)
diff --git a/html/test.php b/html/test.php
index d8b890a..bdd2ef9 100644
--- a/html/test.php
+++ b/html/test.php
@@ -38,12 +38,12 @@ require_once('lib/icon_action.class.php');
require_once ('lib/function_javascript.php');
require_once 'class/user.class.php';
require_once NOALYSS_INCLUDE.'/lib/http_input.class.php';
-
+html_page_start();
global $http;
$http=new HttpInput();
-load_all_script();
+
$gDossier=$http->request('gDossier',"number", -1);
if ($gDossier==-1)
{
@@ -64,7 +64,7 @@ if (!file_exists('authorized_debug'))
exit();
}
define('ALLOWED', 1);
-html_page_start("Classic");
+load_all_script();
/******************************************************************************************************************/
/* Utilities
/******************************************************************************************************************/
diff --git a/include/lib/icon_action.class.php
b/include/lib/icon_action.class.php
index e983712..a1dab59 100644
--- a/include/lib/icon_action.class.php
+++ b/include/lib/icon_action.class.php
@@ -368,27 +368,28 @@ class Icon_Action
if ( $p_value == 0 ) { return \Icon_Action::iconoff($p_id,
$p_javascript,$p_style);}
}
- static function checked ($p_id,$p_javascript="") {
+ static function checked ($p_id,$p_javascript="",$p_classrange="") {
$lock_cur="";
-
- $r=sprintf( '<span id="%s" onclick="%s" class="icon
smallicon">%s</span>',
+ $r=sprintf( '<span id="%s" onclick="%s" class="icon smallicon %s"
>%s</span>',
$p_id,
$p_javascript,
+ $p_classrange,
$lock_cur);
return $r;
}
- static function unchecked ($p_id,$p_javascript="") {
+ static function unchecked ($p_id,$p_javascript="",$p_classrange="") {
$lock_cur="";
- $r=sprintf( '<span id="%s" onclick="%s" class="icon smallicon"
>%s</span>',
+ $r=sprintf( '<span id="%s" onclick="%s" class="icon smallicon %s"
>%s</span>',
$p_id,
$p_javascript,
+ $p_classrange,
$lock_cur);
return $r;
}
- static function checkbox ($p_id,$p_javascript="",$p_value=0) {
- if ( $p_value == 0 ) { return \Icon_Action::checked($p_id,
$p_javascript); }
- if ( $p_value == 1 ) { return \Icon_Action::unchecked($p_id,
$p_javascript);}
+ static function checkbox
($p_id,$p_javascript="",$p_value=0,$p_classrange="") {
+ if ( $p_value == 0 ) { return \Icon_Action::checked($p_id,
$p_javascript,$p_classrange); }
+ if ( $p_value == 1 ) { return \Icon_Action::unchecked($p_id,
$p_javascript,$p_classrange);}
}
static function full_size($p_div) {
$js=sprintf("full_size('%s')",$p_div);
diff --git a/include/lib/input_checkbox.class.php
b/include/lib/input_checkbox.class.php
index a81ac57..a6d6793 100644
--- a/include/lib/input_checkbox.class.php
+++ b/include/lib/input_checkbox.class.php
@@ -50,6 +50,7 @@ class InputCheckBox extends HtmlInput
$this->id_hidden=$p_id;
$this->id_icon=uniqid($p_id);
$this->javascript="";
+ $this->classrange="";
}
function input($p_name=NULL, $p_value=0)
@@ -75,9 +76,9 @@ class InputCheckBox extends HtmlInput
$this->javascript);
if ($this->value=='1') {
- $r.=Icon_Action::checked($this->id_icon,$this->javascript);
+
$r.=Icon_Action::checked($this->id_icon,$this->javascript,$this->classrange);
} else {
- $r.=Icon_Action::unchecked($this->id_icon,$this->javascript);
+
$r.=Icon_Action::unchecked($this->id_icon,$this->javascript,$this->classrange);
}
return $r;
}
diff --git a/scenario/HtmlInput.test.php b/scenario/HtmlInput.test.php
index 54675cb..0a0c1e0 100644
--- a/scenario/HtmlInput.test.php
+++ b/scenario/HtmlInput.test.php
@@ -92,12 +92,15 @@ $http=new HttpInput();
for ($i = 0 ; $i < 10 ; $i ++) :
echo '<li>';
$check[$i]=new InputCheckBox("check[]",1,"checkid".$i);
+ $check[$i]->classrange="improvechkbox";
echo $i, " - name = ",$check[$i]->value_container,",id = " ,
$check[$i]->id_icon,$check[$i]->input();
+
echo '</li>';
endfor;
?>
</ul>
-
+ <aside>les selections par plage ne fonctionnent pas encore avec les
CHECKBOX améliorés</aside>
+ <script> activate_checkbox_range("improvechkbox")</script>
<h1>Submit</h1>
<pre>
echo HtmlInput::submit("submit", _("Envoi"));
@@ -129,7 +132,7 @@ $http=new HttpInput();
Fichier - IFile
</h2>
<form method="POST" enctype="application/x-www-form-urlencoded"
onsubmit="check_size();return false;">
-
+ <span id="file-info"></span>
<?php
$file=new IFILE("file_to_upload");
@@ -147,10 +150,13 @@ $http=new HttpInput();
var aFile=document.getElementsByTagName("input");
console.debug("afile");
console.debug(aFile);
-
+ var info=document.getElementById("file-info");
for (var i = 0;i < aFile.length;i++) {
- if ( aFile[i].getAttribute("type")=="file" ) {
+ if ( aFile[i].getAttribute("type")==="file" ) {
+
console.debug("file"+aFile[i].files[0].size);
+ info.innerHTML+="file :
"+aFile[i].files[0].name+":"+aFile[i].files[0].size+" bytes <br>";
+
}
}
- [Noalyss-commit] [noalyss] 149/173: Merge branch 'enterprise' into entreprise, (continued)
- [Noalyss-commit] [noalyss] 149/173: Merge branch 'enterprise' into entreprise, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 155/173: Merge branch 'master' into dev-8-bootstrap, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 156/173: rel8100 Merge branch 'master' into entreprise, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 157/173: Merge branch 'dev-8-bug-saldo-not-checked', Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 161/173: Move CSS and start to integrate BootStrap, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 163/173: Move CSS and start to integrate BootStrap Add fonts, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 165/173: Currency : adapt test, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 166/173: BootStrap : set up + move CSS and font to their own folders, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 167/173: Task 0001912: Developpement DEBUG new system with level, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 168/173: Task #1911: FOLLOW : télécharger toutes les documents en une fois, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 153/173: Improve scenario test,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 158/173: Merge branch 'dev8001', Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 172/173: Erreur : fiche_attr , first param is a DatabaseCore object, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 173/173: if a document cannot be generate, a error message is displaid and the whole operation is not cancelled, Dany De Bontridder, 2021/03/22