Skip to content

Commit 9f2ccf0

Browse files
committed
Fix docs.
1 parent 0026480 commit 9f2ccf0

File tree

8 files changed

+9
-156
lines changed

8 files changed

+9
-156
lines changed

README.md

Lines changed: 2 additions & 149 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ A simple light weight JavaScript url parser.
44

55
* [Demo](https://websanova.com/utils/url)
66
* [Docs](https://websanova.com/docs/url)
7-
* [Download](https://github.com/websanova/url/tags)
7+
* [Download](https://github.com/websanova/js-url/tags)
88

99
## Availability
1010

@@ -28,151 +28,4 @@ To build simply run:
2828

2929
MIT licensed
3030

31-
Copyright (C) 2011-2012 Websanova http://www.websanova.com
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-
# url()
62-
63-
A simple, lightweight url parser for JavaScript (~1.7 Kb minified, ~0.7Kb gzipped).
64-
65-
* [Change Log](https://github.com/websanova/js-url/wiki/Change-Log)
66-
* [View the url demo](http://url.websanova.com)
67-
* [Download the lastest version of url](https://github.com/websanova/js-url/tags)
68-
69-
Also available for Node.js.
70-
71-
* [On GitHub as node-url](https://github.com/websanova/node-url)
72-
* [On Npm as wurl](https://www.npmjs.com/package/wurl)
73-
74-
Full list of domains.
75-
76-
* [https://publicsuffix.org/list/public_suffix_list.dat](https://publicsuffix.org/list/public_suffix_list.dat)
77-
78-
79-
## Bower Install
80-
81-
```
82-
> bower install js-url
83-
```
84-
85-
## Notes
86-
87-
For path(1) and path(-1) will always act as if the path is in the form `/some/path/` regardless of whether the original path was `/some/path` or `some/path/`.
88-
89-
## Tld
90-
91-
There are two versions, `url.min.js` and `url-tld.min.jd`. The `tld` version contains a list of valid tld's making the file about 2kb larger. If you don't need support for it just use domain parts arguments (`url('-1')`) to get the tld pieces you need.
92-
93-
## Examples
94-
95-
```html
96-
http://rob:abcd1234@www.example.co.uk/path/index.html?query1=test&silly=willy&field[0]=zero&field[2]=two#test=hash&chucky=cheese
97-
```
98-
99-
```js
100-
url(); // http://rob:abcd1234@www.example.co.uk/path/index.html?query1=test&silly=willy&field[0]=zero&field[2]=two#test=hash&chucky=cheese
101-
url('tld'); // co.uk
102-
url('domain'); // example.co.uk
103-
url('hostname'); // www.example.co.uk
104-
url('sub'); // www
105-
url('.0') // undefined
106-
url('.1') // www
107-
url('.2') // example
108-
url('.-1') // uk
109-
url('auth') // rob:abcd1234
110-
url('user') // rob
111-
url('pass') // abcd1234
112-
url('port'); // 80
113-
url('protocol'); // http
114-
url('path'); // /path/index.html
115-
url('file'); // index.html
116-
url('filename'); // index
117-
url('fileext'); // html
118-
url('1'); // path
119-
url('2'); // index.html
120-
url('3'); // undefined
121-
url('-1'); // index.html
122-
url(1); // path
123-
url(2); // index.html
124-
url(-1); // index.html
125-
url('query'); // query1=test&silly=willy
126-
url('?'); // {query1: 'test', silly: 'willy', field: ['zero', undefined, 'two']}
127-
url('?silly'); // willy
128-
url('?poo'); // undefined
129-
url('field[0]') // zero
130-
url('field') // ['zero', undefined, 'two']
131-
url('hash'); // test=hash&chucky=cheese
132-
url('#'); // {test: 'hash', chucky: 'cheese'}
133-
url('#chucky'); // cheese
134-
url('#poo'); // undefined
135-
```
136-
137-
Also supports `mailto`.
138-
139-
```js
140-
url('protocol', 'mailto:rob@websanova.com'); // mailto
141-
url('email', 'mailto:rob@websanova.com'); // rob@websanova.com
142-
143-
```
144-
145-
We can also pass a url in and use all the same options on it:
146-
147-
```js
148-
url('hostname', 'test.www.example.com/path/here'); // test.www.example.com
149-
url('protocol', 'www.example.com/path/here'); // http
150-
url('path', 'http://www.example.com:8080/some/path'); // /some/path
151-
url('port', 'http://www.example.com:8080/some/path'); // 8080
152-
url('protocol', 'https://www.example.com:8080/some/path'); // https
153-
etc...
154-
```
155-
156-
## jQuery
157-
158-
Also include is a jQuery version of the plugin that can be called via $.url() with all the same options. If you're already using jQuery it may be better to use the jQuery version to avoid namespacing issues.
159-
160-
## AMD module
161-
162-
If AMD loader present (when `(typeof define === 'function' && define.amd !== undefined)` is truthy) the script registers itself as anonymous AMD module without polluting global `window`-object or extending `jQuery`.
163-
164-
## Grunt.js
165-
166-
If you want to use Grunt you will need to install the required plugins locally using `npm install` in the root folder of your project. If you need to setup Grunt on your system you can follow my [Setting up Grunt.js](http://www.websanova.com/blog/javascript/how-to-setup-grunt) guide.
167-
168-
## Resources
169-
170-
* [More jQuery plugins by Websanova](http://websanova.com/plugins)
171-
* [jQuery Plugin Development Boilerplate](http://wboiler.websanova.com)
172-
* [The Ultimate Guide to Writing jQuery Plugins](http://www.websanova.com/blog/jquery/the-ultimate-guide-to-writing-jquery-plugins)
173-
174-
## License
175-
176-
MIT licensed
177-
178-
Copyright (C) 2011-2012 Websanova http://www.websanova.com
31+
Copyright (C) 2011-2012 Websanova http://www.websanova.com

dist/es5-url-tld.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/es5-url.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/jquery-url-tld.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/jquery-url.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/url-tld.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)