guff-compass 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.editorconfig +21 -0
- data/.gitignore +6 -0
- data/LICENSE.txt +22 -0
- data/README.md +21 -0
- data/demo/bower_components/jquery/.bower.json +21 -0
- data/demo/bower_components/jquery/.editorconfig +43 -0
- data/demo/bower_components/jquery/.gitattributes +2 -0
- data/demo/bower_components/jquery/.gitignore +14 -0
- data/demo/bower_components/jquery/.gitmodules +6 -0
- data/demo/bower_components/jquery/.jshintrc +17 -0
- data/demo/bower_components/jquery/.mailmap +94 -0
- data/demo/bower_components/jquery/AUTHORS.txt +170 -0
- data/demo/bower_components/jquery/CONTRIBUTING.md +216 -0
- data/demo/bower_components/jquery/Gruntfile.js +594 -0
- data/demo/bower_components/jquery/MIT-LICENSE.txt +21 -0
- data/demo/bower_components/jquery/README.md +398 -0
- data/demo/bower_components/jquery/bower.json +11 -0
- data/demo/bower_components/jquery/build/release-notes.js +59 -0
- data/demo/bower_components/jquery/build/release.js +316 -0
- data/demo/bower_components/jquery/component.json +15 -0
- data/demo/bower_components/jquery/composer.json +35 -0
- data/demo/bower_components/jquery/jquery-migrate.js +511 -0
- data/demo/bower_components/jquery/jquery-migrate.min.js +3 -0
- data/demo/bower_components/jquery/jquery.js +9789 -0
- data/demo/bower_components/jquery/jquery.min.js +6 -0
- data/demo/bower_components/jquery/jquery.min.map +1 -0
- data/demo/bower_components/jquery/package.json +38 -0
- data/demo/bower_components/jquery/speed/benchmark.js +15 -0
- data/demo/bower_components/jquery/speed/benchmarker.css +65 -0
- data/demo/bower_components/jquery/speed/benchmarker.js +181 -0
- data/demo/bower_components/jquery/speed/closest.html +39 -0
- data/demo/bower_components/jquery/speed/css.html +82 -0
- data/demo/bower_components/jquery/speed/event.html +58 -0
- data/demo/bower_components/jquery/speed/filter.html +183 -0
- data/demo/bower_components/jquery/speed/find.html +179 -0
- data/demo/bower_components/jquery/speed/index.html +72 -0
- data/demo/bower_components/jquery/speed/jquery-basis.js +6238 -0
- data/demo/bower_components/jquery/speed/slice.vs.concat.html +47 -0
- data/demo/bower_components/jquery/src/.jshintrc +27 -0
- data/demo/bower_components/jquery/src/ajax.js +855 -0
- data/demo/bower_components/jquery/src/ajax/jsonp.js +80 -0
- data/demo/bower_components/jquery/src/ajax/script.js +86 -0
- data/demo/bower_components/jquery/src/ajax/xhr.js +207 -0
- data/demo/bower_components/jquery/src/attributes.js +659 -0
- data/demo/bower_components/jquery/src/callbacks.js +197 -0
- data/demo/bower_components/jquery/src/core.js +981 -0
- data/demo/bower_components/jquery/src/css.js +661 -0
- data/demo/bower_components/jquery/src/data.js +336 -0
- data/demo/bower_components/jquery/src/deferred.js +141 -0
- data/demo/bower_components/jquery/src/deprecated.js +11 -0
- data/demo/bower_components/jquery/src/dimensions.js +41 -0
- data/demo/bower_components/jquery/src/effects.js +732 -0
- data/demo/bower_components/jquery/src/event-alias.js +32 -0
- data/demo/bower_components/jquery/src/event.js +995 -0
- data/demo/bower_components/jquery/src/exports.js +21 -0
- data/demo/bower_components/jquery/src/intro.js +20 -0
- data/demo/bower_components/jquery/src/manipulation.js +744 -0
- data/demo/bower_components/jquery/src/offset.js +169 -0
- data/demo/bower_components/jquery/src/outro.js +2 -0
- data/demo/bower_components/jquery/src/queue.js +146 -0
- data/demo/bower_components/jquery/src/serialize.js +99 -0
- data/demo/bower_components/jquery/src/sizzle-jquery.js +7 -0
- data/demo/bower_components/jquery/src/support.js +246 -0
- data/demo/bower_components/jquery/src/traversing.js +283 -0
- data/demo/bower_components/jquery/src/wrap.js +66 -0
- data/demo/bower_components/jquery/test/.jshintignore +3 -0
- data/demo/bower_components/jquery/test/.jshintrc +60 -0
- data/demo/bower_components/jquery/test/data/1x1.jpg +0 -0
- data/demo/bower_components/jquery/test/data/ajax/unreleasedXHR.html +25 -0
- data/demo/bower_components/jquery/test/data/atom+xml.php +4 -0
- data/demo/bower_components/jquery/test/data/badcall.js +1 -0
- data/demo/bower_components/jquery/test/data/badjson.js +1 -0
- data/demo/bower_components/jquery/test/data/cleanScript.html +10 -0
- data/demo/bower_components/jquery/test/data/core/cc_on.html +22 -0
- data/demo/bower_components/jquery/test/data/dashboard.xml +11 -0
- data/demo/bower_components/jquery/test/data/dimensions/documentLarge.html +17 -0
- data/demo/bower_components/jquery/test/data/dimensions/documentSmall.html +21 -0
- data/demo/bower_components/jquery/test/data/echoData.php +1 -0
- data/demo/bower_components/jquery/test/data/echoQuery.php +1 -0
- data/demo/bower_components/jquery/test/data/errorWithJSON.php +6 -0
- data/demo/bower_components/jquery/test/data/errorWithText.php +5 -0
- data/demo/bower_components/jquery/test/data/etag.php +21 -0
- data/demo/bower_components/jquery/test/data/evalScript.php +1 -0
- data/demo/bower_components/jquery/test/data/event/focusElem.html +16 -0
- data/demo/bower_components/jquery/test/data/event/longLoadScript.php +4 -0
- data/demo/bower_components/jquery/test/data/event/promiseReady.html +17 -0
- data/demo/bower_components/jquery/test/data/event/syncReady.html +23 -0
- data/demo/bower_components/jquery/test/data/headers.php +18 -0
- data/demo/bower_components/jquery/test/data/if_modified_since.php +20 -0
- data/demo/bower_components/jquery/test/data/iframe.html +8 -0
- data/demo/bower_components/jquery/test/data/jquery-1.9.1.ajax_xhr.min.js +5 -0
- data/demo/bower_components/jquery/test/data/json.php +13 -0
- data/demo/bower_components/jquery/test/data/json_obj.js +1 -0
- data/demo/bower_components/jquery/test/data/jsonp.php +14 -0
- data/demo/bower_components/jquery/test/data/manipulation/iframe-denied.html +36 -0
- data/demo/bower_components/jquery/test/data/name.html +1 -0
- data/demo/bower_components/jquery/test/data/name.php +24 -0
- data/demo/bower_components/jquery/test/data/nocontent.php +5 -0
- data/demo/bower_components/jquery/test/data/offset/absolute.html +41 -0
- data/demo/bower_components/jquery/test/data/offset/body.html +26 -0
- data/demo/bower_components/jquery/test/data/offset/fixed.html +34 -0
- data/demo/bower_components/jquery/test/data/offset/relative.html +31 -0
- data/demo/bower_components/jquery/test/data/offset/scroll.html +39 -0
- data/demo/bower_components/jquery/test/data/offset/static.html +31 -0
- data/demo/bower_components/jquery/test/data/offset/table.html +43 -0
- data/demo/bower_components/jquery/test/data/params_html.php +12 -0
- data/demo/bower_components/jquery/test/data/readywaitasset.js +1 -0
- data/demo/bower_components/jquery/test/data/readywaitloader.js +25 -0
- data/demo/bower_components/jquery/test/data/script.php +11 -0
- data/demo/bower_components/jquery/test/data/selector/html5_selector.html +114 -0
- data/demo/bower_components/jquery/test/data/selector/sizzle_cache.html +21 -0
- data/demo/bower_components/jquery/test/data/statusText.php +5 -0
- data/demo/bower_components/jquery/test/data/support/bodyBackground.html +28 -0
- data/demo/bower_components/jquery/test/data/support/boxSizing.html +19 -0
- data/demo/bower_components/jquery/test/data/support/csp.js +3 -0
- data/demo/bower_components/jquery/test/data/support/csp.php +22 -0
- data/demo/bower_components/jquery/test/data/support/shrinkWrapBlocks.html +23 -0
- data/demo/bower_components/jquery/test/data/support/testElementCrash.html +17 -0
- data/demo/bower_components/jquery/test/data/test.html +7 -0
- data/demo/bower_components/jquery/test/data/test.js +3 -0
- data/demo/bower_components/jquery/test/data/test.php +7 -0
- data/demo/bower_components/jquery/test/data/test2.html +5 -0
- data/demo/bower_components/jquery/test/data/test3.html +3 -0
- data/demo/bower_components/jquery/test/data/testinit.js +264 -0
- data/demo/bower_components/jquery/test/data/testrunner.js +371 -0
- data/demo/bower_components/jquery/test/data/testsuite.css +155 -0
- data/demo/bower_components/jquery/test/data/text.php +12 -0
- data/demo/bower_components/jquery/test/data/ua.txt +272 -0
- data/demo/bower_components/jquery/test/data/with_fries.xml +25 -0
- data/demo/bower_components/jquery/test/data/with_fries_over_jsonp.php +7 -0
- data/demo/bower_components/jquery/test/delegatetest.html +228 -0
- data/demo/bower_components/jquery/test/hovertest.html +158 -0
- data/demo/bower_components/jquery/test/index.html +337 -0
- data/demo/bower_components/jquery/test/jquery.js +5 -0
- data/demo/bower_components/jquery/test/localfile.html +75 -0
- data/demo/bower_components/jquery/test/networkerror.html +84 -0
- data/demo/bower_components/jquery/test/readywait.html +70 -0
- data/demo/bower_components/jquery/test/unit/ajax.js +2016 -0
- data/demo/bower_components/jquery/test/unit/attributes.js +1388 -0
- data/demo/bower_components/jquery/test/unit/callbacks.js +342 -0
- data/demo/bower_components/jquery/test/unit/core.js +1360 -0
- data/demo/bower_components/jquery/test/unit/css.js +1056 -0
- data/demo/bower_components/jquery/test/unit/data.js +645 -0
- data/demo/bower_components/jquery/test/unit/deferred.js +436 -0
- data/demo/bower_components/jquery/test/unit/deprecated.js +8 -0
- data/demo/bower_components/jquery/test/unit/dimensions.js +472 -0
- data/demo/bower_components/jquery/test/unit/effects.js +2242 -0
- data/demo/bower_components/jquery/test/unit/event.js +2755 -0
- data/demo/bower_components/jquery/test/unit/exports.js +7 -0
- data/demo/bower_components/jquery/test/unit/manipulation.js +2120 -0
- data/demo/bower_components/jquery/test/unit/offset.js +559 -0
- data/demo/bower_components/jquery/test/unit/queue.js +314 -0
- data/demo/bower_components/jquery/test/unit/selector.js +172 -0
- data/demo/bower_components/jquery/test/unit/serialize.js +148 -0
- data/demo/bower_components/jquery/test/unit/support.js +370 -0
- data/demo/bower_components/jquery/test/unit/traversing.js +797 -0
- data/demo/bower_components/jquery/test/unit/wrap.js +265 -0
- data/demo/bower_components/jquery/test/xhtml.php +5 -0
- data/demo/index.html +347 -0
- data/demo/styles/main.css +208 -0
- data/demo/styles/main.scss +138 -0
- data/docs/docco.css +506 -0
- data/docs/guff.html +1127 -0
- data/docs/public/fonts/aller-bold.eot +0 -0
- data/docs/public/fonts/aller-bold.ttf +0 -0
- data/docs/public/fonts/aller-bold.woff +0 -0
- data/docs/public/fonts/aller-light.eot +0 -0
- data/docs/public/fonts/aller-light.ttf +0 -0
- data/docs/public/fonts/aller-light.woff +0 -0
- data/docs/public/fonts/novecento-bold.eot +0 -0
- data/docs/public/fonts/novecento-bold.ttf +0 -0
- data/docs/public/fonts/novecento-bold.woff +0 -0
- data/docs/public/stylesheets/normalize.css +375 -0
- data/guff.gemspec +16 -0
- data/guff.scss +514 -0
- data/gulpfile.js +67 -0
- data/lib/guff.rb +4 -0
- data/lib/stylesheets/_guff.scss +514 -0
- data/package.json +19 -0
- data/src/_functions.scss +57 -0
- data/src/_mixins.scss +301 -0
- data/src/_reset.scss +67 -0
- data/src/_settings.scss +22 -0
- data/src/_typography.scss +67 -0
- metadata +259 -0
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
(function() {
|
|
2
|
+
|
|
3
|
+
if ( !jQuery.fn.wrap ) { // no wrap module
|
|
4
|
+
return;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
module( "wrap", {
|
|
8
|
+
teardown: moduleTeardown
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
// See test/unit/manipulation.js for explanation about these 2 functions
|
|
12
|
+
function manipulationBareObj( value ) {
|
|
13
|
+
return value;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function manipulationFunctionReturningObj( value ) {
|
|
17
|
+
return function() {
|
|
18
|
+
return value;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function testWrap( val ) {
|
|
23
|
+
|
|
24
|
+
expect( 19 );
|
|
25
|
+
|
|
26
|
+
var defaultText, result, j, i, cacheLength;
|
|
27
|
+
|
|
28
|
+
defaultText = "Try them out:";
|
|
29
|
+
result = jQuery("#first").wrap( val("<div class='red'><span></span></div>") ).text();
|
|
30
|
+
|
|
31
|
+
equal( defaultText, result, "Check for wrapping of on-the-fly html" );
|
|
32
|
+
ok( jQuery("#first").parent().parent().is(".red"), "Check if wrapper has class 'red'" );
|
|
33
|
+
|
|
34
|
+
QUnit.reset();
|
|
35
|
+
result = jQuery("#first").wrap( val(document.getElementById("empty")) ).parent();
|
|
36
|
+
ok( result.is("ol"), "Check for element wrapping" );
|
|
37
|
+
equal( result.text(), defaultText, "Check for element wrapping" );
|
|
38
|
+
|
|
39
|
+
QUnit.reset();
|
|
40
|
+
jQuery("#check1").on( "click", function() {
|
|
41
|
+
var checkbox = this;
|
|
42
|
+
|
|
43
|
+
ok( checkbox.checked, "Checkbox's state is erased after wrap() action, see #769" );
|
|
44
|
+
jQuery( checkbox ).wrap( val("<div id='c1' style='display:none;'></div>") );
|
|
45
|
+
ok( checkbox.checked, "Checkbox's state is erased after wrap() action, see #769" );
|
|
46
|
+
}).prop( "checked", false )[ 0 ].click();
|
|
47
|
+
|
|
48
|
+
// using contents will get comments regular, text, and comment nodes
|
|
49
|
+
j = jQuery("#nonnodes").contents();
|
|
50
|
+
j.wrap( val("<i></i>") );
|
|
51
|
+
|
|
52
|
+
// Blackberry 4.6 doesn't maintain comments in the DOM
|
|
53
|
+
equal( jQuery("#nonnodes > i").length, jQuery("#nonnodes")[ 0 ].childNodes.length, "Check node,textnode,comment wraps ok" );
|
|
54
|
+
equal( jQuery("#nonnodes > i").text(), j.text(), "Check node,textnode,comment wraps doesn't hurt text" );
|
|
55
|
+
|
|
56
|
+
// Try wrapping a disconnected node
|
|
57
|
+
cacheLength = 0;
|
|
58
|
+
for ( i in jQuery.cache ) {
|
|
59
|
+
cacheLength++;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
j = jQuery("<label/>").wrap( val("<li/>") );
|
|
63
|
+
equal( j[ 0 ] .nodeName.toUpperCase(), "LABEL", "Element is a label" );
|
|
64
|
+
equal( j[ 0 ].parentNode.nodeName.toUpperCase(), "LI", "Element has been wrapped" );
|
|
65
|
+
|
|
66
|
+
for ( i in jQuery.cache ) {
|
|
67
|
+
cacheLength--;
|
|
68
|
+
}
|
|
69
|
+
equal( cacheLength, 0, "No memory leak in jQuery.cache (bug #7165)" );
|
|
70
|
+
|
|
71
|
+
// Wrap an element containing a text node
|
|
72
|
+
j = jQuery("<span/>").wrap("<div>test</div>");
|
|
73
|
+
equal( j[ 0 ].previousSibling.nodeType, 3, "Make sure the previous node is a text element" );
|
|
74
|
+
equal( j[ 0 ].parentNode.nodeName.toUpperCase(), "DIV", "And that we're in the div element." );
|
|
75
|
+
|
|
76
|
+
// Try to wrap an element with multiple elements (should fail)
|
|
77
|
+
j = jQuery("<div><span></span></div>").children().wrap("<p></p><div></div>");
|
|
78
|
+
equal( j[ 0 ].parentNode.parentNode.childNodes.length, 1, "There should only be one element wrapping." );
|
|
79
|
+
equal( j.length, 1, "There should only be one element (no cloning)." );
|
|
80
|
+
equal( j[ 0 ].parentNode.nodeName.toUpperCase(), "P", "The span should be in the paragraph." );
|
|
81
|
+
|
|
82
|
+
// Wrap an element with a jQuery set
|
|
83
|
+
j = jQuery("<span/>").wrap( jQuery("<div></div>") );
|
|
84
|
+
equal( j[ 0 ].parentNode.nodeName.toLowerCase(), "div", "Wrapping works." );
|
|
85
|
+
|
|
86
|
+
// Wrap an element with a jQuery set and event
|
|
87
|
+
result = jQuery("<div></div>").on( "click", function() {
|
|
88
|
+
ok( true, "Event triggered." );
|
|
89
|
+
|
|
90
|
+
// Remove handlers on detached elements
|
|
91
|
+
result.off();
|
|
92
|
+
jQuery(this).off();
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
j = jQuery("<span/>").wrap( result );
|
|
96
|
+
equal( j[ 0 ].parentNode.nodeName.toLowerCase(), "div", "Wrapping works." );
|
|
97
|
+
|
|
98
|
+
j.parent().trigger("click");
|
|
99
|
+
|
|
100
|
+
// clean up attached elements
|
|
101
|
+
QUnit.reset();
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
test( "wrap(String|Element)", function() {
|
|
105
|
+
testWrap( manipulationBareObj );
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
test( "wrap(Function)", function() {
|
|
109
|
+
testWrap( manipulationFunctionReturningObj );
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
test( "wrap(Function) with index (#10177)", function() {
|
|
113
|
+
var expectedIndex = 0,
|
|
114
|
+
targets = jQuery("#qunit-fixture p");
|
|
115
|
+
|
|
116
|
+
expect( targets.length );
|
|
117
|
+
targets.wrap(function(i) {
|
|
118
|
+
equal( i, expectedIndex, "Check if the provided index (" + i + ") is as expected (" + expectedIndex + ")" );
|
|
119
|
+
expectedIndex++;
|
|
120
|
+
|
|
121
|
+
return "<div id='wrap_index_'" + i + "'></div>";
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
test( "wrap(String) consecutive elements (#10177)", function() {
|
|
126
|
+
var targets = jQuery("#qunit-fixture p");
|
|
127
|
+
|
|
128
|
+
expect( targets.length * 2 );
|
|
129
|
+
targets.wrap("<div class='wrapper'></div>");
|
|
130
|
+
|
|
131
|
+
targets.each(function() {
|
|
132
|
+
var $this = jQuery(this);
|
|
133
|
+
|
|
134
|
+
ok( $this.parent().is(".wrapper"), "Check each elements parent is correct (.wrapper)" );
|
|
135
|
+
equal( $this.siblings().length, 0, "Each element should be wrapped individually" );
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
function testWrapAll( val ) {
|
|
140
|
+
|
|
141
|
+
expect( 8 );
|
|
142
|
+
|
|
143
|
+
var prev, p, result;
|
|
144
|
+
|
|
145
|
+
prev = jQuery("#firstp")[ 0 ].previousSibling;
|
|
146
|
+
p = jQuery("#firstp,#first")[ 0 ].parentNode;
|
|
147
|
+
result = jQuery("#firstp,#first").wrapAll( val("<div class='red'><div class='tmp'></div></div>") );
|
|
148
|
+
|
|
149
|
+
equal( result.parent().length, 1, "Check for wrapping of on-the-fly html" );
|
|
150
|
+
ok( jQuery("#first").parent().parent().is(".red"), "Check if wrapper has class 'red'" );
|
|
151
|
+
ok( jQuery("#firstp").parent().parent().is(".red"), "Check if wrapper has class 'red'" );
|
|
152
|
+
equal( jQuery("#first").parent().parent()[ 0 ].previousSibling, prev, "Correct Previous Sibling" );
|
|
153
|
+
equal( jQuery("#first").parent().parent()[ 0 ].parentNode, p, "Correct Parent" );
|
|
154
|
+
|
|
155
|
+
QUnit.reset();
|
|
156
|
+
prev = jQuery("#firstp")[ 0 ].previousSibling;
|
|
157
|
+
p = jQuery("#first")[ 0 ].parentNode;
|
|
158
|
+
jQuery("#firstp,#first").wrapAll( val(document.getElementById("empty")) );
|
|
159
|
+
|
|
160
|
+
equal( jQuery("#first").parent()[ 0 ], jQuery("#firstp").parent()[ 0 ], "Same Parent" );
|
|
161
|
+
equal( jQuery("#first").parent()[ 0 ].previousSibling, prev, "Correct Previous Sibling" );
|
|
162
|
+
equal( jQuery("#first").parent()[ 0 ].parentNode, p, "Correct Parent" );
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
test( "wrapAll(String|Element)", function() {
|
|
166
|
+
testWrapAll( manipulationBareObj );
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
function testWrapInner( val ) {
|
|
170
|
+
|
|
171
|
+
expect( 11 );
|
|
172
|
+
|
|
173
|
+
var num, div;
|
|
174
|
+
|
|
175
|
+
num = jQuery("#first").children().length;
|
|
176
|
+
jQuery("#first").wrapInner( val("<div class='red'><div id='tmp'></div></div>") );
|
|
177
|
+
|
|
178
|
+
equal( jQuery("#first").children().length, 1, "Only one child" );
|
|
179
|
+
ok( jQuery("#first").children().is(".red"), "Verify Right Element" );
|
|
180
|
+
equal( jQuery("#first").children().children().children().length, num, "Verify Elements Intact" );
|
|
181
|
+
|
|
182
|
+
QUnit.reset();
|
|
183
|
+
num = jQuery("#first").html("foo<div>test</div><div>test2</div>").children().length;
|
|
184
|
+
jQuery("#first").wrapInner( val("<div class='red'><div id='tmp'></div></div>") );
|
|
185
|
+
equal( jQuery("#first").children().length, 1, "Only one child" );
|
|
186
|
+
ok( jQuery("#first").children().is(".red"), "Verify Right Element" );
|
|
187
|
+
equal( jQuery("#first").children().children().children().length, num, "Verify Elements Intact" );
|
|
188
|
+
|
|
189
|
+
QUnit.reset();
|
|
190
|
+
num = jQuery("#first").children().length;
|
|
191
|
+
jQuery("#first").wrapInner( val(document.getElementById("empty")) );
|
|
192
|
+
equal( jQuery("#first").children().length, 1, "Only one child" );
|
|
193
|
+
ok( jQuery("#first").children().is("#empty"), "Verify Right Element" );
|
|
194
|
+
equal( jQuery("#first").children().children().length, num, "Verify Elements Intact" );
|
|
195
|
+
|
|
196
|
+
div = jQuery("<div/>");
|
|
197
|
+
div.wrapInner( val("<span></span>") );
|
|
198
|
+
equal( div.children().length, 1, "The contents were wrapped." );
|
|
199
|
+
equal( div.children()[ 0 ].nodeName.toLowerCase(), "span", "A span was inserted." );
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
test( "wrapInner(String|Element)", function() {
|
|
203
|
+
testWrapInner( manipulationBareObj );
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
test( "wrapInner(Function)", function() {
|
|
207
|
+
testWrapInner( manipulationFunctionReturningObj );
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
test( "unwrap()", function() {
|
|
211
|
+
|
|
212
|
+
expect( 9 );
|
|
213
|
+
|
|
214
|
+
jQuery("body").append(" <div id='unwrap' style='display: none;'> <div id='unwrap1'> <span class='unwrap'>a</span> <span class='unwrap'>b</span> </div> <div id='unwrap2'> <span class='unwrap'>c</span> <span class='unwrap'>d</span> </div> <div id='unwrap3'> <b><span class='unwrap unwrap3'>e</span></b> <b><span class='unwrap unwrap3'>f</span></b> </div> </div>");
|
|
215
|
+
|
|
216
|
+
var abcd = jQuery("#unwrap1 > span, #unwrap2 > span").get(),
|
|
217
|
+
abcdef = jQuery("#unwrap span").get();
|
|
218
|
+
|
|
219
|
+
equal( jQuery("#unwrap1 span").add("#unwrap2 span:first-child").unwrap().length, 3, "make #unwrap1 and #unwrap2 go away" );
|
|
220
|
+
deepEqual( jQuery("#unwrap > span").get(), abcd, "all four spans should still exist" );
|
|
221
|
+
|
|
222
|
+
deepEqual( jQuery("#unwrap3 span").unwrap().get(), jQuery("#unwrap3 > span").get(), "make all b in #unwrap3 go away" );
|
|
223
|
+
|
|
224
|
+
deepEqual( jQuery("#unwrap3 span").unwrap().get(), jQuery("#unwrap > span.unwrap3").get(), "make #unwrap3 go away" );
|
|
225
|
+
|
|
226
|
+
deepEqual( jQuery("#unwrap").children().get(), abcdef, "#unwrap only contains 6 child spans" );
|
|
227
|
+
|
|
228
|
+
deepEqual( jQuery("#unwrap > span").unwrap().get(), jQuery("body > span.unwrap").get(), "make the 6 spans become children of body" );
|
|
229
|
+
|
|
230
|
+
deepEqual( jQuery("body > span.unwrap").unwrap().get(), jQuery("body > span.unwrap").get(), "can't unwrap children of body" );
|
|
231
|
+
deepEqual( jQuery("body > span.unwrap").unwrap().get(), abcdef, "can't unwrap children of body" );
|
|
232
|
+
|
|
233
|
+
deepEqual( jQuery("body > span.unwrap").get(), abcdef, "body contains 6 .unwrap child spans" );
|
|
234
|
+
|
|
235
|
+
jQuery("body > span.unwrap").remove();
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
test( "jQuery(<tag>) & wrap[Inner/All]() handle unknown elems (#10667)", function() {
|
|
239
|
+
|
|
240
|
+
expect( 2 );
|
|
241
|
+
|
|
242
|
+
var $wraptarget = jQuery( "<div id='wrap-target'>Target</div>" ).appendTo( "#qunit-fixture" ),
|
|
243
|
+
$section = jQuery( "<section>" ).appendTo( "#qunit-fixture" );
|
|
244
|
+
|
|
245
|
+
$wraptarget.wrapAll("<aside style='background-color:green'></aside>");
|
|
246
|
+
|
|
247
|
+
notEqual( $wraptarget.parent("aside").get( 0 ).style.backgroundColor, "transparent", "HTML5 elements created with wrapAll inherit styles" );
|
|
248
|
+
notEqual( $section.get( 0 ).style.backgroundColor, "transparent", "HTML5 elements create with jQuery( string ) inherit styles" );
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
test( "wrapping scripts (#10470)", function() {
|
|
252
|
+
|
|
253
|
+
expect( 2 );
|
|
254
|
+
|
|
255
|
+
var script = document.createElement("script");
|
|
256
|
+
script.text = script.textContent = "ok( !document.eval10470, 'script evaluated once' ); document.eval10470 = true;";
|
|
257
|
+
|
|
258
|
+
document.eval10470 = false;
|
|
259
|
+
jQuery("#qunit-fixture").empty()[0].appendChild( script );
|
|
260
|
+
jQuery("#qunit-fixture script").wrap("<b></b>");
|
|
261
|
+
strictEqual( script.parentNode, jQuery("#qunit-fixture > b")[ 0 ], "correctly wrapped" );
|
|
262
|
+
jQuery( script ).remove();
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
})();
|
data/demo/index.html
ADDED
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
|
|
3
|
+
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
|
|
4
|
+
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
|
|
5
|
+
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
|
|
6
|
+
<head>
|
|
7
|
+
<meta charset="utf-8">
|
|
8
|
+
<title>GUFF</title>
|
|
9
|
+
<meta name="description" content="Structure Style Guide">
|
|
10
|
+
<meta name="viewport" content="width=device-width">
|
|
11
|
+
<link rel="stylesheet" href="styles/main.css">
|
|
12
|
+
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/modernizr/2.7.1/modernizr.min.js
|
|
13
|
+
|
|
14
|
+
"></script>
|
|
15
|
+
</head>
|
|
16
|
+
<body>
|
|
17
|
+
<header class="primary">
|
|
18
|
+
<h1>GUFF</h1>
|
|
19
|
+
<p>Lets keep this shit simple.</p>
|
|
20
|
+
</header>
|
|
21
|
+
<main>
|
|
22
|
+
<section>
|
|
23
|
+
<header>
|
|
24
|
+
<h2>CSS Reset Mixin</h2>
|
|
25
|
+
</header>
|
|
26
|
+
<code class="prettyprint">
|
|
27
|
+
@include reset;
|
|
28
|
+
</code>
|
|
29
|
+
</section>
|
|
30
|
+
<section>
|
|
31
|
+
<header>
|
|
32
|
+
<h2>Breakpoint Mixin</h2>
|
|
33
|
+
</header>
|
|
34
|
+
<code class="prettyprint">
|
|
35
|
+
$desktop: "(min-width: 1024px)";
|
|
36
|
+
|
|
37
|
+
div {
|
|
38
|
+
@include breakpoint($desktop){
|
|
39
|
+
width: 100%;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
</code>
|
|
43
|
+
<p>Renders the following media query:</p>
|
|
44
|
+
<code class="prettyprint">
|
|
45
|
+
@media (min-width: 1024px) {
|
|
46
|
+
div {
|
|
47
|
+
width: 100%;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
</code>
|
|
51
|
+
</section>
|
|
52
|
+
<section>
|
|
53
|
+
<header>
|
|
54
|
+
<h2>Container Mixin</h2>
|
|
55
|
+
</header>
|
|
56
|
+
<code class="prettyprint">
|
|
57
|
+
// Use on divs wrapping span mixins
|
|
58
|
+
|
|
59
|
+
.container {
|
|
60
|
+
@include container;
|
|
61
|
+
}
|
|
62
|
+
</code>
|
|
63
|
+
<code class="prettyprint">
|
|
64
|
+
// Use on divs wrapping col mixins
|
|
65
|
+
|
|
66
|
+
.container {
|
|
67
|
+
@include col-container;
|
|
68
|
+
}
|
|
69
|
+
</code>
|
|
70
|
+
</section>
|
|
71
|
+
<section>
|
|
72
|
+
<header>
|
|
73
|
+
<h2>Span Mixin</h2>
|
|
74
|
+
</header>
|
|
75
|
+
<code class="prettyprint">
|
|
76
|
+
// cols : int - Column count
|
|
77
|
+
// padding : boolean - Use grid padding : optional
|
|
78
|
+
|
|
79
|
+
@include span(cols, padding);
|
|
80
|
+
</code>
|
|
81
|
+
<div class="container">
|
|
82
|
+
<div class="float-tile"></div>
|
|
83
|
+
<div class="float-tile"></div>
|
|
84
|
+
<div class="float-tile"></div>
|
|
85
|
+
</div>
|
|
86
|
+
<code class="prettyprint">
|
|
87
|
+
// Requires container with container() mixin
|
|
88
|
+
// Use span function to just get width
|
|
89
|
+
|
|
90
|
+
.tile {
|
|
91
|
+
@include span(4);
|
|
92
|
+
}
|
|
93
|
+
</code>
|
|
94
|
+
</section>
|
|
95
|
+
<section>
|
|
96
|
+
<header>
|
|
97
|
+
<h2>Col Mixin</h2>
|
|
98
|
+
</header>
|
|
99
|
+
<code class="prettyprint">
|
|
100
|
+
// Creates columns with margins using the justify method
|
|
101
|
+
// cols : int - Column count
|
|
102
|
+
|
|
103
|
+
@include col(cols);
|
|
104
|
+
</code>
|
|
105
|
+
<div class="col-container">
|
|
106
|
+
<div class="col-tile"></div>
|
|
107
|
+
<div class="col-tile"></div>
|
|
108
|
+
<div class="col-tile"></div>
|
|
109
|
+
</div>
|
|
110
|
+
<code class="prettyprint">
|
|
111
|
+
// Requires a container with col-container mixin
|
|
112
|
+
|
|
113
|
+
.col {
|
|
114
|
+
@include col(4);
|
|
115
|
+
}
|
|
116
|
+
</code>
|
|
117
|
+
</section>
|
|
118
|
+
<section>
|
|
119
|
+
<header>
|
|
120
|
+
<h2>Offset Mixin</h2>
|
|
121
|
+
</header>
|
|
122
|
+
<code class="prettyprint">
|
|
123
|
+
// cols : int - Column count
|
|
124
|
+
|
|
125
|
+
@include offset(cols);
|
|
126
|
+
</code>
|
|
127
|
+
<div class="container">
|
|
128
|
+
<div class="float-tile offset-tile">
|
|
129
|
+
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
<code class="prettyprint">
|
|
133
|
+
.tile.offset-tile {
|
|
134
|
+
@include @offset(4);
|
|
135
|
+
}
|
|
136
|
+
</code>
|
|
137
|
+
</section>
|
|
138
|
+
<section>
|
|
139
|
+
<header>
|
|
140
|
+
<h2>Span Function</h2>
|
|
141
|
+
</header>
|
|
142
|
+
<code class="prettyprint">
|
|
143
|
+
// Use to simply get column width
|
|
144
|
+
|
|
145
|
+
.tile-no-float {
|
|
146
|
+
width: span(4);
|
|
147
|
+
margin-left: span(2);
|
|
148
|
+
}
|
|
149
|
+
</code>
|
|
150
|
+
</section>
|
|
151
|
+
<section>
|
|
152
|
+
<header>
|
|
153
|
+
<h2>Prefix Mixins</h2>
|
|
154
|
+
</header>
|
|
155
|
+
<code class="prettyprint">
|
|
156
|
+
// Generates browser prefixes for properties
|
|
157
|
+
|
|
158
|
+
// Transistion
|
|
159
|
+
@include transition(all 1s linear);
|
|
160
|
+
|
|
161
|
+
// Transform
|
|
162
|
+
@include transform(translateZ(0));
|
|
163
|
+
|
|
164
|
+
// Box Sizing
|
|
165
|
+
@include box-sizing(border-box);
|
|
166
|
+
|
|
167
|
+
// Anything you want
|
|
168
|
+
@include prefixer(text-shadow, 5px, webkit moz);
|
|
169
|
+
|
|
170
|
+
</code>
|
|
171
|
+
</section>
|
|
172
|
+
<section>
|
|
173
|
+
<header>
|
|
174
|
+
<h2>rem-calc()</h2>
|
|
175
|
+
</header>
|
|
176
|
+
<code class="prettyprint">
|
|
177
|
+
// Calculates rem value for px value
|
|
178
|
+
|
|
179
|
+
font-size: rem-calc(14);
|
|
180
|
+
</code>
|
|
181
|
+
</section>
|
|
182
|
+
<section>
|
|
183
|
+
<header>
|
|
184
|
+
<h2>Helper Mixins</h2>
|
|
185
|
+
</header>
|
|
186
|
+
<code class="prettyprint">
|
|
187
|
+
// Clearfix Mixin
|
|
188
|
+
//
|
|
189
|
+
// &:after {
|
|
190
|
+
// content:"";
|
|
191
|
+
// display:table;
|
|
192
|
+
// clear:both;
|
|
193
|
+
// }
|
|
194
|
+
//
|
|
195
|
+
|
|
196
|
+
@include clear;
|
|
197
|
+
|
|
198
|
+
// clear(boolean) : Use false inside media queries to use mixin instead of placeholder
|
|
199
|
+
|
|
200
|
+
@include clear(false);
|
|
201
|
+
|
|
202
|
+
// Ellipsis Mixin - ellipsis($width)
|
|
203
|
+
//
|
|
204
|
+
// display: inline-block;
|
|
205
|
+
// max-width: $width;
|
|
206
|
+
// overflow: hidden;
|
|
207
|
+
// text-overflow: ellipsis;
|
|
208
|
+
// white-space: nowrap;
|
|
209
|
+
//
|
|
210
|
+
|
|
211
|
+
@include ellipsis(200px);
|
|
212
|
+
|
|
213
|
+
// Hide Text
|
|
214
|
+
//
|
|
215
|
+
// overflow:hidden;
|
|
216
|
+
// text-indent: 100%;
|
|
217
|
+
// white-space: nowrap;
|
|
218
|
+
//
|
|
219
|
+
|
|
220
|
+
@include hide-text;
|
|
221
|
+
|
|
222
|
+
// hide-text(boolean) : Use false inside media queries to use mixin instead of placeholder
|
|
223
|
+
|
|
224
|
+
@include hide-text(false);
|
|
225
|
+
|
|
226
|
+
// Inline List (use on <ul>)
|
|
227
|
+
//
|
|
228
|
+
// list-style-type:none;
|
|
229
|
+
// padding:0;
|
|
230
|
+
// margin:0;
|
|
231
|
+
// overflow:hidden;
|
|
232
|
+
// > li{
|
|
233
|
+
// display:block;
|
|
234
|
+
// float:left;
|
|
235
|
+
// }
|
|
236
|
+
|
|
237
|
+
@include inline-list;
|
|
238
|
+
|
|
239
|
+
// Pass false to render list items as inline-block instead of float
|
|
240
|
+
|
|
241
|
+
@include inline-list(false);
|
|
242
|
+
|
|
243
|
+
</code>
|
|
244
|
+
</section>
|
|
245
|
+
<section class="typography">
|
|
246
|
+
<header>
|
|
247
|
+
<h2>Typographic Rhythm</h2>
|
|
248
|
+
</header>
|
|
249
|
+
<code class="prettyprint">
|
|
250
|
+
// Uses the following variable settings
|
|
251
|
+
//
|
|
252
|
+
// $rem-base - base rem size in px
|
|
253
|
+
// $line-height-base - line height base
|
|
254
|
+
// $type-rhythm-ratio - header scaling ratio
|
|
255
|
+
|
|
256
|
+
@include type(16px, 26px, 1.14);
|
|
257
|
+
|
|
258
|
+
@include type(16px, 1.5, 1.14);
|
|
259
|
+
|
|
260
|
+
// No arguments required, falls back to settings variables
|
|
261
|
+
|
|
262
|
+
@include type;
|
|
263
|
+
</code>
|
|
264
|
+
<h1>H1</h1>
|
|
265
|
+
<h2>H2</h2>
|
|
266
|
+
<h3>H3</h3>
|
|
267
|
+
<h4>H4</h4>
|
|
268
|
+
<h5>H5</h5>
|
|
269
|
+
<h6>H6</h6>
|
|
270
|
+
<p>Paragraph</p>
|
|
271
|
+
</section>
|
|
272
|
+
<section>
|
|
273
|
+
<header>
|
|
274
|
+
<h2>Installation</h2>
|
|
275
|
+
</header>
|
|
276
|
+
<code class="prettyprint">
|
|
277
|
+
// Bower
|
|
278
|
+
|
|
279
|
+
bower install guff
|
|
280
|
+
|
|
281
|
+
// In your SCSS file
|
|
282
|
+
|
|
283
|
+
@import "guff"
|
|
284
|
+
</code>
|
|
285
|
+
<code class="prettyprint">
|
|
286
|
+
// Compass
|
|
287
|
+
|
|
288
|
+
gem install guff-compass
|
|
289
|
+
|
|
290
|
+
// In your config.rb file
|
|
291
|
+
|
|
292
|
+
require "guff-compass"
|
|
293
|
+
|
|
294
|
+
// In your SCSS file
|
|
295
|
+
|
|
296
|
+
@import "guff"
|
|
297
|
+
</code>
|
|
298
|
+
<a href='https://github.com/kenwheeler/guff/' class='download-button'>
|
|
299
|
+
Download
|
|
300
|
+
<span>Latest version from GitHub</span>
|
|
301
|
+
</a>
|
|
302
|
+
</section>
|
|
303
|
+
<section>
|
|
304
|
+
<header>
|
|
305
|
+
<h2>Settings</h2>
|
|
306
|
+
</header>
|
|
307
|
+
<p>Override these variables at the top of your scss file.</p>
|
|
308
|
+
<code class="prettyprint">
|
|
309
|
+
// Set base font size
|
|
310
|
+
$rem-base: 16px !default;
|
|
311
|
+
// Set line height ratio base. Accepts px, em, rem or int values
|
|
312
|
+
$line-height-base: 26px !default;
|
|
313
|
+
// Vertical rhythm ratio
|
|
314
|
+
$type-rhythm-ratio: 1.14 !default;
|
|
315
|
+
// Desktop Media Query
|
|
316
|
+
$desktop: "(min-width: 1024px)" !default;
|
|
317
|
+
// Tablet Media Query
|
|
318
|
+
$tablet: "(min-width: 768px) and (max-width: 1023px)" !default;
|
|
319
|
+
// Mobile Media Query
|
|
320
|
+
$mobile: "(max-width: 767px)" !default;
|
|
321
|
+
// Set Grid Column Count
|
|
322
|
+
$grid-columns: 12 !default;
|
|
323
|
+
// Set Grid Gutter (percentage)
|
|
324
|
+
$grid-gutter: 4 !default;
|
|
325
|
+
// Set Grid Padding (as px)
|
|
326
|
+
$grid-padding: 20px !default;
|
|
327
|
+
// Set Grid Max Width (as px)
|
|
328
|
+
$grid-max-width: 1024px !default;
|
|
329
|
+
</code>
|
|
330
|
+
</section>
|
|
331
|
+
<section>
|
|
332
|
+
<header>
|
|
333
|
+
<h2>Playground</h2>
|
|
334
|
+
</header>
|
|
335
|
+
<a href='http://codepen.io/kenwheeler/pen/tpBdF' class='download-button'>
|
|
336
|
+
Try it out live
|
|
337
|
+
<span>On The Codepen Sandbox</span>
|
|
338
|
+
</a>
|
|
339
|
+
</section>
|
|
340
|
+
</main>
|
|
341
|
+
<footer class="primary">
|
|
342
|
+
<p>© 2014 Ken Wheeler</p>
|
|
343
|
+
</footer>
|
|
344
|
+
<script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js?lang=css"></script>
|
|
345
|
+
|
|
346
|
+
</body>
|
|
347
|
+
</html>
|