equal
deleted
inserted
replaced
12 /** |
12 /** |
13 * Expose the module in window.wp.revisions. |
13 * Expose the module in window.wp.revisions. |
14 */ |
14 */ |
15 revisions = wp.revisions = { model: {}, view: {}, controller: {} }; |
15 revisions = wp.revisions = { model: {}, view: {}, controller: {} }; |
16 |
16 |
17 // Link post revisions data served from the back-end. |
17 // Link post revisions data served from the back end. |
18 revisions.settings = window._wpRevisionsSettings || {}; |
18 revisions.settings = window._wpRevisionsSettings || {}; |
19 |
19 |
20 // For debugging |
20 // For debugging |
21 revisions.debug = false; |
21 revisions.debug = false; |
22 |
22 |
23 /** |
23 /** |
24 * wp.revisions.log |
24 * wp.revisions.log |
25 * |
25 * |
26 * A debugging utility for revisions. Works only when a |
26 * A debugging utility for revisions. Works only when a |
27 * debugĀ flag is on and the browser supports it. |
27 * debug flag is on and the browser supports it. |
28 */ |
28 */ |
29 revisions.log = function() { |
29 revisions.log = function() { |
30 if ( window.console && revisions.debug ) { |
30 if ( window.console && revisions.debug ) { |
31 window.console.log.apply( window.console, arguments ); |
31 window.console.log.apply( window.console, arguments ); |
32 } |
32 } |
409 } ); |
409 } ); |
410 |
410 |
411 // Start the router if browser supports History API |
411 // Start the router if browser supports History API |
412 if ( window.history && window.history.pushState ) { |
412 if ( window.history && window.history.pushState ) { |
413 this.router = new revisions.Router({ model: this }); |
413 this.router = new revisions.Router({ model: this }); |
|
414 if ( Backbone.History.started ) { |
|
415 Backbone.history.stop(); |
|
416 } |
414 Backbone.history.start({ pushState: true }); |
417 Backbone.history.start({ pushState: true }); |
415 } |
418 } |
416 }, |
419 }, |
417 |
420 |
418 updateLoadingStatus: function() { |
421 updateLoadingStatus: function() { |