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

Commit0c2880b

Browse files
authored
Merge pull request#199 from visualpython/revert-198-devops
Revert "Devops"
2 parents5b9b8b7 +0d0df07 commit0c2880b

File tree

15 files changed

+121
-179
lines changed

15 files changed

+121
-179
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:150px;
58+
height:160px;
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:150px;
65+
height:160px;
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%-35px);
93+
height:calc(100%-30px);
9494
}
9595
.vp-ds-df-option-box {
9696
height:100%;

‎visualpython/css/component/multiSelector.css‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,4 @@
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;
8882
}

‎visualpython/css/m_ml/modelInfo.css‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
.vp-model-select-box {
2-
grid-column-gap:5px;
3-
align-items: start;
4-
}
51
.vp-ins-select-title {
62
font-weight: bold;
73
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 mb5">
11+
<divclass="vp-grid-col-p50">
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 mt5">
25+
<divclass="vp-ds-option-inner-box">
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">Allocate to</label></td>
77+
<td><labelfor="vp_sampleReturn"class="vp-orange-text">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{file,blockType, menuId, menuState, menuConfig, argIdx, position, afterAction}=obj;
481+
let{ blockType, menuId, menuState, menuConfig, argIdx, position, afterAction}=obj;
482482
// get OptionComponent Object
483483
// LAB: relative path needed
484-
letOptionComponent=require('./'+file);
484+
letOptionComponent=require('./'+menuConfig.file);
485485
if(OptionComponent){
486486
lettaskState=menuState.taskState;
487487
letblockState=menuState.blockState;

‎visualpython/js/com/com_Config.js‎

Lines changed: 6 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,8 @@ define([
208208
vp_config_version:'1.0.0',
209209
vp_signature:'VisualPython',
210210
vp_position:{},
211-
vp_section_display:false,
211+
// CHROME: default to display vp
212+
vp_section_display:true,
212213
vp_note_display:false,
213214
vp_menu_width:Config.MENU_MIN_WIDTH,
214215
vp_note_width:Config.BOARD_MIN_WIDTH
@@ -484,15 +485,15 @@ define([
484485
that._checkMounted().then(function(){
485486
that._readFromColab(configKey).then(function(result){
486487
letdata=result;
487-
if(data==undefined||(datainstanceofObject&&Object.keys(data).length===0)){
488+
if(data==undefined||data=={}){
488489
resolve(data);
489490
return;
490491
}
491492
if(dataKey==''){
492493
resolve(data);
493494
return;
494495
}
495-
if(datainstanceofObject&&Object.keys(data).length>0){
496+
if(Object.keys(data).length>0){
496497
resolve(data[dataKey]);
497498
return;
498499
}
@@ -508,15 +509,15 @@ define([
508509
// LAB: use local .visualpython files
509510
that._readFromLab(configKey).then(function(result){
510511
letdata=result;
511-
if(data==undefined||(datainstanceofObject&&Object.keys(data).length===0)){
512+
if(data==undefined||data=={}){
512513
resolve(data);
513514
return;
514515
}
515516
if(dataKey==''){
516517
resolve(data);
517518
return;
518519
}
519-
if(datainstanceofObject&&Object.keys(data).length>0){
520+
if(Object.keys(data).length>0){
520521
resolve(data[dataKey]);
521522
return;
522523
}
@@ -778,40 +779,6 @@ define([
778779
returnConfig.version;
779780
}
780781

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-
815782
checkVpVersion(background=false){
816783
letthat=this;
817784
letnowVersion=this.getVpInstalledVersion();
@@ -851,8 +818,6 @@ define([
851818
switch(clickedBtnIdx){
852819
case0:
853820
// cancel
854-
// update version_timestamp
855-
that.setData({'version_timestamp':newDate().getTime()},'vpcfg');
856821
break;
857822
case1:
858823
// update

‎visualpython/js/com/com_generatorV2.js‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,17 +134,14 @@ 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===true||obj.output===true){
137+
if(obj.required){
138138
tblInput.append(newTag);
139139
}else{
140140
tblOption.append(newTag);
141141
}
142142
});
143143

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

149146
bindAutoComponentEvent(pageThis);
150147
}
@@ -166,7 +163,7 @@ define([
166163
letvalue=state[name];
167164

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

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

Lines changed: 57 additions & 73 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(this.selectedList));
308+
tag.appendLine(this.renderSelectedBox(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,6 +380,62 @@ 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+
383439
// item indexing - add all
384440
$(this.wrapSelector('.'+APP_SELECT_ADD_ALL_BTN)).on('click',function(event){
385441
$(that.wrapSelector('.'+APP_SELECT_BOX+'.left .'+APP_SELECT_ITEM)).appendTo(
@@ -454,75 +510,6 @@ define([
454510
that._addNewItem(newItemName);
455511
}
456512
});
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-
});
526513
}
527514

528515
_addNewItem(newItemName){
@@ -564,7 +551,6 @@ define([
564551
letnewItemIndex=this.dataList.length;
565552
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">
566553
<span>${newItemName}</span>
567-
<div class="vp-cs-del-item vp-icon-close-small" title="Delete this manually added item"></div>
568554
</div>`);
569555
$(targetTag).appendTo(
570556
$(this.wrapSelector('.'+APP_SELECT_BOX+'.right'))
@@ -574,8 +560,6 @@ define([
574560
$(this.wrapSelector('.'+APP_SELECT_ITEM)).removeClass('selected');
575561
// clear item input
576562
$(this.wrapSelector('.vp-cs-add-item-name')).val('');
577-
// bind click event
578-
this._bindItemClickEvent();
579563
// bind draggable
580564
this.bindDraggable();
581565
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp