function HistoryWidget(div, tabHeader) { this._div = div; this._tabHeader = tabHeader; this.update(); } HistoryWidget.prototype.resize = function() { var body = this._div.find(".history-panel-body"); var footer = this._div.find(".history-panel-footer"); var bodyPaddings = body.outerHeight(true) - body.height(); body.css("height", (this._div.height() - footer.outerHeight(true) - bodyPaddings) + "px"); }; HistoryWidget.prototype.update = function(onDone) { var self = this; Ajax.chainGetJSON( "/command/get-history?" + $.param({ project: theProject.id }), null, function(data) { self._data = data; self._render(); if (onDone) { onDone(); } } ); }; HistoryWidget.prototype._render = function() { var self = this; this._tabHeader.html('Undo/Redo ' + this._data.past.length + ''); this._div .empty() .unbind() .html( '
about making mistakes. Every change you make will be shown here, and you can undo changes at any point.
' + '' + '' + 'The following JSON code encodes the operations you have done that can be abstracted. ' + 'You can copy and save it in order to apply the same operations in the future.' + ' | |
' +
' | ' +
'' + '' + ' | ' + '
' + 'Paste the JSON code encoding the operations to perform.' + ' |
' + '' + ' |