Index: site/app/webroot/css/screen.css =================================================================== --- site/app/webroot/css/screen.css (revision 16779) +++ site/app/webroot/css/screen.css (working copy) @@ -607,3 +607,21 @@ #thumb-browser #form-listcontrol { margin-left: 20%; padding: 8px 12% 8px 15%; } #thumb-browser #form-listcontrol #order-by button { white-space: nowrap; width: 16.5% } + +#slider { margin-bottom: 18px; width: 569px; background:transparent url(../img/addon-tr.png) no-repeat scroll right top; } +#slider .inner { background:transparent url(../img/addon-tl.png) no-repeat scroll left top; } +#slider .viewport { position: relative; width: 100%; overflow: hidden; } +#slider .item_set { width: 2850px; } +#slider .item_set .addon { float: left; width: 308px; } +#slider .item_set .addon .preview-img { background: none } +#slider .item_set .addon { background: none; border-left: none } +#slider .item_set .addon .install-container { height: 85px; } +#slider .item_set .addon .install-button { padding-top: 1.75em; padding-left: .5em; } +#slider .item_set .addon .exp-loggedout .install-button { padding-top: 0; padding-left: 0; } +#slider .item_set .addon .count { border-top:1px solid #CCCCCC; bottom:4px; height:35px; margin-left:-240px; position:absolute; } +#slider .controls { border-top: 1px solid #ccc; width: 100%; } +#slider .controls_inner { font-size: 140%; text-align: center; padding-top: 6px; border-left: 1px solid #ccc; border-right: 1px solid #ccc } +#slider .controls a { text-decoration: none; padding: 0 0.5em; } +#slider .controls a img { border: none; vertical-align: top } +#slider .vex { background: transparent url("../img/addon-br.png") right bottom no-repeat; width: 100%; } +#slider .vex span { background: transparent url("../img/addon-bl.png") left bottom no-repeat; height: 10px; display: block } Index: site/app/webroot/css/ie6.css =================================================================== --- site/app/webroot/css/ie6.css (revision 16779) +++ site/app/webroot/css/ie6.css (working copy) @@ -118,3 +118,6 @@ #thumb-browser .thumbs { list-style-type:none; margin-left: 20%; } #thumb-browser .thumbs li.thumb .vex { height: 8px; margin-top: -10px } #thumb-browser .thumbs li.thumb .vex span { height: 8px; margin-left:0px; } + +#slider { width: 544px } +#slider .item_set .addon { width: 283px } Index: site/app/webroot/img/slider-next.gif =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: site/app/webroot/img/slider-next.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Index: site/app/webroot/img/slider-prev-disabled.gif =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: site/app/webroot/img/slider-prev-disabled.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Index: site/app/webroot/img/slider-prev.gif =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: site/app/webroot/img/slider-prev.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Index: site/app/webroot/img/slider-next-disabled.gif =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: site/app/webroot/img/slider-next-disabled.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Index: site/app/controllers/addons_controller.php =================================================================== --- site/app/controllers/addons_controller.php (revision 16779) +++ site/app/controllers/addons_controller.php (working copy) @@ -234,7 +234,7 @@ "Feature.application_id ='" . APP_ID . "'", "(Feature.locale = '" . LANG . "' OR Feature.locale IS NULL)"); $this->Feature->unbindFully(); - $feature = $this->Feature->findAll($criteria, 'Feature.addon_id', "RAND()", 3, null, 1); + $feature = $this->Feature->findAll($criteria, 'Feature.addon_id', "RAND()", 7, null, 1); if (!empty($feature)) { $_feat_ids = array(); Index: site/app/views/layouts/mozilla.thtml =================================================================== --- site/app/views/layouts/mozilla.thtml (revision 16779) +++ site/app/views/layouts/mozilla.thtml (working copy) @@ -238,10 +238,82 @@ }); +controller->name == 'Addons' && + (in_array($this->action, array('home', 'browse'))) ): ?> + /** + * Slider widget handler, attached to root elements with + * a CSS class of 'slider_widget' + */ + $(document).ready(function() { + + $('.slider_widget').each(function() { + var slider_sel = '#' + this.id; + + $(this).click(function(e) { + + // If the click target is the image, jump up to parent link. + var targ = (/img/i.test(e.target.tagName)) ? + e.target.parentNode : e.target; + + // If the click target is a link... + if (/a/i.test(targ.tagName)) { + var old_item = $(slider_sel + " .item_set .selected"); + var new_item = null; + + // Check the link class name for action. + if ($(targ).hasClass('click-disabled')) { + return false; + } else if ($(targ).hasClass('prev')) { + new_item = old_item.prev('.item'); + if (!new_item.length) return false; + } else if ($(targ).hasClass('next')) { + new_item = old_item.next('.item'); + if (!new_item.length) return false; + } + + // Only act if a new item was selected. + if (new_item) { + + // Adjust next / prev button images to reflect enabled / disabled + ['next', 'prev'].forEach(function(pos) { + var img = $(slider_sel + " .controls ."+pos+" img")[0]; + if (!new_item[pos]().length) { + img.src = img.src.replace(pos, pos+'-disabled'); + } else { + img.src = img.src.replace(pos+'-disabled', pos); + } + }); + + // Update the current index in the controls area. + var item_id = new_item[0].id; + $(slider_sel + ' .controls .index').text( + // Assume item IDs containing index like feature1_1 ... feature1_5 + item_id.substr( item_id.lastIndexOf('_') + 1 ) + ); + + // Swap the current selected item class in the slider. + old_item.removeClass('selected'); + new_item.addClass('selected'); + + // Perform the slider animation with a viewport scroll. + $(slider_sel + ' .viewport').animate({ + scrollLeft: new_item[0].offsetLeft + }, 400) + + return false; + } + + } + + }); + }); + + }); + // ]]> + - controller->name == 'Addons' && $this->action == 'display'): ?> =$javascript->link('jquery-ui/ui.lightbox.js') . "\n"?> =$html->css('jquery-lightbox', 'stylesheet', array('media'=>'screen,projection'))."\n"?> Index: site/app/views/addons/home.thtml =================================================================== --- site/app/views/addons/home.thtml (revision 16779) +++ site/app/views/addons/home.thtml (working copy) @@ -47,32 +47,66 @@