Skip to content

Commit

Permalink
Add description to heading block widget
Browse files Browse the repository at this point in the history
  • Loading branch information
taylor-steve committed Feb 14, 2025
1 parent 4e5bb16 commit 2f4811c
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 2 deletions.
12 changes: 12 additions & 0 deletions app/assets/javascripts/spotlight/spotlight.esm.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/assets/javascripts/spotlight/spotlight.esm.js.map

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions app/assets/javascripts/spotlight/spotlight.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/assets/javascripts/spotlight/spotlight.js.map

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions app/javascript/spotlight/admin/blocks/heading_block.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
SirTrevor.Blocks.Heading = (function () {
return SirTrevor.Blocks.Heading.extend({
editorHTML: function() {
return `<p>${i18n.t("blocks:heading:description")}</p><hr><h2 class="st-required st-text-block st-text-block--heading" contenteditable="true"></h2>`;
}
});
})();
1 change: 1 addition & 0 deletions app/javascript/spotlight/admin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import 'spotlight/admin/blocks/block'
import 'spotlight/admin/blocks/resources_block' // This is a base class of several other blocks, so must come first
import 'spotlight/admin/blocks/browse_block'
import 'spotlight/admin/blocks/browse_group_categories_block'
import 'spotlight/admin/blocks/heading_block'
import 'spotlight/admin/blocks/iframe_block'
import 'spotlight/admin/blocks/link_to_search_block'
import 'spotlight/admin/blocks/oembed_block'
Expand Down
4 changes: 4 additions & 0 deletions app/javascript/spotlight/admin/sir-trevor/locales.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ SirTrevor.Locales.en.blocks = $.extend(SirTrevor.Locales.en.blocks, {
item_counts: "Include category item counts?"
},

heading: {
description: "This widget produces an H2 heading"
},

link_to_search: {
title: "Saved Searches",
description: "This widget highlights saved searches. Each highlighted saved search links to the search results page generated by the saved search parameters. Any saved search listed on the Curation > Browse categories page, whether published or not, can be highlighted as a saved search.",
Expand Down

0 comments on commit 2f4811c

Please sign in to comment.