Recent Posts

Pages: [1] 2 3 ... 10
1
HTML & templates / Re: Simple contact template
« Last post by bmartino1 on Today at 02:20:14 AM »
i was able to fix the blob content write to single file:

here is the xml code revision form above that fixes the blob with line

the code here was the fix, unknown why the /r or /g was reguried and or needed replaced:

Code: [Select]
FullDataString = FullDataString.replace(/([^\r])\n/g, "$1\r\n");
Fianly fixed the if then else statment to stop the wirte if validation fails...

i will not be working on this any more until Leos has his reveison.
*this is the extent of my time/knowledge and coding skill, atm...


working validation code with write xml
Code: [Select]
<!DOCTYPE html>
<html>
<head>
<meta charset=UTF-8 />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Contact Form using JavaScript</title>   
</head>


<!-- include css file here -->
<!--   <link rel="stylesheet" href="/Contact/form.css"/>   -->
<style type="text/css">
/* below line is write to use google font online  */
@import url(http://fonts.googleapis.com/css?family=Ubuntu);


* {
margin: 0;
padding: 0;
}

body {
font-size: 62.5%;
        font-family: 'Ubuntu', sans-serif;
}

p {
font-size: 1.3em;
margin-bottom: 15px;
}

#page-wrap {
width: 660px;
background: white;
padding: 20px 50px 20px 50px;
margin: 20px auto;
min-height: 300px;
height: auto !important;
height: 300px;
}

#contact-area {
width: 600px;
margin-top: 25px;
}

#contact-area input, #contact-area textarea {
padding: 5px;
width: 471px;
        font-family: 'Ubuntu', sans-serif;
font-size: 1.4em;
margin: 0px 0px 10px 0px;
border: 2px solid #CCC;
}

#contact-area textarea {
height: 90px;
}

#contact-area textarea:focus, #contact-area input:focus {
border: 2px solid #FC0;
}

#contact-area button.submit-button {
width: 100px;
height: 30px;
float: right;
cursor: default;
color: buttontext;
text-align: center;
padding: 2px 6px 3px;
box-sizing: border-box;
align-items: flex-start;
border: 0px outset buttonface;
-webkit-appearance: push-button;
        font-family: 'Ubuntu', sans-serif;
font-size: 1.4em;
white-space: pre;
}

label {
float: left;
text-align: right;
margin-right: 15px;
width: 100px;
padding-top: 5px;
font-size: 1.4em;
}

/* -------------------------------------
    CSS for sidebar (optional)
---------------------------------------- */
div#fugo{
float:right;
}
</style>

<body>

<div id="page-wrap">
<p><h1>&laquo; Contacting the Server Administrator &raquo;</h1></p>

<div id="contact-area">

<form method="GET">
<label for="contact-name">Full Name:</label>
<input type="text" tabindex="1" class="form-control" id="contact-name" name="name" placeholder="Please Enter Your Full Name.." onkeyup='validateName()'>
            <span class='error-message' id='name-error'></span>

<label for="contact-email">Email Address:</label>
            <input type="email" tabindex="2" class="form-control" id="contact-email" name="email" placeholder="Please Enter a valid Email (your@email.com) " onkeyup='validateEmail()'>
            <span class='error-message' id='email-error'></span>

<label for="contact-subject">Subject:</label><br />
            <input type="subject" tabindex="3" class="form-control" id="contact-subject" name="subject" placeholder="Ex: I Have Experienced an Error" onkeyup='validateSubject()'>
            <span class='error-message' id='subject-error'></span>

<label for='contactMessage'>Your Message:</label><br />
            <textarea class="form-control" rows="20" cols="20" id='contact-message' tabindex="4" name='message'  placeholder="Please Detail your needs - Enter a brief message" onkeyup='validateMessage()'></textarea>
            <span class='error-message' id='message-error'></span>
            <br />

<button id="SendMe" name="SubmitMessage" OnMouseOver='return validateForm()' class="submit-button" tabindex="5" >Submit</button>
<!-- buton onclick became OnMouseOver / a html embeded javascript function -->
<br />       
<span class='error-message' id='submit-error'></span>
</button>
</form>
</div>
</div>

<!-- include JavaScript file here -->
<!-- <script src="/Contact/form.js"></script> -->

<script type="text/javascript">
//Creates box and validate textbox content for a name
function validateName() {

  var name = document.getElementById('contact-name').value;

  if(name.length == 0) {

    producePrompt('Name is required', 'name-error' , 'red')
    return false;

  }

  if (!name.match(/^[A-Za-z]*\s{1}[A-Za-z]*$/)) {

    producePrompt('First and Last name, please.','name-error', 'red');
    return false;

  }

  producePrompt('Valid', 'name-error', 'green');
  return true;

}

//Creates box and validate textbox content for a Email Subject
function validateSubject() {

  var submessage = document.getElementById('contact-subject').value;
  var required = 2;
  var left = required - submessage.length;

  if (left > 0) {
    producePrompt(left + ' At least 2 characters are required for the Subject','subject-error','red');
    return false;
  }

  producePrompt('Valid', 'subject-error', 'green');
  return true;

}

//Creates box and validate textbox content for a valid Email

function validateEmail () {

  var email = document.getElementById('contact-email').value;

  if(email.length == 0) {

    producePrompt('Email Invalid','email-error', 'red');
    return false;

  }

  if(!email.match(/^[A-Za-z\._\-[0-9]*[@][A-Za-z]*[\.][a-z]{2,4}$/)) {

    producePrompt('Email Invalid', 'email-error', 'red');
    return false;

  }

  producePrompt('Valid', 'email-error', 'green');
  return true;

}

//Creates box and validate textbox content for Email Message - Text to save to file later?
function validateMessage() {
  var message = document.getElementById('contact-message').value;
  var required = 10;
  var left = required - message.length;

  if (left > 0) {
    producePrompt(left + ' more characters are required, Please Provide More deails for the server admin','message-error','red');
    return false;
  }

  producePrompt('Valid', 'message-error', 'green');
  return true;

}

//ON button click action:
//Checks form and contents pass validation (NOT working - atleast not displaying) - use later for alert measge sent

var booleanXCHECK = false;
//atempt to use a a check value, but can't get validate to change then write boolean works ...

function validateForm() {
    if (!validateName() || !validateSubject() || !validateEmail() || !validateMessage())
{
        jsShow('submit-error');
        producePrompt('Please fix errors to submit.', 'submit-error', 'red');
        setTimeout(function(){jsHide('submit-error');}, 5000);
        return false;

    }
else
{
//Change alert for message sent successfully
        //producePrompt('Sent Successfully', 'Submit-error', 'green');
        jsShow('submit-error');
        producePrompt('Mesage Passed Validation.', 'submit-error', 'green');
        setTimeout(function(){jsHide('submit-error');}, 2000);
        return booleanXCHECK = true;
return true;
    }
}

//??? Secondary Code for JS validation:
function jsShow(id) {
  document.getElementById(id).style.display = 'block';
}

function jsHide(id) {
  document.getElementById(id).style.display = 'none';
}

//Populate HTML Page
function producePrompt(message, promptLocation, color) {

  document.getElementById(promptLocation).innerHTML = message;
  document.getElementById(promptLocation).style.color = color;


}
</script>


<!-- How/What we save is added here -->

<!-- Rejeto HFS Macro Commands via LEO sends to hfs via text (XML) -->
<!-- Fix Permission to folder upload access (hfs macro)? -->
{.set item|%folder%|add upload=@anyone.}
<!-- @any account or @anyone, in the event they go here while loged in as a user....  writes either way-->

<script>
document.getElementById("SendMe").onclick = function () {

if (booleanXCHECK === true) {
//if statement (write xml file fail) as this code should just run after validation...

//alert("your check is :"+booleanXCHECK );
//check value in code -- fail - pass true, but writes either way

var Headers = '\n---------------------------\n';
var GetName = 'Name: '+document.getElementById("contact-name").value;
var GetMail = 'Email: '+document.getElementById("contact-email").value;
var GetSubject = 'Subject: '+document.getElementById("contact-subject").value;
var GetMessage = 'Message:\n\n'+document.getElementById("contact-message").value+'\n';

var FullDataString = Headers+'\n'+GetName+'\n'+GetMail+'\n'+GetSubject+'\n'+GetMessage+'\n'+Headers;
FullDataString = FullDataString.replace(/([^\r])\n/g, "$1\r\n");
//atempt to fix single line text saved to 1 single string???...


var content = FullDataString;
//content writes fine issues is with variable passed to blob in witch content loses the "/n" new lines...
//alert("your check is :"+content );
//check content before transfer to blob before data append...
//https://developers.google.com/web/updates/2012/06/Don-t-Build-Blobs-Construct-Them

var blob = new Blob([content], { type: "text/plain"});
var formData = new FormData();

// JavaScript file-like object
formData.append("webmasterfile", blob, "New-Message-{.time|yyyy.mm.dd'-at-'hh.nn.ss.}.txt");

var request = new XMLHttpRequest();
request.open("POST", "/contact"); 
//enable (PATH MUST BE CORRECT)
request.send(formData);

//disabled as it is now apart of the javascript
alert("Message sent!");
//can become the a message on the page instead of an alert box...
//jsShow('submit-error');
//producePrompt('Mesage SENT.', 'submit-error', 'green');
//setTimeout(function(){jsHide('submit-error');}, 2000);

}
}
</script>

</body>
</html>
2
HFS ~ HTTP File Server / Re: New version: 2.3m
« Last post by rejetto on August 18, 2018, 03:50:42 PM »
thanks for your help, Leo :)

I just had some vacations and could take care of a few things here. Also had to make a few sysadmin tasks for the website itself.
I'd like to make the default template mobile friendly, now, but i'm not sure the time left is enough.
3
HFS ~ HTTP File Server / Re: New version: 2.3m
« Last post by LeoNeeson on August 18, 2018, 09:58:24 AM »
Great!, we finally have the first stable version of 2018!... :)

Don't forget to upload the sources file (hfs2.3m.src.zip) in SourceForge.net (which is linked here, in the download section), or if it's easier for you, you can upload it directly, here on your server. The 'What's new' section needs also to be updated (since it's listing updates until version 2.3k) ;)

Cheers,
Leo.-
4
Bug reports / Re: HFS Documentation (English)
« Last post by rejetto on August 17, 2018, 12:08:27 PM »
sorry for letting you wait guys.
I fixed it.
thanks for the help!
5
Programmers corner / Re: HTTP Header Size Problem
« Last post by User21 on August 17, 2018, 10:18:46 AM »
New version 2.3m has been installed and

Code: [Select]
[+download]
{.remove header|ETag.}
{.remove header|Set-cookie.}

has beend added to hfs.events.

It works perfectly now. :D

Thanks a lot for this very fast fix.

Regards,
Lothar
7
HFS ~ HTTP File Server / New version: 2.3m
« Last post by rejetto on August 15, 2018, 05:27:36 PM »
what's new
Please go to:
Menu > updates > check for news/updates

what's new
+ initial localization support [link]
+ {.remove header.}
- fixed error pages' loading problem [link]
- fixed error with {.load.} with size exceeding real size http://rejetto.com/forum/index.php?topic=12059.msg1062781#msg1062781
- fixed template translation issues http://rejetto.com/forum/index.php?topic=11880.msg1062167#msg106216
8
HFS ~ HTTP File Server / Re: New version: 2.3k
« Last post by rejetto on August 15, 2018, 04:39:26 PM »
9
HFS ~ HTTP File Server / Re: moving to another pc
« Last post by rejetto on August 15, 2018, 04:38:13 PM »
In order to get this working you need to "Edit resource" and point to the directory where the file is located. The Folder icons are OK, but the files placed in those folders must be edited :(

your main problem is that you used a VIRTUAL folder when probably you needed a REAL folder.
10
HFS ~ HTTP File Server / Re: Unlimited Speed Hang
« Last post by rejetto on August 15, 2018, 04:34:45 PM »
Any progress on this topic? I am currently running with a rate limited wget command "wget -r -nH -l1 --no-verbose --no-parent --limit-rate=8000k" to avoid the hang. Using FileZilla I get much better performance without the hang but using HFS would be my preference.

did you update wget as suggested in my last post?
Pages: [1] 2 3 ... 10