Dotclear

Changeset 983:594d50245ead


Ignore:
Timestamp:
11/09/12 19:13:32 (13 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Expurged version of jQuery constantFooter plugin

File:
1 edited

Legend:

Unmodified
Added
Removed
  • admin/js/jquery/jquery.constantfooter.js

    r982 r983  
    44     // http://www.stevefenton.co.uk/Content/Jquery-Constant-Footer/ 
    55     // Feel free to use this jQuery Plugin 
    6      // Version: 3.0.3 
     6     // Version: 3.0.3 - modified by DC Team 
    77    // Contributions by:  
    88      
    9      var nextSetIdentifier = 0; 
    109     var classModifier = ""; 
    1110      
    12      var feedItems; 
    13      var feedIndex; 
    14      var feedDelay = 10; 
    15      var feedTimer; 
    16       
    17      function CycleFeedList(feedList, i) { 
    18           feedItems = feedList; 
    19           feedIndex = i; 
    20           ShowNextFeedItem(); 
    21      } 
    22       
    23      function ShowNextFeedItem() { 
    24           //put that feed content on the screen! 
    25           $("." + classModifier + " .content").fadeOut(1000, function () { 
    26                $("." + classModifier + " .content").html(feedItems[feedIndex]).fadeIn(1000); 
    27                PadDocument(); 
    28                feedIndex++; 
    29                if (feedIndex >= feedItems.length) { 
    30                     feedIndex = 0; 
    31                } 
    32                feedTimer = window.setTimeout(ShowNextFeedItem, (feedDelay * 1000)); 
    33           }); 
    34      } 
    35  
    36      // Gets rid of CDATA sections 
    37      function StripCdataEnclosure(string) { 
    38           if (string.indexOf("<![CDATA[") > -1) { 
    39                string = string.replace("<![CDATA[", "").replace("]]>", ""); 
    40           } 
    41           return string; 
    42      } 
    43  
    4411     // Add padding to the bottom of the document so it can be scrolled past the footer 
    4512     function PadDocument() { 
     
    5219          var config = { 
    5320               classmodifier: "constantfooter", 
    54                feed: "", 
    55                feedlink: "Read more &raquo;", 
    5621               opacity: 0.8, 
    5722               showclose: false, 
     
    7742               $This = $(this); 
    7843 
    79                // Add a div used for body padding 
    80                // $This.before("<div id=\"" + config.classmodifier + "padding\">&nbsp;</div>"); 
    81                 
    8244               // Hide it 
    8345               $This.hide().addClass(classModifier).css({ position: "fixed", bottom: "0px", left: "0px", width: "100%" }) 
    84                 
    85                // If there is a feed, we will replace the footer HTML with the feed 
    86                if (config.feed.length > 0) { 
    87                     $This.html(""); 
    88                } 
    8946                
    9047               // Show a close button if required 
     
    9855               } 
    9956                
    100                $This.append("<div class=\"content\"></div>"); 
     57               // $This.append("<div class=\"content\"></div>"); 
    10158 
    10259               // Show it 
     
    10562               // Pad the bottom of the document 
    10663               PadDocument(); 
    107                 
    108                // Process any feeds 
    109                if (config.feed.length > 0) { 
    110            
    111                     var feedList = new Array(); 
    112                      
    113                     $.get(config.feed, function(xmlDoc) { 
    114                           
    115                          var itemList = xmlDoc.getElementsByTagName("item"); 
    116                           
    117                          for (var i = 1; i <= itemList.length; i++) { 
    118                           
    119                               var title = xmlDoc.getElementsByTagName("title")[i].childNodes[0].nodeValue; 
    120                               var link = xmlDoc.getElementsByTagName("link")[i].childNodes[0].nodeValue; 
    121                               var description = xmlDoc.getElementsByTagName("description")[i].childNodes[0].nodeValue; 
    122                           
    123                               var article = "<div class=\"item\">"; 
    124                                
    125                               if (link != null) { 
    126                                    article += "<a href=\"" + link + "\">"; 
    127                               } 
    128                               article += "<h2>" + title + "</h2>"; 
    129                               if (link != null) { 
    130                                    article += "</a>"; 
    131                               } 
    132                                
    133                               article += "<div class=\"description\"><p>" + description + "</p></div>"; 
    134                                
    135                               if (link != null) { 
    136                                    article += "<div class=\"link\"><a href=\"" + link + "\">" + config.feedlink + "</a></div>"; 
    137                               } 
    138                                
    139                               article += "</div>"; 
    140                  
    141                               feedList[feedList.length] = article; 
    142                          } 
    143                           
    144                          if (feedList.length > 0) { 
    145                               CycleFeedList(feedList, 0); 
    146                          } 
    147                     }); 
    148                } 
    14964          }); 
    15065     }; 
Note: See TracChangeset for help on using the changeset viewer.

Sites map