<commit_before>`import Clipboard from 'clipboard';`

Template.body.onRendered ->
	clipboard = new Clipboard('.clipboard')

	$(document.body).on 'keydown', (e) ->
		if e.keyCode is 80 and (e.ctrlKey is true or e.metaKey is true) and e.shiftKey is false
			e.preventDefault()
			e.stopPropagation()
			spotlight.show()

		if e.keyCode is 27
			spotlight.hide()

		unread = Session.get('unread')
		if e.keyCode is 27 and e.shiftKey is true and unread? and unread isnt ''
			e.preventDefault()
			e.stopPropagation()
			swal
				title: t('Clear_all_unreads_question')
				type: 'warning'
				confirmButtonText: t('Yes_clear_all')
				showCancelButton: true
				cancelButtonText: t('Cancel')
				confirmButtonColor: '#DD6B55'
			, ->
				subscriptions = ChatSubscription.find({open: true}, { fields: { unread: 1, alert: 1, rid: 1, t: 1, name: 1, ls: 1 } })
				for subscription in subscriptions.fetch()
					if subscription.alert or subscription.unread > 0
						Meteor.call 'readMessages', subscription.rid

	$(document.body).on 'keypress', (e) ->
		target = e.target
		if /input|textarea|select/i.test(target.tagName)
			return
		$inputMessage = $('textarea.input-message')
		if 0 == $inputMessage.length
			return
		$inputMessage.focus()

	$(document.body).on 'click', 'a', (e) ->
		link = e.currentTarget<commit_msg>Ignore keypress if swipebox is open<commit_after>`import Clipboard from 'clipboard';`

Template.body.onRendered ->
	clipboard = new Clipboard('.clipboard')

	$(document.body).on 'keydown', (e) ->
		if e.keyCode is 80 and (e.ctrlKey is true or e.metaKey is true) and e.shiftKey is false
			e.preventDefault()
			e.stopPropagation()
			spotlight.show()

		if e.keyCode is 27
			spotlight.hide()

		unread = Session.get('unread')
		if e.keyCode is 27 and e.shiftKey is true and unread? and unread isnt ''
			e.preventDefault()
			e.stopPropagation()
			swal
				title: t('Clear_all_unreads_question')
				type: 'warning'
				confirmButtonText: t('Yes_clear_all')
				showCancelButton: true
				cancelButtonText: t('Cancel')
				confirmButtonColor: '#DD6B55'
			, ->
				subscriptions = ChatSubscription.find({open: true}, { fields: { unread: 1, alert: 1, rid: 1, t: 1, name: 1, ls: 1 } })
				for subscription in subscriptions.fetch()
					if subscription.alert or subscription.unread > 0
						Meteor.call 'readMessages', subscription.rid

	$(document.body).on 'keypress', (e) ->
		target = e.target
		if /input|textarea|select/i.test(target.tagName)
			return
		if $.swipebox.isOpen
			return
		$inputMessage = $('textarea.input-message')
		if 0 == $inputMessage.length
			return
		$inputMessage.focus()

	$(document.body).on 'click', 'a', (e) ->
		link = e.currentTarget
{'fraction_non_alphanumeric': 0.13743016759776536, 'fraction_numerical': 0.01266294227188082, 'mean_word_length': 3.6794425087108014, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '247273', 'n_tokens_mistral': 1077, 'n_tokens_neox': 903, 'n_words': 235}