This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// To the extent possible under law, the Yawning Angel has waived all copyright | |
// and related or neighboring rights to orhttp_example, using the creative | |
// commons "cc0" public domain dedication. See LICENSE or | |
// <http://creativecommons.org/publicdomain/zero/1.0/> for full details. | |
package main | |
import ( | |
// Things needed by the actual interface. | |
"golang.org/x/net/proxy" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Quick implementation of ResponsiveEnhance by Josh Emerson | |
// Original implementation: https://github.com/joshje/Responsive-Enhance | |
// <img src="sd.jpg" data-hd="hd.jpg"> | |
function quickUpgrade (obj) { | |
var tmp = new Image(); // prepare a loose image to make the request & cache it | |
var newsrc = obj.getAttribute('data-hd'); // grab the URL of hd version | |
if (newsrc) { // make sure it's there |