Subversion Repositories SmartDukaan

Rev

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

Rev 15085 Rev 15128
Line 236... Line 236...
236
				format: "json"
236
				format: "json"
237
			},
237
			},
238
			// Work with the response
238
			// Work with the response
239
			success: function( response ) {
239
			success: function( response ) {
240
				if(response.success && response.type=='redirect'){
240
				if(response.success && response.type=='redirect'){
-
 
241
					if(me == 1) {
241
					// document.location = response.url;
242
						document.location = 'http://mobilehotindia.com/r.html?'+Base64.encode(response.url);
-
 
243
					}else{
242
					document.location = '/r.html?'+response.url;
244
						document.location = response.url;
-
 
245
					}										
243
				}
246
				}
244
			}
247
			}
245
		});
248
		});
246
		ga('send', 'event', 'product', 'click', $(this).data('url'));
249
		ga('send', 'event', 'product', 'click', $(this).data('url'));
247
	});
250
	});
Line 657... Line 660...
657
	$('[data-toggle="popover"]#'+id).popover({'html':true});
660
	$('[data-toggle="popover"]#'+id).popover({'html':true});
658
	$('[data-toggle="popover"]#'+id).trigger('click');		
661
	$('[data-toggle="popover"]#'+id).trigger('click');		
659
}
662
}
660
$(document).on('click','.nodeals',function(){
663
$(document).on('click','.nodeals',function(){
661
	document.location = $(this).data('href');
664
	document.location = $(this).data('href');
662
})
-
 
663
665
})
-
 
666
var Base64 = {
-
 
667
 
-
 
668
 
-
 
669
    _keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
-
 
670
 
-
 
671
 
-
 
672
    encode: function(input) {
-
 
673
        var output = "";
-
 
674
        var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
-
 
675
        var i = 0;
-
 
676
 
-
 
677
        input = Base64._utf8_encode(input);
-
 
678
 
-
 
679
        while (i < input.length) {
-
 
680
 
-
 
681
            chr1 = input.charCodeAt(i++);
-
 
682
            chr2 = input.charCodeAt(i++);
-
 
683
            chr3 = input.charCodeAt(i++);
-
 
684
 
-
 
685
            enc1 = chr1 >> 2;
-
 
686
            enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
-
 
687
            enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
-
 
688
            enc4 = chr3 & 63;
-
 
689
 
-
 
690
            if (isNaN(chr2)) {
-
 
691
                enc3 = enc4 = 64;
-
 
692
            } else if (isNaN(chr3)) {
-
 
693
                enc4 = 64;
-
 
694
            }
-
 
695
 
-
 
696
            output = output + this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) + this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);
-
 
697
 
-
 
698
        }
-
 
699
 
-
 
700
        return output;
-
 
701
    },
-
 
702
 
-
 
703
 
-
 
704
    decode: function(input) {
-
 
705
        var output = "";
-
 
706
        var chr1, chr2, chr3;
-
 
707
        var enc1, enc2, enc3, enc4;
-
 
708
        var i = 0;
-
 
709
 
-
 
710
        input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
-
 
711
 
-
 
712
        while (i < input.length) {
-
 
713
 
-
 
714
            enc1 = this._keyStr.indexOf(input.charAt(i++));
-
 
715
            enc2 = this._keyStr.indexOf(input.charAt(i++));
-
 
716
            enc3 = this._keyStr.indexOf(input.charAt(i++));
-
 
717
            enc4 = this._keyStr.indexOf(input.charAt(i++));
-
 
718
 
-
 
719
            chr1 = (enc1 << 2) | (enc2 >> 4);
-
 
720
            chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
-
 
721
            chr3 = ((enc3 & 3) << 6) | enc4;
-
 
722
 
-
 
723
            output = output + String.fromCharCode(chr1);
-
 
724
 
-
 
725
            if (enc3 != 64) {
-
 
726
                output = output + String.fromCharCode(chr2);
-
 
727
            }
-
 
728
            if (enc4 != 64) {
-
 
729
                output = output + String.fromCharCode(chr3);
-
 
730
            }
-
 
731
 
-
 
732
        }
-
 
733
 
-
 
734
        output = Base64._utf8_decode(output);
-
 
735
 
-
 
736
        return output;
-
 
737
 
-
 
738
    },
-
 
739
 
-
 
740
    _utf8_encode: function(string) {
-
 
741
        string = string.replace(/\r\n/g, "\n");
-
 
742
        var utftext = "";
-
 
743
 
-
 
744
        for (var n = 0; n < string.length; n++) {
-
 
745
 
-
 
746
            var c = string.charCodeAt(n);
-
 
747
 
-
 
748
            if (c < 128) {
-
 
749
                utftext += String.fromCharCode(c);
-
 
750
            }
-
 
751
            else if ((c > 127) && (c < 2048)) {
-
 
752
                utftext += String.fromCharCode((c >> 6) | 192);
-
 
753
                utftext += String.fromCharCode((c & 63) | 128);
-
 
754
            }
-
 
755
            else {
-
 
756
                utftext += String.fromCharCode((c >> 12) | 224);
-
 
757
                utftext += String.fromCharCode(((c >> 6) & 63) | 128);
-
 
758
                utftext += String.fromCharCode((c & 63) | 128);
-
 
759
            }
-
 
760
 
-
 
761
        }
-
 
762
 
-
 
763
        return utftext;
-
 
764
    },
-
 
765
 
-
 
766
    _utf8_decode: function(utftext) {
-
 
767
        var string = "";
-
 
768
        var i = 0;
-
 
769
        var c = c1 = c2 = 0;
-
 
770
 
-
 
771
        while (i < utftext.length) {
-
 
772
 
-
 
773
            c = utftext.charCodeAt(i);
-
 
774
 
-
 
775
            if (c < 128) {
-
 
776
                string += String.fromCharCode(c);
-
 
777
                i++;
-
 
778
            }
-
 
779
            else if ((c > 191) && (c < 224)) {
-
 
780
                c2 = utftext.charCodeAt(i + 1);
-
 
781
                string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
-
 
782
                i += 2;
-
 
783
            }
-
 
784
            else {
-
 
785
                c2 = utftext.charCodeAt(i + 1);
-
 
786
                c3 = utftext.charCodeAt(i + 2);
-
 
787
                string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
-
 
788
                i += 3;
-
 
789
            }
-
 
790
 
-
 
791
        }
-
 
792
 
-
 
793
        return string;
-
 
794
    }
-
 
795
 
-
 
796
}
-
 
797
664
798