|
8114 | 8114 |
|
8115 | 8115 | var QRCode$1 = QRCode; |
8116 | 8116 |
|
8117 | | - var sdPara = {}; |
8118 | | - |
8119 | | - var ObjProto = Object.prototype; |
8120 | | - var toString = ObjProto.toString; |
8121 | | - |
8122 | | - var getRandomBasic = (function() { |
8123 | | - var today = new Date(); |
8124 | | - var seed = today.getTime(); |
8125 | | - |
8126 | | - function rnd() { |
8127 | | - seed = (seed * 9301 + 49297) % 233280; |
8128 | | - return seed / 233280.0; |
8129 | | - } |
8130 | | - return function rand(number) { |
8131 | | - return Math.ceil(rnd() * number); |
8132 | | - }; |
8133 | | - })(); |
8134 | | - |
8135 | | - function isObject(obj) { |
8136 | | - if (obj == null) { |
8137 | | - return false; |
8138 | | - } else { |
8139 | | - return toString.call(obj) == '[object Object]'; |
8140 | | - } |
8141 | | - } |
8142 | | - |
8143 | | - function formatJsonString(obj) { |
8144 | | - try { |
8145 | | - return JSON.stringify(obj, null, ' '); |
8146 | | - } catch (e) { |
8147 | | - return JSON.stringify(obj); |
8148 | | - } |
8149 | | - } |
8150 | | - |
8151 | | - function isSessionStorgaeSupport() { |
8152 | | - var supported = true; |
8153 | | - |
8154 | | - var supportName = '__sensorsdatasupport__'; |
8155 | | - var val = 'testIsSupportStorage'; |
8156 | | - try { |
8157 | | - if (sessionStorage && sessionStorage.setItem) { |
8158 | | - sessionStorage.setItem(supportName, val); |
8159 | | - sessionStorage.removeItem(supportName, val); |
8160 | | - supported = true; |
8161 | | - } else { |
8162 | | - supported = false; |
8163 | | - } |
8164 | | - } catch (e) { |
8165 | | - supported = false; |
8166 | | - } |
8167 | | - return supported; |
8168 | | - } |
8169 | | - |
8170 | | - function sdLog() { |
8171 | | - if ((isSessionStorgaeSupport() && sessionStorage.getItem('sensorsdata_jssdk_debug') === 'true') || sdPara.show_log) { |
8172 | | - if (isObject(arguments[0]) && (sdPara.show_log === false)) { |
8173 | | - arguments[0] = formatJsonString(arguments[0]); |
8174 | | - } |
8175 | | - |
8176 | | - if (typeof console === 'object' && console.log) { |
8177 | | - try { |
8178 | | - return console.log.apply(console, arguments); |
8179 | | - } catch (e) { |
8180 | | - console.log(arguments[0]); |
8181 | | - } |
8182 | | - } |
8183 | | - } |
8184 | | - } |
8185 | | - |
8186 | | - function urlParse(para) { |
8187 | | - var URLParser = function(a) { |
8188 | | - this._fields = { |
8189 | | - Username: 4, |
8190 | | - Password: 5, |
8191 | | - Port: 7, |
8192 | | - Protocol: 2, |
8193 | | - Host: 6, |
8194 | | - Path: 8, |
8195 | | - URL: 0, |
8196 | | - QueryString: 9, |
8197 | | - Fragment: 10 |
8198 | | - }; |
8199 | | - this._values = {}; |
8200 | | - this._regex = null; |
8201 | | - this._regex = /^((\w+):\/\/)?((\w+):?(\w+)?@)?([^\/\?:]+):?(\d+)?(\/?[^\?#]+)?\??([^#]+)?#?(\w*)/; |
8202 | | - |
8203 | | - if (typeof a != 'undefined') { |
8204 | | - this._parse(a); |
8205 | | - } |
8206 | | - }; |
8207 | | - URLParser.prototype.setUrl = function(a) { |
8208 | | - this._parse(a); |
8209 | | - }; |
8210 | | - URLParser.prototype._initValues = function() { |
8211 | | - for (var a in this._fields) { |
8212 | | - this._values[a] = ''; |
8213 | | - } |
8214 | | - }; |
8215 | | - URLParser.prototype.addQueryString = function(queryObj) { |
8216 | | - if (typeof queryObj !== 'object') { |
8217 | | - return false; |
8218 | | - } |
8219 | | - var query = this._values.QueryString || ''; |
8220 | | - for (var i in queryObj) { |
8221 | | - if (new RegExp(i + '[^&]+').test(query)) { |
8222 | | - query = query.replace(new RegExp(i + '[^&]+'), i + '=' + queryObj[i]); |
8223 | | - } else { |
8224 | | - if (query.slice(-1) === '&') { |
8225 | | - query = query + i + '=' + queryObj[i]; |
8226 | | - } else { |
8227 | | - if (query === '') { |
8228 | | - query = i + '=' + queryObj[i]; |
8229 | | - } else { |
8230 | | - query = query + '&' + i + '=' + queryObj[i]; |
8231 | | - } |
8232 | | - } |
8233 | | - } |
8234 | | - } |
8235 | | - this._values.QueryString = query; |
8236 | | - }; |
8237 | | - URLParser.prototype.getUrl = function() { |
8238 | | - var url = ''; |
8239 | | - url += this._values.Origin; |
8240 | | - url += this._values.Port ? ':' + this._values.Port : ''; |
8241 | | - url += this._values.Path; |
8242 | | - url += this._values.QueryString ? '?' + this._values.QueryString : ''; |
8243 | | - url += this._values.Fragment ? '#' + this._values.Fragment : ''; |
8244 | | - return url; |
8245 | | - }; |
8246 | | - |
8247 | | - URLParser.prototype._parse = function(a) { |
8248 | | - this._initValues(); |
8249 | | - |
8250 | | - var b = this._regex.exec(a); |
8251 | | - if (!b) { |
8252 | | - sdLog('DPURLParser::_parse -> Invalid URL'); |
8253 | | - } |
8254 | | - |
8255 | | - var urlTmp = a.split('#'); |
8256 | | - var urlPart = urlTmp[0]; |
8257 | | - var hashPart = urlTmp.slice(1).join('#'); |
8258 | | - b = this._regex.exec(urlPart); |
8259 | | - for (var c in this._fields) { |
8260 | | - if (typeof b[this._fields[c]] != 'undefined') { |
8261 | | - this._values[c] = b[this._fields[c]]; |
8262 | | - } |
8263 | | - } |
8264 | | - this._values['Hostname'] = this._values['Host'].replace(/:\d+$/, ''); |
8265 | | - this._values['Origin'] = this._values['Protocol'] + '://' + this._values['Hostname']; |
8266 | | - this._values['Fragment'] = hashPart; |
8267 | | - }; |
8268 | | - return new URLParser(para); |
8269 | | - } |
8270 | | - |
8271 | 8117 | (function() { |
8272 | 8118 | var sd = null; |
8273 | 8119 | var _ = null; |
|
8304 | 8150 | this.setNoticeMap(data, url); |
8305 | 8151 | } |
8306 | 8152 | } else { |
8307 | | - var href = urlParse(location.href); |
8308 | 8153 | if (!data) { |
8309 | 8154 | return false; |
8310 | 8155 | } |
|
8313 | 8158 | } |
8314 | 8159 | var obj = { |
8315 | 8160 | 'sa-request-id': data, |
8316 | | - 'sa-request-type': type |
| 8161 | + 'sa-request-type': type, |
| 8162 | + 'sa-request-url': sessionStorage ? sessionStorage.getItem('sensors_heatmap_url') || '' : '' |
8317 | 8163 | }; |
| 8164 | + var windowNameParam = {}; |
| 8165 | + try { |
| 8166 | + if (window.name) { |
| 8167 | + windowNameParam = JSON.parse(window.name); |
| 8168 | + obj = _.extend(windowNameParam, obj); |
| 8169 | + } |
| 8170 | + window.name = JSON.stringify(obj); |
| 8171 | + } catch (e) { |
| 8172 | + window.name = JSON.stringify(obj); |
| 8173 | + } |
8318 | 8174 |
|
8319 | | - href.addQueryString(obj); |
8320 | | - location.href = href.getUrl(); |
| 8175 | + location.reload(); |
8321 | 8176 | } |
8322 | 8177 | }, |
8323 | 8178 | setDropDown: function(request_id, type, url) { |
|
9565 | 9420 |
|
9566 | 9421 | window.sa_jssdk_heatmap_render = function(se, data, type, url) { |
9567 | 9422 | sd = se; |
9568 | | - sd.heatmap_version = '1.21.6'; |
| 9423 | + sd.heatmap_version = '1.21.7'; |
9569 | 9424 | _ = sd._; |
9570 | 9425 | _.querySelectorAll = function(val) { |
9571 | 9426 | if (typeof val !== 'string') { |
|
0 commit comments