diff --git a/app.manifest b/app.manifest index fe424542..6dcc76f2 100644 --- a/app.manifest +++ b/app.manifest @@ -1,5 +1,5 @@ CACHE MANIFEST -# Time: Mon Jan 04 2016 23:04:09 GMT+0100 (CET) +# Time: Mon Jan 04 2016 23:15:01 GMT+0100 (CET) CACHE: diff --git a/js/app.js b/js/app.js index dc82f9da..e8d55691 100644 --- a/js/app.js +++ b/js/app.js @@ -41,7 +41,7 @@ e.put("partials/desktop/dialog_service.html",'\n\n
\n\n \n\n
\n\n \n\n'),e.put("partials/desktop/inactive.html",'
\n
\n
\n
\n \n

\n
\n
\n \n
\n
\n
\n
'),e.put("partials/desktop/lang_footer.html",''),e.put("partials/desktop/login.html",'
\n \n \n\n
\n\n'),e.put("partials/desktop/media_modal_layout.html",''),e.put("partials/desktop/megagroup_edit_modal.html",'
\n\n
\n\n \n\n
\n\n \n\n
'),e.put("partials/desktop/message.html",'
\n\n\n
\n\n
\n
\n
\n
\n
\n
\n \n \n
\n\n \n \n \n\n
\n\n
\n \n\n \n \n \n \n\n \n\n
\n
\n
\n \n
\n
\n \n
\n\n
\n\n \n\n \n\n
\n \n
\n \n \n \n \n
\n
\n\n
\n\n
\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n The message is not supported on your version of Telegram Web. Update the app to view: web.telegram.org.\n
\n
\n\n
\n\n\n
\n\n
\n
\n\n
\n\n'),e.put("partials/desktop/message_attach_contact.html",'
\n \n
\n \n \n
\n
\n
'),e.put("partials/desktop/message_attach_document.html",'
\n\n
\n\n
\n\n
\n
\n
\n\n
\n\n \n \n \n \n
\n \n
\n
\n\n
\n
\n \n \n \n
\n
\n \n \n \n
\n
\n \n
\n
\n
\n
\n
\n
\n
\n\n
\n
\n
\n'),e.put("partials/desktop/message_attach_geo.html",'\n \n \n'),e.put("partials/desktop/message_attach_pending.html",'
\n
\n \n
\n
\n
\n \n \n
\n
\n \n
\n
\n
\n
\n
\n
\n
\n
\n'),e.put("partials/desktop/message_attach_photo.html",'\n \n\n
'),e.put("partials/desktop/message_attach_venue.html",'
\n\n \n \n \n \n\n
\n
\n \n
\n
\n
\n\n
\n'),e.put("partials/desktop/message_attach_video.html",'
\n \n \n \n \n \n\n
\n
\n \n \n \n
\n
\n \n \n \n \n \n
\n
\n \n
\n
\n
\n
\n
\n
\n
\n
\n
'),e.put("partials/desktop/message_attach_webpage.html",'
\n
\n
\n
\n \n
\n
\n \n \n \n
\n
\n
\n
\n \n
\n
\n \n \n \n \n \n
\n\n
\n
\n
\n\n
\n
\n
\n\n
\n \n \n \n
\n
\n \n
\n
\n
\n
\n'),e.put("partials/desktop/message_service.html",'\n \n \n \n «»\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n «»\n \n \n \n\n \n \n \n\n'), e.put("partials/desktop/password_recovery_modal.html",'
\n\n
\n\n \n\n
\n\n \n\n
'),e.put("partials/desktop/password_update_modal.html",'
\n\n
\n\n \n\n
\n\n \n\n
'),e.put("partials/desktop/peer_select.html",'
\n\n
\n
\n
\n \n
\n
\n
\n
\n\n
\n\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n \n
\n\n
\n
\n \n
\n
\n
\n
\n
\n\n
\n\n \n\n \n\n
\n'),e.put("partials/desktop/photo_modal.html",'\n\n\n\n
\n
\n
\n \n \n \n \n \n \n \n \n \n
\n\n
\n \n
\n \n
\n
\n \n \n
\n
\n\n
\n
\n \n
\n
\n
\n\n
\n \n \n \n \n \n
\n
\n
\n\n\n\n'),e.put("partials/desktop/profile_edit_modal.html",'
\n\n
\n\n \n\n
\n\n \n\n
\n'),e.put("partials/desktop/reply_markup.html",'
\n
\n
\n
\n \n
\n
\n
\n
'),e.put("partials/desktop/reply_message.html",'
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n\n \n
\n
'),e.put("partials/desktop/sessions_list_modal.html",'
\n\n
\n
\n
\n \n
\n
\n
\n
\n\n
\n\n
\n\n
\n
\n\n
\n \n \n \n
\n\n \n\n
\n
\n\n
\n\n
\n\n
\n'),e.put("partials/desktop/settings_modal.html",'
\n\n
\n
\n
\n \n \n
\n
\n
\n\n
\n
\n
\n \n
\n \n
\n
\n
\n
\n
\n
\n
\n\n
\n
\n
\n \n \n
\n
\n
\n\n
\n\n
\n\n
\n \n\n
\n
\n
\n
\n\n
\n
\n \n \n
\n
\n
\n
\n\n
\n \n\n \n \n \n \n\n \n \n \n \n\n \n \n \n \n\n
\n
\n
\n\n
\n\n
\n \n\n \n\n
\n\n \n\n
\n\n
\n\n
\n'),e.put("partials/desktop/slider.html",'
\n
\n
\n
\n
\n
'),e.put("partials/desktop/stickerset_modal.html",'
\n\n
\n
\n
\n \n
\n
\n
\n \n \n
\n
\n\n
\n\n
\n\n
\n
\n\n
\n \n \n \n
\n\n
\n \n
\n
\n
\n
\n\n
\n
\n\n
\n\n
\n
\n \n \n \n
\n
\n\n
\n\n
\n'),e.put("partials/desktop/user_modal.html",'
\n\n
\n
\n
\n \n \n
\n
\n
\n\n
\n
\n \n
\n
\n
\n
\n
\n
\n
\n\n
\n
\n \n \n \n
\n
\n\n\n
\n\n
\n\n
\n \n\n
\n
\n \n
\n
\n
\n\n
\n
\n
\n
\n\n
\n
\n \n
\n
\n
\n
\n\n
\n \n\n \n \n \n \n\n
\n\n \n\n
\n\n
\n\n
\n\n'), e.put("partials/desktop/username_edit_modal.html",'
\n\n
\n\n \n\n
\n\n \n\n
'),e.put("partials/desktop/video_modal.html",'\n\n
\n
\n
\n \n \n \n \n \n \n \n \n \n
\n\n
\n \n
\n \n
\n
\n \n \n
\n
\n\n
\n
\n
\n\n'),e.put("partials/desktop/welcome.html",""),e.put("partials/mobile/audio_player.html",'
\n \n \n \n
\n
\n \n \n
\n \n \n \n \n \n \n \n \n \n
\n \n \n
\n
\n
\n \n \n
\n
\n
\n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n
'),e.put("partials/mobile/changelog_modal.html",'
\n\n \n\n \n\n
\n'),e.put("partials/mobile/channel_modal.html",'
\n\n
\n \n
\n\n \n\n
\n'), -e.put("partials/mobile/chat_create_modal.html",'
\n\n
\n \n
\n\n \n\n
'),e.put("partials/mobile/chat_edit_modal.html",'
\n\n
\n \n
\n\n \n\n
'),e.put("partials/mobile/chat_modal.html",'
\n\n
\n \n
\n\n \n\n
\n'),e.put("partials/mobile/contacts_modal.html",'
\n\n
\n \n
\n\n \n\n
\n'),e.put("partials/mobile/country_select_modal.html",'
\n\n
\n \n
\n\n \n\n
\n'),e.put("partials/mobile/dialog.html",'\n\n
\n
\n \n \n
\n\n
\n\n
\n\n
\n \n
\n\n
\n \n \n \n
\n\n
\n
\n \n
\n
\n \n \n \n :\n \n \n \n \n :\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n\n \n
\n
\n\n
\n
\n'),e.put("partials/mobile/edit_contact_modal.html",'
\n\n
\n \n
\n\n \n\n
'),e.put("partials/mobile/full_gif.html",'\n\n
\n\n \n \n\n
\n\n
\n\n
\n
\n
\n
\n
\n\n
\n
GIF
\n
\n
\n\n
\n\n
'),e.put("partials/mobile/full_photo.html",'
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n \n \n
\n
\n
\n
\n
\n
'),e.put("partials/mobile/full_video.html",'
\n
\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n \n \n
\n
\n
\n
\n
\n
'),e.put("partials/mobile/head.html",'
\n \n
\n'),e.put("partials/mobile/im.html",'
\n\n
\n\n
\n\n
\n
\n \n
\n\n
\n\n
\n

\n

\n \n \n
\n\n \n\n
\n
\n \n
\n\n
\n
\n \n
\n\n
\n
\n \n
\n\n
\n
\n\n
\n
\n \n
\n\n
\n
\n\n
\n\n
\n
\n
\n \n \n \n \n
\n\n
\n
\n
\n
\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n
\n\n
\n \n
\n \n
\n
\n
\n
\n \n \n \n
\n
\n
\n \n \n
\n
\n\n
\n\n
\n\n
\n
\n\n
\n \n \n
\n\n
\n \n
\n
\n\n
\n
\n \n \n\n
\n \n
\n\n
\n \n \n
\n\n \n\n \n
\n\n\n
\n
\n
\n\n
\n
\n\n
\n\n
\n\n
\n\n
\n
\n\n
\n\n
\n\n
'), +e.put("partials/mobile/chat_create_modal.html",'
\n\n
\n \n
\n\n \n\n
'),e.put("partials/mobile/chat_edit_modal.html",'
\n\n
\n \n
\n\n \n\n
'),e.put("partials/mobile/chat_modal.html",'
\n\n
\n \n
\n\n \n\n
\n'),e.put("partials/mobile/contacts_modal.html",'
\n\n
\n \n
\n\n \n\n
\n'),e.put("partials/mobile/country_select_modal.html",'
\n\n
\n \n
\n\n \n\n
\n'),e.put("partials/mobile/dialog.html",'\n\n
\n
\n \n \n
\n\n
\n\n
\n\n
\n \n
\n\n
\n \n \n \n
\n\n
\n
\n \n
\n
\n \n \n \n :\n \n \n \n \n :\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n\n \n
\n
\n\n
\n
\n'),e.put("partials/mobile/edit_contact_modal.html",'
\n\n
\n \n
\n\n \n\n
'),e.put("partials/mobile/full_gif.html",'\n\n
\n\n
\n \n \n
\n \n\n
\n\n
\n\n
\n
\n
\n
\n
\n\n
\n
GIF
\n
\n
\n\n
\n\n
'),e.put("partials/mobile/full_photo.html",'
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n \n \n
\n
\n
\n
\n
\n
'),e.put("partials/mobile/full_video.html",'
\n
\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n \n \n
\n
\n
\n
\n
\n
'),e.put("partials/mobile/head.html",'
\n \n
\n'),e.put("partials/mobile/im.html",'
\n\n
\n\n
\n\n
\n
\n \n
\n\n
\n\n
\n

\n

\n \n \n
\n\n \n\n
\n
\n \n
\n\n
\n
\n \n
\n\n
\n
\n \n
\n\n
\n
\n\n
\n
\n \n
\n\n
\n
\n\n
\n\n
\n
\n
\n \n \n \n \n
\n\n
\n
\n
\n
\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n
\n\n
\n \n
\n \n
\n
\n
\n
\n \n \n \n
\n
\n
\n \n \n
\n
\n\n
\n\n
\n\n
\n
\n\n
\n \n \n
\n\n
\n \n
\n
\n\n
\n
\n \n \n\n
\n \n
\n\n
\n \n \n
\n\n \n\n \n
\n\n\n
\n
\n
\n\n
\n
\n\n
\n\n
\n\n
\n\n
\n
\n\n
\n\n
\n\n
'), e.put("partials/mobile/import_contact_modal.html",'
\n\n
\n \n
\n\n \n
'),e.put("partials/mobile/login.html",'
\n \n
\n\n\n
\n \n\n
\n\n'),e.put("partials/mobile/message.html",'
\n\n\n
\n\n
\n
\n
\n
\n
\n
\n \n \n
\n\n \n \n \n\n
\n\n
\n\n \n\n
\n
\n
\n \n
\n
\n \n \n \n \n \n
\n\n
\n\n \n \n\n \n\n
\n \n \n \n \n \n
\n\n
\n\n
\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n The message is not supported on your version of Telegram Web. Update the app to view: web.telegram.org.\n
\n
\n\n
\n
\n\n
\n
\n\n
\n\n'),e.put("partials/mobile/message_actions_modal.html",'
\n\n
\n \n \n \n \n \n
\n\n
\n'),e.put("partials/mobile/message_attach_contact.html",'
\n \n
\n \n \n
\n
\n
'),e.put("partials/mobile/message_attach_document.html",'
\n\n
\n\n
\n\n
\n
\n
\n\n
\n\n \n \n \n \n
\n \n
\n
\n\n
\n
\n \n \n \n
\n
\n \n \n \n
\n
\n \n
\n
\n
\n
\n
\n
\n
\n\n
\n
\n
\n'),e.put("partials/mobile/message_attach_geo.html",'\n \n \n'),e.put("partials/mobile/message_attach_pending.html",'
\n
\n \n
\n
\n
\n \n \n
\n
\n \n
\n
\n
\n
\n
\n
\n
\n
\n'),e.put("partials/mobile/message_attach_photo.html",'\n \n\n
'),e.put("partials/mobile/message_attach_venue.html",'
\n\n \n \n \n \n\n
\n
\n \n
\n
\n
\n\n
\n'),e.put("partials/mobile/message_attach_video.html",'
\n \n \n \n \n \n
\n
'),e.put("partials/mobile/message_attach_webpage.html",'
\n
\n
\n
\n \n
\n
\n \n \n \n
\n
\n
\n
\n \n
\n
\n \n \n \n \n \n
\n\n
\n
\n \n \n \n
\n \n
\n
\n
\n
\n'),e.put("partials/mobile/message_service.html",'\n \n \n \n «»\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n «»\n \n \n \n\n \n \n \n\n'),e.put("partials/mobile/password_recovery_modal.html",'
\n\n
\n \n
\n\n \n\n
'), e.put("partials/mobile/password_update_modal.html",'
\n\n
\n \n
\n\n \n\n
'),e.put("partials/mobile/peer_select.html",'
\n\n
\n \n
\n\n \n\n
\n'),e.put("partials/mobile/phonebook_modal.html",'
\n\n
\n \n
\n\n \n\n \n\n
\n'),e.put("partials/mobile/photo_modal.html",'
\n
\n
\n \n \n \n
\n\n
\n \n \n \n
\n\n
\n \n
\n \n
\n\n
\n
\n\n
\n \n
\n\n\n\n'),e.put("partials/mobile/profile_edit_modal.html",'
\n\n
\n \n
\n\n \n\n
'),e.put("partials/mobile/sessions_list_modal.html",'
\n\n
\n \n
\n\n \n\n
\n'),e.put("partials/mobile/settings_modal.html",'
\n\n
\n \n
\n\n \n
\n'),e.put("partials/mobile/stickerset_modal.html",'
\n\n
\n \n
\n\n \n\n
'),e.put("partials/mobile/user_modal.html",'
\n\n
\n \n
\n\n \n\n
\n'), e.put("partials/mobile/username_edit_modal.html",'
\n\n
\n \n
\n\n \n\n
'),e.put("partials/mobile/video_modal.html",'
\n
\n
\n \n \n \n
\n\n
\n \n \n \n
\n\n
\n \n
\n \n
\n\n
\n
\n\n
\n
\n
\n \n \n \n
\n \n
\n
\n\n\n\n'),e.put("partials/mobile/welcome.html","")}]),function(e,t,n,a){function i(e){ConfigStorage.get("emojis_popular",function(t){var n=[];if(t&&t.length){for(var a=0,i=t.length;i>a;a++)n.push({code:t[a][0],rate:t[a][1]});return void e(n)}ConfigStorage.get("emojis_recent",function(t){t=t||y||[];for(var a,i,o=0,s=t.length;s>o;o++)a=t[o],Array.isArray(a)&&(a=a[0]),a&&"string"==typeof a&&(":"==a.charAt(0)&&(a=a.substr(1,a.length-2)),(i=f[a])&&n.push({code:i,rate:1}));e(n)})})}function o(e){i(function(t){for(var n=!1,a=t.length,i=[],o=0;a>o;o++)t[o].code==e&&(n=!0,t[o].rate++),i.push([t[o].code,t[o].rate]);n?i.sort(function(e,t){return t[1]-e[1]}):(i.length>41&&(i=i.slice(0,41)),i.push([e,1])),ConfigStorage.set({emojis_popular:i})})}function s(){if(v===!1){v=SearchIndexManager.createIndex();var e;for(e in f)f.hasOwnProperty(e)&&SearchIndexManager.indexObject(f[e],e,v)}}function r(e){s();var t,n=SearchIndexManager.search(e,v),a=[];for(t in n)n.hasOwnProperty(t)&&a.push(t);return a}var l,c,d,u,p,m,g,h,t={},f={},_={},v=!1,y="joy,kissing_heart,heart,heart_eyes,blush,grin,+1,relaxed,pensive,smile,sob,kiss,unamused,flushed,stuck_out_tongue_winking_eye,see_no_evil,wink,smiley,cry,stuck_out_tongue_closed_eyes,scream,rage,smirk,disappointed,sweat_smile,kissing_closed_eyes,speak_no_evil,relieved,grinning,yum,laughing,ok_hand,neutral_face,confused".split(",");for(l=0,g=n.length;g>l;l++)for(m=a[l][1],c=0,h=n[l].length;h>c;c++)d=n[l][c],p=Config.Emoji[d],u=p[1][0],t[d]=[p[0],u],f[u]=d,_[d]=[l,c,Math.floor(c/m),c%m];e.EmojiHelper={emojis:t,shortcuts:f,spritesheetPositions:_,getPopularEmoji:i,pushPopularEmoji:o,indexEmojis:s,searchEmojis:r}}(window,Config.Emoji,Config.EmojiCategories,Config.EmojiCategorySpritesheetDimens),EmojiTooltip.prototype.onMouseEnter=function(e){this.hideTimeout?(clearTimeout(this.hideTimeout),delete this.hideTimeout):e&&!this.showTimeout&&(this.showTimeout=setTimeout(this.show.bind(this),100))},EmojiTooltip.prototype.onMouseLeave=function(e){if(this.hideTimeout)e&&this.showTimeout&&(clearTimeout(this.showTimeout),delete this.showTimeout);else{var t=this;this.hideTimeout=setTimeout(function(){t.hide()},600)}},EmojiTooltip.prototype.createTooltip=function(){if(this.tooltipEl)return!1;var e='
'+this.langpack.im_emoji_tab+'
'+this.langpack.im_stickers_tab+'
';e=e.replace(/>\s+<");var t=this;this.tooltipEl=$(e).appendTo(document.body),this.tabsEl=$(".composer_emoji_tooltip_tabs",this.tooltipEl),this.categoriesEl=$(".composer_emoji_tooltip_categories",this.tooltipEl),this.stickersCategoriesEl=$(".composer_emoji_tooltip_tab_stickers_content .composer_emoji_tooltip_categories",this.tooltipEl),this.contentEl=$(".composer_emoji_tooltip_content",this.tooltipEl),this.emojiContentEl=$(".composer_emoji_tooltip_content_emoji",this.tooltipEl),this.stickersContentEl=$(".composer_emoji_tooltip_content_stickers",this.tooltipEl),angular.forEach(["emoji","stickers"],function(e,n){var a=$(".composer_emoji_tooltip_tab_"+e,t.tabsEl).on("mousedown",function(e){return t.selectTab(n),cancelEvent(e)});Config.Navigator.touch||a.on("mouseenter mouseleave",function(e){clearTimeout(t.selectTabTimeout),"mouseenter"==e.type&&(t.selectTabTimeout=setTimeout(function(){t.selectTab(n)},300))})});var n="mousedown";return Config.Navigator.touch||(n+=" mouseover mouseout"),this.categoriesEl.on(n,function(e){e=e.originalEvent||e;var n=e.target;if("A"!=n.tagName&&(n=n.parentNode),"A"==n.tagName){var a=parseInt(n.getAttribute("data-category"));if("mousedown"==e.type)return t.selectCategory(a),cancelEvent(e);if(!t.tab){var i="mouseover"==e.type;i&&t.selectCategoryIndex==a||(clearTimeout(t.selectCategoryTimeout),delete t.selectCategoryTimeout,i?(t.selectCategoryIndex=a,t.selectCategoryTimeout=setTimeout(function(){delete t.selectCategoryIndex,delete t.selectCategoryTimeout,t.selectCategory(a)},300)):delete t.selectCategoryIndex)}}}),this.emojiScroller=new Scroller(this.emojiContentEl,{classPrefix:"composer_emoji_tooltip"}),this.stickersScroller=new Scroller(this.stickersContentEl,{classPrefix:"composer_emoji_tooltip"}),this.stickersScroller.onScroll(function(e,n){t.onStickersScroll(e,n)}),this.contentEl.on("mousedown",function(e){e=e.originalEvent||e;var n,a,i,o=$(e.target);return"A"!=o[0].tagName&&(o=$(o[0].parentNode)),(n=o.attr("data-code"))&&(t.onEmojiSelected&&t.onEmojiSelected(n),EmojiHelper.pushPopularEmoji(n)),(a=o.attr("data-sticker"))&&(t.onStickerSelected&&t.onStickerSelected(a),Config.Mobile&&t.hide()),(i=o.attr("data-stickerset"))&&(t.onStickersetSelected&&t.onStickersetSelected(i),t.hide()),cancelEvent(e)}),Config.Navigator.touch||this.tooltipEl.on("mouseenter mouseleave",function(e){"mouseenter"==e.type?t.onMouseEnter():t.onMouseLeave()}),this.selectTab(0),$(window).on("resize",this.updatePosition.bind(this)),!0},EmojiTooltip.prototype.selectCategory=function(e,t){return this.cat!==e||t?($(".active",this.categoriesEl).removeClass("active"),this.cat=e,void(this.tab?(this.activateStickerCategory(),this.updateStickersContents(t)):($(this.categoriesEl[this.tab].childNodes[e]).addClass("active"),this.updateEmojiContents()))):!1},EmojiTooltip.prototype.selectTab=function(e,t){if(this.tab===e&&!t)return!1;this.tab=e,this.selectCategory(0,!0);var n=this;setTimeout(function(){$(n.tooltipEl).toggleClass("composer_emoji_tooltip_tabs_stickers_active",1==e)},0)},EmojiTooltip.prototype.updateEmojiContents=function(){var e=[],t=this,n=26,a=function(){t.emojiContentEl.html(e.join("")),t.emojiScroller.reinit()};if(this.cat>0){var i,o,s,r,l,c=this.cat-1,d=Config.EmojiCategories[c],u=Config.EmojiCategorySpritesheetDimens[c][1],p=d.length;for(s=0;p>s;s++)i=d[s],o=Config.Emoji[i],r=n*(s%u),l=n*Math.floor(s/u),e.push('');a()}else EmojiHelper.getPopularEmoji(function(t){var i,o,s,r,l,c,d,u,p=t.length;for(c=0;p>c;c++)i=t[c].code,(o=Config.Emoji[i])&&(s=EmojiHelper.spritesheetPositions[i],l=s[0],r=s[1],d=n*s[3],u=n*s[2],e.push(''));a()})},EmojiTooltip.prototype.updateStickersContents=function(e){var t=[],n=[],a=this,i=function(){var t=a.cat?a.stickersetPositions[a.cat][0]:0;a.stickersScroller.scrollTo(t,e?0:200)};if(!e&&a.stickersetPositions.length)return void i();var o=function(e){var o,s,r,l,c,d;for(r=0,c=e.length;c>r;r++)if(o=e[r],o.docIDs.length){for(t.push('
'),o.title&&t.push('',encodeEntities(o.title),""),n.push(o.id?'':''),l=0,d=o.docIDs.length;d>l;l++)s=o.docIDs[l],t.push('');t.push("
")}a.stickersContentEl.html(t.join("")),a.stickersCategoriesEl.html(n.join("")),a.stickersScroller.reinit();var u=[];$(".composer_stickerset_wrap",a.stickersContentEl).each(function(e,t){var n=t.offsetHeight,a=t.offsetTop;u.push([a,n])}),a.stickersetPositions=u,i();var p=[];a.contentEl.find(".composer_sticker_btn").each(function(e,t){12>e?a.replaceStickerImage(t):p.push([t.offsetTop,t])}),a.stickersPreload=p,a.stickersCategoriesEl.find(".composer_sticker_btn").each(function(e,t){a.replaceStickerImage(t)})};this.getStickers(o)},EmojiTooltip.prototype.replaceStickerImage=function(e){e=$(e),this.getStickerImage(e,e.attr("data-sticker"))},EmojiTooltip.prototype.onStickersScroll=function(e,t){var n,a,i=e.clientHeight,o=e.scrollHeight,s=this.stickersetPositions.length,r=!1;if(20>t)r=0;else if(t>o-i-20)r=s-1;else for(a=0;s>a;a++)if(n=this.stickersetPositions[a],t>=n[0]&&ta;a++)n=this.stickersPreload[a],n[0]>=t&&n[0]<=t+i&&(this.replaceStickerImage(n[1]),this.stickersPreload.splice(a,1),a--,s--);this.cat!==r&&r!==!1&&($(".active",this.categoriesEl).removeClass("active"),this.cat=r,this.activateStickerCategory())},EmojiTooltip.prototype.activateStickerCategory=function(){var e=this.categoriesEl[1],t=e.childNodes[this.cat];if(t){$(t).addClass("active");var n=t.offsetLeft,a=t.offsetWidth,i=e.clientWidth;$(e).animate({scrollLeft:n-(i-a)/2},200)}},EmojiTooltip.prototype.updatePosition=function(){var e=this.btnEl.offset();this.tooltipEl.css({top:e.top,left:e.left})},EmojiTooltip.prototype.show=function(){this.updatePosition(),this.tab?this.updateStickersContents(!0):this.updateEmojiContents(),this.tooltipEl.addClass("composer_emoji_tooltip_shown"),this.btnEl.addClass("composer_emoji_insert_btn_on"),delete this.showTimeout,this.shown=!0},EmojiTooltip.prototype.hide=function(){this.tooltipEl&&(this.tooltipEl.removeClass("composer_emoji_tooltip_shown"),this.btnEl.removeClass("composer_emoji_insert_btn_on")),delete this.hideTimeout,delete this.shown},EmojiPanel.prototype.update=function(){var e=[],t=this,n=Config.Mobile?26:20;EmojiHelper.getPopularEmoji(function(a){var i,o,s,r,l,c,d,u,p=a.length;for(c=0;p>c;c++)i=a[c].code,(o=Config.Emoji[i])&&(s=EmojiHelper.spritesheetPositions[i],l=s[0],r=s[1],d=n*s[3],u=n*s[2],e.push(''));t.containerEl.html(e.join(""))})},MessageComposer.autoCompleteRegEx=/(\s|^)(:|@|\/)([A-Za-z0-9\-\+\*@_]*)$/,MessageComposer.prototype.setUpInput=function(){if("contentEditable"in document.body?this.setUpRich():this.setUpPlaintext(),!Config.Mobile){var e=getScrollWidth();e&&(this.richTextareaEl||this.textareaEl).css({marginRight:-e})}},MessageComposer.prototype.setUpRich=function(){this.textareaEl.hide(),this.richTextareaEl=$('
'),this.textareaEl[0].parentNode.insertBefore(this.richTextareaEl[0],this.textareaEl[0]),this.richTextareaEl.on("keyup keydown",this.onKeyEvent.bind(this)),this.richTextareaEl.on("focus blur",this.onFocusBlur.bind(this)),this.richTextareaEl.on("paste",this.onRichPaste.bind(this)),this.richTextareaEl.on("DOMNodeInserted",this.onRichPasteNode.bind(this)),$(document.body).on("keydown",this.backupSelection.bind(this))},MessageComposer.prototype.setUpPlaintext=function(){this.textareaEl.on("keyup keydown",this.onKeyEvent.bind(this)),this.textareaEl.on("focus blur",this.onFocusBlur.bind(this))},MessageComposer.prototype.onKeyEvent=function(e){if("keyup"==e.type){this.checkAutocomplete();var t=!1;if(this.richTextareaEl){clearTimeout(this.updateValueTO);var n=tsNow();void 0===this.keyupStarted&&(this.keyupStarted=n),n-this.keyupStarted>1e4?this.onChange():(t=this.richTextareaEl[0].textContent.length,this.wasEmpty!=!t?(this.wasEmpty=!this.wasEmpty,this.onChange()):this.updateValueTO=setTimeout(this.onChange.bind(this),1e3))}if(this.onTyping){var n=tsNow();n-this.lastTyping>5e3&&(t===!1&&(t=(this.richTextareaEl?this.richTextareaEl[0].textContent:this.textareaEl[0].value).length),t!=this.lastLength&&(this.lastTyping=n,this.lastLength=t,this.onTyping()))}}if("keydown"==e.type){var a=!this.autocompleteShown;if(this.autocompleteShown){if(38==e.keyCode||40==e.keyCode){var i=40==e.keyCode,o=$(this.autoCompleteEl).find(".composer_autocomplete_option_active");if(o.length){var s=o[0].parentNode,r=s[i?"nextSibling":"previousSibling"];if(o.removeClass("composer_autocomplete_option_active"),r)return $(r).find("a").addClass("composer_autocomplete_option_active"),this.scroller.scrollToNode(r),cancelEvent(e)}var l=this.autoCompleteEl[0].childNodes,r=l[i?0:l.length-1];return this.scroller.scrollToNode(r),$(r).find("a").addClass("composer_autocomplete_option_active"),cancelEvent(e)}if(13==e.keyCode||9==e.keyCode){var o=$(this.autoCompleteEl).find(".composer_autocomplete_option_active");o.length||9!=e.keyCode||(o=$(this.autoCompleteEl[0].childNodes[0]).find("a"));var c,d,u;if(c=o.attr("data-code"))return this.onEmojiSelected(c,!0),EmojiHelper.pushPopularEmoji(c),cancelEvent(e);if(d=o.attr("data-mention"))return this.onMentionSelected(d),cancelEvent(e);if(u=o.attr("data-command"))return this.onCommandSelected&&this.onCommandSelected(u,9==e.keyCode),cancelEvent(e);a=!0}}if(a&&13==e.keyCode){var p=!1,m=!0;if(this.getSendOnEnter&&!this.getSendOnEnter()&&(m=!1),m&&!e.shiftKey?p=!0:m||!e.ctrlKey&&!e.metaKey||(p=!0),p)return this.onMessageSubmit(e),cancelEvent(e)}}},MessageComposer.prototype.backupSelection=function(){if(delete this.selection,this.isActive)if(window.getSelection){var e=window.getSelection();e.getRangeAt&&e.rangeCount&&(this.selection=e.getRangeAt(0))}else document.selection&&document.selection.createRange&&(this.selection=document.selection.createRange())},MessageComposer.prototype.restoreSelection=function(){if(!this.selection)return!1;var e=!1;if(window.getSelection){var t=window.getSelection();t.removeAllRanges(),t.addRange(this.selection),e=!0}else document.selection&&this.selection.select&&(this.selection.select(),e=!0);return delete this.selection,e},MessageComposer.prototype.checkAutocomplete=function(e){var t,n;if(this.richTextareaEl){var a=this.richTextareaEl[0],i=getRichValueWithCaret(a),n=i[0],t=i[1]>=0?i[1]:n.length;t||this.cleanRichTextarea(n,!0)}else var a=this.textareaEl[0],t=getFieldSelection(a),n=a.value;e||(n=n.substr(0,t));var o=n.match(MessageComposer.autoCompleteRegEx);if(o){if(this.previousQuery==o[0])return;this.previousQuery=o[0];var s=SearchIndexManager.cleanSearchText(o[3]);if("@"==o[2])if(this.mentions&&this.mentions.index){if(s.length)for(var r,l=SearchIndexManager.search(s,this.mentions.index),c=[],d=0,u=this.mentions.users.length;u>d;d++)r=this.mentions.users[d],l[r.id]&&c.push(r);else var c=this.mentions.users;c.length?this.showMentionSuggestions(c):this.hideSuggestions()}else this.hideSuggestions();else if(o[1]||"/"!=o[2])":"==o[2]&&EmojiHelper.getPopularEmoji(function(e){if(s.length){var t=EmojiHelper.searchEmojis(s);if(t.length){for(var n,a,i=[],o=0,r=e.length;r>o&&(n=e[o].code,a=t.indexOf(n),!(a>=0)||(i.push(n),t.splice(a,1),t.length));o++);this.showEmojiSuggestions(i.concat(t))}else this.hideSuggestions()}else this.showEmojiSuggestions(e)}.bind(this));else if(this.commands&&this.commands.index){if(s.length)for(var p,l=SearchIndexManager.search(s,this.commands.index),m=[],d=0,u=this.commands.list.length;u>d;d++)p=this.commands.list[d],l[p.value]&&m.push(p);else var m=this.commands.list;m.length?this.showCommandsSuggestions(m):this.hideSuggestions()}else this.hideSuggestions()}else delete this.previousQuery,this.hideSuggestions()},MessageComposer.prototype.onFocusBlur=function(e){this.isActive="focus"==e.type,this.isActive?setTimeout(this.checkAutocomplete.bind(this),100):(this.cleanRichTextarea(),this.hideSuggestions()),this.richTextareaEl&&document.execCommand("enableObjectResizing",!this.isActive,!this.isActive)},MessageComposer.prototype.onRichPaste=function(e){var t,n=(e.originalEvent||e).clipboardData,a=n&&n.items||[];for(t=0;t0&&(this.richTextareaEl.html(""),this.lastLength=0,this.wasEmpty=!0,t)){var n=this;setZeroTimeout(function(){n.focus()})}},MessageComposer.prototype.onRichPasteNode=function(e){var t=(e.originalEvent||e).target,n=(t||{}).src||"",a=!1;if("data:"==n.substr(0,5)){a=!0;var i=dataUrlToBlob(n);this.onFilePaste(i),setZeroTimeout(function(){t.parentNode.replaceChild(document.createTextNode("   "),t)})}else if(n&&!n.match(/img\/blank\.gif/)){var o=document.createTextNode(" "+n+" ");setTimeout(function(){t.parentNode.replaceChild(o,t)},100)}},MessageComposer.prototype.onEmojiSelected=function(e,t){if(this.richTextareaEl){var n=this.richTextareaEl[0];if(this.isActive||this.restoreSelection()||setRichFocus(n),t){var a,i=getRichValueWithCaret(n),o=i[0],s=i[1]>=0?i[1]:o.length,r=o.substr(s),l=o.substr(0,s),c=l.match(/:([A-Za-z0-9\-\+\*_]*)$/),d=EmojiHelper.emojis[e];a=c&&c[0]?l.substr(0,c.index)+":"+d[1]+":":l+":"+d[1]+":",n.value=f;var u;r.length?(this.selId=(this.selId||0)+1,u=this.getRichHtml(a)+' '+this.getRichHtml(r),this.richTextareaEl.html(u),setRichFocus(n,$("#composer_sel"+this.selId)[0])):(u=this.getRichHtml(a)+" ",this.richTextareaEl.html(u),setRichFocus(n))}else{var u=this.getEmojiHtml(e);if(window.getSelection){var p=window.getSelection();if(p.getRangeAt&&p.rangeCount){var m=document.createElement("div");m.innerHTML=u;var g=m.firstChild,h=p.getRangeAt(0);h.deleteContents(),h.insertNode(document.createTextNode(" ")),h.insertNode(g),h.setStart(g,0),setTimeout(function(){h=document.createRange(),h.setStartAfter(g),h.collapse(!0),p.removeAllRanges(),p.addRange(h)},0)}}else document.selection&&"Control"!=document.selection.type&&document.selection.createRange().pasteHTML(u)}}else{var n=this.textareaEl[0],o=n.value,s=this.isActive?getFieldSelection(n):o.length,r=o.substr(s),l=o.substr(0,s),c=t&&l.match(/:([A-Za-z0-9\-\+\*_]*)$/),d=EmojiHelper.emojis[e];if(c&&c[0])var f=l.substr(0,c.index)+":"+d[1]+": "+r,_=c.index+d[1].length+3;else var f=l+":"+d[1]+": "+r,_=l.length+d[1].length+3;n.value=f,setFieldSelection(n,_)}this.hideSuggestions(),this.onChange()},MessageComposer.prototype.onMentionsUpdated=function(e){delete this.previousQuery,this.isActive&&this.checkAutocomplete()},MessageComposer.prototype.onMentionSelected=function(e){if(this.richTextareaEl){var t=this.richTextareaEl[0];this.isActive||this.restoreSelection()||setRichFocus(t);var n,a=getRichValueWithCaret(t),i=a[0],o=a[1]>=0?a[1]:i.length,s=i.substr(o),r=i.substr(0,o),l=r.match(/@([A-Za-z0-9\-\+\*_]*)$/);n=l&&l[0]?r.substr(0,l.index)+"@"+e:r+"@"+e,t.value=d;var c;s.length?(this.selId=(this.selId||0)+1,c=this.getRichHtml(n)+' '+this.getRichHtml(s),this.richTextareaEl.html(c),setRichFocus(t,$("#composer_sel"+this.selId)[0])):(c=this.getRichHtml(n)+" ",this.richTextareaEl.html(c),setRichFocus(t))}else{var t=this.textareaEl[0],i=t.value,o=this.isActive?getFieldSelection(t):i.length,s=i.substr(o),r=i.substr(0,o),l=r.match(/@([A-Za-z0-9\-\+\*_]*)$/);if(l&&l[0])var d=r.substr(0,l.index)+"@"+e+" "+s,u=l.index+e.length+2;else var d=r+":"+e+": "+s,u=r.length+e.length+2;t.value=d,setFieldSelection(t,u)}this.hideSuggestions(),this.onChange()},MessageComposer.prototype.onCommandSelected=function(e,t){if(t)if(this.richTextareaEl)this.richTextareaEl.html(encodeEntities(e)+" "),setRichFocus(this.richTextareaEl[0]);else{var n=this.textareaEl[0];n.value=e+" ",setFieldSelection(n)}else this.onCommandSend(e);this.hideSuggestions(),this.onChange()},MessageComposer.prototype.onChange=function(e){this.richTextareaEl&&(delete this.keyupStarted,this.textareaEl.val(getRichValue(this.richTextareaEl[0])).trigger("change"))},MessageComposer.prototype.getEmojiHtml=function(e,t){t=t||EmojiHelper.emojis[e];var n=20,a=EmojiHelper.spritesheetPositions[e],i=a[0],o=(a[1],n*a[3]),s=n*a[2];return':'+encodeEntities(t[1])+':'},MessageComposer.prototype.setValue=function(e){this.richTextareaEl?(this.richTextareaEl.html(this.getRichHtml(e)),this.lastLength=e.length,this.wasEmpty=!e.length,this.onKeyEvent({type:"keyup"})):this.textareaEl.val(e)},MessageComposer.prototype.setFocusedValue=function(e){var t=e[0],n=e[1],a=e[2];if(this.richTextareaEl){this.selId=(this.selId||0)+1;var i=this.getRichHtml(t)+''+this.getRichHtml(n)+""+this.getRichHtml(a);this.richTextareaEl.html(i),setRichFocus(this.richTextareaEl[0],$("#composer_sel"+this.selId)[0],!0)}else this.textareaEl.val(t+n+a),setFieldSelection(this.textareaEl[0],t.length,t.length+n.length)},MessageComposer.prototype.getRichHtml=function(e){return $("
").text(e).html().replace(/\n/g,"
").replace(/:([A-Za-z0-9\-\+\*_]+?):/gi,function(e,t){var n=EmojiHelper.shortcuts[t];return void 0!==n?this.getEmojiHtml(n):e}.bind(this))},MessageComposer.prototype.focus=function(){this.richTextareaEl?setZeroTimeout(function(){setRichFocus(this.richTextareaEl[0])}.bind(this)):setFieldSelection(this.textareaEl[0])},MessageComposer.prototype.blur=function(){this.richTextareaEl?this.richTextareaEl[0].blur():this.textareaEl[0].blur()},MessageComposer.prototype.renderSuggestions=function(e){this.autoCompleteEl.html(e.join("")),this.autoCompleteWrapEl.show(),this.scroller.reinit(),this.updatePosition(),this.autocompleteShown=!0},MessageComposer.prototype.showEmojiSuggestions=function(e){var t,n,a,i,o,s,r,l,c=[],d=Config.Mobile?26:20,u=Math.min(5,e.length);for(s=0;u>s;s++)t=e[s],t.code&&(t=t.code),(n=Config.Emoji[t])&&(a=EmojiHelper.spritesheetPositions[t],o=a[0],i=a[1],r=d*a[3],l=d*a[2],c.push('
  • :'+encodeEntities(n[1][0])+":
  • "));this.renderSuggestions(c)},MessageComposer.prototype.showMentionSuggestions=function(e){var t,n,a=[],i=e.length;for(n=0;i>n;n++)t=e[n],a.push('
  • '+t.rFullName+'@'+t.username+"
  • ");this.renderSuggestions(a);var o=this;this.autoCompleteEl.find(".composer_user_photo").each(function(e,t){o.getPeerImage($(t),t.getAttribute("data-user-id"))})},MessageComposer.prototype.showCommandsSuggestions=function(e){var t,n,a=[],i=Math.min(200,e.length);for(n=0;i>n;n++)t=e[n],a.push('
  • '+encodeEntities(t.value)+''+t.rDescription+"
  • ");this.renderSuggestions(a);var o=this,s={};this.autoCompleteEl.find(".composer_user_photo").each(function(e,t){var n=!0,a=t.getAttribute("data-user-id");s[a]||(s[a]=!0,n=!1),o.getPeerImage($(t),a,n)})},MessageComposer.prototype.updatePosition=function(){var e=(this.richTextareaEl||this.textareaEl).offset(),t=this.scroller.updateHeight(),n=$((this.richTextareaEl||this.textareaEl)[0].parentNode).outerWidth();this.autoCompleteWrapEl.css({top:e.top-t,left:Config.Mobile?0:e.left,width:Config.Mobile?"100%":n-2}),this.scroller.update()},MessageComposer.prototype.hideSuggestions=function(){this.autoCompleteWrapEl.hide(),delete this.autocompleteShown},MessageComposer.prototype.resetTyping=function(){this.lastTyping=0,this.lastLength=0},MessageComposer.prototype.setPlaceholder=function(e){(this.richTextareaEl||this.textareaEl).attr("placeholder",e)},Scroller.prototype.setUpNano=function(){this.content.wrap('
    '),this.scrollable=$(this.content[0].parentNode),this.scroller=$(this.scrollable[0].parentNode),this.wrap=$(this.scroller[0].parentNode),this.scroller.nanoScroller({preventPageScrolling:!0,tabIndex:-1})},Scroller.prototype.setUpNative=function(){this.content.wrap('
    '),this.scrollable=$(this.content[0].parentNode),this.scrollable.css({overflow:"auto"}),this.maxHeight&&this.scrollable.css({maxHeight:this.maxHeight}),this.minHeight&&this.scrollable.css({minHeight:this.minHeight})},Scroller.prototype.onScroll=function(e){var t=this,n=this.scrollable[0];this.scrollable.on("scroll",function(a){t.isAnimatedScroll||e(n,n.scrollTop)})},Scroller.prototype.update=function(){this.useNano&&$(this.scroller).nanoScroller()},Scroller.prototype.reinit=function(){this.scrollTo(0),this.useNano&&setTimeout(function(){this.updateHeight()}.bind(this),100)},Scroller.prototype.updateHeight=function(){var e;return this.useNano?(this.maxHeight||this.minHeight?(e=this.content[0].offsetHeight,this.maxHeight&&e>this.maxHeight&&(e=this.maxHeight),this.minHeight&&e0){var a=this;this.isAnimatedScroll=!0,this.scrollable.animate({scrollTop:e},t,function(){delete a.isAnimatedScroll,a.useNano&&$(a.scroller).nanoScroller({flash:!0}),a.scrollable.trigger("scroll"),n&&n()})}else this.scrollable[0].scrollTop=e,this.useNano&&$(this.scroller).nanoScroller({flash:!0}),n&&n()},Scroller.prototype.scrollToNode=function(e){e=e[0]||e;var t=e.offsetTop-15,n=e.offsetHeight+30,a=this.scrollable[0].scrollTop,i=this.scrollable[0].clientHeight;a>t?this.scrollTo(t):t+n-i>a&&this.scrollTo(t+n-i)},angular.module("myApp.directives",["myApp.filters"]).constant("shouldFocusOnInteraction",!Config.Navigator.mobile).directive("myHead",function(){return{restrict:"AE",templateUrl:templateUrl("head")}}).directive("myLangFooter",function(){return{restrict:"AE",templateUrl:templateUrl("lang_footer")}}).directive("myFooter",function(){return{restrict:"AE",templateUrl:templateUrl("footer")}}).directive("myDialog",function(){return{restrict:"AE",templateUrl:templateUrl("dialog")}}).directive("myMessage",["$filter","_",function(e,t){function n(e,t,n){ diff --git a/webogram.appcache b/webogram.appcache index fe424542..6dcc76f2 100644 --- a/webogram.appcache +++ b/webogram.appcache @@ -1,5 +1,5 @@ CACHE MANIFEST -# Time: Mon Jan 04 2016 23:04:09 GMT+0100 (CET) +# Time: Mon Jan 04 2016 23:15:01 GMT+0100 (CET) CACHE: