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

Commit5b9b8b7

Browse files
authored
Merge pull request#198 from minjk-bl/devops
Devops
2 parents65c7c78 +724cf44 commit5b9b8b7

File tree

15 files changed

+179
-121
lines changed

15 files changed

+179
-121
lines changed

‎.gitignore‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
dist/
22
jupyterlab/lib/visualpython
3-
test/
3+
test/

‎visualpython/css/component/dataSelector.css‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@
5555
}
5656
.vp-ds-data-box {
5757
width:100%;
58-
height:160px;
58+
height:150px;
5959
align-content: baseline;
6060
align-items: center;
6161
}
6262
.vp-ds-type-box,
6363
.vp-ds-variable-box {
6464
border:0.25px solidvar(--border-gray-color);
65-
height:160px;
65+
height:150px;
6666
grid-row-gap:0px;
6767
align-content: baseline;
6868
}
@@ -90,7 +90,7 @@
9090
margin-top:10px;
9191
}
9292
.vp-ds-option-inner-box {
93-
height:calc(100%-30px);
93+
height:calc(100%-35px);
9494
}
9595
.vp-ds-df-option-box {
9696
height:100%;

‎visualpython/css/component/multiSelector.css‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,10 @@
7979
left:calc(100%-25px);
8080
bottom:23px;
8181
cursor: pointer;
82+
}
83+
.vp-cs-del-item {
84+
position: relative;
85+
float: right;
86+
top:4px;
87+
cursor: pointer;
8288
}

‎visualpython/css/m_ml/modelInfo.css‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
.vp-model-select-box {
2+
grid-column-gap:5px;
3+
align-items: start;
4+
}
15
.vp-ins-select-title {
26
font-weight: bold;
37
color:var(--font-highlight);

‎visualpython/html/component/dataSelector.html‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<divclass="vp-inner-popup-close"title="Close data selector"></div>
99
</div>
1010
<divclass="vp-inner-popup-body vp-scrollbar">
11-
<divclass="vp-grid-col-p50">
11+
<divclass="vp-grid-col-p50 mb5">
1212
<labelclass="vp-bold">Type</label>
1313
<labelclass="vp-bold">Data</label>
1414
</div>
@@ -22,7 +22,7 @@
2222
</div>
2323
<divclass="vp-ds-option-box">
2424
<labelclass="vp-bold">Option Page</label>
25-
<divclass="vp-ds-option-inner-box">
25+
<divclass="vp-ds-option-inner-box mt5">
2626

2727
</div>
2828
</div>

‎visualpython/html/m_apps/file.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
</td>
7575
</tr>
7676
<tr>
77-
<td><labelfor="vp_sampleReturn"class="vp-orange-text">Allocate to</label></td>
77+
<td><labelfor="vp_sampleReturn">Allocate to</label></td>
7878
<td><inputtype="text"class="vp-input input-single"id="vp_sampleReturn"placeholder=""value=""title=""></td>
7979
</tr>
8080
</tbody>

‎visualpython/js/MainFrame.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,10 +478,10 @@ define([
478478
letparentBlock=null;
479479
letprevBlock=null;
480480
loadStateList.forEach(obj=>{
481-
let{ blockType, menuId, menuState, menuConfig, argIdx, position, afterAction}=obj;
481+
let{file,blockType, menuId, menuState, menuConfig, argIdx, position, afterAction}=obj;
482482
// get OptionComponent Object
483483
// LAB: relative path needed
484-
letOptionComponent=require('./'+menuConfig.file);
484+
letOptionComponent=require('./'+file);
485485
if(OptionComponent){
486486
lettaskState=menuState.taskState;
487487
letblockState=menuState.blockState;

‎visualpython/js/com/com_Config.js‎

Lines changed: 41 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,7 @@ define([
208208
vp_config_version:'1.0.0',
209209
vp_signature:'VisualPython',
210210
vp_position:{},
211-
// CHROME: default to display vp
212-
vp_section_display:true,
211+
vp_section_display:false,
213212
vp_note_display:false,
214213
vp_menu_width:Config.MENU_MIN_WIDTH,
215214
vp_note_width:Config.BOARD_MIN_WIDTH
@@ -485,15 +484,15 @@ define([
485484
that._checkMounted().then(function(){
486485
that._readFromColab(configKey).then(function(result){
487486
letdata=result;
488-
if(data==undefined||data=={}){
487+
if(data==undefined||(datainstanceofObject&&Object.keys(data).length===0)){
489488
resolve(data);
490489
return;
491490
}
492491
if(dataKey==''){
493492
resolve(data);
494493
return;
495494
}
496-
if(Object.keys(data).length>0){
495+
if(datainstanceofObject&&Object.keys(data).length>0){
497496
resolve(data[dataKey]);
498497
return;
499498
}
@@ -509,15 +508,15 @@ define([
509508
// LAB: use local .visualpython files
510509
that._readFromLab(configKey).then(function(result){
511510
letdata=result;
512-
if(data==undefined||data=={}){
511+
if(data==undefined||(datainstanceofObject&&Object.keys(data).length===0)){
513512
resolve(data);
514513
return;
515514
}
516515
if(dataKey==''){
517516
resolve(data);
518517
return;
519518
}
520-
if(Object.keys(data).length>0){
519+
if(datainstanceofObject&&Object.keys(data).length>0){
521520
resolve(data[dataKey]);
522521
return;
523522
}
@@ -779,6 +778,40 @@ define([
779778
returnConfig.version;
780779
}
781780

781+
checkVersionTimestamp=function(){
782+
letthat=this;
783+
// check version timestamp
784+
letnowDate=newDate();
785+
this.getData('version_timestamp','vpcfg').then(function(data){
786+
letdoCheckVersion=false;
787+
vpLog.display(VP_LOG_TYPE.DEVELOP,'Checking its version timestamp... : '+data);
788+
if(data==undefined||(datainstanceofObject&&Object.keys(data).length===0)){
789+
// no timestamp, check version
790+
doCheckVersion=true;
791+
}elseif(data!=''){
792+
letlastCheck=newDate(parseInt(data));
793+
letdiffCheck_now=newDate(nowDate.getFullYear(),nowDate.getMonth()+1,nowDate.getDate());
794+
letdiffCheck_last=newDate(lastCheck.getFullYear(),lastCheck.getMonth()+1,lastCheck.getDate());
795+
796+
letdiff=Math.abs(diffCheck_now.getTime()-diffCheck_last.getTime());
797+
diff=Math.ceil(diff/(1000*3600*24));
798+
799+
if(diff>=1){
800+
// if More than 1 day passed, check version
801+
doCheckVersion=true;
802+
}
803+
}
804+
805+
// check version and update version_timestamp
806+
if(doCheckVersion==true){
807+
that.checkVpVersion(true);
808+
}
809+
810+
}).catch(function(err){
811+
vpLog.display(VP_LOG_TYPE.ERROR,err);
812+
})
813+
}
814+
782815
checkVpVersion(background=false){
783816
letthat=this;
784817
letnowVersion=this.getVpInstalledVersion();
@@ -818,6 +851,8 @@ define([
818851
switch(clickedBtnIdx){
819852
case0:
820853
// cancel
854+
// update version_timestamp
855+
that.setData({'version_timestamp':newDate().getTime()},'vpcfg');
821856
break;
822857
case1:
823858
// update

‎visualpython/js/com/com_generatorV2.js‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,14 +134,17 @@ define([
134134
package.options&&package.options.forEach(function(o,i){
135135
varobj=JSON.parse(JSON.stringify(o));
136136
letnewTag=vp_createTag(pageThis,obj,state);
137-
if(obj.required){
137+
if(obj.required===true||obj.output===true){
138138
tblInput.append(newTag);
139139
}else{
140140
tblOption.append(newTag);
141141
}
142142
});
143143

144144
// TODO: userOption
145+
if(package.code.includes('${etc}')){
146+
147+
}
145148

146149
bindAutoComponentEvent(pageThis);
147150
}
@@ -163,7 +166,7 @@ define([
163166
letvalue=state[name];
164167

165168
varrequiredFontStyle=required==true?'vp-orange-text' :'';
166-
varlblTag=$(`<label>${label}</label>`).attr({
169+
varlblTag=$(`<label>${label}</label>`).attr({
167170
'for':name,
168171
'class':requiredFontStyle,
169172
'title':'('+name+')'

‎visualpython/js/com/component/MultiSelector.js‎

Lines changed: 73 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ define([
305305
// select - right
306306
tag.appendFormatLine('<div class="{0}">',APP_SELECT_RIGHT);
307307
varselectedList=this.dataList.filter(data=>that.selectedList.includes(data.code));
308-
tag.appendLine(this.renderSelectedBox(selectedList));
308+
tag.appendLine(this.renderSelectedBox(this.selectedList));
309309
if(this.allowAdd){
310310
// add item
311311
tag.appendLine('<input type="text" class="vp-cs-add-item-name vp-input wp100" placeholder="New item to add" value="">');
@@ -380,62 +380,6 @@ define([
380380
that.bindDraggable();
381381
});
382382

383-
// item indexing
384-
$(this.wrapSelector('.'+APP_SELECT_ITEM)).on('click',function(event){
385-
vardataIdx=$(this).attr('data-idx');
386-
varidx=$(this).index();
387-
varadded=$(this).hasClass('added');// right side added item?
388-
varselector='';
389-
390-
// remove selection for select box on the other side
391-
if(added){
392-
// remove selection for left side
393-
$(that.wrapSelector('.'+APP_SELECT_ITEM+':not(.added)')).removeClass('selected');
394-
// set selector
395-
selector='.added';
396-
}else{
397-
// remove selection for right(added) side
398-
$(that.wrapSelector('.'+APP_SELECT_ITEM+'.added')).removeClass('selected');
399-
// set selector
400-
selector=':not(.added)';
401-
}
402-
403-
if(vpEvent.keyManager.keyCheck.ctrlKey){
404-
// multi-select
405-
that.pointer={start:idx,end:-1};
406-
$(this).toggleClass('selected');
407-
}elseif(vpEvent.keyManager.keyCheck.shiftKey){
408-
// slicing
409-
varstartIdx=that.pointer.start;
410-
411-
if(startIdx==-1){
412-
// no selection
413-
that.pointer={start:idx,end:-1};
414-
}elseif(startIdx>idx){
415-
// add selection from idx to startIdx
416-
vartags=$(that.wrapSelector('.'+APP_SELECT_ITEM+selector));
417-
for(vari=idx;i<=startIdx;i++){
418-
$(tags[i]).addClass('selected');
419-
}
420-
that.pointer={start:startIdx,end:idx};
421-
}elseif(startIdx<=idx){
422-
// add selection from startIdx to idx
423-
vartags=$(that.wrapSelector('.'+APP_SELECT_ITEM+selector));
424-
for(vari=startIdx;i<=idx;i++){
425-
$(tags[i]).addClass('selected');
426-
}
427-
that.pointer={start:startIdx,end:idx};
428-
}
429-
}else{
430-
// single-select
431-
that.pointer={start:idx,end:-1};
432-
// un-select others
433-
$(that.wrapSelector('.'+APP_SELECT_ITEM+selector)).removeClass('selected');
434-
// select this
435-
$(this).addClass('selected');
436-
}
437-
});
438-
439383
// item indexing - add all
440384
$(this.wrapSelector('.'+APP_SELECT_ADD_ALL_BTN)).on('click',function(event){
441385
$(that.wrapSelector('.'+APP_SELECT_BOX+'.left .'+APP_SELECT_ITEM)).appendTo(
@@ -510,6 +454,75 @@ define([
510454
that._addNewItem(newItemName);
511455
}
512456
});
457+
458+
this._bindItemClickEvent();
459+
}
460+
461+
_bindItemClickEvent(){
462+
letthat=this;
463+
// item indexing
464+
$(this.wrapSelector('.'+APP_SELECT_ITEM)).off('click');
465+
$(this.wrapSelector('.'+APP_SELECT_ITEM)).on('click',function(event){
466+
vardataIdx=$(this).attr('data-idx');
467+
varidx=$(this).index();
468+
varadded=$(this).hasClass('added');// right side added item?
469+
varselector='';
470+
471+
// remove selection for select box on the other side
472+
if(added){
473+
// remove selection for left side
474+
$(that.wrapSelector('.'+APP_SELECT_ITEM+':not(.added)')).removeClass('selected');
475+
// set selector
476+
selector='.added';
477+
}else{
478+
// remove selection for right(added) side
479+
$(that.wrapSelector('.'+APP_SELECT_ITEM+'.added')).removeClass('selected');
480+
// set selector
481+
selector=':not(.added)';
482+
}
483+
484+
if(vpEvent.keyManager.keyCheck.ctrlKey){
485+
// multi-select
486+
that.pointer={start:idx,end:-1};
487+
$(this).toggleClass('selected');
488+
}elseif(vpEvent.keyManager.keyCheck.shiftKey){
489+
// slicing
490+
varstartIdx=that.pointer.start;
491+
492+
if(startIdx==-1){
493+
// no selection
494+
that.pointer={start:idx,end:-1};
495+
}elseif(startIdx>idx){
496+
// add selection from idx to startIdx
497+
vartags=$(that.wrapSelector('.'+APP_SELECT_ITEM+selector));
498+
for(vari=idx;i<=startIdx;i++){
499+
$(tags[i]).addClass('selected');
500+
}
501+
that.pointer={start:startIdx,end:idx};
502+
}elseif(startIdx<=idx){
503+
// add selection from startIdx to idx
504+
vartags=$(that.wrapSelector('.'+APP_SELECT_ITEM+selector));
505+
for(vari=startIdx;i<=idx;i++){
506+
$(tags[i]).addClass('selected');
507+
}
508+
that.pointer={start:startIdx,end:idx};
509+
}
510+
}else{
511+
// single-select
512+
that.pointer={start:idx,end:-1};
513+
// un-select others
514+
$(that.wrapSelector('.'+APP_SELECT_ITEM+selector)).removeClass('selected');
515+
// select this
516+
$(this).addClass('selected');
517+
}
518+
});
519+
520+
// item deleting (manually added item only)
521+
$(this.wrapSelector('.vp-cs-del-item')).off('click');
522+
$(this.wrapSelector('.vp-cs-del-item')).on('click',function(event){
523+
$(this).closest('.'+APP_SELECT_ITEM).remove();
524+
that.pointer={start:-1,end:-1};
525+
});
513526
}
514527

515528
_addNewItem(newItemName){
@@ -551,6 +564,7 @@ define([
551564
letnewItemIndex=this.dataList.length;
552565
vartargetTag=$(`<div class="${APP_SELECT_ITEM}${APP_DRAGGABLE} added selected" data-idx="${newItemIndex}" data-name="${newItemName}" data-type="object" data-code="'${newItemName}'" title="${newItemName}: Added manually">
553566
<span>${newItemName}</span>
567+
<div class="vp-cs-del-item vp-icon-close-small" title="Delete this manually added item"></div>
554568
</div>`);
555569
$(targetTag).appendTo(
556570
$(this.wrapSelector('.'+APP_SELECT_BOX+'.right'))
@@ -560,6 +574,8 @@ define([
560574
$(this.wrapSelector('.'+APP_SELECT_ITEM)).removeClass('selected');
561575
// clear item input
562576
$(this.wrapSelector('.vp-cs-add-item-name')).val('');
577+
// bind click event
578+
this._bindItemClickEvent();
563579
// bind draggable
564580
this.bindDraggable();
565581
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp