mirror of
https://github.com/wahyd4/cdnjs.git
synced 2026-08-18 17:26:38 +10:00
Added jquery.turbolinks
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
// Generated by CoffeeScript 1.7.1
|
||||
|
||||
/*
|
||||
jQuery.Turbolinks ~ https://github.com/kossnocorp/jquery.turbolinks
|
||||
jQuery plugin for drop-in fix binded events problem caused by Turbolinks
|
||||
|
||||
The MIT License
|
||||
Copyright (c) 2012-2013 Sasha Koss & Rico Sta. Cruz
|
||||
*/
|
||||
|
||||
(function() {
|
||||
var $, $document;
|
||||
|
||||
$ = window.jQuery || (typeof require === "function" ? require('jquery') : void 0);
|
||||
|
||||
$document = $(document);
|
||||
|
||||
$.turbo = {
|
||||
version: '2.0.2',
|
||||
isReady: false,
|
||||
use: function(load, fetch) {
|
||||
return $document.off('.turbo').on("" + load + ".turbo", this.onLoad).on("" + fetch + ".turbo", this.onFetch);
|
||||
},
|
||||
addCallback: function(callback) {
|
||||
if ($.turbo.isReady) {
|
||||
return callback($);
|
||||
} else {
|
||||
return $document.on('turbo:ready', function() {
|
||||
return callback($);
|
||||
});
|
||||
}
|
||||
},
|
||||
onLoad: function() {
|
||||
$.turbo.isReady = true;
|
||||
return $document.trigger('turbo:ready');
|
||||
},
|
||||
onFetch: function() {
|
||||
return $.turbo.isReady = false;
|
||||
},
|
||||
register: function() {
|
||||
$(this.onLoad);
|
||||
return $.fn.ready = this.addCallback;
|
||||
}
|
||||
};
|
||||
|
||||
$.turbo.register();
|
||||
|
||||
$.turbo.use('page:load', 'page:fetch');
|
||||
|
||||
}).call(this);
|
||||
@@ -0,0 +1 @@
|
||||
(function(){var r,t;r=window.jQuery||("function"==typeof require?require("jquery"):void 0),t=r(document),r.turbo={version:"2.0.2",isReady:!1,use:function(r,o){return t.off(".turbo").on(""+r+".turbo",this.onLoad).on(""+o+".turbo",this.onFetch)},addCallback:function(o){return r.turbo.isReady?o(r):t.on("turbo:ready",function(){return o(r)})},onLoad:function(){return r.turbo.isReady=!0,t.trigger("turbo:ready")},onFetch:function(){return r.turbo.isReady=!1},register:function(){return r(this.onLoad),r.fn.ready=this.addCallback}},r.turbo.register(),r.turbo.use("page:load","page:fetch")}).call(this);
|
||||
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"name": "jquery.turbolinks",
|
||||
"version": "2.0.2",
|
||||
"filename": "jquery.turbolinks.min.js",
|
||||
"author": "Sasha Koss <kossnocorp@gmail.com>",
|
||||
"description": "jQuery plugin for drop-in fix binded events problem caused by Turbolinks",
|
||||
|
||||
"devDependencies": {
|
||||
"coffee-script": "~1.7.1",
|
||||
"mocha": "*",
|
||||
"chai": "*",
|
||||
"sinon": "*",
|
||||
"sinon-chai": "*",
|
||||
"jquery": "*",
|
||||
"jsdom": "*"
|
||||
},
|
||||
|
||||
"license": "MIT",
|
||||
|
||||
"engine": {
|
||||
"node": ">=0.4"
|
||||
},
|
||||
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "Sasha Koss",
|
||||
"web": "http://koss.nocorp.me"
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user