survivalkit 1.0.beta.11 → 1.0.beta.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. data/CHANGELOG.markdown +4 -0
  2. data/lib/survivalkit.rb +2 -2
  3. data/stylesheets/survivalkit/fonts/_all.scss +2 -0
  4. data/stylesheets/survivalkit/fonts/_ss-social.scss +136 -0
  5. data/stylesheets/survivalkit/fonts/_ss-standard.scss +426 -0
  6. data/stylesheets/survivalkit/reset/_reset.scss +4 -0
  7. data/templates/clean/manifest.rb +0 -2
  8. data/templates/drupal/manifest.rb +0 -2
  9. data/templates/project/manifest.rb +44 -46
  10. data/templates/project/sources/FitVids/README.md +49 -0
  11. data/templates/project/sources/FitVids/jquery.fitvids.js +80 -0
  12. data/templates/project/sources/FitVids/tests.html +66 -0
  13. data/templates/project/sources/Geared-Scrolling/README.md +31 -0
  14. data/templates/project/sources/Geared-Scrolling/css/specific.css +88 -0
  15. data/templates/project/sources/Geared-Scrolling/images/col1.png +0 -0
  16. data/templates/project/sources/Geared-Scrolling/images/col2.png +0 -0
  17. data/templates/project/sources/Geared-Scrolling/images/col3.png +0 -0
  18. data/templates/project/sources/Geared-Scrolling/images/header.png +0 -0
  19. data/templates/project/sources/Geared-Scrolling/index.html +32 -0
  20. data/templates/project/sources/Geared-Scrolling/js/init.js +11 -0
  21. data/templates/project/sources/Geared-Scrolling/js/jquery.heyday.gearedscrolling.js +283 -0
  22. data/templates/project/sources/Lettering.js/README.md +58 -0
  23. data/templates/project/sources/Lettering.js/examples/index.html +135 -0
  24. data/templates/project/sources/Lettering.js/examples/style.css +171 -0
  25. data/templates/project/sources/Lettering.js/jquery.lettering.js +66 -0
  26. data/templates/project/sources/Respond/README.md +100 -0
  27. data/templates/project/sources/Respond/cross-domain/example.html +24 -0
  28. data/templates/project/sources/Respond/cross-domain/respond-proxy.html +96 -0
  29. data/templates/project/sources/Respond/cross-domain/respond.proxy.gif +0 -0
  30. data/templates/project/sources/Respond/cross-domain/respond.proxy.js +127 -0
  31. data/templates/project/sources/Respond/respond.min.js +6 -0
  32. data/templates/project/sources/Respond/respond.src.js +326 -0
  33. data/templates/project/sources/Respond/test/test.css +80 -0
  34. data/templates/project/sources/Respond/test/test.html +20 -0
  35. data/templates/project/sources/Respond/test/test2.css +8 -0
  36. data/templates/project/sources/Respond/test/unit/index.html +29 -0
  37. data/templates/project/sources/Respond/test/unit/qunit/qunit.css +226 -0
  38. data/templates/project/sources/Respond/test/unit/qunit/qunit.js +1598 -0
  39. data/templates/project/sources/Respond/test/unit/test.css +73 -0
  40. data/templates/project/sources/Respond/test/unit/test2.css +5 -0
  41. data/templates/project/sources/Respond/test/unit/test3.css +5 -0
  42. data/templates/project/sources/Respond/test/unit/tests.js +144 -0
  43. data/templates/project/sources/box-sizing-polyfill/README.md +24 -0
  44. data/templates/project/sources/box-sizing-polyfill/boxsizing.htc +501 -0
  45. data/templates/project/sources/formalize/README.txt +26 -0
  46. data/templates/project/sources/formalize/assets/css/_formalize.sass +326 -0
  47. data/templates/project/sources/formalize/assets/css/demo.css +654 -0
  48. data/templates/project/sources/formalize/assets/css/formalize.css +368 -0
  49. data/templates/project/sources/formalize/assets/css/reset.css +211 -0
  50. data/templates/project/sources/formalize/assets/css/text.css +81 -0
  51. data/templates/project/sources/formalize/assets/images/button.png +0 -0
  52. data/templates/project/sources/formalize/assets/images/select_arrow.gif +0 -0
  53. data/templates/project/sources/formalize/assets/js/dojo.formalize.js +202 -0
  54. data/templates/project/sources/formalize/assets/js/dojo.formalize.min.js +1 -0
  55. data/templates/project/sources/formalize/assets/js/extjs.formalize.js +192 -0
  56. data/templates/project/sources/formalize/assets/js/extjs.formalize.min.js +1 -0
  57. data/templates/project/sources/formalize/assets/js/jquery.formalize.js +181 -0
  58. data/templates/project/sources/formalize/assets/js/jquery.formalize.min.js +1 -0
  59. data/templates/project/sources/formalize/assets/js/mootools.formalize.js +193 -0
  60. data/templates/project/sources/formalize/assets/js/mootools.formalize.min.js +1 -0
  61. data/templates/project/sources/formalize/assets/js/prototype.formalize.js +192 -0
  62. data/templates/project/sources/formalize/assets/js/prototype.formalize.min.js +1 -0
  63. data/templates/project/sources/formalize/assets/js/yui.formalize.js +183 -0
  64. data/templates/project/sources/formalize/assets/js/yui.formalize.min.js +1 -0
  65. data/templates/project/sources/formalize/demo.html +130 -0
  66. data/templates/project/sources/formalize/dojo_demo.html +215 -0
  67. data/templates/project/sources/formalize/dojo_disabled.html +215 -0
  68. data/templates/project/sources/formalize/dojo_errors.html +215 -0
  69. data/templates/project/sources/formalize/extjs_demo.html +215 -0
  70. data/templates/project/sources/formalize/extjs_disabled.html +215 -0
  71. data/templates/project/sources/formalize/extjs_errors.html +215 -0
  72. data/templates/project/sources/formalize/jquery_demo.html +215 -0
  73. data/templates/project/sources/formalize/jquery_disabled.html +215 -0
  74. data/templates/project/sources/formalize/jquery_errors.html +215 -0
  75. data/templates/project/sources/formalize/mootools_demo.html +215 -0
  76. data/templates/project/sources/formalize/mootools_disabled.html +215 -0
  77. data/templates/project/sources/formalize/mootools_errors.html +215 -0
  78. data/templates/project/sources/formalize/prototype_demo.html +215 -0
  79. data/templates/project/sources/formalize/prototype_disabled.html +215 -0
  80. data/templates/project/sources/formalize/prototype_errors.html +215 -0
  81. data/templates/project/sources/formalize/unstyled.html +210 -0
  82. data/templates/project/sources/formalize/yui_demo.html +223 -0
  83. data/templates/project/sources/formalize/yui_disabled.html +223 -0
  84. data/templates/project/sources/formalize/yui_errors.html +223 -0
  85. data/templates/project/sources/iOS-Orientationchange-Fix/README.md +16 -0
  86. data/templates/project/sources/iOS-Orientationchange-Fix/demo.html +43 -0
  87. data/templates/project/sources/iOS-Orientationchange-Fix/ios-orientationchange-fix.js +56 -0
  88. data/templates/project/sources/jQuery-widowFix/index.html +159 -0
  89. data/templates/project/sources/jQuery-widowFix/js/jquery-1.4.3.min.js +166 -0
  90. data/templates/project/sources/jQuery-widowFix/js/jquery.widowFix-1.3.2.js +135 -0
  91. data/templates/project/sources/jQuery-widowFix/js/jquery.widowFix-1.3.2.min.js +10 -0
  92. data/templates/project/sources/jQuery-widowFix/sample.html +84 -0
  93. data/templates/project/sources/jquery-html5-placeholder-shim/jquery.html5-placeholder-shim.js +96 -0
  94. data/templates/project/sources/jquery-html5-placeholder-shim/readme.md +22 -0
  95. data/templates/project/sources/jquery-html5-placeholder-shim/test.html +103 -0
  96. data/templates/project/sources/ss-social/ss-social.js +78 -0
  97. data/templates/project/sources/ss-standard/ss-standard.js +78 -0
  98. data/templates/shared/partials/01-variables/_colors.scss +2 -6
  99. data/templates/shared/partials/01-variables/_fonts.scss +49 -2
  100. data/templates/shared/partials/01-variables/_settings.scss +48 -13
  101. data/templates/shared/partials/04-base/_all.scss +0 -2
  102. data/templates/shared/partials/04-base/_common.scss +0 -4
  103. data/templates/shared/partials/05-layout/_grids-susy.scss +4 -4
  104. data/templates/shared/style.scss +9 -9
  105. metadata +93 -5
  106. data/templates/shared/partials/04-base/_edits.scss +0 -8
  107. data/templates/shared/partials/04-base/_font-face.scss +0 -14
@@ -0,0 +1,171 @@
1
+ html, body, div, span, object, iframe,
2
+ h1, h2, h3, h4, h5, h6, p, blockquote, pre,
3
+ abbr, address, cite, code,
4
+ del, dfn, em, img, ins, kbd, q, samp,
5
+ small, strong, sub, sup, var,
6
+ b, i,
7
+ dl, dt, dd, ol, ul, li,
8
+ fieldset, form, label, legend,
9
+ table, caption, tbody, tfoot, thead, tr, th, td,
10
+ article, aside, canvas, details, figcaption, figure,
11
+ footer, header, hgroup, menu, nav, section, summary,
12
+ time, mark, audio, video {
13
+ margin:0;
14
+ padding:0;
15
+ border:0;
16
+ outline:0;
17
+ font-size:100%;
18
+ vertical-align:baseline;
19
+ background:transparent;
20
+ }
21
+
22
+ article, aside, details, figcaption, figure,
23
+ footer, header, hgroup, menu, nav, section {
24
+ display:block;
25
+ }
26
+
27
+ nav ul { list-style:none; }
28
+
29
+ blockquote, q { quotes:none; }
30
+
31
+ blockquote:before, blockquote:after,
32
+ q:before, q:after { content:''; content:none; }
33
+
34
+ a { margin:0; padding:0; font-size:100%; vertical-align:baseline; background:transparent; }
35
+
36
+ ins { background-color:#ff9; color:#000; text-decoration:none; }
37
+
38
+ mark { background-color:#ff9; color:#000; font-style:italic; font-weight:bold; }
39
+
40
+ del { text-decoration: line-through; }
41
+
42
+ abbr[title], dfn[title] { border-bottom:1px dotted; cursor:help; }
43
+
44
+ /* tables still need cellspacing="0" in the markup */
45
+ table { border-collapse:collapse; border-spacing:0; }
46
+
47
+ hr { display:block; height:1px; border:0; border-top:1px solid #ccc; margin:1em 0; padding:0; }
48
+
49
+ input, select { vertical-align:middle; }
50
+ /* END RESET CSS */
51
+
52
+ body { font:13px/1.231 sans-serif; *font-size:small; } /* hack retained to preserve specificity */
53
+
54
+ select, input, textarea, button { font:99% sans-serif; }
55
+ pre, code, kbd, samp { font-family: monospace, sans-serif; }
56
+
57
+ body, select, input, textarea {
58
+ color: #444;
59
+ }
60
+
61
+ h1,h2,h3,h4,h5,h6 { font-weight: bold; }
62
+ html { overflow-y: scroll; }
63
+
64
+ a:hover, a:active { outline: none; }
65
+ a, a:active, a:visited { color: #607890; }
66
+ a:hover { color: #036; }
67
+
68
+ ul, ol { margin-left: 1.8em; }
69
+ ol { list-style-type: decimal; }
70
+
71
+ small { font-size: 85%; }
72
+ strong, th { font-weight: bold; }
73
+
74
+ td, td img { vertical-align: top; }
75
+
76
+ sub { vertical-align: sub; font-size: smaller; }
77
+ sup { vertical-align: super; font-size: smaller; }
78
+
79
+ pre {
80
+ padding: 15px;
81
+ white-space: pre; /* CSS2 */
82
+ white-space: pre-wrap; /* CSS 2.1 */
83
+ white-space: pre-line; /* CSS 3 (and 2.1 as well, actually) */
84
+ word-wrap: break-word; /* IE */
85
+ }
86
+
87
+ textarea { overflow: auto; }
88
+ .ie6 legend, .ie7 legend { margin-left: -7px; }
89
+ input[type="radio"] { vertical-align: text-bottom; }
90
+ input[type="checkbox"] { vertical-align: bottom; }
91
+ .ie7 input[type="checkbox"] { vertical-align: baseline; }
92
+ .ie6 input { vertical-align: text-bottom; }
93
+ label, input[type=button], input[type=submit], button { cursor: pointer; }
94
+ button, input, select, textarea { margin: 0; }
95
+ input:valid, textarea:valid { }
96
+ input:invalid, textarea:invalid {
97
+ border-radius: 1px;
98
+ -moz-box-shadow: 0px 0px 5px red;
99
+ -webkit-box-shadow: 0px 0px 5px red;
100
+ box-shadow: 0px 0px 5px red;
101
+ }
102
+ .no-boxshadow input:invalid,
103
+ .no-boxshadow textarea:invalid { background-color: #f0dddd; }
104
+ ::-moz-selection{ background: #FF5E99; color:#fff; text-shadow: none; }
105
+ ::selection { background:#FF5E99; color:#fff; text-shadow: none; }
106
+
107
+ a:link { -webkit-tap-highlight-color: #FF5E99; }
108
+
109
+ button { width: auto; overflow: visible; }
110
+
111
+ .ie7 img { -ms-interpolation-mode: bicubic; }
112
+
113
+ .hidden { display: none; visibility: hidden; }
114
+
115
+ .visuallyhidden { position: absolute !important;
116
+ clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
117
+ clip: rect(1px, 1px, 1px, 1px); }
118
+ .invisible { visibility: hidden; }
119
+ .clearfix:after { content: "\0020"; display: block; height: 0; clear: both; visibility: hidden; }
120
+ .clearfix { zoom: 1; }
121
+
122
+
123
+ body { background:#baddad;}
124
+
125
+ #container {
126
+ width: 800px;
127
+ margin:50px auto 200px;
128
+ padding:50px;
129
+ background:#fff;
130
+ }
131
+
132
+ pre {
133
+ display:block;
134
+ border:1px solid #ccc;
135
+ background:#f8f8f8;
136
+ margin-bottom:2em;
137
+ }
138
+
139
+ h1, h2, h3, h4 { }
140
+ h1 { font-size: 48px; text-transform:uppercase; margin-bottom: 0em; }
141
+ h2 { font-size: 28px; margin-bottom: 0.5em; }
142
+ h3 { font-size: 34px; margin-bottom: 0.5em; }
143
+ h4 { margin-bottom: 0.5em; }
144
+
145
+ section { margin-bottom: 4em; }
146
+
147
+ p { margin-bottom:1.5em;}
148
+
149
+ @media print {
150
+ * { background: transparent !important; color: #444 !important; text-shadow: none !important; }
151
+
152
+ a, a:visited { color: #444 !important; text-decoration: underline; }
153
+
154
+ a:after { content: " (" attr(href) ")"; }
155
+
156
+ abbr:after { content: " (" attr(title) ")"; }
157
+
158
+ .ir a:after { content: ""; } /* Don't show links for images */
159
+
160
+ pre, blockquote { border: 1px solid #999; page-break-inside: avoid; }
161
+
162
+ thead { display: table-header-group; } /* css-discuss.incutio.com/wiki/Printing_Tables */
163
+
164
+ tr, img { page-break-inside: avoid; }
165
+
166
+ @page { margin: 0.5cm; }
167
+
168
+ p, h2, h3 { orphans: 3; widows: 3; }
169
+
170
+ h2, h3{ page-break-after: avoid; }
171
+ }
@@ -0,0 +1,66 @@
1
+ /*global jQuery */
2
+ /*!
3
+ * Lettering.JS 0.6.1
4
+ *
5
+ * Copyright 2010, Dave Rupert http://daverupert.com
6
+ * Released under the WTFPL license
7
+ * http://sam.zoy.org/wtfpl/
8
+ *
9
+ * Thanks to Paul Irish - http://paulirish.com - for the feedback.
10
+ *
11
+ * Date: Mon Sep 20 17:14:00 2010 -0600
12
+ */
13
+ (function($){
14
+ function injector(t, splitter, klass, after) {
15
+ var a = t.text().split(splitter), inject = '';
16
+ if (a.length) {
17
+ $(a).each(function(i, item) {
18
+ inject += '<span class="'+klass+(i+1)+'">'+item+'</span>'+after;
19
+ });
20
+ t.empty().append(inject);
21
+ }
22
+ }
23
+
24
+ var methods = {
25
+ init : function() {
26
+
27
+ return this.each(function() {
28
+ injector($(this), '', 'char', '');
29
+ });
30
+
31
+ },
32
+
33
+ words : function() {
34
+
35
+ return this.each(function() {
36
+ injector($(this), ' ', 'word', ' ');
37
+ });
38
+
39
+ },
40
+
41
+ lines : function() {
42
+
43
+ return this.each(function() {
44
+ var r = "eefec303079ad17405c889e092e105b0";
45
+ // Because it's hard to split a <br/> tag consistently across browsers,
46
+ // (*ahem* IE *ahem*), we replaces all <br/> instances with an md5 hash
47
+ // (of the word "split"). If you're trying to use this plugin on that
48
+ // md5 hash string, it will fail because you're being ridiculous.
49
+ injector($(this).children("br").replaceWith(r).end(), r, 'line', '');
50
+ });
51
+
52
+ }
53
+ };
54
+
55
+ $.fn.lettering = function( method ) {
56
+ // Method calling logic
57
+ if ( method && methods[method] ) {
58
+ return methods[ method ].apply( this, [].slice.call( arguments, 1 ));
59
+ } else if ( method === 'letters' || ! method ) {
60
+ return methods.init.apply( this, [].slice.call( arguments, 0 ) ); // always pass an array
61
+ }
62
+ $.error( 'Method ' + method + ' does not exist on jQuery.lettering' );
63
+ return this;
64
+ };
65
+
66
+ })(jQuery);
@@ -0,0 +1,100 @@
1
+ # Respond.js
2
+ ### A fast & lightweight polyfill for min/max-width CSS3 Media Queries (for IE 6-8, and more)
3
+
4
+ - Copyright 2011: Scott Jehl, scottjehl.com
5
+ - Dual licensed under the MIT or GPL Version 2 licenses.
6
+
7
+ The goal of this script is to provide a fast and lightweight (3kb minified / 1kb gzipped) script to enable [responsive web designs](http://www.alistapart.com/articles/responsive-web-design/) in browsers that don't support CSS3 Media Queries - in particular, Internet Explorer 8 and under. It's written in such a way that it will probably patch support for other non-supporting browsers as well (more information on that soon).
8
+
9
+ If you're unfamiliar with the concepts surrounding Responsive Web Design, you can read up [here](http://www.alistapart.com/articles/responsive-web-design/) and also [here](http://filamentgroup.com/examples/responsive-images/)
10
+
11
+ [Demo page](http://scottjehl.github.com/Respond/test/test.html) (the colors change to show media queries working)
12
+
13
+
14
+ Usage Instructions
15
+ ======
16
+
17
+ 1. Craft your CSS with min/max-width media queries to adapt your layout from mobile (first) all the way up to desktop
18
+
19
+
20
+ <pre>
21
+ @media screen and (min-width: 480px){
22
+ ...styles for 480px and up go here
23
+ }
24
+ </pre>
25
+
26
+ 2. Reference the respond.min.js script (1kb min/gzipped) after all of your CSS (the earlier it runs, the greater chance IE users will not see a flash of um-media'd content)
27
+
28
+ 3. Crack open Internet Explorer and pump fists in delight
29
+
30
+
31
+ CDN/X-Domain Setup
32
+ ======
33
+
34
+ Respond.js works by requesting a pristine copy of your CSS via AJAX, so if you host your stylesheets on a CDN (or a subdomain), you'll need to upload a proxy page to enable cross-domain communication.
35
+
36
+ See `cross-domain/example.html` for a demo:
37
+
38
+ - Upload `cross-domain/respond-proxy.html` to your external domain
39
+ - Upload `cross-domain/respond.proxy.gif` to your origin domain
40
+ - Reference the file(s) via `<link />` element(s):
41
+
42
+ <pre>
43
+ &lt;!-- Respond.js proxy on external server --&gt;
44
+ &lt;link href=&quot;http://externalcdn.com/respond-proxy.html&quot; id=&quot;respond-proxy&quot; rel=&quot;respond-proxy&quot; /&gt;
45
+
46
+ &lt;!-- Respond.js redirect location on local server --&gt;
47
+ &lt;link href=&quot;/path/to/respond.proxy.gif&quot; id=&quot;respond-redirect&quot; rel=&quot;respond-redirect&quot; /&gt;
48
+
49
+ &lt;!-- Respond.js proxy script on local server --&gt;
50
+ &lt;script src="/path/to/respond.proxy.js"&gt;&lt;/script&gt;
51
+ </pre>
52
+
53
+ Note: HUGE thanks to @doctyper for the contributions in the cross-domain proxy!
54
+
55
+
56
+ Support & Caveats
57
+ ======
58
+
59
+ Some notes to keep in mind:
60
+
61
+ - This script's focus is purposely very narrow: only min-width and max-width media queries and all media types (screen, print, etc) are translated to non-supporting browsers. I wanted to keep things simple for filesize, maintenance, and performance, so I've intentionally limited support to queries that are essential to building a (mobile-first) responsive design. In the future, I may rework things a bit to include a hook for patching-in additional media query features - stay tuned!
62
+
63
+ - Browsers that natively support CSS3 Media Queries are opted-out of running this script as quickly as possible. In testing for support, all other browsers are subjected to a quick test to determine whether they support media queries or not before proceeding to run the script. This test is now included separately at the top, and uses the window.matchMedia polyfill found here: https://github.com/paulirish/matchMedia.js . If you are already including this polyfill via Modernizr or otherwise, feel free to remove that part.
64
+
65
+ - This script relies on no other scripts or frameworks (aside from the included matchMedia polyfill), and is optimized for mobile delivery (~1kb total filesize min/gzip)
66
+
67
+ - As you might guess, this implementation is quite dumb in regards to CSS parsing rules. This is a good thing, because that allows it to run really fast, but it's looseness may also cause unexpected behavior. For example: if you enclose a whole media query in a comment intending to disable its rules, you'll probably find that those rules will end up enabled in non-media-query-supporting browsers.
68
+
69
+ - Respond.js doesn't parse CSS refrenced via @import, nor does it work with media queries within style elements, as those styles can't be re-requested for parsing.
70
+
71
+ - Due to security restrictions, some browsers may not allow this script to work on file:// urls (because it uses xmlHttpRequest). Run it on a web server.
72
+
73
+ - Currently, media attributes on link elements are supported, but only if the linked stylesheet contains no media queries. If it does contain queries, the media attribute will be ignored and the internal queries will be parsed normally. In other words, @media statements in the CSS take priority.
74
+
75
+ - Reportedly, if CSS files are encoded in UTF-8 with Byte-Order-Mark (BOM), they will not work with Respond.js in IE7 or IE8. Noted in issue #97
76
+
77
+ - WARNING: Including @font-face rules inside a media query will cause IE7 and IE8 to hang during load. To work around this, place @font-face rules in the wide open, as a sibling to other media queries.
78
+
79
+
80
+ How's it work?
81
+ ======
82
+ Basically, the script loops through the CSS referenced in the page and runs a regular expression or two on their contents to find media queries and their associated blocks of CSS. In Internet Explorer, the content of the stylesheet is impossible to retrieve in its pre-parsed state (which in IE 8-, means its media queries are removed from the text), so Respond.js re-requests the CSS files using Ajax and parses the text response from there. Be sure to configure your CSS files' caching properly so that this re-request doesn't actually go to the server, hitting your browser cache instead.
83
+
84
+ From there, each media query block is appended to the head in order via style elements, and those style elements are enabled and disabled (read: appended and removed from the DOM) depending on how their min/max width compares with the browser width. The media attribute on the style elements will match that of the query in the CSS, so it could be "screen", "projector", or whatever you want. Any relative paths contained in the CSS will be prefixed by their stylesheet's href, so image paths will direct to their proper destination
85
+
86
+ API Options?
87
+ ======
88
+ Sure, a couple:
89
+
90
+ - respond.update() : rerun the parser (helpful if you added a stylesheet to the page and it needs to be translated)
91
+ - respond.mediaQueriesSupported: set to true if the browser natively supports media queries.
92
+
93
+
94
+
95
+
96
+ Alternatives to this script
97
+ ======
98
+ This isn't the only CSS3 Media Query polyfill script out there; but it damn well may be the fastest.
99
+
100
+ If you're looking for more robust CSS3 Media Query support, you might check out http://code.google.com/p/css3-mediaqueries-js/. In testing, I've found that script to be noticeably slow when rendering complex responsive designs (both in filesize and performance), but it really does support a lot more media query features than this script. Big hat tip to the authors! :)
@@ -0,0 +1,24 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <title>Respond JS Test Page</title>
6
+ <link href="http://scottjehl.com/respond-proxy/test.css" rel="stylesheet"/>
7
+ <link href="http://scottjehl.com/respond-proxy/test2.css" media="screen and (min-width: 600px)" rel="stylesheet"/>
8
+ <script src="../respond.src.js"></script>
9
+
10
+ <!-- Respond.js proxy on external server -->
11
+ <link href="http://scottjehl.com/respond-proxy/respond-proxy.html" id="respond-proxy" rel="respond-proxy" />
12
+ <link href="respond.proxy.gif" id="respond-redirect" rel="respond-redirect" />
13
+ <script src="respond.proxy.js"></script>
14
+ </head>
15
+ <body>
16
+ <p>This is a visual test file for cross-domain proxy.</p>
17
+
18
+ <p>The media queries in the included CSS file simply change the body's background color depending on the browser width. If you see any colors aside from black, then the media queries are working in your browser. You can resize your browser window to see it change on the fly.</p>
19
+
20
+
21
+ <p id="attribute-test">Media-attributes are working too! This should be visible above 600px.</p>
22
+
23
+ </body>
24
+ </html>
@@ -0,0 +1,96 @@
1
+ <!-- Respond.js: min/max-width media query polyfill. Remote proxy (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs -->
2
+ <!DOCTYPE html>
3
+ <html>
4
+ <head>
5
+ <meta charset="utf-8" />
6
+ <title>Respond JS Proxy</title>
7
+ </head>
8
+ <body>
9
+ <script>
10
+ (function () {
11
+ var domain, css, query, getQueryString, ajax, xmlHttp;
12
+
13
+ /*
14
+ http://stackoverflow.com/questions/4963673/get-url-array-variables-in-javascript-jquery/4963817#4963817
15
+ */
16
+ getQueryString = function() {
17
+ var ret = {}, parts, i, p;
18
+
19
+ parts = (document.location.toString().split("?")[1]).split("&");
20
+
21
+ for (i = 0; i < parts.length; i++) {
22
+
23
+ p = parts[i].split("=");
24
+ // so strings will be correctly parsed:
25
+ p[1] = decodeURIComponent(p[1].replace(/\+/g, " "));
26
+
27
+ if (p[0].search(/\[\]/) >= 0) { // then it"s an array
28
+ p[0] = p[0].replace("[]", "");
29
+
30
+ if (typeof ret[p[0]] != "object") {
31
+ ret[p[0]] = [];
32
+ }
33
+ ret[p[0]].push(p[1]);
34
+ } else {
35
+ ret[p[0]] = p[1];
36
+ }
37
+ }
38
+ return ret;
39
+ };
40
+
41
+ ajax = function( url, callback ) {
42
+ var req = xmlHttp();
43
+ if (!req){
44
+ return;
45
+ }
46
+ req.open( "GET", url, true );
47
+ req.onreadystatechange = function () {
48
+ if ( req.readyState != 4 || req.status != 200 && req.status != 304 ){
49
+ return;
50
+ }
51
+ callback( req.responseText );
52
+ };
53
+ if ( req.readyState == 4 ){
54
+ return;
55
+ }
56
+ req.send();
57
+ };
58
+
59
+ //define ajax obj
60
+ xmlHttp = (function() {
61
+ var xmlhttpmethod = false,
62
+ attempts = [
63
+ function(){ return new XMLHttpRequest(); },
64
+ function(){ return new ActiveXObject("Microsoft.XMLHTTP"); },
65
+ function(){ return new ActiveXObject("MSXML2.XMLHTTP.3.0"); }
66
+ ],
67
+ al = attempts.length;
68
+
69
+ while( al-- ){
70
+ try {
71
+ xmlhttpmethod = attempts[ al ]();
72
+ }
73
+ catch(e) {
74
+ continue;
75
+ }
76
+ break;
77
+ }
78
+ return function(){
79
+ return xmlhttpmethod;
80
+ };
81
+ })();
82
+
83
+ query = getQueryString();
84
+ css = query["css"];
85
+ domain = query["url"];
86
+
87
+ if (css && domain) {
88
+ ajax(css, function (response) {
89
+ window.name = response;
90
+ window.location.href = domain;
91
+ });
92
+ }
93
+ }());
94
+ </script>
95
+ </body>
96
+ </html>