Skip to content
Permalink
Browse files

Deprecating minify route

F3's minification causes a variety of weird issues, and is painful to develop around due to the caching differences. HTTP/2 is a thing now, and we should embrace it, and also focus on removing reliance on so many third-party scripts.
  • Loading branch information
Alanaktion committed Dec 10, 2019
1 parent 6a14744 commit aba8b2243b9ea5212b0f779531d257dd69caa1c0
@@ -42,7 +42,7 @@
<p class="text-center">{{ @dict.no_groups_exist }}</p>
</check>
<include href="blocks/footer.html" />
<script src="{{ @BASE }}/minify/js/stupidtable.min.js"></script>
<script src="{{ @BASE }}/js/stupidtable.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('.table').stupidtable();
@@ -36,9 +36,9 @@
</form>
<include href="blocks/footer.html" />
</div>
<script src="{{ @BASE }}/minify/js/bootstrap-datepicker.js"></script>
<check if="{{ @user_obj->date_picker()->js }}">
<script src="{{ @BASE }}/minify/js/bootstrap-datepicker.{{ @user_obj->date_picker()->language }}.js"></script>
<script src="{{ @BASE }}/js/bootstrap-datepicker.js"></script>
<check if="{{ @user_obj->date_picker()->js && @user_obj->date_picker()->language != 'en-US' }}">
<script src="{{ @BASE }}/js/bootstrap-datepicker.{{ @user_obj->date_picker()->language }}.js"></script>
</check>
<script>
$(function() {
@@ -36,9 +36,9 @@
</form>
<include href="blocks/footer.html" />
</div>
<script src="{{ @BASE }}/minify/js/bootstrap-datepicker.js"></script>
<check if="{{ @user_obj->date_picker()->js }}">
<script src="{{ @BASE }}/minify/js/bootstrap-datepicker.{{ @user_obj->date_picker()->language }}.js"></script>
<script src="{{ @BASE }}/js/bootstrap-datepicker.js"></script>
<check if="{{ @user_obj->date_picker()->js && @user_obj->date_picker()->language != 'en-US' }}">
<script src="{{ @BASE }}/js/bootstrap-datepicker.{{ @user_obj->date_picker()->language }}.js"></script>
</check>
<script>
$(function() {
@@ -50,7 +50,7 @@
<a class="btn btn-default btn-sm" href="{{ @BASE }}/admin/users/deleted">{{ @dict.show_deactivated_users }}</a>
</p>
<include href="blocks/footer.html" />
<script src="{{ @BASE }}/minify/js/stupidtable.min.js"></script>
<script src="{{ @BASE }}/js/stupidtable.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('.table').stupidtable();
@@ -42,7 +42,7 @@
</tbody>
</table>
<include href="blocks/footer.html" />
<script src="{{ @BASE }}/minify/js/stupidtable.min.js"></script>
<script src="{{ @BASE }}/js/stupidtable.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('.table').stupidtable();
@@ -137,7 +137,7 @@
<script type="text/javascript">var sortBacklog = true;</script>
</check>
<script src="{{ @BASE }}/js/sortable.min.js"></script>
<script src="{{ @BASE }}/minify/js/backlog.js"></script>
<script src="{{ @BASE }}/js/backlog.js"></script>
</div>
</body>
</html>
@@ -48,8 +48,9 @@
</div>
</div>
<include href="blocks/footer.html" />
<script src="{{ @BASE }}/minify/js/jquery-ui-dragsort.min.js,jquery.ui.touch-punch.min.js"></script>
<script src="{{ @BASE }}/minify/js/backlog.js"></script>
<script src="{{ @BASE }}/js/jquery-ui-dragsort.min.js"></script>
<script src="{{ @BASE }}/js/jquery.ui.touch-punch.min.js"></script>
<script src="{{ @BASE }}/js/backlog.js"></script>
</div>
</body>
</html>
@@ -7,7 +7,9 @@
}
~}
<script>var BASE = '{{ @BASE }}', issue_types = {{ json_encode(@types) }};</script>
<script src="{{ @BASE }}/minify/js/jquery-3.2.1.min.js,bootstrap.min.js,modernizr.custom.js,mousetrap-1.6.2.min.js"></script>
<script src="{{ @BASE }}/js/jquery-3.2.1.min.js"></script>
<script src="{{ @BASE }}/js/bootstrap.min.js"></script>
<script src="{{ @BASE }}/js/mousetrap-1.6.2.min.js"></script>
<script src="{{ @BASE }}/js/global.js"></script>
<script src="{{ @BASE }}/js/respond.min.js"></script>

@@ -5,6 +5,7 @@
<meta name="generator" content="alanaktion/phproject">
<title>{{ empty(@title) ? @site.name : @title . ' - ' . @site.name | esc }}</title>
<link rel="stylesheet" href="{{ @BASE }}/{{ empty(@user.theme) ? @site.theme : @user.theme }}">
<link rel="stylesheet" href="{{ @BASE }}/minify/css/style.css,datepicker.css">
<link rel="stylesheet" href="{{ @BASE }}/css/style.css">
<link rel="stylesheet" href="{{ @BASE }}/css/datepicker.css">
<link rel="stylesheet" href="{{ @BASE }}/css/font-awesome.min.css">
<link rel="search" type="application/opensearchdescription+xml" href="{{ @BASE }}/opensearch.xml" title="{{ @site.name | esc }}">
@@ -58,7 +58,7 @@
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function() {
$.ajax({
url: BASE + '/minify/js/typeahead.jquery.js',
url: BASE + '/js/typeahead.jquery.js',
cache: true,
dataType: "script",
success: function() {
@@ -12,9 +12,10 @@
<include href="issues/edit-form.html" />
<include href="blocks/footer.html" />
</div>
<script src="{{ @BASE }}/minify/js/bootstrap-datepicker.js,typeahead.jquery.js"></script>
<check if="{{ @user_obj->date_picker()->js }}">
<script src="{{ @BASE }}/minify/js/bootstrap-datepicker.{{ @user_obj->date_picker()->language }}.js"></script>
<script src="{{ @BASE }}/js/bootstrap-datepicker.js"></script>
<script src="{{ @BASE }}/js/typeahead.jquery.js"></script>
<check if="{{ @user_obj->date_picker()->js && @user_obj->date_picker()->language != 'en-US' }}">
<script src="{{ @BASE }}/js/bootstrap-datepicker.{{ @user_obj->date_picker()->language }}.js"></script>
</check>
<check if="{{ @parse.markdown && !@user_obj->option('disable_mde') }}">
<script src="{{ @BASE }}/js/simplemde.min.js"></script>
@@ -29,9 +29,9 @@
</check>
<include href="blocks/footer.html" />
</div>
<script src="{{ @BASE }}/minify/js/bootstrap-datepicker.js"></script>
<check if="{{ @user_obj->date_picker()->js }}">
<script src="{{ @BASE }}/minify/js/bootstrap-datepicker.{{ @user_obj->date_picker()->language }}.js"></script>
<script src="{{ @BASE }}/js/bootstrap-datepicker.js"></script>
<check if="{{ @user_obj->date_picker()->js && @user_obj->date_picker()->language != 'en-US' }}">
<script src="{{ @BASE }}/js/bootstrap-datepicker.{{ @user_obj->date_picker()->language }}.js"></script>
</check>
<script>var datepickerLanguage='{{ @user_obj->date_picker()->language }}';</script>
</body>
@@ -90,7 +90,7 @@ <h3 class="h4"><i>{{ @dict.project_overview }}</i></h3>
</div>

<include href="blocks/footer.html" />
<script src="{{ @BASE }}/minify/js/stupidtable.min.js"></script>
<script src="{{ @BASE }}/js/stupidtable.min.js"></script>
<script type="text/javascript">
$(function() {
setTimeout(function() {
@@ -371,9 +371,12 @@ <h4 class="modal-title" id="modal-copy-label">{{ @dict.copy_issue }}</h4>
</div>
</div>

<script src="{{ @BASE }}/minify/js/bootstrap-datepicker.js,stupidtable.min.js,typeahead.jquery.js,autosize.min.js"></script>
<check if="{{ @user_obj->date_picker()->js }}">
<script src="{{ @BASE }}/minify/js/bootstrap-datepicker.{{ @user_obj->date_picker()->language }}.js"></script>
<script src="{{ @BASE }}/js/bootstrap-datepicker.js"></script>
<script src="{{ @BASE }}/js/stupidtable.min.js"></script>
<script src="{{ @BASE }}/js/typeahead.jquery.js"></script>
<script src="{{ @BASE }}/js/autosize.min.js"></script>
<check if="{{ @user_obj->date_picker()->js && @user_obj->date_picker()->language != 'en-US' }}">
<script src="{{ @BASE }}/js/bootstrap-datepicker.{{ @user_obj->date_picker()->language }}.js"></script>
</check>
<check if="{{ @parse.markdown && !@user_obj->option('disable_mde') }}">
<script src="{{ @BASE }}/js/simplemde.min.js"></script>
@@ -60,7 +60,7 @@ <h1>{{ @dict.issue_tags }}</h1>
</div>
</div>
<include href="blocks/footer.html" />
<script src="{{ @BASE }}/minify/js/stupidtable.min.js"></script>
<script src="{{ @BASE }}/js/stupidtable.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('.table').stupidtable();
@@ -2,7 +2,7 @@
<html lang="{{ @LANGUAGE }}">
<head>
<include href="blocks/head.html" />
<link rel="stylesheet" href="{{ @BASE }}/minify/css/taskboard.css">
<link rel="stylesheet" href="{{ @BASE }}/css/taskboard.css">
<set columnwidth="160" />
<check if="{{ !empty(@taskboard[0]) }}">
<style type="text/css">
@@ -361,9 +361,11 @@ <h4 class="modal-title">{{ @dict.burndown }}</h4>
</div>
</check>

<script src="{{ @BASE }}/minify/js/jquery-ui-dragsort.min.js,jquery.ui.touch-punch.min.js,bootstrap-datepicker.js"></script>
<check if="{{ @user_obj->date_picker()->js }}">
<script src="{{ @BASE }}/minify/js/bootstrap-datepicker.{{ @user_obj->date_picker()->language }}.js"></script>
<script src="{{ @BASE }}/js/jquery-ui-dragsort.min.js"></script>
<script src="{{ @BASE }}/js/jquery.ui.touch-punch.min.js"></script>
<script src="{{ @BASE }}/js/bootstrap-datepicker.js"></script>
<check if="{{ @user_obj->date_picker()->js && @user_obj->date_picker()->language != 'en-US' }}">
<script src="{{ @BASE }}/js/bootstrap-datepicker.{{ @user_obj->date_picker()->language }}.js"></script>
</check>
<script>
var datepickerLanguage='{{ @user_obj->date_picker()->language }}';
@@ -399,7 +401,8 @@ <h4 class="modal-title">{{ @dict.burndown }}</h4>
};
</script>
<script src="{{ @BASE }}/js/chart.js"></script>
<script src="{{ @BASE }}/minify/js/taskboard.js,burndown.js"></script>
<script src="{{ @BASE }}/js/taskboard.js"></script>
<script src="{{ @BASE }}/js/burndown.js"></script>
<script>
$(document).ready(function() {
$("#burndown-modal").on("shown.bs.modal", function(e) {
@@ -427,7 +430,7 @@ <h4 class="modal-title">{{ @dict.burndown }}</h4>
</script>
</true>
<false>
<script src="{{ @BASE }}/minify/js/taskboard.js"></script>
<script src="{{ @BASE }}/js/taskboard.js"></script>
</false>
</check>
</body>
@@ -36,7 +36,8 @@
</div>

<include href="blocks/footer.html" />
<script src="{{ @BASE }}/minify/js/jquery-ui-dragsort.min.js,jquery.ui.touch-punch.min.js"></script>
<script src="{{ @BASE }}/js/jquery-ui-dragsort.min.js"></script>
<script src="{{ @BASE }}/js/jquery.ui.touch-punch.min.js"></script>

<include href="user/dashboard-widget-modal.html" />
</div>
@@ -90,7 +90,12 @@

// Minify static resources
// Cache for 1 week
// This route is deprecated, and will be removed in a future release.
$f3->route("GET /minify/@type/@files", function (Base $f3, $args) {
if (!in_array($args['type'], ['js', 'css'])) {
$f3->abort(404);
return;
}
$f3->set("UI", $args["type"] . "/");
echo Web::instance()->minify($args["files"]);
}, $f3->get("cache_expire.minify"));
@@ -100,7 +100,6 @@ $(function() {
});

// Show Mac hotkeys on Macs
// TODO: remap
if(navigator.platform.indexOf('Mac') >= 0) {
var $modalBody = $('#modal-hotkeys .modal-body');
$modalBody.html($modalBody.html().replace(/alt\+/g, '&#8997;').replace(/ctrl\+/g, '&#8984;').replace(/enter/g, '&#8617;').replace(/shift\+/g, '&#8679;'));

0 comments on commit aba8b22

Please sign in to comment.
You can’t perform that action at this time.