Bugzilla – Attachment 50627 Details for
Bug 16310
Remove the use of "onclick" from audio alerts template
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 16310 - Remove the use of "onclick" from audio alerts template
PASSED-QA-Bug-16310---Remove-the-use-of-onclick-fr.patch (text/plain), 3.34 KB, created by
Katrin Fischer
on 2016-04-25 10:48:56 UTC
(
hide
)
Description:
[PASSED QA] Bug 16310 - Remove the use of "onclick" from audio alerts template
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2016-04-25 10:48:56 UTC
Size:
3.34 KB
patch
obsolete
>From 128b90476143d9200f20b03264b045b26dc0100d Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Wed, 20 Apr 2016 10:29:03 -0400 >Subject: [PATCH] [PASSED QA] Bug 16310 - Remove the use of "onclick" from > audio alerts template >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >This patch removes one use of "onclick" in favor of defining events in >the JavaScript. > >This patch also makes changes to the style of some buttons to make the >interface a little more consistent with current practices. > >To test, apply the patch and go to Administration -> Audio alerts. > >- In the list of existing audio alerts, click the "Edit" button for any > alert. The correct data should be loaded in the edit form. > >Signed-off-by: Marc Véron <veron@veron.ch> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > koha-tmpl/intranet-tmpl/prog/en/js/audio_alerts.js | 10 ++++++++++ > koha-tmpl/intranet-tmpl/prog/en/modules/admin/audio_alerts.tt | 5 +++-- > 2 files changed, 13 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/audio_alerts.js b/koha-tmpl/intranet-tmpl/prog/en/js/audio_alerts.js >index 154c33a..6cc6d53 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/js/audio_alerts.js >+++ b/koha-tmpl/intranet-tmpl/prog/en/js/audio_alerts.js >@@ -65,6 +65,16 @@ $( document ).ready(function() { > return false; > } > }); >+ >+ $(".edit").on("click",function(e){ >+ e.preventDefault(); >+ var elt = this; >+ var id = $(this).data("soundid"); >+ var precedence = $(this).data("precedence"); >+ var selector = $(this).data("selector"); >+ var sound = $(this).data("sound"); >+ EditAlert( elt, id, precedence, selector, sound ); >+ }); > }); > > function enablePlayButton(sound_field_value,playbutton){ >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/audio_alerts.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/audio_alerts.tt >index 83c9eca..2366251 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/audio_alerts.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/audio_alerts.tt >@@ -111,14 +111,15 @@ > </td> > <td>[% a.selector %]</td> > <td>[% a.sound %]</td> >- <td><a class="btn btn-small" onclick="EditAlert( this, '[% a.id %]','[% a.precedence %]', '[% a.selector | replace( "'", "\\'" ) | html %]', '[% a.sound %]' )" ><i class="fa fa-pencil"></i> Edit</a></td> >+ <td> >+ <a class="btn btn-mini edit" data-soundid="[% a.id %]" data-precedence="[% a.precedence %]" data-selector="[% a.selector %]" data-sound="[% a.sound %]"><i class="fa fa-pencil"></i> Edit</a></td> > </tr> > [% END %] > </tbody> > </table> > > <p> >- <button id="delete-alerts" type="submit" class="btn disabled"><i class="fa fa-trash"></i> Delete selected alerts</button> >+ <button id="delete-alerts" type="submit" class="btn btn-small disabled"><i class="fa fa-trash"></i> Delete selected alerts</button> > </p> > </form> > </div> >-- >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 16310
:
50462
|
50464
| 50627