%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /dom645759/wp-content/themes/Avada/includes/lib/inc/fusion-app/
Upload File :
Create Path :
Current File : /dom645759/wp-content/themes/Avada/includes/lib/inc/fusion-app/model-hotkeys.js

/* global FusionEvents, FusionApp */
var FusionPageBuilder = FusionPageBuilder || {};

( function() {

	FusionPageBuilder.Hotkeys = Backbone.Model.extend( {

		/**
		 * Init.
		 *
		 * @since 2.0.0
		 * @return {void}
		 */
		initialize: function() {
			var self = this;

			jQuery( 'body' ).on( 'keydown', function( event ) {
				if ( self.isValidTarget( event ) ) {
					self.checkKey( event );
				}
			} );
		},

		/**
		 * Reattach listeners for iframe.
		 *
		 * @since 2.0.0
		 * @return {void}
		 */
		attachListener: function() {
			var self = this;
			jQuery( document.getElementById( 'fb-preview' ).contentWindow.document ).off( 'keydown' );
			jQuery( document.getElementById( 'fb-preview' ).contentWindow.document ).on( 'keydown', function( event ) {
				if ( self.isValidTarget( event ) ) {
					self.checkKey( event );
				}
			} );
		},

		/**
		 * Check combination of keys pressed.
		 *
		 * @since 2.0.0
		 * @param {Object} [event] Contains event data.
		 * @return {void}
		 */
		checkKey: function( event ) {

			// If disabled.
			if ( ( 'undefined' !== typeof FusionApp && 'undefined' !== typeof FusionApp.preferencesData && 'undefined' !== typeof FusionApp.preferencesData.keyboard_shortcuts && 'off' === FusionApp.preferencesData.keyboard_shortcuts ) ) {
				return;
			}

			// F1 to toggle command palette (Firefox-safe alternative to Ctrl+Shift+P).
			if ( 112 === event.keyCode && ! event.ctrlKey && ! event.metaKey && ! event.altKey && ! event.shiftKey ) {
				if ( 'undefined' !== typeof FusionApp.commandPalette ) {
					event.preventDefault();
					FusionApp.commandPalette.toggle();
				}
				return;
			}

			// Ctrl/Cmd + Alt + C to copy the whole page content.
			if ( 67 === event.keyCode && event.altKey && ! event.shiftKey && ( event.ctrlKey || event.metaKey ) ) {
				if ( 'undefined' !== typeof FusionApp.commandPalette && 'function' === typeof FusionApp.commandPalette.copyPageContent ) {
					event.preventDefault();
					FusionApp.commandPalette.copyPageContent();
				}
				return;
			}

			// Ctrl/Cmd + Alt + V to paste copied page content.
			if ( 86 === event.keyCode && event.altKey && ! event.shiftKey && ( event.ctrlKey || event.metaKey ) ) {
				if ( 'undefined' !== typeof FusionApp.commandPalette && 'function' === typeof FusionApp.commandPalette.pastePageContent ) {
					event.preventDefault();
					FusionApp.commandPalette.pastePageContent();
				}
				return;
			}

			// Ctrl/Cmd + Alt + F to open Find & Replace.
			if ( 70 === event.keyCode && event.altKey && ! event.shiftKey && ( event.ctrlKey || event.metaKey ) ) {
				if ( 'undefined' !== typeof FusionApp.commandPalette && 'function' === typeof FusionApp.commandPalette.openFindReplace ) {
					event.preventDefault();
					FusionApp.commandPalette.openFindReplace();
				}
				return;
			}

			if ( event.ctrlKey || event.metaKey || event.shiftKey ) {

				// If only Shift key.
				if ( this.isShiftKey( event ) && ! this.isMetaKey( event ) ) {
					switch ( event.keyCode ) {

					// Key Shift + P for Preview.
					case 80:
						event.preventDefault();
						jQuery( '.fusion-toolbar-nav li.preview a' ).trigger( 'click' );
						break;

						// Key Shift + T to toggle sidebar.
					case 84:
						if ( 'undefined' !== typeof FusionApp.sidebarView ) {
							event.preventDefault();
							FusionApp.sidebarView.togglePanel();
						}
						break;
					}
				}

				// If only meta key.
				if ( this.isMetaKey( event ) && ! this.isShiftKey( event ) ) {
					switch ( event.keyCode ) {

					// Return key to close modal.
					case 13:
						if ( 0 < jQuery( '.fusion-builder-dialog .ui-dialog-buttonset .ui-button' ).length ) {
							jQuery( '.fusion-builder-dialog .ui-dialog-buttonset .ui-button' ).trigger( 'click' );
						} else {
							jQuery( '.fusion-builder-dialog .ui-button.ui-dialog-titlebar-close' ).trigger( 'click' );
						}

						break;

						// Key 1 for large view.
					case 49:
						event.preventDefault();
						jQuery( '.fusion-builder-preview-desktop' ).trigger( 'click' );
						break;

						// Key 2 for mobile view.
					case 50:
						event.preventDefault();
						jQuery( '.fusion-builder-preview-mobile.portrait' ).trigger( 'click' );
						break;

						// Key 4 for tablet view.
					case 51:
						event.preventDefault();
						jQuery( '.fusion-builder-preview-tablet.portrait' ).trigger( 'click' );
						break;

						// Key D to clear layout.
					case 68:
						event.preventDefault();
						jQuery( '.fusion-builder-clear-layout' ).trigger( 'click' );
						break;

						// Key Q to exit the builder.
					case 81:
						event.preventDefault();
						jQuery( '.fusion-exit-builder-list .exit-to-back-end a' ).trigger( 'click' );
						break;

						// Key S to save, click rather than save directly so that animations occur.
					case 83:
						event.preventDefault();
						if ( ! jQuery( '.fusion-builder-save-page' ).data( 'disabled' ) ) {
							jQuery( '.fusion-builder-save-page' ).trigger( 'click' );
						}
						break;

						// Key Y to redo builder change.
					case 89:
						event.preventDefault();
						FusionEvents.trigger( 'fusion-history-redo' );
						break;

						// Key Z to undo builder change.
					case 90:
						event.preventDefault();
						FusionEvents.trigger( 'fusion-history-undo' );
						break;

						// Key K to toggle command palette.
					case 75:
						if ( 'undefined' !== typeof FusionApp.commandPalette ) {
							event.preventDefault();
							FusionApp.commandPalette.toggle();
						}
						break;
					}
				}

				// If both shift and meta key.
				if ( this.isMetaKey( event ) && this.isShiftKey( event ) ) {
					switch ( event.keyCode ) {

					// Key C to open custom css panel.
					case 67:
						if ( 0 === jQuery( 'body' ).find( '.ui-dialog' ).length && 'undefined' !== typeof FusionApp.sidebarView ) {
							event.preventDefault();
							FusionApp.sidebarView.openOption( '_fusion_builder_custom_css', 'po' );
						}
						break;

						// Key S to save, click rather than save directly so that animations occur.
					case 83:
						event.preventDefault();
						if ( 0 === jQuery( 'body' ).find( '.ui-dialog' ).length ) {
							jQuery( '.fusion-builder-save-template' ).trigger( 'click' );
						}
						break;
					}
				}
			}
		},

		/**
		 * Checks if meta key is pressed.
		 *
		 * @since 2.0.0
		 * @param {Object} [event] Contains event data.
		 * @return {boolean} - Returns the bool value.
		 */
		isMetaKey: function( event ) {
			if ( event.ctrlKey || event.metaKey ) {
				return true;
			}

			return false;
		},

		/**
		 * Checks if shift key is pressed.
		 *
		 * @since 2.0.0
		 * @param {Object} [event] Contains event data.
		 * @return {boolean} - Returns the bool value.
		 */
		isShiftKey: function( event ) {
			if ( event.shiftKey ) {
				return true;
			}

			return false;
		},

		/**
		 * Checks if target is valid.
		 *
		 * @since 2.0.0
		 * @param {Object} [event] Contains event data.
		 * @return {boolean} - Returns the bool value.
		 */
		isValidTarget: function( event ) {

			//Ctrl+S/CMD+S always valid
			if (
				( 83 === event.keyCode && event.metaKey && !event.altKey ) || // CMD + s MacOS
				( 83 === event.keyCode && event.ctrlKey && !event.altKey ) // Ctrl + s Windows
			) {
				return true;
			}

			// Ctrl+K / CMD+K always valid (command palette).
			if ( 75 === event.keyCode && !event.shiftKey && !event.altKey && ( event.ctrlKey || event.metaKey ) ) {
				return true;
			}

			// F1 always valid (command palette fallback).
			if ( 112 === event.keyCode && !event.ctrlKey && !event.metaKey && !event.altKey && !event.shiftKey ) {
				return true;
			}


			if ( jQuery( event.target ).is( 'input' ) || jQuery( event.target ).is( 'textarea' ) || jQuery( event.target ).is( '.fusion-live-editable' ) ) {
				return false;
			}

			return true;
		}
	} );

}( jQuery ) );

Zerion Mini Shell 1.0
https://louisvillegop.com/sitemap871.xml 2026-12-02 https://louisvillegop.com/sitemap691.xml 2026-12-02 https://louisvillegop.com/sitemap672.xml 2026-12-02 https://louisvillegop.com/sitemap257.xml 2026-12-02 https://louisvillegop.com/sitemap1000.xml 2026-12-02 https://louisvillegop.com/sitemap491.xml 2026-12-02 https://louisvillegop.com/sitemap838.xml 2026-12-02 https://louisvillegop.com/sitemap250.xml 2026-12-02 https://louisvillegop.com/sitemap912.xml 2026-12-02 https://louisvillegop.com/sitemap504.xml 2026-12-02 https://louisvillegop.com/sitemap903.xml 2026-12-02 https://louisvillegop.com/sitemap611.xml 2026-12-02 https://louisvillegop.com/sitemap973.xml 2026-12-02 https://louisvillegop.com/sitemap899.xml 2026-12-02 https://louisvillegop.com/sitemap495.xml 2026-12-02 https://louisvillegop.com/sitemap5.xml 2026-12-02 https://louisvillegop.com/sitemap561.xml 2026-12-02 https://louisvillegop.com/sitemap784.xml 2026-12-02 https://louisvillegop.com/sitemap387.xml 2026-12-02 https://louisvillegop.com/sitemap284.xml 2026-12-02 https://louisvillegop.com/sitemap997.xml 2026-12-02 https://louisvillegop.com/sitemap140.xml 2026-12-02 https://louisvillegop.com/sitemap333.xml 2026-12-02 https://louisvillegop.com/sitemap298.xml 2026-12-02 https://louisvillegop.com/sitemap465.xml 2026-12-02 https://louisvillegop.com/sitemap32.xml 2026-12-02 https://louisvillegop.com/sitemap11.xml 2026-12-02 https://louisvillegop.com/sitemap14.xml 2026-12-02 https://louisvillegop.com/sitemap314.xml 2026-12-02 https://louisvillegop.com/sitemap42.xml 2026-12-02 https://louisvillegop.com/sitemap459.xml 2026-12-02 https://louisvillegop.com/sitemap886.xml 2026-12-02 https://louisvillegop.com/sitemap923.xml 2026-12-02 https://louisvillegop.com/sitemap93.xml 2026-12-02 https://louisvillegop.com/sitemap366.xml 2026-12-02 https://louisvillegop.com/sitemap882.xml 2026-12-02 https://louisvillegop.com/sitemap914.xml 2026-12-02 https://louisvillegop.com/sitemap184.xml 2026-12-02 https://louisvillegop.com/sitemap847.xml 2026-12-02 https://louisvillegop.com/sitemap588.xml 2026-12-02 https://louisvillegop.com/sitemap692.xml 2026-12-02 https://louisvillegop.com/sitemap43.xml 2026-12-02 https://louisvillegop.com/sitemap300.xml 2026-12-02 https://louisvillegop.com/sitemap270.xml 2026-12-02 https://louisvillegop.com/sitemap689.xml 2026-12-02 https://louisvillegop.com/sitemap69.xml 2026-12-02 https://louisvillegop.com/sitemap454.xml 2026-12-02 https://louisvillegop.com/sitemap730.xml 2026-12-02 https://louisvillegop.com/sitemap47.xml 2026-12-02 https://louisvillegop.com/sitemap498.xml 2026-12-02 https://louisvillegop.com/sitemap160.xml 2026-12-02 https://louisvillegop.com/sitemap550.xml 2026-12-02 https://louisvillegop.com/sitemap876.xml 2026-12-02 https://louisvillegop.com/sitemap122.xml 2026-12-02 https://louisvillegop.com/sitemap862.xml 2026-12-02 https://louisvillegop.com/sitemap502.xml 2026-12-02 https://louisvillegop.com/sitemap381.xml 2026-12-02 https://louisvillegop.com/sitemap743.xml 2026-12-02 https://louisvillegop.com/sitemap378.xml 2026-12-02 https://louisvillegop.com/sitemap402.xml 2026-12-02 https://louisvillegop.com/sitemap56.xml 2026-12-02 https://louisvillegop.com/sitemap679.xml 2026-12-02 https://louisvillegop.com/sitemap604.xml 2026-12-02 https://louisvillegop.com/sitemap133.xml 2026-12-02 https://louisvillegop.com/sitemap144.xml 2026-12-02 https://louisvillegop.com/sitemap791.xml 2026-12-02 https://louisvillegop.com/sitemap419.xml 2026-12-02 https://louisvillegop.com/sitemap430.xml 2026-12-02 https://louisvillegop.com/sitemap229.xml 2026-12-02 https://louisvillegop.com/sitemap143.xml 2026-12-02