Changeset 7385
- Timestamp:
- 02/20/07 16:31:55 (23 months ago)
- Location:
- trunk
- Files:
-
- 4 modified
-
demos/storage/editor.html (modified) (4 diffs)
-
demos/storage/editor.js (modified) (5 diffs)
-
src/off.js (modified) (2 diffs)
-
src/sync.js (modified) (22 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/demos/storage/editor.html
r7323 r7385 10 10 var djConfig = 11 11 { 12 isDebug: true,12 isDebug: false, 13 13 parseWidgets: false, 14 14 searchIds: ["storageValue"] … … 41 41 #storageKey, #directory { margin-top: 0.3em; } 42 42 #saveButton { margin-left: 0.2em; } 43 /*#dot-widget-container { height: auto; }*/43 #dot-widget-container { height: auto; } 44 44 45 45 .widget { border: 2px solid #CDDDE9; } … … 90 90 filled into any element with ID "dot-widget". 91 91 --> 92 92 <!-- 93 93 <div id="dot-widget"></div> 94 94 --> 95 95 96 96 <!-- Customize what parts of the Offline Widget we see --> 97 <!--98 97 <div id="dot-widget-container" style="visibility: hidden;"> 99 98 <div id="dot-widget-title-bar"> … … 121 120 </div> 122 121 </div> 123 -->124 122 </div> 125 123 -
trunk/demos/storage/editor.js
r7328 r7385 391 391 392 392 _downloadData: function(){ 393 dojo.debug("Moxie._downloadData");394 393 var self = this; 395 394 // FIXME: Use Dojo's internal cache busting mechanisms … … 400 399 headers: { "Accept" : "text/javascript" }, 401 400 error: function(type, errObj){ 402 dojo.debug("Moxie._downloadData.error, type="+type+", errObj="+errObj.message);401 //dojo.debug("Moxie._downloadData.error, type="+type+", errObj="+errObj.message); 403 402 var message = "Unable to download our documents from server: " 404 403 + errObj.message; … … 406 405 }, 407 406 load: function(type, data, evt){ 408 dojo.debug("Moxie._downloadData.load, type="+type+", evt="+evt);407 //dojo.debug("Moxie._downloadData.load, type="+type+", evt="+evt); 409 408 self._saveDownloadedData(data); 410 409 } … … 416 415 417 416 _saveDownloadedData: function(data){ 418 dojo.debug("Moxie.saveDownloadedData");419 417 // persist the data into Dojo Storage, with the key 420 418 // "documents". 'data' … … 425 423 try{ 426 424 dojo.storage.put("documents", data, function(status, key, message){ 427 dojo.debug("_saveDownloadedData.resultHandler, status="+status+", key="+key+", message="+message);425 //dojo.debug("_saveDownloadedData.resultHandler, status="+status+", key="+key+", message="+message); 428 426 if(status == dojo.storage.SUCCESS){ 429 427 // update our list of available keys -
trunk/src/off.js
r7323 r7385 239 239 240 240 _onLoad: function(){ 241 dojo.debug("dojo.off._onLoad");241 //dojo.debug("dojo.off._onLoad"); 242 242 // both local storage and the page are finished loading 243 243 … … 251 251 var self = this; 252 252 this.load(function(){ 253 dojo.debug("Load finished callback inside of dojo.off._onLoad");254 253 // kick off a thread to check network status on 255 254 // a regular basis -
trunk/src/sync.js
r7327 r7385 63 63 64 64 replay: function(){ /* void */ 65 dojo.debug("replay");66 65 // summary: 67 66 // Replays all of the commands that have been 68 67 // cached in this command log when we go back online; 69 68 // onCommand will be called for each command we have 70 dojo.debug("isReplaying="+this.isReplaying);71 69 72 70 if(this.isReplaying == true){ … … 77 75 78 76 if(this.commands.length == 0){ 79 dojo.debug("no commands to run");80 77 this.onReplayFinished(); 81 78 return; … … 85 82 86 83 var nextCommand = this.commands[0]; 87 dojo.debug("nextCommand="+nextCommand);88 84 this.onCommand(nextCommand); 89 85 }, … … 115 111 // the network, and you should call one of these two methods based on 116 112 // the result of your network call. 117 dojo.debug("default onCommand");118 113 }, 119 114 120 115 add: function(command /* Object */){ /* void */ 121 dojo.debug("CommandLog.add");122 116 // summary: 123 117 // Adds an action to our command log … … 146 140 + "we are replaying a command log"); 147 141 } 148 dojo.debug("this.commands="+this.commands); 149 dojo.debug("this.commands.push="+this.commands.push); 150 for(var i in this.commands){ 151 dojo.debug(i + "=" + this.commands[i]); 152 } 142 153 143 this.commands.push(command); 154 144 … … 182 172 // are not rolled back), while the command entry that was halted 183 173 // stays in our list of commands to later be replayed. 184 dojo.debug("commandlog.haltReplay");185 174 if(this.isReplaying == false){ 186 175 return; … … 207 196 208 197 continueReplay: function(){ /* void */ 209 dojo.debug("commandlog.continueReplay");210 198 // summary: 211 199 // Indicates that we should continue processing out list … … 224 212 this.commands.shift(); 225 213 226 dojo.debug("this.commands.length after shifting="+this.commands.length);227 228 214 // are we done? 229 215 if(this.commands.length == 0){ 230 dojo.debug("no more length");231 216 // save the state of our command log, then 232 217 // tell anyone who is interested that we are … … 235 220 var self = this; 236 221 this.save(function(){ 237 dojo.debug("finished saving command log");238 222 self.isReplaying = false; 239 223 self.onReplayFinished(); … … 249 233 // get the next command 250 234 var nextCommand = this.commands[0]; 251 dojo.debug("nextCommand="+nextCommand);252 235 this.onCommand(nextCommand); 253 236 }, … … 271 254 272 255 save: function(finishedCallback){ /* void */ 273 dojo.debug("commandlog.save");274 256 // summary: 275 257 // Saves this command log to persistent, client-side storage … … 306 288 307 289 load: function(finishedCallback){ /* void */ 308 dojo.debug("CommandLog load!");309 290 // summary: 310 291 // Loads our command log from reliable, persistent local storage; … … 443 424 444 425 synchronize: function(){ /* void */ 445 dojo.debug("dojo.sync.synchronize");446 426 // summary: 447 427 // Begin a synchronization session. … … 476 456 477 457 start: function(){ /* void */ 478 dojo.debug("dojo.sync.start");479 458 if(this.cancelled == true){ 480 459 this.finished(); … … 490 469 491 470 refreshUI: function(){ /* void */ 492 dojo.debug("dojo.sync.refreshUI");493 471 if(this.cancelled == true){ 494 472 this.finished(); … … 515 493 516 494 upload: function(){ /* void */ 517 dojo.debug("dojo.sync.upload");518 495 if(this.cancelled == true){ 519 496 this.finished(); … … 531 508 if(this.log.onReplayFinished == null){ 532 509 this.log.onReplayFinished = function(){ 533 dojo.debug("onReplayFinished");534 510 self.download(); 535 511 } … … 541 517 542 518 download: function(){ /* void */ 543 dojo.debug("dojo.sync.download");544 519 if(this.cancelled == true){ 545 520 this.finished(); … … 558 533 559 534 doDownload: function(){ /* void */ 560 dojo.debug("dojo.sync.doDownload");561 535 // summary: 562 536 // Actually downloads the data we need to … … 571 545 finishedDownloading: function(successful /* boolean */, 572 546 errorMessage /* String */){ 573 dojo.debug("dojo.sync.finishedDownloading, successful="+successful+", errorMessage="+errorMessage);574 547 // summary: 575 548 // Applications call this method from their … … 591 564 592 565 finished: function(){ /* void */ 593 dojo.debug("dojo.sync.finished");594 566 this.isSyncing = false; 595 567 … … 650 622 // as it is handle automatically by the Dojo Offline 651 623 // framework. 652 dojo.debug("dojo.sync.load, log="+this.log);653 624 this.log.load(function(){ 654 dojo.debug("!!!Loaded log, log="+dojo.sync.log);655 625 finishedCallback(); 656 626 });