| Line 27: |
Line 27: |
| | var idgen = ""; | | var idgen = ""; |
| | for (var i = 0; i < self.length; i++) { | | for (var i = 0; i < self.length; i++) { |
| − | idgen += self.charCodeAt(i) + ""; | + | idgen += self.charCodeAt(i); |
| | } | | } |
| | // Take username for standard databasename format | | // Take username for standard databasename format |
| Line 44: |
Line 44: |
| | 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 98: |
Line 100: |
| | // 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 */ ) { | + | 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 ) { |
| | mw.loader.using( 'oojs-ui-core' ).done( function () { | | mw.loader.using( 'oojs-ui-core' ).done( function () { |
| | $( function () { | | $( function () { |
| Line 120: |
Line 122: |
| | 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; |
| Line 126: |
Line 127: |
| | 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 134: |
Line 135: |
| | 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" } ); |
| − | textInput[i] = new OO.ui.TextInputWidget( { | + | textIn[i] = new OO.ui.TextInputWidget( { |
| − | value: check( person, rel_C + '.' + i ),/// | + | value: check( person, rel_C + '.' + i ), /// |
| − | placeholder: rel_B, | + | placeholder: rel_B |
| − | id: 'textinput_' + i
| |
| | } ); | | } ); |
| | | | |
| − | textInput[i].on("keydown",function search(e) { | + | textIn[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 147: |
| | }); | | }); |
| | | | |
| − | console.log( textInput[i].getValue() ); | + | console.log( textIn[i].getValue() ); |
| | | | |
| | button_new[i].on( 'click', function () { | | button_new[i].on( 'click', function () { |
| Line 168: |
Line 168: |
| | | | |
| | // save | | // save |
| − | recordUpdate( db, person, rel_C, i , textInput[i].getValue() ) ; | + | recordUpdate( db, person, rel_C, i , textIn[i].getValue() ) ; |
| | interface_media( db, person, rel_A, rel_B, rel_C ); | | interface_media( db, person, rel_A, rel_B, rel_C ); |
| | return; | | return; |
| | | | |
| | } ); | | } ); |
| − | $( '#mw-content-text' ).prepend( textInput[i].$element ); | + | $( '#mw-content-text' ).prepend( textIn[i].$element ); |
| | $( '#mw-content-text' ).prepend( '<br>' ); | | $( '#mw-content-text' ).prepend( '<br>' ); |
| | $( '#mw-content-text' ).prepend( button_new[i].$element ); | | $( '#mw-content-text' ).prepend( button_new[i].$element ); |