@@ -70,12 +70,13 @@ function getDBList() {
7070 for ( var count = 0 ; count < dbList . length ; count ++ ) {
7171 var dbName = dbList [ count ] [ 0 ] ;
7272 var isEncrypted = dbList [ count ] [ 1 ] ;
73+ var isDownloadable = dbList [ count ] [ 2 ] ;
7374 var dbAttribute = isEncrypted == "true" ? ' <span class="glyphicon glyphicon-lock" aria-hidden="true" style="color:blue"></span>' : "" ;
7475 if ( dbName . indexOf ( "journal" ) == - 1 ) {
75- $ ( "#db-list" ) . append ( "<a href='#' id=" + dbName + " class='list-group-item' onClick='openDatabaseAndGetTableList(\"" + dbName + "\");'>" + dbName + dbAttribute + "</a>" ) ;
76+ $ ( "#db-list" ) . append ( "<a href='#' id=" + dbName + " class='list-group-item' onClick='openDatabaseAndGetTableList(\"" + dbName + "\", \"" + isDownloadable + "\" );'>" + dbName + dbAttribute + "</a>" ) ;
7677 if ( ! isSelectionDone ) {
7778 isSelectionDone = true ;
78- $ ( '#db-list' ) . find ( 'a' ) . trigger ( 'click' ) ;
79+ $ ( '#db-list' ) . find ( 'a' ) . trigger ( 'click' ) ;
7980 }
8081 }
8182 }
@@ -85,7 +86,7 @@ function getDBList() {
8586}
8687
8788var lastTableName = getHashValue ( 'table' ) ;
88- function openDatabaseAndGetTableList ( db ) {
89+ function openDatabaseAndGetTableList ( db , isDownloadable ) {
8990
9091 if ( "APP_SHARED_PREFERENCES" == db ) {
9192 $ ( '#run-query' ) . removeClass ( 'active' ) ;
@@ -97,10 +98,16 @@ function openDatabaseAndGetTableList(db) {
9798 } else {
9899 $ ( '#run-query' ) . removeClass ( 'disabled' ) ;
99100 $ ( '#run-query' ) . addClass ( 'active' ) ;
100- $ ( '#selected-db-info' ) . removeClass ( 'disabled' ) ;
101- $ ( '#selected-db-info' ) . addClass ( 'active' ) ;
101+ if ( "true" == isDownloadable ) {
102+ $ ( '#selected-db-info' ) . removeClass ( 'disabled' ) ;
103+ $ ( '#selected-db-info' ) . addClass ( 'active' ) ;
104+ $ ( "#selected-db-info" ) . text ( "Export Selected Database : " + db ) ;
105+ } else {
106+ $ ( '#selected-db-info' ) . removeClass ( 'active' ) ;
107+ $ ( '#selected-db-info' ) . addClass ( 'disabled' ) ;
108+ $ ( "#selected-db-info" ) . text ( "Selected Database : " + db ) ;
109+ }
102110 isDatabaseSelected = true ;
103- $ ( "#selected-db-info" ) . text ( "Export Selected Database : " + db ) ;
104111 }
105112
106113
@@ -110,7 +117,11 @@ function openDatabaseAndGetTableList(db) {
110117 var tableList = result . rows ;
111118 var dbVersion = result . dbVersion ;
112119 if ( "APP_SHARED_PREFERENCES" != db ) {
113- $ ( "#selected-db-info" ) . text ( "Export Selected Database : " + db + " Version : " + dbVersion ) ;
120+ if ( "true" == isDownloadable ) {
121+ $ ( "#selected-db-info" ) . text ( "Export Selected Database : " + db + " Version : " + dbVersion ) ;
122+ } else {
123+ $ ( "#selected-db-info" ) . text ( "Selected Database : " + db + " Version : " + dbVersion ) ;
124+ }
114125 }
115126 $ ( '#table-list' ) . empty ( )
116127 for ( var count = 0 ; count < tableList . length ; count ++ ) {
0 commit comments