Server IP : 85.214.239.14 / Your IP : 18.222.17.194 Web Server : Apache/2.4.62 (Debian) System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.18 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /var/www/wordpress/phpMyAdmin/js/designer/ |
Upload File : |
var designerTables = [ { name: 'pdf_pages', key: 'pgNr', autoIncrement: true }, { name: 'table_coords', key: 'id', autoIncrement: true } ]; // eslint-disable-next-line no-unused-vars var DesignerOfflineDB = (function () { var designerDB = {}; var datastore = null; designerDB.open = function (callback) { var version = 1; var request = window.indexedDB.open('pma_designer', version); request.onupgradeneeded = function (e) { var db = e.target.result; e.target.transaction.onerror = designerDB.onerror; var t; for (t in designerTables) { if (db.objectStoreNames.contains(designerTables[t].name)) { db.deleteObjectStore(designerTables[t].name); } } for (t in designerTables) { db.createObjectStore(designerTables[t].name, { keyPath: designerTables[t].key, autoIncrement: designerTables[t].autoIncrement }); } }; request.onsuccess = function (e) { datastore = e.target.result; if (typeof callback !== 'undefined' && callback !== null) { callback(true); } }; request.onerror = designerDB.onerror; }; designerDB.loadObject = function (table, id, callback) { var db = datastore; var transaction = db.transaction([table], 'readwrite'); var objStore = transaction.objectStore(table); var cursorRequest = objStore.get(parseInt(id)); cursorRequest.onsuccess = function (e) { callback(e.target.result); }; cursorRequest.onerror = designerDB.onerror; }; designerDB.loadAllObjects = function (table, callback) { var db = datastore; var transaction = db.transaction([table], 'readwrite'); var objStore = transaction.objectStore(table); var keyRange = IDBKeyRange.lowerBound(0); var cursorRequest = objStore.openCursor(keyRange); var results = []; transaction.oncomplete = function () { callback(results); }; cursorRequest.onsuccess = function (e) { var result = e.target.result; if (Boolean(result) === false) { return; } results.push(result.value); result.continue(); }; cursorRequest.onerror = designerDB.onerror; }; designerDB.loadFirstObject = function (table, callback) { var db = datastore; var transaction = db.transaction([table], 'readwrite'); var objStore = transaction.objectStore(table); var keyRange = IDBKeyRange.lowerBound(0); var cursorRequest = objStore.openCursor(keyRange); var firstResult = null; transaction.oncomplete = function () { callback(firstResult); }; cursorRequest.onsuccess = function (e) { var result = e.target.result; if (Boolean(result) === false) { return; } firstResult = result.value; }; cursorRequest.onerror = designerDB.onerror; }; designerDB.addObject = function (table, obj, callback) { var db = datastore; var transaction = db.transaction([table], 'readwrite'); var objStore = transaction.objectStore(table); var request = objStore.put(obj); request.onsuccess = function (e) { if (typeof callback !== 'undefined' && callback !== null) { callback(e.currentTarget.result); } }; request.onerror = designerDB.onerror; }; designerDB.deleteObject = function (table, id, callback) { var db = datastore; var transaction = db.transaction([table], 'readwrite'); var objStore = transaction.objectStore(table); var request = objStore.delete(parseInt(id)); request.onsuccess = function () { if (typeof callback !== 'undefined' && callback !== null) { callback(true); } }; request.onerror = designerDB.onerror; }; designerDB.onerror = function (e) { // eslint-disable-next-line no-console console.log(e); }; // Export the designerDB object. return designerDB; }());