Skip to content

Commit

Permalink
Merge pull request #651 from wireapp/dev
Browse files Browse the repository at this point in the history
staging bump 2017-01-20
  • Loading branch information
herrmannplatz authored Jan 20, 2017
2 parents ab07493 + 000d58e commit c29c027
Show file tree
Hide file tree
Showing 74 changed files with 1,452 additions and 588 deletions.
12 changes: 6 additions & 6 deletions app/page/auth.html
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,17 @@

<form id="form-account-register" class="form" data-bind="submit: register">
<div id="wire-register-name-container" class="form-control">
<input class="input name" id="wire-register-name" type="text" maxlength="64" spellcheck="false"
<input class="input name" id="wire-register-name" type="text" autocomplete="off" maxlength="64" spellcheck="false"
data-bind="css: {'input-error': failed_validation_name}, event: {input: clear_error}, l10n_tooltip: z.string.auth_placeholder_name, l10n_placeholder: z.string.auth_placeholder_name, textInput: name"
data-uie-name="enter-name" tabindex="1" dir="auto">
</div>
<div id="wire-register-email-container" class="form-control">
<input class="input email" id="wire-register-email" type="text" maxlength="128" spellcheck="false"
<input class="input email" id="wire-register-email" type="text" autocomplete="off" maxlength="128" spellcheck="false"
data-bind="css: {'input-error': failed_validation_email}, event: {input: clear_error}, l10n_tooltip: z.string.auth_placeholder_email, l10n_placeholder: z.string.auth_placeholder_email, textInput: username"
data-uie-name="enter-email" tabindex="2">
</div>
<div id="wire-register-password-container" class="form-control">
<input class="input password" id="wire-register-password" type="password" maxlength="1024"
<input class="input password" id="wire-register-password" type="password" autocomplete="off" maxlength="1024"
data-bind="css: {'input-error': failed_validation_password}, event: {input: clear_error_password}, l10n_tooltip: z.string.auth_placeholder_password_set, l10n_placeholder: z.string.auth_placeholder_password_set, textInput: password"
data-uie-name="enter-password" tabindex="3">
</div>
Expand Down Expand Up @@ -180,12 +180,12 @@
<div class="auth-headline" data-bind="l10n_text: z.string.auth_verify_account_headline"></div>
<div class="auth-headline-sub" data-bind="l10n_text: z.string.auth_verify_account_detail"></div>
<div id="wire-verify-account-email-container" class="form-control">
<input class="input email" id="wire-verify-account-email" type="text" maxlength="128" spellcheck="false"
<input class="input email" id="wire-verify-account-email" type="text" autocomplete="off" maxlength="128" spellcheck="false"
data-bind="css: {'input-error': failed_validation_email}, event: {input: clear_error}, l10n_tooltip: z.string.auth_placeholder_email, l10n_placeholder: z.string.auth_placeholder_email, textInput: username"
data-uie-name="enter-email">
</div>
<div id="wire-verify-account-password-container" class="form-control">
<input class="input password" id="wire-verify-account-password" type="password" maxlength="1024"
<input class="input password" id="wire-verify-account-password" type="password" maxlength="1024" autocomplete="off"
data-bind="css: {'input-error': failed_validation_password}, event: {input: clear_error_password}, l10n_tooltip: z.string.auth_placeholder_password_set, l10n_placeholder: z.string.auth_placeholder_password_set, textInput: password"
data-uie-name="enter-password">
</div>
Expand Down Expand Up @@ -262,7 +262,7 @@
<form id="form-verify-phone-password" class="form" data-bind="submit: verify_password">
<div class="auth-headline verify-password-text" data-bind="l10n_text: z.string.auth_verify_password_headline"></div>
<div id="wire-verify-phone-password-container" class="form-control">
<input class="input password" id="wire-verify-password-input" type="password" maxlength="1024"
<input class="input password" id="wire-verify-password-input" type="password" maxlength="1024" autocomplete="off"
data-bind="css: {'input-error': failed_validation_password}, event: {input: clear_error_password}, l10n_tooltip: z.string.auth_placeholder_password_put, l10n_placeholder: z.string.auth_placeholder_password_put, textInput: password"
data-uie-name="enter-password">
</div>
Expand Down
14 changes: 9 additions & 5 deletions app/page/template/_dist/app.htm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
<script src="/script/util/protobuf.js"></script>
<script src="/script/util/keycode.js"></script>
<script src="/script/util/KeyUtil.js"></script>
<script src="/script/util/LocalizerUtil.js"></script>
<script src="/script/util/marked.js"></script>
<script src="/script/util/moment.js"></script>
<script src="/script/util/confirm.js"></script>
<script src="/script/util/PromiseQueue.js"></script>
<script src="/script/util/scroll-helpers.js"></script>
Expand Down Expand Up @@ -49,6 +51,7 @@
<!-- Localization -->
<script src="/script/localization/strings-init.js"></script>
<script src="/script/localization/strings-cs.js"></script>
<script src="/script/localization/strings-da.js"></script>
<script src="/script/localization/strings-de.js"></script>
<script src="/script/localization/strings-es.js"></script>
<script src="/script/localization/strings-fi.js"></script>
Expand Down Expand Up @@ -131,15 +134,16 @@
<script src="/script/location/GeoLocation.js"></script>
<!-- Conversation -->
<script src="/script/conversation/ConversationError.js"></script>
<script src="/script/conversation/ConversationType.js"></script>
<script src="/script/conversation/ConversationMapper.js"></script>
<script src="/script/conversation/ConversationRepository.js"></script>
<script src="/script/conversation/ConversationService.js"></script>
<script src="/script/conversation/ConversationServiceNoCompound.js"></script>
<script src="/script/conversation/ConversationStatus.js"></script>
<script src="/script/conversation/ConversationType.js"></script>
<script src="/script/conversation/ConversationUnreadType.js"></script>
<script src="/script/conversation/ConversationUpdateType.js"></script>
<script src="/script/conversation/ConversationService.js"></script>
<script src="/script/conversation/ConversationServiceNoCompound.js"></script>
<script src="/script/conversation/ConversationVerificationState.js"></script>
<script src="/script/conversation/EventMapper.js"></script>
<script src="/script/conversation/ConversationMapper.js"></script>
<script src="/script/conversation/ConversationRepository.js"></script>
<!-- Extensions -->
<script src="/script/extension/GiphyService.js"></script>
<script src="/script/extension/GiphyRepository.js"></script>
Expand Down
9 changes: 4 additions & 5 deletions app/page/template/content/collection-details.htm
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@

<div class="content-list-wrapper">
<div class="content-list collection-list" data-bind="antiscroll: true">

<div class="collection-images">

<!-- ko foreach: {data: items(), as: 'message_et'} -->
<!-- ko if: $parent.should_show_header(message_et) -->
<header class="collection-date-separator" data-bind="text: $parent.get_title_for_header(message_et)"></header>
<!-- /ko -->
<!-- ko if: message_et.category & z.message.MessageCategory.IMAGE -->
<image-component class="collection-image" data-bind="click: $parent.click_on_image" params="asset: message_et.get_first_asset().resource"></image-component>
<image-component class="collection-image" params="asset: message_et.get_first_asset().resource, click: function() {$parent.click_on_image(message_et)}"></image-component>
<!-- /ko -->
<!-- ko if: message_et.category & z.message.MessageCategory.LINK -->
<link-preview-asset params="message: message_et, header: true"></link-preview-asset>
Expand All @@ -27,9 +28,7 @@
<file-asset class="collection-file" params="message: message_et, header: true"></file-asset>
<!-- /ko -->
<!-- /ko -->

</div>

</div>
</div>

Expand Down
12 changes: 6 additions & 6 deletions app/page/template/detail-view.htm
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<div class="detail-view-content modal-content-anim-close" data-bind="css: {'modal-content-anim-open': image_visible()}">
<header class="detail-view-header">
<div class="text-center">
<div class="label-bold-xs" data-bind="text: message_et().sender_name()"></div>
<div class="label-xs" data-bind="text: moment(message_et().timestamp).format('DD/MM/YYYY H:mm')"></div>
<div class="label-bold-xs" data-bind="text: message_et().sender_name(), attr: {'data-uie-uid': message_et().user().id, 'data-uie-value': message_et().user().name}" data-uie-name="fullscreen-picture-sender"></div>
<div class="label-xs" data-bind="text: moment(message_et().timestamp).format('DD/MM/YYYY H:mm'), attr: {'data-timestamp': message_et().timestamp}"></div>
</div>
<span class="detail-view-header-close-button icon-close icon-button" data-bind="click: click_on_close" data-uie-name="do-close-detail-view"></span>
</header>
Expand All @@ -13,25 +13,25 @@
</div>
<footer class="detail-view-footer">
<!-- ko if: message_et().is_downloadable() && !message_et().is_ephemeral() -->
<span class="detail-view-action-button" data-bind="click: click_on_download">
<span class="detail-view-action-button" data-bind="click: click_on_download" data-uie-name="do-download-fullscreen-picture">
<span class="icon-download"></span>
<span data-bind="l10n_text: z.string.conversation_context_menu_download"></span>
</span>
<!-- /ko -->
<!-- ko if: message_et().is_reactable() && !conversation_et().removed_from_conversation() -->
<span class="detail-view-action-button" data-bind="click: click_on_like">
<span class="detail-view-action-button" data-bind="click: click_on_like" data-uie-name="do-like-fullscreen-picture">
<span data-bind="css: message_et().is_liked() ? 'icon-liked text-red' : 'icon-like'"></span>
<span data-bind="l10n_text: z.string.conversation_context_menu_like"></span>
</span>
<!-- /ko -->
<!-- ko if: message_et().is_deletable() -->
<span class="detail-view-action-button" data-bind="click: click_on_delete">
<span class="detail-view-action-button" data-bind="click: click_on_delete" data-uie-name="do-delete-fullscreen-picture">
<span class="icon-delete-for-me"></span>
<span data-bind="l10n_text: z.string.conversation_context_menu_delete"></span>
</span>
<!-- /ko -->
<!-- ko if: message_et().user().is_me && message_et().status() !== z.message.StatusType.SENDING && !conversation_et().removed_from_conversation() -->
<span class="detail-view-action-button" data-bind="click: click_on_delete_for_everyone">
<span class="detail-view-action-button" data-bind="click: click_on_delete_for_everyone" data-uie-name="do-delete-everywhere-fullscreen-picture">
<span class="icon-delete-for-everyone"></span>
<span data-bind="l10n_text: z.string.conversation_context_menu_delete_everyone"></span>
</span>
Expand Down
4 changes: 2 additions & 2 deletions app/page/template/modals.htm
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,11 @@
<div class="modal-content">
<div class="modal-header">
<div class="modal-close icon-close icon-button pull-right"></div>
<div class="modal-title" data-bind="l10n_text: z.string.modal_new_device_headline"></div>
<div class="modal-title"></div>
</div>
<div class="modal-text" data-bind="l10n_text: z.string.modal_new_device_message"></div>
<div class="modal-footer">
<div class="modal-secondary button button-medium button-full button-inverted" data-bind="l10n_text: z.string.modal_new_device_show_device" data-uie-name="go-show-device"></div>
<div class="modal-secondary button button-medium button-full button-inverted" data-bind="l10n_text: z.string.modal_button_cancel" data-uie-name="go-show-device"></div>
<div class="modal-action button button-medium button-full" data-bind="l10n_text: z.string.modal_new_device_send_anyway" data-uie-name="do-send"></div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions app/page/template/partials/template-message.htm
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@
<!-- ko if: asset.is_image() -->
<div class="message-asset-image">
<div class="image image-loading" data-bind="
attr: {'data-uie-visible': $parent.visible},
attr: {'data-uie-visible': $parent.visible() && !message.is_expired()},
background_image: asset.resource,
click: function() {$parents[1].show_detail(message, event)},
click: function(data, event) {$parents[1].show_detail(message, event)},
css: {'bg-color-ephemeral': message.is_expired()},
viewport_changed: $parents[1].viewport_changed
" data-uie-name="go-image-detail">
Expand Down
6 changes: 3 additions & 3 deletions app/script/calling/entities/Flow.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ class z.calling.entities.Flow
outline = undefined

if @negotiation_mode() is z.calling.enum.SDPNegotiationMode.ICE_RESTART or (sdp_source is z.calling.enum.SDPSource.LOCAL and @is_group())
if z.util.contains sdp_line, 'opus'
if z.util.StringUtil.includes sdp_line, 'opus'
outlines.push sdp_line
outline = "a=ptime:#{AUDIO_PTIME}"
@logger.info "Changed audio p-time in local SDP: #{outline}"
Expand Down Expand Up @@ -674,7 +674,7 @@ class z.calling.entities.Flow
@param ice_candidate [RTCIceCandidate] Received remote ICE candidate
###
add_remote_ice_candidate: (ice_candidate) =>
if z.util.contains ice_candidate.candidate, 'end-of-candidates'
if z.util.StringUtil.includes ice_candidate.candidate, 'end-of-candidates'
@logger.info 'Ignoring remote non-candidate'
return

Expand Down Expand Up @@ -729,7 +729,7 @@ class z.calling.entities.Flow
@param ice_candidate [RTCICECandidate] Local ICE candidate to be send
###
_send_ice_candidate: (ice_candidate) ->
if not z.util.contains ice_candidate.candidate, 'UDP'
unless z.util.StringUtil.includes ice_candidate.candidate, 'UDP'
return @logger.info "Local ICE candidate ignored as it is not of type 'UDP'"

if @conversation_id and @id
Expand Down
5 changes: 4 additions & 1 deletion app/script/components/image.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ class z.components.Image
@asset_src = ko.observable()
@asset_is_loading = ko.observable false

@on_click = =>
params.click? @asset

@on_entered_viewport = =>
@load_image_asset()
return true
Expand All @@ -45,7 +48,7 @@ ko.components.register 'image-component',
return new z.components.Image params, component_info
template: """
<!-- ko if: asset_src() -->
<img data-bind="attr:{src: asset_src}"/>
<img data-bind="attr:{src: asset_src}, click: on_click"/>
<!-- /ko -->
<!-- ko ifnot: asset_src() -->
<div data-bind="in_viewport: on_entered_viewport, css: {'three-dots': asset_is_loading()}">
Expand Down
2 changes: 1 addition & 1 deletion app/script/components/inputElement.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class z.components.InputElement
@value = params.value

@change = (data, event) =>
new_name = z.util.remove_line_breaks event.target.value.trim()
new_name = z.util.StringUtil.remove_line_breaks event.target.value.trim()
old_name = @value().trim()
event.target.value = old_name
@editing false
Expand Down
2 changes: 1 addition & 1 deletion app/script/components/topPeople.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ ko.components.register 'top-people',
template: """
<div class="search-list search-list-sm" data-bind="foreach: {data: displayed_users}">
<div class="search-list-item" data-bind="click: $parent.on_select, css: {'search-list-item-selected': $parent.is_selected($data)}, attr: {'data-uie-uid': $data.id, 'data-uie-value': $data.name(), 'data-uie-status': $data.connection().status()}" data-uie-name="item-user">
<user-avatar class="search-list-item-image user-avatar-md" params="user: $data, selected: $parent.is_selected($data)"></user-avatar>
<user-avatar class="search-list-item-image user-avatar-md" params="user: $data, selected: $parent.is_selected($data), delay: 300"></user-avatar>
<div class="search-list-item-content">
<div class="search-list-item-content-name" data-bind="text: first_name"></div>
</div>
Expand Down
12 changes: 6 additions & 6 deletions app/script/components/userAvatar.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class z.components.UserAvatar
@user = ko.unwrap params.user
@badge = params.badge or false
@element = $(component_info.element)
@delay = params.delay

@avatar_loading_blocked = false
@avatar_entered_viewport = false
Expand All @@ -37,7 +38,7 @@ class z.components.UserAvatar

@initials = ko.pureComputed =>
if @element.hasClass 'user-avatar-xs'
return z.util.get_first_character @user.initials()
return z.util.StringUtil.get_first_character @user.initials()
else
return @user.initials()

Expand All @@ -60,14 +61,13 @@ class z.components.UserAvatar
params.click? data.user, event.currentTarget.parentNode

@on_in_viewport = =>
return true if @avatar_loading_blocked
@avatar_entered_viewport = true
@_load_avatar_picture()
return true

@_load_avatar_picture = =>
return true if @avatar_loading_blocked
@avatar_loading_blocked = true
@avatar_entered_viewport = true
@user.preview_picture_resource()?.get_object_url()
.then (url) =>
image = new Image()
Expand All @@ -77,8 +77,8 @@ class z.components.UserAvatar
@element.addClass 'user-avatar-image-loaded user-avatar-loading-transition'
@avatar_loading_blocked = false

@picture_preview_subscription = ko.computed =>
return if @avatar_loading_blocked or not @avatar_entered_viewport
@picture_preview_subscription = @user.preview_picture_resource.subscribe =>
return if not @avatar_entered_viewport
@_load_avatar_picture()

dispose: =>
Expand All @@ -90,7 +90,7 @@ ko.components.register 'user-avatar',
createViewModel: (params, component_info) ->
return new z.components.UserAvatar params, component_info
template: """
<div class="user-avatar" data-bind="attr: {title: user.name}, css: css_classes(), click: on_click, in_viewport: on_in_viewport">
<div class="user-avatar" data-bind="attr: {title: user.name}, css: css_classes(), click: on_click, in_viewport: on_in_viewport, delay: delay">
<div class="user-avatar-background"></div>
<div class="user-avatar-initials" data-bind="text: initials"></div>
<div class="user-avatar-image"></div>
Expand Down
3 changes: 2 additions & 1 deletion app/script/components/userList.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ class z.components.UserListViewModel
# filter all list items if a filter is provided
if @user_filter?
@filtered_user_ets = ko.pureComputed =>
ko.utils.arrayFilter @user_ets(), (user_et) => user_et.matches @user_filter()
normalized_query = z.search.SearchRepository.normalize_query @user_filter()
ko.utils.arrayFilter(@user_ets(), (user_et) => user_et.matches normalized_query, @user_filter().trim().startsWith '@').slice 0, 30

# check every list item before selection if selected_filter is provided
if @user_selected_filter?
Expand Down
3 changes: 3 additions & 0 deletions app/script/conversation/ConversationError.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ class z.conversation.ConversationError
@message = switch @type
when z.conversation.ConversationError::TYPE.CONVERSATION_NOT_FOUND
'Conversation not found'
when z.conversation.ConversationError::DEGRADED_CONVERSATION_CANCELLATION
'Sending to degraded conversation was canceled by user'
when z.conversation.ConversationError::TYPE.MESSAGE_NOT_FOUND
'Message not found'
when z.conversation.ConversationError::TYPE.NO_CHANGES
Expand All @@ -41,6 +43,7 @@ class z.conversation.ConversationError
@::constructor = @
@::TYPE =
CONVERSATION_NOT_FOUND: 'z.conversation.ConversationError::TYPE.CONVERSATION_NOT_FOUND'
DEGRADED_CONVERSATION_CANCELLATION: 'z.conversation.ConversationError::TYPE.DEGRADED_CONVERSATION_CANCELLATION'
MESSAGE_NOT_FOUND: 'z.conversation.ConversationError::TYPE.MESSAGE_NOT_FOUND'
NO_CHANGES: 'z.conversation.ConversationError::TYPE.NO_CHANGES'
WRONG_USER: 'z.conversation.ConversationError::TYPE.WRONG_USER'
Expand Down
Loading

0 comments on commit c29c027

Please sign in to comment.