Several strings are defined in opac-bottom.inc for use the tags feature. These can be moved to the corresponding JavaScript file.
Created attachment 152416 [details] [review] Bug 34035: Move translatable strings out of opac-bottom.inc: Tags This patch removes the definition of JS variables in opac-bottom.inc related to the tags feature. These strings can be wrapped in the __() function inside tags.js and they'll get picked up for translation. Some other tags-related JS variable definitions are removed from templates in favor of embedding them directly in the <script> block. To test you must have TagsEnabled set to "Allow." Apply the patch and log in to the OPAC. - Perform a catalog search and select some items in the result list. - Add the items to the cart and open the cart. - Check a box next to one of the titles in the cart. - Click the "Tag" link - Submit the "New tag" form without entering a tag. You should see "No tag was specified." - Perform the same test on the search results page both using the checkboxes and by clicking the "Add tag" link on an individual result. - Perform the same test on the bibliographic detail page. - When adding tags from the cart, result list, or detail page, confirm that the "Tags added: X" message is always displayed. - Test adding a tag to a title which is already attached to that title. - Test adding HTML markup, e.g. "<script>" - Test adding HTML markup and plain text, e.g. "<script>Foo"
Created attachment 152525 [details] [review] Bug 34035: (preparatory cleanup) Convert indentation to spaces. This patch converts tabs to spaces in tags.js. No other changes are made.
Created attachment 152526 [details] [review] Bug 34035: Move translatable strings out of opac-bottom.inc: Tags This patch removes the definition of JS variables in opac-bottom.inc related to the tags feature. These strings can be wrapped in the __() function inside tags.js and they'll get picked up for translation. Some other tags-related JS variable definitions are removed from templates in favor of embedding them directly in the <script> block. To test you must have TagsEnabled set to "Allow." Apply the patch and log in to the OPAC. - Perform a catalog search and select some items in the result list. - Add the items to the cart and open the cart. - Check a box next to one of the titles in the cart. - Click the "Tag" link - Submit the "New tag" form without entering a tag. You should see "No tag was specified." - Perform the same test on the search results page both using the checkboxes and by clicking the "Add tag" link on an individual result. - Perform the same test on the bibliographic detail page. - When adding tags from the cart, result list, or detail page, confirm that the "Tags added: X" message is always displayed. - Test adding a tag to a title which is already attached to that title. - Test adding HTML markup, e.g. "<script>" - Test adding HTML markup and plain text, e.g. "<script>Foo"
Created attachment 152529 [details] [review] Bug 34035: (preparatory cleanup) Convert indentation to spaces. This patch converts tabs to spaces in tags.js. No other changes are made.
Created attachment 152530 [details] [review] Bug 34035: Move translatable strings out of opac-bottom.inc: Tags This patch removes the definition of JS variables in opac-bottom.inc related to the tags feature. These strings can be wrapped in the __() function inside tags.js and they'll get picked up for translation. Some other tags-related JS variable definitions are removed from templates in favor of embedding them directly in the <script> block. To test you must have TagsEnabled set to "Allow." Apply the patch and log in to the OPAC. - Perform a catalog search and select some items in the result list. - Add the items to the cart and open the cart. - Check a box next to one of the titles in the cart. - Click the "Tag" link - Submit the "New tag" form without entering a tag. You should see "No tag was specified." - Perform the same test on the search results page both using the checkboxes and by clicking the "Add tag" link on an individual result. - Perform the same test on the bibliographic detail page. - When adding tags from the cart, result list, or detail page, confirm that the "Tags added: X" message is always displayed. - Test adding a tag to a title which is already attached to that title. - Test adding HTML markup, e.g. "<script>" - Test adding HTML markup and plain text, e.g. "<script>Foo"
Created attachment 156698 [details] [review] Bug 34035: (preparatory cleanup) Convert indentation to spaces. This patch converts tabs to spaces in tags.js. No other changes are made. Signed-off-by: David Nind <david@davidnind.com>
Created attachment 156699 [details] [review] Bug 34035: Move translatable strings out of opac-bottom.inc: Tags This patch removes the definition of JS variables in opac-bottom.inc related to the tags feature. These strings can be wrapped in the __() function inside tags.js and they'll get picked up for translation. Some other tags-related JS variable definitions are removed from templates in favor of embedding them directly in the <script> block. To test you must have TagsEnabled set to "Allow." Apply the patch and log in to the OPAC. - Perform a catalog search and select some items in the result list. - Add the items to the cart and open the cart. - Check a box next to one of the titles in the cart. - Click the "Tag" link - Submit the "New tag" form without entering a tag. You should see "No tag was specified." - Perform the same test on the search results page both using the checkboxes and by clicking the "Add tag" link on an individual result. - Perform the same test on the bibliographic detail page. - When adding tags from the cart, result list, or detail page, confirm that the "Tags added: X" message is always displayed. - Test adding a tag to a title which is already attached to that title. - Test adding HTML markup, e.g. "<script>" - Test adding HTML markup and plain text, e.g. "<script>Foo" Signed-off-by: David Nind <david@davidnind.com>
Testing notes (using KTD): - Needed to enable the TagsInputOnList system preference as well.
Created attachment 156710 [details] [review] Bug 34035: (preparatory cleanup) Convert indentation to spaces. This patch converts tabs to spaces in tags.js. No other changes are made. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 156711 [details] [review] Bug 34035: Move translatable strings out of opac-bottom.inc: Tags This patch removes the definition of JS variables in opac-bottom.inc related to the tags feature. These strings can be wrapped in the __() function inside tags.js and they'll get picked up for translation. Some other tags-related JS variable definitions are removed from templates in favor of embedding them directly in the <script> block. To test you must have TagsEnabled set to "Allow." Apply the patch and log in to the OPAC. - Perform a catalog search and select some items in the result list. - Add the items to the cart and open the cart. - Check a box next to one of the titles in the cart. - Click the "Tag" link - Submit the "New tag" form without entering a tag. You should see "No tag was specified." - Perform the same test on the search results page both using the checkboxes and by clicking the "Add tag" link on an individual result. - Perform the same test on the bibliographic detail page. - When adding tags from the cart, result list, or detail page, confirm that the "Tags added: X" message is always displayed. - Test adding a tag to a title which is already attached to that title. - Test adding HTML markup, e.g. "<script>" - Test adding HTML markup and plain text, e.g. "<script>Foo" Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Pushed to master for 23.11. Nice work everyone, thanks!
Enhancement not pushed to 23.05.x