HEX
Server: Apache
System: Linux webm005.cluster121.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: adventp (418412)
PHP: 7.4.33
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/adventp/www/wp-content/plugins/js_composer/assets/js/lib/undoredo/undoredo-ui-backend.js
(function ( $ ) {
	'use strict';

	$( function () {
		if ( window.vc && window.vc.events ) {
			var $undoControl, $redoControl, renderNewContent, checkControls;
			$undoControl = $( '#vc_navbar-undo' );
			$redoControl = $( '#vc_navbar-redo' );

			checkControls = function () {
				$undoControl.attr( 'disabled', !window.vc.undoRedoApi.canUndo() );
				$redoControl.attr( 'disabled', !window.vc.undoRedoApi.canRedo() );
			};

			renderNewContent = function ( content ) {
				vc.storage.setContent( content );
				vc.shortcodes.fetch( { reset: true } );

				_.delay( function () {
					window.vc.undoRedoApi.unlock();
				}, 50 );
			};

			window.vc.events.on( 'undoredo:add undoredo:undo undoredo:redo undoredo:lock undoredo:unlock', _.debounce( checkControls, 150 ) );

			$undoControl.on( 'click.vc-undo', function ( e ) {
				if ( $( this ).is( '[disabled]' ) || window.vc.undoRedoApi.isLocked() ) {
					if ( e && e.preventDefault ) {
						e.preventDefault();
					}
					return;
				}
				vc.closeActivePanel();
				window.vc.undoRedoApi.lock();
				var newContent = window.vc.undoRedoApi.undo();

				renderNewContent( newContent );
			} );
			$redoControl.on( 'click.vc-redo', function ( e ) {
				if ( $( this ).is( '[disabled]' ) || window.vc.undoRedoApi.isLocked() ) {
					if ( e && e.preventDefault ) {
						e.preventDefault();
					}
					return;
				}
				vc.closeActivePanel();
				window.vc.undoRedoApi.lock();
				var newContent = window.vc.undoRedoApi.redo();

				renderNewContent( newContent );
			} );
		}
	} );
})( window.jQuery );