Skip to content

Commit

Permalink
Display last update time per user script.
Browse files Browse the repository at this point in the history
  • Loading branch information
arantius committed Jul 31, 2018
1 parent d819908 commit 2f8006d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions _locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@
"install_failed": {
"message": "User script failed to install"
},
"last_updated": {
"message": "Last updated:"
},
"malicious_user_scripts": {
"message": "Malicious user scripts can violate your privacy, steal your data, and act on your behalf without your knowledge."
},
Expand Down
3 changes: 3 additions & 0 deletions src/browser/monkey-menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ <h2>{'global_excludes'|i18n}</h2>
<p rv-if="activeScript.homePageUrl">
<a rv-href="activeScript.homePageUrl">{'homepage'|i18n}</a>
</p>
<p rv-if="activeScript.installTime">
<b>{'last_updated'|i18n}</b> {activeScript.installTime|timeToLocaleString}
</p>
</menu>
</section>

Expand Down
6 changes: 3 additions & 3 deletions src/browser/monkey-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ function onLoad() {
gTplData.origin = url.origin == "null" ? null : url.origin;
loadScripts(userScripts, url);

tinybind.formatters.bothArraysEmpty
= (a, b) => !(!!a.length || !!b.length);
tinybind.formatters.bothArraysEmpty = (a, b) => !(!!a.length || !!b.length);
tinybind.formatters.canAddOrigin = () => {
if (!gTplData.origin) return false;

let originExclude = gTplData.origin + '/*';
return !getGlobalExcludes().includes(originExclude);
};
tinybind.formatters.timeToLocaleString
= t => new Date(t).toLocaleDateString();
tinybind.bind(document.body, gTplData);

document.body.id = 'main-menu';
Expand Down

0 comments on commit 2f8006d

Please sign in to comment.