javascript : test and improve cosmetic

This commit is contained in:
sparkyx 2021-04-23 21:58:28 +02:00
parent 58cc7c7c04
commit d6435fcacb
4 changed files with 112 additions and 23 deletions

View file

@ -2075,7 +2075,7 @@ td.box {
z-index:3;
position:absolute;
left:10%;
border:1px solid #00008B;
/* border:1px solid #00008B;*/
-moz-box-shadow: 10px 10px 5px #888;
-webkit-box-shadow: 10px 10px 5px #888;
box-shadow: 10px 10px 5px #888;
@ -2085,30 +2085,51 @@ width: 85%;
color:beige;
font-weight: bold;
}
.dialog-title {
background: lightgray;
padding: 5px;
color: black;
font-weight:700;
font-size:110%;
border: 1px edge blue;
border-bottom: outset 1px darkgray;
color:#665757;
}
.dialog-buttons button {
color:#FFFFFF;
color:darkblue;
font-weight: normal;
text-decoration:none;
background: #606c88; /* Old browsers */
background: -moz-linear-gradient(top, #606c88 0%, #3f4c6b 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#606c88), color-stop(100%,#3f4c6b)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #606c88 0%,#3f4c6b 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #606c88 0%,#3f4c6b 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #606c88 0%,#3f4c6b 100%); /* IE10+ */
background: linear-gradient(to bottom, #606c88 0%,#3f4c6b 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#606c88', endColorstr='#3f4c6b',GradientType=0 ); /* IE6-9 */
border-color: #605D5D;
border-width:0px;
padding:4px;
margin:3px;
font-family: arial,verdana,sans-serif,helvetica;
/*! background-image: url("font/bg-submit2.gif"); */
/*! background-repeat: repeat-x; */
/*! background-position: left; */
font-size:12px;
font-size:0.85rem;
font-family: SansationLight;
border-style: ridge ;
border-color: grey ;
border-width:1px;
padding-bottom: 5px;
padding-top: 5px;
padding-right: 5px;
padding-left: 5px;
margin-top:3px;
cursor:pointer;
margin:1px 2px 1px 2px;
border-radius: 5px;
-moz-border-radius:5px;
width:7em;
width:7rem;
font-family: SansationLight;
background: lightgray;
background: -moz-linear-gradient(top, #ffffff 0%, #f1f1f1 50%, #e1e1e1 51%, #f6f6f6 100%);
background: -webkit-linear-gradient(top, #ffffff 0%,#f1f1f1 50%,#e1e1e1 51%,#f6f6f6 100%);
background: linear-gradient(to bottom, #ffffff 0%,#f1f1f1 50%,#e1e1e1 51%,#f6f6f6 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#f6f6f6',GradientType=0 );
min-width:5rem !important;
border-radius:5px;
}
.dialog-buttons button:hover {
color:navy;
background-color:darkgrey;
}
.dialog-prompt input {
margin: 0;
border: 0;
@ -2869,4 +2890,4 @@ span.tagcell {
#facturation_div_id {
margin-top:2rem;
}
}

View file

@ -54,6 +54,7 @@
cancel = 'Cancel',
classname = '',
buttons = '',
sTitle = '',
box;
if (f.type === 'prompt') {
@ -62,7 +63,12 @@
'<input id="dialog-input-' + f.newid + '" type="text" ' + (f.params.value ? 'value="' + f.params.value + '"' : '') + ' />' +
'</div>';
}
/**
* Add a title
*/
if ( f.params.title) {
sTitle='<div class="dialog-title">'+f.params.title+'</div>';
}
if (f.params.ok) {
ok = f.params.ok;
}
@ -119,6 +125,7 @@
box =
'<div id="smoke-bg-' + f.newid + '" class="smokebg"></div>' +
'<div class="dialog smoke ' + classname + '">' +
sTitle +
'<div class="dialog-inner">' +
e +
prompt +
@ -425,7 +432,6 @@
if (g.duration !== 'undefined') {
duration = g.duration;
}
var id = smoke.newdialog();
smoke.build(e, {
type: 'signal',

View file

@ -26,7 +26,7 @@ require_once NOALYSS_INCLUDE.'/class/pdf.class.php';
class PDFLand extends PDF
{
public function __construct ($p_cn = null, $orientation = 'P', $unit = 'mm', $format = 'A4')
public function __construct ($p_cn = null, $orientation = 'L', $unit = 'mm', $format = 'A4')
{
if($p_cn == null) die("No database connection. Abort.");

62
scenario/smoke.php Normal file
View file

@ -0,0 +1,62 @@
<?php
//@description: test smoke javascript for managing dialog box
?>
<h1> smoke alert</h1>
<pre>
smoke.alert('alert',func_callback,{title:"Titre"});
</pre>
<script>
function func_callback() {
alert("Function called");
}
function smoke_alert()
{
smoke.alert('alert',func_callback,{title:"Titre"});
}
</script>
<button onclick="smoke_alert()">smoke_alert</button>
<h1> smoke confirm</h1>
<pre>
smoke.confirm('Confirmez-vous',function(ev) { if (ev) { alert("confirmé");},{title:"Titre"});
</pre>
<script>
function smoke_confirm()
{
smoke.confirm('Confirmez-vous',function(ev) { if (ev) { alert("confirmé");}},{title:"Titre"});
}
</script>
<button onclick="smoke_confirm()">smoke_confirm</button>
<h1> smoke prompt</h1>
<pre>
function func_callback_prompt(ev)
{
if (ev) { alert ("accepted "+ev);}
console.debug(ev);
return true;
}
smoke.prompt('Confirmez-vous',func_callback_prompt,{title:"Titre"});
</pre>
<script>
function func_callback_prompt(ev)
{
if (ev) { alert ("accepted "+ev);}
console.debug(ev);
return true;
}
function smoke_prompt()
{
smoke.prompt('Donnez un élement',func_callback_prompt,{title:"Titre"});
}
</script>
<button onclick="smoke_prompt()">smoke_prompt</button>