Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
105 lines (95 sloc) 3.38 KB
<script src='js/fileuploader.js' type="text/javascript"></script>
<link href='css/fileuploader.css' rel='stylesheet' type='text/css'>
<span class='fbTitle'>Edit your profile</span>
<span id='cross' onclick='hideEditProfile()'>X</span>
<div id='blueLine'></div>
<ul class='links'>
<li class='hilite'>Edit profile</li>
<li >Update password</li>
<li >Display Picture</li>
</ul>
<div class='content'>
<div class='panel' style='display:block;'>
<form class='feedbackForm'>
<input required id='pName' type='text' placeholder='Full name' /><br />
<input required id='pEmail' type='email' placeholder='Your Email' /><br />
<input disabled id='pUName' type='text' placeholder='You cant change your username' /><br />
<input required id='pRoll' type='text' placeholder='Institute roll number' /><br />
<input required id='pDesc' type='text' placeholder='One word to describe you' /><br />
<span id='feedbackFormSubmitProfile' class='grayButton'>Submit</span>
</form>
</div>
<div class='panel' style='display:none;'>
<form class='feedbackForm'>
<input required id='pWord' type='password' placeholder='Existing password' /><br />
<input required id='pWord1' type='password' placeholder='Enter new password' /><br />
<input required id='pWord2' type='password' placeholder='Repeat new password' /><br />
<span id='feedbackFormSubmitPasswd' class='grayButton'>Update password</span>
</form>
</div>
<div class='panel' style='display:none;'>
<form class='feedbackForm'>
<div id="fileUploader">
<noscript>
<p>Please enable JavaScript to use file uploader.</p>
<!-- or put a simple form for upload here -->
</noscript>
</div>
</form>
</div>
</div>
<script type="text/javascript">
$('div#editProfile ul.links li').click(function() {
$(this).parent().children().removeClass('hilite');
$(this).addClass('hilite');
var numb = $('div#editProfile ul.links li').index(this);
$('div#editProfile div.content div.panel').hide().eq(numb).fadeIn("fast");
});
$('span#feedbackFormSubmitProfile').click(function() {
var profile = {} ;
profile.fname = $('input#pName').attr('value');
profile.roll = $('input#pRoll').attr('value');
profile.email = $('input#pEmail').attr('value');
if( profile.fname !=='' && profile.roll !=='' && profile.email !== '') {
$.post("response/userupdate.php" ,profile, function(data){
$('div.content').html(data);
setTimeout(function(){
hideEditProfile();
},1000);
});
} else {
alert("Fill in all the fields of the form.")
}
});
$('span#feedbackFormSubmitPasswd').click(function() {
var p = $('input#pWord1').attr('value'),
p1 = $('input#pWord1').attr('value'),
p2 = $('input#pWord2').attr('value');
if( p1 !== p2) {
alert("Enter the same password");
} else if ( p1.length < 6 ) {
alert("Password too short. Minimum 6 characters");
} else if ( p1 == $('span#profileUsername').text() ) {
alert("Password same as your username. Too insecure");
} else {
$.post("response/userupdate.php" , { 'oldPassword': p,'newPassword': p1 } , function(data){
$('div.content').html(data);
setTimeout(function(){
hideEditProfile();
},1000);
});
}
});
$('div#darkenScreenObject').click(function(){
hideEditProfile();
});
function createUploader(){
var uploader = new qq.FileUploader({
element: document.getElementById('fileUploader'),
action: 'functions/upload.php',
debug: true
});
};
createUploader();
</script>
<!-- </div> -->