| Line 38: |
Line 38: |
| | console.log( CurrentPerson ); | | console.log( CurrentPerson ); |
| | | | |
| − | recordAdd( PersonalDataDataBaseName, CurrentPerson ); | + | recordUpdate( PersonalDataDataBaseName, CurrentPerson, "id", idgen ); |
| − | /* | + | /* |
| − | recordUpdate(PersonalDataDataBaseName, CurrentPerson, '-', value);
| |
| | recordCheck(PersonalDataDataBaseName, CurrentPerson); | | recordCheck(PersonalDataDataBaseName, CurrentPerson); |
| | recordDeleteFrom(PersonalDataDataBaseName, CurrentPerson, ) | | recordDeleteFrom(PersonalDataDataBaseName, CurrentPerson, ) |
| | */ | | */ |
| − | var textInput = [];
| |
| − |
| |
| | | | |
| | // check if we are on a page of any of the targeted Entity | | // check if we are on a page of any of the targeted Entity |
| Line 95: |
Line 92: |
| | var string_temporary_store_2 = get_Y_from_X ( get_Y_from_X ( get_Y_from_X( obj, wbEStruct['defaultValRelation'] ), '0'), wbEStruct['IDPropLoc'] ); //placeholder_text | | var string_temporary_store_2 = get_Y_from_X ( get_Y_from_X ( get_Y_from_X( obj, wbEStruct['defaultValRelation'] ), '0'), wbEStruct['IDPropLoc'] ); //placeholder_text |
| | var string_temporary_store_3 = get_Y_from_X ( get_Y_from_X ( get_Y_from_X ( get_Y_from_X( obj, wbEStruct['concernsRelation'] ), '0'), wbEStruct['IDPropLoc']), wbEStruct['IDName'] ); //property name | | var string_temporary_store_3 = get_Y_from_X ( get_Y_from_X ( get_Y_from_X ( get_Y_from_X( obj, wbEStruct['concernsRelation'] ), '0'), wbEStruct['IDPropLoc']), wbEStruct['IDName'] ); //property name |
| − | interface_media( PersonalDataDataBaseName, CurrentPerson, string_temporary_store_1, string_temporary_store_2, string_temporary_store_3, textInput ); | + | interface_media( PersonalDataDataBaseName, CurrentPerson, string_temporary_store_1, string_temporary_store_2, string_temporary_store_3 ); |
| | } | | } |
| | | | |
| | // repeating code patterns | | // repeating code patterns |
| | | | |
| − | function interface_media( db /* database */, prs /* user */ , rel_A /* current value location */, rel_B /* placeholder value */, rel_C /* which attribute it is in the inddb database - concerns for input item */, textIn ) { | + | function interface_media( db /* database */, prs /* user */ , rel_A /* current value location */, rel_B /* placeholder value */, rel_C /* which attribute it is in the inddb database - concerns for input item */ ) { |
| | mw.loader.using( 'oojs-ui-core' ).done( function () { | | mw.loader.using( 'oojs-ui-core' ).done( function () { |
| | $( function () { | | $( function () { |
| Line 122: |
Line 119: |
| | button_delete = [], | | button_delete = [], |
| | button_new = [], | | button_new = [], |
| − |
| + | textInput = [], |
| | ii = Object.keys( check( person, rel_C + '' ) ).length; | | ii = Object.keys( check( person, rel_C + '' ) ).length; |
| | + | |
| | + | var prevs = element.all(by.tagName('input')).map(function(elem) { |
| | + | return elem; |
| | + | }); |
| | + | |
| | + | delete prevs; |
| | | | |
| | console.log( "Mark Finite" ); | | console.log( "Mark Finite" ); |
| | console.log( rel_C ); | | console.log( rel_C ); |
| − | textIn.length = 0;
| |
| | if ( check( person, rel_C + '' ) !== undefined ) { | | if ( check( person, rel_C + '' ) !== undefined ) { |
| | for ( var i = 0 ; i <= ii ; i++ ) { | | for ( var i = 0 ; i <= ii ; i++ ) { |
| Line 135: |
Line 137: |
| | button_new[i] = new OO.ui.ButtonWidget( { label: "New", class: 'pddh' } ); | | button_new[i] = new OO.ui.ButtonWidget( { label: "New", class: 'pddh' } ); |
| | button_delete[i] = new OO.ui.ButtonWidget( { label: "Delete", class: "pddh" } ); | | button_delete[i] = new OO.ui.ButtonWidget( { label: "Delete", class: "pddh" } ); |
| − | textIn[i] = new OO.ui.TextInputWidget( { | + | textIn[number(i)] = new OO.ui.TextInputWidget( { |
| | value: check( person, rel_C + '.' + i ), /// | | value: check( person, rel_C + '.' + i ), /// |
| | placeholder: rel_B | | placeholder: rel_B |
| | } ); | | } ); |
| | | | |
| − | textIn[i].on("keydown",function search(e) { | + | textIn[number(i)].on("keydown",function search(e) { |
| | if(e.keyCode == 13) { | | if(e.keyCode == 13) { |
| | recordUpdate( db, person , rel_C, i , ($(this).val()) ); | | recordUpdate( db, person , rel_C, i , ($(this).val()) ); |
| Line 147: |
Line 149: |
| | }); | | }); |
| | | | |
| − | console.log( textIn[i].getValue() ); | + | console.log( textIn[number(i)].getValue() ); |
| | | | |
| | button_new[i].on( 'click', function () { | | button_new[i].on( 'click', function () { |
| Line 153: |
Line 155: |
| | // new | | // new |
| | recordUpdate( db, person, rel_C, ii , '2' ); | | recordUpdate( db, person, rel_C, ii , '2' ); |
| − | interface_media( db, person, rel_A, rel_B, rel_C , textIn); | + | interface_media( db, person, rel_A, rel_B, rel_C , textIn ); |
| | return; | | return; |
| | | | |