Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | // Binary: cache/js-dbg-32-30b481fd82f5-linux |
michael@0 | 2 | // Flags: -j |
michael@0 | 3 | // |
michael@0 | 4 | var Native = function(k) { |
michael@0 | 5 | var f = k.initialize; |
michael@0 | 6 | var d = f; |
michael@0 | 7 | var j = function(n, l, o, m) { |
michael@0 | 8 | n.prototype[l] = o; |
michael@0 | 9 | }; |
michael@0 | 10 | d.alias = function(n, l, o) { |
michael@0 | 11 | n = this.prototype[n] |
michael@0 | 12 | return j(this, l, n, o); |
michael@0 | 13 | }; |
michael@0 | 14 | d.implement = function(m, l, o) { |
michael@0 | 15 | for (var n in m) { |
michael@0 | 16 | j(this, n, m[n], l); |
michael@0 | 17 | } |
michael@0 | 18 | } |
michael@0 | 19 | return d; |
michael@0 | 20 | }; |
michael@0 | 21 | (function() { |
michael@0 | 22 | var a = { |
michael@0 | 23 | Array: Array, |
michael@0 | 24 | Function: Function, |
michael@0 | 25 | }; |
michael@0 | 26 | for (var h in a) { |
michael@0 | 27 | new Native({ |
michael@0 | 28 | initialize: a[h], |
michael@0 | 29 | }); |
michael@0 | 30 | } |
michael@0 | 31 | } ()); |
michael@0 | 32 | Array.alias("forEach", "each"); |
michael@0 | 33 | function $merge() { |
michael@0 | 34 | var a = Array.slice(arguments); |
michael@0 | 35 | a.unshift({}); |
michael@0 | 36 | return $mixin.apply(null, a); |
michael@0 | 37 | } |
michael@0 | 38 | function $mixin(e) { |
michael@0 | 39 | for (var d = 1, a = arguments.length; d < a; d++) { |
michael@0 | 40 | var b = arguments[d]; |
michael@0 | 41 | for (var c in b) { |
michael@0 | 42 | var g = b[c], |
michael@0 | 43 | f = e[c]; |
michael@0 | 44 | e[c] = f && $type(g) == "object" && $type(f) == "object" ? $mixin(f, g) : $unlink(g); |
michael@0 | 45 | } |
michael@0 | 46 | } |
michael@0 | 47 | } |
michael@0 | 48 | function $type(a) { |
michael@0 | 49 | if (a == undefined) { |
michael@0 | 50 | return false; |
michael@0 | 51 | } |
michael@0 | 52 | if (a.$family) { |
michael@0 | 53 | } |
michael@0 | 54 | return typeof a; |
michael@0 | 55 | } |
michael@0 | 56 | function $unlink(c) { |
michael@0 | 57 | if ($type(c) == "object") { |
michael@0 | 58 | b = {}; |
michael@0 | 59 | } |
michael@0 | 60 | return b; |
michael@0 | 61 | } |
michael@0 | 62 | var Window = new Native({ |
michael@0 | 63 | initialize: function(a) {}, |
michael@0 | 64 | }); |
michael@0 | 65 | Array.implement({ |
michael@0 | 66 | extend: function(c) { |
michael@0 | 67 | return this; |
michael@0 | 68 | } |
michael@0 | 69 | }); |
michael@0 | 70 | Function.implement({ |
michael@0 | 71 | extend: function(a) { |
michael@0 | 72 | for (var b in a) { |
michael@0 | 73 | this[b] = a[b]; |
michael@0 | 74 | } |
michael@0 | 75 | return this; |
michael@0 | 76 | }, |
michael@0 | 77 | run: function(a, b) { |
michael@0 | 78 | return this.apply(b, a); |
michael@0 | 79 | } |
michael@0 | 80 | }); |
michael@0 | 81 | function Class(b) { |
michael@0 | 82 | var a = function() { |
michael@0 | 83 | Object.reset(this); |
michael@0 | 84 | var c = this.initialize ? this.initialize.apply(this, arguments) : this; |
michael@0 | 85 | }.extend(this); |
michael@0 | 86 | a.implement(b); |
michael@0 | 87 | return a; |
michael@0 | 88 | } |
michael@0 | 89 | Object.reset = function(a, c) { |
michael@0 | 90 | if (c == null) { |
michael@0 | 91 | for (var e in a) { |
michael@0 | 92 | Object.reset(a, e); |
michael@0 | 93 | } |
michael@0 | 94 | } |
michael@0 | 95 | switch ($type(a[c])) { |
michael@0 | 96 | case "object": |
michael@0 | 97 | var d = function() {}; |
michael@0 | 98 | d.prototype = a[c]; |
michael@0 | 99 | var b = new d; |
michael@0 | 100 | a[c] = Object.reset(b); |
michael@0 | 101 | } |
michael@0 | 102 | return a; |
michael@0 | 103 | }; |
michael@0 | 104 | (new Native({initialize: Class})).extend({}); |
michael@0 | 105 | function wrap(a, b, c) { |
michael@0 | 106 | return function() { |
michael@0 | 107 | var d = c.apply(this, arguments); |
michael@0 | 108 | }.extend({}); |
michael@0 | 109 | } |
michael@0 | 110 | Class.implement({ |
michael@0 | 111 | implement: function(a, d) { |
michael@0 | 112 | if ($type(a) == "object") { |
michael@0 | 113 | for (var e in a) { |
michael@0 | 114 | this.implement(e, a[e]); |
michael@0 | 115 | } |
michael@0 | 116 | } |
michael@0 | 117 | var f = Class.Mutators[a]; |
michael@0 | 118 | if (f) { |
michael@0 | 119 | d = f.call(this, d); |
michael@0 | 120 | } |
michael@0 | 121 | var c = this.prototype; |
michael@0 | 122 | switch ($type(d)) { |
michael@0 | 123 | case "function": |
michael@0 | 124 | c[a] = wrap(this, a, d); |
michael@0 | 125 | break; |
michael@0 | 126 | case "object": |
michael@0 | 127 | var b = c[a]; |
michael@0 | 128 | if ($type(b) == "object") { |
michael@0 | 129 | $mixin(b, d); |
michael@0 | 130 | } else { |
michael@0 | 131 | c[a] = $unlink(d); |
michael@0 | 132 | } |
michael@0 | 133 | } |
michael@0 | 134 | } |
michael@0 | 135 | }); |
michael@0 | 136 | Class.Mutators = { |
michael@0 | 137 | Extends: function(a) { |
michael@0 | 138 | this.prototype = new a; |
michael@0 | 139 | }, |
michael@0 | 140 | Implements: function(a) { |
michael@0 | 141 | a.each(function(b) { |
michael@0 | 142 | b = new b; |
michael@0 | 143 | this.implement(b); |
michael@0 | 144 | }, |
michael@0 | 145 | this); |
michael@0 | 146 | } |
michael@0 | 147 | }; |
michael@0 | 148 | var Events = new Class({}); |
michael@0 | 149 | var Options = new Class({ |
michael@0 | 150 | setOptions: function() { |
michael@0 | 151 | this.options = $merge.run([this.options].extend(arguments)); |
michael@0 | 152 | } |
michael@0 | 153 | }); |
michael@0 | 154 | var Autocompleter = {}; |
michael@0 | 155 | Autocompleter.Base = new Class({ |
michael@0 | 156 | Implements: [Options, Events], |
michael@0 | 157 | options: {}, |
michael@0 | 158 | }); |
michael@0 | 159 | Autocompleter.Ajax = {}; |
michael@0 | 160 | Autocompleter.Ajax.Base = new Class({ |
michael@0 | 161 | Extends: Autocompleter.Base, |
michael@0 | 162 | options: { |
michael@0 | 163 | postVar: "value", |
michael@0 | 164 | onRequest: function(){}, |
michael@0 | 165 | } |
michael@0 | 166 | }); |
michael@0 | 167 | Autocompleter.Ajax.Json = new Class({ |
michael@0 | 168 | Extends: Autocompleter.Ajax.Base, |
michael@0 | 169 | }); |
michael@0 | 170 | Autocompleter.JsonP = new Class({ |
michael@0 | 171 | Extends: Autocompleter.Ajax.Json, |
michael@0 | 172 | options: { |
michael@0 | 173 | minLength: 1 |
michael@0 | 174 | }, |
michael@0 | 175 | initialize: function(el, url, options) { |
michael@0 | 176 | this.setOptions({}); |
michael@0 | 177 | } |
michael@0 | 178 | }); |
michael@0 | 179 | new Autocompleter.JsonP(); |