- Works (ish) on all modern browsers and even on old browsers, such as IE8 or Android 2.3
- IE8 doesn't support :target, so selected link won't change color
- IE8/9 refuse to add pseudo elements around the buttons
- iOS, unlike anything on Android, refuses to apply :hover after touching a span/button - thus we have to use :target (works for links, span/button requires JS)
- I don't recall if it's possible to hack around the :hover limitation on iOS with tabindex and :focus... it had issues for certain.
This file contains hidden or 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
var getHtml = function (lang, pageId) | |
{ | |
var promise = Q.ninvoke(fs, "readFile", getFn(lang, pageId), UTF); | |
var onFailure = (lang == defaultLang | |
? Q.reject | |
: function () { return getHtml(defaultLang, pageId); }); | |
return promise.then(Q.resolve, onFailure); | |
}; |
This file contains hidden or 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
var noop = function(){}; | |
// remove existing Q (hopefully it has no state...) | |
delete require.cache[require.resolve('q')]; | |
// remove freezing so we can modify Q | |
var origFreeze = Object.freeze; | |
Object.freeze = noop; | |
// require Q and restore freezing | |
var Q = require('q'); |
This file contains hidden or 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
then1 | |
then2 | |
fin1 | |
fin2 | |
fin3 |
This file contains hidden or 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
var Q = require("q"); | |
var promise = Q.resolve("ok"); | |
promise | |
.then(function(v){ | |
console.log("then1"); | |
}) | |
.fin(function(){ | |
console.log("fin1"); |
In IE specific stylesheet set $rem-to-px: 16px; and then in your ordinary stylesheets use rem(X) - this will produce Xrem for normal browsers and (X*16)px for IEold.
See also: http://jakearchibald.github.com/sass-ie/
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Invoice</title> | |
<style> | |
body { | |
font-family: sans-serif; | |
width: 640px; | |
margin: 0 auto; |
This file contains hidden or 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
obj.method(arg, options, function(err, value){ | |
if (err) { | |
// handle or rethrow | |
} | |
doSomethingWith(value); | |
}); |
Test case files:
- container.html: IFRAME, 720px wide
- mq.html should display:
- 'Matching: default', when screen is <719px wide
- 'Matching: min-width:719px', when screen is =719px wide
- 'Matching: min-width:720px', when screen is >719px wide
In Firefox:
- just mq.html works as expected (I think... too hard to repro exact circumstances)
- container.html works as expected at 100% zoom
This file contains hidden or 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
For http://localhost:3000/1 the following output will be produced: | |
Matched /:id | |
[ id: '1' ] | |
Matched /* | |
[ '1' ] | |
Timeout in /:id | |
[ '1' ] | |
Notice how req.params inside the /:id handler has changed. |
OlderNewer