Server IP : 127.0.0.2 / Your IP : 18.216.82.12 Web Server : Apache/2.4.18 (Ubuntu) System : User : www-data ( ) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : disk_free_space,disk_total_space,diskfreespace,dl,exec,fpaththru,getmyuid,getmypid,highlight_file,ignore_user_abord,leak,listen,link,opcache_get_configuration,opcache_get_status,passthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,php_uname,phpinfo,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,pclose,popen,proc_open,proc_close,proc_get_status,proc_nice,proc_terminate,shell_exec,source,show_source,system,virtual MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/phpmyadmin/js/pmd/ |
Upload File : |
var designer_tables = [{name: "pdf_pages", key: "pg_nr", auto_inc: true}, {name: "table_coords", key: "id", auto_inc: true}]; 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; for (var t in designer_tables) { if (db.objectStoreNames.contains(designer_tables[t].name)) { db.deleteObjectStore(designer_tables[t].name); } } for (var t in designer_tables) { db.createObjectStore(designer_tables[t].name, { keyPath: designer_tables[t].key, autoIncrement: designer_tables[t].auto_inc }); } }; 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 (e) { 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(e) { 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(e) { if (typeof callback !== 'undefined' && callback !== null) { callback(true); } }; request.onerror = designerDB.onerror; }; designerDB.onerror = function(e) { console.log(e); }; // Export the designerDB object. return designerDB; }());