js code rewrite. Created _helpers.js with XHR and storage wrapper

This commit is contained in:
meow
2022-05-06 04:46:59 +03:00
parent ef8c7184de
commit 7dd699370f
23 changed files with 735 additions and 901 deletions

View File

@@ -29,6 +29,7 @@
}.to_pretty_json
%>
</script>
<script src="/js/_helpers.js?v=<%= ASSET_COMMIT %>"></script>
<script src="/js/playlist_widget.js?v=<%= ASSET_COMMIT %>"></script>
<div class="pure-g">

View File

@@ -93,4 +93,5 @@
}.to_pretty_json
%>
</script>
<script src="/js/_helpers.js?v=<%= ASSET_COMMIT %>"></script>
<script src="/js/community.js?v=<%= ASSET_COMMIT %>"></script>

View File

@@ -66,4 +66,5 @@
}.to_pretty_json
%>
</script>
<script src="/js/_helpers.js?v=<%= ASSET_COMMIT %>"></script>
<script src="/js/player.js?v=<%= ASSET_COMMIT %>"></script>

View File

@@ -31,6 +31,7 @@
}.to_pretty_json
%>
</script>
<script src="/js/_helpers.js?v=<%= ASSET_COMMIT %>"></script>
<script src="/js/subscribe_widget.js?v=<%= ASSET_COMMIT %>"></script>
<% else %>
<p>

View File

@@ -31,6 +31,7 @@
</script>
<%= rendered "components/player" %>
<script src="/js/_helpers.js?v=<%= ASSET_COMMIT %>"></script>
<script src="/js/embed.js?v=<%= ASSET_COMMIT %>"></script>
</body>
</html>

View File

@@ -25,6 +25,7 @@
}.to_pretty_json
%>
</script>
<script src="/js/_helpers.js?v=<%= ASSET_COMMIT %>"></script>
<script src="/js/watched_widget.js"></script>
<div class="pure-g">

View File

@@ -50,6 +50,7 @@
}.to_pretty_json
%>
</script>
<script src="/js/_helpers.js?v=<%= ASSET_COMMIT %>"></script>
<script src="/js/watched_widget.js"></script>
<div class="pure-g">

View File

@@ -9,6 +9,20 @@
<body>
<h1><%= translate(locale, "JavaScript license information") %></h1>
<table id="jslicense-labels1">
<tr>
<td>
<a href="/js/_helpers.js?v=<%= ASSET_COMMIT %>">_helpers.js</a>
</td>
<td>
<a href="https://www.gnu.org/licenses/agpl-3.0.html">AGPL-3.0</a>
</td>
<td>
<a href="/js/_helpers.js?v=<%= ASSET_COMMIT %>"><%= translate(locale, "source") %></a>
</td>
</tr>
<tr>
<td>
<a href="/js/community.js?v=<%= ASSET_COMMIT %>">community.js</a>

View File

@@ -97,6 +97,7 @@
}.to_pretty_json
%>
</script>
<script src="/js/_helpers.js?v=<%= ASSET_COMMIT %>"></script>
<script src="/js/playlist_widget.js?v=<%= ASSET_COMMIT %>"></script>
<% end %>

View File

@@ -157,6 +157,7 @@
</div>
<div class="pure-u-1 pure-u-md-2-24"></div>
</div>
<script src="/js/_helpers.js?v=<%= ASSET_COMMIT %>"></script>
<script src="/js/handlers.js?v=<%= ASSET_COMMIT %>"></script>
<script src="/js/themes.js?v=<%= ASSET_COMMIT %>"></script>
<% if env.get? "user" %>

View File

@@ -165,6 +165,7 @@ we're going to need to do it here in order to allow for translations.
}.to_pretty_json
%>
</script>
<script src="/js/_helpers.js?v=<%= ASSET_COMMIT %>"></script>
<script src="/js/playlist_widget.js?v=<%= Time.utc.to_unix_ms %>"></script>
<% end %>
<% end %>
@@ -303,4 +304,5 @@ we're going to need to do it here in order to allow for translations.
</div>
<% end %>
</div>
<script src="/js/_helpers.js?v=<%= ASSET_COMMIT %>"></script>
<script src="/js/watch.js?v=<%= ASSET_COMMIT %>"></script>