Skip to content

Commit 0211db9

Browse files
committed
Merge branch 'master' into from-can-util
2 parents 21629fe + 1d02bb7 commit 0211db9

17 files changed

+405
-0
lines changed

.editorconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
; Unix-style newlines
2+
[*]
3+
end_of_line = LF
4+
indent_style = tab
5+
trim_trailing_whitespace = false
6+
insert_final_newline = true

.gitignore

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Logs
2+
logs
3+
*.log
4+
5+
# Runtime data
6+
pids
7+
*.pid
8+
*.seed
9+
10+
# Directory for instrumented libs generated by jscoverage/JSCover
11+
lib-cov
12+
13+
# Coverage directory used by tools like istanbul
14+
coverage
15+
16+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
17+
.grunt
18+
19+
# Compiled binary addons (http://nodejs.org/api/addons.html)
20+
build/Release
21+
22+
# Dependency directory
23+
# Commenting this out is preferred by some people, see
24+
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
25+
node_modules
26+
27+
# Users Environment Variables
28+
.lock-wscript
29+
30+
docs/
31+
dist/

.jshintrc

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"globals": {
3+
"steal": true,
4+
"can": true,
5+
"Zepto": true,
6+
"QUnit": true,
7+
"System": true,
8+
"SimpleDOM": true,
9+
"test": true,
10+
"asyncTest": true,
11+
"expect": true,
12+
"module": true,
13+
"ok": true,
14+
"equal": true,
15+
"notEqual": true,
16+
"deepEqual": true,
17+
"notDeepEqual": true,
18+
"strictEqual": true,
19+
"notStrictEqual": true,
20+
"raises": true,
21+
"start": true,
22+
"stop": true,
23+
"global": true
24+
},
25+
"curly": true,
26+
"eqeqeq": true,
27+
"freeze": true,
28+
"indent": 2,
29+
"latedef": true,
30+
"noarg": true,
31+
"undef": true,
32+
"unused": true,
33+
"trailing": true,
34+
"maxdepth": 4,
35+
"boss" : true,
36+
"eqnull": true,
37+
"evil": true,
38+
"loopfunc": true,
39+
"smarttabs": true,
40+
"maxerr" : 200,
41+
"jquery": true,
42+
"dojo": true,
43+
"mootools": true,
44+
"yui": true,
45+
"browser": true,
46+
"phantom": true,
47+
"rhino": true,
48+
"node": true,
49+
"esnext": true
50+
}

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
!dist/

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
language: node_js
2+
node_js: node
3+
before_install:
4+
- "export DISPLAY=:99.0"
5+
- "sh -e /etc/init.d/xvfb start"

.yo-rc.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"generator-donejs": {
3+
"promptValues": {
4+
"authorName": "Bitovi",
5+
"authorEmail": "[email protected]",
6+
"authorUrl": "https://www.bitovi.com/"
7+
}
8+
}
9+
}

CONTRIBUTING.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Contributing to can-ajax
2+
3+
## Developing Locally
4+
5+
This section will walk you through setting up the [repository](https://github.com/canjs/can-ajax) on your computer.
6+
7+
### Signing up for GitHub
8+
9+
If you don’t already have a GitHub account, you’ll need to [create a new one](https://help.github.com/articles/signing-up-for-a-new-github-account/).
10+
11+
### Forking & cloning the repository
12+
13+
A “fork” is a copy of a repository in your personal GitHub account. “Cloning” is the process of getting the repository’s source code on your computer.
14+
15+
GitHub has a guide for [forking a repo](https://help.github.com/articles/fork-a-repo/). To fork can-ajax, you can start by going to its [fork page](https://github.com/canjs/can-ajax/fork).
16+
17+
Next, you’ll want to clone the repo. [GitHub’s cloning guide](https://help.github.com/articles/cloning-a-repository/) explains how to do this on Linux, Mac, or Windows.
18+
19+
GitHub’s guide will [instruct you](https://help.github.com/articles/fork-a-repo/#step-2-create-a-local-clone-of-your-fork) to clone it with a command like:
20+
21+
```shell
22+
git clone https://github.com/YOUR-USERNAME/can-ajax
23+
```
24+
25+
Make sure you replace `YOUR-USERNAME` with your GitHub username.
26+
27+
### Installing the dependencies
28+
29+
After you’ve forked & cloned the repository, you’ll need to install the project’s dependencies.
30+
31+
First, make sure you’ve [installed Node.js and npm](https://docs.npmjs.com/getting-started/installing-node).
32+
33+
If you just cloned the repo from the command line, you’ll want to switch to the folder with your clone:
34+
35+
```shell
36+
cd can-ajax
37+
```
38+
39+
Next, install the project’s dependencies with npm:
40+
41+
```shell
42+
npm install
43+
```
44+
45+
### Starting the development server
46+
47+
Run the following to start a dev server:
48+
49+
```shell
50+
npm run develop
51+
```
52+
53+
### Running the tests
54+
55+
You can manually run this repository’s tests in any browser by starting the dev server (see the section above) and visiting this page: http://localhost:8080/test/test.html
56+
57+
Firefox is used to run the repository’s automated tests from the command line. If you don’t already have it, [download Firefox](https://www.mozilla.org/en-US/firefox/new/). Mozilla has guides for installing it on [Linux](https://support.mozilla.org/t5/Install-and-Update/Install-Firefox-on-Linux/ta-p/2516), [Mac](https://support.mozilla.org/t5/Install-and-Update/How-to-download-and-install-Firefox-on-Mac/ta-p/3453), and [Windows](https://support.mozilla.org/t5/Install-and-Update/How-to-download-and-install-Firefox-on-Windows/ta-p/2210).
58+
59+
After Firefox is installed, you can run:
60+
61+
```shell
62+
npm test
63+
```
64+
65+
### Making a build
66+
67+
Run the following command to create a build:
68+
69+
```shell
70+
npm run build
71+
```
72+
73+
This will create a `dist/` folder that contains the AMD, CommonJS, and global module versions of the project.
74+
75+
### Building the documentation
76+
77+
To generate the docs:
78+
79+
```shell
80+
npm run document
81+
```
82+
83+
This will create a `docs/` folder that contains a browsable site with all of your documentation.
84+
85+
With the dev server running, you can view the docs at http://localhost:8080/docs/

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2017 CanJS
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# can-ajax
2+
3+
[![Greenkeeper badge](https://badges.greenkeeper.io/canjs/can-ajax.svg)](https://greenkeeper.io/)
4+
5+
[![Build Status](https://travis-ci.org/canjs/can-ajax.png?branch=master)](https://travis-ci.org/canjs/can-ajax)
6+
7+
jQuery-inspired AJAX request library.
8+
9+
## Usage
10+
11+
### ES6 use
12+
13+
With StealJS, you can import this module directly in a template that is autorendered:
14+
15+
```js
16+
import plugin from 'can-ajax';
17+
```
18+
19+
### CommonJS use
20+
21+
Use `require` to load `can-ajax` and everything else
22+
needed to create a template that uses `can-ajax`:
23+
24+
```js
25+
var plugin = require("can-ajax");
26+
```
27+
28+
## AMD use
29+
30+
Configure the `can` and `jquery` paths and the `can-ajax` package:
31+
32+
```html
33+
<script src="require.js"></script>
34+
<script>
35+
require.config({
36+
paths: {
37+
"jquery": "node_modules/jquery/dist/jquery",
38+
"can": "node_modules/canjs/dist/amd/can"
39+
},
40+
packages: [{
41+
name: 'can-ajax',
42+
location: 'node_modules/can-ajax/dist/amd',
43+
main: 'lib/can-ajax'
44+
}]
45+
});
46+
require(["main-amd"], function(){});
47+
</script>
48+
```
49+
50+
### Standalone use
51+
52+
Load the `global` version of the plugin:
53+
54+
```html
55+
<script src='./node_modules/can-ajax/dist/global/can-ajax.js'></script>
56+
```

build.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
var stealTools = require("steal-tools");
2+
3+
stealTools.export({
4+
steal: {
5+
config: __dirname + "/package.json!npm"
6+
},
7+
outputs: {
8+
"+cjs": {},
9+
"+amd": {},
10+
"+global-js": {}
11+
}
12+
}).catch(function(e){
13+
14+
setTimeout(function(){
15+
throw e;
16+
},1);
17+
18+
});

0 commit comments

Comments
 (0)