Change the layout to two columns; Parameters and document view.
This commit is contained in:
@@ -4,6 +4,7 @@ include_once "config.php";
|
|||||||
include_once "utils.php";
|
include_once "utils.php";
|
||||||
include_once "ui.php";
|
include_once "ui.php";
|
||||||
|
|
||||||
|
|
||||||
$Commands=array();
|
$Commands=array();
|
||||||
|
|
||||||
function ExecCommand($command){
|
function ExecCommand($command){
|
||||||
@@ -136,16 +137,27 @@ function CropImage($file){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function RenderDocument($filePath){
|
||||||
|
$filename=pathinfo($filePath)["basename"];
|
||||||
|
$filePathFixed=htmlentities($filePath,ENT_HTML5, "UTF-8");
|
||||||
|
$filenameFixed=htmlentities($filename,ENT_HTML5, "UTF-8");
|
||||||
|
$render="";
|
||||||
|
$render.='<div><a href="'.$filePathFixed.'" class="button" download="'.$filenameFixed.'">'.
|
||||||
|
'Download</a></div>'."\n";
|
||||||
|
$render.='<iframe src="'.$filePathFixed.'" '.
|
||||||
|
'class="previewDoc" ></iframe>';
|
||||||
|
return $render;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Detect scanner
|
// Detect scanner
|
||||||
$Scanner=array();
|
$Scanner=array();
|
||||||
$Scanner["ScanDevice"]=RequestParm("hidScanDevice","");
|
$Scanner["ScanDevice"]=RequestParm("hidScanDevice","");
|
||||||
$Scanner["ScanModel"]=RequestParm("hidScanDevice","");
|
$Scanner["ScanModel"]=RequestParm("hidScanModel","");
|
||||||
if($Scanner["ScanDevice"]=="" || $Scanner["ScanModel"]==""){
|
if($Scanner["ScanDevice"]=="" || $Scanner["ScanModel"]==""){
|
||||||
$Scanner=ScannerDetect();
|
$Scanner=ScannerDetect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Configure with formdata
|
// Configure with formdata
|
||||||
$Resolution=RequestParm("ddlResolution",$Resolution);
|
$Resolution=RequestParm("ddlResolution",$Resolution);
|
||||||
$Format=RequestParm("ddlFormat",$Format);
|
$Format=RequestParm("ddlFormat",$Format);
|
||||||
@@ -165,31 +177,24 @@ if(RequestParm("btnScan",false)){
|
|||||||
MoveToDest($DestFile);
|
MoveToDest($DestFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Render Form
|
||||||
echo '<form id="frmMain" method="POST" action="'.$_SERVER['PHP_SELF'].'">'."\n";
|
$formFields="";
|
||||||
|
$formFields.=RenderFieldInfo("Scanner",$Scanner["ScanModel"]);
|
||||||
// Render header info
|
$formFields.=RenderFieldCombo("Resolution","ddlResolution",$Resolutions,$Resolution);
|
||||||
echo RenderFieldInfo("Scanner",$Scanner["ScanModel"]);
|
$formFields.=RenderFieldCombo("Format","ddlFormat",$Formats,$Format);
|
||||||
echo RenderFieldCombo("Resolution","ddlResolution",$Resolutions,$Resolution);
|
$formFields.=RenderFieldCombo("Size","ddlSize",$Sizes,$Size);
|
||||||
echo RenderFieldCombo("Format","ddlFormat",$Formats,$Format);
|
$formFields.=RenderFieldCheckText("Cropping","chkCrop",$Crop,"txtCropFuzz",$CropFuzz);
|
||||||
echo RenderFieldCombo("Size","ddlSize",$Sizes,$Size);
|
$formFields.=RenderFieldButton("","btnScan","Scan");
|
||||||
echo RenderFieldCheckText("Cropping","chkCrop",$Crop,"txtCropFuzz",$CropFuzz);
|
$formFields.=RenderHidden("hidScanDevice",$Scanner["ScanDevice"]);
|
||||||
echo RenderFieldButton("","btnScan","Scan");
|
$formFields.=RenderHidden("hidScanModel",$Scanner["ScanModel"]);
|
||||||
echo RenderHidden("hidScanDevice",$Scanner["ScanDevice"]);
|
$columns="";
|
||||||
echo RenderHidden("hidScanModel",$Scanner["ScanModel"]);
|
$columns.=renderDiv("divColLeft",$formFields);
|
||||||
|
$result="";
|
||||||
if($DestFile!=null){
|
if($DestFile!=null){
|
||||||
$DestFilenane=pathinfo($DestFile)["basename"];
|
$result.=RenderDocument($DestFile);
|
||||||
$DestFileFixed=htmlentities($DestFilenane,ENT_HTML5, "UTF-8");
|
|
||||||
$DestPathFixed=htmlentities($DestFile,ENT_HTML5, "UTF-8");
|
|
||||||
echo '<div><a href="'.$DestPathFixed.'" class="button" download="'.$DestFileFixed.'">'.
|
|
||||||
'Download</a></div>'."\n";
|
|
||||||
echo '<iframe src="'.$DestPathFixed.'" '.
|
|
||||||
'class="previewDoc" ></iframe>';
|
|
||||||
}
|
}
|
||||||
|
$columns.=renderDiv("divColRight",$result);
|
||||||
echo RenderCommandLog();
|
$columns.=RenderCommandLog();
|
||||||
|
echo RenderForm("frmMain",$columns);
|
||||||
echo "</form>\n";
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
43
style.css
43
style.css
@@ -1,9 +1,12 @@
|
|||||||
* {margin:0;padding:0;border:none;font-family:Arial,sans-serif; color:rgb(32,32,32);background-color: #E9F0F0; box-sizing:border-box; -moz-box-sizing:border-box;}
|
* {margin:0;padding:0;border:none;font-family:Arial,sans-serif; color:rgb(32,32,32);background-color: #E9F0F0; box-sizing:border-box; -moz-box-sizing:border-box;}
|
||||||
|
|
||||||
|
html{height: 100%;}
|
||||||
|
body{height:100%;}
|
||||||
|
|
||||||
h1{
|
h1{
|
||||||
font-size: 40px;
|
font-size: 40px;
|
||||||
color: rgb(128,128,128);
|
color: rgb(128,128,128);
|
||||||
margin:15px;
|
padding:15px;
|
||||||
}
|
}
|
||||||
.field{
|
.field{
|
||||||
display:block;
|
display:block;
|
||||||
@@ -14,7 +17,7 @@ h1{
|
|||||||
}
|
}
|
||||||
.fieldLabel{
|
.fieldLabel{
|
||||||
display:inline-block;
|
display:inline-block;
|
||||||
width:20%;
|
width:40%;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
vertical-align:top;
|
vertical-align:top;
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
@@ -23,7 +26,7 @@ h1{
|
|||||||
}
|
}
|
||||||
.fieldContent{
|
.fieldContent{
|
||||||
display:inline-block;
|
display:inline-block;
|
||||||
width:80%;
|
width:60%;
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
vertical-align:top;
|
vertical-align:top;
|
||||||
word-break: break-word;
|
word-break: break-word;
|
||||||
@@ -57,13 +60,6 @@ h1{
|
|||||||
background-color: white;
|
background-color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.previewImage{
|
|
||||||
margin:5px;
|
|
||||||
border: solid 1px rgb(32,32,32);
|
|
||||||
max-width:200px;
|
|
||||||
max-height:200px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#divConsoleContainer{
|
#divConsoleContainer{
|
||||||
margin:5px;
|
margin:5px;
|
||||||
}
|
}
|
||||||
@@ -90,6 +86,29 @@ h1{
|
|||||||
color: red;
|
color: red;
|
||||||
}
|
}
|
||||||
|
|
||||||
.divHidden{
|
form{
|
||||||
display: none;
|
white-space: nowrap;
|
||||||
|
height: calc(100% - 120px);
|
||||||
|
}
|
||||||
|
|
||||||
|
#divColLeft{
|
||||||
|
box-sizing: border-box;
|
||||||
|
display: inline-block;
|
||||||
|
width:40%;
|
||||||
|
vertical-align:top;
|
||||||
|
}
|
||||||
|
|
||||||
|
#divColRight{
|
||||||
|
box-sizing: border-box;
|
||||||
|
display: inline-block;
|
||||||
|
width:59%;
|
||||||
|
height: 100%;
|
||||||
|
padding: 15px;
|
||||||
|
vertical-align:top;
|
||||||
|
}
|
||||||
|
#divColRight .previewDoc{
|
||||||
|
box-sizing: border-box;
|
||||||
|
width:100%;
|
||||||
|
height: calc(100% - 35px);
|
||||||
|
border: solid 1px rgb(32,32,32);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user