Line 54: |
Line 54: |
| function input_display_function() { | | function input_display_function() { |
| var obj = interjson( get_Y_from_X( mw, mwEStruct['wbXntity'] ) ); | | var obj = interjson( get_Y_from_X( mw, mwEStruct['wbXntity'] ) ); |
− | mw.notify( $('<input type="text" placeholder="' + get_Y_from_X ( get_Y_from_X( obj, wbEStruct['defaultValRelation'] ), wbEStruct['IDPropLoc'] ) + '" id="place_0" />'), { autoHide: false } ); | + | var string_temporary_store[0] = get_Y_from_X ( get_Y_from_X( obj, wbEStruct['defaultValRelation'] )[0], wbEStruct['IDPropLoc'] ); |
| + | mw.notify( $('<input type="text" placeholder="' + string_temporary_store[0] + '" id="place_0" />'), { autoHide: false } ); |
| } | | } |
| | | |
Line 94: |
Line 95: |
| | | |
| function get_Y_from_X( obj, B ){ | | function get_Y_from_X( obj, B ){ |
− | if ( check(obj, B) != undefined ) { | + | if ( check(obj, B) !== undefined ) { |
| console.log( "entity is defined" ) | | console.log( "entity is defined" ) |
| return dive(obj, B); | | return dive(obj, B); |
Line 105: |
Line 106: |
| } catch (e) { | | } catch (e) { |
| // if not JSON, do silly things | | // if not JSON, do silly things |
− | };
| + | }; |
| + | |
| } | | } |
| | | |
| function check_Y_in_X(obj, to_check){ | | function check_Y_in_X(obj, to_check){ |
− | if (obj === to_check) { return true }; | + | if (obj === to_check) { return true |
− | for (var i = 0; i < obj.length; i++ ){
| + | for (var i = 0; i < obj.length; i++ ){ |
− | if (obj[i] === to_check) { return true };
| + | if (obj[i] === to_check) { return true }; |
| } | | } |
| return false; | | return false; |