Skip to content

Commit

Permalink
If prior turn on notices were set retain setting
Browse files Browse the repository at this point in the history
* Also don't presume that metadata blocks are at the beginning *(easily findable)* and always set the tooltip.

NOTE:
* Fixes notice non-display of https://openuserjs.org/scripts/jesus2099/mb._MASS_MERGE_RECORDINGS

Post OpenUserJS#1632
  • Loading branch information
Martii committed Aug 26, 2019
1 parent df49945 commit 6be3102
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
10 changes: 7 additions & 3 deletions libs/modelParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,9 @@ var parseScript = function (aScript) {
);

script.showSourceNotices = true;
script.showSourceNoticesCritical = updateURLForceCheck;
script.showSourceNoticesCritical = script.showSourceNoticesCritical
? true
: updateURLForceCheck;
}
} else {
// Allow offsite checks
Expand Down Expand Up @@ -570,8 +572,10 @@ var parseScript = function (aScript) {
: script.hasInvalidUpdateURL
);

script.showSourceNotices = updateURLForceCheck;
script.showSourceNoticesCritical = updateURLForceCheck;
script.showSourceNotices = script.showSourceNotices ? true : updateURLForceCheck;
script.showSourceNoticesCritical = script.showSourceNoticesCritical
? true
: updateURLForceCheck;
}
}

Expand Down
6 changes: 3 additions & 3 deletions views/includes/scriptPageHeaderSourceNotices.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</p>
{{/script.hasInvalidUpdateURL}}
{{#script.hasAlternateUpdateURL}}
<p{{^isScriptViewSourcePage}} title="{{script.meta.UserScript.updateURL.0.value}}"{{/isScriptViewSourcePage}}>
<p title="{{script.meta.UserScript.updateURL.0.value}}">
<i class="fa fa-fw fa-exclamation-triangle"></i> Alternate update check target.
</p>
{{/script.hasAlternateUpdateURL}}
Expand All @@ -15,12 +15,12 @@
</p>
{{/script.hasInvalidDownloadURL}}
{{#script.hasAlternateDownloadURL}}
<p{{^isScriptViewSourcePage}} title="{{script.meta.UserScript.downloadURL.0.value}}"{{/isScriptViewSourcePage}}>
<p title="{{script.meta.UserScript.downloadURL.0.value}}">
<i class="fa fa-fw fa-exclamation-triangle"></i> Alternate download source target.
</p>
{{/script.hasAlternateDownloadURL}}
{{#script.hasUnstableMinify}}
<p{{^isScriptViewSourcePage}} title="{{script.meta.OpenUserJS.unstableMinify.0.value}}"{{/isScriptViewSourcePage}}>
<p title="{{script.meta.OpenUserJS.unstableMinify.0.value}}">
<i class="fa fa-fw fa-exclamation-triangle"></i> The script author suggests that minification of this script may be unstable.
<p>
{{/script.hasUnstableMinify}}
Expand Down

0 comments on commit 6be3102

Please sign in to comment.