Hello, I have a file (initGears.html) in which I create a localserver
and create the managedresourcestore. At present I am setting
store.enabled = true; after the store is created. But the files are
NOT being served locally when testing. Where/How do I set
store.enabled = true?
Here is my code (mainly from Google documentation):
[CODE]
function createManagedStore()
{
if (!window.google || !google.gears)
{ location.href = "http://gears.google.com/?
action=install&message=Welcome! Please install Google Gears to Enable
Offline Mode" + "&return=http://localhost/impact/
initGears.htm";
return;
}
setText('Creating the store ...');
try
{
var localServer = google.gears.factory.create('beta.localserver');
} catch (ex)
{
var timerId3 = window.setInterval(function() {
setText('Could not create local server: ' + ex.message); }, 6000);
return;
}
var store = localServer.createManagedStore("IMPACT_STORE_V");
store.manifestUrl = 'manifest_v1.json';
store.checkForUpdate();
var timerId = window.setInterval(function() {
// When the currentVersion property has a value, all of the
resources
// listed in the manifest file for that version are captured.
There is
// an open bug to surface this state change as an event.
if (store.currentVersion) {
window.clearInterval(timerId);
setText("The documents are now available offline.\n" +
"With your browser offline, load the document at " +
"its normal online URL to see the locally stored " +
"version. The version stored is: " +
store.currentVersion);
} else if (store.updateStatus == 3) {
setText("Error: " + store.lastErrorMessage);
}
}, 500);
store.enabled = true;
var this_user_id = getValue("user_id");
location.replace('Full_DB_Sync.html?user_id='+ escape(this_user_id));
}
[/CODE]