Line 6: |
Line 6: |
| | | |
| // suppress console.log, switch to true for debug | | // suppress console.log, switch to true for debug |
− | var Debug_switch = false; | + | var Debug_switch = true; |
| // seemingly the Safari engine uses a somewhat different implementation of arguments for db.transaction and index.get | | // seemingly the Safari engine uses a somewhat different implementation of arguments for db.transaction and index.get |
| // because no browser on any mac / ios is allowed to use a different engine, rather than user agent, platform can be tested | | // because no browser on any mac / ios is allowed to use a different engine, rather than user agent, platform can be tested |
− | var iOS = !!navigator.platform && /Macintosh|MacIntel|MacPPC|Mac68K|Mac|iPad|iPhone|iPod/.test(navigator.platform); | + | var iOS = !!navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform); |
− | | + | var Safari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); |
| + | debuglog("iOS:" + iOS + " & Saf:" + Safari); |
| + | |
| // deterministic hash generator for creating user id#s from usernames, should be replaced by something more functional (guaranteed to be transitively different) | | // deterministic hash generator for creating user id#s from usernames, should be replaced by something more functional (guaranteed to be transitively different) |
| hashCode = function(s) { | | hashCode = function(s) { |
Line 74: |
Line 76: |
| // Mode 'remove from record' field1 field2 | | // Mode 'remove from record' field1 field2 |
| // retrieve record, splice/delete record.field1.field2, push back | | // retrieve record, splice/delete record.field1.field2, push back |
| + | |
| + | // Mode 'import record' field1 |
| + | // retrieve record, add all fields from field1, push back |
| | | |
| async function Enquire( pddbname, record, sqitch, control_1, control_2, control_3 ) { | | async function Enquire( pddbname, record, sqitch, control_1, control_2, control_3 ) { |
Line 100: |
Line 105: |
| var tx; | | var tx; |
| | | |
− | if ( iOS ) { | + | if ( iOS || Safari ) { |
| tx = db.transaction([pddbname], "readwrite"); | | tx = db.transaction([pddbname], "readwrite"); |
| } else { | | } else { |
Line 111: |
Line 116: |
| // Get the original record from the db... | | // Get the original record from the db... |
| var getRecord; | | var getRecord; |
− | if ( iOS ) { | + | if ( iOS || Safari ) { |
| getRecord = index.get(record.id); | | getRecord = index.get(record.id); |
| } else { | | } else { |