Skip to content

Commit

Permalink
Merge pull request #8 from bluegr/recommended_download
Browse files Browse the repository at this point in the history
WEB: Add a "Recommended download" button to the downloads page
  • Loading branch information
bluegr committed Nov 17, 2013
2 parents 15f0c6d + 910d711 commit ef8f241
Show file tree
Hide file tree
Showing 12 changed files with 394 additions and 2 deletions.
1 change: 1 addition & 0 deletions .htaccess
Expand Up @@ -2,6 +2,7 @@
RewriteEngine On

# Set the base for the rewritten URLs
# NOTE: When debugging locally, set this to the directory the site is in
RewriteBase /

##
Expand Down
42 changes: 42 additions & 0 deletions css/downloads.css
Expand Up @@ -27,3 +27,45 @@ span.daily_provider {
font-size: 90;
padding-left: 3em;
}

#downloadContainer {
position: relative;
height: 100px;
}

#downloadButton {
behavior: url(../css/ie-css3.htc);
height: 53px;
float: left;
margin-bottom: 30px;
padding: 15px;
padding-left: 90px;
color: white;
-moz-border-radius: 12px;
-webkit-border-radius: 12px;
border-radius: 12px;
border: 1px solid white;
-webkit-box-shadow: 0 0 10px #222;
-moz-box-shadow: 0 0 10px #222;
box-shadow: 0 0 10px #222;
text-decoration: none;
background: #C84430 url(../images/downloadbg.png) repeat-x;
}

#downloadButton:hover {
background: #EFC6BE url(../images/downloadbgbright.png) repeat-x;
}

.downloadText {
font-size: 40px;
line-height: 32px;
letter-spacing: .03em;
padding-bottom: 6px;
display: block;
font-family: "trebuchet MS",Arial,"Sans-Serif";
}

#downloadDetails {
padding-left: 3px;
color: white;
}
243 changes: 243 additions & 0 deletions css/ie-css3.htc
@@ -0,0 +1,243 @@
--Do not remove this if you are using--
Original Author: Remiz Rahnas
Original Author URL: http://www.htmlremix.com
Published date: 2008/09/24

Changes by Nick Fetchak:
- IE8 standards mode compatibility
- VML elements now positioned behind original box rather than inside of it - should be less prone to breakage
- Added partial support for 'box-shadow' style
- Checks for VML support before doing anything
- Updates VML element size and position via timer and also via window resize event
Published date : 2009/11/19
http://fetchak.com/ie-css3


<public:attach event="oncontentready" onevent="oncontentready('v08vnSVo78t4JfjH')" />
<script type="text/javascript">

timer_length = 200; // Milliseconds

// supportsVml() borrowed from http://stackoverflow.com/questions/654112/how-do-you-detect-support-for-vml-or-svg-in-a-browser
function supportsVml() {
if (typeof supportsVml.supported == "undefined") {
var a = document.body.appendChild(document.createElement('div'));
a.innerHTML = '<v:shape id="vml_flag1" adj="1" />';
var b = a.firstChild;
b.style.behavior = "url(#default#VML)";
supportsVml.supported = b ? typeof b.adj == "object": true;
a.parentNode.removeChild(a);
}
return supportsVml.supported
}


// findPos() borrowed from http://www.quirksmode.org/js/findpos.html
function findPos(obj) {
var curleft = curtop = 0;

if (obj.offsetParent) {
do {
curleft += obj.offsetLeft;
curtop += obj.offsetTop;
} while (obj = obj.offsetParent);
}

return({
'x': curleft,
'y': curtop
});
}

function createShadow(element, vml_parent) {
var style = element.currentStyle['-moz-box-shadow'] || element.currentStyle['-webkit-box-shadow'] || element.currentStyle['box-shadow'] || '';
var match = style.match(/^(\d+)px (\d+)px (\d+)px/);
if (!match) { return(false); }


var shadow = document.createElement('v:roundrect');
shadow.userAttrs = {
'x': parseInt(RegExp.$1 || 0),
'y': parseInt(RegExp.$2 || 0),
'radius': parseInt(RegExp.$3 || 0) / 2
};
shadow.position_offset = {
'y': (0 - vml_parent.pos_ieCSS3.y - shadow.userAttrs.radius + shadow.userAttrs.y),
'x': (0 - vml_parent.pos_ieCSS3.x - shadow.userAttrs.radius + shadow.userAttrs.x)
};
shadow.size_offset = {
'width': 0,
'height': 0
};
shadow.arcsize = element.arcSize +'px';
shadow.style.display = 'block';
shadow.style.position = 'absolute';
shadow.style.top = (element.pos_ieCSS3.y + shadow.position_offset.y) +'px';
shadow.style.left = (element.pos_ieCSS3.x + shadow.position_offset.x) +'px';
shadow.style.width = element.offsetWidth +'px';
shadow.style.height = element.offsetHeight +'px';
shadow.style.antialias = true;
shadow.className = 'vml_box_shadow';
shadow.style.zIndex = element.zIndex - 1;
shadow.style.filter = 'progid:DXImageTransform.Microsoft.Blur(pixelRadius='+ shadow.userAttrs.radius +',makeShadow=true,shadowOpacity=1)';

element.parentNode.appendChild(shadow);
//element.parentNode.insertBefore(shadow, element.element);

// For window resizing
element.vml.push(shadow);

return(true);
}

function createBorderRect(element, vml_parent) {
if (isNaN(element.borderRadius)) { return(false); }

element.style.background = 'transparent';
element.style.borderColor = 'transparent';

var rect = document.createElement('v:roundrect');
rect.position_offset = {
'y': (0.5 * element.strokeWeight) - vml_parent.pos_ieCSS3.y,
'x': (0.5 * element.strokeWeight) - vml_parent.pos_ieCSS3.x
};
rect.size_offset = {
'width': 1 - element.strokeWeight,
'height': 1 - element.strokeWeight
};
rect.arcsize = element.arcSize +'px';
rect.strokecolor = element.strokeColor;
rect.strokeWeight = element.strokeWeight +'px';
rect.stroked = element.stroked;
rect.className = 'vml_border_radius';
rect.style.display = 'block';
rect.style.position = 'absolute';
rect.style.top = (element.pos_ieCSS3.y + rect.position_offset.y) +'px';
rect.style.left = (element.pos_ieCSS3.x + rect.position_offset.x) +'px';
rect.style.width = (element.offsetWidth + rect.size_offset.width) +'px';
rect.style.height = (element.offsetHeight + rect.size_offset.height) +'px';
rect.style.antialias = true;
rect.style.zIndex = element.zIndex - 1;

var fill = document.createElement('v:fill');
fill.color = element.fillColor;
fill.src = element.fillSrc;
fill.className = 'vml_border_radius_fill';
fill.type = 'tile';

// Hack: IE6 doesn't support transparent borders, use padding to offset original element
isIE6 = /msie|MSIE 6/.test(navigator.userAgent);
if (isIE6 && (element.strokeWeight > 0)) {
this.style.borderStyle = 'none';
this.style.paddingTop = parseInt(this.currentStyle.paddingTop || 0) + element.strokeWeight;
this.style.paddingBottom = parseInt(this.currentStyle.paddingBottom || 0) + element.strokeWeight;
}

rect.appendChild(fill);
element.parentNode.appendChild(rect);
//element.parentNode.insertBefore(rect, element.element);

// For window resizing
element.vml.push(rect);

return(true);
}

function oncontentready(classID) {
if (!supportsVml()) { return(false); }

if (this.className.match(classID)) { return(false); }
this.className = this.className.concat(' ', classID);

// Add a namespace for VML (IE8 requires it)
if (!document.namespaces.v) { document.namespaces.add("v", "urn:schemas-microsoft-com:vml"); }

// Check to see if we've run once before on this page
if (typeof(window.ieCSS3) == 'undefined') {
// Create global ieCSS3 object
window.ieCSS3 = {
'vmlified_elements': new Array(),
'update_timer': setInterval(updatePositionAndSize, timer_length)
};

if (typeof(window.onresize) == 'function') { window.ieCSS3.previous_onresize = window.onresize; }

// Attach window resize event
window.onresize = updatePositionAndSize;
}


// These attrs are for the script and have no meaning to the browser:
this.borderRadius = parseInt(this.currentStyle['-moz-border-radius'] ||
this.currentStyle['-webkit-border-radius'] ||
this.currentStyle['border-radius'] ||
this.currentStyle['-khtml-border-radius']);
this.arcSize = Math.min(this.borderRadius / Math.min(this.offsetWidth, this.offsetHeight), 1);
this.fillColor = this.currentStyle.backgroundColor;
this.fillSrc = this.currentStyle.backgroundImage.replace(/^url\("(.+)"\)$/, '$1');
this.strokeColor = this.currentStyle.borderColor;
this.strokeWeight = parseInt(this.currentStyle.borderWidth);
this.stroked = 'true';
if (isNaN(this.strokeWeight)) {
this.strokeWeight = 0;
this.strokeColor = fillColor;
this.stroked = 'false';
}

this.element.vml = new Array();
this.zIndex = parseInt(this.currentStyle.zIndex);
if (isNaN(this.zIndex)) { this.zIndex = 0; }

// Find which element provides position:relative for the target element (default to BODY)
vml_parent = this;
var limit = 100, i = 0;
do {
vml_parent = vml_parent.parentElement;
i++;
if (i >= limit) { return(false); }
} while ((typeof(vml_parent) != 'undefined') && (vml_parent.currentStyle.position != 'relative') && (vml_parent.tagName != 'BODY'));

vml_parent.pos_ieCSS3 = findPos(vml_parent);
this.pos_ieCSS3 = findPos(this);

var rv1 = createShadow(this, vml_parent);
var rv2 = createBorderRect(this, vml_parent);

if (rv1 || rv2) { window.ieCSS3.vmlified_elements.push(this.element); }

if (typeof(vml_parent.document.ieCSS3_stylesheet) == 'undefined') {
vml_parent.document.ieCSS3_stylesheet = vml_parent.document.createStyleSheet();
vml_parent.document.ieCSS3_stylesheet.addRule("v\\:roundrect", "behavior: url(#default#VML)");
vml_parent.document.ieCSS3_stylesheet.addRule("v\\:fill", "behavior: url(#default#VML)");
}
}

function updatePositionAndSize() {
if (typeof(window.ieCSS3.vmlified_elements) != 'object') { return(false); }

for (var i in window.ieCSS3.vmlified_elements) {
var el = window.ieCSS3.vmlified_elements[i];

if (typeof(el.vml) != 'object') { continue; }

for (var z in el.vml) {
//var parent_pos = findPos(el.vml[z].parentNode);
var new_pos = findPos(el);
new_pos.x = (new_pos.x + el.vml[z].position_offset.x) + 'px';
new_pos.y = (new_pos.y + el.vml[z].position_offset.y) + 'px';
if (el.vml[z].style.left != new_pos.x) { el.vml[z].style.left = new_pos.x; }
if (el.vml[z].style.top != new_pos.y) { el.vml[z].style.top = new_pos.y; }

var new_size = {
'width': parseInt(el.offsetWidth + el.vml[z].size_offset.width),
'height': parseInt(el.offsetHeight + el.vml[z].size_offset.height)
}
if (el.vml[z].offsetWidth != new_size.width) { el.vml[z].style.width = new_size.width +'px'; }
if (el.vml[z].offsetHeight != new_size.height) { el.vml[z].style.height = new_size.height +'px'; }
}
}

if (event && (event.type == 'resize') && typeof(window.ieCSS3.previous_onresize) == 'function') { window.ieCSS3.previous_onresize(); }
}
</script>

12 changes: 12 additions & 0 deletions data/downloads.xml
Expand Up @@ -19,6 +19,7 @@
<url>scummvm-{$release}-win32.exe?download</url>
<name><h:b>Windows Installer</h:b></name>
<extra_info>(6.6M Win32 .exe)</extra_info>
<user_agent>Windows</user_agent>
</file>
<file>
<category_icon>catpl-windows.png</category_icon>
Expand Down Expand Up @@ -78,6 +79,7 @@
<url>scummvm_{$release}-raring.1_amd64.deb?download</url>
<name>Ubuntu 13.04 (raring) x86 64bit package</name>
<extra_info>(9.9M .deb)</extra_info>
<user_agent>Ubuntu</user_agent>
</file>

<file>
Expand All @@ -99,6 +101,7 @@
<url>scummvm-{$release}-macosx.dmg?download</url>
<name>Mac OS X Universal Disk Image</name>
<extra_info>(18.2M disk image)</extra_info>
<user_agent>Macintosh</user_agent>
</file>
<!--
<file>
Expand Down Expand Up @@ -133,6 +136,7 @@
<category_icon>catpl-android.png</category_icon>
<url>https://play.google.com/store/apps/details?id=org.scummvm.scummvm</url>
<name>Android package at Google Play Store</name>
<user_agent>Android</user_agent>
</file>
<!--
<file>
Expand All @@ -147,6 +151,7 @@
<url>scummvm-{$release}-s60v3.zip?download</url>
<name>Symbian S60 version 3 binary</name>
<extra_info>(22.8M .zip)</extra_info>
<user_agent>SymbOS</user_agent>
</file>
<file>
<category_icon>catpl-uiq.png</category_icon>
Expand All @@ -166,6 +171,7 @@
<url>scummvm-{$release}-iphone.deb?download</url>
<name>iPhone package</name>
<extra_info>(10.7M .deb)</extra_info>
<user_agent>like Mac OS X</user_agent>
</file>
-->
<file>
Expand Down Expand Up @@ -292,6 +298,7 @@
<url>scummvm-{$release}-solaris10-x86.pkg.7z?download</url>
<name>iSolaris 10 x86, Solaris 11 x86, OpenIndiana binary</name>
<extra_info>(24.5M .pkg.7z)</extra_info>
<user_agent>SunOS</user_agent>
</file>
<!--
<file>
Expand Down Expand Up @@ -327,6 +334,7 @@
<url>scummvm-{$release}-amigaos4.lha?download</url>
<name>AmigaOS 4 package</name>
<extra_info>(13.9M .lha)</extra_info>
<user_agent>Amiga</user_agent>
</file>

<!--
Expand Down Expand Up @@ -542,6 +550,7 @@
<url>scummvm-1.5.0-iphone.deb?download</url>
<name>1.5.0 iPhone package</name>
<extra_info>(10.7M .deb)</extra_info>
<user_agent>like Mac OS X</user_agent>
</file>

<file>
Expand Down Expand Up @@ -588,6 +597,7 @@
<url>scummvm-1.5.0-morphos.lha?download</url>
<name>1.5.0 MorphOS package</name>
<extra_info>(13.9M .lha)</extra_info>
<user_agent>MorphOS</user_agent>
</file>
<file>
<category_icon>catpl-debian.png</category_icon>
Expand Down Expand Up @@ -640,6 +650,7 @@
<url>scummvm-1.4.1-os2.zip?download</url>
<name>1.4.1 OS/2 package</name>
<extra_info>(8.9M .zip)</extra_info>
<user_agent>OS/2</user_agent>
</file>
<file>
<category_icon>catpl-win64.png</category_icon>
Expand All @@ -652,6 +663,7 @@
<url>scummvm-1.4.0-gcc4-haiku.tgz?download</url>
<name>1.4.0 Haiku package</name>
<extra_info>(8.2M .tgz)</extra_info>
<user_agent>Haiku</user_agent>
</file>

<file>
Expand Down
Binary file added images/downloadbg.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/downloadbgbright.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/scummvm.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ef8f241

Please sign in to comment.