Permalink
Browse files

Added AMD build configuration, updated output libs, added version and…

… license notice.
  • Loading branch information...
1 parent 628151b commit fd4cbc305f2a110fadc61ceaae211191c7935ad1 @ifandelse committed Feb 4, 2012
View
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+anvil -b build-standard.json
+anvil -b build-amd.json
View
@@ -0,0 +1,12 @@
+{
+ "source": "src",
+ "output": "lib/amd",
+ "lint": {},
+ "uglify": {},
+ "gzip": {},
+ "extensions": { "uglify": "min", "gzip": "gz" },
+ "wrap": {
+ "prefix": "define(['jquery'], function($){",
+ "suffix": "return $.trafficCop;});"
+ }
+}
@@ -1,6 +1,6 @@
{
"source": "src",
- "output": "lib",
+ "output": "lib/standard",
"lint": {},
"uglify": {},
"gzip": {},
View
@@ -0,0 +1,27 @@
+define(['jquery'], function($){
+/*
+ TrafficCop
+ Author: Jim Cowart
+ License: Dual licensed MIT (http://www.opensource.org/licenses/mit-license) & GPL (http://www.opensource.org/licenses/gpl-license)
+ Version 0.3.0
+*/
+
+var inProgress = {};
+
+$.trafficCop = function(url, options) {
+ var reqOptions = url, key;
+ if(arguments.length === 2) {
+ reqOptions = $.extend(true, options, { url: url });
+ }
+ key = JSON.stringify(reqOptions);
+ if (key in inProgress) {
+ for (i in {success: 1, error: 1, complete: 1}) {
+ inProgress[key][i](reqOptions[i]);
+ }
+ } else {
+ inProgress[key] = $.ajax(reqOptions).always(function () { delete inProgress[key]; });
+ }
+ return inProgress[key];
+};
+
+return $.trafficCop;});
Binary file not shown.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -1,4 +1,10 @@
(function($, undefined) {
+/*
+ TrafficCop
+ Author: Jim Cowart
+ License: Dual licensed MIT (http://www.opensource.org/licenses/mit-license) & GPL (http://www.opensource.org/licenses/gpl-license)
+ Version 0.3.0
+*/
var inProgress = {};
Binary file not shown.
File renamed without changes.
View
@@ -3,4 +3,5 @@ var express = require('express'),
path = require("path");
app.use("/", express.static(path.resolve(__dirname)));
-app.listen(1581);
+app.listen(1581);
+console.log("Listening on port 1581");
View
@@ -5,7 +5,7 @@
<script type="text/javascript" src="../ext/jquery.mockjax.js"></script>
<script type="text/javascript" src="../ext/qunit.js"></script>
<script type="text/javascript" src="../ext/pavlov.js"></script>
-<script type="text/javascript" src="../lib/TrafficCop.js"></script>
+<script type="text/javascript" src="../lib/standard/TrafficCop.js"></script>
<script type="text/javascript" src="TrafficCop.spec.js"></script>
<link rel="stylesheet" href="../ext/qunit.css" type="text/css" media="screen" />
</head>
View
@@ -1,4 +1,4 @@
-
+//import("VersionHeader.js");
var inProgress = {};
$.trafficCop = function(url, options) {
View
@@ -0,0 +1,6 @@
+/*
+ TrafficCop
+ Author: Jim Cowart
+ License: Dual licensed MIT (http://www.opensource.org/licenses/mit-license) & GPL (http://www.opensource.org/licenses/gpl-license)
+ Version 0.3.0
+*/

0 comments on commit fd4cbc3

Please sign in to comment.