SyncCode I3 init.js

From MWWiki

Jump to: navigation, search

Back to WordPress Synchronizer

/**
 * This method is invoked when a request is made to establish the "remote"
 * RPC session.  Updates to the user are posted, and the correct script
 * and arguments are returned to the caller.
 */
function grabRemoteInit() {
  var targetDiv = document.getElementById("datacontent");
  var script = "rpc.php?";
  targetDiv.innerHTML = "Retrieving latest entry from remote blog...<br />";
  return script + "function=load&argument=remote";
}
 
/**
 * Once the "remote" blog has indicated it is finished with its session, this
 * method is invoked to perform the same operations on the "local" blog. 
 * Similar messages and script addresses are posted and returned.
 */
function grabLocalInit() {
  var targetDiv = document.getElementById("datacontent");
  var script = "rpc.php?";
  targetDiv.innerHTML += "Retrieving latest entry from local blog...<br />";
  return script + "function=load&argument=local";
}
 
/**
 * When the RPC sessions are complete, this method is invoked to merge the 
 * differences between the values returned from RPC.
 */
function mergeInit() {
  var targetDiv = document.getElementById("datacontent");
  var script = "rpc.php?";
  targetDiv.innerHTML += "Collecting all posts between entry ID values...<br />";
  return script + "function=merge";
}
Personal tools