@ -6,6 +6,7 @@
@@ -6,6 +6,7 @@
* /
'use strict'
/* global Config, templateUrl, onContentLoaded, cancelEvent, dT, setZeroTimeout calcImageInBox, getSelectedText,Scroller, setFieldSelection, scrollToNode, EmojiTooltip, EmojiPanel, MessageComposer, checkDragEvent, checkClick, Image, Clipboard, EmojiHelper, encodeEntities, FB, twttr, gapi, isInDOM */
/* Directives */
@ -43,13 +44,13 @@ angular.module('myApp.directives', ['myApp.filters'])
@@ -43,13 +44,13 @@ angular.module('myApp.directives', ['myApp.filters'])
. directive ( 'myMessage' , function ( $filter , _ ) {
var dateFilter = $filter ( 'myDate' )
var dateSplitHtml = '<div class="im_message_date_split im_service_message_wrap"><div class="im_service_message"><span class="copyonly"><br/>--- </span><span class="im_message_date_split_text"></span><span class="copyonly"> ---</span></div></div>' ,
unreadSplitHtml = '<div class="im_message_unread_split">' + _ ( 'unread_messages_split' ) + '</div>' ,
selectedClass = 'im_message_selected' ,
focusClass = 'im_message_focus' ,
unreadClass = 'im_message_unread' ,
errorClass = 'im_message_error' ,
pendingClass = 'im_message_pending'
var dateSplitHtml = '<div class="im_message_date_split im_service_message_wrap"><div class="im_service_message"><span class="copyonly"><br/>--- </span><span class="im_message_date_split_text"></span><span class="copyonly"> ---</span></div></div>'
var unreadSplitHtml = '<div class="im_message_unread_split">' + _ ( 'unread_messages_split' ) + '</div>'
var selectedClass = 'im_message_selected'
var focusClass = 'im_message_focus'
var unreadClass = 'im_message_unread'
var errorClass = 'im_message_error'
var pendingClass = 'im_message_pending'
return {
templateUrl : templateUrl ( 'message' ) ,
@ -69,9 +70,9 @@ angular.module('myApp.directives', ['myApp.filters'])
@@ -69,9 +70,9 @@ angular.module('myApp.directives', ['myApp.filters'])
selected = ! selected
element . toggleClass ( selectedClass , selected )
}
} ,
needDateSplit ,
applyGrouped = function ( ) {
}
var needDateSplit , unreadAfterSplit
var applyGrouped = function ( ) {
if ( grouped != $scope . historyMessage . grouped ) {
if ( grouped ) {
element . removeClass ( grouped )
@ -99,8 +100,7 @@ angular.module('myApp.directives', ['myApp.filters'])
@@ -99,8 +100,7 @@ angular.module('myApp.directives', ['myApp.filters'])
needDateSplit . hide ( )
}
}
} ,
unreadAfterSplit
}
applySelected ( )
applyGrouped ( )
@ -166,8 +166,8 @@ angular.module('myApp.directives', ['myApp.filters'])
@@ -166,8 +166,8 @@ angular.module('myApp.directives', ['myApp.filters'])
if ( ! error && ! pending ) {
deregisterPending ( )
}
} ,
deregisterPending = $scope . $on ( 'messages_pending' , applyPending )
}
var deregisterPending = $scope . $on ( 'messages_pending' , applyPending )
applyPending ( )
}
@ -187,7 +187,7 @@ angular.module('myApp.directives', ['myApp.filters'])
@@ -187,7 +187,7 @@ angular.module('myApp.directives', ['myApp.filters'])
}
function updateMessageText ( $scope , element , message ) {
if ( message . media && message . media . handleMessage ||
if ( ( message . media && message . media . handleMessage ) ||
typeof message . message !== 'string' ||
! message . message . length ) {
$ ( '.im_message_text' , element ) . hide ( )
@ -671,7 +671,6 @@ angular.module('myApp.directives', ['myApp.filters'])
@@ -671,7 +671,6 @@ angular.module('myApp.directives', ['myApp.filters'])
} )
. directive ( 'myMessageEdited' , function ( _ , $timeout , AppMessagesManager ) {
var editedLabel = _ ( 'message_edited' )
return {
@ -769,8 +768,9 @@ angular.module('myApp.directives', ['myApp.filters'])
@@ -769,8 +768,9 @@ angular.module('myApp.directives', ['myApp.filters'])
return true
}
var currentSelected , nextDialogWrap , dialogWraps
if ( e . keyCode == 36 && ! e . shiftKey && ! e . ctrlKey && e . altKey ) { // Alt + Home
var currentSelected = $ ( scrollableWrap ) . find ( '.im_dialog_wrap a' )
currentSelected = $ ( scrollableWrap ) . find ( '.im_dialog_wrap a' )
if ( currentSelected . length ) {
$ ( currentSelected [ 0 ] ) . trigger ( 'mousedown' )
scrollableWrap . scrollTop = 0
@ -779,14 +779,13 @@ angular.module('myApp.directives', ['myApp.filters'])
@@ -779,14 +779,13 @@ angular.module('myApp.directives', ['myApp.filters'])
return cancelEvent ( e )
}
if ( e . keyCode == 27 || e . keyCode == 9 && e . shiftKey && ! e . ctrlKey && ! e . metaKey ) { // ESC or Shift + Tab
if ( e . keyCode == 27 || ( e . keyCode == 9 && e . shiftKey && ! e . ctrlKey && ! e . metaKey ) ) { // ESC or Shift + Tab
if ( ! searchFocused ) {
setFieldSelection ( searchField )
if ( searchField . value ) {
searchField . select ( )
}
}
else if ( searchField . value ) {
} else if ( searchField . value ) {
$ ( searchClear ) . trigger ( 'click' )
} else {
$scope . $emit ( 'esc_no_more' )
@ -802,7 +801,7 @@ angular.module('myApp.directives', ['myApp.filters'])
@@ -802,7 +801,7 @@ angular.module('myApp.directives', ['myApp.filters'])
}
if ( searchFocused && e . keyCode == 13 && ! Config . Navigator . mobile ) { // Enter
var currentSelected = $ ( scrollableWrap ) . find ( '.im_dialog_selected' ) [ 0 ] || $ ( scrollableWrap ) . find ( '.im_dialog_wrap a' ) [ 0 ]
currentSelected = $ ( scrollableWrap ) . find ( '.im_dialog_selected' ) [ 0 ] || $ ( scrollableWrap ) . find ( '.im_dialog_wrap a' ) [ 0 ]
if ( currentSelected &&
! $ ( currentSelected ) . hasClass ( 'disabled' ) ) {
$ ( currentSelected ) . trigger ( 'mousedown' )
@ -813,15 +812,13 @@ angular.module('myApp.directives', ['myApp.filters'])
@@ -813,15 +812,13 @@ angular.module('myApp.directives', ['myApp.filters'])
if (
( ! Config . Navigator . osX && // No Mac users
e . altKey && e . shiftKey && ! e . ctrlKey && ! e . metaKey &&
e . keyCode >= 49 && e . keyCode <= 57 ) // Alt + Shift + # , switch to conversation # where # is in [1..9]
||
e . keyCode >= 49 && e . keyCode <= 57 ) || // Alt + Shift + # , switch to conversation # where # is in [1..9]
( Config . Navigator . osX && // Mac users only
e . ctrlKey && e . shiftKey && ! e . metaKey && ! e . altKey &&
e . keyCode >= 49 && e . keyCode <= 57 ) ) { // Ctrl + Shift + # , switch to conversation # where # is in [1..9]
var dialogNumber = e . keyCode - 49
var dialogWraps = $ ( scrollableWrap ) . find ( '.im_dialog_wrap' )
var nextDialogWrap = dialogWraps [ dialogNumber ]
dialogWraps = $ ( scrollableWrap ) . find ( '.im_dialog_wrap' )
nextDialogWrap = dialogWraps [ dialogNumber ]
if ( nextDialogWrap ) {
$ ( nextDialogWrap ) . find ( 'a' ) . trigger ( 'mousedown' )
@ -838,8 +835,7 @@ angular.module('myApp.directives', ['myApp.filters'])
@@ -838,8 +835,7 @@ angular.module('myApp.directives', ['myApp.filters'])
next = e . keyCode == 40
prev = ! next
skip = ! e . shiftKey && e . altKey
}
else if ( ctrlTabSupported && e . keyCode == 9 && e . ctrlKey && ! e . metaKey ) { // Ctrl + Tab, Shift + Ctrl + Tab
} else if ( ctrlTabSupported && e . keyCode == 9 && e . ctrlKey && ! e . metaKey ) { // Ctrl + Tab, Shift + Ctrl + Tab
next = ! e . shiftKey
prev = ! next
skip = true
@ -850,22 +846,21 @@ angular.module('myApp.directives', ['myApp.filters'])
@@ -850,22 +846,21 @@ angular.module('myApp.directives', ['myApp.filters'])
return true
}
var currentSelected = ! skip && $ ( scrollableWrap ) . find ( '.im_dialog_selected' ) [ 0 ] || $ ( scrollableWrap ) . find ( '.active a.im_dialog' ) [ 0 ]
var currentSelectedWrap = currentSelected && currentSelected . parentNode ,
nextDialogWrap
currentSelected = ( ! skip && $ ( scrollableWrap ) . find ( '.im_dialog_selected' ) [ 0 ] ) || $ ( scrollableWrap ) . find ( '.active a.im_dialog' ) [ 0 ]
var currentSelectedWrap = currentSelected && currentSelected . parentNode
if ( currentSelectedWrap ) {
var nextDialogWrap = currentSelected [ next ? 'nextSibling' : 'previousSibling' ]
nextDialogWrap = currentSelected [ next ? 'nextSibling' : 'previousSibling' ]
if ( ! nextDialogWrap || ! nextDialogWrap . className || nextDialogWrap . className . indexOf ( 'im_dialog_wrap' ) == - 1 ) {
var dialogWraps = $ ( scrollableWrap ) . find ( '.im_dialog_wrap' )
dialogWraps = $ ( scrollableWrap ) . find ( '.im_dialog_wrap' )
var pos = dialogWraps . index ( currentSelected . parentNode )
var nextPos = pos + ( next ? 1 : - 1 )
nextDialogWrap = dialogWraps [ nextPos ]
}
} else {
var dialogWraps = $ ( scrollableWrap ) . find ( '.im_dialog_wrap' )
dialogWraps = $ ( scrollableWrap ) . find ( '.im_dialog_wrap' )
if ( next ) {
nextDialogWrap = dialogWraps [ 0 ]
} else {
@ -1024,8 +1019,8 @@ angular.module('myApp.directives', ['myApp.filters'])
@@ -1024,8 +1019,8 @@ angular.module('myApp.directives', ['myApp.filters'])
function updateSizes ( ) {
$ ( element ) . css ( {
height : $ ( $window ) . height ( ) -
( panelWrap && panelWrap . offsetHeight || 0 ) -
( searchWrap && searchWrap . offsetHeight || 0 ) -
( ( panelWrap && panelWrap . offsetHeight ) || 0 ) -
( ( searchWrap && searchWrap . offsetHeight ) || 0 ) -
( Config . Mobile ? 64 : 200 )
} )
$ ( contactsWrap ) . nanoScroller ( )
@ -1055,10 +1050,10 @@ angular.module('myApp.directives', ['myApp.filters'])
@@ -1055,10 +1050,10 @@ angular.module('myApp.directives', ['myApp.filters'])
function updateSizes ( ) {
$ ( element ) . css ( {
height : $ ( $window ) . height ( )
- ( panelWrap && panelWrap . offsetHeight || 0 )
- ( searchWrap && searchWrap . offsetHeight || 0 )
- ( Config . Mobile ? 46 + 18 : 200 )
height : $ ( $window ) . height ( ) -
( ( panelWrap && panelWrap . offsetHeight ) || 0 ) -
( ( searchWrap && searchWrap . offsetHeight ) || 0 ) -
( Config . Mobile ? 46 + 18 : 200 )
} )
$ ( countriesWrap ) . nanoScroller ( )
}
@ -1085,8 +1080,8 @@ angular.module('myApp.directives', ['myApp.filters'])
@@ -1085,8 +1080,8 @@ angular.module('myApp.directives', ['myApp.filters'])
function updateSizes ( ) {
$ ( element ) . css ( {
height : Math . min ( 760 , $ ( $window ) . height ( )
- ( Config . Mobile ? 46 + 18 : 200 ) )
height : Math . min ( 760 , $ ( $window ) . height ( ) -
( Config . Mobile ? 46 + 18 : 200 ) )
} )
$ ( sessionsWrap ) . nanoScroller ( )
}
@ -1110,8 +1105,8 @@ angular.module('myApp.directives', ['myApp.filters'])
@@ -1110,8 +1105,8 @@ angular.module('myApp.directives', ['myApp.filters'])
function updateSizes ( ) {
$ ( element ) . css ( {
height : Math . min ( 600 , $ ( $window ) . height ( )
- ( Config . Mobile ? 46 + 18 : 200 ) )
height : Math . min ( 600 , $ ( $window ) . height ( ) -
( Config . Mobile ? 46 + 18 : 200 ) )
} )
$ ( stickersWrap ) . nanoScroller ( )
}
@ -1155,8 +1150,8 @@ angular.module('myApp.directives', ['myApp.filters'])
@@ -1155,8 +1150,8 @@ angular.module('myApp.directives', ['myApp.filters'])
}
var transform = false
var trs = [ 'transform' , 'webkitTransform' , 'MozTransform' , 'msTransform' , 'OTransform' ] ,
i
var trs = [ 'transform' , 'webkitTransform' , 'MozTransform' , 'msTransform' , 'OTransform' ]
var i
for ( i = 0 ; i < trs . length ; i ++ ) {
if ( trs [ i ] in historyMessagesEl . style ) {
transform = trs [ i ]
@ -1164,7 +1159,7 @@ angular.module('myApp.directives', ['myApp.filters'])
@@ -1164,7 +1159,7 @@ angular.module('myApp.directives', ['myApp.filters'])
}
}
var animated = transform && false ? true : false
var animated = transform && false ? true : false // ?
var curAnimation = false
$scope . $on ( 'ui_history_append_new' , function ( e , options ) {
@ -1183,8 +1178,8 @@ angular.module('myApp.directives', ['myApp.filters'])
@@ -1183,8 +1178,8 @@ angular.module('myApp.directives', ['myApp.filters'])
}
var curAnimated = animated &&
! $rootScope . idle . isIDLE &&
historyMessagesEl . clientHeight > 0 ,
wasH
historyMessagesEl . clientHeight > 0
var wasH
if ( curAnimated ) {
wasH = scrollableWrap . scrollHeight
@ -1364,9 +1359,9 @@ angular.module('myApp.directives', ['myApp.filters'])
@@ -1364,9 +1359,9 @@ angular.module('myApp.directives', ['myApp.filters'])
clearTimeout ( timer )
unreg ( )
} ,
timer = setTimeout ( upd , 0 ) ,
unreg = $scope . $on ( '$viewContentLoaded' , upd )
}
var timer = setTimeout ( upd , 0 )
var unreg = $scope . $on ( '$viewContentLoaded' , upd )
} )
$scope . $on ( 'ui_history_append' , function ( ) {
@ -1439,8 +1434,7 @@ angular.module('myApp.directives', ['myApp.filters'])
@@ -1439,8 +1434,7 @@ angular.module('myApp.directives', ['myApp.filters'])
if ( ! moreNotified && st <= 300 ) {
moreNotified = true
$scope . $emit ( 'history_need_more' )
}
else if ( ! lessNotified && st >= scrollableWrap . scrollHeight - scrollableWrap . clientHeight - 300 ) {
} else if ( ! lessNotified && st >= scrollableWrap . scrollHeight - scrollableWrap . clientHeight - 300 ) {
lessNotified = true
$scope . $emit ( 'history_need_less' )
}
@ -1486,10 +1480,10 @@ angular.module('myApp.directives', ['myApp.filters'])
@@ -1486,10 +1480,10 @@ angular.module('myApp.directives', ['myApp.filters'])
function updateBottomizer ( ) {
$ ( historyMessagesEl ) . css ( { marginTop : 0 } )
var marginTop = scrollableWrap . offsetHeight
- historyMessagesEl . offsetHeight
- emptyWrapEl . offsetHeight
- ( Config . Mobile ? 0 : 39 )
var marginTop = scrollableWrap . offsetHeight -
historyMessagesEl . offsetHeight -
emptyWrapEl . offsetHeight -
( Config . Mobile ? 0 : 39 )
if ( historyMessagesEl . offsetHeight > 0 && marginTop > 0 ) {
$ ( historyMessagesEl ) . css ( { marginTop : marginTop } )
@ -1727,7 +1721,7 @@ angular.module('myApp.directives', ['myApp.filters'])
@@ -1727,7 +1721,7 @@ angular.module('myApp.directives', ['myApp.filters'])
composer . setValue ( $scope . draftMessage . text || '' )
updateHeight ( )
}
if ( shouldFocusOnInteraction || options && options . focus ) {
if ( shouldFocusOnInteraction || ( options && options . focus ) ) {
composer . focus ( )
}
}
@ -1786,10 +1780,9 @@ angular.module('myApp.directives', ['myApp.filters'])
@@ -1786,10 +1780,9 @@ angular.module('myApp.directives', ['myApp.filters'])
function onPasteEvent ( e ) {
var cData = ( e . originalEvent || e ) . clipboardData
var items = cData && cData . items || [ ]
var files = [ ] ,
file
var i
var items = ( cData && cData . items ) || [ ]
var files = [ ]
var i , file
for ( i = 0 ; i < items . length ; i ++ ) {
if ( items [ i ] . kind == 'file' ) {
@ -1902,7 +1895,7 @@ angular.module('myApp.directives', ['myApp.filters'])
@@ -1902,7 +1895,7 @@ angular.module('myApp.directives', ['myApp.filters'])
// console.log('new loc', newLocation, arguments)
var counterSaved = ++ counter
if ( ! newLocation || newLocation . empty ) {
element . attr ( 'src' , $scope . thumb && $scope . thumb . placeholder || 'img/blank.gif' )
element . attr ( 'src' , ( $scope . thumb && $scope . thumb . placeholder ) || 'img/blank.gif' )
cleanup ( )
return
}
@ -2179,7 +2172,7 @@ angular.module('myApp.directives', ['myApp.filters'])
@@ -2179,7 +2172,7 @@ angular.module('myApp.directives', ['myApp.filters'])
imgElement . attr ( 'alt' , '[' + ( $scope . document . stickerEmojiRaw || '' ) + ' ' + _ ( 'conversation_media_sticker' ) + ']' )
var dim = attrs . dim && $scope . $parent . $eval ( attrs . dim ) || $scope . document . thumb
var dim = ( attrs . dim && $scope . $parent . $eval ( attrs . dim ) ) || $scope . document . thumb
if ( attrs . open && $scope . document . stickerSetInput ) {
element
@ -2404,7 +2397,8 @@ angular.module('myApp.directives', ['myApp.filters'])
@@ -2404,7 +2397,8 @@ angular.module('myApp.directives', ['myApp.filters'])
if ( animationSupported === undefined ) {
animationSupported = el . style . animationName !== undefined
if ( animationSupported === false ) {
var domPrefixes = 'Webkit Moz O ms Khtml' . split ( ' ' ) , i
var domPrefixes = 'Webkit Moz O ms Khtml' . split ( ' ' )
var i
for ( i = 0 ; i < domPrefixes . length ; i ++ ) {
if ( el . style [ domPrefixes [ i ] + 'AnimationName' ] !== undefined ) {
animationSupported = true
@ -2570,7 +2564,7 @@ angular.module('myApp.directives', ['myApp.filters'])
@@ -2570,7 +2564,7 @@ angular.module('myApp.directives', ['myApp.filters'])
var height = element [ 0 ] . parentNode . offsetHeight
var modal = element [ 0 ] . parentNode . parentNode . parentNode
var bottomPanel = $ ( '.media_modal_bottom_panel_wrap' , modal ) [ 0 ]
var contHeight = modal . offsetHeight - ( bottomPanel && bottomPanel . offsetHeight || 0 )
var contHeight = modal . offsetHeight - ( ( bottomPanel && bottomPanel . offsetHeight ) || 0 )
if ( height < contHeight ) {
$ ( element [ 0 ] . parentNode ) . css ( 'marginTop' , ( contHeight - height ) / 2 )
@ -2611,7 +2605,7 @@ angular.module('myApp.directives', ['myApp.filters'])
@@ -2611,7 +2605,7 @@ angular.module('myApp.directives', ['myApp.filters'])
var updateMargin = function ( ) {
var height = element [ 0 ] . offsetHeight
var fullHeight = height - ( height && usePadding ? 2 * prevMargin : 0 )
var ratio = attrs . myVerticalPosition && parseFloat ( attrs . myVerticalPosition ) || 0.5
var ratio = ( attrs . myVerticalPosition && parseFloat ( attrs . myVerticalPosition ) ) || 0.5
var contHeight = attrs . contHeight ? $scope . $eval ( attrs . contHeight ) : $ ( $window ) . height ( )
var margin = fullHeight < contHeight ? parseInt ( ( contHeight - fullHeight ) * ratio ) : ''
var styles = usePadding
@ -2668,7 +2662,7 @@ angular.module('myApp.directives', ['myApp.filters'])
@@ -2668,7 +2662,7 @@ angular.module('myApp.directives', ['myApp.filters'])
var user = AppUsersManager . getUser ( userID )
element
. html ( statusFilter ( user , attrs . botChatPrivacy ) )
. toggleClass ( 'status_online' , user . status && user . status . _ == 'userStatusOnline' || false )
. toggleClass ( 'status_online' , ( user . status && user . status . _ == 'userStatusOnline' ) || false )
// console.log(dT(), 'update status', element[0], user.status && user.status, tsNow(true), element.html())
}
@ -3045,9 +3039,7 @@ angular.module('myApp.directives', ['myApp.filters'])
@@ -3045,9 +3039,7 @@ angular.module('myApp.directives', ['myApp.filters'])
if ( $scope . audio . url ) {
checkPlayer ( $scope . mediaPlayer . player )
$scope . mediaPlayer . player . playPause ( )
}
else if ( $scope . audio . progress && $scope . audio . progress . enabled ) {
return
} else if ( $scope . audio . progress && $scope . audio . progress . enabled ) {
} else {
AppDocsManager . downloadDoc ( $scope . audio . id ) . then ( function ( ) {
onContentLoaded ( function ( ) {
@ -3198,12 +3190,10 @@ angular.module('myApp.directives', ['myApp.filters'])
@@ -3198,12 +3190,10 @@ angular.module('myApp.directives', ['myApp.filters'])
if ( e . touches && e . touches [ 0 ] ) {
lastMinPageX = element . position ( ) . left
offsetX = e . touches [ 0 ] . pageX - lastMinPageX
}
else if ( e . offsetX !== undefined ) {
} else if ( e . offsetX !== undefined ) {
offsetX = e . offsetX
lastMinPageX = e . pageX - offsetX
}
else if ( e . layerX !== undefined ) {
} else if ( e . layerX !== undefined ) {
offsetX = e . layerX
lastMinPageX = e . pageX - offsetX
} else {
@ -3468,8 +3458,7 @@ angular.module('myApp.directives', ['myApp.filters'])
@@ -3468,8 +3458,7 @@ angular.module('myApp.directives', ['myApp.filters'])
var spritesheet , pos
var categoryIndex
var count = Math . min ( 5 , codes . length )
var i , x
var y
var i , x , y
for ( i = 0 ; i < count ; i ++ ) {
emoticonCode = codes [ i ]
@ -3517,8 +3506,9 @@ angular.module('myApp.directives', ['myApp.filters'])
@@ -3517,8 +3506,9 @@ angular.module('myApp.directives', ['myApp.filters'])
if ( ( result . type == 'gif' || result . type == 'sticker' ) && result . document ) {
AppDocsManager . downloadDoc ( result . document . id )
}
var photoSize
if ( result . type == 'photo' && result . photo ) {
var photoSize = AppPhotosManager . choosePhotoSize ( result . photo , result . thumbW , result . thumbH )
photoSize = AppPhotosManager . choosePhotoSize ( result . photo , result . thumbW , result . thumbH )
var dim = calcImageInBox ( photoSize . w , photoSize . h , result . thumbW , result . thumbH )
result . thumb = {
width : dim . w ,
@ -3528,7 +3518,7 @@ angular.module('myApp.directives', ['myApp.filters'])
@@ -3528,7 +3518,7 @@ angular.module('myApp.directives', ['myApp.filters'])
}
}
if ( result . type == 'game' && result . photo ) {
var photoSize = AppPhotosManager . choosePhotoSize ( result . photo , 100 , 100 )
photoSize = AppPhotosManager . choosePhotoSize ( result . photo , 100 , 100 )
// var dim = calcImageInBox(photoSize.w, photoSize.h, result.thumbW, result.thumbH)
result . thumb = {
// width: dim.w,
@ -3562,7 +3552,7 @@ angular.module('myApp.directives', ['myApp.filters'])
@@ -3562,7 +3552,7 @@ angular.module('myApp.directives', ['myApp.filters'])
if ( ! dataParsed || ! dataParsed . eventType ) {
return
}
$scope . $emit ( 'game_frame_event' , dataParsed ) ;
$scope . $emit ( 'game_frame_event' , dataParsed )
}
$ ( $window ) . on ( 'message' , handler )
@ -3579,7 +3569,6 @@ angular.module('myApp.directives', ['myApp.filters'])
@@ -3579,7 +3569,6 @@ angular.module('myApp.directives', ['myApp.filters'])
} )
. directive ( 'myEmojiImage' , function ( RichTextProcessor ) {
function link ( $scope , element , attrs ) {
var emoji = attrs . myEmojiImage
var html = RichTextProcessor . wrapRichText ( emoji , { noLinks : true , noLinebreaks : true } )
@ -3607,16 +3596,17 @@ angular.module('myApp.directives', ['myApp.filters'])
@@ -3607,16 +3596,17 @@ angular.module('myApp.directives', ['myApp.filters'])
var html = ''
var callback = false
var needTwitter = false
var videoID
switch ( embedData [ 0 ] ) {
case 'youtube' :
var videoID = embedData [ 1 ]
videoID = embedData [ 1 ]
html = '<div class="im_message_media_embed im_message_video_embed"><' + embedTag + ' type="text/html" frameborder="0" ' +
'src="https://www.youtube.com/embed/' + videoID +
'?autoplay=0&controls=2" webkitallowfullscreen mozallowfullscreen allowfullscreen></' + embedTag + '></div>'
break
case 'vimeo' :
var videoID = embedData [ 1 ]
videoID = embedData [ 1 ]
html = '<div class="im_message_media_embed im_message_video_embed"><' + embedTag + ' type="text/html" frameborder="0" ' +
'src="https://player.vimeo.com/video/' + videoID +
'?title=0&byline=0&portrait=0" webkitallowfullscreen mozallowfullscreen allowfullscreen></' + embedTag + '></div>'
@ -3666,8 +3656,7 @@ angular.module('myApp.directives', ['myApp.filters'])
@@ -3666,8 +3656,7 @@ angular.module('myApp.directives', ['myApp.filters'])
} )
} )
. attr ( 'src' , 'https://platform.twitter.com/widgets.js' )
}
else if ( window . twttr ) {
} else if ( window . twttr ) {
twttr . widgets . load ( element [ 0 ] )
}
twitterPendingWidgets . push ( $scope )
@ -3691,9 +3680,7 @@ angular.module('myApp.directives', ['myApp.filters'])
@@ -3691,9 +3680,7 @@ angular.module('myApp.directives', ['myApp.filters'])
} )
} )
. attr ( 'src' , 'https://connect.facebook.net/en_US/sdk.js#xfbml=1&appId=254098051407226&version=v2.0' )
}
else if ( window . FB ) {
} else if ( window . FB ) {
FB . XFBML . parse ( element [ 0 ] )
}
facebookPendingWidgets . push ( $scope )
@ -3714,8 +3701,7 @@ angular.module('myApp.directives', ['myApp.filters'])
@@ -3714,8 +3701,7 @@ angular.module('myApp.directives', ['myApp.filters'])
gapi . post . go ( )
} )
. attr ( 'src' , 'https://apis.google.com/js/plusone.js' )
}
else if ( window . gapi ) {
} else if ( window . gapi ) {
gapi . post . go ( element [ 0 ] )
}
element . one ( 'load' , function ( ) {