-
Notifications
You must be signed in to change notification settings - Fork 874
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Sync] Add a spearate input element for custom sync url and show
relaunch button when toogle/url change.
- Loading branch information
1 parent
cd1714c
commit f26c2e6
Showing
15 changed files
with
279 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 19 additions & 24 deletions
43
browser/resources/settings/brave_sync_page/brave_sync_page.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,36 @@ | ||
<style include="settings-shared iron-flex"> | ||
cr-input { | ||
width: 100%; | ||
--cr-input-width: 50%; | ||
margin-top: 10px; | ||
margin-left: 20px; | ||
} | ||
cr-input { | ||
width: 100%; | ||
--cr-input-width: 50%; | ||
margin-top: 10px; | ||
margin-left: 20px; | ||
} | ||
|
||
cr-input::part(row-container) { | ||
justify-content: normal; | ||
} | ||
cr-input::part(row-container) { | ||
justify-content: normal; | ||
} | ||
</style> | ||
<settings-animated-pages id="pages" section="braveSync"> | ||
<div route-path="default"> | ||
<cr-link-row id="brave-sync-setup" | ||
label$="[[syncLabel_]]" | ||
on-click="onSyncTap_" | ||
role-description="$i18n{subpageArrowRoleDescription}"> | ||
<cr-link-row id="brave-sync-setup" label$="[[syncLabel_]]" on-click="onSyncTap_" role-description="$i18n{subpageArrowRoleDescription}"> | ||
</cr-link-row> | ||
</div> | ||
|
||
<template is="dom-if" route-path="/braveSync/setup"> | ||
<settings-subpage | ||
associated-control="[[$$('#brave-sync-setup')]]" | ||
page-title="[[syncLabel_]]"> | ||
<settings-brave-sync-subpage | ||
sync-status="[[syncStatus_]]"> | ||
<settings-subpage associated-control="[[$$('#brave-sync-setup')]]" page-title="[[syncLabel_]]"> | ||
<settings-brave-sync-subpage sync-status="[[syncStatus_]]"> | ||
</settings-brave-sync-subpage> | ||
</settings-subpage> | ||
</template> | ||
</settings-animated-pages> | ||
|
||
|
||
<settings-toggle-button id="customSyncUrlEnabled" | ||
class="hr" | ||
pref="{{prefs.brave.custom_sync_url_enabled}}" | ||
label="$i18n{braveCustomSyncUrlEnableLabel}"> | ||
<settings-toggle-button id="customSyncUrlEnabled" class="hr" pref="{{prefs.brave.custom_sync_url_enabled}}" label="$i18n{braveCustomSyncUrlEnableLabel}"> | ||
<template is="dom-if" if="[[shouldShowRestart_(prefs.brave.custom_sync_url_enabled.value)]]"> | ||
<cr-button on-click="onRestartClick_" slot="more-actions"> | ||
$i18n{restart} | ||
</cr-button> | ||
</template> | ||
</settings-toggle-button> | ||
<template is="dom-if" if="[[prefs.brave.custom_sync_url_enabled.value]]"> | ||
<cr-input id="customSyncUrl" value="{{customSyncUrl_}}" placeholder="$i18n{enterCustomSyncUrl}" spellcheck="false"></cr-input> | ||
<sync-url-input id="customSyncUrl" pref="{{prefs.brave.custom_sync_url}}"></sync-url-input> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
browser/resources/settings/brave_sync_page/sync_url_input.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<style> | ||
cr-input { | ||
width: 100%; | ||
--cr-input-width: 50%; | ||
margin-top: 10px; | ||
margin-left: 20px; | ||
} | ||
|
||
cr-input::part(row-container) { | ||
justify-content: normal; | ||
} | ||
</style> | ||
|
||
<!-- Max length of 100 KB to prevent browser from freezing. --> | ||
<cr-input | ||
id="input" | ||
value="{{value}}" | ||
rows="1" | ||
autogrow="true" | ||
placeholder="$i18n{enterCustomSyncUrl}" | ||
invalid="[[showError_]]" | ||
on-input="validate_" | ||
first-footer="[[errorText_]]" | ||
maxlength="102400" | ||
spellcheck="false" | ||
on-keypress="onKeyPress_" | ||
on-input="onInput_" | ||
on-blur="validate_" | ||
on-change="onChange_" | ||
> | ||
</cr-input> |
Oops, something went wrong.