1
0
mirror of https://github.com/lxsang/antd-web-apps synced 2024-11-20 02:18:20 +01:00

minor fix

This commit is contained in:
Xuan Sang LE 2018-02-22 19:15:03 +01:00
parent 5bc9780877
commit 4fa07bf89c
6 changed files with 44 additions and 27 deletions

View File

@ -198,7 +198,7 @@ button{
margin-right: 10px;
box-shadow: 1px 1px 1px #9f9F9F;
}
#status{
div[data-id="status"]{
padding-left: 10px;
padding-top:5px;
color:#724841;

View File

@ -19,8 +19,8 @@
<textarea data-class = "data" name = "content"></textarea>
<div data-height="5"></div>
<afx-hbox data-height="30">
<div id="status"></div>
<button id = "send" data-width = "60" >Send</button>
<div data-id="status"></div>
<button data-id = "send" data-width = "60" >Send</button>
</afx-hbox>
<div data-height="5"></div>
</afx-vbox>

View File

@ -27,6 +27,7 @@
<script src="grs/gscripts/riot.compiler.min.js"> </script>
<script>
var scheme = undefined;
var obs = undefined;
function mailtoMe()
{
if(scheme) return;
@ -34,26 +35,30 @@
$.get( "grs/sendto.html")
.done(function(d) {
scheme = $.parseHTML(d)
var observable = riot.observable()
obs = riot.observable()
$("#desktop").append(scheme)
riot.mount($(scheme), {observable:observable})
observable.on("exit", function(){
scheme = scheme[0]
obs.on("exit", function(){
obs.off("rendered")
obs.off("exit")
obs = undefined;
$(scheme).remove()
scheme = undefined
})
observable.on("rendered", function(){
$("#send").click(function(){
$("#status").html("");
var els = $("[data-class='data']")
obs.on("rendered", function(d){
$("[data-id='send']", scheme).click(function(){
var status = $("[data-id='status']", scheme)
status.html("");
var els = $("[data-class='data']", scheme)
var data = {}
for(var i = 0; i < els.length; i++)
data[els[i].name] = $(els[i]).val()
if(data.email == "" || data.subject == "" || data.content == "" || data.name == "")
return $("#status").html("Please enter all the fields");
return status.html("Please enter all the fields");
var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
if(!re.test(String(data.email).toLowerCase()))
return $("#status").html("Email is not correct");
return status.html("Email is not correct");
$.ajax({
type: 'POST',
@ -67,14 +72,15 @@
alert(r.error)
else
{
observable.trigger("exit")
alert("Thank")
obs.trigger("exit")
alert("Email sent. Thank")
}
}).fail(function(){
alert("Service unavailable at the moment")
})
})
})
riot.mount(scheme, {observable:obs})
})
.fail(function() {
alert( "Cannot get the form" );

View File

@ -25,6 +25,7 @@
<head>
<!--script type="text/javascript" src="../os/scripts/jquery-3.2.1.min.js"></script-->
<script type="text/javascript" src="rst/showdown.min.js"></script>
<link rel="stylesheet" type="text/css" href="grs/ubuntu-regular.css" />
<link rel="stylesheet" type="text/css" href="style.css" />
<link rel="stylesheet" type="text/css" href="rst/font-awesome.css" />
<title>Porfolio</title>

View File

@ -6,7 +6,7 @@ local rq = (JSON.decodeString(REQUEST.query.json))
local to = "xsang.le@gmail.com"
local from = "From: "..rq.email.."\n"
local suject = "Subject: "..rq.subject.."\n"
local content = "Contact request from:"..rq.name.."\n Email:"..rq.email.."\n"..rq.content.."\n"
local content = "Contact request from:"..rq.name.."\n Email: "..rq.email.."\n"..rq.content.."\n"
local cmd = 'echo "'..utils.escape(from..suject..content)..'"| sendmail '..to

View File

@ -1,28 +1,28 @@
@font-face {
font-family: 'FuturaBold';
font-family: 'Futura';
src: url('rst/fonts/FuturaNewDemi.woff') format('woff');
font-weight: normal;
font-weight: bold;
font-style: normal;
}
@font-face {
font-family: 'FuturaNormal';
font-family: 'Futura';
src: url('rst/fonts/FuturaNewLight.woff') format('woff');
font-weight: normal;
font-style: normal;
}
/** Generated by FG **/
@font-face {
font-family: 'FuturaItalic';
font-family: 'Futura';
src: url('rst/fonts/FuturaNewLightOblique.woff') format('woff');
font-weight: normal;
font-style: normal;
font-style: italic;
}
.layout{
width:800px;
font-family: "FuturaNormal";
font-family: "Futura";
text-align: justify;
margin:0 auto;
display: flex;
@ -33,7 +33,7 @@ h1 {
font-size: 25px;
text-align: center;
margin-top: 20px;
font-family: "FuturaBold";
font-weight: bold;
}
h1 .name{
color:#3170B2;
@ -88,9 +88,12 @@ h1 .cv{
color:#3170B2;
border-bottom: 1px solid #3170B2;
}
a{
text-decoration: none;
color:#3170B2;
}
.sub-container h2
{
color:#3170B2;
font-size:18px;
color:#3170B2;
border-bottom: 1px dotted #3170B2;
@ -99,7 +102,7 @@ h1 .cv{
margin-bottom: 10px;
}
.entry .title{
font-family: "FuturaBold";
font-weight: bold;
}
.entry p .title .fa{
color:#878887;
@ -113,11 +116,11 @@ h1 .cv{
}
.entry .location{
float:right;
font-family: "FuturaItalic";
font-style: italic;
color: #662702;
}
.entry-short-des{
font-family: "FuturaItalic";
font-style: italic;
padding-left: 13px;
margin-bottom: 5px;
}
@ -129,5 +132,12 @@ h1 .cv{
padding-left: 13px;
}
.title-optional{
font-family: "FuturaItalic";
font-style: italic;
}
hr{
display: block;
height: 1px;
border: 0;
border-top: 1px solid #878887;
padding: 0;
}