1(function( $ ) { 2 'use strict'; 3 4 /** 5 * All of the code for your public-facing JavaScript source 6 * should reside in this file. 7 * 8 * Note: It has been assumed you will write jQuery code here, so the 9 * $ function reference has been prepared for usage within the scope 10 * of this function. 11 * 12 * This enables you to define handlers, for when the DOM is ready: 13 * 14 * $(function() { 15 * 16 * }); 17 * 18 * When the window is loaded: 19 * 20 * $( window ).load(function() { 21 * 22 * }); 23 * 24 * ...and/or other possibilities. 25 * 26 * Ideally, it is not considered best practise to attach more than a 27 * single DOM-ready or window-load handler for a particular page. 28 * Although scripts in the WordPress core, Plugins and Themes may be 29 * practising this, we should strive to set a better example in our own work. 30 */ 31 32 $(document).ready(function(){ 33 var ctrlDown = false, 34 ctrlKey = 17, 35 cmdKey = 91, 36 cKey = 67; 37 var copy_count = 0; 38 var hint_count = 0; 39 40 // Document Ctrl + C 41 $(document).keydown(function(e) { 42 if (e.keyCode == ctrlKey || e.keyCode == cmdKey) ctrlDown = true; 43 }).keyup(function(e) { 44 if (e.keyCode == ctrlKey || e.keyCode == cmdKey) ctrlDown = false; 45 }); 46 47 $(document).keydown(function(e) { 48 if (ctrlDown && (e.keyCode == cKey)){ 49 copy_count ++; 50 $(document).find('.ays_quiz_track_users').attr( 'data-copy', copy_count ); 51 } 52 }); 53 54 //Hint Click Count 55 $(document).on('click', '.ays_question_hint_container', function(){ 56 hint_count ++; 57 $(document).find('.ays_quiz_track_users').attr( 'data-hint', hint_count ); 58 }); 59 }); 60 61})( jQuery );
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.