Permalink
Browse files

v1.5.3-beta. Response data for html ajaxy links now returns outerHTML…

… instead of innerHTML for head and body elements.
  • Loading branch information...
balupton committed Aug 7, 2010
1 parent 7154e68 commit 0d6d61fe8522cd97091ed32781e16fb4db3802b9
Showing with 4,856 additions and 4,785 deletions.
  1. +14 −1 README.txt
  2. +4,797 −4,768 scripts/closure.map
  3. +20 −6 scripts/jquery.ajaxy.js
  4. +5 −4 scripts/jquery.ajaxy.min.js
  5. +5 −6 scripts/resources/jquery.ajaxy.js
  6. +15 −0 scripts/resources/jquery.extra.js
View
@@ -19,7 +19,7 @@
* - A copy of our interpretation of the license used.
* If not, see <http://github.com/balupton/jquery-ajaxy/blob/master/COPYING.txt>.
*
- * @version 1.5.2-beta
+ * @version 1.5.3-beta
* @date August 07, 2010
* @since v0.1.0-dev, July 24, 2008
* @category jquery-plugin
@@ -47,6 +47,19 @@ Known Issues:
Changelog:
+v1.5.3-beta, August 07, 2010
+- The Response.data returned on normal html ajaxy links is now as follows:
+ {
+ "controller": controller,
+ "responseText": responseText, /* raw result */
+ "html": html, /* raw result put through Ajaxy.htmlCompat */
+ "title": title, /* the text of the title/#ajaxy-title element */
+ "head": head, /* the outerHTML of the head/#ajaxy-head element */
+ "body": body, /* the outerHTML of the body/#ajaxy-body element */
+ "content": content /* the innerHTML of the body/#ajaxy-body element or the html value */
+ }
+- Updated jQuery Sparkle dependencies to [v1.4.10-beta, August 07, 2010]
+
v1.5.2-beta, August 07, 2010
- Added the Ajaxy.htmlCompat function which will convert a html document into a jQuery compatible document.
This is based on old functionality and includes fixes.
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -946,6 +946,21 @@ String.prototype.queryStringToJSON = String.prototype.queryStringToJSON || funct
};
+ /**
+ * Get a elements html including it's own tag
+ * @version 1.0.1
+ * @date August 07, 2010
+ * @since 1.0.0, August 07, 2010
+ * @package jquery-sparkle {@link http://www.balupton/projects/jquery-sparkle}
+ * @author Benjamin "balupton" Lupton {@link http://www.balupton.com}
+ * @copyright (c) 2009-2010 Benjamin Arthur Lupton {@link http://www.balupton.com}
+ * @license GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
+ */
+ $.fn.htmlAndSelf = $.fn.htmlAndSelf || function(){
+ // Get a elements html including it's own tag
+ return $(this).attr('outerHTML');
+ };
+
})(jQuery);/**
* @depends jquery
* @name jquery.utilities
@@ -1737,7 +1752,7 @@ String.prototype.queryStringToJSON = String.prototype.queryStringToJSON || funct
/**
* jQuery Ajaxy
- * @version 1.5.2
+ * @version 1.5.3
* @date August 07, 2010
* @since 0.1.0-dev, July 24, 2008
* @package jquery-ajaxy {@link http://www.balupton/projects/jquery-ajaxy}
@@ -3181,11 +3196,10 @@ String.prototype.queryStringToJSON = String.prototype.queryStringToJSON || funct
$title = $html.find('#ajaxy-title'),
$controller = $html.find('#ajaxy-controller'), /* special case support for controller in html pages */
title = ($title.length ? $title.text() : ''),
- head = ($head.length ? $head.html() : ''),
- body = ($body.length ? $body.html() : ''),
- content = (body || html),
- controller = ($controller.length ? $controller.text() : null);
- // ^ We do the above workaround with element types as jQuery does not support loadin in documents
+ head = ($head.length ? $head.htmlAndSelf() : ''),
+ body = ($body.length ? $body.htmlAndSelf() : ''),
+ content = ($body.length ? $body.html() : html),
+ controller = ($controller.length ? $controller.text().trim() : null);
// Create
responseData = {

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

Oops, something went wrong.
@@ -18,7 +18,7 @@
/**
* jQuery Ajaxy
- * @version 1.5.2
+ * @version 1.5.3
* @date August 07, 2010
* @since 0.1.0-dev, July 24, 2008
* @package jquery-ajaxy {@link http://www.balupton/projects/jquery-ajaxy}
@@ -1462,11 +1462,10 @@
$title = $html.find('#ajaxy-title'),
$controller = $html.find('#ajaxy-controller'), /* special case support for controller in html pages */
title = ($title.length ? $title.text() : ''),
- head = ($head.length ? $head.html() : ''),
- body = ($body.length ? $body.html() : ''),
- content = (body || html),
- controller = ($controller.length ? $controller.text() : null);
- // ^ We do the above workaround with element types as jQuery does not support loadin in documents
+ head = ($head.length ? $head.htmlAndSelf() : ''),
+ body = ($body.length ? $body.htmlAndSelf() : ''),
+ content = ($body.length ? $body.html() : html),
+ controller = ($controller.length ? $controller.text().trim() : null);
// Create
responseData = {
@@ -323,4 +323,19 @@
};
+ /**
+ * Get a elements html including it's own tag
+ * @version 1.0.1
+ * @date August 07, 2010
+ * @since 1.0.0, August 07, 2010
+ * @package jquery-sparkle {@link http://www.balupton/projects/jquery-sparkle}
+ * @author Benjamin "balupton" Lupton {@link http://www.balupton.com}
+ * @copyright (c) 2009-2010 Benjamin Arthur Lupton {@link http://www.balupton.com}
+ * @license GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
+ */
+ $.fn.htmlAndSelf = $.fn.htmlAndSelf || function(){
+ // Get a elements html including it's own tag
+ return $(this).attr('outerHTML');
+ };
+
})(jQuery);

0 comments on commit 0d6d61f

Please sign in to comment.