| @@ -8,9 +8,9 @@ | ||
| 8 | 8 | use Elementor\Core\Common\Modules\Ajax\Module as Ajax; |
| 9 | 9 | use Elementor\Utils; |
| 10 | 10 | |
| 11 | 11 | if ( ! defined( 'ABSPATH' ) ) { |
| 12 | - exit; // Exit if accessed directly. | |
| 12 | + exit; // Exit if accessed directly | |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | 15 | class Module extends \Elementor\Core\Base\Module { |
| 16 | 16 | |
| @@ -64,9 +64,9 @@ | ||
| 64 | 64 | return $value; |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | /** |
| 68 | - * @throws \Exception If the safe mode cannot be enabled. | |
| 68 | + * @throws \Exception | |
| 69 | 69 | */ |
| 70 | 70 | public function ajax_enable_safe_mode( $data ) { |
| 71 | 71 | if ( ! current_user_can( 'install_plugins' ) ) { |
| 72 | 72 | throw new \Exception( 'Access denied.' ); |
| @@ -154,15 +154,11 @@ | ||
| 154 | 154 | <style> |
| 155 | 155 | .elementor-safe-mode-toast { |
| 156 | 156 | position: absolute; |
| 157 | 157 | z-index: 10000; /* Over the loading layer */ |
| 158 | - inset-block-end: 10px; | |
| 159 | - inset-inline-end: 10px; | |
| 158 | + bottom: 10px; | |
| 160 | 159 | width: 400px; |
| 161 | 160 | line-height: 30px; |
| 162 | - display: flex; | |
| 163 | - flex-direction: column; | |
| 164 | - gap: 20px; | |
| 165 | 161 | color: var(--e-a-color-txt); |
| 166 | 162 | background: var(--e-a-bg-default); |
| 167 | 163 | padding: 20px 25px 25px; |
| 168 | 164 | box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15); |
| @@ -169,8 +165,16 @@ | ||
| 169 | 165 | border-radius: 5px; |
| 170 | 166 | font-family: var(--e-a-font-family); |
| 171 | 167 | } |
| 172 | 168 | |
| 169 | + body.rtl .elementor-safe-mode-toast { | |
| 170 | + left: 10px; | |
| 171 | + } | |
| 172 | + | |
| 173 | + body:not(.rtl) .elementor-safe-mode-toast { | |
| 174 | + right: 10px; | |
| 175 | + } | |
| 176 | + | |
| 173 | 177 | #elementor-try-safe-mode { |
| 174 | 178 | display: none; |
| 175 | 179 | } |
| 176 | 180 | |
| @@ -185,38 +189,58 @@ | ||
| 185 | 189 | |
| 186 | 190 | .elementor-safe-mode-toast .elementor-toast-content hr { |
| 187 | 191 | margin: 15px auto; |
| 188 | 192 | border: 0 none; |
| 189 | - border-block-start: var(--e-a-border); | |
| 193 | + border-top: var(--e-a-border); | |
| 190 | 194 | } |
| 191 | 195 | |
| 192 | 196 | .elementor-safe-mode-toast header { |
| 193 | 197 | display: flex; |
| 194 | 198 | align-items: center; |
| 195 | - gap: 10px; | |
| 199 | + justify-content: space-between; | |
| 200 | + flex-wrap: wrap; | |
| 201 | + margin-bottom: 20px; | |
| 196 | 202 | } |
| 197 | 203 | |
| 204 | + .elementor-safe-mode-toast header > * { | |
| 205 | + margin-top: 10px; | |
| 206 | + } | |
| 207 | + | |
| 198 | 208 | .elementor-safe-mode-toast header i { |
| 199 | 209 | font-size: 25px; |
| 200 | 210 | color: var(--e-a-color-warning); |
| 201 | 211 | } |
| 202 | 212 | |
| 213 | + body:not(.rtl) .elementor-safe-mode-toast header i { | |
| 214 | + margin-right: 10px; | |
| 215 | + } | |
| 216 | + | |
| 217 | + body.rtl .elementor-safe-mode-toast header i { | |
| 218 | + margin-left: 10px; | |
| 219 | + } | |
| 220 | + | |
| 203 | 221 | .elementor-safe-mode-toast header h2 { |
| 204 | 222 | flex-grow: 1; |
| 205 | 223 | font-size: 18px; |
| 206 | 224 | } |
| 207 | 225 | |
| 208 | - .elementor-safe-mode-list { | |
| 209 | - display: flex; | |
| 210 | - flex-direction: column; | |
| 211 | - gap: 10px; | |
| 226 | + .elementor-safe-mode-list-item { | |
| 227 | + margin-top: 10px; | |
| 228 | + list-style: outside; | |
| 212 | 229 | } |
| 213 | 230 | |
| 214 | - .elementor-safe-mode-list-item { | |
| 215 | - margin-inline-start: 15px; | |
| 216 | - list-style: outside; | |
| 231 | + body:not(.rtl) .elementor-safe-mode-list-item { | |
| 232 | + margin-left: 15px; | |
| 217 | 233 | } |
| 218 | 234 | |
| 235 | + body.rtl .elementor-safe-mode-list-item { | |
| 236 | + margin-right: 15px; | |
| 237 | + } | |
| 238 | + | |
| 239 | + .elementor-safe-mode-list-item b { | |
| 240 | + font-size: 14px; | |
| 241 | + } | |
| 242 | + | |
| 219 | 243 | .elementor-safe-mode-list-item-content { |
| 220 | 244 | font-style: italic; |
| 221 | 245 | color: var(--e-a-color-txt); |
| 222 | 246 | } |
| @@ -227,9 +251,9 @@ | ||
| 227 | 251 | |
| 228 | 252 | .elementor-safe-mode-mu-plugins { |
| 229 | 253 | background-color: var(--e-a-bg-hover); |
| 230 | 254 | color: var(--e-a-color-txt-hover); |
| 231 | - margin-block-start: 20px; | |
| 255 | + margin-top: 20px; | |
| 232 | 256 | padding: 10px 15px; |
| 233 | 257 | } |
| 234 | 258 | </style> |
| 235 | 259 | <?php |
| @@ -239,9 +263,9 @@ | ||
| 239 | 263 | $this->print_safe_mode_css() |
| 240 | 264 | ?> |
| 241 | 265 | <div class="elementor-safe-mode-toast" id="elementor-safe-mode-message"> |
| 242 | 266 | <header> |
| 243 | - <i class="eicon-warning" aria-hidden="true"></i> | |
| 267 | + <i class="eicon-warning"></i> | |
| 244 | 268 | <h2><?php echo esc_html__( 'Safe Mode ON', 'elementor' ); ?></h2> |
| 245 | 269 | <a class="elementor-button elementor-safe-mode-button elementor-disable-safe-mode" target="_blank" href="<?php echo esc_url( $this->get_admin_page_url() ); ?>"> |
| 246 | 270 | <?php echo esc_html__( 'Disable Safe Mode', 'elementor' ); ?> |
| 247 | 271 | </a> |
| @@ -317,9 +341,9 @@ | ||
| 317 | 341 | location.replace( location.href.replace( '&elementor-mode=safe', '' ) ); |
| 318 | 342 | } |
| 319 | 343 | }, |
| 320 | 344 | error: function() { |
| 321 | - alert( 'An error occurred.' ); | |
| 345 | + alert( 'An error occurred' ); | |
| 322 | 346 | }, |
| 323 | 347 | }, |
| 324 | 348 | true |
| 325 | 349 | ); |
| @@ -347,9 +371,9 @@ | ||
| 347 | 371 | ?> |
| 348 | 372 | <div class="elementor-safe-mode-toast" id="elementor-try-safe-mode"> |
| 349 | 373 | <?php if ( current_user_can( 'install_plugins' ) ) : ?> |
| 350 | 374 | <header> |
| 351 | - <i class="eicon-warning" aria-hidden="true"></i> | |
| 375 | + <i class="eicon-warning"></i> | |
| 352 | 376 | <h2><?php echo esc_html__( 'Can\'t Edit?', 'elementor' ); ?></h2> |
| 353 | 377 | <a class="elementor-button e-primary elementor-safe-mode-button elementor-enable-safe-mode" target="_blank" href="<?php echo esc_url( $this->get_admin_page_url() ); ?>"> |
| 354 | 378 | <?php echo esc_html__( 'Enable Safe Mode', 'elementor' ); ?> |
| 355 | 379 | </a> |
| @@ -359,9 +383,9 @@ | ||
| 359 | 383 | <a href="<?php Utils::print_unescaped_internal_string( self::DOCS_TRY_SAFE_MODE_URL ); ?>" target="_blank"><?php echo esc_html__( 'Learn More', 'elementor' ); ?></a> |
| 360 | 384 | </div> |
| 361 | 385 | <?php else : ?> |
| 362 | 386 | <header> |
| 363 | - <i class="eicon-warning" aria-hidden="true"></i> | |
| 387 | + <i class="eicon-warning"></i> | |
| 364 | 388 | <h2><?php echo esc_html__( 'Can\'t Edit?', 'elementor' ); ?></h2> |
| 365 | 389 | </header> |
| 366 | 390 | <div class="elementor-toast-content"> |
| 367 | 391 | <?php echo esc_html__( 'If you are experiencing a loading issue, contact your site administrator to troubleshoot the problem using Safe Mode.', 'elementor' ); ?> |
| @@ -391,9 +415,9 @@ | ||
| 391 | 415 | success: function( url ) { |
| 392 | 416 | location.assign( url ); |
| 393 | 417 | }, |
| 394 | 418 | error: function() { |
| 395 | - alert( 'An error occurred.' ); | |
| 419 | + alert( 'An error occurred' ); | |
| 396 | 420 | }, |
| 397 | 421 | }, |
| 398 | 422 | true |
| 399 | 423 | ); |
| @@ -424,9 +448,9 @@ | ||
| 424 | 448 | return; |
| 425 | 449 | } |
| 426 | 450 | |
| 427 | 451 | if ( ! $notice.data( 'visible' ) ) { |
| 428 | - $notice.attr( 'style', 'display: flex;' ); | |
| 452 | + $notice.show().data( 'visible', true ); | |
| 429 | 453 | } |
| 430 | 454 | |
| 431 | 455 | // Re-check after 500ms. |
| 432 | 456 | setTimeout( handleTrySafeModeNotice, 500 ); |