Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/nitcalicut/Paathshaala into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
nxvipin committed Dec 17, 2011
2 parents 58b314e + 1824ceb commit ed4ea50
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 23 deletions.
6 changes: 4 additions & 2 deletions css/structure.less
Expand Up @@ -442,9 +442,11 @@ img.feedbackDock {
}

#indexMesssage {
span#cross {
margin-left:10px;
img#cross {
cursor:pointer;
position: absolute;
right: 5px; top: 5px;
margin-left:10px;
}
background: none repeat scroll 0 0 @gray1;
border: 1px solid #D4D4D4;
Expand Down
6 changes: 2 additions & 4 deletions index.php
Expand Up @@ -12,9 +12,6 @@
<div id='container'>
<?php echo $topBar;
echo $feedback; ?>
<div id="indexMesssage">
We pay our tribute to our <a href="video.php?video=261"><em>inspiration</em></a>. RIP Steve Jobs (February 24, 1955 – October 5, 2011).<span id="cross" class="news">X</span>
</div>
</div><!-- /container -->

<?php
Expand All @@ -24,7 +21,8 @@
?>
<script type="text/javascript">
$(document).ready(function() {
P.updateStoryBox('homePage');
P.indexMesssage('We pay our tribute to our <a hrefour tribute to our <a href="video.php?video=261"><em>inspiration</em></a>. RIP Steve Jobs (February 24, 1955 – October 5, 2011).')
.updateStoryBox('homePage');
});
</script>

Expand Down
51 changes: 37 additions & 14 deletions js/functions.js
Expand Up @@ -54,6 +54,7 @@
$(this).attr('rows' , lineno + 2)
commbox.height(ht + (14 * lineno) );
});
return this;
},
dashBoard : function() {
var dashShown = 0,loginShown = 0,joinShown = 0;
Expand Down Expand Up @@ -97,6 +98,7 @@
$("#logChangeButton").attr('src', 'pics/down.png');
}
});
return this;
},
getUrlVars : function() {
/*
Expand Down Expand Up @@ -187,6 +189,7 @@
}
Paathshaala.validate.video();
});
return this;
},
grayOut : function (option){
if(option) {
Expand All @@ -207,6 +210,7 @@
} else {
$('div#darkenScreenObject').remove();
}
return this;
},
hashTag : function(elem) {
var data = $(elem).html(),
Expand All @@ -218,14 +222,17 @@
data = data.replace( res[i],'<a href=search.php?tag=' + res[i] + '>' + res[i] + '</a>' );
}
$(elem).html(data);
return this;
},
hideEditProfile : function() {
$('#editProfile').fadeOut("fast");
this.grayOut(false);
return this;
},
hideFeedback : function () {
this.grayOut(false);
$('div#feedback').hide();
return this;
},
imageError : function() {
$('img#loggedImage').error(function(){
Expand All @@ -234,6 +241,20 @@
$('div#snapShot img').error(function(){
$(this).attr('src','pics/profile.png');
});
return this;
},
indexMesssage : function(text) {
if( $('#indexMesssage').length === 0 ) {
$("<div>").attr('id','indexMesssage')
.html(text)
.append($('<img>').addClass('news').attr('id','cross').attr('src','data:image/gif;base64,R0lGODlhFAAUAMQAAPb29ubm5ejo6Onp6evr6/X19WZmZu3t7fT09G9vb/Dw8PLy8tvb28DAwMPDw7y8vL29va6urqqqqtnZ2eTk5NjY2NLS0gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAAAAAAALAAAAAAUABQAAAV8YCCOZGkCaKquqci+qwvP8vzWdhysFqVSFt3KkGCgGAmDUNUgMpCGxpJJTEp1hay2EDEYIlutCEEuT5LESbksWrjdlSQEQqy83SKFXp986B9Ee3oiB4WFEg6GBw4SigciBJGSk5SSIgOYmZqbmSICn6ChoqCeo6ahJqmqIQA7').attr('title','Close the message')).insertAfter("#top");
} else {
$('#indexMesssage').find('span').html(text)
}
$('img.news').click(function(){
$('div#indexMesssage').fadeOut("fast");
});
return this;
},
quirks : function(){
/* Stuff which i cant put anywhere else. Cant pollute the global object, hence this is here */
Expand All @@ -249,9 +270,7 @@
$('img#bugButton.VideoBarButton, img.feedbackDock').click(function(){
Paathshaala.showFeedback();
});
$('span.news').click(function(){
$('div#indexMesssage').fadeOut("fast");
});
return this;
},
Search : function (q,tag) {
/*
Expand Down Expand Up @@ -287,17 +306,20 @@
}).complete(function(){
$("time.timeago").timeago();
});
return this;
},
searchBox : function() {
$(".searchBox").focus(function () {
$(this).animate({width: '380px'} , 250 , '' , function () {})
}).focusout(function () {
$(this).animate({width: '270px'} , 150 , '' , function () {});
});
return this;
},
showEditProfile: function () {
this.grayOut(true);
$('div#editProfile').load('editprofile.html').fadeIn("slow");
return this;
},
showFeedback : function() {
this.grayOut(true);
Expand Down Expand Up @@ -344,6 +366,7 @@
P.hideFeedback();
});
});
return this;
},
updateStoryBox : function (type) {
/*
Expand Down Expand Up @@ -430,8 +453,7 @@
}).complete(function(){ complete(); });
break;
}


return this;
}
};

Expand Down Expand Up @@ -584,6 +606,7 @@
}
});
});
return this;
};

Paathshaala.validate.video = function() {
Expand Down Expand Up @@ -671,6 +694,7 @@
}
}, "json");
});
return this;
};

// Expose Paathshaala to the global object
Expand All @@ -683,15 +707,14 @@
$(document).ready(function(){
if($.browser.msie) {
$("div#indexMesssage").remove();
$("<div>").attr('id','indexMesssage')
.html("Have a life, <a href='http://abetterbrowser.org/'><em>use a modern browser</em></a>. We dont support Internet Explorer.")
.appendTo("#container");
P.indexMesssage("Have a life, <a href='http://abetterbrowser.org/'><em>use a modern browser</em></a>. We dont support Internet Explorer.");
throw "Internet Explorer";
} else {
P.searchBox();
P.dashBoard();
P.imageError();
P.comments();
P.quirks();
P.validate.join();
P.searchBox()
.dashBoard()
.imageError()
.comments()
.quirks()
.validate.join();
}
});
6 changes: 3 additions & 3 deletions profile.php
Expand Up @@ -46,9 +46,9 @@
?>
<script type="text/javascript">
$(document).ready(function() {
P.updateStoryBox('My Uploads');
P.updateStoryBox('Liked videos');
P.updateStoryBox('Disliked videos');
P.updateStoryBox('My Uploads')
.updateStoryBox('Liked videos')
.updateStoryBox('Disliked videos');
});
</script>
</body>
Expand Down

0 comments on commit ed4ea50

Please sign in to comment.