Skip to content

Commit

Permalink
Added profile dp related stuff, fixed panel fetch js bugs, triggring …
Browse files Browse the repository at this point in the history
…uploader
  • Loading branch information
jaseemabid committed Aug 7, 2011
1 parent 77988d2 commit 2f68519
Showing 1 changed file with 58 additions and 44 deletions.
102 changes: 58 additions & 44 deletions editprofile.html
Original file line number Diff line number Diff line change
@@ -1,56 +1,60 @@
<!-- <div id='editProfile'> -->
<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'>
<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>
<ul class='links'>
<li class='hilite'>Edit profile</li>
<li >Update password</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' style="cursor:pointer;">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' style="cursor:pointer;">Submit</span>
</form>
<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">

$('ul.links li').click(function() {
$(this).parent().children().removeClass('hilite'); /* Remove tab color from inactive tabs */
$(this).addClass('hilite'); /* Add tab color from inactive tabs */
var numb = $("ul.links li").index(this);
$('div.content .panel').hide().eq(numb).fadeIn("fast");
var type = $("ul.links li").eq(numb).attr('type');
var desc = $("ul.links li").eq(numb).attr('desc');
$('input#fType').attr('value',type);
$('textarea#fDesc').attr('placeholder',desc);
$('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 pName = $('input#pName').attr('value');
var pRoll = $('input#pRoll').attr('value');
var pDesc = $('input#pDesc').attr('value');
var pEmail = $('input#pEmail').attr('value');
console.log(pName); console.log(pRoll); console.log(pDesc);

if( pName !=='' && pRoll !=='' && pDesc !=='' &&pEmail !== '') {
$.post("response/userupdate.php" , {'name':pName,'roll':pRoll ,'desc':pDesc, 'email':pEmail} , function(data){
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();
Expand Down Expand Up @@ -85,6 +89,16 @@
hideEditProfile();
});

function createUploader(){
var uploader = new qq.FileUploader({
element: document.getElementById('fileUploader'),
action: 'functions/upload.php',
debug: true
});
};

createUploader();

</script>

<!-- </div> -->

0 comments on commit 2f68519

Please sign in to comment.