Skip to content

Commit

Permalink
Release 0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jgallen23 committed Apr 26, 2012
1 parent 7a129f6 commit 98792bf
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 8 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
boosh:
smoosh make ./build.json
test:
./node_modules/.bin/nodeunit test/node.js

.PHONY: test
42 changes: 42 additions & 0 deletions dist/jquery.framejax.js
Original file line number Diff line number Diff line change
@@ -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);
8 changes: 8 additions & 0 deletions dist/jquery.framejax.min.js
Original file line number Diff line number Diff line change
@@ -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)
6 changes: 3 additions & 3 deletions lib/copyright.js
Original file line number Diff line number Diff line change
@@ -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
*/
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand All @@ -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.