Subversion Repositories SmartDukaan

Rev

Rev 15085 | Rev 15767 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 15085 Rev 15203
Line 1... Line 1...
1
<html>
1
<html>
2
<!--
2
<head>
3
  Static page for redirecting to a separate page.
-
 
4
  This changes the HTTP-Referer so that the original page is
-
 
5
  hidden.
-
 
6
 
-
 
7
  Copyright (c) 2014 by Jim Lawless
-
 
8
  jimbo@radiks.net
-
 
9
  See MIT/X11 license at
-
 
10
  http://www.mailsend-online.com/license2014.php
-
 
11
 
-
 
12
-->
-
 
13
<head><title>Ditch your HTTP-Referer</title>
3
  <title>Redirect</title>
14
<script type="text/javascript">
4
<script type="text/javascript">
-
 
5
String.prototype.capitalizeFirstLetter = function() {
-
 
6
    return this.charAt(0).toUpperCase() + this.slice(1);
-
 
7
}
15
function pass_it_on() {
8
function pass_it_on() {
16
   var l=window.location+"";
9
   var l=window.location+"";
17
   var dsp=document.getElementById("display");
10
   var dsp=document.getElementById("display");
18
   var qsloc=l.indexOf("?");
11
   var qsloc=l.indexOf("?");
19
   if(qsloc>=0) {
12
   if(qsloc>=0) {
-
 
13
      var link = document.createElement('a');          
20
      var query_string=unescape(l.substring(qsloc+1));
14
      var query_string=unescape(l.substring(qsloc+1));
-
 
15
      link.setAttribute('href', Base64.decode(query_string));    
21
      dsp.innerHTML="Redirecting to " + query_string;
16
      dsp.innerHTML="Redirecting to " + link.hostname.capitalizeFirstLetter();
22
      window.location=query_string;
17
      window.location=Base64.decode(query_string);
23
   }
18
   }
24
}
19
}
-
 
20
var Base64 = {
-
 
21
 
-
 
22
 
-
 
23
    _keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
-
 
24
 
-
 
25
 
-
 
26
    encode: function(input) {
-
 
27
        var output = "";
-
 
28
        var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
-
 
29
        var i = 0;
-
 
30
 
-
 
31
        input = Base64._utf8_encode(input);
-
 
32
 
-
 
33
        while (i < input.length) {
-
 
34
 
-
 
35
            chr1 = input.charCodeAt(i++);
-
 
36
            chr2 = input.charCodeAt(i++);
-
 
37
            chr3 = input.charCodeAt(i++);
-
 
38
 
-
 
39
            enc1 = chr1 >> 2;
-
 
40
            enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
-
 
41
            enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
-
 
42
            enc4 = chr3 & 63;
-
 
43
 
-
 
44
            if (isNaN(chr2)) {
-
 
45
                enc3 = enc4 = 64;
-
 
46
            } else if (isNaN(chr3)) {
-
 
47
                enc4 = 64;
-
 
48
            }
-
 
49
 
-
 
50
            output = output + this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) + this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);
-
 
51
 
-
 
52
        }
-
 
53
 
-
 
54
        return output;
-
 
55
    },
-
 
56
 
-
 
57
 
-
 
58
    decode: function(input) {
-
 
59
        var output = "";
-
 
60
        var chr1, chr2, chr3;
-
 
61
        var enc1, enc2, enc3, enc4;
-
 
62
        var i = 0;
-
 
63
 
-
 
64
        input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
-
 
65
 
-
 
66
        while (i < input.length) {
-
 
67
 
-
 
68
            enc1 = this._keyStr.indexOf(input.charAt(i++));
-
 
69
            enc2 = this._keyStr.indexOf(input.charAt(i++));
-
 
70
            enc3 = this._keyStr.indexOf(input.charAt(i++));
-
 
71
            enc4 = this._keyStr.indexOf(input.charAt(i++));
-
 
72
 
-
 
73
            chr1 = (enc1 << 2) | (enc2 >> 4);
-
 
74
            chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
-
 
75
            chr3 = ((enc3 & 3) << 6) | enc4;
-
 
76
 
-
 
77
            output = output + String.fromCharCode(chr1);
-
 
78
 
-
 
79
            if (enc3 != 64) {
-
 
80
                output = output + String.fromCharCode(chr2);
-
 
81
            }
-
 
82
            if (enc4 != 64) {
-
 
83
                output = output + String.fromCharCode(chr3);
-
 
84
            }
-
 
85
 
-
 
86
        }
-
 
87
 
-
 
88
        output = Base64._utf8_decode(output);
-
 
89
 
-
 
90
        return output;
-
 
91
 
-
 
92
    },
-
 
93
 
-
 
94
    _utf8_encode: function(string) {
-
 
95
        string = string.replace(/\r\n/g, "\n");
-
 
96
        var utftext = "";
-
 
97
 
-
 
98
        for (var n = 0; n < string.length; n++) {
-
 
99
 
-
 
100
            var c = string.charCodeAt(n);
-
 
101
 
-
 
102
            if (c < 128) {
-
 
103
                utftext += String.fromCharCode(c);
-
 
104
            }
-
 
105
            else if ((c > 127) && (c < 2048)) {
-
 
106
                utftext += String.fromCharCode((c >> 6) | 192);
-
 
107
                utftext += String.fromCharCode((c & 63) | 128);
-
 
108
            }
-
 
109
            else {
-
 
110
                utftext += String.fromCharCode((c >> 12) | 224);
-
 
111
                utftext += String.fromCharCode(((c >> 6) & 63) | 128);
-
 
112
                utftext += String.fromCharCode((c & 63) | 128);
-
 
113
            }
-
 
114
 
-
 
115
        }
-
 
116
 
-
 
117
        return utftext;
-
 
118
    },
-
 
119
 
-
 
120
    _utf8_decode: function(utftext) {
-
 
121
        var string = "";
-
 
122
        var i = 0;
-
 
123
        var c = c1 = c2 = 0;
-
 
124
 
-
 
125
        while (i < utftext.length) {
-
 
126
 
-
 
127
            c = utftext.charCodeAt(i);
-
 
128
 
-
 
129
            if (c < 128) {
-
 
130
                string += String.fromCharCode(c);
-
 
131
                i++;
-
 
132
            }
-
 
133
            else if ((c > 191) && (c < 224)) {
-
 
134
                c2 = utftext.charCodeAt(i + 1);
-
 
135
                string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
-
 
136
                i += 2;
-
 
137
            }
-
 
138
            else {
-
 
139
                c2 = utftext.charCodeAt(i + 1);
-
 
140
                c3 = utftext.charCodeAt(i + 2);
-
 
141
                string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
-
 
142
                i += 3;
-
 
143
            }
-
 
144
 
-
 
145
        }
-
 
146
 
-
 
147
        return string;
-
 
148
    }
-
 
149
 
-
 
150
}
25
</script>
151
</script>
26
</head>
152
</head>
27
<body onload="pass_it_on();">
153
<body onload="pass_it_on();">
28
 
154
 
29
<div id="display">
155
<div id="display">