Skip to content
Browse files

Release 0.1.0

  • Loading branch information...
1 parent 7a129f6 commit 98792bf49fb4d6f415f43a60c0e3e75326d41a77 @jgallen23 committed Apr 26, 2012
Showing with 62 additions and 8 deletions.
  1. +7 −0 CHANGELOG.md
  2. +0 −3 Makefile
  3. +42 −0 dist/jquery.framejax.js
  4. +8 −0 dist/jquery.framejax.min.js
  5. +3 −3 lib/copyright.js
  6. +2 −2 package.json
View
7 CHANGELOG.md
@@ -1,3 +1,10 @@
+
+0.1.0 / 2012-04-26
+==================
+
+ * re-wrote as jquery plugin
+ * updated example server
+
# v0.0.3
- removed unnecessary options code
- submit function now calls submit for you
View
3 Makefile
@@ -1,6 +1,3 @@
boosh:
smoosh make ./build.json
-test:
- ./node_modules/.bin/nodeunit test/node.js
-.PHONY: test
View
42 dist/jquery.framejax.js
@@ -0,0 +1,42 @@
+/*!
+ * jquery.framejax
+ * v0.1.0
+ * https://github.com/jgallen23/framejax
+ * copyright JGA 2012
+ * MIT License
+ */
+
+!function($) {
+ var lastId = 0;
+ var createiFrame = function(id) {
+ return $('<iframe/>')
+ .attr({
+ id: id,
+ name: id,
+ width: 0,
+ height: 0
+ })
+ .css('display', 'none')
+ .appendTo('body');
+ }
+
+ $.fn.framejax = function(opts) {
+ return this.each(function() {
+ var el = $(this);
+ if (el[0].tagName != 'FORM')
+ throw new Error('all selectors must be form tags');
+
+ el.on('submit', function() {
+ var id = '__framejax__' + lastId++;
+ var iframe = createiFrame(id);
+
+ iframe.on('load', function() {
+ var results = $(this).contents().find('body').html();
+ el.trigger('complete', results);
+ });
+
+ el.attr('target', id);
+ });
+ });
+ };
+}(window.jQuery);
View
8 dist/jquery.framejax.min.js
@@ -0,0 +1,8 @@
+/*!
+ * jquery.framejax
+ * v0.1.0
+ * https://github.com/jgallen23/framejax
+ * copyright JGA 2012
+ * MIT License
+ */
+!function(a){var b=0,c=function(b){return a("<iframe/>").attr({id:b,name:b,width:0,height:0}).css("display","none").appendTo("body")};a.fn.framejax=function(d){return this.each(function(){var d=a(this);if(d[0].tagName!="FORM")throw new Error("all selectors must be form tags");d.on("submit",function(){var e="__framejax__"+b++,f=c(e);f.on("load",function(){var b=a(this).contents().find("body").html();d.trigger("complete",b)}),d.attr("target",e)})})}}(window.jQuery)
View
6 lib/copyright.js
@@ -1,7 +1,7 @@
/*!
- * framejax
- * v0.0.3
+ * jquery.framejax
+ * v0.1.0
* https://github.com/jgallen23/framejax
- * copyright JGA 2011
+ * copyright JGA 2012
* MIT License
*/
View
4 package.json
@@ -1,7 +1,7 @@
{
"name": "framejax",
"description": "a iframe ajax library for uploading files",
- "version": "0.0.3",
+ "version": "0.1.0",
"homepage": "https://github.com/jgallen23/framejax",
"author": "Greg Allen <@jgaui> (http://jga.me)",
"repository": {
@@ -14,7 +14,7 @@
"express": "*",
"jade": "*"
},
- "main": "./dist/framejax.js",
+ "main": "./dist/jquery.framejax.js",
"keywords": ["ender", "iframe", "ajax", "upload"]
}

0 comments on commit 98792bf

Please sign in to comment.
Something went wrong with that request. Please try again.