Switch to minifier
This commit is contained in:
parent
e42349bc74
commit
30ac7817cf
10 changed files with 4119 additions and 14 deletions
|
@ -1,3 +0,0 @@
|
||||||
import AccountManager from "./kpsul/managers/account_manager.js"
|
|
||||||
|
|
||||||
self.account_manager = new AccountManager();
|
|
1
kfet/static/kfet/js/kpsul.min.js
vendored
Normal file
1
kfet/static/kfet/js/kpsul.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
25
kfet/static/kfet/src/kpsul/Makefile
Normal file
25
kfet/static/kfet/src/kpsul/Makefile
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
# Compilation des fichiers .js de K-Psul en une version minifiée
|
||||||
|
|
||||||
|
LIBS = libs/underscore.js libs/backbone.js
|
||||||
|
MODELS = $(wildcard models/**.js)
|
||||||
|
MANAGERS = $(wildcard managers/**.js)
|
||||||
|
ENTRYPOINT = kpsul.js
|
||||||
|
|
||||||
|
CONCAT_FILE = kpsul.src.js
|
||||||
|
TARGET = ../../js/kpsul.min.js
|
||||||
|
|
||||||
|
FLAGS =
|
||||||
|
|
||||||
|
|
||||||
|
build: concat minify
|
||||||
|
# For dev use : we don't minify
|
||||||
|
dev: concat cp
|
||||||
|
|
||||||
|
concat:
|
||||||
|
@cat $(LIBS) $(MODELS) $(MANAGERS) $(ENTRYPOINT) > $(CONCAT_FILE)
|
||||||
|
|
||||||
|
cp:
|
||||||
|
@cp $(CONCAT_FILE) $(TARGET)
|
||||||
|
|
||||||
|
minify:
|
||||||
|
terser $(CONCAT_FILE) -o $(TARGET) $(FLAGS)
|
3
kfet/static/kfet/src/kpsul/kpsul.js
Normal file
3
kfet/static/kfet/src/kpsul/kpsul.js
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
$(function () {
|
||||||
|
self.account_manager = new AccountManager();
|
||||||
|
})
|
4087
kfet/static/kfet/src/kpsul/kpsul.src.js
Normal file
4087
kfet/static/kfet/src/kpsul/kpsul.src.js
Normal file
File diff suppressed because it is too large
Load diff
|
@ -1,5 +1,3 @@
|
||||||
import Account from "../models/account.js"
|
|
||||||
|
|
||||||
class AccountManager {
|
class AccountManager {
|
||||||
// Classe pour gérer la partie "compte" de K-Psul
|
// Classe pour gérer la partie "compte" de K-Psul
|
||||||
// Devrait être la seule interface entre le JS de K-Psul et la logique des comptes.
|
// Devrait être la seule interface entre le JS de K-Psul et la logique des comptes.
|
||||||
|
@ -143,7 +141,7 @@ class AccountSearch {
|
||||||
var choice_text = choice.text().trim();
|
var choice_text = choice.text().trim();
|
||||||
var trigramme_regex = /\((.{3})\)$/;
|
var trigramme_regex = /\((.{3})\)$/;
|
||||||
// le match est de la forme [<global match>, <group match>]
|
// le match est de la forme [<global match>, <group match>]
|
||||||
trigramme = choice_text.match(trigramme_regex)[1]
|
var trigramme = choice_text.match(trigramme_regex)[1]
|
||||||
this.manager.set(trigramme);
|
this.manager.set(trigramme);
|
||||||
this.close();
|
this.close();
|
||||||
}
|
}
|
||||||
|
@ -153,6 +151,4 @@ class AccountSearch {
|
||||||
this._$dialog.close();
|
this._$dialog.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default AccountManager;
|
|
|
@ -144,5 +144,3 @@ var EmptyAccountView = AccountView.extend({
|
||||||
return buttons
|
return buttons
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
export default Account;
|
|
|
@ -7,9 +7,7 @@
|
||||||
<script type="text/javascript" src="{% static 'kfet/vendor/moment/moment-timezone-with-data-2012-2022.min.js' %}"></script>
|
<script type="text/javascript" src="{% static 'kfet/vendor/moment/moment-timezone-with-data-2012-2022.min.js' %}"></script>
|
||||||
<script type="text/javascript" src="{% static 'kfet/js/history.js' %}"></script>
|
<script type="text/javascript" src="{% static 'kfet/js/history.js' %}"></script>
|
||||||
<script type="text/javascript" src="{% url 'js_reverse' %}" ></script>
|
<script type="text/javascript" src="{% url 'js_reverse' %}" ></script>
|
||||||
<script type="text/javascript" src="{% static 'kfet/vendor/underscore-min.js' %}"></script>
|
<script type="text/javascript" src="{% static 'kfet/js/kpsul.min.js' %}"></script>
|
||||||
<script type="text/javascript" src="{% static 'kfet/vendor/backbone-min.js' %}"></script>
|
|
||||||
<script type="module" src="{% static 'kfet/js/kpsul.js' %}"></script>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block title %}K-Psul{% endblock %}
|
{% block title %}K-Psul{% endblock %}
|
||||||
|
|
Loading…
Reference in a new issue