autofill & logo change

This commit is contained in:
Vivek Teega 2020-07-05 18:50:16 +05:30
parent 4fc42d9a7b
commit 8b37b81ebc
4 changed files with 395 additions and 28 deletions

View File

@ -300,7 +300,13 @@
// Prevent clicks from inside article from bubbling.
$this.on('click', function(event) {
event.stopPropagation();
if (!("jugaad" in event.target.dataset)) {
// data attribute doesn't exist
event.stopPropagation();
}
else{
event.stopPropagation();
}
});
});

BIN
images/transparent_logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

View File

@ -54,7 +54,8 @@
<!-- Header -->
<header id="header">
<div class="logo">
<span class="icon fa-gem"></span>
<!--<span class="icon fa-gem"></span>-->
<img class='icon' src='images/transparent_logo_white.png' style='max-width: 100%; max-height: 100%;'>
</div>
<div class="content">
<div class="inner">
@ -71,16 +72,16 @@
<nav>
<ul>
<li><a href="#intro">Intro</a></li>
<li><a href="#work">Projects</a></li>
<li><a href="#contact">Apply</a></li>
<li><a href="#projects">Projects</a></li>
<li><a href="#apply">Apply</a></li>
<!--<li><a href="#elements">Elements</a></li>-->
<li><a href="#list">List</a></li>
</ul>
</nav>
</header>
<!-- Main -->
<div id="main">
<!-- Intro -->
<article id="intro">
<h2 class="major">Intro</h2>
@ -99,13 +100,19 @@
</article>
<!-- Work -->
<article id="work">
<article id="projects">
<h2 class="major">Projects</h2>
<span class="image main"><img src="images/pic02.jpg" alt="" /></span>
<p>This is some random text which will be replaced with much more creative introduction to the Project
List</p>
<div id='projectlist'>
</div>
<form method="post" action="#" id='projectform'>
<div id='projectlist'>
</div>
<ul id='projectactionlist' class="actions" style="display:none">
<li><input type="submit" value="Apply" /></li>
<li><input type="reset" value="Reset" id='resetform' /></li>
</ul>
</form>
</article>
<!-- About -->
@ -120,7 +127,7 @@
</article>
<!-- Contact -->
<article id="contact">
<article id="apply">
<h2 class="major">Apply</h2>
<form method="post" action="#" id='applicationform'>
<div class="fields">
@ -149,8 +156,15 @@
<input type="text" name="whatsapp" id="whatsapp" />
</div>
<div class="field half">
<label for="floid">*FLO ID</label>
<input type="text" name="floid" id="floid" />
<label for="floid">FLO ID</label>
<input type="text" name="floid" id="floid" readonly />
</div>
<div class="field half">
<label for="floid">Project</label>
<!--<input type="text" name="floid" id="floid" />-->
<select name="formprojectlist" id="formprojectlist">
<option disabled selected value> -- select project -- </option>
</select>
</div>
<!--<div class="field" style='display:"none"'>
<label for="message">Message</label>
@ -422,6 +436,258 @@ print 'It took ' + i + ' iterations to sort the deck.';</code></pre>
</article>
<!-- List -->
<article id="list">
<h2 class="major">Applicant List</h2>
<section>
<h3 class="major">Text</h3>
<p>This is <b>bold</b> and this is <strong>strong</strong>. This is <i>italic</i> and this is
<em>emphasized</em>.
This is <sup>superscript</sup> text and this is <sub>subscript</sub> text.
This is <u>underlined</u> and this is code: <code>for (;;) { ... }</code>. Finally, <a
href="#">this is a link</a>.</p>
<hr />
<h2>Heading Level 2</h2>
<h3>Heading Level 3</h3>
<h4>Heading Level 4</h4>
<h5>Heading Level 5</h5>
<h6>Heading Level 6</h6>
<hr />
<h4>Blockquote</h4>
<blockquote>Fringilla nisl. Donec accumsan interdum nisi, quis tincidunt felis sagittis eget tempus
euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis
iaculis volutpat ac adipiscing accumsan faucibus. Vestibulum ante ipsum primis in faucibus lorem
ipsum dolor sit amet nullam adipiscing eu felis.</blockquote>
<h4>Preformatted</h4>
<pre>
<code>i = 0;
while (!deck.isInOrder()) {
print 'Iteration ' + i;
deck.shuffle();
i++;
}
print 'It took ' + i + ' iterations to sort the deck.';
</code>
</pre>
</section>
<section>
<h3 class="major">Lists</h3>
<h4>Unordered</h4>
<ul>
<li>Dolor pulvinar etiam.</li>
<li>Sagittis adipiscing.</li>
<li>Felis enim feugiat.</li>
</ul>
<h4>Alternate</h4>
<ul class="alt">
<li>Dolor pulvinar etiam.</li>
<li>Sagittis adipiscing.</li>
<li>Felis enim feugiat.</li>
</ul>
<h4>Ordered</h4>
<ol>
<li>Dolor pulvinar etiam.</li>
<li>Etiam vel felis viverra.</li>
<li>Felis enim feugiat.</li>
<li>Dolor pulvinar etiam.</li>
<li>Etiam vel felis lorem.</li>
<li>Felis enim et feugiat.</li>
</ol>
<h4>Icons</h4>
<ul class="icons">
<li><a href="#" class="icon brands fa-twitter"><span class="label">Twitter</span></a></li>
<li><a href="#" class="icon brands fa-facebook-f"><span class="label">Facebook</span></a></li>
<li><a href="#" class="icon brands fa-instagram"><span class="label">Instagram</span></a></li>
<li><a href="#" class="icon brands fa-github"><span class="label">Github</span></a></li>
</ul>
<h4>Actions</h4>
<ul class="actions">
<li><a href="#" class="button primary">Default</a></li>
<li><a href="#" class="button">Default</a></li>
</ul>
<ul class="actions stacked">
<li><a href="#" class="button primary">Default</a></li>
<li><a href="#" class="button">Default</a></li>
</ul>
</section>
<section>
<h3 class="major">Table</h3>
<h4>Default</h4>
<div class="table-wrapper">
<table>
<thead>
<tr>
<th>Name</th>
<th>Description</th>
<th>Price</th>
</tr>
</thead>
<tbody>
<tr>
<td>Item One</td>
<td>Ante turpis integer aliquet porttitor.</td>
<td>29.99</td>
</tr>
<tr>
<td>Item Two</td>
<td>Vis ac commodo adipiscing arcu aliquet.</td>
<td>19.99</td>
</tr>
<tr>
<td>Item Three</td>
<td> Morbi faucibus arcu accumsan lorem.</td>
<td>29.99</td>
</tr>
<tr>
<td>Item Four</td>
<td>Vitae integer tempus condimentum.</td>
<td>19.99</td>
</tr>
<tr>
<td>Item Five</td>
<td>Ante turpis integer aliquet porttitor.</td>
<td>29.99</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="2"></td>
<td>100.00</td>
</tr>
</tfoot>
</table>
</div>
<h4>Alternate</h4>
<div class="table-wrapper">
<table class="alt">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
<th>Price</th>
</tr>
</thead>
<tbody>
<tr>
<td>Item One</td>
<td>Ante turpis integer aliquet porttitor.</td>
<td>29.99</td>
</tr>
<tr>
<td>Item Two</td>
<td>Vis ac commodo adipiscing arcu aliquet.</td>
<td>19.99</td>
</tr>
<tr>
<td>Item Three</td>
<td> Morbi faucibus arcu accumsan lorem.</td>
<td>29.99</td>
</tr>
<tr>
<td>Item Four</td>
<td>Vitae integer tempus condimentum.</td>
<td>19.99</td>
</tr>
<tr>
<td>Item Five</td>
<td>Ante turpis integer aliquet porttitor.</td>
<td>29.99</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="2"></td>
<td>100.00</td>
</tr>
</tfoot>
</table>
</div>
</section>
<section>
<h3 class="major">Buttons</h3>
<ul class="actions">
<li><a href="#" class="button primary">Primary</a></li>
<li><a href="#" class="button">Default</a></li>
</ul>
<ul class="actions">
<li><a href="#" class="button">Default</a></li>
<li><a href="#" class="button small">Small</a></li>
</ul>
<ul class="actions">
<li><a href="#" class="button primary icon solid fa-download">Icon</a></li>
<li><a href="#" class="button icon solid fa-download">Icon</a></li>
</ul>
<ul class="actions">
<li><span class="button primary disabled">Disabled</span></li>
<li><span class="button disabled">Disabled</span></li>
</ul>
</section>
<section>
<h3 class="major">Form</h3>
<form method="post" action="#">
<div class="fields">
<div class="field half">
<label for="demo-name">Name</label>
<input type="text" name="demo-name" id="demo-name" value="" placeholder="Jane Doe" />
</div>
<div class="field half">
<label for="demo-email">Email</label>
<input type="email" name="demo-email" id="demo-email" value=""
placeholder="jane@untitled.tld" />
</div>
<div class="field">
<label for="demo-category">Category</label>
<select name="demo-category" id="demo-category">
<option value="">-</option>
<option value="1">Manufacturing</option>
<option value="1">Shipping</option>
<option value="1">Administration</option>
<option value="1">Human Resources</option>
</select>
</div>
<div class="field half">
<input type="radio" id="demo-priority-low" name="demo-priority" checked>
<label for="demo-priority-low">Low</label>
</div>
<div class="field half">
<input type="radio" id="demo-priority-high" name="demo-priority">
<label for="demo-priority-high">High</label>
</div>
<div class="field half">
<input type="checkbox" id="demo-copy" name="demo-copy">
<label for="demo-copy">Email me a copy</label>
</div>
<div class="field half">
<input type="checkbox" id="demo-human" name="demo-human" checked>
<label for="demo-human">Not a robot</label>
</div>
<div class="field">
<label for="demo-message">Message</label>
<textarea name="demo-message" id="demo-message" placeholder="Enter your message"
rows="6"></textarea>
</div>
</div>
<ul class="actions">
<li><input type="submit" value="Send Message" class="primary" /></li>
<li><input type="reset" value="Reset" /></li>
</ul>
</form>
</section>
</article>
</div>
<!-- Footer -->
@ -9552,36 +9818,79 @@ print 'It took ' + i + ' iterations to sort the deck.';</code></pre>
/*async function loadRIBC() {
floCloudAPI.requestObjectData('RIBC', options = { senderIDs: false, receiverID: "FMeiptdJNtYQEtzyYAVNP8fjsDJ1i4EPfE", application: 'RIBC' })
}*/
function validateEmail(mail) {
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(mail)) {
return (true)
}
alert("You have entered an invalid email address!")
return (false)
}
function validatePhonenumber(inputtxt) {
var phoneno = /^\d{10}$/;
if ((inputtxt.value.match(phoneno))) {
return true;
}
else {
alert("You have entered an invalid phone number!");
return false;
}
}
async function fetchInternApplicants() {
let applicants = await floCloudAPI.requestGeneralData('test')
debugger;
}
//Handler for Applicant form submission
document.getElementById('applicationform').addEventListener('submit', (ev) => {
ev.preventDefault()
aname = document.getElementById('name').value
aname = aname.replace(/\s+/g, ' ')
aname = aname.trim()
if (aname == '') {
alert('You have entered an invalid name!')
}
aemail = document.getElementById('email').value
aemail = aemail.replace(/\s+/g, ' ')
aemail = aemail.trim()
if (!validateEmail(aemail)) {
return
}
acollege = document.getElementById('college').value
acollege = acollege.replace(/\s+/g, ' ')
acollege = acollege.trim()
if (acollege == '') {
alert('You have entered an invalid college!')
return
}
acourse = document.getElementById('course').value
adob = document.getElementById('dob').value
awhatsapp = document.getElementById('whatsapp').value
afloid = document.getElementById('floid').value
afloid = myFloID
aproject = document.getElementById('formprojectlist').value
let detailsObj = {
'name' : aname,
'email' : aemail,
'college' : acollege,
'course' : acourse,
'dob' : adob,
'whatsapp' : awhatsapp
'name': aname,
'email': aemail,
'college': acollege,
'course': acourse,
'dob': adob,
'whatsapp': awhatsapp,
'project': aproject
}
let mainObj = {}
mainObj[afloid] = detailsObj
floCloudAPI.sendGeneralData(JSON.stringify(mainObj), 'test1')
document.getElementById('resetform').click()
floCloudAPI.sendGeneralData(JSON.stringify(mainObj), 'test2')
document.getElementById('resetform').click()
})
</script>
@ -9598,36 +9907,88 @@ print 'It took ' + i + ' iterations to sort the deck.';</code></pre>
console.log(result)
alert(`Welcome FLO_ID: ${myFloID}`)
document.getElementById('floid').value = myFloID
//App functions....
/*loadRIBC()
.then(loadres => {
.then(loadres => {
}) */
let ribcAppdata = floCloudAPI.requestObjectData('RIBC', options = { senderIDs: false, receiverID: "FMeiptdJNtYQEtzyYAVNP8fjsDJ1i4EPfE", application: 'RIBC' })
let ribcGendata = floCloudAPI.requestGeneralData('test')
let ribcGendata = floCloudAPI.requestGeneralData('test2')
Promise.all([ribcAppdata, ribcGendata]).then((values) => {
console.log("Hey I'm here, the promises just got resolved")
console.log(values)
// Project list related operations
let projectDetails = floGlobals.appObjects.RIBC.projectDetails
let projectDetailsKeys = Object.keys(projectDetails)
let projectlistContainer = document.getElementById('projectlist')
let formprojectlistContainer = document.getElementById('formprojectlist')
for (let i = 0; i < projectDetailsKeys.length; i++) {
newHtml = `<h4>${projectDetails[projectDetailsKeys[i]].projectName}</h4>
newHtml = `<div class="field">
<input type="checkbox" name="vehicle${i}" id="vehicle${i}">
<label for="vehicle${i}" data-jugaad="checkbox">${projectDetails[projectDetailsKeys[i]].projectName}</label>
</div>
<p>${projectDetails[projectDetailsKeys[i]].projectDescription}</p>`
projectlistContainer.innerHTML = projectlistContainer.innerHTML + newHtml
applicationformHtml = `<option value="${projectDetails[projectDetailsKeys[i]].projectName}">${projectDetails[projectDetailsKeys[i]].projectName}</option>`
formprojectlistContainer.innerHTML = formprojectlistContainer.innerHTML + applicationformHtml
}
document.getElementById('projectactionlist').style.display = 'flex'
// User list related operations
let applicantsArray = floGlobals.generalData['{"application":"TEST_MODE","type":"test2"}']
let applicantsIDarray = []
for (let i = 0; i < applicantsArray.length; i++) {
applicantsIDarray.push(applicantsArray[i]['sender'])
}
if (applicantsIDarray.includes(myFloID)) {
window.isApplicant = true
window.applicantProjects = []
for (let i = 0; i < applicantsArray.length; i++) {
if (myFloID == applicantsArray[i]['sender']) {
var temp = JSON.parse(applicantsArray[i]['message'])
applicantProjects.push(temp[myFloID]['project'])
// force user to not change his details if he already exists
if (i == 0) {
document.getElementById('name').value = temp[myFloID]['name']
document.getElementById('name').readOnly = true
document.getElementById('email').value = temp[myFloID]['email']
document.getElementById('email').readOnly = true
document.getElementById('college').value = temp[myFloID]['college']
document.getElementById('college').readOnly = true
document.getElementById('course').value = temp[myFloID]['course']
document.getElementById('course').readOnly = true
document.getElementById('dob').value = temp[myFloID]['dob']
document.getElementById('dob').readOnly = true
document.getElementById('whatsapp').value = temp[myFloID]['whatsapp']
document.getElementById('whatsapp').readOnly = true
}
}
}
}
else {
window.isApplicant = false
}
});
}).catch(error => console.error(error))
}
function checkboxBehaviour() {
console.log('I just clicked a checkbox')
}
</script>
</body>