mirror of
https://github.com/eldarion/eldarion-ajax-demo.git
synced 2026-01-08 21:47:56 -05:00
Update to eldarion-ajax==0.7.2
This commit is contained in:
4
demo/static/js/eldarion-ajax.min.js
vendored
4
demo/static/js/eldarion-ajax.min.js
vendored
@@ -1,5 +1,5 @@
|
||||
/* ====================================================================
|
||||
* eldarion-ajax.min.js v0.7.0
|
||||
* eldarion-ajax.min.js v0.7.2
|
||||
* ====================================================================
|
||||
* Copyright (c) 2013, Eldarion, Inc.
|
||||
* All rights reserved.
|
||||
@@ -29,4 +29,4 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ==================================================================== */
|
||||
!function(e){"use strict";var t=function(){};t.prototype.click=function(t){var a=e(this),o=a.attr("href"),r=a.attr("data-method");r||(r="get"),a.trigger("eldarion-ajax:begin",[a]),t.preventDefault(),e.ajax({url:o,type:r,dataType:"json",statusCode:{200:function(e){a.trigger("eldarion-ajax:success",[a,e])},500:function(){a.trigger("eldarion-ajax:error",[a,500])},404:function(){a.trigger("eldarion-ajax:error",[a,404])}}})},t.prototype.submit=function(t){var a=e(this),o=a.attr("action"),r=a.attr("method"),n=a.serialize();a.trigger("eldarion-ajax:begin",[a]),t.preventDefault(),e.ajax({url:o,type:r,data:n,dataType:"json",statusCode:{200:function(e){a.trigger("eldarion-ajax:success",[a,e])},500:function(){a.trigger("eldarion-ajax:error",[a,500])},404:function(){a.trigger("eldarion-ajax:error",[a,404])}}})},t.prototype.cancel=function(t){var a=e(this),o=a.attr("data-cancel-closest");t.preventDefault(),a.closest(o).remove()},e(function(){e("body").on("click","a.ajax",t.prototype.click),e("body").on("submit","form.ajax",t.prototype.submit),e("body").on("click","a[data-cancel-closest]",t.prototype.cancel)})}(window.jQuery),!function(e){"use strict";var t=function(){};t.prototype.redirect=function(e,t,a){return a.location?(window.location.href=a.location,!1):void 0},t.prototype.replace=function(t,a,o){e(a.data("replace")).replaceWith(o.html)},t.prototype.replaceClosest=function(e,t,a){t.closest(t.data("replace-closest")).replaceWith(a.html)},t.prototype.replaceInner=function(t,a,o){e(a.data("replace-inner")).html(o.html)},t.prototype.replaceClosestInner=function(e,t,a){t.closest(t.data("replace-closest-inner")).html(a.html)},t.prototype.append=function(t,a,o){e(a.data("append")).append(o.html)},t.prototype.prepend=function(t,a,o){e(a.data("prepend")).prepend(o.html)},t.prototype.refresh=function(t,a){e.each(e(a.data("refresh")),function(t,a){e.getJSON(e(a).data("refresh-url"),function(t){e(a).replaceWith(t.html)})})},t.prototype.refreshClosest=function(t,a){e.each(e(a.data("refresh-closest")),function(t,o){e.getJSON(e(o).data("refresh-url"),function(t){a.closest(e(o)).replaceWith(t.html)})})},t.prototype.clear=function(t,a){e(a.data("clear")).html("")},t.prototype.remove=function(t,a){e(a.data("remove")).remove()},t.prototype.clearClosest=function(e,t){t.closest(t.data("clear-closest")).html("")},t.prototype.removeClosest=function(e,t){t.closest(t.data("remove-closest")).remove()},t.prototype.fragments=function(t,a,o){if(o.fragments)for(var r in o.fragments)e(r).replaceWith(o.fragments[r]);if(o["inner-fragments"])for(var n in o["inner-fragments"])e(n).html(o["inner-fragments"][n]);if(o["append-fragments"])for(var c in o["append-fragments"])e(c).append(o["append-fragments"][c]);if(o["prepend-fragments"])for(var s in o["prepend-fragments"])e(s).prepend(o["prepend-fragments"][s])},e(function(){e(document).on("eldarion-ajax:success",t.prototype.redirect),e(document).on("eldarion-ajax:success",t.prototype.fragments),e(document).on("eldarion-ajax:success","[data-replace]",t.prototype.replace),e(document).on("eldarion-ajax:success","[data-replace-closest]",t.prototype.replaceClosest),e(document).on("eldarion-ajax:success","[data-replace-inner]",t.prototype.replaceInner),e(document).on("eldarion-ajax:success","[data-replace-closest-inner]",t.prototype.replaceClosestInner),e(document).on("eldarion-ajax:success","[data-append]",t.prototype.append),e(document).on("eldarion-ajax:success","[data-prepend]",t.prototype.prepend),e(document).on("eldarion-ajax:success","[data-refresh]",t.prototype.refresh),e(document).on("eldarion-ajax:success","[data-refresh-closest]",t.prototype.refreshClosest),e(document).on("eldarion-ajax:success","[data-clear]",t.prototype.clear),e(document).on("eldarion-ajax:success","[data-remove]",t.prototype.remove),e(document).on("eldarion-ajax:success","[data-clear-closest]",t.prototype.clearClosest),e(document).on("eldarion-ajax:success","[data-remove-closest]",t.prototype.removeClosest)})}(window.jQuery);
|
||||
!function(e){"use strict";var t=function(){};t.prototype.click=function(t){var a=e(this),o=a.attr("href"),r=a.attr("data-method");r||(r="get"),a.trigger("eldarion-ajax:begin",[a]),t.preventDefault(),e.ajax({url:o,type:r,dataType:"json",headers:{"X-Eldarion-Ajax":!0},statusCode:{200:function(e){a.trigger("eldarion-ajax:success",[a,e])},500:function(){a.trigger("eldarion-ajax:error",[a,500])},400:function(){a.trigger("eldarion-ajax:error",[a,400])},404:function(){a.trigger("eldarion-ajax:error",[a,404])}},complete:function(t,o){e(document).trigger("eldarion-ajax:complete",[a,t,o])}})},t.prototype.submit=function(t){var a=e(this),o=a.attr("action"),r=a.attr("method"),n=a.serialize();a.trigger("eldarion-ajax:begin",[a]),t.preventDefault(),e.ajax({url:o,type:r,data:n,dataType:"json",headers:{"X-Eldarion-Ajax":!0},statusCode:{200:function(e){a.trigger("eldarion-ajax:success",[a,e])},500:function(){a.trigger("eldarion-ajax:error",[a,500])},400:function(){a.trigger("eldarion-ajax:error",[a,400])},404:function(){a.trigger("eldarion-ajax:error",[a,404])}},complete:function(t,o){e(document).trigger("eldarion-ajax:complete",[a,t,o])}})},t.prototype.cancel=function(t){var a=e(this),o=a.attr("data-cancel-closest");t.preventDefault(),a.closest(o).remove()},e(function(){e("body").on("click","a.ajax",t.prototype.click),e("body").on("submit","form.ajax",t.prototype.submit),e("body").on("click","a[data-cancel-closest]",t.prototype.cancel)})}(window.jQuery),!function(e){"use strict";var t=function(){};t.prototype.redirect=function(e,t,a){return a.location?(window.location.href=a.location,!1):void 0},t.prototype.replace=function(t,a,o){e(a.data("replace")).replaceWith(o.html)},t.prototype.replaceClosest=function(e,t,a){t.closest(t.data("replace-closest")).replaceWith(a.html)},t.prototype.replaceInner=function(t,a,o){e(a.data("replace-inner")).html(o.html)},t.prototype.replaceClosestInner=function(e,t,a){t.closest(t.data("replace-closest-inner")).html(a.html)},t.prototype.append=function(t,a,o){e(a.data("append")).append(o.html)},t.prototype.prepend=function(t,a,o){e(a.data("prepend")).prepend(o.html)},t.prototype.refresh=function(t,a){e.each(e(a.data("refresh")),function(t,a){e.getJSON(e(a).data("refresh-url"),function(t){e(a).replaceWith(t.html)})})},t.prototype.refreshClosest=function(t,a){e.each(e(a.data("refresh-closest")),function(t,o){e.getJSON(e(o).data("refresh-url"),function(t){a.closest(e(o)).replaceWith(t.html)})})},t.prototype.clear=function(t,a){e(a.data("clear")).html("")},t.prototype.remove=function(t,a){e(a.data("remove")).remove()},t.prototype.clearClosest=function(e,t){t.closest(t.data("clear-closest")).html("")},t.prototype.removeClosest=function(e,t){t.closest(t.data("remove-closest")).remove()},t.prototype.fragments=function(t,a,o){if(o.fragments)for(var r in o.fragments)e(r).replaceWith(o.fragments[r]);if(o["inner-fragments"])for(var n in o["inner-fragments"])e(n).html(o["inner-fragments"][n]);if(o["append-fragments"])for(var c in o["append-fragments"])e(c).append(o["append-fragments"][c]);if(o["prepend-fragments"])for(var s in o["prepend-fragments"])e(s).prepend(o["prepend-fragments"][s])},e(function(){e(document).on("eldarion-ajax:success",t.prototype.redirect),e(document).on("eldarion-ajax:success",t.prototype.fragments),e(document).on("eldarion-ajax:success","[data-replace]",t.prototype.replace),e(document).on("eldarion-ajax:success","[data-replace-closest]",t.prototype.replaceClosest),e(document).on("eldarion-ajax:success","[data-replace-inner]",t.prototype.replaceInner),e(document).on("eldarion-ajax:success","[data-replace-closest-inner]",t.prototype.replaceClosestInner),e(document).on("eldarion-ajax:success","[data-append]",t.prototype.append),e(document).on("eldarion-ajax:success","[data-prepend]",t.prototype.prepend),e(document).on("eldarion-ajax:success","[data-refresh]",t.prototype.refresh),e(document).on("eldarion-ajax:success","[data-refresh-closest]",t.prototype.refreshClosest),e(document).on("eldarion-ajax:success","[data-clear]",t.prototype.clear),e(document).on("eldarion-ajax:success","[data-remove]",t.prototype.remove),e(document).on("eldarion-ajax:success","[data-clear-closest]",t.prototype.clearClosest),e(document).on("eldarion-ajax:success","[data-remove-closest]",t.prototype.removeClosest)})}(window.jQuery);
|
||||
Reference in New Issue
Block a user