Sha256: 6fecad4bde2545704d47d87550913f6cc531e2b22bc0aef17c13c0c6b3c7f813

Contents?: true

Size: 658 Bytes

Versions: 12

Compression:

Stored size: 658 Bytes

Contents

Obfuscator = {

  extractUrl: function(url) {
    pattern = /#(.+)$/
    if (url.match(pattern)) {
      return "/" + RegExp.$1.replace(/%23/g,'/');
    }
  },
  
  decode: function(elem){

    var text = Obfuscator.extractUrl(elem.href);
    var dst = '';
    var len = text.length;

    if  (text.length > 0) {
     for(var i=0; i < text.length ; i++) {
       b = text.charCodeAt(i)
       if( ( (b>64) && (b<78) ) || ( (b>96) && (b<110) ) ) {
          b=b+13;
      } else {
        if( ( (b>77) && (b<91) ) || ( (b>109) && (b<123) ) ) { b=b-13; }
      }
      t=String.fromCharCode(b);
      dst=dst.concat(t);
     }
    }
   elem.href = dst;
  }
}

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
ppc_logic-0.8.0 public/javascripts/link_obfuscator.js
site_logic-1.9.2 public/javascripts/link_obfuscator.js
site_logic-1.9.1 public/javascripts/link_obfuscator.js
site_logic-1.9.0 public/javascripts/link_obfuscator.js
site_logic-1.8.0 public/javascripts/link_obfuscator.js
site_logic-1.7.1 public/javascripts/link_obfuscator.js
site_logic-1.7.0 public/javascripts/link_obfuscator.js
site_logic-1.6.10 public/javascripts/link_obfuscator.js
site_logic-1.6.9 public/javascripts/link_obfuscator.js
site_logic-1.6.8 public/javascripts/link_obfuscator.js
site_logic-1.6.7 public/javascripts/link_obfuscator.js
site_logic-1.6.6 public/javascripts/link_obfuscator.js