Bugzilla – Attachment 50623 Details for
Bug 16297
Remove the use of "onclick" from OAI sets configuration template
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 16297 - Remove the use of "onclick" from OAI sets configuration template
PASSED-QA-Bug-16297---Remove-the-use-of-onclick-fr.patch (text/plain), 3.45 KB, created by
Katrin Fischer
on 2016-04-25 09:48:03 UTC
(
hide
)
Description:
[PASSED QA] Bug 16297 - Remove the use of "onclick" from OAI sets configuration template
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2016-04-25 09:48:03 UTC
Size:
3.45 KB
patch
obsolete
>From 30cf9167d709d316668d8c8a4fb81ad9183cdc50 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Tue, 19 Apr 2016 12:40:29 -0400 >Subject: [PATCH] [PASSED QA] Bug 16297 - Remove the use of "onclick" from OAI > sets configuration template >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >In order to bring the OAI sets configuration template into compliance >with coding guideline JS9, this patch changes with way some JavaScript >events are handled by moving JS handling out of the HTML markup. > >To test, apply the patch and go to Administration -> OAI sets >configuration. > >- Create or edit a set. >- Test the "Add description" link. Clicking it should add a > description textarea. >- Test the "Remove" link associated with multiple description lines. > Click them should remove the corresponding textarea. >- Test that additions and removals are saved correctly. > >Signed-off-by: Marc Véron <veron@veron.ch> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > .../intranet-tmpl/prog/en/modules/admin/oai_sets.tt | 19 +++++++++++++++---- > 1 file changed, 15 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/oai_sets.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/oai_sets.tt >index 2406e0d..dc30103 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/oai_sets.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/oai_sets.tt >@@ -7,13 +7,13 @@ function newDescField() { > $("#adddescription").before( > '<li><label>setDescription: </label>' + > '<textarea style="vertical-align:middle" rows="2" cols="30" name="description"></textarea>' + >- '<a onclick="delDescField(this); return false;" href="#"><i class="fa fa-fw fa-trash"></i> Remove</a>' + >+ '<a class="remove_description" href="#"><i class="fa fa-fw fa-trash"></i> Remove</a>' + > '</li>' > ); > } > > function delDescField(minusButton) { >- var li = $(minusButton).parent('li'); >+ var li = minusButton.parent('li'); > $(li).remove(); > } > >@@ -25,6 +25,17 @@ $(document).ready(function() { > $(".delete_oai_set").on("click",function(){ > return confirmDelete(); > }); >+ >+ $("body").on("click", ".remove_description", function(e){ >+ e.preventDefault(); >+ delDescField($(this)); >+ }); >+ >+ $(".add_description").on("click", function(e){ >+ e.preventDefault(); >+ newDescField(); >+ }); >+ > }); > //]]> > </script> >@@ -67,10 +78,10 @@ $(document).ready(function() { > <li> > <label>setDescription: </label> > <textarea style="vertical-align:middle" rows="2" cols="30" name="description">[% desc.description %]</textarea> >- <a onclick="delDescField(this); return false;" href="#"><i class="fa fa-fw fa-trash"></i> Remove</a> >+ <a class="remove_description" href="#"><i class="fa fa-fw fa-trash"></i> Remove</a> > </li> > [% END %] >- <li id="adddescription"><span class="label"> </span><a href="#" onclick='newDescField(); return false;'><i class="fa fa-fw fa-plus"></i> Add description</a></li> >+ <li id="adddescription"><span class="label"> </span><a href="#" class="add_description"><i class="fa fa-fw fa-plus"></i> Add description</a></li> > > </ol> > </fieldset> >-- >1.9.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 16297
:
50430
|
50512
| 50623