Title: [255187] trunk/Websites/webkit.org
- Revision
- 255187
- Author
- [email protected]
- Date
- 2020-01-27 15:27:29 -0800 (Mon, 27 Jan 2020)
Log Message
Add support for table of contents to Web Inspector pages
https://bugs.webkit.org/show_bug.cgi?id=206845
Reviewed by Devin Rousso.
* wp-content/plugins/table-of-contents.php:
Modified Paths
Diff
Modified: trunk/Websites/webkit.org/ChangeLog (255186 => 255187)
--- trunk/Websites/webkit.org/ChangeLog 2020-01-27 23:22:59 UTC (rev 255186)
+++ trunk/Websites/webkit.org/ChangeLog 2020-01-27 23:27:29 UTC (rev 255187)
@@ -1,5 +1,14 @@
2020-01-27 Jon Davis <[email protected]>
+ Add support for table of contents to Web Inspector pages
+ https://bugs.webkit.org/show_bug.cgi?id=206845
+
+ Reviewed by Devin Rousso.
+
+ * wp-content/plugins/table-of-contents.php:
+
+2020-01-27 Jon Davis <[email protected]>
+
Fix submenu behavior for narrow viewports
https://bugs.webkit.org/show_bug.cgi?id=206835
Modified: trunk/Websites/webkit.org/wp-content/plugins/table-of-contents.php (255186 => 255187)
--- trunk/Websites/webkit.org/wp-content/plugins/table-of-contents.php 2020-01-27 23:22:59 UTC (rev 255186)
+++ trunk/Websites/webkit.org/wp-content/plugins/table-of-contents.php 2020-01-27 23:27:29 UTC (rev 255187)
@@ -11,6 +11,7 @@
class WebKitTableOfContents {
+ private static $supported_post_types = array('page', 'web_inspector_page');
private static $editing = false;
private static $toc = array();
private static $attr_regex = '\{((?:[ ]*[#.][-_:a-zA-Z0-9]+){1,})[ ]*\}';
@@ -32,7 +33,8 @@
}
public static function renderMarkup() {
- if ( ! is_page() ) return;
+ if (!in_array(get_post_type(), self::$supported_post_types))
+ return;
if ( empty(self::$toc) || ! self::hasIndex() )
return;
@@ -72,8 +74,7 @@
}
public function wp_insert_post_data( $post_data, $record ) {
-
- if ( ! in_array($post_data['post_type'], array('page')) )
+ if (!in_array($post_data['post_type'], self::$supported_post_types))
return $post_data;
$post_data['post_content'] = self::parse($post_data['post_content']);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes