Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jquery refs #2348

Merged
merged 8 commits into from
Sep 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ restrictions:

* Please **do not** open issues or pull requests regarding the code in
[`.htaccess`](https://github.com/h5bp/server-configs-apache),
[`jQuery`](https://github.com/jquery/jquery/),
[`Modernizr`](https://github.com/Modernizr/Modernizr) or
[`Normalize.css`](https://github.com/necolas/normalize.css) (open them in
their respective repositories).
Expand Down
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

* Please **do not** open issues or pull requests regarding the code in
[`.htaccess`](https://github.com/h5bp/server-configs-apache),
[`jQuery`](https://github.com/jquery/jquery/),
[`Modernizr`](https://github.com/Modernizr/Modernizr) or
[`Normalize.css`](https://github.com/necolas/normalize.css) (open them in
their respective repositories).
Expand Down
1 change: 0 additions & 1 deletion .github/SUPPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ For personal support requests with HTML5 Boilerplate please use Stack Overflow

Please check the respective repository/website for support regarding the code in
[`.htaccess`](https://github.com/h5bp/server-configs-apache),
[`jQuery`](https://jquery.org/support/),
[`Modernizr`](https://modernizr.com/) or
[`Normalize.css`](https://github.com/necolas/normalize.css).
19 changes: 0 additions & 19 deletions dist/doc/extend.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,25 +118,6 @@ and
[Event](https://developers.google.com/analytics/devguides/collection/analyticsjs/events)
Docs.

### Track jQuery AJAX requests in Google Analytics

An article by @JangoSteve explains how to [track jQuery AJAX requests in Google
Analytics](https://www.alfajango.com/blog/track-jquery-ajax-requests-in-google-analytics/).

Add this to `plugins.js`:

```js
/*
* Log all jQuery AJAX requests to Google Analytics
* See: https://www.alfajango.com/blog/track-jquery-ajax-requests-in-google-analytics/
*/
if (typeof ga !== "undefined" && ga !== null) {
$(document).ajaxSend(function(event, xhr, settings){
ga('send', 'pageview', settings.url);
});
}
```

### Track JavaScript errors in Google Analytics

Add this function after `ga` is defined:
Expand Down
4 changes: 1 addition & 3 deletions dist/doc/html.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,11 @@ it before the other scripts in the bottom of the page:
```html
<script src="js/vendor/modernizr-3.10.0.min.js"></script>
<script src="https://polyfill.io/v3/polyfill.min.js"></script>
<script src="js/plugins.js"></script>
<script src="js/app.js"></script>
</body>
```

If you like to just include the polyfills yourself, you could include them in
`js/plugins.js`. When you have a bunch of polyfills to load in, you could also
When you have a bunch of polyfills to load in, you could also
create a `polyfills.js` file in the `js/vendor` directory or include the files
individually and combine them using a build tool. Always ensure that the
polyfills are all loaded before any other JavaScript.
Expand Down
14 changes: 0 additions & 14 deletions dist/doc/js.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,6 @@ This file can be used to contain or reference your site/app JavaScript code. If
you're working on something more advanced you might replace this file entirely.
That's cool.

## plugins.js

This file can be used to contain all your plugins, such as jQuery plugins and
other 3rd party scripts for a simple site.

One approach is to put jQuery plugins inside of a `(function($){ ...})(jQuery);`
closure to make sure they're in the jQuery namespace safety blanket. Read more
about [jQuery plugin authoring](https://learn.jquery.com/plugins/).

By default the `plugins.js` file contains a small script to avoid `console`
errors in browsers that lack a `console`. The script will make sure that, if a
console method isn't available, that method will have the value of empty
function, thus, preventing the browser from throwing an error.

## vendor

This directory can be used to contain all 3rd party library code.
Expand Down
1 change: 0 additions & 1 deletion dist/doc/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ A basic HTML5 Boilerplate site initially looks something like this:
├── img
├── js
│ ├── app.js
│ ├── plugins.js
│ └── vendor
│ └── modernizr.min.js
├── .editorconfig
Expand Down
2 changes: 1 addition & 1 deletion dist/humans.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
# TECHNOLOGY COLOPHON

CSS3, HTML5
Apache Server Configs, jQuery, Modernizr, Normalize.css
Apache Server Configs, Modernizr, Normalize.css, main.css, Parcel
1 change: 0 additions & 1 deletion dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
<!-- Add your site or application content here -->
<p>Hello world! This is HTML5 Boilerplate.</p>
<script src="js/vendor/modernizr-3.11.3.min.js"></script>
<script src="js/plugins.js"></script>
<script src="js/app.js"></script>

<!-- Google Analytics: change UA-XXXXX-Y to be your site's ID. -->
Expand Down
24 changes: 0 additions & 24 deletions dist/js/plugins.js

This file was deleted.

19 changes: 0 additions & 19 deletions src/doc/extend.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,25 +118,6 @@ and
[Event](https://developers.google.com/analytics/devguides/collection/analyticsjs/events)
Docs.

### Track jQuery AJAX requests in Google Analytics

An article by @JangoSteve explains how to [track jQuery AJAX requests in Google
Analytics](https://www.alfajango.com/blog/track-jquery-ajax-requests-in-google-analytics/).

Add this to `plugins.js`:

```js
/*
* Log all jQuery AJAX requests to Google Analytics
* See: https://www.alfajango.com/blog/track-jquery-ajax-requests-in-google-analytics/
*/
if (typeof ga !== "undefined" && ga !== null) {
$(document).ajaxSend(function(event, xhr, settings){
ga('send', 'pageview', settings.url);
});
}
```

### Track JavaScript errors in Google Analytics

Add this function after `ga` is defined:
Expand Down
4 changes: 1 addition & 3 deletions src/doc/html.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,11 @@ it before the other scripts in the bottom of the page:
```html
<script src="js/vendor/modernizr-3.10.0.min.js"></script>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not related to this PR - but we should update modernizr version here.

<script src="https://polyfill.io/v3/polyfill.min.js"></script>
<script src="js/plugins.js"></script>
<script src="js/app.js"></script>
</body>
```

If you like to just include the polyfills yourself, you could include them in
`js/plugins.js`. When you have a bunch of polyfills to load in, you could also
When you have a bunch of polyfills to load in, you could also
create a `polyfills.js` file in the `js/vendor` directory or include the files
individually and combine them using a build tool. Always ensure that the
polyfills are all loaded before any other JavaScript.
Expand Down
14 changes: 0 additions & 14 deletions src/doc/js.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,6 @@ This file can be used to contain or reference your site/app JavaScript code. If
you're working on something more advanced you might replace this file entirely.
That's cool.

## plugins.js

This file can be used to contain all your plugins, such as jQuery plugins and
other 3rd party scripts for a simple site.

One approach is to put jQuery plugins inside of a `(function($){ ...})(jQuery);`
closure to make sure they're in the jQuery namespace safety blanket. Read more
about [jQuery plugin authoring](https://learn.jquery.com/plugins/).

By default the `plugins.js` file contains a small script to avoid `console`
errors in browsers that lack a `console`. The script will make sure that, if a
console method isn't available, that method will have the value of empty
function, thus, preventing the browser from throwing an error.

## vendor

This directory can be used to contain all 3rd party library code.
Expand Down
1 change: 0 additions & 1 deletion src/doc/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ A basic HTML5 Boilerplate site initially looks something like this:
├── img
├── js
│ ├── app.js
│ ├── plugins.js
│ └── vendor
│ └── modernizr.min.js
├── .editorconfig
Expand Down
2 changes: 1 addition & 1 deletion src/humans.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
# TECHNOLOGY COLOPHON

CSS3, HTML5
Apache Server Configs, jQuery, Modernizr, Normalize.css
Apache Server Configs, Modernizr, Normalize.css, main.css, Parcel
1 change: 0 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
<!-- Add your site or application content here -->
<p>Hello world! This is HTML5 Boilerplate.</p>
<script src="js/vendor/modernizr-{{MODERNIZR_VERSION}}.min.js"></script>
<script src="js/plugins.js"></script>
<script src="js/app.js"></script>

<!-- Google Analytics: change UA-XXXXX-Y to be your site's ID. -->
Expand Down
24 changes: 0 additions & 24 deletions src/js/plugins.js

This file was deleted.

1 change: 0 additions & 1 deletion test/file_existence.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ const expectedFilesInDistDir = [

'js/',
'js/app.js',
'js/plugins.js',
'js/vendor/',
`js/vendor/modernizr-${pkg.devDependencies.modernizr}.min.js`,

Expand Down