This plugin had prepublish checks working only by sending a callback from outside of the sidepanel to it. This meant that we had to have a dedicated button on Drupal to make this happen. Siteimprove CMS SDK has a callback that registers this prepublish callback from inside of the side panel instead, allowing it to be part of the side panel itself. Additionally, the Drupal plugin's highlighting isn't consistent with other plugins from Siteimprove.
Using Siteimprove's Plugin SDK "registerPrepublishCallback" method to add the "Run prepublish checks" button to the plugin side panel. Regarding the highlighting, we should be using the internal highlighting methods (still undocumented by Siteimprove) so that it remains consistent and in order to keep as much logic as possible as part of the SDK itself.
- Adds "Run prepublish checks" button to the plugin side panel
- Uses the SDK internal highlighting methods, changing the highlighting styles to be consistent with the Siteimprove implementation
- There was this weird right border on the Siteimprove toolbar items on certain themes (Gin, for instance), as well as the height of the dropdown not being set correctly. This code also fixes this.
The changes were mainly done to the siteimprove.js file, changing the way it grabs the DOM to be checked for issues. This implementation was copied and adjusted from the Wordpress plugin implementation, ensuring it works the same way (keeping consistency). One important note to make is the removal of the document.cloneNode(true)
which, even though it creates a clone of the document, it doesn't always keep the correct stylings on the DOM that is sent to be checked for issues. To work around this, we create an hidden iframe that loads the same page we are on, clears the contents of the Drupal specific elements (toolbars, etc...) and SI Plugin specific elements (side widget and iframe) without removing the elements itself (otherwise it would break the DOM structure) and uses the DOM from this iframe instead. This ensures that the DOM we are running the checks against is the correct one.
Something else worth noting is the images (on Drupal, the img src is a relative path). The internal tools from Siteimprove that render the previews to run the checks on cannot access these images if they are relative paths, so this change adds some methods that converts all relative links to absolute links for the images.
Active
2.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
No activities found.