This commit is contained in:
abusedmedia 2016-03-30 19:06:12 +02:00
Родитель cd3341ed45
Коммит 9c16d32e73
10 изменённых файлов: 18 добавлений и 20 удалений

Просмотреть файл

@ -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

Просмотреть файл

@ -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)
})
}

Просмотреть файл

@ -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)
})

Просмотреть файл

@ -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())) {

Просмотреть файл

@ -1,8 +1,6 @@
(function (window, Cryptoloji, undefined) {
'use strict'
console.log(Cryptoloji)
Cryptoloji.states.welcome = {
enter: function () {

Просмотреть файл

@ -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")
}

Просмотреть файл

@ -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
}

Просмотреть файл

@ -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

Просмотреть файл

@ -21,7 +21,6 @@
var emojiLength = 120
if (message) {
emojiLength = message.length
console.log("--->>>", emojiLength, message)
}
var molt = size
if (emojiLength == 1) {

Просмотреть файл

@ -43,7 +43,5 @@
// 00F0 ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
"ðñòóôõö÷øùúûüýþÿ" // no 00F7
console.log('total chars: ' + chars.length)
return chars
}));