@ -1505,7 +1505,7 @@ function init_gears() {
db . execute ( "CREATE TABLE if not exists offline_feeds (id integer, title text)" ) ;
db . execute ( "CREATE TABLE if not exists offline_feeds (id integer, title text)" ) ;
db . execute ( "CREATE TABLE if not exists offline_data (id integer, feed_id integer, title text, updated text, content text, tags text)") ;
db . execute ( "CREATE TABLE if not exists offline_data (id integer, feed_id integer, title text, link text, guid text, updated text, content text, tags text)") ;
var qmcDownload = document . getElementById ( "qmcDownload" ) ;
var qmcDownload = document . getElementById ( "qmcDownload" ) ;
if ( qmcDownload ) Element . show ( qmcDownload ) ;
if ( qmcDownload ) Element . show ( qmcDownload ) ;
@ -1552,33 +1552,35 @@ function offline_download_parse(stage, transport) {
}
}
window . setTimeout ( "initiate_offline_download(" + ( stage + 1 ) + ")" , 50 ) ;
window . setTimeout ( "initiate_offline_download(" + ( stage + 1 ) + ")" , 50 ) ;
}
} else {
notify _info ( "All done. ") ;
var articles = transport . responseXML . getElementsByTagName ( "article ") ;
}
var articles _found = 0 ;
} catch ( e ) {
exception _error ( "offline_download_parse" , e ) ;
}
}
function download _set _progress ( p ) {
for ( var i = 0 ; i < articles . length ; i ++ ) {
try {
var a = eval ( "(" + articles [ i ] . firstChild . nodeValue + ")" ) ;
var o = document . getElementById ( "d_progress_i" ) ;
articles _found ++ ;
if ( a ) {
db . execute ( "DELETE FROM offline_data WHERE id = ?" , [ a . id ] ) ;
db . execute ( "INSERT INTO offline_data " +
"(id, feed_id, title, link, guid, updated, content) " +
"VALUES (?, ?, ?, ?, ?, ?, ?)" ,
[ a . id , a . feed _id , a . title , a . link , a . guid , a . updated , a . content ] ) ;
if ( ! o ) return ;
}
}
Element . show ( o ) ;
if ( articles _found > 0 ) {
window . setTimeout ( "initiate_offline_download(" + ( stage + 1 ) + ")" , 50 ) ;
}
}
new Effect . Scale ( o , p , {
notify _info ( "All done." ) ;
scaleY : false ,
scaleFrom : download _progress _last ,
scaleMode : { originalWidth : 100 } ,
queue : { position : 'end' , scope : 'LSP-Q' , limit : 3 } } ) ;
download _progress _last = p ;
}
} catch ( e ) {
} catch ( e ) {
exception _error ( " download_progress ", e ) ;
exception _error ( "offline_download_parse" , e ) ;
}
}
}
}
@ -1587,8 +1589,7 @@ function initiate_offline_download(stage) {
if ( ! stage ) stage = 0 ;
if ( ! stage ) stage = 0 ;
notify _progress ( "Loading, please wait... S" + stage , true ) ;
notify _progress ( "Loading, please wait... (" + stage + ")" , true ) ;
download _set _progress ( 20 ) ;
var query = "backend.php?op=rpc&subop=download&stage=" + stage ;
var query = "backend.php?op=rpc&subop=download&stage=" + stage ;