Sha256: 8bea751233c31a10dd2dc61d0ff315d709c343ed185ad1254d8dd887f43105e3
Contents?: true
Size: 1.6 KB
Versions: 23
Compression:
Stored size: 1.6 KB
Contents
I"Y(function() { var Link; Link = (function() { function Link(page, $link) { this.page = page; this.$link = $link; } Link.prototype.allows_process = function(event) { return !(this._cross_origin_link(event.currentTarget) || this._non_standard_click(event)); }; Link.prototype.process = function() { var type; type = this.$link.data('push') === 'partial' ? 'partial' : 'template'; return this.page.load(this.$link.attr("href"), this.$link.data('target'), type); }; Link.prototype._cross_origin_link = function(link) { return this._different_protocol(link) || this._different_host(link) || this._different_port(link); }; Link.prototype._different_protocol = function(link) { if (link.protocol === ':' || link.protocol === '') { return false; } return location.protocol !== link.protocol; }; Link.prototype._different_host = function(link) { if (link.host === '') { return false; } return location.host.split(':')[0] !== link.host.split(':')[0]; }; Link.prototype._different_port = function(link) { var port_equals; port_equals = (location.port === link.port) || (location.port === '' && (link.port === "80" || link.port === "443")); return !port_equals; }; Link.prototype._non_standard_click = function(event) { return event.metaKey || event.ctrlKey || event.shiftKey || event.altKey; }; return Link; })(); if (window._Wiselinks === void 0) { window._Wiselinks = {}; } window._Wiselinks.Link = Link; }).call(this); :ET
Version data entries
23 entries across 23 versions & 1 rubygems