Skip to content

Commit be42df7

Browse files
author
shengyonggen
committed
优化老板app打通中getAppStatus的多次调用功能
1 parent c7c2336 commit be42df7

File tree

9 files changed

+42
-30
lines changed

9 files changed

+42
-30
lines changed

heatmap.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sensorsdata.amd.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sensorsdata.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/heatmap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9209,7 +9209,7 @@ var heatmap_render = {
92099209

92109210
var urlParse = new _.urlParse(sd.para.web_url);
92119211
urlParse._values.Path = '/web-click/users';
9212-
obj.data_user_link = urlParse.getUrl() + '#heat_map_id=' + heat_map_id + '&detail=true&element_selector=' + encodeURIComponent(obj.by_values[0]);
9212+
obj.data_user_link = urlParse.getUrl() + '#heat_map_id=' + heat_map_id + '&detail=true&element_selector=' + encodeURIComponent(obj.by_values[0]) + '&page_url=' + encodeURIComponent(location.href);
92139213

92149214
if(String(obj.top_values[0]) === 'null'){
92159215
obj.data_top_value = '没有值';

src/sdk.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1608,9 +1608,8 @@ _.getSourceFromReferrer = function(){
16081608
}
16091609
}
16101610
}
1611-
1612-
var search_engine = ['www.baidu.','m.baidu.','m.sm.cn','so.com','sogou.com','youdao.com','google.','yahoo.com/','bing.com/','ask.com/'];
1613-
var social_engine = ['weibo.com','renren.com','kaixin001.com','douban.com','qzone.qq.com','zhihu.com','tieba.baidu.com','weixin.qq.com'];
1611+
var search_engine = sd.para.source_type.search;
1612+
var social_engine = sd.para.source_type.social;
16141613

16151614
var referrer = document.referrer || '';
16161615
var url = _.info.pageProp.url;
@@ -2906,7 +2905,7 @@ saEvent.send = function(p, callback) {
29062905
}
29072906
};
29082907

2909-
function app_js_bridge(){
2908+
function app_js_bridge(){
29102909
var app_info = null;
29112910
var todo = null;
29122911
function setAppInfo(data){
@@ -2916,6 +2915,8 @@ saEvent.send = function(p, callback) {
29162915
}
29172916
if(todo){
29182917
todo(app_info);
2918+
todo = null;
2919+
app_info = null;
29192920
}
29202921
}
29212922
//android
@@ -2948,16 +2949,19 @@ saEvent.send = function(p, callback) {
29482949
// 不传参数,直接返回数据
29492950
if(!func){
29502951
return app_info;
2952+
app_info = null;
29512953
}else{
29522954
//如果传参数,保存参数。如果有数据直接执行,没数据时保存
29532955
if(app_info === null){
29542956
todo = func;
29552957
}else{
29562958
func(app_info);
2959+
app_info = null;
29572960
}
29582961
}
29592962
};
29602963
};
2964+
29612965
sd.getPresetProperties = function(){
29622966
function getUtm(){
29632967
var utms = _.info.campaignParams();

src/sensorsdata.full.amd.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ if(typeof JSON!=='object'){JSON={}}(function(){'use strict';var rx_one=/^[\],:{}
7575

7676
is_trackLink:true,
7777
// 如果要设置,设置数组
78-
source_type_config:{
78+
source_type:{
7979
utm: null,
80-
search: null,
81-
social: null
80+
search: ['www.baidu.','m.baidu.','m.sm.cn','so.com','sogou.com','youdao.com','google.','yahoo.com/','bing.com/','ask.com/'],
81+
social: ['weibo.com','renren.com','kaixin001.com','douban.com','qzone.qq.com','zhihu.com','tieba.baidu.com','weixin.qq.com']
8282
},
8383
callback_timeout: 1000,
8484
is_track_device_id: false,
@@ -135,7 +135,7 @@ var ObjProto = Object.prototype;
135135
var slice = ArrayProto.slice;
136136
var toString = ObjProto.toString;
137137
var hasOwnProperty = ObjProto.hasOwnProperty;
138-
var LIB_VERSION = '1.9.11';
138+
var LIB_VERSION = '1.9.12';
139139

140140
sd.lib_version = LIB_VERSION;
141141

@@ -1739,9 +1739,8 @@ _.getSourceFromReferrer = function(){
17391739
}
17401740
}
17411741
}
1742-
1743-
var search_engine = ['www.baidu.','m.baidu.','m.sm.cn','so.com','sogou.com','youdao.com','google.','yahoo.com/','bing.com/','ask.com/'];
1744-
var social_engine = ['weibo.com','renren.com','kaixin001.com','douban.com','qzone.qq.com','zhihu.com','tieba.baidu.com','weixin.qq.com'];
1742+
var search_engine = sd.para.source_type.search;
1743+
var social_engine = sd.para.source_type.social;
17451744

17461745
var referrer = document.referrer || '';
17471746
var url = _.info.pageProp.url;
@@ -3031,7 +3030,7 @@ saEvent.send = function(p, callback) {
30313030
}
30323031
};
30333032

3034-
function app_js_bridge(){
3033+
function app_js_bridge(){
30353034
var app_info = null;
30363035
var todo = null;
30373036
function setAppInfo(data){
@@ -3041,6 +3040,8 @@ saEvent.send = function(p, callback) {
30413040
}
30423041
if(todo){
30433042
todo(app_info);
3043+
todo = null;
3044+
app_info = null;
30443045
}
30453046
}
30463047
//android
@@ -3073,16 +3074,19 @@ saEvent.send = function(p, callback) {
30733074
// 不传参数,直接返回数据
30743075
if(!func){
30753076
return app_info;
3077+
app_info = null;
30763078
}else{
30773079
//如果传参数,保存参数。如果有数据直接执行,没数据时保存
30783080
if(app_info === null){
30793081
todo = func;
30803082
}else{
30813083
func(app_info);
3084+
app_info = null;
30823085
}
30833086
}
30843087
};
30853088
};
3089+
30863090
sd.getPresetProperties = function(){
30873091
function getUtm(){
30883092
var utms = _.info.campaignParams();

src/sensorsdata.full.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ if(typeof JSON!=='object'){JSON={}}(function(){'use strict';var rx_one=/^[\],:{}
7272

7373
is_trackLink:true,
7474
// 如果要设置,设置数组
75-
source_type_config:{
75+
source_type:{
7676
utm: null,
77-
search: null,
78-
social: null
77+
search: ['www.baidu.','m.baidu.','m.sm.cn','so.com','sogou.com','youdao.com','google.','yahoo.com/','bing.com/','ask.com/'],
78+
social: ['weibo.com','renren.com','kaixin001.com','douban.com','qzone.qq.com','zhihu.com','tieba.baidu.com','weixin.qq.com']
7979
},
8080
callback_timeout: 1000,
8181
is_track_device_id: false,
@@ -132,7 +132,7 @@ var ObjProto = Object.prototype;
132132
var slice = ArrayProto.slice;
133133
var toString = ObjProto.toString;
134134
var hasOwnProperty = ObjProto.hasOwnProperty;
135-
var LIB_VERSION = '1.9.11';
135+
var LIB_VERSION = '1.9.12';
136136

137137
sd.lib_version = LIB_VERSION;
138138

@@ -1736,9 +1736,8 @@ _.getSourceFromReferrer = function(){
17361736
}
17371737
}
17381738
}
1739-
1740-
var search_engine = ['www.baidu.','m.baidu.','m.sm.cn','so.com','sogou.com','youdao.com','google.','yahoo.com/','bing.com/','ask.com/'];
1741-
var social_engine = ['weibo.com','renren.com','kaixin001.com','douban.com','qzone.qq.com','zhihu.com','tieba.baidu.com','weixin.qq.com'];
1739+
var search_engine = sd.para.source_type.search;
1740+
var social_engine = sd.para.source_type.social;
17421741

17431742
var referrer = document.referrer || '';
17441743
var url = _.info.pageProp.url;
@@ -3028,7 +3027,7 @@ saEvent.send = function(p, callback) {
30283027
}
30293028
};
30303029

3031-
function app_js_bridge(){
3030+
function app_js_bridge(){
30323031
var app_info = null;
30333032
var todo = null;
30343033
function setAppInfo(data){
@@ -3038,6 +3037,8 @@ saEvent.send = function(p, callback) {
30383037
}
30393038
if(todo){
30403039
todo(app_info);
3040+
todo = null;
3041+
app_info = null;
30413042
}
30423043
}
30433044
//android
@@ -3070,16 +3071,19 @@ saEvent.send = function(p, callback) {
30703071
// 不传参数,直接返回数据
30713072
if(!func){
30723073
return app_info;
3074+
app_info = null;
30733075
}else{
30743076
//如果传参数,保存参数。如果有数据直接执行,没数据时保存
30753077
if(app_info === null){
30763078
todo = func;
30773079
}else{
30783080
func(app_info);
3081+
app_info = null;
30793082
}
30803083
}
30813084
};
30823085
};
3086+
30833087
sd.getPresetProperties = function(){
30843088
function getUtm(){
30853089
var utms = _.info.campaignParams();

src/sensorsdata.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ try{
8080

8181
is_trackLink:true,
8282
// 如果要设置,设置数组
83-
source_type_config:{
83+
source_type:{
8484
utm: null,
85-
search: null,
86-
social: null
85+
search: ['www.baidu.','m.baidu.','m.sm.cn','so.com','sogou.com','youdao.com','google.','yahoo.com/','bing.com/','ask.com/'],
86+
social: ['weibo.com','renren.com','kaixin001.com','douban.com','qzone.qq.com','zhihu.com','tieba.baidu.com','weixin.qq.com']
8787
},
8888
callback_timeout: 1000,
8989
is_track_device_id: false,

version.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
var sensorsdata_js_sdk_latest_version = '1.9.11';
1+
var sensorsdata_js_sdk_latest_version = '1.9.12';

0 commit comments

Comments
 (0)