diff --git a/app/css/app.css b/app/css/app.css index e32f5e72..a9a161b8 100644 --- a/app/css/app.css +++ b/app/css/app.css @@ -425,7 +425,7 @@ input[type="number"] { .modal-close-button i { display: inline-block; background: url(../img/icons/IconsetW.png) -15px -320px no-repeat; - background-size: 42px 891px; + background-size: 42px 971px; width: 12px; height: 12px; margin: 21px; @@ -877,7 +877,7 @@ input.tg_range::-moz-range-thumb { font-size: 12px; line-height: normal; background: #F2F2F2 url(../img/icons/IconsetW.png) -6px -205px no-repeat; - background-size: 42px 891px; + background-size: 42px 971px; border: 1px solid #F2F2F2; border-radius: 3px; padding: 6px 20px 6px 30px; @@ -905,7 +905,7 @@ input.tg_range::-moz-range-thumb { height: 13px; vertical-align: text-top; background: url(../img/icons/IconsetW.png) -15px -192px no-repeat; - background-size: 42px 891px; + background-size: 42px 971px; opacity: 0.6; } .is_1x .im_dialogs_search_clear { @@ -1111,7 +1111,7 @@ a.im_dialog_selected .im_dialog_date { margin-left: 6px; background: url(../img/icons/IconsetW.png) -17px -444px no-repeat; - background-size: 42px 891px; + background-size: 42px 971px; } .is_1x .icon-caret { background-image: url(../img/icons/IconsetW_1x.png); @@ -1194,57 +1194,7 @@ a.im_dialog_selected .im_dialog_date { .non_osx .im_message_fwd_author { font-size: 12px; } -.im_grouped_short .im_message_from_photo, -.im_grouped_short .im_message_author, -.im_grouped .im_message_from_photo, -.im_grouped .im_message_author, -.im_grouped_fwd .im_message_author, -.im_grouped_fwd .im_message_from_photo, -.im_grouped_fwd_short .im_message_author, -.im_grouped_fwd_short .im_message_from_photo { - display: none; -} -.im_grouped_short .im_message_body, -.im_grouped .im_message_body, -.im_grouped_fwd .im_message_body, -.im_grouped_fwd_short .im_message_body { - margin-left: 46px; -} -.im_grouped_short .im_content_message_select_area, -.im_grouped .im_content_message_select_area { - height: 34px; -} -.im_history_appending .im_content_message_select_area { - height: 52px; -} -.im_grouped_short .icon-select-tick, -.im_grouped_fwd_short .icon-select-tick { - margin-top: 5px; -} -.im_grouped_short .icon-message-status, -.im_grouped_fwd_short .icon-message-status { - margin-top: 5px; -} -.im_grouped_fwd .im_message_fwd_from, -.im_grouped_fwd_short .im_message_fwd_from { - display: none; -} -.im_grouped_short .im_message_fwd .im_message_date, -.im_grouped .im_message_fwd .im_message_date, -.im_grouped_fwd .im_message_fwd .im_message_date, -.im_grouped_fwd_short .im_message_fwd .im_message_date { - display: none; -} - -.im_grouped_fwd .im_message_fwd, -.im_grouped_fwd_short .im_message_fwd { - margin-top: 8px; -} -.im_grouped_fwd .im_message_fwd, -.im_grouped_fwd_short .im_message_fwd { - margin-top: 8px; -} .im_message_from_photo, .im_message_contact_photo, @@ -1323,7 +1273,7 @@ div.im_message_video_thumb { height: 42px; background: url(../img/icons/IconsetW.png) 0 -590px no-repeat; - background-size: 42px 891px; + background-size: 42px 971px; z-index: 1; } .is_1x .icon-videoplay { @@ -1350,7 +1300,7 @@ div.im_message_video_thumb { height: 19px; background: url(../img/icons/IconsetW.png) -14px -389px no-repeat; - background-size: 42px 891px; + background-size: 42px 971px; } .is_1x .icon-geo-point { background-image: url(../img/icons/IconsetW_1x.png); @@ -1392,13 +1342,15 @@ div.im_message_video_thumb { } .im_message_document, -.im_message_audio, .im_message_upload_file { margin-top: 3px; border-radius: 3px; display: inline-block; width: 340px; } +.im_message_audio { + margin-top: 3px; +} .icon-document, .icon-photo, .icon-video { @@ -1409,7 +1361,7 @@ div.im_message_video_thumb { vertical-align: text-top; background: #F2F2F2 url(../img/icons/IconsetW.png) -2px -229px no-repeat; - background-size: 42px 891px; + background-size: 42px 971px; border-radius: 3px; margin-right: 10px; } @@ -1478,44 +1430,39 @@ img.im_message_document_thumb { color: #999; padding-left: 2px; } -.im_message_document_actions a { +.im_message_document_actions a, +.audio_player_actions a { margin-right: 10px; } - -.icon-audio { - display: block; - float: left; +.audio_player_button { width: 38px; height: 38px; - vertical-align: text-top; - - background: #F2F2F2 url(../img/icons/IconsetW.png) -2px -277px no-repeat; - background-size: 42px 891px; border-radius: 3px; - margin-right: 10px; + margin-right: 12px; +} +.audio_player_btn_icon { + display: block; + width: 13px; + height: 18px; + background: url(../img/icons/IconsetW.png) -15px -898px no-repeat; + background-size: 42px 971px; } -.is_1x .icon-audio { +.is_1x .audio_player_btn_icon { background-image: url(../img/icons/IconsetW_1x.png); } -.im_message_selected .icon-audio, -.im_history_selectable .im_message_outer_wrap:hover .icon-audio { - background-color: #dae6f0; - background-position: -2px -697px; +.audio_player_btn_icon_pause { + background-position: -15px -924px; } - - -.im_message_audio_info { - float: left; - width: 292px; +.audio_player_btn_icon_cancel { + background-position: -15px -948px; } -.im_message_audio_name_wrap { +.audio_player_title_wrap { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; - width: 290px; padding: 0 0 1px; } -.im_message_audio_name { +.audio_player_title { color: #222; display: inline-block; font-weight: bold; @@ -1525,25 +1472,33 @@ img.im_message_document_thumb { white-space: nowrap; text-overflow: ellipsis; } -.im_message_audio_duration, -.im_message_audio_size { +.audio_player_title:hover { + color: #222; +} +.audio_player_meta { + overflow: hidden; + vertical-align: text-top; + display: inline-block; +} +.audio_player_size, +.audio_player_duration { color: #999; padding-left: 2px; } -.im_message_audio_info audio { - width: 100%; - height: 38px; - line-height: 38px; -} .im_message_upload_progress_wrap, .im_message_download_progress_wrap { margin-top: 5px; width: 290px; } +.audio_player_progress_wrap { + margin-top: 5px; + max-width: 290px; + border-radius: 2px; + overflow: hidden; +} .im_message_document_thumbed .im_message_document_name_wrap, -.im_message_document_thumbed .im_message_audio_name_wrap, .im_message_document_thumbed .im_message_upload_progress_wrap, .im_message_document_thumbed .im_message_download_progress_wrap { width: 230px; @@ -1566,7 +1521,8 @@ img.im_message_document_thumb { } .tg_up_progress, -.tg_down_progress { +.tg_down_progress, +.tg_play_progress { height: 5px; margin: 0; padding: 0; @@ -1577,7 +1533,8 @@ img.im_message_document_thumb { box-shadow: none; } .tg_up_progress .progress-bar, -.tg_down_progress .progress-bar { +.tg_down_progress .progress-bar, +.tg_play_progress .progress-bar { height: 5px; line-height: 5px; background: #6B9ABD; @@ -1586,6 +1543,18 @@ img.im_message_document_thumb { -webkit-box-shadow: none; box-shadow: none; } +.tg_play_progress { + background: #e4e9ed; + border-radius: 2px; +} +.tg_play_progress .progress-bar { + background: #628fb2; + border-radius: 2px; + /*-webkit-transition: width 1s linear; + transition: width 1s linear;*/ + -webkit-transition: none; + transition: none; +} @@ -1626,24 +1595,11 @@ div.im_message_body { display: block; overflow: hidden; } -.im_message_fwd_from { - margin-top: 5px; -} -.im_grouped .im_message_fwd_from { - margin-top: 0; -} -.im_message_fwd { - margin-top: 4px; - margin-bottom: 4px; -} a.im_message_fwd_photo { position: absolute; margin-top: 1px; } -.im_message_fwd_author { - margin-right: 5px; -} .im_message_fwd_date { padding: 0; } @@ -1758,7 +1714,7 @@ textarea.im_message_field { height: 23px; vertical-align: text-top; background: url(../img/icons/IconsetW.png) -12px -68px no-repeat; - background-size: 42px 891px; + background-size: 42px 971px; opacity: 0.8; } .is_1x .icon-paperclip { @@ -1786,7 +1742,7 @@ textarea.im_message_field { height: 23px; vertical-align: text-top; background: url(../img/icons/IconsetW.png) -10px -4px no-repeat; - background-size: 42px 891px; + background-size: 42px 971px; opacity: 0.8; } .is_1x .icon-emoji { @@ -1835,7 +1791,7 @@ textarea.im_message_field { height: 21px; vertical-align: text-top; background: url(../img/icons/IconsetW.png) -9px -132px no-repeat; - background-size: 42px 891px; + background-size: 42px 971px; opacity: 0.8; } .is_1x .icon-camera { @@ -2174,7 +2130,7 @@ a:hover .icon-twitter { font-size: 12px; line-height: normal; background: url(../img/icons/IconsetW.png) -6px -205px no-repeat; - background-size: 42px 891px; + background-size: 42px 971px; border: 1px solid #d9dbde; border-radius: 3px; padding: 6px 15px 6px 30px; @@ -2193,7 +2149,7 @@ a:hover .icon-twitter { height: 13px; vertical-align: text-top; background: url(../img/icons/IconsetW.png) -15px -192px no-repeat; - background-size: 42px 891px; + background-size: 42px 971px; opacity: 0.6; } .is_1x .contacts_modal_search_clear { @@ -2309,7 +2265,7 @@ img.chat_modal_participant_photo { width: 25px; height: 25px; background: url(../img/icons/IconsetW.png) -9px -516px no-repeat; - background-size: 42px 891px; + background-size: 42px 971px; opacity: 0.5; } .is_1x .icon-contact-tick { @@ -2378,8 +2334,8 @@ img.chat_modal_participant_photo { .im_message_focus .im_message_date, .im_message_focus .im_message_document_size, -.im_message_focus .im_message_audio_duration, -.im_message_focus .im_message_audio_size, +.im_message_focus .audio_player_duration, +.im_message_focus .audio_player_size, .im_message_focus .im_message_fwd_date { color: #68839c; } @@ -2390,7 +2346,7 @@ img.chat_modal_participant_photo { height: 26px; margin: 13px 0 0 40px; background: url(../img/icons/IconsetW.png) -9px -516px no-repeat; - background-size: 42px 891px; + background-size: 42px 971px; } .is_1x .icon-select-tick { background-image: url(../img/icons/IconsetW_1x.png); @@ -2509,7 +2465,7 @@ ce671b orange font-size: 12px; line-height: normal; background: #F2F2F2 url(../img/icons/IconsetW.png) -6px -205px no-repeat; - background-size: 42px 891px; + background-size: 42px 971px; border: 1px solid #F2F2F2; border-radius: 3px; padding: 6px 20px 6px 30px; @@ -2532,7 +2488,7 @@ ce671b orange height: 13px; vertical-align: text-top; background: url(../img/icons/IconsetW.png) -15px -192px no-repeat; - background-size: 42px 891px; + background-size: 42px 971px; opacity: 0.6; } .is_1x .countries_modal_search_clear { diff --git a/app/css/desktop.css b/app/css/desktop.css index c493c6bf..5239d708 100644 --- a/app/css/desktop.css +++ b/app/css/desktop.css @@ -462,6 +462,9 @@ a.footer_lang_link.active:active { } +.im_message_fwd_author { + margin-right: 5px; +} .im_message_fwd .im_message_fwd_author_wrap, .im_message_fwd .im_message_text, .im_message_fwd .im_message_media { @@ -788,6 +791,70 @@ div.im_panel_own_photo { } } +/* Groupings */ +.im_message_fwd_from { + margin-top: 5px; +} +.im_grouped .im_message_fwd_from { + margin-top: 0; +} +.im_message_fwd { + margin-top: 4px; + margin-bottom: 4px; +} +.im_grouped_short .im_message_from_photo, +.im_grouped_short .im_message_author, +.im_grouped .im_message_from_photo, +.im_grouped .im_message_author, +.im_grouped_fwd .im_message_author, +.im_grouped_fwd .im_message_from_photo, +.im_grouped_fwd_short .im_message_author, +.im_grouped_fwd_short .im_message_from_photo { + display: none; +} +.im_grouped_short .im_message_body, +.im_grouped .im_message_body, +.im_grouped_fwd .im_message_body, +.im_grouped_fwd_short .im_message_body { + margin-left: 46px; +} +.im_grouped_short .im_content_message_select_area, +.im_grouped .im_content_message_select_area { + height: 34px; +} +.im_history_appending .im_content_message_select_area { + height: 52px; +} +.im_grouped_short .icon-select-tick, +.im_grouped_fwd_short .icon-select-tick { + margin-top: 5px; +} +.im_grouped_short .icon-message-status, +.im_grouped_fwd_short .icon-message-status { + margin-top: 5px; +} +.im_grouped_fwd .im_message_fwd_from, +.im_grouped_fwd_short .im_message_fwd_from { + display: none; +} + +.im_grouped_short .im_message_fwd .im_message_date, +.im_grouped .im_message_fwd .im_message_date, +.im_grouped_fwd .im_message_fwd .im_message_date, +.im_grouped_fwd_short .im_message_fwd .im_message_date { + display: none; +} + +.im_grouped_fwd .im_message_fwd, +.im_grouped_fwd_short .im_message_fwd { + margin-top: 8px; +} +.im_grouped_fwd .im_message_fwd, +.im_grouped_fwd_short .im_message_fwd { + margin-top: 8px; +} + + .tooltip-inner { background: rgba(0,0,0, 0.8); } diff --git a/app/css/mobile.css b/app/css/mobile.css index 40be67e9..6498017d 100644 --- a/app/css/mobile.css +++ b/app/css/mobile.css @@ -39,8 +39,6 @@ html { } .tg_page_head .navbar-inverse .navbar-toggle:hover, -/*.tg_page_head .navbar-inverse .navbar-toggle:active,*/ -.tg_page_head .navbar-inverse .navbar-toggle:focus, .tg_page_head .navbar-inverse .open .navbar-toggle { background-color: rgba(0,0,0,0.1); } @@ -331,14 +329,12 @@ html { } -.im_message_body, -.im_message_document { +.im_message_body { padding: 7px 10px; border-radius: 3px; background: #f1f1f1; } -.im_message_out .im_message_body, -.im_message_out .im_message_document { +.im_message_out .im_message_body { background: #e4ecf2; } .im_message_body_media, @@ -348,7 +344,8 @@ html { background: none; } .im_message_selected .im_message_body, -.im_message_selected .im_message_document { +.im_message_selected .im_message_document, +.im_message_selected .im_message_audio { background: #497495; color: #FFF; } @@ -357,68 +354,44 @@ html { color: inherit; } -.im_message_fwd .im_message_body, -.im_message_fwd .im_message_document { - padding: 7px 8px; -} -.im_grouped_fwd_start .im_message_body, -.im_grouped_fwd_short .im_message_body, -.im_grouped_fwd .im_message_body, -.im_grouped .im_message_fwd .im_message_body, -.im_grouped_fwd_start .im_message_document, -.im_grouped_fwd_short .im_message_document, -.im_grouped_fwd .im_message_document, -.im_grouped .im_message_fwd .im_message_document { - border-radius: 0; -} - -.im_grouped_fwd_start .im_message_fwd .im_message_body, -.im_grouped_fwd_start .im_message_fwd .im_message_document { - border-radius: 3px 3px 0 0; +.im_service_message { + font-size: 13px; } -.im_grouped_fwd_end .im_message_fwd .im_message_body, -.im_grouped_fwd_end .im_message_fwd .im_message_document { - border-radius: 0 0 3px 3px; +.audio_player_button { + margin-right: 8px; } - -.im_message_fwd .im_message_text { - min-height: 21px; +.im_message_body_media .im_message_document, +.im_message_body_media .im_message_audio { + padding: 5px; + border-radius: 3px; + background: #f1f1f1; + margin-top: 0; } -.im_grouped_fwd .im_message_text, -.im_grouped_fwd_short .im_message_text { - min-height: 0; +.im_message_body_media a.im_message_photo_thumb, +.im_message_body_media .im_message_video { + margin-top: 0; } - -.im_service_message { - font-size: 13px; +.im_message_out .im_message_body_media .im_message_document, +.im_message_out .im_message_body_media .im_message_audio { + background: #e4ecf2; } .im_message_document { - padding: 5px; width: auto; max-width: 250px; - margin-top: 0; } -.im_message_audio, .im_message_document { position: relative; } -.im_message_audio > a, .im_message_document .icon-document, -.im_message_audio .icon-audio, .im_message_document_thumb_wrap { position: absolute; } -.im_message_out .im_message_audio .icon-audio, .im_message_out .im_message_document .icon-document { background-color: #e4ecf2; } .im_message_document_thumb_wrap { background-color: transparent; } -.im_message_audio_done i { - display: none; -} -.im_message_audio_info, .im_message_document_info { float: none; margin-left: 43px; @@ -428,25 +401,6 @@ html { .im_message_document_thumbed .im_message_document_info { margin-left: 110px; } -.im_message_audio_name, -.im_message_audio_duration { - display: inline; - vertical-align: baseline; - line-height: 38px; -} -.im_message_audio_progress .im_message_audio_name, -.im_message_audio_progress .im_message_audio_duration { - line-height: 18px; -} -.im_message_audio_done .im_message_audio_info { - margin-left: 0; - width: auto; - float: none; -} -.im_message_audio_player_wrap { - height: 38px; - line-height: 38px; -} .im_message_document_size { display: block; padding-left: 0; @@ -454,13 +408,11 @@ html { .im_message_document_thumbed .im_message_document_info { min-height: 100px; } -.im_message_document_info .cancelable_progress_wrap, -.im_message_audio_info .cancelable_progress_wrap { +.im_message_document_info .cancelable_progress_wrap { margin-top: 4px; } .im_message_document_thumbed .im_message_document_name_wrap, -.im_message_document_name_wrap, -.im_message_audio_name_wrap { +.im_message_document_name_wrap { width: auto; } .im_message_document_progress .im_message_document_size { @@ -504,10 +456,7 @@ img.im_message_video_thumb, .im_message_document_thumb_wrap { position: absolute; } -.im_grouped_short .im_message_body, -.im_grouped .im_message_body, -.im_grouped_fwd .im_message_body, -.im_grouped_fwd_short .im_message_body { +.im_grouped .im_message_body { margin-left: 0; } @@ -551,42 +500,19 @@ img.im_message_video_thumb, padding-left: 0; padding-right: 42px; } -.im_message_fwd.im_content_message_wrap { - float: none; -} .im_history_messages_group .im_message_in.im_content_message_wrap, .im_history_messages_group .im_grouped_short .im_message_in.im_content_message_wrap, -.im_history_messages_group .im_grouped .im_message_in.im_content_message_wrap, -.im_history_messages_group .im_grouped_fwd .im_message_in.im_content_message_wrap, -.im_history_messages_group .im_grouped_fwd_short .im_message_in.im_content_message_wrap { +.im_history_messages_group .im_grouped .im_message_in.im_content_message_wrap { padding-left: 45px; } -.im_grouped_short .im_message_out.im_message_fwd, -.im_grouped .im_message_out.im_message_fwd, -.im_grouped_fwd .im_message_out.im_message_fwd, -.im_grouped_fwd_short .im_message_out.im_message_fwd { - padding-left: 80px; -} .im_grouped_short .im_content_message_wrap, .im_grouped .im_content_message_wrap { margin-top: 0; } -.im_grouped_fwd_start .im_message_fwd.im_content_message_wrap, -.im_grouped_short .im_message_fwd.im_content_message_wrap, -.im_grouped .im_message_fwd.im_content_message_wrap, -.im_grouped_fwd .im_message_fwd.im_content_message_wrap, -.im_grouped_fwd_short .im_message_fwd.im_content_message_wrap { - margin-top: 0; - margin-bottom: 0; -} -.im_grouped_fwd_start .im_message_fwd.im_content_message_wrap { - margin-top: 8px; -} -.im_grouped_fwd_end .im_message_fwd.im_content_message_wrap { - margin-bottom: 8px; +.im_message_fwd_header { + font-size: 12px; } - .im_message_meta { float: none; position: absolute; @@ -602,18 +528,6 @@ img.im_message_video_thumb, left: 0; } -.im_grouped_fwd .im_message_meta, -.im_grouped_fwd_short .im_message_meta, -.im_grouped_fwd_start .im_message_meta { - display: none; -} -.im_grouped_fwd_end .im_message_meta { - display: block; -} -.im_grouped_fwd_end .im_message_fwd .im_message_date { - display: inline; -} - .im_message_out .im_message_fwd_date { color: #93a2ae; } @@ -624,27 +538,21 @@ img.im_message_video_thumb, background-color: #dae6f0; background-position: -2px -542px; } -.im_message_out .icon-audio, -.im_history_selectable .im_message_outer_wrap:hover .icon-audio { - background-color: #dae6f0; - background-position: -2px -697px; -} - .im_message_out .im_message_document_size, -.im_message_out .im_message_audio_duration, -.im_message_out .im_message_audio_size, +.im_message_out .audio_player_duration, +.im_message_out .audio_player_size, .im_message_out .im_message_fwd_date, .im_message_selected .im_message_document_size, -.im_message_selected .im_message_audio_duration, -.im_message_selected .im_message_audio_size, +.im_message_selected .audio_player_duration, +.im_message_selected .audio_player_size, .im_message_selected .im_message_fwd_date, .im_message_focus .im_message_document_size, -.im_message_focus .im_message_audio_duration, -.im_message_focus .im_message_audio_size, +.im_message_focus .audio_player_duration, +.im_message_focus .audio_player_size, .im_message_focus .im_message_fwd_date, .im_history_selectable .im_message_outer_wrap:hover .im_message_document_size, -.im_history_selectable .im_message_outer_wrap:hover .im_message_audio_duration, -.im_history_selectable .im_message_outer_wrap:hover .im_message_audio_size, +.im_history_selectable .im_message_outer_wrap:hover .audio_player_duration, +.im_history_selectable .im_message_outer_wrap:hover .audio_player_size, .im_history_selectable .im_message_outer_wrap:hover .im_message_fwd_date { color: #68839c; } @@ -853,15 +761,15 @@ a.im_dialog_selected .im_dialog_message_text { } .im_message_selected .im_message_body a, .im_message_selected .im_message_fwd_title, -.im_message_selected .im_message_audio_name, +.im_message_selected .im_message_fwd_date, .im_message_selected .im_message_document_name, .im_message_selected .im_message_document_size, -.im_message_selected .im_message_audio_duration, -.im_message_selected .im_message_audio_size, -.im_message_selected .im_message_fwd_date, +.im_message_selected .audio_player_title, +.im_message_selected .audio_player_duration, +.im_message_selected .audio_player_size, .im_history_selectable .im_message_selected:hover .im_message_document_size, -.im_history_selectable .im_message_selected:hover .im_message_audio_duration, -.im_history_selectable .im_message_selected:hover .im_message_audio_size, +.im_history_selectable .im_message_selected:hover .audio_player_duration, +.im_history_selectable .im_message_selected:hover .audio_player_size, .im_history_selectable .im_message_selected:hover .im_message_fwd_date { color: #FFF; } @@ -870,13 +778,6 @@ a.im_dialog_selected .im_dialog_message_text { a.im_message_fwd_author { color: #323232; } -.im_message_fwd .im_message_fwd_author_wrap, -.im_message_fwd .im_message_text, -.im_message_fwd .im_message_media { - margin-left: 50px; -} - - .im_dialogs_scrollable_wrap a.im_dialog:hover, .im_dialogs_scrollable_wrap a.im_dialog_selected, diff --git a/app/img/icons/IconsetW.png b/app/img/icons/IconsetW.png index 1f358805..c73d904d 100644 Binary files a/app/img/icons/IconsetW.png and b/app/img/icons/IconsetW.png differ diff --git a/app/img/icons/IconsetW_1x.png b/app/img/icons/IconsetW_1x.png index c6000d3d..bc1341e4 100644 Binary files a/app/img/icons/IconsetW_1x.png and b/app/img/icons/IconsetW_1x.png differ diff --git a/app/img/screenshot1_tile.png b/app/img/screenshot1_tile.png deleted file mode 100644 index 24346517..00000000 Binary files a/app/img/screenshot1_tile.png and /dev/null differ diff --git a/app/index.html b/app/index.html index 391f44f3..e689cb35 100644 --- a/app/index.html +++ b/app/index.html @@ -50,6 +50,7 @@ + diff --git a/app/js/app.js b/app/js/app.js index 3f4f3b4a..1c0c4995 100644 --- a/app/js/app.js +++ b/app/js/app.js @@ -13,6 +13,7 @@ angular.module('myApp', [ 'ngSanitize', 'ngTouch', 'ui.bootstrap', + 'mediaPlayer', 'izhukov.utils', 'izhukov.mtproto', 'izhukov.mtproto.wrapper', diff --git a/app/js/directives.js b/app/js/directives.js index 36d2f5e5..8cc50882 100644 --- a/app/js/directives.js +++ b/app/js/directives.js @@ -1482,27 +1482,6 @@ angular.module('myApp.directives', ['myApp.filters']) } }) - .directive('myAudioAutoplay', function() { - - return { - link: link, - scope: { - audio: '=' - } - }; - - function link ($scope, element, attrs) { - $scope.$watch('audio.autoplay', function (autoplay) { - if (autoplay) { - element.autoplay = true; - element[0].play(); - } else { - element.autoplay = false; - } - }); - } - }) - .directive('myFocused', function(){ return { link: function($scope, element, attrs) { @@ -1842,3 +1821,69 @@ angular.module('myApp.directives', ['myApp.filters']) } }) + + .directive('myAudioPlayer', function ($sce, $timeout, $q, FileManager, MtpApiFileManager) { + + return { + link: link, + scope: { + audio: '=' + }, + templateUrl: templateUrl('audio_player') + }; + + function downloadAudio (audio) { + var inputFileLocation = { + _: audio._ == 'document' ? 'inputDocumentFileLocation' : 'inputAudioFileLocation', + id: audio.id, + access_hash: audio.access_hash + }; + + audio.progress = {enabled: true, percent: 1, total: audio.size}; + + var downloadPromise = MtpApiFileManager.downloadFile(audio.dc_id, inputFileLocation, audio.size, {mime: 'audio/ogg'}); + + audio.progress.cancel = downloadPromise.cancel; + + return downloadPromise.then(function (url) { + delete audio.progress; + audio.rawUrl = url; + audio.url = $sce.trustAsResourceUrl(url); + }, function (e) { + console.log('audio download failed', e); + audio.progress.enabled = false; + }, function (progress) { + console.log('audio dl progress', progress); + audio.progress.done = progress.done; + audio.progress.percent = Math.max(1, Math.floor(100 * progress.done / progress.total)); + }); + } + + function link($scope, element, attrs) { + $scope.mediaPlayer = {}; + + $scope.download = function () { + ($scope.audio.rawUrl ? $q.when() : downloadAudio($scope.audio)).then( + function () { + FileManager.download($scope.audio.rawUrl, $scope.audio.mime_type || 'audio/ogg', $scope.audio.file_name || 'audio.ogg'); + } + ); + }; + + $scope.togglePlay = function () { + if ($scope.audio.url) { + $scope.mediaPlayer.player.playPause(); + } + else if ($scope.audio.progress && $scope.audio.progress.enabled) { + $scope.audio.progress.cancel(); + } + else { + downloadAudio($scope.audio).then(function () { + onContentLoaded(function () { + $scope.mediaPlayer.player.play(); + }) + }) + } + }; + } + }) diff --git a/app/js/filters.js b/app/js/filters.js index 452824cb..3ea481d1 100644 --- a/app/js/filters.js +++ b/app/js/filters.js @@ -104,6 +104,7 @@ angular.module('myApp.filters', ['myApp.i18n']) .filter('duration', [function() { return function (duration) { + duration = parseInt(duration); var secs = duration % 60, mins = Math.floor((duration - secs) / 60.0); diff --git a/app/js/locales/en-us.json b/app/js/locales/en-us.json index dde9fe2f..03d4cb1d 100644 --- a/app/js/locales/en-us.json +++ b/app/js/locales/en-us.json @@ -304,6 +304,7 @@ "login_controller_unknown_country": "Unknown", "message_forwarded_message": "Forwarded message", + "message_forwarded_message_mobile": "Forwarded from {from}, {date}", "message_attach_audio_message": "Voice message", "message_attach_audio_play": "Play", diff --git a/app/js/services.js b/app/js/services.js index cad86470..817e90e6 100644 --- a/app/js/services.js +++ b/app/js/services.js @@ -1809,6 +1809,9 @@ angular.module('myApp.services', ['myApp.i18n']) {noLinks: true, noLinebreaks: true} ); break; + + case 'messageMediaEmpty': + delete message.media; } } else if (message.action) { @@ -1839,7 +1842,8 @@ angular.module('myApp.services', ['myApp.i18n']) len = history.length, end = len, i, curDay, prevDay, curMessage, prevMessage, curGrouped, prevGrouped, - wasUpdated = false; + wasUpdated = false, + groupFwd = !Config.Mobile; if (limit > 0) { end = Math.min(limit, len); @@ -1874,12 +1878,12 @@ angular.module('myApp.services', ['myApp.i18n']) curMessage.date < prevMessage.date + 900) { var singleLine = curMessage.message && curMessage.message.length < 70 && curMessage.message.indexOf("\n") == -1; - if (curMessage.fwd_from_id && curMessage.fwd_from_id == prevMessage.fwd_from_id) { + if (groupFwd && curMessage.fwd_from_id && curMessage.fwd_from_id == prevMessage.fwd_from_id) { curMessage.grouped = singleLine ? 'im_grouped_fwd_short' : 'im_grouped_fwd'; } else { curMessage.grouped = !curMessage.fwd_from_id && singleLine ? 'im_grouped_short' : 'im_grouped'; } - if (curMessage.fwd_from_id) { + if (groupFwd && curMessage.fwd_from_id) { if (!prevMessage.grouped) { prevMessage.grouped = 'im_grouped_fwd_start'; } @@ -1890,7 +1894,7 @@ angular.module('myApp.services', ['myApp.i18n']) } else if (prevMessage || !i) { delete curMessage.grouped; - if (prevMessage && prevMessage.grouped && prevMessage.fwd_from_id) { + if (groupFwd && prevMessage && prevMessage.grouped && prevMessage.fwd_from_id) { prevMessage.grouped += ' im_grouped_fwd_end'; } } @@ -2328,8 +2332,8 @@ angular.module('myApp.services', ['myApp.i18n']) function wrapForHistory (photoID) { var photo = angular.copy(photos[photoID]) || {_: 'photoEmpty'}, - width = Math.min(windowW - 80, 260), - height = Math.min(windowH - 100, 260), + width = Math.min(windowW - 80, Config.Mobile ? 210 : 260), + height = Math.min(windowH - 100, Config.Mobile ? 210 : 260), thumbPhotoSize = choosePhotoSize(photo, width, height), thumb = { placeholder: 'img/placeholders/PhotoThumbConversation.gif', @@ -2506,8 +2510,8 @@ angular.module('myApp.services', ['myApp.i18n']) } var video = angular.copy(videos[videoID]), - width = Math.min(windowW - 80, windowW <= 479 ? 260 : 200), - height = Math.min(windowH - 100, windowW <= 479 ? 260 : 200), + width = Math.min(windowW - 80, Config.Mobile ? 210 : 200), + height = Math.min(windowH - 100, Config.Mobile ? 210 : 200), thumbPhotoSize = video.thumb, thumb = { placeholder: 'img/placeholders/VideoThumbConversation.gif', @@ -2677,6 +2681,7 @@ angular.module('myApp.services', ['myApp.i18n']) var doc = angular.copy(docs[docID]), isGif = doc.mime_type == 'image/gif', + isAudio = doc.mime_type.substr(0, 6) == 'audio/', width = isGif ? Math.min(windowW - 80, 260) : 100, height = isGif ? Math.min(windowH - 100, 260) : 100, thumbPhotoSize = doc.thumb, @@ -2711,6 +2716,9 @@ angular.module('myApp.services', ['myApp.i18n']) if (doc.withPreview && isGif) { doc.isSpecial = 'gif'; } + else if (isAudio) { + doc.isSpecial = 'audio'; + } return docsForHistory[docID] = doc; } @@ -2836,6 +2844,8 @@ angular.module('myApp.services', ['myApp.i18n']) }, updateDownloadProgress); historyAudio.progress.cancel = downloadPromise.cancel; + + return downloadPromise; } $rootScope.openAudio = openAudio; diff --git a/app/partials/desktop/audio_player.html b/app/partials/desktop/audio_player.html new file mode 100644 index 00000000..3a3a7d78 --- /dev/null +++ b/app/partials/desktop/audio_player.html @@ -0,0 +1,31 @@ +
+ +
+ + + + +
+ + + +
+
+
+ + +
+
+
+
+
+
+
+
+
+ +
\ No newline at end of file diff --git a/app/partials/desktop/message.html b/app/partials/desktop/message.html index b1fbb717..059e09ad 100644 --- a/app/partials/desktop/message.html +++ b/app/partials/desktop/message.html @@ -37,18 +37,18 @@ -
+
- +
-
+
diff --git a/app/partials/desktop/message_attach_audio.html b/app/partials/desktop/message_attach_audio.html index 959e58b7..14982b4f 100644 --- a/app/partials/desktop/message_attach_audio.html +++ b/app/partials/desktop/message_attach_audio.html @@ -1,31 +1,3 @@ -
- - - - - -
-
- - - -
-
- -
-
- -
-
-
-
-
-
-
- -
-
+
+
diff --git a/app/partials/desktop/message_attach_document.html b/app/partials/desktop/message_attach_document.html index cd1fd1a1..888626ca 100644 --- a/app/partials/desktop/message_attach_document.html +++ b/app/partials/desktop/message_attach_document.html @@ -2,6 +2,10 @@
+
+
+
+ -
+
@@ -29,19 +29,16 @@
-
+
-
-
Forwarded message
- -
- -
+
+ +
-
+
diff --git a/app/partials/mobile/message_attach_audio.html b/app/partials/mobile/message_attach_audio.html index 680beb0c..14982b4f 100644 --- a/app/partials/mobile/message_attach_audio.html +++ b/app/partials/mobile/message_attach_audio.html @@ -1,30 +1,3 @@ -
- - - - - -
-
- - Voice message - - - -
-
- Cancel -
-
-
-
-
-
-
- -
-
-
\ No newline at end of file +
+
+
diff --git a/app/partials/mobile/message_attach_document.html b/app/partials/mobile/message_attach_document.html index dca019ae..47913247 100644 --- a/app/partials/mobile/message_attach_document.html +++ b/app/partials/mobile/message_attach_document.html @@ -2,6 +2,10 @@
+
+
+
+
diff --git a/app/vendor/angular-media-player/angular-media-player.js b/app/vendor/angular-media-player/angular-media-player.js new file mode 100644 index 00000000..a5d8893b --- /dev/null +++ b/app/vendor/angular-media-player/angular-media-player.js @@ -0,0 +1,510 @@ +/** + * MDN references for hackers: + * =========================== + * Media events on