Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1004447

Browse files
author
minjk-bl
committed
Edit auto-update on JupyterLab and Fix default-state of open vp initially on Jupyter Notebook
1 parentaec2fb3 commit1004447

File tree

1 file changed

+5
-34
lines changed

1 file changed

+5
-34
lines changed

‎visualpython/js/loadVisualpython.js‎

Lines changed: 5 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -206,38 +206,6 @@ define([
206206
}
207207
}
208208

209-
var_checkVersion=function(){
210-
// check version timestamp
211-
letnowDate=newDate();
212-
vpConfig.getData('version_timestamp','vpcfg').then(function(data){
213-
letdoCheckVersion=false;
214-
if(data==undefined){
215-
// no timestamp, check version
216-
doCheckVersion=true;
217-
}elseif(data!=''){
218-
letlastCheck=newDate(parseInt(data));
219-
letdiffCheck_now=newDate(nowDate.getFullYear(),nowDate.getMonth()+1,nowDate.getDate());
220-
letdiffCheck_last=newDate(lastCheck.getFullYear(),lastCheck.getMonth()+1,lastCheck.getDate());
221-
222-
letdiff=Math.abs(diffCheck_now.getTime()-diffCheck_last.getTime());
223-
diff=Math.ceil(diff/(1000*3600*24));
224-
225-
if(diff>=1){
226-
// if More than 1 day passed, check version
227-
doCheckVersion=true;
228-
}
229-
}
230-
231-
// check version and update version_timestamp
232-
if(doCheckVersion==true){
233-
vpConfig.checkVpVersion(true);
234-
}
235-
236-
}).catch(function(err){
237-
vpLog.display(VP_LOG_TYPE.ERROR,err);
238-
})
239-
}
240-
241209
//========================================================================
242210
// External call function
243211
//========================================================================
@@ -290,9 +258,10 @@ define([
290258
_addToolBarVpButton();
291259
}
292260
_loadVpResource(cfg);
293-
_checkVersion();
261+
vpConfig.checkVersionTimestamp();
294262

295-
if(cfg.vp_section_display&&vpFrame){
263+
if((cfg.vp_section_display&&vpFrame)
264+
||vpConfig.extensionType==='colab'){// CHROME: default to display vp
296265
vpFrame.openVp();
297266
}
298267

@@ -319,11 +288,13 @@ define([
319288
if(newValue.sessionContext.isReady){
320289
vpLog.display(VP_LOG_TYPE.LOG,'vp operations for kernel ready...');
321290
vpConfig.readKernelFunction();
291+
vpConfig.checkVersionTimestamp();
322292
}
323293
newValue.sessionContext._connectionStatusChanged.connect(function(s2,status){
324294
if(status==='connected'){
325295
vpLog.display(VP_LOG_TYPE.LOG,'vp operations for kernel ready...');
326296
vpConfig.readKernelFunction();
297+
vpConfig.checkVersionTimestamp();
327298
}
328299
});
329300
}else{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp