<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[23813] trunk/wp-admin/js/revisions.js: *Very* rough runthough of revisions.js for JS style, variable names, etc.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/23813">23813</a></dd>
<dt>Author</dt> <dd>markjaquith</dd>
<dt>Date</dt> <dd>2013-03-27 12:59:41 +0000 (Wed, 27 Mar 2013)</dd>
</dl>
<h3>Log Message</h3>
<pre>*Very* rough runthough of revisions.js for JS style, variable names, etc.
Consider this the lawnmower that precedes Daryl's scissors.
see <a href="http://core.trac.wordpress.org/ticket/23497">#23497</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminjsrevisionsjs">trunk/wp-admin/js/revisions.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminjsrevisionsjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/revisions.js (23812 => 23813)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/revisions.js        2013-03-27 12:58:43 UTC (rev 23812)
+++ trunk/wp-admin/js/revisions.js        2013-03-27 12:59:41 UTC (rev 23813)
</span><span class="lines">@@ -3,28 +3,28 @@
</span><span class="cx"> (function($) {
</span><span class="cx">         wp.revisions = {
</span><span class="cx">
</span><del>-                views : {},
</del><ins>+                views: {},
</ins><span class="cx">
</span><del>-                Model : Backbone.Model.extend({
-                        idAttribute : 'ID',
-                        urlRoot : ajaxurl +        '?action=revisions-data' +
</del><ins>+                Model: Backbone.Model.extend({
+                        idAttribute: 'ID',
+                        urlRoot: ajaxurl +        '?action=revisions-data' +
</ins><span class="cx">                                 '&show_autosaves=true&show_split_view=true&nonce=' + wpRevisionsSettings.nonce,
</span><span class="cx">                         defaults: {
</span><del>-                                ID : 0,
-                                revision_date_author : '',
</del><ins>+                                ID: 0,
+                                revision_date_author: '',
</ins><span class="cx">                                 revision_date_author_short: '',
</span><del>-                                revisiondiff : '<div class="diff-loading"><div class="spinner"></div></div>',
-                                restoreaction : '',
-                                revision_from_date_author : '',
-                                revision_toload : false,
-                                lines_added : 0,
-                                lines_deleted : 0,
-                                scope_of_changes : 'none',
-                                previous_revision_id : 0
</del><ins>+                                revisiondiff: '<div class="diff-loading"><div class="spinner"></div></div>',
+                                restoreaction: '',
+                                revision_from_date_author: '',
+                                revision_toload: false,
+                                lines_added: 0,
+                                lines_deleted: 0,
+                                scope_of_changes: 'none',
+                                previous_revision_id: 0
</ins><span class="cx">                         },
</span><span class="cx">
</span><del>-                        url : function() {
-                                if ( 1 === REVAPP._compareoneortwo ) {
</del><ins>+                        url: function() {
+                                if ( 1 === REVAPP._compareOneOrTwo ) {
</ins><span class="cx">                                         return this.urlRoot +
</span><span class="cx">                                                 '&single_revision_id=' + this.id +
</span><span class="cx">                                                 '&compare_to=' + this.get( 'previous_revision_id' ) +
</span><span class="lines">@@ -40,55 +40,53 @@
</span><span class="cx">
</span><span class="cx">                 app: _.extend({}, Backbone.Events),
</span><span class="cx">
</span><del>-                App : Backbone.Router.extend({
-                        _revisionDifflView : null,
-                        _revisions : null,
-                        _left_handle_revisions : null,
-                        _right_handle_revisions : null,
-                        _revisionsInteractions : null,
-                        _revisionsOptions : null,
-                        _left_diff : 1,
-                        _right_diff : 1,
-                        _autosaves : true,
-                        _show_split_view : true,
-                        _compareoneortwo : 1,
-                        _left_model_loading : false,        //keep track of model loads
-                        _right_model_loading : false,        //disallow slider interaction, also repeat loads, while loading
-                        _tickmarkView : null, //the slider tickmarks
-                        _has_tooltip : false,
</del><ins>+                App: Backbone.Router.extend({
+                        _revisions: null,
+                        _leftHandleRevisions: null,
+                        _rightHandleRevisions: null,
+                        _revisionsInteractions: null,
+                        _revisionsOptions: null,
+                        _leftDiff: 1,
+                        _rightDiff: 1,
+                        _autosaves: true,
+                        _showSplitView: true,
+                        _compareOneOrTwo: 1,
+                        _leftModelLoading: false,        // keep track of model loads
+                        _rightModelLoading: false,        // disallow slider interaction, also repeat loads, while loading
+                        _tickmarkView: null, // the slider tickmarks
</ins><span class="cx">
</span><del>-                        routes : {
</del><ins>+                        routes: {
</ins><span class="cx">                         },
</span><span class="cx">
</span><del>-                        reload_toload_revisions : function( model_collection, reverse_direction ) {
-                                var self = this;
-                                var revisions_to_load = model_collection.where( { revision_toload : true } );
-                                var delay=0;
-                                //match slider to passed revision_id
-                                _.each( revisions_to_load, function( the_model ) {
-                                        if ( the_model.get( 'ID' ) == wpRevisionsSettings.revision_id ) {
-                                                self._right_diff = self._revisions.indexOf( the_model ) + 1;
</del><ins>+                        reloadToLoadRevisions: function( model_collection, reverse_direction ) {
+                                var self = this,
+                                 revisionsToLoad = model_collection.where( { revision_toload: true } ),
+                                 delay = 0;
+                                // match slider to passed revision_id
+                                _.each( revisionsToLoad, function( theModel ) {
+                                        if ( theModel.get( 'ID' ) == wpRevisionsSettings.revision_id ) {
+                                                self._rightDiff = self._revisions.indexOf( theModel ) + 1;
</ins><span class="cx">                                         }
</span><span class="cx">
</span><span class="cx">                                 });
</span><del>-                                _.each( revisions_to_load, function( the_model ) {
-                                                the_model.urlRoot = model_collection.url;
</del><ins>+                                _.each( revisionsToLoad, function( theModel ) {
+                                                theModel.urlRoot = model_collection.url;
</ins><span class="cx">                                                 _.delay( function() {
</span><del>-                                                        the_model.fetch( {
-                                                                update : true,
-                                                                add : false,
-                                                                remove : false,
-                                                                success : function( model ) {
</del><ins>+                                                        theModel.fetch( {
+                                                                update: true,
+                                                                add: false,
+                                                                remove: false,
+                                                                success: function( model ) {
</ins><span class="cx">                                                                         model.set( 'revision_toload', 'false' );
</span><span class="cx">
</span><del>-                                                                        //stop spinner when all models are loaded
-                                                                        if ( 0 === model_collection.where( { revision_toload : true } ).length )
-                                                                                self.stop_model_loading_spinner();
</del><ins>+                                                                        // stop spinner when all models are loaded
+                                                                        if ( 0 === model_collection.where( { revision_toload: true } ).length )
+                                                                                self.stopModelLoadingSpinner();
</ins><span class="cx">
</span><span class="cx">                                                                         self._tickmarkView.render();
</span><span class="cx">
</span><del>-                                                                        var total_changes = model.get( 'lines_added' ) + model.get( 'lines_deleted');
-                                                                        var scope_of_changes = 'vsmall';
</del><ins>+                                                                        var total_changes = model.get( 'lines_added' ) + model.get( 'lines_deleted'),
+                                                                         scope_of_changes = 'vsmall';
</ins><span class="cx">
</span><span class="cx">                                                                         // Note: hard coded scope of changes
</span><span class="cx">                                                                         // TODO change to dynamic based on range of values
</span><span class="lines">@@ -102,170 +100,170 @@
</span><span class="cx">                                                                                 scope_of_changes = 'vlarge';
</span><span class="cx">                                                                         }
</span><span class="cx">                                                                         model.set( 'scope_of_changes', scope_of_changes );
</span><del>-                                                                        if ( 0 !== self._right_diff &&
-                                                                                model.get( 'ID' ) === self._revisions.at( self._right_diff - 1 ).get( 'ID' ) ) {
-                                                                                //reload if current model refreshed
</del><ins>+                                                                        if ( 0 !== self._rightDiff &&
+                                                                                model.get( 'ID' ) === self._revisions.at( self._rightDiff - 1 ).get( 'ID' ) ) {
+                                                                                // reload if current model refreshed
</ins><span class="cx">                                                                                 self._revisionView.render();
</span><span class="cx">                                                                         }
</span><span class="cx">
</span><span class="cx">                                                                 }
</span><span class="cx">                                                 } );
</span><span class="cx">                                                 }, delay ) ;
</span><del>-                                                delay = delay + 150; //stagger model loads to avoid hammering server with requests
</del><ins>+                                                delay = delay + 150; // stagger model loads to avoid hammering server with requests
</ins><span class="cx">                                         }
</span><span class="cx">                                 );
</span><span class="cx">                         },
</span><span class="cx">
</span><del>-                        start_left_model_loading : function() {
-                                this._left_model_loading = true;
</del><ins>+                        startLeftModelLoading: function() {
+                                this._leftModelLoading = true;
</ins><span class="cx">                                 $('.revisiondiffcontainer').addClass('leftmodelloading');
</span><span class="cx">                         },
</span><span class="cx">
</span><del>-                        stop_left_model_loading : function() {
-                                this._left_model_loading = false;
</del><ins>+                        stopLeftModelLoading: function() {
+                                this._leftModelLoading = false;
</ins><span class="cx">                         },
</span><span class="cx">
</span><del>-                        start_right_model_loading : function() {
-                                this._right_model_loading = true;
</del><ins>+                        startRightModelLoading: function() {
+                                this._rightModelLoading = true;
</ins><span class="cx">                                 $('.revisiondiffcontainer').addClass('rightmodelloading');
</span><span class="cx">                         },
</span><span class="cx">
</span><del>-                        stop_right_model_loading : function() {
-                                this._right_model_loading = false;
</del><ins>+                        stopRightModelLoading: function() {
+                                this._rightModelLoading = false;
</ins><span class="cx">                         },
</span><span class="cx">
</span><del>-                        stop_model_loading_spinner : function() {
</del><ins>+                        stopModelLoadingSpinner: function() {
</ins><span class="cx">                                 $('.revisiondiffcontainer').removeClass('rightmodelloading');
</span><span class="cx">                                 $('.revisiondiffcontainer').removeClass('leftmodelloading');
</span><span class="cx">                         },
</span><span class="cx">
</span><del>-                        reloadmodel : function() {
-                                if ( 2 === this._compareoneortwo ) {
-                                        this.reloadleftright();
</del><ins>+                        reloadModel: function() {
+                                if ( 2 === this._compareOneOrTwo ) {
+                                        this.reloadLeftRight();
</ins><span class="cx">                                 } else {
</span><del>-                                        this.reloadmodelsingle();
</del><ins>+                                        this.reloadModelSingle();
</ins><span class="cx">                                 }
</span><span class="cx">                         },
</span><span class="cx">
</span><del>-                        //load the models for the single handle mode
-                        reloadmodelsingle : function() {
</del><ins>+                        // load the models for the single handle mode
+                        reloadModelSingle: function() {
</ins><span class="cx">                                 var self = this;
</span><span class="cx">                                 self._revisions.url = ajaxurl +        '?action=revisions-data&compare_to=' + wpRevisionsSettings.post_id +
</span><span class="cx">                                                                                         '&show_autosaves=' + self._autosaves +
</span><del>-                                                                                        '&show_split_view=' + self._show_split_view +
</del><ins>+                                                                                        '&show_split_view=' + self._showSplitView +
</ins><span class="cx">                                                                                         '&nonce=' + wpRevisionsSettings.nonce;
</span><del>-                                self.start_right_model_loading();
-                                self._revisions.fetch({ //reload revision data
-                                        success : function() {
</del><ins>+                                self.startRightModelLoading();
+                                self._revisions.fetch({ // reload revision data
+                                        success: function() {
</ins><span class="cx">                                                 console.log('loaded');
</span><del>-                                                //self.stop_right_model_loading();
-                                                //REVAPP._right_diff -= 1;
-                                                var revisioncount = self._revisions.length;
</del><ins>+                                                // self.stopRightModelLoading();
+                                                // REVAPP._rightDiff -= 1;
+                                                var revisionCount = self._revisions.length;
</ins><span class="cx">                                                 self._revisionView.model = self._revisions;
</span><span class="cx">                                                 self._revisionView.render();
</span><del>-                                                self.reload_toload_revisions( self._revisions );
</del><ins>+                                                self.reloadToLoadRevisions( self._revisions );
</ins><span class="cx">                                                 self._tickmarkView.model = self._revisions;
</span><span class="cx">                                                 self._tickmarkView.render();
</span><del>-                                                $( '#slider' ).slider( 'option', 'max', revisioncount-1 ); //TODO test this, if autsave option changed
-                                                $( '#slider' ).slider( 'value', self._right_diff - 1 ).trigger( 'slide' );
</del><ins>+                                                $( '#slider' ).slider( 'option', 'max', revisionCount - 1 ); // TODO: test this, if autosave option changed
+                                                $( '#slider' ).slider( 'value', self._rightDiff - 1 ).trigger( 'slide' );
</ins><span class="cx">
</span><span class="cx">                                         },
</span><span class="cx">
</span><del>-                                        error : function () {
-                                                self.stop_right_model_loading();
</del><ins>+                                        error: function() {
+                                                self.stopRightModelLoading();
</ins><span class="cx">                                         }
</span><span class="cx">
</span><span class="cx">                                 });
</span><span class="cx">                         },
</span><span class="cx">
</span><del>-                        //load the models for the left handle
-                        reloadleft : function() {
</del><ins>+                        // load the models for the left handle
+                        reloadLeft: function() {
</ins><span class="cx">                                 var self = this;
</span><del>-                                self.start_left_model_loading();
-                                self._left_handle_revisions = new wp.revisions.Collection();
</del><ins>+                                self.startLeftModelLoading();
+                                self._leftHandleRevisions = new wp.revisions.Collection();
</ins><span class="cx">
</span><del>-                                self._left_handle_revisions.url =
</del><ins>+                                self._leftHandleRevisions.url =
</ins><span class="cx">                                         ajaxurl +
</span><del>-                                        '?action=revisions-data&compare_to=' + self._revisions.at( self._right_diff - 1 ).get( 'ID' ) +
</del><ins>+                                        '?action=revisions-data&compare_to=' + self._revisions.at( self._rightDiff - 1 ).get( 'ID' ) +
</ins><span class="cx">                                         '&post_id=' + wpRevisionsSettings.post_id +
</span><span class="cx">                                         '&show_autosaves=' + REVAPP._autosaves +
</span><del>-                                        '&show_split_view=' + REVAPP._show_split_view +
</del><ins>+                                        '&show_split_view=' + REVAPP._showSplitView +
</ins><span class="cx">                                         '&nonce=' + wpRevisionsSettings.nonce +
</span><del>-                                        '&right_handle_at=' + ( self._right_diff );
</del><ins>+                                        '&right_handle_at=' + ( self._rightDiff );
</ins><span class="cx">
</span><del>-                                self._left_handle_revisions.fetch({
</del><ins>+                                self._leftHandleRevisions.fetch({
</ins><span class="cx">
</span><del>-                                        success : function(){
-                                                self.stop_left_model_loading();
-                                                self.reload_toload_revisions( self._left_handle_revisions );
-                                                self._tickmarkView.model = self._left_handle_revisions;
</del><ins>+                                        success: function(){
+                                                self.stopLeftModelLoading();
+                                                self.reloadToLoadRevisions( self._leftHandleRevisions );
+                                                self._tickmarkView.model = self._leftHandleRevisions;
</ins><span class="cx">                                                 $( '#slider' ).slider( 'option', 'max', self._revisions.length );
</span><span class="cx">                                                 // ensure right handle not beyond length, in particular if viewing autosaves is switched from on to off
</span><span class="cx">                                                 // the number of models in the collection might get shorter, this ensures right handle is not beyond last model
</span><del>-                                                if ( self._right_diff > self._revisions.length )
-                                                        self._right_diff = self._revisions.length;
</del><ins>+                                                if ( self._rightDiff > self._revisions.length )
+                                                        self._rightDiff = self._revisions.length;
</ins><span class="cx">                                                 },
</span><span class="cx">
</span><del>-                                        error : function () {
-                                                self.stop_left_model_loading();
</del><ins>+                                        error: function() {
+                                                self.stopLeftModelLoading();
</ins><span class="cx">                                         }
</span><span class="cx">                                 });
</span><span class="cx">                         },
</span><span class="cx">
</span><del>-                        //load the models for the right handle
-                        reloadright : function() {
</del><ins>+                        // load the models for the right handle
+                        reloadRight: function() {
</ins><span class="cx">                                 var self = this;
</span><del>-                                self.start_right_model_loading();
-                                self._right_handle_revisions = new wp.revisions.Collection();
</del><ins>+                                self.startRightModelLoading();
+                                self._rightHandleRevisions = new wp.revisions.Collection();
</ins><span class="cx">
</span><del>-                                        self._right_handle_revisions.url =
</del><ins>+                                        self._rightHandleRevisions.url =
</ins><span class="cx">                                                 ajaxurl +
</span><del>-                                                '?action=revisions-data&compare_to=' + ( self._revisions.at( self._left_diff ).get( 'ID' ) -1)+
</del><ins>+                                                '?action=revisions-data&compare_to=' + ( self._revisions.at( self._leftDiff ).get( 'ID' ) - 1 )+
</ins><span class="cx">                                                 '&post_id=' + wpRevisionsSettings.post_id +
</span><span class="cx">                                                 '&show_autosaves=' + REVAPP._autosaves +
</span><del>-                                                '&show_split_view=' + REVAPP._show_split_view +
</del><ins>+                                                '&show_split_view=' + REVAPP._showSplitView +
</ins><span class="cx">                                                 '&nonce=' + wpRevisionsSettings.nonce;
</span><span class="cx">
</span><del>-                                self._right_handle_revisions.fetch({
</del><ins>+                                self._rightHandleRevisions.fetch({
</ins><span class="cx">
</span><del>-                                        success : function(){
-                                                self.stop_right_model_loading();
-                                                self.reload_toload_revisions( self._right_handle_revisions );
-                                                self._tickmarkView.model = self._right_handle_revisions;
</del><ins>+                                        success: function(){
+                                                self.stopRightModelLoading();
+                                                self.reloadToLoadRevisions( self._rightHandleRevisions );
+                                                self._tickmarkView.model = self._rightHandleRevisions;
</ins><span class="cx">                                                 $( '#slider' ).slider( 'option', 'max', self._revisions.length );
</span><del>-                                                $( '#slider' ).slider( 'values', [ REVAPP._left_diff, REVAPP._right_diff] ).trigger( 'slide' );
</del><ins>+                                                $( '#slider' ).slider( 'values', [ REVAPP._leftDiff, REVAPP._rightDiff] ).trigger( 'slide' );
</ins><span class="cx">
</span><del>-                                                //REVAPP._revisionView.render();
</del><ins>+                                                // REVAPP._revisionView.render();
</ins><span class="cx">
</span><span class="cx">                                         },
</span><span class="cx">
</span><del>-                                        error : function ( response ) {
-                                                self.stop_right_model_loading();
</del><ins>+                                        error: function( response ) {
+                                                self.stopRightModelLoading();
</ins><span class="cx">                                         }
</span><span class="cx">                                 });
</span><span class="cx">
</span><span class="cx">                         },
</span><span class="cx">
</span><del>-                        reloadleftright : function() {
-                                this.start_right_model_loading();
-                                this.start_left_model_loading();
-                                this.reloadleft();
-                                this.reloadright();
</del><ins>+                        reloadLeftRight: function() {
+                                this.startRightModelLoading();
+                                this.startLeftModelLoading();
+                                this.reloadLeft();
+                                this.reloadRight();
</ins><span class="cx">                         },
</span><span class="cx">
</span><span class="cx">                         /*
</span><span class="cx">                          * initialize the revision application
</span><span class="cx">                          */
</span><del>-                        initialize : function( options ) {
-                                var self = this; //store the application instance
</del><ins>+                        initialize: function( options ) {
+                                var self = this; // store the application instance
</ins><span class="cx">                                 if (this._revisions === null) {
</span><del>-                                        self._revisions = new wp.revisions.Collection(); //set up collection
-                                        self.start_right_model_loading();
-                                        self._revisions.fetch({ //load revision data
</del><ins>+                                        self._revisions = new wp.revisions.Collection(); // set up collection
+                                        self.startRightModelLoading();
+                                        self._revisions.fetch({ // load revision data
</ins><span class="cx">
</span><del>-                                                success : function() {
-                                                        self.stop_right_model_loading();
-                                                        //self._right_handle_revisions = self._revisions;
</del><ins>+                                                success: function() {
+                                                        self.stopRightModelLoading();
+                                                        // self._rightHandleRevisions = self._revisions;
</ins><span class="cx">                                                         self.completeApplicationSetup();
</span><span class="cx">                                                 }
</span><span class="cx">                                         });
</span><span class="lines">@@ -273,7 +271,7 @@
</span><span class="cx">                                 return this;
</span><span class="cx">                         },
</span><span class="cx">
</span><del>-                        addTooltip : function( handle, message ) {
</del><ins>+                        addTooltip: function( handle, message ) {
</ins><span class="cx">
</span><span class="cx">                                 handle.attr( 'title', '' ).tooltip({
</span><span class="cx">                                         track: false,
</span><span class="lines">@@ -300,25 +298,25 @@
</span><span class="cx">                         },
</span><span class="cx"> /**/
</span><span class="cx">
</span><del>-                        completeApplicationSetup : function() {
</del><ins>+                        completeApplicationSetup: function() {
</ins><span class="cx">                                 this._revisionView = new wp.revisions.views.View({
</span><del>-                                        model : this._revisions
</del><ins>+                                        model: this._revisions
</ins><span class="cx">                                 });
</span><span class="cx">                                 this._revisionView.render();
</span><span class="cx">                                 $( '#slider' ).slider( 'option', 'max', this._revisions.length - 1 );
</span><span class="cx">
</span><del>-                                this.reload_toload_revisions( this._revisions );
</del><ins>+                                this.reloadToLoadRevisions( this._revisions );
</ins><span class="cx">
</span><span class="cx">                                 this._revisionsInteractions = new wp.revisions.views.Interact({
</span><del>-                                        model : this._revisions
</del><ins>+                                        model: this._revisions
</ins><span class="cx">                                 });
</span><span class="cx">                                 this._revisionsInteractions.render();
</span><span class="cx">
</span><span class="cx">                                 this._tickmarkView = new wp.revisions.views.Tickmarks({
</span><del>-                                        model : this._revisions
</del><ins>+                                        model: this._revisions
</ins><span class="cx">                                 });
</span><span class="cx">                                 this._tickmarkView.render();
</span><del>-                                this._tickmarkView.resetticks();
</del><ins>+                                this._tickmarkView.resetTicks();
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx">                                 /*
</span><span class="lines">@@ -333,9 +331,9 @@
</span><span class="cx">                                         });
</span><span class="cx">                                 */
</span><span class="cx">                                 /*
</span><del>-                                //Options hidden for now, moving to screen options
</del><ins>+                                // Options hidden for now, moving to screen options
</ins><span class="cx">                                 this._revisionsOptions = new wp.revisions.views.Options({
</span><del>-                                        model : this._revisions
</del><ins>+                                        model: this._revisions
</ins><span class="cx">                                 });
</span><span class="cx">                                 this._revisionsOptions.render();
</span><span class="cx">                                 */
</span><span class="lines">@@ -345,147 +343,138 @@
</span><span class="cx">         };
</span><span class="cx">
</span><span class="cx">         wp.revisions.Collection = Backbone.Collection.extend({
</span><del>-                model : wp.revisions.Model,
-                url : ajaxurl +        '?action=revisions-data&compare_to=' + wpRevisionsSettings.post_id +
</del><ins>+                model: wp.revisions.Model,
+                url: ajaxurl +        '?action=revisions-data&compare_to=' + wpRevisionsSettings.post_id +
</ins><span class="cx">                         '&show_autosaves=true&show_split_view=true&nonce=' + wpRevisionsSettings.nonce,
</span><span class="cx">
</span><del>-                initialize : function() {
</del><ins>+                initialize: function() {
</ins><span class="cx">                         }
</span><span class="cx">         } );
</span><span class="cx">
</span><span class="cx">         _.extend(wp.revisions.views, {
</span><span class="cx">
</span><del>-                //Ticks inside slider view
-                //
-                Tickmarks : Backbone.View.extend({
-                        el : $('#diff-slider-ticks')[0],
-                        tagName : 'diff-slider-ticks-view',
-                        className : 'diff-slider-ticks-container',
-                        template : wp.template('revision-ticks'),
-                        model : wp.revisions.Model,
</del><ins>+                // Ticks inside slider view
+                Tickmarks: Backbone.View.extend({
+                        el: $('#diff-slider-ticks')[0],
+                        tagName: 'diff-slider-ticks-view',
+                        className: 'diff-slider-ticks-container',
+                        template: wp.template('revision-ticks'),
+                        model: wp.revisions.Model,
</ins><span class="cx">
</span><del>-                        resetticks : function() {
-                                var slider_max = $( '#slider' ).slider( 'option', 'max');
-                                var slider_width = $( '#slider' ).width();
-                                var adjust_max = ( 2 === REVAPP._compareoneortwo ) ? 1 : 0;
-                                var tick_width = Math.floor( slider_width / ( slider_max - adjust_max ) );
</del><ins>+                        resetTicks: function() {
+                                var sliderMax = $( '#slider' ).slider( 'option', 'max');
+                                var sliderWidth = $( '#slider' ).width();
+                                var adjustMax = ( 2 === REVAPP._compareOneOrTwo ) ? 1 : 0;
+                                var tickWidth = Math.floor( sliderWidth / ( sliderMax - adjustMax ) );
</ins><span class="cx">
</span><del>-                                //TODO: adjust right margins for wider ticks so they stay centered on handle stop point
</del><ins>+                                // TODO: adjust right margins for wider ticks so they stay centered on handle stop point
</ins><span class="cx">
</span><del>-                                //set minimum and maximum widths for tick marks
-                                tick_width = (tick_width > 50 ) ? 50 : tick_width;
-                                tick_width = (tick_width < 10 ) ? 10 : tick_width;
</del><ins>+                                // set minimum and maximum widths for tick marks
+                                tickWidth = (tickWidth > 50 ) ? 50 : tickWidth;
+                                tickWidth = (tickWidth < 10 ) ? 10 : tickWidth;
</ins><span class="cx">
</span><del>-                                slider_width = tick_width * (slider_max - adjust_max ) +1;
</del><ins>+                                sliderWidth = tickWidth * (sliderMax - adjustMax ) + 1;
</ins><span class="cx">
</span><del>-                                $( '#slider' ).width( slider_width );
-                                $( '.diff-slider-ticks-wrapper' ).width( slider_width );
-                                $( '#diffslider' ).width( slider_width );
-                                $( '#diff-slider-ticks' ).width( slider_width );
</del><ins>+                                $( '#slider' ).width( sliderWidth );
+                                $( '.diff-slider-ticks-wrapper' ).width( sliderWidth );
+                                $( '#diffslider' ).width( sliderWidth );
+                                $( '#diff-slider-ticks' ).width( sliderWidth );
</ins><span class="cx">
</span><del>-                                var a_tick_width = $( '.revision-tick' ).width();
</del><ins>+                                var aTickWidth = $( '.revision-tick' ).width();
</ins><span class="cx">
</span><del>-                                if ( tick_width !== a_tick_width ) { // is the width already set correctly?
</del><ins>+                                if ( tickWidth !== aTickWidth ) { // is the width already set correctly?
</ins><span class="cx">                                         $( '.revision-tick' ).each( function( ) {
</span><del>-                                                $(this).css( 'margin-right', tick_width - 1 + 'px'); //space the ticks out using right margin
</del><ins>+                                                $(this).css( 'margin-right', tickWidth - 1 + 'px'); // space the ticks out using right margin
</ins><span class="cx">                                         });
</span><span class="cx">
</span><del>-                                        if( 2 === REVAPP._compareoneortwo ) {
-                                                $( '.revision-tick' ).first().remove(); //TODO - remove the check
</del><ins>+                                        if( 2 === REVAPP._compareOneOrTwo ) {
+                                                $( '.revision-tick' ).first().remove(); // TODO - remove the check
</ins><span class="cx">                                         }
</span><span class="cx">                                         $( '.revision-tick' ).last().css( 'margin-right', '0' ); // last tick gets no right margin
</span><span class="cx">                                 }
</span><span class="cx">
</span><span class="cx">                         },
</span><span class="cx">
</span><del>-                        //render the tickmark view
-                        render : function() {
</del><ins>+                        // render the tickmark view
+                        render: function() {
</ins><span class="cx">                                 var self = this;
</span><span class="cx">
</span><span class="cx">                                 if ( null !== self.model ) {
</span><del>-                                        var addhtml = "";
-                                        _.each ( self.model.models, function ( the_model ) {
-                                                addhtml = addhtml + self.template ( the_model.toJSON() );
</del><ins>+                                        var addHtml = "";
+                                        _.each ( self.model.models, function( theModel ) {
+                                                addHtml = addHtml + self.template ( theModel.toJSON() );
</ins><span class="cx">                                         });
</span><del>-                                        self.$el.html( addhtml );
</del><ins>+                                        self.$el.html( addHtml );
</ins><span class="cx">
</span><span class="cx">                                 }
</span><del>-                                self.resetticks();
</del><ins>+                                self.resetTicks();
</ins><span class="cx">                                 return self;
</span><span class="cx">                         }
</span><span class="cx">                 }),
</span><span class="cx">
</span><del>-                //
-                //primary revision diff view
-                //
-                View : Backbone.View.extend({
-                        el : $('#backbonerevisionsdiff')[0],
-                        tagName : 'revisionvview',
-                        className : 'revisionview-container',
-                        template : wp.template('revision'),
-                        comparetwochecked : '',
-                        draggingleft : false,
</del><ins>+                // primary revision diff view
+                View: Backbone.View.extend({
+                        el: $('#backbonerevisionsdiff')[0],
+                        tagName: 'revisionvview',
+                        className: 'revisionview-container',
+                        template: wp.template('revision'),
+                        comparetwochecked: '',
+                        draggingLeft: false,
</ins><span class="cx">
</span><del>-                        //
-                        //render the revisions
-                        //
-                        render : function() {
-                                var addhtml = '';
-                                //compare two revisions mode?
</del><ins>+                        // render the revisions
+                        render: function() {
+                                var addHtml = '';
+                                // compare two revisions mode?
</ins><span class="cx">
</span><del>-                                if ( 2 === REVAPP._compareoneortwo ) {
</del><ins>+                                if ( 2 === REVAPP._compareOneOrTwo ) {
</ins><span class="cx">                                         this.comparetwochecked = 'checked';
</span><del>-                                        if ( this.draggingleft ) {
-                                                        if ( this.model.at( REVAPP._left_diff ) ) {
-                                                        addhtml = this.template( _.extend(
-                                                                this.model.at( REVAPP._left_diff ).toJSON(),
-                                                                { comparetwochecked : this.comparetwochecked } //keep the checkmark checked
</del><ins>+                                        if ( this.draggingLeft ) {
+                                                        if ( this.model.at( REVAPP._leftDiff ) ) {
+                                                        addHtml = this.template( _.extend(
+                                                                this.model.at( REVAPP._leftDiff ).toJSON(),
+                                                                { comparetwochecked: this.comparetwochecked } // keep the checkmark checked
</ins><span class="cx">                                                         ) );
</span><span class="cx">                                                 }
</span><del>-                                        } else { //dragging right handle
-                                                var thediff = REVAPP._right_diff;
</del><ins>+                                        } else { // dragging right handle
+                                                var thediff = REVAPP._rightDiff;
</ins><span class="cx">                                                 if ( this.model.at( thediff ) ) {
</span><del>-                                                        addhtml = this.template( _.extend(
</del><ins>+                                                        addHtml = this.template( _.extend(
</ins><span class="cx">                                                                 this.model.at( thediff ).toJSON(),
</span><del>-                                                                { comparetwochecked : this.comparetwochecked } //keep the checkmark checked
</del><ins>+                                                                { comparetwochecked: this.comparetwochecked } // keep the checkmark checked
</ins><span class="cx">                                                         ) );
</span><span class="cx">                                                 }
</span><span class="cx">                                         }
</span><del>-                                } else { //end compare two revisions mode, eg only one slider handle
</del><ins>+                                } else { // end compare two revisions mode, eg only one slider handle
</ins><span class="cx">                                         this.comparetwochecked = '';
</span><del>-                                        if ( this.model.at( REVAPP._right_diff - 1 ) ) {
-                                                addhtml = this.template( _.extend(
-                                                        this.model.at( REVAPP._right_diff - 1 ).toJSON(),
-                                                        { comparetwochecked : this.comparetwochecked } //keep the checkmark unchecked
</del><ins>+                                        if ( this.model.at( REVAPP._rightDiff - 1 ) ) {
+                                                addHtml = this.template( _.extend(
+                                                        this.model.at( REVAPP._rightDiff - 1 ).toJSON(),
+                                                        { comparetwochecked: this.comparetwochecked } // keep the checkmark unchecked
</ins><span class="cx">                                                 ) );
</span><span class="cx">                                         }
</span><span class="cx">                                 }
</span><del>-                                this.$el.html( addhtml );
</del><ins>+                                this.$el.html( addHtml );
</ins><span class="cx">                                 if ( this.model.length < 3 ) {
</span><del>-                                        $( 'div#comparetworevisions' ).hide(); //don't allow compare two if fewer than three revisions
</del><ins>+                                        $( 'div#comparetworevisions' ).hide(); // don't allow compare two if fewer than three revisions
</ins><span class="cx">                                 }
</span><span class="cx">                                 if ( this.model.length < 2 ) {
</span><del>-                                        $( 'div#diffslider' ).hide(); //don't allow compare two if fewer than three revisions
</del><ins>+                                        $( 'div#diffslider' ).hide(); // don't allow compare two if fewer than three revisions
</ins><span class="cx">                                         $( 'div.diff-slider-ticks-wrapper' ).hide();
</span><span class="cx">                                 }
</span><span class="cx">
</span><del>-                                //
</del><span class="cx">                                 // add tooltips to the handles
</span><del>-                                //
-                                if ( 2 === REVAPP._compareoneortwo ) {
</del><ins>+                                if ( 2 === REVAPP._compareOneOrTwo ) {
</ins><span class="cx">                                         REVAPP.addTooltip ( $( 'a.ui-slider-handle.left-handle' ),
</span><del>-                                                ( REVAPP._right_diff >= REVAPP._revisions.length ) ? '' : REVAPP._revisions.at( REVAPP._left_diff ).get( 'revision_date_author_short' ) );
</del><ins>+                                                ( REVAPP._rightDiff >= REVAPP._revisions.length ) ? '' : REVAPP._revisions.at( REVAPP._leftDiff ).get( 'revision_date_author_short' ) );
</ins><span class="cx">                                         REVAPP.addTooltip ( $( 'a.ui-slider-handle.right-handle' ),
</span><del>-                                                ( REVAPP._right_diff >= REVAPP._revisions.length ) ? '' : REVAPP._revisions.at( REVAPP._right_diff ).get( 'revision_date_author_short' ) );
</del><ins>+                                                ( REVAPP._rightDiff >= REVAPP._revisions.length ) ? '' : REVAPP._revisions.at( REVAPP._rightDiff ).get( 'revision_date_author_short' ) );
</ins><span class="cx">                                 } else {
</span><span class="cx">                                         REVAPP.addTooltip ( $( 'a.ui-slider-handle' ),
</span><del>-                                                ( REVAPP._right_diff >= REVAPP._revisions.length ) ? '' : REVAPP._revisions.at( REVAPP._right_diff ).get( 'revision_date_author_short' ) );
</del><ins>+                                                ( REVAPP._rightDiff >= REVAPP._revisions.length ) ? '' : REVAPP._revisions.at( REVAPP._rightDiff ).get( 'revision_date_author_short' ) );
</ins><span class="cx">                                 }
</span><span class="cx">
</span><del>-                                //
</del><span class="cx">                                 // hide the restore button when on the last sport/current post data
</span><del>-                                //
-                                if ( REVAPP._right_diff === REVAPP._revisions.length ){
</del><ins>+                                if ( REVAPP._rightDiff === REVAPP._revisions.length ){
</ins><span class="cx">                                         $( '.restore-button' ).hide();
</span><span class="cx">                                 } else {
</span><span class="cx">                                         $( '.restore-button' ).show();
</span><span class="lines">@@ -494,69 +483,63 @@
</span><span class="cx">                                 return this;
</span><span class="cx">                         },
</span><span class="cx">
</span><del>-                        //the compare two button is in this view, add the interaction here
-                        events : {
-                                'click #comparetwo' : 'clickcomparetwo'
</del><ins>+                        // the compare two button is in this view, add the interaction here
+                        events: {
+                                'click #comparetwo': 'clickcomparetwo'
</ins><span class="cx">                         },
</span><span class="cx">
</span><del>-                        //
-                        //turn on/off the compare two mmode
-                        //
-                        clickcomparetwo : function(){
</del><ins>+                        // turn on/off the compare two mmode
+                        clickcomparetwo: function(){
</ins><span class="cx">                                 self = this;
</span><span class="cx">
</span><del>-                                if ( $( 'input#comparetwo' ).is( ':checked' ) ) { //compare 2 mode
-                                        REVAPP._compareoneortwo = 2 ;
</del><ins>+                                if ( $( 'input#comparetwo' ).is( ':checked' ) ) { // compare 2 mode
+                                        REVAPP._compareOneOrTwo = 2 ;
</ins><span class="cx">
</span><del>-                                        if ( 1 === REVAPP._right_diff )
-                                                REVAPP._right_diff = 2;
-                                                REVAPP._revisionView.draggingleft = false;
</del><ins>+                                        if ( 1 === REVAPP._rightDiff )
+                                                REVAPP._rightDiff = 2;
+                                                REVAPP._revisionView.draggingLeft = false;
</ins><span class="cx">
</span><span class="cx">                                                 wpRevisionsSettings.revision_id = ''; // reset passed revision id so switching back to one handle mode doesn't re-select revision
</span><del>-                                                REVAPP.reloadleftright();
-                                                REVAPP._revisionView.model = REVAPP._right_handle_revisions;
</del><ins>+                                                REVAPP.reloadLeftRight();
+                                                REVAPP._revisionView.model = REVAPP._rightHandleRevisions;
</ins><span class="cx">
</span><del>-                                        } else { //compare one mode
-                                                REVAPP._compareoneortwo = 1 ;
-                                                REVAPP._revisionView.draggingleft = false;
-                                                //REVAPP._left_diff = 0;
-                                                //REVAPP._right_diff = (REVAPP._revisions.length <= REVAPP._right_diff ) ? REVAPP._right_diff + 1 : REVAPP._right_diff + 1;
-                                                REVAPP.reloadmodelsingle();
</del><ins>+                                        } else { // compare one mode
+                                                REVAPP._compareOneOrTwo = 1 ;
+                                                REVAPP._revisionView.draggingLeft = false;
+                                                // REVAPP._leftDiff = 0;
+                                                // REVAPP._rightDiff = (REVAPP._revisions.length <= REVAPP._rightDiff ) ? REVAPP._rightDiff + 1 : REVAPP._rightDiff + 1;
+                                                REVAPP.reloadModelSingle();
</ins><span class="cx">                                         }
</span><del>-                                        //REVAPP._revisionView.render();
</del><ins>+                                        // REVAPP._revisionView.render();
</ins><span class="cx">                                         REVAPP._revisionsInteractions.render();
</span><span class="cx">                                         REVAPP._tickmarkView.render();
</span><span class="cx">
</span><span class="cx">                         }
</span><span class="cx">                 }),
</span><span class="cx">
</span><del>-                //
-                //options view for show autosaves and show split view options
-                //
</del><ins>+                // options view for show autosaves and show split view options
</ins><span class="cx">                 /* DISABLED for now
</span><del>-                Options : Backbone.View.extend({
-                        el : $('#backbonerevisionsoptions')[0],
-                        tagName : 'revisionoptionsview',
-                        className : 'revisionoptions-container',
-                        template : wp.template('revisionoptions'),
</del><ins>+                Options: Backbone.View.extend({
+                        el: $('#backbonerevisionsoptions')[0],
+                        tagName: 'revisionoptionsview',
+                        className: 'revisionoptions-container',
+                        template: wp.template('revisionoptions'),
</ins><span class="cx">
</span><del>-                        //render the options view
-                        render : function() {
-                                var addhtml = this.template;
-                                this.$el.html( addhtml );
</del><ins>+                        // render the options view
+                        render: function() {
+                                var addHtml = this.template;
+                                this.$el.html( addHtml );
</ins><span class="cx">                                 return this;
</span><span class="cx">                         },
</span><span class="cx">
</span><del>-                        //add options interactions
-                        events : {
-                                'click #toggleshowautosaves' : 'toggleshowautosaves',
-                                'click #showsplitview' : 'showsplitview'
</del><ins>+                        // add options interactions
+                        events: {
+                                'click #toggleshowautosaves': 'toggleshowautosaves',
+                                'click #showsplitview': 'showsplitview'
</ins><span class="cx">                         },
</span><span class="cx">
</span><del>-                        //
-                        //toggle include autosaves
-                        //
-                        toggleshowautosaves : function() {
</del><ins>+                        // toggle include autosaves
+                        toggleshowautosaves: function() {
</ins><span class="cx">                                 var self = this;
</span><span class="cx">                                 if ( $( '#toggleshowautosaves' ).is( ':checked' ) ) {
</span><span class="cx">                                         REVAPP._autosaves = true ;
</span><span class="lines">@@ -564,62 +547,58 @@
</span><span class="cx">                                         REVAPP._autosaves = false ;
</span><span class="cx">                                 }
</span><span class="cx">
</span><del>-                                //refresh the model data
-                                REVAPP.reloadmodel();
</del><ins>+                                // refresh the model data
+                                REVAPP.reloadModel();
</ins><span class="cx">                         },
</span><span class="cx">
</span><del>-                        //
-                        //toggle showing the split diff view
-                        //
-                        showsplitview : function() {
</del><ins>+                        // toggle showing the split diff view
+                        showsplitview: function() {
</ins><span class="cx">                                 var self = this;
</span><span class="cx">
</span><span class="cx">                                 if ( $( 'input#showsplitview' ).is( ':checked' ) ) {
</span><del>-                                        REVAPP._show_split_view = 'true';
</del><ins>+                                        REVAPP._showSplitView = 'true';
</ins><span class="cx">                                         $('.revisiondiffcontainer').addClass('diffsplit');
</span><span class="cx">                                 } else {
</span><del>-                                        REVAPP._show_split_view = '';
</del><ins>+                                        REVAPP._showSplitView = '';
</ins><span class="cx">                                         $('.revisiondiffcontainer').removeClass('diffsplit');
</span><span class="cx">                                 }
</span><span class="cx">
</span><del>-                                REVAPP.reloadmodel();
</del><ins>+                                REVAPP.reloadModel();
</ins><span class="cx">                         }
</span><span class="cx">                 }),
</span><span class="cx">                 */
</span><del>-                //
-                //main interactions view
-                //
-                Interact : Backbone.View.extend({
-                        el : $('#backbonerevisionsinteract')[0],
-                        tagName : 'revisionvinteract',
-                        className : 'revisionvinteract-container',
-                        template : wp.template('revisionvinteract'),
</del><ins>+                // main interactions view
+                Interact: Backbone.View.extend({
+                        el: $('#backbonerevisionsinteract')[0],
+                        tagName: 'revisionvinteract',
+                        className: 'revisionvinteract-container',
+                        template: wp.template('revisionvinteract'),
</ins><span class="cx">
</span><del>-                        initialize : function() {
</del><ins>+                        initialize: function() {
</ins><span class="cx">                         },
</span><span class="cx">
</span><del>-                        render : function() {
</del><ins>+                        render: function() {
</ins><span class="cx">                                 var self = this;
</span><span class="cx">
</span><del>-                                var addhtml = this.template;
-                                this.$el.html( addhtml );
</del><ins>+                                var addHtml = this.template;
+                                this.$el.html( addHtml );
</ins><span class="cx">
</span><span class="cx">                                 var modelcount = REVAPP._revisions.length;
</span><span class="cx">
</span><span class="cx">                                 slider = $( "#slider" );
</span><del>-                                if ( 1 === REVAPP._compareoneortwo ) {
-                                        //set up the slider with a single handle
</del><ins>+                                if ( 1 === REVAPP._compareOneOrTwo ) {
+                                        // set up the slider with a single handle
</ins><span class="cx">                                         slider.slider({
</span><del>-                                                value: REVAPP._right_diff-1,
</del><ins>+                                                value: REVAPP._rightDiff - 1,
</ins><span class="cx">                                                 min: 0,
</span><del>-                                                max: modelcount-1,
</del><ins>+                                                max: modelcount - 1,
</ins><span class="cx">                                                 step: 1,
</span><span class="cx">
</span><span class="cx">
</span><del>-                                                //slide interactions for one handles slider
-                                                slide : function( event, ui ) {
</del><ins>+                                                // slide interactions for one handles slider
+                                                slide: function( event, ui ) {
</ins><span class="cx">
</span><del>-                                                        REVAPP._right_diff = ( ui.value + 1 );
</del><ins>+                                                        REVAPP._rightDiff = ( ui.value + 1 );
</ins><span class="cx">                                                         REVAPP._revisionView.render();
</span><span class="cx">                                                         /*
</span><span class="cx">                                                         $( 'a.ui-slider-handle' ).tooltip( {
</span><span class="lines">@@ -635,82 +614,82 @@
</span><span class="cx">                                                                         .appendTo( this );
</span><span class="cx">                                                                         }
</span><span class="cx">                                                                 }
</span><del>-                                                        });//.trigger( 'close' ).trigger( 'open' );
</del><ins>+                                                        });// .trigger( 'close' ).trigger( 'open' );
</ins><span class="cx"> */
</span><span class="cx">                                                         }
</span><span class="cx">                                         });
</span><span class="cx">                                         $( '.revisiondiffcontainer' ).removeClass( 'comparetwo' );
</span><span class="cx">
</span><del>-                                } else { //comparing more than one, eg 2
-                                        //set up the slider with two handles
</del><ins>+                                } else { // comparing more than one, eg 2
+                                        // set up the slider with two handles
</ins><span class="cx">                                         slider.slider({
</span><del>-                                                values : [ REVAPP._left_diff, REVAPP._right_diff + 1 ],
-                                                min : 1,
-                                                max : modelcount+1,
-                                                step : 1,
</del><ins>+                                                values: [ REVAPP._leftDiff, REVAPP._rightDiff + 1 ],
+                                                min: 1,
+                                                max: modelcount + 1,
+                                                step: 1,
</ins><span class="cx">                                                 range: true,
</span><span class="cx">
</span><del>-                                                //in two handled mode when user starts dragging, swap in precalculated diff for handle
-                                                start : function (event, ui ) {
-                                                        var index = $( ui.handle ).index(); //0 (left) or 1 (right)
</del><ins>+                                                // in two handled mode when user starts dragging, swap in precalculated diff for handle
+                                                start: function(event, ui ) {
+                                                        var index = $( ui.handle ).index(); // 0 (left) or 1 (right)
</ins><span class="cx">                                                         switch ( index ) {
</span><del>-                                                                case 1: //left handle drag
-                                                                        if ( REVAPP._left_model_loading ) //left model still loading, prevent sliding left handle
</del><ins>+                                                                case 1: // left handle drag
+                                                                        if ( REVAPP._leftModelLoading ) // left model still loading, prevent sliding left handle
</ins><span class="cx">                                                                                 return false;
</span><span class="cx">
</span><del>-                                                                        REVAPP._revisionView.draggingleft = true;
</del><ins>+                                                                        REVAPP._revisionView.draggingLeft = true;
</ins><span class="cx">
</span><del>-                                                                        if ( REVAPP._revisionView.model !== REVAPP._left_handle_revisions &&
-                                                                                        null !== REVAPP._left_handle_revisions ) {
-                                                                                REVAPP._revisionView.model = REVAPP._left_handle_revisions;
-                                                                                REVAPP._tickmarkView.model = REVAPP._left_handle_revisions;
</del><ins>+                                                                        if ( REVAPP._revisionView.model !== REVAPP._leftHandleRevisions &&
+                                                                                        null !== REVAPP._leftHandleRevisions ) {
+                                                                                REVAPP._revisionView.model = REVAPP._leftHandleRevisions;
+                                                                                REVAPP._tickmarkView.model = REVAPP._leftHandleRevisions;
</ins><span class="cx">                                                                                 REVAPP._tickmarkView.render();
</span><span class="cx">                                                                         }
</span><span class="cx">
</span><del>-                                                                        REVAPP._left_diff_start = ui.values[ 0 ];
</del><ins>+                                                                        REVAPP._leftDiffStart = ui.values[ 0 ];
</ins><span class="cx">                                                                         break;
</span><span class="cx">
</span><del>-                                                                case 2: //right
-                                                                        if ( REVAPP._right_model_loading || 0 === REVAPP._right_handle_revisions.length) //right model still loading, prevent sliding right handle
</del><ins>+                                                                case 2: // right
+                                                                        if ( REVAPP._rightModelLoading || 0 === REVAPP._rightHandleRevisions.length) // right model still loading, prevent sliding right handle
</ins><span class="cx">                                                                                 return false;
</span><span class="cx">
</span><del>-                                                                        if ( REVAPP._revisionView.model !== REVAPP._right_handle_revisions &&
-                                                                                        null !== REVAPP._right_handle_revisions ) {
-                                                                                REVAPP._revisionView.model = REVAPP._right_handle_revisions;
-                                                                                REVAPP._tickmarkView.model = REVAPP._right_handle_revisions;
</del><ins>+                                                                        if ( REVAPP._revisionView.model !== REVAPP._rightHandleRevisions &&
+                                                                                        null !== REVAPP._rightHandleRevisions ) {
+                                                                                REVAPP._revisionView.model = REVAPP._rightHandleRevisions;
+                                                                                REVAPP._tickmarkView.model = REVAPP._rightHandleRevisions;
</ins><span class="cx">                                                                                 REVAPP._tickmarkView.render();
</span><span class="cx">                                                                         }
</span><span class="cx">
</span><del>-                                                                        REVAPP._revisionView.draggingleft = false;
-                                                                        REVAPP._right_diff_start = ui.values[ 1 ];
</del><ins>+                                                                        REVAPP._revisionView.draggingLeft = false;
+                                                                        REVAPP._rightDiffStart = ui.values[1];
</ins><span class="cx">                                                                         break;
</span><span class="cx">                                                         }
</span><span class="cx">                                                 },
</span><span class="cx">
</span><del>-                                                //when sliding in two handled mode change appropriate value
-                                                slide : function( event, ui ) {
-                                                        if ( ui.values[ 0 ] === ui.values[ 1 ] ) //prevent compare to self
</del><ins>+                                                // when sliding in two handled mode change appropriate value
+                                                slide: function( event, ui ) {
+                                                        if ( ui.values[0] === ui.values[1] ) // prevent compare to self
</ins><span class="cx">                                                                 return false;
</span><span class="cx">
</span><del>-                                                        var index = $( ui.handle ).index(); //0 (left) or 1 (right)
</del><ins>+                                                        var index = $( ui.handle ).index(); // 0 (left) or 1 (right)
</ins><span class="cx">
</span><span class="cx">                                                         switch ( index ) {
</span><del>-                                                                case 1: //left
-                                                                        if ( REVAPP._left_model_loading ) //left model still loading, prevent sliding left handle
</del><ins>+                                                                case 1: // left
+                                                                        if ( REVAPP._leftModelLoading ) // left model still loading, prevent sliding left handle
</ins><span class="cx">                                                                                 return false;
</span><span class="cx">
</span><del>-                                                                        REVAPP._left_diff = ui.values[ 0 ];
</del><ins>+                                                                        REVAPP._leftDiff = ui.values[0];
</ins><span class="cx">                                                                         break;
</span><span class="cx">
</span><del>-                                                                case 2: //right
-                                                                        if ( REVAPP._right_model_loading ) //right model still loading, prevent sliding right handle
</del><ins>+                                                                case 2: // right
+                                                                        if ( REVAPP._rightModelLoading ) // right model still loading, prevent sliding right handle
</ins><span class="cx">                                                                                 return false;
</span><span class="cx">
</span><del>-                                                                        REVAPP._right_diff = ui.values[ 1 ];
</del><ins>+                                                                        REVAPP._rightDiff = ui.values[1];
</ins><span class="cx">                                                                         break;
</span><span class="cx">                                                         }
</span><span class="cx">
</span><del>-                                                        if ( 0 === REVAPP._left_diff ) {
</del><ins>+                                                        if ( 0 === REVAPP._leftDiff ) {
</ins><span class="cx">                                                                 $( '.revisiondiffcontainer' ).addClass( 'currentversion' );
</span><span class="cx">
</span><span class="cx">                                                         } else {
</span><span class="lines">@@ -721,28 +700,28 @@
</span><span class="cx">
</span><span class="cx">                                                 },
</span><span class="cx">
</span><del>-                                                //when the user stops sliding in 2 handle mode, recalculate diffs
-                                                stop : function( event, ui ) {
-                                                        if ( 2 === REVAPP._compareoneortwo ) {
-                                                                //calculate and generate a diff for comparing to the left handle
-                                                                //and the right handle, swap out when dragging
</del><ins>+                                                // when the user stops sliding in 2 handle mode, recalculate diffs
+                                                stop: function( event, ui ) {
+                                                        if ( 2 === REVAPP._compareOneOrTwo ) {
+                                                                // calculate and generate a diff for comparing to the left handle
+                                                                // and the right handle, swap out when dragging
</ins><span class="cx">
</span><del>-                                                                var index = $( ui.handle ).index(); //0 (left) or 1 (right)
</del><ins>+                                                                var index = $( ui.handle ).index(); // 0 (left) or 1 (right)
</ins><span class="cx">
</span><span class="cx">                                                                 switch ( index ) {
</span><del>-                                                                        case 1: //left
</del><ins>+                                                                        case 1: // left
</ins><span class="cx">
</span><del>-                                                                                //left handle dragged & changed, reload right handle model
-                                                                                if ( REVAPP._left_diff_start !== ui.values[ 0 ] )
-                                                                                        REVAPP.reloadright();
</del><ins>+                                                                                // left handle dragged & changed, reload right handle model
+                                                                                if ( REVAPP._leftDiffStart !== ui.values[0] )
+                                                                                        REVAPP.reloadRight();
</ins><span class="cx">
</span><span class="cx">                                                                                 break;
</span><span class="cx">
</span><del>-                                                                        case 2: //right
-                                                                                //REVAPP._right_diff = ( 1 >= REVAPP._right_diff ) ? 1 : REVAPP._right_diff-1;
-                                                                                //right handle dragged & changed, reload left handle model if changed
-                                                                                if ( REVAPP._right_diff_start !== ui.values[ 1 ] )
-                                                                                        REVAPP.reloadleft();
</del><ins>+                                                                        case 2: // right
+                                                                                // REVAPP._rightDiff = ( 1 >= REVAPP._rightDiff ) ? 1 : REVAPP._rightDiff - 1;
+                                                                                // right handle dragged & changed, reload left handle model if changed
+                                                                                if ( REVAPP._rightDiffStart !== ui.values[1] )
+                                                                                        REVAPP.reloadLeft();
</ins><span class="cx">
</span><span class="cx">                                                                                 break;
</span><span class="cx">                                                                 }
</span><span class="lines">@@ -756,35 +735,35 @@
</span><span class="cx">                                 return this;
</span><span class="cx">                         },
</span><span class="cx">
</span><del>-                        //next and previous buttons, only available in compare one mode
-                        events : {
-                                'click #next' : 'nextrevision',
-                                'click #previous' : 'previousrevision'
</del><ins>+                        // next and previous buttons, only available in compare one mode
+                        events: {
+                                'click #next': 'nextRevision',
+                                'click #previous': 'previousRevision'
</ins><span class="cx">                         },
</span><span class="cx">
</span><del>-                        //go to the next revision
-                        nextrevision : function() {
-                                if ( REVAPP._right_diff < this.model.length ) //unless at right boundry
-                                        REVAPP._right_diff = REVAPP._right_diff + 1 ;
</del><ins>+                        // go to the next revision
+                        nextRevision: function() {
+                                if ( REVAPP._rightDiff < this.model.length ) // unless at right boundry
+                                        REVAPP._rightDiff = REVAPP._rightDiff + 1 ;
</ins><span class="cx">
</span><span class="cx">                                 REVAPP._revisionView.render();
</span><span class="cx">
</span><del>-                                $( '#slider' ).slider( 'value', REVAPP._right_diff - 1 ).trigger( 'slide' );
</del><ins>+                                $( '#slider' ).slider( 'value', REVAPP._rightDiff - 1 ).trigger( 'slide' );
</ins><span class="cx">                         },
</span><span class="cx">
</span><del>-                        //go the the previous revision
-                        previousrevision : function() {
-                                if ( REVAPP._right_diff > 1 ) //unless at left boundry
-                                                REVAPP._right_diff = REVAPP._right_diff - 1 ;
</del><ins>+                        // go the the previous revision
+                        previousRevision: function() {
+                                if ( REVAPP._rightDiff > 1 ) // unless at left boundry
+                                        REVAPP._rightDiff = REVAPP._rightDiff - 1 ;
</ins><span class="cx">
</span><span class="cx">                                 REVAPP._revisionView.render();
</span><span class="cx">
</span><del>-                                $( '#slider' ).slider( 'value', REVAPP._right_diff - 1 ).trigger( 'slide' );
</del><ins>+                                $( '#slider' ).slider( 'value', REVAPP._rightDiff - 1 ).trigger( 'slide' );
</ins><span class="cx">                         }
</span><span class="cx">                 })
</span><span class="cx">         });
</span><span class="cx">
</span><del>-        //instantiate Revision Application
</del><ins>+        // instantiate Revision Application
</ins><span class="cx">         REVAPP = new wp.revisions.App();
</span><span class="cx">
</span><span class="cx"> }(jQuery));
</span></span></pre>
</div>
</div>
</body>
</html>