noreferrer 0.2 → 0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -13,5 +13,9 @@ Example:
13
13
  The following exmaple will intercept and remove the referrer information to any links that link to google.
14
14
 
15
15
  $(document).ready(function(){
16
- $('a').noreferrer(['google', 'yahoo.com']);
16
+ jQuery.noreferrer('a', ['google', 'yahoo.com']);
17
17
  });
18
+
19
+ --
20
+ A LIVE example application can be seen at
21
+ http://test-referrer.herokuapp.com/
data/noreferrer.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |gem|
6
6
  gem.name = "noreferrer"
7
- gem.version = 0.2
7
+ gem.version = 0.3
8
8
  gem.authors = ["Rodney Carvalho"]
9
9
  gem.email = ["rcarvalho@atlantistech.com"]
10
10
  gem.description = "Removes referrer information on an html link."
@@ -11,14 +11,14 @@
11
11
 
12
12
  (function($){
13
13
  NoReferrer = {
14
- init: function(matches){
14
+ init: function(selector, url_matches){
15
15
  NoReferrer.Browser.init();
16
16
  if(matches != undefined){
17
17
  for(i=0;i<matches.length;i++){
18
18
  matches[i]
19
19
  }
20
20
  }
21
- $('a').on('click', function(e){
21
+ $(document.body).on('click', selector, function(e){
22
22
  if(matches == undefined){
23
23
  NoReferrer.Link.go($(this).attr('href'));
24
24
  return false;
@@ -92,27 +92,8 @@
92
92
  }
93
93
  };
94
94
 
95
- $.fn.noreferrer = function(matches) {
96
- NoReferrer.Browser.init();
97
- if(matches != undefined){
98
- for(i=0;i<matches.length;i++){
99
- matches[i]
100
- }
101
- }
102
- this.on('click', function(e){
103
- if(matches == undefined){
104
- NoReferrer.Link.go($(this).attr('href'));
105
- return false;
106
- }
107
- else{
108
- for(i=0;i<matches.length;i++){
109
- if(new RegExp(matches[i]).test($(this).attr('href'))){
110
- NoReferrer.Link.go($(this).attr('href'));
111
- return false;
112
- }
113
- }
114
- }
115
- });
95
+ $.fn.noreferrer = function(selector, url_matches) {
96
+ NoReferrer.Browser.init(selector, matches);
116
97
  return this;
117
98
  };
118
99
  })(jQuery);
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: noreferrer
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.2'
4
+ version: '0.3'
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: