| Line 54: |
Line 54: |
| | e.preventDefault(); | | e.preventDefault(); |
| | if(dflt.type == "item") { | | if(dflt.type == "item") { |
| − | mw.notify("on click activated item")
| |
| | var selection = $(this).prev('input').data('entityselector').selectedEntity(); | | var selection = $(this).prev('input').data('entityselector').selectedEntity(); |
| | quickpresets_additemstatement(qid, dflt.pid, dflt.name, selection.id.substring(1), selection.label); | | quickpresets_additemstatement(qid, dflt.pid, dflt.name, selection.id.substring(1), selection.label); |
| | } | | } |
| | else if(dflt.type == "string") { | | else if(dflt.type == "string") { |
| − | mw.notify("on click activated string") | + | quickpresets_addstringstatement(qid, dflt.pid, dflt.name, $(this).prev('input')[0].value); |
| − | mw.notify("$(this).prev('input') "+$(this).prev('input'))
| |
| − | quickpresets_addstringstatement(qid, dflt.pid, dflt.name, $(this).prev('input')[0].value);
| |
| | } | | } |
| | }); | | }); |
| Line 114: |
Line 111: |
| | */ | | */ |
| | function quickpresets_additemstatement(qid, pid, pname, toqid, toname) { | | function quickpresets_additemstatement(qid, pid, pname, toqid, toname) { |
| − | mw.notify("adding item statement") | + | var claim = { |
| − | var claim = {
| |
| | id: (new wb.utilities.ClaimGuidGenerator("q" + qid)).newGuid(), | | id: (new wb.utilities.ClaimGuidGenerator("q" + qid)).newGuid(), |
| | type: "claim", | | type: "claim", |
| Line 151: |
Line 147: |
| | */ | | */ |
| | function quickpresets_addstringstatement(qid, pid, pname, str) { | | function quickpresets_addstringstatement(qid, pid, pname, str) { |
| − | mw.notify("adding string statement") | + | var claim = { |
| − | mw.notify("adding str "+qid+" "+pid+" "+pname+" "+str)
| |
| − | var claim = {
| |
| | id: (new wb.utilities.ClaimGuidGenerator("q" + qid)).newGuid(), | | id: (new wb.utilities.ClaimGuidGenerator("q" + qid)).newGuid(), |
| | type: "claim", | | type: "claim", |