kopia lustrzana https://github.com/wagtail/wagtail
				
				
				
			Ensure `insert_editor_js` documentation reflects common usage (#13022)
Fixes #13021 Relates to #2936pull/12993/head
							rodzic
							
								
									8a9d05eef5
								
							
						
					
					
						commit
						5b429e24d6
					
				| 
						 | 
				
			
			@ -33,6 +33,7 @@ Changelog
 | 
			
		|||
 * Docs: Add tutorial on deploying on Ubuntu to third-party tutorials (Mohammad Fathi Rahman)
 | 
			
		||||
 * Docs: Document that request_or_site is optional on BaseGenericSetting.load (Matt Westcott)
 | 
			
		||||
 * Docs: Mention third-party StreamField based form builder packages in the form builder documentation (Matt Westcott)
 | 
			
		||||
 * Docs: Clarify that `insert_editor_js` hook applies to all core editing/creation views (LB (Ben) Johnston)
 | 
			
		||||
 * Maintenance: Migrate away from deprecated Sass import rules to module system (Srishti Jaiswal)
 | 
			
		||||
 * Maintenance: Apply Sass mixed declarations migration in preparation for CSS nesting (Prabhpreet Kaur)
 | 
			
		||||
 * Maintenance: Refactor styles for Draftail, minimap, and comments to fix remaining Sass migration warnings (Thibaud Colas)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -16,6 +16,8 @@ INSTALLED_APPS = (
 | 
			
		|||
 | 
			
		||||
This will add a 'Styleguide' item to the Settings menu in the admin.
 | 
			
		||||
 | 
			
		||||
At present the styleguide is static: new UI components must be added to it manually, and there are no hooks into it for other modules to use. We hope to support hooks in the future.
 | 
			
		||||
At present the styleguide is static: new UI components must be added to it manually, and there are no specific hooks into it for other modules to use. It will include the output of the [](insert_editor_js) hook for any custom edit forms JavaScript that may be used.
 | 
			
		||||
 | 
			
		||||
We hope to support specific styleguide hooks in the future.
 | 
			
		||||
 | 
			
		||||
The styleguide doesn't currently provide examples of all the core interface components; notably the Page, Document, Image and Snippet chooser interfaces are not currently represented.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -514,7 +514,9 @@ def global_admin_css():
 | 
			
		|||
 | 
			
		||||
### `insert_editor_js`
 | 
			
		||||
 | 
			
		||||
Add additional JavaScript files or code snippets to the page editor.
 | 
			
		||||
Add additional JavaScript files or code snippets to page, snippets and ModelViewSet editing and creation views. This hook's output is also included in the [](styleguide) view to better test editing customizations.
 | 
			
		||||
 | 
			
		||||
See [](extending_client_side) for more details about how to integrate these kinds of customizations.
 | 
			
		||||
 | 
			
		||||
```python
 | 
			
		||||
# wagtail_hooks.py
 | 
			
		||||
| 
						 | 
				
			
			@ -563,6 +565,8 @@ window.addEventListener('DOMContentLoaded', (event) => {
 | 
			
		|||
 | 
			
		||||
Add additional JavaScript files or code snippets to all admin pages.
 | 
			
		||||
 | 
			
		||||
See [](extending_client_side) for more details about how to integrate these kinds of customizations.
 | 
			
		||||
 | 
			
		||||
```python
 | 
			
		||||
from django.utils.html import format_html
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -51,6 +51,7 @@ This version adds formal support for Django 5.2.
 | 
			
		|||
 * Add tutorial on deploying on Ubuntu to third-party tutorials (Mohammad Fathi Rahman)
 | 
			
		||||
 * Document that request_or_site is optional on BaseGenericSetting.load (Matt Westcott)
 | 
			
		||||
 * Mention third-party StreamField based form builder packages in the [form builder](form_builder) documentation (Matt Westcott)
 | 
			
		||||
 * Clarify that `insert_editor_js` hook applies to all core editing/creation views (LB (Ben) Johnston)
 | 
			
		||||
 | 
			
		||||
### Maintenance
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,7 +2,7 @@
 | 
			
		|||
 | 
			
		||||
{% comment %}
 | 
			
		||||
    DEPRECATED: Remove this template in a future release and replace with the direct hook_output template tag, customizations should use the hook only.
 | 
			
		||||
    Do not add any further standalone script imports here, this template will be deprecated in a future release.
 | 
			
		||||
    Do not add any further standalone script imports here, this template will be deprecated in a future release - RemovedInWagtail80
 | 
			
		||||
{% endcomment %}
 | 
			
		||||
 | 
			
		||||
{% hook_output 'insert_editor_js' %}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Ładowanie…
	
		Reference in New Issue