Subversion Repositories SmartDukaan

Rev

Rev 15767 | Rev 18167 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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