From 9c16d32e73ec0530c96f3bfeb53bf18a572fc630 Mon Sep 17 00:00:00 2001 From: abusedmedia Date: Wed, 30 Mar 2016 19:06:12 +0200 Subject: [PATCH] console cleanup --- assets/js/app.js | 12 ++++++++++++ assets/js/handleSvgLoading.js | 1 - assets/js/routes.js | 1 - assets/js/states/encrypt.js | 6 ++++++ assets/js/states/welcome.js | 2 -- assets/js/ui.js | 10 ---------- assets/js/ui/key-modal.js | 2 -- assets/js/ui/keyslider.js | 1 - assets/js/utils.js | 1 - libs/crypto-lib/char-list.js | 2 -- 10 files changed, 18 insertions(+), 20 deletions(-) diff --git a/assets/js/app.js b/assets/js/app.js index 8186673..c1189ee 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -107,6 +107,18 @@ ga('send', 'event', parts[0], parts[1]); }) + Cryptoloji.stateman.on('decrypt:wrong-key', function(){ + ga('send', 'event', 'decrypt', 'wrong-key'); + }) + Cryptoloji.stateman.on('decrypt:right-key', function(){ + ga('send', 'event', 'decrypt', 'right-key'); + }) + Cryptoloji.stateman.on('encrypt:key', function(){ + ga('send', 'event', 'encrypt', 'key'); + }) + Cryptoloji.stateman.on('encrypt:key_soon', function(){ + ga('send', 'event', 'encrypt', 'key_soon'); + }) // // handle first visit element display/hide diff --git a/assets/js/handleSvgLoading.js b/assets/js/handleSvgLoading.js index c8e4d0f..18faa4d 100644 --- a/assets/js/handleSvgLoading.js +++ b/assets/js/handleSvgLoading.js @@ -17,7 +17,6 @@ function gHandleSvgLoading (svg_loaded) { svgsPromises.push(loadSvg(self, path)) }) $.when.apply($, svgsPromises).then(function(){ - console.log('all svg loaded!') $.holdReady(false) }) } diff --git a/assets/js/routes.js b/assets/js/routes.js index 877e946..2391ac0 100644 --- a/assets/js/routes.js +++ b/assets/js/routes.js @@ -29,7 +29,6 @@ $('body').on('click', '[to-state]', function (event) { event.preventDefault() var goToState = $(event.target).closest('[to-state]').attr('to-state') - console.info('Change state detected:', goToState) if (goToState) Cryptoloji.stateman.go(goToState) }) diff --git a/assets/js/states/encrypt.js b/assets/js/states/encrypt.js index dc08702..426495f 100644 --- a/assets/js/states/encrypt.js +++ b/assets/js/states/encrypt.js @@ -47,6 +47,7 @@ if ($('#encryption_input').val().length === 0) { var newplaceholder = ['You\'ve picked a key. ', 500, '\nWrite your message here to see it in cipher.', 400] animateInputPlaceholder(theater, newplaceholder) + Cryptoloji.stateman.emit('encrypt:key_soon') } // check if the key is already being selected @@ -54,6 +55,8 @@ if (Cryptoloji.current.key !== key) { Cryptoloji.UI.selectKey(key) + Cryptoloji.stateman.emit('encrypt:key') + // select corresponding emoji in keymodal Cryptoloji.UI.KeyModal().select(key) @@ -67,6 +70,8 @@ if (Cryptoloji.current.key !== key) { Cryptoloji.UI.selectKey(key) + Cryptoloji.stateman.emit('encrypt:key') + Cryptoloji.UI.Keyslider('encrypt') .resetSelection() .addKey(key).select(key).scrollToSelectedKey() @@ -78,6 +83,7 @@ Cryptoloji.stateman.on('keypanel:key-chosen', function (key) { Cryptoloji.UI.selectKey(key) + Cryptoloji.stateman.emit('encrypt:key') $('#encryption_selected_key').html(Cryptoloji.UI.toTwemoji(key)) // coachmark error if (_.isEmpty($('#encryption_input').val())) { diff --git a/assets/js/states/welcome.js b/assets/js/states/welcome.js index 23e3eeb..614e8a1 100644 --- a/assets/js/states/welcome.js +++ b/assets/js/states/welcome.js @@ -1,8 +1,6 @@ (function (window, Cryptoloji, undefined) { 'use strict' - console.log(Cryptoloji) - Cryptoloji.states.welcome = { enter: function () { diff --git a/assets/js/ui.js b/assets/js/ui.js index 0a89526..017e4eb 100644 --- a/assets/js/ui.js +++ b/assets/js/ui.js @@ -27,9 +27,7 @@ var text = $('#decryption_input').attr('text') Cryptoloji.current.input = text - console.debug('Chosen text:', Cryptoloji.current.input) text = CryptoLib.decrypt(Cryptoloji.current.input, Cryptoloji.current.key) - console.debug('Decrypted text:', text) Cryptoloji.current.output = text $('#decryption_output').removeClass('placeholdit').text(text) Cryptoloji.stateman.emit('decrypt:show-reply', Cryptoloji.current.key) @@ -42,9 +40,7 @@ CryptoLib.generateEmojiSubsetFrom(Cryptoloji.current.key) Cryptoloji.current.input = text Cryptoloji.stateman.emit('encrypt:hide-output-placeholder') - console.debug('Chosen text:', text) text = CryptoLib.encrypt(Cryptoloji.current.input, Cryptoloji.current.key) - console.debug('Encrypted text:', text) Cryptoloji.current.output = text encryptTextAnimation(Cryptoloji.current.input, text) // text = toTwemoji(text) @@ -57,7 +53,6 @@ var _animationTimeout = null function encryptTextAnimation (text, emojiText) { - console.log(text, emojiText) function _mapToBlueBox (text) { text = text.toLowerCase() @@ -285,7 +280,6 @@ } function selectKey (key) { Cryptoloji.current.key = key - console.debug('Chosen key', key) // load emoji key to share $(".share_key_emoji-item").html(toTwemoji(key)) $(".share_key_emoji-item").attr('value', key) @@ -320,10 +314,8 @@ function _writeOrientationAttr () { // if orientation is 0 or 180 we are in portrait mode if (window.orientation == 0 || window.orientation == 180) { - console.info('changed orientation to portrait') $('html').attr('orientation', 'portrait') } else { - console.info('changed orientation to landscape') $('html').attr('orientation', 'landscape') } } @@ -400,7 +392,6 @@ tooltipPosition.left = 0 function slideLeft (el, duration) { - console.log(">>>>>>", el, duration) function removeSlide () { el.removeClass("section-show") } @@ -409,7 +400,6 @@ } function slideLeftNext (el, duration) { - console.log(">>>>>>", el, duration) function dispaySlide () { el.addClass("section-show") } diff --git a/assets/js/ui/key-modal.js b/assets/js/ui/key-modal.js index e8221ed..056636a 100644 --- a/assets/js/ui/key-modal.js +++ b/assets/js/ui/key-modal.js @@ -12,7 +12,6 @@ function KeyModal (selector) { var self = this self.mainSelector = selector - console.debug('creating KeyModal on ' + selector) self.$element = $(selector) // if instace .fill() has been called self.filled = false @@ -30,7 +29,6 @@ KeyModal.prototype.addClickHandler = function addClickHandler (selector) { var self = this - console.debug('attach click handler ' + selector + ' on ' + self.mainSelector) $(selector).click(_clickHandler) return self } diff --git a/assets/js/ui/keyslider.js b/assets/js/ui/keyslider.js index 7c91ca0..33d6031 100644 --- a/assets/js/ui/keyslider.js +++ b/assets/js/ui/keyslider.js @@ -10,7 +10,6 @@ var Keyslider = function Keyslider (name, selector) { var self = this - console.debug('creating keyslider ' + name + ' on ' + selector) self.$element = $(selector) // if instace .fill() has been called diff --git a/assets/js/utils.js b/assets/js/utils.js index 2106a05..4e23bce 100644 --- a/assets/js/utils.js +++ b/assets/js/utils.js @@ -21,7 +21,6 @@ var emojiLength = 120 if (message) { emojiLength = message.length - console.log("--->>>", emojiLength, message) } var molt = size if (emojiLength == 1) { diff --git a/libs/crypto-lib/char-list.js b/libs/crypto-lib/char-list.js index c18757a..9b61b5a 100644 --- a/libs/crypto-lib/char-list.js +++ b/libs/crypto-lib/char-list.js @@ -43,7 +43,5 @@ // 00F0 ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ "ðñòóôõö÷øùúûüýþÿ" // no 00F7 - console.log('total chars: ' + chars.length) - return chars }));