Browse Source

Improved search in history

Closes #1328
master
Igor Zhukov 8 years ago
parent
commit
694938a788
  1. BIN
      app/img/icons/IconsetW.png
  2. BIN
      app/img/icons/IconsetW_2x.png
  3. 6
      app/js/controllers.js
  4. 2
      app/js/locales/en-us.json
  5. 2
      app/less/app.less
  6. 39
      app/less/desktop.less
  7. 15
      app/partials/desktop/head.html

BIN
app/img/icons/IconsetW.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 13 KiB

BIN
app/img/icons/IconsetW_2x.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 28 KiB

6
app/js/controllers.js

@ -725,7 +725,11 @@ angular.module('myApp.controllers', ['myApp.i18n'])
}) })
$scope.$on('dialogs_multiupdate', function (e, dialogsUpdated) { $scope.$on('dialogs_multiupdate', function (e, dialogsUpdated) {
if ($scope.search.query !== undefined && $scope.search.query.length) { if (searchMessages) {
return false
}
if ($scope.search.query !== undefined &&
$scope.search.query.length) {
return false return false
} }

2
app/js/locales/en-us.json

@ -470,8 +470,6 @@
"im_open_settings": "Open settings", "im_open_settings": "Open settings",
"im_select_a_chat": "Please select a chat to start messaging", "im_select_a_chat": "Please select a chat to start messaging",
"im_loading_history": "Loading history", "im_loading_history": "Loading history",
"im_info": "Info",
"im_select": "Select",
"im_media": "Media", "im_media": "Media",
"im_media_photos": "Photos", "im_media_photos": "Photos",
"im_media_video": "Videos", "im_media_video": "Videos",

2
app/less/app.less

@ -4727,7 +4727,7 @@ a.countries_modal_search_clear {
body .im_dialogs_col_wrap, body .im_dialogs_col_wrap,
body .im_bottom_panel_wrap, body .im_bottom_panel_wrap,
body .tg_head_logo_wrap, body .tg_head_logo_wrap,
body .tg_head_msgs_edit_btn, body .tg_head_peer_search_btn,
body .tg_head_peer_return_btn, body .tg_head_peer_return_btn,
body .tg_head_peer_dropdown { body .tg_head_peer_dropdown {
display: none; display: none;

39
app/less/desktop.less

@ -272,8 +272,10 @@
} }
} }
.tg_head_msgs_edit_btn { .tg_head_peer_search_btn {
float: right; float: right;
padding-top: 15px;
padding-bottom: 15px;
} }
.tg_head_peer { .tg_head_peer {
@ -291,6 +293,10 @@
border-radius: 0; border-radius: 0;
padding: 9px 0; padding: 9px 0;
float: none;
right: 0;
left: auto;
margin: -1px 0 0 0; margin: -1px 0 0 0;
border: 1px solid rgba(15, 60, 96, 0.2); border: 1px solid rgba(15, 60, 96, 0.2);
@ -369,6 +375,37 @@
} }
} }
.icon-search {
display: inline-block;
width: 17px;
height: 17px;
.image-2x('../img/icons/IconsetW.png', 42px, 1171px);
background-position: -12px -1037px;
vertical-align: middle;
opacity: 0.9;
}
.tg_head_peer_media_dropdown {
.dropdown-toggle {
display: block;
.icon-bar {
display: block;
background-color: #d7e5f0;
width: 4px;
height: 4px;
border-radius: 2px;
margin-left: 3px;
margin-right: 3px;
& + .icon-bar {
margin-top: 2px;
}
}
}
}
.icon-filter { .icon-filter {
&-photos, &-photos,
&-video, &-video,

15
app/partials/desktop/head.html

@ -40,19 +40,26 @@
<div ng-switch-default ng-if="!!historyPeer.id" class="tg_head_main_peer_wrap"> <div ng-switch-default ng-if="!!historyPeer.id" class="tg_head_main_peer_wrap">
<a class="tg_head_btn tg_head_msgs_edit_btn" my-i18n="im_select" ng-click="toggleEdit()"></a>
<div class="tg_head_peer_dropdown tg_head_peer_media_dropdown dropdown" dropdown> <div class="tg_head_peer_dropdown tg_head_peer_media_dropdown dropdown" dropdown>
<a class="tg_head_btn dropdown-toggle" dropdown-toggle my-i18n="im_media"></a> <a class="tg_head_btn dropdown-toggle" dropdown-toggle>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li><a ng-click="toggleEdit()" my-i18n="head_select_messages"></a></li>
<li class="divider ng-scope"></li>
<li><a ng-click="toggleMedia('photos')" my-i18n="head_media_photos"></a></li> <li><a ng-click="toggleMedia('photos')" my-i18n="head_media_photos"></a></li>
<li><a ng-click="toggleMedia('video')" my-i18n="head_media_video"></a></li> <li><a ng-click="toggleMedia('video')" my-i18n="head_media_video"></a></li>
<li><a ng-click="toggleMedia('documents')" my-i18n="head_media_documents"></a></li> <li><a ng-click="toggleMedia('documents')" my-i18n="head_media_documents"></a></li>
<li><a ng-click="toggleMedia('audio')" my-i18n="head_media_audio"></a></li> <li><a ng-click="toggleMedia('audio')" my-i18n="head_media_audio"></a></li>
<li><a ng-click="toggleMedia('search')" my-i18n="head_media_search"></a></li>
</ul> </ul>
</div> </div>
<a class="tg_head_btn tg_head_peer_search_btn" ng-click="toggleMedia('search')">
<i class="icon icon-search"></i>
</a>
<a class="tg_head_btn tg_head_peer_return_btn" ng-show="historyFilter.mediaType.length || historyState.skipped" ng-click="returnToRecent()" ng-switch="historyState.skipped"> <a class="tg_head_btn tg_head_peer_return_btn" ng-show="historyFilter.mediaType.length || historyState.skipped" ng-click="returnToRecent()" ng-switch="historyState.skipped">
<span ng-switch-when="true" my-i18n="im_show_recent_messages"></span> <span ng-switch-when="true" my-i18n="im_show_recent_messages"></span>
<span ng-switch-default my-i18n="im_show_all_messages"></span> <span ng-switch-default my-i18n="im_show_all_messages"></span>

Loading…
Cancel
Save