Add alert about full URL limitation. Fix #845.

See: https://github.com/FelisCatus/SwitchyOmega/wiki/Chromium-Full-URL-Limitation
This commit is contained in:
FelisCatus 2017-01-09 14:19:08 -08:00
parent 87c6cd4e69
commit a1135ffa3e
20 changed files with 155 additions and 3 deletions

View File

@ -150,6 +150,13 @@ msgstr ""
"The request and its URL don't matter to this condition. "
"The result is solely based on the day of the week when the request is sent."
msgid "condition_alert_fullUrlLimitation"
msgstr ""
"Full URL matching is no longer possible for <code>https://</code> "
"URLs as of Chrome 52. "
"<a href='https://github.com/FelisCatus/SwitchyOmega/wiki/Chromium-Full-URL-Limitation'>"
"Learn more...</a>"
msgid "condition_group_default"
msgstr " "

View File

@ -152,6 +152,13 @@ msgstr ""
"The request and its URL don't matter to this condition. "
"The result is solely based on the day of the week when the request is sent."
msgid "condition_alert_fullUrlLimitation"
msgstr ""
"Full URL matching is no longer possible for <code>https://</code> "
"URLs as of Chrome 52. "
"<a href='https://github.com/FelisCatus/SwitchyOmega/wiki/Chromium-Full-URL-Limitation'>"
"Learn more...</a>"
msgid "condition_group_default"
msgstr " "

View File

@ -155,6 +155,13 @@ msgstr ""
"The request and its URL don't matter to this condition. "
"The result is solely based on the day of the week when the request is sent."
msgid "condition_alert_fullUrlLimitation"
msgstr ""
"Full URL matching is no longer possible for <code>https://</code> "
"URLs as of Chrome 52. "
"<a href='https://github.com/FelisCatus/SwitchyOmega/wiki/Chromium-Full-URL-Limitation'>"
"Learn more...</a>"
msgid "condition_group_default"
msgstr " "

View File

@ -151,6 +151,13 @@ msgstr ""
"The request and its URL don't matter to this condition. "
"The result is solely based on the day of the week when the request is sent."
msgid "condition_alert_fullUrlLimitation"
msgstr ""
"Full URL matching is no longer possible for <code>https://</code> "
"URLs as of Chrome 52. "
"<a href='https://github.com/FelisCatus/SwitchyOmega/wiki/Chromium-Full-URL-Limitation'>"
"Learn more...</a>"
msgid "condition_group_default"
msgstr " "

View File

@ -154,6 +154,13 @@ msgstr ""
"The request and its URL don't matter to this condition. "
"The result is solely based on the day of the week when the request is sent."
msgid "condition_alert_fullUrlLimitation"
msgstr ""
"Full URL matching is no longer possible for <code>https://</code> "
"URLs as of Chrome 52. "
"<a href='https://github.com/FelisCatus/SwitchyOmega/wiki/Chromium-Full-URL-Limitation'>"
"Learn more...</a>"
msgid "condition_group_default"
msgstr " "

View File

@ -158,6 +158,13 @@ msgstr ""
"The request and its URL don't matter to this condition. "
"The result is solely based on the day of the week when the request is sent."
msgid "condition_alert_fullUrlLimitation"
msgstr ""
"Full URL matching is no longer possible for <code>https://</code> "
"URLs as of Chrome 52. "
"<a href='https://github.com/FelisCatus/SwitchyOmega/wiki/Chromium-Full-URL-Limitation'>"
"Learn more...</a>"
msgid "condition_group_default"
msgstr " "

View File

@ -152,6 +152,13 @@ msgstr ""
"The request and its URL don't matter to this condition. "
"The result is solely based on the day of the week when the request is sent."
msgid "condition_alert_fullUrlLimitation"
msgstr ""
"Full URL matching is no longer possible for <code>https://</code> "
"URLs as of Chrome 52. "
"<a href='https://github.com/FelisCatus/SwitchyOmega/wiki/Chromium-Full-URL-Limitation'>"
"Learn more...</a>"
msgid "condition_group_default"
msgstr " "

View File

@ -106,6 +106,13 @@ msgstr "Vikudagur"
msgid "condition_help_WeekdayCondition"
msgstr ""
msgid "condition_alert_fullUrlLimitation"
msgstr ""
"Full URL matching is no longer possible for <code>https://</code> "
"URLs as of Chrome 52. "
"<a href='https://github.com/FelisCatus/SwitchyOmega/wiki/Chromium-Full-URL-Limitation'>"
"Learn more...</a>"
msgid "condition_group_default"
msgstr ""

View File

@ -148,6 +148,13 @@ msgstr ""
"The request and its URL don't matter to this condition. "
"The result is solely based on the day of the week when the request is sent."
msgid "condition_alert_fullUrlLimitation"
msgstr ""
"Full URL matching is no longer possible for <code>https://</code> "
"URLs as of Chrome 52. "
"<a href='https://github.com/FelisCatus/SwitchyOmega/wiki/Chromium-Full-URL-Limitation'>"
"Learn more...</a>"
msgid "condition_group_default"
msgstr " "

View File

@ -114,6 +114,13 @@ msgstr "Ukedag"
msgid "condition_help_WeekdayCondition"
msgstr ""
msgid "condition_alert_fullUrlLimitation"
msgstr ""
"Full URL matching is no longer possible for <code>https://</code> "
"URLs as of Chrome 52. "
"<a href='https://github.com/FelisCatus/SwitchyOmega/wiki/Chromium-Full-URL-Limitation'>"
"Learn more...</a>"
msgid "condition_group_default"
msgstr ""

View File

@ -151,6 +151,13 @@ msgstr ""
"The request and its URL don't matter to this condition. "
"The result is solely based on the day of the week when the request is sent."
msgid "condition_alert_fullUrlLimitation"
msgstr ""
"Full URL matching is no longer possible for <code>https://</code> "
"URLs as of Chrome 52. "
"<a href='https://github.com/FelisCatus/SwitchyOmega/wiki/Chromium-Full-URL-Limitation'>"
"Learn more...</a>"
msgid "condition_group_default"
msgstr " "

View File

@ -155,6 +155,13 @@ msgstr ""
"The request and its URL don't matter to this condition. "
"The result is solely based on the day of the week when the request is sent."
msgid "condition_alert_fullUrlLimitation"
msgstr ""
"Full URL matching is no longer possible for <code>https://</code> "
"URLs as of Chrome 52. "
"<a href='https://github.com/FelisCatus/SwitchyOmega/wiki/Chromium-Full-URL-Limitation'>"
"Learn more...</a>"
msgid "condition_group_default"
msgstr " "

View File

@ -105,6 +105,13 @@ msgstr ""
msgid "condition_help_WeekdayCondition"
msgstr ""
msgid "condition_alert_fullUrlLimitation"
msgstr ""
"Full URL matching is no longer possible for <code>https://</code> "
"URLs as of Chrome 52. "
"<a href='https://github.com/FelisCatus/SwitchyOmega/wiki/Chromium-Full-URL-Limitation'>"
"Learn more...</a>"
msgid "condition_group_default"
msgstr ""

View File

@ -107,6 +107,13 @@ msgstr ""
msgid "condition_help_WeekdayCondition"
msgstr ""
msgid "condition_alert_fullUrlLimitation"
msgstr ""
"Full URL matching is no longer possible for <code>https://</code> "
"URLs as of Chrome 52. "
"<a href='https://github.com/FelisCatus/SwitchyOmega/wiki/Chromium-Full-URL-Limitation'>"
"Learn more...</a>"
msgid "condition_group_default"
msgstr ""

View File

@ -154,6 +154,13 @@ msgstr ""
"The request and its URL don't matter to this condition. "
"The result is solely based on the day of the week when the request is sent."
msgid "condition_alert_fullUrlLimitation"
msgstr ""
"Full URL matching is no longer possible for <code>https://</code> "
"URLs as of Chrome 52. "
"<a href='https://github.com/FelisCatus/SwitchyOmega/wiki/Chromium-Full-URL-Limitation'>"
"Learn more...</a>"
msgid "condition_group_default"
msgstr ""

View File

@ -134,6 +134,12 @@ msgstr ""
"假设在请求发送时是星期X如果星期X被勾选则匹配所有请求。否则不匹配任何请求。<br>"
"除了日期以外,在匹配过程中不会参考请求的网址或任何其他信息。"
msgid "condition_alert_fullUrlLimitation"
msgstr ""
"Chrome 52 起,<code>https://</code>协议下的完整网址无法正常匹配。"
"<a href='https://github.com/FelisCatus/SwitchyOmega/wiki/Chromium-%E5%AE%8C%E6%95%B4%E7%BD%91%E5%9D%80%E9%99%90%E5%88%B6'>"
"更多信息...</a>"
msgid "condition_group_default"
msgstr " "

View File

@ -134,6 +134,12 @@ msgstr ""
"假設在請求傳送時是星期X如果星期X被勾選則匹配所有請求。否則不匹配任何請求。<br>"
"除了日期以外,在匹配過程中不會參考請求的網址或任何其他資訊。"
msgid "condition_alert_fullUrlLimitation"
msgstr ""
"Chrome 52 起,<code>https://</code>協議下的完整網址無法正常匹配。"
"<a href='https://github.com/FelisCatus/SwitchyOmega/wiki/Chromium-%E5%AE%8C%E6%95%B4%E7%BD%91%E5%9D%80%E9%99%90%E5%88%B6'>"
"更多信息...</a>"
msgid "condition_group_default"
msgstr " "

View File

@ -463,6 +463,19 @@ main {
cursor: move;
}
.switch-rule-row td.has-icon {
> .form-control {
display: inline-block;
width: ~"calc(100% - 1.5em)";
}
> .glyphicon {
display: block;
float: right;
line-height: 34px;
}
}
.cycle-profile-container {
list-style-type: none;
min-height: 20px;

View File

@ -116,9 +116,21 @@ angular.module('omega').controller 'SwitchProfileCtrl', ($scope, $rootScope,
$scope.showConditionTypes = 0
$scope.hasConditionTypes = 0
$scope.hasUrlConditions = false
$scope.isUrlConditionType =
'UrlWildcardCondition': true
'UrlRegexCondition': true
updateHasConditionTypes = ->
return unless $scope.hasConditionTypes == 0
return unless $scope.profile?.rules?
$scope.hasUrlConditions = false
for rule in $scope.profile.rules
if $scope.isUrlConditionType[rule.condition.conditionType]
$scope.hasUrlConditions = true
break
return unless $scope.hasConditionTypes == 0
for rule in $scope.profile.rules
# Convert TrueCondition to a HostWildcardCondition with pattern '*'.
if rule.condition.conditionType == 'TrueCondition'

View File

@ -13,7 +13,12 @@ div(ng-controller='SwitchProfileCtrl')
| {{'condition_group_' + group.group | tr}}
dl(ng-show='expandedSection.id == $index')
dt(ng-repeat-start='type in group.types') {{'condition_' + type | tr}}
dd(ng-repeat-end ng-bind-html='"condition_help_" + type | tr')
dd(ng-repeat-end)
div(ng-bind-html='"condition_help_" + type | tr')
.text-danger(ng-if='isUrlConditionType[type]')
span.glyphicon.glyphicon-alert
= ' '
span(ng-bind-html='"condition_alert_fullUrlLimitation" | tr')
section.settings-group
h3
| {{'options_group_switchRules' | tr}}
@ -32,6 +37,10 @@ div(ng-controller='SwitchProfileCtrl')
span.glyphicon.glyphicon-remove
= ' '
| {{source.error.message}}
.alert.alert-danger(ng-show='!!hasUrlConditions')
span.glyphicon.glyphicon-alert
= ' '
span(ng-bind-html='"condition_alert_fullUrlLimitation" | tr')
.rules-source(ng-show='editSource')
textarea.monospace.form-control.width-limit(ng-model='source.code' rows=20 ng-change='source.touched = true; $root.optionsDirty = true')
.table-responsive.switch-rules-wrapper(ng-if='loadRules' ng-show='!editSource')
@ -53,9 +62,10 @@ div(ng-controller='SwitchProfileCtrl')
tr.switch-rule-row(ng-repeat='rule in profile.rules')
td.sort-bar
span.glyphicon.glyphicon-sort
td
td(ng-class='{"has-icon": isUrlConditionType[rule.condition.conditionType]}')
select.form-control(ng-model='rule.condition.conditionType'
ng-options='type.type as ("condition_" + type.type | tr) group by (type.group | tr) for type in conditionTypes')
span.glyphicon.glyphicon-alert.text-danger(ng-if='isUrlConditionType[rule.condition.conditionType]')
td(ng-switch='rule.condition.conditionType' ng-class='{"has-warning": conditionHasWarning(rule.condition)}')
span(ng-switch-when='FalseCondition')
span(ng-show='!!rule.condition.pattern')