1
0
mirror of https://github.com/lxsang/antd-web-apps synced 2025-04-19 01:56:44 +02: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; margin-right: 10px;
box-shadow: 1px 1px 1px #9f9F9F; box-shadow: 1px 1px 1px #9f9F9F;
} }
#status{ div[data-id="status"]{
padding-left: 10px; padding-left: 10px;
padding-top:5px; padding-top:5px;
color:#724841; color:#724841;

View File

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

View File

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

View File

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

View File

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

View File

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