Subversion Repositories SmartDukaan

Rev

Rev 20145 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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