Coding guideline JS1 (https://wiki.koha-community.org/wiki/Coding_Guidelines#JS1:_Embedding_JavaScript_blocks_in_templates) says "Whenever possible JavaScript should be placed in a separate file." The JavaScript embedded in admin/biblio_framework.tt is not so dependent on template processing that it can't be safely moved to a separate file.
Created attachment 48193 [details] [review] Bug 15846 - Move MARC Framework JavaScript into separate file The JavaScript embedded in the MARC framework template is not dependent on template processing to such an extent that it can't be safely moved to a separate file. This patch does so, adding definition of a few translatable strings to the template. To test, apply the patch and go to Administration -> MARC frameworks. - The table of existing frameworks should be sortable. - The "Export" link should trigger the export modal. - The "Import" link should trigger the import modal. -- Clicking "Import" without selecting a file should trigger an alert. -- Selecting the wrong file type should trigger an alert. -- Importing a file of the correct type should trigger an overwrite warning ("Do you really want to import...?"). -- A progress indicator should show during the import, with correct values for "Importing from" and "Importing to". -- Importing an incorrectly-formatted file of a correct type should trigger an alert, "Error importing the framework..."
Created attachment 48194 [details] [review] [SIGNED-OFF]Bug 15846: Move MARC Framework JavaScript into separate file The JavaScript embedded in the MARC framework template is not dependent on template processing to such an extent that it can't be safely moved to a separate file. This patch does so, adding definition of a few translatable strings to the template. To test, apply the patch and go to Administration -> MARC frameworks. - The table of existing frameworks should be sortable. - The "Export" link should trigger the export modal. - The "Import" link should trigger the import modal. -- Clicking "Import" without selecting a file should trigger an alert. -- Selecting the wrong file type should trigger an alert. -- Importing a file of the correct type should trigger an overwrite warning ("Do you really want to import...?"). -- A progress indicator should show during the import, with correct values for "Importing from" and "Importing to". -- Importing an incorrectly-formatted file of a correct type should trigger an alert, "Error importing the framework..." Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> Works as advertised. Export and Import options work properly
Created attachment 48452 [details] [review] Bug 15846: Move MARC Framework JavaScript into separate file The JavaScript embedded in the MARC framework template is not dependent on template processing to such an extent that it can't be safely moved to a separate file. This patch does so, adding definition of a few translatable strings to the template. To test, apply the patch and go to Administration -> MARC frameworks. - The table of existing frameworks should be sortable. - The "Export" link should trigger the export modal. - The "Import" link should trigger the import modal. -- Clicking "Import" without selecting a file should trigger an alert. -- Selecting the wrong file type should trigger an alert. -- Importing a file of the correct type should trigger an overwrite warning ("Do you really want to import...?"). -- A progress indicator should show during the import, with correct values for "Importing from" and "Importing to". -- Importing an incorrectly-formatted file of a correct type should trigger an alert, "Error importing the framework..." Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> Works as advertised. Export and Import options work properly
I fixed the merge problem and have returned this to "signed off." This page is affected by Bug 15916, so you may need that patch to test this properly.
Please rebase!
Created attachment 49528 [details] [review] Bug 15846: Move MARC Framework JavaScript into separate file The JavaScript embedded in the MARC framework template is not dependent on template processing to such an extent that it can't be safely moved to a separate file. This patch does so, adding definition of a few translatable strings to the template. To test, apply the patch and go to Administration -> MARC frameworks. - The table of existing frameworks should be sortable. - The "Export" link should trigger the export modal. - The "Import" link should trigger the import modal. -- Clicking "Import" without selecting a file should trigger an alert. -- Selecting the wrong file type should trigger an alert. -- Importing a file of the correct type should trigger an overwrite warning ("Do you really want to import...?"). -- A progress indicator should show during the import, with correct values for "Importing from" and "Importing to". -- Importing an incorrectly-formatted file of a correct type should trigger an alert, "Error importing the framework..." Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> Works as advertised. Export and Import options work properly
Will be in the May 2015 release, thanks for your work!