Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Rewrote indexMessage module

  • Loading branch information...
commit d298002842dbc59883307551f3f30658d0d9f23a 1 parent b1e6dff
Jaseem Abid jaseemabid authored

Showing 3 changed files with 20 additions and 11 deletions. Show diff stats Hide diff stats

  1. +4 2 css/structure.less
  2. +1 3 index.php
  3. +15 6 js/functions.js
6 css/structure.less
@@ -442,9 +442,11 @@ img.feedbackDock {
442 442 }
443 443
444 444 #indexMesssage {
445   - span#cross {
446   - margin-left:10px;
  445 + img#cross {
447 446 cursor:pointer;
  447 + position: absolute;
  448 + right: 5px; top: 5px;
  449 + margin-left:10px;
448 450 }
449 451 background: none repeat scroll 0 0 @gray1;
450 452 border: 1px solid #D4D4D4;
4 index.php
@@ -12,9 +12,6 @@
12 12 <div id='container'>
13 13 <?php echo $topBar;
14 14 echo $feedback; ?>
15   - <div id="indexMesssage">
16   - 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>
17   - </div>
18 15 </div><!-- /container -->
19 16
20 17 <?php
@@ -24,6 +21,7 @@
24 21 ?>
25 22 <script type="text/javascript">
26 23 $(document).ready(function() {
  24 + 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).')
27 25 P.updateStoryBox('homePage');
28 26 });
29 27 </script>
21 js/functions.js
@@ -235,6 +235,19 @@
235 235 $(this).attr('src','pics/profile.png');
236 236 });
237 237 },
  238 + indexMesssage : function(text) {
  239 + if( $('#indexMesssage').length === 0 ) {
  240 + $("<div>").attr('id','indexMesssage')
  241 + .html(text)
  242 + .append($('<img>').addClass('news').attr('id','cross').attr('src','data:image/gif;base64,R0lGODlhFAAUAMQAAPb29ubm5ejo6Onp6evr6/X19WZmZu3t7fT09G9vb/Dw8PLy8tvb28DAwMPDw7y8vL29va6urqqqqtnZ2eTk5NjY2NLS0gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAAAAAAALAAAAAAUABQAAAV8YCCOZGkCaKquqci+qwvP8vzWdhysFqVSFt3KkGCgGAmDUNUgMpCGxpJJTEp1hay2EDEYIlutCEEuT5LESbksWrjdlSQEQqy83SKFXp986B9Ee3oiB4WFEg6GBw4SigciBJGSk5SSIgOYmZqbmSICn6ChoqCeo6ahJqmqIQA7').attr('title','Close the message')).insertAfter("#top");
  243 + } else {
  244 + $('#indexMesssage').find('span').html(text)
  245 + }
  246 + $('img.news').click(function(){
  247 + $('div#indexMesssage').fadeOut("fast");
  248 + });
  249 + return this;
  250 + },
238 251 quirks : function(){
239 252 /* Stuff which i cant put anywhere else. Cant pollute the global object, hence this is here */
240 253 $('#loading')
@@ -249,9 +262,6 @@
249 262 $('img#bugButton.VideoBarButton, img.feedbackDock').click(function(){
250 263 Paathshaala.showFeedback();
251 264 });
252   - $('span.news').click(function(){
253   - $('div#indexMesssage').fadeOut("fast");
254   - });
255 265 },
256 266 Search : function (q,tag) {
257 267 /*
@@ -683,9 +693,8 @@
683 693 $(document).ready(function(){
684 694 if($.browser.msie) {
685 695 $("div#indexMesssage").remove();
686   - $("<div>").attr('id','indexMesssage')
687   - .html("Have a life, <a href='http://abetterbrowser.org/'><em>use a modern browser</em></a>. We dont support Internet Explorer.")
688   - .appendTo("#container");
  696 + P.indexMesssage("Have a life, <a href='http://abetterbrowser.org/'><em>use a modern browser</em></a>. We dont support Internet Explorer.");
  697 + throw "Internet Explorer";
689 698 } else {
690 699 P.searchBox();
691 700 P.dashBoard();

0 comments on commit d298002

Please sign in to comment.
Something went wrong with that request. Please try again.