html5-boilerplate 0.2.6 → 0.3.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.
- data/README.md +11 -18
- data/VERSION +1 -1
- data/stylesheets/html5-boilerplate/_fonts.scss +1 -7
- data/stylesheets/html5-boilerplate/_helpers.scss +2 -4
- data/stylesheets/html5-boilerplate/_media.scss +8 -7
- data/stylesheets/html5-boilerplate/_reset.scss +7 -17
- data/stylesheets/html5-boilerplate/_styles.scss +9 -12
- data/templates/project/_head.html.haml +3 -8
- data/templates/project/_javascripts.html.haml +8 -11
- data/templates/project/application.html.haml +3 -3
- data/templates/project/files/htaccess +194 -19
- data/templates/project/files/humans.txt +43 -0
- data/templates/project/index.html.haml +4 -13
- data/templates/project/javascripts/plugins.js +3 -32
- data/templates/project/javascripts/rails.js +137 -156
- data/templates/project/javascripts/script.js +26 -0
- data/templates/project/manifest.rb +8 -15
- data/templates/project/partials/_base.scss +1 -1
- data/templates/project/partials/_example.scss +0 -21
- data/templates/project/partials/_fonts.scss +4 -0
- data/templates/project/partials/_media.scss +21 -0
- data/templates/project/style.scss +14 -9
- metadata +8 -12
- data/templates/project/files/lighttpd.conf +0 -149
- data/templates/project/files/mime.types +0 -80
- data/templates/project/files/nginx.conf +0 -108
- data/templates/project/files/web.config +0 -207
- data/templates/project/javascripts/profiling/charts.swf +0 -0
- data/templates/project/javascripts/profiling/config.js +0 -59
- data/templates/project/javascripts/profiling/yahoo-profiling.css +0 -7
- data/templates/project/javascripts/profiling/yahoo-profiling.min.js +0 -39
@@ -0,0 +1,43 @@
|
|
1
|
+
/* the humans responsible & colophon */
|
2
|
+
/* humanstxt.org */
|
3
|
+
|
4
|
+
|
5
|
+
/* TEAM */
|
6
|
+
<your title>: <your name>
|
7
|
+
Site:
|
8
|
+
Twitter:
|
9
|
+
Location:
|
10
|
+
|
11
|
+
/* THANKS */
|
12
|
+
Names (& URL):
|
13
|
+
|
14
|
+
/* SITE */
|
15
|
+
Standards: HTML5, CSS3
|
16
|
+
Components: Modernizr, jQuery
|
17
|
+
Software:
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
-o/-
|
22
|
+
+oo//-
|
23
|
+
:ooo+//:
|
24
|
+
-ooooo///-
|
25
|
+
/oooooo//:
|
26
|
+
:ooooooo+//-
|
27
|
+
-+oooooooo///-
|
28
|
+
-://////////////+oooooooooo++////////////::
|
29
|
+
:+ooooooooooooooooooooooooooooooooooooo+:::-
|
30
|
+
-/+ooooooooooooooooooooooooooooooo+/::////:-
|
31
|
+
-:+oooooooooooooooooooooooooooo/::///////:-
|
32
|
+
--/+ooooooooooooooooooooo+::://////:-
|
33
|
+
-:+ooooooooooooooooo+:://////:--
|
34
|
+
/ooooooooooooooooo+//////:-
|
35
|
+
-ooooooooooooooooooo////-
|
36
|
+
/ooooooooo+oooooooooo//:
|
37
|
+
:ooooooo+/::/+oooooooo+//-
|
38
|
+
-oooooo/::///////+oooooo///-
|
39
|
+
/ooo+::://////:---:/+oooo//:
|
40
|
+
-o+/::///////:- -:/+o+//-
|
41
|
+
:-:///////:- -:/://
|
42
|
+
-////:- --//:
|
43
|
+
-- -:
|
@@ -5,7 +5,7 @@
|
|
5
5
|
<!--[if IE 8 ]> <html lang="en" class="no-js ie8"> <![endif]-->
|
6
6
|
<!--[if IE 9 ]> <html lang="en" class="no-js ie9"> <![endif]-->
|
7
7
|
<!--[if (gte IE 9)|!(IE)]><!-->
|
8
|
-
%html.no-js
|
8
|
+
%html.no-js
|
9
9
|
<!--<![endif]-->
|
10
10
|
%head
|
11
11
|
%meta{ :charset => "utf-8" }/
|
@@ -15,11 +15,6 @@
|
|
15
15
|
Remove this if you use the .htaccess
|
16
16
|
%meta{ :content => "IE=edge,chrome=1", "http-equiv" => "X-UA-Compatible" }/
|
17
17
|
|
18
|
-
-# encoding must be specified within the first 512 bytes www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#charset
|
19
|
-
|
20
|
-
-# meta element for compatibility mode needs to be before all elements except title & meta msdn.microsoft.com/en-us/library/cc288325(VS.85).aspx
|
21
|
-
-# Chrome Frame is only invoked if meta element for compatibility mode is within the first 1K bytes code.google.com/p/chromium/issues/detail?id=23003
|
22
|
-
|
23
18
|
%title
|
24
19
|
%meta{ :content => "", :name => "description" }/
|
25
20
|
%meta{ :content => "", :name => "author" }/
|
@@ -38,9 +33,9 @@
|
|
38
33
|
-# %link{ :href => "css/handheld.css?v=1", :media => "handheld", :rel => "stylesheet" }/
|
39
34
|
|
40
35
|
-# All JavaScript at the bottom, except for Modernizr which enables HTML5 elements & feature detects
|
41
|
-
%script{ :src => "js/modernizr
|
36
|
+
%script{ :src => "js/modernizr.min.js" }
|
42
37
|
|
43
|
-
%body
|
38
|
+
%body{ :lang => "en" }
|
44
39
|
#container
|
45
40
|
%header
|
46
41
|
#main
|
@@ -51,7 +46,7 @@
|
|
51
46
|
Grab Google CDN's jQuery. fall back to local if necessary
|
52
47
|
%script{ :src => "http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" }
|
53
48
|
:javascript
|
54
|
-
!window.jQuery && document.write(unescape('%3Cscript src="js/jquery
|
49
|
+
!window.jQuery && document.write(unescape('%3Cscript src="js/jquery.min.js"%3E%3C/script%3E'))
|
55
50
|
|
56
51
|
%script{ :src => "js/plugins.js?v=1" }
|
57
52
|
%script{ :src => "js/script.js?v=1" }
|
@@ -60,10 +55,6 @@
|
|
60
55
|
:javascript
|
61
56
|
$.getScript("js/dd_belatedpng.js",function(){ DD_belatedPNG.fix('img, .png_bg'); });
|
62
57
|
|
63
|
-
-# yui profiler and profileviewer - remove for production
|
64
|
-
%script{ :src => "js/profiling/yahoo-profiling.min.js?v=1" }
|
65
|
-
%script{ :src => "js/profiling/config.js?v=1" }
|
66
|
-
|
67
58
|
-# asynchronous google analytics: mathiasbynens.be/notes/async-analytics-snippet
|
68
59
|
-# change the UA-XXXXX-X to be your site's ID
|
69
60
|
:javascript
|
@@ -1,40 +1,11 @@
|
|
1
|
-
|
2
|
-
// remap jQuery to $
|
3
|
-
(function($){
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
})(this.jQuery);
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
// usage: log('inside coolFunc',this,arguments);
|
1
|
+
// usage: log('inside coolFunc', this, arguments);
|
20
2
|
// paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/
|
21
3
|
window.log = function(){
|
22
4
|
log.history = log.history || []; // store logs to an array for reference
|
23
5
|
log.history.push(arguments);
|
24
|
-
if(this.console)
|
25
|
-
console.log( Array.prototype.slice.call(arguments) );
|
26
|
-
}
|
6
|
+
if(this.console) console.log( Array.prototype.slice.call(arguments) );
|
27
7
|
};
|
28
8
|
|
29
9
|
|
30
10
|
|
31
|
-
//
|
32
|
-
(function(doc){
|
33
|
-
var write = doc.write;
|
34
|
-
doc.write = function(q){
|
35
|
-
log('document.write(): ',arguments);
|
36
|
-
if (/docwriteregexwhitelist/.test(q)) write.apply(doc,arguments);
|
37
|
-
};
|
38
|
-
})(document);
|
39
|
-
|
40
|
-
|
11
|
+
// place any jQuery/helper plugins in here, instead of separate, slower script files.
|
@@ -1,156 +1,137 @@
|
|
1
|
-
|
2
|
-
*
|
3
|
-
*
|
4
|
-
*
|
5
|
-
*
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
$(disable_with_form_remote_selector).live('ajax:before.rails', disable_with_input_function);
|
140
|
-
$(disable_with_form_not_remote_selector).live('submit.rails', disable_with_input_function);
|
141
|
-
|
142
|
-
$(disable_with_form_remote_selector).live('ajax:complete.rails', function () {
|
143
|
-
$(this).find(disable_with_input_selector).each(function () {
|
144
|
-
var input = $(this);
|
145
|
-
input.removeAttr('disabled')
|
146
|
-
.val(input.data('enable-with'));
|
147
|
-
});
|
148
|
-
});
|
149
|
-
|
150
|
-
var jqueryVersion = $().jquery;
|
151
|
-
|
152
|
-
if ( (jqueryVersion === '1.4') || (jqueryVersion === '1.4.1') || (jqueryVersion === '1.4.2') ){
|
153
|
-
alert('This rails.js does not support the jQuery version you are using. Please read documentation.');
|
154
|
-
}
|
155
|
-
|
156
|
-
});
|
1
|
+
/**
|
2
|
+
* Unobtrusive scripting adapter for jQuery
|
3
|
+
*
|
4
|
+
* Requires jQuery 1.4.3 or later.
|
5
|
+
* https://github.com/rails/jquery-ujs
|
6
|
+
*/
|
7
|
+
|
8
|
+
(function($) {
|
9
|
+
// Triggers an event on an element and returns the event result
|
10
|
+
function fire(obj, name, data) {
|
11
|
+
var event = new $.Event(name);
|
12
|
+
obj.trigger(event, data);
|
13
|
+
return event.result !== false;
|
14
|
+
}
|
15
|
+
|
16
|
+
// Submits "remote" forms and links with ajax
|
17
|
+
function handleRemote(element) {
|
18
|
+
var method, url, data,
|
19
|
+
dataType = element.attr('data-type') || ($.ajaxSettings && $.ajaxSettings.dataType);
|
20
|
+
|
21
|
+
if (element.is('form')) {
|
22
|
+
method = element.attr('method');
|
23
|
+
url = element.attr('action');
|
24
|
+
data = element.serializeArray();
|
25
|
+
// memoized value from clicked submit button
|
26
|
+
var button = element.data('ujs:submit-button');
|
27
|
+
if (button) {
|
28
|
+
data.push(button);
|
29
|
+
element.data('ujs:submit-button', null);
|
30
|
+
}
|
31
|
+
} else {
|
32
|
+
method = element.attr('data-method');
|
33
|
+
url = element.attr('href');
|
34
|
+
data = null;
|
35
|
+
}
|
36
|
+
|
37
|
+
$.ajax({
|
38
|
+
url: url, type: method || 'GET', data: data, dataType: dataType,
|
39
|
+
// stopping the "ajax:beforeSend" event will cancel the ajax request
|
40
|
+
beforeSend: function(xhr, settings) {
|
41
|
+
if (settings.dataType === undefined) {
|
42
|
+
xhr.setRequestHeader('accept', '*/*;q=0.5, ' + settings.accepts.script);
|
43
|
+
}
|
44
|
+
return fire(element, 'ajax:beforeSend', [xhr, settings]);
|
45
|
+
},
|
46
|
+
success: function(data, status, xhr) {
|
47
|
+
element.trigger('ajax:success', [data, status, xhr]);
|
48
|
+
},
|
49
|
+
complete: function(xhr, status) {
|
50
|
+
element.trigger('ajax:complete', [xhr, status]);
|
51
|
+
},
|
52
|
+
error: function(xhr, status, error) {
|
53
|
+
element.trigger('ajax:error', [xhr, status, error]);
|
54
|
+
}
|
55
|
+
});
|
56
|
+
}
|
57
|
+
|
58
|
+
// Handles "data-method" on links such as:
|
59
|
+
// <a href="/users/5" data-method="delete" rel="nofollow" data-confirm="Are you sure?">Delete</a>
|
60
|
+
function handleMethod(link) {
|
61
|
+
var href = link.attr('href'),
|
62
|
+
method = link.attr('data-method'),
|
63
|
+
csrf_token = $('meta[name=csrf-token]').attr('content'),
|
64
|
+
csrf_param = $('meta[name=csrf-param]').attr('content'),
|
65
|
+
form = $('<form method="post" action="' + href + '"></form>'),
|
66
|
+
metadata_input = '<input name="_method" value="' + method + '" type="hidden" />';
|
67
|
+
|
68
|
+
if (csrf_param !== undefined && csrf_token !== undefined) {
|
69
|
+
metadata_input += '<input name="' + csrf_param + '" value="' + csrf_token + '" type="hidden" />';
|
70
|
+
}
|
71
|
+
|
72
|
+
form.hide().append(metadata_input).appendTo('body');
|
73
|
+
form.submit();
|
74
|
+
}
|
75
|
+
|
76
|
+
function disableFormElements(form) {
|
77
|
+
form.find('input[data-disable-with]').each(function() {
|
78
|
+
var input = $(this);
|
79
|
+
input.data('ujs:enable-with', input.val())
|
80
|
+
.val(input.attr('data-disable-with'))
|
81
|
+
.attr('disabled', 'disabled');
|
82
|
+
});
|
83
|
+
}
|
84
|
+
|
85
|
+
function enableFormElements(form) {
|
86
|
+
form.find('input[data-disable-with]').each(function() {
|
87
|
+
var input = $(this);
|
88
|
+
input.val(input.data('ujs:enable-with')).removeAttr('disabled');
|
89
|
+
});
|
90
|
+
}
|
91
|
+
|
92
|
+
function allowAction(element) {
|
93
|
+
var message = element.attr('data-confirm');
|
94
|
+
return !message || (fire(element, 'confirm') && confirm(message));
|
95
|
+
}
|
96
|
+
|
97
|
+
$('a[data-confirm], a[data-method], a[data-remote]').live('click.rails', function(e) {
|
98
|
+
var link = $(this);
|
99
|
+
if (!allowAction(link)) return false;
|
100
|
+
|
101
|
+
if (link.attr('data-remote')) {
|
102
|
+
handleRemote(link);
|
103
|
+
return false;
|
104
|
+
} else if (link.attr('data-method')) {
|
105
|
+
handleMethod(link);
|
106
|
+
return false;
|
107
|
+
}
|
108
|
+
});
|
109
|
+
|
110
|
+
$('form').live('submit.rails', function(e) {
|
111
|
+
var form = $(this);
|
112
|
+
if (!allowAction(form)) return false;
|
113
|
+
|
114
|
+
if (form.attr('data-remote')) {
|
115
|
+
handleRemote(form);
|
116
|
+
return false;
|
117
|
+
} else {
|
118
|
+
disableFormElements(form);
|
119
|
+
}
|
120
|
+
});
|
121
|
+
|
122
|
+
$('form input[type=submit], form button[type=submit], form button:not([type])').live('click.rails', function() {
|
123
|
+
var button = $(this);
|
124
|
+
if (!allowAction(button)) return false;
|
125
|
+
// register the pressed submit button
|
126
|
+
var name = button.attr('name'), data = name ? {name:name, value:button.val()} : null;
|
127
|
+
button.closest('form').data('ujs:submit-button', data);
|
128
|
+
});
|
129
|
+
|
130
|
+
$('form').live('ajax:beforeSend.rails', function(event) {
|
131
|
+
if (this == event.target) disableFormElements($(this));
|
132
|
+
});
|
133
|
+
|
134
|
+
$('form').live('ajax:complete.rails', function(event) {
|
135
|
+
if (this == event.target) enableFormElements($(this));
|
136
|
+
});
|
137
|
+
})( jQuery );
|